Skip to content

feat(anthropic) Update span attributes to use gen_ai.* namespace instead of ai.* #4674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

constantinius
Copy link
Contributor

@constantinius constantinius commented Aug 5, 2025

Update AnthropicIntegration to support Otel and Sentry AI Agents module compatible span attributes of gen_ai.* family.

Closes https://linear.app/getsentry/issue/TET-996/improve-integration-for-anthropic-sdk

Copy link

codecov bot commented Aug 5, 2025

Codecov Report

❌ Patch coverage is 91.37931% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.10%. Comparing base (3ef02a1) to head (6236f9d).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/anthropic.py 90.00% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4674      +/-   ##
==========================================
+ Coverage   85.09%   85.10%   +0.01%     
==========================================
  Files         156      156              
  Lines       15842    15856      +14     
  Branches     2679     2684       +5     
==========================================
+ Hits        13480    13494      +14     
- Misses       1582     1583       +1     
+ Partials      780      779       -1     
Files with missing lines Coverage Δ
sentry_sdk/ai/utils.py 72.72% <100.00%> (ø)
sentry_sdk/integrations/starlite.py 81.94% <100.00%> (ø)
sentry_sdk/integrations/anthropic.py 86.59% <90.00%> (-1.29%) ⬇️

... and 2 files with indirect coverage changes

@constantinius constantinius marked this pull request as ready for review August 6, 2025 18:33
@constantinius constantinius requested a review from a team as a code owner August 6, 2025 18:33
Copy link

linear bot commented Aug 6, 2025

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@antonpirker antonpirker changed the title feat(anthropic) update span attributes to use gen_ai.* namespace instead of ai.* feat(anthropic) Update span attributes to use gen_ai.* namespace instead of ai.* Aug 8, 2025
Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it is ready to merge. Thanks @constantinius for the work!

@antonpirker antonpirker merged commit 378fe81 into master Aug 8, 2025
138 checks passed
@antonpirker antonpirker deleted the constantinius/feat/anthropic/ai-to-gen-ai-span-attributes branch August 8, 2025 11:03
sentrivana pushed a commit that referenced this pull request Aug 12, 2025
…stead of `ai.*` (#4674)

Update `AnthropicIntegration` to support Otel and Sentry AI Agents
module compatible span attributes of `gen_ai.*` family.

Closes
https://linear.app/getsentry/issue/TET-996/improve-integration-for-anthropic-sdk

---------

Co-authored-by: Anton Pirker <anton.pirker@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants