feat(cloudflare): Add @sentry/cloudflare/vite orchestrion plugin #21967
Merged
Conversation
Contributor
size-limit report 📦
|
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
8 times, most recently
from
July 13, 2026 09:48
18b7454 to
596608d
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
from
July 13, 2026 13:08
596608d to
f5c454b
Compare
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
from
July 14, 2026 13:26
4d78130 to
b66e928
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
from
July 14, 2026 13:32
515173e to
45a679c
Compare
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
from
July 14, 2026 14:44
b66e928 to
332ece3
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
from
July 14, 2026 14:44
45a679c to
6e6c5b7
Compare
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
4 times, most recently
from
July 15, 2026 07:30
baafdd8 to
931a37a
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
from
July 15, 2026 08:56
6e6c5b7 to
d6c0992
Compare
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
from
July 15, 2026 09:20
95c6874 to
c0dfebc
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
4 times, most recently
from
July 15, 2026 09:43
4da617b to
965040a
Compare
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 965040a. Configure here.
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
2 times, most recently
from
July 15, 2026 10:50
c7a4227 to
f750c0d
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
2 times, most recently
from
July 15, 2026 11:16
2a66913 to
7249eff
Compare
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
from
July 15, 2026 11:38
e7262f3 to
6713fc3
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
from
July 15, 2026 11:38
7249eff to
afcb71d
Compare
s1gr1d
reviewed
Jul 15, 2026
Comment on lines
+51
to
+52
| "types": "./build/types/vite/index.d.ts", | ||
| "import": "./build/esm/vite/index.js" |
Member
There was a problem hiding this comment.
Don't you need the cjs export here as well? Other exports have it 👀
Edit: I just noticed the comment above that it's only ESM. But this PR could fix that: #22286
s1gr1d
reviewed
Jul 15, 2026
s1gr1d
approved these changes
Jul 15, 2026
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
from
July 16, 2026 06:39
6713fc3 to
0d56181
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
2 times, most recently
from
July 16, 2026 07:34
8517822 to
7e8f420
Compare
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
from
July 17, 2026 06:57
b59ebba to
157e383
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
from
July 17, 2026 06:57
cfc41ca to
d2a6c9f
Compare
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
from
July 17, 2026 07:21
157e383 to
6755627
Compare
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
from
July 17, 2026 07:21
d2a6c9f to
dbd5795
Compare
isaacs
approved these changes
Jul 20, 2026
timfish
approved these changes
Jul 20, 2026
JPeer264
force-pushed
the
jp/orchestrion-integrations
branch
from
July 21, 2026 08:32
713422f to
022aa6a
Compare
…tics channels Integrate the server-utils orchestrion channel-integration mechanism into the Cloudflare SDK, so bundled npm packages (e.g. `mysql`) are traced without monkey-patching, which workerd doesn't support anyway. - Add the `@sentry/cloudflare/vite` plugin, which runs the orchestrion transform (injecting `diagnostics_channel.tracingChannel` calls) and injects a registration module that puts the channel-subscriber integrations on the global marker. Workers built without the plugin don't ship that code. - `getDefaultIntegrations()` reads the registered integrations from the marker at `init()`, activating only those whose module was actually transformed, and warns (debug only, once per isolate) about modules whose transform failed. - Add a Cloudflare + MySQL e2e test app exercising real `db` spans in workerd. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tics channels Integrate the server-utils orchestrion channel-integration mechanism into the Cloudflare SDK, so bundled npm packages (e.g. `mysql`) are traced without monkey-patching, which workerd doesn't support anyway. - Add the `@sentry/cloudflare/vite` plugin, which runs the orchestrion transform (injecting `diagnostics_channel.tracingChannel` calls) and injects a registration module that puts the channel-subscriber integrations on the global marker. Workers built without the plugin don't ship that code. - `getDefaultIntegrations()` reads the registered integrations from the marker at `init()`, activating only those whose module was actually transformed, and warns (debug only, once per isolate) about modules whose transform failed. - Add a Cloudflare + MySQL e2e test app exercising real `db` spans in workerd. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/orchestrion-cloudflare
branch
from
July 21, 2026 08:33
dbd5795 to
494d73c
Compare
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #22062
This adds a
/viteplugin for Cloudflare that adds Orchestrion on build time. It adds all orchestrion integrations in thedefaultIntegrations, which adds more bundle size - this is not optimal and will be adapted in a follow up PR. Best case scenario: Only add integrations which the user really installed.For now the user only has to add the following to the Vite config:
import { cloudflare } from '@cloudflare/vite-plugin'; + import { sentryCloudflareVitePlugin } from '@sentry/cloudflare/vite'; import { defineConfig } from 'vite'; export default defineConfig({ - plugins: [cloudflare()], + plugins: [ + cloudflare(), + sentryCloudflareVitePlugin({ + _experimental: { + useDiagnosticsChannelInjection: true, + } + }) + ], });The
_experimental.useDiagnosticsChannelInjectionis the same as we have in Next.js via the Webpack plugin - so it stays consistentAlso the migration from pure wrangler to Vite is as easy as just adding
vite.config.tsand prependingvite buildbeforewrangler deploy: https://developers.cloudflare.com/workers/vite-plugin/reference/migrating-from-wrangler-dev/