Skip to content

feat(server-utils): Instrument Vercel AI experimental_evaluate - #24694

Merged
andreiborza merged 5 commits into
developfrom
ab/vercel-ai-evaluate
Sep 25, 2026
Merged

andreiborza merged 5 commits into
developfrom
ab/vercel-ai-evaluate

Conversation

@andreiborza

@andreiborza andreiborza commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

What

Vercel AI experimental_evaluate calls now create a gen_ai.evaluate span with the state and questions as input messages and the answers as output messages.

Why

AI SDK 7 added evaluation (for example TypeSafe's Jev through AI Gateway), and we did not capture these calls.

Closes: #24692

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Sep 24, 2026

Copy link
Copy Markdown

JS-3782

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31 kB - -
@sentry/react (incl. Tracing) 53.45 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 30.93 kB - -
CDN Bundle (incl. Tracing) 51.69 kB - -
CDN Bundle (incl. Logs, Metrics) 33.2 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.92 kB - -
CDN Bundle (incl. Tracing, Replay) 89.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.45 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.42 kB - -
CDN Bundle - uncompressed 91.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 153.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.73 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.54 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.5 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.13 kB - -
@sentry/nextjs (client) 55.77 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.95 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 134.08 kB +0.14% +183 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.43 kB - -
@sentry/node - without tracing 90.46 kB +0.02% +15 B 🔺
@sentry/node - without channel injection 112.59 kB +0.17% +185 B 🔺
@sentry/aws-serverless 98.72 kB +0.01% +5 B 🔺
@sentry/cloudflare (withSentry) - minified 206.49 kB - -
@sentry/cloudflare (withSentry) 513.73 kB - -

View base workflow run

@andreiborza
andreiborza marked this pull request as ready for review September 24, 2026 13:42
@andreiborza
andreiborza requested review from a team as code owners September 24, 2026 13:42
@andreiborza
andreiborza requested review from JPeer264, RulaKhaled, isaacs, mydea and nicohrubec and removed request for a team September 24, 2026 13:42

@chargome chargome left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ja passt

@andreiborza

andreiborza commented Sep 24, 2026 •

Copy link
Copy Markdown
Member Author

buglitzer moch

@nicohrubec nicohrubec left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

schaut guad aus

expect(evaluateSpan.name).toBe('evaluate typesafe-ai/jev');
expect(evaluateSpan.status).toBe('ok');
expect(evaluateSpan.attributes['sentry.origin']?.value).toBe('auto.vercelai.channel');
expect(evaluateSpan.attributes['gen_ai.operation.name']?.value).toBe('evaluate');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

l: should this also be imported from conventions?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 7086acf

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 91d6874. Configure here.

@andreiborza

Copy link
Copy Markdown
Member Author

While I was working on the typesafe sdk integration, I noticed that confidence is missing from vercel ai's instrumentation. Vercel puts the confidence data in provider metadata so we extract it back in as a normalization step to be more in line with the other instrumentation.

@nicohrubec nicohrubec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

schaut guad aus

const ORIGIN = 'auto.vercelai.channel';

// Not yet in `@sentry/conventions`.
const GEN_AI_EVALUATE = 'gen_ai.evaluate';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we have PR for that yet?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not yet, I want to wait a bit on the RFC before finalizing-finalzing that.

@andreiborza
andreiborza merged commit 04fa17a into develop Sep 25, 2026
639 of 641 checks passed
@andreiborza
andreiborza deleted the ab/vercel-ai-evaluate branch September 25, 2026 12:12
andreiborza added a commit that referenced this pull request Sep 25, 2026
… privacy test (#24742)

## What

The Vercel AI evaluate privacy test now uses its own instrument file to
turn off recording, instead of an environment variable.

## Why

This follows how the other suites set up different SDK options.
Follow-up to #24694.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

Instrument Vercel AI experimental_evaluate

4 participants