diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e273e367111..4b34ea85e6b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - ref(astro): Adjust `mechanism` on error events captured by astro middleware ([#17613](https://github.com/getsentry/sentry-javascript/pull/17613)) - ref(aws-severless): Slightly adjust aws-serverless mechanism type ([#17614](https://github.com/getsentry/sentry-javascript/pull/17614)) - ref(bun): Adjust `mechanism` of errors captured in Bun.serve ([#17616](https://github.com/getsentry/sentry-javascript/pull/17616)) + - ref(core): Adjust `mechanism` in `captureConsoleIntegration` ([#17633](https://github.com/getsentry/sentry-javascript/pull/17633)) - ref(core): Adjust MCP server error event `mechanism` ([#17622](https://github.com/getsentry/sentry-javascript/pull/17622)) - ref(core): Simplify `linkedErrors` mechanism logic ([#17600](https://github.com/getsentry/sentry-javascript/pull/17600)) - ref(nextjs): Set more specific event `mechanism`s ([#17543](https://github.com/getsentry/sentry-javascript/pull/17543)) diff --git a/dev-packages/browser-integration-tests/suites/integrations/captureConsole-attachStackTrace/test.ts b/dev-packages/browser-integration-tests/suites/integrations/captureConsole-attachStackTrace/test.ts index fc8c1b378e7f..ff15c17832c6 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/captureConsole-attachStackTrace/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/captureConsole-attachStackTrace/test.ts @@ -37,7 +37,7 @@ sentryTest( expect(logEvent?.exception?.values![0]).toMatchObject({ mechanism: { handled: true, - type: 'console', + type: 'auto.core.capture_console', synthetic: true, }, value: 'console log', @@ -59,7 +59,7 @@ sentryTest( expect(warnEvent?.exception?.values![0]).toMatchObject({ mechanism: { handled: true, - type: 'console', + type: 'auto.core.capture_console', synthetic: true, }, value: 'console warn', @@ -81,7 +81,7 @@ sentryTest( expect(infoEvent?.exception?.values![0]).toMatchObject({ mechanism: { handled: true, - type: 'console', + type: 'auto.core.capture_console', synthetic: true, }, value: 'console info', @@ -103,7 +103,7 @@ sentryTest( expect(errorEvent?.exception?.values![0]).toMatchObject({ mechanism: { handled: true, - type: 'console', + type: 'auto.core.capture_console', synthetic: true, }, value: 'console error', @@ -125,7 +125,7 @@ sentryTest( expect(traceEvent?.exception?.values![0]).toMatchObject({ mechanism: { handled: true, - type: 'console', + type: 'auto.core.capture_console', synthetic: true, }, value: 'console trace', @@ -153,7 +153,7 @@ sentryTest( expect(errorWithErrorEvent?.exception?.values?.[0].value).toBe('console error with error object'); expect(errorWithErrorEvent?.exception?.values?.[0].mechanism).toEqual({ handled: true, - type: 'console', + type: 'auto.core.capture_console', }); expect(traceWithErrorEvent).toEqual( expect.objectContaining({ diff --git a/dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts b/dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts index 06d989cc4433..8e7e6aaa58e3 100644 --- a/dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts +++ b/dev-packages/browser-integration-tests/suites/integrations/captureConsole/test.ts @@ -96,7 +96,7 @@ sentryTest('it captures console messages correctly', async ({ getLocalTestUrl, p expect(errorWithErrorEvent?.exception?.values?.[0].value).toBe('console error with error object'); expect(errorWithErrorEvent?.exception?.values?.[0].mechanism).toEqual({ handled: true, - type: 'console', + type: 'auto.core.capture_console', }); expect(traceWithErrorEvent).toEqual( expect.objectContaining({ diff --git a/packages/core/src/integrations/captureconsole.ts b/packages/core/src/integrations/captureconsole.ts index e491efedd83f..d5d34bd554aa 100644 --- a/packages/core/src/integrations/captureconsole.ts +++ b/packages/core/src/integrations/captureconsole.ts @@ -65,7 +65,7 @@ function consoleHandler(args: unknown[], level: string, handled: boolean): void addExceptionMechanism(event, { handled, - type: 'console', + type: 'auto.core.capture_console', }); return event; diff --git a/packages/core/test/lib/integrations/captureconsole.test.ts b/packages/core/test/lib/integrations/captureconsole.test.ts index 2fe971710a07..8da7c6570d74 100644 --- a/packages/core/test/lib/integrations/captureconsole.test.ts +++ b/packages/core/test/lib/integrations/captureconsole.test.ts @@ -328,7 +328,7 @@ describe('CaptureConsole setup', () => { expect(someEvent.exception?.values?.[0]?.mechanism).toEqual({ handled: true, - type: 'console', + type: 'auto.core.capture_console', }); }); @@ -352,7 +352,7 @@ describe('CaptureConsole setup', () => { expect(someEvent.exception?.values?.[0]?.mechanism).toEqual({ handled: true, - type: 'console', + type: 'auto.core.capture_console', }); }); @@ -376,7 +376,7 @@ describe('CaptureConsole setup', () => { expect(someEvent.exception?.values?.[0]?.mechanism).toEqual({ handled: false, - type: 'console', + type: 'auto.core.capture_console', }); }); });