Skip to content

Commit 9993d1e

Browse files
authored
feat(node): Add alias childProcessIntegration for processThreadBreadcrumbIntegration and deprecate it (#14334)
1 parent 3778ac9 commit 9993d1e

File tree

8 files changed

+25
-8
lines changed

8 files changed

+25
-8
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const DEPENDENTS: Dependent[] = [
5252
'NodeClient',
5353
// Bun doesn't emit the required diagnostics_channel events
5454
'processThreadBreadcrumbIntegration',
55+
'childProcessIntegration',
5556
],
5657
},
5758
{

docs/migration/draft-v9-migration-guide.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
- Deprecated `transactionNamingScheme` option in `requestDataIntegration`.
1414

15-
## `@sentry/types``
15+
## `@sentry/types`
1616

1717
- Deprecated `Request` in favor of `RequestEventData`.
18+
19+
## Server-side SDKs (`@sentry/node` and all dependents)
20+
21+
- Deprecated `processThreadBreadcrumbIntegration` in favor of `childProcessIntegration`. Functionally they are the same.

packages/astro/src/index.server.ts

+2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ export {
9191
parameterize,
9292
postgresIntegration,
9393
prismaIntegration,
94+
// eslint-disable-next-line deprecation/deprecation
9495
processThreadBreadcrumbIntegration,
96+
childProcessIntegration,
9597
redisIntegration,
9698
requestDataIntegration,
9799
rewriteFramesIntegration,

packages/aws-serverless/src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ export {
105105
setupNestErrorHandler,
106106
postgresIntegration,
107107
prismaIntegration,
108+
// eslint-disable-next-line deprecation/deprecation
108109
processThreadBreadcrumbIntegration,
110+
childProcessIntegration,
109111
hapiIntegration,
110112
setupHapiErrorHandler,
111113
spotlightIntegration,

packages/google-cloud-serverless/src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ export {
117117
zodErrorsIntegration,
118118
profiler,
119119
amqplibIntegration,
120+
// eslint-disable-next-line deprecation/deprecation
120121
processThreadBreadcrumbIntegration,
122+
childProcessIntegration,
121123
} from '@sentry/node';
122124

123125
export {

packages/node/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export { tediousIntegration } from './integrations/tracing/tedious';
3333
export { genericPoolIntegration } from './integrations/tracing/genericPool';
3434
export { dataloaderIntegration } from './integrations/tracing/dataloader';
3535
export { amqplibIntegration } from './integrations/tracing/amqplib';
36-
export { processThreadBreadcrumbIntegration } from './integrations/processThread';
36+
// eslint-disable-next-line deprecation/deprecation
37+
export { processThreadBreadcrumbIntegration, childProcessIntegration } from './integrations/childProcess';
3738

3839
export { SentryContextManager } from './otel/contextManager';
3940
export { generateInstrumentOnce } from './otel/instrument';

packages/node/src/integrations/processThread.ts packages/node/src/integrations/childProcess.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { ChildProcess } from 'node:child_process';
22
import * as diagnosticsChannel from 'node:diagnostics_channel';
33
import type { Worker } from 'node:worker_threads';
44
import { addBreadcrumb, defineIntegration } from '@sentry/core';
5-
import type { IntegrationFn } from '@sentry/types';
65

76
interface Options {
87
/**
@@ -13,9 +12,13 @@ interface Options {
1312
includeChildProcessArgs?: boolean;
1413
}
1514

15+
// TODO(v9): Update this name and mention in migration docs.
1616
const INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs';
1717

18-
const _processThreadBreadcrumbIntegration = ((options: Options = {}) => {
18+
/**
19+
* Capture breadcrumbs for child processes and worker threads.
20+
*/
21+
export const childProcessIntegration = defineIntegration((options: Options = {}) => {
1922
return {
2023
name: INTEGRATION_NAME,
2124
setup(_client) {
@@ -34,12 +37,14 @@ const _processThreadBreadcrumbIntegration = ((options: Options = {}) => {
3437
});
3538
},
3639
};
37-
}) satisfies IntegrationFn;
40+
});
3841

3942
/**
4043
* Capture breadcrumbs for child processes and worker threads.
44+
*
45+
* @deprecated Use `childProcessIntegration` integration instead. Functionally they are the same. `processThreadBreadcrumbIntegration` will be removed in the next major version.
4146
*/
42-
export const processThreadBreadcrumbIntegration = defineIntegration(_processThreadBreadcrumbIntegration);
47+
export const processThreadBreadcrumbIntegration = childProcessIntegration;
4348

4449
function captureChildProcessEvents(child: ChildProcess, options: Options): void {
4550
let hasExited = false;

packages/node/src/sdk/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ import { consoleIntegration } from '../integrations/console';
3030
import { nodeContextIntegration } from '../integrations/context';
3131
import { contextLinesIntegration } from '../integrations/contextlines';
3232

33+
import { childProcessIntegration } from '../integrations/childProcess';
3334
import { httpIntegration } from '../integrations/http';
3435
import { localVariablesIntegration } from '../integrations/local-variables';
3536
import { modulesIntegration } from '../integrations/modules';
3637
import { nativeNodeFetchIntegration } from '../integrations/node-fetch';
3738
import { onUncaughtExceptionIntegration } from '../integrations/onuncaughtexception';
3839
import { onUnhandledRejectionIntegration } from '../integrations/onunhandledrejection';
39-
import { processThreadBreadcrumbIntegration } from '../integrations/processThread';
4040
import { INTEGRATION_NAME as SPOTLIGHT_INTEGRATION_NAME, spotlightIntegration } from '../integrations/spotlight';
4141
import { getAutoPerformanceIntegrations } from '../integrations/tracing';
4242
import { makeNodeTransport } from '../transports';
@@ -72,7 +72,7 @@ export function getDefaultIntegrationsWithoutPerformance(): Integration[] {
7272
contextLinesIntegration(),
7373
localVariablesIntegration(),
7474
nodeContextIntegration(),
75-
processThreadBreadcrumbIntegration(),
75+
childProcessIntegration(),
7676
...getCjsOnlyIntegrations(),
7777
];
7878
}

0 commit comments

Comments
 (0)