Skip to content

Commit 816d8a2

Browse files
committed
do not set on span start??
1 parent c786e13 commit 816d8a2

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

packages/browser/src/tracing/browserTracingIntegration.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)