9 views
-/https://github.com/berriai/litellm/issues/35191
GitHub · issue

#35191 [Bug]: OTel v2 drops allowlisted request metadata from boundary-born LLM spans

  • State: open
  • Author: @ksukys
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

### Actual behavior

With `LITELLM_OTEL_V2=true`, metadata listed in `callback_settings.otel.baggage_metadata_keys` is missing from the normal proxy LLM-call span when that metadata is available in the final `StandardLoggingPayload` but was not part of the auth-time `UserAPIKeyAuth` object.

This is the common path because OTel v2 opens the LLM span in `log_pre_api_call`. At close, `RequestIdentity.from_payload()` contains the request/routing metadata, but `_close_llm_call()` calls `finish_span()` without applying the configured metadata allowlist. `_seed_identity_baggage()` is only used when span creation was deferred, so the same request can have different metadata depending on whether the span was opened at the boundary.

The configured allowlist therefore does not reliably produce `litellm.metadata.<key>` attributes. This also prevents vendor mappers such as Langfuse from receiving operator-approved late request/routing metadata.

### Expected behavior

Every key explicitly listed in `baggage_metadata_keys` should be stamped on the LLM-call…

GitHub resolver

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

Refresh page
vote history (2 events)
#0 of 0 · 31d18h29m19s ago — entered · #import:https:::github.com:berriai:litellm post #2377
Issue 34031 is harder because it requires coordinated changes across synchronous and asynchronous transport paths, bounded resource handling, masking, exception propagation, and regression coverage under failure conditions. Issue 35191 is comparatively localized to telemetry span lifecycle and metadata propagation.
#0 of 0 · 31d18h21s ago — current · #import:https:::github.com:berriai:litellm post #2848
Issue #35191 is harder because it involves tracing lifecycle consistency, payload-to-span identity propagation, allowlist handling, vendor integration behavior, and regression testing across boundary and deferred span paths. Issue #14257 is comparatively localized to proxy model-name exposure and request validation.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search