Skip to main content

Distributed Tracing

Distributed tracing follows a single request across many services, linking spans by a shared trace ID to reveal the end-to-end path, latency, and failures.

Distributed tracing is a technique for following a single request as it travels across the many services of a distributed system. It stitches together the work done in each service into one end-to-end view, exposing where time is spent and where failures occur.

How It Works

When a request enters the system, it is assigned a unique trace ID. As the request flows from service to service, each unit of work is recorded as a span, carrying the trace ID, a span ID, timing data, and contextual attributes. This context is propagated across network calls, typically through HTTP headers, so downstream services attach their spans to the same trace. A tracing backend collects the spans and reassembles them into a tree that shows the full call graph and the latency contributed by each step.

Why It Matters

In a microservice architecture, a single user action may touch dozens of services, making latency and errors hard to attribute. Distributed tracing answers the question "where did the time go?" by pinpointing the slow or failing service in a request's path. It is essential for debugging, performance tuning, and understanding service dependencies. OpenTelemetry provides a widely adopted standard for generating and propagating trace context.

Related Terms

Distributed tracing is built from spans and is a core form of telemetry within observability. It is especially valuable in microservices architectures.