Created
July 21, 2019 02:19
-
-
Save jordan-chalupka/d412ae8992dce6377b3df218137361ac to your computer and use it in GitHub Desktop.
Datadog lambda example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datadog import datadog_lambda_wrapper, statsd | |
import time | |
@datadog_lambda_wrapper | |
def lambda_handler(event, context): | |
x = event['x'] | |
y = event['y'] | |
z = event['z'] | |
start_time = time.time() | |
result = perform_complex_calculation(x, y, z) | |
duration = time.time() - start_time | |
statsd.distribution('complex_calculation_duration', duration) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment