claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Monitoring(OpenTelemetry) is broken since 2.64, still not working in 2.67 (latest version)

Open FutureGadget opened this issue 2 weeks ago • 4 comments

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?

Claude Code Opentelemetry feature is broken. Broken means it does not produce any logs / metrics. It does not produce metrics / logs even after we configure that.

What Should Happen?

After we configure the telemetry setting, the claude code should produce metrics / logs.

Error Messages/Logs

No error messages found.

Steps to Reproduce

~/.claude/settings.json

{
  "env": {
    "AWS_PROFILE": "<AWS ROLE>",
    "AWS_REGION": "<AWS REGION>",
    "NODE_TLS_REJECT_UNAUTHORIZED": 0,
    "ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION": "<AWS REGION>",
    "CLAUDE_CODE_USE_BEDROCK": 1,
    "ANTHROPIC_MODEL": "<Model Inference Profile ID>",
    "ANTHROPIC_SMALL_FAST_MODEL": "<Model Inference Profile ID>",
    "ANTHROPIC_CUSTOM_HEADERS": "X-Amzn-Bedrock-GuardrailIdentifier: <GuardrailID>\nX-Amzn-Bedrock-GuardrailVersion: <GuardrailVersion>",
    "CLAUDE_CODE_ENABLE_TELEMETRY": 1,
    "OTEL_METRICS_EXPORTER": "console",
    "OTEL_METRIC_EXPORT_INTERVAL": 1000,
    "OTEL_METRICS_INCLUDE_SESSION_ID": false,
    "OTEL_RESOURCE_ATTRIBUTES": "user.name=testuser"
  }
}

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.64

Claude Code Version

2.0.67

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

We have a dashboard that monitors usage. In the claude_code_active_time_seconds_total metric, the last version we are seeing is 2.0.64.

FutureGadget avatar Dec 12 '25 14:12 FutureGadget

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/13771

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 12 '25 14:12 github-actions[bot]

Additional Debugging Data - Independent Confirmation

yes, Claude code helped me debug and write this comment!

I hit this same issue and spent significant time debugging before finding this issue. Adding my findings in case they help the investigation:

Environment

  • Claude Code Version: 2.0.67
  • Platform: macOS Tahoe 26.1
  • API: Anthropic API (not Bedrock)

What Was Tested

  1. Console exporter (no network required):

    CLAUDE_CODE_ENABLE_TELEMETRY=1 \
    OTEL_METRICS_EXPORTER=console \
    OTEL_METRIC_EXPORT_INTERVAL=5000 \
    claude
    

    Result: Zero output after 5+ minutes of active usage (file edits, prompts, tool calls), including after /exit

  2. Debug logging enabled:

    {
      "env": {
        "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
        "OTEL_METRICS_EXPORTER": "console",
        "OTEL_LOG_LEVEL": "debug",
        "OTEL_METRIC_EXPORT_INTERVAL": "10000"
      }
    }
    

    Result: No OTEL debug output whatsoever - SDK appears to never initialize

  3. OTLP endpoint (verified working):

    • Tested endpoint directly with curl → HTTP 200
    • Logs show zero POST requests from Claude Code
    • Alloy OTLP receiver healthy and waiting

Key Finding

The OTEL SDK does not initialize at all in v2.0.67. Even with OTEL_METRICS_EXPORTER=console (which requires no network and should print directly to stdout), nothing is output. This rules out any endpoint/network configuration issues.

Verification Steps Taken

  • ✅ Confirmed no managed settings override (/Library/Application Support/ClaudeCode/ doesn't exist)
  • ✅ Confirmed env vars are set correctly in ~/.claude/settings.json
  • ✅ Confirmed env vars exported in shell before running claude
  • ✅ Tested both interactive sessions and -p single commands
  • ✅ Checked statsig feature flags cache (no obvious telemetry disable flag visible)

Conclusion

This appears to be a complete failure of OTEL SDK initialization in versions 2.0.64+, not a configuration or export issue. The telemetry subsystem simply doesn't start.

Happy to provide additional debugging if helpful!

I found this EXACT same issue and came to report it, thank you for mentioning this, @andrewmitchell-automations

rbonestell avatar Dec 12 '25 19:12 rbonestell

Credit to @FutureGadget for the initial report. On that note, @FutureGadget, any chance you can update the tags to reflect that this is not just an issue on AWS Bedrock? I'm getting it on desktop.

Hey folks, I can confirm this is broken. A fix was merged and we'll get it to you asap (on Monday afternoon at the latest).

igorkofman avatar Dec 13 '25 18:12 igorkofman

As a workaround, you can set the otel env-vars in you shell instead of in settings.json for now.

igorkofman avatar Dec 13 '25 18:12 igorkofman

As a workaround, you can set the otel env-vars in you shell instead of in settings.json for now.

This is what I have done, however it adds non-zero complexity to mass assignment of managed settings via MDM. Thanks for getting to this issue so quickly!

rbonestell avatar Dec 13 '25 19:12 rbonestell

Looks like on v2.0.70 it started working again. Telemetry successfully sent using otel

mdolinin avatar Dec 16 '25 20:12 mdolinin

Yes it's working since 2.0.70. I just upgraded to 2.0.71 and it's working too 😃 Thanks for the quick follow up!

FutureGadget avatar Dec 17 '25 12:12 FutureGadget

Sorry for the trouble here. This was fixed in v2.0.70. Thanks everyone for the detailed debugging info and for your patience!

vadim-anthropic avatar Dec 19 '25 18:12 vadim-anthropic