Skip to content

ref(server-utils): Remove addVercelAiProcessors and Vercel AI OTel span processing - #23384

Draft
mydea wants to merge 10 commits into
developfrom
fn/remove-vercelai-processors
Draft

ref(server-utils): Remove addVercelAiProcessors and Vercel AI OTel span processing#23384
mydea wants to merge 10 commits into
developfrom
fn/remove-vercelai-processors

Conversation

@mydea

@mydea mydea commented Aug 13, 2026

Copy link
Copy Markdown
Member

Removes the OpenTelemetry-span post-processing path for the Vercel AI SDK from @sentry/server-utilsaddVercelAiProcessors and every helper reachable only through it (the spanStart/processSpan/event-processor pipeline, plus the now-orphaned utils.ts, constants.ts, types.ts, and the AI_* attribute constants). getProviderMetadataAttributes is kept, since the ai >= 7 tracing-channel subscriber still shares it.

Per-runtime handling of the vercelAIIntegration:

  • Vercel Edge: removed entirely. It relied on the OTel span post-processor, which is no longer available, and Vercel AI is not supported on the Edge runtime going forward. This also removes it from the Edge runtime of @sentry/nextjs.
  • Deno: re-exports vercelAIIntegration from @sentry/server-utils/orchestrion — the same integration Node uses and the one Deno's default set already registered.
  • Cloudflare: re-exports vercelAIIntegration from @sentry/server-utils (its existing import source; Cloudflare has not yet moved to the orchestrion entry). It now uses the channel-based integration directly instead of wrapping it with the OTel processors.

A migration note is added under the v11 "AI integrations" removed-APIs section, and addVercelAiProcessors is dropped from the "moved helpers" list there.

Stacked on top of #23360 (the vercelAiIntegrationvercelAIIntegration rename).

Comment thread packages/vercel-edge/src/index.ts
Comment thread packages/server-utils/src/index.ts
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 30.3 kB - -
@sentry/browser - with treeshaking flags 28.47 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.81 kB - -
@sentry/browser (incl. Tracing) 48.54 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.55 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.43 kB - -
@sentry/browser (incl. Tracing, Replay) 87.94 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.32 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.67 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.36 kB - -
@sentry/browser (incl. Feedback) 47.65 kB - -
@sentry/browser (incl. sendFeedback) 35.13 kB - -
@sentry/browser (incl. FeedbackAsync) 40.28 kB - -
@sentry/browser (incl. Metrics) 31.24 kB - -
@sentry/browser (incl. Logs) 31.52 kB - -
@sentry/browser (incl. Metrics & Logs) 32.15 kB - -
@sentry/react 32.09 kB - -
@sentry/react (incl. Tracing) 50.73 kB - -
@sentry/vue 35.31 kB - -
@sentry/vue (incl. Tracing) 50.5 kB - -
@sentry/svelte 30.33 kB - -
CDN Bundle 31.61 kB - -
CDN Bundle (incl. Tracing) 48.87 kB - -
CDN Bundle (incl. Logs, Metrics) 33.8 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.79 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.31 kB - -
CDN Bundle (incl. Tracing, Replay) 86.46 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.16 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.11 kB - -
CDN Bundle - uncompressed 93.84 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.72 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.41 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.08 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.98 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.68 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.34 kB - -
@sentry/nextjs (client) 53.26 kB - -
@sentry/sveltekit (client) 48.96 kB - -
@sentry/core/server 65.34 kB - -
@sentry/core/browser 51.69 kB - -
@sentry/node 117.67 kB -0.01% -3 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 82.06 kB -0.01% -3 B 🔽
@sentry/aws-serverless 91.46 kB -0.01% -2 B 🔽
@sentry/cloudflare (withSentry) - minified 194.36 kB -9.18% -19.64 kB 🔽
@sentry/cloudflare (withSentry) 480.39 kB -9.15% -48.38 kB 🔽

View base workflow run

@mydea
mydea force-pushed the fn/remove-vercelai-processors branch from 14bb3ef to d6aec87 Compare August 13, 2026 08:51
@mydea
mydea force-pushed the fn/remove-vercelai-processors branch from d6aec87 to 7d9dff7 Compare August 13, 2026 09:28
Comment thread packages/cloudflare/src/integrations/tracing/vercelai.ts Outdated
@mydea
mydea force-pushed the fn/remove-vercelai-processors branch from 7d9dff7 to 29dd416 Compare August 13, 2026 11:23
Base automatically changed from fn/rename-vercelai-integration to develop August 13, 2026 11:54
mydea and others added 5 commits August 13, 2026 13:54
…span processing

Removes the OpenTelemetry-span post-processing path for the Vercel AI SDK
(`addVercelAiProcessors` and everything reachable only through it) from
`@sentry/server-utils`. `getProviderMetadataAttributes`, still shared with the
`ai` >= 7 tracing-channel subscriber, is kept.

- vercel-edge: the `vercelAIIntegration` is removed entirely (no longer supported).
- deno & cloudflare: use the server-utils `vercelAIIntegration` directly instead
  of wrapping it with the OTel processors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Removing `vercelAIIntegration` from `@sentry/vercel-edge` dropped it from the
`@sentry/nextjs` edge build (which re-exports that package), so named imports
from `@sentry/nextjs` would fail when Next.js compiles instrumentation for the
edge runtime — while `index.types.ts` still declares the export.

Mirror the existing `pinoIntegration` pattern: a no-op edge shim plus an explicit
server re-export so the export is statically detectable from both builds. Extends
the `serverExports` regression test to cover it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the fn/remove-vercelai-processors branch from 29dd416 to b45c204 Compare August 13, 2026 11:54
Comment thread packages/cloudflare/src/sdk.ts
Comment thread packages/cloudflare/src/index.ts

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a3f614e. Configure here.

// however, for things with native channel support (like ai v7) we do not know about this
// we'll fix this in a follow up, but for the time being vercelAIIntegration is added here
// TODO: Remove this once we auto-inject integrations for native channels as well
vercelAIIntegration(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Default and public integrations diverge

Medium Severity

The default vercelAIIntegration is loaded from @sentry/server-utils/orchestrion (v4–v7, including orchestrion channels), but @sentry/cloudflare still re-exports the v7-only factory from @sentry/server-utils. Passing vercelAIIntegration() from the public API replaces the default by name, so v4–v6 channel instrumentation is dropped even when the Vite plugin injected those channels.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a3f614e. Configure here.

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.

1 participant