Deployment Tracking for AWS Lambda Serverless Applications

Deployment tracking helps you to understand when a new version of code or a configuration change causes a spike in errors, degraded performance, or when your cloud environment drifts from its expected state.

Deployment Events

Datadog collects code and configuration change events for your AWS Lambda functions from AWS CloudTrail.

To see deployment events for your serverless applications, select a function in the Serverless view to open a side panel, and click the Deployments tab.

Setup

  1. If you haven’t already, set up the Amazon Web Services integration.

  2. Add the following permission to the policy document for your AWS/Datadog role:

    cloudtrail:LookupEvents
    

If you have already added the permission, but you still don’t see events for any of your AWS Lambda functions, enable Deployment Tracking using the AWS Lambda integration tile.

Lambda Integration Settings

Resource Changes

Resource Changes is in Preview. Enabling resource collection can impact your AWS CloudWatch costs.

You can use Resource Changes for visibility and control over configuration changes to your AWS Lambda functions. To enable Resource Changes, enable resource collection in the Datadog-AWS integration:

  1. Navigate to the Amazon Web Services integration tile in Datadog.
  2. Select your AWS account and navigate to the Resource Collection tab.
  3. Toggle Enable Resource Collection.

See the Resource Changes documentation for more information.

Tag telemetry with deployment information

Datadog can group your metrics by tags such as git.commit.sha to correlate code changes with issues.

Metrics Grouped By Git Commit

Depending on your configuration, the Datadog Lambda Extension adds the following tags to your metrics, logs, and traces:

  • executed_version: The AWS Lambda function version that was executed. This tag is added by the Datadog Lambda Extension when you enable AWS Lambda versioning for your function. To use this feature, you must publish versions of your Lambda function and configure aliases or direct invocations to use specific versions.
  • version: The deployment version tag set through the DD_VERSION Lambda environment variable. If you have this as an environment variable, it is added as a tag by the Datadog Lambda Extension.
  • git.commit.sha: The Git commit hash associated with the deployed code. This must be included in the DD_TAGS Lambda environment variable (for example, DD_TAGS=git.commit.sha:abc123def456). If you deploy your Lambda function using Datadog’s CI or CDK construct, this tag is automatically added to the DD_TAGS environment variable during deployment. Otherwise, you must add it to DD_TAGS yourself.

Further Reading

Additional helpful documentation, links, and articles: