getsentry/sentry-python

Add token usage to AI Agent spans

Opened this issue · 1 comments

In integration that create agent spans automatically (currently openai-agents and langgraph) we should add the total token usage of the agent run to the agent span.

We need to check if we get this information from the framework or if we would need to sum token usage up by hand and add when the agent run ends.