Skip to content

Commit 344abcc

Browse files
committed
No new feature
1 parent 096d874 commit 344abcc

File tree

5 files changed

+9
-26
lines changed

5 files changed

+9
-26
lines changed

dev-packages/node-integration-tests/suites/child-process/fork.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Sentry.init({
77
debug: true,
88
dsn: 'https://[email protected]/1337',
99
release: '1.0',
10-
integrations: [Sentry.childProcessIntegration()],
1110
transport: loggingTransport,
1211
});
1312

dev-packages/node-integration-tests/suites/child-process/fork.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Sentry.init({
99
debug: true,
1010
dsn: 'https://[email protected]/1337',
1111
release: '1.0',
12-
integrations: [Sentry.childProcessIntegration()],
1312
transport: loggingTransport,
1413
});
1514

dev-packages/node-integration-tests/suites/child-process/worker.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Sentry.init({
77
debug: true,
88
dsn: 'https://[email protected]/1337',
99
release: '1.0',
10-
integrations: [Sentry.childProcessIntegration()],
1110
transport: loggingTransport,
1211
});
1312

dev-packages/node-integration-tests/suites/child-process/worker.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Sentry.init({
99
debug: true,
1010
dsn: 'https://[email protected]/1337',
1111
release: '1.0',
12-
integrations: [Sentry.childProcessIntegration()],
1312
transport: loggingTransport,
1413
});
1514

packages/node/src/integrations/childProcess.ts

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ChildProcess } from 'node:child_process';
22
import * as diagnosticsChannel from 'node:diagnostics_channel';
33
import type { Worker } from 'node:worker_threads';
4-
import { addBreadcrumb, captureException, defineIntegration } from '@sentry/core';
4+
import { addBreadcrumb, defineIntegration } from '@sentry/core';
55

66
interface Options {
77
/**
@@ -10,13 +10,6 @@ interface Options {
1010
* @default false
1111
*/
1212
includeChildProcessArgs?: boolean;
13-
14-
/**
15-
* Whether to capture errors from worker threads.
16-
*
17-
* @default true
18-
*/
19-
captureWorkerErrors?: boolean;
2013
}
2114

2215
const INTEGRATION_NAME = 'ChildProcess';
@@ -36,7 +29,7 @@ export const childProcessIntegration = defineIntegration((options: Options = {})
3629

3730
diagnosticsChannel.channel('worker_threads').subscribe((event: unknown) => {
3831
if (event && typeof event === 'object' && 'worker' in event) {
39-
captureWorkerThreadEvents(event.worker as Worker, options);
32+
captureWorkerThreadEvents(event.worker as Worker);
4033
}
4134
});
4235
},
@@ -89,25 +82,19 @@ function captureChildProcessEvents(child: ChildProcess, options: Options): void
8982
});
9083
}
9184

92-
function captureWorkerThreadEvents(worker: Worker, options: Options): void {
85+
function captureWorkerThreadEvents(worker: Worker): void {
9386
let threadId: number | undefined;
9487

9588
worker
9689
.on('online', () => {
9790
threadId = worker.threadId;
9891
})
9992
.on('error', error => {
100-
if (options.captureWorkerErrors !== false) {
101-
captureException(error, {
102-
mechanism: { type: 'instrument', handled: false, data: { threadId: String(threadId) } },
103-
});
104-
} else {
105-
addBreadcrumb({
106-
category: 'worker_thread',
107-
message: `Worker thread errored with '${error.message}'`,
108-
level: 'error',
109-
data: { threadId },
110-
});
111-
}
93+
addBreadcrumb({
94+
category: 'worker_thread',
95+
message: `Worker thread errored with '${error.message}'`,
96+
level: 'error',
97+
data: { threadId },
98+
});
11299
});
113100
}

0 commit comments

Comments
 (0)