Skill 4.2.6
Implement tracing by using AWS services and tools
Key Concepts
For Lambda, enable active tracing; for API Gateway, enable X-Ray tracing on the stage; Step Functions, SNS, SQS and EventBridge also propagate trace context. To trace calls your code makes, instrument the AWS SDK and HTTP clients with AWS Distro for OpenTelemetry (ADOT), Powertools Tracer or the X-Ray SDK, which create subsegments for each downstream call. The X-Ray SDKs and daemon entered maintenance mode in February 2026, so AWS recommends OpenTelemetry for new instrumentation.
On EC2, ECS and on-premises servers, run the X-Ray daemon or the ADOT collector (as a sidecar container on ECS) to send trace data, and give the role xray:PutTraceSegments and xray:PutTelemetryRecords. Sampling rules control volume and cost, and trace context passes between services in the X-Amzn-Trace-Id header.