RousselTMLEARNING

Observability

Grafana Tempo: the distributed tracing backend at scale

Understand distributed tracing and Grafana Tempo: traces, spans, TraceID, architecture (distributor, ingester, querier, compactor), object storage, and a comparison with Jaeger and Zipkin.

1. Distributed tracing in brief #

Following a request across services.

Traces, spans and context #

Available in: ✓ OSS ✓ Enterprise ✓ Cloud Tempo open source, Enterprise Traces and Grafana Cloud Traces

In a microservice architecture, a user request often goes through dozens of services. A trace represents the full path of that request; it is made of spans, each corresponding to an operation (HTTP call, SQL query, internal processing) with a duration, attributes and a status. All the spans of a trace share the same TraceID, propagated from one service to the next in headers (W3C traceparent).

Anatomy of a distributed trace
The critical path is the longest chain of spans: that is where you save time.
# En-tête W3C propagé entre les services
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
#            ver  <------- trace-id (16 octets) -----> <-span-id-> flags

2. Why Tempo? #

A simple, cost-effective backend.

The philosophy #

Grafana Tempo needs only object storage (S3, GCS, Azure Blob, MinIO): no database to manage, no heavy index. You find a trace by its TraceID or search for it with TraceQL on attributes. It accepts many protocols: OTLP, Jaeger, Zipkin.

CriterionGrafana TempoJaegerZipkin
StorageObject (S3, GCS, Azure) or localElasticsearch, Cassandra, OpenSearchElasticsearch, Cassandra, MySQL
Cost at scaleVery lowMedium to highMedium
Query languageTraceQLUI/API filtersUI/API filters
Grafana integrationNative (logs, metrics, profiles)Data sourceData source
Input protocolsOTLP, Jaeger, ZipkinOTLP, JaegerZipkin

3. The architecture #

Write and read paths.

The components #

Grafana Tempo components
Each component can be scaled separately.
ComponentRole
DistributorReceives spans (OTLP, Jaeger, Zipkin), groups them by TraceID and sends them to the ingesters
IngesterAssembles traces in memory and in the WAL, writes blocks to storage
CompactorMerges blocks, applies retention
Query FrontendSplits searches into parallel sub-queries
QuerierLooks for traces in the ingesters and in storage
Metrics-generatorDerives metrics (service graphs, span metrics) from traces

Deployment modes #

tempo -config.file=tempo.yaml -target=all            # monolithique (tests, petits volumes)
tempo -config.file=tempo.yaml -target=distributor     # microservices
tempo -config.file=tempo.yaml -target=querier
tempo --version
Good practice: Start in monolithic mode; switch to the tempo-distributed chart when ingestion exceeds a few tens of MB/s.

Related articles

The LGTM stack (Loki, Grafana, Tempo, Mimir): architecture and setup

Grafana Labs' LGTM stack: Loki for logs, Grafana for visualization, Tempo for traces, Mimir for metrics (and …

Installing Grafana Tempo (Docker Compose, binary and Helm)

Install Grafana Tempo: the tempo.yaml configuration, Docker Compose with Grafana and Prometheus, OTLP ports, …

Sending traces to Tempo: OpenTelemetry instrumentation and Alloy

Produce and route traces to Tempo: Python/Java/Node auto-instrumentation, the manual SDK, OTEL environment va…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!