Skip to content

docs(nextjs): Require experimental_telemetry for Vercel AI - #19197

Draft
chargome wants to merge 1 commit into
masterfrom
chargome/docs/nextjs-vercel-ai-telemetry
Draft

docs(nextjs): Require experimental_telemetry for Vercel AI#19197
chargome wants to merge 1 commit into
masterfrom
chargome/docs/nextjs-vercel-ai-telemetry

Conversation

@chargome

Copy link
Copy Markdown
Member

DESCRIBE YOUR PR

On Next.js, @sentry/nextjs can't auto-enable the Vercel AI SDK's telemetry, so experimental_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 presented force: true as the whole fix, but force: true only 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:

Config Result
force: true alone zero AI spans
force: true + per-call experimental_telemetry correct gen_ai.* spans
neither raw ai.generateText / ai.toolCall, no gen_ai op
  • Troubleshooting entry now spells out both required steps and says explicitly that force: true alone is not enough
  • Telemetry requirement moved from Edge-only to Next.js-wide; dropped the claim that the Node runtime patches call sites
  • Added the missing isEnabled: true to the Node per-call recording example, which otherwise produced no span
  • Trimmed the Node/Edge split down to where the runtimes actually differ — kept for setup (different config files) and the differences table, dropped where both now behave identically

Genuinely Edge-specific notes are unchanged: no OpenTelemetry instrumentation, force unavailable, integration-level recordInputs/recordOutputs silently ignored, no AI SDK v7.

Not version-gated. The fix that makes force: true unnecessary 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: true becomes unnecessary rather than wrong, and the telemetry requirement is unaffected.

Note: the page moved to docs/platforms/javascript/common/agent-tracing/vercelai.mdx in #19152 and is now shared across ~25 platforms. Every edit here is inside a javascript.nextjs <PlatformSection> — verified that none of the 28 changed lines render for javascript.node or 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-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've supplied a deadline.

Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

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>
@chargome chargome self-assigned this Aug 31, 2026
@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview Aug 31, 2026 4:25pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Aug 31, 2026 4:25pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant