ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Service · Developer Tools

AWS X-Ray

Traces each request as it travels through an application, to show where it slows down or fails.

Users
API GatewayLambdaDynamoDB
X-Ray
Trace map of the app
  1. 1A user’s request arrives at Amazon API Gateway, which gives it a trace ID.
  2. 2As the request moves through Lambda and on to DynamoDB, API Gateway and Lambda send timing data to X-Ray.
  3. 3X-Ray joins the data into one trace per request and draws a trace map, which you view in the CloudWatch console.
Each part of the application sends timing data to X-Ray, which draws a trace map.

Step by step

  1. 1A user’s request arrives at Amazon API Gateway, which gives it a trace ID.
  2. 2As the request moves through Lambda and on to DynamoDB, API Gateway and Lambda send timing data to X-Ray.
  3. 3X-Ray joins the data into one trace per request and draws a trace map, which you view in the CloudWatch console.

Each part of the application sends timing data to X-Ray, which draws a trace map.

  • X-Ray

    Answers the question
    Where does this request slow down or fail?
    Example
    Checkout takes five seconds, and the trace shows four are spent in one database call
  • CloudWatch

    Answers the question
    How are my resources and applications doing?
    Example
    An alarm when CPU use stays above 80% for ten minutes
  • CloudTrail

    Answers the question
    Who did what in my AWS account, and when?
    Example
    Finding out who deleted a security group
Three services that watch your account and applications, and the question each one answers.

1 / 2

  • X-Ray

    Answers the question
    Where does this request slow down or fail?
    Example
    Checkout takes five seconds, and the trace shows four are spent in one database call
  • CloudWatch

    Answers the question
    How are my resources and applications doing?
    Example
    An alarm when CPU use stays above 80% for ten minutes

2 / 2

  • CloudTrail

    Answers the question
    Who did what in my AWS account, and when?
    Example
    Finding out who deleted a security group
Three services that watch your account and applications, and the question each one answers.

What it is

A modern application is made of many parts, such as an API, functions, containers and databases. When a request is slow or fails, it is hard to tell which part is to blame. AWS X-Ray follows each request through every part and records how long each step took and where errors happened. This is called distributed tracing.

X-Ray joins this data into one trace per request and draws a trace map of the whole application. The map shows each component, how the components connect, and which ones are slow or returning errors. You can view traces and the map in the Amazon CloudWatch console.

What it is

Services such as AWS Lambda and Amazon API Gateway can send trace data when you turn tracing on. For your own code, AWS now recommends the open-source OpenTelemetry tools to send the data.

Remember

  • Distributed tracing: follow one request across many services.
  • The trace map shows how components connect, and which ones are slow or failing.
  • It helps developers find bottlenecks and errors, and improve performance.
  • Works with Lambda, API Gateway, and applications on Amazon EC2 or in containers.

Remember

  • CloudWatch shows how a whole system is doing. X-Ray shows the path of each request.

On the exam

  • “Trace requests through a microservices application to find performance bottlenecks” points to AWS X-Ray.
  • “Who made this API call in the account” points to AWS CloudTrail. “An alarm on CPU use” points to Amazon CloudWatch.