Skip to content

feat(integration): pydantic-ai: properly report token usage and respo…

a22fea6
Select commit
Loading
Failed to load commit list.
Merged

feat(integration): pydantic-ai: properly report token usage and response model for invoke_agent spans #5153

feat(integration): pydantic-ai: properly report token usage and respo…
a22fea6
Select commit
Loading
Failed to load commit list.
Codecov / codecov/project succeeded Nov 26, 2025 in 0s

83.98% (+0.00%) compared to 7b7ea33

View this Pull Request on Codecov

83.98% (+0.00%) compared to 7b7ea33

Details

Codecov Report

❌ Patch coverage is 69.44444% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.98%. Comparing base (7b7ea33) to head (a22fea6).
⚠️ Report is 4 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...sdk/integrations/pydantic_ai/spans/invoke_agent.py 60.00% 4 Missing and 4 partials ⚠️
sentry_sdk/integrations/pydantic_ai/spans/utils.py 83.33% 0 Missing and 2 partials ⚠️
..._sdk/integrations/pydantic_ai/patches/agent_run.py 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5153   +/-   ##
=======================================
  Coverage   83.97%   83.98%           
=======================================
  Files         180      181    +1     
  Lines       18222    18241   +19     
  Branches     3235     3239    +4     
=======================================
+ Hits        15302    15319   +17     
  Misses       1929     1929           
- Partials      991      993    +2     
Files with missing lines Coverage Δ
...ry_sdk/integrations/pydantic_ai/spans/ai_client.py 76.19% <100.00%> (+0.07%) ⬆️
..._sdk/integrations/pydantic_ai/patches/agent_run.py 90.47% <66.66%> (+3.11%) ⬆️
sentry_sdk/integrations/pydantic_ai/spans/utils.py 83.33% <83.33%> (ø)
...sdk/integrations/pydantic_ai/spans/invoke_agent.py 75.36% <60.00%> (-7.00%) ⬇️

... and 1 file with indirect coverage changes