@@ -2,7 +2,7 @@ import { Carrier, getHubFromCarrier, getMainCarrier } from '@sentry/hub';
2
2
import { RewriteFrames } from '@sentry/integrations' ;
3
3
import { configureScope , getCurrentHub , init as nodeInit , Integrations } from '@sentry/node' ;
4
4
import { hasTracingEnabled } from '@sentry/tracing' ;
5
- import { Event } from '@sentry/types' ;
5
+ import { EventProcessor } from '@sentry/types' ;
6
6
import { escapeStringForRegex , logger } from '@sentry/utils' ;
7
7
import * as domainModule from 'domain' ;
8
8
import * as path from 'path' ;
@@ -71,6 +71,12 @@ export function init(options: NextjsOptions): void {
71
71
72
72
nodeInit ( options ) ;
73
73
74
+ const filterTransactions : EventProcessor = event => {
75
+ return event . type === 'transaction' && event . transaction === '/404' ? null : event ;
76
+ } ;
77
+
78
+ filterTransactions . id = 'NextServer404Filter' ;
79
+
74
80
configureScope ( scope => {
75
81
scope . setTag ( 'runtime' , 'node' ) ;
76
82
if ( isVercel ) {
@@ -131,10 +137,6 @@ function addServerIntegrations(options: NextjsOptions): void {
131
137
}
132
138
}
133
139
134
- function filterTransactions ( event : Event ) : Event | null {
135
- return event . type === 'transaction' && event . transaction === '/404' ? null : event ;
136
- }
137
-
138
140
export type { SentryWebpackPluginOptions } from './config/types' ;
139
141
export { withSentryConfig } from './config' ;
140
142
export { withSentry } from './utils/withSentry' ;
0 commit comments