@newrelic/browser-agent 1.262.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.
Files changed (259) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +2 -2
  3. package/dist/cjs/cdn/experimental.js +3 -7
  4. package/dist/cjs/cdn/pro.js +2 -2
  5. package/dist/cjs/cdn/spa.js +2 -2
  6. package/dist/cjs/common/aggregate/aggregator.js +3 -3
  7. package/dist/cjs/common/config/state/configurable.js +4 -4
  8. package/dist/cjs/common/config/state/init.js +11 -6
  9. package/dist/cjs/common/constants/env.cdn.js +1 -1
  10. package/dist/cjs/common/constants/env.npm.js +1 -1
  11. package/dist/cjs/common/constants/runtime.js +1 -3
  12. package/dist/cjs/common/context/shared-context.js +2 -2
  13. package/dist/cjs/common/drain/drain.js +5 -5
  14. package/dist/cjs/common/harvest/harvest.js +3 -3
  15. package/dist/cjs/common/serialize/bel-serializer.js +2 -2
  16. package/dist/cjs/common/session/session-entity.js +3 -3
  17. package/dist/cjs/common/timing/time-keeper.js +13 -2
  18. package/dist/cjs/common/url/encode.js +3 -5
  19. package/dist/cjs/common/util/console.js +3 -4
  20. package/dist/cjs/common/util/obfuscate.js +3 -3
  21. package/dist/cjs/common/util/submit-data.js +0 -1
  22. package/dist/cjs/common/vitals/vital-metric.js +1 -1
  23. package/dist/cjs/common/wrap/wrap-logger.js +1 -2
  24. package/dist/cjs/common/wrap/wrap-xhr.js +1 -1
  25. package/dist/cjs/features/ajax/aggregate/index.js +1 -1
  26. package/dist/cjs/features/ajax/instrument/index.js +1 -1
  27. package/dist/cjs/features/generic_events/aggregate/index.js +137 -0
  28. package/dist/cjs/features/generic_events/constants.js +8 -0
  29. package/dist/cjs/features/generic_events/index.js +12 -0
  30. package/dist/cjs/features/generic_events/instrument/index.js +27 -0
  31. package/dist/cjs/features/jserrors/aggregate/index.js +13 -12
  32. package/dist/cjs/features/jserrors/instrument/index.js +1 -1
  33. package/dist/cjs/features/logging/aggregate/index.js +6 -6
  34. package/dist/cjs/features/logging/constants.js +2 -5
  35. package/dist/cjs/features/logging/instrument/index.js +1 -1
  36. package/dist/cjs/features/metrics/aggregate/index.js +17 -1
  37. package/dist/cjs/features/metrics/instrument/index.js +1 -1
  38. package/dist/cjs/features/page_action/instrument/index.js +6 -6
  39. package/dist/cjs/features/page_view_event/aggregate/index.js +21 -5
  40. package/dist/cjs/features/page_view_event/aggregate/initialized-features.js +1 -1
  41. package/dist/cjs/features/page_view_event/instrument/index.js +1 -1
  42. package/dist/cjs/features/page_view_timing/aggregate/index.js +3 -3
  43. package/dist/cjs/features/page_view_timing/instrument/index.js +1 -1
  44. package/dist/cjs/features/session_replay/aggregate/index.js +3 -3
  45. package/dist/cjs/features/session_replay/instrument/index.js +1 -1
  46. package/dist/cjs/features/session_replay/shared/recorder.js +1 -1
  47. package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +1 -1
  48. package/dist/cjs/features/session_trace/aggregate/index.js +1 -1
  49. package/dist/cjs/features/session_trace/aggregate/trace/storage.js +2 -2
  50. package/dist/cjs/features/session_trace/instrument/index.js +1 -1
  51. package/dist/cjs/features/soft_navigations/aggregate/bel-node.js +1 -1
  52. package/dist/cjs/features/soft_navigations/aggregate/index.js +1 -1
  53. package/dist/cjs/features/soft_navigations/aggregate/interaction.js +5 -5
  54. package/dist/cjs/features/soft_navigations/instrument/index.js +1 -1
  55. package/dist/cjs/features/spa/aggregate/index.js +3 -4
  56. package/dist/cjs/features/spa/aggregate/interaction.js +2 -2
  57. package/dist/cjs/features/spa/aggregate/serializer.js +1 -2
  58. package/dist/cjs/features/spa/instrument/index.js +1 -1
  59. package/dist/cjs/features/utils/aggregate-base.js +6 -3
  60. package/dist/cjs/features/utils/instrument-base.js +2 -2
  61. package/dist/cjs/features/utils/lazy-feature-loader.js +2 -2
  62. package/dist/cjs/index.js +21 -0
  63. package/dist/cjs/loaders/agent-base.js +1 -5
  64. package/dist/cjs/loaders/agent.js +3 -4
  65. package/dist/cjs/loaders/api/api.js +10 -8
  66. package/dist/cjs/loaders/api/apiAsync.js +1 -1
  67. package/dist/cjs/loaders/browser-agent.js +4 -3
  68. package/dist/cjs/loaders/configure/configure.js +4 -3
  69. package/dist/cjs/loaders/features/features.js +8 -4
  70. package/dist/cjs/loaders/micro-agent.js +6 -6
  71. package/dist/esm/cdn/experimental.js +2 -5
  72. package/dist/esm/cdn/pro.js +2 -2
  73. package/dist/esm/cdn/spa.js +2 -2
  74. package/dist/esm/common/aggregate/aggregator.js +3 -3
  75. package/dist/esm/common/config/state/configurable.js +4 -4
  76. package/dist/esm/common/config/state/init.js +11 -6
  77. package/dist/esm/common/constants/env.cdn.js +1 -1
  78. package/dist/esm/common/constants/env.npm.js +1 -1
  79. package/dist/esm/common/constants/runtime.js +0 -2
  80. package/dist/esm/common/context/shared-context.js +2 -2
  81. package/dist/esm/common/drain/drain.js +5 -5
  82. package/dist/esm/common/harvest/harvest.js +4 -4
  83. package/dist/esm/common/serialize/bel-serializer.js +2 -2
  84. package/dist/esm/common/session/session-entity.js +4 -4
  85. package/dist/esm/common/timing/time-keeper.js +12 -2
  86. package/dist/esm/common/url/encode.js +3 -5
  87. package/dist/esm/common/util/console.js +3 -4
  88. package/dist/esm/common/util/obfuscate.js +3 -3
  89. package/dist/esm/common/util/submit-data.js +0 -1
  90. package/dist/esm/common/vitals/vital-metric.js +1 -1
  91. package/dist/esm/common/wrap/wrap-logger.js +1 -2
  92. package/dist/esm/common/wrap/wrap-xhr.js +1 -1
  93. package/dist/esm/features/ajax/aggregate/index.js +1 -1
  94. package/dist/esm/features/ajax/instrument/index.js +1 -1
  95. package/dist/esm/features/generic_events/aggregate/index.js +129 -0
  96. package/dist/esm/features/generic_events/constants.js +2 -0
  97. package/dist/esm/features/generic_events/index.js +1 -0
  98. package/dist/esm/features/generic_events/instrument/index.js +20 -0
  99. package/dist/esm/features/jserrors/aggregate/index.js +13 -12
  100. package/dist/esm/features/jserrors/instrument/index.js +1 -1
  101. package/dist/esm/features/logging/aggregate/index.js +7 -7
  102. package/dist/esm/features/logging/constants.js +1 -4
  103. package/dist/esm/features/logging/instrument/index.js +1 -1
  104. package/dist/esm/features/metrics/aggregate/index.js +17 -1
  105. package/dist/esm/features/metrics/instrument/index.js +1 -1
  106. package/dist/esm/features/page_action/instrument/index.js +7 -6
  107. package/dist/esm/features/page_view_event/aggregate/index.js +22 -6
  108. package/dist/esm/features/page_view_event/aggregate/initialized-features.js +1 -1
  109. package/dist/esm/features/page_view_event/instrument/index.js +1 -1
  110. package/dist/esm/features/page_view_timing/aggregate/index.js +3 -3
  111. package/dist/esm/features/page_view_timing/instrument/index.js +1 -1
  112. package/dist/esm/features/session_replay/aggregate/index.js +3 -3
  113. package/dist/esm/features/session_replay/instrument/index.js +1 -1
  114. package/dist/esm/features/session_replay/shared/recorder.js +1 -1
  115. package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +1 -1
  116. package/dist/esm/features/session_trace/aggregate/index.js +1 -1
  117. package/dist/esm/features/session_trace/aggregate/trace/storage.js +2 -2
  118. package/dist/esm/features/session_trace/instrument/index.js +1 -1
  119. package/dist/esm/features/soft_navigations/aggregate/bel-node.js +1 -1
  120. package/dist/esm/features/soft_navigations/aggregate/index.js +1 -1
  121. package/dist/esm/features/soft_navigations/aggregate/interaction.js +5 -5
  122. package/dist/esm/features/soft_navigations/instrument/index.js +1 -1
  123. package/dist/esm/features/spa/aggregate/index.js +3 -4
  124. package/dist/esm/features/spa/aggregate/interaction.js +2 -2
  125. package/dist/esm/features/spa/aggregate/serializer.js +1 -2
  126. package/dist/esm/features/spa/instrument/index.js +1 -1
  127. package/dist/esm/features/utils/aggregate-base.js +7 -4
  128. package/dist/esm/features/utils/instrument-base.js +2 -2
  129. package/dist/esm/features/utils/lazy-feature-loader.js +2 -2
  130. package/dist/esm/index.js +3 -0
  131. package/dist/esm/loaders/agent-base.js +1 -5
  132. package/dist/esm/loaders/agent.js +3 -4
  133. package/dist/esm/loaders/api/api.js +10 -8
  134. package/dist/esm/loaders/api/apiAsync.js +1 -1
  135. package/dist/esm/loaders/browser-agent.js +3 -2
  136. package/dist/esm/loaders/configure/configure.js +4 -3
  137. package/dist/esm/loaders/features/features.js +8 -4
  138. package/dist/esm/loaders/micro-agent.js +6 -6
  139. package/dist/types/common/aggregate/aggregator.d.ts.map +1 -1
  140. package/dist/types/common/config/state/init.d.ts.map +1 -1
  141. package/dist/types/common/constants/runtime.d.ts +0 -1
  142. package/dist/types/common/constants/runtime.d.ts.map +1 -1
  143. package/dist/types/common/drain/drain.d.ts.map +1 -1
  144. package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -1
  145. package/dist/types/common/timing/time-keeper.d.ts +2 -1
  146. package/dist/types/common/timing/time-keeper.d.ts.map +1 -1
  147. package/dist/types/common/url/encode.d.ts.map +1 -1
  148. package/dist/types/common/util/console.d.ts +1 -1
  149. package/dist/types/common/util/console.d.ts.map +1 -1
  150. package/dist/types/common/util/submit-data.d.ts.map +1 -1
  151. package/dist/types/common/wrap/wrap-logger.d.ts.map +1 -1
  152. package/dist/types/features/{page_action → generic_events}/aggregate/index.d.ts +7 -5
  153. package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -0
  154. package/dist/types/features/generic_events/constants.d.ts +2 -0
  155. package/dist/types/features/generic_events/constants.d.ts.map +1 -0
  156. package/dist/types/features/generic_events/index.d.ts +2 -0
  157. package/dist/types/features/generic_events/index.d.ts.map +1 -0
  158. package/dist/types/features/generic_events/instrument/index.d.ts +6 -0
  159. package/dist/types/features/generic_events/instrument/index.d.ts.map +1 -0
  160. package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
  161. package/dist/types/features/logging/constants.d.ts +0 -3
  162. package/dist/types/features/logging/constants.d.ts.map +1 -1
  163. package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
  164. package/dist/types/features/page_action/instrument/index.d.ts +5 -4
  165. package/dist/types/features/page_action/instrument/index.d.ts.map +1 -1
  166. package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
  167. package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
  168. package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
  169. package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
  170. package/dist/types/features/spa/aggregate/interaction.d.ts.map +1 -1
  171. package/dist/types/features/spa/aggregate/serializer.d.ts.map +1 -1
  172. package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
  173. package/dist/types/index.d.ts +3 -0
  174. package/dist/types/loaders/agent-base.d.ts +0 -1
  175. package/dist/types/loaders/agent-base.d.ts.map +1 -1
  176. package/dist/types/loaders/agent.d.ts.map +1 -1
  177. package/dist/types/loaders/api/api.d.ts.map +1 -1
  178. package/dist/types/loaders/browser-agent.d.ts.map +1 -1
  179. package/dist/types/loaders/configure/configure.d.ts.map +1 -1
  180. package/dist/types/loaders/features/features.d.ts +1 -0
  181. package/dist/types/loaders/features/features.d.ts.map +1 -1
  182. package/package.json +25 -6
  183. package/src/cdn/experimental.js +2 -4
  184. package/src/cdn/pro.js +2 -2
  185. package/src/cdn/spa.js +2 -2
  186. package/src/common/aggregate/aggregator.js +2 -3
  187. package/src/common/config/state/configurable.js +4 -4
  188. package/src/common/config/state/init.js +6 -4
  189. package/src/common/constants/runtime.js +0 -2
  190. package/src/common/context/shared-context.js +2 -2
  191. package/src/common/drain/drain.js +4 -5
  192. package/src/common/harvest/harvest.js +4 -4
  193. package/src/common/serialize/bel-serializer.js +1 -2
  194. package/src/common/session/session-entity.js +4 -4
  195. package/src/common/timing/time-keeper.js +14 -2
  196. package/src/common/url/encode.js +2 -3
  197. package/src/common/util/console.js +3 -4
  198. package/src/common/util/obfuscate.js +3 -3
  199. package/src/common/util/submit-data.js +0 -1
  200. package/src/common/wrap/wrap-logger.js +1 -2
  201. package/src/common/wrap/wrap-xhr.js +1 -1
  202. package/src/features/generic_events/aggregate/index.js +133 -0
  203. package/src/features/generic_events/constants.js +3 -0
  204. package/src/features/generic_events/index.js +1 -0
  205. package/src/features/generic_events/instrument/index.js +22 -0
  206. package/src/features/jserrors/aggregate/index.js +4 -5
  207. package/src/features/logging/aggregate/index.js +6 -6
  208. package/src/features/logging/constants.js +0 -4
  209. package/src/features/metrics/aggregate/index.js +12 -0
  210. package/src/features/page_action/instrument/index.js +6 -6
  211. package/src/features/page_view_event/aggregate/index.js +22 -5
  212. package/src/features/page_view_event/aggregate/initialized-features.js +1 -1
  213. package/src/features/page_view_timing/aggregate/index.js +1 -2
  214. package/src/features/session_replay/aggregate/index.js +1 -1
  215. package/src/features/session_replay/shared/recorder.js +1 -1
  216. package/src/features/spa/aggregate/index.js +2 -3
  217. package/src/features/spa/aggregate/interaction.js +1 -2
  218. package/src/features/spa/aggregate/serializer.js +1 -2
  219. package/src/features/utils/aggregate-base.js +7 -4
  220. package/src/features/utils/instrument-base.js +2 -2
  221. package/src/features/utils/lazy-feature-loader.js +2 -2
  222. package/src/index.js +3 -0
  223. package/src/loaders/agent-base.js +1 -5
  224. package/src/loaders/agent.js +3 -4
  225. package/src/loaders/api/api.js +10 -8
  226. package/src/loaders/api/apiAsync.js +1 -1
  227. package/src/loaders/browser-agent.js +5 -3
  228. package/src/loaders/configure/configure.js +5 -1
  229. package/src/loaders/features/features.js +8 -4
  230. package/src/loaders/micro-agent.js +6 -6
  231. package/dist/cjs/cdn/polyfills/lite.js +0 -16
  232. package/dist/cjs/cdn/polyfills/pro.js +0 -21
  233. package/dist/cjs/cdn/polyfills/spa.js +0 -22
  234. package/dist/cjs/cdn/polyfills.js +0 -24
  235. package/dist/cjs/common/util/map-own.js +0 -31
  236. package/dist/cjs/features/page_action/aggregate/index.js +0 -121
  237. package/dist/esm/cdn/polyfills/lite.js +0 -14
  238. package/dist/esm/cdn/polyfills/pro.js +0 -19
  239. package/dist/esm/cdn/polyfills/spa.js +0 -20
  240. package/dist/esm/cdn/polyfills.js +0 -27
  241. package/dist/esm/common/util/map-own.js +0 -24
  242. package/dist/esm/features/page_action/aggregate/index.js +0 -114
  243. package/dist/types/cdn/polyfills/lite.d.ts +0 -2
  244. package/dist/types/cdn/polyfills/lite.d.ts.map +0 -1
  245. package/dist/types/cdn/polyfills/pro.d.ts +0 -2
  246. package/dist/types/cdn/polyfills/pro.d.ts.map +0 -1
  247. package/dist/types/cdn/polyfills/spa.d.ts +0 -2
  248. package/dist/types/cdn/polyfills/spa.d.ts.map +0 -1
  249. package/dist/types/cdn/polyfills.d.ts +0 -2
  250. package/dist/types/cdn/polyfills.d.ts.map +0 -1
  251. package/dist/types/common/util/map-own.d.ts +0 -3
  252. package/dist/types/common/util/map-own.d.ts.map +0 -1
  253. package/dist/types/features/page_action/aggregate/index.d.ts.map +0 -1
  254. package/src/cdn/polyfills/lite.js +0 -20
  255. package/src/cdn/polyfills/pro.js +0 -30
  256. package/src/cdn/polyfills/spa.js +0 -32
  257. package/src/cdn/polyfills.js +0 -27
  258. package/src/common/util/map-own.js +0 -22
  259. package/src/features/page_action/aggregate/index.js +0 -114
