@cloudcare/browser-rum 3.2.19 → 3.2.22
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/README.md +128 -194
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +2 -3
- package/cjs/boot/buildEnv.js.map +1 -1
- package/cjs/boot/perStartRum.js +9 -2
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/recorderApi.js +1 -1
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/boot/rum.entry.js +1 -2
- package/cjs/boot/rum.entry.js.map +1 -1
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/boot/rumPublicApi.js +1 -1
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRecording.js +51 -39
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/constants.js +13 -26
- package/cjs/constants.js.map +1 -1
- package/cjs/domain/assembly.js +6 -6
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration.js.map +1 -1
- package/cjs/domain/contexts/displayContext.js.map +1 -1
- package/cjs/domain/contexts/foregroundContexts.js +2 -4
- package/cjs/domain/contexts/foregroundContexts.js.map +1 -1
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/contexts/pageStateHistory.js +4 -8
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.js +1 -2
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/viewContexts.js +1 -2
- package/cjs/domain/contexts/viewContexts.js.map +1 -1
- package/cjs/domain/deflate/deflateEncoder.js +1 -2
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +3 -5
- package/cjs/domain/deflate/deflateWorker.js.map +1 -1
- package/cjs/domain/firstInputPolyfill.js.map +1 -1
- package/cjs/domain/locationChangeObservable.js.map +1 -1
- package/cjs/domain/performanceObservable.js +1 -2
- package/cjs/domain/performanceObservable.js.map +1 -1
- package/cjs/domain/performanceUtils.js.map +1 -1
- package/cjs/domain/replay/record/elementsScrollPositions.js.map +1 -1
- package/cjs/domain/replay/record/mutationBatch.js +1 -2
- package/cjs/domain/replay/record/mutationBatch.js.map +1 -1
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/observers.js +5 -6
- package/cjs/domain/replay/record/observers.js.map +1 -1
- package/cjs/domain/replay/record/privacy.js +2 -4
- package/cjs/domain/replay/record/privacy.js.map +1 -1
- package/cjs/domain/replay/record/record.js.map +1 -1
- package/cjs/domain/replay/record/serializationUtils.js +3 -6
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -1
- package/cjs/domain/replay/record/serialize.js +5 -7
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/replay/record/shadowRootsController.js +1 -2
- package/cjs/domain/replay/record/shadowRootsController.js.map +1 -1
- package/cjs/domain/replay/record/viewports.js +2 -4
- package/cjs/domain/replay/record/viewports.js.map +1 -1
- package/cjs/domain/replay/replayStats.js +1 -2
- package/cjs/domain/replay/replayStats.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js +1 -1
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segment.js +3 -3
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +3 -4
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/replay/startRecordBridge.js +19 -0
- package/cjs/domain/replay/startRecordBridge.js.map +1 -0
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/clickChain.js +2 -4
- package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js +1 -2
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js +1 -2
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -4
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/trackClickActions.js +2 -2
- package/cjs/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/cjs/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js +2 -5
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js +1 -2
- package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +1 -2
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +1 -2
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js +1 -2
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +1 -2
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +1 -2
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js +1 -2
- package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViews.js +18 -12
- package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/cjs/domain/rumSessionManager.js +5 -9
- package/cjs/domain/rumSessionManager.js.map +1 -1
- package/cjs/domain/tracing/ddtraceTracer.js.map +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.js +1 -2
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/cjs/domain/tracing/jaegerTracer.js.map +1 -1
- package/cjs/domain/tracing/sampler.js +69 -0
- package/cjs/domain/tracing/sampler.js.map +1 -0
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
- package/cjs/domain/tracing/traceIdentifier.js.map +1 -1
- package/cjs/domain/tracing/tracer.js +8 -2
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/tracing/w3cTraceParentTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/cjs/domain/trackEventCounts.js.map +1 -1
- package/cjs/domain/usr/index.js +3 -6
- package/cjs/domain/usr/index.js.map +1 -1
- package/cjs/domain/waitPageActivityEnd.js +2 -4
- package/cjs/domain/waitPageActivityEnd.js.map +1 -1
- package/cjs/types/sessionReplayConstants.js +5 -10
- package/cjs/types/sessionReplayConstants.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/perStartRum.js +10 -3
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/recorderApi.js +2 -2
- package/esm/boot/recorderApi.js.map +1 -1
- package/esm/boot/rum.js.map +1 -1
- package/esm/boot/rumPublicApi.js +1 -1
- package/esm/boot/rumPublicApi.js.map +1 -1
- package/esm/boot/startRecording.js +51 -38
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/domain/assembly.js +6 -6
- package/esm/domain/configuration.js.map +1 -1
- package/esm/domain/contexts/displayContext.js.map +1 -1
- package/esm/domain/contexts/foregroundContexts.js.map +1 -1
- package/esm/domain/contexts/internalContext.js.map +1 -1
- package/esm/domain/contexts/pageStateHistory.js.map +1 -1
- package/esm/domain/contexts/urlContexts.js.map +1 -1
- package/esm/domain/contexts/viewContexts.js.map +1 -1
- package/esm/domain/deflate/deflateEncoder.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/firstInputPolyfill.js.map +1 -1
- package/esm/domain/locationChangeObservable.js.map +1 -1
- package/esm/domain/performanceUtils.js.map +1 -1
- package/esm/domain/replay/record/elementsScrollPositions.js.map +1 -1
- package/esm/domain/replay/record/mutationBatch.js.map +1 -1
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/observers.js +5 -6
- package/esm/domain/replay/record/observers.js.map +1 -1
- package/esm/domain/replay/record/record.js.map +1 -1
- package/esm/domain/replay/record/serialize.js +4 -5
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/replay/record/shadowRootsController.js.map +1 -1
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/replay/startRecordBridge.js +13 -0
- package/esm/domain/replay/startRecordBridge.js.map +1 -0
- package/esm/domain/requestCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/esm/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js +0 -1
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackViews.js +15 -6
- package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/esm/domain/rumSessionManager.js +2 -2
- package/esm/domain/rumSessionManager.js.map +1 -1
- package/esm/domain/tracing/ddtraceTracer.js.map +1 -1
- package/esm/domain/tracing/jaegerTracer.js.map +1 -1
- package/esm/domain/tracing/sampler.js +61 -0
- package/esm/domain/tracing/sampler.js.map +1 -0
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
- package/esm/domain/tracing/traceIdentifier.js.map +1 -1
- package/esm/domain/tracing/tracer.js +8 -2
- package/esm/domain/tracing/tracer.js.map +1 -1
- package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/esm/domain/trackEventCounts.js.map +1 -1
- package/esm/domain/usr/index.js.map +1 -1
- package/esm/types/sessionReplayConstants.js +0 -1
- package/esm/types/sessionReplayConstants.js.map +1 -1
- package/package.json +35 -35
- package/src/boot/perStartRum.js +13 -4
- package/src/boot/recorderApi.js +6 -2
- package/src/boot/rumPublicApi.js +0 -1
- package/src/boot/startRecording.js +59 -47
- package/src/domain/replay/startRecordBridge.js +14 -0
- package/src/domain/rumEventsCollection/view/trackViews.js +18 -9
- package/src/domain/rumSessionManager.js +6 -2
- package/src/domain/tracing/sampler.js +65 -0
- package/src/domain/tracing/tracer.js +11 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionReplayConstants.js","names":["RecordType","FullSnapshot","IncrementalSnapshot","Meta","Focus","ViewEnd","VisualViewport","FrustrationRecord","NodeType","Document","DocumentType","Element","Text","CDATA","DocumentFragment","IncrementalSource","Mutation","MouseMove","MouseInteraction","Scroll","ViewportResize","Input","TouchMove","MediaInteraction","StyleSheetRule","MouseInteractionType","MouseUp","MouseDown","Click","ContextMenu","DblClick","Blur","TouchStart","TouchEnd","MediaInteractionType","Play","Pause"],"sources":["../../src/types/sessionReplayConstants.js"],"sourcesContent":["export var RecordType = {\n FullSnapshot: 2,\n IncrementalSnapshot: 3,\n Meta: 4,\n Focus: 6,\n ViewEnd: 7,\n VisualViewport: 8,\n FrustrationRecord: 9\n}\n\nexport var NodeType = {\n Document: 0,\n DocumentType: 1,\n Element: 2,\n Text: 3,\n CDATA: 4,\n DocumentFragment: 11\n}\n\nexport var IncrementalSource = {\n Mutation: 0,\n MouseMove: 1,\n MouseInteraction: 2,\n Scroll: 3,\n ViewportResize: 4,\n Input: 5,\n TouchMove: 6,\n MediaInteraction: 7,\n StyleSheetRule: 8\n // CanvasMutation : 9,\n // Font : 10,\n}\n\nexport var MouseInteractionType = {\n MouseUp: 0,\n MouseDown: 1,\n Click: 2,\n ContextMenu: 3,\n DblClick: 4,\n Focus: 5,\n Blur: 6,\n TouchStart: 7,\n TouchEnd: 9\n}\n\nexport var MediaInteractionType = {\n Play: 0,\n Pause: 1\n}\n"],"mappings":"AAAA,OAAO,IAAIA,UAAU,GAAG;EACtBC,YAAY,EAAE,CAAC;EACfC,mBAAmB,EAAE,CAAC;EACtBC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,OAAO,EAAE,CAAC;EACVC,cAAc,EAAE,CAAC;EACjBC,iBAAiB,EAAE;AACrB,CAAC;AAED,OAAO,IAAIC,QAAQ,GAAG;EACpBC,QAAQ,EAAE,CAAC;EACXC,YAAY,EAAE,CAAC;EACfC,OAAO,EAAE,CAAC;EACVC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,gBAAgB,EAAE;AACpB,CAAC;AAED,OAAO,IAAIC,iBAAiB,GAAG;EAC7BC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,CAAC;EACZC,gBAAgB,EAAE,CAAC;EACnBC,MAAM,EAAE,CAAC;EACTC,cAAc,EAAE,CAAC;EACjBC,KAAK,EAAE,CAAC;EACRC,SAAS,EAAE,CAAC;EACZC,gBAAgB,EAAE,CAAC;EACnBC,cAAc,EAAE;EAChB;EACA;AACF,CAAC
|
|
1
|
+
{"version":3,"file":"sessionReplayConstants.js","names":["RecordType","FullSnapshot","IncrementalSnapshot","Meta","Focus","ViewEnd","VisualViewport","FrustrationRecord","NodeType","Document","DocumentType","Element","Text","CDATA","DocumentFragment","IncrementalSource","Mutation","MouseMove","MouseInteraction","Scroll","ViewportResize","Input","TouchMove","MediaInteraction","StyleSheetRule","MouseInteractionType","MouseUp","MouseDown","Click","ContextMenu","DblClick","Blur","TouchStart","TouchEnd","MediaInteractionType","Play","Pause"],"sources":["../../src/types/sessionReplayConstants.js"],"sourcesContent":["export var RecordType = {\n FullSnapshot: 2,\n IncrementalSnapshot: 3,\n Meta: 4,\n Focus: 6,\n ViewEnd: 7,\n VisualViewport: 8,\n FrustrationRecord: 9\n}\n\nexport var NodeType = {\n Document: 0,\n DocumentType: 1,\n Element: 2,\n Text: 3,\n CDATA: 4,\n DocumentFragment: 11\n}\n\nexport var IncrementalSource = {\n Mutation: 0,\n MouseMove: 1,\n MouseInteraction: 2,\n Scroll: 3,\n ViewportResize: 4,\n Input: 5,\n TouchMove: 6,\n MediaInteraction: 7,\n StyleSheetRule: 8\n // CanvasMutation : 9,\n // Font : 10,\n}\n\nexport var MouseInteractionType = {\n MouseUp: 0,\n MouseDown: 1,\n Click: 2,\n ContextMenu: 3,\n DblClick: 4,\n Focus: 5,\n Blur: 6,\n TouchStart: 7,\n TouchEnd: 9\n}\n\nexport var MediaInteractionType = {\n Play: 0,\n Pause: 1\n}\n"],"mappings":"AAAA,OAAO,IAAIA,UAAU,GAAG;EACtBC,YAAY,EAAE,CAAC;EACfC,mBAAmB,EAAE,CAAC;EACtBC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,OAAO,EAAE,CAAC;EACVC,cAAc,EAAE,CAAC;EACjBC,iBAAiB,EAAE;AACrB,CAAC;AAED,OAAO,IAAIC,QAAQ,GAAG;EACpBC,QAAQ,EAAE,CAAC;EACXC,YAAY,EAAE,CAAC;EACfC,OAAO,EAAE,CAAC;EACVC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,gBAAgB,EAAE;AACpB,CAAC;AAED,OAAO,IAAIC,iBAAiB,GAAG;EAC7BC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,CAAC;EACZC,gBAAgB,EAAE,CAAC;EACnBC,MAAM,EAAE,CAAC;EACTC,cAAc,EAAE,CAAC;EACjBC,KAAK,EAAE,CAAC;EACRC,SAAS,EAAE,CAAC;EACZC,gBAAgB,EAAE,CAAC;EACnBC,cAAc,EAAE;EAChB;EACA;AACF,CAAC;AAED,OAAO,IAAIC,oBAAoB,GAAG;EAChCC,OAAO,EAAE,CAAC;EACVC,SAAS,EAAE,CAAC;EACZC,KAAK,EAAE,CAAC;EACRC,WAAW,EAAE,CAAC;EACdC,QAAQ,EAAE,CAAC;EACX1B,KAAK,EAAE,CAAC;EACR2B,IAAI,EAAE,CAAC;EACPC,UAAU,EAAE,CAAC;EACbC,QAAQ,EAAE;AACZ,CAAC;AAED,OAAO,IAAIC,oBAAoB,GAAG;EAChCC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE;AACT,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
"name": "@cloudcare/browser-rum",
|
|
3
|
+
"version": "3.2.22",
|
|
4
|
+
"main": "cjs/index.js",
|
|
5
|
+
"module": "esm/index.js",
|
|
6
|
+
"types": "types/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@cloudcare/browser-core": "3.2.22",
|
|
9
|
+
"@cloudcare/browser-worker": "3.2.22"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "webpack serve --open --mode=development",
|
|
13
|
+
"build": "run-p build:cjs build:esm build:bundle",
|
|
14
|
+
"build:cjs": "rm -rf cjs && babel --config-file ./babel.cjs.json --out-dir cjs ./src && npm run replace-build-env cjs",
|
|
15
|
+
"build:esm": "rm -rf esm && babel --config-file ./babel.esm.json --out-dir esm ./src && npm run replace-build-env esm",
|
|
16
|
+
"build:bundle": "rm -rf bundle && webpack --mode=production",
|
|
17
|
+
"replace-build-env": "node ../../scripts/replace-build-env.js",
|
|
18
|
+
"publish:oss:current": "npm run build:bundle && node ./scripts/publish-oss.js current",
|
|
19
|
+
"publish:oss:lts": "npm run build:bundle && node ./scripts/publish-oss.js lts",
|
|
20
|
+
"publish:oss:test": "npm run build:bundle && node ./scripts/publish-oss.js test"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"dataflux",
|
|
24
|
+
"rum",
|
|
25
|
+
"sdk"
|
|
26
|
+
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"url": "https://github.com/DataFlux-cn/datakit-js",
|
|
29
|
+
"type": "git",
|
|
30
|
+
"directory": "packages/rum"
|
|
31
|
+
},
|
|
32
|
+
"author": "dataflux",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"homepage": "https://github.com/CloudCare/dataflux-rum-sdk-javascript/blob/master/packages/rum/README.md",
|
|
35
|
+
"description": "DataFlux RUM Web 端数据指标监控",
|
|
36
|
+
"gitHead": "b2098679ee0435c9d35ac9596680c9084a32f936"
|
|
37
37
|
}
|
package/src/boot/perStartRum.js
CHANGED
|
@@ -10,7 +10,9 @@ import {
|
|
|
10
10
|
assign,
|
|
11
11
|
addTelemetryConfiguration,
|
|
12
12
|
initFetchObservable,
|
|
13
|
-
deepClone
|
|
13
|
+
deepClone,
|
|
14
|
+
fetchAndApplyRemoteConfiguration,
|
|
15
|
+
getEventBridge
|
|
14
16
|
} from '@cloudcare/browser-core'
|
|
15
17
|
import { validateAndBuildRumConfiguration } from '../domain/configuration'
|
|
16
18
|
|
|
@@ -134,8 +136,11 @@ export function createPreStartStrategy(
|
|
|
134
136
|
if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {
|
|
135
137
|
return
|
|
136
138
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
+
if (initConfiguration.remoteConfiguration) {
|
|
140
|
+
fetchAndApplyRemoteConfiguration(initConfiguration, doInit)
|
|
141
|
+
} else {
|
|
142
|
+
doInit(initConfiguration)
|
|
143
|
+
}
|
|
139
144
|
},
|
|
140
145
|
|
|
141
146
|
getInitConfiguration: function () {
|
|
@@ -209,6 +214,10 @@ export function createPreStartStrategy(
|
|
|
209
214
|
function overrideInitConfigurationForBridge(initConfiguration) {
|
|
210
215
|
return assign({}, initConfiguration, {
|
|
211
216
|
applicationId: '00000000-aaaa-0000-aaaa-000000000000',
|
|
212
|
-
|
|
217
|
+
clientToken: 'empty',
|
|
218
|
+
sessionSampleRate: 100,
|
|
219
|
+
defaultPrivacyLevel:
|
|
220
|
+
initConfiguration.defaultPrivacyLevel ??
|
|
221
|
+
getEventBridge()?.getPrivacyLevel()
|
|
213
222
|
})
|
|
214
223
|
}
|
package/src/boot/recorderApi.js
CHANGED
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
runOnReadyState,
|
|
4
4
|
LifeCycleEventType,
|
|
5
5
|
canUseEventBridge,
|
|
6
|
+
bridgeSupports,
|
|
7
|
+
BridgeCapability,
|
|
6
8
|
PageExitReason
|
|
7
9
|
} from '@cloudcare/browser-core'
|
|
8
10
|
|
|
@@ -27,7 +29,10 @@ var RecorderStatus = {
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
30
|
-
if (
|
|
32
|
+
if (
|
|
33
|
+
(canUseEventBridge() && !bridgeSupports(BridgeCapability.RECORDS)) ||
|
|
34
|
+
!isBrowserSupported()
|
|
35
|
+
) {
|
|
31
36
|
return {
|
|
32
37
|
start: noop,
|
|
33
38
|
stop: noop,
|
|
@@ -131,7 +136,6 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
131
136
|
return
|
|
132
137
|
}
|
|
133
138
|
var deflateEncoder = getOrCreateDeflateEncoder()
|
|
134
|
-
|
|
135
139
|
if (!deflateEncoder) {
|
|
136
140
|
state = {
|
|
137
141
|
status: RecorderStatus.Stopped
|
package/src/boot/rumPublicApi.js
CHANGED
|
@@ -3,9 +3,11 @@ import {
|
|
|
3
3
|
createHttpRequest,
|
|
4
4
|
LifeCycleEventType,
|
|
5
5
|
addTelemetryDebug,
|
|
6
|
-
ONE_SECOND
|
|
6
|
+
ONE_SECOND,
|
|
7
|
+
canUseEventBridge
|
|
7
8
|
} from '@cloudcare/browser-core'
|
|
8
9
|
import { record } from '../domain/replay/record'
|
|
10
|
+
import { startRecordBridge } from '../domain/replay/startRecordBridge'
|
|
9
11
|
import {
|
|
10
12
|
startSegmentCollection,
|
|
11
13
|
SEGMENT_BYTES_LIMIT
|
|
@@ -38,58 +40,68 @@ export function startRecording(
|
|
|
38
40
|
configuration.retryMaxSize,
|
|
39
41
|
reportError
|
|
40
42
|
)
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var unlockSegment = segmentCollection.unlockSegment
|
|
56
|
-
cleanupTasks.push(segmentCollection.stop)
|
|
57
|
-
if (isRecordErrorSessionReplay) {
|
|
58
|
-
sessionManager.sessionStateUpdateObservable.subscribe(
|
|
59
|
-
({ previousState, newState }) => {
|
|
60
|
-
if (!previousState.hasError && newState.hasError) {
|
|
61
|
-
isRecordErrorSessionReplay = false
|
|
62
|
-
unlockSegment()
|
|
63
|
-
}
|
|
64
|
-
}
|
|
43
|
+
|
|
44
|
+
let addRecord, _record
|
|
45
|
+
if (!canUseEventBridge()) {
|
|
46
|
+
const session = sessionManager.findTrackedSession()
|
|
47
|
+
let isRecordErrorSessionReplay =
|
|
48
|
+
session && session.errorSessionReplayAllowed && !session.sessionHasError
|
|
49
|
+
var segmentCollection = startSegmentCollection(
|
|
50
|
+
lifeCycle,
|
|
51
|
+
configuration,
|
|
52
|
+
sessionManager,
|
|
53
|
+
viewContexts,
|
|
54
|
+
replayRequest,
|
|
55
|
+
encoder,
|
|
56
|
+
isRecordErrorSessionReplay
|
|
65
57
|
)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
addRecord = segmentCollection.addRecord
|
|
59
|
+
let flushBufferSegment = segmentCollection.flushBufferSegment
|
|
60
|
+
let unlockSegment = segmentCollection.unlockSegment
|
|
61
|
+
cleanupTasks.push(segmentCollection.stop)
|
|
70
62
|
if (isRecordErrorSessionReplay) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
63
|
+
sessionManager.sessionStateUpdateObservable.subscribe(
|
|
64
|
+
({ previousState, newState }) => {
|
|
65
|
+
if (!previousState.hasError && newState.hasError) {
|
|
66
|
+
isRecordErrorSessionReplay = false
|
|
67
|
+
unlockSegment()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
let lastFullSnapshotEvent = null
|
|
73
|
+
const wrappedEmit = (recordData) => {
|
|
74
|
+
addRecord(recordData)
|
|
75
|
+
if (isRecordErrorSessionReplay) {
|
|
76
|
+
if (recordData.type === RecordType.FullSnapshot) {
|
|
77
|
+
lastFullSnapshotEvent = recordData
|
|
78
|
+
} else if (recordData.type === RecordType.IncrementalSnapshot) {
|
|
79
|
+
const exceedTime =
|
|
80
|
+
recordData.timestamp - lastFullSnapshotEvent.timestamp >
|
|
81
|
+
BUFFER_CHECKOUT_TIME
|
|
82
|
+
// If the time between the last full snapshot and the incremental snapshot is greater than the buffer time, we need to take a new full snapshot
|
|
83
|
+
if (exceedTime) {
|
|
84
|
+
flushBufferSegment(() => {
|
|
85
|
+
deleteOldestStats()
|
|
86
|
+
takeSubsequentFullSnapshot()
|
|
87
|
+
})
|
|
88
|
+
}
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
91
|
}
|
|
92
|
+
_record = record({
|
|
93
|
+
emit: wrappedEmit,
|
|
94
|
+
configuration: configuration,
|
|
95
|
+
lifeCycle: lifeCycle
|
|
96
|
+
})
|
|
97
|
+
} else {
|
|
98
|
+
;({ addRecord } = startRecordBridge(viewContexts))
|
|
99
|
+
_record = record({
|
|
100
|
+
emit: addRecord,
|
|
101
|
+
configuration: configuration,
|
|
102
|
+
lifeCycle: lifeCycle
|
|
103
|
+
})
|
|
86
104
|
}
|
|
87
|
-
|
|
88
|
-
var _record = record({
|
|
89
|
-
emit: wrappedEmit,
|
|
90
|
-
configuration: configuration,
|
|
91
|
-
lifeCycle: lifeCycle
|
|
92
|
-
})
|
|
93
105
|
cleanupTasks.push(_record.stop)
|
|
94
106
|
var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot
|
|
95
107
|
var flushMutations = _record.flushMutations
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getEventBridge } from '@cloudcare/browser-core'
|
|
2
|
+
|
|
3
|
+
export function startRecordBridge(viewHistory) {
|
|
4
|
+
const bridge = getEventBridge()
|
|
5
|
+
|
|
6
|
+
return {
|
|
7
|
+
addRecord: (record) => {
|
|
8
|
+
// Get the current active view, not at the time of the record, aligning with the segment logic.
|
|
9
|
+
// This approach could potentially associate the record to an incorrect view, in case the record date is in the past (e.g. frustration records).
|
|
10
|
+
const view = viewHistory.findView()
|
|
11
|
+
bridge.send('session_replay', record, view.id)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -79,15 +79,15 @@ export function trackViews(
|
|
|
79
79
|
lifeCycle.subscribe(LifeCycleEventType.SESSION_EXPIRED, function () {
|
|
80
80
|
currentView.end({ sessionIsActive: false })
|
|
81
81
|
})
|
|
82
|
-
// End the current view on page unload
|
|
83
|
-
lifeCycle.subscribe(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
82
|
+
// // End the current view on page unload
|
|
83
|
+
// lifeCycle.subscribe(
|
|
84
|
+
// LifeCycleEventType.PAGE_EXITED,
|
|
85
|
+
// function (pageExitEvent) {
|
|
86
|
+
// if (pageExitEvent.reason === PageExitReason.UNLOADING) {
|
|
87
|
+
// currentView.end()
|
|
88
|
+
// }
|
|
89
|
+
// }
|
|
90
|
+
// )
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
function renewViewOnLocationChange(locationChangeObservable) {
|
|
@@ -229,6 +229,14 @@ function newView(
|
|
|
229
229
|
triggerViewUpdate,
|
|
230
230
|
SESSION_KEEP_ALIVE_INTERVAL
|
|
231
231
|
)
|
|
232
|
+
const pageMayExitSubscription = lifeCycle.subscribe(
|
|
233
|
+
LifeCycleEventType.PAGE_EXITED,
|
|
234
|
+
(pageMayExitEvent) => {
|
|
235
|
+
if (pageMayExitEvent.reason === PageExitReason.UNLOADING) {
|
|
236
|
+
triggerViewUpdate()
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
)
|
|
232
240
|
triggerViewUpdate()
|
|
233
241
|
// View context update should always be throttled
|
|
234
242
|
contextManager.changeObservable.subscribe(scheduleViewUpdate)
|
|
@@ -297,6 +305,7 @@ function newView(
|
|
|
297
305
|
clearInterval(keepAliveIntervalId)
|
|
298
306
|
setViewEnd(endClocks.relative)
|
|
299
307
|
stopCommonViewMetricsTracking()
|
|
308
|
+
pageMayExitSubscription.unsubscribe()
|
|
300
309
|
triggerViewUpdate()
|
|
301
310
|
setTimeout(function () {
|
|
302
311
|
result.stop()
|
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
LifeCycleEventType,
|
|
5
5
|
noop,
|
|
6
6
|
Observable,
|
|
7
|
-
timeStampNow
|
|
7
|
+
timeStampNow,
|
|
8
|
+
bridgeSupports,
|
|
9
|
+
BridgeCapability
|
|
8
10
|
} from '@cloudcare/browser-core'
|
|
9
11
|
|
|
10
12
|
export var RUM_SESSION_KEY = 'rum'
|
|
@@ -118,7 +120,9 @@ export function startRumSessionManagerStub() {
|
|
|
118
120
|
plan: RumSessionPlan.WITHOUT_SESSION_REPLAY, // plan value should not be taken into account for mobile
|
|
119
121
|
isErrorSession: false,
|
|
120
122
|
sessionErrorTimestamp: 0,
|
|
121
|
-
sessionReplayAllowed:
|
|
123
|
+
sessionReplayAllowed: bridgeSupports(BridgeCapability.RECORDS)
|
|
124
|
+
? true
|
|
125
|
+
: false,
|
|
122
126
|
errorSessionReplayAllowed: false,
|
|
123
127
|
sessionHasError: false
|
|
124
128
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { performDraw } from '@cloudcare/browser-core'
|
|
2
|
+
|
|
3
|
+
let sampleDecisionCache
|
|
4
|
+
|
|
5
|
+
export function isTraceSampled(sessionId, sampleRate) {
|
|
6
|
+
// Shortcuts for common cases. This is not strictly necessary, but it makes the code faster for
|
|
7
|
+
// customers willing to ingest all traces.
|
|
8
|
+
if (sampleRate === 100) {
|
|
9
|
+
return true
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (sampleRate === 0) {
|
|
13
|
+
return false
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (sampleDecisionCache && sessionId === sampleDecisionCache.sessionId) {
|
|
17
|
+
return sampleDecisionCache.decision
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let decision
|
|
21
|
+
// @ts-expect-error BigInt might not be defined in every browser we support
|
|
22
|
+
if (window.BigInt) {
|
|
23
|
+
decision = sampleUsingKnuthFactor(
|
|
24
|
+
BigInt(`0x${sessionId.split('-')[4]}`),
|
|
25
|
+
sampleRate
|
|
26
|
+
)
|
|
27
|
+
} else {
|
|
28
|
+
// For simplicity, we don't use consistent sampling for browser without BigInt support
|
|
29
|
+
// TODO: remove this when all browser we support have BigInt support
|
|
30
|
+
decision = performDraw(sampleRate)
|
|
31
|
+
}
|
|
32
|
+
sampleDecisionCache = { sessionId, decision }
|
|
33
|
+
return decision
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Exported for tests
|
|
37
|
+
export function resetSampleDecisionCache() {
|
|
38
|
+
sampleDecisionCache = undefined
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Perform sampling using the Knuth factor method. This method offer consistent sampling result
|
|
43
|
+
* based on the provided identifier.
|
|
44
|
+
*
|
|
45
|
+
* @param identifier The identifier to use for sampling.
|
|
46
|
+
* @param sampleRate The sample rate in percentage between 0 and 100.
|
|
47
|
+
*/
|
|
48
|
+
export function sampleUsingKnuthFactor(identifier, sampleRate) {
|
|
49
|
+
// The formula is:
|
|
50
|
+
//
|
|
51
|
+
// (identifier * knuthFactor) % 2^64 < sampleRate * 2^64
|
|
52
|
+
//
|
|
53
|
+
// Because JavaScript numbers are 64-bit floats, we can't represent 64-bit integers, and the
|
|
54
|
+
// modulo would be incorrect. Thus, we are using BigInts here.
|
|
55
|
+
|
|
56
|
+
// Note: All implementations have slight variations. Some of them use '<=' instead of '<', and
|
|
57
|
+
// use `sampleRate * 2^64 - 1` instead of `sampleRate * 2^64`. The following implementation
|
|
58
|
+
// should adhere to the spec and is a bit simpler than using a 2^64-1 limit as there are less
|
|
59
|
+
// BigInt arithmetic to write. In practice this does not matter, as we are using floating point
|
|
60
|
+
// numbers in the end, and Number(2n**64n-1n) === Number(2n**64n).
|
|
61
|
+
const knuthFactor = BigInt('1111111111111111111')
|
|
62
|
+
const twoPow64 = BigInt('0x10000000000000000') // 2n ** 64n
|
|
63
|
+
const hash = (identifier * knuthFactor) % twoPow64
|
|
64
|
+
return Number(hash) <= (sampleRate / 100) * Number(twoPow64)
|
|
65
|
+
}
|
|
@@ -18,7 +18,7 @@ import { JaegerTracer } from './jaegerTracer'
|
|
|
18
18
|
import { ZipkinSingleTracer } from './zipkinSingleTracer'
|
|
19
19
|
import { ZipkinMultiTracer } from './zipkinMultiTracer'
|
|
20
20
|
import { W3cTraceParentTracer } from './w3cTraceParentTracer'
|
|
21
|
-
|
|
21
|
+
import { isTraceSampled } from './sampler'
|
|
22
22
|
export function isTracingOption(item) {
|
|
23
23
|
var expectedItem = item
|
|
24
24
|
return (
|
|
@@ -103,7 +103,8 @@ export function injectHeadersIfTracingAllowed(
|
|
|
103
103
|
sessionManager,
|
|
104
104
|
inject
|
|
105
105
|
) {
|
|
106
|
-
|
|
106
|
+
const session = sessionManager.findTrackedSession()
|
|
107
|
+
if (!session) {
|
|
107
108
|
return
|
|
108
109
|
}
|
|
109
110
|
var tracingOption = find(
|
|
@@ -115,9 +116,14 @@ export function injectHeadersIfTracingAllowed(
|
|
|
115
116
|
if (!tracingOption) {
|
|
116
117
|
return
|
|
117
118
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
const traceSampled = isTraceSampled(
|
|
120
|
+
session.id,
|
|
121
|
+
configuration.tracingSampleRate
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
// var traceSampled =
|
|
125
|
+
// !isNumber(configuration.tracingSampleRate) ||
|
|
126
|
+
// performDraw(configuration.tracingSampleRate)
|
|
121
127
|
var tracer,
|
|
122
128
|
traceType = tracingOption.traceType
|
|
123
129
|
switch (traceType) {
|