Skip to content
IT glossary
DevOps and cloudUpdated December 3, 2026

Distributed tracing

Распределённая трассировка

Distributed tracing follows a request or background job across services so you can see which operations ran, where time was spent, and where errors occurred.

What a trace tells you

A latency dashboard can tell you that checkout got slower after a deployment. It cannot tell you what happened during a particular checkout. A distributed trace shows which services handled that request, which calls overlapped, and which operations finished before the response went back to the user. That makes it useful for investigating slow requests and failures that cross service boundaries.

How services build a trace

A trace is made up of spans. A span represents one timed operation, such as serving an HTTP request, querying a database, or consuming a message. Spans in the same trace share a trace ID, but each span has its own span ID. A span can record attributes such as the service name or route template, along with a status and events. Parent relationships show how operations are nested.

Services do not send the entire trace with each request. They pass just enough context to connect the next operation to the current one. Over HTTP, the W3C Trace Context standard defines the traceparent header for this. Across a queue, the producer can put trace context in message metadata for the consumer to read. If that context is dropped, the consumer may still record a span, but it can appear in a separate trace.

OpenTelemetry and Jaeger play different roles. OpenTelemetry provides APIs, SDKs, and instrumentation that create and export spans. Its optional Collector can receive, process, and forward telemetry. Jaeger is a tracing backend that lets teams store, search, and visualize traces.

Example: reading a timeline

In this simplified checkout trace, the numbers show when each operation started and ended relative to the start of the request:

Checkout request     0–480 ms
├─ Inventory check 20–140 ms
└─ Payment auth    25–450 ms
   └─ Provider API 40–430 ms

Inventory and payment ran concurrently, so adding their durations would overstate the time spent waiting for them. If checkout waits for both, payment is the branch to investigate first. The provider call accounts for most of that span, but the trace alone does not say whether the delay came from the network or from processing at the provider.

Production use and interview questions

Use metrics to spot changes across many requests, traces to examine individual examples, and logs to read details such as exception messages. Including the trace ID in structured logs makes it easier to move between the two views. Keep credentials and personal data out of span attributes.

A common interview question is how to keep rare failures without storing every trace. Head sampling makes the decision near the start, before the outcome is known. Tail sampling buffers incoming spans and decides later, so it can favor traces with errors or unusually long durations. That flexibility costs memory and delays the decision. A sampled set can be excellent for debugging but misleading for estimating the overall error rate, especially if errors are deliberately kept more often.