Skip to content

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

Draft
nicohrubec wants to merge 1 commit into
ref/move-ai-google-genai-2from
ref/move-ai-workers-ai-2
Draft

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

Conversation

@nicohrubec

Copy link
Copy Markdown
Member

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 consumed by cloudflare from @sentry/server-utils (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 — it re-couples to ../workers-ai/constants when vercel-ai moves last.

🤖 Generated with Claude Code

@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 -0.02% -5 B 🔽
@sentry/browser - with treeshaking flags 28.11 kB -0.02% -4 B 🔽
@sentry/browser (incl. Tracing) 47.35 kB -0.02% -5 B 🔽
@sentry/browser (incl. Tracing + Span Streaming) 47.36 kB -0.01% -4 B 🔽
@sentry/browser (incl. Tracing, Profiling) 52.13 kB -0.01% -5 B 🔽
@sentry/browser (incl. Tracing, Replay) 86.69 kB -0.01% -4 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.13 kB -0.01% -4 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 91.41 kB -0.01% -4 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 104.05 kB -0.01% -5 B 🔽
@sentry/browser (incl. Feedback) 47.22 kB -0.02% -5 B 🔽
@sentry/browser (incl. sendFeedback) 34.76 kB -0.02% -5 B 🔽
@sentry/browser (incl. FeedbackAsync) 39.86 kB -0.02% -6 B 🔽
@sentry/browser (incl. Metrics) 30.99 kB -0.02% -5 B 🔽
@sentry/browser (incl. Logs) 31.22 kB -0.02% -4 B 🔽
@sentry/browser (incl. Metrics & Logs) 31.89 kB -0.02% -4 B 🔽
@sentry/react 31.73 kB -0.02% -5 B 🔽
@sentry/react (incl. Tracing) 49.61 kB -0.01% -4 B 🔽
@sentry/vue 34.98 kB -0.03% -7 B 🔽
@sentry/vue (incl. Tracing) 49.34 kB -0.02% -5 B 🔽
@sentry/svelte 29.94 kB -0.02% -5 B 🔽
CDN Bundle 32 kB -0.02% -6 B 🔽
CDN Bundle (incl. Tracing) 47.72 kB -0.02% -6 B 🔽
CDN Bundle (incl. Logs, Metrics) 33.55 kB -0.02% -4 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) 49.08 kB -0.02% -7 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 72.89 kB -0.01% -5 B 🔽
CDN Bundle (incl. Tracing, Replay) 85.35 kB -0.01% -7 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.65 kB -0.01% -7 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 91.14 kB -0.01% -5 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.45 kB -0.01% -7 B 🔽
CDN Bundle - uncompressed 95.5 kB -0.03% -24 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 143.08 kB -0.02% -24 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.21 kB -0.03% -24 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 147.06 kB -0.02% -24 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.97 kB -0.02% -24 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 262.34 kB -0.01% -24 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 266.3 kB -0.01% -24 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 276.04 kB -0.01% -24 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 280 kB -0.01% -24 B 🔽
@sentry/nextjs (client) 52.2 kB -0.01% -4 B 🔽
@sentry/sveltekit (client) 47.8 kB -0.02% -8 B 🔽
@sentry/core/server 73.84 kB -7.72% -6.18 kB 🔽
@sentry/core/browser 51.96 kB -0.02% -9 B 🔽
@sentry/node 121.32 kB +0.36% +433 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 84.26 kB -0.01% -4 B 🔽
@sentry/aws-serverless 92.92 kB -0.02% -16 B 🔽
@sentry/cloudflare (withSentry) - minified 224.91 kB +2.53% +5.54 kB 🔺
@sentry/cloudflare (withSentry) 553.2 kB +2.36% +12.73 kB 🔺

View base workflow run

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 98d9d97 to 94e3d08 Compare August 3, 2026 15:37
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