[BUG] OTEL_LOG_RAW_API_BODIES Ignored in project settings since 2.1.251 Why would we be forced to export the raw logs of ALL our project if we only need one?
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?
Since 2.1.257, the OTEL_LOG_RAW_API_BODIES settings is ignored in project settings.
This apparently comes from this change log: "_Fixed project settings being able to enable detailed beta tracing or raw API body logging, and a lower-scope beta tracing endpoint bypassing an OTLP collector pinned by managed settings or a host app_"
In the debug log we indeed can see a warning: "_OTEL_LOG_RAW_API_BODIES in .claude/settings.json is ignored — project-scoped settings can't set this key. Set it in ~/.claude/settings.json or managed settings instead._"
So, we can still enable telemetry and otel logs and metrics exporter at the project settings level, but no more the export of raw_api_bodies. We then need to add this setting un our user level settings file.
When we set: "OTEL_LOG_RAW_API_BODIES": "file:./otel-logs", all our projects will now export their raw logs to their 'otel-logs' folders (even for project which doesn't enable telemetry).
Why can't we export our raw data for a given project anymore?
What Should Happen?
We should be able to set, for example: "OTEL_LOG_RAW_API_BODIES": "file:./otel-logs", in our project settings like before, and not be forced to have all our projects export these raw files to a 'otel-logs' folder.
Error Messages/Logs
Steps to Reproduce
- set the "OTEL_LOG_RAW_API_BODIES" env variable in your project settings file
example:
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_LOG_RAW_API_BODIES": "file:./otel-logs",
}
- Start a claude session in that project and send a prompt
- Notice that there is no file appearing into the 'otel-logs' folder of your project
- Set this "OTEL_LOG_RAW_API_BODIES" env variable in your user settings file
- Start a claude session in your project and send a prompt
- Notice that, now, the raw log files are created into your project's otel-logs filder (and also in any other project which you will start a conversation with, even if they don't enable telemetry).
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.250
Claude Code Version
2.1.259
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