@cloudcare/browser-rum 3.0.29 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +3 -2
- package/cjs/boot/buildEnv.js.map +1 -0
- package/cjs/boot/recorderApi.js +30 -46
- package/cjs/boot/recorderApi.js.map +1 -0
- package/cjs/boot/rum.entry.js +2 -7
- package/cjs/boot/rum.entry.js.map +1 -0
- package/cjs/boot/rum.js +40 -43
- package/cjs/boot/rum.js.map +1 -0
- package/cjs/boot/rumPublicApi.js +3 -49
- package/cjs/boot/rumPublicApi.js.map +1 -0
- package/cjs/boot/startRecording.js +7 -11
- package/cjs/boot/startRecording.js.map +1 -0
- package/cjs/constants.js +8 -6
- package/cjs/constants.js.map +1 -0
- package/cjs/domain/assembly.js +8 -20
- package/cjs/domain/assembly.js.map +1 -0
- package/cjs/domain/configuration.js +15 -52
- package/cjs/domain/configuration.js.map +1 -0
- package/cjs/domain/contexts/commonContext.js +2 -2
- package/cjs/domain/contexts/commonContext.js.map +1 -0
- package/cjs/domain/contexts/displayContext.js +28 -0
- package/cjs/domain/contexts/displayContext.js.map +1 -0
- package/cjs/domain/contexts/foregroundContexts.js +4 -29
- package/cjs/domain/contexts/foregroundContexts.js.map +1 -0
- package/cjs/domain/contexts/internalContext.js +5 -4
- package/cjs/domain/contexts/internalContext.js.map +1 -0
- package/cjs/domain/contexts/pageStateHistory.js +105 -0
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -0
- package/cjs/domain/contexts/urlContexts.js +3 -9
- package/cjs/domain/contexts/urlContexts.js.map +1 -0
- package/cjs/domain/contexts/viewContexts.js +2 -6
- package/cjs/domain/contexts/viewContexts.js.map +1 -0
- package/cjs/domain/domMutationCollection.js +6 -10
- package/cjs/domain/domMutationCollection.js.map +1 -0
- package/cjs/domain/initViewportObservable.js +4 -11
- package/cjs/domain/initViewportObservable.js.map +1 -0
- package/cjs/domain/locationChangeObservable.js +2 -11
- package/cjs/domain/locationChangeObservable.js.map +1 -0
- package/cjs/domain/performanceCollection.js +11 -39
- package/cjs/domain/performanceCollection.js.map +1 -0
- package/cjs/domain/replay/deflate/deflateEncoder.js +82 -0
- package/cjs/domain/replay/deflate/deflateEncoder.js.map +1 -0
- package/cjs/domain/replay/deflate/deflateWorker.js +142 -0
- package/cjs/domain/replay/deflate/deflateWorker.js.map +1 -0
- package/cjs/domain/replay/deflate/index.js +44 -0
- package/cjs/domain/replay/deflate/index.js.map +1 -0
- package/cjs/domain/replay/record/elementsScrollPositions.js +2 -3
- package/cjs/domain/replay/record/elementsScrollPositions.js.map +1 -0
- package/cjs/domain/replay/record/index.js +2 -4
- package/cjs/domain/replay/record/index.js.map +1 -0
- package/cjs/domain/replay/record/mutationBatch.js +4 -11
- package/cjs/domain/replay/record/mutationBatch.js.map +1 -0
- package/cjs/domain/replay/record/mutationObserver.js +27 -86
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -0
- package/cjs/domain/replay/record/observers.js +15 -89
- package/cjs/domain/replay/record/observers.js.map +1 -0
- package/cjs/domain/replay/record/privacy.js +57 -75
- package/cjs/domain/replay/record/privacy.js.map +1 -0
- package/cjs/domain/replay/record/record.js +6 -29
- package/cjs/domain/replay/record/record.js.map +1 -0
- package/cjs/domain/replay/record/serializationUtils.js +8 -68
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -0
- package/cjs/domain/replay/record/serialize.js +43 -118
- package/cjs/domain/replay/record/serialize.js.map +1 -0
- package/cjs/domain/replay/record/shadowRootsController.js +4 -11
- package/cjs/domain/replay/record/shadowRootsController.js.map +1 -0
- package/cjs/domain/replay/record/utils.js +4 -12
- package/cjs/domain/replay/record/utils.js.map +1 -0
- package/cjs/domain/replay/record/viewports.js +4 -42
- package/cjs/domain/replay/record/viewports.js.map +1 -0
- package/cjs/domain/replay/replayStats.js +2 -14
- package/cjs/domain/replay/replayStats.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js +4 -9
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/index.js +1 -9
- package/cjs/domain/replay/segmentCollection/index.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/segment.js +23 -87
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +41 -64
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -0
- package/cjs/domain/requestCollection.js +2 -17
- package/cjs/domain/requestCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js +12 -22
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/clickChain.js +3 -14
- package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/computeFrustration.js +12 -20
- package/cjs/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js +22 -53
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js +13 -45
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js +4 -6
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/trackClickActions.js +15 -45
- package/cjs/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -0
- package/cjs/domain/rumEventsCollection/error/errorCollection.js +13 -23
- package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/error/trackConsoleError.js +2 -3
- package/cjs/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -0
- package/cjs/domain/rumEventsCollection/error/trackReportError.js +4 -5
- package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -0
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js +2 -7
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/resource/matchRequestTiming.js +2 -13
- package/cjs/domain/rumEventsCollection/resource/matchRequestTiming.js.map +1 -0
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +2 -18
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js +58 -69
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js +55 -0
- package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js +62 -0
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +74 -0
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +26 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js +2 -8
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstInputTimings.js +38 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstInputTimings.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js +26 -179
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +120 -0
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +49 -0
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js +39 -0
- package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js +37 -0
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js +61 -0
- package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js +3 -6
- package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackViews.js +26 -58
- package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/viewCollection.js +43 -48
- package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -0
- package/cjs/domain/rumSessionManager.js +3 -13
- package/cjs/domain/rumSessionManager.js.map +1 -0
- package/cjs/domain/tracing/ddtraceTracer.js +2 -4
- package/cjs/domain/tracing/ddtraceTracer.js.map +1 -0
- package/cjs/domain/tracing/getDocumentTraceId.js +5 -22
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -0
- package/cjs/domain/tracing/jaegerTracer.js +2 -4
- package/cjs/domain/tracing/jaegerTracer.js.map +1 -0
- package/cjs/domain/tracing/skywalkingTracer.js +6 -13
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -0
- package/cjs/domain/tracing/traceIdentifier.js +2 -7
- package/cjs/domain/tracing/traceIdentifier.js.map +1 -0
- package/cjs/domain/tracing/tracer.js +5 -30
- package/cjs/domain/tracing/tracer.js.map +1 -0
- package/cjs/domain/tracing/w3cTraceParentTracer.js +2 -11
- package/cjs/domain/tracing/w3cTraceParentTracer.js.map +1 -0
- package/cjs/domain/tracing/zipkinMultiTracer.js +4 -6
- package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -0
- package/cjs/domain/tracing/zipkinSingleTracer.js +2 -4
- package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -0
- package/cjs/domain/trackEventCounts.js +2 -10
- package/cjs/domain/trackEventCounts.js.map +1 -0
- package/cjs/domain/usr/index.js +2 -7
- package/cjs/domain/usr/index.js.map +1 -0
- package/cjs/domain/waitPageActivityEnd.js +7 -23
- package/cjs/domain/waitPageActivityEnd.js.map +1 -0
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -0
- package/cjs/transport/startRumBatch.js +7 -8
- package/cjs/transport/startRumBatch.js.map +1 -0
- package/cjs/transport/startRumEventBridge.js +2 -3
- package/cjs/transport/startRumEventBridge.js.map +1 -0
- package/cjs/types/index.js +2 -3
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/sessionReplayConstants.js +4 -3
- package/cjs/types/sessionReplayConstants.js.map +1 -0
- package/esm/boot/buildEnv.js +3 -2
- package/esm/boot/buildEnv.js.map +1 -0
- package/esm/boot/recorderApi.js +32 -42
- package/esm/boot/recorderApi.js.map +1 -0
- package/esm/boot/rum.entry.js +2 -1
- package/esm/boot/rum.entry.js.map +1 -0
- package/esm/boot/rum.js +41 -23
- package/esm/boot/rum.js.map +1 -0
- package/esm/boot/rumPublicApi.js +3 -43
- package/esm/boot/rumPublicApi.js.map +1 -0
- package/esm/boot/startRecording.js +8 -7
- package/esm/boot/startRecording.js.map +1 -0
- package/esm/constants.js +8 -4
- package/esm/constants.js.map +1 -0
- package/esm/domain/assembly.js +8 -17
- package/esm/domain/assembly.js.map +1 -0
- package/esm/domain/configuration.js +15 -38
- package/esm/domain/configuration.js.map +1 -0
- package/esm/domain/contexts/commonContext.js +2 -1
- package/esm/domain/contexts/commonContext.js.map +1 -0
- package/esm/domain/contexts/displayContext.js +21 -0
- package/esm/domain/contexts/displayContext.js.map +1 -0
- package/esm/domain/contexts/foregroundContexts.js +6 -25
- package/esm/domain/contexts/foregroundContexts.js.map +1 -0
- package/esm/domain/contexts/internalContext.js +5 -3
- package/esm/domain/contexts/internalContext.js.map +1 -0
- package/esm/domain/contexts/pageStateHistory.js +95 -0
- package/esm/domain/contexts/pageStateHistory.js.map +1 -0
- package/esm/domain/contexts/urlContexts.js +3 -6
- package/esm/domain/contexts/urlContexts.js.map +1 -0
- package/esm/domain/contexts/viewContexts.js +2 -3
- package/esm/domain/contexts/viewContexts.js.map +1 -0
- package/esm/domain/domMutationCollection.js +6 -7
- package/esm/domain/domMutationCollection.js.map +1 -0
- package/esm/domain/initViewportObservable.js +4 -6
- package/esm/domain/initViewportObservable.js.map +1 -0
- package/esm/domain/locationChangeObservable.js +2 -9
- package/esm/domain/locationChangeObservable.js.map +1 -0
- package/esm/domain/performanceCollection.js +11 -35
- package/esm/domain/performanceCollection.js.map +1 -0
- package/esm/domain/replay/deflate/deflateEncoder.js +74 -0
- package/esm/domain/replay/deflate/deflateEncoder.js.map +1 -0
- package/esm/domain/replay/deflate/deflateWorker.js +129 -0
- package/esm/domain/replay/deflate/deflateWorker.js.map +1 -0
- package/esm/domain/replay/deflate/index.js +3 -0
- package/esm/domain/replay/deflate/index.js.map +1 -0
- package/esm/domain/replay/record/elementsScrollPositions.js +2 -2
- package/esm/domain/replay/record/elementsScrollPositions.js.map +1 -0
- package/esm/domain/replay/record/index.js +2 -1
- package/esm/domain/replay/record/index.js.map +1 -0
- package/esm/domain/replay/record/mutationBatch.js +5 -9
- package/esm/domain/replay/record/mutationBatch.js.map +1 -0
- package/esm/domain/replay/record/mutationObserver.js +29 -80
- package/esm/domain/replay/record/mutationObserver.js.map +1 -0
- package/esm/domain/replay/record/observers.js +15 -72
- package/esm/domain/replay/record/observers.js.map +1 -0
- package/esm/domain/replay/record/privacy.js +57 -65
- package/esm/domain/replay/record/privacy.js.map +1 -0
- package/esm/domain/replay/record/record.js +6 -19
- package/esm/domain/replay/record/record.js.map +1 -0
- package/esm/domain/replay/record/serializationUtils.js +8 -46
- package/esm/domain/replay/record/serializationUtils.js.map +1 -0
- package/esm/domain/replay/record/serialize.js +45 -107
- package/esm/domain/replay/record/serialize.js.map +1 -0
- package/esm/domain/replay/record/shadowRootsController.js +4 -6
- package/esm/domain/replay/record/shadowRootsController.js.map +1 -0
- package/esm/domain/replay/record/utils.js +4 -6
- package/esm/domain/replay/record/utils.js.map +1 -0
- package/esm/domain/replay/record/viewports.js +3 -32
- package/esm/domain/replay/record/viewports.js.map +1 -0
- package/esm/domain/replay/replayStats.js +2 -8
- package/esm/domain/replay/replayStats.js.map +1 -0
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js +4 -6
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -0
- package/esm/domain/replay/segmentCollection/index.js +2 -2
- package/esm/domain/replay/segmentCollection/index.js.map +1 -0
- package/esm/domain/replay/segmentCollection/segment.js +21 -77
- package/esm/domain/replay/segmentCollection/segment.js.map +1 -0
- package/esm/domain/replay/segmentCollection/segmentCollection.js +40 -53
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -0
- package/esm/domain/requestCollection.js +2 -10
- package/esm/domain/requestCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/actionCollection.js +12 -19
- package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/clickChain.js +3 -10
- package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/computeFrustration.js +12 -14
- package/esm/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js +22 -50
- package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js +12 -40
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js +4 -4
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/trackClickActions.js +18 -37
- package/esm/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -0
- package/esm/domain/rumEventsCollection/error/errorCollection.js +14 -19
- package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/error/trackConsoleError.js +2 -1
- package/esm/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -0
- package/esm/domain/rumEventsCollection/error/trackReportError.js +4 -3
- package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -0
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js +2 -5
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/resource/matchRequestTiming.js +3 -11
- package/esm/domain/rumEventsCollection/resource/matchRequestTiming.js.map +1 -0
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js +2 -13
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js +58 -57
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js +47 -0
- package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js +56 -0
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +67 -0
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +18 -0
- package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js +2 -4
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackFirstInputTimings.js +32 -0
- package/esm/domain/rumEventsCollection/view/trackFirstInputTimings.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js +25 -164
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +113 -0
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +41 -0
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackLoadingTime.js +33 -0
- package/esm/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js +31 -0
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js +53 -0
- package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js +5 -3
- package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackViews.js +28 -54
- package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/viewCollection.js +43 -44
- package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -0
- package/esm/domain/rumSessionManager.js +3 -9
- package/esm/domain/rumSessionManager.js.map +1 -0
- package/esm/domain/tracing/ddtraceTracer.js +2 -2
- package/esm/domain/tracing/ddtraceTracer.js.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.js +5 -15
- package/esm/domain/tracing/getDocumentTraceId.js.map +1 -0
- package/esm/domain/tracing/jaegerTracer.js +3 -2
- package/esm/domain/tracing/jaegerTracer.js.map +1 -0
- package/esm/domain/tracing/skywalkingTracer.js +8 -12
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -0
- package/esm/domain/tracing/traceIdentifier.js +2 -4
- package/esm/domain/tracing/traceIdentifier.js.map +1 -0
- package/esm/domain/tracing/tracer.js +5 -19
- package/esm/domain/tracing/tracer.js.map +1 -0
- package/esm/domain/tracing/w3cTraceParentTracer.js +4 -8
- package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -0
- package/esm/domain/tracing/zipkinMultiTracer.js +5 -4
- package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -0
- package/esm/domain/tracing/zipkinSingleTracer.js +3 -2
- package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -0
- package/esm/domain/trackEventCounts.js +2 -8
- package/esm/domain/trackEventCounts.js.map +1 -0
- package/esm/domain/usr/index.js +2 -3
- package/esm/domain/usr/index.js.map +1 -0
- package/esm/domain/waitPageActivityEnd.js +9 -19
- package/esm/domain/waitPageActivityEnd.js.map +1 -0
- package/esm/index.js +2 -1
- package/esm/index.js.map +1 -0
- package/esm/transport/startRumBatch.js +7 -6
- package/esm/transport/startRumBatch.js.map +1 -0
- package/esm/transport/startRumEventBridge.js +2 -1
- package/esm/transport/startRumEventBridge.js.map +1 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/sessionReplayConstants.js +5 -3
- package/esm/types/sessionReplayConstants.js.map +1 -0
- package/package.json +6 -5
- package/src/boot/recorderApi.js +43 -32
- package/src/boot/rum.js +45 -10
- package/src/boot/startRecording.js +7 -3
- package/src/domain/assembly.js +5 -2
- package/src/domain/configuration.js +0 -1
- package/src/domain/contexts/displayContext.js +29 -0
- package/src/domain/contexts/internalContext.js +3 -1
- package/src/domain/contexts/pageStateHistory.js +138 -0
- package/src/domain/replay/deflate/deflateEncoder.js +88 -0
- package/src/domain/replay/{segmentCollection/startDeflateWorker.js → deflate/deflateWorker.js} +55 -32
- package/src/domain/replay/deflate/index.js +7 -0
- package/src/domain/replay/record/mutationObserver.js +2 -1
- package/src/domain/replay/record/observers.js +3 -3
- package/src/domain/replay/record/privacy.js +20 -23
- package/src/domain/replay/record/record.js +2 -2
- package/src/domain/replay/record/serializationUtils.js +4 -2
- package/src/domain/replay/record/serialize.js +11 -14
- package/src/domain/replay/record/shadowRootsController.js +0 -1
- package/src/domain/replay/record/viewports.js +0 -26
- package/src/domain/replay/segmentCollection/buildReplayPayload.js +1 -1
- package/src/domain/replay/segmentCollection/index.js +0 -1
- package/src/domain/replay/segmentCollection/segment.js +28 -83
- package/src/domain/replay/segmentCollection/segmentCollection.js +49 -55
- package/src/domain/rumEventsCollection/actions/actionCollection.js +12 -12
- package/src/domain/rumEventsCollection/actions/trackClickActions.js +8 -6
- package/src/domain/rumEventsCollection/error/errorCollection.js +20 -15
- package/src/domain/rumEventsCollection/error/trackReportError.js +22 -16
- package/src/domain/rumEventsCollection/view/interactionCountPolyfill.js +59 -0
- package/src/domain/rumEventsCollection/view/trackCommonViewMetrics.js +87 -0
- package/src/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +73 -0
- package/src/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +23 -0
- package/src/domain/rumEventsCollection/view/trackFirstInputTimings.js +40 -0
- package/src/domain/rumEventsCollection/view/trackInitialViewTimings.js +29 -199
- package/src/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +144 -0
- package/src/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +57 -0
- package/src/domain/rumEventsCollection/view/trackLoadingTime.js +50 -0
- package/src/domain/rumEventsCollection/view/trackNavigationTimings.js +35 -0
- package/src/domain/rumEventsCollection/view/trackScrollMetrics.js +74 -0
- package/src/domain/rumEventsCollection/view/trackViews.js +32 -37
- package/src/domain/rumEventsCollection/view/viewCollection.js +51 -22
- package/src/transport/startRumBatch.js +5 -1
- package/cjs/domain/replay/segmentCollection/startDeflateWorker.js +0 -145
- package/cjs/domain/rumEventsCollection/view/trackViewMetrics.js +0 -156
- package/esm/domain/replay/segmentCollection/startDeflateWorker.js +0 -128
- package/esm/domain/rumEventsCollection/view/trackViewMetrics.js +0 -146
- package/src/domain/rumEventsCollection/view/trackViewMetrics.js +0 -176
|
@@ -1,105 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
assign,
|
|
3
|
-
addEventListener,
|
|
4
|
-
concatBuffers
|
|
5
|
-
} from '@cloudcare/browser-core'
|
|
1
|
+
import { assign } from '@cloudcare/browser-core'
|
|
6
2
|
import { RecordType } from '../../../types'
|
|
7
3
|
import * as replayStats from '../replayStats'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
worker,
|
|
12
|
-
context,
|
|
13
|
-
creationReason,
|
|
14
|
-
initialRecord,
|
|
15
|
-
onWrote,
|
|
16
|
-
onFlushed
|
|
17
|
-
) {
|
|
18
|
-
this.worker = worker
|
|
19
|
-
this.pendingWriteCount = 0
|
|
20
|
-
this.id = nextId++
|
|
4
|
+
|
|
5
|
+
export function Segment(encoder, context, creationReason) {
|
|
6
|
+
this.encoder = encoder
|
|
21
7
|
var viewId = context.view.id
|
|
22
8
|
|
|
23
9
|
this.metadata = assign(
|
|
24
10
|
{
|
|
25
|
-
start:
|
|
26
|
-
end:
|
|
11
|
+
start: Infinity,
|
|
12
|
+
end: -Infinity,
|
|
27
13
|
creation_reason: creationReason,
|
|
28
|
-
records_count:
|
|
29
|
-
has_full_snapshot:
|
|
14
|
+
records_count: 0,
|
|
15
|
+
has_full_snapshot: false,
|
|
30
16
|
index_in_view: replayStats.getSegmentsCount(viewId),
|
|
31
17
|
source: 'browser'
|
|
32
18
|
},
|
|
33
19
|
context
|
|
34
20
|
)
|
|
35
21
|
replayStats.addSegment(viewId)
|
|
36
|
-
replayStats.addRecord(viewId)
|
|
37
|
-
var rawBytesCount = 0
|
|
38
|
-
var compressedBytesCount = 0
|
|
39
|
-
var compressedData = []
|
|
40
|
-
var _this = this
|
|
41
|
-
var wokerListener = addEventListener(worker, 'message', function (params) {
|
|
42
|
-
var data = params.data
|
|
43
|
-
if (data.type !== 'wrote') {
|
|
44
|
-
return
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (data.id === _this.id) {
|
|
48
|
-
_this.pendingWriteCount -= 1
|
|
49
|
-
replayStats.addWroteData(viewId, data.additionalBytesCount)
|
|
50
|
-
rawBytesCount += data.additionalBytesCount
|
|
51
|
-
compressedBytesCount += data.result.length
|
|
52
|
-
compressedData.push(data.result)
|
|
53
|
-
if (_this.flushReason && _this.pendingWriteCount === 0) {
|
|
54
|
-
compressedData.push(data.trailer)
|
|
55
|
-
onFlushed(concatBuffers(compressedData), rawBytesCount)
|
|
56
|
-
removeMessageListener()
|
|
57
|
-
} else {
|
|
58
|
-
onWrote(compressedBytesCount)
|
|
59
|
-
}
|
|
60
|
-
} else if (data.id > _this.id) {
|
|
61
|
-
// Messages should be received in the same order as they are sent, so if we receive a
|
|
62
|
-
// message with an id superior to this Segment instance id, we know that another, more
|
|
63
|
-
// recent Segment instance is being used.
|
|
64
|
-
//
|
|
65
|
-
// In theory, a "flush" response should have been received at this point, so the listener
|
|
66
|
-
// should already have been removed. But if something goes wrong and we didn't receive a
|
|
67
|
-
// "flush" response, remove the listener to avoid any leak, and send a monitor message to
|
|
68
|
-
// help investigate the issue.
|
|
69
|
-
removeMessageListener()
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
var removeMessageListener = wokerListener.stop
|
|
73
|
-
// worker.addEventListener('message', listener)
|
|
74
|
-
|
|
75
|
-
this.write('{"records":[' + JSON.stringify(initialRecord))
|
|
76
22
|
}
|
|
77
|
-
Segment.prototype.addRecord = function (record) {
|
|
23
|
+
Segment.prototype.addRecord = function (record, callback) {
|
|
78
24
|
this.metadata.start = Math.min(this.metadata.start, record.timestamp)
|
|
79
25
|
this.metadata.end = Math.max(this.metadata.end, record.timestamp)
|
|
80
26
|
this.metadata.records_count += 1
|
|
81
|
-
replayStats.addRecord(this.metadata.view.id)
|
|
82
27
|
if (!this.metadata.has_full_snapshot) {
|
|
83
28
|
this.metadata.has_full_snapshot = record.type === RecordType.FullSnapshot
|
|
84
29
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.write('],' + JSON.stringify(this.metadata).slice(1) + '\n')
|
|
89
|
-
|
|
90
|
-
this.worker.postMessage({
|
|
91
|
-
action: 'reset',
|
|
92
|
-
streamId: STREAM_ID
|
|
93
|
-
})
|
|
94
|
-
this.flushReason = reason
|
|
30
|
+
replayStats.addRecord(this.metadata.view.id)
|
|
31
|
+
const prefix = this.metadata.records_count === 1 ? '{"records":[' : ','
|
|
32
|
+
this.encoder.write(prefix + JSON.stringify(record), callback)
|
|
95
33
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
34
|
+
Segment.prototype.flush = function (callback) {
|
|
35
|
+
if (this.metadata.records_count === 0) {
|
|
36
|
+
throw new Error('Empty segment flushed')
|
|
37
|
+
}
|
|
38
|
+
var _this = this
|
|
39
|
+
this.encoder.write(
|
|
40
|
+
'],' + JSON.stringify(this.metadata).slice(1) + '\n',
|
|
41
|
+
function () {
|
|
42
|
+
replayStats.addWroteData(
|
|
43
|
+
_this.metadata.view.id,
|
|
44
|
+
_this.encoder.getRawBytesCount()
|
|
45
|
+
)
|
|
46
|
+
callback(_this.metadata)
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
this.encoder.reset()
|
|
105
50
|
}
|
|
@@ -46,7 +46,7 @@ export function startSegmentCollection(
|
|
|
46
46
|
sessionManager,
|
|
47
47
|
viewContexts,
|
|
48
48
|
httpRequest,
|
|
49
|
-
|
|
49
|
+
encoder
|
|
50
50
|
) {
|
|
51
51
|
return doStartSegmentCollection(
|
|
52
52
|
lifeCycle,
|
|
@@ -54,7 +54,7 @@ export function startSegmentCollection(
|
|
|
54
54
|
return computeSegmentContext(configuration, sessionManager, viewContexts)
|
|
55
55
|
},
|
|
56
56
|
httpRequest,
|
|
57
|
-
|
|
57
|
+
encoder
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -68,7 +68,7 @@ export function doStartSegmentCollection(
|
|
|
68
68
|
lifeCycle,
|
|
69
69
|
getSegmentContext,
|
|
70
70
|
httpRequest,
|
|
71
|
-
|
|
71
|
+
encoder
|
|
72
72
|
) {
|
|
73
73
|
var state = {
|
|
74
74
|
status: SegmentCollectionStatus.WaitingForInitialRecord,
|
|
@@ -91,7 +91,19 @@ export function doStartSegmentCollection(
|
|
|
91
91
|
|
|
92
92
|
function flushSegment(flushReason) {
|
|
93
93
|
if (state.status === SegmentCollectionStatus.SegmentPending) {
|
|
94
|
-
state.segment.flush(
|
|
94
|
+
state.segment.flush(function (metadata) {
|
|
95
|
+
var payload = buildReplayPayload(
|
|
96
|
+
encoder.getEncodedBytes(),
|
|
97
|
+
metadata,
|
|
98
|
+
encoder.getRawBytesCount()
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
if (isPageExitReason(flushReason)) {
|
|
102
|
+
httpRequest.sendOnExit(payload)
|
|
103
|
+
} else {
|
|
104
|
+
httpRequest.send(payload)
|
|
105
|
+
}
|
|
106
|
+
})
|
|
95
107
|
clearTimeout(state.expirationTimeoutId)
|
|
96
108
|
}
|
|
97
109
|
|
|
@@ -107,58 +119,43 @@ export function doStartSegmentCollection(
|
|
|
107
119
|
}
|
|
108
120
|
}
|
|
109
121
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
122
|
+
return {
|
|
123
|
+
addRecord: function (record) {
|
|
124
|
+
if (state.status === SegmentCollectionStatus.Stopped) {
|
|
125
|
+
return
|
|
126
|
+
}
|
|
115
127
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
initialRecord,
|
|
121
|
-
function (compressedSegmentBytesCount) {
|
|
122
|
-
if (
|
|
123
|
-
!segment.flushReason &&
|
|
124
|
-
compressedSegmentBytesCount > SEGMENT_BYTES_LIMIT
|
|
125
|
-
) {
|
|
126
|
-
flushSegment('segment_bytes_limit')
|
|
128
|
+
if (state.status === SegmentCollectionStatus.WaitingForInitialRecord) {
|
|
129
|
+
var context = getSegmentContext()
|
|
130
|
+
if (!context) {
|
|
131
|
+
return
|
|
127
132
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
|
|
134
|
+
state = {
|
|
135
|
+
status: SegmentCollectionStatus.SegmentPending,
|
|
136
|
+
segment: new Segment(
|
|
137
|
+
encoder,
|
|
138
|
+
context,
|
|
139
|
+
state.nextSegmentCreationReason
|
|
140
|
+
),
|
|
141
|
+
expirationTimeoutId: setTimeout(function () {
|
|
142
|
+
flushSegment('segment_duration_limit')
|
|
143
|
+
}, SEGMENT_DURATION_LIMIT)
|
|
139
144
|
}
|
|
140
145
|
}
|
|
141
|
-
)
|
|
142
|
-
state = {
|
|
143
|
-
status: SegmentCollectionStatus.SegmentPending,
|
|
144
|
-
segment: segment,
|
|
145
|
-
expirationTimeoutId: setTimeout(function () {
|
|
146
|
-
flushSegment('segment_duration_limit')
|
|
147
|
-
}, SEGMENT_DURATION_LIMIT)
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
146
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
147
|
+
var segment = state.segment
|
|
148
|
+
|
|
149
|
+
segment.addRecord(record, function () {
|
|
150
|
+
if (
|
|
151
|
+
// the written segment is still pending
|
|
152
|
+
state.status === SegmentCollectionStatus.SegmentPending &&
|
|
153
|
+
state.segment === segment &&
|
|
154
|
+
encoder.getEncodedBytesCount() > SEGMENT_BYTES_LIMIT
|
|
155
|
+
) {
|
|
156
|
+
flushSegment('segment_bytes_limit')
|
|
157
|
+
}
|
|
158
|
+
})
|
|
162
159
|
},
|
|
163
160
|
|
|
164
161
|
stop: function () {
|
|
@@ -199,9 +196,6 @@ export function computeSegmentContext(
|
|
|
199
196
|
}
|
|
200
197
|
}
|
|
201
198
|
|
|
202
|
-
export function setSegmentBytesLimit(newSegmentBytesLimit) {
|
|
203
|
-
if (newSegmentBytesLimit === undefined) {
|
|
204
|
-
newSegmentBytesLimit = 60000
|
|
205
|
-
}
|
|
199
|
+
export function setSegmentBytesLimit(newSegmentBytesLimit = 60_000) {
|
|
206
200
|
SEGMENT_BYTES_LIMIT = newSegmentBytesLimit
|
|
207
201
|
}
|
|
@@ -13,19 +13,19 @@ export function startActionCollection(
|
|
|
13
13
|
lifeCycle,
|
|
14
14
|
domMutationObservable,
|
|
15
15
|
configuration,
|
|
16
|
-
|
|
16
|
+
pageStateHistory
|
|
17
17
|
) {
|
|
18
18
|
lifeCycle.subscribe(
|
|
19
19
|
LifeCycleEventType.AUTO_ACTION_COMPLETED,
|
|
20
20
|
function (action) {
|
|
21
21
|
lifeCycle.notify(
|
|
22
22
|
LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,
|
|
23
|
-
processAction(action,
|
|
23
|
+
processAction(action, pageStateHistory)
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
var actionContexts = { findActionId: noop }
|
|
28
|
+
var actionContexts = { findActionId: noop, findAllActionId: noop }
|
|
29
29
|
if (configuration.trackUserInteractions) {
|
|
30
30
|
actionContexts = trackClickActions(
|
|
31
31
|
lifeCycle,
|
|
@@ -40,14 +40,14 @@ export function startActionCollection(
|
|
|
40
40
|
LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,
|
|
41
41
|
extend(
|
|
42
42
|
{ savedCommonContext: savedCommonContext },
|
|
43
|
-
processAction(action,
|
|
43
|
+
processAction(action, pageStateHistory)
|
|
44
44
|
)
|
|
45
45
|
)
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function processAction(action,
|
|
50
|
+
function processAction(action, pageStateHistory) {
|
|
51
51
|
var autoActionProperties = isAutoAction(action)
|
|
52
52
|
? {
|
|
53
53
|
action: {
|
|
@@ -89,16 +89,16 @@ function processAction(action, foregroundContexts) {
|
|
|
89
89
|
type: action.type
|
|
90
90
|
},
|
|
91
91
|
date: action.startClocks.timeStamp,
|
|
92
|
-
type: RumEventType.ACTION
|
|
92
|
+
type: RumEventType.ACTION,
|
|
93
|
+
view: {
|
|
94
|
+
in_foreground: pageStateHistory.isInActivePageStateAt(
|
|
95
|
+
action.startClocks.relative
|
|
96
|
+
)
|
|
97
|
+
}
|
|
93
98
|
},
|
|
94
99
|
autoActionProperties
|
|
95
100
|
)
|
|
96
|
-
|
|
97
|
-
action.startClocks.relative
|
|
98
|
-
)
|
|
99
|
-
if (inForeground !== undefined) {
|
|
100
|
-
actionEvent.view = { in_foreground: inForeground }
|
|
101
|
-
}
|
|
101
|
+
|
|
102
102
|
return {
|
|
103
103
|
customerContext: customerContext,
|
|
104
104
|
rawRumEvent: actionEvent,
|
|
@@ -75,8 +75,11 @@ export function trackClickActions(
|
|
|
75
75
|
var actionContexts = {
|
|
76
76
|
findActionId: function (startTime) {
|
|
77
77
|
return history.find(startTime)
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
},
|
|
79
|
+
findAllActionId: function (startTime) {
|
|
80
|
+
return configuration.trackFrustrations
|
|
81
|
+
? history.findAll(startTime)
|
|
82
|
+
: history.find(startTime)
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
|
|
@@ -269,9 +272,9 @@ function newClick(
|
|
|
269
272
|
isChildEvent: function (event) {
|
|
270
273
|
return (
|
|
271
274
|
event.action !== undefined &&
|
|
272
|
-
(isArray(event.action.
|
|
273
|
-
? includes(event.action.
|
|
274
|
-
: event.action.
|
|
275
|
+
(isArray(event.action.ids)
|
|
276
|
+
? includes(event.action.ids, id)
|
|
277
|
+
: event.action.ids === id)
|
|
275
278
|
)
|
|
276
279
|
}
|
|
277
280
|
})
|
|
@@ -365,7 +368,6 @@ function newClick(
|
|
|
365
368
|
export function finalizeClicks(clicks, rageClick) {
|
|
366
369
|
var _computeFrustration = computeFrustration(clicks, rageClick)
|
|
367
370
|
var isRage = _computeFrustration.isRage
|
|
368
|
-
|
|
369
371
|
if (isRage) {
|
|
370
372
|
each(clicks, function (click) {
|
|
371
373
|
click.discard()
|
|
@@ -8,26 +8,31 @@ import {
|
|
|
8
8
|
Observable,
|
|
9
9
|
trackRuntimeError,
|
|
10
10
|
RumEventType,
|
|
11
|
-
LifeCycleEventType
|
|
11
|
+
LifeCycleEventType,
|
|
12
|
+
NonErrorPrefix
|
|
12
13
|
} from '@cloudcare/browser-core'
|
|
13
14
|
import { trackConsoleError } from './trackConsoleError'
|
|
14
15
|
import { trackReportError } from './trackReportError'
|
|
15
16
|
|
|
16
|
-
export function startErrorCollection(
|
|
17
|
+
export function startErrorCollection(
|
|
18
|
+
lifeCycle,
|
|
19
|
+
configuration,
|
|
20
|
+
pageStateHistory
|
|
21
|
+
) {
|
|
17
22
|
var errorObservable = new Observable()
|
|
18
23
|
|
|
19
24
|
trackConsoleError(errorObservable)
|
|
20
25
|
trackRuntimeError(errorObservable)
|
|
21
|
-
trackReportError(errorObservable)
|
|
26
|
+
trackReportError(configuration, errorObservable)
|
|
22
27
|
|
|
23
28
|
errorObservable.subscribe(function (error) {
|
|
24
29
|
lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })
|
|
25
30
|
})
|
|
26
31
|
|
|
27
|
-
return doStartErrorCollection(lifeCycle,
|
|
32
|
+
return doStartErrorCollection(lifeCycle, pageStateHistory)
|
|
28
33
|
}
|
|
29
34
|
|
|
30
|
-
export function doStartErrorCollection(lifeCycle,
|
|
35
|
+
export function doStartErrorCollection(lifeCycle, pageStateHistory) {
|
|
31
36
|
lifeCycle.subscribe(LifeCycleEventType.RAW_ERROR_COLLECTED, function (error) {
|
|
32
37
|
lifeCycle.notify(
|
|
33
38
|
LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,
|
|
@@ -36,7 +41,7 @@ export function doStartErrorCollection(lifeCycle, foregroundContexts) {
|
|
|
36
41
|
customerContext: error.customerContext,
|
|
37
42
|
savedCommonContext: error.savedCommonContext
|
|
38
43
|
},
|
|
39
|
-
processError(error.error,
|
|
44
|
+
processError(error.error, pageStateHistory)
|
|
40
45
|
)
|
|
41
46
|
)
|
|
42
47
|
})
|
|
@@ -51,7 +56,7 @@ export function doStartErrorCollection(lifeCycle, foregroundContexts) {
|
|
|
51
56
|
originalError: error,
|
|
52
57
|
handlingStack: providedError.handlingStack,
|
|
53
58
|
startClocks: providedError.startClocks,
|
|
54
|
-
nonErrorPrefix:
|
|
59
|
+
nonErrorPrefix: NonErrorPrefix.PROVIDED,
|
|
55
60
|
source: ErrorSource.CUSTOM,
|
|
56
61
|
handling: ErrorHandling.HANDLED
|
|
57
62
|
})
|
|
@@ -64,7 +69,7 @@ export function doStartErrorCollection(lifeCycle, foregroundContexts) {
|
|
|
64
69
|
}
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
function processError(error,
|
|
72
|
+
function processError(error, pageStateHistory) {
|
|
68
73
|
var rawRumEvent = {
|
|
69
74
|
date: error.startClocks.timeStamp,
|
|
70
75
|
error: {
|
|
@@ -78,14 +83,14 @@ function processError(error, foregroundContexts) {
|
|
|
78
83
|
causes: error.causes,
|
|
79
84
|
source_type: 'browser'
|
|
80
85
|
},
|
|
81
|
-
type: RumEventType.ERROR
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
rawRumEvent.view = { in_foreground: inForeground }
|
|
86
|
+
type: RumEventType.ERROR,
|
|
87
|
+
view: {
|
|
88
|
+
in_foreground: pageStateHistory.isInActivePageStateAt(
|
|
89
|
+
error.startClocks.relative
|
|
90
|
+
)
|
|
91
|
+
}
|
|
88
92
|
}
|
|
93
|
+
|
|
89
94
|
return {
|
|
90
95
|
rawRumEvent: rawRumEvent,
|
|
91
96
|
startTime: error.startClocks.relative,
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
clocksNow,
|
|
3
|
+
ErrorHandling,
|
|
4
|
+
ErrorSource,
|
|
5
|
+
initReportObservable,
|
|
6
|
+
RawReportType
|
|
7
|
+
} from '@cloudcare/browser-core'
|
|
2
8
|
|
|
3
|
-
export function trackReportError(errorObservable) {
|
|
4
|
-
var subscription = initReportObservable(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
)
|
|
9
|
+
export function trackReportError(configuration, errorObservable) {
|
|
10
|
+
var subscription = initReportObservable(configuration, [
|
|
11
|
+
(RawReportType.cspViolation, RawReportType.intervention)
|
|
12
|
+
]).subscribe(function (reportError) {
|
|
13
|
+
errorObservable.notify({
|
|
14
|
+
startClocks: clocksNow(),
|
|
15
|
+
message: reportError.message,
|
|
16
|
+
stack: reportError.stack,
|
|
17
|
+
type: reportError.subtype,
|
|
18
|
+
source: ErrorSource.REPORT,
|
|
19
|
+
handling: ErrorHandling.UNHANDLED
|
|
20
|
+
})
|
|
21
|
+
})
|
|
16
22
|
|
|
17
23
|
return {
|
|
18
|
-
stop: function(){
|
|
24
|
+
stop: function () {
|
|
19
25
|
subscription.unsubscribe()
|
|
20
|
-
}
|
|
26
|
+
}
|
|
21
27
|
}
|
|
22
28
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* performance.interactionCount polyfill
|
|
3
|
+
*
|
|
4
|
+
* The interactionCount is an integer which counts the total number of distinct user interactions,
|
|
5
|
+
* for which there was a unique interactionId.
|
|
6
|
+
*
|
|
7
|
+
* The interactionCount polyfill is an estimate based on a convention specific to Chrome. Cf: https://github.com/GoogleChrome/web-vitals/pull/213
|
|
8
|
+
* This is currently not an issue as the polyfill is only used for INP which is currently only supported on Chrome.
|
|
9
|
+
* Hopefully when/if other browsers will support INP, they will also implement performance.interactionCount at the same time, so we won't need that polyfill.
|
|
10
|
+
*
|
|
11
|
+
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/main/src/lib/polyfills/interactionCountPolyfill.ts
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { monitor } from '@cloudcare/browser-core'
|
|
15
|
+
|
|
16
|
+
var observer
|
|
17
|
+
|
|
18
|
+
var interactionCountEstimate = 0
|
|
19
|
+
var minKnownInteractionId = Infinity
|
|
20
|
+
var maxKnownInteractionId = 0
|
|
21
|
+
|
|
22
|
+
export function initInteractionCountPolyfill() {
|
|
23
|
+
if ('interactionCount' in performance || observer) {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
observer = new window.PerformanceObserver(
|
|
28
|
+
monitor(function (entries) {
|
|
29
|
+
entries.getEntries().forEach(function (e) {
|
|
30
|
+
const entry = e
|
|
31
|
+
|
|
32
|
+
if (entry.interactionId) {
|
|
33
|
+
minKnownInteractionId = Math.min(
|
|
34
|
+
minKnownInteractionId,
|
|
35
|
+
entry.interactionId
|
|
36
|
+
)
|
|
37
|
+
maxKnownInteractionId = Math.max(
|
|
38
|
+
maxKnownInteractionId,
|
|
39
|
+
entry.interactionId
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
interactionCountEstimate =
|
|
43
|
+
(maxKnownInteractionId - minKnownInteractionId) / 7 + 1
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
)
|
|
48
|
+
observer.observe({ type: 'event', buffered: true, durationThreshold: 0 })
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Returns the `interactionCount` value using the native API (if available)
|
|
53
|
+
* or the polyfill estimate in this module.
|
|
54
|
+
*/
|
|
55
|
+
export var getInteractionCount = function () {
|
|
56
|
+
return observer
|
|
57
|
+
? interactionCountEstimate
|
|
58
|
+
: window.performance.interactionCount || 0
|
|
59
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { noop } from '@cloudcare/browser-core'
|
|
2
|
+
|
|
3
|
+
import { computeScrollValues, trackScrollMetrics } from './trackScrollMetrics'
|
|
4
|
+
import { trackLoadingTime } from './trackLoadingTime'
|
|
5
|
+
import {
|
|
6
|
+
isLayoutShiftSupported,
|
|
7
|
+
trackCumulativeLayoutShift
|
|
8
|
+
} from './trackCumulativeLayoutShift'
|
|
9
|
+
import { trackInteractionToNextPaint } from './trackInteractionToNextPaint'
|
|
10
|
+
|
|
11
|
+
export function trackCommonViewMetrics(
|
|
12
|
+
lifeCycle,
|
|
13
|
+
domMutationObservable,
|
|
14
|
+
configuration,
|
|
15
|
+
scheduleViewUpdate,
|
|
16
|
+
loadingType,
|
|
17
|
+
viewStart
|
|
18
|
+
) {
|
|
19
|
+
var commonViewMetrics = {}
|
|
20
|
+
var _trackLoadingTime = trackLoadingTime(
|
|
21
|
+
lifeCycle,
|
|
22
|
+
domMutationObservable,
|
|
23
|
+
configuration,
|
|
24
|
+
loadingType,
|
|
25
|
+
viewStart,
|
|
26
|
+
function (newLoadingTime) {
|
|
27
|
+
commonViewMetrics.loadingTime = newLoadingTime
|
|
28
|
+
|
|
29
|
+
// We compute scroll metrics at loading time to ensure we have scroll data when loading the view initially
|
|
30
|
+
// This is to ensure that we have the depth data even if the user didn't scroll or if the view is not scrollable.
|
|
31
|
+
var _computeScrollValues = computeScrollValues()
|
|
32
|
+
|
|
33
|
+
commonViewMetrics.scroll = {
|
|
34
|
+
maxDepth: _computeScrollValues.scrollDepth,
|
|
35
|
+
maxDepthScrollHeight: _computeScrollValues.scrollHeight,
|
|
36
|
+
maxDepthTime: newLoadingTime,
|
|
37
|
+
maxDepthScrollTop: _computeScrollValues.scrollTop
|
|
38
|
+
}
|
|
39
|
+
scheduleViewUpdate()
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
var stopLoadingTimeTracking = _trackLoadingTime.stop
|
|
43
|
+
var setLoadEvent = _trackLoadingTime.setLoadEvent
|
|
44
|
+
var _trackScrollMetrics = trackScrollMetrics(
|
|
45
|
+
viewStart,
|
|
46
|
+
function (newScrollMetrics) {
|
|
47
|
+
commonViewMetrics.scroll = newScrollMetrics
|
|
48
|
+
},
|
|
49
|
+
computeScrollValues
|
|
50
|
+
)
|
|
51
|
+
var stopScrollMetricsTracking = _trackScrollMetrics.stop
|
|
52
|
+
var stopCLSTracking
|
|
53
|
+
if (isLayoutShiftSupported()) {
|
|
54
|
+
commonViewMetrics.cumulativeLayoutShift = 0
|
|
55
|
+
var _trackCumulativeLayoutShift = trackCumulativeLayoutShift(
|
|
56
|
+
lifeCycle,
|
|
57
|
+
function (cumulativeLayoutShift) {
|
|
58
|
+
commonViewMetrics.cumulativeLayoutShift = cumulativeLayoutShift
|
|
59
|
+
scheduleViewUpdate()
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
stopCLSTracking = _trackCumulativeLayoutShift.stop
|
|
63
|
+
} else {
|
|
64
|
+
stopCLSTracking = noop
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var _trackInteractionToNextPaint = trackInteractionToNextPaint(
|
|
68
|
+
loadingType,
|
|
69
|
+
lifeCycle
|
|
70
|
+
)
|
|
71
|
+
var stopINPTracking = _trackInteractionToNextPaint.stop
|
|
72
|
+
var getInteractionToNextPaint =
|
|
73
|
+
_trackInteractionToNextPaint.getInteractionToNextPaint
|
|
74
|
+
return {
|
|
75
|
+
stop: function () {
|
|
76
|
+
stopLoadingTimeTracking()
|
|
77
|
+
stopCLSTracking()
|
|
78
|
+
stopScrollMetricsTracking()
|
|
79
|
+
stopINPTracking()
|
|
80
|
+
},
|
|
81
|
+
setLoadEvent: setLoadEvent,
|
|
82
|
+
getCommonViewMetrics: function () {
|
|
83
|
+
commonViewMetrics.interactionToNextPaint = getInteractionToNextPaint()
|
|
84
|
+
return commonViewMetrics
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|