Jaeger
medium 28 minJaeger is an open-source store and viewer for distributed traces.
Video lesson · Chapter 1 of 5
A payment vanishes inside a six-hundred-millisecond request
Jaeger in 90 seconds
1:30Reel coming soon
Theory
Read or listen first. About 2 min.
What it is
Jaeger is a backend for distributed tracing. A trace is the record of one request through many services. It is made of spans: each span is one piece of work with a name, a start, a duration and a link to its parent.
Jaeger receives spans, stores them, and offers a web interface and an API to search and compare traces. It does not create spans. Applications do that with OpenTelemetry, and send them in the OTLP format.
It only keeps traces. Other telemetry, such as logs and metrics, belongs in other stores.
Why it exists
A page is slow. It calls five services, and each of them calls others. Every service's own log looks fine, because each sees only its own part. Someone has to join the parts of the same request.
Tracing does that with one id that travels with the request. The picture then shows which call took the time, which ran one after another although they could run together, and where an error began.
A short history
2010
Google publishes a paper about Dapper, its tracing system. It describes spans, trees and sampling.
2016
Uber Technologies releases Jaeger as open source.
September 2017
The Cloud Native Computing Foundation accepts Jaeger.
October 2019
Jaeger becomes a graduated project.
November 2024
Jaeger v2 is released. It is built on the OpenTelemetry Collector framework.
December 2025
Version 1 reaches its end of life on the 31st. Only v2 is maintained.
Words to know
- Trace
- All spans of one request, joined by a 16-byte trace id.
- Span
- One piece of work: name, start, duration, parent, attributes, events, status.
- Context propagation
- Passing the trace id and parent span id to the next service, usually in the
traceparentheader. - Collector role
- A Jaeger process that receives spans and writes them.
- Query role
- A Jaeger process that serves the API and the web interface.
- Ingester role
- A Jaeger process that reads spans from Kafka and writes them to storage.
- Remote sampling
- SDKs ask Jaeger which share of requests to trace.
- SPM
- Service performance monitoring: rate, errors and duration per service, computed from spans.
How it works
Step through the idea, or press Play.
Create. Services make spans and pass the id on
Understand it
Start here
A ribbon through the fairground
A parcel goes from stall to stall in a fairground, and comes out after twelve minutes. Nobody knows where the time went. Imagine how a coloured ribbon could show it.
One ribbon is enough to see the path. Not every parcel needs one.
Model
Spans, parents and one id
One trace as data
| Span | Parent | Start | Duration | Service |
|---|---|---|---|---|
| A: POST /order | none | 0 ms | 600 ms | web |
| B: reserve | A | 20 ms | 80 ms | stock |
| C: charge | A | 110 ms | 460 ms | pay |
| D: bank call | C | 130 ms | 420 ms | pay |
Self time of a span
How the id travels
Attributes such as http.response.status_code and user.tier make traces searchable. Do not put secrets or personal data into them: everyone who may open Jaeger can read them.
Inside
One program, several roles
Direct to storage
Collector
Receives OTLP, also Zipkin and older Jaeger formats. Batches and writes.
Query
Search API and web interface on port 16686.
Ingester
A collector that reads from Kafka instead of the network.
All-in-one
Collector and query in one process. With memory storage it is for tests only.
Storage extension
One place that names the databases, for writing and for reading.
Agent: not needed
The old Jaeger agent is gone. Use an OpenTelemetry Collector next to the app if you need one.
Ports
| Port | Protocol | For |
|---|---|---|
| 4317 | gRPC | OTLP spans in |
| 4318 | HTTP | OTLP spans in, /v1/traces |
| 9411 | HTTP | Zipkin spans in |
| 5778, 5779 | HTTP, gRPC | Remote sampling answers |
| 16686 | HTTP | Web interface and JSON API |
| 16685 | gRPC | Query API v3 |
| 8888 | HTTP | Jaeger's own metrics |
| 13133 | HTTP | Health check |
service: extensions: [jaeger_storage, jaeger_query, healthcheckv2] pipelines: traces: receivers: [otlp] processors: [] exporters: [jaeger_storage_exporter]extensions: healthcheckv2: use_v2: true http: jaeger_query: storage: traces: main traces_archive: archive jaeger_storage: backends: main: elasticsearch: server_urls: ["https://es1:9200"] indices: index_prefix: "jaeger-main" spans: { date_layout: "2006-01-02", rollover_frequency: "day", shards: 5, replicas: 1 } archive: elasticsearch: server_urls: ["https://es1:9200"] indices: { index_prefix: "jaeger-archive" }receivers: otlp: protocols: grpc: { endpoint: "0.0.0.0:4317" } http: { endpoint: "0.0.0.0:4318" }exporters: jaeger_storage_exporter: trace_storage: mainSampling
Which requests get a ribbon
OpenTelemetry SDKs trace everything unless told otherwise. With many requests that costs too much, so most systems keep a share. All services must keep the same traces, otherwise trees have holes. That is why the decision travels with the request.
What it costs to keep everything
Kinds of sampling
| Kind | Who decides, when | Good | Bad |
|---|---|---|---|
| Head, fixed share | First service, at the start | Cheap, simple | Cannot know that the request will fail |
| Remote, from a file | Jaeger tells SDKs a share per service and operation | One place to change it | Only SDKs with this feature |
| Remote, adaptive | Jaeger computes the share from traffic | Quiet endpoints are not forgotten | Needs a sampling store |
| Tail | Jaeger or a Collector, after the trace | Keeps errors and slow ones | All spans must be sent, held and come to one process |
{ "service_strategies": [ { "service": "checkout", "type": "probabilistic", "param": 0.5 }, { "service": "search", "type": "ratelimiting", "param": 5 } ], "default_strategy": { "type": "probabilistic", "param": 0.05, "operation_strategies": [ { "operation": "/health", "type": "probabilistic", "param": 0.0 } ] }}Choosing a sampling method
A rare error and a small share do not go together. If 5 requests an hour fail and you keep 1 percent, you expect one failed trace about every 20 hours. The chance to catch none of the 120 in a day is 0.99 to the power of 120, about 30 percent.
Storage
Where traces live
| Storage | Good for | Mind |
|---|---|---|
| Memory | Trying it out | Lost on restart; no limit unless you set max_traces |
| Badger | One machine, modest volume | Local files, no second instance |
| Elasticsearch or OpenSearch | Production with search; the team's recommendation | Old data leaves by index, which you must set up |
| Cassandra | Fast lookup by trace id, built-in TTL | Search is done in Jaeger: many extra writes, limited results |
| ClickHouse | Compression and analytics | Marked experimental; the schema may change |
| Remote storage (gRPC) | Your own backend | You write and run the server |
The Elasticsearch page names versions 7.x and 8.x, so check it before using a newer cluster. Jaeger makes daily indices by default, and a cleaner job deletes old ones. The documentation recommends rollover with ILM instead, where Elasticsearch opens and deletes indices by itself. Cassandra's automatic schema has a lifetime of 48 hours and replication factor 1, so change both for production.
Two ways to write to Elasticsearch
async (default) | sync | |
|---|---|---|
| The sender hears | Accepted, before it is stored | Success or error after the bulk request |
| Speed | Highest throughput | One round trip per batch |
| A failed write | Logged and counted, then gone | Goes back to the pipeline, which can retry |
Peaks
Kafka as a buffer
Collect now, store later
Direct to storage, a collector has a queue in memory. If storage stays slow, the queue fills and spans are dropped. More collectors do not help then: the slow part is the storage. Kafka keeps spans on disk until ingesters catch up, and other programs can read them too. More ingesters than partitions stand idle.
A traffic peak with and without a buffer
Read
Reading a trace
- 1
Find it
By trace id from a log line or error page, or by service, operation, attributes and minimum duration.
- 2
Look for the longest bar
Then for its self time. A long parent with a long child is not the cause.
- 3
Look at the shape
A staircase means calls one after another. Many short equal bars often mean one query per item.
- 4
Look for gaps
Empty time between children is work without a span, or waiting in a queue.
- 5
Compare
Put a slow trace beside a normal one. Jaeger can show the difference.
What does the shape tell you?
Side by side
- Three calls of 100 ms start together
- Total: about 100 ms
- The slowest child decides
Staircase
- Three calls of 100 ms, one after the other
- Total: about 300 ms
- Ask: does the second need the first?
Service performance monitoring shows rate, errors and duration (p50, p75, p95) per service and operation. It needs metrics made from spans, kept in a Prometheus-compatible store, or Elasticsearch or OpenSearch. If you sampled before counting, the rates are too low: count first, then sample. The service map in production needs a separate job that reads the stored spans.
Operate
Running it
What to watch
| Signal | Means | Do |
|---|---|---|
| Accepted spans far above sent spans | Spans wait or are lost between receiving and storing | Look at storage and queue |
| Refused spans | The collector cannot take more | Scale collectors or sample more |
| Failed exports | Storage answers with errors | Check disk, mapping, credentials |
| Kafka lag grows | Ingesters or storage too slow | Add ingesters up to the partitions, then storage |
| Traces with missing parents | A service drops or does not pass the context | Check propagation and filters |
Upgrade from the end of the path: first query, then ingester, then collector, so that readers understand the new data. The Helm chart or the OpenTelemetry Operator installs v2 on Kubernetes.
Choose
When another tool fits better
| Need | Better choice | Why |
|---|---|---|
| Create spans in code | OpenTelemetry | Jaeger's own client libraries are retired |
| Alerts on rates | Prometheus | Metrics are complete, traces are sampled |
| Text of every event | ELK Stack | Logs are not spans |
| Very cheap storage, mostly lookup by id | Grafana Tempo | Keeps traces in object storage |
| One product for all signals, hosted | Datadog or a similar service | Nothing to run, a bill instead |
| One program, no remote calls | A profiler | There is nothing distributed |
Jaeger is under the Apache 2.0 licence and free to use. The cost is the storage cluster and the people who run it.
Summary
The whole topic in one minute.
Services make spans with OpenTelemetry and send them over OTLP. Jaeger's collector writes them to a database, and the query role shows them as a timeline.
The cost is spans a second times size times days, so sampling is the main control. Head sampling is cheap and blind, tail sampling sees the whole trace and needs memory.
Jaeger v2 is one program with several roles, configured in YAML like an OpenTelemetry Collector. The state is in the storage, which is therefore the part to size and to protect.
- A trace is a tree of spans with one id. Jaeger stores and shows it; OpenTelemetry makes it.
- Jaeger v2 is one binary with roles, built on the OpenTelemetry Collector. Version 1 ended in December 2025.
- Collector and query are stateless. Storage is the limit.
- Sampling decides the cost. Head is cheap and blind, tail is informed and heavy.
- Elasticsearch or OpenSearch are recommended for search; memory is for tests.
- Kafka absorbs peaks; more collectors do not fix slow storage.
- The interface has no accounts: protect it.