1- import { captureException , flush , getCurrentHub , Handlers , startTransaction } from '@sentry/node' ;
1+ import { addRequestDataToEvent , captureException , flush , getCurrentHub , startTransaction } from '@sentry/node' ;
22import { extractTraceparentData , hasTracingEnabled } from '@sentry/tracing' ;
33import { Transaction } from '@sentry/types' ;
44import {
@@ -12,8 +12,6 @@ import {
1212import * as domain from 'domain' ;
1313import { NextApiHandler , NextApiRequest , NextApiResponse } from 'next' ;
1414
15- const { parseRequest } = Handlers ;
16-
1715// This is the same as the `NextApiHandler` type, except instead of having a return type of `void | Promise<void>`, it's
1816// only `Promise<void>`, because wrapped handlers are always async
1917export type WrappedNextApiHandler = ( req : NextApiRequest , res : NextApiResponse ) => Promise < void > ;
@@ -43,7 +41,7 @@ export const withSentry = (origHandler: NextApiHandler): WrappedNextApiHandler =
4341 const currentScope = getCurrentHub ( ) . getScope ( ) ;
4442
4543 if ( currentScope ) {
46- currentScope . addEventProcessor ( event => parseRequest ( event , req ) ) ;
44+ currentScope . addEventProcessor ( event => addRequestDataToEvent ( event , req ) ) ;
4745
4846 if ( hasTracingEnabled ( ) ) {
4947 // If there is a trace header set, extract the data from it (parentSpanId, traceId, and sampling decision)
0 commit comments