litellm/tests/unit/integrations/otel
yucheng-berri ac179fe422
fix(otel): keep the FastAPI server span when the proxy runs under ddtrace-run (#54016)
* fix(otel): keep the FastAPI server span when another tracer wraps the middleware stack

* test(otel): type the helpers of the wrapped middleware stack tests

* test(otel): assert the error status and wait for the model call span before counting server spans

* fix(otel): put the server span middleware inside the other tracer's middleware, as before v1.109

Wrapping the whole stack put the OTel middleware outside ddtrace's. With
DD_TRACE_OTEL_ENABLED=true that sent Datadog an extra top-level server span per
request. The instrumentation now gets Starlette's error middleware from under the
other tracer's wrapper, and the wrapper goes back on top.

* refactor(otel): walk the wrapper chain with a loop instead of recursion
2026-11-30 16:47:05 -08:00
..
__init__.py test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00
test_db_endpoint.py fix(otel): name postgres service spans by operation and table (#44240) 2026-10-03 09:20:28 -07:00
test_langfuse_logger.py fix(responses): preserve incomplete status in synthetic streams (#52489) 2026-11-19 22:24:50 -08:00
test_otel_v2_baggage.py feat(otel): add Mixpanel OpenTelemetry v2 preset callback (#49999) 2026-11-25 10:27:02 -08:00
test_otel_v2_components.py feat(control_plane): ocsf audit events, sink protocol, queued delivery and hash chain (#49660) 2026-11-16 17:36:24 +00:00
test_otel_v2_config_baggage_parenting_guardrails.py fix(otel): tolerate non-dict callback_settings.otel and ignore bare EXCLUDED_SERVICES env (#44086) 2026-10-02 12:36:46 -07:00
test_otel_v2_destinations.py feat(otel): add Mixpanel OpenTelemetry v2 preset callback (#49999) 2026-11-25 10:27:02 -08:00
test_otel_v2_dynamic.py feat(langfuse_otel): group calls that share a metadata trace_id into one trace (#54408) 2026-11-26 00:58:20 +00:00
test_otel_v2_emitter.py fix(langfuse otel): emit request metadata under langfuse.observation.metadata and langfuse.trace.metadata on the OTEL v2 Langfuse mapper (#42697) 2026-10-27 18:54:10 -07:00
test_otel_v2_logger.py feat(otel): group service spans by background job run (#54513) 2026-11-27 20:53:04 -08:00
test_otel_v2_metrics.py fix(otel): label configured pass-through routes litellm.passthrough and read the operation from the upstream (#48675) 2026-10-28 10:48:34 -07:00
test_otel_v2_mount.py fix(otel): keep the FastAPI server span when the proxy runs under ddtrace-run (#54016) 2026-11-30 16:47:05 -08:00
test_otel_v2_multibackend.py test: move tests/test_litellm integrations and secret_managers into tests/unit (#43194) 2026-09-25 12:57:07 -07:00
test_otel_v2_named_trace.py feat(langfuse_otel): group calls that share a metadata trace_id into one trace (#54408) 2026-11-26 00:58:20 +00:00
test_otel_v2_presets.py test(unit): make 21 flaky unit tests deterministic (#54785) 2026-11-26 20:48:13 -08:00
test_otel_v2_sources_of_truth.py feat(otel): group service spans by background job run (#54513) 2026-11-27 20:53:04 -08:00
test_otel_v2_vendor_mappers.py feat(otel): add Mixpanel OpenTelemetry v2 preset callback (#49999) 2026-11-25 10:27:02 -08:00
test_runtime.py feat(otel): trace auto-router configuration and classifier failures (#44926) 2026-10-06 15:40:34 -07:00