docs(nextjs): Require experimental_telemetry for Vercel AI - #19197
Draft
chargome wants to merge 1 commit into
Draft
docs(nextjs): Require experimental_telemetry for Vercel AI#19197chargome wants to merge 1 commit into
chargome wants to merge 1 commit into
Conversation
On Next.js the SDK cannot auto-enable the Vercel AI SDK's telemetry, so `experimental_telemetry` is required on every call in both the Node and Edge runtimes. The page scoped that requirement to Edge and claimed the Node runtime patches call sites automatically. Also correct the troubleshooting entry for raw span names. It presented `force: true` as the complete fix, but `force: true` alone only registers the span processors — following it as written produced no AI spans at all. Simplify the Next.js runtime split while here: it is kept for setup, where the two runtimes need different config files, and dropped where both runtimes now behave the same. Refs getsentry/sentry-javascript#23773 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DESCRIBE YOUR PR
On Next.js,
@sentry/nextjscan't auto-enable the Vercel AI SDK's telemetry, soexperimental_telemetry: { isEnabled: true }is required on every AI SDK call — in both the Node and Edge runtimes. The page scoped that requirement to Edge and stated the Node runtime patches call sites for you.The troubleshooting entry for raw span names (
ai.toolCall,ai.streamText) was worse than incomplete: it presentedforce: trueas the whole fix, butforce: trueonly registers the span processors. Following it as written took you from wrongly-named spans to no AI spans at all.Verified on
@sentry/nextjs@10.71.0, Next.js 16.3.3,ai@6:force: truealoneforce: true+ per-callexperimental_telemetrygen_ai.*spansai.generateText/ai.toolCall, nogen_aiopforce: truealone is not enoughisEnabled: trueto the Node per-call recording example, which otherwise produced no spanGenuinely Edge-specific notes are unchanged: no OpenTelemetry instrumentation,
forceunavailable, integration-levelrecordInputs/recordOutputssilently ignored, no AI SDK v7.Not version-gated. The fix that makes
force: trueunnecessary on Next.js is in review (getsentry/sentry-javascript#23773) but unreleased, so gating it would mean guessing a version. Both changes stay correct once it ships —force: truebecomes unnecessary rather than wrong, and the telemetry requirement is unaffected.Note: the page moved to
docs/platforms/javascript/common/agent-tracing/vercelai.mdxin #19152 and is now shared across ~25 platforms. Every edit here is inside ajavascript.nextjs<PlatformSection>— verified that none of the 28 changed lines render forjavascript.nodeor any other platform.IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace
YYYY-MM-DDwith the due date. You can update this information later by editing the PR description.SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: