Observability
Jaeger
A distributed tracing system: it collects and shows the path of a request through microservices.
What it is
Jaeger was created at Uber, open sourced in 2017 and became a CNCF graduated project in 2019. It is an open system for collecting, storing and viewing traces.
It shows how a request travels through services, how long each step takes and where delays or errors happen. The UI has a Gantt chart of spans and a service dependency map.
Today Jaeger works with OpenTelemetry (OTLP) data: apps are instrumented through OTel, and Jaeger acts as the storage backend (Elasticsearch, Cassandra, Badger) and UI.
Use it when
- A microservice architecture where it is hard to find which service slows a request.
- You need a self-hosted open source tracing tool.
- Analyzing latency and dependencies between services.
- You want a backend for OpenTelemetry data without a commercial vendor.
Avoid it when
- A single monolith: a profiler and logs are enough.
- You need metrics and logs in one solution: Jaeger is only about traces.
- You lack resources to run trace storage (Elasticsearch, Cassandra) at large volumes.
Key concepts
- Trace / Span
- A trace consists of spans: operations with a start time, duration and tags.
- Sampling
- Only part of the traces is kept (for example 1%) so the system is not overloaded.
- Service graph
- A map of dependencies between services built from spans.
- Storage backend
- Elasticsearch, Cassandra or Badger for trace storage, in-memory for development only.
- OTLP
- Jaeger accepts traces over the OpenTelemetry protocol.
Example
Interview questions
1. What problem does distributed tracing solve?
In microservices one request passes through many services, and each service's logs alone do not give the whole picture. Tracing collects the full path of the request with timing for each step, so you can see exactly where a delay or error occurs.
2. What is trace sampling?
Keeping only a part of the traces to cut costs. There is head sampling (decide at the start of the request) and tail sampling (decide after completion, for example keep only slow or failed ones).
3. How is Jaeger related to OpenTelemetry?
OpenTelemetry collects and ships telemetry, while Jaeger stores and displays it. Apps are instrumented through the OTel SDK and Jaeger accepts data over OTLP.
Related technologies
- OpenTelemetryA single open standard and SDK set for traces, metrics and logs, independent of the vendor.
- GrafanaA visualization platform: dashboards and alerts on top of Prometheus, Loki, SQL databases and dozens of other sources.
- ElasticsearchElasticsearch is a distributed search and analytics engine built on Lucene with a REST API and JSON documents.
- Apache CassandraA distributed wide-column database with no single point of failure, built for massive write volumes.
- KubernetesKubernetes is a container orchestration system that deploys, scales and heals applications across a cluster of servers.
Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).