You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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, and Latitude(cost_resolver=fn) lets fn(usage)
return a cost or None to 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_cost and gen_ai.usage.total_cost plus latitude.cost.source="user", replacing any cost the
instrumentation wrote on that span. total defaults to input + output, a total-only cost
drops the instrumentation's input/output costs, and an explicit 0 is 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_USER and the ATTRIBUTES.cost_input / cost_output / cost_total / cost_source
constants. LLM calls, provider, model and token counts are read from OpenTelemetry GenAI,
OpenInference (including CrewAI's AGENT span), OpenLLMetry and Vercel AI SDK attributes, and
cost is resolved when each span ends, before redaction.
Changed
Dev extra now pins openai 3.3.1. openai-agents is 0.21.0 so the graph can resolve
(0.15.1 required openai<3). LiteLLM is no longer co-installed: every published litellm still requires openai<3. Install it separately for the LiteLLM examples.
openinference-semantic-conventions is 0.1.33, which openinference-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 stamped tcp.connect no longer ships without its parent.