diff --git a/MIGRATION.md b/MIGRATION.md index a2a9803071e7..241701eb0d3d 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,5 +1,11 @@ # Upgrading from 7.x to 8.x +## Removal of Client-Side health check transaction filters + +The SDK no longer filters out health check transactions by default. Instead, they are sent to Sentry but still dropped +by the Sentry backend by default. You can disable dropping them in your Sentry project settings. If you still want to +drop specific transactions within the SDK you can either use the `ignoreTransactions` SDK option. + ## Removal of the `MetricsAggregator` integration class and `metricsAggregatorIntegration` The SDKs now support metrics features without any additional configuration. diff --git a/packages/core/src/integrations/inboundfilters.ts b/packages/core/src/integrations/inboundfilters.ts index 60b4b885a718..7d42d57f81ed 100644 --- a/packages/core/src/integrations/inboundfilters.ts +++ b/packages/core/src/integrations/inboundfilters.ts @@ -8,16 +8,6 @@ import { convertIntegrationFnToClass, defineIntegration } from '../integration'; // this is the result of a script being pulled in from an external domain and CORS. const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/]; -const DEFAULT_IGNORE_TRANSACTIONS = [ - /^.*\/healthcheck$/, - /^.*\/healthy$/, - /^.*\/live$/, - /^.*\/ready$/, - /^.*\/heartbeat$/, - /^.*\/health$/, - /^.*\/healthz$/, -]; - /** Options for the InboundFilters integration */ export interface InboundFiltersOptions { allowUrls: Array; @@ -26,7 +16,6 @@ export interface InboundFiltersOptions { ignoreTransactions: Array; ignoreInternal: boolean; disableErrorDefaults: boolean; - disableTransactionDefaults: boolean; } const INTEGRATION_NAME = 'InboundFilters'; @@ -77,11 +66,7 @@ function _mergeOptions( ...(clientOptions.ignoreErrors || []), ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS), ], - ignoreTransactions: [ - ...(internalOptions.ignoreTransactions || []), - ...(clientOptions.ignoreTransactions || []), - ...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS), - ], + ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])], ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, }; } diff --git a/packages/core/test/lib/integrations/inboundfilters.test.ts b/packages/core/test/lib/integrations/inboundfilters.test.ts index 24783b8eeb68..012c3f5f5f0d 100644 --- a/packages/core/test/lib/integrations/inboundfilters.test.ts +++ b/packages/core/test/lib/integrations/inboundfilters.test.ts @@ -216,21 +216,6 @@ const TRANSACTION_EVENT_3: Event = { type: 'transaction', }; -const TRANSACTION_EVENT_HEALTH: Event = { - transaction: 'GET /health', - type: 'transaction', -}; - -const TRANSACTION_EVENT_HEALTH_2: Event = { - transaction: 'GET /healthy', - type: 'transaction', -}; - -const TRANSACTION_EVENT_HEALTH_3: Event = { - transaction: 'GET /live', - type: 'transaction', -}; - describe('InboundFilters', () => { describe('_isSentryError', () => { it('should work as expected', () => { @@ -408,39 +393,12 @@ describe('InboundFilters', () => { const eventProcessor = createInboundFiltersEventProcessor(); expect(eventProcessor(SCRIPT_ERROR_EVENT, {})).toBe(null); expect(eventProcessor(TRANSACTION_EVENT, {})).toBe(TRANSACTION_EVENT); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH, {})).toBe(null); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH_2, {})).toBe(null); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH_3, {})).toBe(null); }); it('disable default error filters', () => { const eventProcessor = createInboundFiltersEventProcessor({ disableErrorDefaults: true }); expect(eventProcessor(SCRIPT_ERROR_EVENT, {})).toBe(SCRIPT_ERROR_EVENT); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH, {})).toBe(null); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH_2, {})).toBe(null); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH_3, {})).toBe(null); }); - - it('disable default transaction filters', () => { - const eventProcessor = createInboundFiltersEventProcessor({ disableTransactionDefaults: true }); - expect(eventProcessor(SCRIPT_ERROR_EVENT, {})).toBe(null); - expect(eventProcessor(TRANSACTION_EVENT, {})).toBe(TRANSACTION_EVENT); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH, {})).toBe(TRANSACTION_EVENT_HEALTH); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH_2, {})).toBe(TRANSACTION_EVENT_HEALTH_2); - expect(eventProcessor(TRANSACTION_EVENT_HEALTH_3, {})).toBe(TRANSACTION_EVENT_HEALTH_3); - }); - - it.each(['/delivery', '/already', '/healthysnacks'])( - "doesn't filter out transactions that have similar names to health check ones (%s)", - transaction => { - const eventProcessor = createInboundFiltersEventProcessor(); - const evt: Event = { - transaction, - type: 'transaction', - }; - expect(eventProcessor(evt, {})).toBe(evt); - }, - ); }); describe('denyUrls/allowUrls', () => {