Skip to main content

AWS X-Ray

What is it

  • a distributed tracing service that helps you analyze and debug applications, especially those built using a microservices or serverless architecture
  • a GPS tracker for every request that enters your system, it follows the request as it travels through various services (like Lambda, API Gateway, or SQS) and databases (like DynamoDB), recording exactly how long each step took and where errors occured
  • visualization:

What problem does it solve?

  • problems are difficult to trace in a multi service setup as compared to monolith

Why is it needed?

  • Root cause analysis
  • Performance Optimization
  • Dependency Mapping
  • Request Proximity

When to use it?

  • microservices or serverless (lambda) system
  • performance is critical
  • troubleshooting intermittent bugs

How to use it?

  • for Lambda or API Gateway, a checkbox in the AWS console
  • for EC2 or ECS , install the X-Ray Daemon / X-Ray Agent
  • integrate the AWS X-Ray SDK in the source code
  • X-Ray agent needs IAM permissions to X-Ray

AWS Observability suite

  • Works with Amazon CloudWatch, CloudWatch ServiceLens, AWS App Mesh, AWS Distro for OpenTelemtry (ADOT)