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.
|
| dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
| tracesSampleRate: 0, | ||
| debug: false, | ||
| release: '1.0', |
There was a problem hiding this comment.
just a question: is there any specific reason we set this here?
There was a problem hiding this comment.
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.
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.
Additional Locations (1)
Based on [this merged PR](getsentry/sentry-javascript#18741) and the [10.33 changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#10330), v6 is now supported. this PR updates the Vercel AI doc page to reflect that.
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