@@ -17,7 +17,6 @@ import {
1717} from '@sentry/core' ;
1818import { isMainThread , parentPort } from 'node:worker_threads' ;
1919import { detectOrchestrionSetup , getErrorIntegrations , getTracingIntegrations } from '@sentry/server-utils' ;
20- import { registerDiagnosticsChannelInjection } from '@sentry/server-runtime-injection/register' ;
2120import { DEBUG_BUILD } from '../debug-build' ;
2221import { childProcessIntegration } from '../integrations/childProcess' ;
2322import { consoleIntegration } from '../integrations/console' ;
@@ -41,10 +40,6 @@ import { defaultStackParser, getSentryRelease } from './api';
4140import { NodeClient } from './client' ;
4241import { initOpenTelemetry } from './initOtel' ;
4342
44- // Treeshakable guard to remove all code related to runtime diagnostics-channel injection. Set to
45- // `false` at build time by the Sentry bundler plugins' `bundleSizeOptimizations.excludeChannelInjection`.
46- declare const __SENTRY_CHANNEL_INJECTION__ : boolean | undefined ;
47-
4843/**
4944 * Get the base default integrations shared by all Node SDK default-integration sets.
5045 */
@@ -134,9 +129,10 @@ function _init(
134129
135130 applySdkMetadata ( options , 'node' ) ;
136131
137- // Enable debug logging before channel-injection registration below, so its failure modes (e.g. no
138- // available Node hook API, dep-resolution errors) actually surface. `getClientOptions` resolves
139- // `debug` the same way for the client; resolving it here as well keeps the two in agreement.
132+ // Enable debug logging before the client is created, so failure modes during setup (e.g. the
133+ // channel-injection registration finding no available Node hook API, or dep-resolution errors)
134+ // actually surface. `getClientOptions` resolves `debug` the same way for the client; resolving it
135+ // here as well keeps the two in agreement.
140136 if ( envToBool ( options . debug ?? process . env . SENTRY_DEBUG ) ) {
141137 if ( DEBUG_BUILD ) {
142138 debug . enable ( ) ;
@@ -158,18 +154,6 @@ function _init(
158154 tracesSampleRate : getTracesSampleRate ( options . tracesSampleRate ) ,
159155 } ;
160156
161- // Install the channel-based (orchestrion diagnostics-channel) instrumentation hooks by default,
162- // independent of tracing — the channel integrations also capture errors, not just spans. Opt out at
163- // runtime with `enableRuntimeChannelInjection: false`, or at build time via the bundler plugins'
164- // `bundleSizeOptimizations.excludeChannelInjection` (which tree-shakes this whole block away).
165- // Install as early as possible, before the app imports its instrumented modules.
166- if (
167- ( typeof __SENTRY_CHANNEL_INJECTION__ === 'undefined' || __SENTRY_CHANNEL_INJECTION__ ) &&
168- options . enableRuntimeChannelInjection !== false
169- ) {
170- registerDiagnosticsChannelInjection ( ) ;
171- }
172-
173157 // Only use Node SDK defaults if none provided.
174158 const defaultIntegrations = options . defaultIntegrations ?? getDefaultIntegrationsImpl ( optionsWithResolvedTracing ) ;
175159
0 commit comments