Skip to content

Commit 288bbb6

Browse files
andreiborzaclaude
andauthored
feat(node)!: Remove init, preload entry points and preloadOpenTelemetry (#23074)
## What Remove the following from `@sentry/node`, part of the v11 major: * The `@sentry/node/init` and `@sentry/node/preload` no-code entry points. * The `preloadOpenTelemetry()` function. * The `node-express-{cjs,esm}-preload` e2e apps and the `no-code` integration suite that tested them. Also repurposes the `express/late-init` integration suite (renamed to `express/ignore-layers-type`) into a focused `ignoreLayersType` test. ## Why All instrumentation is channel-based via orchestrion and is set up when the instrumented module loads, so preloading no longer does anything. `preloadOpenTelemetry()` could only ever preload the Sentry HTTP breadcrumb/propagation instrument, which normal `init()` already sets up, so it had quietly stopped doing its advertised job. The issue proposed deprecating `init`/`preload`, but since `develop` is the v11 line a deprecation cycle buys nothing, so these are removed outright. `@sentry/node/import` stays as the one supported hook. `@sentry/node/loader` and `@sentry/node/auto-diagnostic-channels` from the issue are already moot: `/loader` was removed with the iitm cleanup, and `/import` already is the orchestrion diagnostics-channel hook that `/auto-diagnostic-channels` was meant to become. The `late-init` suite existed to guard lazy Express option loading via a later `init()`, a mechanism that now lives only in `@sentry/core`'s `patchLayer` (Deno-only, unit-tested) and is unreachable in node under orchestrion. It was also the only node e2e test exercising `ignoreLayersType`, so it is kept and refocused on that option rather than deleted. Closes: #21483 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8c2a490 commit 288bbb6

28 files changed

Lines changed: 22 additions & 715 deletions

File tree

MIGRATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@ node --require ./instrument.js app.js
236236
node --import ./instrument.js app.js
237237
```
238238

239-
The same applies to the no-code entry points, e.g. `node --import=@sentry/node/init app.js` and `node --import @sentry/node/preload app.js`.
240-
241239
### Span streaming is now the default
242240

243241
Affected SDKs: All SDKs.
@@ -613,6 +611,8 @@ Sentry.init({
613611
- The `registerEsmLoaderHooks` option was removed. All instrumentation is now channel-based (via `@sentry/server-utils`), so the SDK no longer registers `import-in-the-middle` ESM loader hooks and the option no longer had any effect.
614612
- The deprecated `SentryHttpInstrumentation` and `SentryNodeFetchInstrumentation` exports were removed. Use `instrumentHttpOutgoingRequests()` and the `nativeNodeFetchIntegration` respectively.
615613
- The `generateInstrumentOnce` export was removed (from `@sentry/node` and the framework SDKs that re-exported it). It wrapped OpenTelemetry's `registerInstrumentations` and is no longer needed now that instrumentation is channel-based.
614+
- The `@sentry/node/init` and `@sentry/node/preload` entry points were removed. Create your own instrument file that calls `Sentry.init()` and preload it with `node --import ./instrument.mjs app.js` instead.
615+
- The `preloadOpenTelemetry()` function was removed. All instrumentation is now channel-based via `orchestrion` and is set up when the instrumented module loads, so preloading is no longer needed.
616616
- The `@sentry/node/loader` entry point was removed. Use `node --import @sentry/node/import` instead.
617617
- (Astro) The `@sentry/astro/loader` entry point was removed. Use `node --import @sentry/astro/import` instead.
618618
- (AWS Lambda) The `@sentry/aws-serverless/loader` entry point was removed. Use `node --import @sentry/aws-serverless/import` instead.

dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const NODE_EXPORTS_IGNORE = [
1818
'setOpenTelemetryContextAsyncContextStrategy',
1919
'getDefaultIntegrationsWithoutPerformance',
2020
'initWithoutDefaultIntegrations',
21-
'preloadOpenTelemetry',
2221
// Internal helper only needed within integrations (e.g. bunRuntimeMetricsIntegration)
2322
'_INTERNAL_normalizeCollectionInterval',
2423
// not exported by bun

dev-packages/e2e-tests/test-applications/node-express-cjs-preload/package.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/node-express-cjs-preload/playwright.config.mjs

Lines changed: 0 additions & 7 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/node-express-cjs-preload/src/app.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/node-express-cjs-preload/start-event-proxy.mjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/node-express-cjs-preload/tests/server.test.ts

Lines changed: 0 additions & 117 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/node-express-esm-preload/package.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/node-express-esm-preload/playwright.config.mjs

Lines changed: 0 additions & 7 deletions
This file was deleted.

dev-packages/e2e-tests/test-applications/node-express-esm-preload/src/app.mjs

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)