AWS Lambda Extensions are companion processes that augment your Lambda functions. They run within the Lambda execution environment, alongside your Lambda function code. The Datadog Extension is a lightweight version of the Datadog agent built to run alongside your code with minimal performance overhead.
The Datadog Extension supports submitting custom metrics and logs synchronously while your AWS Lambda function executes. This means that you can submit some of your telemetry data without the Datadog Forwarder. Note: The Datadog Forwarder is still required to submit traces to Datadog.
The Datadog Extension is distributed as its own Lambda Layer (separate from the Datadog Lambda Library) and supports Node.js and Python runtimes.
Add the Lambda Layer for the Datadog Extension to your AWS Lambda function:
arn:aws:lambda:<AWS_REGION>:464622532012:layer:Datadog-Extension:5
Replace the placeholder AWS_REGION
in the Lambda Layer ARN with appropriate values.
If you are using Node.js or Python, add the Lambda Layer for the Datadog Library to your AWS Lambda function:
arn:aws:lambda:<AWS_REGION>:464622532012:layer:Datadog-<RUNTIME>:<VERSION>
The available RUNTIME
options are Node10-x
, Node12-x
, Python37
, and Python38
. For VERSION
, see the latest release for Node.js or Python.
Reference the sample code to submit a custom metric.
To submit your AWS Lambda logs to Datadog using the Extension, set the env variable DD_LOGS_ENABLED
to true
in your function. Additionally, this generates Datadog’s enhanced metrics.
Additional helpful documentation, links, and articles: