What Is Distributed Tracing? How It Works
Last verified on Nov 8, 2026.
Distributed tracing follows a single request as it moves through the services that handle it, and records each step as a timed span. OpenTelemetry's glossary defines it as tracking the progression of one request, called a trace, across the services that make up an application, crossing process, network, and security boundaries. It answers "where did this request spend its time, and where did it fail?"
How a Request Becomes a Trace
Four things have to happen:
- Instrumentation creates a span for each operation, such as the incoming request and each outgoing call.
- Context propagation moves the trace ID and the caller's span ID to the next service. OpenTelemetry describes it this way: service A includes a trace ID and a span ID in its context, and service B uses them to create a span in the same trace with A's span as the parent.
- Export sends finished spans to a collector or backend, usually over OTLP.
- Assembly happens in the backend, which groups spans by trace ID and orders them by parent-child links.
OpenTelemetry's default propagator uses the headers defined by W3C Trace Context, so a service in one language can continue a trace that began in another.
An Example
A browser calls POST /checkout on the web service. That service calls a payments service and a database. The trace looks like this (timings are illustrative):
trace 5b8aa5a2d2c872e8321cf37308d69df2
POST /checkout [web, server] 0 ms ======================= 412 ms
charge card [web, client] 18 ms ================== 371 ms
POST /v1/charges [payments, server] 31 ms =============== 350 ms
SELECT card [payments, client] 40 ms === 62 ms
INSERT order [web, client] 380 ms == 405 msOne glance shows the slow part is inside payments, not the web tier. Metrics alone would show a slow /checkout and nothing more. Logs from the two services would show nothing connecting them, unless you add the trace ID to each line.
Distributed Tracing vs Logs and Metrics
Metrics aggregate numbers over time, so they tell you something is slow. Logs record individual events, but OpenTelemetry's primer notes they lack context such as where they were called from, and become far more useful when correlated with a trace and span. Traces supply the request-level path. The primer says tracing is especially useful for debugging behavior that is hard to reproduce locally. The three work best together, which is the idea behind observability.
Where Distributed Tracing Breaks
- Lost context. One uninstrumented service, a proxy that strips
traceparent, or a custom HTTP client can split a trace in two. Each fragment gets its own trace ID. - Asynchronous work. A queue breaks the parent-child chain in time. OpenTelemetry has producer and consumer span kinds for this, and span links to tie a later trace back to the earlier one.
- Untrusted callers. OpenTelemetry warns that malicious actors can send forged trace headers. At a public edge, you may want to ignore incoming context.
- Volume. OpenTelemetry says that when most requests succeed with acceptable latency, you do not need every trace. See trace sampling.
Next Steps
If you run microservices, start with a trace ID in every log line, as described in the microservices logging guide. Then add tracing with the OpenTelemetry setup for your language. Traces pair well with alerts on latency spikes and tail latency.
Sazabi, an AI-native observability and security platform, accepts OTLP traces and lets you search for a request by trace ID alongside its logs. Sazabi ingests OpenTelemetry metrics (Prometheus metrics through an OpenTelemetry Collector) and OTLP traces through the same intake as your logs. It stores each metric data point and each span as a log record that its agent queries alongside your logs, so there is no separate metrics store to run.
Frequently Asked Questions
What is distributed tracing in simple terms?
It follows one request through every service that handles it and records each step as a timed span, so you can see where time went or where an error began.
How does distributed tracing work?
The first service creates a trace ID and span ID and passes them to downstream services in a header such as traceparent. Each service records its own spans under that trace and exports them to a backend, which assembles the tree.
What is the difference between distributed tracing and logging?
Logs are timestamped messages that are not tied to a request unless you add an ID. Tracing records structure and timing for each request. Adding the trace ID to logs links the two.
Do I need to trace every request?
No. Sampling keeps a representative share of traces, and teams often keep all traces with errors or high latency.
Sources
- Distributed tracing tracks a single request, called a trace, as it is handled by the services of an application, and traverses process, network, and security boundaries (accessed Nov 8, 2026)
- Service A includes a trace ID and span ID in the context; service B creates a span in the same trace with A's span as parent; the default propagator uses W3C TraceContext headers; be cautious accepting context from external sources (accessed Nov 8, 2026)
- Distributed tracing lets you observe requests as they propagate through distributed systems and debug behavior that is hard to reproduce locally (accessed Nov 8, 2026)
- Context propagation is the core concept that enables distributed tracing; span links associate traces for asynchronous work; producer and consumer span kinds (accessed Nov 8, 2026)
- The traceparent header carries trace ID, parent ID, and trace flags between services (accessed Nov 8, 2026)
- You do not need 100 percent of traces to observe a system; head and tail sampling reduce volume (accessed Nov 8, 2026)