What is AWS X-Ray?
A service used to analyze and debug distributed applications, providing a visual map of the application’s components and the flow of requests.
What are the three main components of X-Ray?
What is the primary role of the X-Ray SDK?
To instrument your application code, generate trace data (segments), and provide easy-to-use middleware for common frameworks.
What is the primary role of the X-Ray Daemon?
A software agent that listens for UDP traffic, buffers raw segment data, and relays it to the X-Ray API.
It must be run on your compute resource (e.g., EC2, ECS, Lambda).
What is a “Segment” in X-Ray?
A unit of work recorded by a single component (e.g., a single EC2 instance, a Lambda function) containing details about the request, work done, and downstream calls.
What is a “Trace” in X-Ray?
The complete path of a request as it travels through your entire application (combining multiple segments into one logical unit).
What is “Sampling” in X-Ray, and why is it used?
The process of deciding which requests to record to manage costs and data volume.
What is X-Ray’s default sampling rule?
Record the first request each second and 5% of any additional requests.
When X-Ray integrates with an API Gateway endpoint or Lambda function, where is the Daemon component run?
AWS manages the Daemon component for you in these serverless services; you only need to use the X-Ray SDK.
Which visualization tool should you use to see the connections, latency, and errors between services?
The X-Ray Service Map.
How can you ensure X-Ray data is sent even if your service encounters an error?
Configure the X-Ray Daemon/SDK to use an appropriate logging level and ensure the segment is sent before the application terminates.
In X-Ray, what is the key difference between Annotations and Metadata?
Searchability
Annotations CAN be searched on
Metadata CANNOT
A developer wants to use AWS X-Ray to monitor a Lambda function invoked by an SQS queue. Where must the developer explicitly ensure tracing is activated to see the full trace from SQS to Lambda?
In the Event Source Mapping configuration for SQS and Lambda