[Bug]: Datadog LLM Obs embedding spans lack top-level model_name, causing "Partial cost"
What happened?
Embedding spans emitted by the Datadog LLM Observability callback arrive without a top-level model_name, so Datadog cannot price them and flags every trace containing one as "Partial cost — Unsupported model provider".
The model name is being sent — it just lands in meta.metadata instead of on meta, and Datadog only promotes it to the top level for kind: llm spans.
Measured on live spans from a LiteLLM proxy (v1.90.3), same trace:
kind=llm meta.model_name=openai/gpt-4.1-mini meta.metadata.model_name=openai/gpt-4.1-mini
kind=embedding meta.model_name=None meta.metadata.model_name=openai/text-embedding-3-smallThe llm span prices correctly. The embedding span does not, and the whole trace is marked partial.
Root cause
Meta in litellm/types/integrations/datadog_llm_obs.py has no model_name or model_provider field:
class Meta(TypedDict, total=False):
kind: Literal["llm", "tool", "task", "embedding", "retrieval"]
input: InputMeta
output: OutputMeta
metadata: Dict[str, Any]
error: Optional[DDLLMObsError]_get_dd_llm_obs_payload_metadata puts both values inside metadata (datadog_llm_obs.py:560-564), which works only because Datadog infers them for llm spans.
Datadog's span schema accepts model_name and model_provider on both llm and embedding spans — its own SDK exposes @embedding(model_name=..., model_provider=...).
Suggested fix
Add the two fields to Meta and set them for llm and embedding kinds:
class Meta(TypedDict, total=False):
kind: ...
model_name: str # new, for llm and embedding spans
model_provider: str # new
...The values are already computed — they just need to be lifted out of metadata.
Why it matters
Any application doing RAG through the proxy emits at least one embedding call per request, so every one of its traces shows Partial cost. The missing amount itself is small — 240 out of 692,239 nanodollars in our trace, about 0.03% — but the warning suggests a larger problem than it is, and makes cost dashboards hard to trust.
Context
Found while evaluating Datadog Agent Observability against LangSmith and Langfuse, with LiteLLM as the gateway. Propagating parent_id / trace_id through request metadata already fixes span nesting, span-kind classification and cost attribution for llm spans — this is the one field left that the caller cannot supply, because the span is built proxy-side.
Are you a ML Ops Team?
Yes
What LiteLLM version are you on?
v1.90.3 (Meta is unchanged on main)
Source: BerriAI/litellm