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
437437 sampled : spanIsSampled ( idleSpan ) ,
438438 dsc : getDynamicSamplingContextFromSpan ( span ) ,
439439 } ) ;
440+
441+ if ( isPageloadSpan ) {
442+ // clean up the stored pageload span on the intergration.
443+ _pageloadSpan = undefined ;
444+ }
440445 } ,
441446 trimIdleSpanEndTimestamp : ! explicitPageloadEnd ,
442447 } ) ;
@@ -606,7 +611,6 @@ export const browserTracingIntegration = ((options: Partial<BrowserTracingOption
606611 if ( explicitPageloadEnd && _pageloadSpan ) {
607612 _pageloadSpan . setAttribute ( SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON , 'reportPageLoaded' ) ;
608613 _pageloadSpan . end ( ) ;
609- _pageloadSpan = undefined ;
610614 }
611615 } ) ;
612616 } ,
Original file line number Diff line number Diff line change @@ -606,6 +606,10 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
606606 ) => void ,
607607 ) : ( ) => void ;
608608
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+ */
609613 public on ( hook : 'endPageloadSpan' , callback : ( ) => void ) : ( ) => void ;
610614
611615 /**
You can’t perform that action at this time.
0 commit comments