mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
Under otel_v2, a client that propagates W3C trace context in params._meta (SEP-414) pulled the tools/call span out of the gateway's trace: resolve_mcp_span_context parented the MCP span to the client's remote context and demoted the gateway's own transport span to a span link. The gateway's tracing backend only ever receives the gateway's half of such a trace, so the span was unreachable from the trace view and the POST transaction showed a dangling link. Invert the anchoring: the MCP tool-call and tools/list spans now always nest under the transport span of the request carrying the message, and the client's propagated context is recorded as the span link instead, so the correlation survives while every trace stays renderable. With no transport at all the span roots its own trace and still carries the link, keeping a single shape for the event. Both returned contexts are built on an explicitly empty base so ambient session state can never leak in, and the span inherits the transport's sampling decision like every other request-level span. |
||
|---|---|---|
| .. | ||
| test_db_endpoint.py | ||
| test_otel_v2_baggage.py | ||
| test_otel_v2_components.py | ||
| test_otel_v2_config_baggage_parenting_guardrails.py | ||
| test_otel_v2_dynamic.py | ||
| test_otel_v2_emitter.py | ||
| test_otel_v2_logger.py | ||
| test_otel_v2_metrics.py | ||
| test_otel_v2_mount.py | ||
| test_otel_v2_multibackend.py | ||
| test_otel_v2_presets.py | ||
| test_otel_v2_sources_of_truth.py | ||
| test_otel_v2_vendor_mappers.py | ||
| test_runtime.py | ||