What this thread does
Do first: Upgrade LiteLLM to v1.109.4 (as of November 2026).
Symptom
every LLM call produces two unrelated traces in Langfuse
oriolrius reported separate application-side SDK v4 traces and proxy callback SDK v2 traces. The issue was opened by pperezrubio to request Langfuse SDK v4 support. Reporter: pperezrubio. The detailed two-trace report is by oriolrius. Other issue participants include vivek12345 and AmineDjeghri; their comments discuss the report or proposed changes.
Cause
The old callback used the v2 tracing API while the application used v4 OpenTelemetry IDs. The merged migration exports callback generations and child spans through OpenTelemetry and supports the v4 SDK rather than the removed v2 API. Merged change.
Fix
1. Upgrade LiteLLM to v1.109.4 (as of November 2026). 2. Enable success_callback: ["langfuse"] under litellm_settings, as the migration PR specifies. 3. To continue an application trace, pass its trace ID through metadata.existing_trace_id. The callback in this release gives that field precedence over metadata.trace_id; merely setting metadata.session_id groups a session rather than joining independent traces.
Sources: fix PR; v1.109.4 implementation.
Fixed in
First pre-release v1.104.0-rc.1 (released 2026-09-28); first stable v1.104.0 (released 2026-10-03). PR #36741 was merged on 2026-09-25.
If it still fails
- The migration rejects SDK 2.x and 3.x. Upgrading the callback alone does not assign an application trace ID to every request or combine historical traces. The reporter’s session-ID workaround left application-side traces separate.
Not for: Claude Code session tracing with a stop-hook plugin; see langfuse-trace-claude-code-sessions-stop-hook-plugin.
Sources
- [[Feature]: Support Langfuse Python SDK v4](https://github.com/BerriAI/litellm/issues/24123), pperezrubio, opened 2026-03-19; closed as completed on 2026-09-25: "Support the Langfuse Python SDK v4"
- feat(langfuse)!: migrate the sdk callback to langfuse v4, yucheng-berri, merged 2026-09-25 (closed).
- v1.104.0-rc.1, published 2026-09-28.
- v1.104.0, published 2026-10-03.
- v1.109.4, published 2026-11-24.
- Implementation at v1.109.4, read 2026-11-24.
- Issue comment by vivek12345, vivek12345, 2026-03-19; parent issue closed as completed on 2026-09-25.
- Issue comment by AmineDjeghri, AmineDjeghri, 2026-05-07; parent issue closed as completed on 2026-09-25.
- Two-trace report, oriolrius, 2026-05-27; parent issue closed as completed on 2026-09-25.
Checked
2026-11-24; read the issue and linked comment API records, merged PR and diff, fix release evidence, November release record and implementation at its tag; no command was run.
Started from a post by @pperezrubio, packaged by the editor. Original post