@newrelic/browser-agent 1.313.1-rc.5 → 1.313.1-rc.7

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.
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.313.1-rc.5";
20
+ const VERSION = exports.VERSION = "1.313.1-rc.7";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.313.1-rc.5";
20
+ const VERSION = exports.VERSION = "1.313.1-rc.7";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -15,6 +15,7 @@ var _gql = require("./gql");
15
15
  var _belSerializer = require("../../../common/serialize/bel-serializer");
16
16
  var _nreum = require("../../../common/window/nreum");
17
17
  var _utils = require("../../../common/v2/utils");
18
+ var _uniqueId = require("../../../common/ids/unique-id");
18
19
  /**
19
20
  * Copyright 2020-2026 New Relic, Inc. All rights reserved.
20
21
  * SPDX-License-Identifier: Apache-2.0
@@ -87,7 +88,8 @@ class Aggregate extends _aggregateBase.AggregateBase {
87
88
  type,
88
89
  startTime,
89
90
  endTime,
90
- callbackDuration: metrics.cbTime
91
+ callbackDuration: metrics.cbTime,
92
+ [_constants.AJAX_ID]: (0, _uniqueId.generateUuid)() // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
91
93
  };
92
94
  if (ctx.dt) {
93
95
  event.spanId = ctx.dt.spanId;
@@ -157,7 +159,9 @@ class Aggregate extends _aggregateBase.AggregateBase {
157
159
  const attrParts = (0, _belSerializer.addCustomAttributes)({
158
160
  ...(jsAttributes || {}),
159
161
  ...(event.gql || {}),
160
- ...(event.targetAttributes || {}) // used to supply the version 2 attributes, either MFE target or duplication attributes for the main agent app
162
+ ...(event.targetAttributes || {}),
163
+ // used to supply the version 2 attributes, either MFE target or duplication attributes for the main agent app
164
+ [_constants.AJAX_ID]: event[_constants.AJAX_ID] // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
161
165
  }, addString);
162
166
  fields.unshift((0, _belSerializer.numeric)(attrParts.length));
163
167
  insert += fields.join(',');
@@ -3,11 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.FEATURE_NAME = void 0;
6
+ exports.FEATURE_NAME = exports.AJAX_ID = void 0;
7
7
  var _features = require("../../loaders/features/features");
8
8
  /**
9
- * Copyright 2020-2025 New Relic, Inc. All rights reserved.
9
+ * Copyright 2020-2026 New Relic, Inc. All rights reserved.
10
10
  * SPDX-License-Identifier: Apache-2.0
11
11
  */
12
12
 
13
- const FEATURE_NAME = exports.FEATURE_NAME = _features.FEATURE_NAMES.ajax;
13
+ const FEATURE_NAME = exports.FEATURE_NAME = _features.FEATURE_NAMES.ajax;
14
+ const AJAX_ID = exports.AJAX_ID = 'ajaxRequest.id';
@@ -338,7 +338,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
338
338
  ...eventAttributes,
339
339
  ...(0, _utils.getVersion2Attributes)(target, this)
340
340
  });
