1
- import { captureException , flush , getCurrentHub , Handlers , startTransaction } from '@sentry/node' ;
1
+ import { addRequestDataToEvent , captureException , flush , getCurrentHub , startTransaction } from '@sentry/node' ;
2
2
import { extractTraceparentData , hasTracingEnabled } from '@sentry/tracing' ;
3
3
import { Transaction } from '@sentry/types' ;
4
4
import {
@@ -12,8 +12,6 @@ import {
12
12
import * as domain from 'domain' ;
13
13
import { NextApiHandler , NextApiRequest , NextApiResponse } from 'next' ;
14
14
15
- const { parseRequest } = Handlers ;
16
-
17
15
// This is the same as the `NextApiHandler` type, except instead of having a return type of `void | Promise<void>`, it's
18
16
// only `Promise<void>`, because wrapped handlers are always async
19
17
export type WrappedNextApiHandler = ( req : NextApiRequest , res : NextApiResponse ) => Promise < void > ;
@@ -43,7 +41,7 @@ export const withSentry = (origHandler: NextApiHandler): WrappedNextApiHandler =
43
41
const currentScope = getCurrentHub ( ) . getScope ( ) ;
44
42
45
43
if ( currentScope ) {
46
- currentScope . addEventProcessor ( event => parseRequest ( event , req ) ) ;
44
+ currentScope . addEventProcessor ( event => addRequestDataToEvent ( event , req ) ) ;
47
45
48
46
if ( hasTracingEnabled ( ) ) {
49
47
// If there is a trace header set, extract the data from it (parentSpanId, traceId, and sampling decision)
0 commit comments