@@ -282,6 +282,8 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
282282
283283 scope . setPropagationContext ( {
284284 ...oldPropagationContext ,
285+ traceId : idleSpan . spanContext ( ) . traceId ,
286+ sampled : spanIsSampled ( idleSpan ) ,
285287 dsc : getDynamicSamplingContextFromSpan ( span ) ,
286288 } ) ;
287289 } ,
@@ -301,21 +303,6 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
301303
302304 emitFinish ( ) ;
303305 }
304-
305- // A trace should to stay the consistent over the entire time span of one route.
306- // Therefore, when the initial pageload or navigation root span ends, we update the
307- // scope's propagation context to keep span-specific attributes like the `sampled` decision and
308- // the dynamic sampling context valid, even after the root span has ended.
309- // This ensures that the trace data is consistent for the entire duration of the route.
310- const scope = getCurrentScope ( ) ;
311- const oldPropagationContext = scope . getPropagationContext ( ) ;
312-
313- scope . setPropagationContext ( {
314- ...oldPropagationContext ,
315- traceId : idleSpan . spanContext ( ) . traceId ,
316- sampled : spanIsSampled ( idleSpan ) ,
317- dsc : getDynamicSamplingContextFromSpan ( idleSpan ) ,
318- } ) ;
319306 }
320307
321308 return {
0 commit comments