Instrumenting Lambda Functions
Note
The following steps must be completed for each Lambda functions that should be instrumented.
1. Verify Datadog prerequisites
Before enrolling AWS services such as ECS Fargate or Lambda functions in Datadog, the following must already be configured:
- Datadog AWS Integration
- Datadog Log Forwarder
- AWS IAM policies related to Datadog and API keys
These steps only need to be completed once per AWS account that will be enrolled in Datadog.
Contact Team Cloud to verify that this setup has already been completed.
2. Locate the Terraform code for the lambda
Find the Terraform configuration that manages the Lambda function for your product.
Example:
BYM-IKT/InntauingInfrastrukturMain/BYM-DP-Inntauing-Prod/prod/eu-west-1/inntauing/main.tf
3. Enable observability in Terraform
Set enable_observability to true for the Lambda function configuration.
| main.tf | |
|---|---|
4. Instrument the Application Code
Instrument the application so it emits traces, metrics, and logs.
Reference implementations:
- .NET – datadog-dotnet-poc