@newrelic/browser-agent 1.317.0 → 1.318.0-rc.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 (78) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/common/config/configurable.js +1 -1
  3. package/dist/cjs/common/config/init-types.js +2 -0
  4. package/dist/cjs/common/config/init.js +3 -0
  5. package/dist/cjs/common/constants/env.cdn.js +1 -1
  6. package/dist/cjs/common/constants/env.npm.js +1 -1
  7. package/dist/cjs/common/harvest/harvester.js +3 -219
  8. package/dist/cjs/common/harvest/send.js +232 -0
  9. package/dist/cjs/common/harvest/types.js +9 -5
  10. package/dist/cjs/common/session/session-entity.js +8 -8
  11. package/dist/cjs/common/v2/mfe-vitals.js +303 -0
  12. package/dist/cjs/features/generic_events/aggregate/index.js +1 -1
  13. package/dist/cjs/features/generic_events/instrument/index.js +1 -1
  14. package/dist/cjs/features/logging/aggregate/index.js +5 -5
  15. package/dist/cjs/features/page_view_event/aggregate/index.js +65 -30
  16. package/dist/cjs/features/session_replay/aggregate/index.js +32 -28
  17. package/dist/cjs/features/session_trace/aggregate/index.js +29 -27
  18. package/dist/cjs/features/session_trace/constants.js +17 -3
  19. package/dist/cjs/features/utils/aggregate-base.js +2 -0
  20. package/dist/cjs/loaders/api/register.js +27 -4
  21. package/dist/esm/common/config/configurable.js +1 -1
  22. package/dist/esm/common/config/init-types.js +2 -0
  23. package/dist/esm/common/config/init.js +3 -0
  24. package/dist/esm/common/constants/env.cdn.js +1 -1
  25. package/dist/esm/common/constants/env.npm.js +1 -1
  26. package/dist/esm/common/harvest/harvester.js +3 -219
  27. package/dist/esm/common/harvest/send.js +226 -0
  28. package/dist/esm/common/harvest/types.js +9 -5
  29. package/dist/esm/common/session/session-entity.js +9 -9
  30. package/dist/esm/common/v2/mfe-vitals.js +298 -0
  31. package/dist/esm/features/generic_events/aggregate/index.js +1 -1
  32. package/dist/esm/features/generic_events/instrument/index.js +1 -1
  33. package/dist/esm/features/logging/aggregate/index.js +5 -5
  34. package/dist/esm/features/page_view_event/aggregate/index.js +64 -29
  35. package/dist/esm/features/session_replay/aggregate/index.js +32 -28
  36. package/dist/esm/features/session_trace/aggregate/index.js +30 -28
  37. package/dist/esm/features/session_trace/constants.js +16 -2
  38. package/dist/esm/features/utils/aggregate-base.js +2 -0
  39. package/dist/esm/loaders/api/register.js +27 -4
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/dist/types/common/config/init-types.d.ts +6 -0
  42. package/dist/types/common/config/init.d.ts.map +1 -1
  43. package/dist/types/common/harvest/harvester.d.ts +0 -17
  44. package/dist/types/common/harvest/harvester.d.ts.map +1 -1
  45. package/dist/types/common/harvest/send.d.ts +9 -0
  46. package/dist/types/common/harvest/send.d.ts.map +1 -0
  47. package/dist/types/common/harvest/types.d.ts +39 -10
  48. package/dist/types/common/harvest/types.d.ts.map +1 -1
  49. package/dist/types/common/session/session-entity.d.ts.map +1 -1
  50. package/dist/types/common/v2/mfe-vitals.d.ts +14 -0
  51. package/dist/types/common/v2/mfe-vitals.d.ts.map +1 -0
  52. package/dist/types/features/page_view_event/aggregate/index.d.ts +1 -0
  53. package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
  54. package/dist/types/features/session_replay/aggregate/index.d.ts +2 -2
  55. package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
  56. package/dist/types/features/session_trace/aggregate/index.d.ts +1 -1
  57. package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
  58. package/dist/types/features/session_trace/constants.d.ts +17 -0
  59. package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
  60. package/dist/types/loaders/api/register.d.ts.map +1 -1
  61. package/package.json +2 -2
  62. package/src/common/config/configurable.js +1 -1
  63. package/src/common/config/init-types.js +2 -0
  64. package/src/common/config/init.js +2 -1
  65. package/src/common/harvest/harvester.js +3 -202
  66. package/src/common/harvest/send.js +209 -0
  67. package/src/common/harvest/types.js +9 -5
  68. package/src/common/session/session-entity.js +8 -9
  69. package/src/common/v2/mfe-vitals.js +285 -0
  70. package/src/features/generic_events/aggregate/index.js +1 -1
  71. package/src/features/generic_events/instrument/index.js +1 -1
  72. package/src/features/logging/aggregate/index.js +5 -5
  73. package/src/features/page_view_event/aggregate/index.js +52 -27
  74. package/src/features/session_replay/aggregate/index.js +30 -27
  75. package/src/features/session_trace/aggregate/index.js +31 -28
  76. package/src/features/session_trace/constants.js +7 -1
  77. package/src/features/utils/aggregate-base.js +2 -0
  78. package/src/loaders/api/register.js +25 -4
@@ -15,8 +15,9 @@ import { firstPaint } from '../../../common/vitals/first-paint';
15
15
  import { timeToFirstByte } from '../../../common/vitals/time-to-first-byte';
16
16
  import { now } from '../../../common/timing/now';
17
17
  import { TimeKeeper } from '../../../common/timing/time-keeper';
18
+ import { send } from '../../../common/harvest/send';
19
+ import { canEnableSessionTracking } from '../../utils/feature-gates';
18
20
  import { Obfuscator } from '../../../common/util/obfuscate';
19
- import { send } from '../../../common/harvest/harvester';
20
21
  import { FEATURE_NAMES, FEATURE_TO_ENDPOINT } from '../../../loaders/features/features';
21
22
  import { getSubmitMethod } from '../../../common/util/submit-data';
22
23
  import { webdriverDetected } from '../../../common/util/webdriver-detection';
