@@ -282,6 +282,8 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
282
282
283
283
scope . setPropagationContext ( {
284
284
...oldPropagationContext ,
285
+ traceId : idleSpan . spanContext ( ) . traceId ,
286
+ sampled : spanIsSampled ( idleSpan ) ,
285
287
dsc : getDynamicSamplingContextFromSpan ( span ) ,
286
288
} ) ;
287
289
} ,
@@ -301,21 +303,6 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
301
303
302
304
emitFinish ( ) ;
303
305
}
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
- } ) ;
319
306
}
320
307
321
308
return {
0 commit comments