Geavanceerd
Zoeken inInstallatiegidsen
Zo zoek je
  • Plak een foutmelding tussen aanhalingstekens, bijv. "permission denied", om de oplossingstabel te vinden.
  • Kies een gebied en een deel van de gids (installeren, eerste instellingen, dagelijks gebruik, beveiliging, oplossingen) om direct naar de juiste stap te gaan.
  • "twee woorden" vindt precies die zin.
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken
Probeer:

Gids 85Jaeger · Monitoring

Install and set up Jaeger (distributed tracing)

Jaeger shows traces: the path of one request through all your services — which service called which, how long each step took, and where it failed. When a page is slow or an API returns 500 in a microservice system, a trace shows the guilty service in seconds. Jaeger v2 is built on the OpenTelemetry Collector and receives OTLP directly. This guide runs Jaeger all-in-one for labs, a production setup with Elasticsearch/OpenSearch storage, sends traces from an app, and explains sampling, searching and fixes.

  • 9 Lessen
  • 5 Commando's

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

$ als gewone gebruiker# als root (of met sudo)

85.1

Know it before you install

A trace is made of spans (one operation each: an HTTP call, a DB query) with start time, duration, attributes and the parent span. Apps create spans with the OpenTelemetry SDK and send them (OTLP) to Jaeger — or to an OTel Collector that forwards them. Jaeger stores them and the UI lets you search and compare.

ItemValue
Image / binaryjaegertracing/jaeger (v2, one binary for all roles)
Ports16686 (UI), 4317 (OTLP gRPC), 4318 (OTLP HTTP)
Storagememory (labs), Badger (single node), Elasticsearch / OpenSearch / Cassandra (production)
Configa YAML file in the OpenTelemetry Collector format (v2)
AlternativesGrafana Tempo (cheap object storage, Grafana UI) — the same OTLP data works for both

Notitie

Jaeger v1 reached end of life; use v2. Apps should use the OpenTelemetry SDKs (the old Jaeger client libraries are retired).

85.2

Run it for a lab (RHEL and Ubuntu)

With Docker (see the Docker guide) — all-in-one, data in memory:

docker run -d --name jaeger -p 127.0.0.1:16686:16686 -p 4317:4317 -p 4318:4318 jaegertracing/jaeger:2.11.0
curl -s http://127.0.0.1:16686/api/services
{"data":["jaeger"], …}

Open http://127.0.0.1:16686 (SSH tunnel on a server). Data is lost when the container stops — fine for a lab.

85.3

First configuration: production storage

For real use, store traces in Elasticsearch or OpenSearch (see the Elasticsearch guide) with a config file:

/etc/jaeger/config.yaml
service:
  extensions: [jaeger_storage, jaeger_query, healthcheckv2]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [jaeger_storage_exporter]
 
extensions:
  healthcheckv2:
    use_v2: true
    http:
      endpoint: 0.0.0.0:13133
  jaeger_query:
    storage:
      traces: es_main
  jaeger_storage:
    backends:
      es_main:
        elasticsearch:
          server_urls: ["https://es1.example.com:9200"]
          auth:
            basic:
              username: jaeger
              password: ${env:JAEGER_ES_PASSWORD}
          tls:
            ca_file: /etc/jaeger/es-ca.crt
          indices:
            index_prefix: jaeger
            spans:
              date_layout: "2006-01-02"
              rollover_frequency: "day"
 
receivers:
  otlp:
    protocols:
      grpc: { endpoint: 0.0.0.0:4317 }
      http: { endpoint: 0.0.0.0:4318 }
 
processors:
  batch: {}
 
exporters:
  jaeger_storage_exporter:
    trace_storage: es_main
docker run -d --name jaeger --restart unless-stopped -e JAEGER_ES_PASSWORD -v /etc/jaeger:/etc/jaeger:ro -p 127.0.0.1:16686:16686 -p 4317:4317 -p 4318:4318 jaegertracing/jaeger:2.11.0 --config /etc/jaeger/config.yaml
PartWhy
jaeger_storage backendWhere traces live; one daily index makes deleting old data easy.
jaeger_queryThe UI and API (port 16686).
otlp receiverApps (or a Collector) send OTLP here.
Password from ${env:…}No secret in the file.

The config keys change between Jaeger versions — compare with the example files in the Jaeger repository (cmd/jaeger/config-elasticsearch.yaml, config-opensearch.yaml) for your version.

Delete old indices with an ILM/ISM policy (for example 7–14 days of traces). Put the UI behind Nginx with HTTPS and a login (SSO via oauth2-proxy) — the Jaeger UI has no login of its own. In Kubernetes use the Jaeger Helm chart or the OpenTelemetry Operator.

85.4

Send traces from an app

Auto-instrumentation with environment variables (Python example; Java, Node.js, .NET and Go are similar):

pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install
export OTEL_SERVICE_NAME=shop-api
export OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger.example.com:4318
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_TRACES_SAMPLER=parentbased_traceidratio
export OTEL_TRACES_SAMPLER_ARG=0.1
opentelemetry-instrument python app.py

traceidratio 0.1 keeps 10 % of traces — enough to see patterns on busy systems; use 1.0 in labs. Every service in the chain must propagate the trace context (W3C traceparent header) — the OTel libraries do it.

85.5

Daily use: search traces and the real uses

In the UI: choose the Service, an Operation, filter by Tags (http.status_code=500, error=true), Min Duration (> 1s) and a time range. Open a trace: the timeline shows the slow span; Compare shows two traces side by side; System Architecture draws the service map.

curl -s http://127.0.0.1:16686/api/services | jq .
curl -s 'http://127.0.0.1:16686/api/traces?service=shop-api&limit=5&tags=%7B%22error%22%3A%22true%22%7D' | jq '.data[].traceID'
curl -s http://127.0.0.1:13133/status
docker logs --tail 50 jaeger

Real uses at work:

  • Find which microservice makes a request slow, or where an error starts.
  • Find N+1 database queries and slow external APIs.
  • Link traces with logs (trace ID in log lines) and metrics (exemplars in Grafana).

85.6

Make it safe

Security checklist:

  • OTLP ports only from app networks (or behind a Collector gateway); TLS across networks.
  • The UI has no login: Nginx + SSO in front, or localhost only.
  • Scrub secrets and personal data from span attributes (in the SDK or an OTel Collector).
  • Retention on storage (7–14 days); size the backend for your sampling rate.
  • Pin the image version; keep Jaeger and the storage updated.

85.7

Update and remove

docker pull jaegertracing/jaeger:2.12.0
docker rm -f jaeger

Then start the new version with the same config. Data stays in Elasticsearch/OpenSearch.

85.8

Fix common problems

ProblemCauseFix
No services in the UIApps do not send, wrong endpoint/port, or firewall.Check OTEL_EXPORTER_OTLP_ENDPOINT and protocol (4317 gRPC / 4318 HTTP); curl the port from the app host.
Traces are cut in pieces (one service per trace)Context not propagated between services.Use OTel instrumentation in every service; keep the traceparent header through proxies.
Only a few tracesSampling ratio.Raise OTEL_TRACES_SAMPLER_ARG (or use tail sampling in a Collector).
All traces gone after restartMemory storage (all-in-one lab).Use Badger or Elasticsearch/OpenSearch storage.
Storage errors in the logElasticsearch auth/TLS or index permissions.Check user rights for jaeger-* indices, CA file, password variable.

Commando's in deze les

85.9

Next steps

1A trace shows only one service although the request went through three. Why?

The trace context was not propagated; every service must use OTel instrumentation and keep the traceparent header.

2Why use sampling (for example 10 %) in production?

To keep cost and storage low on busy systems while still seeing the patterns.

Alle commando's in dit hoofdstuk