If your Go Lambda functions are still using runtime go1.x and you cannot migrate to the provided.al2 runtime, you must instrument using the Datadog Forwarder. Otherwise, follow the instructions in this guide to instrument using the Datadog Lambda Extension.
If your Lambda functions are deployed in a VPC without access to the public internet, you can send data either using AWS PrivateLink for the datadoghq.comDatadog site, or using a proxy for all other sites.
Version 67+ of the Datadog Lambda Extension uses an optimized version of the extension. Read more.
Replace <DATADOG_SITE> with your Datadog site to send the telemetry to.
Replace <DATADOG_API_KEY_SECRET_ARN> with the ARN of the AWS secret where your Datadog API key is securely stored. The key needs to be stored as a plaintext string (not a JSON blob). The secretsmanager:GetSecretValue permission is required. For quick testing, you can instead use apiKey and set the Datadog API key in plaintext.
Replace <TAG> with either a specific version number (for example, 75) or with latest. Alpine is also supported with specific version numbers (such as 75-alpine) or with latest-alpine. You can see a complete list of possible tags in the Amazon ECR repository.
Set the required environment variables
Set DD_SITE to datadoghq.com (ensure the correct SITE is selected on the right).
Set DD_API_KEY_SECRET_ARN to the ARN of the AWS secret where your Datadog API key is securely stored. The key needs to be stored as a plaintext string (not a JSON blob). The secretsmanager:GetSecretValue permission is required. For quick testing, you can use DD_API_KEY instead and set the Datadog API key in plaintext.
Optionally set DD_UNIVERSAL_INSTRUMENTATION: true to take advantage of advanced configurations such as capturing the Lambda request and response payloads and inferring APM spans from incoming Lambda events.
Add the Lambda layer of Datadog Lambda Extension to your Lambda functions, using the ARN format based on your AWS region and architecture:
# Use this format for x86-based Lambda deployed in AWS commercial regionsarn:aws:lambda:<AWS_REGION>:464622532012:layer:Datadog-Extension:75
# Use this format for arm64-based Lambda deployed in AWS commercial regionsarn:aws:lambda:<AWS_REGION>:464622532012:layer:Datadog-Extension-ARM:75
# Use this format for x86-based Lambda deployed in AWS GovCloud regionsarn:aws-us-gov:lambda:<AWS_REGION>:002406178527:layer:Datadog-Extension:75
# Use this format for arm64-based Lambda deployed in AWS GovCloud regionsarn:aws-us-gov:lambda:<AWS_REGION>:002406178527:layer:Datadog-Extension-ARM:75
Replace <AWS_REGION> with a valid AWS region, such as us-east-1.
Set DD_SITE to datadoghq.com (ensure the correct SITE is selected on the right).
Set DD_API_KEY_SECRET_ARN to the ARN of the AWS secret where your Datadog API key is securely stored. The key needs to be stored as a plaintext string (not a JSON blob). The secretsmanager:GetSecretValue permission is required. For quick testing, you can use DD_API_KEY instead and set the Datadog API key in plaintext.
Version 67+ of the Datadog Extension is optimized to significantly reduce cold start duration.
To use the optimized extension, disable Application Security Management (ASM), Continuous Profiler for Lambda, and OpenTelemetry based tracing. Set the following environment variables to false:
DD_TRACE_OTEL_ENABLED
DD_PROFILING_ENABLED
DD_SERVERLESS_APPSEC_ENABLED
Enabling any of these features cause the extension to default back to the fully compatible older version of the extension. You can also force your extension to use the older version by setting DD_EXTENSION_VERSION to compatibility. Datadog encourages you to report any feedback or bugs by adding an issue on GitHub and tagging your issue with version/next.