[BUG] Error: Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL
Status Fixed / completed
Maintainer reply ✓ Yes — sid374
Activity 10 comments · opened May 21, 2025 · closed Jun 27, 2025
💡 Likely answer: A maintainer (sid374, contributor)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: ?
- Operating System: macOs 10.15.5
- Terminal: ghostty
- Node.js v23.11.0
Bug Description
After using Claude today it said that was an upgrade so I quit and restarted Claude, but it fails with:
Error: Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: undefined
at jT5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1453:6529)
at xT5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1453:7131)
at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1453:7874
Steps to Reproduce
- Upgrade claude
- run claude
Expected Behaviour
No crash
Actual Behavior
crash
Additional Context
I tried deleting and reinstalling but got the same issue.
10 Comments
@channingwalton are you trying to use any of the open telemetry features as documented here?
Specifically do you have the following env vars set:
CLAUDE_CODE_ENABLE_TELEMETRY=1andOTEL_EXPORTER_OTLP_METRICS_PROTOCOLorOTEL_EXPORTER_OTLP_PROTOCOLNo, I ran claude successfully, it said there was an update and to restart, so I did, and the result was this bug.
Sorry I do have the following set
Deleting that has resolved the problem.
But as I say it did work prior to the upgrade.
BTW, that doc link seems to be an internal anthropic url
Thanks, fixed the link. Glad you are unblocked now, and we'll look into a possible regression.
Also curious what your use case for setting up OTEL was?
I really don't recall doing it, I must have copied it from somewhere blindly.
Found it, I copied it from the settings docs.
I hit this problem Today, after claude updated to
1.0.31; Nothing was changed in my development environment.I have to follow these steps to make it work again:
You can make your OpenTelemetry configuration permanent by adding it to your Claude Code settings file. Here's how:
Add the environment variables to your user settings file at
~/.claude/settings.json:This will apply these settings every time you run Claude Code.
For project-specific settings, you can add them to
.claude/settings.jsonin your project directory.If you're an administrator configuring for multiple users, you can set these in the managed settings file:
macOS:
/Library/Application Support/ClaudeCode/managed-settings.jsonLinux:
/etc/claude-code/managed-settings.jsonSource: https://docs.anthropic.com/en/docs/claude-code/monitoring-usage
This issue seems resolved. Closing this - feel free to reopen if you encounter this again
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.