feat(observability): add Tempo trace backend

This commit is contained in:
kert
2026-05-01 10:39:00 -04:00
parent 828228b245
commit 7545ecdd7a
3 changed files with 60 additions and 0 deletions

View File

@@ -561,6 +561,25 @@ services:
- no-new-privileges:true - no-new-privileges:true
restart: unless-stopped restart: unless-stopped
tempo:
image: grafana/tempo:2.7.2
container_name: tempo
networks:
- observability
volumes:
- ./infra/tempo/tempo.yml:/etc/tempo/config.yaml:ro
- tempo_data:/var/tempo
command: -config.file=/etc/tempo/config.yaml
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3200/ready"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
security_opt:
- no-new-privileges:true
restart: unless-stopped
promtail: promtail:
image: grafana/promtail:latest image: grafana/promtail:latest
container_name: promtail container_name: promtail
@@ -761,4 +780,5 @@ volumes:
act_runner_data: act_runner_data:
loki_data: loki_data:
prometheus_data: prometheus_data:
tempo_data:
grafana_data: grafana_data:

24
infra/tempo/tempo.yml Normal file
View File

@@ -0,0 +1,24 @@
server:
http_listen_port: 3200
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
ingester:
trace_idle_period: 30s
max_block_bytes: 1048576
max_block_duration: 5m
storage:
trace:
backend: local
local:
path: /var/tempo/traces
wal:
path: /var/tempo/wal

View File

@@ -23,3 +23,19 @@ def _services() -> dict:
def test_compose_has_services(): def test_compose_has_services():
assert _services(), "compose.yml has no services" assert _services(), "compose.yml has no services"
class TestTempo:
def test_tempo_service_present(self):
svcs = _services()
assert "tempo" in svcs
assert svcs["tempo"]["networks"] == ["observability"]
def test_tempo_volume_declared(self):
vols = _load().get("volumes", {})
assert "tempo_data" in vols
def test_tempo_config_mounted(self):
svc = _services()["tempo"]
mounts = [v for v in svc["volumes"] if "/etc/tempo" in v]
assert any("./infra/tempo/tempo.yml" in v for v in mounts)