Added
- Bring your own LLM cost.
capture(name, ..., cost={"input": .., "output": ..} | {"total": ..})
sets the cost (USD) of every LLM-call span inside the capture (never the capture's own wrapper
span).Latitude(pricing={"<provider>/<model>": {"input_per_1m": .., "output_per_1m": ..}})
prices LLM calls from their token counts, andLatitude(cost_resolver=fn)letsfn(usage)
return a cost orNoneto fall back.set_llm_cost(span, input=, output=, total=)sets the cost of
one span. Precedence:set_llm_cost>capture(cost=)>cost_resolver>pricing> Latitude's
server-side pricing. - Where the SDK sets cost it writes
gen_ai.usage.input_cost,gen_ai.usage.output_costand
gen_ai.usage.total_costpluslatitude.cost.source="user", replacing any cost the
instrumentation wrote on that span.totaldefaults toinput + output, atotal-only cost
drops the instrumentation's input/output costs, and an explicit0is honoured. Cost is applied
at export through an attribute-override wrapper, so other processors on a shared provider see the
span unchanged. New exports:set_llm_cost,LlmCost,LlmUsage,ModelPricing,
COST_SOURCE_USERand theATTRIBUTES.cost_input/cost_output/cost_total/cost_source
constants. LLM calls, provider, model and token counts are read from OpenTelemetry GenAI,
OpenInference (including CrewAI'sAGENTspan), OpenLLMetry and Vercel AI SDK attributes, and
cost is resolved when each span ends, before redaction.
Changed
- Dev extra now pins
openai3.3.1.openai-agentsis 0.21.0 so the graph can resolve
(0.15.1requiredopenai<3). LiteLLM is no longer co-installed: every published
litellmstill requiresopenai<3. Install it separately for the LiteLLM examples. openinference-semantic-conventionsis 0.1.33, whichopeninference-instrumentation-openai
0.1.56 requires.
Fixed
- Smart filter now promotes ancestors of kept spans (including already-ended parents held briefly
after a drop) so exported traces stay connected when only a descendant independently passed the
filter — e.g. a stampedtcp.connectno longer ships without its parent.