@newrelic/browser-agent 1.292.1-rc.1 → 1.292.1-rc.3

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.DIST_METHOD = exports.BUILD_EN
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.292.1-rc.1";
20
+ const VERSION = exports.VERSION = "1.292.1-rc.3";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.DIST_METHOD = exports.BUILD_EN
17
17
  /**
18
18
  * Exposes the version of the agent
19
19
  */
20
- const VERSION = exports.VERSION = "1.292.1-rc.1";
20
+ const VERSION = exports.VERSION = "1.292.1-rc.3";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -81,7 +81,7 @@ class DT {
81
81
  // return true if DT is enabled and the origin is allowed, either by being
82
82
  // same-origin, or included in the allowed list
83
83
  shouldGenerateTrace(parsedOrigin) {
84
- return this.agentRef.init?.distributed_tracing && this.isAllowedOrigin(parsedOrigin);
84
+ return this.agentRef.init?.distributed_tracing?.enabled && this.isAllowedOrigin(parsedOrigin);
85
85
  }
86
86
  isAllowedOrigin(parsedOrigin) {
87
87
  var allowed = false;
@@ -167,9 +167,17 @@ class Aggregate extends _aggregateBase.AggregateBase {
167
167
  return;
168
168
  }
169
169
  try {
170
+ const wasReady = this.agentRef.runtime.timeKeeper.ready;
171
+
170
172
  // will do nothing if already done
171
173
  this.agentRef.runtime.timeKeeper.processRumRequest(xhr, this.rumStartTime, rumEndTime, app.nrServerTime);
172
174
  if (!this.agentRef.runtime.timeKeeper.ready) throw new Error('TimeKeeper not ready');
175
+
176
+ // If timeKeeper's origin time is ahead of nrServerTime, then the timestamp is invalid. Report a supportability metric.
177
+ const timeDiff = this.agentRef.runtime.timeKeeper.correctedOriginTime - app.nrServerTime;
178
+ if (wasReady && timeDiff > 0) {
179
+ this.reportSupportabilityMetric('Generic/TimeKeeper/InvalidTimestamp/Seen', timeDiff);
180
+ }
173
181
  } catch (error) {
174
182
  this.ee.abort();
175
183
  (0, _console.warn)(17, error);
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.292.1-rc.1";
14
+ export const VERSION = "1.292.1-rc.3";
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.292.1-rc.1";
14
+ export const VERSION = "1.292.1-rc.3";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -74,7 +74,7 @@ export class DT {
74
74
  // return true if DT is enabled and the origin is allowed, either by being
75
75
  // same-origin, or included in the allowed list
76
76
  shouldGenerateTrace(parsedOrigin) {
77
- return this.agentRef.init?.distributed_tracing && this.isAllowedOrigin(parsedOrigin);
77
+ return this.agentRef.init?.distributed_tracing?.enabled && this.isAllowedOrigin(parsedOrigin);
78
78
  }
79
79
  isAllowedOrigin(parsedOrigin) {
80
80
  var allowed = false;
@@ -158,9 +158,17 @@ export class Aggregate extends AggregateBase {
158
158
  return;
159
159
  }
160
160
  try {
161
+ const wasReady = this.agentRef.runtime.timeKeeper.ready;
162
+
161
163
  // will do nothing if already done
162
164
  this.agentRef.runtime.timeKeeper.processRumRequest(xhr, this.rumStartTime, rumEndTime, app.nrServerTime);
163
165
  if (!this.agentRef.runtime.timeKeeper.ready) throw new Error('TimeKeeper not ready');
166
+
167
+ // If timeKeeper's origin time is ahead of nrServerTime, then the timestamp is invalid. Report a supportability metric.
168
+ const timeDiff = this.agentRef.runtime.timeKeeper.correctedOriginTime - app.nrServerTime;
169
+ if (wasReady && timeDiff > 0) {
170
+ this.reportSupportabilityMetric('Generic/TimeKeeper/InvalidTimestamp/Seen', timeDiff);
171
+ }
164
172
  } catch (error) {
165
173
  this.ee.abort();
166
174
  warn(17, error);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/index.js"],"names":[],"mappings":"AAsBA;IACE,2BAA2C;IAC3C,2BA8BC;IA3BC,wBAAwB;IACxB,8BAA8B;IAC9B,8BAA8B;IA2BhC;;;;;OAKG;IACH,2BAHW,GAAC,WACD,GAAC,QAsEX;IAVC,iCAAyB;IAY3B;;;;;aAqCC;IAED,qDAaC;CACF;8BA7K6B,4BAA4B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/index.js"],"names":[],"mappings":"AAsBA;IACE,2BAA2C;IAC3C,2BA8BC;IA3BC,wBAAwB;IACxB,8BAA8B;IAC9B,8BAA8B;IA2BhC;;;;;OAKG;IACH,2BAHW,GAAC,WACD,GAAC,QAsEX;IAVC,iCAAyB;IAY3B;;;;;aA6CC;IAED,qDAaC;CACF;8BArL6B,4BAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.292.1-rc.1",
3
+ "version": "1.292.1-rc.3",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -94,7 +94,7 @@ export class DT {
94
94
  // return true if DT is enabled and the origin is allowed, either by being
95
95
  // same-origin, or included in the allowed list
96
96
  shouldGenerateTrace (parsedOrigin) {
97
- return this.agentRef.init?.distributed_tracing && this.isAllowedOrigin(parsedOrigin)
97
+ return this.agentRef.init?.distributed_tracing?.enabled && this.isAllowedOrigin(parsedOrigin)
98
98
  }
99
99
 
100
100
  isAllowedOrigin (parsedOrigin) {
@@ -152,9 +152,17 @@ export class Aggregate extends AggregateBase {
152
152
  }
153
153
 
154
154
  try {
155
+ const wasReady = this.agentRef.runtime.timeKeeper.ready
156
+
155
157
  // will do nothing if already done
156
158
  this.agentRef.runtime.timeKeeper.processRumRequest(xhr, this.rumStartTime, rumEndTime, app.nrServerTime)
157
159
  if (!this.agentRef.runtime.timeKeeper.ready) throw new Error('TimeKeeper not ready')
160
+
161
+ // If timeKeeper's origin time is ahead of nrServerTime, then the timestamp is invalid. Report a supportability metric.
162
+ const timeDiff = this.agentRef.runtime.timeKeeper.correctedOriginTime - app.nrServerTime
163
+ if (wasReady && timeDiff > 0) {
164
+ this.reportSupportabilityMetric('Generic/TimeKeeper/InvalidTimestamp/Seen', timeDiff)
165
+ }
158
166
  } catch (error) {
159
167
  this.ee.abort()
160
168
  warn(17, error)