Skip to main content
In this lesson you’ll learn how to inspect traces produced by an instrumented application using AWS X-Ray (accessible from the CloudWatch console). The sample application is already deployed and configured to send traces to X-Ray — this guide focuses on interpreting those traces in the X-Ray console rather than on the instrumentation steps.
To use X-Ray you must instrument your application with the X-Ray SDK or an AWS-supported integration so that traces and segments are sent to the service.
X-Ray uses sampling by default, which means not every request will generate a trace. When troubleshooting, consider adjusting the sampling rules or temporarily disabling sampling to capture more traces. Be mindful of increased storage and cost when changing sampling rates.

Opening X-Ray in CloudWatch

Open the AWS Console and search for “X-Ray” (it appears as its own service and is integrated with CloudWatch). X-Ray provides two primary views that are useful for troubleshooting and performance analysis:

Service Map

The Service Map shows nodes (clients, services, AWS resources) and the edges between them. In the demo below, a client issues requests to a Scorekeep application running in an ECS container. That container interacts with multiple DynamoDB tables and publishes to an SNS topic.
A screenshot of the AWS CloudWatch X-Ray Service Map showing a central ECS container node labeled "Scorekeep" connected to several DynamoDB table nodes (scorekeep-state, scorekeep-session, scorekeep-move) and a Client node. The CloudWatch console navigation pane and toolbar are visible on the left and top.
Tips for using the Service Map:
  • Adjust the timeframe (last 5, 15 minutes, etc.) to focus on recent activity.
  • Click any node to see metrics such as latency, request count and fault rate.
  • Use the node’s “View traces” action to open traces that include that component.

Viewing Traces for a Node

Selecting “View traces” builds a filter query targeting that service. For example, to view traces involving the ScorekeepGame DynamoDB table:
Run the query to list matching traces. The Traces page displays trace IDs, status, timestamps, response codes and durations; click any trace to inspect its segments and timeline.

Inspecting a Trace and Segments

A trace contains segments (one per service, resource, or logical operation). The trace view shows a timeline with the start time and duration of each segment so you can quickly identify which operations contribute most to latency. Example segments timeline (trimmed and reformatted for readability):
Each line shows:
  • Segment name and type
  • Status (e.g., OK, Fault)
  • Response code (HTTP or AWS operation result)
  • Duration (milliseconds)
  • Operation details (HTTP method/URL or API call and resource)
This makes it easy to spot high-latency operations (for example, a long-running UpdateItem or external HTTP call) and to trace the request flow across services.
A screenshot of an AWS X-Ray/CloudWatch Segments Timeline showing DynamoDB and SNS calls with green "OK" status, 200 response codes, and duration columns. Timing bars on the right show individual GetItem, UpdateItem and Publish operations and their millisecond durations.

Common fields shown in the Traces view

Investigating Faults

When a trace contains a fault (e.g., HTTP 500), X-Ray highlights the failing segment and lets you see the call path that led to the error. This helps identify which component failed and which upstream calls preceded it. Example failing calls:
Look for:
  • The first failing segment in the trace timeline.
  • Any related downstream or upstream calls that may have contributed to the fault.
  • Error messages or annotations added by your instrumentation (if available).

Working with All Traces and Building Queries

To view every trace within the selected timeframe, clear the query and run it. You can also build more advanced queries to combine services or to find specific patterns. Useful query examples: Run queries to:
  • Filter traces by service, resource ARN, or status.
  • Inspect response time distributions for a service.
  • Drill into individual traces for segment-level timing and error details.
A screenshot of the AWS CloudWatch "Traces" (X-Ray) console showing a table of recent trace IDs with status (OK), timestamps, response codes and response times. The left sidebar shows CloudWatch navigation items like Alarms, Logs and Metrics.

Summary

AWS X-Ray gives you:
  • A Service Map to visualize application topology and to identify nodes of interest.
  • A Traces view to investigate per-request segment timelines, durations, response codes and faults.
  • A query language to filter traces by service, resource or error conditions.
Key troubleshooting checklist:
  • Instrument your app to send traces to X-Ray.
  • Use the Service Map to find problematic nodes.
  • Inspect Traces and segment timelines to find slow or failing operations.
  • Build queries to focus on specific services or combinations of services.
Links and references Hope this lesson was helpful.

Watch Video