Skip to content

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

Merged
mydea merged 11 commits into
developfrom
fn/remove-vercelai-processors
Aug 24, 2026
Merged

ref(server-utils): Remove addVercelAiProcessors and Vercel AI OTel span processing#23384
mydea merged 11 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 📦

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.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.59 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.46 kB - -
@sentry/browser (incl. Tracing, Replay) 87.98 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.36 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.7 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.39 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.77 kB - -
@sentry/vue 35.34 kB - -
@sentry/vue (incl. Tracing) 50.54 kB - -
@sentry/svelte 30.33 kB - -
CDN Bundle 31.61 kB - -
CDN Bundle (incl. Tracing) 48.9 kB - -
CDN Bundle (incl. Logs, Metrics) 33.8 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.82 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.31 kB - -
CDN Bundle (incl. Tracing, Replay) 86.48 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.31 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.19 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.12 kB - -
CDN Bundle - uncompressed 93.84 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.75 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.44 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.08 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.68 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.37 kB - -
@sentry/nextjs (client) 53.29 kB - -
@sentry/sveltekit (client) 49 kB - -
@sentry/core/server 65.38 kB - -
@sentry/core/browser 51.72 kB - -
@sentry/node 117.47 kB +0.02% +22 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 82 kB +0.03% +23 B 🔺
@sentry/aws-serverless 91.37 kB +0.03% +27 B 🔺
@sentry/cloudflare (withSentry) - minified 194.46 kB - -
@sentry/cloudflare (withSentry) 480.88 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
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 Outdated
Comment thread packages/cloudflare/src/index.ts Outdated

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

Comment thread packages/cloudflare/src/sdk.ts Outdated
@mydea
mydea force-pushed the fn/remove-vercelai-processors branch 2 times, most recently from cd952c4 to f4fb222 Compare August 20, 2026 07:00
mydea and others added 11 commits August 24, 2026 09:24
…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 f4fb222 to 640b46f Compare August 24, 2026 07:40
@mydea
mydea marked this pull request as ready for review August 24, 2026 07:53
@mydea
mydea requested review from a team as code owners August 24, 2026 07:53
@mydea
mydea requested a review from a team as a code owner August 24, 2026 07:53
@mydea
mydea requested review from JPeer264, chargome, isaacs and nicohrubec and removed request for a team August 24, 2026 07:53
instrumentStateGraph,
instrumentCreateReactAgent,
} from '@sentry/server-utils';
export { vercelAIIntegration } from '@sentry/server-utils/orchestrion';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The exported vercelAIIntegration for Cloudflare will fail if the nodejs_compat flag is not enabled, as it lacks a guard for the node:diagnostics_channel dependency.
Severity: HIGH

Suggested Fix

Add a guard in the orchestrion version of vercelAIIntegration (packages/server-utils/src/integrations/vercel-ai.ts) to check if dc.tracingChannel is available before using it, similar to the guard in the base integration. This will prevent crashes in environments without Node.js compatibility, like default Cloudflare Workers. Alternatively, do not export this integration from the @sentry/cloudflare package.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: packages/cloudflare/src/index.ts#L137

Potential issue: The `vercelAIIntegration` exported from `@sentry/cloudflare`
(re-exported from `@sentry/server-utils/orchestrion`) unconditionally imports and uses
`node:diagnostics_channel`. However, this module is only available in Cloudflare Workers
when the `nodejs_compat` compatibility flag is enabled. Unlike the base integration,
this version lacks a runtime guard to check for the existence of `dc.tracingChannel`.
Consequently, any Cloudflare user who uses this integration without enabling
`nodejs_compat` will experience a runtime error when the application attempts to load
the missing Node.js module.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That can be ignored.

Comment thread MIGRATION.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These need to go into docs/migration/v11-end-state.md I think

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

right, #23510!

@mydea
mydea merged commit a58b778 into develop Aug 24, 2026
201 of 202 checks passed
@mydea
mydea deleted the fn/remove-vercelai-processors branch August 24, 2026 10:47
mydea added a commit that referenced this pull request Aug 24, 2026
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.

3 participants