From c644c006ba347c1424da8f471e098518ead407a7 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 23 Oct 2026 09:39:11 +0200 Subject: [PATCH 1/4] fix(bun): Add systemErrorIntegration to default integrations Bun implements `util.getSystemErrorMap`, so the integration works there, and older Bun versions without it are covered by the existing guard. Also documents why `childProcessIntegration` and `workerThreadsIntegration` stay omitted. Co-Authored-By: Claude Opus 5.5 --- packages/bun/src/sdk.ts | 3 +++ packages/bun/test/init.test.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/bun/src/sdk.ts b/packages/bun/src/sdk.ts index d1aba1b7aebc..49e40b687292 100644 --- a/packages/bun/src/sdk.ts +++ b/packages/bun/src/sdk.ts @@ -21,6 +21,7 @@ import { onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, processSessionIntegration, + systemErrorIntegration, } from '@sentry/node'; import { bunServerIntegration } from './integrations/bunserver'; import { fetchIntegration } from './integrations/fetch'; @@ -52,6 +53,7 @@ export function getDefaultIntegrationsWithoutPerformance(): Integration[] { linkedErrorsIntegration(), dedupeIntegration(), requestDataIntegration(), + systemErrorIntegration(), conversationIdIntegration(), // Native Wrappers consoleIntegration(), @@ -63,6 +65,7 @@ export function getDefaultIntegrationsWithoutPerformance(): Integration[] { // Event Info contextLinesIntegration(), nodeContextIntegration(), + // childProcessIntegration and workerThreadsIntegration are omitted: Bun never publishes to those diagnostics channels (#20237) modulesIntegration(), processSessionIntegration(), // Framework-level integrations. These are not performance-only: they also handle error capture, so diff --git a/packages/bun/test/init.test.ts b/packages/bun/test/init.test.ts index 17983138e5ad..52f7c75275e7 100644 --- a/packages/bun/test/init.test.ts +++ b/packages/bun/test/init.test.ts @@ -193,6 +193,7 @@ describe('init()', () => { const full = getDefaultIntegrations({}).map(({ name }) => name); expect(withoutPerformance).toEqual(full); + expect(full).toContain('NodeSystemError'); expect(mockGetTracingIntegrations).toHaveBeenCalledTimes(0); }); From c61747603c7f983c58c1499b4606a8f5df19e30b Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 23 Oct 2026 09:51:08 +0200 Subject: [PATCH 2/4] feat(bun): Export systemErrorIntegration Co-Authored-By: Claude Opus 5.5 --- .../node-exports-test-app/scripts/consistentExports.ts | 1 - packages/bun/src/index.ts | 1 + packages/node/src/integrations/systemError.ts | 3 +-- 3 files changed, 2 insertions(+), 3 deletions(-) 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 2821cf41f0a6..6bee27e997bc 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 @@ -55,7 +55,6 @@ const DEPENDENTS: Dependent[] = [ 'NODE_VERSION', 'childProcessIntegration', 'workerThreadsIntegration', - 'systemErrorIntegration', 'pinoIntegration', // Bun will get its own runtime metrics integration 'nodeRuntimeMetricsIntegration', diff --git a/packages/bun/src/index.ts b/packages/bun/src/index.ts index 4e91068d21f8..888247171704 100644 --- a/packages/bun/src/index.ts +++ b/packages/bun/src/index.ts @@ -98,6 +98,7 @@ export { nodeContextIntegration, localVariablesIntegration, requestDataIntegration, + systemErrorIntegration, fsIntegration, functionToStringIntegration, eventFiltersIntegration, diff --git a/packages/node/src/integrations/systemError.ts b/packages/node/src/integrations/systemError.ts index 944300163103..9684ddb8cb7c 100644 --- a/packages/node/src/integrations/systemError.ts +++ b/packages/node/src/integrations/systemError.ts @@ -20,8 +20,7 @@ function isSystemError(error: unknown): error is SystemError { return false; } - // Workaround for Bun where getSystemErrorMap doesn't exist - // Can be removed once Bun supports getSystemErrorMap + // Older Bun versions don't implement getSystemErrorMap // https://github.com/oven-sh/bun/issues/22872 if (typeof util.getSystemErrorMap !== 'function') { return false; From e4fa09256eef7c573d95a59b5e35c687c2bae88a Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 23 Oct 2026 09:51:17 +0200 Subject: [PATCH 3/4] ref(bun): Remove comment about omitted integrations Co-Authored-By: Claude Opus 5.5 --- packages/bun/src/sdk.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/bun/src/sdk.ts b/packages/bun/src/sdk.ts index 49e40b687292..96be2997ffab 100644 --- a/packages/bun/src/sdk.ts +++ b/packages/bun/src/sdk.ts @@ -65,7 +65,6 @@ export function getDefaultIntegrationsWithoutPerformance(): Integration[] { // Event Info contextLinesIntegration(), nodeContextIntegration(), - // childProcessIntegration and workerThreadsIntegration are omitted: Bun never publishes to those diagnostics channels (#20237) modulesIntegration(), processSessionIntegration(), // Framework-level integrations. These are not performance-only: they also handle error capture, so From aeb863ac255a2dfb6d8bb4e744edca3ca9da916c Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 23 Oct 2026 09:53:01 +0200 Subject: [PATCH 4/4] test(bun): Run system-error node suite with @sentry/bun Co-Authored-By: Claude Opus 5.5 --- dev-packages/bun-integration-tests/node-suites/excludes.ts | 4 ---- packages/bun/test/init.test.ts | 1 - 2 files changed, 5 deletions(-) diff --git a/dev-packages/bun-integration-tests/node-suites/excludes.ts b/dev-packages/bun-integration-tests/node-suites/excludes.ts index c8a8bf93a1a9..7bcfcfa1622e 100644 --- a/dev-packages/bun-integration-tests/node-suites/excludes.ts +++ b/dev-packages/bun-integration-tests/node-suites/excludes.ts @@ -133,9 +133,6 @@ const NOT_TRIAGED = [ 'suites/proxy/test.ts', ]; -// The suite expects the events of `nodeSystemErrorIntegration`, which `@sentry/bun` does not include. -const NO_SYSTEM_ERROR_INTEGRATION = ['suites/system-error/test.ts']; - // The scenario configures `nativeNodeFetchIntegration`, which `@sentry/bun` does not export. const NO_NATIVE_NODE_FETCH_INTEGRATION = [ 'suites/tracing/http-client-spans/fetch-forward-request-hook/test.ts', @@ -195,7 +192,6 @@ export const SENTRY_NODE_EXCLUDE = [...NO_HTTP_SERVER_SPANS, ...NO_FETCH_INSTRUM export const SENTRY_BUN_EXCLUDE = [ ...HTTP_SERVER_OPTIONS_IGNORED, ...NO_EXPRESS_INSTRUMENTATION, - ...NO_SYSTEM_ERROR_INTEGRATION, ...NO_NATIVE_NODE_FETCH_INTEGRATION, ...FETCH_INTEGRATION_DIFFERS, ]; diff --git a/packages/bun/test/init.test.ts b/packages/bun/test/init.test.ts index 52f7c75275e7..17983138e5ad 100644 --- a/packages/bun/test/init.test.ts +++ b/packages/bun/test/init.test.ts @@ -193,7 +193,6 @@ describe('init()', () => { const full = getDefaultIntegrations({}).map(({ name }) => name); expect(withoutPerformance).toEqual(full); - expect(full).toContain('NodeSystemError'); expect(mockGetTracingIntegrations).toHaveBeenCalledTimes(0); });