The visibility gap
In a monolith a stack trace shows a whole request. Across microservices one request hops through many services, and logs scatter. Distributed tracing stitches those hops back into one picture.
Traces and spans
- A trace represents one end to end request.
- Each unit of work is a span with a start, end, and parent.
- A trace id is generated at the edge and propagated in headers through every hop.
Context propagation
Every service must forward the trace id and span context on its outgoing calls. Without propagation the trace breaks into disconnected pieces.
What you get
A trace view shows the call tree and the time each span took, so you can spot the slow hop, see retries, and understand failures that span services.
Sampling
Tracing every request is costly, so systems sample, keeping a fraction of traces while still capturing enough to debug.
Key idea
Distributed tracing propagates a trace id across services and records spans, so one request becomes a single timeline that reveals the slow or failing hop.