AWS X-Ray

The Datadog AWS Lambda X-Ray integration is only supported on commercial AWS accounts. Without a commercial Lambda account, the Datadog AWS Lambda X-Ray integration is not supported on the Datadog for Government site.

Overview

AWS X-Ray lets developers trace distributed applications built using AWS products. This integration provides traces for Lambda functions in the Serverless function detail page. For more information, see Serverless monitoring.

Setup

Installation

First, enable the AWS integration and ensure the following permissions are present in the policy document of your Datadog integration role:

xray:BatchGetTraces,
xray:GetTraceSummaries

The GetTraceSummaries permission is used to get the list of recent traces. BatchGetTraces actually returns the full traces themselves.

Then, enable the X-Ray integration within Datadog.

If you are using a Customer Master Key (CMK) to encrypt traces, add the kms:Decrypt method to your policy where the Resource is the CMK used for X-Ray.

Note: Enabling the AWS X-Ray integration increases the amount of Indexed Spans which can impact your bill.

Enabling AWS X-Ray for your functions

  1. Follow instructions from AWS to enable X-Ray tracing on your Lambda functions and API Gateways.
  2. To get the most out of the AWS X-Ray integration, also install the X-Ray SDK in your Lambda function.

Enrich X-Ray traces with Datadog

Datadog can enrich X-Ray traces with spans and metadata generated by the Datadog APM client, and merge them into a single Datadog trace for the same Lambda invocation.

  1. Install Datadog serverless monitoring on your Lambda functions.
  2. Set the environment variable DD_MERGE_XRAY_TRACES to true on your Lambda functions.

Data Collected

The AWS X-Ray integration pulls in trace data from AWS, and does not collect any metrics or logs.

PREVIEWING: may/unit-testing