---
title: Deployment Tracking for AWS Lambda Serverless Applications
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Serverless > Serverless Monitoring for AWS Lambda > Deployment Tracking
  for AWS Lambda Serverless Applications
---

# 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{% #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](https://app.datadoghq.com/functions) to open a side panel, and click the **Deployments** tab.

### Setup{% #setup %}

1. If you haven't already, set up the [Amazon Web Services](https://docs.datadoghq.com/integrations/amazon_web_services/#setup) integration.

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

   ```text
   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](https://app.datadoghq.com/integrations/amazon-lambda).

{% image
   source="https://datadog-docs.imgix.net/images/serverless/lambda_integration_settings.34205d52409fdfbd1116ba01ad643628.png?auto=format"
   alt="Lambda Integration Settings" /%}

## Resource Changes{% #resource-changes %}

{% alert level="info" %}
Resource Changes is in Preview. Enabling resource collection can impact your AWS CloudWatch costs.
{% /alert %}

You can use [Resource Changes](https://docs.datadoghq.com/infrastructure/resource_catalog/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](https://app.datadoghq.com/integrations/amazon-web-services) in Datadog.
1. Select your AWS account and navigate to the **Resource Collection** tab.
1. Toggle **Enable Resource Collection**.

See the [Resource Changes](https://docs.datadoghq.com/infrastructure/resource_catalog/resource_changes/) documentation for more information.

## Tag telemetry with deployment information{% #tag-telemetry-with-deployment-information %}

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

{% image
   source="https://datadog-docs.imgix.net/images/serverless/metrics_grouped_by_git_commit.f148b7e915d627993104238a29536dfe.png?auto=format"
   alt="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](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) 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{% #further-reading %}

- [Distributed Tracing for Serverless](https://docs.datadoghq.com/serverless/distributed_tracing)
- [Serverless Tagging](https://docs.datadoghq.com/serverless/serverless_tagging)
