Question
What is an X-Ray trace?
Click to reveal answer
Answer
An end-to-end path of a request across services. Composed of segments (one per service) and subsegments (downstream calls).
Click to flip back
All X-Ray Flashcards
Q: What is an X-Ray trace?
A: An end-to-end path of a request across services. Composed of segments (one per service) and subsegments (downstream calls).
Q: Annotations vs metadata?
A: Annotations are indexed key-value pairs for filtering/searching traces. Metadata is non-indexed data for debugging. Both attach to segments/subsegments.
Q: What is the X-Ray daemon?
A: A process that listens on UDP port 2000, collects trace segments, and sends them to the X-Ray API. Required on EC2/ECS. Not needed for Lambda.
Q: What is the default X-Ray sampling rule?
A: 1 request per second (reservoir) + 5% of additional requests (rate). Custom rules can override per service or URL path.
Q: How do you enable X-Ray in Lambda?
A: Enable Active Tracing in the function configuration. Lambda runs the X-Ray daemon automatically. Add the SDK for custom subsegments.
Q: What does an X-Ray service map show?
A: A visual topology of traced services showing connections, latency, error rates, and throughput between components.
Q: How does X-Ray trace propagation work?
A: The X-Amzn-Trace-Id header carries the trace ID, parent segment ID, and sampling decision across service boundaries.
Q: What is an X-Ray subsegment?
A: Records downstream calls from a service (e.g., DynamoDB query, HTTP call, SQL query). Shows timing, errors, and request details.
Q: How do you instrument a Node.js app with X-Ray?
A: Use aws-xray-sdk-core. Wrap the AWS SDK with AWSXRay.captureAWS(). Use captureHTTPs() for HTTP calls. Segments auto-created for Lambda.
Q: What are X-Ray groups?
A: Named collections of traces filtered by a filter expression. Useful for organizing traces by application, environment, or error type.