Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6b6187

Browse files
committed
fix: still set the trasnaction name
1 parent9c7a185 commitf6b6187

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎packages/nextjs/src/common/wrapMiddlewareWithSentry.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{captureException,handleCallbackErrors}from'@sentry/core';
1+
import{captureException,getCurrentScope,handleCallbackErrors}from'@sentry/core';
22
import{flushSafelyWithTimeout,waitUntil}from'../common/utils/responseEnd';
33
importtype{EdgeRouteHandler}from'../edge/types';
44

@@ -40,6 +40,10 @@ export function wrapMiddlewareWithSentry<H extends EdgeRouteHandler>(
4040
}
4141
}
4242

43+
constreq:unknown=args[0];
44+
constspanName=reqinstanceofRequest ?`middleware${req.method}` :'middleware';
45+
getCurrentScope().setTransactionName(spanName);
46+
4347
returnhandleCallbackErrors(
4448
()=>wrappingTarget.apply(thisArg,args),
4549
error=>{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp