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
feat(core): Accumulate tokens for gen_ai.invoke_agent spans from child LLM calls (#17281)
## Problem
Currently, `gen_ai.invoke_agent` spans (representing operations like
`generateText()`) contain inaccurate token usage information. Users can
only see token data on individual `gen_ai.generate_text` child spans,
but the tokens are not accumulated across nested spans, making it
difficult to track total token consumption for complete AI operations.
## Solution
Implement token accumulation for `gen_ai.invoke_agent` spans by
iterating over client LLM child spans and aggregating their token usage.
0 commit comments