[DOCS] OpenTelemetry docs omit `claude_code.assistant_response` and `OTEL_LOG_ASSISTANT_RESPONSES`

Open 💬 1 comment Opened Jun 25, 2026 by coygeek

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/monitoring-usage

Section/Topic

OpenTelemetry common configuration variables, event reference, and environment variable reference.

Current Documentation

The monitoring page currently lists prompt and raw-body controls:

OTEL_LOG_USER_PROMPTS | Enable logging of user prompt content (default: disabled)

It also says:

OTEL_LOG_RAW_API_BODIES | Emit the full Anthropic Messages API request and response JSON as api_request_body / api_response_body log events (default: disabled). Bodies include the entire conversation history.

The environment variables page lists:

OTEL_LOG_USER_PROMPTS | Set to 1 to include user prompt text in OpenTelemetry traces and logs. Disabled by default (prompts are redacted).

What's Wrong or Missing?

Claude Code v2.1.193 added a claude_code.assistant_response OpenTelemetry log event containing model response text.

The release note also describes privacy-sensitive behavior that is not documented:

  • response text is redacted unless OTEL_LOG_ASSISTANT_RESPONSES=1
  • when OTEL_LOG_ASSISTANT_RESPONSES is unset, it follows OTEL_LOG_USER_PROMPTS
  • deployments that already log prompt content can start receiving response content on upgrade
  • setting OTEL_LOG_ASSISTANT_RESPONSES=0 keeps prompts-only logging

The docs currently do not mention the event name, the new environment variable, the inheritance behavior, or the opt-out value.

Suggested Improvement

Update the monitoring and environment-variable docs with:

  • a row for OTEL_LOG_ASSISTANT_RESPONSES
  • a short description of the claude_code.assistant_response event
  • the default redaction behavior
  • the inheritance behavior from OTEL_LOG_USER_PROMPTS when unset
  • the explicit 0 opt-out for organizations that want prompt logging without assistant-response logging

Suggested wording:

OTEL_LOG_ASSISTANT_RESPONSES: Controls whether claude_code.assistant_response log events include model response text. Set to 1 to include response text. Set to 0 to keep response text redacted even when OTEL_LOG_USER_PROMPTS=1. When unset, this follows OTEL_LOG_USER_PROMPTS.

Impact

High - Prevents users from using a feature

Additional Context

Affected Pages:

| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/monitoring-usage | OpenTelemetry common configuration table and log/event descriptions omit assistant-response logging |
| https://code.claude.com/docs/en/env-vars | Environment variable table omits OTEL_LOG_ASSISTANT_RESPONSES |
| https://code.claude.com/docs/en/settings | otelHeadersHelper references OpenTelemetry configuration but does not link to the new response-content control |

Total scope: 3 pages affected

Version context: Claude Code v2.1.193 release note: "Added claude_code.assistant_response OpenTelemetry log event containing the model's response text. Redacted unless OTEL_LOG_ASSISTANT_RESPONSES=1; when that var is unset it follows OTEL_LOG_USER_PROMPTS, so deployments that already log prompt content will start receiving response content on upgrade - set OTEL_LOG_ASSISTANT_RESPONSES=0 to keep prompts-only."

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