Get started with X-Ray - AWS X-Ray

Get started with X-Ray

To use X-Ray, you must do the following:

  1. Instrument your application, which allows X-Ray to track how your application processes a request.

    • Use the X-Ray SDKs, X-Ray APIs, ADOT or CloudWatch Application Signals to send trace data to X-Ray. For more information about which interface to use, see Choose an interface.

    For more information about instrumentation, see Instrument your application for AWS X-Ray.

  2. (Optional) Configure X-Ray to work with other AWS services that integrate with X-Ray. You can sample traces and add headers to incoming requests, run an agent or collector, and automatically send trace data to X-Ray. For more information, see Integrate AWS X-Ray with other AWS services.

  3. Deploy your instrumented application. As your application receives requests, the X-Ray SDK will record trace, segment and subsegment data. In this step, you might also have to set up an IAM policy and deploy an agent or collector.

    • For example scripts to deploy an application using the AWS Distro for OpenTelemetry (ADOT) SDK and the CloudWatch agent on different platforms, see Application Signals Demo Scripts.

    • For an example script to deploy an application using the X-Ray SDK and the X-Ray daemon, see AWS X-Ray sample application.

  4. (Optional) Open a console to view and analyze the data. You can see a GUI representation of a trace map, service map, and more to inspect how your application functions. Use the graphical information in the console to optimize, debug and understand your application. For more information about choosing a console, see Use an AWS Management Console.

The following diagram shows how to get started using X-Ray:

X-Ray displays detailed information about application requests including status, duration and HTTP response code.

For an example of the data and maps that are available in the console, launch a sample application that is already instrumented to generate trace data. In a few minutes, you can generate traffic, send segments to X-Ray, and view a trace and service map.