@newrelic/browser-agent 1.237.0 → 1.237.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/harvest/harvest.js +2 -3
- package/dist/cjs/features/metrics/aggregate/index.js +8 -0
- package/dist/cjs/features/spa/aggregate/index.js +1 -1
- package/dist/cjs/loaders/configure/configure.js +2 -1
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/harvest/harvest.js +2 -3
- package/dist/esm/features/metrics/aggregate/index.js +8 -0
- package/dist/esm/features/spa/aggregate/index.js +1 -1
- package/dist/esm/loaders/configure/configure.js +3 -2
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/harvest/harvest.js +2 -3
- package/src/features/metrics/aggregate/index.js +8 -0
- package/src/features/spa/aggregate/index.js +1 -1
- package/src/loaders/configure/configure.js +11 -2
|
@@ -258,9 +258,8 @@ class Harvest extends _sharedContext.SharedContext {
|
|
|
258
258
|
cleanPayload() {
|
|
259
259
|
let payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
260
260
|
const clean = input => {
|
|
261
|
-
if (typeof Uint8Array !== 'undefined' && input instanceof Uint8Array ||
|
|
262
|
-
|
|
263
|
-
}
|
|
261
|
+
if (typeof Uint8Array !== 'undefined' && input instanceof Uint8Array || Array.isArray(input)) return input;
|
|
262
|
+
if (typeof input === 'string') return input.length > 0 ? input : null;
|
|
264
263
|
return Object.entries(input || {}).reduce((accumulator, _ref2) => {
|
|
265
264
|
let [key, value] = _ref2;
|
|
266
265
|
if (typeof value === 'number' || typeof value === 'string' && value.length > 0 || typeof value === 'object' && Object.keys(value || {}).length > 0) {
|
|
@@ -154,6 +154,14 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
154
154
|
// Capture metrics for size of custom attributes
|
|
155
155
|
const jsAttributes = (0, _stringify.stringify)(info.jsAttributes);
|
|
156
156
|
this.storeSupportabilityMetrics('PageSession/Feature/CustomData/Bytes', jsAttributes === '{}' ? 0 : jsAttributes.length);
|
|
157
|
+
|
|
158
|
+
// Capture metrics for performance markers and measures
|
|
159
|
+
if (typeof performance !== 'undefined') {
|
|
160
|
+
const markers = performance.getEntriesByType('mark');
|
|
161
|
+
const measures = performance.getEntriesByType('measure');
|
|
162
|
+
this.storeSupportabilityMetrics('Generic/Performance/Mark/Seen', markers.length);
|
|
163
|
+
this.storeSupportabilityMetrics('Generic/Performance/Measure/Seen', measures.length);
|
|
164
|
+
}
|
|
157
165
|
} catch (e) {
|
|
158
166
|
// do nothing
|
|
159
167
|
}
|
|
@@ -407,7 +407,7 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
407
407
|
(0, _registerHandler.registerHandler)(FETCH_DONE, function (err, res) {
|
|
408
408
|
var node = this[SPA_NODE];
|
|
409
409
|
if (node) {
|
|
410
|
-
if (err) {
|
|
410
|
+
if (err || !(0, _denyList.shouldCollectEvent)(this.params)) {
|
|
411
411
|
node.cancel();
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
@@ -36,7 +36,8 @@ function configure(agentIdentifier) {
|
|
|
36
36
|
info.jsAttributes.isWorker = true;
|
|
37
37
|
}
|
|
38
38
|
(0, _config.setInfo)(agentIdentifier, info);
|
|
39
|
-
|
|
39
|
+
const updatedInit = (0, _config.getConfiguration)(agentIdentifier);
|
|
40
|
+
runtime.denyList = [...(updatedInit.ajax?.deny_list || []), ...(updatedInit.ajax?.block_internal ? [info.beacon, info.errorBeacon] : [])];
|
|
40
41
|
(0, _config.setRuntime)(agentIdentifier, runtime);
|
|
41
42
|
(0, _api.setTopLevelCallers)();
|
|
42
43
|
const api = (0, _api.setAPI)(agentIdentifier, forceDrain);
|
|
@@ -250,9 +250,8 @@ export class Harvest extends SharedContext {
|
|
|
250
250
|
cleanPayload() {
|
|
251
251
|
let payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
252
252
|
const clean = input => {
|
|
253
|
-
if (typeof Uint8Array !== 'undefined' && input instanceof Uint8Array ||
|
|
254
|
-
|
|
255
|
-
}
|
|
253
|
+
if (typeof Uint8Array !== 'undefined' && input instanceof Uint8Array || Array.isArray(input)) return input;
|
|
254
|
+
if (typeof input === 'string') return input.length > 0 ? input : null;
|
|
256
255
|
return Object.entries(input || {}).reduce((accumulator, _ref2) => {
|
|
257
256
|
let [key, value] = _ref2;
|
|
258
257
|
if (typeof value === 'number' || typeof value === 'string' && value.length > 0 || typeof value === 'object' && Object.keys(value || {}).length > 0) {
|
|
@@ -148,6 +148,14 @@ export class Aggregate extends AggregateBase {
|
|
|
148
148
|
// Capture metrics for size of custom attributes
|
|
149
149
|
const jsAttributes = stringify(info.jsAttributes);
|
|
150
150
|
this.storeSupportabilityMetrics('PageSession/Feature/CustomData/Bytes', jsAttributes === '{}' ? 0 : jsAttributes.length);
|
|
151
|
+
|
|
152
|
+
// Capture metrics for performance markers and measures
|
|
153
|
+
if (typeof performance !== 'undefined') {
|
|
154
|
+
const markers = performance.getEntriesByType('mark');
|
|
155
|
+
const measures = performance.getEntriesByType('measure');
|
|
156
|
+
this.storeSupportabilityMetrics('Generic/Performance/Mark/Seen', markers.length);
|
|
157
|
+
this.storeSupportabilityMetrics('Generic/Performance/Measure/Seen', measures.length);
|
|
158
|
+
}
|
|
151
159
|
} catch (e) {
|
|
152
160
|
// do nothing
|
|
153
161
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setAPI, setTopLevelCallers } from '../api/api';
|
|
2
2
|
import { addToNREUM, gosCDN, gosNREUMInitializedAgents } from '../../common/window/nreum';
|
|
3
|
-
import { setConfiguration, setInfo, setLoaderConfig, setRuntime } from '../../common/config/config';
|
|
3
|
+
import { getConfiguration, setConfiguration, setInfo, setLoaderConfig, setRuntime } from '../../common/config/config';
|
|
4
4
|
import { activatedFeatures } from '../../common/util/feature-flags';
|
|
5
5
|
import { isWorkerScope } from '../../common/constants/runtime';
|
|
6
6
|
export function configure(agentIdentifier) {
|
|
@@ -30,7 +30,8 @@ export function configure(agentIdentifier) {
|
|
|
30
30
|
info.jsAttributes.isWorker = true;
|
|
31
31
|
}
|
|
32
32
|
setInfo(agentIdentifier, info);
|
|
33
|
-
|
|
33
|
+
const updatedInit = getConfiguration(agentIdentifier);
|
|
34
|
+
runtime.denyList = [...(updatedInit.ajax?.deny_list || []), ...(updatedInit.ajax?.block_internal ? [info.beacon, info.errorBeacon] : [])];
|
|
34
35
|
setRuntime(agentIdentifier, runtime);
|
|
35
36
|
setTopLevelCallers();
|
|
36
37
|
const api = setAPI(agentIdentifier, forceDrain);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH;IAII,0BAA2H;IAC3H,uBAAoD;IACpD,kCAAsH;IAEtH,YAAiB;IAGnB;;;;;OAKG;IACH,aAFW,eAAe,WAUzB;IAED;;;OAGG;IACH,YAFW,eAAe,WAMzB;IAED;;;OAGG;IACH,wBAFW,eAAe,WAMzB;IAED;;;;;;OAMG;IACH,gGAJW,eAAe,GACb,OAAO,CAmFnB;IAGD,0BAmBC;IAED;;;;;;;OAOG;IACH,wBALW,yBAAyB,WACzB,6BAA6B,GAE3B,cAAc,CA2B1B;IAED;;;;;;;OAOG;IACH,uBAHW,cAAc,GACZ,cAAc,
|
|
1
|
+
{"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../../../src/common/harvest/harvest.js"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH;IAII,0BAA2H;IAC3H,uBAAoD;IACpD,kCAAsH;IAEtH,YAAiB;IAGnB;;;;;OAKG;IACH,aAFW,eAAe,WAUzB;IAED;;;OAGG;IACH,YAFW,eAAe,WAMzB;IAED;;;OAGG;IACH,wBAFW,eAAe,WAMzB;IAED;;;;;;OAMG;IACH,gGAJW,eAAe,GACb,OAAO,CAmFnB;IAGD,0BAmBC;IAED;;;;;;;OAOG;IACH,wBALW,yBAAyB,WACzB,6BAA6B,GAE3B,cAAc,CA2B1B;IAED;;;;;;;OAOG;IACH,uBAHW,cAAc,GACZ,cAAc,CAuB1B;IAED;;;;;OAKG;IACH,aAHW,yBAAyB,YACzB,sBAAsB,QAQhC;CACF;8BAnPY,OAAO,YAAY,EAAE,eAAe;wCACpC,OAAO,YAAY,EAAE,yBAAyB;6BAC9C,OAAO,YAAY,EAAE,cAAc;qCACnC,OAAO,YAAY,EAAE,sBAAsB;4CAC3C,OAAO,YAAY,EAAE,6BAA6B;8BAZjC,2BAA2B;2BAF9B,mBAAmB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;IACjC,mDAsBC;IAED,wDAKC;IAED,iDAKC;IAED,qBA+BC;IAED,0BAQC;IAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;IACjC,mDAsBC;IAED,wDAKC;IAED,iDAKC;IAED,qBA+BC;IAED,0BAQC;IAED,eA4DC;IApDG,mCAAyB;CAqD9B;8BApJ6B,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/configure.js"],"names":[],"mappings":"AAMA;;;;;;;;
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/configure.js"],"names":[],"mappings":"AAMA;;;;;;;;EAqCC"}
|
package/package.json
CHANGED
|
@@ -230,9 +230,8 @@ export class Harvest extends SharedContext {
|
|
|
230
230
|
*/
|
|
231
231
|
cleanPayload (payload = {}) {
|
|
232
232
|
const clean = (input) => {
|
|
233
|
-
if ((typeof Uint8Array !== 'undefined' && input instanceof Uint8Array) ||
|
|
234
|
-
|
|
235
|
-
}
|
|
233
|
+
if ((typeof Uint8Array !== 'undefined' && input instanceof Uint8Array) || Array.isArray(input)) return input
|
|
234
|
+
if (typeof input === 'string') return input.length > 0 ? input : null
|
|
236
235
|
return Object.entries(input || {})
|
|
237
236
|
.reduce((accumulator, [key, value]) => {
|
|
238
237
|
if ((typeof value === 'number') ||
|
|
@@ -147,6 +147,14 @@ export class Aggregate extends AggregateBase {
|
|
|
147
147
|
// Capture metrics for size of custom attributes
|
|
148
148
|
const jsAttributes = stringify(info.jsAttributes)
|
|
149
149
|
this.storeSupportabilityMetrics('PageSession/Feature/CustomData/Bytes', jsAttributes === '{}' ? 0 : jsAttributes.length)
|
|
150
|
+
|
|
151
|
+
// Capture metrics for performance markers and measures
|
|
152
|
+
if (typeof performance !== 'undefined') {
|
|
153
|
+
const markers = performance.getEntriesByType('mark')
|
|
154
|
+
const measures = performance.getEntriesByType('measure')
|
|
155
|
+
this.storeSupportabilityMetrics('Generic/Performance/Mark/Seen', markers.length)
|
|
156
|
+
this.storeSupportabilityMetrics('Generic/Performance/Measure/Seen', measures.length)
|
|
157
|
+
}
|
|
150
158
|
} catch (e) {
|
|
151
159
|
// do nothing
|
|
152
160
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setAPI, setTopLevelCallers } from '../api/api'
|
|
2
2
|
import { addToNREUM, gosCDN, gosNREUMInitializedAgents } from '../../common/window/nreum'
|
|
3
|
-
import { setConfiguration, setInfo, setLoaderConfig, setRuntime } from '../../common/config/config'
|
|
3
|
+
import { getConfiguration, setConfiguration, setInfo, setLoaderConfig, setRuntime } from '../../common/config/config'
|
|
4
4
|
import { activatedFeatures } from '../../common/util/feature-flags'
|
|
5
5
|
import { isWorkerScope } from '../../common/constants/runtime'
|
|
6
6
|
|
|
@@ -22,7 +22,16 @@ export function configure (agentIdentifier, opts = {}, loaderType, forceDrain) {
|
|
|
22
22
|
}
|
|
23
23
|
setInfo(agentIdentifier, info)
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const updatedInit = getConfiguration(agentIdentifier)
|
|
26
|
+
runtime.denyList = [
|
|
27
|
+
...(updatedInit.ajax?.deny_list || []),
|
|
28
|
+
...(updatedInit.ajax?.block_internal
|
|
29
|
+
? [
|
|
30
|
+
info.beacon,
|
|
31
|
+
info.errorBeacon
|
|
32
|
+
]
|
|
33
|
+
: [])
|
|
34
|
+
]
|
|
26
35
|
setRuntime(agentIdentifier, runtime)
|
|
27
36
|
|
|
28
37
|
setTopLevelCallers()
|