Skip to content

Commit 6d35c6b

Browse files
author
Luca Forstner
committed
.
1 parent 42650bb commit 6d35c6b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/nextjs/src/server/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { isBuild } from '../common/utils/isBuild';
1010
import { distDirRewriteFramesIntegration } from './distDirRewriteFramesIntegration';
1111

1212
export * from '@sentry/node';
13+
import type { EventProcessor } from '@sentry/types';
1314
import { onUncaughtExceptionIntegration } from './onUncaughtExceptionIntegration';
1415

1516
export { captureUnderscoreErrorException } from '../common/_error';
@@ -72,7 +73,7 @@ export function init(options: NodeOptions): void {
7273
}
7374

7475
const customDefaultIntegrations = [
75-
...getDefaultIntegrations(options).filter(integration => integration.name === 'OnUncaughtException'),
76+
...getDefaultIntegrations(options).filter(integration => integration.name !== 'OnUncaughtException'),
7677
onUncaughtExceptionIntegration(),
7778
];
7879

@@ -106,11 +107,19 @@ export function init(options: NodeOptions): void {
106107

107108
nodeInit(opts);
108109

110+
const filterTransactions: EventProcessor = event => {
111+
return event.type === 'transaction' && event.transaction === '/404' ? null : event;
112+
};
113+
114+
filterTransactions.id = 'NextServer404TransactionFilter';
115+
109116
setTag('runtime', 'node');
110117
if (IS_VERCEL) {
111118
setTag('vercel', true);
112119
}
113120

121+
addEventProcessor(filterTransactions);
122+
114123
if (process.env.NODE_ENV === 'development') {
115124
addEventProcessor(devErrorSymbolicationEventProcessor);
116125
}

0 commit comments

Comments
 (0)