@newrelic/browser-agent 1.320.0 → 1.320.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/CHANGELOG.md +8 -0
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/payloads/payloads.js +3 -2
- package/dist/cjs/common/serialize/bel-serializer.js +17 -4
- package/dist/cjs/common/v2/mfe-vitals.js +34 -11
- package/dist/cjs/features/ajax/aggregate/index.js +19 -8
- package/dist/cjs/features/page_view_timing/aggregate/index.js +28 -13
- package/dist/cjs/features/soft_navigations/aggregate/ajax-node.js +16 -4
- package/dist/cjs/features/soft_navigations/aggregate/interaction.js +10 -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/payloads/payloads.js +3 -2
- package/dist/esm/common/serialize/bel-serializer.js +17 -4
- package/dist/esm/common/v2/mfe-vitals.js +34 -11
- package/dist/esm/features/ajax/aggregate/index.js +19 -8
- package/dist/esm/features/page_view_timing/aggregate/index.js +28 -13
- package/dist/esm/features/soft_navigations/aggregate/ajax-node.js +16 -4
- package/dist/esm/features/soft_navigations/aggregate/interaction.js +10 -3
- package/dist/types/common/payloads/payloads.d.ts +3 -2
- package/dist/types/common/payloads/payloads.d.ts.map +1 -1
- package/dist/types/common/serialize/bel-serializer.d.ts +9 -1
- package/dist/types/common/serialize/bel-serializer.d.ts.map +1 -1
- package/dist/types/common/v2/mfe-vitals.d.ts.map +1 -1
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts +0 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/soft_navigations/aggregate/ajax-node.d.ts.map +1 -1
- package/dist/types/features/soft_navigations/aggregate/interaction.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/common/payloads/payloads.js +3 -2
- package/src/common/serialize/bel-serializer.js +13 -4
- package/src/common/v2/mfe-vitals.js +39 -12
- package/src/features/ajax/aggregate/index.js +12 -9
- package/src/features/page_view_timing/aggregate/index.js +19 -14
- package/src/features/soft_navigations/aggregate/ajax-node.js +10 -7
- package/src/features/soft_navigations/aggregate/interaction.js +6 -5
|
@@ -42,7 +42,7 @@ export class AjaxNode extends BelNode {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
serialize (parentStartTimestamp, agentRef, ajaxObfuscator) {
|
|
45
|
-
const { addString, addStringWithTruncation } = createStringAdders(getAddStringContext, ajaxObfuscator)
|
|
45
|
+
const { addString, addStringRaw, addStringWithTruncation } = createStringAdders(getAddStringContext, ajaxObfuscator)
|
|
46
46
|
|
|
47
47
|
const nodeList = []
|
|
48
48
|
|
|
@@ -54,22 +54,25 @@ export class AjaxNode extends BelNode {
|
|
|
54
54
|
numeric(this.end - this.start), // end is relative to start
|
|
55
55
|
numeric(this.callbackEnd - this.end), // callbackEnd is relative to end
|
|
56
56
|
numeric(this.callbackDuration), // not relative
|
|
57
|
-
|
|
57
|
+
addStringRaw(this.method),
|
|
58
58
|
numeric(this.status),
|
|
59
59
|
addString(this.domain),
|
|
60
60
|
addString(this.path),
|
|
61
61
|
numeric(this.txSize),
|
|
62
62
|
numeric(this.rxSize),
|
|
63
63
|
this.requestedWith,
|
|
64
|
-
|
|
65
|
-
nullable(this.spanId,
|
|
64
|
+
addStringRaw(this.nodeId),
|
|
65
|
+
nullable(this.spanId, addStringRaw, true) + nullable(this.traceId, addStringRaw, true) + nullable(this.spanTimestamp, numeric)
|
|
66
66
|
]
|
|
67
67
|
// Regular attributes: obfuscate only
|
|
68
68
|
const regularAttrs = addCustomAttributes({
|
|
69
|
-
[AJAX_ID]: this[AJAX_ID],
|
|
70
69
|
...(this.targetAttributes || {}),
|
|
71
70
|
...(this.gql || {})
|
|
72
|
-
}, addString)
|
|
71
|
+
}, { addKey: addStringRaw, addVal: addString })
|
|
72
|
+
|
|
73
|
+
regularAttrs.push(...addCustomAttributes({
|
|
74
|
+
[AJAX_ID]: this[AJAX_ID]
|
|
75
|
+
}, { addKey: addStringRaw, addVal: addStringRaw }))
|
|
73
76
|
|
|
74
77
|
// Payload attributes: obfuscate then truncate
|
|
75
78
|
const payloadAttrs = addCustomAttributes({
|
|
@@ -78,7 +81,7 @@ export class AjaxNode extends BelNode {
|
|
|
78
81
|
...(this.requestQuery ? { requestQuery: this.requestQuery } : {}),
|
|
79
82
|
...(this.responseBody ? { responseBody: this.responseBody } : {}),
|
|
80
83
|
...(this.responseHeaders ? { responseHeaders: this.responseHeaders } : {})
|
|
81
|
-
}, addStringWithTruncation)
|
|
84
|
+
}, { addKey: addStringRaw, addVal: addStringWithTruncation })
|
|
82
85
|
|
|
83
86
|
let allAttachedNodes = [...regularAttrs, ...payloadAttrs]
|
|
84
87
|
this.children.forEach(node => allAttachedNodes.push(node.serialize())) // no children is expected under ajax nodes at this time
|
|
@@ -9,6 +9,7 @@ import { now } from '../../../common/timing/now'
|
|
|
9
9
|
import { cleanURL } from '../../../common/url/clean-url'
|
|
10
10
|
import { NODE_TYPE, INTERACTION_STATUS, INTERACTION_TYPE, API_TRIGGER_NAME, IPL_TRIGGER_NAME, NO_LONG_TASK_WINDOW } from '../constants'
|
|
11
11
|
import { BelNode } from './bel-node'
|
|
12
|
+
import { createStringAdders } from '../../../common/payloads/payloads'
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* link https://github.com/newrelic/nr-querypack/blob/main/schemas/bel/7.qpschema
|
|
@@ -139,7 +140,7 @@ export class Interaction extends BelNode {
|
|
|
139
140
|
*/
|
|
140
141
|
serialize (firstStartTimeOfPayload, agentRef, interactionObfuscator, ajaxObfuscator) {
|
|
141
142
|
const isFirstIxnOfPayload = firstStartTimeOfPayload === undefined
|
|
142
|
-
const addString = getAddStringContext
|
|
143
|
+
const { addString, addStringRaw } = createStringAdders(getAddStringContext, interactionObfuscator)
|
|
143
144
|
const nodeList = []
|
|
144
145
|
let ixnType
|
|
145
146
|
if (this.trigger === IPL_TRIGGER_NAME) ixnType = INTERACTION_TYPE.INITIAL_PAGE_LOAD
|
|
@@ -154,7 +155,7 @@ export class Interaction extends BelNode {
|
|
|
154
155
|
numeric(this.end - this.start), // end -- relative to start
|
|
155
156
|
numeric(0), // callbackEnd -- relative to start; not used by BrowserInteraction events so these are always 0
|
|
156
157
|
numeric(0), // not relative; always 0 for BrowserInteraction
|
|
157
|
-
|
|
158
|
+
addStringRaw(this.trigger),
|
|
158
159
|
addString(cleanURL(this.initialPageURL, true)),
|
|
159
160
|
addString(cleanURL(this.oldURL, true)),
|
|
160
161
|
addString(cleanURL(this.newURL, true)),
|
|
@@ -162,12 +163,12 @@ export class Interaction extends BelNode {
|
|
|
162
163
|
ixnType,
|
|
163
164
|
nullable(this.queueTime, numeric, true) + nullable(this.appTime, numeric, true) +
|
|
164
165
|
nullable(this.oldRoute, addString, true) + nullable(this.newRoute, addString, true) +
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
addStringRaw(this.id),
|
|
167
|
+
addStringRaw(this.nodeId),
|
|
167
168
|
nullable(this.firstPaint, numeric, true) + nullable(this.firstContentfulPaint, numeric)
|
|
168
169
|
]
|
|
169
170
|
const customAttributes = { ...agentRef.info.jsAttributes, ...this.customAttributes } // attrs specific to this interaction should have precedence over the general custom attrs
|
|
170
|
-
const allAttachedNodes = addCustomAttributes(customAttributes || {}, addString) // start with all custom attributes
|
|
171
|
+
const allAttachedNodes = addCustomAttributes(customAttributes || {}, { addKey: addStringRaw, addVal: addString }) // start with all custom attributes
|
|
171
172
|
if (agentRef.info.atts) allAttachedNodes.push('a,' + addString(agentRef.info.atts)) // add apm provided attributes
|
|
172
173
|
/* Querypack encoder+decoder quirkiness:
|
|
173
174
|
- If first ixn node of payload is being processed, its children's start time must be offset by this node's start. (firstStartTime should be undefined.)
|