[DOCS] Clarify that OTEL telemetry exports events via logs protocol, not metrics

Resolved 💬 4 comments Opened Dec 26, 2025 by raveenb Closed Mar 1, 2026

Description

The monitoring documentation mentions configuring both OTEL_METRICS_EXPORTER and OTEL_LOGS_EXPORTER, which implies Claude Code exports both traditional OTel metrics and logs. However, the actual telemetry data (token usage, tool calls, API requests, etc.) is exported exclusively via the logs/events protocol, not as OTel metrics.

This caused confusion when setting up an OTel collector + ClickHouse pipeline - we spent time looking for data in otel_metrics_* tables when it was actually in otel_logs.

Expected Behavior (from docs)

  • OTEL_METRICS_EXPORTER=otlp would export time-series metrics
  • OTEL_LOGS_EXPORTER=otlp would export log events

Actual Behavior

  • All Claude Code telemetry (token counts, tool usage, API requests, costs) is exported as events via the logs protocol
  • Setting OTEL_METRICS_EXPORTER doesn't appear to export any traditional OTel metrics
  • OTEL_RESOURCE_ATTRIBUTES works correctly for logs/events ✅

Additional Context

What works well:

  • OTEL_RESOURCE_ATTRIBUTES="team=my-team" correctly applies to all log events
  • Events like claude_code.api_request, claude_code.tool_result, claude_code.user_prompt contain rich data in LogAttributes

Suggested doc improvements:

  1. Clarify that Claude Code exports events via OTel logs, not traditional metrics
  2. Explain that "metrics" like token usage are attributes on events, not separate metric signals
  3. Add example queries for backends like ClickHouse showing how to query otel_logs tables
  4. Clarify what OTEL_METRICS_EXPORTER actually does (if anything)

Environment

  • Claude Code version: 2.0.76
  • OS: macOS (Darwin 24.6.0)

---

cc: @avishkarsonni (Avishkar Sonni) - co-investigated this issue

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