[AWS] X-Ray

X-Ray traces applications and helps to identify potential problems or optimizations in the applications. It provides a visualization of your application’s underlying components.


The X-Ray Service Map provides an end-to-end view of requests as they travel through your application. It allows you to troubleshoot the root cause of connection/performance issues and errors.

  • Segments: data about the work done by application (request, response, issues …)
  • Subsegments: A more granular view of data inside of segments
  • Service Graph: A JSON document of how the application’s services and resources interact (visualized)
  • Traces: At first, HTTP trace ID header -> and propagates downstream to track through the system

X-Ray can track application errors

  • Errors (Client error – 400), Fault (Server error – 500), Throttle (429 Too many requests)

X-Ray Architecture

  • The X-Ray agent must be installed on your EC2 instance.
  • Configure your applications using the X-Ray SDK
    • The X-Ray SDK gathers information from request and response headers, the code in your application, and metadata about the AWS resources on which it runs, and sends this trace data to X-Ray. e.g. incoming HTTP requests, error codes, latency data.


X-Ray integrates with AWS Services or custom applications.

  • AWS Services: EC2, Lambda, Elastic Beanstalk, SNS, SQS, DynamoDB, Elastic Load Balancer, Elastic Container Service, and API Gateway.
  • Custom Application: applications written in .NET, Java, Node.js, Go, Ruby, or Python.
  • The X-Ray SDK automatically captures metadata for API calls made to AWS services using the AWS SDK.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s