33 captureException ,
44 getActiveSpan ,
55 getCapturedScopesOnSpan ,
6- getClient ,
76 getRootSpan ,
87 handleCallbackErrors ,
98 propagationContextFromHeaders ,
@@ -13,7 +12,6 @@ import {
1312 setCapturedScopesOnSpan ,
1413 SPAN_STATUS_ERROR ,
1514 SPAN_STATUS_OK ,
16- spanToJSON ,
1715 startSpanManual ,
1816 winterCGHeadersToDict ,
1917 withIsolationScope ,
@@ -23,8 +21,6 @@ import type { GenerationFunctionContext } from '../common/types';
2321import { isNotFoundNavigationError , isRedirectNavigationError } from './nextNavigationErrorUtils' ;
2422import { TRANSACTION_ATTR_SENTRY_TRACE_BACKFILL } from './span-attributes-with-logic-attached' ;
2523import { commonObjectToIsolationScope , commonObjectToPropagationContext } from './utils/tracingUtils' ;
26- import { getSanitizedRequestUrl } from './utils/urls' ;
27- import { maybeExtractSynchronousParamsAndSearchParams } from './utils/wrapperUtils' ;
2824/**
2925 * Wraps a generation function (e.g. generateMetadata) with Sentry error and performance instrumentation.
3026 */
@@ -46,43 +42,23 @@ export function wrapGenerationFunctionWithSentry<F extends (...args: any[]) => a
4642 }
4743
4844 const isolationScope = commonObjectToIsolationScope ( headers ) ;
49- let pathname = undefined as string | undefined ;
5045
5146 const activeSpan = getActiveSpan ( ) ;
5247 if ( activeSpan ) {
5348 const rootSpan = getRootSpan ( activeSpan ) ;
5449 const { scope } = getCapturedScopesOnSpan ( rootSpan ) ;
5550 setCapturedScopesOnSpan ( rootSpan , scope ?? new Scope ( ) , isolationScope ) ;
56-
57- const spanData = spanToJSON ( rootSpan ) ;
58-
59- if ( spanData . data && 'http.target' in spanData . data ) {
60- pathname = spanData . data [ 'http.target' ] as string ;
61- }
6251 }
6352
6453 const headersDict = headers ? winterCGHeadersToDict ( headers ) : undefined ;
6554
66- let data : Record < string , unknown > | undefined = undefined ;
67- if ( getClient ( ) ?. getOptions ( ) . sendDefaultPii ) {
68- const props : unknown = args [ 0 ] ;
69- const { params, searchParams } = maybeExtractSynchronousParamsAndSearchParams ( props ) ;
70- data = { params, searchParams } ;
71- }
72-
7355 return withIsolationScope ( isolationScope , ( ) => {
7456 return withScope ( scope => {
7557 scope . setTransactionName ( `${ componentType } .${ generationFunctionIdentifier } (${ componentRoute } )` ) ;
7658
7759 isolationScope . setSDKProcessingMetadata ( {
7860 normalizedRequest : {
7961 headers : headersDict ,
80- url : getSanitizedRequestUrl (
81- componentRoute ,
82- data ?. params as Record < string , string > | undefined ,
83- headersDict ,
84- pathname ,
85- ) ,
8662 } satisfies RequestEventData ,
8763 } ) ;
8864
@@ -106,8 +82,6 @@ export function wrapGenerationFunctionWithSentry<F extends (...args: any[]) => a
10682
10783 scope . setPropagationContext ( propagationContext ) ;
10884
109- scope . setExtra ( 'route_data' , data ) ;
110-
11185 return startSpanManual (
11286 {
11387 op : 'function.nextjs' ,
0 commit comments