@cloudcare/browser-rum 3.3.24 → 3.3.26
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 +33 -0
- package/README.zh.md +30 -0
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/disabledRumPublicApi.js +5 -0
- package/cjs/boot/disabledRumPublicApi.js.map +1 -1
- package/cjs/boot/initCallbacks.js +25 -0
- package/cjs/boot/initCallbacks.js.map +1 -0
- package/cjs/boot/perStartRum.js +99 -50
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/recorderApi.js +36 -1
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/boot/rum.js +8 -9
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/boot/rumPublicApi.js +6 -7
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRecording.js +2 -0
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/domain/configuration.js +15 -2
- package/cjs/domain/configuration.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.js +32 -21
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/viewContexts.js +1 -1
- package/cjs/domain/contexts/viewContexts.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +39 -27
- package/cjs/domain/deflate/deflateWorker.js.map +1 -1
- package/cjs/domain/privacy.js +79 -107
- package/cjs/domain/privacy.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandCapture.js +87 -179
- package/cjs/domain/replay/record/canvasCommandCapture.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandObserver.js +10 -6
- package/cjs/domain/replay/record/canvasCommandObserver.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandObserverStub.js +24 -0
- package/cjs/domain/replay/record/canvasCommandObserverStub.js.map +1 -0
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js +3 -2
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
- package/cjs/domain/replay/record/canvasContext.js +15 -0
- package/cjs/domain/replay/record/canvasContext.js.map +1 -1
- package/cjs/domain/replay/record/canvasEncodeWorker.js +1 -1
- package/cjs/domain/replay/record/canvasObserver.js +3 -0
- package/cjs/domain/replay/record/canvasObserver.js.map +1 -1
- package/cjs/domain/replay/record/canvasWebGLPluginHost.js +5 -1
- package/cjs/domain/replay/record/canvasWebGLPluginHost.js.map +1 -1
- package/cjs/domain/replay/record/mutationObserver.js +3 -12
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/observers.js +3 -7
- package/cjs/domain/replay/record/observers.js.map +1 -1
- package/cjs/domain/replay/record/record.js +15 -2
- package/cjs/domain/replay/record/record.js.map +1 -1
- package/cjs/domain/replay/record/serializationUtils.js +8 -23
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -1
- package/cjs/domain/replay/record/serialize.js +19 -33
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js +21 -6
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +91 -143
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/replayCanvasSupported.js +8 -0
- package/cjs/domain/replayCanvasSupported.js.map +1 -0
- package/cjs/domain/requestCollection.js +38 -39
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js +1 -1
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/fetchTimingRegistry.js +143 -0
- package/cjs/domain/rumEventsCollection/resource/fetchTimingRegistry.js.map +1 -0
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +2 -2
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +91 -66
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js +11 -9
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js +35 -50
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +7 -1
- package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViews.js +3 -0
- package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/viewCollection.js +1 -1
- package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/cjs/domain/tracing/skywalkingTracer.js +4 -50
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
- package/cjs/domain/tracing/tracer.js +26 -3
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/disabledRumPublicApi.js +1 -1
- package/esm/boot/disabledRumPublicApi.js.map +1 -1
- package/esm/boot/initCallbacks.js +2 -0
- package/esm/boot/initCallbacks.js.map +1 -0
- package/esm/boot/perStartRum.js +1 -1
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/recorderApi.js +1 -1
- package/esm/boot/recorderApi.js.map +1 -1
- package/esm/boot/rum.js +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 +1 -1
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/domain/configuration.js +1 -1
- package/esm/domain/configuration.js.map +1 -1
- package/esm/domain/contexts/urlContexts.js +1 -1
- package/esm/domain/contexts/urlContexts.js.map +1 -1
- package/esm/domain/contexts/viewContexts.js +1 -1
- package/esm/domain/contexts/viewContexts.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/deflate/deflateWorker.js.map +1 -1
- package/esm/domain/privacy.js +1 -1
- package/esm/domain/privacy.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandCapture.js +1 -1
- package/esm/domain/replay/record/canvasCommandCapture.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandObserver.js +1 -1
- package/esm/domain/replay/record/canvasCommandObserver.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandObserverStub.js +2 -0
- package/esm/domain/replay/record/canvasCommandObserverStub.js.map +1 -0
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js +1 -1
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
- package/esm/domain/replay/record/canvasContext.js +1 -1
- package/esm/domain/replay/record/canvasContext.js.map +1 -1
- package/esm/domain/replay/record/canvasEncodeWorker.js +1 -1
- package/esm/domain/replay/record/canvasObserver.js +1 -1
- package/esm/domain/replay/record/canvasObserver.js.map +1 -1
- package/esm/domain/replay/record/canvasWebGLPluginHost.js +1 -1
- package/esm/domain/replay/record/canvasWebGLPluginHost.js.map +1 -1
- package/esm/domain/replay/record/mutationObserver.js +1 -1
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/observers.js +1 -1
- package/esm/domain/replay/record/observers.js.map +1 -1
- package/esm/domain/replay/record/record.js +1 -1
- package/esm/domain/replay/record/record.js.map +1 -1
- package/esm/domain/replay/record/serializationUtils.js +1 -1
- package/esm/domain/replay/record/serializationUtils.js.map +1 -1
- package/esm/domain/replay/record/serialize.js +1 -1
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js +1 -1
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/replayCanvasSupported.js +2 -0
- package/esm/domain/replayCanvasSupported.js.map +1 -0
- package/esm/domain/requestCollection.js +1 -1
- package/esm/domain/requestCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js +1 -1
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/fetchTimingRegistry.js +2 -0
- package/esm/domain/rumEventsCollection/resource/fetchTimingRegistry.js.map +1 -0
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +1 -1
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +1 -1
- package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +1 -1
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackViews.js +1 -1
- package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/viewCollection.js +1 -1
- package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/esm/domain/tracing/skywalkingTracer.js +1 -1
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
- package/esm/domain/tracing/tracer.js +1 -1
- package/esm/domain/tracing/tracer.js.map +1 -1
- package/package.json +7 -7
- package/src/boot/disabledRumPublicApi.js +5 -0
- package/src/boot/initCallbacks.js +16 -0
- package/src/boot/perStartRum.js +102 -59
- package/src/boot/recorderApi.js +51 -2
- package/src/boot/rum.js +12 -18
- package/src/boot/rumPublicApi.js +6 -8
- package/src/boot/startRecording.js +2 -0
- package/src/domain/configuration.js +13 -2
- package/src/domain/contexts/urlContexts.js +34 -27
- package/src/domain/contexts/viewContexts.js +2 -2
- package/src/domain/deflate/deflateWorker.js +35 -21
- package/src/domain/privacy.js +93 -157
- package/src/domain/replay/record/canvasCommandCapture.js +102 -239
- package/src/domain/replay/record/canvasCommandObserver.js +11 -18
- package/src/domain/replay/record/canvasCommandObserverStub.js +11 -0
- package/src/domain/replay/record/canvasCommandSerializeArgs.js +2 -2
- package/src/domain/replay/record/canvasContext.js +18 -0
- package/src/domain/replay/record/canvasObserver.js +5 -1
- package/src/domain/replay/record/canvasWebGLPluginHost.js +4 -1
- package/src/domain/replay/record/mutationObserver.js +6 -22
- package/src/domain/replay/record/observers.js +4 -8
- package/src/domain/replay/record/record.js +20 -5
- package/src/domain/replay/record/serializationUtils.js +10 -33
- package/src/domain/replay/record/serialize.js +30 -38
- package/src/domain/replay/segmentCollection/buildReplayPayload.js +24 -14
- package/src/domain/replay/segmentCollection/segmentCollection.js +97 -227
- package/src/domain/replayCanvasSupported.js +1 -0
- package/src/domain/requestCollection.js +39 -51
- package/src/domain/rumEventsCollection/actions/listenActionEvents.js +8 -2
- package/src/domain/rumEventsCollection/resource/fetchTimingRegistry.js +138 -0
- package/src/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +2 -2
- package/src/domain/rumEventsCollection/resource/resourceCollection.js +103 -88
- package/src/domain/rumEventsCollection/resource/resourceTrackerManager.js +10 -10
- package/src/domain/rumEventsCollection/resource/resourceUtils.js +41 -69
- package/src/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +8 -2
- package/src/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +1 -1
- package/src/domain/rumEventsCollection/view/trackViews.js +3 -0
- package/src/domain/rumEventsCollection/view/viewCollection.js +2 -3
- package/src/domain/tracing/skywalkingTracer.js +14 -91
- package/src/domain/tracing/tracer.js +28 -4
- package/types/index.d.ts +9 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracer.js","names":["objectEntries","each","shallowClone","isArray","TraceType","performDraw","isNumber","getType","find","isMatchOption","matchList","isString","isRequest","display","DDtraceTracer","SkyWalkingTracer","JaegerTracer","ZipkinSingleTracer","ZipkinMultiTracer","W3cTraceParentTracer","isTraceSampled","isTracingOption","item","expectedItem","match","traceType","clearTracingIfNeeded","context","status","isAborted","traceId","undefined","spanId","traceSampled","startTracer","configuration","sessionManager","traceFetch","injectHeadersIfTracingAllowed","tracingHeaders","input","init","headers","Headers","forEach","value","key","
|
|
1
|
+
{"version":3,"file":"tracer.js","names":["objectEntries","each","shallowClone","isArray","TraceType","performDraw","isNumber","getType","buildUrl","find","isMatchOption","matchList","isString","isRequest","display","DDtraceTracer","SkyWalkingTracer","JaegerTracer","ZipkinSingleTracer","ZipkinMultiTracer","W3cTraceParentTracer","isTraceSampled","isTracingOption","item","expectedItem","match","traceType","clearTracingIfNeeded","context","status","isAborted","traceId","undefined","spanId","traceSampled","buildTracingOptions","options","reduce","result","option","push","url","test","protocol","username","password","href","_","startTracer","configuration","sessionManager","tracingOptions","allowedTracingUrls","traceFetch","injectHeadersIfTracingAllowed","tracingHeaders","input","init","headers","Headers","forEach","value","key","header","headersMap","concat","Request","append","traceXhr","xhr","name","setRequestHeader","inject","arguments","length","session","findTrackedSession","allowTraceHeaderWithoutSession","tracingOption","tracer","id","tracingSampleRate","DDTRACE","SKYWALKING_V3","ZIPKIN_MULTI_HEADER","JAEGER","W3C_TRACEPARENT","W3C_TRACEPARENT_64","ZIPKIN_SINGLE_HEADER","isTracingSupported","getTraceId","getSpanId","makeTracingHeaders","injectTraceHeader","visitorId","enabled","toLowerCase","warn"],"sources":["../../../src/domain/tracing/tracer.js"],"mappings":"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","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcare/browser-rum",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.26",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@cloudcare/browser-core": "3.3.
|
|
9
|
-
"@cloudcare/browser-worker": "3.3.
|
|
8
|
+
"@cloudcare/browser-core": "3.3.26",
|
|
9
|
+
"@cloudcare/browser-worker": "3.3.26"
|
|
10
10
|
},
|
|
11
11
|
"description": "Guance Browser SDK RUM Package",
|
|
12
12
|
"browserSdkCapabilities": {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"build": "run-s build:cjs build:esm build:bundle",
|
|
18
18
|
"build:cjs": "rm -rf cjs && babel --config-file ./babel.cjs.json --out-dir cjs ./src && npm run replace-build-env cjs && node ../../scripts/strip-source-map-sources-content.js cjs",
|
|
19
19
|
"build:esm": "rm -rf esm && babel --config-file ./babel.esm.json --out-dir esm ./src && npm run replace-build-env esm && node ../../scripts/optimize-esm.js esm && node ../../scripts/strip-source-map-sources-content.js esm",
|
|
20
|
-
"build:bundle": "rm -rf bundle && webpack --mode=production && npm run check:bundle-size && npm run check:bundle-contract",
|
|
21
|
-
"check:bundle-size": "node ../../scripts/check-bundle-size.js bundle/dataflux-rum.js",
|
|
22
|
-
"check:bundle-contract": "node ../../scripts/check-bundle-property-contract.js bundle/dataflux-rum.js rum && node ../../scripts/check-rum-webgl-boundary.js bundle/dataflux-rum.js",
|
|
20
|
+
"build:bundle": "rm -rf bundle && webpack --mode=production && webpack --mode=production --env domOnly && npm run check:bundle-size && npm run check:bundle-contract",
|
|
21
|
+
"check:bundle-size": "node ../../scripts/check-bundle-size.js bundle/dataflux-rum.js && node ../../scripts/check-bundle-size.js bundle/dataflux-rum-dom.js dom",
|
|
22
|
+
"check:bundle-contract": "node ../../scripts/check-bundle-property-contract.js bundle/dataflux-rum.js rum && node ../../scripts/check-bundle-property-contract.js bundle/dataflux-rum-dom.js rum && node ../../scripts/check-rum-webgl-boundary.js bundle/dataflux-rum.js",
|
|
23
23
|
"replace-build-env": "node ../../scripts/replace-build-env.js",
|
|
24
24
|
"publish:oss:current": "npm run build:bundle && node ./scripts/publish-oss.js current",
|
|
25
25
|
"publish:oss:lts": "npm run build:bundle && node ./scripts/publish-oss.js lts",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"author": "dataflux",
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"homepage": "https://github.com/GuanceCloud/datakit-js/README.md",
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "c453c2490d7704f59abe8917de333b9273b06134"
|
|
45
45
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// A construction failure happens before init(), so its monitor cannot help.
|
|
2
2
|
// Keep this fallback free of runtime collectors and browser instrumentation.
|
|
3
|
+
import { reportInitError } from './initCallbacks'
|
|
4
|
+
|
|
3
5
|
export function makeDisabledRumPublicApi(withReplay) {
|
|
4
6
|
function noop() {}
|
|
5
7
|
function emptyContext() { return {} }
|
|
@@ -31,6 +33,9 @@ export function makeDisabledRumPublicApi(withReplay) {
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
methods.forEach(function (name) { api[name] = noop })
|
|
36
|
+
api.init = function (configuration) {
|
|
37
|
+
reportInitError(configuration, 'sdk_disabled', 'RUM is disabled because SDK construction failed.')
|
|
38
|
+
}
|
|
34
39
|
api.getGlobalContext = api.getRumGlobalContext = api.getViewContext = api.getUser = emptyContext
|
|
35
40
|
api.createResourceTrackerId = function () { return '' }
|
|
36
41
|
api.getRemoteConfiguration = noop
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { catchUserErrors, displayAlreadyInitializedError, getType } from '@cloudcare/browser-core'
|
|
2
|
+
|
|
3
|
+
export function callInitCallback(configuration, name, result) {
|
|
4
|
+
if (configuration && getType(configuration[name]) === 'function') {
|
|
5
|
+
catchUserErrors(configuration[name], name + ' callback threw an error:')(result)
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function reportInitError(configuration, code, message) {
|
|
10
|
+
callInitCallback(configuration, 'onInitError', { code: code, message: message })
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function reportAlreadyInitialized(configuration) {
|
|
14
|
+
displayAlreadyInitializedError('DATAFLUX_RUM', configuration)
|
|
15
|
+
reportInitError(configuration, 'already_initialized', 'RUM is already initialized or initialization is in progress.')
|
|
16
|
+
}
|
package/src/boot/perStartRum.js
CHANGED
|
@@ -2,7 +2,8 @@ import {
|
|
|
2
2
|
createBoundedBuffer,
|
|
3
3
|
display,
|
|
4
4
|
canUseEventBridge,
|
|
5
|
-
|
|
5
|
+
catchUserErrors,
|
|
6
|
+
monitorError,
|
|
6
7
|
willSyntheticsInjectRum,
|
|
7
8
|
noop,
|
|
8
9
|
timeStampNow,
|
|
@@ -15,8 +16,9 @@ import {
|
|
|
15
16
|
getEventBridge,
|
|
16
17
|
getType
|
|
17
18
|
} from '@cloudcare/browser-core'
|
|
18
|
-
import { validateAndBuildRumConfiguration } from '../domain/configuration'
|
|
19
|
+
import { prepareReplayCanvasConfiguration, validateAndBuildRumConfiguration } from '../domain/configuration'
|
|
19
20
|
import { getPluginsTelemetry, validatePlugins } from '../domain/plugins'
|
|
21
|
+
import { callInitCallback, reportInitError, reportAlreadyInitialized } from './initCallbacks'
|
|
20
22
|
|
|
21
23
|
export function createPreStartStrategy(
|
|
22
24
|
rumPublicApiOptions,
|
|
@@ -28,7 +30,7 @@ export function createPreStartStrategy(
|
|
|
28
30
|
var startCompressionWorker = rumPublicApiOptions.startCompressionWorker
|
|
29
31
|
var overrideInitConfiguration = rumPublicApiOptions.overrideInitConfiguration
|
|
30
32
|
var bufferApiCalls = createBoundedBuffer()
|
|
31
|
-
var
|
|
33
|
+
var remoteConfigurationCallbacks = createBoundedBuffer()
|
|
32
34
|
var firstStartViewCall
|
|
33
35
|
|
|
34
36
|
var compressionWorker
|
|
@@ -37,11 +39,11 @@ export function createPreStartStrategy(
|
|
|
37
39
|
var cachedConfiguration
|
|
38
40
|
var cachedRemoteConfiguration
|
|
39
41
|
var hasStarted
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
+
var pendingAttempt
|
|
43
|
+
var workerFailed = false
|
|
42
44
|
var resourceTrackerManager = rumPublicApiOptions.resourceTrackerManager
|
|
43
45
|
function tryStartRum() {
|
|
44
|
-
if (hasStarted || !cachedInitConfiguration || !cachedConfiguration) {
|
|
46
|
+
if (hasStarted || workerFailed || !cachedInitConfiguration || !cachedConfiguration) {
|
|
45
47
|
return
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -61,17 +63,35 @@ export function createPreStartStrategy(
|
|
|
61
63
|
initialViewOptions = firstStartViewCall.options
|
|
62
64
|
}
|
|
63
65
|
|
|
66
|
+
hasStarted = true
|
|
64
67
|
var startRumResult = doStartRum(
|
|
65
68
|
cachedConfiguration,
|
|
66
69
|
compressionWorker,
|
|
67
70
|
initialViewOptions
|
|
68
71
|
)
|
|
69
|
-
hasStarted = true
|
|
70
72
|
|
|
71
73
|
bufferApiCalls.drain(startRumResult)
|
|
72
74
|
}
|
|
73
75
|
|
|
74
|
-
function
|
|
76
|
+
function fail(attempt, code, message) {
|
|
77
|
+
if (pendingAttempt !== attempt) return
|
|
78
|
+
attempt.$rConfigurationReadyCallbacks = undefined
|
|
79
|
+
pendingAttempt = undefined
|
|
80
|
+
if (code === 'worker_initialization_failed') workerFailed = true
|
|
81
|
+
reportInitError(attempt, code, message)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function run(attempt, callback) {
|
|
85
|
+
if (pendingAttempt !== attempt) return
|
|
86
|
+
try {
|
|
87
|
+
callback()
|
|
88
|
+
} catch (error) {
|
|
89
|
+
fail(attempt, 'initialization_failed', 'An error occurred while initializing RUM.')
|
|
90
|
+
monitorError(error)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function doInit(attempt, initConfiguration, remoteConfiguration, remoteError) {
|
|
75
95
|
var eventBridgeAvailable = canUseEventBridge()
|
|
76
96
|
if (eventBridgeAvailable) {
|
|
77
97
|
initConfiguration = overrideInitConfigurationForBridge(initConfiguration)
|
|
@@ -83,11 +103,7 @@ export function createPreStartStrategy(
|
|
|
83
103
|
// Update the exposed initConfiguration to reflect the bridge and remote configuration overrides
|
|
84
104
|
cachedInitConfiguration = initConfiguration
|
|
85
105
|
cachedRemoteConfiguration = remoteConfiguration
|
|
86
|
-
|
|
87
|
-
if (cachedConfiguration) {
|
|
88
|
-
displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)
|
|
89
|
-
return
|
|
90
|
-
}
|
|
106
|
+
remoteConfigurationCallbacks.drain(cachedRemoteConfiguration)
|
|
91
107
|
var telemetryConfiguration = deepClone(initConfiguration)
|
|
92
108
|
if (initConfiguration.plugins) {
|
|
93
109
|
telemetryConfiguration.plugins = getPluginsTelemetry(
|
|
@@ -97,7 +113,7 @@ export function createPreStartStrategy(
|
|
|
97
113
|
addTelemetryConfiguration(telemetryConfiguration)
|
|
98
114
|
var configuration = validateAndBuildRumConfiguration(initConfiguration)
|
|
99
115
|
if (!configuration) {
|
|
100
|
-
|
|
116
|
+
fail(attempt, 'invalid_configuration', 'Invalid RUM configuration.')
|
|
101
117
|
return
|
|
102
118
|
}
|
|
103
119
|
|
|
@@ -109,48 +125,71 @@ export function createPreStartStrategy(
|
|
|
109
125
|
display.warn(
|
|
110
126
|
'No storage available for session. We will not send any data.'
|
|
111
127
|
)
|
|
112
|
-
|
|
128
|
+
fail(attempt, 'storage_unavailable', 'No storage available for the RUM session.')
|
|
113
129
|
return
|
|
114
130
|
}
|
|
115
131
|
|
|
132
|
+
var prepared = false
|
|
133
|
+
var workerReady = true
|
|
134
|
+
function notifyIfReady() {
|
|
135
|
+
if (!prepared || !workerReady || pendingAttempt !== attempt) return
|
|
136
|
+
pendingAttempt = undefined
|
|
137
|
+
const result = { remoteConfiguration: 'disabled' }
|
|
138
|
+
if (remoteError) {
|
|
139
|
+
result.remoteConfiguration = 'fallback'
|
|
140
|
+
result.remoteConfigurationError = remoteError
|
|
141
|
+
} else if (remoteConfiguration !== undefined) {
|
|
142
|
+
result.remoteConfiguration = 'applied'
|
|
143
|
+
}
|
|
144
|
+
callInitCallback(attempt, 'onInitSuccess', result)
|
|
145
|
+
}
|
|
146
|
+
|
|
116
147
|
if (
|
|
117
148
|
configuration.compressIntakeRequests &&
|
|
118
149
|
!configuration.sendContentTypeByJson &&
|
|
119
150
|
!eventBridgeAvailable &&
|
|
120
151
|
startCompressionWorker
|
|
121
152
|
) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
'RUM'
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
)
|
|
130
|
-
if (!compressionWorker) {
|
|
131
|
-
|
|
132
|
-
initializationPending = false
|
|
153
|
+
workerReady = false
|
|
154
|
+
function onWorkerError(reason) {
|
|
155
|
+
fail(attempt, 'worker_initialization_failed', reason || 'Unable to create the RUM compression Worker.')
|
|
156
|
+
}
|
|
157
|
+
compressionWorker = startCompressionWorker(configuration, 'RUM', onWorkerError, undefined, function () {
|
|
158
|
+
workerReady = true
|
|
159
|
+
notifyIfReady()
|
|
160
|
+
})
|
|
161
|
+
if (!compressionWorker || workerFailed) {
|
|
162
|
+
onWorkerError()
|
|
133
163
|
return
|
|
134
164
|
}
|
|
135
165
|
}
|
|
136
166
|
|
|
167
|
+
// Let plugins queue the initial manual View before collection starts.
|
|
168
|
+
const callbacks = attempt.$rConfigurationReadyCallbacks
|
|
169
|
+
attempt.$rConfigurationReadyCallbacks = undefined
|
|
170
|
+
callbacks.forEach(function (callback) {
|
|
171
|
+
catchUserErrors(callback, 'Plugin configuration callback threw an error:')()
|
|
172
|
+
})
|
|
137
173
|
cachedConfiguration = configuration
|
|
138
|
-
|
|
139
|
-
// Instrumuent fetch to track network requests
|
|
140
|
-
// This is needed in case the consent is not granted and some cutsomer
|
|
141
|
-
// library (Apollo Client) is storing uninstrumented fetch to be used later
|
|
142
|
-
// The subscrption is needed so that the instrumentation process is completed
|
|
174
|
+
// Instrument fetch before returning so libraries can cache the wrapped function.
|
|
143
175
|
initFetchObservable().subscribe(noop)
|
|
144
176
|
tryStartRum()
|
|
177
|
+
// The handshake gates the notification. Collection starts as soon as the Worker exists.
|
|
178
|
+
prepared = true
|
|
179
|
+
notifyIfReady()
|
|
145
180
|
}
|
|
146
181
|
|
|
147
182
|
return {
|
|
148
183
|
init: function (initConfiguration, publicApi) {
|
|
184
|
+
if (workerFailed) return
|
|
149
185
|
if (!initConfiguration) {
|
|
150
186
|
display.error('Missing configuration')
|
|
151
187
|
return
|
|
152
188
|
}
|
|
153
|
-
|
|
189
|
+
if (pendingAttempt || cachedConfiguration) {
|
|
190
|
+
reportAlreadyInitialized(initConfiguration)
|
|
191
|
+
return
|
|
192
|
+
}
|
|
154
193
|
|
|
155
194
|
// If we are in a Synthetics test configured to automatically inject a RUM instance, we want
|
|
156
195
|
// to completely discard the customer application RUM instance by ignoring their init() call.
|
|
@@ -158,37 +197,40 @@ export function createPreStartStrategy(
|
|
|
158
197
|
// internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.
|
|
159
198
|
if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {
|
|
160
199
|
cachedInitConfiguration = initConfiguration
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
if (initializationPending || cachedConfiguration) {
|
|
164
|
-
displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)
|
|
200
|
+
reportInitError(initConfiguration, 'initialization_ignored', 'RUM initialization was delegated to Synthetics.')
|
|
165
201
|
return
|
|
166
202
|
}
|
|
167
203
|
// Expose the accepted configuration regardless of initialization success.
|
|
204
|
+
initConfiguration = prepareReplayCanvasConfiguration(initConfiguration)
|
|
168
205
|
cachedInitConfiguration = initConfiguration
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (rumPublicApiOptions.onInit) {
|
|
174
|
-
rumPublicApiOptions.onInit(initConfiguration, publicApi)
|
|
175
|
-
}
|
|
176
|
-
pluginsRequireManualViewTracking =
|
|
177
|
-
!!initConfiguration.plugins &&
|
|
178
|
-
initConfiguration.trackViewsManually === true
|
|
179
|
-
if (initConfiguration.remoteConfiguration) {
|
|
180
|
-
fetchAndApplyRemoteConfiguration(
|
|
181
|
-
initConfiguration,
|
|
182
|
-
function (remoteInitConfiguration, remoteConfiguration) {
|
|
183
|
-
if (pluginsRequireManualViewTracking) {
|
|
184
|
-
remoteInitConfiguration.trackViewsManually = true
|
|
185
|
-
}
|
|
186
|
-
doInit(remoteInitConfiguration, remoteConfiguration)
|
|
187
|
-
}
|
|
188
|
-
)
|
|
189
|
-
} else {
|
|
190
|
-
doInit(initConfiguration)
|
|
206
|
+
const attempt = pendingAttempt = {
|
|
207
|
+
onInitSuccess: initConfiguration.onInitSuccess,
|
|
208
|
+
onInitError: initConfiguration.onInitError,
|
|
209
|
+
$rConfigurationReadyCallbacks: []
|
|
191
210
|
}
|
|
211
|
+
run(attempt, function () {
|
|
212
|
+
if (!validatePlugins(initConfiguration.plugins)) {
|
|
213
|
+
fail(attempt, 'invalid_plugins', 'Invalid RUM plugins configuration.')
|
|
214
|
+
return
|
|
215
|
+
}
|
|
216
|
+
if (rumPublicApiOptions.onInit) {
|
|
217
|
+
rumPublicApiOptions.onInit(initConfiguration, publicApi, function (callback) {
|
|
218
|
+
if (attempt.$rConfigurationReadyCallbacks) attempt.$rConfigurationReadyCallbacks.push(callback)
|
|
219
|
+
})
|
|
220
|
+
}
|
|
221
|
+
const pluginsRequireManualViewTracking =
|
|
222
|
+
!!initConfiguration.plugins && initConfiguration.trackViewsManually === true
|
|
223
|
+
if (initConfiguration.remoteConfiguration) {
|
|
224
|
+
fetchAndApplyRemoteConfiguration(initConfiguration, function (resolved, remote, error) {
|
|
225
|
+
run(attempt, function () {
|
|
226
|
+
if (pluginsRequireManualViewTracking) resolved.trackViewsManually = true
|
|
227
|
+
doInit(attempt, resolved, remote, error)
|
|
228
|
+
})
|
|
229
|
+
})
|
|
230
|
+
} else {
|
|
231
|
+
doInit(attempt, initConfiguration)
|
|
232
|
+
}
|
|
233
|
+
})
|
|
192
234
|
},
|
|
193
235
|
|
|
194
236
|
getInitConfiguration: function () {
|
|
@@ -196,10 +238,11 @@ export function createPreStartStrategy(
|
|
|
196
238
|
},
|
|
197
239
|
getRemoteConfiguration: function (callback) {
|
|
198
240
|
if (getType(callback) === 'function') {
|
|
241
|
+
callback = catchUserErrors(callback, 'getRemoteConfiguration callback threw an error:')
|
|
199
242
|
if (cachedRemoteConfiguration) {
|
|
200
243
|
callback(cachedRemoteConfiguration)
|
|
201
244
|
} else {
|
|
202
|
-
|
|
245
|
+
remoteConfigurationCallbacks.add(callback)
|
|
203
246
|
}
|
|
204
247
|
}
|
|
205
248
|
},
|
package/src/boot/recorderApi.js
CHANGED
|
@@ -7,7 +7,11 @@ import {
|
|
|
7
7
|
BridgeCapability,
|
|
8
8
|
PageExitReason,
|
|
9
9
|
monitorError,
|
|
10
|
-
Observable
|
|
10
|
+
Observable,
|
|
11
|
+
addEventListener,
|
|
12
|
+
clearTimeout,
|
|
13
|
+
DOM_EVENT,
|
|
14
|
+
setTimeout
|
|
11
15
|
} from '@cloudcare/browser-core'
|
|
12
16
|
|
|
13
17
|
import { makeRecorderApiStub } from './recorderApiStub'
|
|
@@ -19,6 +23,7 @@ import {
|
|
|
19
23
|
DeflateEncoderStreamId
|
|
20
24
|
} from '../domain/deflate'
|
|
21
25
|
import { createDeflateWorkerController } from '../domain/deflate/deflateWorker'
|
|
26
|
+
var INITIAL_SNAPSHOT_RETRY_DELAY_MS = 1000
|
|
22
27
|
var RecorderStatus = {
|
|
23
28
|
// The recorder is stopped.
|
|
24
29
|
Stopped: 0,
|
|
@@ -60,6 +65,7 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
60
65
|
$rStatus: RecorderStatus.Stopped
|
|
61
66
|
}
|
|
62
67
|
var retryOnView = false
|
|
68
|
+
var initialSnapshotRetryAvailable = true
|
|
63
69
|
var nextRecordingToken = 0
|
|
64
70
|
var unloadRecoveryGeneration = 0
|
|
65
71
|
var replayDeflateWorkerController = createDeflateWorkerController()
|
|
@@ -87,6 +93,37 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
87
93
|
keepRecordingIntent(options && options.force ? undefined : options, true)
|
|
88
94
|
}
|
|
89
95
|
|
|
96
|
+
function cancelInitialSnapshotRetry() {
|
|
97
|
+
if (state.$rCancelRetry) {
|
|
98
|
+
state.$rCancelRetry()
|
|
99
|
+
state.$rCancelRetry = undefined
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function scheduleInitialSnapshotRetry(intent) {
|
|
104
|
+
function retryWhenVisible() {
|
|
105
|
+
if (state === intent && document.visibilityState !== 'hidden') {
|
|
106
|
+
initialSnapshotRetryAvailable = false
|
|
107
|
+
startStrategy(intent.$rOptions)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
var timer = setTimeout(function () {
|
|
111
|
+
if (document.visibilityState === 'hidden') {
|
|
112
|
+
// Keep this view's one retry until the user returns to the tab.
|
|
113
|
+
intent.$rCancelRetry = addEventListener(
|
|
114
|
+
document,
|
|
115
|
+
DOM_EVENT.VISIBILITY_CHANGE,
|
|
116
|
+
retryWhenVisible
|
|
117
|
+
).stop
|
|
118
|
+
} else {
|
|
119
|
+
retryWhenVisible()
|
|
120
|
+
}
|
|
121
|
+
}, INITIAL_SNAPSHOT_RETRY_DELAY_MS)
|
|
122
|
+
intent.$rCancelRetry = function () {
|
|
123
|
+
clearTimeout(timer)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
90
127
|
function reconcileStoppedRecordingState() {
|
|
91
128
|
if (
|
|
92
129
|
state.$rStatus === RecorderStatus.Started &&
|
|
@@ -122,6 +159,7 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
122
159
|
compressionWorker
|
|
123
160
|
) {
|
|
124
161
|
lifeCycle.subscribe(LifeCycleEventType.SESSION_EXPIRED, function () {
|
|
162
|
+
cancelInitialSnapshotRetry()
|
|
125
163
|
if (isRecordingInProgress()) {
|
|
126
164
|
var options = state.$rOptions
|
|
127
165
|
stopStrategy()
|
|
@@ -156,11 +194,13 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
156
194
|
}
|
|
157
195
|
)
|
|
158
196
|
lifeCycle.subscribe(LifeCycleEventType.SESSION_RENEWED, function () {
|
|
197
|
+
initialSnapshotRetryAvailable = true
|
|
159
198
|
if (state.$rStatus === RecorderStatus.IntentToStart) {
|
|
160
199
|
startStrategy(state.$rOptions)
|
|
161
200
|
}
|
|
162
201
|
})
|
|
163
202
|
lifeCycle.subscribe(LifeCycleEventType.VIEW_CREATED, function () {
|
|
203
|
+
initialSnapshotRetryAvailable = true
|
|
164
204
|
reconcileStoppedRecordingState()
|
|
165
205
|
if (state.$rStatus === RecorderStatus.IntentToStart && retryOnView) {
|
|
166
206
|
startStrategy(state.$rOptions)
|
|
@@ -247,6 +287,7 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
247
287
|
return replayDeflateWorkerController.getStatus()
|
|
248
288
|
}
|
|
249
289
|
startStrategy = function (options) {
|
|
290
|
+
cancelInitialSnapshotRetry()
|
|
250
291
|
reconcileStoppedRecordingState()
|
|
251
292
|
if (isRecordingInProgress()) {
|
|
252
293
|
if (options && options.force) {
|
|
@@ -294,12 +335,19 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
294
335
|
viewContexts,
|
|
295
336
|
deflateEncoder,
|
|
296
337
|
undefined,
|
|
297
|
-
function () {
|
|
338
|
+
function (stopReason) {
|
|
298
339
|
if (
|
|
299
340
|
isRecordingInProgress() &&
|
|
300
341
|
state.$rToken === recordingToken
|
|
301
342
|
) {
|
|
302
343
|
keepRecordingIntentAfterFailure(options)
|
|
344
|
+
if (
|
|
345
|
+
stopReason === 'initial_full_snapshot_serialization_timeout' &&
|
|
346
|
+
state.$rStatus === RecorderStatus.IntentToStart &&
|
|
347
|
+
initialSnapshotRetryAvailable
|
|
348
|
+
) {
|
|
349
|
+
scheduleInitialSnapshotRetry(state)
|
|
350
|
+
}
|
|
303
351
|
}
|
|
304
352
|
}
|
|
305
353
|
)
|
|
@@ -369,6 +417,7 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
369
417
|
}
|
|
370
418
|
|
|
371
419
|
stopStrategy = function (flushReason) {
|
|
420
|
+
cancelInitialSnapshotRetry()
|
|
372
421
|
unloadRecoveryGeneration += 1
|
|
373
422
|
if (state.$rStatus === RecorderStatus.Stopped) {
|
|
374
423
|
return
|
package/src/boot/rum.js
CHANGED
|
@@ -6,6 +6,7 @@ import { startCacheUsrCache } from '../domain/usr'
|
|
|
6
6
|
import {
|
|
7
7
|
LifeCycle,
|
|
8
8
|
LifeCycleEventType,
|
|
9
|
+
assign,
|
|
9
10
|
createPageExitObservable,
|
|
10
11
|
canUseEventBridge,
|
|
11
12
|
startTelemetry,
|
|
@@ -16,7 +17,7 @@ import { createDOMMutationObservable } from '../domain/domMutationObservable.js'
|
|
|
16
17
|
import { createLocationChangeObservable } from '../domain/locationChangeObservable'
|
|
17
18
|
import { startLongTaskCollection } from '../domain/rumEventsCollection/longTask/longTaskCollection'
|
|
18
19
|
import { startLongAnimationFrameCollection } from '../domain/rumEventsCollection/longTask/longAnimationFrameCollection'
|
|
19
|
-
import { RumPerformanceEntryType } from '../domain/performanceObservable'
|
|
20
|
+
import { RumPerformanceEntryType, supportPerformanceTimingEvent } from '../domain/performanceObservable'
|
|
20
21
|
import { startActionCollection } from '../domain/rumEventsCollection/actions/actionCollection'
|
|
21
22
|
import { startRumBatch } from '../transport/startRumBatch'
|
|
22
23
|
import { startRumEventBridge } from '../transport/startRumEventBridge'
|
|
@@ -41,6 +42,7 @@ export function startRum(
|
|
|
41
42
|
createEncoder,
|
|
42
43
|
resourceTrackerManager
|
|
43
44
|
) {
|
|
45
|
+
var excludeDocumentQuery = initialViewOptions?.excludeHashRouteOuterQuery && location.hash.indexOf('#/') === 0
|
|
44
46
|
var cleanupTasks = []
|
|
45
47
|
var lifeCycle = new LifeCycle()
|
|
46
48
|
var telemetry = startRumTelemetry(configuration)
|
|
@@ -143,7 +145,8 @@ export function startRum(
|
|
|
143
145
|
pageStateHistory,
|
|
144
146
|
undefined,
|
|
145
147
|
undefined,
|
|
146
|
-
resourceTrackerManager
|
|
148
|
+
resourceTrackerManager,
|
|
149
|
+
excludeDocumentQuery
|
|
147
150
|
)
|
|
148
151
|
var addResource = _startResourceCollection.addResource
|
|
149
152
|
cleanupTasks.push(_startResourceCollection.stop)
|
|
@@ -154,20 +157,11 @@ export function startRum(
|
|
|
154
157
|
)
|
|
155
158
|
cleanupTasks.unshift(webSocketCollection.stop)
|
|
156
159
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
) {
|
|
163
|
-
var longAnimationFrameCollection = startLongAnimationFrameCollection(
|
|
164
|
-
lifeCycle,
|
|
165
|
-
configuration
|
|
166
|
-
)
|
|
167
|
-
cleanupTasks.push(longAnimationFrameCollection.stop)
|
|
168
|
-
} else {
|
|
169
|
-
startLongTaskCollection(lifeCycle, configuration)
|
|
170
|
-
}
|
|
160
|
+
var startTaskCollection = configuration.enableLongAnimationFrame &&
|
|
161
|
+
supportPerformanceTimingEvent(RumPerformanceEntryType.LONG_ANIMATION_FRAME)
|
|
162
|
+
? startLongAnimationFrameCollection
|
|
163
|
+
: startLongTaskCollection
|
|
164
|
+
cleanupTasks.push(startTaskCollection(lifeCycle, configuration).stop)
|
|
171
165
|
|
|
172
166
|
var _startErrorCollection = startErrorCollection(
|
|
173
167
|
lifeCycle,
|
|
@@ -176,7 +170,7 @@ export function startRum(
|
|
|
176
170
|
pageStateHistory
|
|
177
171
|
)
|
|
178
172
|
var addError = _startErrorCollection.addError
|
|
179
|
-
startRequestCollection(lifeCycle, configuration, session)
|
|
173
|
+
cleanupTasks.push(startRequestCollection(lifeCycle, configuration, session).stop)
|
|
180
174
|
|
|
181
175
|
var internalContext = startInternalContext(
|
|
182
176
|
configuration.applicationId,
|
|
@@ -197,7 +191,7 @@ export function startRum(
|
|
|
197
191
|
getViewContext,
|
|
198
192
|
setViewName,
|
|
199
193
|
lifeCycle: lifeCycle,
|
|
200
|
-
viewContexts: viewContexts,
|
|
194
|
+
viewContexts: assign({}, viewContexts, { $rGetDocumentUrl: urlContexts.$rGetDocumentUrl }),
|
|
201
195
|
session: session,
|
|
202
196
|
setForcedSession: function () {
|
|
203
197
|
session.setForcedSession({ refreshView: true })
|
package/src/boot/rumPublicApi.js
CHANGED
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
sanitize,
|
|
19
19
|
createCustomerDataTrackerManager,
|
|
20
20
|
CustomerDataCompressionStatus,
|
|
21
|
-
displayAlreadyInitializedError,
|
|
22
21
|
getType,
|
|
23
22
|
noop
|
|
24
23
|
} from '@cloudcare/browser-core'
|
|
@@ -98,12 +97,13 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
98
97
|
strategy = createPreStartStrategy(
|
|
99
98
|
assign({}, options, {
|
|
100
99
|
resourceTrackerManager: resourceTrackerManager,
|
|
101
|
-
onInit: function (initConfiguration, publicApi) {
|
|
100
|
+
onInit: function (initConfiguration, publicApi, onConfigurationReady) {
|
|
102
101
|
callPluginsMethod(initConfiguration.plugins, 'onInit', {
|
|
103
102
|
addError: addPluginError,
|
|
104
103
|
publicApi: publicApi,
|
|
105
104
|
rum: publicApi,
|
|
106
|
-
initConfiguration: initConfiguration
|
|
105
|
+
initConfiguration: initConfiguration,
|
|
106
|
+
onConfigurationReady: onConfigurationReady
|
|
107
107
|
})
|
|
108
108
|
},
|
|
109
109
|
onConfigurationReady: function (configuration) {
|
|
@@ -252,7 +252,7 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
252
252
|
}),
|
|
253
253
|
|
|
254
254
|
getInitConfiguration: monitor(function () {
|
|
255
|
-
return deepClone(strategy.
|
|
255
|
+
return deepClone(strategy.getInitConfiguration())
|
|
256
256
|
}),
|
|
257
257
|
getRemoteConfiguration: monitor(function (callback) {
|
|
258
258
|
return strategy.getRemoteConfiguration(callback)
|
|
@@ -389,10 +389,8 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
389
389
|
function createPostStartStrategy(preStartStrategy, startRumResult) {
|
|
390
390
|
return assign(
|
|
391
391
|
{
|
|
392
|
-
init:
|
|
393
|
-
|
|
394
|
-
},
|
|
395
|
-
initConfiguration: preStartStrategy.getInitConfiguration(),
|
|
392
|
+
init: preStartStrategy.init,
|
|
393
|
+
getInitConfiguration: preStartStrategy.getInitConfiguration,
|
|
396
394
|
getRemoteConfiguration: function (callback) {
|
|
397
395
|
preStartStrategy.getRemoteConfiguration(callback)
|
|
398
396
|
}
|
|
@@ -288,6 +288,7 @@ export function startRecording(
|
|
|
288
288
|
emit: wrappedEmit,
|
|
289
289
|
$rEmitBaseline: wrappedEmitBaseline,
|
|
290
290
|
configuration: configuration,
|
|
291
|
+
$rGetDocumentUrl: viewContexts.$rGetDocumentUrl,
|
|
291
292
|
lifeCycle: lifeCycle,
|
|
292
293
|
sessionManager: sessionManager,
|
|
293
294
|
$rWasLastEmitBackpressured: wasLastEmitBackpressured,
|
|
@@ -306,6 +307,7 @@ export function startRecording(
|
|
|
306
307
|
_record = recordImpl({
|
|
307
308
|
emit: addRecord,
|
|
308
309
|
configuration: configuration,
|
|
310
|
+
$rGetDocumentUrl: viewContexts.$rGetDocumentUrl,
|
|
309
311
|
lifeCycle: lifeCycle,
|
|
310
312
|
sessionManager: sessionManager,
|
|
311
313
|
$rWasLastEmitBackpressured: wasLastEmitBackpressured,
|