[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=otlpwould export time-series metricsOTEL_LOGS_EXPORTER=otlpwould 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_EXPORTERdoesn't appear to export any traditional OTel metrics OTEL_RESOURCE_ATTRIBUTESworks 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_promptcontain rich data inLogAttributes
Suggested doc improvements:
- Clarify that Claude Code exports events via OTel logs, not traditional metrics
- Explain that "metrics" like token usage are attributes on events, not separate metric signals
- Add example queries for backends like ClickHouse showing how to query
otel_logstables - Clarify what
OTEL_METRICS_EXPORTERactually does (if anything)
Environment
- Claude Code version: 2.0.76
- OS: macOS (Darwin 24.6.0)
---
cc: @avishkarsonni (Avishkar Sonni) - co-investigated this issue
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