@newrelic/browser-agent 1.281.0 → 1.282.0
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/CHANGELOG.md +7 -0
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/wrap/wrap-function.js +1 -0
- package/dist/cjs/common/wrap/wrap-websocket.js +23 -39
- package/dist/cjs/features/metrics/aggregate/index.js +7 -9
- package/dist/cjs/features/metrics/constants.js +3 -5
- package/dist/cjs/features/metrics/instrument/index.js +8 -11
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/wrap/wrap-function.js +1 -1
- package/dist/esm/common/wrap/wrap-websocket.js +23 -39
- package/dist/esm/features/metrics/aggregate/index.js +8 -10
- package/dist/esm/features/metrics/constants.js +2 -3
- package/dist/esm/features/metrics/instrument/index.js +9 -11
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/common/aggregate/event-aggregator.d.ts +1 -3
- package/dist/types/common/aggregate/event-aggregator.d.ts.map +1 -1
- package/dist/types/common/constants/agent-constants.d.ts.map +1 -1
- package/dist/types/common/constants/env.cdn.d.ts.map +1 -1
- package/dist/types/common/constants/env.d.ts.map +1 -1
- package/dist/types/common/constants/env.npm.d.ts.map +1 -1
- package/dist/types/common/session/constants.d.ts.map +1 -1
- package/dist/types/common/url/clean-url.d.ts +1 -1
- package/dist/types/common/url/clean-url.d.ts.map +1 -1
- package/dist/types/common/util/traverse.d.ts +1 -1
- package/dist/types/common/util/traverse.d.ts.map +1 -1
- package/dist/types/common/window/page-visibility.d.ts +1 -1
- package/dist/types/common/window/page-visibility.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-function.d.ts +11 -1
- package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-websocket.d.ts.map +1 -1
- package/dist/types/features/generic_events/constants.d.ts.map +1 -1
- package/dist/types/features/logging/constants.d.ts.map +1 -1
- package/dist/types/features/metrics/constants.d.ts +1 -0
- package/dist/types/features/metrics/constants.d.ts.map +1 -1
- package/dist/types/features/session_replay/constants.d.ts.map +1 -1
- package/dist/types/features/session_trace/constants.d.ts.map +1 -1
- package/dist/types/features/soft_navigations/constants.d.ts.map +1 -1
- package/dist/types/features/spa/constants.d.ts.map +1 -1
- package/dist/types/features/utils/feature-base.d.ts.map +1 -1
- package/dist/types/features/utils/instrument-base.d.ts +2 -2
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/loaders/agent-base.d.ts +2 -2
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/api/api.d.ts +0 -10
- package/dist/types/loaders/api/api.d.ts.map +1 -1
- package/dist/types/loaders/features/features.d.ts.map +1 -1
- package/dist/types/loaders/micro-agent-base.d.ts +6 -6
- package/dist/types/loaders/micro-agent-base.d.ts.map +1 -1
- package/dist/types/loaders/micro-agent.d.ts +1 -1
- package/dist/types/loaders/micro-agent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/wrap/wrap-function.js +1 -1
- package/src/common/wrap/wrap-websocket.js +24 -40
- package/src/features/metrics/aggregate/index.js +8 -8
- package/src/features/metrics/constants.js +2 -2
- package/src/features/metrics/instrument/index.js +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.282.0](https://github.com/newrelic/newrelic-browser-agent/compare/v1.281.0...v1.282.0) (2025-02-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Re-implement wrap-websocket into agent ([#1342](https://github.com/newrelic/newrelic-browser-agent/issues/1342)) ([9b2756f](https://github.com/newrelic/newrelic-browser-agent/commit/9b2756f520cb946192e72d138e14fb4fca75a7b8))
|
|
12
|
+
|
|
6
13
|
## [1.281.0](https://github.com/newrelic/newrelic-browser-agent/compare/v1.280.0...v1.281.0) (2025-02-04)
|
|
7
14
|
|
|
8
15
|
|
|
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the version of the agent
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = exports.VERSION = "1.
|
|
20
|
+
const VERSION = exports.VERSION = "1.282.0";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the version of the agent
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = exports.VERSION = "1.
|
|
20
|
+
const VERSION = exports.VERSION = "1.282.0";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -30,49 +30,33 @@ function wrapWebSocket(sharedEE) {
|
|
|
30
30
|
sharedEE.emit(WEBSOCKET_TAG + message, [timestamp, timestamp - createdAt, isLoaded, socketId, ...data]);
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
class WrappedWebSocket extends WebSocket {
|
|
34
|
+
static name = 'WebSocket';
|
|
35
|
+
constructor(...args) {
|
|
36
|
+
super(...args);
|
|
37
|
+
const socketId = (0, _uniqueId.generateRandomHexString)(6);
|
|
38
|
+
this.report = reporter(socketId);
|
|
39
|
+
this.report('new');
|
|
40
|
+
const events = ['message', 'error', 'open', 'close'];
|
|
41
|
+
/** add event listeners */
|
|
42
|
+
events.forEach(evt => {
|
|
43
|
+
this.addEventListener(evt, function (e) {
|
|
44
|
+
this.report(ADD_EVENT_LISTENER_TAG, {
|
|
45
|
+
eventType: evt,
|
|
46
|
+
event: e
|
|
47
|
+
});
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (originalProp) {
|
|
59
|
-
Object.defineProperty(proxiedProp, 'name', {
|
|
60
|
-
value: prop
|
|
61
|
-
});
|
|
62
|
-
function proxiedProp() {
|
|
63
|
-
report(prop, ...arguments);
|
|
64
|
-
try {
|
|
65
|
-
return originalProp.apply(this, arguments);
|
|
66
|
-
} catch (err) {
|
|
67
|
-
report(prop + '-err', ...arguments);
|
|
68
|
-
// rethrow error so we don't effect execution by observing.
|
|
69
|
-
throw err;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
ws[prop] = proxiedProp;
|
|
50
|
+
}
|
|
51
|
+
send(...args) {
|
|
52
|
+
this.report('send', ...args);
|
|
53
|
+
try {
|
|
54
|
+
return super.send(...args);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
this.report('send-err', ...args);
|
|
57
|
+
throw err;
|
|
73
58
|
}
|
|
74
59
|
}
|
|
75
|
-
return ws;
|
|
76
60
|
}
|
|
77
61
|
_runtime.globalScope.WebSocket = WrappedWebSocket;
|
|
78
62
|
return sharedEE;
|
|
@@ -13,14 +13,13 @@ var _eventListenerOpts = require("../../../common/event-listener/event-listener-
|
|
|
13
13
|
var _runtime = require("../../../common/constants/runtime");
|
|
14
14
|
var _aggregateBase = require("../../utils/aggregate-base");
|
|
15
15
|
var _iframe = require("../../../common/dom/iframe");
|
|
16
|
+
var _wrapWebsocket = require("../../../common/wrap/wrap-websocket");
|
|
17
|
+
var _websocketDetection = require("./websocket-detection");
|
|
16
18
|
/**
|
|
17
19
|
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
18
20
|
* SPDX-License-Identifier: Apache-2.0
|
|
19
21
|
*/
|
|
20
22
|
|
|
21
|
-
// import { WEBSOCKET_TAG } from '../../../common/wrap/wrap-websocket'
|
|
22
|
-
// import { handleWebsocketEvents } from './websocket-detection'
|
|
23
|
-
|
|
24
23
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
25
24
|
static featureName = _constants.FEATURE_NAME;
|
|
26
25
|
constructor(agentRef) {
|
|
@@ -134,12 +133,11 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
134
133
|
subtree: true
|
|
135
134
|
});
|
|
136
135
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
// })
|
|
136
|
+
_constants.WATCHABLE_WEB_SOCKET_EVENTS.forEach(tag => {
|
|
137
|
+
(0, _registerHandler.registerHandler)('buffered-' + _wrapWebsocket.WEBSOCKET_TAG + tag, (...args) => {
|
|
138
|
+
(0, _websocketDetection.handleWebsocketEvents)(this.storeSupportabilityMetrics.bind(this), tag, ...args);
|
|
139
|
+
}, this.featureName, this.ee);
|
|
140
|
+
});
|
|
143
141
|
}
|
|
144
142
|
eachSessionChecks() {
|
|
145
143
|
if (!_runtime.isBrowserScope) return;
|
|
@@ -3,19 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SUPPORTABILITY_METRIC_CHANNEL = exports.SUPPORTABILITY_METRIC = exports.FEATURE_NAME = exports.CUSTOM_METRIC_CHANNEL = exports.CUSTOM_METRIC = void 0;
|
|
6
|
+
exports.WATCHABLE_WEB_SOCKET_EVENTS = exports.SUPPORTABILITY_METRIC_CHANNEL = exports.SUPPORTABILITY_METRIC = exports.FEATURE_NAME = exports.CUSTOM_METRIC_CHANNEL = exports.CUSTOM_METRIC = void 0;
|
|
7
|
+
var _wrapWebsocket = require("../../common/wrap/wrap-websocket");
|
|
7
8
|
var _features = require("../../loaders/features/features");
|
|
8
9
|
/**
|
|
9
10
|
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
10
11
|
* SPDX-License-Identifier: Apache-2.0
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
|
-
// import { ADD_EVENT_LISTENER_TAG } from '../../common/wrap/wrap-websocket'
|
|
14
|
-
|
|
15
14
|
const FEATURE_NAME = exports.FEATURE_NAME = _features.FEATURE_NAMES.metrics;
|
|
16
15
|
const SUPPORTABILITY_METRIC = exports.SUPPORTABILITY_METRIC = 'sm';
|
|
17
16
|
const CUSTOM_METRIC = exports.CUSTOM_METRIC = 'cm';
|
|
18
17
|
const SUPPORTABILITY_METRIC_CHANNEL = exports.SUPPORTABILITY_METRIC_CHANNEL = 'storeSupportabilityMetrics';
|
|
19
18
|
const CUSTOM_METRIC_CHANNEL = exports.CUSTOM_METRIC_CHANNEL = 'storeEventMetrics';
|
|
20
|
-
|
|
21
|
-
// export const WATCHABLE_WEB_SOCKET_EVENTS = ['new', 'send', 'close', ADD_EVENT_LISTENER_TAG]
|
|
19
|
+
const WATCHABLE_WEB_SOCKET_EVENTS = exports.WATCHABLE_WEB_SOCKET_EVENTS = ['new', 'send', 'close', _wrapWebsocket.ADD_EVENT_LISTENER_TAG];
|
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Metrics = exports.Instrument = void 0;
|
|
7
|
+
var _handle = require("../../../common/event-emitter/handle");
|
|
8
|
+
var _wrapWebsocket = require("../../../common/wrap/wrap-websocket");
|
|
7
9
|
var _instrumentBase = require("../../utils/instrument-base");
|
|
8
10
|
var _constants = require("../constants");
|
|
9
11
|
/**
|
|
@@ -11,21 +13,16 @@ var _constants = require("../constants");
|
|
|
11
13
|
* SPDX-License-Identifier: Apache-2.0
|
|
12
14
|
*/
|
|
13
15
|
|
|
14
|
-
// import { handle } from '../../../common/event-emitter/handle'
|
|
15
|
-
// import { WEBSOCKET_TAG, wrapWebSocket } from '../../../common/wrap/wrap-websocket'
|
|
16
|
-
|
|
17
16
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
18
17
|
static featureName = _constants.FEATURE_NAME;
|
|
19
18
|
constructor(agentRef, auto = true) {
|
|
20
19
|
super(agentRef, _constants.FEATURE_NAME, auto);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// })
|
|
28
|
-
|
|
20
|
+
(0, _wrapWebsocket.wrapWebSocket)(this.ee);
|
|
21
|
+
_constants.WATCHABLE_WEB_SOCKET_EVENTS.forEach(suffix => {
|
|
22
|
+
this.ee.on(_wrapWebsocket.WEBSOCKET_TAG + suffix, (...args) => {
|
|
23
|
+
(0, _handle.handle)('buffered-' + _wrapWebsocket.WEBSOCKET_TAG + suffix, [...args], undefined, this.featureName, this.ee);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
29
26
|
this.importAggregator(agentRef);
|
|
30
27
|
}
|
|
31
28
|
}
|
|
@@ -173,7 +173,7 @@ function report(args, emitter) {
|
|
|
173
173
|
* Defaults to the global event emitter.
|
|
174
174
|
* @returns {object} - The destination founction or object with copied properties.
|
|
175
175
|
*/
|
|
176
|
-
function copy(from, to, emitter) {
|
|
176
|
+
export function copy(from, to, emitter) {
|
|
177
177
|
if (Object.defineProperty && Object.keys) {
|
|
178
178
|
// Create accessors that proxy to actual function
|
|
179
179
|
try {
|
|
@@ -22,49 +22,33 @@ export function wrapWebSocket(sharedEE) {
|
|
|
22
22
|
sharedEE.emit(WEBSOCKET_TAG + message, [timestamp, timestamp - createdAt, isLoaded, socketId, ...data]);
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
class WrappedWebSocket extends WebSocket {
|
|
26
|
+
static name = 'WebSocket';
|
|
27
|
+
constructor(...args) {
|
|
28
|
+
super(...args);
|
|
29
|
+
const socketId = generateRandomHexString(6);
|
|
30
|
+
this.report = reporter(socketId);
|
|
31
|
+
this.report('new');
|
|
32
|
+
const events = ['message', 'error', 'open', 'close'];
|
|
33
|
+
/** add event listeners */
|
|
34
|
+
events.forEach(evt => {
|
|
35
|
+
this.addEventListener(evt, function (e) {
|
|
36
|
+
this.report(ADD_EVENT_LISTENER_TAG, {
|
|
37
|
+
eventType: evt,
|
|
38
|
+
event: e
|
|
39
|
+
});
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (originalProp) {
|
|
51
|
-
Object.defineProperty(proxiedProp, 'name', {
|
|
52
|
-
value: prop
|
|
53
|
-
});
|
|
54
|
-
function proxiedProp() {
|
|
55
|
-
report(prop, ...arguments);
|
|
56
|
-
try {
|
|
57
|
-
return originalProp.apply(this, arguments);
|
|
58
|
-
} catch (err) {
|
|
59
|
-
report(prop + '-err', ...arguments);
|
|
60
|
-
// rethrow error so we don't effect execution by observing.
|
|
61
|
-
throw err;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
ws[prop] = proxiedProp;
|
|
42
|
+
}
|
|
43
|
+
send(...args) {
|
|
44
|
+
this.report('send', ...args);
|
|
45
|
+
try {
|
|
46
|
+
return super.send(...args);
|
|
47
|
+
} catch (err) {
|
|
48
|
+
this.report('send-err', ...args);
|
|
49
|
+
throw err;
|
|
65
50
|
}
|
|
66
51
|
}
|
|
67
|
-
return ws;
|
|
68
52
|
}
|
|
69
53
|
globalScope.WebSocket = WrappedWebSocket;
|
|
70
54
|
return sharedEE;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { registerHandler } from '../../../common/event-emitter/register-handler';
|
|
6
|
-
import { FEATURE_NAME, SUPPORTABILITY_METRIC, CUSTOM_METRIC, SUPPORTABILITY_METRIC_CHANNEL, CUSTOM_METRIC_CHANNEL
|
|
6
|
+
import { FEATURE_NAME, SUPPORTABILITY_METRIC, CUSTOM_METRIC, SUPPORTABILITY_METRIC_CHANNEL, CUSTOM_METRIC_CHANNEL, WATCHABLE_WEB_SOCKET_EVENTS } from '../constants';
|
|
7
7
|
import { getFrameworks } from './framework-detection';
|
|
8
8
|
import { isFileProtocol } from '../../../common/url/protocol';
|
|
9
9
|
import { onDOMContentLoaded } from '../../../common/window/load';
|
|
@@ -11,9 +11,8 @@ import { windowAddEventListener } from '../../../common/event-listener/event-lis
|
|
|
11
11
|
import { isBrowserScope, isWorkerScope } from '../../../common/constants/runtime';
|
|
12
12
|
import { AggregateBase } from '../../utils/aggregate-base';
|
|
13
13
|
import { isIFrameWindow } from '../../../common/dom/iframe';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
import { WEBSOCKET_TAG } from '../../../common/wrap/wrap-websocket';
|
|
15
|
+
import { handleWebsocketEvents } from './websocket-detection';
|
|
17
16
|
export class Aggregate extends AggregateBase {
|
|
18
17
|
static featureName = FEATURE_NAME;
|
|
19
18
|
constructor(agentRef) {
|
|
@@ -127,12 +126,11 @@ export class Aggregate extends AggregateBase {
|
|
|
127
126
|
subtree: true
|
|
128
127
|
});
|
|
129
128
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
// })
|
|
129
|
+
WATCHABLE_WEB_SOCKET_EVENTS.forEach(tag => {
|
|
130
|
+
registerHandler('buffered-' + WEBSOCKET_TAG + tag, (...args) => {
|
|
131
|
+
handleWebsocketEvents(this.storeSupportabilityMetrics.bind(this), tag, ...args);
|
|
132
|
+
}, this.featureName, this.ee);
|
|
133
|
+
});
|
|
136
134
|
}
|
|
137
135
|
eachSessionChecks() {
|
|
138
136
|
if (!isBrowserScope) return;
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { ADD_EVENT_LISTENER_TAG } from '../../common/wrap/wrap-websocket';
|
|
7
7
|
import { FEATURE_NAMES } from '../../loaders/features/features';
|
|
8
8
|
export const FEATURE_NAME = FEATURE_NAMES.metrics;
|
|
9
9
|
export const SUPPORTABILITY_METRIC = 'sm';
|
|
10
10
|
export const CUSTOM_METRIC = 'cm';
|
|
11
11
|
export const SUPPORTABILITY_METRIC_CHANNEL = 'storeSupportabilityMetrics';
|
|
12
12
|
export const CUSTOM_METRIC_CHANNEL = 'storeEventMetrics';
|
|
13
|
-
|
|
14
|
-
// export const WATCHABLE_WEB_SOCKET_EVENTS = ['new', 'send', 'close', ADD_EVENT_LISTENER_TAG]
|
|
13
|
+
export const WATCHABLE_WEB_SOCKET_EVENTS = ['new', 'send', 'close', ADD_EVENT_LISTENER_TAG];
|
|
@@ -3,22 +3,20 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { handle } from '../../../common/event-emitter/handle';
|
|
7
|
+
import { WEBSOCKET_TAG, wrapWebSocket } from '../../../common/wrap/wrap-websocket';
|
|
8
8
|
import { InstrumentBase } from '../../utils/instrument-base';
|
|
9
|
-
import { FEATURE_NAME
|
|
9
|
+
import { FEATURE_NAME, WATCHABLE_WEB_SOCKET_EVENTS } from '../constants';
|
|
10
10
|
export class Instrument extends InstrumentBase {
|
|
11
11
|
static featureName = FEATURE_NAME;
|
|
12
12
|
constructor(agentRef, auto = true) {
|
|
13
13
|
super(agentRef, FEATURE_NAME, auto);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// })
|
|
21
|
-
|
|
14
|
+
wrapWebSocket(this.ee);
|
|
15
|
+
WATCHABLE_WEB_SOCKET_EVENTS.forEach(suffix => {
|
|
16
|
+
this.ee.on(WEBSOCKET_TAG + suffix, (...args) => {
|
|
17
|
+
handle('buffered-' + WEBSOCKET_TAG + suffix, [...args], undefined, this.featureName, this.ee);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
22
20
|
this.importAggregator(agentRef);
|
|
23
21
|
}
|
|
24
22
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/index.js","../src/cdn/experimental.js","../src/cdn/lite.js","../src/cdn/pro.js","../src/cdn/spa.js","../src/common/aggregate/aggregator.js","../src/common/aggregate/event-aggregator.js","../src/common/config/configurable.js","../src/common/config/info.js","../src/common/config/init.js","../src/common/config/loader-config.js","../src/common/config/runtime.js","../src/common/constants/agent-constants.js","../src/common/constants/env.cdn.js","../src/common/constants/env.js","../src/common/constants/env.npm.js","../src/common/constants/runtime.js","../src/common/constants/shared-channel.js","../src/common/context/shared-context.js","../src/common/deny-list/deny-list.js","../src/common/dispatch/global-event.js","../src/common/dom/iframe.js","../src/common/dom/query-selector.js","../src/common/dom/selector-path.js","../src/common/drain/drain.js","../src/common/event-emitter/contextual-ee.js","../src/common/event-emitter/event-context.js","../src/common/event-emitter/handle.js","../src/common/event-emitter/register-handler.js","../src/common/event-listener/event-listener-opts.js","../src/common/harvest/harvester.js","../src/common/harvest/types.js","../src/common/ids/bundle-id.js","../src/common/ids/id.js","../src/common/ids/unique-id.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/storage/local-storage.js","../src/common/timer/interaction-timer.js","../src/common/timer/timer.js","../src/common/timing/nav-timing.js","../src/common/timing/now.js","../src/common/timing/time-keeper.js","../src/common/unload/eol.js","../src/common/url/canonicalize-url.js","../src/common/url/clean-url.js","../src/common/url/encode.js","../src/common/url/location.js","../src/common/url/parse-url.js","../src/common/url/protocol.js","../src/common/util/console.js","../src/common/util/data-size.js","../src/common/util/feature-flags.js","../src/common/util/get-or-set.js","../src/common/util/invoke.js","../src/common/util/obfuscate.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/text.js","../src/common/util/traverse.js","../src/common/util/type-check.js","../src/common/vitals/constants.js","../src/common/vitals/cumulative-layout-shift.js","../src/common/vitals/first-contentful-paint.js","../src/common/vitals/first-input-delay.js","../src/common/vitals/first-paint.js","../src/common/vitals/interaction-to-next-paint.js","../src/common/vitals/largest-contentful-paint.js","../src/common/vitals/time-to-first-byte.js","../src/common/vitals/vital-metric.js","../src/common/window/load.js","../src/common/window/nreum.js","../src/common/window/page-visibility.js","../src/common/wrap/wrap-events.js","../src/common/wrap/wrap-fetch.js","../src/common/wrap/wrap-function.js","../src/common/wrap/wrap-history.js","../src/common/wrap/wrap-jsonp.js","../src/common/wrap/wrap-logger.js","../src/common/wrap/wrap-mutation.js","../src/common/wrap/wrap-promise.js","../src/common/wrap/wrap-timer.js","../src/common/wrap/wrap-websocket.js","../src/common/wrap/wrap-xhr.js","../src/features/ajax/constants.js","../src/features/ajax/index.js","../src/features/ajax/aggregate/gql.js","../src/features/ajax/aggregate/index.js","../src/features/ajax/instrument/distributed-tracing.js","../src/features/ajax/instrument/index.js","../src/features/ajax/instrument/response-size.js","../src/features/generic_events/constants.js","../src/features/generic_events/index.js","../src/features/generic_events/aggregate/index.js","../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js","../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js","../src/features/generic_events/instrument/index.js","../src/features/jserrors/constants.js","../src/features/jserrors/index.js","../src/features/jserrors/aggregate/canonical-function-name.js","../src/features/jserrors/aggregate/compute-stack-trace.js","../src/features/jserrors/aggregate/format-stack-trace.js","../src/features/jserrors/aggregate/index.js","../src/features/jserrors/aggregate/internal-errors.js","../src/features/jserrors/aggregate/string-hash-code.js","../src/features/jserrors/instrument/index.js","../src/features/jserrors/shared/cast-error.js","../src/features/jserrors/shared/uncaught-error.js","../src/features/logging/constants.js","../src/features/logging/index.js","../src/features/logging/aggregate/index.js","../src/features/logging/instrument/index.js","../src/features/logging/shared/log.js","../src/features/logging/shared/utils.js","../src/features/metrics/constants.js","../src/features/metrics/index.js","../src/features/metrics/aggregate/framework-detection.js","../src/features/metrics/aggregate/index.js","../src/features/metrics/aggregate/websocket-detection.js","../src/features/metrics/instrument/index.js","../src/features/page_action/constants.js","../src/features/page_action/index.js","../src/features/page_action/instrument/index.js","../src/features/page_view_event/constants.js","../src/features/page_view_event/index.js","../src/features/page_view_event/aggregate/index.js","../src/features/page_view_event/aggregate/initialized-features.js","../src/features/page_view_event/instrument/index.js","../src/features/page_view_timing/constants.js","../src/features/page_view_timing/index.js","../src/features/page_view_timing/aggregate/index.js","../src/features/page_view_timing/instrument/index.js","../src/features/session_replay/constants.js","../src/features/session_replay/index.js","../src/features/session_replay/aggregate/index.js","../src/features/session_replay/instrument/index.js","../src/features/session_replay/shared/recorder-events.js","../src/features/session_replay/shared/recorder.js","../src/features/session_replay/shared/stylesheet-evaluator.js","../src/features/session_replay/shared/utils.js","../src/features/session_trace/constants.js","../src/features/session_trace/index.js","../src/features/session_trace/aggregate/index.js","../src/features/session_trace/aggregate/trace/node.js","../src/features/session_trace/aggregate/trace/storage.js","../src/features/session_trace/instrument/index.js","../src/features/soft_navigations/constants.js","../src/features/soft_navigations/index.js","../src/features/soft_navigations/aggregate/ajax-node.js","../src/features/soft_navigations/aggregate/bel-node.js","../src/features/soft_navigations/aggregate/index.js","../src/features/soft_navigations/aggregate/initial-page-load-interaction.js","../src/features/soft_navigations/aggregate/interaction.js","../src/features/soft_navigations/instrument/index.js","../src/features/spa/constants.js","../src/features/spa/index.js","../src/features/spa/aggregate/index.js","../src/features/spa/aggregate/interaction-node.js","../src/features/spa/aggregate/interaction.js","../src/features/spa/aggregate/serializer.js","../src/features/spa/instrument/index.js","../src/features/utils/agent-session.js","../src/features/utils/aggregate-base.js","../src/features/utils/event-buffer.js","../src/features/utils/event-store-manager.js","../src/features/utils/feature-base.js","../src/features/utils/feature-gates.js","../src/features/utils/instrument-base.js","../src/features/utils/lazy-feature-loader.js","../src/features/utils/nr1-debugger.js","../src/loaders/agent-base.js","../src/loaders/agent.js","../src/loaders/browser-agent.js","../src/loaders/micro-agent-base.js","../src/loaders/micro-agent.js","../src/loaders/api/api-methods.js","../src/loaders/api/api.js","../src/loaders/api/apiAsync.js","../src/loaders/api/interaction-types.js","../src/loaders/configure/configure.js","../src/loaders/configure/nonce.js","../src/loaders/configure/public-path.js","../src/loaders/features/enabled-features.js","../src/loaders/features/featureDependencies.js","../src/loaders/features/features.js"],"version":"5.7.3"}
|
|
@@ -12,9 +12,7 @@ export class EventAggregator {
|
|
|
12
12
|
aggregatorTypes: any;
|
|
13
13
|
}): void;
|
|
14
14
|
get(opts: any): {} | null;
|
|
15
|
-
clear({ aggregatorTypes }?: {
|
|
16
|
-
aggregatorTypes: any;
|
|
17
|
-
}): void;
|
|
15
|
+
clear({ aggregatorTypes }?: {}): void;
|
|
18
16
|
reloadSave({ aggregatorTypes }: {
|
|
19
17
|
aggregatorTypes: any;
|
|
20
18
|
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregate/event-aggregator.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH;IAIE;;YAGC;IAED,wFAIC;IAED,kEAGC;IAED;;aAgBC;IAED,0BAGC;IAED
|
|
1
|
+
{"version":3,"file":"event-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/common/aggregate/event-aggregator.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH;IAIE;;YAGC;IAED,wFAIC;IAED,kEAGC;IAED;;aAgBC;IAED,0BAGC;IAED,sCAMC;IAED;;aAYC;IAED;;aAGC;;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-constants.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/agent-constants.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"agent-constants.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/agent-constants.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,iCAAkC,KAAK,CAAA;AACvC,+BAAgC,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.cdn.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/env.cdn.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AACH,yCAAgD;AAEhD;;;GAGG;AACH,2CAA8C;AAE9C;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"env.cdn.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/env.cdn.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AACH,yCAAgD;AAEhD;;;GAGG;AACH,2CAA8C;AAE9C;;GAEG;AACH,0BAA2B,KAAK,CAAA;AAEhC;;GAEG;AACH,+CAAsD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/env.js"],"names":[],"mappings":"AAcA;;GAEG;AACH,0BAAsC;AAEtC;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/env.js"],"names":[],"mappings":"AAcA;;GAEG;AACH,0BAAsC;AAEtC;;GAEG;AACH,wBAAyB,KAAK,CAAA;AAE9B;;GAEG;AACH,0BAA2B,KAAK,CAAA;AAEhC;;GAEG;AACH,gCAAuD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.npm.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/env.npm.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AACH,yCAAgD;AAEhD;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"env.npm.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/env.npm.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AACH,yCAAgD;AAEhD;;;GAGG;AACH,wBAAyB,KAAK,CAAA;AAE9B;;;GAGG;AACH,0BAA2B,KAAK,CAAA;AAEhC;;GAEG;AACH,+CAAsD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/common/session/constants.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/common/session/constants.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAsB,MAAM,CAAA;AAC5B,0BAA2B,SAAS,CAAA;AACpC,iCAAkC,QAAQ,CAAA;AAC1C,kCAAmC,OAAO,CAAA"}
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* @param {boolean} [keepHash=false] - Whether to preserve the hash portion of the URL.
|
|
5
5
|
* @returns {string} The cleaned URL.
|
|
6
6
|
*/
|
|
7
|
-
export function cleanURL(url: string, keepHash?: boolean
|
|
7
|
+
export function cleanURL(url: string, keepHash?: boolean): string;
|
|
8
8
|
//# sourceMappingURL=clean-url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean-url.d.ts","sourceRoot":"","sources":["../../../../src/common/url/clean-url.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,8BAJW,MAAM,
|
|
1
|
+
{"version":3,"file":"clean-url.d.ts","sourceRoot":"","sources":["../../../../src/common/url/clean-url.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,8BAJW,MAAM,aACN,OAAO,GACL,MAAM,CAIlB"}
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
* @param {Array<string>} [ignoreKeys=[]] - The keys of properties to ignore and not modify.
|
|
12
12
|
* @returns {Object} - The object with function recursively applied.
|
|
13
13
|
*/
|
|
14
|
-
export function applyFnToProps(obj: Object, fn: Function, type?: string
|
|
14
|
+
export function applyFnToProps(obj: Object, fn: Function, type?: string, ignoreKeys?: Array<string>): Object;
|
|
15
15
|
//# sourceMappingURL=traverse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../../../src/common/util/traverse.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,oCANW,MAAM
|
|
1
|
+
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../../../src/common/util/traverse.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,oCANW,MAAM,uBAEN,MAAM,eACN,KAAK,CAAC,MAAM,CAAC,GACX,MAAM,CAelB"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* @param {boolean} [toHiddenOnly=false] - only execute the 'cb' when the vis is changing to the hidden state; no arg is passed to 'cb' if used
|
|
4
4
|
* @returns void
|
|
5
5
|
*/
|
|
6
|
-
export function subscribeToVisibilityChange(cb: Function, toHiddenOnly?: boolean
|
|
6
|
+
export function subscribeToVisibilityChange(cb: Function, toHiddenOnly?: boolean, capture: any, abortSignal: any): void;
|
|
7
7
|
//# sourceMappingURL=page-visibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-visibility.d.ts","sourceRoot":"","sources":["../../../../src/common/window/page-visibility.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"page-visibility.d.ts","sourceRoot":"","sources":["../../../../src/common/window/page-visibility.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,yEAHW,OAAO,wCAajB"}
|
|
@@ -4,7 +4,17 @@
|
|
|
4
4
|
* @param {boolean} always - If `true`, emit events even if already emitting an event.
|
|
5
5
|
* @returns {function} The wrapped function.
|
|
6
6
|
*/
|
|
7
|
-
export function createWrapperWithEmitter(emitter?: Object
|
|
7
|
+
export function createWrapperWithEmitter(emitter?: Object, always: boolean): Function;
|
|
8
|
+
/**
|
|
9
|
+
* Copies properties from one object to another. Used for creating a wrapper function from an original function and for
|
|
10
|
+
* copying an original function to a property of a wrapper function named by `flag` in the executing context.
|
|
11
|
+
* @param {Object} from - The source function or object.
|
|
12
|
+
* @param {Object} to - The destination function or object.
|
|
13
|
+
* @param {Object} [emitter] - The (optional) desired event emitter if errors are encountered while copying.
|
|
14
|
+
* Defaults to the global event emitter.
|
|
15
|
+
* @returns {object} - The destination founction or object with copied properties.
|
|
16
|
+
*/
|
|
17
|
+
export function copy(from: Object, to: Object, emitter?: Object): object;
|
|
8
18
|
export const flag: string;
|
|
9
19
|
export default createWrapperWithEmitter;
|
|
10
20
|
//# sourceMappingURL=wrap-function.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA6BA;;;;;GAKG;AACH
|
|
1
|
+
{"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA6BA;;;;;GAKG;AACH,mDAJW,MAAM,UACN,OAAO,YAgIjB;AAgBD;;;;;;;;GAQG;AACH,2BANW,MAAM,MACN,MAAM,YACN,MAAM,GAEJ,MAAM,CA2BlB;AAtMD,0BAA6C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-websocket.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-websocket.js"],"names":[],"mappings":"AAeA,
|
|
1
|
+
{"version":3,"file":"wrap-websocket.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-websocket.js"],"names":[],"mappings":"AAeA,kDA6CC;AAlDD,4BAA6B,YAAY,CAAA;AACzC,qCAAsC,kBAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/generic_events/constants.js"],"names":[],"mappings":"AAMA,kCAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/generic_events/constants.js"],"names":[],"mappings":"AAMA,kCAAuD;AACvD,iCAAkC,KAAK,CAAA;AACvC,+BAAgC,OAAO,CAAA;AAEvC,uCAA6F;AAC7F,8CAAuD;AAEvD,0CAA2C,CAAC,CAAA;AAC5C,sCAAuC,IAAI,CAAA;AAE3C,4CAAsF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/logging/constants.js"],"names":[],"mappings":";;;;;;;AAcA,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/logging/constants.js"],"names":[],"mappings":";;;;;;;AAcA,4CAA6C,KAAK,CAAA;AAElD,kCAAiD"}
|
|
@@ -3,4 +3,5 @@ export const SUPPORTABILITY_METRIC: "sm";
|
|
|
3
3
|
export const CUSTOM_METRIC: "cm";
|
|
4
4
|
export const SUPPORTABILITY_METRIC_CHANNEL: "storeSupportabilityMetrics";
|
|
5
5
|
export const CUSTOM_METRIC_CHANNEL: "storeEventMetrics";
|
|
6
|
+
export const WATCHABLE_WEB_SOCKET_EVENTS: string[];
|
|
6
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/metrics/constants.js"],"names":[],"mappings":"AAQA,kCAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/metrics/constants.js"],"names":[],"mappings":"AAQA,kCAAiD;AACjD,oCAAqC,IAAI,CAAA;AACzC,4BAA6B,IAAI,CAAA;AACjC,4CAA6C,4BAA4B,CAAA;AACzE,oCAAqC,mBAAmB,CAAA;AAExD,mDAA2F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_replay/constants.js"],"names":[],"mappings":"AAOA,kCAAuD;;;;;;;AASvD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_replay/constants.js"],"names":[],"mappings":"AAOA,kCAAuD;;;;;;;AASvD,8BAA+B,IAAI,CAAA;;;;;;;;;AASnC,2GAA2G;AAC3G;;EAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BtF,0CAA0C;AAC1C,kCAAmC,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_trace/constants.js"],"names":[],"mappings":"AAMA,kCAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_trace/constants.js"],"names":[],"mappings":"AAMA,kCAAsD;AACtD,2BAA4B,aAAa,CAAA;AACzC,uBAAwB,UAAU,CAAA;AAClC,oBAAqB,QAAQ,CAAA;AAC7B,kBAAmB,MAAM,CAAA;AACzB,8BAAoC;AACpC,4BAAgC;AAChC,yBAA0B,WAAW,CAAA;AACrC,oCAAqC,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/soft_navigations/constants.js"],"names":[],"mappings":"AAMA,4CAKC;AACD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/soft_navigations/constants.js"],"names":[],"mappings":"AAMA,4CAKC;AACD,+BAAgC,KAAK,CAAA;AACrC,+BAAgC,iBAAiB,CAAA;AAEjD,kCAAiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/spa/constants.js"],"names":[],"mappings":"AAOA,kCAA6C;AAC7C,0CAOC;AAED,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/spa/constants.js"],"names":[],"mappings":"AAOA,kCAA6C;AAC7C,0CAOC;AAED,+BAAgC,GAAG,CAAA;AACnC,uBAAwB,UAAU,CAAA;AAClC,qBAAsB,QAAQ,CAAA;AAC9B,uBAAwB,UAAU,CAAA;AAClC,8BAA+B,UAAU,CAAA;AACzC,wBAAyB,WAAW,CAAA;AACpC,0BAA2B,aAAa,CAAA;AACxC,uBAAwB,SAAS,CAAA;AACjC,yBAA0B,WAAW,CAAA;AACrC,0BAA2B,aAAa,CAAA;AACxC,yBAA0B,YAAY,CAAA;AACtC,yBAA0B,aAAa,CAAA;AACvC,wBAAyB,WAAW,CAAA;AAEpC,qCAA0D;AAE1D,oBAAqB,QAAQ,CAAA;AAC7B,kBAAmB,MAAM,CAAA;AACzB,mBAAoB,OAAO,CAAA;AAC3B,4BAAgC;AAChC,sBAAuB,QAAQ,CAAA;AAC/B,oBAAqB,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/feature-base.js"],"names":[],"mappings":"AAOA;IACE,oDAaC;IAZC,qBAAqB;IACrB,iBADW,MAAM,CACqB;IACtC,oEAAoE;IACpE,
|
|
1
|
+
{"version":3,"file":"feature-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/feature-base.js"],"names":[],"mappings":"AAOA;IACE,oDAaC;IAZC,qBAAqB;IACrB,iBADW,MAAM,CACqB;IACtC,oEAAoE;IACpE,QAAiC;IACjC,qBAAqB;IACrB,aADW,MAAM,CACa;IAC9B;;;;OAIG;IACH,SAFU,OAAO,CAEG;IAGtB,wBAEC;CACF"}
|
|
@@ -11,7 +11,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
11
11
|
* of its pooled instrumentation data handled by the agent's centralized drain functionality, rather than draining
|
|
12
12
|
* immediately. Primarily useful for fine-grained control in tests.
|
|
13
13
|
*/
|
|
14
|
-
constructor(agentRef: any, featureName: string, auto?: boolean
|
|
14
|
+
constructor(agentRef: any, featureName: string, auto?: boolean);
|
|
15
15
|
auto: boolean;
|
|
16
16
|
/** @type {Function | undefined} This should be set by any derived Instrument class if it has things to do when feature fails or is killed. */
|
|
17
17
|
abortHandler: Function | undefined;
|
|
@@ -32,7 +32,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
32
32
|
* @param {Object} [argsObjFromInstrument] - any values or references to pass down to aggregate
|
|
33
33
|
* @returns void
|
|
34
34
|
*/
|
|
35
|
-
importAggregator(agentRef: any, argsObjFromInstrument?: Object
|
|
35
|
+
importAggregator(agentRef: any, argsObjFromInstrument?: Object): void;
|
|
36
36
|
#private;
|
|
37
37
|
}
|
|
38
38
|
import { FeatureBase } from './feature-base';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IACE;;;;;;;OAOG;IACH,wCALW,MAAM,
|
|
1
|
+
{"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IACE;;;;;;;OAOG;IACH,wCALW,MAAM,SACN,OAAO,EAoCjB;IA9BC,cAAgB;IAEhB,8IAA8I;IAC9I,cADW,WAAW,SAAS,CACF;IAE7B;;;MAGE;IACF,eAHU,OAAO,kBAAkB,EAAE,aAAa,CAGpB;IAE9B;;;MAGE;IACF,kCAAoC;IAiBtC;;;;;;OAMG;IACH,wDAHW,MAAM,QAsDhB;;CAkBF;4BApI2B,gBAAgB"}
|
|
@@ -12,7 +12,7 @@ export class AgentBase extends MicroAgentBase {
|
|
|
12
12
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/finished/}
|
|
13
13
|
* @param {number} [timeStamp] Defaults to the current time of the call. If used, this marks the time that the page is "finished" according to your own criteria.
|
|
14
14
|
*/
|
|
15
|
-
finished(timeStamp?: number
|
|
15
|
+
finished(timeStamp?: number): any;
|
|
16
16
|
/**
|
|
17
17
|
* Forces a replay to record. If a replay is already actively recording, this call will be ignored.
|
|
18
18
|
* If a recording has not been started, a new one will be created. If a recording has been started, but is currently not recording, it will resume recording.
|
|
@@ -69,7 +69,7 @@ export class AgentBase extends MicroAgentBase {
|
|
|
69
69
|
wrapLogger(parent: object, functionName: string, options?: {
|
|
70
70
|
customAttributes?: object;
|
|
71
71
|
level?: "ERROR" | "TRACE" | "DEBUG" | "INFO" | "WARN";
|
|
72
|
-
}
|
|
72
|
+
}): any;
|
|
73
73
|
#private;
|
|
74
74
|
}
|
|
75
75
|
export type InteractionInstance = import("./api/interaction-types").InteractionInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent-base.js"],"names":[],"mappings":"AAWA;;GAEG;AAEH;IAWE;;;OAGG;IACH,aAEC;IAED;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent-base.js"],"names":[],"mappings":"AAWA;;GAEG;AAEH;IAWE;;;OAGG;IACH,aAEC;IAED;;;;OAIG;IACH,qBAFW,MAAM,OAIhB;IAED;;;;OAIG;IACH,oBAEC;IAED;;;;;OAKG;IACH,mBAEC;IAED;;;;;;;;;;OAUG;IACH,6BARW;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,OAUrF;IAED;;;;;OAKG;IACH,0BAHW,MAAM,OAKhB;IAED;;;;;;MAME;IACF,eAJa,mBAAmB,CAM/B;IAED;;;;;;MAME;IACF,mBAJW,MAAM,gBACN,MAAM,YACN;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,GAAC,OAAO,GAAC,OAAO,GAAC,MAAM,GAAC,MAAM,CAAA;KAAC,OAIpF;;CACF;kCAhGY,OAAO,yBAAyB,EAAE,mBAAmB;+BAHnC,oBAAoB"}
|
|
@@ -12,17 +12,7 @@ export function setAPI(agentIdentifier: any, forceDrain: any, runSoftNavOverSpa?
|
|
|
12
12
|
recordCustomEvent: (...args: any[]) => any;
|
|
13
13
|
setPageViewName(name: any, host: any): any;
|
|
14
14
|
setCustomAttribute(name: any, value: any, persistAttribute?: boolean): any;
|
|
15
|
-
/**
|
|
16
|
-
* Attach the 'enduser.id' attribute onto agent payloads. This may be used in NR queries to group all browser events by specific users.
|
|
17
|
-
* @param {string} value - unique user identifier; a null user id suggests none should exist
|
|
18
|
-
* @returns @see apiCall
|
|
19
|
-
*/
|
|
20
15
|
setUserId(value: string): any;
|
|
21
|
-
/**
|
|
22
|
-
* Attach the 'applcation.version' attribute onto agent payloads. This may be used in NR queries to group all browser events by a specific customer-defined release.
|
|
23
|
-
* @param {string|null} value - Application version -- if null, will "unset" the value
|
|
24
|
-
* @returns @see apiCall
|
|
25
|
-
*/
|
|
26
16
|
setApplicationVersion(value: string | null): any;
|
|
27
17
|
start(): void;
|
|
28
18
|
interaction(options: any): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/api.js"],"names":[],"mappings":"AAuBA,2CAiBC;AAID;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/api.js"],"names":[],"mappings":"AAuBA,2CAiBC;AAID;;;;;;;;;;;;;qBAqEa,MAAM;iCAaN,MAAM,GAAC,IAAI;;;;;EAiGvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../../src/loaders/features/features.js"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../../src/loaders/features/features.js"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,qBAAsB,QAAQ,CAAA;AAC9B,uBAAwB,UAAU,CAAA;AAElC,kBAAmB,KAAK,CAAA;;;;;;;;;;;;;;;AAoBxB;;;GAGG;AACH;;EAYC;AAED;;EAYC"}
|
|
@@ -6,21 +6,21 @@ export class MicroAgentBase {
|
|
|
6
6
|
* @param {string} name Name or category of the action. Reported as the actionName attribute.
|
|
7
7
|
* @param {object} [attributes] JSON object with one or more key/value pairs. For example: {key:"value"}. The key is reported as its own PageAction attribute with the specified values.
|
|
8
8
|
*/
|
|
9
|
-
addPageAction(name: string, attributes?: object
|
|
9
|
+
addPageAction(name: string, attributes?: object): any;
|
|
10
10
|
/**
|
|
11
11
|
* Records a custom event with a specified eventType and attributes.
|
|
12
12
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/recordCustomEvent/}
|
|
13
13
|
* @param {string} eventType The eventType to store the event as.
|
|
14
14
|
* @param {object} [attributes] JSON object with one or more key/value pairs. For example: {key:"value"}.
|
|
15
15
|
*/
|
|
16
|
-
recordCustomEvent(eventType: string, attributes?: object
|
|
16
|
+
recordCustomEvent(eventType: string, attributes?: object): any;
|
|
17
17
|
/**
|
|
18
18
|
* Groups page views to help URL structure or to capture the URL's routing information.
|
|
19
19
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setpageviewname/}
|
|
20
20
|
* @param {string} name The page name you want to use. Use alphanumeric characters.
|
|
21
21
|
* @param {string} [host] Default is http://custom.transaction. Typically set host to your site's domain URI.
|
|
22
22
|
*/
|
|
23
|
-
setPageViewName(name: string, host?: string
|
|
23
|
+
setPageViewName(name: string, host?: string): any;
|
|
24
24
|
/**
|
|
25
25
|
* Adds a user-defined attribute name and value to subsequent events on the page.
|
|
26
26
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/}
|
|
@@ -28,14 +28,14 @@ export class MicroAgentBase {
|
|
|
28
28
|
* @param {string|number|boolean|null} value Value of the attribute. Appears as the value in the named attribute column in the PageView event. It will appear as a column in the PageAction event if you are using it. Custom attribute values cannot be complex objects, only simple types such as Strings, Integers and Booleans. Passing a null value unsets any existing attribute of the same name.
|
|
29
29
|
* @param {boolean} [persist] Default false. If set to true, the name-value pair will also be set into the browser's storage API. Then on the following instrumented pages that load within the same session, the pair will be re-applied as a custom attribute.
|
|
30
30
|
*/
|
|
31
|
-
setCustomAttribute(name: string, value: string | number | boolean | null, persist?: boolean
|
|
31
|
+
setCustomAttribute(name: string, value: string | number | boolean | null, persist?: boolean): any;
|
|
32
32
|
/**
|
|
33
33
|
* Identifies a browser error without disrupting your app's operations.
|
|
34
34
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/noticeerror/}
|
|
35
35
|
* @param {Error|string} error Provide a meaningful error message that you can use when analyzing data on browser's JavaScript errors page.
|
|
36
36
|
* @param {object} [customAttributes] An object containing name/value pairs representing custom attributes.
|
|
37
37
|
*/
|
|
38
|
-
noticeError(error: Error | string, customAttributes?: object
|
|
38
|
+
noticeError(error: Error | string, customAttributes?: object): any;
|
|
39
39
|
/**
|
|
40
40
|
* Adds a user-defined identifier string to subsequent events on the page.
|
|
41
41
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setuserid/}
|
|
@@ -75,7 +75,7 @@ export class MicroAgentBase {
|
|
|
75
75
|
log(message: string, options?: {
|
|
76
76
|
customAttributes?: object;
|
|
77
77
|
level?: "ERROR" | "TRACE" | "DEBUG" | "INFO" | "WARN";
|
|
78
|
-
}
|
|
78
|
+
}): any;
|
|
79
79
|
#private;
|
|
80
80
|
}
|
|
81
81
|
//# sourceMappingURL=micro-agent-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"micro-agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent-base.js"],"names":[],"mappings":"AAOA;IACE,wBAAe;IAkBf;;;;;OAKG;IACH,oBAHW,MAAM,
|
|
1
|
+
{"version":3,"file":"micro-agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent-base.js"],"names":[],"mappings":"AAOA;IACE,wBAAe;IAkBf;;;;;OAKG;IACH,oBAHW,MAAM,eACN,MAAM,OAIhB;IAED;;;;;OAKG;IACH,6BAHW,MAAM,eACN,MAAM,OAIhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,SACN,MAAM,OAIhB;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,OAAO,GAAC,IAAI,YAC1B,OAAO,OAIjB;IAED;;;;;OAKG;IACH,mBAHW,KAAK,GAAC,MAAM,qBACZ,MAAM,OAIhB;IAED;;;;OAIG;IACH,iBAFW,MAAM,GAAC,IAAI,OAIrB;IAED;;;;;;;OAOG;IACH,6BAJW,MAAM,GAAC,IAAI,OAMrB;IAED;;;;OAIG;IACH,0BAFW,CAAC,KAAK,EAAE,KAAK,GAAC,MAAM,KAAK,OAAO,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,OAI9D;IAED;;;;;OAKG;IACH,iBAHW,MAAM,MACN,MAAM,OAIhB;IAED;;;;;MAKE;IACF,aAHW,MAAM,YACN;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,GAAC,OAAO,GAAC,OAAO,GAAC,MAAM,GAAC,MAAM,CAAA;KAAC,OAIpF;;CACF"}
|
|
@@ -14,7 +14,7 @@ export class MicroAgent extends MicroAgentBase {
|
|
|
14
14
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/start/}
|
|
15
15
|
* @param {string|string[]} [featureNames] The feature name(s) to start. If no name(s) are passed, all features will be started
|
|
16
16
|
*/
|
|
17
|
-
start: (featureNames?: string | string[]
|
|
17
|
+
start: (featureNames?: string | string[]) => boolean;
|
|
18
18
|
get config(): {
|
|
19
19
|
info: any;
|
|
20
20
|
init: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH;IACE;;OAEG;IACH,qBAFW,MAAM,EAsDhB;IAjDC,aAAkB;IAMlB;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH;IACE;;OAEG;IACH,qBAFW,MAAM,EAsDhB;IAjDC,aAAkB;IAMlB;;;;OAIG;IACH,uBAFW,MAAM,GAAC,MAAM,EAAE,aAqCzB;IAKH;;;;;MAOC;CACF;+BAhF8B,oBAAoB"}
|
package/package.json
CHANGED
|
@@ -183,7 +183,7 @@ function report (args, emitter) {
|
|
|
183
183
|
* Defaults to the global event emitter.
|
|
184
184
|
* @returns {object} - The destination founction or object with copied properties.
|
|
185
185
|
*/
|
|
186
|
-
function copy (from, to, emitter) {
|
|
186
|
+
export function copy (from, to, emitter) {
|
|
187
187
|
if (Object.defineProperty && Object.keys) {
|
|
188
188
|
// Create accessors that proxy to actual function
|
|
189
189
|
try {
|
|
@@ -27,51 +27,35 @@ export function wrapWebSocket (sharedEE) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
class WrappedWebSocket extends WebSocket {
|
|
31
|
+
static name = 'WebSocket'
|
|
32
|
+
|
|
33
|
+
constructor (...args) {
|
|
34
|
+
super(...args)
|
|
35
|
+
const socketId = generateRandomHexString(6)
|
|
36
|
+
this.report = reporter(socketId)
|
|
37
|
+
this.report('new')
|
|
38
|
+
|
|
39
|
+
const events = ['message', 'error', 'open', 'close']
|
|
40
|
+
/** add event listeners */
|
|
41
|
+
events.forEach(evt => {
|
|
42
|
+
this.addEventListener(evt, function (e) {
|
|
43
|
+
this.report(ADD_EVENT_LISTENER_TAG, { eventType: evt, event: e })
|
|
44
|
+
})
|
|
45
45
|
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** could also observe the on-events for runtime processing, but not implemented yet */
|
|
49
|
-
|
|
50
|
-
/** observe the static method send, but noteably not close, as that is currently observed with the event listener */
|
|
51
|
-
;['send'].forEach(wrapStaticProperty)
|
|
46
|
+
}
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
report(prop, ...arguments)
|
|
61
|
-
try {
|
|
62
|
-
return originalProp.apply(this, arguments)
|
|
63
|
-
} catch (err) {
|
|
64
|
-
report(prop + '-err', ...arguments)
|
|
65
|
-
// rethrow error so we don't effect execution by observing.
|
|
66
|
-
throw err
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
ws[prop] = proxiedProp
|
|
48
|
+
send (...args) {
|
|
49
|
+
this.report('send', ...args)
|
|
50
|
+
try {
|
|
51
|
+
return super.send(...args)
|
|
52
|
+
} catch (err) {
|
|
53
|
+
this.report('send-err', ...args)
|
|
54
|
+
throw err
|
|
70
55
|
}
|
|
71
56
|
}
|
|
72
|
-
|
|
73
|
-
return ws
|
|
74
57
|
}
|
|
58
|
+
|
|
75
59
|
globalScope.WebSocket = WrappedWebSocket
|
|
76
60
|
return sharedEE
|
|
77
61
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { registerHandler } from '../../../common/event-emitter/register-handler'
|
|
6
|
-
import { FEATURE_NAME, SUPPORTABILITY_METRIC, CUSTOM_METRIC, SUPPORTABILITY_METRIC_CHANNEL, CUSTOM_METRIC_CHANNEL
|
|
6
|
+
import { FEATURE_NAME, SUPPORTABILITY_METRIC, CUSTOM_METRIC, SUPPORTABILITY_METRIC_CHANNEL, CUSTOM_METRIC_CHANNEL, WATCHABLE_WEB_SOCKET_EVENTS } from '../constants'
|
|
7
7
|
import { getFrameworks } from './framework-detection'
|
|
8
8
|
import { isFileProtocol } from '../../../common/url/protocol'
|
|
9
9
|
import { onDOMContentLoaded } from '../../../common/window/load'
|
|
@@ -11,8 +11,8 @@ import { windowAddEventListener } from '../../../common/event-listener/event-lis
|
|
|
11
11
|
import { isBrowserScope, isWorkerScope } from '../../../common/constants/runtime'
|
|
12
12
|
import { AggregateBase } from '../../utils/aggregate-base'
|
|
13
13
|
import { isIFrameWindow } from '../../../common/dom/iframe'
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
import { WEBSOCKET_TAG } from '../../../common/wrap/wrap-websocket'
|
|
15
|
+
import { handleWebsocketEvents } from './websocket-detection'
|
|
16
16
|
|
|
17
17
|
export class Aggregate extends AggregateBase {
|
|
18
18
|
static featureName = FEATURE_NAME
|
|
@@ -116,11 +116,11 @@ export class Aggregate extends AggregateBase {
|
|
|
116
116
|
mo.observe(window.document.body, { childList: true, subtree: true })
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
WATCHABLE_WEB_SOCKET_EVENTS.forEach(tag => {
|
|
120
|
+
registerHandler('buffered-' + WEBSOCKET_TAG + tag, (...args) => {
|
|
121
|
+
handleWebsocketEvents(this.storeSupportabilityMetrics.bind(this), tag, ...args)
|
|
122
|
+
}, this.featureName, this.ee)
|
|
123
|
+
})
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
eachSessionChecks () {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { ADD_EVENT_LISTENER_TAG } from '../../common/wrap/wrap-websocket'
|
|
7
7
|
import { FEATURE_NAMES } from '../../loaders/features/features'
|
|
8
8
|
|
|
9
9
|
export const FEATURE_NAME = FEATURE_NAMES.metrics
|
|
@@ -12,4 +12,4 @@ export const CUSTOM_METRIC = 'cm'
|
|
|
12
12
|
export const SUPPORTABILITY_METRIC_CHANNEL = 'storeSupportabilityMetrics'
|
|
13
13
|
export const CUSTOM_METRIC_CHANNEL = 'storeEventMetrics'
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
export const WATCHABLE_WEB_SOCKET_EVENTS = ['new', 'send', 'close', ADD_EVENT_LISTENER_TAG]
|
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { handle } from '../../../common/event-emitter/handle'
|
|
7
|
+
import { WEBSOCKET_TAG, wrapWebSocket } from '../../../common/wrap/wrap-websocket'
|
|
8
8
|
import { InstrumentBase } from '../../utils/instrument-base'
|
|
9
|
-
import { FEATURE_NAME
|
|
9
|
+
import { FEATURE_NAME, WATCHABLE_WEB_SOCKET_EVENTS } from '../constants'
|
|
10
10
|
|
|
11
11
|
export class Instrument extends InstrumentBase {
|
|
12
12
|
static featureName = FEATURE_NAME
|
|
13
13
|
constructor (agentRef, auto = true) {
|
|
14
14
|
super(agentRef, FEATURE_NAME, auto)
|
|
15
|
-
|
|
15
|
+
wrapWebSocket(this.ee)
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
WATCHABLE_WEB_SOCKET_EVENTS.forEach((suffix) => {
|
|
18
|
+
this.ee.on(WEBSOCKET_TAG + suffix, (...args) => {
|
|
19
|
+
handle('buffered-' + WEBSOCKET_TAG + suffix, [...args], undefined, this.featureName, this.ee)
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
22
|
|
|
23
23
|
this.importAggregator(agentRef)
|
|
24
24
|
}
|