@newrelic/browser-agent 1.262.0 → 1.263.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 +13 -0
- package/dist/cjs/common/config/state/configurable.js +4 -4
- package/dist/cjs/common/config/state/init.js +5 -3
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/context/shared-context.js +2 -2
- package/dist/cjs/common/drain/drain.js +1 -1
- package/dist/cjs/common/harvest/harvest.js +1 -1
- package/dist/cjs/common/session/session-entity.js +2 -2
- package/dist/cjs/common/timing/time-keeper.js +13 -2
- package/dist/cjs/common/util/console.js +3 -4
- package/dist/cjs/common/util/obfuscate.js +3 -3
- package/dist/cjs/common/wrap/wrap-logger.js +1 -2
- package/dist/cjs/common/wrap/wrap-xhr.js +1 -1
- package/dist/cjs/features/logging/aggregate/index.js +5 -5
- package/dist/cjs/features/logging/constants.js +2 -5
- package/dist/cjs/features/metrics/aggregate/index.js +16 -0
- package/dist/cjs/features/page_view_event/aggregate/index.js +20 -4
- package/dist/cjs/features/session_replay/aggregate/index.js +1 -1
- package/dist/cjs/features/session_replay/shared/recorder.js +1 -1
- package/dist/cjs/features/spa/aggregate/index.js +1 -1
- package/dist/cjs/features/utils/aggregate-base.js +4 -3
- package/dist/cjs/features/utils/instrument-base.js +2 -2
- package/dist/cjs/loaders/agent-base.js +1 -1
- package/dist/cjs/loaders/agent.js +3 -4
- package/dist/cjs/loaders/api/api.js +9 -7
- package/dist/cjs/loaders/micro-agent.js +5 -5
- package/dist/esm/common/config/state/configurable.js +4 -4
- package/dist/esm/common/config/state/init.js +5 -3
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/context/shared-context.js +2 -2
- package/dist/esm/common/drain/drain.js +1 -1
- package/dist/esm/common/harvest/harvest.js +1 -1
- package/dist/esm/common/session/session-entity.js +2 -2
- package/dist/esm/common/timing/time-keeper.js +12 -2
- package/dist/esm/common/util/console.js +3 -4
- package/dist/esm/common/util/obfuscate.js +3 -3
- package/dist/esm/common/wrap/wrap-logger.js +1 -2
- package/dist/esm/common/wrap/wrap-xhr.js +1 -1
- package/dist/esm/features/logging/aggregate/index.js +6 -6
- package/dist/esm/features/logging/constants.js +1 -4
- package/dist/esm/features/metrics/aggregate/index.js +16 -0
- package/dist/esm/features/page_view_event/aggregate/index.js +21 -5
- package/dist/esm/features/session_replay/aggregate/index.js +1 -1
- package/dist/esm/features/session_replay/shared/recorder.js +1 -1
- package/dist/esm/features/spa/aggregate/index.js +1 -1
- package/dist/esm/features/utils/aggregate-base.js +4 -3
- package/dist/esm/features/utils/instrument-base.js +2 -2
- package/dist/esm/loaders/agent-base.js +1 -1
- package/dist/esm/loaders/agent.js +3 -4
- package/dist/esm/loaders/api/api.js +9 -7
- package/dist/esm/loaders/micro-agent.js +5 -5
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/timing/time-keeper.d.ts +2 -1
- package/dist/types/common/timing/time-keeper.d.ts.map +1 -1
- package/dist/types/common/util/console.d.ts +1 -1
- package/dist/types/common/util/console.d.ts.map +1 -1
- package/dist/types/common/wrap/wrap-logger.d.ts.map +1 -1
- package/dist/types/features/logging/constants.d.ts +0 -3
- package/dist/types/features/logging/constants.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_replay/shared/recorder.d.ts.map +1 -1
- package/dist/types/features/utils/aggregate-base.d.ts.map +1 -1
- package/dist/types/loaders/agent.d.ts.map +1 -1
- package/dist/types/loaders/api/api.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/config/state/configurable.js +4 -4
- package/src/common/config/state/init.js +4 -3
- package/src/common/context/shared-context.js +2 -2
- package/src/common/drain/drain.js +1 -1
- package/src/common/harvest/harvest.js +1 -1
- package/src/common/session/session-entity.js +2 -2
- package/src/common/timing/time-keeper.js +14 -2
- package/src/common/util/console.js +3 -4
- package/src/common/util/obfuscate.js +3 -3
- package/src/common/wrap/wrap-logger.js +1 -2
- package/src/common/wrap/wrap-xhr.js +1 -1
- package/src/features/logging/aggregate/index.js +6 -6
- package/src/features/logging/constants.js +0 -4
- package/src/features/metrics/aggregate/index.js +12 -0
- package/src/features/page_view_event/aggregate/index.js +22 -5
- package/src/features/session_replay/aggregate/index.js +1 -1
- package/src/features/session_replay/shared/recorder.js +1 -1
- package/src/features/spa/aggregate/index.js +1 -1
- package/src/features/utils/aggregate-base.js +4 -3
- package/src/features/utils/instrument-base.js +2 -2
- package/src/loaders/agent-base.js +1 -1
- package/src/loaders/agent.js +3 -4
- package/src/loaders/api/api.js +9 -7
- package/src/loaders/micro-agent.js +5 -5
package/src/loaders/api/api.js
CHANGED
|
@@ -30,7 +30,7 @@ export function setTopLevelCallers () {
|
|
|
30
30
|
let returnVals = []
|
|
31
31
|
Object.values(nr.initializedAgents).forEach(val => {
|
|
32
32
|
if (!val || !val.api) {
|
|
33
|
-
warn(
|
|
33
|
+
warn(38, fnName)
|
|
34
34
|
} else if (val.exposed && val.api[fnName]) {
|
|
35
35
|
returnVals.push(val.api[fnName](...args))
|
|
36
36
|
}
|
|
@@ -57,10 +57,12 @@ export function setAPI (agentIdentifier, forceDrain, runSoftNavOverSpa = false)
|
|
|
57
57
|
var spaPrefix = prefix + 'ixn-'
|
|
58
58
|
|
|
59
59
|
apiInterface.log = function (message, { customAttributes = {}, level = LOG_LEVELS.INFO } = {}) {
|
|
60
|
+
handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/log/called'], undefined, FEATURE_NAMES.metrics, instanceEE)
|
|
60
61
|
bufferLog(instanceEE, message, customAttributes, level)
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
apiInterface.wrapLogger = (parent, functionName, { customAttributes = {}, level = LOG_LEVELS.INFO } = {}) => {
|
|
65
|
+
handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/wrapLogger/called'], undefined, FEATURE_NAMES.metrics, instanceEE)
|
|
64
66
|
wrapLogger(instanceEE, parent, functionName, { customAttributes, level })
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -95,11 +97,11 @@ export function setAPI (agentIdentifier, forceDrain, runSoftNavOverSpa = false)
|
|
|
95
97
|
}
|
|
96
98
|
apiInterface.setCustomAttribute = function (name, value, persistAttribute = false) {
|
|
97
99
|
if (typeof name !== 'string') {
|
|
98
|
-
warn(
|
|
100
|
+
warn(39, typeof name)
|
|
99
101
|
return
|
|
100
102
|
}
|
|
101
103
|
if (!(['string', 'number', 'boolean'].includes(typeof value) || value === null)) {
|
|
102
|
-
warn(
|
|
104
|
+
warn(40, typeof value)
|
|
103
105
|
return
|
|
104
106
|
}
|
|
105
107
|
return appendJsAttribute(name, value, 'setCustomAttribute', persistAttribute)
|
|
@@ -111,7 +113,7 @@ export function setAPI (agentIdentifier, forceDrain, runSoftNavOverSpa = false)
|
|
|
111
113
|
*/
|
|
112
114
|
apiInterface.setUserId = function (value) {
|
|
113
115
|
if (!(typeof value === 'string' || value === null)) {
|
|
114
|
-
warn(
|
|
116
|
+
warn(41, typeof value)
|
|
115
117
|
return
|
|
116
118
|
}
|
|
117
119
|
return appendJsAttribute('enduser.id', value, 'setUserId', true)
|
|
@@ -124,7 +126,7 @@ export function setAPI (agentIdentifier, forceDrain, runSoftNavOverSpa = false)
|
|
|
124
126
|
*/
|
|
125
127
|
apiInterface.setApplicationVersion = function (value) {
|
|
126
128
|
if (!(typeof value === 'string' || value === null)) {
|
|
127
|
-
warn(
|
|
129
|
+
warn(42, typeof value)
|
|
128
130
|
return
|
|
129
131
|
}
|
|
130
132
|
return appendJsAttribute('application.version', value, 'setApplicationVersion', false)
|
|
@@ -135,7 +137,7 @@ export function setAPI (agentIdentifier, forceDrain, runSoftNavOverSpa = false)
|
|
|
135
137
|
handle(SUPPORTABILITY_METRIC_CHANNEL, ['API/start/called'], undefined, FEATURE_NAMES.metrics, instanceEE)
|
|
136
138
|
instanceEE.emit('manual-start-all')
|
|
137
139
|
} catch (err) {
|
|
138
|
-
warn(
|
|
140
|
+
warn(23, err)
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
|
|
@@ -210,7 +212,7 @@ export function setAPI (agentIdentifier, forceDrain, runSoftNavOverSpa = false)
|
|
|
210
212
|
setAPI(agentIdentifier)
|
|
211
213
|
drain(agentIdentifier, 'api')
|
|
212
214
|
}).catch((err) => {
|
|
213
|
-
warn(
|
|
215
|
+
warn(27, err)
|
|
214
216
|
instanceEE.abort()
|
|
215
217
|
})
|
|
216
218
|
}
|
|
@@ -61,11 +61,11 @@ export class MicroAgent extends AgentBase {
|
|
|
61
61
|
if (features === undefined) features = featNames
|
|
62
62
|
else {
|
|
63
63
|
features = Array.isArray(features) && features.length ? features : [features]
|
|
64
|
-
if (features.some(f => !featNames.includes(f))) return warn(
|
|
64
|
+
if (features.some(f => !featNames.includes(f))) return warn(37, featNames)
|
|
65
65
|
if (!features.includes(FEATURE_NAMES.pageViewEvent)) features.push(FEATURE_NAMES.pageViewEvent)
|
|
66
66
|
}
|
|
67
67
|
} catch (err) {
|
|
68
|
-
warn(
|
|
68
|
+
warn(23, err)
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
try {
|
|
@@ -75,7 +75,7 @@ export class MicroAgent extends AgentBase {
|
|
|
75
75
|
// a biproduct of doing this is that the "session manager" is automatically handled through importing this feature
|
|
76
76
|
this.features.page_view_event = new PVE(this.agentIdentifier, this.sharedAggregator)
|
|
77
77
|
} catch (err) {
|
|
78
|
-
warn(
|
|
78
|
+
warn(24, err)
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
onWindowLoad(() => {
|
|
@@ -87,13 +87,13 @@ export class MicroAgent extends AgentBase {
|
|
|
87
87
|
}).then(({ Aggregate }) => {
|
|
88
88
|
this.features[f] = new Aggregate(this.agentIdentifier, this.sharedAggregator)
|
|
89
89
|
}).catch(err =>
|
|
90
|
-
warn(
|
|
90
|
+
warn(25, err))
|
|
91
91
|
}
|
|
92
92
|
})
|
|
93
93
|
})
|
|
94
94
|
return true
|
|
95
95
|
} catch (err) {
|
|
96
|
-
warn(
|
|
96
|
+
warn(26, err)
|
|
97
97
|
return false
|
|
98
98
|
}
|
|
99
99
|
}
|