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

# Troubleshoot AWS Lambda Monitoring

{% alert level="info" %}
Check out the additional [troubleshooting guides](https://docs.datadoghq.com/serverless/guide/#troubleshoot-your-installation) for common issues such as the function code size is too large or webpack compatibility. This guide helps you troubleshoot general telemetry collection issues.
{% /alert %}

## Understand the basics{% #understand-the-basics %}

To better understand the instructions from this guide, familiarize yourself with the [key concepts](https://docs.datadoghq.com/serverless/glossary/#datadog-serverless-for-aws-lambda-concepts) first. A better understanding on how things work helps you identify the missing pieces and narrow down probable causes.

## Use the Datadog Lambda Extension instead of the Forwarder{% #use-the-datadog-lambda-extension-instead-of-the-forwarder %}

If you are still using the [Datadog Forwarder Lambda function](https://docs.datadoghq.com/logs/guide/forwarder/) for data collection, consider adopting the [Datadog Lambda Extension](https://docs.datadoghq.com/serverless/libraries_integrations/extension/) instead. Because the technical limitations of the Forwarder Lambda cause a number of known issues, migrating to the Lambda Extension can resolve them automatically.

- If you are unsure whether your Lambda is using the Extension, check your Lambda function's [layer configurations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html) and see if any Lambda layer is named `Datadog-Extension`.

- If you are unsure whether your Lambda is using the Forwarder, check the [subscription filters](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html) of your Lambda function's log group, and see if the log group is subscribed by a Lambda named `Datadog Forwarder` or something similar.

See this [comparison guide](https://docs.datadoghq.com/serverless/guide/extension_motivation/) to understand the benefits of using the Extension and this [migration guide](https://docs.datadoghq.com/serverless/configuration/#migrate-to-the-datadog-lambda-extension) for the general migration steps. Test your changes in a dev or staging environment first!

To continue using the Forwarder, see this [Forwarder troubleshooting guide](https://docs.datadoghq.com/logs/guide/lambda-logs-collection-troubleshooting-guide/) for more help.

{% alert level="info" %}
The Datadog Lambda extension enables log collection by default. If you are migrating from the Forwarder to the extension, ensure that you remove your log subscription. Otherwise, you may see duplicate logs.
{% /alert %}

## Ensure the configurations are up-to-date and expected{% #ensure-the-configurations-are-up-to-date-and-expected %}

Check out the [installation guides](https://docs.datadoghq.com/serverless/installation/) with up-to-date instructions about applications you may have configured for Datadog monitoring in the past.

To ensure the actual changes made to your Lambda functions are expected, try setting up another testing function and configuring it following the instructions for *Datadog CLI* or *Custom*. Compare the changes (such as handler, layers, environment variables, and tags) made on your real Lambda functions against the testing one.

## Collect debugging logs{% #collect-debugging-logs %}

Enable verbose debugging logs by setting the environment variable `DD_LOG_LEVEL` to `debug` on your Lambda functions. If you are using the [Datadog Forwarder Lambda function](https://docs.datadoghq.com/logs/guide/forwarder/) for data forwarding from logs, also set `DD_LOG_LEVEL` to `debug` on the Forwarder Lambda function.

If you have issues with tracing, set the environment variable `DD_TRACE_DEBUG` to `true` for extra debugging logs from the Datadog Tracer.

To avoid unnecessary costs, disable the debugging logs after you collect enough data.

## Check the AWS integration{% #check-the-aws-integration %}

Datadog can collect metrics and resource tags from AWS through an [integration with AWS](https://docs.datadoghq.com/integrations/amazon_web_services/) (optional). If you are missing certain metrics from CloudWatch and Lambda resource tags, ensure that the AWS integration is properly configured.

## Ensure the tags are configured{% #ensure-the-tags-are-configured %}

If you have trouble applying the Datadog standard `service`, `env`, and `version` tags to the collected data, make sure the environment variables `DD_SERVICE`, `DD_ENV`, and `DD_VERSION` are configured on your Lambda functions. For custom tags, ensure `DD_TAGS` is configured.

If you want to enrich the data collected with your AWS Lambda resource tags, make sure the [Datadog integration for AWS](https://docs.datadoghq.com/integrations/amazon_web_services/) is properly configured.

## Get help{% #get-help %}

For quick questions, post in the *#serverless* channel of the [Datadog Slack community](https://chat.datadoghq.com/).

If you have followed all the troubleshooting steps above and want help from [Datadog Support](https://www.datadoghq.com/support/), use one of the following methods to send relevant configuration information to support.

{% tab title="Serverless Flare" %}

1. Create a [Zendesk ticket](https://help.datadoghq.com/hc/en-us/requests/new).

1. Download the latest version of the [Datadog CLI](https://github.com/DataDog/datadog-ci/#how-to-install-the-cli).

   ```sh
   npm install -g @datadog/datadog-ci @datadog/datadog-ci-plugin-lambda
   ```

1. Use the Serverless Flare command from the root of your project directory to automatically collect and submit data about your Lambda function to Datadog Support.

   ```sh
   datadog-ci lambda flare -f <function_arn> -e <email> -c <case_id> --with-logs
   ```

{% alert level="info" %}
For more information about Serverless Flare, read the [command documentation](https://docs.datadoghq.com/serverless/libraries_integrations/cli/#troubleshooting-lambda-instrumentation).
{% /alert %}

{% /tab %}

{% tab title="Manually" %}
Create a [Zendesk ticket](https://help.datadoghq.com/hc/en-us/requests/new), and include the following information in your ticket:

1. Basic information about your Lambda function: ARN, runtime, handler, layers, environment variables, and tags. Focus on one function first if you have the same issue with many.
1. If the Lambda function is configured to send data through logs using the Datadog Forwarder, include basic information about the Forwarder Lambda function. Also, provide the subscription filters configured on your Lambda function's log group.
1. The installation method you followed, such as *Serverless Framework* or *AWS CDK*.
1. The alternative installation method you attempted, such as *Datadog CLI* or *Custom*.
1. Debugging logs from your own Lambda function.
1. Debugging logs from the Datadog Forwarder Lambda function (if used).
1. The project configuration files, with **redacted hardcoded secrets**, such as `serverless.yaml`, `package.json`, `package-lock.json`, `yarn.lock`, `tsconfig.json`, and `webpack.config.json`.

{% /tab %}

## Further Reading{% #further-reading %}

- [Installing Serverless Monitoring](https://docs.datadoghq.com/serverless/installation/)
- [Troubleshoot Common Issues](https://docs.datadoghq.com/serverless/guide/#troubleshoot-your-installation)
