AWS X-Ray lets developers trace distributed applications built using AWS products. This integration provides traces for Lambda functions in the function detail page of Cloud Functions. For more information about Cloud Functions, refer to the dedicated documentation.
First, enable the AWS integration and add the following permissions to the policy document in your AWS/Datadog Role:
GetTraceSummaries permission is used to get the list of recent traces.
BatchGetTraces actually returns the full traces themselves.
If you are using a Customer Master Key to encrypt traces, add the
kms:Decrypt method to your policy where the Resource is the Customer Master Key used for X-Ray.
Recommended X-Ray setup:
Navigate to the Lambda function in the AWS console you want to instrument. In the “Debugging and error handling” section, check the box to “Enable active tracing”. This turns on X-Ray for that function.
Import the X-Ray SDK in your function, and patch all supported libraries. This automatically causes X-Ray to trace all AWS calls and other X-Ray supported integrations. See an example of this in Python.
The AWS X-Ray integration pulls in trace data from AWS, and does not collect any metrics or logs.