341
- if ((0, _utils.shouldDuplicate)(target, this.agentRef)) this.addEvent({
341
+ if ((0, _utils.shouldDuplicate)(target, this)) this.addEvent({
342
342
  ...eventAttributes,
343
343
  ...(0, _utils.getVersion2DuplicationAttributes)(target, this)
344
344
  });
@@ -5,7 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.AjaxNode = void 0;
7
7
  var _belSerializer = require("../../../common/serialize/bel-serializer");
8
- var _constants = require("../constants");
8
+ var _constants = require("../../ajax/constants");
9
+ var _constants2 = require("../constants");
9
10
  var _belNode = require("./bel-node");
10
11
  /**
11
12
  * Copyright 2020-2026 New Relic, Inc. All rights reserved.
@@ -15,7 +16,7 @@ var _belNode = require("./bel-node");
15
16
  class AjaxNode extends _belNode.BelNode {
16
17
  constructor(ajaxEvent, ajaxContext) {
17
18
  super();
18
- this.belType = _constants.NODE_TYPE.AJAX;
19
+ this.belType = _constants2.NODE_TYPE.AJAX;
19
20
  this.method = ajaxEvent.method;
20
21
  this.status = ajaxEvent.status;
21
22
  this.domain = ajaxEvent.domain;
@@ -28,6 +29,8 @@ class AjaxNode extends _belNode.BelNode {
28
29
  this.spanTimestamp = ajaxEvent.spanTimestamp;
29
30
  this.gql = ajaxEvent.gql;
30
31
  this.targetAttributes = ajaxEvent.targetAttributes;
32
+ this[_constants.AJAX_ID] = ajaxEvent[_constants.AJAX_ID]; // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
33
+
31
34
  this.start = ajaxEvent.startTime;
32
35
  this.end = ajaxEvent.endTime;
33
36
  if (ajaxContext?.latestLongtaskEnd) {
@@ -53,7 +56,8 @@ class AjaxNode extends _belNode.BelNode {
53
56
  addString(this.method), (0, _belSerializer.numeric)(this.status), addString(this.domain), addString(this.path), (0, _belSerializer.numeric)(this.txSize), (0, _belSerializer.numeric)(this.rxSize), this.requestedWith, addString(this.nodeId), (0, _belSerializer.nullable)(this.spanId, addString, true) + (0, _belSerializer.nullable)(this.traceId, addString, true) + (0, _belSerializer.nullable)(this.spanTimestamp, _belSerializer.numeric)];
54
57
  let allAttachedNodes = (0, _belSerializer.addCustomAttributes)({
55
58
  ...(this.gql || {}),
56
- ...(this.targetAttributes || {})
59
+ ...(this.targetAttributes || {}),
60
+ [_constants.AJAX_ID]: this[_constants.AJAX_ID]
57
61
  }, addString);
58
62
  this.children.forEach(node => allAttachedNodes.push(node.serialize())); // no children is expected under ajax nodes at this time
59
63
 
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.313.1-rc.5";
14
+ export const VERSION = "1.313.1-rc.7";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.313.1-rc.5";
14
+ export const VERSION = "1.313.1-rc.7";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -6,13 +6,14 @@ import { registerHandler } from '../../../common/event-emitter/register-handler'
6
6
  import { stringify } from '../../../common/util/stringify';
7
7
  import { handle } from '../../../common/event-emitter/handle';
8
8
  import { setDenyList, shouldCollectEvent } from '../../../common/deny-list/deny-list';
9
- import { FEATURE_NAME } from '../constants';
9
+ import { AJAX_ID, FEATURE_NAME } from '../constants';
10
10
  import { FEATURE_NAMES } from '../../../loaders/features/features';
11
11
  import { AggregateBase } from '../../utils/aggregate-base';
12
12
  import { parseGQL } from './gql';
13
13
  import { nullable, numeric, getAddStringContext, addCustomAttributes } from '../../../common/serialize/bel-serializer';
14
14
  import { gosNREUMOriginals } from '../../../common/window/nreum';
15
15
  import { getVersion2Attributes, getVersion2DuplicationAttributes, shouldDuplicate } from '../../../common/v2/utils';
16
+ import { generateUuid } from '../../../common/ids/unique-id';
16
17
  export class Aggregate extends AggregateBase {
17
18
  static featureName = FEATURE_NAME;
18
19
  constructor(agentRef) {
@@ -80,7 +81,8 @@ export class Aggregate extends AggregateBase {
80
81
  type,
81
82
  startTime,
82
83
  endTime,
83
- callbackDuration: metrics.cbTime
84
+ callbackDuration: metrics.cbTime,
85
+ [AJAX_ID]: generateUuid() // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
84
86
  };
85
87
  if (ctx.dt) {
86
88
  event.spanId = ctx.dt.spanId;
@@ -150,7 +152,9 @@ export class Aggregate extends AggregateBase {
150
152
  const attrParts = addCustomAttributes({
151
153
  ...(jsAttributes || {}),
152
154
  ...(event.gql || {}),
153
- ...(event.targetAttributes || {}) // used to supply the version 2 attributes, either MFE target or duplication attributes for the main agent app
155
+ ...(event.targetAttributes || {}),
156
+ // used to supply the version 2 attributes, either MFE target or duplication attributes for the main agent app
157
+ [AJAX_ID]: event[AJAX_ID] // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
154
158
  }, addString);
155
159
  fields.unshift(numeric(attrParts.length));
156
160
  insert += fields.join(',');
@@ -1,6 +1,7 @@
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';
6
- export const FEATURE_NAME = FEATURE_NAMES.ajax;
6
+ export const FEATURE_NAME = FEATURE_NAMES.ajax;
7
+ export const AJAX_ID = 'ajaxRequest.id';
@@ -331,7 +331,7 @@ export class Aggregate extends AggregateBase {
331
331
  ...eventAttributes,
332
332
  ...getVersion2Attributes(target, this)
333
333
  });
334
- if (shouldDuplicate(target, this.agentRef)) this.addEvent({
334
+ if (shouldDuplicate(target, this)) this.addEvent({
335
335
  ...eventAttributes,
336
336
  ...getVersion2DuplicationAttributes(target, this)
337
337
  });
@@ -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 { AJAX_ID } from '../../ajax/constants';
6
7
  import { NODE_TYPE } from '../constants';
7
8
  import { BelNode } from './bel-node';
8
9
  export class AjaxNode extends BelNode {
@@ -21,6 +22,8 @@ export class AjaxNode extends BelNode {
21
22
  this.spanTimestamp = ajaxEvent.spanTimestamp;
22
23
  this.gql = ajaxEvent.gql;
23
24
  this.targetAttributes = ajaxEvent.targetAttributes;
25
+ 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
+
24
27
  this.start = ajaxEvent.startTime;
25
28
  this.end = ajaxEvent.endTime;
26
29
  if (ajaxContext?.latestLongtaskEnd) {
@@ -46,7 +49,8 @@ export class AjaxNode extends BelNode {
46
49
  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)];
47
50
  let allAttachedNodes = addCustomAttributes({
48
51
  ...(this.gql || {}),
49
- ...(this.targetAttributes || {})
52
+ ...(this.targetAttributes || {}),
53
+ [AJAX_ID]: this[AJAX_ID]
50
54
  }, addString);
51
55
  this.children.forEach(node => allAttachedNodes.push(node.serialize())); // no children is expected under ajax nodes at this time
52
56
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAgBA;IACE,2BAAiC;IAEjC,2BA0BC;IAED,0GAuEC;IAED,+CAOC;IAED,iDAwDC;CACF;8BAhL6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;IAEjC,2BA0BC;IAED,0GAwEC;IAED,+CAOC;IAED,iDAyDC;CACF;8BAnL6B,4BAA4B"}
@@ -1,2 +1,3 @@
1
1
  export const FEATURE_NAME: string;
2
+ export const AJAX_ID: "ajaxRequest.id";
2
3
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/ajax/constants.js"],"names":[],"mappings":"AAMA,kCAA8C"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/ajax/constants.js"],"names":[],"mappings":"AAMA,kCAA8C;AAE9C,sBAAuB,gBAAgB,CAAA"}
@@ -15,6 +15,7 @@ export class AjaxNode extends BelNode {
15
15
  targetAttributes: any;
16
16
  callbackEnd: any;
17
17
  serialize(parentStartTimestamp: any, agentRef: any): string;
18
+ "ajaxRequest.id": any;
18
19
  }
19
20
  import { BelNode } from './bel-node';
20
21
  //# sourceMappingURL=ajax-node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ajax-node.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/ajax-node.js"],"names":[],"mappings":"AAQA;IACE,8CAsBC;IApBC,gBAA6B;IAC7B,YAA8B;IAC9B,YAA8B;IAC9B,YAA8B;IAC9B,UAA0B;IAC1B,YAAmC;IACnC,YAAoC;IACpC,+BAAwD;IACxD,YAA8B;IAC9B,aAAgC;IAChC,mBAA4C;IAC5C,SAAwB;IACxB,sBAAkD;IAKhD,iBAAoE;IAKxE,4DAiCC;CACF;wBA7DuB,YAAY"}
1
+ {"version":3,"file":"ajax-node.d.ts","sourceRoot":"","sources":["../../../../../src/features/soft_navigations/aggregate/ajax-node.js"],"names":[],"mappings":"AASA;IACE,8CAuBC;IArBC,gBAA6B;IAC7B,YAA8B;IAC9B,YAA8B;IAC9B,YAA8B;IAC9B,UAA0B;IAC1B,YAAmC;IACnC,YAAoC;IACpC,+BAAwD;IACxD,YAA8B;IAC9B,aAAgC;IAChC,mBAA4C;IAC5C,SAAwB;IACxB,sBAAkD;IAMhD,iBAAoE;IAKxE,4DAkCC;IA5CC,sBAAkC;CA6CrC;wBA/DuB,YAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.313.1-rc.5",
3
+ "version": "1.313.1-rc.7",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -6,13 +6,14 @@ import { registerHandler } from '../../../common/event-emitter/register-handler'
6
6
  import { stringify } from '../../../common/util/stringify'
7
7
  import { handle } from '../../../common/event-emitter/handle'
8
8
  import { setDenyList, shouldCollectEvent } from '../../../common/deny-list/deny-list'
9
- import { FEATURE_NAME } from '../constants'
9
+ import { AJAX_ID, FEATURE_NAME } from '../constants'
10
10
  import { FEATURE_NAMES } from '../../../loaders/features/features'
11
11
  import { AggregateBase } from '../../utils/aggregate-base'
12
12
  import { parseGQL } from './gql'
13
13
  import { nullable, numeric, getAddStringContext, addCustomAttributes } from '../../../common/serialize/bel-serializer'
14
14
  import { gosNREUMOriginals } from '../../../common/window/nreum'
15
15
  import { getVersion2Attributes, getVersion2DuplicationAttributes, shouldDuplicate } from '../../../common/v2/utils'
16
+ import { generateUuid } from '../../../common/ids/unique-id'
16
17
 
17
18
  export class Aggregate extends AggregateBase {
18
19
  static featureName = FEATURE_NAME
@@ -91,7 +92,8 @@ export class Aggregate extends AggregateBase {
91
92
  type,
92
93
  startTime,
93
94
  endTime,
94
- callbackDuration: metrics.cbTime
95
+ callbackDuration: metrics.cbTime,
96
+ [AJAX_ID]: generateUuid() // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
95
97
  }
96
98
 
97
99
  if (ctx.dt) {
@@ -168,7 +170,8 @@ export class Aggregate extends AggregateBase {
168
170
  const attrParts = addCustomAttributes({
169
171
  ...(jsAttributes || {}),
170
172
  ...(event.gql || {}),
171
- ...(event.targetAttributes || {}) // used to supply the version 2 attributes, either MFE target or duplication attributes for the main agent app
173
+ ...(event.targetAttributes || {}), // used to supply the version 2 attributes, either MFE target or duplication attributes for the main agent app
174
+ [AJAX_ID]: event[AJAX_ID] // all AjaxRequest events should have a unique identifier to allow for easier grouping and analysis in the UI
172
175
  }, addString)
173
176
 
174
177
  fields.unshift(numeric(attrParts.length))
@@ -1,7 +1,9 @@
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'
6
6
 
7
7
  export const FEATURE_NAME = FEATURE_NAMES.ajax
8
+
9
+ export const AJAX_ID = 'ajaxRequest.id'
@@ -331,7 +331,7 @@ export class Aggregate extends AggregateBase {
331
331
  }
332
332
 
333
333
  this.events.add({ ...eventAttributes, ...getVersion2Attributes(target, this) })
334
- if (shouldDuplicate(target, this.agentRef)) this.addEvent({ ...eventAttributes, ...getVersion2DuplicationAttributes(target, this) })
334
+ if (shouldDuplicate(target, this)) this.addEvent({ ...eventAttributes, ...getVersion2DuplicationAttributes(target, this) })
335
335
  }
336
336
 
337
337
  serializer (eventBuffer) {
@@ -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 { AJAX_ID } from '../../ajax/constants'
6
7
  import { NODE_TYPE } from '../constants'
7
8
  import { BelNode } from './bel-node'
8
9
 
@@ -22,6 +23,7 @@ export class AjaxNode extends BelNode {
22
23
  this.spanTimestamp = ajaxEvent.spanTimestamp
23
24
  this.gql = ajaxEvent.gql
24
25
  this.targetAttributes = ajaxEvent.targetAttributes
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
25
27
 
26
28
  this.start = ajaxEvent.startTime
27
29
  this.end = ajaxEvent.endTime
@@ -55,7 +57,8 @@ export class AjaxNode extends BelNode {
55
57
  ]
56
58
  let allAttachedNodes = addCustomAttributes({
57
59
  ...(this.gql || {}),
58
- ...(this.targetAttributes || {})
60
+ ...(this.targetAttributes || {}),
61
+ [AJAX_ID]: this[AJAX_ID]
59
62
  }, addString)
60
63
  this.children.forEach(node => allAttachedNodes.push(node.serialize())) // no children is expected under ajax nodes at this time
61
64