Skip to content

ref(workers-ai)!: Move Workers AI integration to @sentry/server-utils - #22960

Merged
nicohrubec merged 1 commit into
ref/move-ai-google-genai-2from
ref/move-ai-workers-ai-2
Aug 4, 2026
Merged

ref(workers-ai)!: Move Workers AI integration to @sentry/server-utils#22960
nicohrubec merged 1 commit into
ref/move-ai-google-genai-2from
ref/move-ai-workers-ai-2

Conversation

@nicohrubec

@nicohrubec nicohrubec commented Aug 3, 2026

Copy link
Copy Markdown
Member

This moves the OpenAI integration core logic from @sentry/core to @sentry/server-utils, dropping all exports except the instrumentWorkersAiClient.

vercel-edge re-exports instrumentWorkersAiClient from @sentry/server-utils/no-diagnostic-channels to keep the edge build free of node:diagnostics_channel.

Not sure about the 12kB size increase for cloudflare?

@nicohrubec
nicohrubec force-pushed the ref/move-ai-workers-ai-2 branch from 37de299 to 98d9d97 Compare August 3, 2026 13:47
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.91 kB - -
@sentry/browser - with treeshaking flags 28.12 kB - -
@sentry/browser (incl. Tracing) 47.36 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.36 kB - -
@sentry/browser (incl. Tracing, Profiling) 52.13 kB - -
@sentry/browser (incl. Tracing, Replay) 86.7 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.13 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.41 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 104.05 kB - -
@sentry/browser (incl. Feedback) 47.22 kB - -
@sentry/browser (incl. sendFeedback) 34.76 kB - -
@sentry/browser (incl. FeedbackAsync) 39.87 kB - -
@sentry/browser (incl. Metrics) 30.99 kB - -
@sentry/browser (incl. Logs) 31.22 kB - -
@sentry/browser (incl. Metrics & Logs) 31.9 kB - -
@sentry/react 31.73 kB - -
@sentry/react (incl. Tracing) 49.61 kB - -
@sentry/vue 34.98 kB - -
@sentry/vue (incl. Tracing) 49.34 kB - -
@sentry/svelte 29.94 kB - -
CDN Bundle 32.01 kB - -
CDN Bundle (incl. Tracing) 47.72 kB - -
CDN Bundle (incl. Logs, Metrics) 33.55 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.08 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.9 kB - -
CDN Bundle (incl. Tracing, Replay) 85.35 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.14 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.46 kB - -
CDN Bundle - uncompressed 95.52 kB - -
CDN Bundle (incl. Tracing) - uncompressed 143.1 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.08 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.99 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.36 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.07 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280.02 kB - -
@sentry/nextjs (client) 52.21 kB - -
@sentry/sveltekit (client) 47.81 kB - -
@sentry/core/server 73.84 kB -7.71% -6.17 kB 🔽
@sentry/core/browser 51.97 kB - -
@sentry/node 121.33 kB +0.37% +440 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 84.26 kB - -
@sentry/aws-serverless 92.94 kB - -
@sentry/cloudflare (withSentry) - minified 224.93 kB +2.54% +5.57 kB 🔺
@sentry/cloudflare (withSentry) 553.24 kB +2.37% +12.76 kB 🔺

View base workflow run

@nicohrubec
nicohrubec force-pushed the ref/move-ai-workers-ai-2 branch from 98d9d97 to 94e3d08 Compare August 3, 2026 15:37
@nicohrubec
nicohrubec marked this pull request as ready for review August 4, 2026 06:54
@nicohrubec
nicohrubec requested review from a team as code owners August 4, 2026 06:54
@nicohrubec
nicohrubec requested review from JPeer264, andreiborza and mydea and removed request for a team and mydea August 4, 2026 06:54
OPERATION_NAME_ATTRIBUTE,
} from './vercel-ai-attributes';

const WORKERS_AI_INTEGRATION_NAME = 'WorkersAI';

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.

m: We have 3 WORKERS_AI_INTEGRATION_NAME, the plan was once this is consolidated into one, to export it from server-utils and then import it wherever this is needed.

There should be a todo in vercel-ai-dc-subscriber.ts

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.

good catch I'll fix this in the vercel ai when all the integrations that need this are moved to server utils

@nicohrubec
nicohrubec force-pushed the ref/move-ai-workers-ai-2 branch from 94e3d08 to 9b21dc9 Compare August 4, 2026 09:29
Move the Cloudflare Workers AI gen-ai instrumentation from `@sentry/core` to
`@sentry/server-utils/src/ai/workers-ai`, consuming the shared `ai/core` base.
`instrumentWorkersAiClient` is no longer exported from `@sentry/core`; cloudflare
consumes it from `@sentry/server-utils` (both internally in `instrumentEnv` and as a
public re-export), so the platform SDK public API is unchanged.

Core's `vercel-ai` still references `WORKERS_AI_INTEGRATION_NAME`; since it stays in
core until the final cleanup PR and core cannot import from server-utils, the string
value is inlined there for now.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nicohrubec
nicohrubec force-pushed the ref/move-ai-workers-ai-2 branch from 9b21dc9 to f6edf61 Compare August 4, 2026 09:48
@nicohrubec
nicohrubec merged commit 95e4e00 into develop Aug 4, 2026
270 of 271 checks passed
@nicohrubec
nicohrubec deleted the ref/move-ai-workers-ai-2 branch August 4, 2026 12:01
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