@newrelic/browser-agent 1.263.0 → 1.264.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 +8 -0
- package/README.md +2 -2
- package/dist/cjs/cdn/experimental.js +3 -7
- package/dist/cjs/cdn/pro.js +2 -2
- package/dist/cjs/cdn/spa.js +2 -2
- package/dist/cjs/common/aggregate/aggregator.js +3 -3
- package/dist/cjs/common/config/state/init.js +6 -3
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/constants/runtime.js +1 -3
- package/dist/cjs/common/drain/drain.js +4 -4
- package/dist/cjs/common/harvest/harvest.js +2 -2
- package/dist/cjs/common/serialize/bel-serializer.js +2 -2
- package/dist/cjs/common/session/session-entity.js +1 -1
- package/dist/cjs/common/url/encode.js +3 -5
- package/dist/cjs/common/util/submit-data.js +0 -1
- package/dist/cjs/common/vitals/vital-metric.js +1 -1
- package/dist/cjs/features/ajax/aggregate/index.js +1 -1
- package/dist/cjs/features/ajax/instrument/index.js +1 -1
- package/dist/cjs/features/generic_events/aggregate/index.js +137 -0
- package/dist/cjs/features/generic_events/constants.js +8 -0
- package/dist/cjs/features/generic_events/index.js +12 -0
- package/dist/cjs/features/generic_events/instrument/index.js +27 -0
- package/dist/cjs/features/jserrors/aggregate/index.js +13 -12
- package/dist/cjs/features/jserrors/instrument/index.js +1 -1
- package/dist/cjs/features/logging/aggregate/index.js +1 -1
- package/dist/cjs/features/logging/instrument/index.js +1 -1
- package/dist/cjs/features/metrics/aggregate/index.js +1 -1
- package/dist/cjs/features/metrics/instrument/index.js +1 -1
- package/dist/cjs/features/page_action/instrument/index.js +6 -6
- package/dist/cjs/features/page_view_event/aggregate/index.js +1 -1
- package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/dist/cjs/features/page_view_event/instrument/index.js +1 -1
- package/dist/cjs/features/page_view_timing/aggregate/index.js +3 -3
- package/dist/cjs/features/page_view_timing/instrument/index.js +1 -1
- package/dist/cjs/features/session_replay/aggregate/index.js +2 -2
- package/dist/cjs/features/session_replay/instrument/index.js +1 -1
- package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/dist/cjs/features/session_trace/aggregate/index.js +1 -1
- package/dist/cjs/features/session_trace/aggregate/trace/storage.js +2 -2
- package/dist/cjs/features/session_trace/instrument/index.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/bel-node.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/index.js +1 -1
- package/dist/cjs/features/soft_navigations/aggregate/interaction.js +5 -5
- package/dist/cjs/features/soft_navigations/instrument/index.js +1 -1
- package/dist/cjs/features/spa/aggregate/index.js +2 -3
- package/dist/cjs/features/spa/aggregate/interaction.js +2 -2
- package/dist/cjs/features/spa/aggregate/serializer.js +1 -2
- package/dist/cjs/features/spa/instrument/index.js +1 -1
- package/dist/cjs/features/utils/aggregate-base.js +2 -0
- package/dist/cjs/features/utils/lazy-feature-loader.js +2 -2
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/loaders/agent-base.js +0 -4
- package/dist/cjs/loaders/api/api.js +1 -1
- package/dist/cjs/loaders/api/apiAsync.js +1 -1
- package/dist/cjs/loaders/browser-agent.js +4 -3
- package/dist/cjs/loaders/configure/configure.js +4 -3
- package/dist/cjs/loaders/features/features.js +8 -4
- package/dist/cjs/loaders/micro-agent.js +1 -1
- package/dist/esm/cdn/experimental.js +2 -5
- package/dist/esm/cdn/pro.js +2 -2
- package/dist/esm/cdn/spa.js +2 -2
- package/dist/esm/common/aggregate/aggregator.js +3 -3
- package/dist/esm/common/config/state/init.js +6 -3
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/constants/runtime.js +0 -2
- package/dist/esm/common/drain/drain.js +4 -4
- package/dist/esm/common/harvest/harvest.js +3 -3
- package/dist/esm/common/serialize/bel-serializer.js +2 -2
- package/dist/esm/common/session/session-entity.js +2 -2
- package/dist/esm/common/url/encode.js +3 -5
- package/dist/esm/common/util/submit-data.js +0 -1
- package/dist/esm/common/vitals/vital-metric.js +1 -1
- package/dist/esm/features/ajax/aggregate/index.js +1 -1
- package/dist/esm/features/ajax/instrument/index.js +1 -1
- package/dist/esm/features/generic_events/aggregate/index.js +129 -0
- package/dist/esm/features/generic_events/constants.js +2 -0
- package/dist/esm/features/generic_events/index.js +1 -0
- package/dist/esm/features/generic_events/instrument/index.js +20 -0
- package/dist/esm/features/jserrors/aggregate/index.js +13 -12
- package/dist/esm/features/jserrors/instrument/index.js +1 -1
- package/dist/esm/features/logging/aggregate/index.js +1 -1
- package/dist/esm/features/logging/instrument/index.js +1 -1
- package/dist/esm/features/metrics/aggregate/index.js +1 -1
- package/dist/esm/features/metrics/instrument/index.js +1 -1
- package/dist/esm/features/page_action/instrument/index.js +7 -6
- package/dist/esm/features/page_view_event/aggregate/index.js +1 -1
- package/dist/esm/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/dist/esm/features/page_view_event/instrument/index.js +1 -1
- package/dist/esm/features/page_view_timing/aggregate/index.js +3 -3
- package/dist/esm/features/page_view_timing/instrument/index.js +1 -1
- package/dist/esm/features/session_replay/aggregate/index.js +2 -2
- package/dist/esm/features/session_replay/instrument/index.js +1 -1
- package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/dist/esm/features/session_trace/aggregate/index.js +1 -1
- package/dist/esm/features/session_trace/aggregate/trace/storage.js +2 -2
- package/dist/esm/features/session_trace/instrument/index.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/bel-node.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/index.js +1 -1
- package/dist/esm/features/soft_navigations/aggregate/interaction.js +5 -5
- package/dist/esm/features/soft_navigations/instrument/index.js +1 -1
- package/dist/esm/features/spa/aggregate/index.js +2 -3
- package/dist/esm/features/spa/aggregate/interaction.js +2 -2
- package/dist/esm/features/spa/aggregate/serializer.js +1 -2
- package/dist/esm/features/spa/instrument/index.js +1 -1
- package/dist/esm/features/utils/aggregate-base.js +3 -1
- package/dist/esm/features/utils/lazy-feature-loader.js +2 -2
- package/dist/esm/index.js +3 -0
- package/dist/esm/loaders/agent-base.js +0 -4
- package/dist/esm/loaders/api/api.js +1 -1
- package/dist/esm/loaders/api/apiAsync.js +1 -1
- package/dist/esm/loaders/browser-agent.js +3 -2
- package/dist/esm/loaders/configure/configure.js +4 -3
- package/dist/esm/loaders/features/features.js +8 -4
- package/dist/esm/loaders/micro-agent.js +1 -1
- package/dist/types/common/aggregate/aggregator.d.ts.map +1 -1
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/constants/runtime.d.ts +0 -1
- package/dist/types/common/constants/runtime.d.ts.map +1 -1
- package/dist/types/common/drain/drain.d.ts.map +1 -1
- package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -1
- package/dist/types/common/url/encode.d.ts.map +1 -1
- package/dist/types/common/util/submit-data.d.ts.map +1 -1
- package/dist/types/features/{page_action → generic_events}/aggregate/index.d.ts +7 -5
- package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -0
- package/dist/types/features/generic_events/constants.d.ts +2 -0
- package/dist/types/features/generic_events/constants.d.ts.map +1 -0
- package/dist/types/features/generic_events/index.d.ts +2 -0
- package/dist/types/features/generic_events/index.d.ts.map +1 -0
- package/dist/types/features/generic_events/instrument/index.d.ts +6 -0
- package/dist/types/features/generic_events/instrument/index.d.ts.map +1 -0
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_action/instrument/index.d.ts +5 -4
- package/dist/types/features/page_action/instrument/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -1
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/loaders/agent-base.d.ts +0 -1
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/browser-agent.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/dist/types/loaders/features/features.d.ts +1 -0
- package/dist/types/loaders/features/features.d.ts.map +1 -1
- package/package.json +25 -6
- package/src/cdn/experimental.js +2 -4
- package/src/cdn/pro.js +2 -2
- package/src/cdn/spa.js +2 -2
- package/src/common/aggregate/aggregator.js +2 -3
- package/src/common/config/state/init.js +2 -1
- package/src/common/constants/runtime.js +0 -2
- package/src/common/drain/drain.js +3 -4
- package/src/common/harvest/harvest.js +3 -3
- package/src/common/serialize/bel-serializer.js +1 -2
- package/src/common/session/session-entity.js +2 -2
- package/src/common/url/encode.js +2 -3
- package/src/common/util/submit-data.js +0 -1
- package/src/features/generic_events/aggregate/index.js +133 -0
- package/src/features/generic_events/constants.js +3 -0
- package/src/features/generic_events/index.js +1 -0
- package/src/features/generic_events/instrument/index.js +22 -0
- package/src/features/jserrors/aggregate/index.js +4 -5
- package/src/features/page_action/instrument/index.js +6 -6
- package/src/features/page_view_event/aggregate/initialized-features.js +1 -1
- package/src/features/page_view_timing/aggregate/index.js +1 -2
- package/src/features/spa/aggregate/index.js +1 -2
- package/src/features/spa/aggregate/interaction.js +1 -2
- package/src/features/spa/aggregate/serializer.js +1 -2
- package/src/features/utils/aggregate-base.js +3 -1
- package/src/features/utils/lazy-feature-loader.js +2 -2
- package/src/index.js +3 -0
- package/src/loaders/agent-base.js +0 -4
- package/src/loaders/api/api.js +1 -1
- package/src/loaders/api/apiAsync.js +1 -1
- package/src/loaders/browser-agent.js +5 -3
- package/src/loaders/configure/configure.js +5 -1
- package/src/loaders/features/features.js +8 -4
- package/src/loaders/micro-agent.js +1 -1
- package/dist/cjs/cdn/polyfills/lite.js +0 -16
- package/dist/cjs/cdn/polyfills/pro.js +0 -21
- package/dist/cjs/cdn/polyfills/spa.js +0 -22
- package/dist/cjs/cdn/polyfills.js +0 -24
- package/dist/cjs/common/util/map-own.js +0 -31
- package/dist/cjs/features/page_action/aggregate/index.js +0 -121
- package/dist/esm/cdn/polyfills/lite.js +0 -14
- package/dist/esm/cdn/polyfills/pro.js +0 -19
- package/dist/esm/cdn/polyfills/spa.js +0 -20
- package/dist/esm/cdn/polyfills.js +0 -27
- package/dist/esm/common/util/map-own.js +0 -24
- package/dist/esm/features/page_action/aggregate/index.js +0 -114
- package/dist/types/cdn/polyfills/lite.d.ts +0 -2
- package/dist/types/cdn/polyfills/lite.d.ts.map +0 -1
- package/dist/types/cdn/polyfills/pro.d.ts +0 -2
- package/dist/types/cdn/polyfills/pro.d.ts.map +0 -1
- package/dist/types/cdn/polyfills/spa.d.ts +0 -2
- package/dist/types/cdn/polyfills/spa.d.ts.map +0 -1
- package/dist/types/cdn/polyfills.d.ts +0 -2
- package/dist/types/cdn/polyfills.d.ts.map +0 -1
- package/dist/types/common/util/map-own.d.ts +0 -3
- package/dist/types/common/util/map-own.d.ts.map +0 -1
- package/dist/types/features/page_action/aggregate/index.d.ts.map +0 -1
- package/src/cdn/polyfills/lite.js +0 -20
- package/src/cdn/polyfills/pro.js +0 -30
- package/src/cdn/polyfills/spa.js +0 -32
- package/src/cdn/polyfills.js +0 -27
- package/src/common/util/map-own.js +0 -22
- package/src/features/page_action/aggregate/index.js +0 -114
|
@@ -7,7 +7,7 @@ exports.Instrument = void 0;
|
|
|
7
7
|
var _instrumentBase = require("../../utils/instrument-base");
|
|
8
8
|
var _constants = require("../constants");
|
|
9
9
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
10
|
-
static featureName = _constants.FEATURE_NAME;
|
|
10
|
+
static featureName = (() => _constants.FEATURE_NAME)();
|
|
11
11
|
constructor(agentIdentifier, aggregator) {
|
|
12
12
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
13
13
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME, auto);
|
|
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Instrument = void 0;
|
|
7
|
-
var
|
|
8
|
-
var _constants = require("../constants");
|
|
7
|
+
var _generic_events = require("../../generic_events");
|
|
9
8
|
/*
|
|
10
9
|
* Copyright 2020 New Relic Corporation. All rights reserved.
|
|
11
10
|
* SPDX-License-Identifier: Apache-2.0
|
|
12
11
|
*/
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated This feature has been replaced by Generic Events. Use/Import `GenericEvents` instead. This wrapper will be removed in a future release
|
|
15
|
+
*/
|
|
16
|
+
class Instrument extends _generic_events.GenericEvents {
|
|
16
17
|
constructor(agentIdentifier, aggregator) {
|
|
17
18
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
18
|
-
super(agentIdentifier, aggregator,
|
|
19
|
-
this.importAggregator();
|
|
19
|
+
super(agentIdentifier, aggregator, auto);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.Instrument = Instrument;
|
|
@@ -26,7 +26,7 @@ var _timeKeeper = require("../../../common/timing/time-keeper");
|
|
|
26
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
27
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
28
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
29
|
-
static featureName = CONSTANTS.FEATURE_NAME;
|
|
29
|
+
static featureName = (() => CONSTANTS.FEATURE_NAME)();
|
|
30
30
|
constructor(agentIdentifier, aggregator) {
|
|
31
31
|
super(agentIdentifier, aggregator, CONSTANTS.FEATURE_NAME);
|
|
32
32
|
this.timeToFirstByte = 0;
|
|
@@ -24,7 +24,7 @@ function getActivatedFeaturesFlags(agentId) {
|
|
|
24
24
|
case _features.FEATURE_NAMES.jserrors:
|
|
25
25
|
flagArr.push('err');
|
|
26
26
|
break;
|
|
27
|
-
case _features.FEATURE_NAMES.
|
|
27
|
+
case _features.FEATURE_NAMES.genericEvents:
|
|
28
28
|
flagArr.push('ins');
|
|
29
29
|
break;
|
|
30
30
|
case _features.FEATURE_NAMES.sessionTrace:
|
|
@@ -9,7 +9,7 @@ var CONSTANTS = _interopRequireWildcard(require("../constants"));
|
|
|
9
9
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
10
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
12
|
-
static featureName = CONSTANTS.FEATURE_NAME;
|
|
12
|
+
static featureName = (() => CONSTANTS.FEATURE_NAME)();
|
|
13
13
|
constructor(agentIdentifier, aggregator) {
|
|
14
14
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
15
15
|
super(agentIdentifier, aggregator, CONSTANTS.FEATURE_NAME, auto);
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Aggregate = void 0;
|
|
7
7
|
var _belSerializer = require("../../../common/serialize/bel-serializer");
|
|
8
|
-
var _mapOwn = require("../../../common/util/map-own");
|
|
9
8
|
var _harvestScheduler = require("../../../common/harvest/harvest-scheduler");
|
|
10
9
|
var _registerHandler = require("../../../common/event-emitter/register-handler");
|
|
11
10
|
var _handle = require("../../../common/event-emitter/handle");
|
|
@@ -29,7 +28,7 @@ var _constants2 = require("../../../common/vitals/constants");
|
|
|
29
28
|
*/
|
|
30
29
|
|
|
31
30
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
32
|
-
static featureName = _constants.FEATURE_NAME;
|
|
31
|
+
static featureName = (() => _constants.FEATURE_NAME)();
|
|
33
32
|
#handleVitalMetric = _ref => {
|
|
34
33
|
let {
|
|
35
34
|
name,
|
|
@@ -147,7 +146,8 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
147
146
|
var timingAttributes = timing.attrs || {};
|
|
148
147
|
var customAttributes = (0, _config.getInfo)(this.agentIdentifier).jsAttributes || {};
|
|
149
148
|
var reservedAttributes = ['size', 'eid', 'cls', 'type', 'fid', 'elTag', 'elUrl', 'net-type', 'net-etype', 'net-rtt', 'net-dlink'];
|
|
150
|
-
|
|
149
|
+
Object.entries(customAttributes || {}).forEach(_ref3 => {
|
|
150
|
+
let [key, val] = _ref3;
|
|
151
151
|
if (reservedAttributes.indexOf(key) < 0) {
|
|
152
152
|
timingAttributes[key] = val;
|
|
153
153
|
}
|
|
@@ -17,7 +17,7 @@ var _now = require("../../../common/timing/now");
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
20
|
-
static featureName = _constants.FEATURE_NAME;
|
|
20
|
+
static featureName = (() => _constants.FEATURE_NAME)();
|
|
21
21
|
constructor(agentIdentifier, aggregator) {
|
|
22
22
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
23
23
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME, auto);
|
|
@@ -35,8 +35,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
35
35
|
* functionality is validated and a full user experience is curated.
|
|
36
36
|
*/
|
|
37
37
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
38
|
-
static featureName = _constants.FEATURE_NAME;
|
|
39
|
-
mode = _constants3.MODE.OFF;
|
|
38
|
+
static featureName = (() => _constants.FEATURE_NAME)();
|
|
39
|
+
mode = (() => _constants3.MODE.OFF)();
|
|
40
40
|
|
|
41
41
|
// pass the recorder into the aggregator
|
|
42
42
|
constructor(agentIdentifier, aggregator, args) {
|
|
@@ -21,7 +21,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
21
21
|
* functionality is validated and a full user experience is curated.
|
|
22
22
|
*/
|
|
23
23
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
24
|
-
static featureName = _constants2.FEATURE_NAME;
|
|
24
|
+
static featureName = (() => _constants2.FEATURE_NAME)();
|
|
25
25
|
#mode;
|
|
26
26
|
constructor(agentIdentifier, aggregator) {
|
|
27
27
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
@@ -7,7 +7,7 @@ exports.stylesheetEvaluator = void 0;
|
|
|
7
7
|
var _config = require("../../../common/config/config");
|
|
8
8
|
var _runtime = require("../../../common/constants/runtime");
|
|
9
9
|
class StylesheetEvaluator {
|
|
10
|
-
#evaluated = new WeakSet();
|
|
10
|
+
#evaluated = (() => new WeakSet())();
|
|
11
11
|
#fetchProms = [];
|
|
12
12
|
/**
|
|
13
13
|
* Flipped to true if stylesheets that cannot be natively inlined are detected by the stylesheetEvaluator class
|
|
@@ -18,7 +18,7 @@ const ERROR_MODE_SECONDS_WINDOW = 30 * 1000; // sliding window of nodes to track
|
|
|
18
18
|
/** Reserved room for query param attrs */
|
|
19
19
|
const QUERY_PARAM_PADDING = 5000;
|
|
20
20
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
21
|
-
static featureName = _constants.FEATURE_NAME;
|
|
21
|
+
static featureName = (() => _constants.FEATURE_NAME)();
|
|
22
22
|
constructor(agentIdentifier, aggregator) {
|
|
23
23
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME);
|
|
24
24
|
this.agentRuntime = (0, _config.getRuntime)(agentIdentifier);
|
|
@@ -39,10 +39,10 @@ const toAggregate = {
|
|
|
39
39
|
class TraceStorage {
|
|
40
40
|
nodeCount = 0;
|
|
41
41
|
trace = {};
|
|
42
|
-
earliestTimeStamp = Infinity;
|
|
42
|
+
earliestTimeStamp = (() => Infinity)();
|
|
43
43
|
latestTimeStamp = 0;
|
|
44
44
|
tempStorage = [];
|
|
45
|
-
prevStoredEvents = new Set();
|
|
45
|
+
prevStoredEvents = (() => new Set())();
|
|
46
46
|
constructor(parent) {
|
|
47
47
|
this.parent = parent;
|
|
48
48
|
}
|
|
@@ -30,7 +30,7 @@ const {
|
|
|
30
30
|
PUSH_STATE
|
|
31
31
|
} = CONSTANTS;
|
|
32
32
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
33
|
-
static featureName = FEATURE_NAME;
|
|
33
|
+
static featureName = (() => FEATURE_NAME)();
|
|
34
34
|
constructor(agentIdentifier, aggregator) {
|
|
35
35
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
36
36
|
super(agentIdentifier, aggregator, FEATURE_NAME, auto);
|
|
@@ -13,7 +13,7 @@ class BelNode {
|
|
|
13
13
|
end;
|
|
14
14
|
callbackEnd = 0;
|
|
15
15
|
callbackDuration = 0;
|
|
16
|
-
nodeId = ++nodesSeen;
|
|
16
|
+
nodeId = (() => ++nodesSeen)();
|
|
17
17
|
constructor(agentIdentifier) {
|
|
18
18
|
if (!agentIdentifier) throw new Error('Interaction is missing core attributes');
|
|
19
19
|
this.agentIdentifier = agentIdentifier;
|
|
@@ -19,7 +19,7 @@ var _ajaxNode = require("./ajax-node");
|
|
|
19
19
|
var _initialPageLoadInteraction = require("./initial-page-load-interaction");
|
|
20
20
|
var _interaction = require("./interaction");
|
|
21
21
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
22
|
-
static featureName = _constants2.FEATURE_NAME;
|
|
22
|
+
static featureName = (() => _constants2.FEATURE_NAME)();
|
|
23
23
|
constructor(agentIdentifier, aggregator, _ref) {
|
|
24
24
|
let {
|
|
25
25
|
domObserver
|
|
@@ -16,10 +16,10 @@ var _belNode = require("./bel-node");
|
|
|
16
16
|
* link https://github.com/newrelic/nr-querypack/blob/main/schemas/bel/7.qpschema
|
|
17
17
|
**/
|
|
18
18
|
class Interaction extends _belNode.BelNode {
|
|
19
|
-
id = (0, _uniqueId.generateUuid)(); // unique id that is serialized and used to link interactions with errors
|
|
20
|
-
initialPageURL = _runtime.initialLocation;
|
|
21
|
-
oldURL = '' + _runtime.globalScope?.location;
|
|
22
|
-
newURL = '' + _runtime.globalScope?.location;
|
|
19
|
+
id = (() => (0, _uniqueId.generateUuid)())(); // unique id that is serialized and used to link interactions with errors
|
|
20
|
+
initialPageURL = (() => _runtime.initialLocation)();
|
|
21
|
+
oldURL = (() => '' + _runtime.globalScope?.location)();
|
|
22
|
+
newURL = (() => '' + _runtime.globalScope?.location)();
|
|
23
23
|
customName;
|
|
24
24
|
customAttributes = {};
|
|
25
25
|
customDataByApi = {};
|
|
@@ -27,7 +27,7 @@ class Interaction extends _belNode.BelNode {
|
|
|
27
27
|
appTime; // only used by initialPageLoad interactions
|
|
28
28
|
newRoute;
|
|
29
29
|
/** Internal state of this interaction: in-progress, finished, or cancelled. */
|
|
30
|
-
status = _constants.INTERACTION_STATUS.IP;
|
|
30
|
+
status = (() => _constants.INTERACTION_STATUS.IP)();
|
|
31
31
|
domTimestamp = 0;
|
|
32
32
|
historyTimestamp = 0;
|
|
33
33
|
createdByApi = false;
|
|
@@ -20,7 +20,7 @@ var _now = require("../../../common/timing/now");
|
|
|
20
20
|
const UI_WAIT_INTERVAL = 1 / 10 * 1000; // assume 10 fps
|
|
21
21
|
|
|
22
22
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
23
|
-
static featureName = _constants.FEATURE_NAME;
|
|
23
|
+
static featureName = (() => _constants.FEATURE_NAME)();
|
|
24
24
|
constructor(agentIdentifier, aggregator) {
|
|
25
25
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
26
26
|
super(agentIdentifier, aggregator, _constants.FEATURE_NAME, auto);
|
|
@@ -7,7 +7,6 @@ exports.Aggregate = void 0;
|
|
|
7
7
|
var _registerHandler = require("../../../common/event-emitter/register-handler");
|
|
8
8
|
var _parseUrl = require("../../../common/url/parse-url");
|
|
9
9
|
var _denyList = require("../../../common/deny-list/deny-list");
|
|
10
|
-
var _mapOwn = require("../../../common/util/map-own");
|
|
11
10
|
var _navTiming = require("../../../common/timing/nav-timing");
|
|
12
11
|
var _uniqueId = require("../../../common/ids/unique-id");
|
|
13
12
|
var _interaction = require("./interaction");
|
|
@@ -54,7 +53,7 @@ const {
|
|
|
54
53
|
originalSetTimeout
|
|
55
54
|
} = CONSTANTS;
|
|
56
55
|
class Aggregate extends _aggregateBase.AggregateBase {
|
|
57
|
-
static featureName = FEATURE_NAME;
|
|
56
|
+
static featureName = (() => FEATURE_NAME)();
|
|
58
57
|
constructor(agentIdentifier, aggregator) {
|
|
59
58
|
super(agentIdentifier, aggregator, FEATURE_NAME);
|
|
60
59
|
const agentRuntime = (0, _config.getRuntime)(agentIdentifier);
|
|
@@ -622,7 +621,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
622
621
|
|
|
623
622
|
// make sure that newrelic[INTERACTION]() works in end handler
|
|
624
623
|
state.currentNode = root;
|
|
625
|
-
|
|
624
|
+
Object.values(interaction.handlers || {}).forEach(function (cb) {
|
|
626
625
|
cb(attrs.store);
|
|
627
626
|
});
|
|
628
627
|
setCurrentNode(null);
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Interaction = Interaction;
|
|
7
7
|
var _config = require("../../../common/config/config");
|
|
8
|
-
var _mapOwn = require("../../../common/util/map-own");
|
|
9
8
|
var _contextualEe = require("../../../common/event-emitter/contextual-ee");
|
|
10
9
|
var _interactionNode = require("./interaction-node");
|
|
11
10
|
/*
|
|
@@ -88,7 +87,8 @@ InteractionPrototype.finish = function finishInteraction() {
|
|
|
88
87
|
if (this.onFinished) {
|
|
89
88
|
this.onFinished(this);
|
|
90
89
|
}
|
|
91
|
-
|
|
90
|
+
Object.entries((0, _config.getInfo)(interaction.agentIdentifier).jsAttributes || {}).forEach(_ref => {
|
|
91
|
+
let [attr, value] = _ref;
|
|
92
92
|
if (!(attr in customAttrs)) customAttrs[attr] = value;
|
|
93
93
|
});
|
|
94
94
|
root.end = endTimestamp;
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Serializer = void 0;
|
|
7
7
|
var _cleanUrl = require("../../../common/url/clean-url");
|
|
8
|
-
var _mapOwn = require("../../../common/util/map-own");
|
|
9
8
|
var _belSerializer = require("../../../common/serialize/bel-serializer");
|
|
10
9
|
var _sharedContext = require("../../../common/context/shared-context");
|
|
11
10
|
var _config = require("../../../common/config/config");
|
|
@@ -132,7 +131,7 @@ class Serializer extends _sharedContext.SharedContext {
|
|
|
132
131
|
// get all navTiming values except navigationStart
|
|
133
132
|
// (since its the same as interaction.start)
|
|
134
133
|
// and limit to just the first 20 values we know about
|
|
135
|
-
|
|
134
|
+
Object.values(navTiming.slice(1, 21) || {}).forEach(v => {
|
|
136
135
|
if (v !== undefined) {
|
|
137
136
|
navTimingNode += seperator + (0, _belSerializer.numeric)(v - prev);
|
|
138
137
|
seperator = ',';
|
|
@@ -31,7 +31,7 @@ const {
|
|
|
31
31
|
FN_END
|
|
32
32
|
} = CONSTANTS;
|
|
33
33
|
class Instrument extends _instrumentBase.InstrumentBase {
|
|
34
|
-
static featureName = FEATURE_NAME;
|
|
34
|
+
static featureName = (() => FEATURE_NAME)();
|
|
35
35
|
constructor(agentIdentifier, aggregator) {
|
|
36
36
|
var _this;
|
|
37
37
|
let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
@@ -41,6 +41,8 @@ class AggregateBase extends _featureBase.FeatureBase {
|
|
|
41
41
|
});
|
|
42
42
|
return flagsPromise.catch(err => {
|
|
43
43
|
this.ee.emit('internal-error', [err]);
|
|
44
|
+
this.blocked = true;
|
|
45
|
+
(0, _drain.deregisterDrain)(this.agentIdentifier, this.featureName);
|
|
44
46
|
});
|
|
45
47
|
}
|
|
46
48
|
drain() {
|
|
@@ -25,12 +25,12 @@ function lazyFeatureLoader(featureName, featurePart) {
|
|
|
25
25
|
return Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "ajax-aggregate" */'../ajax/aggregate')));
|
|
26
26
|
case _features.FEATURE_NAMES.jserrors:
|
|
27
27
|
return Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "jserrors-aggregate" */'../jserrors/aggregate')));
|
|
28
|
+
case _features.FEATURE_NAMES.genericEvents:
|
|
29
|
+
return Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "generic_events-aggregate" */'../generic_events/aggregate')));
|
|
28
30
|
case _features.FEATURE_NAMES.logging:
|
|
29
31
|
return Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "logging-aggregate" */'../logging/aggregate')));
|
|
30
32
|
case _features.FEATURE_NAMES.metrics:
|
|
31
33
|
return Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "metrics-aggregate" */'../metrics/aggregate')));
|
|
32
|
-
case _features.FEATURE_NAMES.pageAction:
|
|
33
|
-
return Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "page_action-aggregate" */'../page_action/aggregate')));
|
|
34
34
|
case _features.FEATURE_NAMES.pageViewEvent:
|
|
35
35
|
return Promise.resolve().then(() => _interopRequireWildcard(require( /* webpackChunkName: "page_view_event-aggregate" */'../page_view_event/aggregate')));
|
|
36
36
|
case _features.FEATURE_NAMES.pageViewTiming:
|
package/dist/cjs/index.js
CHANGED
|
@@ -21,12 +21,24 @@ Object.defineProperty(exports, "BrowserAgent", {
|
|
|
21
21
|
return _browserAgent.BrowserAgent;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "GenericEvents", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _generic_events.GenericEvents;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "JSErrors", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function () {
|
|
27
33
|
return _jserrors.JSErrors;
|
|
28
34
|
}
|
|
29
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "Logging", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _logging.Logging;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
30
42
|
Object.defineProperty(exports, "Metrics", {
|
|
31
43
|
enumerable: true,
|
|
32
44
|
get: function () {
|
|
@@ -57,6 +69,12 @@ Object.defineProperty(exports, "PageViewTiming", {
|
|
|
57
69
|
return _page_view_timing.PageViewTiming;
|
|
58
70
|
}
|
|
59
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "SessionReplay", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _session_replay.SessionReplay;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
60
78
|
Object.defineProperty(exports, "SessionTrace", {
|
|
61
79
|
enumerable: true,
|
|
62
80
|
get: function () {
|
|
@@ -74,9 +92,12 @@ var _browserAgent = require("./loaders/browser-agent");
|
|
|
74
92
|
var _microAgent = require("./loaders/micro-agent");
|
|
75
93
|
var _ajax = require("./features/ajax");
|
|
76
94
|
var _jserrors = require("./features/jserrors");
|
|
95
|
+
var _generic_events = require("./features/generic_events");
|
|
96
|
+
var _logging = require("./features/logging");
|
|
77
97
|
var _metrics = require("./features/metrics");
|
|
78
98
|
var _page_action = require("./features/page_action");
|
|
79
99
|
var _page_view_event = require("./features/page_view_event");
|
|
80
100
|
var _page_view_timing = require("./features/page_view_timing");
|
|
81
101
|
var _session_trace = require("./features/session_trace");
|
|
102
|
+
var _session_replay = require("./features/session_replay");
|
|
82
103
|
var _spa = require("./features/spa");
|
|
@@ -7,7 +7,6 @@ exports.AgentBase = void 0;
|
|
|
7
7
|
var _console = require("../common/util/console");
|
|
8
8
|
var _constants = require("../features/session_replay/constants");
|
|
9
9
|
var _uniqueId = require("../common/ids/unique-id");
|
|
10
|
-
var _contextualEe = require("../common/event-emitter/contextual-ee");
|
|
11
10
|
/* eslint-disable n/handle-callback-err */
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -19,9 +18,6 @@ class AgentBase {
|
|
|
19
18
|
constructor() {
|
|
20
19
|
let agentIdentifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _uniqueId.generateRandomHexString)(16);
|
|
21
20
|
this.agentIdentifier = agentIdentifier;
|
|
22
|
-
|
|
23
|
-
// Assign the observation context to the event emitter, so it knows how to create observation contexts
|
|
24
|
-
this.ee = _contextualEe.ee.get(agentIdentifier);
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
/**
|
|
@@ -89,7 +89,7 @@ function setAPI(agentIdentifier, forceDrain) {
|
|
|
89
89
|
_apiMethods.asyncApiMethods.forEach(fnName => {
|
|
90
90
|
apiInterface[fnName] = apiCall(prefix, fnName, true, 'api');
|
|
91
91
|
});
|
|
92
|
-
apiInterface.addPageAction = apiCall(prefix, 'addPageAction', true, _features.FEATURE_NAMES.
|
|
92
|
+
apiInterface.addPageAction = apiCall(prefix, 'addPageAction', true, _features.FEATURE_NAMES.genericEvents);
|
|
93
93
|
apiInterface.setPageViewName = function (name, host) {
|
|
94
94
|
if (typeof name !== 'string') return;
|
|
95
95
|
if (name.charAt(0) !== '/') name = '/' + name;
|
|
@@ -40,7 +40,7 @@ function setAPI(agentIdentifier) {
|
|
|
40
40
|
start: time + _runtime.originTime,
|
|
41
41
|
origin: 'nr'
|
|
42
42
|
});
|
|
43
|
-
(0, _handle.handle)('api-addPageAction', [time, 'finished'], undefined, _features.FEATURE_NAMES.
|
|
43
|
+
(0, _handle.handle)('api-addPageAction', [time, 'finished'], undefined, _features.FEATURE_NAMES.genericEvents, instanceEE);
|
|
44
44
|
}
|
|
45
45
|
function addToTrace(t, evt) {
|
|
46
46
|
if (!(evt && typeof evt === 'object' && evt.name && evt.start)) return;
|
|
@@ -12,8 +12,9 @@ var _instrument4 = require("../features/jserrors/instrument");
|
|
|
12
12
|
var _instrument5 = require("../features/ajax/instrument");
|
|
13
13
|
var _instrument6 = require("../features/session_trace/instrument");
|
|
14
14
|
var _instrument7 = require("../features/spa/instrument");
|
|
15
|
-
var _instrument8 = require("../features/
|
|
16
|
-
var _instrument9 = require("../features/
|
|
15
|
+
var _instrument8 = require("../features/session_replay/instrument");
|
|
16
|
+
var _instrument9 = require("../features/generic_events/instrument");
|
|
17
|
+
var _instrument10 = require("../features/logging/instrument");
|
|
17
18
|
/**
|
|
18
19
|
* An agent class with all feature modules available. Features may be disabled and enabled via runtime configuration.
|
|
19
20
|
* The BrowserAgent class is the most convenient and reliable option for most use cases.
|
|
@@ -22,7 +23,7 @@ class BrowserAgent extends _agent.Agent {
|
|
|
22
23
|
constructor(args) {
|
|
23
24
|
super({
|
|
24
25
|
...args,
|
|
25
|
-
features: [_instrument5.Instrument, _instrument.Instrument, _instrument2.Instrument, _instrument6.Instrument, _instrument3.Instrument,
|
|
26
|
+
features: [_instrument5.Instrument, _instrument.Instrument, _instrument2.Instrument, _instrument6.Instrument, _instrument3.Instrument, _instrument4.Instrument, _instrument7.Instrument, _instrument8.Instrument, _instrument9.Instrument, _instrument10.Instrument],
|
|
26
27
|
loaderType: 'browser-agent'
|
|
27
28
|
});
|
|
28
29
|
}
|
|
@@ -10,6 +10,7 @@ var _config = require("../../common/config/config");
|
|
|
10
10
|
var _featureFlags = require("../../common/util/feature-flags");
|
|
11
11
|
var _runtime = require("../../common/constants/runtime");
|
|
12
12
|
var _publicPath = require("./public-path");
|
|
13
|
+
var _contextualEe = require("../../common/event-emitter/contextual-ee");
|
|
13
14
|
let alreadySetOnce = false; // the configure() function can run multiple times in agent lifecycle
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -24,11 +25,10 @@ function configure(agent) {
|
|
|
24
25
|
init,
|
|
25
26
|
info,
|
|
26
27
|
loader_config,
|
|
27
|
-
runtime = {
|
|
28
|
-
loaderType
|
|
29
|
-
},
|
|
28
|
+
runtime = {},
|
|
30
29
|
exposed = true
|
|
31
30
|
} = opts;
|
|
31
|
+
runtime.loaderType = loaderType;
|
|
32
32
|
const nr = (0, _nreum.gosCDN)();
|
|
33
33
|
if (!info) {
|
|
34
34
|
init = nr.init;
|
|
@@ -62,6 +62,7 @@ function configure(agent) {
|
|
|
62
62
|
runtime.denyList = [...(updatedInit.ajax.deny_list || []), ...(updatedInit.ajax.block_internal ? internalTrafficList : [])];
|
|
63
63
|
runtime.ptid = agent.agentIdentifier;
|
|
64
64
|
(0, _config.setRuntime)(agent.agentIdentifier, runtime);
|
|
65
|
+
agent.ee = _contextualEe.ee.get(agent.agentIdentifier);
|
|
65
66
|
if (agent.api === undefined) agent.api = (0, _api.setAPI)(agent.agentIdentifier, forceDrain, agent.runSoftNavOverSpa);
|
|
66
67
|
if (agent.exposed === undefined) agent.exposed = exposed;
|
|
67
68
|
alreadySetOnce = true;
|
|
@@ -6,9 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.featurePriority = exports.FEATURE_NAMES = void 0;
|
|
7
7
|
const FEATURE_NAMES = exports.FEATURE_NAMES = {
|
|
8
8
|
ajax: 'ajax',
|
|
9
|
+
genericEvents: 'generic_events',
|
|
9
10
|
jserrors: 'jserrors',
|
|
10
11
|
logging: 'logging',
|
|
11
12
|
metrics: 'metrics',
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated This feature has been replaced by Generic Events. Use/Import `GenericEvents` instead. This wrapper will be removed in a future release
|
|
15
|
+
*/
|
|
12
16
|
pageAction: 'page_action',
|
|
13
17
|
pageViewEvent: 'page_view_event',
|
|
14
18
|
pageViewTiming: 'page_view_timing',
|
|
@@ -30,8 +34,8 @@ const featurePriority = exports.featurePriority = {
|
|
|
30
34
|
[FEATURE_NAMES.spa]: 5,
|
|
31
35
|
[FEATURE_NAMES.ajax]: 6,
|
|
32
36
|
[FEATURE_NAMES.sessionTrace]: 7,
|
|
33
|
-
[FEATURE_NAMES.
|
|
34
|
-
[FEATURE_NAMES.
|
|
35
|
-
[FEATURE_NAMES.
|
|
36
|
-
[FEATURE_NAMES.
|
|
37
|
+
[FEATURE_NAMES.softNav]: 8,
|
|
38
|
+
[FEATURE_NAMES.sessionReplay]: 9,
|
|
39
|
+
[FEATURE_NAMES.logging]: 10,
|
|
40
|
+
[FEATURE_NAMES.genericEvents]: 11
|
|
37
41
|
};
|
|
@@ -17,7 +17,7 @@ var _agentBase = require("./agent-base");
|
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } // loader files
|
|
19
19
|
// core files
|
|
20
|
-
const nonAutoFeatures = [_features.FEATURE_NAMES.jserrors, _features.FEATURE_NAMES.
|
|
20
|
+
const nonAutoFeatures = [_features.FEATURE_NAMES.jserrors, _features.FEATURE_NAMES.genericEvents, _features.FEATURE_NAMES.metrics];
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* A minimal agent class designed to only respond to manual user input. As such, this class does not
|
|
@@ -16,13 +16,10 @@ import { Instrument as InstrumentErrors } from '../features/jserrors/instrument'
|
|
|
16
16
|
import { Instrument as InstrumentXhr } from '../features/ajax/instrument';
|
|
17
17
|
import { Instrument as InstrumentSessionTrace } from '../features/session_trace/instrument';
|
|
18
18
|
import { Instrument as InstrumentSessionReplay } from '../features/session_replay/instrument';
|
|
19
|
-
|
|
19
|
+
import { Instrument as InstrumentGenericEvents } from '../features/generic_events/instrument';
|
|
20
20
|
import { Instrument as InstrumentSoftNav } from '../features/soft_navigations/instrument';
|
|
21
|
-
import { Instrument as InstrumentPageAction } from '../features/page_action/instrument';
|
|
22
21
|
import { Instrument as InstrumentLogs } from '../features/logging/instrument';
|
|
23
22
|
new Agent({
|
|
24
|
-
features: [InstrumentXhr, InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentSessionTrace, InstrumentSessionReplay, InstrumentMetrics,
|
|
25
|
-
// InstrumentSpa,
|
|
26
|
-
InstrumentSoftNav],
|
|
23
|
+
features: [InstrumentXhr, InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentSessionTrace, InstrumentSessionReplay, InstrumentMetrics, InstrumentErrors, InstrumentGenericEvents, InstrumentLogs, InstrumentSoftNav],
|
|
27
24
|
loaderType: 'experimental'
|
|
28
25
|
});
|
package/dist/esm/cdn/pro.js
CHANGED
|
@@ -11,9 +11,9 @@ import { Instrument as InstrumentErrors } from '../features/jserrors/instrument'
|
|
|
11
11
|
import { Instrument as InstrumentXhr } from '../features/ajax/instrument';
|
|
12
12
|
import { Instrument as InstrumentSessionTrace } from '../features/session_trace/instrument';
|
|
13
13
|
import { Instrument as InstrumentSessionReplay } from '../features/session_replay/instrument';
|
|
14
|
-
import { Instrument as
|
|
14
|
+
import { Instrument as InstrumentGenericEvents } from '../features/generic_events/instrument';
|
|
15
15
|
import { Instrument as InstrumentLogs } from '../features/logging/instrument';
|
|
16
16
|
new Agent({
|
|
17
|
-
features: [InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentSessionTrace, InstrumentSessionReplay, InstrumentXhr, InstrumentMetrics,
|
|
17
|
+
features: [InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentSessionTrace, InstrumentSessionReplay, InstrumentXhr, InstrumentMetrics, InstrumentErrors, InstrumentGenericEvents, InstrumentLogs],
|
|
18
18
|
loaderType: 'pro'
|
|
19
19
|
});
|
package/dist/esm/cdn/spa.js
CHANGED
|
@@ -12,10 +12,10 @@ import { Instrument as InstrumentSessionTrace } from '../features/session_trace/
|
|
|
12
12
|
import { Instrument as InstrumentSessionReplay } from '../features/session_replay/instrument';
|
|
13
13
|
import { Instrument as InstrumentSoftNav } from '../features/soft_navigations/instrument';
|
|
14
14
|
import { Instrument as InstrumentSpa } from '../features/spa/instrument';
|
|
15
|
-
import { Instrument as
|
|
15
|
+
import { Instrument as InstrumentGenericEvents } from '../features/generic_events/instrument';
|
|
16
16
|
import { Instrument as InstrumentLogs } from '../features/logging/instrument';
|
|
17
17
|
new Agent({
|
|
18
|
-
features: [InstrumentXhr, InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentSessionTrace, InstrumentSessionReplay, InstrumentMetrics,
|
|
18
|
+
features: [InstrumentXhr, InstrumentPageViewEvent, InstrumentPageViewTiming, InstrumentSessionTrace, InstrumentSessionReplay, InstrumentMetrics, InstrumentErrors, InstrumentGenericEvents, InstrumentLogs, InstrumentSoftNav, InstrumentSpa // either the softnav or the old spa will be used (not both), but we still need to pack both to avoid dynamic import for instrument files
|
|
19
19
|
],
|
|
20
20
|
loaderType: 'spa'
|
|
21
21
|
});
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { SharedContext } from '../context/shared-context';
|
|
7
|
-
import { mapOwn } from '../util/map-own';
|
|
8
7
|
export class Aggregator extends SharedContext {
|
|
9
8
|
constructor(parent) {
|
|
10
9
|
super(parent);
|
|
@@ -30,7 +29,7 @@ export class Aggregator extends SharedContext {
|
|
|
30
29
|
oldMetrics.count += metrics.count;
|
|
31
30
|
|
|
32
31
|
// iterate through each new metric and merge
|
|
33
|
-
|
|
32
|
+
Object.keys(metrics || {}).forEach(key => {
|
|
34
33
|
// count is a special case handled above
|
|
35
34
|
if (key === 'count') return;
|
|
36
35
|
var oldMetric = oldMetrics[key];
|
|
@@ -89,7 +88,8 @@ function aggregateMetrics(newMetrics, oldMetrics) {
|
|
|
89
88
|
count: 0
|
|
90
89
|
};
|
|
91
90
|
oldMetrics.count += 1;
|
|
92
|
-
|
|
91
|
+
Object.entries(newMetrics || {}).forEach(_ref => {
|
|
92
|
+
let [key, value] = _ref;
|
|
93
93
|
oldMetrics[key] = updateMetric(value, oldMetrics[key]);
|
|
94
94
|
});
|
|
95
95
|
return oldMetrics;
|
|
@@ -45,6 +45,11 @@ const model = () => {
|
|
|
45
45
|
allowed_origins: undefined
|
|
46
46
|
},
|
|
47
47
|
feature_flags: [],
|
|
48
|
+
generic_events: {
|
|
49
|
+
enabled: true,
|
|
50
|
+
harvestTimeSeconds: 30,
|
|
51
|
+
autoStart: true
|
|
52
|
+
},
|
|
48
53
|
harvest: {
|
|
49
54
|
tooManyRequestsDelay: 60
|
|
50
55
|
},
|
|
@@ -65,9 +70,7 @@ const model = () => {
|
|
|
65
70
|
},
|
|
66
71
|
obfuscate: undefined,
|
|
67
72
|
page_action: {
|
|
68
|
-
enabled: true
|
|
69
|
-
harvestTimeSeconds: 30,
|
|
70
|
-
autoStart: true
|
|
73
|
+
enabled: true
|
|
71
74
|
},
|
|
72
75
|
page_view_event: {
|
|
73
76
|
enabled: true,
|