Skip to content
Latchkey

What Is Distributed Tracing?

Distributed tracing follows a single request as it travels across many services, stitching together a complete picture of its journey, timing, and where it slowed down or failed.

In a microservices architecture, one user action might touch a dozen services. When it is slow or fails, no single service's logs tell the whole story. Distributed tracing solves this by connecting the dots into one end-to-end view of the request.

The problem it solves

When a request fans out across many services, traditional logs and metrics show each service in isolation. Distributed tracing reassembles the full path of one request, so you can see exactly which hop was slow or which service returned the error, instead of guessing across disconnected logs.

Traces and spans

A trace represents one request's entire journey and is made up of spans, each a single unit of work (such as a database call or an RPC to another service). Spans nest and chain together, and their timings reveal exactly where the request spent its time.

Trace context propagation

For spans to link into a coherent trace, a trace identifier must be passed along with the request as it crosses service boundaries -- usually via HTTP headers. This propagation is the key mechanism: without it, each service would generate disconnected fragments rather than one connected trace.

Reading a trace

Traces are typically visualized as a waterfall, with each span shown as a bar whose length is its duration. This makes bottlenecks obvious at a glance: one long bar in the middle of an otherwise fast chain pinpoints the slow service. It turns latency debugging into a visual task.

The third pillar

Traces complete the classic trio of observability data alongside logs and metrics. Metrics tell you something is slow, logs tell you what an individual service did, and traces tie it together by showing how a single request flowed through the whole system.

Key takeaways

  • Distributed tracing follows one request across all the services it touches.
  • Traces are made of spans, linked by propagated trace context.
  • It is essential for debugging latency and failures in microservices.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →