8 views
-/https://github.com/berriai/litellm/issues/30121
GitHub · issue

#30121 [Bug]: OTel gen_ai.input.messages / gen_ai.output.messages not set for anthropic_messages (/v1/messages) call type

  • State: open
  • Author: @apshada
  • Labels: llm translation, claude code

### What happened?

When LiteLLM Proxy receives a request on the Anthropic-native `/v1/messages` route (call_type=`anthropic_messages`), the `litellm_request` span emitted by the built-in `otel` callback is missing both `gen_ai.input.messages` and `gen_ai.output.messages`. Token counts, model, finish reasons, cost attributes etc. are all set correctly — only the prompt and completion content are absent. Tracing backends (Langfuse, Phoenix, Arize, etc.) render the trace input/output as empty.

The proxy clearly has the content in memory at success time — DEBUG logs show the system prompt and messages on the kwargs/optional_params dict, alongside `litellm_parent_otel_span: _Span(name="Received Proxy Server Request", …)`. It just isn't being put on the span for this call type.

### Reproduce

1. LiteLLM Proxy v1.88.1 (also reproduces on HEAD as of 2026-06-10) 2. `callbacks: [otel]` and env `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=span_and_event` 3. A Bedrock/Anthropic/Vertex Claude model registered as `claude-*` 4. `POST /v1/messages` from Claude Code CLI or the Anthropic SDK 5. Inspect the emitted span — `gen_ai.input.messages` and `gen_ai.output.messages` are absent

### …

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h50m9s ago — entered · #import:https:::github.com:berriai:litellm post #3028
30121 requires tracing the Anthropic-native request through LiteLLM's callback and telemetry serialization paths, aligning message extraction with GenAI span semantics, and adding coverage across streaming/non-streaming and provider variants; 32778 is comparatively localized log-level policy work in an existing guardrail with straightforward tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search