claude-code - 💡(How to fix) Fix OTEL_LOG_RAW_API_BODIES silently no-ops on Claude Desktop 1.5354 / embedded SDK 2.1.121 [2 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55962Fetched 2026-05-05 06:01:48
View on GitHub
Comments
2
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×5commented ×2

Setting OTEL_LOG_RAW_API_BODIES=1 on Claude Desktop 1.5354.0 (instrumentation scope com.anthropic.claude_code.events v2.1.121) produces claude_code.api_request log records with no request/response body attributes. The same env var works correctly on:

  • Claude Desktop 1.3883 (SDK 2.1.111) — bodies emitted ✅
  • Claude Code CLI 2.1.123 — bodies emitted ✅

So this is a regression in the desktop bundle between SDK 2.1.111 → 2.1.121.

Root Cause

Related

  • #50567 — OTEL_METRICS_EXPORTER=otlp silently no-ops in 2.1.113. Likely same root cause class (dynamic OTLP package require failing silently in the Bun-compiled binary).
  • #55269 — confirms bodies are being emitted in CLI 2.1.126 (just missing trace_id/span_id), suggesting the gap is desktop-bundle-specific, not a global removal.
  • #33301, #25389 — earlier "OTEL works in CLI, no-ops in non-CLI surface" reports.

Code Example

OTEL_LOG_RAW_API_BODIES=1
   OTEL_LOGS_EXPORTER=otlp
   OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
   OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 (exposed via ngrok)

---

model, input_tokens, output_tokens, cache_read_tokens,
cache_creation_tokens, cost_usd, duration_ms,
request_id, speed, query_source, effort
RAW_BUFFERClick to expand / collapse

Claude cowork team plan (team customers)

Summary

Setting OTEL_LOG_RAW_API_BODIES=1 on Claude Desktop 1.5354.0 (instrumentation scope com.anthropic.claude_code.events v2.1.121) produces claude_code.api_request log records with no request/response body attributes. The same env var works correctly on:

  • Claude Desktop 1.3883 (SDK 2.1.111) — bodies emitted ✅
  • Claude Code CLI 2.1.123 — bodies emitted ✅

So this is a regression in the desktop bundle between SDK 2.1.111 → 2.1.121.

Reproduction

  1. Run a local OTLP collector on :4318 with max_request_body_size: 0 and a file exporter for ground-truth inspection.
  2. Launch Claude Desktop 1.5354.0 from a shell with:
    OTEL_LOG_RAW_API_BODIES=1
    OTEL_LOGS_EXPORTER=otlp
    OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
    OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 (exposed via ngrok)
  3. Send any prompt. Inspect the captured OTLP claude_code.api_request log records (file exporter dump or downstream backend).

Observed

claude_code.api_request records contain only:

model, input_tokens, output_tokens, cache_read_tokens,
cache_creation_tokens, cost_usd, duration_ms,
request_id, speed, query_source, effort

No request_body, response_body, or any body-shaped attribute. Verified directly from the collector's raw OTLP file capture — i.e. the desktop app is not emitting bodies at the OTLP wire; it is not a downstream filter or size-limit issue.

Expected

Body attributes present on api_request records when OTEL_LOG_RAW_API_BODIES=1, as on CLI 2.1.123 and the older 1.3883 desktop build.

Environment

  • macOS 26.4.1, arm64
  • Claude Desktop 1.5354.0
  • Embedded scope com.anthropic.claude_code.events 2.1.121

Related

  • #50567 — OTEL_METRICS_EXPORTER=otlp silently no-ops in 2.1.113. Likely same root cause class (dynamic OTLP package require failing silently in the Bun-compiled binary).
  • #55269 — confirms bodies are being emitted in CLI 2.1.126 (just missing trace_id/span_id), suggesting the gap is desktop-bundle-specific, not a global removal.
  • #33301, #25389 — earlier "OTEL works in CLI, no-ops in non-CLI surface" reports.

extent analysis

TL;DR

The issue can be potentially resolved by downgrading the SDK version to 2.1.111 or investigating the dynamic OTLP package require issue in the Bun-compiled binary.

Guidance

  • Investigate the difference in behavior between Claude Desktop 1.5354.0 and the older 1.3883 desktop build to identify the regression cause.
  • Verify that the OTEL_LOG_RAW_API_BODIES=1 environment variable is being set correctly and is not being overridden.
  • Check the OTLP collector configuration to ensure that it is not filtering out the request and response body attributes.
  • Review the related issues (#50567, #55269, #33301, #25389) to see if there are any common patterns or potential solutions.

Example

No code snippet is provided as the issue is related to a specific version of the Claude Desktop and SDK.

Notes

The issue seems to be specific to the desktop bundle and not a global removal of body attributes. The fact that the CLI version 2.1.123 works correctly suggests that the issue is not with the SDK version itself, but rather with the desktop bundle.

Recommendation

Apply a workaround by downgrading the SDK version to 2.1.111, which is known to work correctly, until the root cause of the issue is identified and fixed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING