Conversation

AbhiPrasad

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

@AbhiPrasadAbhiPrasad self-assigned this Jun 3, 2025
@github-actionsGitHub Actions

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.99 kB--
@sentry/browser - with treeshaking flags23.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 flags69.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/react25.76 kB--
@sentry/react (incl. Tracing)40.33 kB--
@sentry/vue28.34 kB+0.01%+1 B 🔺
@sentry/vue (incl. Tracing)40.18 kB--
@sentry/svelte24.01 kB--
CDN Bundle25.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 - uncompressed74.41 kB--
CDN Bundle (incl. Tracing) - uncompressed114.07 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed228.04 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed240.87 kB--
@sentry/nextjs (client)42 kB--
@sentry/sveltekit (client)38.84 kB--
@sentry/node150.1 kB+0.04%+59 B 🔺
@sentry/node - without tracing98.29 kB--
@sentry/aws-serverless124.06 kB-0.01%-1 B 🔽

View base workflow run

@AbhiPrasadAbhiPrasad 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
@AbhiPrasadAbhiPrasad 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

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

Choose a reason for hiding this comment

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

💅

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

Successfully merging this pull request may close these issues.

Update Vercel AI spans to use OTEL gen_ai attributes