Skip to content

Conversation

@RulaKhaled
Copy link
Member

Fixes an issue where VercelAI integration span operations were not being set correctly because the validation was too restrictive. I relaxed the condition to only require ai.model.id attribute instead of both ai.model.id and ai.model.provider as provider attribute is optional and may not always be present on spans

Closes https://linear.app/getsentry/issue/JS-1280

@linear
Copy link

linear bot commented Dec 11, 2025

const aiModelProvider = attributes[AI_MODEL_PROVIDER_ATTRIBUTE];
if (typeof aiModelId !== 'string' || typeof aiModelProvider !== 'string' || !aiModelId || !aiModelProvider) {
if (typeof aiModelId !== 'string' || !aiModelId) {
return;
Copy link

Choose a reason for hiding this comment

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

Bug: Missing regression test for the fix (Bugbot Rules)

This is flagged because it was mentioned in the rules file. This is a fix PR that relaxes the validation to only require ai.model.id instead of both ai.model.id and ai.model.provider. The rules specify that fix PRs should include at least one test that tests the regression being fixed (a test that failed before the fix and passes after). There's no test in this PR that verifies spans without the provider attribute are now processed correctly.

Fix in Cursor Fix in Web

@github-actions
Copy link
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,785 - 8,679 +1%
GET With Sentry 1,741 20% 1,681 +4%
GET With Sentry (error only) 6,055 69% 6,043 +0%
POST Baseline 1,188 - 1,203 -1%
POST With Sentry 587 49% 581 +1%
POST With Sentry (error only) 1,051 88% 1,052 -0%
MYSQL Baseline 3,281 - 3,297 -0%
MYSQL With Sentry 486 15% 426 +14%
MYSQL With Sentry (error only) 2,659 81% 2,665 -0%

View base workflow run

@RulaKhaled RulaKhaled merged commit 065ce1a into develop Dec 11, 2025
207 checks passed
@RulaKhaled RulaKhaled deleted the rolaabuhasna/js-1280-vercelaiintegration-span-op-stays-default-instead-of branch December 11, 2025 12:00
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.

3 participants