@@ -25,6 +26,7 @@ export class Aggregate extends AggregateBase {
25
26
  static featureName = CONSTANTS.FEATURE_NAME;
26
27
  constructor(agentRef) {
27
28
  super(agentRef, CONSTANTS.FEATURE_NAME);
29
+ this.isSessionTrackingEnabled = canEnableSessionTracking(agentRef.init) && !!agentRef.runtime.session;
28
30
  this.sentRum = false; // flag to facilitate calling sendRum() once externally (by the consent API in agent-session.js)
29
31
 
30
32
  this.timeToFirstByte = 0;
@@ -36,6 +38,19 @@ export class Aggregate extends AggregateBase {
36
38
  this.obfuscator = new Obfuscator(agentRef, EVENT_TYPES.PVE);
37
39
  agentRef.runtime.timeKeeper = new TimeKeeper(agentRef.runtime.session);
38
40
  if (isBrowserScope) {
41
+ const cached = this.isSessionTrackingEnabled && agentRef.runtime.session?.state.cachedRumResponse;
42
+ if (cached) {
43
+ const {
44
+ app: cachedApp,
45
+ ...cachedFlags
46
+ } = cached;
47
+
48
+ // set the agent runtime objects that require the rum response or entity guid
49
+ if (!Object.keys(this.agentRef.runtime.appMetadata).length) agentRef.runtime.appMetadata = cachedApp;
50
+ this.drain();
51
+ agentRef.runtime.harvester.startTimer();
52
+ activateFeatures(cachedFlags, agentRef);
53
+ }
39
54
  timeToFirstByte.subscribe(({
40
55
  value,
41
56
  attrs
@@ -80,8 +95,7 @@ export class Aggregate extends AggregateBase {
80
95
  ua: info.userAttributes,
81
96
  at: info.atts
82
97
  };
83
- if (this.agentRef.runtime.session) queryParameters.fsh = Number(this.agentRef.runtime.session.isNew); // "first session harvest" aka RUM request or PageView event of a session
84
-
98
+ if (this.agentRef.runtime.session) queryParameters.fsh = Number(!this.agentRef.runtime.session.state.cachedRumResponse);
85
99
  let body = this.obfuscator.traverseAndObfuscateEvents({
86
100
  ja: {
87
101
  ...customAttributes,
@@ -135,6 +149,7 @@ export class Aggregate extends AggregateBase {
135
149
  }) {
136
150
  const rumEndTime = now();
137
151
  let app, flags;
152
+ const hasCachedRumResponse = !!this.agentRef.runtime.session?.state.cachedRumResponse;
138
153
  try {
139
154
  ({
140
155
  app,
@@ -144,10 +159,20 @@ export class Aggregate extends AggregateBase {
144
159
  // wont set entity stuff here, if main agent will later abort, if registered agent, nothing will happen
145
160
  warn(53, error);
146
161
  }
162
+ const shouldCacheResponse = this.isSessionTrackingEnabled && !hasCachedRumResponse && !!app;
163
+ if (hasCachedRumResponse) {
164
+ let {
165
+ app: cachedApp,
166
+ ...cachedFlags
167
+ } = this.agentRef.runtime.session.state.cachedRumResponse;
168
+ app ??= cachedApp;
169
+ flags = cachedFlags;
170
+ }
147
171
  super.postHarvestCleanup({
148
172
  sent,
149
- retry
173
+ retry: retry && !hasCachedRumResponse
150
174
  }); // this will set isRetrying & re-buffer the body if request is to be retried
175
+
151
176
  if (this.isRetrying && this.retries++ < 1) {
152
177
  // Only retry once
153
178
  setTimeout(() => this.agentRef.runtime.harvester.triggerHarvestFor(this, {
@@ -157,7 +182,6 @@ export class Aggregate extends AggregateBase {
157
182
  }
158
183
  if (status >= 400 || status === 0) {
159
184
  warn(18, status);
160
- this.blocked = true;
161
185
 
162
186
  // Get estimated payload size of our backlog
163
187
  const textEncoder = new TextEncoder();
@@ -168,15 +192,24 @@ export class Aggregate extends AggregateBase {
168
192
  }, 0);
169
193
  const BCSError = 'BCS/Error/';
170
194
  // Send SMs about failed RUM request
171
- const body = {
172
- sm: [{
173
- params: {
174
- name: BCSError + status
175
- },
176
- stats: {
177
- c: 1
178
- }
179
- }, {
195
+ const sm = [{
196
+ params: {
197
+ name: BCSError + status
198
+ },
199
+ stats: {
200
+ c: 1
201
+ }
202
+ }, {
203
+ params: {
204
+ name: BCSError + 'Duration/Ms'
205
+ },
206
+ stats: {
207
+ c: 1,
208
+ t: rumEndTime - this.rumStartTime
209
+ }
210
+ }];
211
+ if (!hasCachedRumResponse) {
212
+ sm.push({
180
213
  params: {
181
214
  name: BCSError + 'Dropped/Bytes'
182
215
  },
@@ -184,28 +217,30 @@ export class Aggregate extends AggregateBase {
184
217
  c: 1,
185
218
  t: payloadSize
186
219
  }
187
- }, {
188
- params: {
189
- name: BCSError + 'Duration/Ms'
190
- },
191
- stats: {
192
- c: 1,
193
- t: rumEndTime - this.rumStartTime
194
- }
195
- }]
196
- };
220
+ });
221
+ }
197
222
  send(this.agentRef, {
198
223
  endpoint: FEATURE_TO_ENDPOINT[FEATURE_NAMES.metrics],
199
224
  payload: {
200
- body
225
+ body: {
226
+ sm
227
+ }
201
228
  },
202
229
  submitMethod: getSubmitMethod(),
203
230
  featureName: FEATURE_NAMES.metrics
204
231
  });
205
-
206
- // Adding retry logic for the rum call will be a separate change; this.blocked will need to be changed since that prevents another triggerHarvestFor()
207
- this.ee.abort();
208
- return;
232
+ if (!hasCachedRumResponse) {
233
+ this.blocked = true;
234
+ this.ee.abort();
235
+ return;
236
+ }
237
+ } else if (shouldCacheResponse) {
238
+ this.agentRef.runtime.session.write({
239
+ cachedRumResponse: {
240
+ app,
241
+ ...flags
242
+ }
243
+ });
209
244
  }
210
245
  try {
211
246
  const wasReady = this.agentRef.runtime.timeKeeper.ready;
@@ -26,7 +26,7 @@ import { PAUSE_REPLAY } from '../../../loaders/api/constants';
26
26
  import { Obfuscator } from '../../../common/util/obfuscate';
27
27
  export class Aggregate extends AggregateBase {
28
28
  static featureName = FEATURE_NAME;
29
- mode = MODE.OFF;
29
+ mode = null;
30
30
 
31
31
  // pass the recorder into the aggregator
32
32
  constructor(agentRef, args) {
@@ -71,7 +71,7 @@ export class Aggregate extends AggregateBase {
71
71
  if (!this.recorder) return;
72
72
  // if the mode changed on a different tab, it needs to update this instance to match
73
73
  this.mode = agentRef.runtime.session.state.sessionReplayMode;
74
- if (!this.initialized || this.mode === MODE.OFF) return;
74
+ if (!this.initialized || this.mode === MODE.OFF || !this.mode) return;
75
75
  this.recorder?.startRecording(TRIGGERS.RESUME, this.mode);
76
76
  });
77
77
  this.ee.on(SESSION_EVENTS.UPDATE, (type, data) => {
@@ -98,6 +98,10 @@ export class Aggregate extends AggregateBase {
98
98
  this.waitForFlags(['srs', 'sr']).then(([srMode, entitled]) => {
99
99
  this.entitled = !!entitled;
100
100
  if (!this.entitled) {
101
+ this.mode = MODE.OFF;
102
+ this.#writeToStorage({
103
+ sessionReplayMode: this.mode
104
+ });
101
105
  this.deregisterDrain();
102
106
  if (this.agentRef.runtime.isRecording) {
103
107
  this.abort(ABORT_REASONS.ENTITLEMENTS);
@@ -109,7 +113,7 @@ export class Aggregate extends AggregateBase {
109
113
  this.drain();
110
114
  });
111
115
  }).then(() => {
112
- if (this.mode === MODE.OFF) {
116
+ if (!this.mode) {
113
117
  this.recorder?.stopRecording(); // stop any conservative preload recording launched by instrument
114
118
  while (this.recorder?.getEvents().events.length) this.recorder?.clearBuffer?.();
115
119
  }
@@ -142,7 +146,7 @@ export class Aggregate extends AggregateBase {
142
146
  // if the error was noticed AFTER the recorder was already imported....
143
147
  if (this.recorder && this.initialized) {
144
148
  if (!this.agentRef.runtime.isRecording) this.recorder.startRecording(TRIGGERS.SWITCH_TO_FULL, this.mode); // off --> full
145
- this.syncWithSessionManager({
149
+ this.#writeToStorage({
146
150
  sessionReplayMode: this.mode
147
151
  });
148
152
  } else {
@@ -174,35 +178,35 @@ export class Aggregate extends AggregateBase {
174
178
  this.timeKeeper = timeKeeper;
175
179
  if (this.recorder?.trigger === TRIGGERS.API && this.agentRef.runtime.isRecording) {
176
180
  this.mode = MODE.FULL;
177
- } else if (!session.isNew && !ignoreSession) {
181
+ } else if (session.state.sessionReplayMode !== null && !ignoreSession) {
178
182
  // inherit the mode of the existing session
179
183
  this.mode = session.state.sessionReplayMode;
180
184
  } else {
181
185
  // The session is new... determine the mode the new session should start in
182
186
  this.mode = srMode;
183
187
  }
184
- // If off, then don't record (early return)
185
- if (this.mode === MODE.OFF) return;
186
- try {
187
- /** will return a recorder instance if already imported, otherwise, will fetch the recorder and initialize it */
188
- this.recorder ??= await this.instrumentClass.importRecorder();
189
- } catch (err) {
190
- /** if the recorder fails to import, abort the feature */
191
- return this.abort(ABORT_REASONS.IMPORT, err);
192
- }
188
+ if (this.mode !== MODE.OFF) {
189
+ try {
190
+ /** will return a recorder instance if already imported, otherwise, will fetch the recorder and initialize it */
191
+ this.recorder ??= await this.instrumentClass.importRecorder();
192
+ } catch (err) {
193
+ /** if the recorder fails to import, abort the feature */
194
+ return this.abort(ABORT_REASONS.IMPORT, err);
195
+ }
193
196
 
194
- // If an error was noticed before the mode could be set (like in the early lifecycle of the page), immediately set to FULL mode
195
- if (this.mode === MODE.ERROR && this.instrumentClass.errorNoticed) {
196
- this.mode = MODE.FULL;
197
- }
197
+ // If an error was noticed before the mode could be set (like in the early lifecycle of the page), immediately set to FULL mode
198
+ if (this.mode === MODE.ERROR && this.instrumentClass.errorNoticed) {
199
+ this.mode = MODE.FULL;
200
+ }
198
201
 
199
- // FULL mode records AND reports from the beginning, while ERROR mode only records (but does not report).
200
- // ERROR mode will do this until an error is thrown, and then switch into FULL mode.
201
- // The makeHarvestPayload should ensure that no payload is returned if we're not in FULL mode...
202
+ // FULL mode records AND reports from the beginning, while ERROR mode only records (but does not report).
203
+ // ERROR mode will do this until an error is thrown, and then switch into FULL mode.
204
+ // The makeHarvestPayload should ensure that no payload is returned if we're not in FULL mode...
202
205
 
203
- await this.prepUtils();
204
- if (!this.agentRef.runtime.isRecording) this.recorder.startRecording(trigger, this.mode);
205
- this.syncWithSessionManager({
206
+ await this.prepUtils();
207
+ if (!this.agentRef.runtime.isRecording) this.recorder.startRecording(trigger, this.mode);
208
+ }
209
+ this.#writeToStorage({
206
210
  sessionReplayMode: this.mode
207
211
  });
208
212
  }
@@ -249,7 +253,7 @@ export class Aggregate extends AggregateBase {
249
253
  this.abort(ABORT_REASONS.TOO_BIG, len);
250
254
  return;
251
255
  }
252
- if (!this.agentRef.runtime.session.state.sessionReplaySentFirstChunk) this.syncWithSessionManager({
256
+ if (!this.agentRef.runtime.session.state.sessionReplaySentFirstChunk) this.#writeToStorage({
253
257
  sessionReplaySentFirstChunk: true
254
258
  });
255
259
  this.recorder.clearBuffer();
@@ -378,7 +382,7 @@ export class Aggregate extends AggregateBase {
378
382
  if (forceHarvest) this.agentRef.runtime.harvester.triggerHarvestFor(this);
379
383
  this.mode = MODE.OFF;
380
384
  this.recorder?.stopRecording?.();
381
- this.syncWithSessionManager({
385
+ this.#writeToStorage({
382
386
  sessionReplayMode: this.mode
383
387
  });
384
388
  }
@@ -390,13 +394,13 @@ export class Aggregate extends AggregateBase {
390
394
  this.blocked = true;
391
395
  this.mode = MODE.OFF;
392
396
  this.recorder?.stopRecording?.();
393
- this.syncWithSessionManager({
397
+ this.#writeToStorage({
394
398
  sessionReplayMode: this.mode
395
399
  });
396
400
  this.recorder?.clearTimestamps?.();
397
401
  while (this.recorder?.getEvents().events.length) this.recorder?.clearBuffer?.();
398
402
  }
399
- syncWithSessionManager(state = {}) {
403
+ #writeToStorage(state = {}) {
400
404
  if (this.isSessionTrackingEnabled) {
401
405
  this.agentRef.runtime.session.write(state);
402
406
  }
@@ -3,7 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { registerHandler } from '../../../common/event-emitter/register-handler';
6
- import { FEATURE_NAME } from '../constants';
6
+ import { ABORT_REASONS, FEATURE_NAME } from '../constants';
7
7
  import { AggregateBase } from '../../utils/aggregate-base';
8
8
  import { TraceStorage } from './trace/storage';
9
9
  import { obj as encodeObj } from '../../../common/url/encode';
@@ -41,8 +41,10 @@ export class Aggregate extends AggregateBase {
41
41
  /** Sets up event listeners, and initializes this module to run in the correct "mode". Can be triggered from a few places, but makes an effort to only set up listeners once */
42
42
  initialize(stMode, stEntitled, ignoreSession) {
43
43
  this.entitled ??= stEntitled;
44
- if (!this.entitled) this.blocked = true;
45
- if (this.blocked) return this.deregisterDrain();
44
+ if (!this.entitled) {
45
+ this.abort(ABORT_REASONS.ENTITLEMENTS);
46
+ return this.deregisterDrain();
47
+ }
46
48
  this.timeKeeper ??= this.agentRef.runtime.timeKeeper;
47
49
  if (!this.initialized) {
48
50
  this.initialized = true;
@@ -52,7 +54,7 @@ export class Aggregate extends AggregateBase {
52
54
  // The SessionEntity class can emit a message indicating the session was cleared and reset (expiry, inactivity). This feature must abort and never resume if that occurs.
53
55
  this.ee.on(SESSION_EVENTS.RESET, () => {
54
56
  if (this.blocked) return;
55
- this.abort(1);
57
+ this.abort(ABORT_REASONS.RESET);
56
58
  });
57
59
  // The SessionEntity can have updates (locally or across tabs for SR mode changes), (across tabs for ST mode changes).
58
60
  // Those updates should be sync'd here to ensure this page also honors the mode after initialization
@@ -61,7 +63,7 @@ export class Aggregate extends AggregateBase {
61
63
  // this will only have an effect if ST is NOT already in full mode
62
64
  if (this.mode !== MODE.FULL && (sessionState.sessionReplayMode === MODE.FULL || sessionState.sessionTraceMode === MODE.FULL)) this.switchToFull();
63
65
  // if another page's session entity has expired, or another page has transitioned to off and this one hasn't... we can just abort straight away here
64
- if (this.sessionId !== sessionState.value || eventType === 'cross-tab' && sessionState.sessionTraceMode === MODE.OFF) this.abort(2);
66
+ if (this.sessionId !== sessionState.value || eventType === 'cross-tab' && sessionState.sessionTraceMode === MODE.OFF) this.abort(ABORT_REASONS.CROSS_TAB);
65
67
  });
66
68
  if (typeof PerformanceNavigationTiming !== 'undefined' && globalScope.performance?.getEntriesByType('navigation')?.length > 0) {
67
69
  this.traceStorage.storeTiming(globalScope.performance.getEntriesByType('navigation')[0]);
@@ -72,30 +74,30 @@ export class Aggregate extends AggregateBase {
72
74
 
73
75
  /** ST/SR sampling flow in BCS - https://drive.google.com/file/d/19hwt2oft-8Hh4RrjpLqEXfpP_9wYBLcq/view?usp=sharing */
74
76
  /** ST will run in the mode provided by BCS if the session IS NEW. If not... it will use the state of the session entity to determine what mode to run in */
75
- if (!this.agentRef.runtime.session.isNew && !ignoreSession) this.mode = this.agentRef.runtime.session.state.sessionTraceMode;else this.mode = stMode;
76
-
77
- /** If the mode is off, we do not want to hold up draining for other features, so we deregister the feature for now.
78
- * If it drains later (due to a mode change), data and handlers will instantly drain instead of waiting for the registry. */
79
- if (this.mode === MODE.OFF) return this.deregisterDrain();
80
-
81
- /** The handlers set up by the Inst file */
82
- registerHandler('bst', (...args) => this.traceStorage.storeEvent(...args), this.featureName, this.ee);
83
- registerHandler('bstResource', (...args) => this.traceStorage.storeResources(...args), this.featureName, this.ee);
84
- registerHandler('bstHist', (...args) => this.traceStorage.storeHist(...args), this.featureName, this.ee);
85
- registerHandler('bstXhrAgg', (...args) => this.traceStorage.storeXhrAgg(...args), this.featureName, this.ee);
86
- registerHandler('bstApi', (...args) => this.traceStorage.storeNode(...args), this.featureName, this.ee);
87
- registerHandler('trace-jserror', (...args) => this.traceStorage.storeErrorAgg(...args), this.featureName, this.ee);
88
- registerHandler('pvtAdded', (...args) => this.traceStorage.processPVT(...args), this.featureName, this.ee);
89
- if (this.mode !== MODE.FULL) {
90
- /** A separate handler for noticing errors, and switching to "full" mode if running in "error" mode */
91
- registerHandler('trace-jserror', () => {
92
- if (this.mode === MODE.ERROR) this.switchToFull();
93
- }, this.featureName, this.ee);
77
+ if (this.agentRef.runtime.session.state.sessionTraceMode !== null && !ignoreSession) this.mode = this.agentRef.runtime.session.state.sessionTraceMode;else this.mode = stMode;
78
+ if (this.mode !== MODE.OFF) {
79
+ /** The handlers set up by the Inst file */
80
+ registerHandler('bst', (...args) => this.traceStorage.storeEvent(...args), this.featureName, this.ee);
81
+ registerHandler('bstResource', (...args) => this.traceStorage.storeResources(...args), this.featureName, this.ee);
82
+ registerHandler('bstHist', (...args) => this.traceStorage.storeHist(...args), this.featureName, this.ee);
83
+ registerHandler('bstXhrAgg', (...args) => this.traceStorage.storeXhrAgg(...args), this.featureName, this.ee);
84
+ registerHandler('bstApi', (...args) => this.traceStorage.storeNode(...args), this.featureName, this.ee);
85
+ registerHandler('trace-jserror', (...args) => this.traceStorage.storeErrorAgg(...args), this.featureName, this.ee);
86
+ registerHandler('pvtAdded', (...args) => this.traceStorage.processPVT(...args), this.featureName, this.ee);
87
+ if (this.mode === MODE.ERROR) {
88
+ /** A separate handler for noticing errors, and switching to "full" mode if running in "error" mode */
89
+ registerHandler('trace-jserror', () => {
90
+ if (this.mode === MODE.ERROR) this.switchToFull();
91
+ }, this.featureName, this.ee);
92
+ }
94
93
  }
95
94
  this.agentRef.runtime.session.write({
96
95
  sessionTraceMode: this.mode
97
96
  });
98
- this.drain();
97
+
98
+ /** If the mode is off, we do not want to hold up draining for other features, so we deregister the feature for now.
99
+ * If it drains later (due to a mode change), data and handlers will instantly drain instead of waiting for the registry. */
100
+ this.mode === MODE.OFF ? this.deregisterDrain() : this.drain();
99
101
  }
100
102
  preHarvestChecks() {
101
103
  if (this.blocked || this.mode !== MODE.FULL) return; // only allow harvest if running in full mode
@@ -103,7 +105,7 @@ export class Aggregate extends AggregateBase {
103
105
  if (!this.agentRef.runtime.session) return; // session entity is required for trace to run and continue running
104
106
  if (this.sessionId !== this.agentRef.runtime.session.state.value || this.ptid !== this.agentRef.runtime.ptid) {
105
107
  // If something unexpected happened and we somehow still got to harvesting after a session identifier changed, we should force-exit instead of harvesting:
106
- this.abort(3);
108
+ this.abort(ABORT_REASONS.SESSION_CHANGED);
107
109
  return;
108
110
  }
109
111
  return true;
@@ -188,8 +190,8 @@ export class Aggregate extends AggregateBase {
188
190
  }
189
191
 
190
192
  /** Stop running for the remainder of the page lifecycle */
191
- abort(code) {
192
- warn(60, code);
193
+ abort(reason = {}) {
194
+ warn(60, reason.message);
193
195
  this.blocked = true;
194
196
  this.mode = MODE.OFF;
195
197
  this.agentRef.runtime.session.write({
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2020-2025 New Relic, Inc. All rights reserved.
2
+ * Copyright 2020-2026 New Relic, Inc. All rights reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { FEATURE_NAMES } from '../../loaders/features/features';
@@ -12,4 +12,18 @@ export const FN_START = 'fn' + START;
12
12
  export const FN_END = 'fn' + END;
13
13
  export const PUSH_STATE = 'pushState';
14
14
  export const MAX_NODES_PER_HARVEST = 1000;
15
- export const ERROR_MODE_SECONDS_WINDOW = 30 * 1000; // sliding window of nodes to track when simply monitoring (but not harvesting) in error mode
15
+ export const ERROR_MODE_SECONDS_WINDOW = 30 * 1000; // sliding window of nodes to track when simply monitoring (but not harvesting) in error mode
16
+ export const ABORT_REASONS = {
17
+ CROSS_TAB: {
18
+ message: 'Session Entity was set to OFF on another tab'
19
+ },
20
+ ENTITLEMENTS: {
21
+ message: 'Session Trace is not allowed and will not be started'
22
+ },
23
+ RESET: {
24
+ message: 'Session was reset'
25
+ },
26
+ SESSION_CHANGED: {
27
+ message: 'Session identifier changed unexpectedly'
28
+ }
29
+ };
@@ -11,6 +11,7 @@ import { handle } from '../../common/event-emitter/handle';
11
11
  import { SUPPORTABILITY_METRIC_CHANNEL } from '../metrics/constants';
12
12
  import { EventAggregator } from '../../common/aggregate/event-aggregator';
13
13
  import { MAX_PAYLOAD_SIZE, IDEAL_PAYLOAD_SIZE, SUPPORTS_REGISTERED_ENTITIES } from '../../common/constants/agent-constants';
14
+ import { warn } from '../../common/util/console';
14
15
  export class AggregateBase extends FeatureBase {
15
16
  /**
16
17
  * Create an AggregateBase instance.
@@ -110,6 +111,7 @@ export class AggregateBase extends FeatureBase {
110
111
  }
111
112
  function buildOutput(ref) {
112
113
  return flagNames.map(flag => {
114
+ if (ref[flag] === undefined || ref[flag] === null) warn(71, flag);
113
115
  if (!ref[flag]) return 0;
114
116
  return ref[flag];
115
117
  });
@@ -18,6 +18,7 @@ import { measure } from './measure';
18
18
  import { recordCustomEvent } from './recordCustomEvent';
19
19
  import { subscribeToPageUnload } from '../../common/window/page-visibility';
20
20
  import { findScriptTimings } from '../../common/v2/script-tracker';
21
+ import { trackMFEVitals } from '../../common/v2/mfe-vitals';
21
22
  import { generateRandomHexString } from '../../common/ids/unique-id';
22
23
 
23
24
  /**
@@ -77,6 +78,9 @@ function register(agentRef, target) {
77
78
  type: V2_TYPES.BA
78
79
  };
79
80
  const timings = findScriptTimings();
81
+
82
+ // Track MFE vitals for this entity
83
+ const vitals = trackMFEVitals(target.id, timings);
80
84
  const attrs = {};
81
85
 
82
86
  // Only define attributes getter if it doesn't already exist
@@ -165,7 +169,8 @@ function register(agentRef, target) {
165
169
  return attrs;
166
170
  },
167
171
  target,
168
- timings
172
+ timings,
173
+ vitals
169
174
  }
170
175
  };
171
176
 
@@ -193,9 +198,17 @@ function register(agentRef, target) {
193
198
  // only ever report the timings the first time this is called
194
199
  if (timings.reportedAt) return;
195
200
  timings.reportedAt = now();
201
+
202
+ // Disconnect observers and capture current values, store in timings obj for visibility
203
+ vitals.disconnect();
204
+ timings.fcp = vitals.fcp;
205
+ timings.lcp = vitals.lcp;
206
+ timings.cls = vitals.cls;
207
+ timings.inp = vitals.inp;
196
208
  const timeToFetch = timings.fetchEnd - timings.fetchStart; // fetchStart to fetchEnd
197
209
  const timeToExecute = timings.scriptEnd - timings.scriptStart; // scriptStart to scriptEnd
198
- api.recordCustomEvent('MicroFrontEndTiming', {
210
+
211
+ const eventData = {
199
212
  assetUrl: timings.asset,
200
213
  // the url of the script that was registered, or undefined if it could not be determined (inline or no match)
201
214
  assetType: timings.type,
@@ -210,8 +223,18 @@ function register(agentRef, target) {
210
223
  // fetchStart to fetchEnd
211
224
  timeToLoad: timeToFetch + timeToExecute,
212
225
  // fetch time and script time together
213
- timeToRegister: timings.registeredAt // timestamp when register() was called
214
- });
226
+ timeToRegister: timings.registeredAt,
227
+ // timestamp when register() was called
228
+ // leave room to extend these with more data keys as needed
229
+ 'nr.vitals.fcp.value': vitals.fcp?.value ?? null,
230
+ // FCP vital object with value and metadata
231
+ 'nr.vitals.lcp.value': vitals.lcp?.value ?? null,
232
+ // LCP vital object with value and metadata
233
+ 'nr.vitals.cls.value': vitals.cls?.value ?? null,
234
+ // CLS vital object with value and metadata
235
+ 'nr.vitals.inp.value': vitals.inp?.value ?? null // INP vital object with value and metadata
236
+ };
237
+ api.recordCustomEvent('MicroFrontEndTiming', eventData);
215
238
  }
216
239
 
217
240
  /**
@@ -1 +1 @@
1
- {"root":["../src/index.js","../src/cdn/experimental.js","../src/cdn/lite.js","../src/cdn/pro.js","../src/cdn/spa.js","../src/common/aggregate/aggregator.js","../src/common/aggregate/event-aggregator.js","../src/common/config/configurable.js","../src/common/config/info.js","../src/common/config/init-types.js","../src/common/config/init.js","../src/common/config/loader-config.js","../src/common/config/runtime.js","../src/common/constants/agent-constants.js","../src/common/constants/env.cdn.js","../src/common/constants/env.js","../src/common/constants/env.npm.js","../src/common/constants/events.js","../src/common/constants/runtime.js","../src/common/constants/shared-channel.js","../src/common/deny-list/deny-list.js","../src/common/dispatch/global-event.js","../src/common/dom/iframe.js","../src/common/dom/query-selector.js","../src/common/dom/selector-path.js","../src/common/drain/drain.js","../src/common/event-emitter/contextual-ee.js","../src/common/event-emitter/event-context.js","../src/common/event-emitter/handle.js","../src/common/event-emitter/register-handler.js","../src/common/event-listener/event-listener-opts.js","../src/common/harvest/harvester.js","../src/common/harvest/types.js","../src/common/ids/bundle-id.js","../src/common/ids/id.js","../src/common/ids/unique-id.js","../src/common/payloads/payloads.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/session/session-key.js","../src/common/storage/local-storage.js","../src/common/timer/interaction-timer.js","../src/common/timer/timer.js","../src/common/timing/nav-timing.js","../src/common/timing/now.js","../src/common/timing/time-keeper.js","../src/common/unload/eol.js","../src/common/url/canonicalize-url.js","../src/common/url/clean-url.js","../src/common/url/encode.js","../src/common/url/extract-url.js","../src/common/url/location.js","../src/common/url/parse-url.js","../src/common/url/protocol.js","../src/common/util/attribute-size.js","../src/common/util/browser-stack-matchers.js","../src/common/util/console.js","../src/common/util/data-size.js","../src/common/util/event-origin.js","../src/common/util/feature-flags.js","../src/common/util/get-or-set.js","../src/common/util/invoke.js","../src/common/util/monkey-patched.js","../src/common/util/obfuscate.js","../src/common/util/short-circuit.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/text.js","../src/common/util/traverse.js","../src/common/util/type-check.js","../src/common/util/webdriver-detection.js","../src/common/v2/script-correlation.js","../src/common/v2/script-tracker.js","../src/common/v2/utils.js","../src/common/vitals/constants.js","../src/common/vitals/cumulative-layout-shift.js","../src/common/vitals/first-contentful-paint.js","../src/common/vitals/first-paint.js","../src/common/vitals/interaction-to-next-paint.js","../src/common/vitals/largest-contentful-paint.js","../src/common/vitals/load-time.js","../src/common/vitals/time-to-first-byte.js","../src/common/vitals/vital-metric.js","../src/common/window/load.js","../src/common/window/nreum.js","../src/common/window/page-visibility.js","../src/common/wrap/wrap-events.js","../src/common/wrap/wrap-fetch.js","../src/common/wrap/wrap-function.js","../src/common/wrap/wrap-history.js","../src/common/wrap/wrap-logger.js","../src/common/wrap/wrap-websocket.js","../src/common/wrap/wrap-xhr.js","../src/features/ajax/constants.js","../src/features/ajax/index.js","../src/features/ajax/aggregate/gql.js","../src/features/ajax/aggregate/index.js","../src/features/ajax/instrument/distributed-tracing.js","../src/features/ajax/instrument/index.js","../src/features/ajax/instrument/response-size.js","../src/features/generic_events/constants.js","../src/features/generic_events/index.js","../src/features/generic_events/aggregate/index.js","../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js","../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js","../src/features/generic_events/instrument/index.js","../src/features/jserrors/constants.js","../src/features/jserrors/index.js","../src/features/jserrors/aggregate/canonical-function-name.js","../src/features/jserrors/aggregate/cause-string.js","../src/features/jserrors/aggregate/compute-stack-trace.js","../src/features/jserrors/aggregate/format-stack-trace.js","../src/features/jserrors/aggregate/index.js","../src/features/jserrors/aggregate/internal-errors.js","../src/features/jserrors/aggregate/string-hash-code.js","../src/features/jserrors/instrument/index.js","../src/features/jserrors/shared/cast-error.js","../src/features/jserrors/shared/uncaught-error.js","../src/features/logging/constants.js","../src/features/logging/index.js","../src/features/logging/aggregate/index.js","../src/features/logging/instrument/index.js","../src/features/logging/shared/log.js","../src/features/logging/shared/utils.js","../src/features/metrics/constants.js","../src/features/metrics/index.js","../src/features/metrics/aggregate/framework-detection.js","../src/features/metrics/aggregate/harvest-metadata.js","../src/features/metrics/aggregate/index.js","../src/features/metrics/instrument/index.js","../src/features/page_action/constants.js","../src/features/page_action/index.js","../src/features/page_action/instrument/index.js","../src/features/page_view_event/constants.js","../src/features/page_view_event/index.js","../src/features/page_view_event/aggregate/index.js","../src/features/page_view_event/aggregate/initialized-features.js","../src/features/page_view_event/instrument/index.js","../src/features/page_view_timing/constants.js","../src/features/page_view_timing/index.js","../src/features/page_view_timing/aggregate/index.js","../src/features/page_view_timing/instrument/index.js","../src/features/session_replay/constants.js","../src/features/session_replay/index.js","../src/features/session_replay/aggregate/index.js","../src/features/session_replay/instrument/index.js","../src/features/session_replay/shared/recorder-events.js","../src/features/session_replay/shared/recorder.js","../src/features/session_replay/shared/stylesheet-evaluator.js","../src/features/session_replay/shared/utils.js","../src/features/session_trace/constants.js","../src/features/session_trace/index.js","../src/features/session_trace/aggregate/index.js","../src/features/session_trace/aggregate/trace/node.js","../src/features/session_trace/aggregate/trace/storage.js","../src/features/session_trace/aggregate/trace/utils.js","../src/features/session_trace/instrument/index.js","../src/features/soft_navigations/constants.js","../src/features/soft_navigations/index.js","../src/features/soft_navigations/aggregate/ajax-node.js","../src/features/soft_navigations/aggregate/bel-node.js","../src/features/soft_navigations/aggregate/index.js","../src/features/soft_navigations/aggregate/initial-page-load-interaction.js","../src/features/soft_navigations/aggregate/interaction.js","../src/features/soft_navigations/instrument/index.js","../src/features/utils/agent-session.js","../src/features/utils/aggregate-base.js","../src/features/utils/event-buffer.js","../src/features/utils/feature-base.js","../src/features/utils/feature-gates.js","../src/features/utils/instrument-base.js","../src/interfaces/registered-entity.js","../src/loaders/agent-base.js","../src/loaders/agent.js","../src/loaders/api-base.js","../src/loaders/browser-agent.js","../src/loaders/micro-agent-base.js","../src/loaders/micro-agent.js","../src/loaders/api/addPageAction.js","../src/loaders/api/addRelease.js","../src/loaders/api/addToTrace.js","../src/loaders/api/consent.js","../src/loaders/api/constants.js","../src/loaders/api/finished.js","../src/loaders/api/interaction-types.js","../src/loaders/api/interaction.js","../src/loaders/api/log.js","../src/loaders/api/measure.js","../src/loaders/api/noticeError.js","../src/loaders/api/pauseReplay.js","../src/loaders/api/recordCustomEvent.js","../src/loaders/api/recordReplay.js","../src/loaders/api/register-api-types.js","../src/loaders/api/register.js","../src/loaders/api/setApplicationVersion.js","../src/loaders/api/setCustomAttribute.js","../src/loaders/api/setErrorHandler.js","../src/loaders/api/setPageViewName.js","../src/loaders/api/setUserId.js","../src/loaders/api/sharedHandlers.js","../src/loaders/api/start.js","../src/loaders/api/topLevelCallers.js","../src/loaders/api/wrapLogger.js","../src/loaders/configure/configure.js","../src/loaders/configure/nonce.js","../src/loaders/configure/public-path.js","../src/loaders/features/enabled-features.js","../src/loaders/features/featureDependencies.js","../src/loaders/features/features.js"],"version":"5.9.3"}
1
+ {"root":["../src/index.js","../src/cdn/experimental.js","../src/cdn/lite.js","../src/cdn/pro.js","../src/cdn/spa.js","../src/common/aggregate/aggregator.js","../src/common/aggregate/event-aggregator.js","../src/common/config/configurable.js","../src/common/config/info.js","../src/common/config/init-types.js","../src/common/config/init.js","../src/common/config/loader-config.js","../src/common/config/runtime.js","../src/common/constants/agent-constants.js","../src/common/constants/env.cdn.js","../src/common/constants/env.js","../src/common/constants/env.npm.js","../src/common/constants/events.js","../src/common/constants/runtime.js","../src/common/constants/shared-channel.js","../src/common/deny-list/deny-list.js","../src/common/dispatch/global-event.js","../src/common/dom/iframe.js","../src/common/dom/query-selector.js","../src/common/dom/selector-path.js","../src/common/drain/drain.js","../src/common/event-emitter/contextual-ee.js","../src/common/event-emitter/event-context.js","../src/common/event-emitter/handle.js","../src/common/event-emitter/register-handler.js","../src/common/event-listener/event-listener-opts.js","../src/common/harvest/harvester.js","../src/common/harvest/send.js","../src/common/harvest/types.js","../src/common/ids/bundle-id.js","../src/common/ids/id.js","../src/common/ids/unique-id.js","../src/common/payloads/payloads.js","../src/common/serialize/bel-serializer.js","../src/common/session/constants.js","../src/common/session/session-entity.js","../src/common/session/session-key.js","../src/common/storage/local-storage.js","../src/common/timer/interaction-timer.js","../src/common/timer/timer.js","../src/common/timing/nav-timing.js","../src/common/timing/now.js","../src/common/timing/time-keeper.js","../src/common/unload/eol.js","../src/common/url/canonicalize-url.js","../src/common/url/clean-url.js","../src/common/url/encode.js","../src/common/url/extract-url.js","../src/common/url/location.js","../src/common/url/parse-url.js","../src/common/url/protocol.js","../src/common/util/attribute-size.js","../src/common/util/browser-stack-matchers.js","../src/common/util/console.js","../src/common/util/data-size.js","../src/common/util/event-origin.js","../src/common/util/feature-flags.js","../src/common/util/get-or-set.js","../src/common/util/invoke.js","../src/common/util/monkey-patched.js","../src/common/util/obfuscate.js","../src/common/util/short-circuit.js","../src/common/util/stringify.js","../src/common/util/submit-data.js","../src/common/util/text.js","../src/common/util/traverse.js","../src/common/util/type-check.js","../src/common/util/webdriver-detection.js","../src/common/v2/mfe-vitals.js","../src/common/v2/script-correlation.js","../src/common/v2/script-tracker.js","../src/common/v2/utils.js","../src/common/vitals/constants.js","../src/common/vitals/cumulative-layout-shift.js","../src/common/vitals/first-contentful-paint.js","../src/common/vitals/first-paint.js","../src/common/vitals/interaction-to-next-paint.js","../src/common/vitals/largest-contentful-paint.js","../src/common/vitals/load-time.js","../src/common/vitals/time-to-first-byte.js","../src/common/vitals/vital-metric.js","../src/common/window/load.js","../src/common/window/nreum.js","../src/common/window/page-visibility.js","../src/common/wrap/wrap-events.js","../src/common/wrap/wrap-fetch.js","../src/common/wrap/wrap-function.js","../src/common/wrap/wrap-history.js","../src/common/wrap/wrap-logger.js","../src/common/wrap/wrap-websocket.js","../src/common/wrap/wrap-xhr.js","../src/features/ajax/constants.js","../src/features/ajax/index.js","../src/features/ajax/aggregate/gql.js","../src/features/ajax/aggregate/index.js","../src/features/ajax/instrument/distributed-tracing.js","../src/features/ajax/instrument/index.js","../src/features/ajax/instrument/response-size.js","../src/features/generic_events/constants.js","../src/features/generic_events/index.js","../src/features/generic_events/aggregate/index.js","../src/features/generic_events/aggregate/user-actions/aggregated-user-action.js","../src/features/generic_events/aggregate/user-actions/user-actions-aggregator.js","../src/features/generic_events/instrument/index.js","../src/features/jserrors/constants.js","../src/features/jserrors/index.js","../src/features/jserrors/aggregate/canonical-function-name.js","../src/features/jserrors/aggregate/cause-string.js","../src/features/jserrors/aggregate/compute-stack-trace.js","../src/features/jserrors/aggregate/format-stack-trace.js","../src/features/jserrors/aggregate/index.js","../src/features/jserrors/aggregate/internal-errors.js","../src/features/jserrors/aggregate/string-hash-code.js","../src/features/jserrors/instrument/index.js","../src/features/jserrors/shared/cast-error.js","../src/features/jserrors/shared/uncaught-error.js","../src/features/logging/constants.js","../src/features/logging/index.js","../src/features/logging/aggregate/index.js","../src/features/logging/instrument/index.js","../src/features/logging/shared/log.js","../src/features/logging/shared/utils.js","../src/features/metrics/constants.js","../src/features/metrics/index.js","../src/features/metrics/aggregate/framework-detection.js","../src/features/metrics/aggregate/harvest-metadata.js","../src/features/metrics/aggregate/index.js","../src/features/metrics/instrument/index.js","../src/features/page_action/constants.js","../src/features/page_action/index.js","../src/features/page_action/instrument/index.js","../src/features/page_view_event/constants.js","../src/features/page_view_event/index.js","../src/features/page_view_event/aggregate/index.js","../src/features/page_view_event/aggregate/initialized-features.js","../src/features/page_view_event/instrument/index.js","../src/features/page_view_timing/constants.js","../src/features/page_view_timing/index.js","../src/features/page_view_timing/aggregate/index.js","../src/features/page_view_timing/instrument/index.js","../src/features/session_replay/constants.js","../src/features/session_replay/index.js","../src/features/session_replay/aggregate/index.js","../src/features/session_replay/instrument/index.js","../src/features/session_replay/shared/recorder-events.js","../src/features/session_replay/shared/recorder.js","../src/features/session_replay/shared/stylesheet-evaluator.js","../src/features/session_replay/shared/utils.js","../src/features/session_trace/constants.js","../src/features/session_trace/index.js","../src/features/session_trace/aggregate/index.js","../src/features/session_trace/aggregate/trace/node.js","../src/features/session_trace/aggregate/trace/storage.js","../src/features/session_trace/aggregate/trace/utils.js","../src/features/session_trace/instrument/index.js","../src/features/soft_navigations/constants.js","../src/features/soft_navigations/index.js","../src/features/soft_navigations/aggregate/ajax-node.js","../src/features/soft_navigations/aggregate/bel-node.js","../src/features/soft_navigations/aggregate/index.js","../src/features/soft_navigations/aggregate/initial-page-load-interaction.js","../src/features/soft_navigations/aggregate/interaction.js","../src/features/soft_navigations/instrument/index.js","../src/features/utils/agent-session.js","../src/features/utils/aggregate-base.js","../src/features/utils/event-buffer.js","../src/features/utils/feature-base.js","../src/features/utils/feature-gates.js","../src/features/utils/instrument-base.js","../src/interfaces/registered-entity.js","../src/loaders/agent-base.js","../src/loaders/agent.js","../src/loaders/api-base.js","../src/loaders/browser-agent.js","../src/loaders/micro-agent-base.js","../src/loaders/micro-agent.js","../src/loaders/api/addPageAction.js","../src/loaders/api/addRelease.js","../src/loaders/api/addToTrace.js","../src/loaders/api/consent.js","../src/loaders/api/constants.js","../src/loaders/api/finished.js","../src/loaders/api/interaction-types.js","../src/loaders/api/interaction.js","../src/loaders/api/log.js","../src/loaders/api/measure.js","../src/loaders/api/noticeError.js","../src/loaders/api/pauseReplay.js","../src/loaders/api/recordCustomEvent.js","../src/loaders/api/recordReplay.js","../src/loaders/api/register-api-types.js","../src/loaders/api/register.js","../src/loaders/api/setApplicationVersion.js","../src/loaders/api/setCustomAttribute.js","../src/loaders/api/setErrorHandler.js","../src/loaders/api/setPageViewName.js","../src/loaders/api/setUserId.js","../src/loaders/api/sharedHandlers.js","../src/loaders/api/start.js","../src/loaders/api/topLevelCallers.js","../src/loaders/api/wrapLogger.js","../src/loaders/configure/configure.js","../src/loaders/configure/nonce.js","../src/loaders/configure/public-path.js","../src/loaders/features/enabled-features.js","../src/loaders/features/featureDependencies.js","../src/loaders/features/features.js"],"version":"5.9.3"}
@@ -276,5 +276,11 @@ export type Init = {
276
276
  */
277
277
  elementAttributes?: string[] | undefined;
278
278
  } | undefined;
279
+ web_sockets?: {
280
+ /**
281
+ * - Turn on/off the web sockets feature (off by default).
282
+ */
283
+ enabled?: boolean | undefined;
284
+ } | undefined;
279
285
  };
280
286
  //# sourceMappingURL=init-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/common/config/init.js"],"names":[],"mappings":"AAgJO,0CAEN;mBAtIY,OAAO,cAAc,EAAE,IAAI"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/common/config/init.js"],"names":[],"mappings":"AAiJO,0CAEN;mBAvIY,OAAO,cAAc,EAAE,IAAI"}
@@ -1,19 +1,3 @@
1
- /**
2
- * Initiate a harvest call.
3
- * @param {NetworkSendSpec} param0 Specification for sending data
4
- * @returns {boolean} True if a network call was made. Note that this does not mean or guarantee that it was successful.
5
- */
6
- export function send(agentRef: any, { endpoint, payload, localOpts, submitMethod, cbFinished, raw, featureName, endpointVersion, harvesterObfuscator }: {
7
- endpoint: any;
8
- payload: any;
9
- localOpts?: {} | undefined;
10
- submitMethod: any;
11
- cbFinished: any;
12
- raw: any;
13
- featureName: any;
14
- endpointVersion?: number | undefined;
15
- harvesterObfuscator: any;
16
- }): boolean;
17
1
  export class Harvester {
18
2
  constructor(agentRef: any);
19
3
  initializedAggregates: any[];
@@ -29,6 +13,5 @@ export class Harvester {
29
13
  triggerHarvestFor(aggregateInst: object, localOpts?: object): boolean;
30
14
  #private;
31
15
  }
32
- export type NetworkSendSpec = import("./types.js").NetworkSendSpec;
33
16
  import { Obfuscator } from '../util/obfuscate';
34
17
  //# sourceMappingURL=harvester.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"harvester.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvester.js"],"names":[],"mappings":"AAmHA;;;;IAII;AACJ;;;;;;;;;;IAFc,OAAO,CAsHpB;AAnND;IAIE,2BAcC;IAhBD,6BAA0B;IAGxB,cAAwB;IAIxB,uBAA0C;IAW5C,wCASC;IAED;;;;;OAKG;IACH,iCAJW,MAAM,cACN,MAAM,GACJ,OAAO,CA+CnB;;CACF;8BAGY,OAAO,YAAY,EAAE,eAAe;2BA7FtB,mBAAmB"}
1
+ {"version":3,"file":"harvester.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvester.js"],"names":[],"mappings":"AAiBA;IAIE,2BAcC;IAhBD,6BAA0B;IAGxB,cAAwB;IAIxB,uBAA0C;IAW5C,wCASC;IAED;;;;;OAKG;IACH,iCAJW,MAAM,cACN,MAAM,GACJ,OAAO,CA+CnB;;CACF;2BA1F0B,mBAAmB"}