@newrelic/browser-agent 1.316.0 → 1.317.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 (140) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/common/config/init-types.js +1 -0
  3. package/dist/cjs/common/config/init.js +6 -4
  4. package/dist/cjs/common/constants/env.cdn.js +2 -2
  5. package/dist/cjs/common/constants/env.npm.js +2 -2
  6. package/dist/cjs/common/constants/events.js +26 -0
  7. package/dist/cjs/common/harvest/harvester.js +12 -4
  8. package/dist/cjs/common/payloads/payloads.js +127 -0
  9. package/dist/cjs/common/serialize/bel-serializer.js +4 -3
  10. package/dist/cjs/common/util/data-size.js +2 -2
  11. package/dist/cjs/common/util/obfuscate.js +147 -3
  12. package/dist/cjs/common/wrap/wrap-websocket.js +2 -1
  13. package/dist/cjs/common/wrap/wrap-xhr.js +1 -1
  14. package/dist/cjs/features/ajax/aggregate/gql.js +40 -1
  15. package/dist/cjs/features/ajax/aggregate/index.js +51 -13
  16. package/dist/cjs/features/ajax/constants.js +6 -1
  17. package/dist/cjs/features/ajax/instrument/index.js +105 -17
  18. package/dist/cjs/features/generic_events/aggregate/index.js +15 -10
  19. package/dist/cjs/features/generic_events/constants.js +3 -2
  20. package/dist/cjs/features/jserrors/aggregate/format-stack-trace.js +2 -2
  21. package/dist/cjs/features/jserrors/aggregate/index.js +12 -3
  22. package/dist/cjs/features/logging/aggregate/index.js +7 -3
  23. package/dist/cjs/features/metrics/aggregate/index.js +5 -1
  24. package/dist/cjs/features/page_view_event/aggregate/index.js +7 -3
  25. package/dist/cjs/features/page_view_timing/aggregate/index.js +6 -1
  26. package/dist/cjs/features/session_replay/aggregate/index.js +7 -1
  27. package/dist/cjs/features/session_trace/aggregate/index.js +6 -2
  28. package/dist/cjs/features/soft_navigations/aggregate/ajax-node.js +36 -5
  29. package/dist/cjs/features/soft_navigations/aggregate/index.js +7 -1
  30. package/dist/cjs/features/soft_navigations/aggregate/initial-page-load-interaction.js +1 -1
  31. package/dist/cjs/features/soft_navigations/aggregate/interaction.js +6 -4
  32. package/dist/cjs/features/utils/aggregate-base.js +2 -3
  33. package/dist/esm/common/config/init-types.js +1 -0
  34. package/dist/esm/common/config/init.js +3 -1
  35. package/dist/esm/common/constants/env.cdn.js +2 -2
  36. package/dist/esm/common/constants/env.npm.js +2 -2
  37. package/dist/esm/common/constants/events.js +20 -0
  38. package/dist/esm/common/harvest/harvester.js +12 -4
  39. package/dist/esm/common/payloads/payloads.js +118 -0
  40. package/dist/esm/common/serialize/bel-serializer.js +4 -3
  41. package/dist/esm/common/util/data-size.js +2 -2
  42. package/dist/esm/common/util/obfuscate.js +147 -3
  43. package/dist/esm/common/wrap/wrap-websocket.js +2 -1
  44. package/dist/esm/common/wrap/wrap-xhr.js +1 -1
  45. package/dist/esm/features/ajax/aggregate/gql.js +39 -1
  46. package/dist/esm/features/ajax/aggregate/index.js +52 -14
  47. package/dist/esm/features/ajax/constants.js +5 -0
  48. package/dist/esm/features/ajax/instrument/index.js +106 -18
  49. package/dist/esm/features/generic_events/aggregate/index.js +15 -10
  50. package/dist/esm/features/generic_events/constants.js +3 -2
  51. package/dist/esm/features/jserrors/aggregate/format-stack-trace.js +2 -2
  52. package/dist/esm/features/jserrors/aggregate/index.js +12 -3
  53. package/dist/esm/features/logging/aggregate/index.js +7 -3
  54. package/dist/esm/features/metrics/aggregate/index.js +5 -1
  55. package/dist/esm/features/page_view_event/aggregate/index.js +7 -3
  56. package/dist/esm/features/page_view_timing/aggregate/index.js +6 -1
  57. package/dist/esm/features/session_replay/aggregate/index.js +7 -1
  58. package/dist/esm/features/session_trace/aggregate/index.js +6 -2
  59. package/dist/esm/features/soft_navigations/aggregate/ajax-node.js +36 -5
  60. package/dist/esm/features/soft_navigations/aggregate/index.js +7 -1
  61. package/dist/esm/features/soft_navigations/aggregate/initial-page-load-interaction.js +1 -1
  62. package/dist/esm/features/soft_navigations/aggregate/interaction.js +6 -4
  63. package/dist/esm/features/utils/aggregate-base.js +2 -3
  64. package/dist/tsconfig.tsbuildinfo +1 -1
  65. package/dist/types/common/config/init-types.d.ts +4 -0
  66. package/dist/types/common/config/init-types.d.ts.map +1 -1
  67. package/dist/types/common/config/init.d.ts.map +1 -1
  68. package/dist/types/common/constants/events.d.ts +16 -0
  69. package/dist/types/common/constants/events.d.ts.map +1 -0
  70. package/dist/types/common/harvest/harvester.d.ts +4 -1
  71. package/dist/types/common/harvest/harvester.d.ts.map +1 -1
  72. package/dist/types/common/payloads/payloads.d.ts +42 -0
  73. package/dist/types/common/payloads/payloads.d.ts.map +1 -0
  74. package/dist/types/common/serialize/bel-serializer.d.ts +1 -1
  75. package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -1
  76. package/dist/types/common/util/obfuscate.d.ts +23 -2
  77. package/dist/types/common/util/obfuscate.d.ts.map +1 -1
  78. package/dist/types/common/wrap/wrap-websocket.d.ts.map +1 -1
  79. package/dist/types/features/ajax/aggregate/gql.d.ts +8 -0
  80. package/dist/types/features/ajax/aggregate/gql.d.ts.map +1 -1
  81. package/dist/types/features/ajax/aggregate/index.d.ts +2 -0
  82. package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
  83. package/dist/types/features/ajax/constants.d.ts +5 -0
  84. package/dist/types/features/ajax/constants.d.ts.map +1 -1
  85. package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
  86. package/dist/types/features/generic_events/aggregate/index.d.ts +3 -1
  87. package/dist/types/features/generic_events/aggregate/index.d.ts.map +1 -1
  88. package/dist/types/features/generic_events/constants.d.ts.map +1 -1
  89. package/dist/types/features/jserrors/aggregate/index.d.ts +8 -1
  90. package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
  91. package/dist/types/features/logging/aggregate/index.d.ts +3 -1
  92. package/dist/types/features/logging/aggregate/index.d.ts.map +1 -1
  93. package/dist/types/features/metrics/aggregate/index.d.ts +2 -0
  94. package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
  95. package/dist/types/features/page_view_event/aggregate/index.d.ts +2 -0
  96. package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
  97. package/dist/types/features/page_view_timing/aggregate/index.d.ts +2 -0
  98. package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
  99. package/dist/types/features/session_replay/aggregate/index.d.ts +2 -0
  100. package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
  101. package/dist/types/features/session_trace/aggregate/index.d.ts +2 -0
  102. package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
  103. package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts +6 -1
  104. package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts.map +1 -1
  105. package/dist/types/features/soft_navigations/aggregate/index.d.ts +3 -0
  106. package/dist/types/features/soft_navigations/aggregate/index.d.ts.map +1 -1
  107. package/dist/types/features/soft_navigations/aggregate/interaction.d.ts +3 -1
  108. package/dist/types/features/soft_navigations/aggregate/interaction.d.ts.map +1 -1
  109. package/dist/types/features/utils/aggregate-base.d.ts +0 -1
  110. package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
  111. package/package.json +2 -2
  112. package/src/common/config/init-types.js +1 -0
  113. package/src/common/config/init.js +2 -1
  114. package/src/common/constants/events.js +20 -0
  115. package/src/common/harvest/harvester.js +11 -4
  116. package/src/common/payloads/payloads.js +135 -0
  117. package/src/common/serialize/bel-serializer.js +4 -3
  118. package/src/common/util/data-size.js +2 -2
  119. package/src/common/util/obfuscate.js +154 -3
  120. package/src/common/wrap/wrap-websocket.js +2 -1
  121. package/src/common/wrap/wrap-xhr.js +1 -1
  122. package/src/features/ajax/aggregate/gql.js +42 -1
  123. package/src/features/ajax/aggregate/index.js +43 -13
  124. package/src/features/ajax/constants.js +5 -1
  125. package/src/features/ajax/instrument/index.js +114 -18
  126. package/src/features/generic_events/aggregate/index.js +14 -9
  127. package/src/features/generic_events/constants.js +3 -2
  128. package/src/features/jserrors/aggregate/format-stack-trace.js +3 -3
  129. package/src/features/jserrors/aggregate/index.js +12 -3
  130. package/src/features/logging/aggregate/index.js +7 -6
  131. package/src/features/metrics/aggregate/index.js +5 -1
  132. package/src/features/page_view_event/aggregate/index.js +6 -2
  133. package/src/features/page_view_timing/aggregate/index.js +6 -1
  134. package/src/features/session_replay/aggregate/index.js +7 -1
  135. package/src/features/session_trace/aggregate/index.js +6 -2
  136. package/src/features/soft_navigations/aggregate/ajax-node.js +26 -5
  137. package/src/features/soft_navigations/aggregate/index.js +7 -1
  138. package/src/features/soft_navigations/aggregate/initial-page-load-interaction.js +1 -1
  139. package/src/features/soft_navigations/aggregate/interaction.js +6 -4
  140. package/src/features/utils/aggregate-base.js +1 -3
