Skip to content

Commit 34e7233

Browse files
authored
feat(core): Remove health check transaction filters (#10818)
This PR removes the `ignoreTransactions` default values which were all patterns trying to identify health check transactions.
1 parent 2187b99 commit 34e7233

File tree

3 files changed

+7
-58
lines changed

3 files changed

+7
-58
lines changed

MIGRATION.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Upgrading from 7.x to 8.x
22

3+
## Removal of Client-Side health check transaction filters
4+
5+
The SDK no longer filters out health check transactions by default. Instead, they are sent to Sentry but still dropped
6+
by the Sentry backend by default. You can disable dropping them in your Sentry project settings. If you still want to
7+
drop specific transactions within the SDK you can either use the `ignoreTransactions` SDK option.
8+
39
## Removal of the `MetricsAggregator` integration class and `metricsAggregatorIntegration`
410

511
The SDKs now support metrics features without any additional configuration.

packages/core/src/integrations/inboundfilters.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ import { convertIntegrationFnToClass, defineIntegration } from '../integration';
88
// this is the result of a script being pulled in from an external domain and CORS.
99
const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/];
1010

11-
const DEFAULT_IGNORE_TRANSACTIONS = [
12-
/^.*\/healthcheck$/,
13-
/^.*\/healthy$/,
14-
/^.*\/live$/,
15-
/^.*\/ready$/,
16-
/^.*\/heartbeat$/,
17-
/^.*\/health$/,
18-
/^.*\/healthz$/,
19-
];
20-
2111
/** Options for the InboundFilters integration */
2212
export interface InboundFiltersOptions {
2313
allowUrls: Array<string | RegExp>;
@@ -26,7 +16,6 @@ export interface InboundFiltersOptions {
2616
ignoreTransactions: Array<string | RegExp>;
2717
ignoreInternal: boolean;
2818
disableErrorDefaults: boolean;
29-
disableTransactionDefaults: boolean;
3019
}
3120

3221
const INTEGRATION_NAME = 'InboundFilters';
@@ -77,11 +66,7 @@ function _mergeOptions(
7766
...(clientOptions.ignoreErrors || []),
7867
...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS),
7968
],
80-
ignoreTransactions: [
81-
...(internalOptions.ignoreTransactions || []),
82-
...(clientOptions.ignoreTransactions || []),
83-
...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS),
84-
],
69+
ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])],
8570
ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,
8671
};
8772
}

packages/core/test/lib/integrations/inboundfilters.test.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,6 @@ const TRANSACTION_EVENT_3: Event = {
216216
type: 'transaction',
217217
};
218218

219-
const TRANSACTION_EVENT_HEALTH: Event = {
220-
transaction: 'GET /health',
221-
type: 'transaction',
222-
};
223-
224-
const TRANSACTION_EVENT_HEALTH_2: Event = {
225-
transaction: 'GET /healthy',
226-
type: 'transaction',
227-
};
228-
229-
const TRANSACTION_EVENT_HEALTH_3: Event = {
230-
transaction: 'GET /live',
231-
type: 'transaction',
232-
};
233-
234219
describe('InboundFilters', () => {
235220
describe('_isSentryError', () => {
236221
it('should work as expected', () => {
@@ -408,39 +393,12 @@ describe('InboundFilters', () => {
408393
const eventProcessor = createInboundFiltersEventProcessor();
409394
expect(eventProcessor(SCRIPT_ERROR_EVENT, {})).toBe(null);
410395
expect(eventProcessor(TRANSACTION_EVENT, {})).toBe(TRANSACTION_EVENT);
411-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH, {})).toBe(null);
412-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH_2, {})).toBe(null);
413-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH_3, {})).toBe(null);
414396
});
415397

416398
it('disable default error filters', () => {
417399
const eventProcessor = createInboundFiltersEventProcessor({ disableErrorDefaults: true });
418400
expect(eventProcessor(SCRIPT_ERROR_EVENT, {})).toBe(SCRIPT_ERROR_EVENT);
419-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH, {})).toBe(null);
420-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH_2, {})).toBe(null);
421-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH_3, {})).toBe(null);
422401
});
423-
424-
it('disable default transaction filters', () => {
425-
const eventProcessor = createInboundFiltersEventProcessor({ disableTransactionDefaults: true });
426-
expect(eventProcessor(SCRIPT_ERROR_EVENT, {})).toBe(null);
427-
expect(eventProcessor(TRANSACTION_EVENT, {})).toBe(TRANSACTION_EVENT);
428-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH, {})).toBe(TRANSACTION_EVENT_HEALTH);
429-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH_2, {})).toBe(TRANSACTION_EVENT_HEALTH_2);
430-
expect(eventProcessor(TRANSACTION_EVENT_HEALTH_3, {})).toBe(TRANSACTION_EVENT_HEALTH_3);
431-
});
432-
433-
it.each(['/delivery', '/already', '/healthysnacks'])(
434-
"doesn't filter out transactions that have similar names to health check ones (%s)",
435-
transaction => {
436-
const eventProcessor = createInboundFiltersEventProcessor();
437-
const evt: Event = {
438-
transaction,
439-
type: 'transaction',
440-
};
441-
expect(eventProcessor(evt, {})).toBe(evt);
442-
},
443-
);
444402
});
445403

446404
describe('denyUrls/allowUrls', () => {

0 commit comments

Comments
 (0)