@@ -12,7 +12,7 @@ import { now } from '../../../common/timing/now';
12
12
  import { SR_EVENT_EMITTER_TYPES } from '../../session_replay/constants';
13
13
  import { castError, castErrorEvent, castPromiseRejectionEvent } from '../shared/cast-error';
14
14
  export class Instrument extends InstrumentBase {
15
- static featureName = FEATURE_NAME;
15
+ static featureName = (() => FEATURE_NAME)();
16
16
  #replayRunning = false;
17
17
  constructor(agentIdentifier, aggregator) {
18
18
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
@@ -6,11 +6,11 @@ import { warn } from '../../../common/util/console';
6
6
  import { stringify } from '../../../common/util/stringify';
7
7
  import { SUPPORTABILITY_METRIC_CHANNEL } from '../../metrics/constants';
8
8
  import { AggregateBase } from '../../utils/aggregate-base';
9
- import { FEATURE_NAME, LOGGING_EVENT_EMITTER_CHANNEL, LOGGING_IGNORED, LOGGING_LEVEL_FAILURE_MESSAGE, LOG_LEVELS, MAX_PAYLOAD_SIZE } from '../constants';
9
+ import { FEATURE_NAME, LOGGING_EVENT_EMITTER_CHANNEL, LOG_LEVELS, MAX_PAYLOAD_SIZE } from '../constants';
10
10
  import { Log } from '../shared/log';
11
11
  import { isValidLogLevel } from '../shared/utils';
12
12
  export class Aggregate extends AggregateBase {
13
- static featureName = FEATURE_NAME;
13
+ static featureName = (() => FEATURE_NAME)();
14
14
  #agentRuntime;
15
15
  #agentInfo;
16
16
  constructor(agentIdentifier, aggregator) {
@@ -45,7 +45,7 @@ export class Aggregate extends AggregateBase {
45
45
  if (this.blocked) return;
46
46
  if (!attributes || typeof attributes !== 'object') attributes = {};
47
47
  if (typeof level === 'string') level = level.toUpperCase();
48
- if (!isValidLogLevel(level)) return warn(LOGGING_LEVEL_FAILURE_MESSAGE + level, Object.values(LOG_LEVELS));
48
+ if (!isValidLogLevel(level)) return warn(30, level);
49
49
  try {
50
50
  if (typeof message !== 'string') {
51
51
  const stringified = stringify(message);
@@ -57,19 +57,19 @@ export class Aggregate extends AggregateBase {
57
57
  if (!!stringified && stringified !== '{}') message = stringified;else message = String(message);
58
58
  }
59
59
  } catch (err) {
60
- warn('could not cast log message to string', message);
60
+ warn(16, message);
61
61
  return;
62
62
  }
63
- if (typeof message !== 'string' || !message) return warn(LOGGING_IGNORED + 'invalid message');
63
+ if (typeof message !== 'string' || !message) return warn(32);
64
64
  if (message.length > MAX_PAYLOAD_SIZE) {
65
65
  handle(SUPPORTABILITY_METRIC_CHANNEL, ['Logging/Harvest/Failed/Seen', message.length]);
66
- return warn(LOGGING_IGNORED + '> ' + MAX_PAYLOAD_SIZE + ' bytes: ', message.slice(0, 25) + '...');
66
+ return warn(31, message.slice(0, 25) + '...');
67
67
  }
68
68
  const log = new Log(this.#agentRuntime.timeKeeper.convertRelativeTimestamp(timestamp), message, attributes, level);
69
69
  const logBytes = log.message.length + stringify(log.attributes).length + log.level.length + 10; // timestamp == 10 chars
70
70
  if (logBytes > MAX_PAYLOAD_SIZE) {
71
71
  handle(SUPPORTABILITY_METRIC_CHANNEL, ['Logging/Harvest/Failed/Seen', logBytes]);
72
- return warn(LOGGING_IGNORED + '> ' + MAX_PAYLOAD_SIZE + ' bytes: ', log.message.slice(0, 25) + '...');
72
+ return warn(31, log.message.slice(0, 25) + '...');
73
73
  }
74
74
  if (this.estimatedBytes + logBytes >= MAX_PAYLOAD_SIZE) {
75
75
  handle(SUPPORTABILITY_METRIC_CHANNEL, ['Logging/Harvest/Early/Seen', this.estimatedBytes + logBytes]);
@@ -8,7 +8,4 @@ export const LOG_LEVELS = {
8
8
  };
9
9
  export const LOGGING_EVENT_EMITTER_CHANNEL = 'log';
10
10
  export const FEATURE_NAME = FEATURE_NAMES.logging;
11
- export const MAX_PAYLOAD_SIZE = 1000000;
12
- export const LOGGING_FAILURE_MESSAGE = 'failed to wrap logger: ';
13
- export const LOGGING_LEVEL_FAILURE_MESSAGE = 'invalid log level: ';
14
- export const LOGGING_IGNORED = 'ignored log: ';
11
+ export const MAX_PAYLOAD_SIZE = 1000000;
@@ -2,7 +2,7 @@ import { InstrumentBase } from '../../utils/instrument-base';
2
2
  import { FEATURE_NAME } from '../constants';
3
3
  import { bufferLog } from '../shared/utils';
4
4
  export class Instrument extends InstrumentBase {
5
- static featureName = FEATURE_NAME;
5
+ static featureName = (() => FEATURE_NAME)();
6
6
  constructor(agentIdentifier, aggregator) {
7
7
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
8
8
  super(agentIdentifier, aggregator, FEATURE_NAME, auto);
@@ -11,7 +11,7 @@ import { isBrowserScope, isWorkerScope } from '../../../common/constants/runtime
11
11
  import { AggregateBase } from '../../utils/aggregate-base';
12
12
  import { deregisterDrain } from '../../../common/drain/drain';
13
13
  export class Aggregate extends AggregateBase {
14
- static featureName = FEATURE_NAME;
14
+ static featureName = (() => FEATURE_NAME)();
15
15
  constructor(agentIdentifier, aggregator) {
16
16
  super(agentIdentifier, aggregator, FEATURE_NAME);
17
17
  this.waitForFlags(['err']).then(_ref => {
@@ -102,6 +102,22 @@ export class Aggregate extends AggregateBase {
102
102
  // Check if proxy for either chunks or beacon is being used
103
103
  if (proxy.assets) this.storeSupportabilityMetrics('Config/AssetsUrl/Changed');
104
104
  if (proxy.beacon) this.storeSupportabilityMetrics('Config/BeaconUrl/Changed');
105
+ if (isBrowserScope && window.MutationObserver) {
106
+ this.storeSupportabilityMetrics('Generic/VideoElement/Added', window.document.querySelectorAll('video').length);
107
+ const mo = new MutationObserver(records => {
108
+ records.forEach(record => {
109
+ record.addedNodes.forEach(addedNode => {
110
+ if (addedNode instanceof HTMLVideoElement) {
111
+ this.storeSupportabilityMetrics('Generic/VideoElement/Added', 1);
112
+ }
113
+ });
114
+ });
115
+ });
116
+ mo.observe(window.document.body, {
117
+ childList: true,
118
+ subtree: true
119
+ });
120
+ }
105
121
  }
106
122
  eachSessionChecks() {
107
123
  if (!isBrowserScope) return;
@@ -1,7 +1,7 @@
1
1
  import { InstrumentBase } from '../../utils/instrument-base';
2
2
  import { FEATURE_NAME } from '../constants';
3
3
  export class Instrument extends InstrumentBase {
4
- static featureName = FEATURE_NAME;
4
+ static featureName = (() => FEATURE_NAME)();
5
5
  constructor(agentIdentifier, aggregator) {
6
6
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
7
7
  super(agentIdentifier, aggregator, FEATURE_NAME, auto);
@@ -3,13 +3,14 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
 
6
- import { InstrumentBase } from '../../utils/instrument-base';
7
- import { FEATURE_NAME } from '../constants';
8
- export class Instrument extends InstrumentBase {
9
- static featureName = FEATURE_NAME;
6
+ import { GenericEvents } from '../../generic_events';
7
+
8
+ /**
9
+ * @deprecated This feature has been replaced by Generic Events. Use/Import `GenericEvents` instead. This wrapper will be removed in a future release
10
+ */
11
+ export class Instrument extends GenericEvents {
10
12
  constructor(agentIdentifier, aggregator) {
11
13
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
12
- super(agentIdentifier, aggregator, FEATURE_NAME, auto);
13
- this.importAggregator();
14
+ super(agentIdentifier, aggregator, auto);
14
15
  }
15
16
  }
@@ -1,7 +1,7 @@
1
1
  import { globalScope, isBrowserScope, originTime } from '../../../common/constants/runtime';
2
2
  import { addPT, addPN } from '../../../common/timing/nav-timing';
3
3
  import { stringify } from '../../../common/util/stringify';
4
- import { getInfo, getRuntime } from '../../../common/config/config';
4
+ import { getInfo, getRuntime, isConfigured } from '../../../common/config/config';
5
5
  import { Harvest } from '../../../common/harvest/harvest';
6
6
  import * as CONSTANTS from '../constants';
7
7
  import { getActivatedFeaturesFlags } from './initialized-features';
@@ -18,13 +18,17 @@ import { SUPPORTABILITY_METRIC_CHANNEL } from '../../metrics/constants';
18
18
  import { now } from '../../../common/timing/now';
19
19
  import { TimeKeeper } from '../../../common/timing/time-keeper';
20
20
  export class Aggregate extends 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.timeToFirstByte = 0;
25
25
  this.firstByteToWindowLoad = 0; // our "frontend" duration
26
26
  this.firstByteToDomContent = 0; // our "dom processing" duration
27
27
  this.timeKeeper = new TimeKeeper(this.agentIdentifier);
28
+ if (!isConfigured(agentIdentifier)) {
29
+ this.ee.abort();
30
+ return warn(43);
31
+ }
28
32
  if (isBrowserScope) {
29
33
  timeToFirstByte.subscribe(_ref => {
30
34
  let {
@@ -47,7 +51,6 @@ export class Aggregate extends AggregateBase {
47
51
  const info = getInfo(this.agentIdentifier);
48
52
  const agentRuntime = getRuntime(this.agentIdentifier);
49
53
  const harvester = new Harvest(this);
50
- if (!info.beacon) return;
51
54
  if (info.queueTime) this.aggregator.store('measures', 'qt', {
52
55
  value: info.queueTime
53
56
  });
@@ -140,11 +143,24 @@ export class Aggregate extends AggregateBase {
140
143
  this.timeKeeper.processRumRequest(xhr, rumStartTime, rumEndTime);
141
144
  if (!this.timeKeeper.ready) throw new Error('TimeKeeper not ready');
142
145
  agentRuntime.timeKeeper = this.timeKeeper;
146
+
147
+ // Check if the time diff is such that we need to capture a supportability metric
148
+ if (this.timeKeeper.localTimeDiff >= 12 * 60 * 60 * 1000) {
149
+ handle(SUPPORTABILITY_METRIC_CHANNEL, ['PVE/NRTime/Calculation/DiffExceed12Hrs'], undefined, FEATURE_NAMES.metrics, this.ee);
150
+ } else if (this.timeKeeper.localTimeDiff >= 6 * 60 * 60 * 1000) {
151
+ handle(SUPPORTABILITY_METRIC_CHANNEL, ['PVE/NRTime/Calculation/DiffExceed6Hrs'], undefined, FEATURE_NAMES.metrics, this.ee);
152
+ } else if (this.timeKeeper.localTimeDiff >= 60 * 60 * 1000) {
153
+ handle(SUPPORTABILITY_METRIC_CHANNEL, ['PVE/NRTime/Calculation/DiffExceed1Hrs'], undefined, FEATURE_NAMES.metrics, this.ee);
154
+ }
143
155
  } catch (error) {
144
- handle(SUPPORTABILITY_METRIC_CHANNEL, ['PVE/NRTime/Calculation/Failed'], undefined, FEATURE_NAMES.metrics, this.ee);
156
+ if (error?.message?.indexOf('invalid format') > 0) {
157
+ handle(SUPPORTABILITY_METRIC_CHANNEL, ['PVE/NRTime/Calculation/InvalidFormat'], undefined, FEATURE_NAMES.metrics, this.ee);
158
+ } else {
159
+ handle(SUPPORTABILITY_METRIC_CHANNEL, ['PVE/NRTime/Calculation/Failed'], undefined, FEATURE_NAMES.metrics, this.ee);
160
+ }
145
161
  drain(this.agentIdentifier, FEATURE_NAMES.metrics, true);
146
162
  this.ee.abort();
147
- warn('Could not calculate New Relic server time. Agent shutting down.', error);
163
+ warn(17, error);
148
164
  return;
149
165
  }
150
166
  try {
@@ -157,7 +173,7 @@ export class Aggregate extends AggregateBase {
157
173
  this.drain();
158
174
  } catch (err) {
159
175
  this.ee.abort();
160
- warn('RUM call failed. Agent shutting down.', err);
176
+ warn(18, err);
161
177
  }
162
178
  }
163
179
  });
@@ -19,7 +19,7 @@ export function getActivatedFeaturesFlags(agentId) {
19
19
  case FEATURE_NAMES.jserrors:
20
20
  flagArr.push('err');
21
21
  break;
22
- case FEATURE_NAMES.pageAction:
22
+ case FEATURE_NAMES.genericEvents:
23
23
  flagArr.push('ins');
24
24
  break;
25
25
  case FEATURE_NAMES.sessionTrace:
@@ -1,7 +1,7 @@
1
1
  import { InstrumentBase } from '../../utils/instrument-base';
2
2
  import * as CONSTANTS from '../constants';
3
3
  export class Instrument extends InstrumentBase {
4
- static featureName = CONSTANTS.FEATURE_NAME;
4
+ static featureName = (() => CONSTANTS.FEATURE_NAME)();
5
5
  constructor(agentIdentifier, aggregator) {
6
6
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
7
7
  super(agentIdentifier, aggregator, CONSTANTS.FEATURE_NAME, auto);
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  import { nullable, numeric, getAddStringContext, addCustomAttributes } from '../../../common/serialize/bel-serializer';
7
- import { mapOwn } from '../../../common/util/map-own';
8
7
  import { HarvestScheduler } from '../../../common/harvest/harvest-scheduler';
9
8
  import { registerHandler } from '../../../common/event-emitter/register-handler';
10
9
  import { handle } from '../../../common/event-emitter/handle';
@@ -23,7 +22,7 @@ import { longTask } from '../../../common/vitals/long-task';
23
22
  import { subscribeToVisibilityChange } from '../../../common/window/page-visibility';
24
23
  import { VITAL_NAMES } from '../../../common/vitals/constants';
25
24
  export class Aggregate extends AggregateBase {
26
- static featureName = FEATURE_NAME;
25
+ static featureName = (() => FEATURE_NAME)();
27
26
  #handleVitalMetric = _ref => {
28
27
  let {
29
28
  name,
@@ -141,7 +140,8 @@ export class Aggregate extends AggregateBase {
141
140
  var timingAttributes = timing.attrs || {};
142
141
  var customAttributes = getInfo(this.agentIdentifier).jsAttributes || {};
143
142
  var reservedAttributes = ['size', 'eid', 'cls', 'type', 'fid', 'elTag', 'elUrl', 'net-type', 'net-etype', 'net-rtt', 'net-dlink'];
144
- mapOwn(customAttributes, function (key, val) {
143
+ Object.entries(customAttributes || {}).forEach(_ref3 => {
144
+ let [key, val] = _ref3;
145
145
  if (reservedAttributes.indexOf(key) < 0) {
146
146
  timingAttributes[key] = val;
147
147
  }
@@ -10,7 +10,7 @@ import { FEATURE_NAME } from '../constants';
10
10
  import { isBrowserScope } from '../../../common/constants/runtime';
11
11
  import { now } from '../../../common/timing/now';
12
12
  export class Instrument extends InstrumentBase {
13
- static featureName = FEATURE_NAME;
13
+ static featureName = (() => FEATURE_NAME)();
14
14
  constructor(agentIdentifier, aggregator) {
15
15
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
16
16
  super(agentIdentifier, aggregator, FEATURE_NAME, auto);
@@ -30,8 +30,8 @@ import { deregisterDrain } from '../../../common/drain/drain';
30
30
  import { now } from '../../../common/timing/now';
31
31
  import { buildNRMetaNode } from '../shared/utils';
32
32
  export class Aggregate extends AggregateBase {
33
- static featureName = FEATURE_NAME;
34
- mode = MODE.OFF;
33
+ static featureName = (() => FEATURE_NAME)();
34
+ mode = (() => MODE.OFF)();
35
35
 
36
36
  // pass the recorder into the aggregator
37
37
  constructor(agentIdentifier, aggregator, args) {
@@ -416,7 +416,7 @@ export class Aggregate extends AggregateBase {
416
416
  abort() {
417
417
  let reason = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
418
418
  let data = arguments.length > 1 ? arguments[1] : undefined;
419
- warn("SR aborted -- ".concat(reason.message));
419
+ warn(33, reason.message);
420
420
  handle(SUPPORTABILITY_METRIC_CHANNEL, ["SessionReplay/Abort/".concat(reason.sm), data], undefined, FEATURE_NAMES.metrics, this.ee);
421
421
  this.blocked = true;
422
422
  this.mode = MODE.OFF;
@@ -15,7 +15,7 @@ import { InstrumentBase } from '../../utils/instrument-base';
15
15
  import { hasReplayPrerequisite, isPreloadAllowed } from '../shared/utils';
16
16
  import { FEATURE_NAME, SR_EVENT_EMITTER_TYPES, TRIGGERS } from '../constants';
17
17
  export class Instrument extends InstrumentBase {
18
- static featureName = FEATURE_NAME;
18
+ static featureName = (() => FEATURE_NAME)();
19
19
  #mode;
20
20
  constructor(agentIdentifier, aggregator) {
21
21
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
@@ -33,7 +33,7 @@ export class Recorder {
33
33
  /** Config to inform to inline stylesheet contents (true default) */
34
34
  this.shouldInlineStylesheets = getConfigurationValue(this.parent.agentIdentifier, 'session_replay.inline_stylesheet');
35
35
  /** A flag that can be set to false by failing conversions to stop the fetching process */
36
- this.shouldFix = this.shouldInlineStylesheets;
36
+ this.shouldFix = this.shouldInlineStylesheets && getConfigurationValue(this.parent.agentIdentifier, 'session_replay.fix_stylesheets');
37
37
  /** The method to stop recording. This defaults to a noop, but is overwritten once the recording library is imported and initialized */
38
38
  this.stopRecording = () => {/* no-op until set by rrweb initializer */};
39
39
  }
@@ -1,7 +1,7 @@
1
1
  import { originals } from '../../../common/config/config';
2
2
  import { isBrowserScope } from '../../../common/constants/runtime';
3
3
  class StylesheetEvaluator {
4
- #evaluated = new WeakSet();
4
+ #evaluated = (() => new WeakSet())();
5
5
  #fetchProms = [];
6
6
  /**
7
7
  * Flipped to true if stylesheets that cannot be natively inlined are detected by the stylesheetEvaluator class
@@ -12,7 +12,7 @@ const ERROR_MODE_SECONDS_WINDOW = 30 * 1000; // sliding window of nodes to track
12
12
  /** Reserved room for query param attrs */
13
13
  const QUERY_PARAM_PADDING = 5000;
14
14
  export class Aggregate extends AggregateBase {
15
- static featureName = FEATURE_NAME;
15
+ static featureName = (() => FEATURE_NAME)();
16
16
  constructor(agentIdentifier, aggregator) {
17
17
  super(agentIdentifier, aggregator, FEATURE_NAME);
18
18
  this.agentRuntime = getRuntime(agentIdentifier);
@@ -33,10 +33,10 @@ const toAggregate = {
33
33
  export class TraceStorage {
34
34
  nodeCount = 0;
35
35
  trace = {};
36
- earliestTimeStamp = Infinity;
36
+ earliestTimeStamp = (() => Infinity)();
37
37
  latestTimeStamp = 0;
38
38
  tempStorage = [];
39
- prevStoredEvents = new Set();
39
+ prevStoredEvents = (() => new Set())();
40
40
  constructor(parent) {
41
41
  this.parent = parent;
42
42
  }
@@ -21,7 +21,7 @@ const {
21
21
  PUSH_STATE
22
22
  } = CONSTANTS;
23
23
  export class Instrument extends InstrumentBase {
24
- static featureName = FEATURE_NAME;
24
+ static featureName = (() => FEATURE_NAME)();
25
25
  constructor(agentIdentifier, aggregator) {
26
26
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
27
27
  super(agentIdentifier, aggregator, FEATURE_NAME, auto);
@@ -7,7 +7,7 @@ export class BelNode {
7
7
  end;
8
8
  callbackEnd = 0;
9
9
  callbackDuration = 0;
10
- nodeId = ++nodesSeen;
10
+ nodeId = (() => ++nodesSeen)();
11
11
  constructor(agentIdentifier) {
12
12
  if (!agentIdentifier) throw new Error('Interaction is missing core attributes');
13
13
  this.agentIdentifier = agentIdentifier;
@@ -13,7 +13,7 @@ import { AjaxNode } from './ajax-node';
13
13
  import { InitialPageLoadInteraction } from './initial-page-load-interaction';
14
14
  import { Interaction } from './interaction';
15
15
  export class Aggregate extends AggregateBase {
16
- static featureName = FEATURE_NAME;
16
+ static featureName = (() => FEATURE_NAME)();
17
17
  constructor(agentIdentifier, aggregator, _ref) {
18
18
  let {
19
19
  domObserver
@@ -11,10 +11,10 @@ import { BelNode } from './bel-node';
11
11
  * link https://github.com/newrelic/nr-querypack/blob/main/schemas/bel/7.qpschema
12
12
  **/
13
13
  export class Interaction extends BelNode {
14
- id = generateUuid(); // unique id that is serialized and used to link interactions with errors
15
- initialPageURL = initialLocation;
16
- oldURL = '' + globalScope?.location;
17
- newURL = '' + globalScope?.location;
14
+ id = (() => generateUuid())(); // unique id that is serialized and used to link interactions with errors
15
+ initialPageURL = (() => initialLocation)();
16
+ oldURL = (() => '' + globalScope?.location)();
17
+ newURL = (() => '' + globalScope?.location)();
18
18
  customName;
19
19
  customAttributes = {};
20
20
  customDataByApi = {};
@@ -22,7 +22,7 @@ export class Interaction extends BelNode {
22
22
  appTime; // only used by initialPageLoad interactions
23
23
  newRoute;
24
24
  /** Internal state of this interaction: in-progress, finished, or cancelled. */
25
- status = INTERACTION_STATUS.IP;
25
+ status = (() => INTERACTION_STATUS.IP)();
26
26
  domTimestamp = 0;
27
27
  historyTimestamp = 0;
28
28
  createdByApi = false;
@@ -15,7 +15,7 @@ import { now } from '../../../common/timing/now';
15
15
  const UI_WAIT_INTERVAL = 1 / 10 * 1000; // assume 10 fps
16
16
 
17
17
  export class Instrument extends InstrumentBase {
18
- static featureName = FEATURE_NAME;
18
+ static featureName = (() => FEATURE_NAME)();
19
19
  constructor(agentIdentifier, aggregator) {
20
20
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
21
21
  super(agentIdentifier, aggregator, FEATURE_NAME, auto);
@@ -6,7 +6,6 @@
6
6
  import { registerHandler as register } from '../../../common/event-emitter/register-handler';
7
7
  import { parseUrl } from '../../../common/url/parse-url';
8
8
  import { shouldCollectEvent } from '../../../common/deny-list/deny-list';
9
- import { mapOwn } from '../../../common/util/map-own';
10
9
  import { navTimingValues as navTiming } from '../../../common/timing/nav-timing';
11
10
  import { generateUuid } from '../../../common/ids/unique-id';
12
11
  import { Interaction } from './interaction';
@@ -45,7 +44,7 @@ const {
45
44
  originalSetTimeout
46
45
  } = CONSTANTS;
47
46
  export class Aggregate extends AggregateBase {
48
- static featureName = FEATURE_NAME;
47
+ static featureName = (() => FEATURE_NAME)();
49
48
  constructor(agentIdentifier, aggregator) {
50
49
  super(agentIdentifier, aggregator, FEATURE_NAME);
51
50
  const agentRuntime = getRuntime(agentIdentifier);
@@ -613,7 +612,7 @@ export class Aggregate extends AggregateBase {
613
612
 
614
613
  // make sure that newrelic[INTERACTION]() works in end handler
615
614
  state.currentNode = root;
616
- mapOwn(interaction.handlers, function (i, cb) {
615
+ Object.values(interaction.handlers || {}).forEach(function (cb) {
617
616
  cb(attrs.store);
618
617
  });
619
618
  setCurrentNode(null);
@@ -693,7 +692,7 @@ export class Aggregate extends AggregateBase {
693
692
  if (interaction.root?.attrs?.trigger === 'initialPageLoad') smCategory = 'InitialPageLoad';else if (interaction.routeChange) smCategory = 'RouteChange';else smCategory = 'Custom';
694
693
  handle(SUPPORTABILITY_METRIC_CHANNEL, ["Spa/Interaction/".concat(smCategory, "/Duration/Ms"), Math.max((interaction.root?.end || 0) - (interaction.root?.start || 0), 0)], undefined, FEATURE_NAMES.metrics, baseEE);
695
694
  scheduler?.scheduleHarvest(0);
696
- if (!scheduler) warn('SPA scheduler is not initialized. Saved interaction is not sent!');
695
+ if (!scheduler) warn(19);
697
696
  }
698
697
  function isEnabled() {
699
698
  var enabled = getConfigurationValue(agentIdentifier, 'spa.enabled');
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  import { getInfo, getRuntime, originals } from '../../../common/config/config';
7
- import { mapOwn } from '../../../common/util/map-own';
8
7
  import { ee } from '../../../common/event-emitter/contextual-ee';
9
8
  import { InteractionNode } from './interaction-node';
10
9
  var originalSetTimeout = originals.ST;
@@ -82,7 +81,8 @@ InteractionPrototype.finish = function finishInteraction() {
82
81
  if (this.onFinished) {
83
82
  this.onFinished(this);
84
83
  }
85
- mapOwn(getInfo(interaction.agentIdentifier).jsAttributes, function (attr, value) {
84
+ Object.entries(getInfo(interaction.agentIdentifier).jsAttributes || {}).forEach(_ref => {
85
+ let [attr, value] = _ref;
86
86
  if (!(attr in customAttrs)) customAttrs[attr] = value;
87
87
  });
88
88
  root.end = endTimestamp;
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { cleanURL } from '../../../common/url/clean-url';
6
- import { mapOwn } from '../../../common/util/map-own';
7
6
  import { nullable, numeric, getAddStringContext, addCustomAttributes } from '../../../common/serialize/bel-serializer';
8
7
  import { SharedContext } from '../../../common/context/shared-context';
9
8
  import { getInfo } from '../../../common/config/config';
@@ -125,7 +124,7 @@ export class Serializer extends SharedContext {
125
124
  // get all navTiming values except navigationStart
126
125
  // (since its the same as interaction.start)
127
126
  // and limit to just the first 20 values we know about
128
- mapOwn(navTiming.slice(1, 21), function (i, v) {
127
+ Object.values(navTiming.slice(1, 21) || {}).forEach(v => {
129
128
  if (v !== undefined) {
130
129
  navTimingNode += seperator + numeric(v - prev);
131
130
  seperator = ',';
@@ -22,7 +22,7 @@ const {
22
22
  FN_END
23
23
  } = CONSTANTS;
24
24
  export class Instrument extends InstrumentBase {
25
- static featureName = FEATURE_NAME;
25
+ static featureName = (() => FEATURE_NAME)();
26
26
  constructor(agentIdentifier, aggregator) {
27
27
  var _this;
28
28
  let auto = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
@@ -2,7 +2,7 @@ import { FeatureBase } from './feature-base';
2
2
  import { getInfo, isConfigured, getRuntime } from '../../common/config/config';
3
3
  import { configure } from '../../loaders/configure/configure';
4
4
  import { gosCDN } from '../../common/window/nreum';
5
- import { drain } from '../../common/drain/drain';
5
+ import { deregisterDrain, drain } from '../../common/drain/drain';
6
6
  import { activatedFeatures } from '../../common/util/feature-flags';
7
7
  export class AggregateBase extends FeatureBase {
8
8
  constructor() {
@@ -35,6 +35,8 @@ export class AggregateBase extends FeatureBase {
35
35
  });
36
36
  return flagsPromise.catch(err => {
37
37
  this.ee.emit('internal-error', [err]);
38
+ this.blocked = true;
39
+ deregisterDrain(this.agentIdentifier, this.featureName);
38
40
  });
39
41
  }
40
42
  drain() {
@@ -49,8 +51,9 @@ export class AggregateBase extends FeatureBase {
49
51
  checkConfiguration() {
50
52
  // NOTE: This check has to happen at aggregator load time
51
53
  if (!isConfigured(this.agentIdentifier)) {
54
+ const cdn = gosCDN();
52
55
  let jsAttributes = {
53
- ...gosCDN().info?.jsAttributes
56
+ ...cdn.info?.jsAttributes
54
57
  };
55
58
  try {
56
59
  jsAttributes = {
@@ -63,9 +66,9 @@ export class AggregateBase extends FeatureBase {
63
66
  configure({
64
67
  agentIdentifier: this.agentIdentifier
65
68
  }, {
66
- ...gosCDN(),
69
+ ...cdn,
67
70
  info: {
68
- ...gosCDN().info,
71
+ ...cdn.info,
69
72
  jsAttributes
70
73
  },
71
74
  runtime: getRuntime(this.agentIdentifier)
@@ -87,7 +87,7 @@ export class InstrumentBase extends FeatureBase {
87
87
  session = setupAgentSession(this.agentIdentifier);
88
88
  }
89
89
  } catch (e) {
90
- warn('A problem occurred when starting up session manager. This page will not start or extend any session.', e);
90
+ warn(20, e);
91
91
  this.ee.emit('internal-error', [e]);
92
92
  if (this.featureName === FEATURE_NAMES.sessionReplay) this.abortHandler?.(); // SR should stop recording if session DNE
93
93
  }
@@ -111,7 +111,7 @@ export class InstrumentBase extends FeatureBase {
111
111
  this.featAggregate = new Aggregate(this.agentIdentifier, this.aggregator, argsObjFromInstrument);
112
112
  loadedSuccessfully(true);
113
113
  } catch (e) {
114
- warn("Downloading and initializing ".concat(this.featureName, " failed..."), e);
114
+ warn(34, e);
115
115
  this.abortHandler?.(); // undo any important alterations made to the page
116
116
  // not supported yet but nice to do: "abort" this agent's EE for this feature specifically
117
117
  drain(this.agentIdentifier, this.featureName, true);
@@ -18,12 +18,12 @@ export function lazyFeatureLoader(featureName, featurePart) {
18
18
  return import( /* webpackChunkName: "ajax-aggregate" */'../ajax/aggregate');
19
19
  case FEATURE_NAMES.jserrors:
20
20
  return import( /* webpackChunkName: "jserrors-aggregate" */'../jserrors/aggregate');
21
+ case FEATURE_NAMES.genericEvents:
22
+ return import( /* webpackChunkName: "generic_events-aggregate" */'../generic_events/aggregate');
21
23
  case FEATURE_NAMES.logging:
22
24
  return import( /* webpackChunkName: "logging-aggregate" */'../logging/aggregate');
23
25
  case FEATURE_NAMES.metrics:
24
26
  return import( /* webpackChunkName: "metrics-aggregate" */'../metrics/aggregate');
25
- case FEATURE_NAMES.pageAction:
26
- return import( /* webpackChunkName: "page_action-aggregate" */'../page_action/aggregate');
27
27
  case FEATURE_NAMES.pageViewEvent:
28
28
  return import( /* webpackChunkName: "page_view_event-aggregate" */'../page_view_event/aggregate');
29
29
  case FEATURE_NAMES.pageViewTiming:
package/dist/esm/index.js CHANGED
@@ -3,9 +3,12 @@ export { BrowserAgent } from './loaders/browser-agent';
3
3
  export { MicroAgent } from './loaders/micro-agent';
4
4
  export { Ajax } from './features/ajax';
5
5
  export { JSErrors } from './features/jserrors';
6
+ export { GenericEvents } from './features/generic_events';
7
+ export { Logging } from './features/logging';
6
8
  export { Metrics } from './features/metrics';
7
9
  export { PageAction } from './features/page_action';
8
10
  export { PageViewEvent } from './features/page_view_event';
9
11
  export { PageViewTiming } from './features/page_view_timing';
10
12
  export { SessionTrace } from './features/session_trace';
13
+ export { SessionReplay } from './features/session_replay';
11
14
  export { Spa } from './features/spa';
@@ -3,7 +3,6 @@
3
3
  import { warn } from '../common/util/console';
4
4
  import { SR_EVENT_EMITTER_TYPES } from '../features/session_replay/constants';
5
5
  import { generateRandomHexString } from '../common/ids/unique-id';
6
- import { ee } from '../common/event-emitter/contextual-ee';
7
6
 
8
7
  /**
9
8
  * @typedef {import('./api/interaction-types').InteractionInstance} InteractionInstance
@@ -14,9 +13,6 @@ export class AgentBase {
14
13
  constructor() {
15
14
  let agentIdentifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : generateRandomHexString(16);
16
15
  this.agentIdentifier = agentIdentifier;
17
-
18
- // Assign the observation context to the event emitter, so it knows how to create observation contexts
19
- this.ee = ee.get(agentIdentifier);
20
16
  }
21
17
 
22
18
  /**
@@ -28,7 +24,7 @@ export class AgentBase {
28
24
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
29
25
  args[_key - 1] = arguments[_key];
30
26
  }
31
- if (typeof this.api?.[methodName] !== 'function') warn("Call to agent api ".concat(methodName, " failed. The API is not currently initialized."));else return this.api[methodName](...args);
27
+ if (typeof this.api?.[methodName] !== 'function') warn(35, methodName);else return this.api[methodName](...args);
32
28
  }
33
29
 
34
30
  /**