What is Distributed Tracing?
Distributed tracing tracks a single request as it travels through the services of a distributed system, recording timing and context at every hop so you can pinpoint where latency and errors originate.
Distributed tracing is the technique of following a single request end-to-end as it flows through a distributed system — every service, queue, and database it touches — and recording a timed span for each operation. The result, a trace, is a tree showing exactly where time was spent and where failures occurred.
The problem it solves
In a microservices architecture, one user action can fan out into dozens of internal calls. When that action is slow, per-service logs and metrics can each look healthy — the latency hides in the gaps between services, in retries, or in one slow query three layers deep. Tracing reconstructs the whole causal chain, turning “checkout is slow” into “the inventory service’s database query added 800ms.”
How it works
- Instrumentation — each service’s tracing library (typically OpenTelemetry) starts and ends spans around meaningful operations; auto-instrumentation covers common frameworks without code changes
- Context propagation — the trace ID travels with the request in headers (W3C Trace Context), so every service parents its spans correctly
- Export — spans stream to a backend via OTLP
- Reassembly & analysis — the backend stitches spans into traces and renders waterfall/flame views, service maps, and latency analytics
What traces give you
- Latency attribution — which hop, query, or external call is responsible for p99
- Error localization — the exact span where a failure started, with its context
- Dependency mapping — an always-current picture of what calls what
- Cross-signal pivots — trace IDs in logs connect the story across the three pillars
Distributed tracing in OpenObserve
OpenObserve’s tracing ingests OTLP natively, links traces with logs and metrics by trace ID, and stores spans on object storage — making it economical to retain traces at volumes where per-GB-priced tools force aggressive sampling. Start with the basics-to-beyond guide.
Frequently asked questions
What is the difference between a trace and a span?
A span is one timed operation — an HTTP handler, a database query, a queue publish. A trace is the tree of all spans produced by a single request as it moves through the system, connected by a shared trace ID.
How does context propagation work in distributed tracing?
When service A calls service B, the tracing library injects the trace ID and parent span ID into request headers (the W3C traceparent header is the standard). Service B extracts them and parents its spans accordingly, so the trace stays connected across process and network boundaries.
Do I need to sample traces?
At high traffic, storing every trace can be costly in most backends, so teams use head-based sampling (decide at request start) or tail-based sampling (decide after seeing the whole trace, keeping errors and slow requests). With storage-efficient backends, many teams can afford to keep far more traces than legacy pricing allowed.
Related terms
Keep reading
See these concepts in action
OpenObserve unifies logs, metrics, traces, and frontend monitoring in one open-source platform — at a fraction of the cost of legacy tools.