Skip to content

feat(node): Switch to new semantic conventions for Vercel AI #16476

New issue

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

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

Already on GitHub? # to your account

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Jun 3, 2025

resolves #16453

In getsentry/sentry-conventions#57 we deprecated some of the ai.X attributes in favour of OTEL's gen_ai.X attributes. This updates the Vercel AI integration to address these deprecations.

These changes are based on https://ai-sdk.dev/docs/ai-sdk-core/telemetry#collected-data, and we created attributes.ts to track these as constants.

See the relay change here to switch to new attributes for measuring token usage: getsentry/relay#4768

@AbhiPrasad AbhiPrasad self-assigned this Jun 3, 2025
Copy link
Contributor

github-actions bot commented Jun 3, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.99 kB - -
@sentry/browser - with treeshaking flags 23.76 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing) 38.34 kB - -
@sentry/browser (incl. Tracing, Replay) 76.48 kB +0.01% +1 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.59 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 81.24 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 93.32 kB - -
@sentry/browser (incl. Feedback) 40.73 kB +0.01% +1 B 🔺
@sentry/browser (incl. sendFeedback) 28.7 kB - -
@sentry/browser (incl. FeedbackAsync) 33.59 kB - -
@sentry/react 25.76 kB - -
@sentry/react (incl. Tracing) 40.33 kB - -
@sentry/vue 28.34 kB +0.01% +1 B 🔺
@sentry/vue (incl. Tracing) 40.18 kB - -
@sentry/svelte 24.01 kB - -
CDN Bundle 25.48 kB - -
CDN Bundle (incl. Tracing) 38.52 kB - -
CDN Bundle (incl. Tracing, Replay) 74.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 79.8 kB - -
CDN Bundle - uncompressed 74.41 kB - -
CDN Bundle (incl. Tracing) - uncompressed 114.07 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 228.04 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 240.87 kB - -
@sentry/nextjs (client) 42 kB - -
@sentry/sveltekit (client) 38.84 kB - -
@sentry/node 150.1 kB +0.04% +59 B 🔺
@sentry/node - without tracing 98.29 kB - -
@sentry/aws-serverless 124.06 kB -0.01% -1 B 🔽

View base workflow run

@AbhiPrasad AbhiPrasad force-pushed the abhi/js-502-update-vercel-ai-spans-to-use-otel-gen_ai-attributes branch from 90d9940 to 8c3e1da Compare June 4, 2025 00:50
@AbhiPrasad AbhiPrasad changed the title fix(node): No longer compute ai token attributes in Vercel AI integration feat(node): Switch to new semantic conventions for Vercel AI Jun 4, 2025
Copy link
Member Author

Choose a reason for hiding this comment

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

This will be used further when tackling #16454

@AbhiPrasad AbhiPrasad requested review from a team, mydea and chargome and removed request for a team June 4, 2025 01:07
@AbhiPrasad AbhiPrasad marked this pull request as ready for review June 4, 2025 01:07
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

💅

@AbhiPrasad AbhiPrasad merged commit 45088a2 into develop Jun 4, 2025
116 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi/js-502-update-vercel-ai-spans-to-use-otel-gen_ai-attributes branch June 4, 2025 14:53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Vercel AI spans to use OTEL gen_ai attributes
2 participants