RousselTMLEARNING

Observability

Installing Grafana Tempo (Docker Compose, binary and Helm)

Install Grafana Tempo: the tempo.yaml configuration, Docker Compose with Grafana and Prometheus, OTLP ports, checks, and installing the binary and the Helm chart.

1. Minimal configuration #

Monolithic with local storage.

tempo.yaml #

Available in: ✓ OSS ✓ Enterprise ✕ Cloud In Grafana Cloud the service is managed by Grafana Labs: nothing to install

# tempo.yaml
stream_over_http_enabled: true

server:
  http_listen_port: 3200
  log_level: info

distributor:
  receivers:
    otlp:
      protocols:
        grpc:
          endpoint: "0.0.0.0:4317"
        http:
          endpoint: "0.0.0.0:4318"

ingester:
  max_block_duration: 5m          # petits blocs pour tester rapidement

compactor:
  compaction:
    block_retention: 48h

storage:
  trace:
    backend: local
    wal:
      path: /var/tempo/wal
    local:
      path: /var/tempo/blocks
Tempo ports
4317/4318 for ingestion, 3200 for reading.

2. Docker Compose #

Tempo, Prometheus and Grafana.

docker-compose.yml #

services:
  tempo:
    image: grafana/tempo:latest
    command: ["-config.file=/etc/tempo.yaml"]
    volumes:
      - ./tempo.yaml:/etc/tempo.yaml
      - tempo-data:/var/tempo
    ports: ["3200:3200", "4317:4317", "4318:4318"]

  prometheus:
    image: prom/prometheus:latest
    command: ["--config.file=/etc/prometheus/prometheus.yml", "--web.enable-remote-write-receiver", "--enable-feature=exemplar-storage"]
    ports: ["9090:9090"]

  grafana:
    image: grafana/grafana:latest
    ports: ["3000:3000"]
    environment:
      GF_AUTH_ANONYMOUS_ENABLED: "true"
      GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
    volumes:
      - ./datasource.yml:/etc/grafana/provisioning/datasources/tempo.yml

volumes:
  tempo-data: {}
# datasource.yml
apiVersion: 1
datasources:
  - name: Tempo
    type: tempo
    url: http://tempo:3200
    jsonData:
      nodeGraph: { enabled: true }
      serviceMap: { datasourceUid: prometheus }
docker compose up -d
curl -s http://localhost:3200/ready            # doit répondre : ready
curl -s http://localhost:3200/status/version
curl -s http://localhost:3200/api/echo         # echo

3. Sending a first trace #

Without writing any code.

telemetrygen #

docker run --rm --network host \
  ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest \
  traces --otlp-insecure --otlp-endpoint localhost:4317 --traces 20 --child-spans 3 --service demo-service

# Récupérer le TraceID dans les logs ou rechercher via l'API
curl -s "http://localhost:3200/api/search?q=%7B%20resource.service.name%20%3D%20%22demo-service%22%20%7D&limit=3" | jq '.traces[] | {traceID, rootTraceName, durationMs}'
curl -s http://localhost:3200/api/traces/<TRACE_ID> | jq '.batches | length'

4. Binary and Kubernetes #

Other installations.

systemd binary #

curl -LO https://github.com/grafana/tempo/releases/latest/download/tempo_linux_amd64.tar.gz
tar xzf tempo_linux_amd64.tar.gz && sudo install tempo /usr/local/bin/
sudo useradd --system --no-create-home tempo && sudo mkdir -p /var/tempo /etc/tempo && sudo chown tempo: /var/tempo
tempo -config.file=/etc/tempo/tempo.yaml -config.verify=true      # vérifier la configuration

Helm #

helm repo add grafana https://grafana.github.io/helm-charts && helm repo update
# Monolithique
helm install tempo grafana/tempo -n tracing --create-namespace
# Distribué (production)
helm install tempo grafana/tempo-distributed -n tracing --create-namespace -f values-prod.yaml
kubectl -n tracing get pods
kubectl -n tracing port-forward svc/tempo 3200:3200
Common mistake: local storage is only suitable for testing: in production, configure object storage (see the storage article) and at least 3 ingesters with replication_factor: 3.

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 …

Grafana Tempo: the distributed tracing backend at scale

Understand distributed tracing and Grafana Tempo: traces, spans, TraceID, architecture (distributor, ingester…

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!