Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude Code Observability

A local observability stack for monitoring Claude Code usage — costs, token consumption, tool activity, sessions, and more.

Architecture

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)

Prerequisites

  • Docker and Docker Compose
  • Claude Code CLI

Setup

  1. Start the stack
docker compose up -d
  1. 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=grpc

Then start Claude Code as normal.

  1. Open Grafana

Navigate to http://localhost:3000. The Claude Code dashboard is available under AI Agents.

Services

Service URL
Grafana http://localhost:3000
Prometheus http://localhost:9090
Jaeger UI http://localhost:16686
VictoriaLogs http://localhost:9428
OTEL Collector grpc://localhost:4317

Forwarding to a third-party backend

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors