[BUG] prompt.id unflattens into a nested prompt object and overwrites prompt attribute in telemetry
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?
This depends on the observability platform but I believe you should make the change instead to conform to HTML specs.
When prompt logging is enabled, the following fields are logged:
"prompt": "If you see this, you are awesome",
"prompt.id": "123456",
"prompt_length": "32",
Depending on the platform, this will break the prompt attribute since prompt.id unflattens into a nested prompt object with just an id - overwriting prompt in the process.
What Should Happen?
Every observability platform should behave the same and render all 3 fields per HTML specs. prompt.id should be renamed to prompt_id to remain consistent or a single prompt object with id, text and length should be included.
Error Messages/Logs
Steps to Reproduce
Enable logging with OTEL_LOG_USER_PROMPTS set to 1.
Log to observability platform of your choice, this was tested with CloudWatch and DataDog
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.191
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_