Skip to content

fix(server-utils)!: Register channel integrations on versions with native channels - #23405

Merged
JPeer264 merged 3 commits into
developfrom
jp/orchestrion-channel-native
Aug 22, 2026
Merged

fix(server-utils)!: Register channel integrations on versions with native channels#23405
JPeer264 merged 3 commits into
developfrom
jp/orchestrion-channel-native

Conversation

@JPeer264

@JPeer264 JPeer264 commented Aug 13, 2026

Copy link
Copy Markdown
Member

Problem

When injecting tracing channels via Orchestrion we also add the integration on the fly, to save bytes on the SDK itself and only add integrations where we need them. The main problem is that for versions where a library has tracing channels baked in, our matchers don't match, so nothing is injected into the bundle and the integration is never registered. Those versions get no instrumentation at all, even though the native channels are exactly what the subscriber consumes. This already affects some integrations today and will affect more as libraries adopt native channels.

Solution

Registration-only configs. For library versions with native channels, registrationOnly() produces a config with astQuery: 'Program' and a custom transform (sentryModuleRegistration). Orchestrion dispatches the named transform instead of its built-in traceSync operator, so the only thing injected is the module-registration snippet that registers the subscriber integration when the module is evaluated. No diagnostics_channel import, no channel declaration, and no function wrapper are added.

Matching the Program node also means the config doesn't depend on any anchor function existing inside the library, so a refactor within the open-ended version range can't trigger orchestrion's "Failed to find injection points" build error.

This is only breaking because in Cloudflare we removed the vercelAIIntegration by default (ai >= 7 is now registered via the bundler plugin). This only affects v11, so I didn't add it to the migration.md.

@JPeer264 JPeer264 self-assigned this Aug 13, 2026
@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.51 kB +0.12% +130 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB +0.12% +100 B 🔺
@sentry/node - without tracing 82.02 kB +0.17% +136 B 🔺
@sentry/aws-serverless 91.42 kB +0.14% +124 B 🔺
@sentry/cloudflare (withSentry) - minified 194.35 kB -9.18% -19.64 kB 🔽
@sentry/cloudflare (withSentry) 480.53 kB -9.16% -48.4 kB 🔽

View base workflow run

@JPeer264
JPeer264 force-pushed the jp/orchestrion-channel-native branch 2 times, most recently from c35446b to 3d8f160 Compare August 14, 2026 09:17
{ exportName: 'postgresJsIntegration', modules: ['postgres'] },
{ exportName: 'mysqlIntegration', modules: ['mysql'] },
{ exportName: 'mysql2Integration', modules: ['mysql2'] },
{ exportName: 'mongooseIntegration', modules: ['mongoose'] },

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.

also needs to add: prisma, fastify, I suppose?

@JPeer264 JPeer264 Aug 20, 2026

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.

Yes that is a separate commit (and PR). There are way more missing

@JPeer264
JPeer264 force-pushed the jp/orchestrion-channel-native branch from b3c6e1e to f0bb82f Compare August 21, 2026 06:40
{ exportName: 'postgresJsIntegration', modules: ['postgres'] },
{ exportName: 'mysqlIntegration', modules: ['mysql'] },
{ exportName: 'mysql2Integration', modules: ['mysql2'] },
{ exportName: 'mongooseIntegration', modules: ['mongoose'] },

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.

do we need to add the other things that are native here? I think these are missing here:

  Missing exportName  │                          module(s)                          │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ awsIntegration       │ @smithy/core, @smithy/smithy-client, @aws-sdk/smithy-client │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ koaIntegration       │ koa                                                         │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ knexIntegration      │ knex                                                        │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ langChainIntegration │ @langchain/core, @langchain/openai, …                       │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ langGraphIntegration │ @langchain/langgraph                                        │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ mongoIntegration     │ mongodb                                                     │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ mongooseIntegration  │ mongoose                                                    │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ tediousIntegration   │ tedious                                                     │
├──────────────────────┼─────────────────────────────────────────────────────────────┤
│ firebaseIntegration  │ @firebase/firestore, firebase-functions

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.

Yes they are missing. I tried to split it up in another PR to keep it small. mongoose is only in this PR since it has native channels already.

That is the follow up: #23477

@JPeer264
JPeer264 marked this pull request as ready for review August 21, 2026 10:04
@JPeer264
JPeer264 requested review from a team as code owners August 21, 2026 10:04
@JPeer264
JPeer264 requested review from andreiborza and isaacs and removed request for a team August 21, 2026 10:04
@JPeer264
JPeer264 merged commit 0e8bff1 into develop Aug 22, 2026
199 of 201 checks passed
@JPeer264
JPeer264 deleted the jp/orchestrion-channel-native branch August 22, 2026 12:13
JPeer264 added a commit that referenced this pull request Aug 22, 2026
This adds the missing integrations based on top of #23405

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

4 participants