claude-code - 💡(How to fix) Fix [BUG] OTLP metric exporter never initialized in 2.1.126 (regression ~2026-04-30) [5 comments, 3 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#56021Fetched 2026-05-05 06:00:14
View on GitHub
Comments
5
Participants
3
Timeline
13
Reactions
0
Timeline (top)
commented ×5labeled ×4closed ×1cross-referenced ×1

Error Message

Error Messages/Logs

Code Example

[3P telemetry] getOtlpMetricExporters: types=["otlp"], protocol=http/protobuf, endpoint=https://otlp.datadoghq.eu/v1/metrics
[3P telemetry] Created 1 metric exporter(s)

---

[DEBUG] CA certs: Config fallback - settingsEnv keys: CLAUDE_CODE_ENABLE_TELEMETRY,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE,OTEL_EXPORTER_OTLP_PROTOCOL,OTEL_METRICS_EXPORTER,OTEL_RESOURCE_ATTRIBUTES,OTEL_EXPORTER_OTLP_HEADERS
[DEBUG] [3P telemetry] Waiting for remote managed settings before telemetry init
[DEBUG] [3P telemetry] Remote managed settings loaded, initializing telemetry
[DEBUG] [3P telemetry] isTelemetryEnabled=true (CLAUDE_CODE_ENABLE_TELEMETRY=1)
[DEBUG] [3P telemetry] getOtlpLogExporters: types=[], protocol=http/protobuf, endpoint=undefined
[DEBUG] [3P telemetry] Created 0 log exporter(s)
[DEBUG] Org fast mode: disabled (extra_usage_disabled)
[DEBUG] BigQuery metrics exported successfully

---

{
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
    "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT": "https://otlp.datadoghq.eu/v1/metrics",
    "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": "delta",
    "OTEL_EXPORTER_OTLP_HEADERS": "DD-API-KEY=<redacted>,dd-otel-metric-config={\"resource_attributes_as_tags\": true}",
    "OTEL_RESOURCE_ATTRIBUTES": "user.email=<redacted>"
  }
}
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
  • I am using the latest version of Claude Code

What's Wrong?

OTEL_METRICS_EXPORTER=otlp is configured but no metrics are exported. Debug log shows the OTLP log exporter init runs, but the OTLP metric exporter init is silently absent — there is no getOtlpMetricExporters line and no Created N metric exporter(s) line.

Metrics stopped arriving at our Datadog org around 2026-04-30 and have not resumed. Worked fine before that.

What Should Happen?

Symmetric to the log path:

[3P telemetry] getOtlpMetricExporters: types=["otlp"], protocol=http/protobuf, endpoint=https://otlp.datadoghq.eu/v1/metrics
[3P telemetry] Created 1 metric exporter(s)

Error Messages/Logs

claude --debug, ~/.claude/debug/latest:

[DEBUG] CA certs: Config fallback - settingsEnv keys: CLAUDE_CODE_ENABLE_TELEMETRY,OTEL_EXPORTER_OTLP_METRICS_ENDPOINT,OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE,OTEL_EXPORTER_OTLP_PROTOCOL,OTEL_METRICS_EXPORTER,OTEL_RESOURCE_ATTRIBUTES,OTEL_EXPORTER_OTLP_HEADERS
[DEBUG] [3P telemetry] Waiting for remote managed settings before telemetry init
[DEBUG] [3P telemetry] Remote managed settings loaded, initializing telemetry
[DEBUG] [3P telemetry] isTelemetryEnabled=true (CLAUDE_CODE_ENABLE_TELEMETRY=1)
[DEBUG] [3P telemetry] getOtlpLogExporters: types=[], protocol=http/protobuf, endpoint=undefined
[DEBUG] [3P telemetry] Created 0 log exporter(s)
[DEBUG] Org fast mode: disabled (extra_usage_disabled)
[DEBUG] BigQuery metrics exported successfully

