claude-code - 💡(How to fix) Fix [BUG] OTEL metrics not exported on Claude Code ≥ v2.1.113 (confirmed with mTLS configuration) [2 comments, 2 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#52353Fetched 2026-04-24 06:09:26
View on GitHub
Comments
2
Participants
2
Timeline
10
Reactions
2
Timeline (top)
labeled ×5commented ×2cross-referenced ×1renamed ×1

Fix Action

Fix / Workaround

Since v2.1.113, Claude Code no longer exports OTEL metrics to a configured OTLP endpoint. No metrics reach the backend despite a correct configuration that worked on v2.1.112. The issue persists through the latest v2.1.118. This appears to be a duplicate of #50567. We can confirm the same silent failure with an mTLS configuration (OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE / OTEL_EXPORTER_OTLP_CLIENT_KEY). Pinning to v2.1.112 restores metrics export as a workaround

  1. Configure the following environment variables (in ~/.zshrc or ~/.claude/settings.json):
CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT=https://<collector>
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE=~/.claude/claude-metrics-certs/client.crt
OTEL_EXPORTER_OTLP_CLIENT_KEY=~/.claude/claude-metrics-certs/client.key
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta
  1. Install v2.1.112: npm install -g @anthropic-ai/[email protected] --registry https://registry.npmjs.org
  2. Start a session and send a few messages → metrics appear in backend ✅
  3. Upgrade to v2.1.113+: npm install -g @anthropic-ai/[email protected] --registry https://registry.npmjs.org
  4. Start a session and send a few messages → no metrics appear ❌

Code Example

CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT=https://<collector>
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE=~/.claude/claude-metrics-certs/client.crt
OTEL_EXPORTER_OTLP_CLIENT_KEY=~/.claude/claude-metrics-certs/client.key
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta

---

OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE=~/.claude/claude-metrics-certs/client.crt
OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY=~/.claude/claude-metrics-certs/client.key
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Since v2.1.113, Claude Code no longer exports OTEL metrics to a configured OTLP endpoint. No metrics reach the backend despite a correct configuration that worked on v2.1.112. The issue persists through the latest v2.1.118. This appears to be a duplicate of #50567. We can confirm the same silent failure with an mTLS configuration (OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE / OTEL_EXPORTER_OTLP_CLIENT_KEY). Pinning to v2.1.112 restores metrics export as a workaround

What Should Happen?

Metrics should be exported to the configured OTLP endpoint as they were on ≤ v2.1.112.

Steps to Reproduce

  1. Configure the following environment variables (in ~/.zshrc or ~/.claude/settings.json):
CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT=https://<collector>
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE=~/.claude/claude-metrics-certs/client.crt
OTEL_EXPORTER_OTLP_CLIENT_KEY=~/.claude/claude-metrics-certs/client.key
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta
  1. Install v2.1.112: npm install -g @anthropic-ai/[email protected] --registry https://registry.npmjs.org
  2. Start a session and send a few messages → metrics appear in backend ✅
  3. Upgrade to v2.1.113+: npm install -g @anthropic-ai/[email protected] --registry https://registry.npmjs.org
  4. Start a session and send a few messages → no metrics appear ❌

Also tried switching to the metrics-specific cert vars — no change:

OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE=~/.claude/claude-metrics-certs/client.crt
OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY=~/.claude/claude-metrics-certs/client.key

Claude Model

claude-sonnet-latest

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.112

Claude Code Version

2.1.118

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

extent analysis

TL;DR

Pinning the Claude Code version to v2.1.112 restores metrics export as a workaround.

Guidance

  • The issue seems to be related to a regression introduced in version v2.1.113, causing OTEL metrics to not be exported to the configured OTLP endpoint.
  • To verify the issue, follow the provided steps to reproduce, which involve configuring environment variables, installing specific versions of Claude Code, and checking if metrics appear in the backend.
  • As a temporary workaround, pin the version to v2.1.112 using npm install -g @anthropic-ai/[email protected] --registry https://registry.npmjs.org.
  • If using an mTLS configuration, ensure that the OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE and OTEL_EXPORTER_OTLP_CLIENT_KEY environment variables are correctly set.

Notes

The provided information suggests that this is a regression introduced in version v2.1.113, and the workaround is to use version v2.1.112. However, without further information or debugging, it's difficult to provide a more permanent solution.

Recommendation

Apply workaround: Pin the Claude Code version to v2.1.112, as it has been confirmed to restore metrics export. This is a temporary solution until the issue is fixed in a future version.

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

claude-code - 💡(How to fix) Fix [BUG] OTEL metrics not exported on Claude Code ≥ v2.1.113 (confirmed with mTLS configuration) [2 comments, 2 participants]