-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(server-utils)!: Register channel integrations on versions with native channels #23405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { cloudflare } from '@cloudflare/vite-plugin'; | ||
| import { sentryCloudflareVitePlugin } from '@sentry/cloudflare/vite'; | ||
| import { defineConfig } from 'vite'; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [cloudflare(), sentryCloudflareVitePlugin({ autoInstrumentation: false })], | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { cloudflare } from '@cloudflare/vite-plugin'; | ||
| import { sentryCloudflareVitePlugin } from '@sentry/cloudflare/vite'; | ||
| import { defineConfig } from 'vite'; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [cloudflare(), sentryCloudflareVitePlugin()], | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| /** | ||
| * Build-time metadata mapping each instrumented package (orchestrion | ||
| * `module.name`) to the channel-subscriber integration that consumes the | ||
| * channels injected into it — by the `exportName` it is published under from | ||
| * `@sentry/server-utils/orchestrion`. | ||
| * Build-time metadata mapping each channel-subscriber integration — by the | ||
| * `exportName` it is published under from `@sentry/server-utils/orchestrion` — | ||
| * to the instrumented packages (orchestrion `module.name`) whose channels it | ||
| * consumes. | ||
| * | ||
| * Kept in a separate, factory-free module on purpose: the module-injected | ||
| * transform (reachable from every orchestrion bundler plugin) reads this to | ||
|
|
@@ -20,6 +20,7 @@ export const CHANNEL_INTEGRATION_DEFINITIONS = [ | |
| { exportName: 'postgresJsIntegration', modules: ['postgres'] }, | ||
| { exportName: 'mysqlIntegration', modules: ['mysql'] }, | ||
| { exportName: 'mysql2Integration', modules: ['mysql2'] }, | ||
| { exportName: 'mongooseIntegration', modules: ['mongoose'] }, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. That is the follow up: #23477 |
||
| { exportName: 'genericPoolIntegration', modules: ['generic-pool'] }, | ||
| { exportName: 'lruMemoizerIntegration', modules: ['lru-memoizer'] }, | ||
| { exportName: 'openAIIntegration', modules: ['openai'] }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import type { InstrumentationConfig } from '..'; | ||
|
|
||
| /** | ||
| * Name of the custom transform (see `bundler/moduleInjectedTransform.ts`) that | ||
| * splices only the module-injected registration snippet — no channel machinery. | ||
| * Prefixed so it can never shadow a built-in operator (`traceSync`, | ||
| * `tracingChannelImport`, ...), which the custom-transforms map overrides by | ||
| * name. | ||
| */ | ||
| export const MODULE_REGISTRATION_TRANSFORM = 'sentryModuleRegistration'; | ||
|
|
||
| /** | ||
| * Build a registration-only config for one file of a library whose tracing | ||
| * channels are native (published by the library itself): no channels are | ||
| * injected, but transforming the file registers the module's channel-subscriber | ||
| * integration at evaluation time. `astQuery: 'Program'` matches the file root | ||
| * unconditionally, so no anchor function inside the library needs to exist. | ||
| */ | ||
| export function registrationOnly(module: { | ||
| name: string; | ||
| versionRange: string; | ||
| filePath: string; | ||
| }): InstrumentationConfig { | ||
| return { | ||
| channelName: 'module-registration', | ||
| module, | ||
| astQuery: 'Program', | ||
| transform: MODULE_REGISTRATION_TRANSFORM, | ||
| }; | ||
| } |
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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