@@ -11,7 +11,6 @@ import {
1111import { isNotFoundNavigationError , isRedirectNavigationError } from '../common/nextNavigationErrorUtils' ;
1212import type { ServerComponentContext } from '../common/types' ;
1313import { flushSafelyWithTimeout , waitUntil } from '../common/utils/responseEnd' ;
14- import { commonObjectToIsolationScope } from './utils/tracingUtils' ;
1514
1615/**
1716 * Wraps an `app` directory server component with Sentry error instrumentation.
@@ -26,7 +25,7 @@ export function wrapServerComponentWithSentry<F extends (...args: any[]) => any>
2625 // hook. 🤯
2726 return new Proxy ( appDirComponent , {
2827 apply : ( originalFunction , thisArg , args ) => {
29- const isolationScope = commonObjectToIsolationScope ( context . headers ) ;
28+ const isolationScope = getIsolationScope ( ) ;
3029
3130 const headersDict = context . headers ? winterCGHeadersToDict ( context . headers ) : undefined ;
3231
@@ -39,20 +38,19 @@ export function wrapServerComponentWithSentry<F extends (...args: any[]) => any>
3938 return handleCallbackErrors (
4039 ( ) => originalFunction . apply ( thisArg , args ) ,
4140 error => {
42- const isolationScope = getIsolationScope ( ) ;
4341 const span = getActiveSpan ( ) ;
4442 const { componentRoute, componentType } = context ;
45- let shouldCapture = false ;
43+ let shouldCapture = true ;
4644 isolationScope . setTransactionName ( `${ componentType } Server Component (${ componentRoute } )` ) ;
4745
4846 if ( span ) {
4947 if ( isNotFoundNavigationError ( error ) ) {
50- shouldCapture = false ;
5148 // We don't want to report "not-found"s
49+ shouldCapture = false ;
5250 span . setStatus ( { code : SPAN_STATUS_ERROR , message : 'not_found' } ) ;
5351 } else if ( isRedirectNavigationError ( error ) ) {
54- shouldCapture = false ;
5552 // We don't want to report redirects
53+ shouldCapture = false ;
5654 span . setStatus ( { code : SPAN_STATUS_OK } ) ;
5755 } else {
5856 span . setStatus ( { code : SPAN_STATUS_ERROR , message : 'internal_error' } ) ;
0 commit comments