File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -437,6 +437,11 @@ export const browserTracingIntegration = ((options: Partial<BrowserTracingOption
437
437
sampled : spanIsSampled ( idleSpan ) ,
438
438
dsc : getDynamicSamplingContextFromSpan ( span ) ,
439
439
} ) ;
440
+
441
+ if ( isPageloadSpan ) {
442
+ // clean up the stored pageload span on the intergration.
443
+ _pageloadSpan = undefined ;
444
+ }
440
445
} ,
441
446
trimIdleSpanEndTimestamp : ! explicitPageloadEnd ,
442
447
} ) ;
@@ -606,7 +611,6 @@ export const browserTracingIntegration = ((options: Partial<BrowserTracingOption
606
611
if ( explicitPageloadEnd && _pageloadSpan ) {
607
612
_pageloadSpan . setAttribute ( SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON , 'reportPageLoaded' ) ;
608
613
_pageloadSpan . end ( ) ;
609
- _pageloadSpan = undefined ;
610
614
}
611
615
} ) ;
612
616
} ,
Original file line number Diff line number Diff line change @@ -606,6 +606,10 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
606
606
) => void ,
607
607
) : ( ) => void ;
608
608
609
+ /**
610
+ * A hook for the browser tracing integrations to trigger the end of a page load span.
611
+ * @returns {() => void } A function that, when executed, removes the registered callback.
612
+ */
609
613
public on ( hook : 'endPageloadSpan' , callback : ( ) => void ) : ( ) => void ;
610
614
611
615
/**
You can’t perform that action at this time.
0 commit comments