Problem
In a system of many services, logs and metrics from individual components cannot explain why one request was slow or failed. Engineers waste hours correlating timestamps across systems.
Follow a single request across service boundaries to find where latency and errors originate.
In a system of many services, logs and metrics from individual components cannot explain why one request was slow or failed. Engineers waste hours correlating timestamps across systems.
Distributed tracing records the path of a request as a tree of timed spans. It answers the question that metrics and logs alone struggle with: where, exactly, did this request spend its time or fail?
When a request enters the system, the first service creates a trace identifier and a root span. Each outbound call carries the context in standard headers, such as traceparent, so downstream services attach their spans to the same trace. Spans record start time, duration, status, and attributes. Applications export them to a collector, which batches, filters, samples, and forwards them to a backend. Queues and background jobs carry context in message headers so asynchronous work remains connected.
# OpenTelemetry collector pipeline
receivers:
otlp:
protocols:
grpc: {}
processors:
batch: {}
tail_sampling:
policies:
- name: errors
type: status_code
status_code: { status_codes: [ERROR] }
exporters:
otlp:
endpoint: tracing-backend:4317
service:
pipelines:
traces:
receivers: [otlp]
processors: [tail_sampling, batch]
exporters: [otlp]
Teams adopt this approach when requests traverse several services or queues; latency problems are hard to localize. It is a poor fit when a single monolith with simple call graphs already has adequate profiling, or when telemetry budget cannot support the added data volume. The central tensions are detail vs telemetry cost; head sampling simplicity vs tail sampling insight; auto-instrumentation convenience vs custom span quality. The main benefits are that it delivers: shows the full path and timing of a request; pinpoints slow or failing dependencies quickly; standards avoid vendor lock-in; links naturally with logs and metrics. The main costs to budget for are: instrumentation effort across many services; data volume and cost require sampling; context propagation breaks across unsupported boundaries; sampling can drop the very traces you need. Governance typically looks like this: platform team owns collector and conventions; service teams own span quality. Expect adoption cost to be medium: instrumentation, collectors, and backend, and a best fit for organizations with several interdependent services. Critics point out that traces rarely tell the full story without matching logs and metrics, and that cost and sampling trade-offs can leave incident-critical traces missing. Treat these concerns as design inputs, and revisit the decision as traffic, team size, and failure history change.