mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-26 01:12:21 +00:00
* fix(langfuse): give session-header calls their own trace id A client that sends only a session header (x-litellm-session-id, a vendor x-<name>-session-id such as Claude Code's X-Claude-Code-Session-Id, a bare x-session-id, or the Codex session/thread/conversation family) has that value stamped into both trace_id and session_id by the proxy. Langfuse upserts a trace by id, so every turn of a session collapsed into one growing trace and the Sessions view showed "Total traces: 1" Detect that aliasing in the Langfuse callback from the request headers the callback already receives, and use litellm_call_id as the trace id for those calls. session_id still carries the header value, so the turns stay grouped under one session. An explicit x-litellm-trace-id, langfuse_trace_id, or langfuse_existing_trace_id keeps its trace id, including when the caller sets it to the same value as the session id Co-authored-by: jesus <jesus@berri.ai> * test(langfuse): cover direct-SDK callers without proxy request headers * fix(langfuse): preserve session trace provenance --------- Co-authored-by: jesus <jesus@berri.ai> |
||
|---|---|---|
| .. | ||
| langfuse.py | ||
| langfuse_handler.py | ||
| langfuse_mock_client.py | ||
| langfuse_otel.py | ||
| langfuse_otel_attributes.py | ||
| langfuse_prompt_management.py | ||