[BUG] Log/events exporter emits nothing while metrics work fine (Windows native v2.1.159)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
With telemetry enabled, metrics export normally but log/events are never emitted at all — not even to the console exporter.
OTEL_METRICS_EXPORTER=consolecorrectly printsclaude_code.session.count,cost.usage,token.usage,active_time.total.OTEL_LOGS_EXPORTER=console(with metrics off) prints zero log records — noseverityText/body/event.nameoutput.- Therefore no
claude_code.user_prompt/api_request/tool_resultevents are produced, and nothing reaches our OTLP backend (CloudWatch Logs).
Because it fails at the console exporter (no network involved), this is not a network/firewall/endpoint/auth problem — events are simply never generated or flushed. A manual OTLP POST from PowerShell to the same CloudWatch endpoint/token returns HTTP 200, confirming the backend is fine.
Reproduced identically on both the native installer build and the npm package at v2.1.159, so it is not install-method-specific — it points to a core regression in the log/events pipeline.
What Should Happen?
With OTEL_LOGS_EXPORTER set, Claude Code should emit log/events (at minimum user_prompt and api_request, per the docs) to the configured exporter, just as metrics are emitted. With console, these records should print to the console.
Error Messages/Logs
# OTEL_METRICS_EXPORTER=console → metrics DO print (excerpt):
{
descriptor: { name: "claude_code.session.count", type: "COUNTER", ... },
dataPoints: [ { attributes: { ... }, value: 1 } ],
}
{ descriptor: { name: "claude_code.token.usage", ... }, dataPoints: [ ... ] }
# (cost.usage, active_time.total also printed)
# OTEL_LOGS_EXPORTER=console, OTEL_METRICS_EXPORTER=none → NOTHING printed:
# 0 log records. No severityText / body / event.name lines at all.
# Reproduced with: claude -p, interactive session, and
# OTEL_LOGS_EXPORT_INTERVAL=500 + a multi-second prompt.
# Same result on both native installer and npm package.
Steps to Reproduce
- Configure telemetry (shell env or settings.json):
CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_LOGS_EXPORTER=console
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORT_INTERVAL=500
- Run: claude -p "Explain why the sky is blue in 200 words."
(a multi-second prompt so several export windows elapse)
- Observe console output.
Expected: log records (user_prompt, api_request, ...) printed by the console exporter.
Actual: zero log records — only the assistant's reply is printed.
Cross-checks:
- Switching OTEL_METRICS_EXPORTER=console shows metrics print fine (so telemetry init works).
- With OTEL_LOGS_EXPORTER=otlp to a CloudWatch Logs endpoint, nothing arrives, while a manual PowerShell OTLP POST to the same endpoint returns HTTP 200.
- Reproduced on both native installer (~/.local/bin/claude.exe) and npm (@anthropic-ai/claude-code).
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
~~Unknown exact version; telemetry was confirmed working around 2026-05-11.~~
regression introduced somewhere between
2.1.132 and 2.1.159.
Claude Code Version
2.1.159 — reproduced on BOTH native installer build and npm package (@anthropic-ai/claude-code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
- Auth: organization SSO (OAuth) account.
- Backend: CloudWatch Logs OTLP endpoint (/v1/logs), verified independently working via a manual PowerShell OTLP POST (HTTP 200).
- Metrics export fine; only log/events are dead, in both install methods.
- Possibly related: #39471 (events not emitted), but that one is Cowork/macOS and loses all signals; here metrics work and only logs are dead.
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