diff --git a/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts b/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts index 546639e8a766..83f9c1639cdc 100644 --- a/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts +++ b/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts @@ -52,6 +52,7 @@ const DEPENDENTS: Dependent[] = [ 'NodeClient', // Bun doesn't emit the required diagnostics_channel events 'processThreadBreadcrumbIntegration', + 'childProcessIntegration', ], }, { diff --git a/docs/migration/draft-v9-migration-guide.md b/docs/migration/draft-v9-migration-guide.md index bbbb2c2d367f..8b0cebd7e51d 100644 --- a/docs/migration/draft-v9-migration-guide.md +++ b/docs/migration/draft-v9-migration-guide.md @@ -12,6 +12,10 @@ - Deprecated `transactionNamingScheme` option in `requestDataIntegration`. -## `@sentry/types`` +## `@sentry/types` - Deprecated `Request` in favor of `RequestEventData`. + +## Server-side SDKs (`@sentry/node` and all dependents) + +- Deprecated `processThreadBreadcrumbIntegration` in favor of `childProcessIntegration`. Functionally they are the same. diff --git a/packages/astro/src/index.server.ts b/packages/astro/src/index.server.ts index e4c871ec74ea..853623abbc8a 100644 --- a/packages/astro/src/index.server.ts +++ b/packages/astro/src/index.server.ts @@ -91,7 +91,9 @@ export { parameterize, postgresIntegration, prismaIntegration, + // eslint-disable-next-line deprecation/deprecation processThreadBreadcrumbIntegration, + childProcessIntegration, redisIntegration, requestDataIntegration, rewriteFramesIntegration, diff --git a/packages/aws-serverless/src/index.ts b/packages/aws-serverless/src/index.ts index 060dddd51787..8341b01719c1 100644 --- a/packages/aws-serverless/src/index.ts +++ b/packages/aws-serverless/src/index.ts @@ -105,7 +105,9 @@ export { setupNestErrorHandler, postgresIntegration, prismaIntegration, + // eslint-disable-next-line deprecation/deprecation processThreadBreadcrumbIntegration, + childProcessIntegration, hapiIntegration, setupHapiErrorHandler, spotlightIntegration, diff --git a/packages/google-cloud-serverless/src/index.ts b/packages/google-cloud-serverless/src/index.ts index 5e1c2bba5bc1..53cf4c026868 100644 --- a/packages/google-cloud-serverless/src/index.ts +++ b/packages/google-cloud-serverless/src/index.ts @@ -117,7 +117,9 @@ export { zodErrorsIntegration, profiler, amqplibIntegration, + // eslint-disable-next-line deprecation/deprecation processThreadBreadcrumbIntegration, + childProcessIntegration, } from '@sentry/node'; export { diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index 88b105682e6d..cc81dce37577 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -33,7 +33,8 @@ export { tediousIntegration } from './integrations/tracing/tedious'; export { genericPoolIntegration } from './integrations/tracing/genericPool'; export { dataloaderIntegration } from './integrations/tracing/dataloader'; export { amqplibIntegration } from './integrations/tracing/amqplib'; -export { processThreadBreadcrumbIntegration } from './integrations/processThread'; +// eslint-disable-next-line deprecation/deprecation +export { processThreadBreadcrumbIntegration, childProcessIntegration } from './integrations/childProcess'; export { SentryContextManager } from './otel/contextManager'; export { generateInstrumentOnce } from './otel/instrument'; diff --git a/packages/node/src/integrations/processThread.ts b/packages/node/src/integrations/childProcess.ts similarity index 85% rename from packages/node/src/integrations/processThread.ts rename to packages/node/src/integrations/childProcess.ts index 870a0dc6df64..99525b4092b4 100644 --- a/packages/node/src/integrations/processThread.ts +++ b/packages/node/src/integrations/childProcess.ts @@ -2,7 +2,6 @@ import type { ChildProcess } from 'node:child_process'; import * as diagnosticsChannel from 'node:diagnostics_channel'; import type { Worker } from 'node:worker_threads'; import { addBreadcrumb, defineIntegration } from '@sentry/core'; -import type { IntegrationFn } from '@sentry/types'; interface Options { /** @@ -13,9 +12,13 @@ interface Options { includeChildProcessArgs?: boolean; } +// TODO(v9): Update this name and mention in migration docs. const INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs'; -const _processThreadBreadcrumbIntegration = ((options: Options = {}) => { +/** + * Capture breadcrumbs for child processes and worker threads. + */ +export const childProcessIntegration = defineIntegration((options: Options = {}) => { return { name: INTEGRATION_NAME, setup(_client) { @@ -34,12 +37,14 @@ const _processThreadBreadcrumbIntegration = ((options: Options = {}) => { }); }, }; -}) satisfies IntegrationFn; +}); /** * Capture breadcrumbs for child processes and worker threads. + * + * @deprecated Use `childProcessIntegration` integration instead. Functionally they are the same. `processThreadBreadcrumbIntegration` will be removed in the next major version. */ -export const processThreadBreadcrumbIntegration = defineIntegration(_processThreadBreadcrumbIntegration); +export const processThreadBreadcrumbIntegration = childProcessIntegration; function captureChildProcessEvents(child: ChildProcess, options: Options): void { let hasExited = false; diff --git a/packages/node/src/sdk/index.ts b/packages/node/src/sdk/index.ts index 87d61cc908bc..edebeea384db 100644 --- a/packages/node/src/sdk/index.ts +++ b/packages/node/src/sdk/index.ts @@ -30,13 +30,13 @@ import { consoleIntegration } from '../integrations/console'; import { nodeContextIntegration } from '../integrations/context'; import { contextLinesIntegration } from '../integrations/contextlines'; +import { childProcessIntegration } from '../integrations/childProcess'; import { httpIntegration } from '../integrations/http'; import { localVariablesIntegration } from '../integrations/local-variables'; import { modulesIntegration } from '../integrations/modules'; import { nativeNodeFetchIntegration } from '../integrations/node-fetch'; import { onUncaughtExceptionIntegration } from '../integrations/onuncaughtexception'; import { onUnhandledRejectionIntegration } from '../integrations/onunhandledrejection'; -import { processThreadBreadcrumbIntegration } from '../integrations/processThread'; import { INTEGRATION_NAME as SPOTLIGHT_INTEGRATION_NAME, spotlightIntegration } from '../integrations/spotlight'; import { getAutoPerformanceIntegrations } from '../integrations/tracing'; import { makeNodeTransport } from '../transports'; @@ -72,7 +72,7 @@ export function getDefaultIntegrationsWithoutPerformance(): Integration[] { contextLinesIntegration(), localVariablesIntegration(), nodeContextIntegration(), - processThreadBreadcrumbIntegration(), + childProcessIntegration(), ...getCjsOnlyIntegrations(), ]; }