Explain it simpler
Imagine following one package as it travels through a delivery network. At each stop, a worker scans it and notes when it arrived and when it left. Afterward you can see the whole trip and spot the stop where it sat for hours. AWS X-Ray does this for requests moving through your application. Each service writes a "scan" (called a segment) with start and end times. Smaller steps inside a service, like one database call, get their own mini-scans (subsegments). You can stick labels on a scan: some labels are searchable (annotations), and some are just notes you can read later (metadata). To save money, X-Ray usually records only some of the requests, which is called sampling.
Lantern Outfitters' checkout is slow, but only sometimes. Customers in the support queue say the "Place order" button spins for eight or nine seconds, then works. Sam, the product manager, forwards you a ticket from a loyal gold-tier customer and asks a simple question: where is the time going? You have logs from API Gateway, three Lambda functions, a DynamoDB table and a payment partner, each in its own log group with its own timestamps. Stitching them together by hand would take hours, and the slowness has usually vanished by the time you look. What you need is one picture of a single request, from the first click to the last database write. How do you get it?
Logs tell you what one component did, but a modern application spreads a single request across many components. Distributed tracing shows the whole request as it travels through Amazon API Gateway, AWS Lambda, Amazon DynamoDB, Amazon Simple Queue Service (SQS) and external APIs. AWS X-Ray collects that trace data, draws a service map of your application, and lets you find exactly which call made a request slow or caused it to fail. For the exam, you need the vocabulary (traces, segments, subsegments), the annotations versus metadata distinction, how sampling works, and how tracing is switched on for Lambda versus Amazon EC2 and Amazon ECS.
Keep reading for free
Create a free StudyToCert account to read the rest of this lesson: 8 more sections, 7 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.