@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,27 +1,51 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InitConfiguration, RawTelemetryConfiguration } from '@kubesense/kubesense-browser-core'
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
canUseEventBridge,
|
|
4
|
+
catchUserErrors,
|
|
5
5
|
serializeConfiguration,
|
|
6
6
|
DefaultPrivacyLevel,
|
|
7
7
|
TraceContextInjection,
|
|
8
8
|
display,
|
|
9
|
-
objectHasValue,
|
|
10
|
-
validateAndBuildConfiguration,
|
|
11
|
-
isSampleRate,
|
|
12
9
|
isNumber,
|
|
13
10
|
isNonEmptyArray,
|
|
11
|
+
BROWSER_CORE_SCHEMA,
|
|
14
12
|
} from '@kubesense/kubesense-browser-core'
|
|
13
|
+
import { isIndexableObject, isMatchOption } from '@kubesense/kubesense-js-core/util'
|
|
14
|
+
import { validateAndBuildConfiguration } from '@kubesense/kubesense-js-core/configuration'
|
|
15
|
+
import type { InferredConfig, MatchOption } from '@kubesense/kubesense-js-core/configuration'
|
|
15
16
|
import type { RumEventDomainContext } from '../../domainContext.types'
|
|
16
17
|
import type { RumEvent } from '../../rumEvent.types'
|
|
18
|
+
import type { SdkName } from '../contexts/defaultContext'
|
|
17
19
|
import type { RumPlugin } from '../plugins'
|
|
18
|
-
import { isTracingOption } from '../tracing/tracer'
|
|
19
20
|
import type { PropagatorType, TracingOption } from '../tracing/tracer.types'
|
|
21
|
+
import { getRemoteConfigurationId } from './remoteConfiguration'
|
|
22
|
+
import type { RemoteConfigurationMetadata } from './remoteConfigurationCache'
|
|
20
23
|
import type { SessionReplayRoutes } from './sessionReplayRoutes'
|
|
21
|
-
|
|
24
|
+
|
|
25
|
+
// replaced at build time
|
|
26
|
+
declare const __BUILD_ENV__SDK_SETUP__: string
|
|
22
27
|
|
|
23
28
|
export const DEFAULT_PROPAGATOR_TYPES: PropagatorType[] = ['tracecontext', 'kubesense']
|
|
24
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Default list of headers collected on resource events when {@link RumInitConfiguration.trackResourceHeaders | trackResourceHeaders}
|
|
32
|
+
* is set to `true`.
|
|
33
|
+
*/
|
|
34
|
+
export const DEFAULT_TRACKED_RESOURCE_HEADERS = [
|
|
35
|
+
'cache-control',
|
|
36
|
+
'etag',
|
|
37
|
+
'age',
|
|
38
|
+
'expires',
|
|
39
|
+
'content-type',
|
|
40
|
+
'content-encoding',
|
|
41
|
+
'vary',
|
|
42
|
+
'content-length',
|
|
43
|
+
'server-timing',
|
|
44
|
+
'x-cache',
|
|
45
|
+
'cf-cache-status',
|
|
46
|
+
'x-vercel-cache',
|
|
47
|
+
] as const
|
|
48
|
+
|
|
25
49
|
/**
|
|
26
50
|
* Init Configuration for the RUM browser SDK.
|
|
27
51
|
*
|
|
@@ -33,6 +57,7 @@ export const DEFAULT_PROPAGATOR_TYPES: PropagatorType[] = ['tracecontext', 'kube
|
|
|
33
57
|
* kubesenseSdk.init({
|
|
34
58
|
* applicationId: '<KUBESENSE_APPLICATION_ID>',
|
|
35
59
|
* clientToken: '<KUBESENSE_CLIENT_TOKEN>',
|
|
60
|
+
* kubesenseRumEndpoint: '<KUBESENSE_RUM_ENDPOINT>',
|
|
36
61
|
* // ...
|
|
37
62
|
* })
|
|
38
63
|
* ```
|
|
@@ -41,6 +66,7 @@ export const DEFAULT_PROPAGATOR_TYPES: PropagatorType[] = ['tracecontext', 'kube
|
|
|
41
66
|
* KUBESENSE_SDK.init({
|
|
42
67
|
* applicationId: '<KUBESENSE_APPLICATION_ID>',
|
|
43
68
|
* clientToken: '<KUBESENSE_CLIENT_TOKEN>',
|
|
69
|
+
* kubesenseRumEndpoint: '<KUBESENSE_RUM_ENDPOINT>',
|
|
44
70
|
* ...
|
|
45
71
|
* })
|
|
46
72
|
* ```
|
|
@@ -54,11 +80,21 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
54
80
|
*/
|
|
55
81
|
applicationId: string
|
|
56
82
|
|
|
83
|
+
/**
|
|
84
|
+
* The service name for your application. Follows the [tag syntax requirements](https://docs.kubesense.ai/getting_started/tagging/#define-tags).
|
|
85
|
+
*
|
|
86
|
+
* `allowedTracingUrls` still requires an explicitly configured service.
|
|
87
|
+
*
|
|
88
|
+
* @category Data Collection
|
|
89
|
+
* @defaultValue the `applicationId`
|
|
90
|
+
*/
|
|
91
|
+
service?: string | undefined | null
|
|
92
|
+
|
|
57
93
|
/**
|
|
58
94
|
* Whether to propagate user and account IDs in the baggage header of trace requests.
|
|
59
95
|
*
|
|
60
96
|
* @category Tracing
|
|
61
|
-
* @defaultValue
|
|
97
|
+
* @defaultValue true
|
|
62
98
|
*/
|
|
63
99
|
propagateTraceBaggage?: boolean | undefined
|
|
64
100
|
|
|
@@ -72,11 +108,8 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
72
108
|
* See [Enrich And Control Browser RUM Data With beforeSend](https://docs.kubesense.ai/real_user_monitoring/guide/enrich-and-control-rum-data) for further information.
|
|
73
109
|
*
|
|
74
110
|
* @category Data Collection
|
|
75
|
-
* @param event - The RUM event
|
|
76
|
-
* @param context - The RUM event domain context providing access to native browser data based on the event type (e.g. error, performance entry).
|
|
77
|
-
* @returns true if the event should be sent to Kubesense, false otherwise
|
|
78
111
|
*/
|
|
79
|
-
beforeSend?:
|
|
112
|
+
beforeSend?: RumBeforeSend | undefined
|
|
80
113
|
|
|
81
114
|
/**
|
|
82
115
|
* A list of request origins ignored when computing the page activity.
|
|
@@ -85,7 +118,7 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
85
118
|
excludedActivityUrls?: MatchOption[] | undefined
|
|
86
119
|
|
|
87
120
|
/**
|
|
88
|
-
* URL pointing to the
|
|
121
|
+
* URL pointing to the KubeSense Browser SDK Worker JavaScript file. The URL can be relative or absolute, but is required to have the same origin as the web application.
|
|
89
122
|
* See [Content Security Policy guidelines](https://docs.kubesense.ai/integrations/content_security_policy_logs/?tab=firefox#use-csp-with-real-user-monitoring-and-session-replay) for further information.
|
|
90
123
|
*
|
|
91
124
|
* @category Transport
|
|
@@ -93,7 +126,7 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
93
126
|
workerUrl?: string
|
|
94
127
|
|
|
95
128
|
/**
|
|
96
|
-
* Compress requests sent to the
|
|
129
|
+
* Compress requests sent to the KubeSense intake to reduce bandwidth usage when sending large amounts of data. The compression is done in a Worker thread.
|
|
97
130
|
* See [Content Security Policy guidelines](https://docs.kubesense.ai/integrations/content_security_policy_logs/?tab=firefox#use-csp-with-real-user-monitoring-and-session-replay) for further information.
|
|
98
131
|
*
|
|
99
132
|
* @category Transport
|
|
@@ -101,12 +134,25 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
101
134
|
compressIntakeRequests?: boolean | undefined
|
|
102
135
|
|
|
103
136
|
/**
|
|
104
|
-
* [Internal option] Id of the remote configuration
|
|
137
|
+
* [Internal option] Id of the remote configuration.
|
|
138
|
+
* Prefer `remoteConfiguration.id` for the non-blocking cache-and-reload path.
|
|
105
139
|
*
|
|
106
140
|
* @internal
|
|
107
141
|
*/
|
|
108
142
|
remoteConfigurationId?: string | undefined
|
|
109
143
|
|
|
144
|
+
/**
|
|
145
|
+
* [Internal option] Remote configuration descriptor. By default the SDK reads a cached
|
|
146
|
+
* configuration synchronously and refreshes it in the background. Set `sync: true` to fall back
|
|
147
|
+
* to the legacy blocking fetch. Set `required: true` to prevent the SDK from starting on the
|
|
148
|
+
* current page load when the remote configuration cache is empty or unreadable (the background
|
|
149
|
+
* fetch still runs to populate the cache for the next load). Ignored when `sync: true` is set
|
|
150
|
+
* or when the legacy `remoteConfigurationId` field is used.
|
|
151
|
+
*
|
|
152
|
+
* @internal
|
|
153
|
+
*/
|
|
154
|
+
remoteConfiguration?: { id: string; sync?: boolean; required?: boolean } | undefined
|
|
155
|
+
|
|
110
156
|
/**
|
|
111
157
|
* [Internal option] set a proxy URL for the remote configuration
|
|
112
158
|
*
|
|
@@ -115,17 +161,47 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
115
161
|
remoteConfigurationProxy?: string | undefined
|
|
116
162
|
|
|
117
163
|
/**
|
|
118
|
-
* Enable dashboard-managed SDK settings served by the
|
|
164
|
+
* Enable dashboard-managed SDK settings served by the KubeSense collector.
|
|
119
165
|
*
|
|
120
166
|
* The configuration document is fetched asynchronously after the SDK starts and cached in
|
|
121
167
|
* local storage, so it never delays initialization. Cached settings are applied on the next
|
|
122
168
|
* page load. Local `init()` values are used until a document has been fetched, and any
|
|
123
169
|
* setting absent from the document keeps its local value.
|
|
124
170
|
*
|
|
171
|
+
* @category Data Collection
|
|
125
172
|
* @defaultValue false
|
|
126
173
|
*/
|
|
127
174
|
enableRemoteSdkConfiguration?: boolean | undefined
|
|
128
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Restrict Session Replay recording to specific routes.
|
|
178
|
+
*
|
|
179
|
+
* Recording starts and stops as the user navigates: it runs only while the current route
|
|
180
|
+
* matches `include` (when provided) and does not match `exclude`. Rules are matched against
|
|
181
|
+
* the path (`pathname` + `search` + `hash`), and string entries match by prefix, so
|
|
182
|
+
* `/checkout` also covers `/checkout/payment`.
|
|
183
|
+
*
|
|
184
|
+
* These rules only narrow recording — a session that was not sampled in by
|
|
185
|
+
* `sessionReplaySampleRate` is never recorded, whatever the routes say.
|
|
186
|
+
*
|
|
187
|
+
* @category Session Replay
|
|
188
|
+
* @example
|
|
189
|
+
* ```ts
|
|
190
|
+
* sessionReplayRoutes: { include: ['/checkout', '/signup'], exclude: ['/checkout/card'] }
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
sessionReplayRoutes?: SessionReplayRoutes | undefined
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* A list of domains to treat as first-party in resource provider classification.
|
|
197
|
+
* Accepts strings (exact hostname match), RegExp, or functions.
|
|
198
|
+
* The current page hostname is always treated as first-party.
|
|
199
|
+
*
|
|
200
|
+
* @category Data Collection
|
|
201
|
+
* @example ['api.myapp.com', /\.myapp\.com$/, (host) => host.endsWith('.internal')]
|
|
202
|
+
*/
|
|
203
|
+
firstPartyDomains?: MatchOption[] | undefined
|
|
204
|
+
|
|
129
205
|
// tracing options
|
|
130
206
|
/**
|
|
131
207
|
* A list of request URLs used to inject tracing headers.
|
|
@@ -133,13 +209,15 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
133
209
|
*
|
|
134
210
|
* @category Tracing
|
|
135
211
|
*/
|
|
136
|
-
allowedTracingUrls?:
|
|
212
|
+
allowedTracingUrls?:
|
|
213
|
+
Array<MatchOption | { match: MatchOption; propagatorTypes?: PropagatorType[] | null | undefined }> | undefined
|
|
137
214
|
|
|
138
215
|
/**
|
|
139
216
|
* The percentage of requests to trace: 100 for all, 0 for none.
|
|
140
217
|
* See [Connect RUM and Traces](https://docs.kubesense.ai/real_user_monitoring/platform/connect_rum_and_traces/?tab=browserrum) for further information.
|
|
141
218
|
*
|
|
142
219
|
* @category Tracing
|
|
220
|
+
* @defaultValue 100
|
|
143
221
|
*/
|
|
144
222
|
traceSampleRate?: number | undefined
|
|
145
223
|
/**
|
|
@@ -159,65 +237,99 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
159
237
|
* See [Replay Privacy Options](https://docs.kubesense.ai/real_user_monitoring/session_replay/browser/privacy_options) for further information.
|
|
160
238
|
*
|
|
161
239
|
* @category Privacy
|
|
162
|
-
* @defaultValue mask
|
|
240
|
+
* @defaultValue mask-user-input
|
|
163
241
|
*/
|
|
164
242
|
defaultPrivacyLevel?: DefaultPrivacyLevel | undefined
|
|
165
243
|
|
|
166
244
|
/**
|
|
167
|
-
* If you are accessing
|
|
245
|
+
* If you are accessing KubeSense through a custom subdomain, you can set `subdomain` to include your custom domain in the `getSessionReplayLink()` returned URL .
|
|
168
246
|
*
|
|
169
247
|
* See [Connect Session Replay To Your Third-Party Tools](https://docs.kubesense.ai/real_user_monitoring/guide/connect-session-replay-to-your-third-party-tools) for further information.
|
|
170
248
|
*
|
|
249
|
+
* @category Session Replay
|
|
171
250
|
*/
|
|
172
251
|
subdomain?: string
|
|
173
252
|
|
|
174
253
|
/**
|
|
175
|
-
* The percentage of tracked sessions with [Browser RUM & Session Replay pricing](https://
|
|
254
|
+
* The percentage of tracked sessions with [Browser RUM & Session Replay pricing](https://rum.kubesense.ai/pricing/?product=real-user-monitoring--session-replay#real-user-monitoring--session-replay) features: 100 for all, 0 for none.
|
|
176
255
|
*
|
|
177
256
|
* See [Configure Your Setup For Browser RUM and Browser RUM & Session Replay Sampling](https://docs.kubesense.ai/real_user_monitoring/guide/sampling-browser-plans) for further information.
|
|
178
257
|
*
|
|
179
258
|
* @category Session Replay
|
|
259
|
+
* @defaultValue 0
|
|
180
260
|
*/
|
|
181
261
|
sessionReplaySampleRate?: number | undefined
|
|
182
262
|
|
|
183
263
|
/**
|
|
184
|
-
* If the session is sampled for Session Replay, only start the recording when `startSessionReplayRecording()` is called, instead of at the beginning of the session.
|
|
264
|
+
* If the session is sampled for Session Replay, only start the recording when `startSessionReplayRecording()` is called, instead of at the beginning of the session.
|
|
185
265
|
*
|
|
186
266
|
* See [Session Replay Usage](https://docs.kubesense.ai/real_user_monitoring/session_replay/browser/#usage) for further information.
|
|
187
267
|
*
|
|
188
268
|
* @category Session Replay
|
|
269
|
+
* @defaultValue false
|
|
189
270
|
*/
|
|
190
271
|
startSessionReplayRecordingManually?: boolean | undefined
|
|
191
272
|
|
|
192
273
|
/**
|
|
193
|
-
*
|
|
274
|
+
* Records `<canvas>` content (most chart libraries draw on one) in Session Replay as captured frames.
|
|
275
|
+
* Canvas recording is disabled when this option is omitted.
|
|
194
276
|
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
277
|
+
* A canvas is captured only when its privacy level is `allow` — set with `data-kubesense-privacy="allow"`
|
|
278
|
+
* or the `kubesense-privacy-allow` class on it or an ancestor — and only when its content changed.
|
|
279
|
+
* Frames are WebP images (PNG where the browser cannot encode WebP), uploaded next to the replay
|
|
280
|
+
* segments and deduplicated by content.
|
|
199
281
|
*
|
|
200
|
-
*
|
|
201
|
-
* `sessionReplaySampleRate` is never recorded, whatever the routes say.
|
|
282
|
+
* `quality` picks a preset; the other fields override single values of that preset.
|
|
202
283
|
*
|
|
203
284
|
* @category Session Replay
|
|
204
|
-
* @example
|
|
205
|
-
* ```ts
|
|
206
|
-
* sessionReplayRoutes: { include: ['/checkout', '/signup'], exclude: ['/checkout/card'] }
|
|
207
|
-
* ```
|
|
208
285
|
*/
|
|
209
|
-
|
|
286
|
+
sessionReplayCanvasRecording?:
|
|
287
|
+
| {
|
|
288
|
+
/**
|
|
289
|
+
* Enables recording canvas elements in Session Replay.
|
|
290
|
+
*/
|
|
291
|
+
enable: boolean
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Trades frame rate and image resolution for bandwidth. See {@link CanvasRecordingQuality}.
|
|
295
|
+
*
|
|
296
|
+
* @defaultValue 'medium'
|
|
297
|
+
*/
|
|
298
|
+
quality?: CanvasRecordingQuality | undefined
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Overrides the preset's maximum number of frames captured per second, between 0 and 8. `0`
|
|
302
|
+
* stops capturing frames.
|
|
303
|
+
*/
|
|
304
|
+
maxFramesPerSecond?: number | undefined
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Overrides the preset's longest side of a captured frame, in pixels, between 1 and 1280. Larger
|
|
308
|
+
* canvases are downscaled proportionally.
|
|
309
|
+
*/
|
|
310
|
+
maxImageDimension?: number | undefined
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Overrides the preset's size of the thumbnail compared to detect a changed canvas, in pixels,
|
|
314
|
+
* between 1 and 100.
|
|
315
|
+
*/
|
|
316
|
+
hashingMaxDimension?: number | undefined
|
|
317
|
+
}
|
|
318
|
+
| undefined
|
|
210
319
|
|
|
211
320
|
/**
|
|
212
321
|
* Enables privacy control for action names.
|
|
213
322
|
*
|
|
214
323
|
* @category Privacy
|
|
324
|
+
* @defaultValue true
|
|
215
325
|
*/
|
|
216
|
-
enablePrivacyForActionName?: boolean | undefined
|
|
326
|
+
enablePrivacyForActionName?: boolean | undefined
|
|
217
327
|
|
|
218
328
|
/**
|
|
219
329
|
* Enables automatic collection of users actions.
|
|
220
330
|
*
|
|
331
|
+
* Add `data-dd-ignore-frustration` without a value, or set it to `all`, to ignore all frustration signals for an element and its descendants. To ignore specific signals, use a space-separated list of `rage-click`, `dead-click`, and `error-click`.
|
|
332
|
+
*
|
|
221
333
|
* See [Tracking User Actions](https://docs.kubesense.ai/real_user_monitoring/browser/tracking_user_actions) for further information.
|
|
222
334
|
*
|
|
223
335
|
* @category Data Collection
|
|
@@ -242,14 +354,6 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
242
354
|
*/
|
|
243
355
|
trackViewsManually?: boolean | undefined
|
|
244
356
|
|
|
245
|
-
/**
|
|
246
|
-
* Enable the creation of dedicated views for pages restored from the Back-Forward cache.
|
|
247
|
-
*
|
|
248
|
-
* @category Data Collection
|
|
249
|
-
* @defaultValue false
|
|
250
|
-
*/
|
|
251
|
-
trackBfcacheViews?: boolean | undefined
|
|
252
|
-
|
|
253
357
|
/**
|
|
254
358
|
* Enables collection of resource events.
|
|
255
359
|
*
|
|
@@ -259,24 +363,47 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
259
363
|
trackResources?: boolean | undefined
|
|
260
364
|
|
|
261
365
|
/**
|
|
262
|
-
* Enables collection of
|
|
366
|
+
* Enables collection of request and response headers on resource events.
|
|
367
|
+
*
|
|
368
|
+
* - `true`: collect {@link DEFAULT_TRACKED_RESOURCE_HEADERS} for all URLs, both directions
|
|
369
|
+
* - `MatchHeader[]`: each {@link MatchHeader} targets a header name, with optional URL scope
|
|
370
|
+
* (`url`), value extraction (`extractor`), and `location`. When `name` is omitted, the matcher
|
|
371
|
+
* applies to {@link DEFAULT_TRACKED_RESOURCE_HEADERS}. By default, both request and response
|
|
372
|
+
* headers are captured; set `location` to `'request'` or `'response'` to restrict to one.
|
|
373
|
+
*
|
|
374
|
+
* Headers whose names match a built-in sensitive-data pattern are always dropped, regardless
|
|
375
|
+
* of the configured matchers. The pattern blocks headers whose names contain: `token`, `cookie`,
|
|
376
|
+
* `secret`, `authorization`, `api-key`, `secret-key`, `access-key`, `app-key`, `client-ip`,
|
|
377
|
+
* `connecting-ip`, `real-ip`, or `forwarded`.
|
|
263
378
|
*
|
|
264
379
|
* @category Data Collection
|
|
265
|
-
* @defaultValue
|
|
380
|
+
* @defaultValue false (disabled)
|
|
381
|
+
* @example
|
|
382
|
+
* // Collect default headers plus custom ones for all URLs
|
|
383
|
+
* trackResourceHeaders: [{}, { name: 'x-request-id' }]
|
|
384
|
+
* @example
|
|
385
|
+
* // Collect default headers from responses only
|
|
386
|
+
* trackResourceHeaders: [{ location: 'response' }]
|
|
387
|
+
* @example
|
|
388
|
+
* // URL-scoped rule: capture specific response headers only for calls to /api
|
|
389
|
+
* trackResourceHeaders: [{ url: /\/api\//, name: 'cache-control', location: 'response' }]
|
|
390
|
+
* @example
|
|
391
|
+
* // Extract a partial value from a header
|
|
392
|
+
* trackResourceHeaders: [{ url: /\/api\//, name: 'server-timing', extractor: /dur=(\d+)/, location: 'response' }]
|
|
266
393
|
*/
|
|
267
|
-
|
|
394
|
+
trackResourceHeaders?: boolean | MatchHeader[] | undefined
|
|
268
395
|
|
|
269
396
|
/**
|
|
270
|
-
* Enables
|
|
397
|
+
* Enables collection of long task events.
|
|
271
398
|
*
|
|
272
399
|
* @category Data Collection
|
|
273
|
-
* @defaultValue
|
|
400
|
+
* @defaultValue true
|
|
274
401
|
*/
|
|
275
|
-
|
|
402
|
+
trackLongTasks?: boolean | undefined
|
|
276
403
|
|
|
277
404
|
/**
|
|
278
405
|
* List of plugins to enable. The plugins API is unstable and experimental, and may change without
|
|
279
|
-
* notice. Please use only plugins provided by
|
|
406
|
+
* notice. Please use only plugins provided by KubeSense matching the version of the SDK you are
|
|
280
407
|
* using.
|
|
281
408
|
*/
|
|
282
409
|
plugins?: RumPlugin[] | undefined
|
|
@@ -304,170 +431,334 @@ export interface RumInitConfiguration extends InitConfiguration {
|
|
|
304
431
|
allowedGraphQlUrls?: Array<MatchOption | GraphQlUrlOption> | undefined
|
|
305
432
|
|
|
306
433
|
/**
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
* The current page hostname is always treated as first-party.
|
|
434
|
+
* Enable partial view updates, which reduces bandwidth by sending only changed
|
|
435
|
+
* fields instead of full view events on intermediate updates.
|
|
310
436
|
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
437
|
+
* Enabled by default when the SDK is loaded from the CDN and no `proxy` is configured.
|
|
438
|
+
* Disabled by default otherwise, because a proxy may not forward the `view_update` event type.
|
|
439
|
+
*
|
|
440
|
+
* @category Beta
|
|
313
441
|
*/
|
|
314
|
-
|
|
442
|
+
betaEnableViewUpdates?: boolean | undefined
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Enables collection of WebSocket resource events.
|
|
446
|
+
*
|
|
447
|
+
* Warning: enabling this option introduces WebSocket resource events to the `beforeSend` hook.
|
|
448
|
+
* Their domain context is WebSocket-specific and does not contain the XHR, Fetch, or performance
|
|
449
|
+
* entry fields available on regular resource events. Narrow the context using the existing
|
|
450
|
+
* `isManual` and `isWebSocket` discriminants before accessing those fields.
|
|
451
|
+
*
|
|
452
|
+
* @category Beta
|
|
453
|
+
*/
|
|
454
|
+
betaTrackWebSockets?: boolean | undefined
|
|
315
455
|
}
|
|
316
456
|
|
|
317
|
-
|
|
457
|
+
/**
|
|
458
|
+
* Recording quality presets for canvas capture. See {@link RumInitConfiguration.sessionReplayCanvasRecording}.
|
|
459
|
+
*
|
|
460
|
+
* | Preset | Frames per second | Longest side | WebP quality |
|
|
461
|
+
* | -------- | ----------------- | ------------ | ------------ |
|
|
462
|
+
* | `low` | 1 | 600 px | 0.3 |
|
|
463
|
+
* | `medium` | 4 | 1000 px | 0.5 |
|
|
464
|
+
* | `high` | 8 | 1280 px | 0.75 |
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
* ```ts
|
|
468
|
+
* kubesenseSdk.init({
|
|
469
|
+
* // ...
|
|
470
|
+
* sessionReplayCanvasRecording: {
|
|
471
|
+
* enable: true,
|
|
472
|
+
* quality: CanvasRecordingQuality.MEDIUM,
|
|
473
|
+
* },
|
|
474
|
+
* })
|
|
475
|
+
* ```
|
|
476
|
+
*/
|
|
477
|
+
export const CanvasRecordingQuality = {
|
|
478
|
+
LOW: 'low',
|
|
479
|
+
MEDIUM: 'medium',
|
|
480
|
+
HIGH: 'high',
|
|
481
|
+
} as const
|
|
482
|
+
export type CanvasRecordingQuality = (typeof CanvasRecordingQuality)[keyof typeof CanvasRecordingQuality]
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* The resolved canvas recording tuning behind each {@link CanvasRecordingQuality} preset.
|
|
486
|
+
*/
|
|
487
|
+
export interface CanvasRecordingConfiguration {
|
|
488
|
+
enable: true
|
|
489
|
+
maxFramesPerSecond: number
|
|
490
|
+
hashingMaxDimension: number
|
|
491
|
+
maxImageDimension: number
|
|
492
|
+
encodeQuality: number
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const CANVAS_RECORDING_QUALITY_PRESETS: Record<CanvasRecordingQuality, Omit<CanvasRecordingConfiguration, 'enable'>> = {
|
|
496
|
+
[CanvasRecordingQuality.LOW]: {
|
|
497
|
+
maxFramesPerSecond: 1,
|
|
498
|
+
hashingMaxDimension: 50,
|
|
499
|
+
maxImageDimension: 600,
|
|
500
|
+
encodeQuality: 0.3,
|
|
501
|
+
},
|
|
502
|
+
[CanvasRecordingQuality.MEDIUM]: {
|
|
503
|
+
maxFramesPerSecond: 4,
|
|
504
|
+
hashingMaxDimension: 100,
|
|
505
|
+
maxImageDimension: 1000,
|
|
506
|
+
encodeQuality: 0.5,
|
|
507
|
+
},
|
|
508
|
+
[CanvasRecordingQuality.HIGH]: {
|
|
509
|
+
maxFramesPerSecond: 8,
|
|
510
|
+
hashingMaxDimension: 100,
|
|
511
|
+
maxImageDimension: 1280,
|
|
512
|
+
encodeQuality: 0.75,
|
|
513
|
+
},
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Upstream gates canvas recording behind the `session_replay_record_canvas` experimental flag; in
|
|
518
|
+
* this SDK it is a regular option. The preset's values can be overridden one by one, which is how the
|
|
519
|
+
* dashboard's remote configuration tunes them.
|
|
520
|
+
*/
|
|
521
|
+
function resolveCanvasRecordingConfiguration(
|
|
522
|
+
configuration:
|
|
523
|
+
| {
|
|
524
|
+
enable: boolean
|
|
525
|
+
quality: CanvasRecordingQuality
|
|
526
|
+
maxFramesPerSecond?: number
|
|
527
|
+
maxImageDimension?: number
|
|
528
|
+
hashingMaxDimension?: number
|
|
529
|
+
}
|
|
530
|
+
| undefined
|
|
531
|
+
): CanvasRecordingConfiguration | undefined {
|
|
532
|
+
const preset = configuration && CANVAS_RECORDING_QUALITY_PRESETS[configuration.quality]
|
|
533
|
+
if (!configuration?.enable || !preset) {
|
|
534
|
+
return undefined
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
return {
|
|
538
|
+
enable: true,
|
|
539
|
+
...preset,
|
|
540
|
+
maxFramesPerSecond: configuration.maxFramesPerSecond ?? preset.maxFramesPerSecond,
|
|
541
|
+
maxImageDimension: configuration.maxImageDimension ?? preset.maxImageDimension,
|
|
542
|
+
hashingMaxDimension: configuration.hashingMaxDimension ?? preset.hashingMaxDimension,
|
|
543
|
+
}
|
|
544
|
+
}
|
|
318
545
|
|
|
319
546
|
export type FeatureFlagsForEvents = 'vital' | 'action' | 'long_task' | 'resource'
|
|
320
547
|
|
|
548
|
+
/**
|
|
549
|
+
* Function called before a RUM event is sent to KubeSense. See {@link RumInitConfiguration.beforeSend}
|
|
550
|
+
*
|
|
551
|
+
* @param event - The RUM event
|
|
552
|
+
* @param context - The RUM event domain context providing access to native browser data based on the event type (e.g. error, performance entry).
|
|
553
|
+
* @returns true if the event should be sent to KubeSense, false otherwise
|
|
554
|
+
*/
|
|
555
|
+
export type RumBeforeSend = (event: RumEvent, context: RumEventDomainContext) => boolean
|
|
556
|
+
|
|
321
557
|
export interface GraphQlUrlOption {
|
|
322
558
|
match: MatchOption
|
|
323
559
|
trackPayload?: boolean
|
|
324
560
|
trackResponseErrors?: boolean
|
|
325
561
|
}
|
|
326
562
|
|
|
327
|
-
export interface
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
563
|
+
export interface MatchHeader {
|
|
564
|
+
url?: MatchOption
|
|
565
|
+
name?: MatchOption
|
|
566
|
+
extractor?: RegExp
|
|
567
|
+
location?: 'request' | 'response' | 'any'
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export const RUM_SCHEMA = {
|
|
571
|
+
...BROWSER_CORE_SCHEMA,
|
|
572
|
+
|
|
573
|
+
// Required
|
|
574
|
+
applicationId: { type: 'string', required: true },
|
|
575
|
+
|
|
576
|
+
// Optional strings
|
|
577
|
+
actionNameAttribute: { type: 'string' },
|
|
578
|
+
workerUrl: { type: 'string' },
|
|
579
|
+
subdomain: { type: 'string' },
|
|
580
|
+
|
|
581
|
+
// Sample rates
|
|
582
|
+
sessionReplaySampleRate: { type: 'percentage', default: 0 },
|
|
583
|
+
traceSampleRate: { type: 'percentage', default: 100 },
|
|
584
|
+
profilingSampleRate: { type: 'percentage', default: 0 },
|
|
585
|
+
|
|
586
|
+
// Booleans
|
|
587
|
+
compressIntakeRequests: { type: 'boolean', default: false },
|
|
588
|
+
trackUserInteractions: { type: 'boolean', default: true, strict: false },
|
|
589
|
+
trackResources: { type: 'boolean', default: true, strict: false },
|
|
590
|
+
trackLongTasks: { type: 'boolean', default: true, strict: false },
|
|
591
|
+
trackViewsManually: { type: 'boolean', default: false, strict: false },
|
|
592
|
+
betaEnableViewUpdates: { type: 'boolean' },
|
|
593
|
+
betaTrackWebSockets: { type: 'boolean', default: false, strict: false },
|
|
594
|
+
enablePrivacyForActionName: { type: 'boolean', default: true },
|
|
595
|
+
propagateTraceBaggage: { type: 'boolean', default: true },
|
|
596
|
+
startSessionReplayRecordingManually: { type: 'boolean', default: false, strict: false },
|
|
597
|
+
enableRemoteSdkConfiguration: { type: 'boolean', default: false, strict: false },
|
|
598
|
+
// KubeSense extensions
|
|
599
|
+
firstPartyDomains: { type: 'match-option', multiple: true, default: [] as MatchOption[] },
|
|
600
|
+
sessionReplayRoutes: {
|
|
601
|
+
type: 'schema',
|
|
602
|
+
strict: false,
|
|
603
|
+
schema: {
|
|
604
|
+
// Not strict: an unusable entry is dropped rather than failing the whole configuration, so a
|
|
605
|
+
// typo in one route does not take Session Replay down entirely.
|
|
606
|
+
include: { type: 'match-option', multiple: true, strict: false },
|
|
607
|
+
exclude: { type: 'match-option', multiple: true, strict: false },
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
|
|
611
|
+
sessionReplayCanvasRecording: {
|
|
612
|
+
type: 'schema',
|
|
613
|
+
schema: {
|
|
614
|
+
enable: { type: 'boolean', required: true },
|
|
615
|
+
quality: { type: 'enum', values: CanvasRecordingQuality, default: CanvasRecordingQuality.MEDIUM },
|
|
616
|
+
maxFramesPerSecond: { type: 'number', min: 0, max: 8 },
|
|
617
|
+
maxImageDimension: { type: 'number', min: 1, max: 1280 },
|
|
618
|
+
hashingMaxDimension: { type: 'number', min: 1, max: 100 },
|
|
619
|
+
},
|
|
620
|
+
},
|
|
621
|
+
|
|
622
|
+
// Enums
|
|
623
|
+
defaultPrivacyLevel: {
|
|
624
|
+
type: 'enum',
|
|
625
|
+
values: DefaultPrivacyLevel,
|
|
626
|
+
default: DefaultPrivacyLevel.MASK_USER_INPUT,
|
|
627
|
+
strict: false,
|
|
628
|
+
},
|
|
629
|
+
traceContextInjection: {
|
|
630
|
+
type: 'enum',
|
|
631
|
+
values: TraceContextInjection,
|
|
632
|
+
default: TraceContextInjection.SAMPLED,
|
|
633
|
+
strict: false,
|
|
634
|
+
},
|
|
635
|
+
|
|
636
|
+
// Arrays
|
|
637
|
+
excludedActivityUrls: { type: 'match-option', multiple: true, default: [] as MatchOption[] },
|
|
638
|
+
allowedTracingUrls: {
|
|
639
|
+
type: 'union',
|
|
640
|
+
multiple: true,
|
|
641
|
+
strict: false,
|
|
642
|
+
default: [] as Array<MatchOption | { match: MatchOption; propagatorTypes: PropagatorType[] }>,
|
|
643
|
+
variants: [
|
|
644
|
+
{ type: 'match-option' },
|
|
645
|
+
{
|
|
646
|
+
type: 'schema',
|
|
647
|
+
schema: {
|
|
648
|
+
match: { type: 'match-option', required: true },
|
|
649
|
+
propagatorTypes: {
|
|
650
|
+
type: 'enum',
|
|
651
|
+
values: ['kubesense', 'b3', 'b3multi', 'tracecontext'] as const,
|
|
652
|
+
multiple: true,
|
|
653
|
+
strict: false,
|
|
654
|
+
default: DEFAULT_PROPAGATOR_TYPES,
|
|
655
|
+
},
|
|
656
|
+
},
|
|
657
|
+
},
|
|
658
|
+
],
|
|
659
|
+
},
|
|
660
|
+
plugins: {
|
|
661
|
+
type: 'schema',
|
|
662
|
+
multiple: true,
|
|
663
|
+
strict: false,
|
|
664
|
+
default: [] as RumPlugin[],
|
|
665
|
+
schema: {
|
|
666
|
+
name: { type: 'string', required: true },
|
|
667
|
+
getConfigurationTelemetry: {
|
|
668
|
+
type: 'function',
|
|
669
|
+
strict: false,
|
|
670
|
+
signature: undefined as RumPlugin['getConfigurationTelemetry'],
|
|
671
|
+
},
|
|
672
|
+
onInit: { type: 'function', strict: false, signature: undefined as RumPlugin['onInit'] },
|
|
673
|
+
onRumStart: { type: 'function', strict: false, signature: undefined as RumPlugin['onRumStart'] },
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
trackFeatureFlagsForEvents: {
|
|
677
|
+
type: 'enum',
|
|
678
|
+
values: ['vital', 'action', 'long_task', 'resource'] as const,
|
|
679
|
+
multiple: true,
|
|
680
|
+
strict: false,
|
|
681
|
+
default: [] as FeatureFlagsForEvents[],
|
|
682
|
+
},
|
|
683
|
+
} as const
|
|
684
|
+
|
|
685
|
+
export type RumConfiguration = Omit<
|
|
686
|
+
InferredConfig<typeof RUM_SCHEMA>,
|
|
687
|
+
'allowedTracingUrls' | 'sessionReplayCanvasRecording'
|
|
688
|
+
> & {
|
|
332
689
|
allowedTracingUrls: TracingOption[]
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
applicationId: string
|
|
337
|
-
defaultPrivacyLevel: DefaultPrivacyLevel
|
|
338
|
-
enablePrivacyForActionName: boolean
|
|
339
|
-
sessionReplaySampleRate: number
|
|
340
|
-
startSessionReplayRecordingManually: boolean
|
|
341
|
-
sessionReplayRoutes: SessionReplayRoutes | undefined
|
|
342
|
-
trackUserInteractions: boolean
|
|
343
|
-
trackViewsManually: boolean
|
|
344
|
-
trackResources: boolean
|
|
345
|
-
trackLongTasks: boolean
|
|
346
|
-
trackBfcacheViews: boolean
|
|
347
|
-
trackEarlyRequests: boolean
|
|
348
|
-
subdomain?: string
|
|
349
|
-
traceContextInjection: TraceContextInjection
|
|
350
|
-
plugins: RumPlugin[]
|
|
351
|
-
trackFeatureFlagsForEvents: FeatureFlagsForEvents[]
|
|
352
|
-
profilingSampleRate: number
|
|
353
|
-
propagateTraceBaggage: boolean
|
|
690
|
+
betaEnableViewUpdates: boolean
|
|
691
|
+
rulePsr: number | undefined
|
|
692
|
+
trackResourceHeaders: MatchHeader[]
|
|
354
693
|
allowedGraphQlUrls: GraphQlUrlOption[]
|
|
355
|
-
|
|
694
|
+
remoteConfigurationId: string | undefined
|
|
695
|
+
sessionReplayCanvasRecording: CanvasRecordingConfiguration | undefined
|
|
356
696
|
}
|
|
357
697
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
698
|
+
/**
|
|
699
|
+
* Resolves whether partial view updates are enabled. Never enabled when the event bridge is used.
|
|
700
|
+
* Otherwise an explicit `betaEnableViewUpdates` takes precedence, and it defaults to true for CDN
|
|
701
|
+
* users that do not go through a proxy: a proxy may not forward the `view_update` event type yet,
|
|
702
|
+
* and npm users pin an SDK version so they opt in explicitly.
|
|
703
|
+
*
|
|
704
|
+
* The CDN check is temporary, the next step is to default this to true unless `proxy` is set.
|
|
705
|
+
* TODO next major: remove the option.
|
|
706
|
+
*/
|
|
707
|
+
function isViewUpdatesEnabled(
|
|
708
|
+
explicit: boolean | undefined,
|
|
709
|
+
proxy: InitConfiguration['proxy'],
|
|
710
|
+
sdkName: SdkName | undefined
|
|
711
|
+
): boolean {
|
|
712
|
+
if (canUseEventBridge()) {
|
|
713
|
+
// The bridge replaces the batch transport, and `view_update` events are only created by the
|
|
714
|
+
// batch dispatcher, so partial updates never happen in a WebView. Ignore the explicit value
|
|
715
|
+
// too, otherwise telemetry reports updates that cannot be sent.
|
|
716
|
+
return false
|
|
372
717
|
}
|
|
373
718
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
)
|
|
378
|
-
|
|
379
|
-
}
|
|
719
|
+
// The Salesforce bundle is a CDN build, but the supported install flow uploads it as a static
|
|
720
|
+
// resource, so publishing a new bundle does not roll those deployments back. Keep them out of
|
|
721
|
+
// the default, they can still opt in explicitly.
|
|
722
|
+
return explicit ?? (__BUILD_ENV__SDK_SETUP__ === 'cdn' && !proxy && sdkName !== 'rum-salesforce')
|
|
723
|
+
}
|
|
380
724
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
725
|
+
export function validateAndBuildRumConfiguration(
|
|
726
|
+
initConfiguration: RumInitConfiguration,
|
|
727
|
+
sdkName?: SdkName
|
|
728
|
+
): RumConfiguration | undefined {
|
|
729
|
+
const config = validateAndBuildConfiguration(
|
|
730
|
+
initConfiguration as unknown as Record<string, unknown>,
|
|
731
|
+
RUM_SCHEMA,
|
|
732
|
+
display
|
|
733
|
+
)
|
|
385
734
|
|
|
386
|
-
|
|
387
|
-
if (!allowedTracingUrls) {
|
|
735
|
+
if (!config) {
|
|
388
736
|
return
|
|
389
737
|
}
|
|
390
738
|
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
const allowedGraphQlUrls = validateAndBuildGraphQlOptions(initConfiguration)
|
|
739
|
+
const allowedTracingUrls = config.allowedTracingUrls.map(normalizeTracingOption).filter(Boolean) as TracingOption[]
|
|
394
740
|
|
|
395
|
-
if (!
|
|
741
|
+
if (allowedTracingUrls.length > 0 && !config.service) {
|
|
742
|
+
display.error('Service needs to be configured when tracing is enabled')
|
|
396
743
|
return
|
|
397
744
|
}
|
|
398
745
|
|
|
399
|
-
const
|
|
746
|
+
const sessionReplayCanvasRecording = resolveCanvasRecordingConfiguration(config.sessionReplayCanvasRecording)
|
|
400
747
|
|
|
401
748
|
return {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
initConfiguration.startSessionReplayRecordingManually !== undefined
|
|
407
|
-
? !!initConfiguration.startSessionReplayRecordingManually
|
|
408
|
-
: sessionReplaySampleRate === 0,
|
|
409
|
-
sessionReplayRoutes: validateSessionReplayRoutes(initConfiguration.sessionReplayRoutes),
|
|
410
|
-
traceSampleRate: initConfiguration.traceSampleRate ?? 100,
|
|
411
|
-
rulePsr: isNumber(initConfiguration.traceSampleRate) ? initConfiguration.traceSampleRate / 100 : undefined,
|
|
749
|
+
...config,
|
|
750
|
+
service: config.service || config.applicationId,
|
|
751
|
+
sessionReplayCanvasRecording,
|
|
752
|
+
betaEnableViewUpdates: isViewUpdatesEnabled(config.betaEnableViewUpdates, config.proxy, sdkName),
|
|
412
753
|
allowedTracingUrls,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
trackBfcacheViews: !!initConfiguration.trackBfcacheViews,
|
|
421
|
-
trackEarlyRequests: !!initConfiguration.trackEarlyRequests,
|
|
422
|
-
subdomain: initConfiguration.subdomain,
|
|
423
|
-
defaultPrivacyLevel: objectHasValue(DefaultPrivacyLevel, initConfiguration.defaultPrivacyLevel)
|
|
424
|
-
? initConfiguration.defaultPrivacyLevel
|
|
425
|
-
: DefaultPrivacyLevel.MASK,
|
|
426
|
-
enablePrivacyForActionName: !!initConfiguration.enablePrivacyForActionName,
|
|
427
|
-
traceContextInjection: objectHasValue(TraceContextInjection, initConfiguration.traceContextInjection)
|
|
428
|
-
? initConfiguration.traceContextInjection
|
|
429
|
-
: TraceContextInjection.SAMPLED,
|
|
430
|
-
plugins: initConfiguration.plugins || [],
|
|
431
|
-
trackFeatureFlagsForEvents: initConfiguration.trackFeatureFlagsForEvents || [],
|
|
432
|
-
profilingSampleRate: initConfiguration.profilingSampleRate ?? 0,
|
|
433
|
-
propagateTraceBaggage: !!initConfiguration.propagateTraceBaggage,
|
|
434
|
-
allowedGraphQlUrls,
|
|
435
|
-
firstPartyDomains: initConfiguration.firstPartyDomains ?? [],
|
|
436
|
-
...baseConfiguration,
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Validates allowedTracingUrls and converts match options to tracing options
|
|
442
|
-
*/
|
|
443
|
-
function validateAndBuildTracingOptions(initConfiguration: RumInitConfiguration): TracingOption[] | undefined {
|
|
444
|
-
if (initConfiguration.allowedTracingUrls === undefined) {
|
|
445
|
-
return []
|
|
446
|
-
}
|
|
447
|
-
if (!Array.isArray(initConfiguration.allowedTracingUrls)) {
|
|
448
|
-
display.error('Allowed Tracing URLs should be an array')
|
|
449
|
-
return
|
|
450
|
-
}
|
|
451
|
-
if (initConfiguration.allowedTracingUrls.length !== 0 && initConfiguration.service === undefined) {
|
|
452
|
-
display.error('Service needs to be configured when tracing is enabled')
|
|
453
|
-
return
|
|
754
|
+
beforeSend: config.beforeSend
|
|
755
|
+
? (catchUserErrors(config.beforeSend, 'beforeSend threw an error:') as typeof config.beforeSend)
|
|
756
|
+
: undefined,
|
|
757
|
+
rulePsr: isNumber(initConfiguration.traceSampleRate) ? initConfiguration.traceSampleRate / 100 : undefined,
|
|
758
|
+
trackResourceHeaders: validateAndBuildTrackResourceHeaders(initConfiguration),
|
|
759
|
+
allowedGraphQlUrls: validateAndBuildGraphQlOptions(initConfiguration),
|
|
760
|
+
remoteConfigurationId: getRemoteConfigurationId(initConfiguration),
|
|
454
761
|
}
|
|
455
|
-
// Convert from (MatchOption | TracingOption) to TracingOption, remove unknown properties
|
|
456
|
-
const tracingOptions: TracingOption[] = []
|
|
457
|
-
initConfiguration.allowedTracingUrls.forEach((option) => {
|
|
458
|
-
if (isMatchOption(option)) {
|
|
459
|
-
tracingOptions.push({ match: option, propagatorTypes: DEFAULT_PROPAGATOR_TYPES })
|
|
460
|
-
} else if (isTracingOption(option)) {
|
|
461
|
-
tracingOptions.push(option)
|
|
462
|
-
} else {
|
|
463
|
-
display.warn(
|
|
464
|
-
'Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter',
|
|
465
|
-
option
|
|
466
|
-
)
|
|
467
|
-
}
|
|
468
|
-
})
|
|
469
|
-
|
|
470
|
-
return tracingOptions
|
|
471
762
|
}
|
|
472
763
|
|
|
473
764
|
/**
|
|
@@ -478,18 +769,32 @@ function getSelectedTracingPropagators(configuration: RumInitConfiguration): Pro
|
|
|
478
769
|
|
|
479
770
|
if (isNonEmptyArray(configuration.allowedTracingUrls)) {
|
|
480
771
|
configuration.allowedTracingUrls.forEach((option) => {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
// Ensure we have an array, as we cannot rely on types yet (configuration is provided by users)
|
|
485
|
-
option.propagatorTypes.forEach((propagatorType) => usedTracingPropagators.add(propagatorType))
|
|
486
|
-
}
|
|
772
|
+
normalizeTracingOption(option)?.propagatorTypes.forEach((propagatorType) =>
|
|
773
|
+
usedTracingPropagators.add(propagatorType)
|
|
774
|
+
)
|
|
487
775
|
})
|
|
488
776
|
}
|
|
489
777
|
|
|
490
778
|
return Array.from(usedTracingPropagators)
|
|
491
779
|
}
|
|
492
780
|
|
|
781
|
+
function normalizeTracingOption(option: unknown): TracingOption | undefined {
|
|
782
|
+
if (isMatchOption(option)) {
|
|
783
|
+
return { match: option, propagatorTypes: DEFAULT_PROPAGATOR_TYPES }
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
if (
|
|
787
|
+
isIndexableObject(option) &&
|
|
788
|
+
isMatchOption(option.match) &&
|
|
789
|
+
(option.propagatorTypes === null || option.propagatorTypes === undefined || Array.isArray(option.propagatorTypes))
|
|
790
|
+
) {
|
|
791
|
+
return {
|
|
792
|
+
match: option.match,
|
|
793
|
+
propagatorTypes: option.propagatorTypes || DEFAULT_PROPAGATOR_TYPES,
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
493
798
|
/**
|
|
494
799
|
* Build GraphQL options from configuration
|
|
495
800
|
*/
|
|
@@ -508,7 +813,7 @@ function validateAndBuildGraphQlOptions(initConfiguration: RumInitConfiguration)
|
|
|
508
813
|
initConfiguration.allowedGraphQlUrls.forEach((option) => {
|
|
509
814
|
if (isMatchOption(option)) {
|
|
510
815
|
graphQlOptions.push({ match: option, trackPayload: false, trackResponseErrors: false })
|
|
511
|
-
} else if (option &&
|
|
816
|
+
} else if (isIndexableObject(option) && isMatchOption(option.match)) {
|
|
512
817
|
graphQlOptions.push({
|
|
513
818
|
match: option.match,
|
|
514
819
|
trackPayload: !!option.trackPayload,
|
|
@@ -520,33 +825,99 @@ function validateAndBuildGraphQlOptions(initConfiguration: RumInitConfiguration)
|
|
|
520
825
|
return graphQlOptions
|
|
521
826
|
}
|
|
522
827
|
|
|
828
|
+
const VALID_HEADER_LOCATIONS = ['request', 'response', 'any']
|
|
829
|
+
|
|
830
|
+
function validateAndBuildTrackResourceHeaders(initConfiguration: RumInitConfiguration): MatchHeader[] {
|
|
831
|
+
const option = initConfiguration.trackResourceHeaders
|
|
832
|
+
|
|
833
|
+
if (option === undefined || option === false) {
|
|
834
|
+
return []
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
if (option === true) {
|
|
838
|
+
return DEFAULT_TRACKED_RESOURCE_HEADERS.map((name) => ({ name }))
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
if (!Array.isArray(option)) {
|
|
842
|
+
display.warn('trackResourceHeaders should be true or an array of MatchHeader')
|
|
843
|
+
return []
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
if (option.length === 0) {
|
|
847
|
+
display.warn('trackResourceHeaders is an empty array, no headers will be captured')
|
|
848
|
+
return []
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
const result: MatchHeader[] = []
|
|
852
|
+
|
|
853
|
+
option.forEach((item, index) => {
|
|
854
|
+
if (!isIndexableObject(item)) {
|
|
855
|
+
display.warn(`trackResourceHeaders[${index}] should be a MatchHeader object`)
|
|
856
|
+
return
|
|
857
|
+
}
|
|
858
|
+
if (item.name !== undefined && !isMatchOption(item.name)) {
|
|
859
|
+
display.warn(`trackResourceHeaders[${index}].name should be a MatchOption`)
|
|
860
|
+
return
|
|
861
|
+
}
|
|
862
|
+
if (item.url !== undefined && !isMatchOption(item.url)) {
|
|
863
|
+
display.warn(`trackResourceHeaders[${index}].url should be a MatchOption`)
|
|
864
|
+
return
|
|
865
|
+
}
|
|
866
|
+
if (item.extractor !== undefined && !(item.extractor instanceof RegExp)) {
|
|
867
|
+
display.warn(`trackResourceHeaders[${index}].extractor should be a RegExp`)
|
|
868
|
+
return
|
|
869
|
+
}
|
|
870
|
+
if (
|
|
871
|
+
item.location !== undefined &&
|
|
872
|
+
(typeof item.location !== 'string' || !VALID_HEADER_LOCATIONS.includes(item.location))
|
|
873
|
+
) {
|
|
874
|
+
display.warn(`trackResourceHeaders[${index}].location should be 'request', 'response', or 'any'`)
|
|
875
|
+
return
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
const { name, ...rest } = item
|
|
879
|
+
result.push({
|
|
880
|
+
...rest,
|
|
881
|
+
...(name !== undefined ? { name: typeof name === 'string' ? name.toLowerCase() : name } : {}),
|
|
882
|
+
})
|
|
883
|
+
})
|
|
884
|
+
|
|
885
|
+
return result
|
|
886
|
+
}
|
|
887
|
+
|
|
523
888
|
function hasGraphQlPayloadTracking(allowedGraphQlUrls: RumInitConfiguration['allowedGraphQlUrls']): boolean {
|
|
524
889
|
return (
|
|
525
890
|
isNonEmptyArray(allowedGraphQlUrls) &&
|
|
526
|
-
allowedGraphQlUrls.some((option) =>
|
|
527
|
-
if (typeof option === 'object' && 'trackPayload' in option) {
|
|
528
|
-
return !!option.trackPayload
|
|
529
|
-
}
|
|
530
|
-
return false
|
|
531
|
-
})
|
|
891
|
+
allowedGraphQlUrls.some((option) => isIndexableObject(option) && option.trackPayload)
|
|
532
892
|
)
|
|
533
893
|
}
|
|
534
894
|
|
|
535
895
|
function hasGraphQlResponseErrorsTracking(allowedGraphQlUrls: RumInitConfiguration['allowedGraphQlUrls']): boolean {
|
|
536
896
|
return (
|
|
537
897
|
isNonEmptyArray(allowedGraphQlUrls) &&
|
|
538
|
-
allowedGraphQlUrls.some((option) =>
|
|
539
|
-
if (typeof option === 'object' && 'trackResponseErrors' in option) {
|
|
540
|
-
return !!option.trackResponseErrors
|
|
541
|
-
}
|
|
542
|
-
return false
|
|
543
|
-
})
|
|
898
|
+
allowedGraphQlUrls.some((option) => isIndexableObject(option) && option.trackResponseErrors)
|
|
544
899
|
)
|
|
545
900
|
}
|
|
546
901
|
|
|
547
|
-
|
|
902
|
+
function getTrackResourceHeadersTelemetryValue(
|
|
903
|
+
trackResourceHeaders: RumInitConfiguration['trackResourceHeaders']
|
|
904
|
+
): 'default_headers' | 'custom' | undefined {
|
|
905
|
+
if (trackResourceHeaders === true) {
|
|
906
|
+
return 'default_headers'
|
|
907
|
+
}
|
|
908
|
+
if (Array.isArray(trackResourceHeaders)) {
|
|
909
|
+
return 'custom'
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
export function serializeRumConfiguration(
|
|
914
|
+
configuration: RumInitConfiguration,
|
|
915
|
+
sdkName?: SdkName,
|
|
916
|
+
remoteConfigurationMetadata?: RemoteConfigurationMetadata
|
|
917
|
+
) {
|
|
548
918
|
const baseSerializedConfiguration = serializeConfiguration(configuration)
|
|
549
919
|
|
|
920
|
+
// `use_` prefix is for telemetry options that track usage of a configuration option as a boolean to avoid capturing customer data
|
|
550
921
|
return {
|
|
551
922
|
session_replay_sample_rate: configuration.sessionReplaySampleRate,
|
|
552
923
|
start_session_replay_recording_manually: configuration.startSessionReplayRecordingManually,
|
|
@@ -568,24 +939,32 @@ export function serializeRumConfiguration(configuration: RumInitConfiguration) {
|
|
|
568
939
|
track_user_interactions: configuration.trackUserInteractions,
|
|
569
940
|
track_resources: configuration.trackResources,
|
|
570
941
|
track_long_task: configuration.trackLongTasks,
|
|
571
|
-
track_bfcache_views: configuration.trackBfcacheViews,
|
|
572
|
-
track_early_requests: configuration.trackEarlyRequests,
|
|
573
942
|
plugins: configuration.plugins?.map((plugin) => ({
|
|
574
943
|
name: plugin.name,
|
|
575
944
|
...plugin.getConfigurationTelemetry?.(),
|
|
576
945
|
})),
|
|
577
946
|
track_feature_flags_for_events: configuration.trackFeatureFlagsForEvents,
|
|
578
|
-
remote_configuration_id: configuration
|
|
947
|
+
remote_configuration_id: getRemoteConfigurationId(configuration),
|
|
948
|
+
remote_configuration: remoteConfigurationMetadata && {
|
|
949
|
+
last_modified: remoteConfigurationMetadata.lastModified,
|
|
950
|
+
last_synced: remoteConfigurationMetadata.lastSynced,
|
|
951
|
+
first_applied: remoteConfigurationMetadata.firstApplied,
|
|
952
|
+
sync_id: remoteConfigurationMetadata.syncId,
|
|
953
|
+
},
|
|
579
954
|
profiling_sample_rate: configuration.profilingSampleRate,
|
|
580
955
|
use_remote_configuration_proxy: !!configuration.remoteConfigurationProxy,
|
|
581
|
-
//
|
|
582
|
-
//
|
|
583
|
-
// interpret the reported values on the dashboard side.
|
|
956
|
+
// KubeSense extensions: whether the dashboard-managed remote document is in play, whether
|
|
957
|
+
// replay recording is route-scoped, and whether resource classification has an explicit
|
|
958
|
+
// first-party list — all needed to interpret the reported values on the dashboard side.
|
|
584
959
|
enable_remote_sdk_configuration: !!configuration.enableRemoteSdkConfiguration,
|
|
585
960
|
use_session_replay_routes:
|
|
586
961
|
!!configuration.sessionReplayRoutes &&
|
|
587
962
|
(isNonEmptyArray(configuration.sessionReplayRoutes.include) ||
|
|
588
963
|
isNonEmptyArray(configuration.sessionReplayRoutes.exclude)),
|
|
964
|
+
use_first_party_domains: isNonEmptyArray(configuration.firstPartyDomains),
|
|
965
|
+
track_resource_headers: getTrackResourceHeadersTelemetryValue(configuration.trackResourceHeaders),
|
|
966
|
+
beta_enable_view_updates: isViewUpdatesEnabled(configuration.betaEnableViewUpdates, configuration.proxy, sdkName),
|
|
967
|
+
beta_track_web_sockets: configuration.betaTrackWebSockets,
|
|
589
968
|
...baseSerializedConfiguration,
|
|
590
969
|
} satisfies RawTelemetryConfiguration
|
|
591
970
|
}
|