From 2ec33fd88d585daf395ebaa3870b5e02cf3a65ee Mon Sep 17 00:00:00 2001 From: Jonatan Ivanov Date: Tue, 20 Aug 2024 19:28:11 -0700 Subject: [PATCH] Upgrade Tempo to 2.5.0 See https://github.com/grafana/tempo/blob/a21001a72a5865bfcfc1b0d2dfa30160c5a26103/example/docker-compose/local/docker-compose.yaml See https://github.com/grafana/tempo/issues/1657 --- docker-compose.yml | 31 +++++++++++++++++++++++-------- docker/grafana/tempo.yml | 12 +++++++++--- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 7371845..f65f4a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -72,13 +72,28 @@ services: - ./docker/grafana/provisioning/alerting:/etc/grafana/provisioning/alerting:ro ports: - "3000:3000" + tempo-init: + # Tempo runs as user 10001, and docker compose creates the volume as root. + # As such, we need to chown the volume in order for Tempo to start correctly. + # This should not be needed but this is the official solution recommended by Tempo maintainers + # See: https://github.com/grafana/tempo/blob/a21001a72a5865bfcfc1b0d2dfa30160c5a26103/example/docker-compose/local/docker-compose.yaml + # See: https://github.com/grafana/tempo/issues/1657 + image: &tempoImage grafana/tempo:2.5.0 # https://hub.docker.com/r/grafana/tempo/tags and https://github.com/grafana/tempo/releases + user: root + entrypoint: + - "chown" + - "10001:10001" + - "/var/tempo" + volumes: + - tempo:/var/tempo tempo: container_name: tempo - image: grafana/tempo:2.4.1 # https://hub.docker.com/r/grafana/tempo/tags and https://github.com/grafana/tempo/releases + image: *tempoImage extra_hosts: ['host.docker.internal:host-gateway'] command: ['-config.file=/etc/tempo.yml'] + depends_on: ['tempo-init'] volumes: - - tempo:/tmp/tempo + - tempo:/var/tempo - ./docker/grafana/tempo.yml:/etc/tempo.yml:ro ports: - "3200:3200" # tempo @@ -98,9 +113,9 @@ services: - "3001:1080" - "25:1025" volumes: - mysql: - driver: local - prometheus: - driver: local - tempo: - driver: local + mysql: + driver: local + prometheus: + driver: local + tempo: + driver: local diff --git a/docker/grafana/tempo.yml b/docker/grafana/tempo.yml index 8a1b76f..9a86c03 100644 --- a/docker/grafana/tempo.yml +++ b/docker/grafana/tempo.yml @@ -6,16 +6,22 @@ distributor: storage: trace: backend: local + wal: + path: /var/tempo/wal local: - path: /tmp/tempo/blocks + path: /var/tempo/blocks metrics_generator: registry: external_labels: source: tempo storage: - path: /tmp/tempo/generator/wal + path: /var/tempo/generator/wal remote_write: - url: http://host.docker.internal:9090/api/v1/write send_exemplars: true + traces_storage: + path: /var/tempo/generator/traces overrides: - metrics_generator_processors: [service-graphs, span-metrics] + defaults: + metrics_generator: + processors: [service-graphs, span-metrics, local-blocks]