-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(Tracing): Add Vercel AI SDK v6 support #18741
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
feat(Tracing): Add Vercel AI SDK v6 support #18741
Conversation
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.
|
nicohrubec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| dsn: 'https://[email protected]/1337', | ||
| tracesSampleRate: 0, | ||
| debug: false, | ||
| release: '1.0', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a question: is there any specific reason we set this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not that i know of, this is just copied from v5
packages/node/src/integrations/tracing/vercelai/instrumentation.ts
Outdated
Show resolved
Hide resolved
| ai: '^6.0.0', | ||
| }, | ||
| }, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate test case runs the same test twice
Low Severity
The test 'creates ai related spans with v6' at lines 562-576 is an exact duplicate of the test 'creates ai related spans with sendDefaultPii: false' at lines 410-424. Both use the same scenario.mjs, instrument.mjs, EXPECTED_TRANSACTION_DEFAULT_PII_FALSE, and ai: '^6.0.0' dependency. This appears to be leftover code that wastes CI resources by running the identical test suite twice.
This PR adds support for Vercel AI SDK v6 telemetry changes.
Changes
Provider Metadata Updates
azurekey toProviderMetadatainterface for Azure Responses API (v6 usesazureinstead ofopenaifor Azure provider)vertexkey for Google Vertex provider (v6 usesvertexinstead ofgoogle)addProviderMetadataToAttributesto check both old and new keys for backward compatibilityV6 Test Suite
MockLanguageModelV3usagenow uses object format:{ total, noCache, cached }finishReasonnow uses object format:{ unified, raw }vercel.ai.request.headers.user-agentattribute to test expectationsCloses #18691