Why it matters

In microservices, traces are the primary tool for understanding request flow. Without them, debugging cross-service latency is guesswork.

Advertisement

The architecture

Trace: root span (initial request) + child spans (each service call).

Context propagation: trace ID + span ID in headers (W3C Trace Context or similar).

Distributed trace structureRoot spaninitial requestChild spansdownstream callsTrace IDpropagate via headersEach span has start/end time; visualization shows waterfall of service calls
Trace anatomy.
Advertisement

How it works end to end

Instrumentation: automatic via libraries (OpenTelemetry auto-instrumentation) or manual span creation.

Sampling: keep all traces expensive; sample 1-10% typical. Tail-based sampling keeps traces with errors or high latency.

Visualization: waterfall shows time each service takes. Bottlenecks visible instantly.