Integrating Amazon X-Ray with other Amazon Web Services - Amazon X-Ray
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Integrating Amazon X-Ray with other Amazon Web Services

Many Amazon Web Services provide varying levels of X-Ray integration, including sampling and adding headers to incoming requests, running the X-Ray daemon, and automatically sending trace data to X-Ray. Integration with X-Ray can include the following:

  • Active instrumentation – Samples and instruments incoming requests

  • Passive instrumentation – Instruments requests that have been sampled by another service

  • Request tracing – Adds a tracing header to all incoming requests and propagates it downstream

  • Tooling – Runs the X-Ray daemon to receive segments from the X-Ray SDK


The X-Ray SDKs include plugins for additional integration with Amazon Web Services. For example, you can use the X-Ray SDK for Java Elastic Beanstalk plugin to add information about the Elastic Beanstalk environment that runs your application, including the environment name and ID.

Here are some examples of Amazon Web Services that are integrated with X-Ray:

  • Amazon Distro for OpenTelemetry (ADOT) – With ADOT, engineers can instrument their applications once and send correlated metrics and traces to multiple Amazon monitoring solutions including Amazon CloudWatch, Amazon X-Ray, Amazon OpenSearch Service, and Amazon Managed Service for Prometheus.

  • Amazon Lambda – Active and passive instrumentation of incoming requests on all runtimes. Amazon Lambda adds two nodes to your trace map, one for the Amazon Lambda service, and one for the function. When you enable instrumentation, Amazon Lambda also runs the X-Ray daemon on Java and Node.js runtimes for use with the X-Ray SDK.

  • Amazon API Gateway – Active and passive instrumentation. API Gateway uses sampling rules to determine which requests to record, and adds a node for the gateway stage to your service map.

  • Amazon Elastic Beanstalk – Tooling. Elastic Beanstalk includes the X-Ray daemon on the following platforms:

    • Java SE – 2.3.0 and later configurations

    • Tomcat – 2.4.0 and later configurations

    • Node.js – 3.2.0 and later configurations

    • Windows Server – All configurations other than Windows Server Core that have been released after December 9th, 2016

    You can use the Elastic Beanstalk console to tell Elastic Beanstalk to run the daemon on these platforms, or use the XRayEnabled option in the aws:elasticbeanstalk:xray namespace.

  • Elastic Load Balancing – Request tracing on Application Load Balancers. The Application Load Balancer adds the trace ID to the request header before sending it to a target group.

  • Amazon EventBridge – Passive instrumentation. If a service that publishes events to EventBridge is instrumented with the X-Ray SDK, event targets will receive the tracing header and can continue to propagate the original trace ID.

  • Amazon Simple Notification Service – Passive instrumentation. If an Amazon SNS publisher traces its client with the X-Ray SDK, subscribers can retrieve the tracing header and continue to propagate the original trace from the publisher with the same trace ID.

  • Amazon Simple Queue Service – Passive instrumentation. If a service traces requests by using the X-Ray SDK, Amazon SQS can send the tracing header and continue to propagate the original trace from the sender to the consumer with a consistent trace ID.

Choose from the following topics to explore the full set of integrated Amazon Web Services.