LiteLLM litellm/integrations/otel/model/spans.py - the declared span roles and hierarchy
repo
Fields
id
sources/w5e-litellm-otel-span-modelPublisher
BerriAI
Kind
repo
Accessed
2026-10-05
notes
Read at main 2026-10-05. This module is the authoritative span vocabulary: SpanRole enum = PROXY_REQUEST, LLM_CALL, MCP_TOOL_CALL, MCP_LIST_TOOLS, GUARDRAIL, DB_CALL, SERVICE, each mapped through SPAN_REGISTRY to a LiteLLMSpanKind (SERVER/CLIENT/INTERNAL/PRODUCER/CONSUMER) and an explicit parent. Root span name literal is 'Received Proxy Server Request'. _METRICS_ONLY_SERVICES = {self, router, proxy_pre_call, auth} documents which service timings deliberately do NOT become spans. Client-propagated trace context in params._meta is recorded as a span LINK, never a parent - a deliberate choice documented in the module docstring.
Notes
Read at main 2026-10-05. This module is the authoritative span vocabulary: SpanRole enum = PROXY_REQUEST, LLM_CALL, MCP_TOOL_CALL, MCP_LIST_TOOLS, GUARDRAIL, DB_CALL, SERVICE, each mapped through SPAN_REGISTRY to a LiteLLMSpanKind (SERVER/CLIENT/INTERNAL/PRODUCER/CONSUMER) and an explicit parent. Root span name literal is 'Received Proxy Server Request'. _METRICS_ONLY_SERVICES = {self, router, proxy_pre_call, auth} documents which service timings deliberately do NOT become spans. Client-propagated trace context in params._meta is recorded as a span LINK, never a parent - a deliberate choice documented in the module docstring.
Cross-references
This record references no other records.