Skip to content

Commit ef7f750

Browse files
committed
stop using event processor in instrumentServer
1 parent 3da003c commit ef7f750

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

packages/nextjs/src/utils/instrumentServer.ts

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
/* eslint-disable max-lines */
2-
import {
3-
addRequestDataToEvent,
4-
captureException,
5-
configureScope,
6-
deepReadDirSync,
7-
getCurrentHub,
8-
startTransaction,
9-
} from '@sentry/node';
2+
import { captureException, configureScope, deepReadDirSync, getCurrentHub, startTransaction } from '@sentry/node';
103
import { extractTraceparentData, getActiveTransaction, hasTracingEnabled } from '@sentry/tracing';
114
import {
125
addExceptionMechanism,
@@ -244,9 +237,7 @@ function makeWrappedReqHandler(origReqHandler: ReqHandler): WrappedReqHandler {
244237
const currentScope = getCurrentHub().getScope();
245238

246239
if (currentScope) {
247-
currentScope.addEventProcessor(event =>
248-
event.type !== 'transaction' ? addRequestDataToEvent(event, nextReq) : event,
249-
);
240+
// Store the request on the scope so we can pull data from it and add it to the event
250241
currentScope.setSDKProcessingMetadata({ request: req });
251242

252243
// We only want to record page and API requests
@@ -298,10 +289,6 @@ function makeWrappedReqHandler(origReqHandler: ReqHandler): WrappedReqHandler {
298289
if (transaction) {
299290
transaction.setHttpStatus(res.statusCode);
300291

301-
// we'll collect this data in a more targeted way in the event processor we added above,
302-
// `addRequestDataToEvent`
303-
delete transaction.metadata.requestPath;
304-
305292
// Push `transaction.finish` to the next event loop so open spans have a chance to finish before the
306293
// transaction closes
307294
setImmediate(() => {

0 commit comments

Comments
 (0)