OTEL telemetry stopped working after auto-update to v2.1.72 with OTEL_LOG_TOOL_DETAILS: 1 and elastic apm 8.*
Bug Description
OpenTelemetry (OTEL) telemetry stopped working after auto-updating to v2.1.72 today. Data was confirmed to be flowing correctly on v2.1.71 (and presumably v2.1.70) but no activity is visible after the upgrade.
Environment
- Claude Code version: 2.1.72 (auto-updated 2026-03-10)
- Previous working version: 2.1.71
- OS: Linux (AWS, kernel 6.17.0-1007-aws)
- OTEL backend: Elastic APM via OTLP HTTP (
http/protobufprotocol)
Configuration
The following OTEL environment variables are set in ~/.claude/settings.json (sensitive values redacted):
CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT=https://<apm-server>:<port>
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer <token>
OTEL_SERVICE_NAME=claude-code
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta
OTEL_LOG_TOOL_DETAILS=1
OTEL_METRICS_INCLUDE_VERSION=true
NODE_TLS_REJECT_UNAUTHORIZED=0
What was verified
- ✅ OTLP endpoint is reachable (HTTP 200)
- ✅ Bearer token is valid — manual OTLP POST with a real protobuf payload returns
200with validExportLogsServiceResponse - ✅ Settings look structurally correct (all required env vars present)
- ✅ OTLP exporter class names are identical between v2.1.71 and v2.1.72 (
OTLPLogExporter,OTLPMetricExporter) - ❌ No telemetry data is appearing in the APM backend after upgrade
Suspected cause
The v2.1.72 binary is ~3MB smaller than v2.1.71 (234MB vs 237MB). The changelog mentions "Reduced bundle size by ~510 KB" and "Improved bash command parsing by switching to a native module — faster initialization and no memory leak." It's possible the native module switch changed initialization order, or a dependency change affected OTEL setup.
Reproduction
- Have OTEL telemetry working on v2.1.71 with
OTEL_METRICS_EXPORTER=otlpandOTEL_LOGS_EXPORTER=otlp - Allow Claude Code to auto-update to v2.1.72
- Restart a Claude Code session
- No telemetry data appears in the OTLP backend
Workaround
Currently testing whether rolling back to v2.1.71 restores telemetry (the binary is still available at ~/.local/share/claude/versions/2.1.71).
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Root Cause Identified
After extensive debugging, we've identified the root cause of the OTEL telemetry regression.
Summary
Claude Code's bundled OTEL SDK is using
@opentelemetry/exporter-logs-otlp-http(which sendsapplication/json) instead of@opentelemetry/exporter-logs-otlp-proto(which sendsapplication/x-protobuf). This happens regardless of theOTEL_EXPORTER_OTLP_PROTOCOL=http/protobufsetting. Elastic APM 8.17.4's OTLP endpoint (/v1/logs,/v1/metrics) only accepts protobuf — it returns HTTP 400 for JSON payloads:Evidence
1. The JSON exporter (what Claude Code uses) fails:
2. The proto exporter (what Claude Code should use) succeeds:
3. Proxy capture confirms the SDK sends JSON despite
http/protobufconfig:4. APM rejects JSON on OTLP endpoints:
Environment
9c4eedf2411a18eef6a08e94866bdff3— identical to v2.1.72)@opentelemetry/*v0.208.0 (approximate, from binary strings)What worked previously
606 events (logs + metrics) were successfully exported between March 7-8, 2026 on the same binary. The proto exporter was correctly selected during those sessions. Something in the exporter selection path changed between sessions — possibly related to initialization timing or env var loading order from
settings.json.Workaround
None currently available via configuration. The
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobufsetting is ignored by the bundled exporter selection logic.Possible workarounds:
Suggested Fix
Ensure Claude Code selects
@opentelemetry/exporter-logs-otlp-proto(and the equivalent metrics proto exporter) whenOTEL_EXPORTER_OTLP_PROTOCOL=http/protobufis configured. The binary already bundles bothprotobufjsand@bufbuildprotobuf libraries.I take it this is a me problem if no body else is experiencing it? I just don’t get why it was working and then stopped after the updated and yet I can manually get Claude to send test messages with the same credentials
Same issue here — confirmed on v2.1.74 (macOS arm64).
I was setting up OTel monitoring for my team's Claude Code usage (tracking MCP tool names and skill invocations via
OTEL_LOG_TOOL_DETAILS=1).Everything looked correctly configured, but no data was reaching our ClickHouse backend.
After hours of debugging, I narrowed it down to a version issue. Here's what I found:
### Setup
grpcandhttp/protobufprotocols### Results
| Version | Protocol | TCP to collector | Data received |
|---------|----------|-----------------|---------------|
| v2.1.71 | grpc | ESTABLISHED | ✅ 235 events |
| v2.1.74 | grpc | ESTABLISHED | ❌ 0 events (5+ min wait) |
| v2.1.71 | http/protobuf | ESTABLISHED | ✅ (
Content-Type: application/x-protobuf) || v2.1.74 | http/protobuf | ESTABLISHED | ❌ 0 events |
The interesting part:
lsofshows v2.1.74 maintains active TCP connections to the collector, so it's clearly attempting to send — but nothing arrives on the other end. This happens with bothgrpcandhttp/protobuf, so the issue seems broader than just the HTTP exporter mentioned in the original report.### Workaround
Rolled back to v2.1.71 via npm and confirmed all telemetry flows correctly — MCP tool events, Skill events, API requests:
```bash
npm install --prefix ~/.local/share/claude/versions/2.1.71 @anthropic-ai/claude-code@2.1.71
Datadog-specific OTLP metrics failures: logs work, metrics silently dropped
My config uses the env vars below including http/protobuf on both logs and metrics. Logs (api_request, user_prompt, etc) arrive in datadog no problem, but no metrics show up, confirmed across multiple sessions including one I left open for 50 minutes.
I believe it may be possible that the metrics exporter isn't initialising at all, rather than initialising but sending the wrong format.
My setup
Configured env vars
Steps to Reproduce
1. Console exporter produces no output
Set
OTEL_METRICS_EXPORTER=consolewith a 1s interval and captured everything to a file:Output was just 4. No metric JSON at any point during the session.
2. Local capture server receives nothing
Spun up a local HTTP server and pointed the metrics exporter at it:
The output of the claude session is 4, meanwhile the server is completely silent, it received zero requests. Meanwhile using the same setup to point to the logs endpoint the server successfully receives the post request:
Logs are working fine in the same setup, so OTEL_LOGS_EXPORTER=otlp is being picked up correctly. It seems specific to the metrics exporter.
Confirming on Windows 11 Pro (Git Bash, VSCode extension).
Same setup:
CLAUDE_CODE_ENABLE_TELEMETRY=1+ OTEL env vars in~/.claude/settings.json, local Jaeger onhttp://localhost:4318.CLAUDE_CODE_ENABLE_TELEMETRYappears empty in the shell despite being set in settings.jsonenvsectionTested with both
http/protobufandhttp/jsonprotocols — no data exported in either case.Deploying AWS usage monitoring from https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock and found a similar OTEL issue, but only with the following combination: Windows 11 + interactive mode + HTTPS.
I replaced the HTTPS OTEL listener with HTTP listener and interactive mode was able to send telemetry. I tested interactive Claude Code versions with WSL Ubuntu 24.04.3 LTS on the same computer and it worked as expected with both protocols.
OS: Windows 11
Shell: Powershell 7.5.4, cmd 10.0.26100.7840
Claude Code: 2.1.73, 2.1.76
Interactive mode = running claude.exe in shell to start session
Headless mode = claude.exe -p '${prompt string here}'
| OS | Monitoring Endpoint Protocol | Claude Code Mode | Telemetry Result |
|----------------|-------------------------------------|-------------------------|--------------------|
| Windows | HTTPS | Interactive | Fail |
| Windows | HTTP | Interactive | Pass |
| Windows | HTTPS | Headless | Pass |
I believe I have found the culprit
OTEL_LOG_TOOL_DETAILS: 1We were building out our skills repo today and were trying to trace skill uses.
The moment this was added today logs dropped
Confirming HTTPS-specific silent failure on macOS — v2.1.91,
http/jsonprotocol.Environment
http/jsonNODE_TLS_REJECT_UNAUTHORIZED, noOTEL_LOG_TOOL_DETAILSConfiguration (env vars sourced in shell)
What I tested
| Test | Protocol | Result |
|------|----------|--------|
| Claude interactive session →
http://localhost:19878| HTTP | 2 events received (user_prompt,api_request) || Claude interactive session →
https://<endpoint>| HTTPS | 0 events received || Claude
--printmode →http://localhost| HTTP | Events received || Claude
--printmode →https://<endpoint>| HTTPS | 0 events || Direct
curlPOST → same HTTPS endpoint | HTTPS | 1 event processed || Node.js
fetch()→ same HTTPS endpoint | HTTPS | 1 event processed |The endpoint is fully reachable and processes events correctly when called directly. Only the OTel SDK's
OTLPLogExporterinside Claude Code fails to deliver to HTTPS.Debug log confirms init succeeds
Additional data points
CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS=15000andCLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS=15000did not help.NODE_OPTIONS="--dns-result-order=ipv4first"did not help.This aligns with @symplr-dlyons's finding that HTTPS fails in interactive mode. It appears to also affect macOS (not just Windows), and specifically
http/jsonprotocol (not justhttp/protobuf).This is what I found on the Mac client. NOt sure if it's the same issue for LInux.
Root cause (hypothesis, with evidence)
The Bun-compiled binary does not include the OTLP exporter packages. The SDK's factory code dynamically require()s them at runtime, resolves to null/undefined, and a destructuring assignment throws — which is caught and swallowed.
Evidence — strings in the binary:
$ strings /Users//.local/share/claude/versions/2.1.113
| grep -oE '@opentelemetry/[a-z0-9/._-]+' | sort -u
@opentelemetry/api
Only the API package. No exporter packages.
Error strings baked into the binary (clearly caught, never surfaced):
Cannot destructure property 'OTLPMetricExporter' from null or undefined value
Cannot destructure property 'OTLPLogExporter' from null or undefined value
Cannot destructure property 'OTLPTraceExporter' from null or undefined value
Console exporter IS bundled (which is why it works):
$ strings /Users//.local/share/claude/versions/2.1.113
| grep -iE 'consolemetricexporter'
ConsoleMetricExporter
Installing the missing packages globally (npm i -g @opentelemetry/exporter-metrics-otlp-proto) and setting NODE_PATH=$(npm root -g) does not help — Bun-compiled binaries don't resolve externals at runtime the way a Node script would.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.