Skip to content

Commit 8f07b99

Browse files
committed
fix iso scope
1 parent c6751b3 commit 8f07b99

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/nextjs/src/common/wrapServerComponentWithSentry.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
import { isNotFoundNavigationError, isRedirectNavigationError } from '../common/nextNavigationErrorUtils';
1212
import type { ServerComponentContext } from '../common/types';
1313
import { 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

Comments
 (0)