Skip to content

Instantly share code, notes, and snippets.

@jordan-chalupka
Created July 21, 2019 02:19
Show Gist options
  • Save jordan-chalupka/d412ae8992dce6377b3df218137361ac to your computer and use it in GitHub Desktop.
Save jordan-chalupka/d412ae8992dce6377b3df218137361ac to your computer and use it in GitHub Desktop.
Datadog lambda example
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