@newrelic/browser-agent 1.292.1-rc.4 → 1.292.1
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.
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/wrap/wrap-function.js +4 -19
- package/dist/cjs/features/ajax/instrument/distributed-tracing.js +1 -1
- package/dist/cjs/features/page_view_event/aggregate/index.js +0 -8
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/wrap/wrap-function.js +4 -19
- package/dist/esm/features/ajax/instrument/distributed-tracing.js +1 -1
- package/dist/esm/features/page_view_event/aggregate/index.js +0 -8
- package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/common/wrap/wrap-function.js +4 -19
- package/src/features/ajax/instrument/distributed-tracing.js +1 -1
- package/src/features/page_view_event/aggregate/index.js +0 -8
|
@@ -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
|
|
20
|
+
const VERSION = exports.VERSION = "1.292.1";
|
|
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
|
|
20
|
+
const VERSION = exports.VERSION = "1.292.1";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -78,7 +78,6 @@ function createWrapperWithEmitter(emitter, always) {
|
|
|
78
78
|
var originalThis;
|
|
79
79
|
var ctx;
|
|
80
80
|
var result;
|
|
81
|
-
let thrownError;
|
|
82
81
|
try {
|
|
83
82
|
originalThis = this;
|
|
84
83
|
args = [...arguments];
|
|
@@ -93,31 +92,17 @@ function createWrapperWithEmitter(emitter, always) {
|
|
|
93
92
|
|
|
94
93
|
// Warning: start events may mutate args!
|
|
95
94
|
safeEmit(prefix + 'start', [args, originalThis, methodName], ctx, bubble);
|
|
96
|
-
const fnStartTime = performance.now();
|
|
97
|
-
let fnEndTime = fnStartTime;
|
|
98
95
|
try {
|
|
99
96
|
result = fn.apply(originalThis, args);
|
|
100
|
-
fnEndTime = performance.now();
|
|
101
97
|
return result;
|
|
102
98
|
} catch (err) {
|
|
103
|
-
fnEndTime = performance.now();
|
|
104
99
|
safeEmit(prefix + 'err', [args, originalThis, err], ctx, bubble);
|
|
100
|
+
|
|
105
101
|
// rethrow error so we don't effect execution by observing.
|
|
106
|
-
|
|
107
|
-
throw thrownError;
|
|
102
|
+
throw err;
|
|
108
103
|
} finally {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
duration,
|
|
112
|
-
isLongTask: duration >= 50,
|
|
113
|
-
methodName,
|
|
114
|
-
thrownError
|
|
115
|
-
// could add more properties here later if needed by downstream features
|
|
116
|
-
};
|
|
117
|
-
// standalone long task message
|
|
118
|
-
if (task.isLongTask) safeEmit('long-task', [task], ctx, bubble);
|
|
119
|
-
// -end message also includes the task execution info
|
|
120
|
-
safeEmit(prefix + 'end', [args, originalThis, result, task], ctx, bubble);
|
|
104
|
+
// happens no matter what.
|
|
105
|
+
safeEmit(prefix + 'end', [args, originalThis, result], ctx, bubble);
|
|
121
106
|
}
|
|
122
107
|
}
|
|
123
108
|
}
|
|
@@ -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
|
|
84
|
+
return this.agentRef.init?.distributed_tracing && this.isAllowedOrigin(parsedOrigin);
|
|
85
85
|
}
|
|
86
86
|
isAllowedOrigin(parsedOrigin) {
|
|
87
87
|
var allowed = false;
|
|
@@ -167,17 +167,9 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
try {
|
|
170
|
-
const wasReady = this.agentRef.runtime.timeKeeper.ready;
|
|
171
|
-
|
|
172
170
|
// will do nothing if already done
|
|
173
171
|
this.agentRef.runtime.timeKeeper.processRumRequest(xhr, this.rumStartTime, rumEndTime, app.nrServerTime);
|
|
174
172
|
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
|
-
}
|
|
181
173
|
} catch (error) {
|
|
182
174
|
this.ee.abort();
|
|
183
175
|
(0, _console.warn)(17, error);
|
|
@@ -71,7 +71,6 @@ export function createWrapperWithEmitter(emitter, always) {
|
|
|
71
71
|
var originalThis;
|
|
72
72
|
var ctx;
|
|
73
73
|
var result;
|
|
74
|
-
let thrownError;
|
|
75
74
|
try {
|
|
76
75
|
originalThis = this;
|
|
77
76
|
args = [...arguments];
|
|
@@ -86,31 +85,17 @@ export function createWrapperWithEmitter(emitter, always) {
|
|
|
86
85
|
|
|
87
86
|
// Warning: start events may mutate args!
|
|
88
87
|
safeEmit(prefix + 'start', [args, originalThis, methodName], ctx, bubble);
|
|
89
|
-
const fnStartTime = performance.now();
|
|
90
|
-
let fnEndTime = fnStartTime;
|
|
91
88
|
try {
|
|
92
89
|
result = fn.apply(originalThis, args);
|
|
93
|
-
fnEndTime = performance.now();
|
|
94
90
|
return result;
|
|
95
91
|
} catch (err) {
|
|
96
|
-
fnEndTime = performance.now();
|
|
97
92
|
safeEmit(prefix + 'err', [args, originalThis, err], ctx, bubble);
|
|
93
|
+
|
|
98
94
|
// rethrow error so we don't effect execution by observing.
|
|
99
|
-
|
|
100
|
-
throw thrownError;
|
|
95
|
+
throw err;
|
|
101
96
|
} finally {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
duration,
|
|
105
|
-
isLongTask: duration >= 50,
|
|
106
|
-
methodName,
|
|
107
|
-
thrownError
|
|
108
|
-
// could add more properties here later if needed by downstream features
|
|
109
|
-
};
|
|
110
|
-
// standalone long task message
|
|
111
|
-
if (task.isLongTask) safeEmit('long-task', [task], ctx, bubble);
|
|
112
|
-
// -end message also includes the task execution info
|
|
113
|
-
safeEmit(prefix + 'end', [args, originalThis, result, task], ctx, bubble);
|
|
97
|
+
// happens no matter what.
|
|
98
|
+
safeEmit(prefix + 'end', [args, originalThis, result], ctx, bubble);
|
|
114
99
|
}
|
|
115
100
|
}
|
|
116
101
|
}
|
|
@@ -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
|
|
77
|
+
return this.agentRef.init?.distributed_tracing && this.isAllowedOrigin(parsedOrigin);
|
|
78
78
|
}
|
|
79
79
|
isAllowedOrigin(parsedOrigin) {
|
|
80
80
|
var allowed = false;
|
|
@@ -158,17 +158,9 @@ export class Aggregate extends AggregateBase {
|
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
try {
|
|
161
|
-
const wasReady = this.agentRef.runtime.timeKeeper.ready;
|
|
162
|
-
|
|
163
161
|
// will do nothing if already done
|
|
164
162
|
this.agentRef.runtime.timeKeeper.processRumRequest(xhr, this.rumStartTime, rumEndTime, app.nrServerTime);
|
|
165
163
|
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
|
-
}
|
|
172
164
|
} catch (error) {
|
|
173
165
|
this.ee.abort();
|
|
174
166
|
warn(17, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA6BA;;;;;GAKG;AACH,mDAJW,MAAM,UACN,OAAO,
|
|
1
|
+
{"version":3,"file":"wrap-function.d.ts","sourceRoot":"","sources":["../../../../src/common/wrap/wrap-function.js"],"names":[],"mappings":"AA6BA;;;;;GAKG;AACH,mDAJW,MAAM,UACN,OAAO,YAgIjB;AAgBD;;;;;;;;GAQG;AACH,2BANW,MAAM,MACN,MAAM,YACN,MAAM,GAEJ,MAAM,CA2BlB;AAtMD,0BAA6C"}
|
|
@@ -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;;;;;
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newrelic/browser-agent",
|
|
3
|
-
"version": "1.292.1
|
|
3
|
+
"version": "1.292.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
|
|
6
6
|
"description": "New Relic Browser Agent",
|
|
@@ -294,4 +294,4 @@
|
|
|
294
294
|
"README.md",
|
|
295
295
|
"CHANGELOG.md"
|
|
296
296
|
]
|
|
297
|
-
}
|
|
297
|
+
}
|
|
@@ -76,7 +76,6 @@ export function createWrapperWithEmitter (emitter, always) {
|
|
|
76
76
|
var originalThis
|
|
77
77
|
var ctx
|
|
78
78
|
var result
|
|
79
|
-
let thrownError
|
|
80
79
|
|
|
81
80
|
try {
|
|
82
81
|
originalThis = this
|
|
@@ -94,31 +93,17 @@ export function createWrapperWithEmitter (emitter, always) {
|
|
|
94
93
|
// Warning: start events may mutate args!
|
|
95
94
|
safeEmit(prefix + 'start', [args, originalThis, methodName], ctx, bubble)
|
|
96
95
|
|
|
97
|
-
const fnStartTime = performance.now()
|
|
98
|
-
let fnEndTime = fnStartTime
|
|
99
96
|
try {
|
|
100
97
|
result = fn.apply(originalThis, args)
|
|
101
|
-
fnEndTime = performance.now()
|
|
102
98
|
return result
|
|
103
99
|
} catch (err) {
|
|
104
|
-
fnEndTime = performance.now()
|
|
105
100
|
safeEmit(prefix + 'err', [args, originalThis, err], ctx, bubble)
|
|
101
|
+
|
|
106
102
|
// rethrow error so we don't effect execution by observing.
|
|
107
|
-
|
|
108
|
-
throw thrownError
|
|
103
|
+
throw err
|
|
109
104
|
} finally {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
duration,
|
|
113
|
-
isLongTask: duration >= 50,
|
|
114
|
-
methodName,
|
|
115
|
-
thrownError
|
|
116
|
-
// could add more properties here later if needed by downstream features
|
|
117
|
-
}
|
|
118
|
-
// standalone long task message
|
|
119
|
-
if (task.isLongTask) safeEmit('long-task', [task], ctx, bubble)
|
|
120
|
-
// -end message also includes the task execution info
|
|
121
|
-
safeEmit(prefix + 'end', [args, originalThis, result, task], ctx, bubble)
|
|
105
|
+
// happens no matter what.
|
|
106
|
+
safeEmit(prefix + 'end', [args, originalThis, result], ctx, bubble)
|
|
122
107
|
}
|
|
123
108
|
}
|
|
124
109
|
}
|
|
@@ -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
|
|
97
|
+
return this.agentRef.init?.distributed_tracing && this.isAllowedOrigin(parsedOrigin)
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
isAllowedOrigin (parsedOrigin) {
|
|
@@ -152,17 +152,9 @@ export class Aggregate extends AggregateBase {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
try {
|
|
155
|
-
const wasReady = this.agentRef.runtime.timeKeeper.ready
|
|
156
|
-
|
|
157
155
|
// will do nothing if already done
|
|
158
156
|
this.agentRef.runtime.timeKeeper.processRumRequest(xhr, this.rumStartTime, rumEndTime, app.nrServerTime)
|
|
159
157
|
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
|
-
}
|
|
166
158
|
} catch (error) {
|
|
167
159
|
this.ee.abort()
|
|
168
160
|
warn(17, error)
|