[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.
10 Comments
Update: confirmed this is a regression with a known last-working version.
I found CloudWatch Logs Insights exports from my own account showing that
log/events were ingested correctly on earlier versions:
Event types received back then:
claude_code.user_prompt,api_request(with input_tokens / output_tokens / cost_usd),
tool_result,tool_decision,mcp_server_connection,hook_execution_start/hook_execution_complete.Same machine, same CloudWatch Logs OTLP endpoint, same config family.
On 2.1.159 none of these events are emitted (not even to the console exporter),
while metrics still work.
Last working version: 2.1.132 → regression introduced somewhere between
2.1.132 and 2.1.159.
This is a real rollout blocker — enterprise auth/proxy friction is one of the top reasons AI coding tools fail internal adoption. Here's what I'd check immediately:
Diagnostic matrix (4 steps):
NODE_EXTRA_CA_CERTS=/path/to/corp-ca.pem claudeexplicitly. Many proxy issues are CA trust issues, not auth issues. Also check:npm config get cafileandexport NODE_TLS_REJECT_UNAUTHORIZED=0(temporary diagnostic only).HTTPS_PROXY=http://proxy:portvsHTTPS_PROXY=https://proxy:portandHTTP_PROXYvariants. The tool may be using a different transport than you expect.curl -v --proxy ...and compare to direct.ENOEXEC/postinstallblocks are usually group policy or endpoint protection, not the tool itself. Try running the blocked script manually:bash -x $(which claude). If it works manually but not via npm/yarn lifecycle, the package manager's sandboxed execution is the culprit.I write about this class of problem regularly — enterprise rollout friction kills more AI coding ROI than any bug. The pattern is almost always: (1) CA trust, (2) proxy protocol, (3) execution policy, in that order. Happy to share a hardening checklist if you want to go deeper.
Hi, thank you very much for taking the time to share these diagnostic
suggestions — I really appreciate the detailed write-up.
That said, I'd like to clarify that this issue is not network, proxy,
or authentication related. As described in the issue body, I have
already ruled out those layers through the following observations:
consoleexporter (which involves no network at all) alsoproduces zero log records, while the
metricsexporter works finewithin the very same process.
same machine returns HTTP 200, which confirms that the backend,
credentials, and network path are all healthy.
the npm package, so it is not install-method-specific either.
Given these results, the failure appears to be upstream of any
transport layer — specifically within the log/events pipeline itself.
If you happen to have observations specifically related to the OTel
logs exporter behavior on Windows v2.1.159, I would be very glad to
hear them. Thank you again for your input!
I've been operating multi-agent coding systems in production and this looks familiar. A few things that might help narrow it down:
Happy to dig deeper if you share more details about when it triggers.
Thanks again for following up — I appreciate your continued interest in this one.
To clarify, though, this isn't a multi-agent or tool-execution issue.
The problem reproduces even with a single, minimal
claude -ppromptand no tools involved, so there's no load or logic pattern to narrow
down on the agent side.
To re-summarize the key signals from the issue body:
consolelogs exporter (no network, no agents) emits zerorecords, while the
metricsexporter works fine in the same run.N tool calls or any specific operation.
So the scope is narrower than it might look: it's specifically the
log/events pipeline that produces nothing, regardless of agent
workflow or session length.
If you've seen this specific behavior with the OTel logs exporter
itself, I'd genuinely love to compare notes. Thanks again!
Still reproduces on 2.1.160 (native installer): with OTEL_LOGS_EXPORTER=console, metrics print but zero log/events. No fix yet.
Possibly related:
silently. Reported for metrics, but the same pattern would hit OTLPLogExporter.
Note: in my case it also reproduces on the npm build, so it may not be Bun-only.
Update — root cause found; correcting my original report
After deeper investigation, my original "log/events are never emitted" framing turned
out to be inaccurate. The log records ARE generated and POSTed. The real bug is that
OTEL_EXPORTER_OTLP_HEADERSis ignored on http/json log export in 2.1.159/2.1.160.Here is the full picture.
1. Why "console shows nothing" was misleading
Binary inspection of the 2.1.160 native (Bun-compiled) executable:
ConsoleLogRecordExporteris not bundled, whileConsoleMetricExporteris. SoOTEL_LOGS_EXPORTER=consoleprinting nothing does NOT prove events aren't generated —the console log exporter simply isn't there. (cf. #50567 bundling gaps.)
OTLPLogExporterIS bundled, so OTLP export does run.2. Logs ARE generated and sent — verified with a local OTLP receiver
Pointing the exporter at a local node http server, every
claude -prun producesmultiple
POST /v1/logs(e.g. bytes=13372, 2949, ...). So generation + OTLP send work.3. Decisive control test: OTEL_EXPORTER_OTLP_HEADERS is ignored
Same local server, same 4 headers, only the sender differs.
Config for the Claude Code run:
Received by the server:
authorizationlen=20 == the configured"Bearer DUMMYTOKEN123".X-Test-A/B/Centirely, and sendsauthorization**len=71 — NOTthe configured 20-char value**. The 71-char value is constant regardless of the
configured token (a 128-char CloudWatch API key also came out as 71).
→ Claude Code does not apply the user-configured headers. Custom headers are dropped,
and the Authorization value is overridden by an internal 71-char token.
4. Why this breaks CloudWatch Logs
CloudWatch Logs OTLP requires
x-aws-log-group/x-aws-log-streamheaders and aspecific bearer token. All three are dropped/overridden, so ingestion always fails —
while a manual PowerShell POST with the same headers returns HTTP 200, confirming the
backend and credentials are fine.
5. Regression range
Worked on 2.1.132 (CloudWatch ingest confirmed in my own logs from 2026-05-07).
Broken on 2.1.159 and 2.1.160, on both the native installer and the npm package.
So the regression landed somewhere between 2.1.132 and 2.1.159.
Questions for maintainers
OTEL_EXPORTER_OTLP_HEADERSnot applied to http/json log exports?Authorizationbeing sent to the configured endpoint?(Potential concern: an internal token is sent to whatever OTLP endpoint is set.)
Possibly related
Self-resolved — this was NOT a Claude Code bug. Root cause: my org ships a
remote-settings.json (org-managed telemetry config) that overrides my local
settings.json env, redirecting OTLP to an internal endpoint with its own token.
That's why my CloudWatch headers/token were "ignored". Closing. Apologies for the noise.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.