Skip to content

Claude Code OpenTelemetry Monitoring for Teams

Summary

Claude Code supports opt-in OpenTelemetry telemetry via CLAUDE_CODE_ENABLE_TELEMETRY=1, exporting 8 metrics and 5 event types. A production monitoring stack (OTel Collector + Prometheus + Grafana) provides team-wide visibility into token usage, cache efficiency, cost per developer, and adoption patterns. Beta distributed tracing with TRACEPARENT propagation enables end-to-end visibility from prompt to CI/CD.

Key Details

  • Cache read ratio (claude_code.token.usage with type attribute) is the single best indicator of whether project configuration (CLAUDE.md, prompt patterns) is effective -- cache reads cost 90% less than fresh input tokens
  • Setting allow or soft_deny in auto-mode config replaces the entire default list -- always export defaults first with claude auto-mode defaults
  • Delta temporality is the default; VictoriaMetrics silently drops delta metrics -- set OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=cumulative if data disappears
  • session.id cardinality explodes at scale -- disable with OTEL_METRICS_INCLUDE_SESSION_ID=false for teams >10
  • Cost metrics are approximations, not invoicing data -- use Anthropic Console for actual billing
  • Managed settings can centralize telemetry config so every developer sends to the same collector

Why Rolf Thinks This Matters

With managed settings and Teams accounts coming for VisiTrans, monitoring is table stakes. We need visibility into who uses Claude Code, how effectively, and at what cost before we can make informed decisions about the rollout. The cache efficiency gap alone -- 60% vs 15% read ratios depending on prompt structure -- shows there's significant optimization potential we're currently blind to.

Further Reading