File tree 1 file changed +11
-0
lines changed
packages/nextjs/src/config/wrappers
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { captureException , getCurrentHub , startTransaction } from '@sentry/core' ;
2
+ import { addRequestDataToEvent } from '@sentry/node' ;
2
3
import { getActiveTransaction } from '@sentry/tracing' ;
3
4
import { Transaction } from '@sentry/types' ;
4
5
import { fill } from '@sentry/utils' ;
@@ -103,6 +104,16 @@ export function callTracedServerSideDataFetcher<F extends (...args: any[]) => Pr
103
104
const currentScope = getCurrentHub ( ) . getScope ( ) ;
104
105
if ( currentScope ) {
105
106
currentScope . setSpan ( dataFetcherSpan ) ;
107
+ currentScope . addEventProcessor ( event =>
108
+ addRequestDataToEvent ( event , req , {
109
+ include : {
110
+ // The `transaction` option tries to extract a transaction name from the request object. We don't want this
111
+ // since we already have a high-quality transaction name with a parameterized route. Setting `transaction`
112
+ // to `true` will clobber that transaction name.
113
+ transaction : false ,
114
+ } ,
115
+ } ) ,
116
+ ) ;
106
117
}
107
118
108
119
try {
You can’t perform that action at this time.
0 commit comments