A local observability stack for monitoring Claude Code usage — costs, token consumption, tool activity, sessions, and more.
Claude Code emits telemetry via OpenTelemetry, which is collected and fanned out to:
- Prometheus — metrics (cost, tokens, sessions, active time, lines of code)
- VictoriaLogs — logs and events
- Jaeger — traces
Grafana provides a pre-provisioned dashboard that pulls from all three.
Claude Code → OTEL Collector (port 4317) → Prometheus
→ VictoriaLogs
→ Jaeger
↓
Grafana (port 3000)
- Docker and Docker Compose
- Claude Code CLI
- Start the stack
docker compose up -d- Configure Claude Code to emit telemetry
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
export OTEL_EXPORTER_OTLP_PROTOCOL=grpcThen start Claude Code as normal.
- Open Grafana
Navigate to http://localhost:3000. The Claude Code dashboard is available under AI Agents.
| Service | URL |
|---|---|
| Grafana | http://localhost:3000 |
| Prometheus | http://localhost:9090 |
| Jaeger UI | http://localhost:16686 |
| VictoriaLogs | http://localhost:9428 |
| OTEL Collector | grpc://localhost:4317 |
To send telemetry to an external backend, add an exporter to otelcol.yaml and include it in the relevant pipeline. An example Dash0 exporter is included as a comment.