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:
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:
Reference the sample code to submit a custom metric.
To submit your AWS Lambda logs to Datadog using the Extension, set the env variable
true in your function. Additionally, this generates Datadog’s enhanced metrics.
Additional helpful documentation, links, and articles: