@kubesense/kubesense-browser-rum-core 1.8.0 → 2.0.0-beta.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/LICENSE +1 -1
- package/cjs/boot/preStartRum.d.ts +4 -3
- package/cjs/boot/preStartRum.js +229 -204
- package/cjs/boot/preStartRum.js.map +1 -1
- package/cjs/boot/rumPublicApi.d.ts +190 -51
- package/cjs/boot/rumPublicApi.js +267 -164
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRum.d.ts +42 -31
- package/cjs/boot/startRum.js +157 -150
- package/cjs/boot/startRum.js.map +1 -1
- package/cjs/browser/cookieObservable.d.ts +1 -5
- package/cjs/browser/cookieObservable.js +30 -34
- package/cjs/browser/cookieObservable.js.map +1 -1
- package/cjs/browser/domMutationObservable.d.ts +3 -3
- package/cjs/browser/domMutationObservable.js +29 -53
- package/cjs/browser/domMutationObservable.js.map +1 -1
- package/cjs/browser/htmlDomUtils.d.ts +5 -0
- package/cjs/browser/htmlDomUtils.js +38 -28
- package/cjs/browser/htmlDomUtils.js.map +1 -1
- package/cjs/browser/locationChangeObservable.d.ts +1 -2
- package/cjs/browser/locationChangeObservable.js +44 -45
- package/cjs/browser/locationChangeObservable.js.map +1 -1
- package/cjs/browser/performanceObservable.d.ts +4 -4
- package/cjs/browser/performanceObservable.js +50 -114
- package/cjs/browser/performanceObservable.js.map +1 -1
- package/cjs/browser/performanceUtils.d.ts +13 -1
- package/cjs/browser/performanceUtils.js +63 -37
- package/cjs/browser/performanceUtils.js.map +1 -1
- package/cjs/browser/scroll.js +17 -28
- package/cjs/browser/scroll.js.map +1 -1
- package/cjs/browser/viewportObservable.d.ts +2 -3
- package/cjs/browser/viewportObservable.js +29 -31
- package/cjs/browser/viewportObservable.js.map +1 -1
- package/cjs/browser/windowOpenObservable.js +11 -7
- package/cjs/browser/windowOpenObservable.js.map +1 -1
- package/cjs/domain/action/actionCollection.d.ts +11 -12
- package/cjs/domain/action/actionCollection.js +82 -89
- package/cjs/domain/action/actionCollection.js.map +1 -1
- package/cjs/domain/action/actionNameConstants.js +10 -9
- package/cjs/domain/action/actionNameConstants.js.map +1 -1
- package/cjs/domain/action/clickChain.js +51 -54
- package/cjs/domain/action/clickChain.js.map +1 -1
- package/cjs/domain/action/computeFrustration.js +30 -62
- package/cjs/domain/action/computeFrustration.js.map +1 -1
- package/cjs/domain/action/frustrationIgnore.d.ts +9 -0
- package/cjs/domain/action/frustrationIgnore.js +32 -0
- package/cjs/domain/action/frustrationIgnore.js.map +1 -0
- package/cjs/domain/action/getActionNameFromElement.js +141 -217
- package/cjs/domain/action/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/action/interactionSelectorCache.d.ts +1 -1
- package/cjs/domain/action/interactionSelectorCache.js +17 -18
- package/cjs/domain/action/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/action/isActionChildEvent.d.ts +2 -0
- package/cjs/domain/action/isActionChildEvent.js +8 -0
- package/cjs/domain/action/isActionChildEvent.js.map +1 -0
- package/cjs/domain/action/listenActionEvents.d.ts +2 -3
- package/cjs/domain/action/listenActionEvents.js +51 -55
- package/cjs/domain/action/listenActionEvents.js.map +1 -1
- package/cjs/domain/action/trackClickActions.d.ts +15 -21
- package/cjs/domain/action/trackClickActions.js +188 -226
- package/cjs/domain/action/trackClickActions.js.map +1 -1
- package/cjs/domain/action/trackManualActions.d.ts +45 -0
- package/cjs/domain/action/trackManualActions.js +48 -0
- package/cjs/domain/action/trackManualActions.js.map +1 -0
- package/cjs/domain/assembly.d.ts +1 -2
- package/cjs/domain/assembly.js +80 -95
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration/configuration.d.ts +575 -81
- package/cjs/domain/configuration/configuration.js +464 -199
- package/cjs/domain/configuration/configuration.js.map +1 -1
- package/cjs/domain/configuration/index.d.ts +1 -0
- package/cjs/domain/configuration/index.js +27 -21
- package/cjs/domain/configuration/jsonPathParser.js +125 -139
- package/cjs/domain/configuration/jsonPathParser.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.d.ts +18 -5
- package/cjs/domain/configuration/remoteConfiguration.js +268 -226
- package/cjs/domain/configuration/remoteConfiguration.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.types.d.ts +49 -0
- package/cjs/domain/configuration/remoteConfigurationCache.d.ts +42 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js +95 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js.map +1 -0
- package/cjs/domain/configuration/remoteSdkConfiguration.d.ts +11 -2
- package/cjs/domain/configuration/remoteSdkConfiguration.js +185 -117
- package/cjs/domain/configuration/remoteSdkConfiguration.js.map +1 -1
- package/cjs/domain/configuration/sessionReplayRoutes.d.ts +1 -6
- package/cjs/domain/configuration/sessionReplayRoutes.js +20 -63
- package/cjs/domain/configuration/sessionReplayRoutes.js.map +1 -1
- package/cjs/domain/contexts/ciVisibilityContext.d.ts +2 -4
- package/cjs/domain/contexts/ciVisibilityContext.js +36 -32
- package/cjs/domain/contexts/ciVisibilityContext.js.map +1 -1
- package/cjs/domain/contexts/connectivityContext.d.ts +2 -2
- package/cjs/domain/contexts/connectivityContext.js +10 -9
- package/cjs/domain/contexts/connectivityContext.js.map +1 -1
- package/cjs/domain/contexts/defaultContext.d.ts +3 -3
- package/cjs/domain/contexts/defaultContext.js +28 -32
- package/cjs/domain/contexts/defaultContext.js.map +1 -1
- package/cjs/domain/contexts/displayContext.d.ts +2 -3
- package/cjs/domain/contexts/displayContext.js +22 -26
- package/cjs/domain/contexts/displayContext.js.map +1 -1
- package/cjs/domain/contexts/featureFlagContext.d.ts +2 -2
- package/cjs/domain/contexts/featureFlagContext.js +38 -50
- package/cjs/domain/contexts/featureFlagContext.js.map +1 -1
- package/cjs/domain/contexts/internalContext.d.ts +2 -3
- package/cjs/domain/contexts/internalContext.js +26 -22
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/contexts/pageStateHistory.d.ts +3 -4
- package/cjs/domain/contexts/pageStateHistory.js +76 -96
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
- package/cjs/domain/contexts/sessionContext.d.ts +9 -3
- package/cjs/domain/contexts/sessionContext.js +31 -45
- package/cjs/domain/contexts/sessionContext.js.map +1 -1
- package/cjs/domain/contexts/sourceCodeMfeContext.d.ts +10 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js +35 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js.map +1 -0
- package/cjs/domain/contexts/syntheticsContext.d.ts +2 -2
- package/cjs/domain/contexts/syntheticsContext.js +19 -23
- package/cjs/domain/contexts/syntheticsContext.js.map +1 -1
- package/cjs/domain/contexts/trackingConsentContext.d.ts +2 -2
- package/cjs/domain/contexts/trackingConsentContext.js +10 -12
- package/cjs/domain/contexts/trackingConsentContext.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.d.ts +4 -3
- package/cjs/domain/contexts/urlContexts.js +65 -61
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/userAgentDataContext.d.ts +2 -2
- package/cjs/domain/contexts/userAgentDataContext.js +20 -29
- package/cjs/domain/contexts/userAgentDataContext.js.map +1 -1
- package/cjs/domain/contexts/viewHistory.d.ts +5 -2
- package/cjs/domain/contexts/viewHistory.js +41 -45
- package/cjs/domain/contexts/viewHistory.js.map +1 -1
- package/cjs/domain/discardNegativeDuration.d.ts +1 -1
- package/cjs/domain/discardNegativeDuration.js +6 -5
- package/cjs/domain/discardNegativeDuration.js.map +1 -1
- package/cjs/domain/error/errorCollection.d.ts +3 -3
- package/cjs/domain/error/errorCollection.js +67 -68
- package/cjs/domain/error/errorCollection.js.map +1 -1
- package/cjs/domain/error/trackReportError.d.ts +1 -2
- package/cjs/domain/error/trackReportError.js +10 -14
- package/cjs/domain/error/trackReportError.js.map +1 -1
- package/cjs/domain/event/eventCollection.d.ts +2 -1
- package/cjs/domain/event/eventCollection.js +21 -22
- package/cjs/domain/event/eventCollection.js.map +1 -1
- package/cjs/domain/eventTracker.d.ts +37 -0
- package/cjs/domain/eventTracker.js +94 -0
- package/cjs/domain/eventTracker.js.map +1 -0
- package/cjs/domain/extractRegexMatch.d.ts +5 -0
- package/cjs/domain/extractRegexMatch.js +16 -0
- package/cjs/domain/extractRegexMatch.js.map +1 -0
- package/cjs/domain/getComposedPathSelector.d.ts +22 -0
- package/cjs/domain/getComposedPathSelector.js +95 -0
- package/cjs/domain/getComposedPathSelector.js.map +1 -0
- package/cjs/domain/getSelectorFromElement.d.ts +18 -6
- package/cjs/domain/getSelectorFromElement.js +199 -191
- package/cjs/domain/getSelectorFromElement.js.map +1 -1
- package/cjs/domain/getSessionReplayUrl.d.ts +2 -2
- package/cjs/domain/getSessionReplayUrl.js +17 -30
- package/cjs/domain/getSessionReplayUrl.js.map +1 -1
- package/cjs/domain/hooks.d.ts +26 -17
- package/cjs/domain/hooks.js +12 -5
- package/cjs/domain/hooks.js.map +1 -1
- package/cjs/domain/lifeCycle.d.ts +26 -12
- package/cjs/domain/lifeCycle.js +28 -5
- package/cjs/domain/lifeCycle.js.map +1 -1
- package/cjs/domain/limitModification.d.ts +5 -1
- package/cjs/domain/limitModification.js +32 -36
- package/cjs/domain/limitModification.js.map +1 -1
- package/cjs/domain/longTask/longTaskCollection.d.ts +0 -13
- package/cjs/domain/longTask/longTaskCollection.js +75 -87
- package/cjs/domain/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/plugins.d.ts +37 -14
- package/cjs/domain/plugins.js +22 -13
- package/cjs/domain/plugins.js.map +1 -1
- package/cjs/domain/privacy.d.ts +6 -1
- package/cjs/domain/privacy.js +143 -286
- package/cjs/domain/privacy.js.map +1 -1
- package/cjs/domain/privacyConstants.js +43 -34
- package/cjs/domain/privacyConstants.js.map +1 -1
- package/cjs/domain/requestCollection.d.ts +6 -5
- package/cjs/domain/requestCollection.js +82 -105
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/resource/graphql.d.ts +1 -1
- package/cjs/domain/resource/graphql.js +85 -86
- package/cjs/domain/resource/graphql.js.map +1 -1
- package/cjs/domain/resource/requestRegistry.js +30 -38
- package/cjs/domain/resource/requestRegistry.js.map +1 -1
- package/cjs/domain/resource/resourceCollection.d.ts +5 -3
- package/cjs/domain/resource/resourceCollection.js +241 -175
- package/cjs/domain/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/resource/resourceUtils.d.ts +13 -13
- package/cjs/domain/resource/resourceUtils.js +323 -221
- package/cjs/domain/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/resource/trackManualResources.d.ts +55 -0
- package/cjs/domain/resource/trackManualResources.js +53 -0
- package/cjs/domain/resource/trackManualResources.js.map +1 -0
- package/cjs/domain/resource/webSocketCollection.d.ts +46 -0
- package/cjs/domain/resource/webSocketCollection.js +163 -0
- package/cjs/domain/resource/webSocketCollection.js.map +1 -0
- package/cjs/domain/session/session.types.d.ts +4 -0
- package/cjs/domain/sessionReplayState.d.ts +8 -0
- package/cjs/domain/sessionReplayState.js +19 -0
- package/cjs/domain/sessionReplayState.js.map +1 -0
- package/cjs/domain/startCustomerDataTelemetry.js +39 -43
- package/cjs/domain/startCustomerDataTelemetry.js.map +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.d.ts +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.js +42 -63
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/cjs/domain/tracing/identifier.js +13 -46
- package/cjs/domain/tracing/identifier.js.map +1 -1
- package/cjs/domain/tracing/tracer.d.ts +2 -5
- package/cjs/domain/tracing/tracer.js +110 -150
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/trackEventCounts.js +43 -48
- package/cjs/domain/trackEventCounts.js.map +1 -1
- package/cjs/domain/view/bfCacheSupport.d.ts +1 -2
- package/cjs/domain/view/bfCacheSupport.js +10 -11
- package/cjs/domain/view/bfCacheSupport.js.map +1 -1
- package/cjs/domain/view/trackViewEventCounts.js +14 -13
- package/cjs/domain/view/trackViewEventCounts.js.map +1 -1
- package/cjs/domain/view/trackViews.d.ts +8 -2
- package/cjs/domain/view/trackViews.js +221 -270
- package/cjs/domain/view/trackViews.js.map +1 -1
- package/cjs/domain/view/viewCollection.d.ts +4 -3
- package/cjs/domain/view/viewCollection.js +124 -148
- package/cjs/domain/view/viewCollection.js.map +1 -1
- package/cjs/domain/view/viewDiff.d.ts +22 -0
- package/cjs/domain/view/viewDiff.js +62 -0
- package/cjs/domain/view/viewDiff.js.map +1 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js +20 -22
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -1
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.d.ts +1 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js +35 -33
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js +14 -13
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +4 -2
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js +51 -34
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js +106 -122
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js +26 -34
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstHidden.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js +31 -31
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +1 -3
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js +33 -38
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +10 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js +202 -144
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +6 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js +65 -55
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.d.ts +2 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js +42 -46
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js +28 -36
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.d.ts +3 -4
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js +63 -72
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -1
- package/cjs/domain/vital/vitalCollection.d.ts +44 -20
- package/cjs/domain/vital/vitalCollection.js +81 -109
- package/cjs/domain/vital/vitalCollection.js.map +1 -1
- package/cjs/domain/waitPageActivityEnd.d.ts +1 -4
- package/cjs/domain/waitPageActivityEnd.js +99 -119
- package/cjs/domain/waitPageActivityEnd.js.map +1 -1
- package/cjs/domainContext.types.d.ts +21 -13
- package/cjs/index.d.ts +11 -10
- package/cjs/index.js +84 -62
- package/cjs/rawRumEvent.types.d.ts +79 -13
- package/cjs/rawRumEvent.types.js +40 -27
- package/cjs/rawRumEvent.types.js.map +1 -1
- package/cjs/rumEvent.types.d.ts +906 -669
- package/cjs/transport/formDataTransport.js +43 -41
- package/cjs/transport/formDataTransport.js.map +1 -1
- package/cjs/transport/startRumBatch.d.ts +27 -3
- package/cjs/transport/startRumBatch.js +132 -31
- package/cjs/transport/startRumBatch.js.map +1 -1
- package/cjs/transport/startRumEventBridge.js +10 -8
- package/cjs/transport/startRumEventBridge.js.map +1 -1
- package/esm/boot/preStartRum.mjs +233 -0
- package/esm/boot/preStartRum.mjs.map +1 -0
- package/esm/boot/rumPublicApi.mjs +271 -0
- package/esm/boot/rumPublicApi.mjs.map +1 -0
- package/esm/boot/startRum.mjs +159 -0
- package/esm/boot/startRum.mjs.map +1 -0
- package/esm/browser/cookieObservable.mjs +34 -0
- package/esm/browser/cookieObservable.mjs.map +1 -0
- package/esm/browser/domMutationObservable.mjs +33 -0
- package/esm/browser/domMutationObservable.mjs.map +1 -0
- package/esm/browser/htmlDomUtils.mjs +48 -0
- package/esm/browser/htmlDomUtils.mjs.map +1 -0
- package/esm/browser/locationChangeObservable.mjs +50 -0
- package/esm/browser/locationChangeObservable.mjs.map +1 -0
- package/esm/browser/performanceObservable.mjs +60 -0
- package/esm/browser/performanceObservable.mjs.map +1 -0
- package/esm/browser/performanceUtils.mjs +64 -0
- package/esm/browser/performanceUtils.mjs.map +1 -0
- package/esm/browser/scroll.mjs +21 -0
- package/esm/browser/scroll.mjs.map +1 -0
- package/esm/browser/viewportObservable.mjs +33 -0
- package/esm/browser/viewportObservable.mjs.map +1 -0
- package/esm/browser/windowOpenObservable.mjs +14 -0
- package/esm/browser/windowOpenObservable.mjs.map +1 -0
- package/esm/domain/action/actionCollection.mjs +89 -0
- package/esm/domain/action/actionCollection.mjs.map +1 -0
- package/esm/domain/action/actionNameConstants.mjs +11 -0
- package/esm/domain/action/actionNameConstants.mjs.map +1 -0
- package/esm/domain/action/clickChain.mjs +57 -0
- package/esm/domain/action/clickChain.mjs.map +1 -0
- package/esm/domain/action/computeFrustration.mjs +36 -0
- package/esm/domain/action/computeFrustration.mjs.map +1 -0
- package/esm/domain/action/frustrationIgnore.mjs +31 -0
- package/esm/domain/action/frustrationIgnore.mjs.map +1 -0
- package/esm/domain/action/getActionNameFromElement.mjs +163 -0
- package/esm/domain/action/getActionNameFromElement.mjs.map +1 -0
- package/esm/domain/action/interactionSelectorCache.mjs +19 -0
- package/esm/domain/action/interactionSelectorCache.mjs.map +1 -0
- package/esm/domain/action/isActionChildEvent.mjs +8 -0
- package/esm/domain/action/isActionChildEvent.mjs.map +1 -0
- package/esm/domain/action/listenActionEvents.mjs +57 -0
- package/esm/domain/action/listenActionEvents.mjs.map +1 -0
- package/esm/domain/action/trackClickActions.mjs +198 -0
- package/esm/domain/action/trackClickActions.mjs.map +1 -0
- package/esm/domain/action/trackManualActions.mjs +48 -0
- package/esm/domain/action/trackManualActions.mjs.map +1 -0
- package/esm/domain/assembly.mjs +87 -0
- package/esm/domain/assembly.mjs.map +1 -0
- package/esm/domain/configuration/configuration.mjs +474 -0
- package/esm/domain/configuration/configuration.mjs.map +1 -0
- package/esm/domain/configuration/index.mjs +6 -0
- package/esm/domain/configuration/jsonPathParser.mjs +145 -0
- package/esm/domain/configuration/jsonPathParser.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.mjs +279 -0
- package/esm/domain/configuration/remoteConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs +92 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs.map +1 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs +208 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs +26 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs.map +1 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs +37 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs.map +1 -0
- package/esm/domain/contexts/connectivityContext.mjs +12 -0
- package/esm/domain/contexts/connectivityContext.mjs.map +1 -0
- package/esm/domain/contexts/defaultContext.mjs +30 -0
- package/esm/domain/contexts/defaultContext.mjs.map +1 -0
- package/esm/domain/contexts/displayContext.mjs +24 -0
- package/esm/domain/contexts/displayContext.mjs.map +1 -0
- package/esm/domain/contexts/featureFlagContext.mjs +40 -0
- package/esm/domain/contexts/featureFlagContext.mjs.map +1 -0
- package/esm/domain/contexts/internalContext.mjs +30 -0
- package/esm/domain/contexts/internalContext.mjs.map +1 -0
- package/esm/domain/contexts/pageStateHistory.mjs +82 -0
- package/esm/domain/contexts/pageStateHistory.mjs.map +1 -0
- package/esm/domain/contexts/sessionContext.mjs +33 -0
- package/esm/domain/contexts/sessionContext.mjs.map +1 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs +35 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs.map +1 -0
- package/esm/domain/contexts/syntheticsContext.mjs +21 -0
- package/esm/domain/contexts/syntheticsContext.mjs.map +1 -0
- package/esm/domain/contexts/trackingConsentContext.mjs +12 -0
- package/esm/domain/contexts/trackingConsentContext.mjs.map +1 -0
- package/esm/domain/contexts/urlContexts.mjs +67 -0
- package/esm/domain/contexts/urlContexts.mjs.map +1 -0
- package/esm/domain/contexts/userAgentDataContext.mjs +22 -0
- package/esm/domain/contexts/userAgentDataContext.mjs.map +1 -0
- package/esm/domain/contexts/viewHistory.mjs +43 -0
- package/esm/domain/contexts/viewHistory.mjs.map +1 -0
- package/esm/domain/discardNegativeDuration.mjs +9 -0
- package/esm/domain/discardNegativeDuration.mjs.map +1 -0
- package/esm/domain/error/errorCollection.mjs +72 -0
- package/esm/domain/error/errorCollection.mjs.map +1 -0
- package/esm/domain/error/trackReportError.mjs +12 -0
- package/esm/domain/error/trackReportError.mjs.map +1 -0
- package/esm/domain/event/eventCollection.mjs +26 -0
- package/esm/domain/event/eventCollection.mjs.map +1 -0
- package/esm/domain/eventTracker.mjs +93 -0
- package/esm/domain/eventTracker.mjs.map +1 -0
- package/esm/domain/extractRegexMatch.mjs +16 -0
- package/esm/domain/extractRegexMatch.mjs.map +1 -0
- package/esm/domain/getComposedPathSelector.mjs +93 -0
- package/esm/domain/getComposedPathSelector.mjs.map +1 -0
- package/esm/domain/getSelectorFromElement.mjs +218 -0
- package/esm/domain/getSelectorFromElement.mjs.map +1 -0
- package/esm/domain/getSessionReplayUrl.mjs +20 -0
- package/esm/domain/getSessionReplayUrl.mjs.map +1 -0
- package/esm/domain/hooks.mjs +13 -0
- package/esm/domain/hooks.mjs.map +1 -0
- package/esm/domain/lifeCycle.mjs +28 -0
- package/esm/domain/lifeCycle.mjs.map +1 -0
- package/esm/domain/limitModification.mjs +42 -0
- package/esm/domain/limitModification.mjs.map +1 -0
- package/esm/domain/longTask/longTaskCollection.mjs +79 -0
- package/esm/domain/longTask/longTaskCollection.mjs.map +1 -0
- package/esm/domain/plugins.mjs +23 -0
- package/esm/domain/plugins.mjs.map +1 -0
- package/esm/domain/privacy.mjs +161 -0
- package/esm/domain/privacy.mjs.map +1 -0
- package/esm/domain/privacyConstants.mjs +36 -0
- package/esm/domain/privacyConstants.mjs.map +1 -0
- package/esm/domain/requestCollection.mjs +86 -0
- package/esm/domain/requestCollection.mjs.map +1 -0
- package/esm/domain/resource/graphql.mjs +93 -0
- package/esm/domain/resource/graphql.mjs.map +1 -0
- package/esm/domain/resource/requestRegistry.mjs +32 -0
- package/esm/domain/resource/requestRegistry.mjs.map +1 -0
- package/esm/domain/resource/resourceCollection.mjs +256 -0
- package/esm/domain/resource/resourceCollection.mjs.map +1 -0
- package/esm/domain/resource/resourceUtils.mjs +349 -0
- package/esm/domain/resource/resourceUtils.mjs.map +1 -0
- package/esm/domain/resource/trackManualResources.mjs +53 -0
- package/esm/domain/resource/trackManualResources.mjs.map +1 -0
- package/esm/domain/resource/webSocketCollection.mjs +160 -0
- package/esm/domain/resource/webSocketCollection.mjs.map +1 -0
- package/esm/domain/sessionReplayState.mjs +18 -0
- package/esm/domain/sessionReplayState.mjs.map +1 -0
- package/esm/domain/startCustomerDataTelemetry.mjs +51 -0
- package/esm/domain/startCustomerDataTelemetry.mjs.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs +50 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs.map +1 -0
- package/esm/domain/tracing/identifier.mjs +20 -0
- package/esm/domain/tracing/identifier.mjs.map +1 -0
- package/esm/domain/tracing/tracer.mjs +120 -0
- package/esm/domain/tracing/tracer.mjs.map +1 -0
- package/esm/domain/trackEventCounts.mjs +45 -0
- package/esm/domain/trackEventCounts.mjs.map +1 -0
- package/esm/domain/view/bfCacheSupport.mjs +12 -0
- package/esm/domain/view/bfCacheSupport.mjs.map +1 -0
- package/esm/domain/view/trackViewEventCounts.mjs +17 -0
- package/esm/domain/view/trackViewEventCounts.mjs.map +1 -0
- package/esm/domain/view/trackViews.mjs +230 -0
- package/esm/domain/view/trackViews.mjs.map +1 -0
- package/esm/domain/view/viewCollection.mjs +129 -0
- package/esm/domain/view/viewCollection.mjs.map +1 -0
- package/esm/domain/view/viewDiff.mjs +61 -0
- package/esm/domain/view/viewDiff.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs +30 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs +45 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs +18 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs +54 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs +117 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs +29 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs +33 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs +36 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs +210 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs +70 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs +46 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs +35 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs +66 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs.map +1 -0
- package/esm/domain/vital/vitalCollection.mjs +85 -0
- package/esm/domain/vital/vitalCollection.mjs.map +1 -0
- package/esm/domain/waitPageActivityEnd.mjs +107 -0
- package/esm/domain/waitPageActivityEnd.mjs.map +1 -0
- package/esm/index.mjs +23 -0
- package/esm/rawRumEvent.types.mjs +42 -0
- package/esm/rawRumEvent.types.mjs.map +1 -0
- package/esm/transport/formDataTransport.mjs +48 -0
- package/esm/transport/formDataTransport.mjs.map +1 -0
- package/esm/transport/startRumBatch.mjs +132 -0
- package/esm/transport/startRumBatch.mjs.map +1 -0
- package/esm/transport/startRumEventBridge.mjs +13 -0
- package/esm/transport/startRumEventBridge.mjs.map +1 -0
- package/package.json +19 -11
- package/src/boot/preStartRum.ts +216 -88
- package/src/boot/rumPublicApi.ts +358 -119
- package/src/boot/startRum.ts +88 -84
- package/src/browser/cookieObservable.ts +19 -28
- package/src/browser/domMutationObservable.ts +7 -12
- package/src/browser/htmlDomUtils.ts +15 -0
- package/src/browser/locationChangeObservable.ts +23 -12
- package/src/browser/performanceObservable.ts +23 -73
- package/src/browser/performanceUtils.ts +52 -4
- package/src/browser/viewportObservable.ts +4 -6
- package/src/domain/action/actionCollection.ts +94 -87
- package/src/domain/action/clickChain.ts +11 -10
- package/src/domain/action/computeFrustration.ts +19 -5
- package/src/domain/action/frustrationIgnore.ts +54 -0
- package/src/domain/action/getActionNameFromElement.ts +27 -61
- package/src/domain/action/interactionSelectorCache.ts +2 -2
- package/src/domain/action/isActionChildEvent.ts +6 -0
- package/src/domain/action/listenActionEvents.ts +2 -11
- package/src/domain/action/trackClickActions.ts +92 -82
- package/src/domain/action/trackManualActions.ts +104 -0
- package/src/domain/assembly.ts +57 -70
- package/src/domain/configuration/configuration.ts +587 -208
- package/src/domain/configuration/index.ts +1 -0
- package/src/domain/configuration/remoteConfiguration.ts +152 -29
- package/src/domain/configuration/remoteConfiguration.types.ts +51 -1
- package/src/domain/configuration/remoteConfigurationCache.ts +153 -0
- package/src/domain/configuration/remoteSdkConfiguration.ts +131 -13
- package/src/domain/configuration/sessionReplayRoutes.ts +2 -47
- package/src/domain/contexts/ciVisibilityContext.ts +23 -12
- package/src/domain/contexts/connectivityContext.ts +7 -10
- package/src/domain/contexts/defaultContext.ts +11 -14
- package/src/domain/contexts/displayContext.ts +8 -12
- package/src/domain/contexts/featureFlagContext.ts +5 -4
- package/src/domain/contexts/internalContext.ts +3 -3
- package/src/domain/contexts/pageStateHistory.ts +20 -31
- package/src/domain/contexts/sessionContext.ts +16 -22
- package/src/domain/contexts/sourceCodeMfeContext.ts +53 -0
- package/src/domain/contexts/syntheticsContext.ts +7 -17
- package/src/domain/contexts/trackingConsentContext.ts +7 -4
- package/src/domain/contexts/urlContexts.ts +13 -9
- package/src/domain/contexts/userAgentDataContext.ts +12 -13
- package/src/domain/contexts/viewHistory.ts +4 -3
- package/src/domain/discardNegativeDuration.ts +1 -1
- package/src/domain/error/errorCollection.ts +12 -22
- package/src/domain/error/trackReportError.ts +4 -7
- package/src/domain/event/eventCollection.ts +4 -2
- package/src/domain/eventTracker.ts +169 -0
- package/src/domain/extractRegexMatch.ts +15 -0
- package/src/domain/getComposedPathSelector.ts +130 -0
- package/src/domain/getSelectorFromElement.ts +125 -31
- package/src/domain/getSessionReplayUrl.ts +4 -13
- package/src/domain/hooks.ts +34 -21
- package/src/domain/lifeCycle.ts +21 -8
- package/src/domain/limitModification.ts +20 -4
- package/src/domain/longTask/longTaskCollection.ts +18 -47
- package/src/domain/plugins.ts +54 -25
- package/src/domain/privacy.ts +16 -24
- package/src/domain/requestCollection.ts +108 -97
- package/src/domain/resource/graphql.ts +71 -25
- package/src/domain/resource/requestRegistry.ts +1 -3
- package/src/domain/resource/resourceCollection.ts +319 -137
- package/src/domain/resource/resourceUtils.ts +24 -26
- package/src/domain/resource/trackManualResources.ts +121 -0
- package/src/domain/resource/webSocketCollection.ts +281 -0
- package/src/domain/session/session.types.ts +5 -0
- package/src/domain/sessionReplayState.ts +36 -0
- package/src/domain/startCustomerDataTelemetry.ts +2 -2
- package/src/domain/tracing/getDocumentTraceId.ts +5 -4
- package/src/domain/tracing/identifier.ts +6 -37
- package/src/domain/tracing/tracer.ts +22 -21
- package/src/domain/tracing/tracer.types.ts +3 -3
- package/src/domain/view/bfCacheSupport.ts +1 -6
- package/src/domain/view/trackViews.ts +40 -37
- package/src/domain/view/viewCollection.ts +29 -23
- package/src/domain/view/viewDiff.ts +115 -0
- package/src/domain/view/viewMetrics/interactionCountPolyfill.ts +13 -2
- package/src/domain/view/viewMetrics/trackBfcacheMetrics.ts +1 -1
- package/src/domain/view/viewMetrics/trackCommonViewMetrics.ts +27 -6
- package/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +5 -3
- package/src/domain/view/viewMetrics/trackFirstContentfulPaint.ts +4 -9
- package/src/domain/view/viewMetrics/trackFirstHidden.ts +2 -8
- package/src/domain/view/viewMetrics/trackInitialViewMetrics.ts +4 -13
- package/src/domain/view/viewMetrics/trackInteractionToNextPaint.ts +180 -35
- package/src/domain/view/viewMetrics/trackLargestContentfulPaint.ts +47 -6
- package/src/domain/view/viewMetrics/trackLoadingTime.ts +4 -3
- package/src/domain/view/viewMetrics/trackNavigationTimings.ts +10 -18
- package/src/domain/view/viewMetrics/trackScrollMetrics.ts +23 -37
- package/src/domain/vital/vitalCollection.ts +83 -102
- package/src/domain/waitPageActivityEnd.ts +7 -11
- package/src/domainContext.types.ts +23 -15
- package/src/index.ts +17 -11
- package/src/rawRumEvent.types.ts +80 -26
- package/src/rumEvent.types.ts +730 -505
- package/src/transport/formDataTransport.ts +16 -6
- package/src/transport/startRumBatch.ts +181 -24
- package/cjs/browser/firstInputPolyfill.d.ts +0 -8
- package/cjs/browser/firstInputPolyfill.js +0 -68
- package/cjs/browser/firstInputPolyfill.js.map +0 -1
- package/cjs/domain/configuration/index.js.map +0 -1
- package/cjs/domain/configuration/remoteConfiguration.types.js +0 -7
- package/cjs/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/cjs/domain/error/trackConsoleError.d.ts +0 -4
- package/cjs/domain/error/trackConsoleError.js +0 -13
- package/cjs/domain/error/trackConsoleError.js.map +0 -1
- package/cjs/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/cjs/domain/resource/matchRequestResourceEntry.js +0 -49
- package/cjs/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -24
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/cjs/domain/rumSessionManager.d.ts +0 -36
- package/cjs/domain/rumSessionManager.js +0 -77
- package/cjs/domain/rumSessionManager.js.map +0 -1
- package/cjs/domain/sampler/sampler.d.ts +0 -10
- package/cjs/domain/sampler/sampler.js +0 -63
- package/cjs/domain/sampler/sampler.js.map +0 -1
- package/cjs/domain/tracing/sampler.d.ts +0 -10
- package/cjs/domain/tracing/sampler.js +0 -69
- package/cjs/domain/tracing/sampler.js.map +0 -1
- package/cjs/domain/tracing/tracer.types.js +0 -3
- package/cjs/domain/tracing/tracer.types.js.map +0 -1
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -44
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/cjs/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/cjs/domain/view/viewMetrics/trackFirstInput.js +0 -43
- package/cjs/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/cjs/domainContext.types.js +0 -6
- package/cjs/domainContext.types.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/rumEvent.types.js +0 -7
- package/cjs/rumEvent.types.js.map +0 -1
- package/esm/boot/preStartRum.d.ts +0 -7
- package/esm/boot/preStartRum.js +0 -205
- package/esm/boot/preStartRum.js.map +0 -1
- package/esm/boot/rumPublicApi.d.ts +0 -409
- package/esm/boot/rumPublicApi.js +0 -165
- package/esm/boot/rumPublicApi.js.map +0 -1
- package/esm/boot/startRum.d.ts +0 -109
- package/esm/boot/startRum.js +0 -149
- package/esm/boot/startRum.js.map +0 -1
- package/esm/browser/cookieObservable.d.ts +0 -8
- package/esm/browser/cookieObservable.js +0 -35
- package/esm/browser/cookieObservable.js.map +0 -1
- package/esm/browser/domMutationObservable.d.ts +0 -27
- package/esm/browser/domMutationObservable.js +0 -54
- package/esm/browser/domMutationObservable.js.map +0 -1
- package/esm/browser/firstInputPolyfill.d.ts +0 -8
- package/esm/browser/firstInputPolyfill.js +0 -65
- package/esm/browser/firstInputPolyfill.js.map +0 -1
- package/esm/browser/htmlDomUtils.d.ts +0 -13
- package/esm/browser/htmlDomUtils.js +0 -36
- package/esm/browser/htmlDomUtils.js.map +0 -1
- package/esm/browser/locationChangeObservable.d.ts +0 -7
- package/esm/browser/locationChangeObservable.js +0 -48
- package/esm/browser/locationChangeObservable.js.map +0 -1
- package/esm/browser/performanceObservable.d.ts +0 -174
- package/esm/browser/performanceObservable.js +0 -121
- package/esm/browser/performanceObservable.js.map +0 -1
- package/esm/browser/performanceUtils.d.ts +0 -7
- package/esm/browser/performanceUtils.js +0 -38
- package/esm/browser/performanceUtils.js.map +0 -1
- package/esm/browser/scroll.d.ts +0 -2
- package/esm/browser/scroll.js +0 -29
- package/esm/browser/scroll.js.map +0 -1
- package/esm/browser/viewportObservable.d.ts +0 -10
- package/esm/browser/viewportObservable.js +0 -32
- package/esm/browser/viewportObservable.js.map +0 -1
- package/esm/browser/windowOpenObservable.d.ts +0 -5
- package/esm/browser/windowOpenObservable.js +0 -7
- package/esm/browser/windowOpenObservable.js.map +0 -1
- package/esm/domain/action/actionCollection.d.ts +0 -21
- package/esm/domain/action/actionCollection.js +0 -93
- package/esm/domain/action/actionCollection.js.map +0 -1
- package/esm/domain/action/actionNameConstants.d.ts +0 -18
- package/esm/domain/action/actionNameConstants.js +0 -8
- package/esm/domain/action/actionNameConstants.js.map +0 -1
- package/esm/domain/action/clickChain.d.ts +0 -8
- package/esm/domain/action/clickChain.js +0 -57
- package/esm/domain/action/clickChain.js.map +0 -1
- package/esm/domain/action/computeFrustration.d.ts +0 -6
- package/esm/domain/action/computeFrustration.js +0 -65
- package/esm/domain/action/computeFrustration.js.map +0 -1
- package/esm/domain/action/getActionNameFromElement.d.ts +0 -4
- package/esm/domain/action/getActionNameFromElement.js +0 -236
- package/esm/domain/action/getActionNameFromElement.js.map +0 -1
- package/esm/domain/action/interactionSelectorCache.d.ts +0 -5
- package/esm/domain/action/interactionSelectorCache.js +0 -18
- package/esm/domain/action/interactionSelectorCache.js.map +0 -1
- package/esm/domain/action/listenActionEvents.d.ts +0 -19
- package/esm/domain/action/listenActionEvents.js +0 -58
- package/esm/domain/action/listenActionEvents.js.map +0 -1
- package/esm/domain/action/trackClickActions.d.ts +0 -81
- package/esm/domain/action/trackClickActions.js +0 -232
- package/esm/domain/action/trackClickActions.js.map +0 -1
- package/esm/domain/assembly.d.ts +0 -5
- package/esm/domain/assembly.js +0 -99
- package/esm/domain/assembly.js.map +0 -1
- package/esm/domain/configuration/configuration.d.ts +0 -358
- package/esm/domain/configuration/configuration.js +0 -209
- package/esm/domain/configuration/configuration.js.map +0 -1
- package/esm/domain/configuration/index.d.ts +0 -4
- package/esm/domain/configuration/index.js +0 -5
- package/esm/domain/configuration/index.js.map +0 -1
- package/esm/domain/configuration/jsonPathParser.d.ts +0 -28
- package/esm/domain/configuration/jsonPathParser.js +0 -156
- package/esm/domain/configuration/jsonPathParser.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.d.ts +0 -39
- package/esm/domain/configuration/remoteConfiguration.js +0 -236
- package/esm/domain/configuration/remoteConfiguration.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.types.d.ts +0 -138
- package/esm/domain/configuration/remoteConfiguration.types.js +0 -6
- package/esm/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/esm/domain/configuration/remoteSdkConfiguration.d.ts +0 -18
- package/esm/domain/configuration/remoteSdkConfiguration.js +0 -137
- package/esm/domain/configuration/remoteSdkConfiguration.js.map +0 -1
- package/esm/domain/configuration/sessionReplayRoutes.d.ts +0 -35
- package/esm/domain/configuration/sessionReplayRoutes.js +0 -65
- package/esm/domain/configuration/sessionReplayRoutes.js.map +0 -1
- package/esm/domain/contexts/ciVisibilityContext.d.ts +0 -12
- package/esm/domain/contexts/ciVisibilityContext.js +0 -30
- package/esm/domain/contexts/ciVisibilityContext.js.map +0 -1
- package/esm/domain/contexts/connectivityContext.d.ts +0 -2
- package/esm/domain/contexts/connectivityContext.js +0 -8
- package/esm/domain/contexts/connectivityContext.js.map +0 -1
- package/esm/domain/contexts/defaultContext.d.ts +0 -4
- package/esm/domain/contexts/defaultContext.js +0 -31
- package/esm/domain/contexts/defaultContext.js.map +0 -1
- package/esm/domain/contexts/displayContext.d.ts +0 -6
- package/esm/domain/contexts/displayContext.js +0 -25
- package/esm/domain/contexts/displayContext.js.map +0 -1
- package/esm/domain/contexts/featureFlagContext.d.ts +0 -19
- package/esm/domain/contexts/featureFlagContext.js +0 -49
- package/esm/domain/contexts/featureFlagContext.js.map +0 -1
- package/esm/domain/contexts/internalContext.d.ts +0 -12
- package/esm/domain/contexts/internalContext.js +0 -23
- package/esm/domain/contexts/internalContext.js.map +0 -1
- package/esm/domain/contexts/pageStateHistory.d.ts +0 -23
- package/esm/domain/contexts/pageStateHistory.js +0 -100
- package/esm/domain/contexts/pageStateHistory.js.map +0 -1
- package/esm/domain/contexts/sessionContext.d.ts +0 -5
- package/esm/domain/contexts/sessionContext.js +0 -44
- package/esm/domain/contexts/sessionContext.js.map +0 -1
- package/esm/domain/contexts/syntheticsContext.d.ts +0 -2
- package/esm/domain/contexts/syntheticsContext.js +0 -22
- package/esm/domain/contexts/syntheticsContext.js.map +0 -1
- package/esm/domain/contexts/trackingConsentContext.d.ts +0 -3
- package/esm/domain/contexts/trackingConsentContext.js +0 -11
- package/esm/domain/contexts/trackingConsentContext.js.map +0 -1
- package/esm/domain/contexts/urlContexts.d.ts +0 -22
- package/esm/domain/contexts/urlContexts.js +0 -60
- package/esm/domain/contexts/urlContexts.js.map +0 -1
- package/esm/domain/contexts/userAgentDataContext.d.ts +0 -2
- package/esm/domain/contexts/userAgentDataContext.js +0 -28
- package/esm/domain/contexts/userAgentDataContext.js.map +0 -1
- package/esm/domain/contexts/viewHistory.d.ts +0 -17
- package/esm/domain/contexts/viewHistory.js +0 -44
- package/esm/domain/contexts/viewHistory.js.map +0 -1
- package/esm/domain/discardNegativeDuration.d.ts +0 -2
- package/esm/domain/discardNegativeDuration.js +0 -5
- package/esm/domain/discardNegativeDuration.js.map +0 -1
- package/esm/domain/error/errorCollection.d.ts +0 -17
- package/esm/domain/error/errorCollection.js +0 -70
- package/esm/domain/error/errorCollection.js.map +0 -1
- package/esm/domain/error/trackConsoleError.d.ts +0 -4
- package/esm/domain/error/trackConsoleError.js +0 -10
- package/esm/domain/error/trackConsoleError.js.map +0 -1
- package/esm/domain/error/trackReportError.d.ts +0 -5
- package/esm/domain/error/trackReportError.js +0 -13
- package/esm/domain/error/trackReportError.js.map +0 -1
- package/esm/domain/event/eventCollection.d.ts +0 -10
- package/esm/domain/event/eventCollection.js +0 -24
- package/esm/domain/event/eventCollection.js.map +0 -1
- package/esm/domain/getSelectorFromElement.d.ts +0 -64
- package/esm/domain/getSelectorFromElement.js +0 -213
- package/esm/domain/getSelectorFromElement.js.map +0 -1
- package/esm/domain/getSessionReplayUrl.d.ts +0 -9
- package/esm/domain/getSessionReplayUrl.js +0 -30
- package/esm/domain/getSessionReplayUrl.js.map +0 -1
- package/esm/domain/hooks.d.ts +0 -23
- package/esm/domain/hooks.js +0 -3
- package/esm/domain/hooks.js.map +0 -1
- package/esm/domain/lifeCycle.d.ts +0 -73
- package/esm/domain/lifeCycle.js +0 -3
- package/esm/domain/lifeCycle.js.map +0 -1
- package/esm/domain/limitModification.d.ts +0 -8
- package/esm/domain/limitModification.js +0 -43
- package/esm/domain/limitModification.js.map +0 -1
- package/esm/domain/longTask/longTaskCollection.d.ts +0 -18
- package/esm/domain/longTask/longTaskCollection.js +0 -87
- package/esm/domain/longTask/longTaskCollection.js.map +0 -1
- package/esm/domain/plugins.d.ts +0 -40
- package/esm/domain/plugins.js +0 -12
- package/esm/domain/plugins.js.map +0 -1
- package/esm/domain/privacy.d.ts +0 -44
- package/esm/domain/privacy.js +0 -302
- package/esm/domain/privacy.js.map +0 -1
- package/esm/domain/privacyConstants.d.ts +0 -23
- package/esm/domain/privacyConstants.js +0 -35
- package/esm/domain/privacyConstants.js.map +0 -1
- package/esm/domain/requestCollection.d.ts +0 -54
- package/esm/domain/requestCollection.js +0 -106
- package/esm/domain/requestCollection.js.map +0 -1
- package/esm/domain/resource/graphql.d.ts +0 -23
- package/esm/domain/resource/graphql.js +0 -91
- package/esm/domain/resource/graphql.js.map +0 -1
- package/esm/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/esm/domain/resource/matchRequestResourceEntry.js +0 -46
- package/esm/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/esm/domain/resource/requestRegistry.d.ts +0 -9
- package/esm/domain/resource/requestRegistry.js +0 -37
- package/esm/domain/resource/requestRegistry.js.map +0 -1
- package/esm/domain/resource/resourceCollection.d.ts +0 -7
- package/esm/domain/resource/resourceCollection.js +0 -187
- package/esm/domain/resource/resourceCollection.js.map +0 -1
- package/esm/domain/resource/resourceUtils.d.ts +0 -55
- package/esm/domain/resource/resourceUtils.js +0 -244
- package/esm/domain/resource/resourceUtils.js.map +0 -1
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -21
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/esm/domain/rumSessionManager.d.ts +0 -36
- package/esm/domain/rumSessionManager.js +0 -72
- package/esm/domain/rumSessionManager.js.map +0 -1
- package/esm/domain/sampler/sampler.d.ts +0 -10
- package/esm/domain/sampler/sampler.js +0 -58
- package/esm/domain/sampler/sampler.js.map +0 -1
- package/esm/domain/startCustomerDataTelemetry.d.ts +0 -4
- package/esm/domain/startCustomerDataTelemetry.js +0 -52
- package/esm/domain/startCustomerDataTelemetry.js.map +0 -1
- package/esm/domain/tracing/getDocumentTraceId.d.ts +0 -12
- package/esm/domain/tracing/getDocumentTraceId.js +0 -68
- package/esm/domain/tracing/getDocumentTraceId.js.map +0 -1
- package/esm/domain/tracing/identifier.d.ts +0 -13
- package/esm/domain/tracing/identifier.js +0 -50
- package/esm/domain/tracing/identifier.js.map +0 -1
- package/esm/domain/tracing/sampler.d.ts +0 -10
- package/esm/domain/tracing/sampler.js +0 -64
- package/esm/domain/tracing/sampler.js.map +0 -1
- package/esm/domain/tracing/tracer.d.ts +0 -30
- package/esm/domain/tracing/tracer.js +0 -156
- package/esm/domain/tracing/tracer.js.map +0 -1
- package/esm/domain/tracing/tracer.types.d.ts +0 -12
- package/esm/domain/tracing/tracer.types.js +0 -2
- package/esm/domain/tracing/tracer.types.js.map +0 -1
- package/esm/domain/trackEventCounts.d.ts +0 -17
- package/esm/domain/trackEventCounts.js +0 -47
- package/esm/domain/trackEventCounts.js.map +0 -1
- package/esm/domain/view/bfCacheSupport.d.ts +0 -2
- package/esm/domain/view/bfCacheSupport.js +0 -10
- package/esm/domain/view/bfCacheSupport.js.map +0 -1
- package/esm/domain/view/trackViewEventCounts.d.ts +0 -5
- package/esm/domain/view/trackViewEventCounts.js +0 -13
- package/esm/domain/view/trackViewEventCounts.js.map +0 -1
- package/esm/domain/view/trackViews.d.ts +0 -65
- package/esm/domain/view/trackViews.js +0 -278
- package/esm/domain/view/trackViews.js.map +0 -1
- package/esm/domain/view/viewCollection.d.ts +0 -18
- package/esm/domain/view/viewCollection.js +0 -150
- package/esm/domain/view/viewCollection.js.map +0 -1
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +0 -6
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js +0 -28
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +0 -1
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.d.ts +0 -18
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js +0 -39
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js.map +0 -1
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -41
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +0 -8
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js +0 -14
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +0 -21
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js +0 -34
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +0 -37
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js +0 -130
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +0 -13
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js +0 -34
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstHidden.d.ts +0 -10
- package/esm/domain/view/viewMetrics/trackFirstHidden.js +0 -30
- package/esm/domain/view/viewMetrics/trackFirstHidden.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/esm/domain/view/viewMetrics/trackFirstInput.js +0 -40
- package/esm/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +0 -15
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js +0 -38
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js +0 -149
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +0 -18
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js +0 -57
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLoadingTime.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackLoadingTime.js +0 -47
- package/esm/domain/view/viewMetrics/trackLoadingTime.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackNavigationTimings.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js +0 -40
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackScrollMetrics.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js +0 -72
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js.map +0 -1
- package/esm/domain/vital/vitalCollection.d.ts +0 -55
- package/esm/domain/vital/vitalCollection.js +0 -107
- package/esm/domain/vital/vitalCollection.js.map +0 -1
- package/esm/domain/waitPageActivityEnd.d.ts +0 -54
- package/esm/domain/waitPageActivityEnd.js +0 -123
- package/esm/domain/waitPageActivityEnd.js.map +0 -1
- package/esm/domainContext.types.d.ts +0 -39
- package/esm/domainContext.types.js +0 -5
- package/esm/domainContext.types.js.map +0 -1
- package/esm/index.d.ts +0 -42
- package/esm/index.js +0 -22
- package/esm/index.js.map +0 -1
- package/esm/rawRumEvent.types.d.ts +0 -326
- package/esm/rawRumEvent.types.js +0 -31
- package/esm/rawRumEvent.types.js.map +0 -1
- package/esm/rumEvent.types.d.ts +0 -2038
- package/esm/rumEvent.types.js +0 -6
- package/esm/rumEvent.types.js.map +0 -1
- package/esm/transport/formDataTransport.d.ts +0 -16
- package/esm/transport/formDataTransport.js +0 -43
- package/esm/transport/formDataTransport.js.map +0 -1
- package/esm/transport/startRumBatch.d.ts +0 -5
- package/esm/transport/startRumBatch.js +0 -30
- package/esm/transport/startRumBatch.js.map +0 -1
- package/esm/transport/startRumEventBridge.d.ts +0 -2
- package/esm/transport/startRumEventBridge.js +0 -8
- package/esm/transport/startRumEventBridge.js.map +0 -1
- package/src/browser/firstInputPolyfill.ts +0 -87
- package/src/domain/error/trackConsoleError.ts +0 -14
- package/src/domain/resource/matchRequestResourceEntry.ts +0 -68
- package/src/domain/resource/retrieveInitialDocumentResourceTiming.ts +0 -27
- package/src/domain/rumSessionManager.ts +0 -134
- package/src/domain/sampler/sampler.ts +0 -63
- package/src/domain/tracing/sampler.ts +0 -69
- package/src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts +0 -70
- package/src/domain/view/viewMetrics/trackFirstInput.ts +0 -59
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface BaseIdentifier {
|
|
2
|
-
toString(radix?: number): string;
|
|
3
|
-
}
|
|
4
|
-
export interface TraceIdentifier extends BaseIdentifier {
|
|
5
|
-
__brand: 'traceIdentifier';
|
|
6
|
-
}
|
|
7
|
-
export interface SpanIdentifier extends BaseIdentifier {
|
|
8
|
-
__brand: 'spanIdentifier';
|
|
9
|
-
}
|
|
10
|
-
export declare function createTraceIdentifier(): TraceIdentifier;
|
|
11
|
-
export declare function createSpanIdentifier(): SpanIdentifier;
|
|
12
|
-
export declare function toPaddedHexadecimalString(id: BaseIdentifier): string;
|
|
13
|
-
export {};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export function createTraceIdentifier() {
|
|
2
|
-
return createIdentifier(64);
|
|
3
|
-
}
|
|
4
|
-
export function createSpanIdentifier() {
|
|
5
|
-
return createIdentifier(63);
|
|
6
|
-
}
|
|
7
|
-
function createIdentifier(bits) {
|
|
8
|
-
const buffer = crypto.getRandomValues(new Uint32Array(2));
|
|
9
|
-
if (bits === 63) {
|
|
10
|
-
// eslint-disable-next-line no-bitwise
|
|
11
|
-
buffer[buffer.length - 1] >>>= 1; // force 63-bit
|
|
12
|
-
}
|
|
13
|
-
// The `.toString` function is intentionally similar to Number and BigInt `.toString` method.
|
|
14
|
-
//
|
|
15
|
-
// JavaScript numbers can represent integers up to 48 bits, this is why we need two of them to
|
|
16
|
-
// represent a 64 bits identifier. But BigInts don't have this limitation and can represent larger
|
|
17
|
-
// integer values.
|
|
18
|
-
//
|
|
19
|
-
// In the future, when we drop browsers without BigInts support, we could use BigInts directly
|
|
20
|
-
// represent identifiers by simply returning a BigInt from this function (as all we need is a
|
|
21
|
-
// value with a `.toString` method).
|
|
22
|
-
//
|
|
23
|
-
// Examples:
|
|
24
|
-
// const buffer = getCrypto().getRandomValues(new Uint32Array(2))
|
|
25
|
-
// return BigInt(buffer[0]) + BigInt(buffer[1]) << 32n
|
|
26
|
-
//
|
|
27
|
-
// // Alternative with BigUint64Array (different Browser support than plain bigints!):
|
|
28
|
-
// return crypto.getRandomValues(new BigUint64Array(1))[0]
|
|
29
|
-
//
|
|
30
|
-
// For now, let's keep using two plain numbers as having two different implementations (one for
|
|
31
|
-
// browsers with BigInt support and one for older browsers) don't bring much value.
|
|
32
|
-
return {
|
|
33
|
-
toString(radix = 10) {
|
|
34
|
-
let high = buffer[1];
|
|
35
|
-
let low = buffer[0];
|
|
36
|
-
let str = '';
|
|
37
|
-
do {
|
|
38
|
-
const mod = (high % radix) * 4294967296 + low;
|
|
39
|
-
high = Math.floor(high / radix);
|
|
40
|
-
low = Math.floor(mod / radix);
|
|
41
|
-
str = (mod % radix).toString(radix) + str;
|
|
42
|
-
} while (high || low);
|
|
43
|
-
return str;
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
export function toPaddedHexadecimalString(id) {
|
|
48
|
-
return id.toString(16).padStart(16, '0');
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=identifier.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../../src/domain/tracing/identifier.ts"],"names":[],"mappings":"AAcA,MAAM,UAAU,qBAAqB;IACnC,OAAO,gBAAgB,CAAC,EAAE,CAAoB,CAAA;AAChD,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,gBAAgB,CAAC,EAAE,CAAmB,CAAA;AAC/C,CAAC;AAED,SAAS,gBAAgB,CAAC,IAAa;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IACzD,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,sCAAsC;QACtC,MAAM,CAA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declare function resetSampleDecisionCache(): void;
|
|
3
|
-
/**
|
|
4
|
-
* Perform sampling using the Knuth factor method. This method offer consistent sampling result
|
|
5
|
-
* based on the provided identifier.
|
|
6
|
-
*
|
|
7
|
-
* @param identifier The identifier to use for sampling.
|
|
8
|
-
* @param sampleRate The sample rate in percentage between 0 and 100.
|
|
9
|
-
*/
|
|
10
|
-
export declare function sampleUsingKnuthFactor(identifier: bigint, sampleRate: number): boolean;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { performDraw } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
let sampleDecisionCache;
|
|
3
|
-
export function isTraceSampled(sessionId, sampleRate) {
|
|
4
|
-
// Shortcuts for common cases. This is not strictly necessary, but it makes the code faster for
|
|
5
|
-
// customers willing to ingest all traces.
|
|
6
|
-
if (sampleRate === 100) {
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
if (sampleRate === 0) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
if (sampleDecisionCache && sessionId === sampleDecisionCache.sessionId) {
|
|
13
|
-
return sampleDecisionCache.decision;
|
|
14
|
-
}
|
|
15
|
-
let decision;
|
|
16
|
-
// @ts-expect-error BigInt might not be defined in every browser we support
|
|
17
|
-
if (window.BigInt) {
|
|
18
|
-
decision = sampleUsingKnuthFactor(BigInt(`0x${sessionId.split('-')[4]}`), sampleRate);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
// For simplicity, we don't use consistent sampling for browser without BigInt support
|
|
22
|
-
// TODO: remove this when all browser we support have BigInt support
|
|
23
|
-
decision = performDraw(sampleRate);
|
|
24
|
-
}
|
|
25
|
-
sampleDecisionCache = { sessionId, decision };
|
|
26
|
-
return decision;
|
|
27
|
-
}
|
|
28
|
-
// Exported for tests
|
|
29
|
-
export function resetSampleDecisionCache() {
|
|
30
|
-
sampleDecisionCache = undefined;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Perform sampling using the Knuth factor method. This method offer consistent sampling result
|
|
34
|
-
* based on the provided identifier.
|
|
35
|
-
*
|
|
36
|
-
* @param identifier The identifier to use for sampling.
|
|
37
|
-
* @param sampleRate The sample rate in percentage between 0 and 100.
|
|
38
|
-
*/
|
|
39
|
-
export function sampleUsingKnuthFactor(identifier, sampleRate) {
|
|
40
|
-
// The formula is:
|
|
41
|
-
//
|
|
42
|
-
// (identifier * knuthFactor) % 2^64 < sampleRate * 2^64
|
|
43
|
-
//
|
|
44
|
-
// Because JavaScript numbers are 64-bit floats, we can't represent 64-bit integers, and the
|
|
45
|
-
// modulo would be incorrect. Thus, we are using BigInts here.
|
|
46
|
-
//
|
|
47
|
-
// Implementation in other languages:
|
|
48
|
-
// * Go https://github.com/kubsense-ai/kubesense-trace-go/blob/ec6fbb1f2d517b7b8e69961052adf7136f3af773/ddtrace/tracer/sampler.go#L86-L91
|
|
49
|
-
// * Python https://github.com/kubsense/kubesense-trace-py/blob/0cee2f066fb6e79aa15947c1514c0f406dea47c5/ddtrace/sampling_rule.py#L197
|
|
50
|
-
// * Ruby https://github.com/kubsense/kubesense-trace-rb/blob/1a6e255cdcb7e7e22235ea5955f90f6dfa91045d/lib/kubesense/tracing/sampling/rate_sampler.rb#L42
|
|
51
|
-
// * C++ https://github.com/kubsense/kubesense-trace-cpp/blob/159629edc438ae45f2bb318eb7bd51abd05e94b5/src/kubesense/trace_sampler.cpp#L58
|
|
52
|
-
// * Java https://github.com/kubsense/kubesense-trace-java/blob/896dd6b380533216e0bdee59614606c8272d313e/kubesense-trace-core/src/main/java/kubesense/trace/common/sampling/DeterministicSampler.java#L48
|
|
53
|
-
//
|
|
54
|
-
// Note: All implementations have slight variations. Some of them use '<=' instead of '<', and
|
|
55
|
-
// use `sampleRate * 2^64 - 1` instead of `sampleRate * 2^64`. The following implementation
|
|
56
|
-
// should adhere to the spec and is a bit simpler than using a 2^64-1 limit as there are less
|
|
57
|
-
// BigInt arithmetic to write. In practice this does not matter, as we are using floating point
|
|
58
|
-
// numbers in the end, and Number(2n**64n-1n) === Number(2n**64n).
|
|
59
|
-
const knuthFactor = BigInt('1111111111111111111');
|
|
60
|
-
const twoPow64 = BigInt('0x10000000000000000'); // 2n ** 64n
|
|
61
|
-
const hash = (identifier * knuthFactor) % twoPow64;
|
|
62
|
-
return Number(hash) <= (sampleRate / 100) * Number(twoPow64);
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=sampler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sampler.js","sourceRoot":"","sources":["../../../src/domain/tracing/sampler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAE/D,IAAI,mBAAyE,CAAA;AAE7E,MAAM,UAAU,cAAc,CAAC,SAAiB,EAAE,UAAkB;IAClE,+FAA+F;IAC/F,0CAA0C;IAC1C,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACvB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,mBAAmB,IAAI,SAAS,KAAK,mBAAmB,CAAC,SAAS,EAAE,CAAC;QACvE,OAAO,mBAAmB,CAAC,QAAQ,CAAA;IACrC,CAAC;IAED,IAAI,QAAiB,CAAA;IACrB,2EAA2E;IAC3E,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,QAAQ,GAAG,sBAAsB,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAA;IACvF,CAAC;SAAM,CAAC;QACN,sFAAsF;QACtF,oEAAoE;QACpE,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAA;IACpC,CAAC;IACD,mBAAmB,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAA;IAC7C,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,qBAAqB;AACrB,MAAM,UAAU,wBAAwB;IACtC,mBAAmB,GAAG,SAAS,CAAA;AACjC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAAkB,EAAE,UAAkB;IAC3E,kBAAkB;IAClB,EAAE;IACF,0DAA0D;IAC1D,EAAE;IACF,4FAA4F;IAC5F,8DAA8D;IAC9D,EAAE;IACF,qCAAqC;IACrC,6IAA6I;IAC7I,sIAAsI;IACtI,2JAA2J;IAC3J,6IAA6I;IAC7I,2MAA2M;IAC3M,EAAE;IACF,8FAA8F;IAC9F,2FAA2F;IAC3F,6FAA6F;IAC7F,+FAA+F;IAC/F,kEAAkE;IAClE,MAAM,WAAW,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAA;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAA,CAAC,YAAY;IAC3D,MAAM,IAAI,GAAG,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,QAAQ,CAAA;IAClD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC9D,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ContextManager } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import type { RumConfiguration } from '../configuration';
|
|
3
|
-
import type { RumFetchResolveContext, RumFetchStartContext, RumXhrCompleteContext, RumXhrStartContext } from '../requestCollection';
|
|
4
|
-
import type { RumSessionManager } from '../rumSessionManager';
|
|
5
|
-
import type { TracingOption } from './tracer.types';
|
|
6
|
-
export interface Tracer {
|
|
7
|
-
traceFetch: (context: Partial<RumFetchStartContext>) => void;
|
|
8
|
-
traceXhr: (context: Partial<RumXhrStartContext>, xhr: XMLHttpRequest) => void;
|
|
9
|
-
clearTracingIfNeeded: (context: RumFetchResolveContext | RumXhrCompleteContext) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function isTracingOption(item: unknown): item is TracingOption;
|
|
12
|
-
/**
|
|
13
|
-
* Clear tracing information to avoid incomplete traces. Ideally, we should do it when the
|
|
14
|
-
* request did not reach the server, but the browser does not expose this. So, we clear tracing
|
|
15
|
-
* information if the request ended with status 0 without being aborted by the application.
|
|
16
|
-
*
|
|
17
|
-
* Reasoning:
|
|
18
|
-
*
|
|
19
|
-
* * Applications are usually aborting requests after a bit of time, for example when the user is
|
|
20
|
-
* typing (autocompletion) or navigating away (in a SPA). With a performant device and good
|
|
21
|
-
* network conditions, the request is likely to reach the server before being canceled.
|
|
22
|
-
*
|
|
23
|
-
* * Requests aborted otherwise (ex: lack of internet, CORS issue, blocked by a privacy extension)
|
|
24
|
-
* are likely to finish quickly and without reaching the server.
|
|
25
|
-
*
|
|
26
|
-
* Of course, it might not be the case every time, but it should limit having incomplete traces a
|
|
27
|
-
* bit.
|
|
28
|
-
* */
|
|
29
|
-
export declare function clearTracingIfNeeded(context: RumFetchResolveContext | RumXhrCompleteContext): void;
|
|
30
|
-
export declare function startTracer(configuration: RumConfiguration, sessionManager: RumSessionManager, userContext: ContextManager, accountContext: ContextManager): Tracer;
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { objectEntries, shallowClone, getType, isMatchOption, matchList, TraceContextInjection, } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { isSampled } from '../sampler/sampler';
|
|
3
|
-
import { createSpanIdentifier, createTraceIdentifier, toPaddedHexadecimalString } from './identifier';
|
|
4
|
-
export function isTracingOption(item) {
|
|
5
|
-
const expectedItem = item;
|
|
6
|
-
return (getType(expectedItem) === 'object' &&
|
|
7
|
-
isMatchOption(expectedItem.match) &&
|
|
8
|
-
Array.isArray(expectedItem.propagatorTypes));
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Clear tracing information to avoid incomplete traces. Ideally, we should do it when the
|
|
12
|
-
* request did not reach the server, but the browser does not expose this. So, we clear tracing
|
|
13
|
-
* information if the request ended with status 0 without being aborted by the application.
|
|
14
|
-
*
|
|
15
|
-
* Reasoning:
|
|
16
|
-
*
|
|
17
|
-
* * Applications are usually aborting requests after a bit of time, for example when the user is
|
|
18
|
-
* typing (autocompletion) or navigating away (in a SPA). With a performant device and good
|
|
19
|
-
* network conditions, the request is likely to reach the server before being canceled.
|
|
20
|
-
*
|
|
21
|
-
* * Requests aborted otherwise (ex: lack of internet, CORS issue, blocked by a privacy extension)
|
|
22
|
-
* are likely to finish quickly and without reaching the server.
|
|
23
|
-
*
|
|
24
|
-
* Of course, it might not be the case every time, but it should limit having incomplete traces a
|
|
25
|
-
* bit.
|
|
26
|
-
* */
|
|
27
|
-
export function clearTracingIfNeeded(context) {
|
|
28
|
-
if (context.status === 0 && !context.isAborted) {
|
|
29
|
-
context.traceId = undefined;
|
|
30
|
-
context.spanId = undefined;
|
|
31
|
-
context.traceSampled = undefined;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export function startTracer(configuration, sessionManager, userContext, accountContext) {
|
|
35
|
-
return {
|
|
36
|
-
clearTracingIfNeeded,
|
|
37
|
-
traceFetch: (context) => injectHeadersIfTracingAllowed(configuration, context, sessionManager, userContext, accountContext, (tracingHeaders) => {
|
|
38
|
-
var _a;
|
|
39
|
-
if (context.input instanceof Request && !((_a = context.init) === null || _a === void 0 ? void 0 : _a.headers)) {
|
|
40
|
-
context.input = new Request(context.input);
|
|
41
|
-
Object.keys(tracingHeaders).forEach((key) => {
|
|
42
|
-
;
|
|
43
|
-
context.input.headers.append(key, tracingHeaders[key]);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
context.init = shallowClone(context.init);
|
|
48
|
-
const headers = [];
|
|
49
|
-
if (context.init.headers instanceof Headers) {
|
|
50
|
-
context.init.headers.forEach((value, key) => {
|
|
51
|
-
headers.push([key, value]);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
else if (Array.isArray(context.init.headers)) {
|
|
55
|
-
context.init.headers.forEach((header) => {
|
|
56
|
-
headers.push(header);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
else if (context.init.headers) {
|
|
60
|
-
Object.keys(context.init.headers).forEach((key) => {
|
|
61
|
-
headers.push([key, context.init.headers[key]]);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
context.init.headers = headers.concat(objectEntries(tracingHeaders));
|
|
65
|
-
}
|
|
66
|
-
}),
|
|
67
|
-
traceXhr: (context, xhr) => injectHeadersIfTracingAllowed(configuration, context, sessionManager, userContext, accountContext, (tracingHeaders) => {
|
|
68
|
-
Object.keys(tracingHeaders).forEach((name) => {
|
|
69
|
-
xhr.setRequestHeader(name, tracingHeaders[name]);
|
|
70
|
-
});
|
|
71
|
-
}),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function injectHeadersIfTracingAllowed(configuration, context, sessionManager, userContext, accountContext, inject) {
|
|
75
|
-
const session = sessionManager.findTrackedSession();
|
|
76
|
-
if (!session) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const tracingOption = configuration.allowedTracingUrls.find((tracingOption) => matchList([tracingOption.match], context.url, true));
|
|
80
|
-
if (!tracingOption) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const traceSampled = isSampled(session.id, configuration.traceSampleRate);
|
|
84
|
-
const shouldInjectHeaders = traceSampled || configuration.traceContextInjection === TraceContextInjection.ALL;
|
|
85
|
-
if (!shouldInjectHeaders) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
context.traceSampled = traceSampled;
|
|
89
|
-
context.traceId = createTraceIdentifier();
|
|
90
|
-
context.spanId = createSpanIdentifier();
|
|
91
|
-
inject(makeTracingHeaders(context.traceId, context.spanId, context.traceSampled, session.id, tracingOption.propagatorTypes, userContext, accountContext, configuration));
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* When trace is not sampled, set priority to '0' instead of not adding the tracing headers
|
|
95
|
-
* to prepare the implementation for sampling delegation.
|
|
96
|
-
*/
|
|
97
|
-
function makeTracingHeaders(traceId, spanId, traceSampled, sessionId, propagatorTypes, userContext, accountContext, configuration) {
|
|
98
|
-
const tracingHeaders = {};
|
|
99
|
-
propagatorTypes.forEach((propagatorType) => {
|
|
100
|
-
switch (propagatorType) {
|
|
101
|
-
case 'kubesense': {
|
|
102
|
-
Object.assign(tracingHeaders, {
|
|
103
|
-
'x-kubesense-origin': 'rum',
|
|
104
|
-
'x-kubesense-parent-id': spanId.toString(),
|
|
105
|
-
'x-kubesense-sampling-priority': traceSampled ? '1' : '0',
|
|
106
|
-
'x-kubesense-trace-id': traceId.toString(),
|
|
107
|
-
});
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
// https://www.w3.org/TR/trace-context/
|
|
111
|
-
case 'tracecontext': {
|
|
112
|
-
Object.assign(tracingHeaders, {
|
|
113
|
-
traceparent: `00-0000000000000000${toPaddedHexadecimalString(traceId)}-${toPaddedHexadecimalString(spanId)}-0${traceSampled ? '1' : '0'}`,
|
|
114
|
-
tracestate: `dd=s:${traceSampled ? '1' : '0'};o:rum`,
|
|
115
|
-
});
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
// https://github.com/openzipkin/b3-propagation
|
|
119
|
-
case 'b3': {
|
|
120
|
-
Object.assign(tracingHeaders, {
|
|
121
|
-
b3: `${toPaddedHexadecimalString(traceId)}-${toPaddedHexadecimalString(spanId)}-${traceSampled ? '1' : '0'}`,
|
|
122
|
-
});
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
case 'b3multi': {
|
|
126
|
-
Object.assign(tracingHeaders, {
|
|
127
|
-
'X-B3-TraceId': toPaddedHexadecimalString(traceId),
|
|
128
|
-
'X-B3-SpanId': toPaddedHexadecimalString(spanId),
|
|
129
|
-
'X-B3-Sampled': traceSampled ? '1' : '0',
|
|
130
|
-
});
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
if (configuration.propagateTraceBaggage) {
|
|
136
|
-
const baggageItems = {
|
|
137
|
-
'session.id': sessionId,
|
|
138
|
-
};
|
|
139
|
-
const userId = userContext.getContext().id;
|
|
140
|
-
if (typeof userId === 'string') {
|
|
141
|
-
baggageItems['user.id'] = userId;
|
|
142
|
-
}
|
|
143
|
-
const accountId = accountContext.getContext().id;
|
|
144
|
-
if (typeof accountId === 'string') {
|
|
145
|
-
baggageItems['account.id'] = accountId;
|
|
146
|
-
}
|
|
147
|
-
const baggageHeader = Object.entries(baggageItems)
|
|
148
|
-
.map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
|
|
149
|
-
.join(',');
|
|
150
|
-
if (baggageHeader) {
|
|
151
|
-
tracingHeaders['baggage'] = baggageHeader;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return tracingHeaders;
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=tracer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../../src/domain/tracing/tracer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,OAAO,EACP,aAAa,EACb,SAAS,EACT,qBAAqB,GACtB,MAAM,mCAAmC,CAAA;AAS1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG9C,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAYrG,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,MAAM,YAAY,GAAG,IAAqB,CAAA;IAC1C,OAAO,CACL,OAAO,CAAC,YAAY,CAAC,KAAK,QAAQ;QAClC,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC;QACjC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAC5C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;KAgBK;AACL,MAAM,UAAU,oBA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EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;iBACzC,CAAC,CAAA;gBACF,MAAK;YACP,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,aAAa,CAAC,qBAAqB,EAAE,CAAC;QACxC,MAAM,YAAY,GAA2B;YAC3C,YAAY,EAAE,SAAS;SACxB,CAAA;QAED,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,EAAE,CAAC,EAAE,CAAA;QAC1C,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,YAAY,CAAC,SAAS,CAAC,GAAG,MAAM,CAAA;QAClC,CAAC;QAED,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,EAAE,CAAC,EAAE,CAAA;QAChD,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAClC,YAAY,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;QACxC,CAAC;QAED,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;aAC/C,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;aAC5D,IAAI,CAAC,GAAG,CAAC,CAAA;QACZ,IAAI,aAAa,EAAE,CAAC;YAClB,cAAc,CAAC,SAAS,CAAC,GAAG,aAAa,CAAA;QAC3C,CAAC;IACH,CAAC;IAED,OAAO,cAAc,CAAA;AACvB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { MatchOption } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
/**
|
|
3
|
-
* kubesense: KubeSense (x-kubesense-*)
|
|
4
|
-
* tracecontext: W3C Trace Context (traceparent, tracestate)
|
|
5
|
-
* b3: B3 Single Header (b3)
|
|
6
|
-
* b3multi: B3 Multiple Headers (X-B3-*)
|
|
7
|
-
*/
|
|
8
|
-
export type PropagatorType = 'kubesense' | 'b3' | 'b3multi' | 'tracecontext';
|
|
9
|
-
export interface TracingOption {
|
|
10
|
-
match: MatchOption;
|
|
11
|
-
propagatorTypes: PropagatorType[];
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tracer.types.js","sourceRoot":"","sources":["../../../src/domain/tracing/tracer.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { RumActionEvent, RumErrorEvent, RumLongTaskEvent, RumResourceEvent } from '../rumEvent.types';
|
|
2
|
-
import type { LifeCycle } from './lifeCycle';
|
|
3
|
-
export interface EventCounts {
|
|
4
|
-
errorCount: number;
|
|
5
|
-
actionCount: number;
|
|
6
|
-
longTaskCount: number;
|
|
7
|
-
resourceCount: number;
|
|
8
|
-
frustrationCount: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function trackEventCounts({ lifeCycle, isChildEvent, onChange: callback, }: {
|
|
11
|
-
lifeCycle: LifeCycle;
|
|
12
|
-
isChildEvent: (event: RumActionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent) => boolean;
|
|
13
|
-
onChange?: () => void;
|
|
14
|
-
}): {
|
|
15
|
-
stop: () => void;
|
|
16
|
-
eventCounts: EventCounts;
|
|
17
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { noop } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { RumEventType } from '../rawRumEvent.types';
|
|
3
|
-
export function trackEventCounts({ lifeCycle, isChildEvent, onChange: callback = noop, }) {
|
|
4
|
-
const eventCounts = {
|
|
5
|
-
errorCount: 0,
|
|
6
|
-
longTaskCount: 0,
|
|
7
|
-
resourceCount: 0,
|
|
8
|
-
actionCount: 0,
|
|
9
|
-
frustrationCount: 0,
|
|
10
|
-
};
|
|
11
|
-
const subscription = lifeCycle.subscribe(13 /* LifeCycleEventType.RUM_EVENT_COLLECTED */, (event) => {
|
|
12
|
-
var _a;
|
|
13
|
-
if (event.type === 'view' || event.type === 'vital' || !isChildEvent(event)) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
switch (event.type) {
|
|
17
|
-
case RumEventType.ERROR:
|
|
18
|
-
eventCounts.errorCount += 1;
|
|
19
|
-
callback();
|
|
20
|
-
break;
|
|
21
|
-
case RumEventType.ACTION:
|
|
22
|
-
eventCounts.actionCount += 1;
|
|
23
|
-
if (event.action.frustration) {
|
|
24
|
-
eventCounts.frustrationCount += event.action.frustration.type.length;
|
|
25
|
-
}
|
|
26
|
-
callback();
|
|
27
|
-
break;
|
|
28
|
-
case RumEventType.LONG_TASK:
|
|
29
|
-
eventCounts.longTaskCount += 1;
|
|
30
|
-
callback();
|
|
31
|
-
break;
|
|
32
|
-
case RumEventType.RESOURCE:
|
|
33
|
-
if (!((_a = event._kubesense) === null || _a === void 0 ? void 0 : _a.discarded)) {
|
|
34
|
-
eventCounts.resourceCount += 1;
|
|
35
|
-
callback();
|
|
36
|
-
}
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return {
|
|
41
|
-
stop: () => {
|
|
42
|
-
subscription.unsubscribe();
|
|
43
|
-
},
|
|
44
|
-
eventCounts,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=trackEventCounts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackEventCounts.js","sourceRoot":"","sources":["../../src/domain/trackEventCounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAanD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,YAAY,EACZ,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAK1B;IACC,MAAM,WAAW,GAAgB;QAC/B,UAAU,EAAE,CAAC;QACb,aAAa,EAAE,CAAC;QAChB,aAAa,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|
|
|
1
|
-
import { addEventListener } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
export function onBFCacheRestore(configuration, callback) {
|
|
3
|
-
const { stop } = addEventListener(configuration, window, "pageshow" /* DOM_EVENT.PAGE_SHOW */, (event) => {
|
|
4
|
-
if (event.persisted) {
|
|
5
|
-
callback(event);
|
|
6
|
-
}
|
|
7
|
-
}, { capture: true });
|
|
8
|
-
return stop;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=bfCacheSupport.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bfCacheSupport.js","sourceRoot":"","sources":["../../../src/domain/view/bfCacheSupport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAa,MAAM,mCAAmC,CAAA;AAE/E,MAAM,UAAU,gBAAgB,CAC9B,aAA4B,EAC5B,QAA8C;IAE9C,MAAM,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAC/B,aAAa,EACb,MAAM,wCAEN,CAAC,KAA0B,EAAE,EAAE;QAC7B,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;YACpB,QAAQ,CAAC,KAAK,CAAC,CAAA;QACjB,CAAC;IACH,CAAC,EACD,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAA;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { trackEventCounts } from '../trackEventCounts';
|
|
2
|
-
export function trackViewEventCounts(lifeCycle, viewId, onChange) {
|
|
3
|
-
const { stop, eventCounts } = trackEventCounts({
|
|
4
|
-
lifeCycle,
|
|
5
|
-
isChildEvent: (event) => event.view.id === viewId,
|
|
6
|
-
onChange,
|
|
7
|
-
});
|
|
8
|
-
return {
|
|
9
|
-
stop,
|
|
10
|
-
eventCounts,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=trackViewEventCounts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackViewEventCounts.js","sourceRoot":"","sources":["../../../src/domain/view/trackViewEventCounts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,UAAU,oBAAoB,CAAC,SAAoB,EAAE,MAAc,EAAE,QAAoB;IAC7F,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,gBAAgB,CAAC;QAC7C,SAAS;QACT,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM;QACjD,QAAQ;KACT,CAAC,CAAA;IAEF,OAAO;QACL,IAAI;QACJ,WAAW;KACZ,CAAA;AACH,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Duration, ClocksState, TimeStamp, RelativeTime, Context, ContextValue } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { Observable } from '@kubesense/kubesense-browser-core';
|
|
3
|
-
import type { ViewCustomTimings } from '../../rawRumEvent.types';
|
|
4
|
-
import { ViewLoadingType } from '../../rawRumEvent.types';
|
|
5
|
-
import type { LifeCycle } from '../lifeCycle';
|
|
6
|
-
import type { EventCounts } from '../trackEventCounts';
|
|
7
|
-
import type { LocationChange } from '../../browser/locationChangeObservable';
|
|
8
|
-
import type { RumConfiguration, RumInitConfiguration } from '../configuration';
|
|
9
|
-
import type { RumMutationRecord } from '../../browser/domMutationObservable';
|
|
10
|
-
import type { InitialViewMetrics } from './viewMetrics/trackInitialViewMetrics';
|
|
11
|
-
import type { CommonViewMetrics } from './viewMetrics/trackCommonViewMetrics';
|
|
12
|
-
export interface ViewEvent {
|
|
13
|
-
id: string;
|
|
14
|
-
name?: string;
|
|
15
|
-
service?: string;
|
|
16
|
-
version?: string;
|
|
17
|
-
context?: Context;
|
|
18
|
-
location: Readonly<Location>;
|
|
19
|
-
commonViewMetrics: CommonViewMetrics;
|
|
20
|
-
initialViewMetrics: InitialViewMetrics;
|
|
21
|
-
customTimings: ViewCustomTimings;
|
|
22
|
-
eventCounts: EventCounts;
|
|
23
|
-
documentVersion: number;
|
|
24
|
-
startClocks: ClocksState;
|
|
25
|
-
duration: Duration;
|
|
26
|
-
isActive: boolean;
|
|
27
|
-
sessionIsActive: boolean;
|
|
28
|
-
loadingType: ViewLoadingType;
|
|
29
|
-
}
|
|
30
|
-
export interface ViewCreatedEvent {
|
|
31
|
-
id: string;
|
|
32
|
-
name?: string;
|
|
33
|
-
service?: string;
|
|
34
|
-
version?: string;
|
|
35
|
-
context?: Context;
|
|
36
|
-
startClocks: ClocksState;
|
|
37
|
-
}
|
|
38
|
-
export interface BeforeViewUpdateEvent {
|
|
39
|
-
id: string;
|
|
40
|
-
name?: string;
|
|
41
|
-
context?: Context;
|
|
42
|
-
startClocks: ClocksState;
|
|
43
|
-
sessionIsActive: boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface ViewEndedEvent {
|
|
46
|
-
endClocks: ClocksState;
|
|
47
|
-
}
|
|
48
|
-
export declare const THROTTLE_VIEW_UPDATE_PERIOD = 3000;
|
|
49
|
-
export declare const SESSION_KEEP_ALIVE_INTERVAL: number;
|
|
50
|
-
export declare const KEEP_TRACKING_AFTER_VIEW_DELAY: number;
|
|
51
|
-
export interface ViewOptions {
|
|
52
|
-
name?: string;
|
|
53
|
-
service?: RumInitConfiguration['service'];
|
|
54
|
-
version?: RumInitConfiguration['version'];
|
|
55
|
-
context?: Context;
|
|
56
|
-
}
|
|
57
|
-
export declare function trackViews(location: Location, lifeCycle: LifeCycle, domMutationObservable: Observable<RumMutationRecord[]>, windowOpenObservable: Observable<void>, configuration: RumConfiguration, locationChangeObservable: Observable<LocationChange>, areViewsTrackedAutomatically: boolean, initialViewOptions?: ViewOptions): {
|
|
58
|
-
addTiming: (name: string, time?: RelativeTime | TimeStamp) => void;
|
|
59
|
-
startView: (options?: ViewOptions, startClocks?: ClocksState) => void;
|
|
60
|
-
setViewContext: (context: Context) => void;
|
|
61
|
-
setViewContextProperty: (key: string, value: ContextValue) => void;
|
|
62
|
-
setViewName: (name: string) => void;
|
|
63
|
-
getViewContext: () => Context;
|
|
64
|
-
stop: () => void;
|
|
65
|
-
};
|