@@ -10,10 +10,11 @@ import { AggregateBase } from '../../utils/aggregate-base';
10
10
  import { warn } from '../../../common/util/console';
11
11
  import { now } from '../../../common/timing/now';
12
12
  import { registerHandler } from '../../../common/event-emitter/register-handler';
13
- import { applyFnToProps } from '../../../common/util/traverse';
13
+ import { Obfuscator } from '../../../common/util/obfuscate';
14
14
  import { UserActionsAggregator } from './user-actions/user-actions-aggregator';
15
15
  import { isIFrameWindow } from '../../../common/dom/iframe';
16
16
  import { isPureObject } from '../../../common/util/type-check';
17
+ import { EVENT_TYPES } from '../../../common/constants/events';
17
18
  import { getVersion2Attributes, getVersion2DuplicationAttributes, shouldDuplicate } from '../../../common/v2/utils';
18
19
  export class Aggregate extends AggregateBase {
19
20
  static featureName = FEATURE_NAME;
@@ -21,6 +22,10 @@ export class Aggregate extends AggregateBase {
21
22
  constructor(agentRef) {
22
23
  super(agentRef, FEATURE_NAME);
23
24
  this.referrerUrl = isBrowserScope && document.referrer ? cleanURL(document.referrer) : undefined;
25
+
26
+ // Create generic obfuscator (no specific event types) since this feature handles multiple event types
27
+ // Will check each event's eventType property at runtime against obfuscation rules
28
+ this.obfuscator = new Obfuscator(agentRef);
24
29
  this.waitForFlags(['ins']).then(([ins]) => {
25
30
  if (!ins) {
26
31
  this.blocked = true;
@@ -40,7 +45,7 @@ export class Aggregate extends AggregateBase {
40
45
  registerHandler('api-addPageAction', (timestamp, name, attributes, target) => {
41
46
  this.addEvent({
42
47
  ...attributes,
43
- eventType: 'PageAction',
48
+ eventType: EVENT_TYPES.PA,
44
49
  timestamp: this.#toEpoch(timestamp),
45
50
  timeSinceLoad: timestamp / 1000,
46
51
  actionName: name,
@@ -68,7 +73,7 @@ export class Aggregate extends AggregateBase {
68
73
  } = aggregatedUserAction.event;
69
74
  aggregatedUserAction.targets.forEach(mfeTarget => {
70
75
  const userActionEvent = {
71
- eventType: 'UserAction',
76
+ eventType: EVENT_TYPES.UA,
72
77
  timestamp: this.#toEpoch(timeStamp),
73
78
  action: type,
74
79
  actionCount: aggregatedUserAction.count,
@@ -155,7 +160,7 @@ export class Aggregate extends AggregateBase {
155
160
  const detailObj = agentRef.init.performance.capture_detail ? createDetailAttrs(entry.detail) : {};
156
161
  this.addEvent({
157
162
  ...detailObj,
158
- eventType: 'BrowserPerformance',
163
+ eventType: EVENT_TYPES.BP,
159
164
  timestamp: this.#toEpoch(entry.startTime),
160
165
  entryName: entry.name,
161
166
  entryDuration: entry.duration,
@@ -221,7 +226,7 @@ export class Aggregate extends AggregateBase {
221
226
  this.reportSupportabilityMetric('Generic/Performance/Resource/Seen');
222
227
  const event = {
223
228
  ...entryObject,
224
- eventType: 'BrowserPerformance',
229
+ eventType: EVENT_TYPES.BP,
225
230
  timestamp: this.#toEpoch(entryObject.startTime),
226
231
  entryName: cleanURL(name),
227
232
  entryDuration: duration,
@@ -241,7 +246,7 @@ export class Aggregate extends AggregateBase {
241
246
  } = args;
242
247
  const event = {
243
248
  ...customAttributes,
244
- eventType: 'BrowserPerformance',
249
+ eventType: EVENT_TYPES.BP,
245
250
  timestamp: this.#toEpoch(start),
246
251
  entryName: n,
247
252
  entryDuration: duration,
@@ -253,7 +258,7 @@ export class Aggregate extends AggregateBase {
253
258
  registerHandler('ws-complete', nrData => {
254
259
  const event = {
255
260
  ...nrData,
256
- eventType: 'WebSocket',
261
+ eventType: EVENT_TYPES.WS,
257
262
  timestamp: this.#toEpoch(nrData.timestamp),
258
263
  openedAt: this.#toEpoch(nrData.openedAt),
259
264
  closedAt: this.#toEpoch(nrData.closedAt)
@@ -268,7 +273,7 @@ export class Aggregate extends AggregateBase {
268
273
  if (!agentRef.init.feature_flags.includes('no_spv')) {
269
274
  registerHandler('spv', evt => {
270
275
  this.addEvent({
271
- eventType: 'SecurityPolicyViolation',
276
+ eventType: EVENT_TYPES.SPV,
272
277
  timestamp: this.#toEpoch(evt.timeStamp),
273
278
  blockedUri: evt.blockedURI,
274
279
  documentUri: evt.documentURI,
@@ -337,9 +342,9 @@ export class Aggregate extends AggregateBase {
337
342
  });
338
343
  }
339
344
  serializer(eventBuffer) {
340
- return applyFnToProps({
345
+ return this.obfuscator.traverseAndObfuscateEvents({
341
346
  ins: eventBuffer
342
- }, this.obfuscator.obfuscateString.bind(this.obfuscator), 'string');
347
+ });
343
348
  }
344
349
  queryStringsBuilder() {
345
350
  return {
@@ -1,7 +1,8 @@
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
+ import { EVENT_TYPES } from '../../common/constants/events';
5
6
  import { FEATURE_NAMES } from '../../loaders/features/features';
6
7
  export const FEATURE_NAME = FEATURE_NAMES.genericEvents;
7
8
  export const OBSERVED_EVENTS = ['auxclick', 'click', 'copy', 'keydown', 'paste', 'scrollend'];
@@ -9,7 +10,7 @@ export const OBSERVED_WINDOW_EVENTS = ['focus', 'blur'];
9
10
  export const RAGE_CLICK_THRESHOLD_EVENTS = 4;
10
11
  export const RAGE_CLICK_THRESHOLD_MS = 1000;
11
12
  export const FRUSTRATION_TIMEOUT_MS = 2000;
12
- export const RESERVED_EVENT_TYPES = ['PageAction', 'UserAction', 'BrowserPerformance'];
13
+ export const RESERVED_EVENT_TYPES = [EVENT_TYPES.PA, EVENT_TYPES.UA, EVENT_TYPES.BP];
13
14
  export const FEATURE_FLAGS = {
14
15
  RESOURCES: 'experimental.resources',
15
16
  REGISTER: 'register'
@@ -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
 
@@ -9,7 +9,7 @@ export function formatStackTrace(stackLines) {
9
9
  return truncateStackLines(stackLines).replace(stripNewlinesRegex, '');
10
10
  }
11
11
 
12
- // takes array of stack lines and returns string with top 50 and buttom 50 lines
12
+ // takes array of stack lines and returns string with top 50 and bottom 50 lines
13
13
  function truncateStackLines(stackLines) {
14
14
  var stackString;
15
15
  if (stackLines.length > 100) {
@@ -15,11 +15,12 @@ import { FEATURE_NAME } from '../constants';
15
15
  import { FEATURE_NAMES } from '../../../loaders/features/features';
16
16
  import { AggregateBase } from '../../utils/aggregate-base';
17
17
  import { now } from '../../../common/timing/now';
18
- import { applyFnToProps } from '../../../common/util/traverse';
18
+ import { Obfuscator } from '../../../common/util/obfuscate';
19
19
  import { evaluateInternalError } from './internal-errors';
20
20
  import { getRegisteredTargetsFromFilename, getVersion2Attributes, getVersion2DuplicationAttributes, shouldDuplicate } from '../../../common/v2/utils';
21
21
  import { buildCauseString } from './cause-string';
22
22
  import { ShortCircuit } from '../../../common/util/short-circuit';
23
+ import { EVENT_TYPES } from '../../../common/constants/events';
23
24
 
24
25
  /**
25
26
  * @typedef {import('./compute-stack-trace.js').StackInfo} StackInfo
@@ -36,6 +37,10 @@ export class Aggregate extends AggregateBase {
36
37
  this.observedAt = {};
37
38
  this.pageviewReported = {};
38
39
  this.errorOnPage = false;
40
+
41
+ // Create obfuscators for each event type this feature handles
42
+ this.errorObfuscator = new Obfuscator(agentRef, EVENT_TYPES.JSE);
43
+ this.xhrObfuscator = new Obfuscator(agentRef, EVENT_TYPES.AJAX);
39
44
  register('err', this.processError.bind(this), this.featureName, this.ee);
40
45
  register('ierr', this.processError.bind(this), this.featureName, this.ee);
41
46
  register('returnJserror', (jsErrorEvent, softNavAttrs) => this.#storeJserrorForHarvest(jsErrorEvent, softNavAttrs), this.featureName, this.ee);
@@ -51,7 +56,11 @@ export class Aggregate extends AggregateBase {
51
56
  });
52
57
  }
53
58
  serializer(aggregatorTypeToBucketsMap) {
54
- return applyFnToProps(aggregatorTypeToBucketsMap, this.obfuscator.obfuscateString.bind(this.obfuscator), 'string');
59
+ return {
60
+ err: this.errorObfuscator.traverseAndObfuscateEvents(aggregatorTypeToBucketsMap.err),
61
+ ierr: this.errorObfuscator.traverseAndObfuscateEvents(aggregatorTypeToBucketsMap.ierr),
62
+ xhr: this.xhrObfuscator.traverseAndObfuscateEvents(aggregatorTypeToBucketsMap.xhr)
63
+ };
55
64
  }
56
65
  queryStringsBuilder(aggregatorTakeReturnedData) {
57
66
  const qs = {};
@@ -253,7 +262,7 @@ export class Aggregate extends AggregateBase {
253
262
  params.stack_trace = truncateSize(stackInfo.stackString);
254
263
  this.observedAt[bucketHash] = Math.floor(this.agentRef.runtime.timeKeeper.correctRelativeTimestamp(time));
255
264
  } else {
256
- params.browser_stack_hash = stringHashCode(stackInfo.stackString);
265
+ params.browser_stack_hash = stringHashCode(truncateSize(stackInfo.stackString));
257
266
  }
258
267
  params.releaseIds = stringify(this.agentRef.runtime.releaseIds);
259
268
 
@@ -9,11 +9,12 @@ import { AggregateBase } from '../../utils/aggregate-base';
9
9
  import { FEATURE_NAME, LOGGING_EVENT_EMITTER_CHANNEL, LOG_LEVELS, LOGGING_MODE } from '../constants';
10
10
  import { Log } from '../shared/log';
11
11
  import { isValidLogLevel } from '../shared/utils';
12
- import { applyFnToProps } from '../../../common/util/traverse';
12
+ import { Obfuscator } from '../../../common/util/obfuscate';
13
13
  import { SESSION_EVENT_TYPES, SESSION_EVENTS } from '../../../common/session/constants';
14
14
  import { ABORT_REASONS } from '../../session_replay/constants';
15
15
  import { canEnableSessionTracking } from '../../utils/feature-gates';
16
16
  import { getVersion2Attributes, getVersion2DuplicationAttributes, shouldDuplicate } from '../../../common/v2/utils';
17
+ import { EVENT_TYPES } from '../../../common/constants/events';
17
18
  const LOGGING_EVENT = 'Logging/Event/';
18
19
  export class Aggregate extends AggregateBase {
19
20
  static featureName = FEATURE_NAME;
@@ -32,6 +33,9 @@ export class Aggregate extends AggregateBase {
32
33
  this.harvestOpts.raw = true;
33
34
  super.customAttributesAreSeparate = true;
34
35
 
36
+ // Create obfuscator for log entries
37
+ this.obfuscator = new Obfuscator(agentRef, EVENT_TYPES.LOG);
38
+
35
39
  // 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.
36
40
  this.ee.on(SESSION_EVENTS.RESET, () => {
37
41
  this.abort(ABORT_REASONS.RESET);
@@ -112,7 +116,7 @@ export class Aggregate extends AggregateBase {
112
116
  common: {
113
117
  /** Attributes in the `common` section are added to `all` logs generated in the payload */
114
118
  attributes: {
115
- ...applyFnToProps(this.agentRef.info.jsAttributes, this.obfuscator.obfuscateString.bind(this.obfuscator), 'string'),
119
+ ...this.obfuscator.traverseAndObfuscateEvents(this.agentRef.info.jsAttributes),
116
120
  ...(this.harvestEndpointVersion === 1 && {
117
121
  'entity.guid': this.agentRef.runtime.appMetadata.agents[0].entityGuid,
118
122
  appId: this.agentRef.info.applicationID
@@ -137,7 +141,7 @@ export class Aggregate extends AggregateBase {
137
141
  }
138
142
  },
139
143
  /** logs section contains individual unique log entries */
140
- logs: applyFnToProps(eventBuffer, this.obfuscator.obfuscateString.bind(this.obfuscator), 'string')
144
+ logs: this.obfuscator.traverseAndObfuscateEvents(eventBuffer)
141
145
  }];
142
146
  }
143
147
  queryStringsBuilder() {
@@ -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 { registerHandler } from '../../../common/event-emitter/register-handler';
@@ -12,6 +12,7 @@ import { isBrowserScope, isWorkerScope } from '../../../common/constants/runtime
12
12
  import { AggregateBase } from '../../utils/aggregate-base';
13
13
  import { isIFrameWindow } from '../../../common/dom/iframe';
14
14
  import { evaluateHarvestMetadata } from './harvest-metadata';
15
+ import { Obfuscator } from '../../../common/util/obfuscate';
15
16
  // import { WEBSOCKET_TAG } from '../../../common/wrap/wrap-websocket'
16
17
  // import { handleWebsocketEvents } from './websocket-detection'
17
18
 
@@ -21,6 +22,9 @@ export class Aggregate extends AggregateBase {
21
22
  super(agentRef, FEATURE_NAME);
22
23
  this.harvestOpts.aggregatorTypes = ['cm', 'sm']; // the types in EventAggregator this feature cares about
23
24
 
25
+ // Create a generic obfuscator for checking if rules are configured
26
+ this.obfuscator = new Obfuscator(agentRef);
27
+
24
28
  /** all the harvest metadata metrics need to be evaluated simulataneously at unload time so just temporarily buffer them and dont make SMs immediately from the data */
25
29
  this.harvestMetadata = {};
26
30
  this.harvestOpts.beforeUnload = () => {
@@ -15,11 +15,12 @@ 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 { applyFnToProps } from '../../../common/util/traverse';
18
+ import { Obfuscator } from '../../../common/util/obfuscate';
19
19
  import { send } from '../../../common/harvest/harvester';
20
20
  import { FEATURE_NAMES, FEATURE_TO_ENDPOINT } from '../../../loaders/features/features';
21
21
  import { getSubmitMethod } from '../../../common/util/submit-data';
22
22
  import { webdriverDetected } from '../../../common/util/webdriver-detection';
23
+ import { EVENT_TYPES } from '../../../common/constants/events';
23
24
  export class Aggregate extends AggregateBase {
24
25
  static featureName = CONSTANTS.FEATURE_NAME;
25
26
  constructor(agentRef) {
@@ -30,6 +31,9 @@ export class Aggregate extends AggregateBase {
30
31
  this.firstByteToWindowLoad = 0; // our "frontend" duration
31
32
  this.firstByteToDomContent = 0; // our "dom processing" duration
32
33
  this.retries = 0;
34
+
35
+ // Create obfuscator for page view events
36
+ this.obfuscator = new Obfuscator(agentRef, EVENT_TYPES.PVE);
33
37
  agentRef.runtime.timeKeeper = new TimeKeeper(agentRef.runtime.session);
34
38
  if (isBrowserScope) {
35
39
  timeToFirstByte.subscribe(({
@@ -78,12 +82,12 @@ export class Aggregate extends AggregateBase {
78
82
  };
79
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
80
84
 
81
- let body = applyFnToProps({
85
+ let body = this.obfuscator.traverseAndObfuscateEvents({
82
86
  ja: {
83
87
  ...customAttributes,
84
88
  webdriverDetected
85
89
  }
86
- }, this.obfuscator.obfuscateString.bind(this.obfuscator), 'string');
90
+ });
87
91
  if (globalScope.performance) {
88
92
  const navTimingEntry = getNavigationEntry();
89
93
  if (navTimingEntry) {
@@ -9,6 +9,7 @@ import { handle } from '../../../common/event-emitter/handle';
9
9
  import { FEATURE_NAME } from '../constants';
10
10
  import { FEATURE_NAMES } from '../../../loaders/features/features';
11
11
  import { AggregateBase } from '../../utils/aggregate-base';
12
+ import { Obfuscator } from '../../../common/util/obfuscate';
12
13
  import { cumulativeLayoutShift } from '../../../common/vitals/cumulative-layout-shift';
13
14
  import { firstContentfulPaint } from '../../../common/vitals/first-contentful-paint';
14
15
  import { firstPaint } from '../../../common/vitals/first-paint';
@@ -21,6 +22,7 @@ import { eventOrigin } from '../../../common/util/event-origin';
21
22
  import { loadTime } from '../../../common/vitals/load-time';
22
23
  import { webdriverDetected } from '../../../common/util/webdriver-detection';
23
24
  import { cleanURL } from '../../../common/url/clean-url';
25
+ import { EVENT_TYPES } from '../../../common/constants/events';
24
26
  export class Aggregate extends AggregateBase {
25
27
  static featureName = FEATURE_NAME;
26
28
  #handleVitalMetric = ({
@@ -35,6 +37,9 @@ export class Aggregate extends AggregateBase {
35
37
  this.curSessEndRecorded = false;
36
38
  this.firstIxnRecorded = false;
37
39
  super.customAttributesAreSeparate = true;
40
+
41
+ // Create obfuscator for page view timing events
42
+ this.obfuscator = new Obfuscator(agentRef, EVENT_TYPES.PVT);
38
43
  registerHandler('docHidden', msTimestamp => this.endCurrentSession(msTimestamp), this.featureName, this.ee);
39
44
  // Add the time of _window pagehide event_ firing to the next PVT harvest == NRDB windowUnload attr:
40
45
  registerHandler('winPagehide', msTimestamp => this.addTiming('unload', msTimestamp, null), this.featureName, this.ee);
@@ -140,7 +145,7 @@ export class Aggregate extends AggregateBase {
140
145
  // serialize array of timing data
141
146
  serializer(eventBuffer) {
142
147
  if (!eventBuffer?.length) return '';
143
- var addString = getAddStringContext(this.agentRef.runtime.obfuscator);
148
+ var addString = getAddStringContext(this.obfuscator);
144
149
  var payload = 'bel.6;';
145
150
  for (var i = 0; i < eventBuffer.length; i++) {
146
151
  var timing = eventBuffer[i];
@@ -19,9 +19,11 @@ import { stringify } from '../../../common/util/stringify';
19
19
  import { stylesheetEvaluator } from '../shared/stylesheet-evaluator';
20
20
  import { now } from '../../../common/timing/now';
21
21
  import { MAX_PAYLOAD_SIZE } from '../../../common/constants/agent-constants';
22
+ import { EVENT_TYPES } from '../../../common/constants/events';
22
23
  import { cleanURL } from '../../../common/url/clean-url';
23
24
  import { canEnableSessionTracking } from '../../utils/feature-gates';
24
25
  import { PAUSE_REPLAY } from '../../../loaders/api/constants';
26
+ import { Obfuscator } from '../../../common/util/obfuscate';
25
27
  export class Aggregate extends AggregateBase {
26
28
  static featureName = FEATURE_NAME;
27
29
  mode = MODE.OFF;
@@ -29,6 +31,10 @@ export class Aggregate extends AggregateBase {
29
31
  // pass the recorder into the aggregator
30
32
  constructor(agentRef, args) {
31
33
  super(agentRef, FEATURE_NAME);
34
+
35
+ // Create obfuscator for session replay query params
36
+ this.obfuscator = new Obfuscator(agentRef, EVENT_TYPES.SR);
37
+
32
38
  /** Set once the recorder has fully initialized after flag checks and sampling */
33
39
  this.initialized = false;
34
40
  /** Set once the feature has been "aborted" to prevent other side-effects from continuing */
@@ -306,7 +312,7 @@ export class Aggregate extends AggregateBase {
306
312
  return {
307
313
  qs: {
308
314
  browser_monitoring_key: this.agentRef.info.licenseKey,
309
- type: 'SessionReplay',
315
+ type: EVENT_TYPES.SR,
310
316
  app_id: this.agentRef.info.applicationID,
311
317
  protocol_version: '0',
312
318
  timestamp: firstTimestamp,
@@ -9,9 +9,10 @@ import { TraceStorage } from './trace/storage';
9
9
  import { obj as encodeObj } from '../../../common/url/encode';
10
10
  import { globalScope } from '../../../common/constants/runtime';
11
11
  import { MODE, SESSION_EVENTS } from '../../../common/session/constants';
12
- import { applyFnToProps } from '../../../common/util/traverse';
12
+ import { Obfuscator } from '../../../common/util/obfuscate';
13
13
  import { cleanURL } from '../../../common/url/clean-url';
14
14
  import { warn } from '../../../common/util/console';
15
+ import { EVENT_TYPES } from '../../../common/constants/events';
15
16
 
16
17
  /** Reserved room for query param attrs */
17
18
  const QUERY_PARAM_PADDING = 5000;
@@ -21,6 +22,9 @@ export class Aggregate extends AggregateBase {
21
22
  super(agentRef, FEATURE_NAME);
22
23
  this.harvestOpts.raw = true;
23
24
 
25
+ // Create obfuscator for session trace nodes
26
+ this.obfuscator = new Obfuscator(agentRef, EVENT_TYPES.ST);
27
+
24
28
  /** Tied to the entitlement flag response from BCS. Will short circuit operations of the agg if false */
25
29
  this.entitled = undefined;
26
30
  /** A flag used to decide if the 30 node threshold should be ignored on the first harvest to ensure sending on the first payload */
@@ -107,7 +111,7 @@ export class Aggregate extends AggregateBase {
107
111
  serializer(stns) {
108
112
  if (!stns.length) return; // there are no processed nodes
109
113
  this.everHarvested = true;
110
- return applyFnToProps(stns, this.obfuscator.obfuscateString.bind(this.obfuscator), 'string');
114
+ return this.obfuscator.traverseAndObfuscateEvents(stns);
111
115
  }
112
116
  queryStringsBuilder(stns) {
113
117
  const firstSessionHarvest = !this.agentRef.runtime.session.state.traceHarvestStarted;
@@ -3,6 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { addCustomAttributes, getAddStringContext, nullable, numeric } from '../../../common/serialize/bel-serializer';
6
+ import { createStringAdders } from '../../../common/payloads/payloads';
6
7
  import { AJAX_ID } from '../../ajax/constants';
7
8
  import { NODE_TYPE } from '../constants';
8
9
  import { BelNode } from './bel-node';
@@ -24,6 +25,12 @@ export class AjaxNode extends BelNode {
24
25
  this.targetAttributes = ajaxEvent.targetAttributes;
25
26
  this[AJAX_ID] = ajaxEvent[AJAX_ID]; // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
26
27
 
28
+ // optional payload metadata attributes
29
+ this.requestBody = ajaxEvent.requestBody;
30
+ this.requestHeaders = ajaxEvent.requestHeaders;
31
+ this.requestQuery = ajaxEvent.requestQuery;
32
+ this.responseBody = ajaxEvent.responseBody;
33
+ this.responseHeaders = ajaxEvent.responseHeaders;
27
34
  this.start = ajaxEvent.startTime;
28
35
  this.end = ajaxEvent.endTime;
29
36
  if (ajaxContext?.latestLongtaskEnd) {
@@ -31,8 +38,11 @@ export class AjaxNode extends BelNode {
31
38
  this.callbackDuration = this.callbackEnd - this.end; // callbackDuration is the time from ajax loaded to last long task observed from it
32
39
  } else this.callbackEnd = this.end; // if no long task was observed, callbackEnd is the same as end
33
40
  }
34
- serialize(parentStartTimestamp, agentRef) {
35
- const addString = getAddStringContext(agentRef.runtime.obfuscator);
41
+ serialize(parentStartTimestamp, agentRef, ajaxObfuscator) {
42
+ const {
43
+ addString,
44
+ addStringWithTruncation
45
+ } = createStringAdders(getAddStringContext, ajaxObfuscator);
36
46
  const nodeList = [];
37
47
 
38
48
  // IMPORTANT: The order in which addString is called matters and correlates to the order in which string shows up in the harvest payload. Do not re-order the following code.
@@ -47,11 +57,32 @@ export class AjaxNode extends BelNode {
47
57
  numeric(this.callbackDuration),
48
58
  // not relative
49
59
  addString(this.method), numeric(this.status), addString(this.domain), addString(this.path), numeric(this.txSize), numeric(this.rxSize), this.requestedWith, addString(this.nodeId), nullable(this.spanId, addString, true) + nullable(this.traceId, addString, true) + nullable(this.spanTimestamp, numeric)];
50
- let allAttachedNodes = addCustomAttributes({
51
- ...(this.gql || {}),
60
+ // Regular attributes: obfuscate only
61
+ const regularAttrs = addCustomAttributes({
62
+ [AJAX_ID]: this[AJAX_ID],
52
63
  ...(this.targetAttributes || {}),
53
- [AJAX_ID]: this[AJAX_ID]
64
+ ...(this.gql || {})
54
65
  }, addString);
66
+
67
+ // Payload attributes: obfuscate then truncate
68
+ const payloadAttrs = addCustomAttributes({
69
+ ...(this.requestBody ? {
70
+ requestBody: this.requestBody
71
+ } : {}),
72
+ ...(this.requestHeaders ? {
73
+ requestHeaders: this.requestHeaders
74
+ } : {}),
75
+ ...(this.requestQuery ? {
76
+ requestQuery: this.requestQuery
77
+ } : {}),
78
+ ...(this.responseBody ? {
79
+ responseBody: this.responseBody
80
+ } : {}),
81
+ ...(this.responseHeaders ? {
82
+ responseHeaders: this.responseHeaders
83
+ } : {})
84
+ }, addStringWithTruncation);
85
+ let allAttachedNodes = [...regularAttrs, ...payloadAttrs];
55
86
  this.children.forEach(node => allAttachedNodes.push(node.serialize())); // no children is expected under ajax nodes at this time
56
87
 
57
88
  fields[1] = numeric(allAttachedNodes.length);
@@ -8,10 +8,12 @@ import { webdriverDetected } from '../../../common/util/webdriver-detection';
8
8
  import { loadTime } from '../../../common/vitals/load-time';
9
9
  import { FEATURE_NAMES } from '../../../loaders/features/features';
10
10
  import { AggregateBase } from '../../utils/aggregate-base';
11
+ import { Obfuscator } from '../../../common/util/obfuscate';
11
12
  import { API_TRIGGER_NAME, FEATURE_NAME, INTERACTION_STATUS, INTERACTION_TRIGGERS, IPL_TRIGGER_NAME, NO_LONG_TASK_WINDOW, POPSTATE_MERGE_WINDOW, POPSTATE_TRIGGER } from '../constants';
12
13
  import { AjaxNode } from './ajax-node';
13
14
  import { InitialPageLoadInteraction } from './initial-page-load-interaction';
14
15
  import { Interaction } from './interaction';
16
+ import { EVENT_TYPES } from '../../../common/constants/events';
15
17
  export class Aggregate extends AggregateBase {
16
18
  static featureName = FEATURE_NAME;
17
19
  constructor(agentRef, {
@@ -19,6 +21,10 @@ export class Aggregate extends AggregateBase {
19
21
  }) {
20
22
  super(agentRef, FEATURE_NAME);
21
23
  super.customAttributesAreSeparate = true;
24
+
25
+ // Create obfuscators for browser interactions and nested AJAX requests
26
+ this.interactionObfuscator = new Obfuscator(agentRef, EVENT_TYPES.BI);
27
+ this.ajaxObfuscator = new Obfuscator(agentRef, EVENT_TYPES.AJAX);
22
28
  this.interactionsToHarvest = this.events;
23
29
  this.domObserver = domObserver;
24
30
  this.initialPageLoadInteraction = new InitialPageLoadInteraction(agentRef);
@@ -82,7 +88,7 @@ export class Aggregate extends AggregateBase {
82
88
  let firstIxnStartTime;
83
89
  const serializedIxnList = [];
84
90
  for (const interaction of eventBuffer) {
85
- serializedIxnList.push(interaction.serialize(firstIxnStartTime, this.agentRef));
91
+ serializedIxnList.push(interaction.serialize(firstIxnStartTime, this.agentRef, this.interactionObfuscator, this.ajaxObfuscator));
86
92
  if (firstIxnStartTime === undefined) firstIxnStartTime = Math.floor(interaction.start); // careful not to match or overwrite on 0 value!
87
93
  }
88
94
  return "bel.7;".concat(serializedIxnList.join(';'));
@@ -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 { navTimingValues } from '../../../common/timing/nav-timing';
@@ -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 { globalScope, initialLocation } from '../../../common/constants/runtime';
@@ -121,11 +121,13 @@ export class Interaction extends BelNode {
121
121
  * Serializes (BEL) the interaction data for transmission.
122
122
  * @param {Number} firstStartTimeOfPayload timestamp
123
123
  * @param {Agent} agentRef Pass in the agent reference directly so that the event itself doesnt need to store the pointers and ruin the evaluation of the event size by including unused object references.
124
+ * @param {Obfuscator} interactionObfuscator Obfuscator for BrowserInteraction event type
125
+ * @param {Obfuscator} ajaxObfuscator Obfuscator for AjaxRequest event type (passed to child AjaxNodes)
124
126
  * @returns {String} A string that is the serialized representation of this interaction.
125
127
  */
126
- serialize(firstStartTimeOfPayload, agentRef) {
128
+ serialize(firstStartTimeOfPayload, agentRef, interactionObfuscator, ajaxObfuscator) {
127
129
  const isFirstIxnOfPayload = firstStartTimeOfPayload === undefined;
128
- const addString = getAddStringContext(agentRef.runtime.obfuscator);
130
+ const addString = getAddStringContext(interactionObfuscator);
129
131
  const nodeList = [];
130
132
  let ixnType;
131
133
  if (this.trigger === IPL_TRIGGER_NAME) ixnType = INTERACTION_TYPE.INITIAL_PAGE_LOAD;else if (this.newURL !== this.oldURL) ixnType = INTERACTION_TYPE.ROUTE_CHANGE;else ixnType = INTERACTION_TYPE.UNSPECIFIED;
@@ -151,7 +153,7 @@ export class Interaction extends BelNode {
151
153
  /* Querypack encoder+decoder quirkiness:
152
154
  - If first ixn node of payload is being processed, its children's start time must be offset by this node's start. (firstStartTime should be undefined.)
153
155
  - Else for subsequent ixns in the same payload, we go back to using that first ixn node's start to offset their children's start. */
154
- this.children.forEach(node => allAttachedNodes.push(node.serialize(isFirstIxnOfPayload ? this.start : firstStartTimeOfPayload, agentRef))); // recursively add the serialized string of every child of this (ixn) bel node
156
+ this.children.forEach(node => allAttachedNodes.push(node.serialize(isFirstIxnOfPayload ? this.start : firstStartTimeOfPayload, agentRef, ajaxObfuscator))); // recursively add the serialized string of every child of this (ixn) bel node
155
157
 
156
158
  fields[1] = numeric(allAttachedNodes.length);
157
159
  nodeList.push(fields);
@@ -4,7 +4,6 @@
4
4
  */
5
5
  import { FeatureBase } from './feature-base';
6
6
  import { drain } from '../../common/drain/drain';
7
- import { Obfuscator } from '../../common/util/obfuscate';
8
7
  import { FEATURE_NAMES } from '../../loaders/features/features';
9
8
  import { Harvester } from '../../common/harvest/harvester';
10
9
  import { EventBuffer } from './event-buffer';
@@ -176,8 +175,8 @@ export class AggregateBase extends FeatureBase {
176
175
  * This method should run after checkConfiguration, which may reset the agent's info/runtime object that is used here.
177
176
  */
178
177
  doOnceForAllAggregate(agentRef) {
179
- if (!agentRef.runtime.obfuscator) agentRef.runtime.obfuscator = new Obfuscator(agentRef);
180
- this.obfuscator = agentRef.runtime.obfuscator;
178
+ // Note: obfuscator is now created per-feature for their specific event types
179
+
181
180
  if (!agentRef.runtime.harvester) agentRef.runtime.harvester = new Harvester(agentRef);
182
181
  }
183
182
 
@@ -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/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/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/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"}
@@ -18,6 +18,10 @@ export type Init = {
18
18
  * - If true, the agent will automatically start the ajax feature. Otherwise, it will be in a deferred state until the `start` API method is called.
19
19
  */
20
20
  autoStart?: boolean | undefined;
21
+ /**
22
+ * - Controls when AJAX request/response payloads are captured. 'none' = never capture, 'failures' = capture only on errors (4xx, 5xx, network errors, GraphQL errors), 'all' = always capture.
23
+ */
24
+ capture_payloads?: "none" | "failures" | "all" | undefined;
21
25
  } | undefined;
22
26
  api?: {
23
27
  register?: {