Skip to content

[BUG] prompt.id unflattens into a nested prompt object and overwrites prompt attribute in telemetry #70763

Description

@rebecca-davies

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions