litellm/tests/logging_callback_tests/langfuse_expected_request_body
yucheng 2f33397626 refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth
The callback now owns an isolated TracerProvider and OTLP exporter and builds generation and child spans with public OpenTelemetry APIs plus the LangfuseOtelSpanAttributes constants. Caller trace ids, generation ids, parent observation ids and historical start and end times are honoured through the OTel id generator, remote SpanContext and explicit span timestamps, so no private Langfuse SDK tracing handle is used any more. The Langfuse client stays only for get_prompt and auth_check

This also resolves the gauntlet findings on the previous draft: fresh traces start from an empty context so caller application spans are never stamped, the Slack trace link is read from the request logging state instead of constructing a logger per alert, a truthy non-mapping trace_metadata is serialized instead of raising, trace_input and trace_output land on the root generation, discarding a cached client is done under the lock, and the prompt cache no longer leaks a task manager because the client cache no longer tears down shared providers

Fixtures under tests/logging_callback_tests lose the SDK-private langfuse.internal.as_root marker; every other exported attribute is unchanged

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 21:18:36 +00:00
..
completion.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
completion_with_bedrock_call.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
completion_with_complex_metadata.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
completion_with_langfuse_metadata.json fix(langfuse): propagate trace_metadata as trace-level attributes in v4 2026-09-17 02:04:01 +00:00
completion_with_no_choices.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
completion_with_router.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
completion_with_tags.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
completion_with_tags_stream.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
completion_with_vertex_call.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
complex_metadata.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
complex_metadata_2.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
embedding_with_vllm.json Add JSON exact match test for vLLM embeddings 2026-02-26 16:49:34 +05:30
empty_metadata.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
metadata_with_function.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
metadata_with_lock.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
nested_metadata.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
simple_metadata.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
simple_metadata2.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00
simple_metadata3.json refactor(langfuse): emit observations as plain OTel spans, keep the SDK for prompts and auth 2026-09-17 21:18:36 +00:00