File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1- import { captureException } from '@sentry/core' ;
1+ import { captureException , getCurrentHub , startTransaction } from '@sentry/core' ;
2+ import { addRequestDataToEvent } from '@sentry/node' ;
23import { getActiveTransaction } from '@sentry/tracing' ;
34import { Transaction } from '@sentry/types' ;
45import { fill } from '@sentry/utils' ;
@@ -103,6 +104,16 @@ export function callTracedServerSideDataFetcher<F extends (...args: any[]) => Pr
103104 const currentScope = getCurrentHub ( ) . getScope ( ) ;
104105 if ( currentScope ) {
105106 currentScope . setSpan ( dataFetcherSpan ) ;
107+ currentScope . addEventProcessor ( event =>
108+ addRequestDataToEvent ( event , req , {
109+ include : {
110+ // When the `transaction` option is set to true, it tries to extract a transaction name from the request
111+ // object. We don't want this since we already have a high-quality transaction name with a parameterized
112+ // route. Setting `transaction` to `true` will clobber that transaction name.
113+ transaction : false ,
114+ } ,
115+ } ) ,
116+ ) ;
106117 }
107118
108119 try {
Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ export * from '@sentry/react';
1111export { nextRouterInstrumentation } from './performance/client' ;
1212export { captureUnderscoreErrorException } from './utils/_error' ;
1313
14- export { withSentryGetInitialProps } from './config/wrappers' ;
15-
1614export { Integrations } ;
1715
1816// Previously we expected users to import `BrowserTracing` like this:
You can’t perform that action at this time.
0 commit comments