@@ -360,14 +360,15 @@ function _addPerformanceNavigationTiming(
360360 return ;
361361 }
362362 const op = NAVIGATION_TIMING_SPAN_OPS [ event ] ;
363+ const filteredUrl = filterCollectedUrl ( entry . name ) ;
363364 startAndEndSpan ( span , _navigationTimeToSeconds ( entry , start ) , _navigationTimeToSeconds ( entry , end ) , {
364365 // With span streaming, span names have to be low cardinality, so we can't fall back to the
365366 // document URL. `url.full` keeps it, and is what Relay derives the description from.
366- name : spanStreamingEnabled ? BROWSER_NAVIGATION_TIMING_SPAN_NAMES [ op ] : entry . name ,
367+ name : spanStreamingEnabled ? BROWSER_NAVIGATION_TIMING_SPAN_NAMES [ op ] : filteredUrl ,
367368 attributes : {
368369 [ SENTRY_OP ] : op ,
369370 [ SENTRY_ORIGIN ] : 'auto.ui.browser.metrics' ,
370- [ URL_FULL ] : filterCollectedUrl ( entry . name ) ,
371+ [ URL_FULL ] : filteredUrl ,
371372 ...( event === 'redirect' && entry . redirectCount != null ? { 'http.redirect_count' : entry . redirectCount } : { } ) ,
372373 } ,
373374 } ) ;
@@ -396,23 +397,23 @@ function _addRequest(span: Span, entry: PerformanceNavigationTiming, spanStreami
396397
397398 // With span streaming, span names have to be low cardinality, so we can't fall back to the
398399 // document URL. `url.full` keeps it, and is what Relay derives the description from.
399- const url = filterCollectedUrl ( entry . name ) ;
400+ const filteredUrl = filterCollectedUrl ( entry . name ) ;
400401
401402 startAndEndSpan ( span , requestStartTimestamp , responseEndTimestamp , {
402- name : spanStreamingEnabled ? BROWSER_NAVIGATION_TIMING_SPAN_NAMES [ BROWSER_REQUEST ] : entry . name ,
403+ name : spanStreamingEnabled ? BROWSER_NAVIGATION_TIMING_SPAN_NAMES [ BROWSER_REQUEST ] : filteredUrl ,
403404 attributes : {
404405 [ SENTRY_OP ] : BROWSER_REQUEST ,
405406 [ SENTRY_ORIGIN ] : 'auto.ui.browser.metrics' ,
406- [ URL_FULL ] : url ,
407+ [ URL_FULL ] : filteredUrl ,
407408 } ,
408409 } ) ;
409410
410411 startAndEndSpan ( span , responseStartTimestamp , responseEndTimestamp , {
411- name : spanStreamingEnabled ? BROWSER_NAVIGATION_TIMING_SPAN_NAMES [ BROWSER_RESPONSE ] : entry . name ,
412+ name : spanStreamingEnabled ? BROWSER_NAVIGATION_TIMING_SPAN_NAMES [ BROWSER_RESPONSE ] : filteredUrl ,
412413 attributes : {
413414 [ SENTRY_OP ] : BROWSER_RESPONSE ,
414415 [ SENTRY_ORIGIN ] : 'auto.ui.browser.metrics' ,
415- [ URL_FULL ] : url ,
416+ [ URL_FULL ] : filteredUrl ,
416417 } ,
417418 } ) ;
418419 }
@@ -468,7 +469,8 @@ export function _addResourceSpans(
468469
469470 attributes [ HTTP_REQUEST_SAME_ORIGIN ] = resourceUrl . includes ( WINDOW . location . origin ) ;
470471
471- attributes [ URL_FULL ] = filterCollectedUrl ( resourceUrl ) ;
472+ const filteredUrl = filterCollectedUrl ( resourceUrl ) ;
473+ attributes [ URL_FULL ] = filteredUrl ;
472474
473475 _setResourceRequestAttributes ( entry , attributes , [
474476 // https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/responseStatus
@@ -493,7 +495,7 @@ export function _addResourceSpans(
493495 // With span streaming, span names have to be low cardinality, so we can't fall back to the URL.
494496 name : spanStreamingEnabled
495497 ? domain || RESOURCE_SPAN_NAME_FALLBACK
496- : resourceUrl . replace ( WINDOW . location . origin , '' ) ,
498+ : filteredUrl . replace ( WINDOW . location . origin , '' ) ,
497499 op,
498500 attributes : attributesWithResourceTiming ,
499501 } ) ;
0 commit comments