The AWS X-Ray Console
The AWS X-Ray console lets you view service maps and traces for requests that your applications serve.
The console's service map is a visual representation of the JSON service graph that X-Ray generates from the trace data generated by your applications. The map consists of service nodes for each application in your account that serves requests, upstream client nodes that represent the origins of the requests, and downstream service nodes that represent web services and resources used by an application while processing a request.
You can use filters to view a service map or traces for a specific request, a service, a connection between two services (an edge), or requests that satisfy a condition. X-Ray provides a filter expression language for filtering requests, services, and edges based on data in request headers, response status, and indexed fields on the original segments.
Viewing the Service Map
View the service map in the X-Ray console to identify services where errors are occurring, connections with high latency, or traces for requests that were unsuccessful.
To view the service map
Open the service map page of the X-Ray console.
Choose a service node to view traces for that node, or an edge between two nodes to view traces for requests that travelled that connection.
The service map indicates the health of each node by coloring it based on the ratio of successful calls to errors and faults.
Green for successful calls.
Red for server faults (500 series errors).
Yellow for client errors (400 series errors).
Purple for throttling errors (429 Too Many Requests).
Use the trace list in the X-Ray console to find traces by URL, response code, or other data from the trace summary.
To use the trace list
Open the traces page of the X-Ray console.
Choose a URL to filter the list of traces.
Choose a trace ID to view the timeline for a trace.
The timeline view shows a hierarchy of segments and subsegments. The first entry in the list is the segment, which represents all data recorded by the service for a single request.
Below the segment are subsegments. This example shows subsegments recorded by instrumented DynamoDB clients, and a custom subsegment.
The X-Ray SDK records subsegments automatically when you use an instrumented AWS SDK, HTTP, or SQL client to make calls to external resources. You can also tell the SDK to record custom subsegments for any function or block of code. Additional subsegments recorded while a custom subsegment is open become children of the custom subsegment.
Choose the name of a segment or subsegment to view additional data. The Overview of a segment shows information about the request and response.
The Resources tab for a segment shows information about the AWS resources running your application, and the X-Ray SDK. Use the Amazon EC2, Elastic Beanstalk, or Amazon ECS plugin for the SDK to record service specific resource information.
The remaining tabs show Annotations, Metadata, and Exceptions recorded on the segment. Exceptions are captured automatically when thrown from an instrumented request. Annotations and metadata contain additional information that you record using the methods provided by the SDK.
For subsegments generated with instrumented clients, the Overview contains information about the request and response from your application's point of view. This example shows a subsegment from an instrumented call to DynamoDB.
The Resources tab for this subsegment shows details about the DynamoDB table, the operation called, and the request ID.
For custom subsegments, the Overview shows the name of the subsegment, which you can set to specify the area of code or function that it records.
Custom subsegments let you organize subsegments from instrumented clients into groups. You can also record metadata and annotations on subsegments, which can help when debugging functions.
In this example, the application records the state of each
Game object that
it saves to DynamoDB, simply by passing the object into the
putMetadata method on
the subsegment. The X-Ray SDK takes care of serializing the object into JSON and adding it to
the segment document.