diff --git a/MIGRATION.md b/MIGRATION.md index fb96493bc8ce..64a795237c24 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -273,6 +273,7 @@ For our efforts to reduce bundle size of the SDK we had to remove and refactor p - Remove deprecated `whitelistUrls` and `blacklistUrls` options from `Sentry.init`. They have been superseded by `allowUrls` and `denyUrls` specifically. See [our docs page on inclusive language](https://develop.sentry.dev/inclusion/) for more details. - Gatsby SDK: Remove `Sentry` from `window` object. - Remove deprecated `Status`, `SessionStatus`, and `RequestSessionStatus` enums. These were only part of an internal API. If you are using these enums, we encourage you to to look at [b177690d](https://github.com/getsentry/sentry-javascript/commit/b177690d89640aef2587039113c614672c07d2be), [5fc3147d](https://github.com/getsentry/sentry-javascript/commit/5fc3147dfaaf1a856d5923e4ba409479e87273be), and [f99bdd16](https://github.com/getsentry/sentry-javascript/commit/f99bdd16539bf6fac14eccf1a974a4988d586b28) to to see the changes we've made to our code as result. We generally recommend using string literals instead of the removed enums. +- Remove 'critical' severity. - Remove deprecated `getActiveDomain` method and `DomainAsCarrier` type from `@sentry/hub`. - Rename `registerRequestInstrumentation` to `instrumentOutgoingRequests` in `@sentry/tracing`. - Remove `Backend` and port its functionality into `Client` (see diff --git a/packages/hub/test/scope.test.ts b/packages/hub/test/scope.test.ts index b734ac59fcf6..1bad52db6d9f 100644 --- a/packages/hub/test/scope.test.ts +++ b/packages/hub/test/scope.test.ts @@ -85,8 +85,8 @@ describe('Scope', () => { test('setLevel', () => { const scope = new Scope(); - scope.setLevel('critical'); - expect((scope as any)._level).toEqual('critical'); + scope.setLevel('fatal'); + expect((scope as any)._level).toEqual('fatal'); }); test('setTransactionName', () => { @@ -137,8 +137,8 @@ describe('Scope', () => { test('chaining', () => { const scope = new Scope(); - scope.setLevel('critical').setUser({ id: '1' }); - expect((scope as any)._level).toEqual('critical'); + scope.setLevel('fatal').setUser({ id: '1' }); + expect((scope as any)._level).toEqual('fatal'); expect((scope as any)._user).toEqual({ id: '1' }); }); }); @@ -296,7 +296,7 @@ describe('Scope', () => { const scope = new Scope(); scope.setLevel('warning'); const event: Event = {}; - event.level = 'critical'; + event.level = 'fatal'; return scope.applyToEvent(event).then(processedEvent => { expect(processedEvent!.level).toEqual('warning'); }); diff --git a/packages/integration-tests/suites/public-api/captureMessage/with_level/subject.js b/packages/integration-tests/suites/public-api/captureMessage/with_level/subject.js index 3d7368c95fef..0d12e7115a7e 100644 --- a/packages/integration-tests/suites/public-api/captureMessage/with_level/subject.js +++ b/packages/integration-tests/suites/public-api/captureMessage/with_level/subject.js @@ -3,5 +3,4 @@ Sentry.captureMessage('info_message', 'info'); Sentry.captureMessage('warning_message', 'warning'); Sentry.captureMessage('error_message', 'error'); Sentry.captureMessage('fatal_message', 'fatal'); -Sentry.captureMessage('critical_message', 'critical'); Sentry.captureMessage('log_message', 'log'); diff --git a/packages/integration-tests/suites/public-api/captureMessage/with_level/test.ts b/packages/integration-tests/suites/public-api/captureMessage/with_level/test.ts index 45eaeca66161..da17ff07a77e 100644 --- a/packages/integration-tests/suites/public-api/captureMessage/with_level/test.ts +++ b/packages/integration-tests/suites/public-api/captureMessage/with_level/test.ts @@ -7,7 +7,7 @@ import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers'; sentryTest('should capture with different severity levels', async ({ getLocalTestPath, page }) => { const url = await getLocalTestPath({ testDir: __dirname }); - const events = await getMultipleSentryEnvelopeRequests(page, 7, { url }); + const events = await getMultipleSentryEnvelopeRequests(page, 6, { url }); expect(events[0].message).toBe('debug_message'); expect(events[0].level).toBe('debug'); @@ -24,9 +24,6 @@ sentryTest('should capture with different severity levels', async ({ getLocalTes expect(events[4].message).toBe('fatal_message'); expect(events[4].level).toBe('fatal'); - expect(events[5].message).toBe('critical_message'); - expect(events[5].level).toBe('critical'); - - expect(events[6].message).toBe('log_message'); - expect(events[6].level).toBe('log'); + expect(events[5].message).toBe('log_message'); + expect(events[5].level).toBe('log'); }); diff --git a/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/scenario.ts b/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/scenario.ts index 993049500b08..b9ae05edefac 100644 --- a/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/scenario.ts +++ b/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/scenario.ts @@ -8,7 +8,7 @@ Sentry.init({ Sentry.addBreadcrumb({ category: 'foo', message: 'bar', - level: 'critical', + level: 'fatal', }); Sentry.addBreadcrumb({ diff --git a/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts b/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts index c8b894a62102..38ef745cb28e 100644 --- a/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts +++ b/packages/node-integration-tests/suites/public-api/addBreadcrumb/multiple_breadcrumbs/test.ts @@ -10,7 +10,7 @@ test('should add multiple breadcrumbs', async () => { { category: 'foo', message: 'bar', - level: 'critical', + level: 'fatal', }, { category: 'qux', diff --git a/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/scenario.ts b/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/scenario.ts index a31b33c68d54..94ebd23dfaa5 100644 --- a/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/scenario.ts +++ b/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/scenario.ts @@ -8,7 +8,7 @@ Sentry.init({ Sentry.addBreadcrumb({ category: 'foo', message: 'bar', - level: 'critical', + level: 'fatal', }); Sentry.captureMessage('test_simple'); diff --git a/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts b/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts index a56f0711e086..d5fc2ef8df73 100644 --- a/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts +++ b/packages/node-integration-tests/suites/public-api/addBreadcrumb/simple_breadcrumb/test.ts @@ -10,7 +10,7 @@ test('should add a simple breadcrumb', async () => { { category: 'foo', message: 'bar', - level: 'critical', + level: 'fatal', }, ], }); diff --git a/packages/node-integration-tests/suites/public-api/captureMessage/with_level/scenario.ts b/packages/node-integration-tests/suites/public-api/captureMessage/with_level/scenario.ts index 32d46fa171fe..be175d36e816 100644 --- a/packages/node-integration-tests/suites/public-api/captureMessage/with_level/scenario.ts +++ b/packages/node-integration-tests/suites/public-api/captureMessage/with_level/scenario.ts @@ -10,5 +10,4 @@ Sentry.captureMessage('info_message', 'info'); Sentry.captureMessage('warning_message', 'warning'); Sentry.captureMessage('error_message', 'error'); Sentry.captureMessage('fatal_message', 'fatal'); -Sentry.captureMessage('critical_message', 'critical'); Sentry.captureMessage('log_message', 'log'); diff --git a/packages/node-integration-tests/suites/public-api/captureMessage/with_level/test.ts b/packages/node-integration-tests/suites/public-api/captureMessage/with_level/test.ts index 5db1ef646168..18bd395b148d 100644 --- a/packages/node-integration-tests/suites/public-api/captureMessage/with_level/test.ts +++ b/packages/node-integration-tests/suites/public-api/captureMessage/with_level/test.ts @@ -2,7 +2,7 @@ import { assertSentryEvent, getMultipleEnvelopeRequest, runServer } from '../../ test('should capture with different severity levels', async () => { const url = await runServer(__dirname); - const envelopes = await getMultipleEnvelopeRequest(url, 14); + const envelopes = await getMultipleEnvelopeRequest(url, 12); assertSentryEvent(envelopes[1][2], { message: 'debug_message', @@ -30,11 +30,6 @@ test('should capture with different severity levels', async () => { }); assertSentryEvent(envelopes[11][2], { - message: 'critical_message', - level: 'critical', - }); - - assertSentryEvent(envelopes[13][2], { message: 'log_message', level: 'log', }); diff --git a/packages/types/src/severity.ts b/packages/types/src/severity.ts index ad96231cb013..de13f2a02b99 100644 --- a/packages/types/src/severity.ts +++ b/packages/types/src/severity.ts @@ -1,6 +1,6 @@ /** * @deprecated Please use a `SeverityLevel` string instead of the `Severity` enum. Acceptable values are 'fatal', - * 'critical', 'error', 'warning', 'log', 'info', and 'debug'. + * 'error', 'warning', 'log', 'info', and 'debug'. */ export enum Severity { /** JSDoc */ @@ -15,10 +15,8 @@ export enum Severity { Info = 'info', /** JSDoc */ Debug = 'debug', - /** JSDoc */ - Critical = 'critical', } // Note: If this is ever changed, the `validSeverityLevels` array in `@sentry/utils` needs to be changed, also. (See // note there for why we can't derive one from the other.) -export type SeverityLevel = 'fatal' | 'error' | 'warning' | 'log' | 'info' | 'debug' | 'critical'; +export type SeverityLevel = 'fatal' | 'error' | 'warning' | 'log' | 'info' | 'debug'; diff --git a/packages/utils/src/severity.ts b/packages/utils/src/severity.ts index ba2ad2822851..c40f0c2a6004 100644 --- a/packages/utils/src/severity.ts +++ b/packages/utils/src/severity.ts @@ -11,7 +11,7 @@ import { Severity, SeverityLevel } from '@sentry/types'; // create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the // type, reminding anyone who changes it to change this list also, will have to do. -export const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical']; +export const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug']; /** * Converts a string-based level into a member of the deprecated {@link Severity} enum.