@newrelic/browser-agent 1.281.0 → 1.283.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.
- package/CHANGELOG.md +15 -0
- package/README.md +17 -0
- package/dist/cjs/common/config/info.js +21 -0
- package/dist/cjs/common/config/init.js +88 -20
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/session/session-entity.js +2 -0
- package/dist/cjs/common/wrap/wrap-function.js +1 -0
- package/dist/cjs/common/wrap/wrap-websocket.js +23 -39
- package/dist/cjs/features/logging/aggregate/index.js +52 -3
- package/dist/cjs/features/logging/constants.js +9 -1
- package/dist/cjs/features/logging/instrument/index.js +20 -0
- package/dist/cjs/features/metrics/aggregate/index.js +7 -9
- package/dist/cjs/features/metrics/constants.js +3 -5
- package/dist/cjs/features/metrics/instrument/index.js +8 -11
- package/dist/cjs/features/session_replay/aggregate/index.js +7 -3
- package/dist/cjs/features/utils/aggregate-base.js +3 -0
- package/dist/cjs/loaders/agent.js +12 -1
- package/dist/cjs/loaders/browser-agent.js +5 -2
- package/dist/cjs/loaders/micro-agent.js +1 -1
- package/dist/esm/common/config/info.js +22 -0
- package/dist/esm/common/config/init.js +86 -17
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/session/session-entity.js +2 -0
- package/dist/esm/common/wrap/wrap-function.js +1 -1
- package/dist/esm/common/wrap/wrap-websocket.js +23 -39
- package/dist/esm/features/logging/aggregate/index.js +53 -4
- package/dist/esm/features/logging/constants.js +8 -0
- package/dist/esm/features/logging/instrument/index.js +20 -0
- package/dist/esm/features/metrics/aggregate/index.js +8 -10
- package/dist/esm/features/metrics/constants.js +2 -3
- package/dist/esm/features/metrics/instrument/index.js +9 -11
- package/dist/esm/features/session_replay/aggregate/index.js +7 -3
- package/dist/esm/features/utils/aggregate-base.js +3 -0
- package/dist/esm/loaders/agent.js +12 -1
- package/dist/esm/loaders/browser-agent.js +5 -2
- package/dist/esm/loaders/micro-agent.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/common/aggregate/event-aggregator.d.ts +1 -3
- package/dist/types/common/aggregate/event-aggregator.d.ts.map +1 -1
- package/dist/types/common/config/info.d.ts +31 -0
- package/dist/types/common/config/info.d.ts.map +1 -1
- package/dist/types/common/config/init.d.ts +262 -0
- package/dist/types/common/config/init.d.ts.map +1 -1
- package/dist/types/common/constants/agent-constants.d.ts.map +1 -1
- package/dist/types/common/constants/env.cdn.d.ts.map +1 -1
- package/dist/types/common/constants/env.d.ts.map +1 -1
- package/dist/types/common/constants/env.npm.d.ts.map +1 -1
- package/dist/types/common/session/constants.d.ts.map +1 -1
- package/dist/types/common/session/session-entity.d.ts.map +1 -1
- package/dist/types/common/url/clean-url.d.ts +1 -1
- package/dist/types/common/url/clean-url.d.ts.map +1 -1
- package/dist/types/common/util/traverse.d.ts +1 -1
- package/dist/types/common/util/traverse.d.ts.map +1 -1
- package/dist/types/common/window/page-visibility.d.ts +1 -1
- package/dist/types/common/window/page-visibility.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-function.d.ts +11 -1
- package/dist/types/common/wrap/wrap-function.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-websocket.d.ts.map +1 -1
- package/dist/types/features/generic_events/constants.d.ts.map +1 -1
- package/dist/types/features/logging/aggregate/index.d.ts +7 -0
- package/dist/types/features/logging/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/logging/constants.d.ts +13 -0
- package/dist/types/features/logging/constants.d.ts.map +1 -1
- package/dist/types/features/logging/instrument/index.d.ts.map +1 -1
- package/dist/types/features/metrics/constants.d.ts +1 -0
- package/dist/types/features/metrics/constants.d.ts.map +1 -1
- package/dist/types/features/session_replay/aggregate/index.d.ts +3 -2
- package/dist/types/features/session_replay/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/constants.d.ts.map +1 -1
- package/dist/types/features/session_trace/constants.d.ts.map +1 -1
- package/dist/types/features/soft_navigations/constants.d.ts.map +1 -1
- package/dist/types/features/spa/constants.d.ts.map +1 -1
- package/dist/types/features/utils/aggregate-base.d.ts +1 -0
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/dist/types/features/utils/feature-base.d.ts.map +1 -1
- package/dist/types/features/utils/instrument-base.d.ts +2 -2
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/loaders/agent-base.d.ts +2 -2
- package/dist/types/loaders/agent-base.d.ts.map +1 -1
- package/dist/types/loaders/agent.d.ts +43 -3
- package/dist/types/loaders/agent.d.ts.map +1 -1
- package/dist/types/loaders/api/api.d.ts +0 -10
- package/dist/types/loaders/api/api.d.ts.map +1 -1
- package/dist/types/loaders/browser-agent.d.ts +0 -1
- package/dist/types/loaders/browser-agent.d.ts.map +1 -1
- package/dist/types/loaders/features/features.d.ts.map +1 -1
- package/dist/types/loaders/micro-agent-base.d.ts +6 -6
- package/dist/types/loaders/micro-agent-base.d.ts.map +1 -1
- package/dist/types/loaders/micro-agent.d.ts +3 -3
- package/dist/types/loaders/micro-agent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/config/info.js +22 -3
- package/src/common/config/init.js +95 -17
- package/src/common/session/session-entity.js +2 -0
- package/src/common/wrap/wrap-function.js +1 -1
- package/src/common/wrap/wrap-websocket.js +24 -40
- package/src/features/logging/aggregate/index.js +57 -4
- package/src/features/logging/constants.js +9 -0
- package/src/features/logging/instrument/index.js +8 -0
- package/src/features/metrics/aggregate/index.js +8 -8
- package/src/features/metrics/constants.js +2 -2
- package/src/features/metrics/instrument/index.js +9 -9
- package/src/features/session_replay/aggregate/index.js +8 -3
- package/src/features/utils/aggregate-base.js +4 -0
- package/src/loaders/agent.js +12 -1
- package/src/loaders/browser-agent.js +5 -3
- package/src/loaders/micro-agent.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/logging/aggregate/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/logging/aggregate/index.js"],"names":[],"mappings":"AAoBA;IACE,2BAAiC;IACjC,2BAmCC;IAjCC,8BAA+G;IAUxG,UAA4B;IAc/B,iBAA4C;IAWlD,0CAKC;IAED,+EAiDC;IAED;;YAIM,0FAA0F;;;QAoB5F,0DAA0D;;QAM7D;IAED;;MAEC;IAED,yDAAyD;IACzD,yBAOC;IAED,yCAIC;CACF;8BA/J6B,4BAA4B"}
|
|
@@ -5,6 +5,19 @@ export namespace LOG_LEVELS {
|
|
|
5
5
|
let DEBUG: string;
|
|
6
6
|
let TRACE: string;
|
|
7
7
|
}
|
|
8
|
+
export namespace LOGGING_MODE {
|
|
9
|
+
export let OFF: number;
|
|
10
|
+
let ERROR_1: number;
|
|
11
|
+
export { ERROR_1 as ERROR };
|
|
12
|
+
let WARN_1: number;
|
|
13
|
+
export { WARN_1 as WARN };
|
|
14
|
+
let INFO_1: number;
|
|
15
|
+
export { INFO_1 as INFO };
|
|
16
|
+
let DEBUG_1: number;
|
|
17
|
+
export { DEBUG_1 as DEBUG };
|
|
18
|
+
let TRACE_1: number;
|
|
19
|
+
export { TRACE_1 as TRACE };
|
|
20
|
+
}
|
|
8
21
|
export const LOGGING_EVENT_EMITTER_CHANNEL: "log";
|
|
9
22
|
export const FEATURE_NAME: string;
|
|
10
23
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/logging/constants.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/logging/constants.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,4CAA6C,KAAK,CAAA;AAElD,kCAAiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/logging/instrument/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/logging/instrument/index.js"],"names":[],"mappings":"AAUA;IACE,2BAAiC;IACjC,2CAgBC;CACF;AAED,wCAAiC;+BA3BF,6BAA6B"}
|
|
@@ -3,4 +3,5 @@ export const SUPPORTABILITY_METRIC: "sm";
|
|
|
3
3
|
export const CUSTOM_METRIC: "cm";
|
|
4
4
|
export const SUPPORTABILITY_METRIC_CHANNEL: "storeSupportabilityMetrics";
|
|
5
5
|
export const CUSTOM_METRIC_CHANNEL: "storeEventMetrics";
|
|
6
|
+
export const WATCHABLE_WEB_SOCKET_EVENTS: string[];
|
|
6
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/metrics/constants.js"],"names":[],"mappings":"AAQA,kCAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/metrics/constants.js"],"names":[],"mappings":"AAQA,kCAAiD;AACjD,oCAAqC,IAAI,CAAA;AACzC,4BAA6B,IAAI,CAAA;AACjC,4CAA6C,4BAA4B,CAAA;AACzE,oCAAqC,mBAAmB,CAAA;AAExD,mDAA2F"}
|
|
@@ -13,16 +13,17 @@ export class Aggregate extends AggregateBase {
|
|
|
13
13
|
timeKeeper: any;
|
|
14
14
|
recorder: any;
|
|
15
15
|
errorNoticed: any;
|
|
16
|
+
isSessionTrackingEnabled: any;
|
|
16
17
|
replayIsActive(): boolean;
|
|
17
18
|
handleError(e: any): void;
|
|
18
19
|
switchToFull(): void;
|
|
19
20
|
/**
|
|
20
21
|
* Evaluate entitlements and sampling before starting feature mechanics, importing and configuring recording library, and setting storage state
|
|
21
|
-
* @param {boolean}
|
|
22
|
+
* @param {boolean} srMode - the true/false state of the "sr" flag (aka. entitlements) from RUM response
|
|
22
23
|
* @param {boolean} ignoreSession - whether to force the method to ignore the session state and use just the sample flags
|
|
23
24
|
* @returns {void}
|
|
24
25
|
*/
|
|
25
|
-
initializeRecording(srMode:
|
|
26
|
+
initializeRecording(srMode: boolean, ignoreSession: boolean): void;
|
|
26
27
|
prepUtils(): Promise<void>;
|
|
27
28
|
makeHarvestPayload(shouldRetryOnFail: any): {
|
|
28
29
|
targetApp: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_replay/aggregate/index.js"],"names":[],"mappings":"AA4BA;IACE,2BAAiC;IACjC,aAAe;IAKb,iFAAiF;IACjF,qBAAwB;IAGxB,2CAA2C;IAC3C,sDAAwB;IACxB,6CAA6C;IAC7C,gDAAmB;IAEnB,0BAA0B;IAC1B,kBAAqB;IACrB,6CAA6C;IAC7C,gBAA2B;IAE3B,cAA8B;IAC9B,kBAA+C;IAG/C,8BAA+G;IAoEjH,0BAEC;IAED,0BAMC;IAED,qBAUC;IAED;;;;;OAKG;IACH,4BAJW,OAAO,iBACP,OAAO,GACL,IAAI,CAuDhB;IAED,2BASC;IAED;;;;;;;;;;;;;oBAgDC;IAED,sCAIC;IAED;;;;;;;;;;MAuEC;IAED,sCAKC;IAED;;;;OAIG;IACH,mCAKC;IAED,yDAAyD;IACzD,+CASC;IAED,yCAIC;CACF;8BApX6B,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_replay/constants.js"],"names":[],"mappings":"AAOA,kCAAuD;;;;;;;AASvD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_replay/constants.js"],"names":[],"mappings":"AAOA,kCAAuD;;;;;;;AASvD,8BAA+B,IAAI,CAAA;;;;;;;;;AASnC,2GAA2G;AAC3G;;EAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BtF,0CAA0C;AAC1C,kCAAmC,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_trace/constants.js"],"names":[],"mappings":"AAMA,kCAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/session_trace/constants.js"],"names":[],"mappings":"AAMA,kCAAsD;AACtD,2BAA4B,aAAa,CAAA;AACzC,uBAAwB,UAAU,CAAA;AAClC,oBAAqB,QAAQ,CAAA;AAC7B,kBAAmB,MAAM,CAAA;AACzB,8BAAoC;AACpC,4BAAgC;AAChC,yBAA0B,WAAW,CAAA;AACrC,oCAAqC,IAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/soft_navigations/constants.js"],"names":[],"mappings":"AAMA,4CAKC;AACD,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/soft_navigations/constants.js"],"names":[],"mappings":"AAMA,4CAKC;AACD,+BAAgC,KAAK,CAAA;AACrC,+BAAgC,iBAAiB,CAAA;AAEjD,kCAAiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/spa/constants.js"],"names":[],"mappings":"AAOA,kCAA6C;AAC7C,0CAOC;AAED,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/features/spa/constants.js"],"names":[],"mappings":"AAOA,kCAA6C;AAC7C,0CAOC;AAED,+BAAgC,GAAG,CAAA;AACnC,uBAAwB,UAAU,CAAA;AAClC,qBAAsB,QAAQ,CAAA;AAC9B,uBAAwB,UAAU,CAAA;AAClC,8BAA+B,UAAU,CAAA;AACzC,wBAAyB,WAAW,CAAA;AACpC,0BAA2B,aAAa,CAAA;AACxC,uBAAwB,SAAS,CAAA;AACjC,yBAA0B,WAAW,CAAA;AACrC,0BAA2B,aAAa,CAAA;AACxC,yBAA0B,YAAY,CAAA;AACtC,yBAA0B,aAAa,CAAA;AACvC,wBAAyB,WAAW,CAAA;AAEpC,qCAA0D;AAE1D,oBAAqB,QAAQ,CAAA;AAC7B,kBAAmB,MAAM,CAAA;AACzB,mBAAoB,OAAO,CAAA;AAC3B,4BAAgC;AAChC,sBAAuB,QAAQ,CAAA;AAC/B,oBAAqB,OAAO,CAAA"}
|
|
@@ -10,6 +10,7 @@ export class AggregateBase extends FeatureBase {
|
|
|
10
10
|
waitForFlags(flagNames?: string[]): Promise<any>;
|
|
11
11
|
drain(): void;
|
|
12
12
|
drained: boolean | undefined;
|
|
13
|
+
preHarvestChecks(opts: any): boolean;
|
|
13
14
|
/**
|
|
14
15
|
* Return harvest payload. A "serializer" function can be defined on a derived class to format the payload.
|
|
15
16
|
* @param {Boolean} shouldRetryOnFail - harvester flag to backup payload for retry later if harvest request fails; this should be moved to harvester logic
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/aggregate-base.js"],"names":[],"mappings":"AAeA;IAGI,cAAwB;IAapB,YAAuC;IAS3C,gBAAqB;IAGvB;;;;OAIG;IACH,yBAHW,MAAM,EAAE,gBAwBlB;IAED,cAGC;IADC,6BAAmB;IAGrB;;;;;OAKG;IACH,kEAqBC;IAED;;;OAGG;IACH,4BAFW,MAAM,QAMhB;IAED;;;OAGG;IACH,6CAsBC;IAED;;;OAGG;IACH,2CASC;IAPC,gBAA6C;CAQhD;
|
|
1
|
+
{"version":3,"file":"aggregate-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/aggregate-base.js"],"names":[],"mappings":"AAeA;IAGI,cAAwB;IAapB,YAAuC;IAS3C,gBAAqB;IAGvB;;;;OAIG;IACH,yBAHW,MAAM,EAAE,gBAwBlB;IAED,cAGC;IADC,6BAAmB;IAGrB,qCAEC;IAED;;;;;OAKG;IACH,kEAqBC;IAED;;;OAGG;IACH,4BAFW,MAAM,QAMhB;IAED;;;OAGG;IACH,6CAsBC;IAED;;;OAGG;IACH,2CASC;IAPC,gBAA6C;CAQhD;4BA7J2B,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/feature-base.js"],"names":[],"mappings":"AAOA;IACE,oDAaC;IAZC,qBAAqB;IACrB,iBADW,MAAM,CACqB;IACtC,oEAAoE;IACpE,
|
|
1
|
+
{"version":3,"file":"feature-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/feature-base.js"],"names":[],"mappings":"AAOA;IACE,oDAaC;IAZC,qBAAqB;IACrB,iBADW,MAAM,CACqB;IACtC,oEAAoE;IACpE,QAAiC;IACjC,qBAAqB;IACrB,aADW,MAAM,CACa;IAC9B;;;;OAIG;IACH,SAFU,OAAO,CAEG;IAGtB,wBAEC;CACF"}
|
|
@@ -11,7 +11,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
11
11
|
* of its pooled instrumentation data handled by the agent's centralized drain functionality, rather than draining
|
|
12
12
|
* immediately. Primarily useful for fine-grained control in tests.
|
|
13
13
|
*/
|
|
14
|
-
constructor(agentRef: any, featureName: string, auto?: boolean
|
|
14
|
+
constructor(agentRef: any, featureName: string, auto?: boolean);
|
|
15
15
|
auto: boolean;
|
|
16
16
|
/** @type {Function | undefined} This should be set by any derived Instrument class if it has things to do when feature fails or is killed. */
|
|
17
17
|
abortHandler: Function | undefined;
|
|
@@ -32,7 +32,7 @@ export class InstrumentBase extends FeatureBase {
|
|
|
32
32
|
* @param {Object} [argsObjFromInstrument] - any values or references to pass down to aggregate
|
|
33
33
|
* @returns void
|
|
34
34
|
*/
|
|
35
|
-
importAggregator(agentRef: any, argsObjFromInstrument?: Object
|
|
35
|
+
importAggregator(agentRef: any, argsObjFromInstrument?: Object): void;
|
|
36
36
|
#private;
|
|
37
37
|
}
|
|
38
38
|
import { FeatureBase } from './feature-base';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IACE;;;;;;;OAOG;IACH,wCALW,MAAM,
|
|
1
|
+
{"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IACE;;;;;;;OAOG;IACH,wCALW,MAAM,SACN,OAAO,EAoCjB;IA9BC,cAAgB;IAEhB,8IAA8I;IAC9I,cADW,WAAW,SAAS,CACF;IAE7B;;;MAGE;IACF,eAHU,OAAO,kBAAkB,EAAE,aAAa,CAGpB;IAE9B;;;MAGE;IACF,kCAAoC;IAiBtC;;;;;;OAMG;IACH,wDAHW,MAAM,QAsDhB;;CAkBF;4BApI2B,gBAAgB"}
|
|
@@ -12,7 +12,7 @@ export class AgentBase extends MicroAgentBase {
|
|
|
12
12
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/finished/}
|
|
13
13
|
* @param {number} [timeStamp] Defaults to the current time of the call. If used, this marks the time that the page is "finished" according to your own criteria.
|
|
14
14
|
*/
|
|
15
|
-
finished(timeStamp?: number
|
|
15
|
+
finished(timeStamp?: number): any;
|
|
16
16
|
/**
|
|
17
17
|
* Forces a replay to record. If a replay is already actively recording, this call will be ignored.
|
|
18
18
|
* If a recording has not been started, a new one will be created. If a recording has been started, but is currently not recording, it will resume recording.
|
|
@@ -69,7 +69,7 @@ export class AgentBase extends MicroAgentBase {
|
|
|
69
69
|
wrapLogger(parent: object, functionName: string, options?: {
|
|
70
70
|
customAttributes?: object;
|
|
71
71
|
level?: "ERROR" | "TRACE" | "DEBUG" | "INFO" | "WARN";
|
|
72
|
-
}
|
|
72
|
+
}): any;
|
|
73
73
|
#private;
|
|
74
74
|
}
|
|
75
75
|
export type InteractionInstance = import("./api/interaction-types").InteractionInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent-base.js"],"names":[],"mappings":"AAWA;;GAEG;AAEH;IAWE;;;OAGG;IACH,aAEC;IAED;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent-base.js"],"names":[],"mappings":"AAWA;;GAEG;AAEH;IAWE;;;OAGG;IACH,aAEC;IAED;;;;OAIG;IACH,qBAFW,MAAM,OAIhB;IAED;;;;OAIG;IACH,oBAEC;IAED;;;;;OAKG;IACH,mBAEC;IAED;;;;;;;;;;OAUG;IACH,6BARW;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,OAUrF;IAED;;;;;OAKG;IACH,0BAHW,MAAM,OAKhB;IAED;;;;;;MAME;IACF,eAJa,mBAAmB,CAM/B;IAED;;;;;;MAME;IACF,mBAJW,MAAM,gBACN,MAAM,YACN;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,GAAC,OAAO,GAAC,OAAO,GAAC,MAAM,GAAC,MAAM,CAAA;KAAC,OAIpF;;CACF;kCAhGY,OAAO,yBAAyB,EAAE,mBAAmB;+BAHnC,oBAAoB"}
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} AgentOptions
|
|
3
|
+
* @property {import('../common/config/info').Info} info - An object containing operational info needed by the agent. It's strongly encouraged to define this.
|
|
4
|
+
* @property {import('../common/config/init').Init} [init] - An object containing initialization configurations for the agent.
|
|
5
|
+
* @property {Object} [loader_config] - An object containing configuration primarily passed by APM injection. This is not recommended for use if not already provided by installation.
|
|
6
|
+
* @property {Object} [runtime] - An object containing runtime references by the agent. This is not recommended for use.
|
|
7
|
+
* @property {Array<Object>} [features] - A list of feature modules to include in the agent. This is only necessary when using the `Agent` class strictly.
|
|
8
|
+
* @property {boolean} [exposed] - Whether the agent should expose its API to (be affected by) the global `newrelic` object.
|
|
9
|
+
* @property {string} [loaderType] - The type of loader that is initializing the agent. It's recommended to allow the default.
|
|
10
|
+
*/
|
|
1
11
|
/**
|
|
2
12
|
* A flexible class that may be used to compose an agent from a select subset of feature modules. In applications
|
|
3
13
|
* sensitive to network load, this may result in smaller builds with slightly lower performance impact.
|
|
4
14
|
*/
|
|
5
15
|
export class Agent extends AgentBase {
|
|
6
16
|
/**
|
|
7
|
-
* @param {
|
|
17
|
+
* @param {AgentOptions} options
|
|
8
18
|
*/
|
|
9
|
-
constructor(options:
|
|
19
|
+
constructor(options: AgentOptions);
|
|
10
20
|
features: {} | undefined;
|
|
11
|
-
desiredFeatures: Set<
|
|
21
|
+
desiredFeatures: Set<Object> | undefined;
|
|
12
22
|
runSoftNavOverSpa: boolean | undefined;
|
|
13
23
|
get config(): {
|
|
14
24
|
info: any;
|
|
@@ -18,5 +28,35 @@ export class Agent extends AgentBase {
|
|
|
18
28
|
};
|
|
19
29
|
run(): false | undefined;
|
|
20
30
|
}
|
|
31
|
+
export type AgentOptions = {
|
|
32
|
+
/**
|
|
33
|
+
* - An object containing operational info needed by the agent. It's strongly encouraged to define this.
|
|
34
|
+
*/
|
|
35
|
+
info: import("../common/config/info").Info;
|
|
36
|
+
/**
|
|
37
|
+
* - An object containing initialization configurations for the agent.
|
|
38
|
+
*/
|
|
39
|
+
init?: import("../common/config/init").Init | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* - An object containing configuration primarily passed by APM injection. This is not recommended for use if not already provided by installation.
|
|
42
|
+
*/
|
|
43
|
+
loader_config?: Object | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* - An object containing runtime references by the agent. This is not recommended for use.
|
|
46
|
+
*/
|
|
47
|
+
runtime?: Object | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* - A list of feature modules to include in the agent. This is only necessary when using the `Agent` class strictly.
|
|
50
|
+
*/
|
|
51
|
+
features?: Object[] | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* - Whether the agent should expose its API to (be affected by) the global `newrelic` object.
|
|
54
|
+
*/
|
|
55
|
+
exposed?: boolean | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - The type of loader that is initializing the agent. It's recommended to allow the default.
|
|
58
|
+
*/
|
|
59
|
+
loaderType?: string | undefined;
|
|
60
|
+
};
|
|
21
61
|
import { AgentBase } from './agent-base';
|
|
22
62
|
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH;IACE;;OAEG;IACH,qBAFW,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/agent.js"],"names":[],"mappings":"AAqBA;;;;;;;;;GASG;AAEH;;;GAGG;AACH;IACE;;OAEG;IACH,qBAFW,YAAY,EAyBtB;IAbC,yBAAkB;IAGlB,yCAAsD;IAMtD,uCAA6G;IAM/G;;;;;MAOC;IAED,yBAsCC;CACF;;;;;UA1Fa,OAAO,uBAAuB,EAAE,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;0BAdxB,cAAc"}
|
|
@@ -12,17 +12,7 @@ export function setAPI(agentIdentifier: any, forceDrain: any, runSoftNavOverSpa?
|
|
|
12
12
|
recordCustomEvent: (...args: any[]) => any;
|
|
13
13
|
setPageViewName(name: any, host: any): any;
|
|
14
14
|
setCustomAttribute(name: any, value: any, persistAttribute?: boolean): any;
|
|
15
|
-
/**
|
|
16
|
-
* Attach the 'enduser.id' attribute onto agent payloads. This may be used in NR queries to group all browser events by specific users.
|
|
17
|
-
* @param {string} value - unique user identifier; a null user id suggests none should exist
|
|
18
|
-
* @returns @see apiCall
|
|
19
|
-
*/
|
|
20
15
|
setUserId(value: string): any;
|
|
21
|
-
/**
|
|
22
|
-
* Attach the 'applcation.version' attribute onto agent payloads. This may be used in NR queries to group all browser events by a specific customer-defined release.
|
|
23
|
-
* @param {string|null} value - Application version -- if null, will "unset" the value
|
|
24
|
-
* @returns @see apiCall
|
|
25
|
-
*/
|
|
26
16
|
setApplicationVersion(value: string | null): any;
|
|
27
17
|
start(): void;
|
|
28
18
|
interaction(options: any): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/api.js"],"names":[],"mappings":"AAuBA,2CAiBC;AAID;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/api.js"],"names":[],"mappings":"AAuBA,2CAiBC;AAID;;;;;;;;;;;;;qBAqEa,MAAM;iCAaN,MAAM,GAAC,IAAI;;;;;EAiGvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/browser-agent.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/browser-agent.js"],"names":[],"mappings":"AAiBA;;;GAGG;AACH;CAuBC;sBAxCqB,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../../src/loaders/features/features.js"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../../src/loaders/features/features.js"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,qBAAsB,QAAQ,CAAA;AAC9B,uBAAwB,UAAU,CAAA;AAElC,kBAAmB,KAAK,CAAA;;;;;;;;;;;;;;;AAoBxB;;;GAGG;AACH;;EAYC;AAED;;EAYC"}
|
|
@@ -6,21 +6,21 @@ export class MicroAgentBase {
|
|
|
6
6
|
* @param {string} name Name or category of the action. Reported as the actionName attribute.
|
|
7
7
|
* @param {object} [attributes] JSON object with one or more key/value pairs. For example: {key:"value"}. The key is reported as its own PageAction attribute with the specified values.
|
|
8
8
|
*/
|
|
9
|
-
addPageAction(name: string, attributes?: object
|
|
9
|
+
addPageAction(name: string, attributes?: object): any;
|
|
10
10
|
/**
|
|
11
11
|
* Records a custom event with a specified eventType and attributes.
|
|
12
12
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/recordCustomEvent/}
|
|
13
13
|
* @param {string} eventType The eventType to store the event as.
|
|
14
14
|
* @param {object} [attributes] JSON object with one or more key/value pairs. For example: {key:"value"}.
|
|
15
15
|
*/
|
|
16
|
-
recordCustomEvent(eventType: string, attributes?: object
|
|
16
|
+
recordCustomEvent(eventType: string, attributes?: object): any;
|
|
17
17
|
/**
|
|
18
18
|
* Groups page views to help URL structure or to capture the URL's routing information.
|
|
19
19
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setpageviewname/}
|
|
20
20
|
* @param {string} name The page name you want to use. Use alphanumeric characters.
|
|
21
21
|
* @param {string} [host] Default is http://custom.transaction. Typically set host to your site's domain URI.
|
|
22
22
|
*/
|
|
23
|
-
setPageViewName(name: string, host?: string
|
|
23
|
+
setPageViewName(name: string, host?: string): any;
|
|
24
24
|
/**
|
|
25
25
|
* Adds a user-defined attribute name and value to subsequent events on the page.
|
|
26
26
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/}
|
|
@@ -28,14 +28,14 @@ export class MicroAgentBase {
|
|
|
28
28
|
* @param {string|number|boolean|null} value Value of the attribute. Appears as the value in the named attribute column in the PageView event. It will appear as a column in the PageAction event if you are using it. Custom attribute values cannot be complex objects, only simple types such as Strings, Integers and Booleans. Passing a null value unsets any existing attribute of the same name.
|
|
29
29
|
* @param {boolean} [persist] Default false. If set to true, the name-value pair will also be set into the browser's storage API. Then on the following instrumented pages that load within the same session, the pair will be re-applied as a custom attribute.
|
|
30
30
|
*/
|
|
31
|
-
setCustomAttribute(name: string, value: string | number | boolean | null, persist?: boolean
|
|
31
|
+
setCustomAttribute(name: string, value: string | number | boolean | null, persist?: boolean): any;
|
|
32
32
|
/**
|
|
33
33
|
* Identifies a browser error without disrupting your app's operations.
|
|
34
34
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/noticeerror/}
|
|
35
35
|
* @param {Error|string} error Provide a meaningful error message that you can use when analyzing data on browser's JavaScript errors page.
|
|
36
36
|
* @param {object} [customAttributes] An object containing name/value pairs representing custom attributes.
|
|
37
37
|
*/
|
|
38
|
-
noticeError(error: Error | string, customAttributes?: object
|
|
38
|
+
noticeError(error: Error | string, customAttributes?: object): any;
|
|
39
39
|
/**
|
|
40
40
|
* Adds a user-defined identifier string to subsequent events on the page.
|
|
41
41
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setuserid/}
|
|
@@ -75,7 +75,7 @@ export class MicroAgentBase {
|
|
|
75
75
|
log(message: string, options?: {
|
|
76
76
|
customAttributes?: object;
|
|
77
77
|
level?: "ERROR" | "TRACE" | "DEBUG" | "INFO" | "WARN";
|
|
78
|
-
}
|
|
78
|
+
}): any;
|
|
79
79
|
#private;
|
|
80
80
|
}
|
|
81
81
|
//# sourceMappingURL=micro-agent-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"micro-agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent-base.js"],"names":[],"mappings":"AAOA;IACE,wBAAe;IAkBf;;;;;OAKG;IACH,oBAHW,MAAM,
|
|
1
|
+
{"version":3,"file":"micro-agent-base.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent-base.js"],"names":[],"mappings":"AAOA;IACE,wBAAe;IAkBf;;;;;OAKG;IACH,oBAHW,MAAM,eACN,MAAM,OAIhB;IAED;;;;;OAKG;IACH,6BAHW,MAAM,eACN,MAAM,OAIhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,SACN,MAAM,OAIhB;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,SACN,MAAM,GAAC,MAAM,GAAC,OAAO,GAAC,IAAI,YAC1B,OAAO,OAIjB;IAED;;;;;OAKG;IACH,mBAHW,KAAK,GAAC,MAAM,qBACZ,MAAM,OAIhB;IAED;;;;OAIG;IACH,iBAFW,MAAM,GAAC,IAAI,OAIrB;IAED;;;;;;;OAOG;IACH,6BAJW,MAAM,GAAC,IAAI,OAMrB;IAED;;;;OAIG;IACH,0BAFW,CAAC,KAAK,EAAE,KAAK,GAAC,MAAM,KAAK,OAAO,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,OAI9D;IAED;;;;;OAKG;IACH,iBAHW,MAAM,MACN,MAAM,OAIhB;IAED;;;;;MAKE;IACF,aAHW,MAAM,YACN;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,GAAC,OAAO,GAAC,OAAO,GAAC,MAAM,GAAC,MAAM,CAAA;KAAC,OAIpF;;CACF"}
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export class MicroAgent extends MicroAgentBase {
|
|
7
7
|
/**
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {import('./agent').AgentOptions} options
|
|
9
9
|
*/
|
|
10
|
-
constructor(options:
|
|
10
|
+
constructor(options: import("./agent").AgentOptions);
|
|
11
11
|
features: {};
|
|
12
12
|
/**
|
|
13
13
|
* Starts a set of agent features if not running in "autoStart" mode
|
|
14
14
|
* {@link https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/start/}
|
|
15
15
|
* @param {string|string[]} [featureNames] The feature name(s) to start. If no name(s) are passed, all features will be started
|
|
16
16
|
*/
|
|
17
|
-
start: (featureNames?: string | string[]
|
|
17
|
+
start: (featureNames?: string | string[]) => boolean;
|
|
18
18
|
get config(): {
|
|
19
19
|
info: any;
|
|
20
20
|
init: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH;IACE;;OAEG;IACH,qBAFW,
|
|
1
|
+
{"version":3,"file":"micro-agent.d.ts","sourceRoot":"","sources":["../../../src/loaders/micro-agent.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,SAAS,EAAE,YAAY,EAsDxC;IAjDC,aAAkB;IAMlB;;;;OAIG;IACH,uBAFW,MAAM,GAAC,MAAM,EAAE,aAqCzB;IAKH;;;;;MAOC;CACF;+BAhF8B,oBAAoB"}
|
package/package.json
CHANGED
|
@@ -5,6 +5,27 @@
|
|
|
5
5
|
import { defaults as nrDefaults, getNREUMInitializedAgent } from '../window/nreum'
|
|
6
6
|
import { getModeledObject } from './configurable'
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {Object} Info
|
|
10
|
+
* @property {string} [beacon]
|
|
11
|
+
* @property {string} [errorBeacon] - Base URL endpoint for all data harvested by the agent. Proxies should be defined in the init instead.
|
|
12
|
+
* @property {string} licenseKey - New Relic license key provided by the website in user account.
|
|
13
|
+
* @property {string} applicationID - New Relic application ID provided when creating a browser entity in the UI.
|
|
14
|
+
* @property {number} [sa]
|
|
15
|
+
* @property {number} [queueTime]
|
|
16
|
+
* @property {number} [applicationTime]
|
|
17
|
+
* @property {string} [ttGuid]
|
|
18
|
+
* @property {string} [user]
|
|
19
|
+
* @property {string} [account]
|
|
20
|
+
* @property {string} [product]
|
|
21
|
+
* @property {string} [extra]
|
|
22
|
+
* @property {Object} [jsAttributes] - Custom attributes that are added to majority of agent's payloads. The `setCustomAttribute` API method affects this.
|
|
23
|
+
* @property {string} [userAttributes]
|
|
24
|
+
* @property {string} [atts]
|
|
25
|
+
* @property {string} [transactionName]
|
|
26
|
+
* @property {string} [tNamePlain]
|
|
27
|
+
*/
|
|
28
|
+
|
|
8
29
|
const model = {
|
|
9
30
|
// preset defaults
|
|
10
31
|
beacon: nrDefaults.beacon,
|
|
@@ -20,9 +41,7 @@ const model = {
|
|
|
20
41
|
account: undefined,
|
|
21
42
|
product: undefined,
|
|
22
43
|
extra: undefined,
|
|
23
|
-
jsAttributes: {
|
|
24
|
-
|
|
25
|
-
},
|
|
44
|
+
jsAttributes: {},
|
|
26
45
|
userAttributes: undefined,
|
|
27
46
|
atts: undefined,
|
|
28
47
|
transactionName: undefined,
|
|
@@ -3,15 +3,95 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { FEATURE_FLAGS } from '../../features/generic_events/constants'
|
|
6
|
-
import { LOG_LEVELS } from '../../features/logging/constants'
|
|
7
6
|
import { isValidSelector } from '../dom/query-selector'
|
|
8
7
|
import { DEFAULT_EXPIRES_MS, DEFAULT_INACTIVE_MS } from '../session/constants'
|
|
9
8
|
import { warn } from '../util/console'
|
|
10
9
|
import { getNREUMInitializedAgent } from '../window/nreum'
|
|
11
10
|
import { getModeledObject } from './configurable'
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {Object} Init
|
|
14
|
+
* @property {Object} [ajax]
|
|
15
|
+
* @property {Array<string>} [ajax.deny_list] - List of domain URLs to be excluded from AjaxRequest collection.
|
|
16
|
+
* @property {boolean} [ajax.block_internal] - If true, agent requests going to harvest endpoint are treated as on deny list. In other words, agent will not self-report AJAX.
|
|
17
|
+
* @property {boolean} [ajax.enabled] - Turn on/off the ajax feature (on by default).
|
|
18
|
+
* @property {boolean} [ajax.autoStart] - 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
|
+
* @property {Object} [distributed_tracing]
|
|
20
|
+
* @property {boolean} [distributed_tracing.enabled] - If true, distributed tracing headers will be added to outgoing requests. Requires ajax feature to be running.
|
|
21
|
+
* @property {boolean} [distributed_tracing.exclude_newrelic_header]
|
|
22
|
+
* @property {boolean} [distributed_tracing.cors_use_newrelic_header]
|
|
23
|
+
* @property {boolean} [distributed_tracing.cors_use_tracecontext_headers]
|
|
24
|
+
* @property {Array<string>} [distributed_tracing.allowed_origins]
|
|
25
|
+
* @property {Array<string>} [feature_flags] - An array of feature flags to enable experimental features.
|
|
26
|
+
* @property {Object} [generic_events]
|
|
27
|
+
* @property {boolean} [generic_events.enabled] - Turn on/off the generic events feature (on by default). This is required for `PageAction`, `UserAction`, and `BrowserPerformance` events.
|
|
28
|
+
* @property {boolean} [generic_events.autoStart] - If true, the agent will automatically start the generic events feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
29
|
+
* @property {Object} [harvest]
|
|
30
|
+
* @property {number} [harvest.interval] - The interval in seconds at which the agent will send out data. It's not recommended to change this value.
|
|
31
|
+
* @property {Object} [jserrors]
|
|
32
|
+
* @property {boolean} [jserrors.enabled] - Turn on/off the jserrors feature (on by default).
|
|
33
|
+
* @property {boolean} [jserrors.autoStart] - If true, the agent will automatically start the jserrors feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
34
|
+
* @property {Object} [logging]
|
|
35
|
+
* @property {boolean} [logging.enabled] - Turn on/off the logging feature (on by default).
|
|
36
|
+
* @property {boolean} [logging.autoStart] - If true, the agent will automatically start the logging feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
37
|
+
* @property {Object} [metrics]
|
|
38
|
+
* @property {boolean} [metrics.enabled] - Turn on/off the metrics feature (on by default).
|
|
39
|
+
* @property {boolean} [metrics.autoStart] - If true, the agent will automatically start the metrics feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
40
|
+
* @property {Array<Object>} [obfuscate] - Array of regexp and corresponding replacement patterns for obfuscating data.
|
|
41
|
+
* @property {Object} [page_action]
|
|
42
|
+
* @property {boolean} [page_action.enabled] - Must be true to allow PageAction events to be captured.
|
|
43
|
+
* @property {Object} [page_view_event]
|
|
44
|
+
* @property {boolean} [page_view_event.enabled] - This setting is ignored! PageViewEvent is always enabled by force.
|
|
45
|
+
* @property {boolean} [page_view_event.autoStart] - If true, the agent will automatically send the RUM request. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
46
|
+
* @property {Object} [page_view_timing]
|
|
47
|
+
* @property {boolean} [page_view_timing.enabled] - Turn on/off the page view timing feature (on by default).
|
|
48
|
+
* @property {boolean} [page_view_timing.autoStart] - If true, the agent will automatically start the page view timing feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
49
|
+
* @property {Object} [performance]
|
|
50
|
+
* @property {boolean} [performance.capture_marks] - If true, the agent will capture PerformanceMark events.
|
|
51
|
+
* @property {boolean} [performance.capture_measures] - If true, the agent will capture PerformanceMeasure events.
|
|
52
|
+
* @property {boolean} [performance.capture_detail] - If true, `BrowserPerformance` events from marks and measures will include, as attribute(s), the `detail` metadata provided to `markOptions` and `measureOptions`.
|
|
53
|
+
* @property {Object} [performance.resources]
|
|
54
|
+
* @property {boolean} [performance.resources.enabled] - If true, the agent will capture PerformanceResourceTiming entries.
|
|
55
|
+
* @property {Array<string>} [performance.resources.asset_types] - Array of `initiatorType` strings to filter the desired ResourceTiming entries. By default, all resource types are captured.
|
|
56
|
+
* @property {Array<string>} [performance.resources.first_party_domains] - Each resource URL will be checked against this list to determine if it should be labeled "first party" in the resulting `BrowserPerformance` event.
|
|
57
|
+
* @property {boolean} [performance.resources.ignore_newrelic] - When true (default), resource entries associated with New Relic domains will be ignored.
|
|
58
|
+
* @property {Object} [privacy]
|
|
59
|
+
* @property {boolean} [privacy.cookies_enabled] - If true (default), session tracking of users across page loads is enabled in the agent. This is required for session trace, replay, and session-related features.
|
|
60
|
+
* @property {Object} [proxy]
|
|
61
|
+
* @property {string} [proxy.assets] - Set value will be used to overwrite the webpack asset path used to fetch agent assets.
|
|
62
|
+
* @property {string} [proxy.beacon] - Set value will be used to overwrite the endpoint URL to which we send analytics.
|
|
63
|
+
* @property {Object} [session]
|
|
64
|
+
* @property {number} [session.expiresMs] - When session tracking is on, this determines how long a session will last before expiring. Modifying this value is not recommended.
|
|
65
|
+
* @property {number} [session.inactiveMs] - When session tracking is on, this determines how long a session will last without user activity before expiring. Modifying this value is not recommended.
|
|
66
|
+
* @property {Object} [session_replay]
|
|
67
|
+
* @property {boolean} [session_replay.autoStart] - If true, the agent will automatically start the session replay feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
68
|
+
* @property {boolean} [session_replay.enabled] - Turn on/off the session replay feature (off by default).
|
|
69
|
+
* @property {boolean} [session_replay.preload] - If true, allow the agent to run rrweb recorder immediately instead of waiting until after the window.load event, for new sessions. Existing sessions ignore this setting.
|
|
70
|
+
* @property {number} [session_replay.sampling_rate] - This setting is deprecated and ineffective. Sampling is controlled in New Relic by server-side configuration.
|
|
71
|
+
* @property {number} [session_replay.error_sampling_rate] - This setting is deprecated and ineffective.
|
|
72
|
+
* @property {boolean} [session_replay.collect_fonts] - When true, serialize fonts for collection without public asset url. This is currently broken -- https://github.com/rrweb-io/rrweb/issues/1304.
|
|
73
|
+
* @property {boolean} [session_replay.inline_images] - When true, serialize images for collection without public asset url. Not recommended for use. This is currently for TESTING as it easily generates payloads too large to be harvested.
|
|
74
|
+
* @property {boolean} [session_replay.fix_stylesheets] - When true, tries to fetch any missing stylesheets again to inline in replayer.
|
|
75
|
+
* @property {boolean} [session_replay.mask_all_inputs] - If true, all input content will be masked with asterisks.
|
|
76
|
+
* @property {string} [session_replay.mask_text_selector] - Set value should be in CSS selector syntax and is used to identify matching elements to mask.
|
|
77
|
+
* @property {string} [session_replay.block_selector] - Set value should be in CSS selector syntax and is used to identify matching elements to block.
|
|
78
|
+
* @property {Object} [session_replay.mask_input_options] - If mask_all_inputs is not true, this object will be used to select what input to mask. Passwords are forcibly always masked.
|
|
79
|
+
* @property {Object} [session_trace]
|
|
80
|
+
* @property {boolean} [session_trace.enabled] - Turn on/off the session trace feature (on by default).
|
|
81
|
+
* @property {boolean} [session_trace.autoStart] - If true, the agent will automatically start the session trace feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
82
|
+
* @property {Object} [soft_navigations]
|
|
83
|
+
* @property {boolean} [soft_navigations.enabled] - Turn on/off the soft navigations feature (on by default).
|
|
84
|
+
* @property {boolean} [soft_navigations.autoStart] - If true, the agent will automatically start the soft navigations feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
85
|
+
* @property {Object} [spa]
|
|
86
|
+
* @property {boolean} [spa.enabled] - Turn on/off the single page application feature (on by default). NOTE: the SPA feature is deprecated and under removal procedure.
|
|
87
|
+
* @property {boolean} [spa.autoStart] - If true, the agent will automatically start the single page application feature. Otherwise, it will be in a deferred state until the `start` API method is called.
|
|
88
|
+
* @property {boolean} [ssl] - If explicitly false, the agent will use HTTP instead of HTTPS. This setting should NOT be used.
|
|
89
|
+
* @property {Object} [user_actions]
|
|
90
|
+
* @property {boolean} [user_actions.enabled] - Must be true to allow UserAction events to be captured.
|
|
91
|
+
* @property {Array<string>} [user_actions.elementAttributes] - List of HTML Element properties to be captured with UserAction events' target elements. This may help to identify the source element being interacted with in the UI.
|
|
92
|
+
*/
|
|
14
93
|
|
|
94
|
+
const nrMask = '[data-nr-mask]'
|
|
15
95
|
const model = () => {
|
|
16
96
|
const hiddenState = {
|
|
17
97
|
feature_flags: [],
|
|
@@ -56,7 +136,7 @@ const model = () => {
|
|
|
56
136
|
generic_events: { enabled: true, autoStart: true },
|
|
57
137
|
harvest: { interval: 30 },
|
|
58
138
|
jserrors: { enabled: true, autoStart: true },
|
|
59
|
-
logging: { enabled: true, autoStart: true
|
|
139
|
+
logging: { enabled: true, autoStart: true },
|
|
60
140
|
metrics: { enabled: true, autoStart: true },
|
|
61
141
|
obfuscate: undefined,
|
|
62
142
|
page_action: { enabled: true },
|
|
@@ -69,33 +149,31 @@ const model = () => {
|
|
|
69
149
|
set capture_measures (val) { hiddenState.experimental.measures = val },
|
|
70
150
|
capture_detail: true,
|
|
71
151
|
resources: {
|
|
72
|
-
// whether to run this subfeature or not in the generic_events feature. false by default through experimental phase, but flipped to true once GA'd
|
|
73
152
|
get enabled () { return hiddenState.feature_flags.includes(FEATURE_FLAGS.RESOURCES) || hiddenState.experimental.resources },
|
|
74
153
|
set enabled (val) { hiddenState.experimental.resources = val },
|
|
75
|
-
asset_types: [],
|
|
76
|
-
first_party_domains: [],
|
|
77
|
-
ignore_newrelic: true
|
|
154
|
+
asset_types: [],
|
|
155
|
+
first_party_domains: [],
|
|
156
|
+
ignore_newrelic: true
|
|
78
157
|
}
|
|
79
158
|
},
|
|
80
|
-
privacy: { cookies_enabled: true },
|
|
159
|
+
privacy: { cookies_enabled: true },
|
|
81
160
|
proxy: {
|
|
82
|
-
assets: undefined,
|
|
83
|
-
beacon: undefined
|
|
161
|
+
assets: undefined,
|
|
162
|
+
beacon: undefined
|
|
84
163
|
},
|
|
85
164
|
session: {
|
|
86
165
|
expiresMs: DEFAULT_EXPIRES_MS,
|
|
87
166
|
inactiveMs: DEFAULT_INACTIVE_MS
|
|
88
167
|
},
|
|
89
168
|
session_replay: {
|
|
90
|
-
// feature settings
|
|
91
169
|
autoStart: true,
|
|
92
170
|
enabled: false,
|
|
93
|
-
preload: false,
|
|
94
|
-
sampling_rate: 10,
|
|
95
|
-
error_sampling_rate: 100,
|
|
96
|
-
collect_fonts: false,
|
|
97
|
-
inline_images: false,
|
|
98
|
-
fix_stylesheets: true,
|
|
171
|
+
preload: false,
|
|
172
|
+
sampling_rate: 10,
|
|
173
|
+
error_sampling_rate: 100,
|
|
174
|
+
collect_fonts: false,
|
|
175
|
+
inline_images: false,
|
|
176
|
+
fix_stylesheets: true,
|
|
99
177
|
// recording config settings
|
|
100
178
|
mask_all_inputs: true,
|
|
101
179
|
// this has a getter/setter to facilitate validation of the selectors
|
|
@@ -16,6 +16,7 @@ import { handle } from '../event-emitter/handle'
|
|
|
16
16
|
import { SUPPORTABILITY_METRIC_CHANNEL } from '../../features/metrics/constants'
|
|
17
17
|
import { FEATURE_NAMES } from '../../loaders/features/features'
|
|
18
18
|
import { windowAddEventListener } from '../event-listener/event-listener-opts'
|
|
19
|
+
import { LOGGING_MODE } from '../../features/logging/constants'
|
|
19
20
|
|
|
20
21
|
// this is what can be stored in local storage (not enforced but probably should be)
|
|
21
22
|
// these values should sync between local storage and the parent class props
|
|
@@ -28,6 +29,7 @@ const model = {
|
|
|
28
29
|
sessionReplaySentFirstChunk: false,
|
|
29
30
|
sessionTraceMode: MODE.OFF,
|
|
30
31
|
traceHarvestStarted: false,
|
|
32
|
+
loggingMode: LOGGING_MODE.OFF,
|
|
31
33
|
serverTimeDiff: null, // set by TimeKeeper; "undefined" value will not be stringified and stored but "null" will
|
|
32
34
|
custom: {}
|
|
33
35
|
}
|
|
@@ -183,7 +183,7 @@ function report (args, emitter) {
|
|
|
183
183
|
* Defaults to the global event emitter.
|
|
184
184
|
* @returns {object} - The destination founction or object with copied properties.
|
|
185
185
|
*/
|
|
186
|
-
function copy (from, to, emitter) {
|
|
186
|
+
export function copy (from, to, emitter) {
|
|
187
187
|
if (Object.defineProperty && Object.keys) {
|
|
188
188
|
// Create accessors that proxy to actual function
|
|
189
189
|
try {
|