Skill 4.2.3
Configuring AWS X-Ray for different services (for example, containers, Amazon API Gateway, Lambda)
Key Concepts
Lambda and API Gateway have an active tracing setting; the function's role needs X-Ray write permissions (AWSXRayDaemonWriteAccess). Application code uses the X-Ray SDK or AWS Distro for OpenTelemetry to create subsegments for downstream calls and add annotations (indexed, filterable) and metadata.
On EC2, run the X-Ray daemon or CloudWatch agent with the instance profile allowing X-Ray writes. On ECS and EKS, run the daemon or ADOT collector as a sidecar container (or DaemonSet) listening on UDP 2000, with the task role or pod role granting permissions. Sampling rules control how many requests are traced.