Skip to content

Commit 4fea67e

Browse files
committed
fix it ???
1 parent 8cb3053 commit 4fea67e

File tree

1 file changed

+7
-8
lines changed
  • dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/pageloadWithChildSpanTimeout

1 file changed

+7
-8
lines changed

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/pageloadWithChildSpanTimeout/init.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ Sentry.init({
1212
],
1313
defaultIntegrations: false,
1414
tracesSampleRate: 1,
15-
debug: true
15+
debug: true,
1616
});
1717

1818
const activeSpan = Sentry.getActiveSpan();
19-
if (activeSpan) {
20-
Sentry.startInactiveSpan({ name: 'pageload-child-span' });
21-
} else {
22-
setTimeout(() => {
23-
Sentry.startInactiveSpan({ name: 'pageload-child-span' });
24-
}, 200);
25-
}
19+
Sentry.startInactiveSpan({
20+
name: 'pageload-child-span',
21+
onlyIfParent: true,
22+
// Set this to ensure we do not discard this span due to timeout
23+
startTime: activeSpan && Sentry.spanToJSON(activeSpan).start_timestamp,
24+
});

0 commit comments

Comments
 (0)