(BigQuery metrics ... is Anthropic's 1P internal exporter, unrelated.)

No getOtlpMetricExporters line and no Created N metric exporter(s) line ever appears, regardless of whether OTEL_LOGS_EXPORTER is set.

Steps to Reproduce

~/.claude/settings.json (env section):

{
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
    "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT": "https://otlp.datadoghq.eu/v1/metrics",
    "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": "delta",
    "OTEL_EXPORTER_OTLP_HEADERS": "DD-API-KEY=<redacted>,dd-otel-metric-config={\"resource_attributes_as_tags\": true}",
    "OTEL_RESOURCE_ATTRIBUTES": "user.email=<redacted>"
  }
}
  1. Run claude --debug.
  2. Inspect ~/.claude/debug/latest.
  3. Observe metric exporter init never runs (no getOtlpMetricExporters line).
  4. No metrics arrive at Datadog.

Diagnostics

  • DD-API-KEY validated independently: curl -i -X POST https://otlp.datadoghq.eu/v1/metrics -H 'DD-API-KEY: <redacted>' -H 'Content-Type: application/x-protobuf' --data-binary ''HTTP/2 400 / Payload is empty — key + endpoint OK.
  • No local managed-settings.json present (broken symlink at /Library/Application Support/ClaudeCode/managed-settings.json); only remote managed settings load.
  • Setting OTEL_LOGS_EXPORTER=otlp makes the log exporter run (separate 403 from otlp.datadoghq.eu/v1/logs — Datadog's OTLP intake at that host is metrics-only; unrelated).
  • Datadog org-wide claude_code.* metric ingestion across all users in our tenant cuts off at the same time (~2026-04-30 ~01:00 UTC), suggesting a Claude Code release / remote-managed-setting rollout, not a per-user config issue.

Possibly Related

  • #55105 (Honeycomb env-var leakage) — fix landed 2026-05-04, but our cutoff predates it.

Claude Model

Opus

Is this a regression?

Yes — was working before ~2026-04-30.

Last Working Version

Unknown exact version; metrics flowing prior to 2026-04-30.

Claude Code Version

2.1.126

Platform

Anthropic API / direct (not Bedrock / Vertex)

Operating System

macOS (Darwin 25.4.0)

Terminal/Shell

zsh

Additional Information

If this is gated behind a remote-managed setting (e.g. extra_usage_disabled), please document it and expose a way for users to opt back in.

extent analysis

TL;DR

The issue is likely due to a change in the remote-managed settings, causing the OTLP metric exporter to not initialize, and can be temporarily worked around by investigating the extra_usage_disabled setting.

Guidance

  • Investigate the extra_usage_disabled setting in the remote-managed settings to see if it's causing the OTLP metric exporter to not initialize.
  • Check the Datadog org-wide metric ingestion to see if there are any changes or issues on their end that could be causing the metrics to not arrive.
  • Verify that the OTEL_METRICS_EXPORTER environment variable is set to otlp and that the OTEL_EXPORTER_OTLP_METRICS_ENDPOINT is correctly set to https://otlp.datadoghq.eu/v1/metrics.
  • Consider setting OTEL_LOGS_EXPORTER=otlp to see if the log exporter runs, which could provide more insight into the issue.

Example

No code snippet is provided as it's not necessary for this issue.

Notes

The issue seems to be related to a change in the remote-managed settings, and the extra_usage_disabled setting might be the cause. The fact that the metrics stopped arriving at the same time for all users in the Datadog org suggests a Claude Code release or remote-managed-setting rollout issue.

Recommendation

Apply workaround: Investigate the extra_usage_disabled setting and try to opt back in to see if it resolves the issue. This is recommended because the issue seems to be related to a change in the remote-managed settings, and investigating this setting could provide more insight into the issue.

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] OTLP metric exporter never initialized in 2.1.126 (regression ~2026-04-30) [5 comments, 3 participants]