@blueking/open-telemetry 0.0.7 → 0.0.9
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/README.md +424 -112
- package/dist/bk-rum.global.js +7 -7
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/core/config.d.ts +27 -87
- package/dist/index.d.ts +7 -7
- package/dist/index.js +680 -762
- package/dist/index.js.map +1 -1
- package/dist/plugins/action.d.ts +5 -2
- package/dist/plugins/blank-screen.d.ts +7 -2
- package/dist/plugins/common.d.ts +1 -1
- package/dist/plugins/csp-violation.d.ts +2 -3
- package/dist/plugins/device.d.ts +4 -2
- package/dist/plugins/error.d.ts +5 -2
- package/dist/plugins/http-body.d.ts +2 -2
- package/dist/plugins/long-task.d.ts +4 -2
- package/dist/plugins/page-view.d.ts +1 -2
- package/dist/plugins/resource.d.ts +1 -2
- package/dist/plugins/route-timing.d.ts +1 -2
- package/dist/plugins/session.d.ts +6 -2
- package/dist/plugins/web-vitals.d.ts +1 -2
- package/dist/plugins/websocket.d.ts +1 -2
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -80,14 +80,14 @@ function S(e, t) {
|
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region \0@oxc-project+runtime@0.128.0/helpers/toPropertyKey.js
|
|
83
|
-
function
|
|
83
|
+
function C(e) {
|
|
84
84
|
var t = S(e, "string");
|
|
85
85
|
return x(t) == "symbol" ? t : t + "";
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region \0@oxc-project+runtime@0.128.0/helpers/defineProperty.js
|
|
89
|
-
function
|
|
90
|
-
return (t =
|
|
89
|
+
function w(e, t, n) {
|
|
90
|
+
return (t = C(t)) in e ? Object.defineProperty(e, t, {
|
|
91
91
|
value: n,
|
|
92
92
|
enumerable: !0,
|
|
93
93
|
configurable: !0,
|
|
@@ -96,7 +96,7 @@ function C(e, t, n) {
|
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region \0@oxc-project+runtime@0.128.0/helpers/objectSpread2.js
|
|
99
|
-
function
|
|
99
|
+
function T(e, t) {
|
|
100
100
|
var n = Object.keys(e);
|
|
101
101
|
if (Object.getOwnPropertySymbols) {
|
|
102
102
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -106,12 +106,12 @@ function w(e, t) {
|
|
|
106
106
|
}
|
|
107
107
|
return n;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function E(e) {
|
|
110
110
|
for (var t = 1; t < arguments.length; t++) {
|
|
111
111
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
112
|
-
t % 2 ?
|
|
113
|
-
|
|
114
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
112
|
+
t % 2 ? T(Object(n), !0).forEach(function(t) {
|
|
113
|
+
w(e, t, n[t]);
|
|
114
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : T(Object(n)).forEach(function(t) {
|
|
115
115
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
116
116
|
});
|
|
117
117
|
}
|
|
@@ -119,107 +119,41 @@ function T(e) {
|
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/core/config.ts
|
|
122
|
-
var
|
|
123
|
-
let n =
|
|
122
|
+
var D = "http://localhost:4318", ie = 60 * 1e3, ae = "unknown_service", O = (e) => e.replace(/\/+$/, ""), oe = (e, t) => {
|
|
123
|
+
let n = O(e || D);
|
|
124
124
|
return n.endsWith(`/v1/${t}`) ? n : n.endsWith("/v1") ? `${n}/${t}` : `${n}/v1/${t}`;
|
|
125
|
-
},
|
|
125
|
+
}, k = (e, t) => {
|
|
126
126
|
var n, r, i, a, o;
|
|
127
|
-
let s = e == null || (n = e.signals) == null ? void 0 : n[t], c = e == null || (r = e.signals) == null || (r = r.endpoints) == null ? void 0 : r[t], l = e != null && e.token || e != null && e.headers || s != null && s.headers ?
|
|
127
|
+
let s = e == null || (n = e.signals) == null ? void 0 : n[t], c = e == null || (r = e.signals) == null || (r = r.endpoints) == null ? void 0 : r[t], l = e != null && e.token || e != null && e.headers || s != null && s.headers ? E(E(E({}, e != null && e.token ? { Authorization: `Bearer ${e.token}` } : {}), (i = e == null ? void 0 : e.headers) == null ? {} : i), (a = s == null ? void 0 : s.headers) == null ? {} : a) : void 0;
|
|
128
128
|
return {
|
|
129
129
|
concurrencyLimit: s == null ? void 0 : s.concurrencyLimit,
|
|
130
|
-
endpoint: c ?
|
|
130
|
+
endpoint: c ? O(c) : oe((o = s == null ? void 0 : s.endpoint) == null ? e == null ? void 0 : e.endpoint : o, t),
|
|
131
131
|
headers: l,
|
|
132
132
|
timeoutMillis: s == null ? void 0 : s.timeoutMillis
|
|
133
133
|
};
|
|
134
|
-
},
|
|
135
|
-
var t;
|
|
136
|
-
return e ? A(typeof e == "boolean" ? {
|
|
137
|
-
maxBodySize: 10 * 1024,
|
|
138
|
-
redact: fe
|
|
139
|
-
} : {
|
|
140
|
-
maxBodySize: O(e.maxBodySize, 10 * 1024),
|
|
141
|
-
redact: (t = e.redact) == null ? fe : t
|
|
142
|
-
}) : k();
|
|
143
|
-
}, he = (e) => {
|
|
144
|
-
var t;
|
|
145
|
-
return {
|
|
146
|
-
action: typeof (e == null ? void 0 : e.action) == "object" ? A({ eventNames: (t = e.action.eventNames) == null ? [
|
|
147
|
-
"click",
|
|
148
|
-
"submit",
|
|
149
|
-
"keydown"
|
|
150
|
-
] : t }) : e != null && e.action ? A({ eventNames: [
|
|
151
|
-
"click",
|
|
152
|
-
"submit",
|
|
153
|
-
"keydown"
|
|
154
|
-
] }) : k(),
|
|
155
|
-
device: typeof (e == null ? void 0 : e.device) == "object" ? A({ storageKey: e.device.storageKey }) : (e == null ? void 0 : e.device) === !1 ? k() : A({}),
|
|
156
|
-
httpBody: me(e == null ? void 0 : e.httpBody),
|
|
157
|
-
session: typeof (e == null ? void 0 : e.session) == "object" ? A({
|
|
158
|
-
inactivityMs: O(e.session.inactivityMs, 1800 * 1e3),
|
|
159
|
-
maxLifetimeMs: O(e.session.maxLifetimeMs, 1440 * 60 * 1e3),
|
|
160
|
-
storageKey: e.session.storageKey
|
|
161
|
-
}) : (e == null ? void 0 : e.session) === !1 ? k() : A({
|
|
162
|
-
inactivityMs: 1800 * 1e3,
|
|
163
|
-
maxLifetimeMs: 1440 * 60 * 1e3
|
|
164
|
-
}),
|
|
165
|
-
pageView: pe(e == null ? void 0 : e.pageView),
|
|
166
|
-
resource: pe(e == null ? void 0 : e.resource),
|
|
167
|
-
error: typeof (e == null ? void 0 : e.error) == "object" ? A({
|
|
168
|
-
maxPerWindow: O(e.error.maxPerWindow, 5),
|
|
169
|
-
windowMs: O(e.error.windowMs, 6e4)
|
|
170
|
-
}) : (e == null ? void 0 : e.error) === !1 ? k() : A({
|
|
171
|
-
maxPerWindow: 5,
|
|
172
|
-
windowMs: 6e4
|
|
173
|
-
}),
|
|
174
|
-
webVitals: pe(e == null ? void 0 : e.webVitals),
|
|
175
|
-
blankScreen: typeof (e == null ? void 0 : e.blankScreen) == "object" ? A({
|
|
176
|
-
checkDelay: ue(e.blankScreen.checkDelay, 3e3),
|
|
177
|
-
ignoreSelectors: e.blankScreen.ignoreSelectors,
|
|
178
|
-
rootSelector: e.blankScreen.rootSelector,
|
|
179
|
-
threshold: de(e.blankScreen.threshold, .8)
|
|
180
|
-
}) : (e == null ? void 0 : e.blankScreen) === !1 ? k() : A({
|
|
181
|
-
checkDelay: 3e3,
|
|
182
|
-
threshold: .8
|
|
183
|
-
}),
|
|
184
|
-
websocket: j(e == null ? void 0 : e.websocket),
|
|
185
|
-
longTask: typeof (e == null ? void 0 : e.longTask) == "object" ? A({ threshold: ue(e.longTask.threshold, 50) }) : e != null && e.longTask ? A({ threshold: 50 }) : k(),
|
|
186
|
-
cspViolation: j(e == null ? void 0 : e.cspViolation),
|
|
187
|
-
routeTiming: j(e == null ? void 0 : e.routeTiming)
|
|
188
|
-
};
|
|
189
|
-
}, ge = (e) => {
|
|
190
|
-
var t, n, r, i, a, o, s, c;
|
|
191
|
-
return {
|
|
192
|
-
instrumentations: {
|
|
193
|
-
documentLoad: (t = e == null || (n = e.instrumentations) == null ? void 0 : n.documentLoad) == null ? !0 : t,
|
|
194
|
-
fetch: (r = e == null || (i = e.instrumentations) == null ? void 0 : i.fetch) == null ? !0 : r,
|
|
195
|
-
xhr: (a = e == null || (o = e.instrumentations) == null ? void 0 : o.xhr) == null ? !0 : a,
|
|
196
|
-
userInteraction: (s = e == null || (c = e.instrumentations) == null ? void 0 : c.userInteraction) == null ? !0 : s
|
|
197
|
-
},
|
|
198
|
-
plugins: he(e == null ? void 0 : e.plugins)
|
|
199
|
-
};
|
|
200
|
-
}, _e = (e) => e, ve = (e) => e, ye = (e) => {
|
|
134
|
+
}, se = (e) => typeof e != "number" || !Number.isFinite(e) ? 1 : Math.max(0, Math.min(1, e)), ce = (e) => e, le = (e) => e, ue = (e) => {
|
|
201
135
|
try {
|
|
202
136
|
return new URL(e, typeof location > "u" ? "http://localhost" : location.href).pathname || "/";
|
|
203
137
|
} catch (t) {
|
|
204
138
|
return e || "/";
|
|
205
139
|
}
|
|
206
|
-
},
|
|
140
|
+
}, de = (e) => {
|
|
207
141
|
var t, n;
|
|
208
142
|
return {
|
|
209
143
|
environment: (t = e == null ? void 0 : e.environment) == null ? "production" : t,
|
|
210
|
-
name: (n = e == null ? void 0 : e.name) == null ?
|
|
144
|
+
name: (n = e == null ? void 0 : e.name) == null ? ae : n,
|
|
211
145
|
version: e == null ? void 0 : e.version
|
|
212
146
|
};
|
|
213
|
-
},
|
|
147
|
+
}, fe = (e) => E(E({
|
|
214
148
|
[b.deploymentEnvironmentName]: e.environment,
|
|
215
149
|
"rum.provider": "blueking",
|
|
216
150
|
[b.serviceName]: e.name
|
|
217
|
-
}, e.version ? { [b.serviceVersion]: e.version } : {}), {}, { "telemetry.sdk.language": "webjs" }),
|
|
218
|
-
endpoint:
|
|
219
|
-
traces:
|
|
220
|
-
metrics:
|
|
221
|
-
logs:
|
|
222
|
-
}),
|
|
151
|
+
}, e.version ? { [b.serviceVersion]: e.version } : {}), {}, { "telemetry.sdk.language": "webjs" }), pe = (e) => ({
|
|
152
|
+
endpoint: O((e == null ? void 0 : e.endpoint) || D),
|
|
153
|
+
traces: k(e, "traces"),
|
|
154
|
+
metrics: k(e, "metrics"),
|
|
155
|
+
logs: k(e, "logs")
|
|
156
|
+
}), me = (e) => ({ rate: se(e == null ? void 0 : e.rate) }), he = (e) => {
|
|
223
157
|
var t, n, r, i, a, o, s, c, l, u, d, f;
|
|
224
158
|
return {
|
|
225
159
|
getPageAttributes: (t = (n = e.attributes) == null ? void 0 : n.page) == null ? (() => ({
|
|
@@ -231,35 +165,34 @@ var ae = "http://localhost:4318", oe = 60 * 1e3, se = "unknown_service", E = (e)
|
|
|
231
165
|
getCustomAttributes: (s = (c = e.attributes) == null ? void 0 : c.custom) == null ? (() => ({})) : s,
|
|
232
166
|
getViewPathGroup: (t) => {
|
|
233
167
|
var n, r, i;
|
|
234
|
-
return (n = (r = e.route) == null || (i = r.getPathGroup) == null ? void 0 : i.call(r, t)) == null ?
|
|
168
|
+
return (n = (r = e.route) == null || (i = r.getPathGroup) == null ? void 0 : i.call(r, t)) == null ? ue(t) : n;
|
|
235
169
|
},
|
|
236
|
-
redactAttributes: (l = (u = e.privacy) == null ? void 0 : u.redactAttributes) == null ?
|
|
237
|
-
redactUrl: (d = (f = e.privacy) == null ? void 0 : f.redactUrl) == null ?
|
|
170
|
+
redactAttributes: (l = (u = e.privacy) == null ? void 0 : u.redactAttributes) == null ? ce : l,
|
|
171
|
+
redactUrl: (d = (f = e.privacy) == null ? void 0 : f.redactUrl) == null ? le : d
|
|
238
172
|
};
|
|
239
|
-
},
|
|
173
|
+
}, ge = (e) => {
|
|
240
174
|
var t, n, r, i, a, o;
|
|
241
|
-
let s =
|
|
175
|
+
let s = de(e.app);
|
|
242
176
|
return {
|
|
243
177
|
app: s,
|
|
244
178
|
autoStart: (t = e.autoStart) == null ? !0 : t,
|
|
245
179
|
debug: (n = e.debug) == null ? !1 : n,
|
|
246
180
|
enabled: (r = e.enabled) == null ? !0 : r,
|
|
247
|
-
hooks:
|
|
248
|
-
instrumentations: (i = e.instrumentations) == null ?
|
|
249
|
-
metricIntervalMillis:
|
|
250
|
-
plugins: (a = e.plugins) == null ?
|
|
251
|
-
resourceAttributes:
|
|
252
|
-
|
|
253
|
-
sampling: Ce(e.sampling),
|
|
181
|
+
hooks: he(e),
|
|
182
|
+
instrumentations: (i = e.instrumentations) == null ? {} : i,
|
|
183
|
+
metricIntervalMillis: ie,
|
|
184
|
+
plugins: (a = e.plugins) == null ? {} : a,
|
|
185
|
+
resourceAttributes: fe(s),
|
|
186
|
+
sampling: me(e.sampling),
|
|
254
187
|
spanBatch: e.spanBatch,
|
|
255
188
|
spanProcessor: (o = e.spanProcessor) == null ? "batch" : o,
|
|
256
|
-
transport:
|
|
189
|
+
transport: pe(e.transport),
|
|
257
190
|
user: e.user
|
|
258
191
|
};
|
|
259
192
|
};
|
|
260
193
|
//#endregion
|
|
261
194
|
//#region \0@oxc-project+runtime@0.128.0/helpers/asyncToGenerator.js
|
|
262
|
-
function
|
|
195
|
+
function _e(e, t, n, r, i, a, o) {
|
|
263
196
|
try {
|
|
264
197
|
var s = e[a](o), c = s.value;
|
|
265
198
|
} catch (e) {
|
|
@@ -268,16 +201,16 @@ function Ee(e, t, n, r, i, a, o) {
|
|
|
268
201
|
}
|
|
269
202
|
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
270
203
|
}
|
|
271
|
-
function
|
|
204
|
+
function A(e) {
|
|
272
205
|
return function() {
|
|
273
206
|
var t = this, n = arguments;
|
|
274
207
|
return new Promise(function(r, i) {
|
|
275
208
|
var a = e.apply(t, n);
|
|
276
209
|
function o(e) {
|
|
277
|
-
|
|
210
|
+
_e(a, r, i, o, s, "next", e);
|
|
278
211
|
}
|
|
279
212
|
function s(e) {
|
|
280
|
-
|
|
213
|
+
_e(a, r, i, o, s, "throw", e);
|
|
281
214
|
}
|
|
282
215
|
o(void 0);
|
|
283
216
|
});
|
|
@@ -285,13 +218,13 @@ function M(e) {
|
|
|
285
218
|
}
|
|
286
219
|
//#endregion
|
|
287
220
|
//#region src/core/plugin.ts
|
|
288
|
-
var
|
|
221
|
+
var ve = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !== !1, ye = (e) => e, be = class {
|
|
289
222
|
constructor(e) {
|
|
290
|
-
|
|
223
|
+
w(this, "plugins", void 0), w(this, "startedPlugins", []), this.plugins = e;
|
|
291
224
|
}
|
|
292
225
|
flush() {
|
|
293
226
|
var e = this;
|
|
294
|
-
return
|
|
227
|
+
return A(function* () {
|
|
295
228
|
yield Promise.all(e.startedPlugins.map((e) => Promise.resolve().then(() => {
|
|
296
229
|
var t;
|
|
297
230
|
return (t = e.flush) == null ? void 0 : t.call(e);
|
|
@@ -300,7 +233,7 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
300
233
|
}
|
|
301
234
|
shutdown() {
|
|
302
235
|
var e = this;
|
|
303
|
-
return
|
|
236
|
+
return A(function* () {
|
|
304
237
|
let t = [...e.startedPlugins].reverse();
|
|
305
238
|
for (let e of t) {
|
|
306
239
|
var n;
|
|
@@ -311,8 +244,8 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
311
244
|
}
|
|
312
245
|
start(e) {
|
|
313
246
|
var t = this;
|
|
314
|
-
return
|
|
315
|
-
for (let r of t.plugins) if (
|
|
247
|
+
return A(function* () {
|
|
248
|
+
for (let r of t.plugins) if (ve(r, e.config)) try {
|
|
316
249
|
yield r.init(e), t.startedPlugins.push(r);
|
|
317
250
|
} catch (t) {
|
|
318
251
|
if (e.config.debug) {
|
|
@@ -322,35 +255,35 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
322
255
|
}
|
|
323
256
|
})();
|
|
324
257
|
}
|
|
325
|
-
},
|
|
258
|
+
}, j = () => typeof window > "u" ? "http://localhost" : window.location.origin, xe = (e) => {
|
|
326
259
|
try {
|
|
327
|
-
return new URL(e,
|
|
260
|
+
return new URL(e, j()).href;
|
|
328
261
|
} catch (t) {
|
|
329
262
|
return e;
|
|
330
263
|
}
|
|
331
|
-
},
|
|
332
|
-
let n = (e) =>
|
|
264
|
+
}, Se = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, Ce = (e, t) => {
|
|
265
|
+
let n = (e) => Se(e.replace(/[?#].*$/, ""));
|
|
333
266
|
return n(e) === n(t);
|
|
334
|
-
},
|
|
267
|
+
}, we = (e) => {
|
|
335
268
|
try {
|
|
336
|
-
return new URL(e,
|
|
269
|
+
return new URL(e, j()).origin === j();
|
|
337
270
|
} catch (e) {
|
|
338
271
|
return !1;
|
|
339
272
|
}
|
|
340
|
-
},
|
|
341
|
-
let n =
|
|
273
|
+
}, Te = (e, t) => {
|
|
274
|
+
let n = xe(t);
|
|
342
275
|
return [
|
|
343
276
|
e.transport.traces.endpoint,
|
|
344
277
|
e.transport.metrics.endpoint,
|
|
345
278
|
e.transport.logs.endpoint
|
|
346
|
-
].some((e) =>
|
|
347
|
-
},
|
|
348
|
-
for (let n of
|
|
279
|
+
].some((e) => Ce(n, xe(e)));
|
|
280
|
+
}, M = (e, t) => Te(e, t), Ee = (e, t) => we(t), De = ["http.url", "url.full"], Oe = (e) => {
|
|
281
|
+
for (let n of De) {
|
|
349
282
|
var t;
|
|
350
283
|
let r = (t = e.attributes) == null ? void 0 : t[n];
|
|
351
284
|
if (typeof r == "string") return r;
|
|
352
285
|
}
|
|
353
|
-
},
|
|
286
|
+
}, ke = class {
|
|
354
287
|
constructor(e, t) {
|
|
355
288
|
this.inner = e, this.config = t;
|
|
356
289
|
}
|
|
@@ -358,8 +291,8 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
358
291
|
return this.inner.forceFlush();
|
|
359
292
|
}
|
|
360
293
|
onEnd(e) {
|
|
361
|
-
let t =
|
|
362
|
-
t &&
|
|
294
|
+
let t = Oe(e);
|
|
295
|
+
t && Te(this.config, t) || this.inner.onEnd(e);
|
|
363
296
|
}
|
|
364
297
|
onStart(e, t) {
|
|
365
298
|
this.inner.onStart(e, t);
|
|
@@ -367,15 +300,15 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
367
300
|
shutdown() {
|
|
368
301
|
return this.inner.shutdown();
|
|
369
302
|
}
|
|
370
|
-
},
|
|
303
|
+
}, Ae = class {
|
|
371
304
|
constructor(e = {}, t) {
|
|
372
|
-
|
|
305
|
+
w(this, "attributes", {}), w(this, "setOptionalAttribute", (e, t) => {
|
|
373
306
|
if (t === void 0) {
|
|
374
307
|
delete this.attributes[e];
|
|
375
308
|
return;
|
|
376
309
|
}
|
|
377
310
|
this.attributes[e] = t;
|
|
378
|
-
}),
|
|
311
|
+
}), w(this, "user", {}), w(this, "view", {}), w(this, "getAttributes", () => E({}, this.attributes)), w(this, "getUser", () => E({}, this.user)), w(this, "getView", () => E({}, this.view)), w(this, "setAttributes", (e) => {
|
|
379
312
|
for (let [t, n] of Object.entries(e)) {
|
|
380
313
|
if (n === void 0) {
|
|
381
314
|
delete this.attributes[t];
|
|
@@ -383,25 +316,25 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
383
316
|
}
|
|
384
317
|
this.attributes[t] = n;
|
|
385
318
|
}
|
|
386
|
-
}),
|
|
387
|
-
if (this.user =
|
|
319
|
+
}), w(this, "setUser", (e) => {
|
|
320
|
+
if (this.user = E(E({}, this.user), e), "id" in e) {
|
|
388
321
|
if (e.id === void 0) {
|
|
389
322
|
delete this.attributes[b.userId];
|
|
390
323
|
return;
|
|
391
324
|
}
|
|
392
325
|
this.attributes[b.userId] = e.id;
|
|
393
326
|
}
|
|
394
|
-
}),
|
|
395
|
-
this.view =
|
|
327
|
+
}), w(this, "setView", (e) => {
|
|
328
|
+
this.view = E(E({}, this.view), e), this.setOptionalAttribute(b.viewId, e.id), this.setOptionalAttribute(b.viewUrl, e.url), this.setOptionalAttribute(b.viewUrlPathGroup, e.urlPathGroup), this.setOptionalAttribute(b.viewLoadingType, e.loadingType);
|
|
396
329
|
}), this.setAttributes(e), t && this.setUser(t);
|
|
397
330
|
}
|
|
398
|
-
},
|
|
331
|
+
}, N = {
|
|
399
332
|
abort: "abort",
|
|
400
333
|
error: "error",
|
|
401
334
|
success: "success",
|
|
402
335
|
timeout: "timeout",
|
|
403
336
|
warning: "warning"
|
|
404
|
-
},
|
|
337
|
+
}, P = {
|
|
405
338
|
action: "action",
|
|
406
339
|
custom: "custom",
|
|
407
340
|
document: "document",
|
|
@@ -411,7 +344,7 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
411
344
|
resource: "resource",
|
|
412
345
|
route: "route",
|
|
413
346
|
vital: "vital"
|
|
414
|
-
},
|
|
347
|
+
}, je = (e) => e < 100 ? "<100ms" : e < 500 ? "100~500ms" : e < 2e3 ? "500ms~2s" : ">2s", Me = (e) => `${Math.trunc(e / 100)}xx`, Ne = (e) => e === 408 || e === 504 ? N.timeout : typeof e == "number" && e >= 400 ? N.error : N.success, Pe = (e) => e === 408 || e === 504 ? "network_timeout" : typeof e != "number" || e < 400 ? "none" : e >= 500 ? "http_5xx" : "http_4xx", Fe = (e) => e === "good" ? N.success : N.warning, Ie = (e, t) => {
|
|
415
348
|
if (!e) return {};
|
|
416
349
|
try {
|
|
417
350
|
let n = new URL(e, typeof location > "u" ? "http://localhost" : location.href), r = t == null ? n.pathname : t;
|
|
@@ -426,78 +359,82 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
426
359
|
pathTemplate: t == null ? e : t
|
|
427
360
|
};
|
|
428
361
|
}
|
|
429
|
-
},
|
|
362
|
+
}, F = ({ duration: e, errorType: t = "none", eventLabel: n, result: r = N.success, spanSubtype: i, spanType: a, targetLabel: o, targetValue: s, traceScene: c }) => E(E(E(E(E({
|
|
430
363
|
[b.spanType]: a,
|
|
431
364
|
[b.spanSubtype]: i,
|
|
432
365
|
[b.result]: r,
|
|
433
366
|
[b.errorType]: t
|
|
434
|
-
}, e === void 0 ? {} : { [b.durationBucket]:
|
|
435
|
-
let o =
|
|
436
|
-
return
|
|
367
|
+
}, e === void 0 ? {} : { [b.durationBucket]: je(e) }), n === void 0 ? {} : { [b.eventLabel]: n }), o === void 0 ? {} : { [b.targetLabel]: o }), s === void 0 ? {} : { [b.targetValue]: s }), c === void 0 ? {} : { [b.traceScene]: c }), Le = ({ duration: e, method: t, statusCode: n, subtype: r, url: i, urlPathTemplate: a }) => {
|
|
368
|
+
let o = Ie(i, a);
|
|
369
|
+
return E(E(E(E(E({}, F({
|
|
437
370
|
duration: e,
|
|
438
|
-
errorType:
|
|
371
|
+
errorType: Pe(n),
|
|
439
372
|
eventLabel: "API 调用",
|
|
440
|
-
result:
|
|
373
|
+
result: Ne(n),
|
|
441
374
|
spanSubtype: r,
|
|
442
|
-
spanType:
|
|
375
|
+
spanType: P.http,
|
|
443
376
|
targetLabel: o.label,
|
|
444
377
|
targetValue: n
|
|
445
378
|
})), t ? { "http.request.method": t.toUpperCase() } : {}), o.domain ? { [b.targetDomain]: o.domain } : {}), o.pathTemplate ? { [b.targetPathTemplate]: o.pathTemplate } : {}), typeof n == "number" ? {
|
|
446
379
|
"http.response.status_code": n,
|
|
447
|
-
[b.statusClass]:
|
|
380
|
+
[b.statusClass]: Me(n)
|
|
448
381
|
} : {});
|
|
449
|
-
},
|
|
382
|
+
}, Re = ({ duration: e, initiatorType: t = "other", responseStatus: n, transferSize: r, url: i, urlPathTemplate: a }) => {
|
|
450
383
|
var o;
|
|
451
|
-
let s =
|
|
452
|
-
return
|
|
384
|
+
let s = Ie(i, a), c = typeof n == "number" ? Ne(n) : N.success;
|
|
385
|
+
return E(E(E(E({}, F({
|
|
453
386
|
duration: e,
|
|
454
|
-
errorType: typeof n == "number" ?
|
|
387
|
+
errorType: typeof n == "number" ? Pe(n) : "none",
|
|
455
388
|
eventLabel: "静态资源",
|
|
456
389
|
result: c,
|
|
457
390
|
spanSubtype: t,
|
|
458
|
-
spanType:
|
|
391
|
+
spanType: P.resource,
|
|
459
392
|
targetLabel: (o = s.label) == null ? i : o,
|
|
460
393
|
targetValue: r
|
|
461
394
|
})), s.domain ? { [b.targetDomain]: s.domain } : {}), s.pathTemplate ? { [b.targetPathTemplate]: s.pathTemplate } : {}), typeof n == "number" ? {
|
|
462
395
|
"http.response.status_code": n,
|
|
463
|
-
[b.statusClass]:
|
|
396
|
+
[b.statusClass]: Me(n)
|
|
464
397
|
} : {});
|
|
465
|
-
},
|
|
398
|
+
}, ze = [
|
|
399
|
+
"click",
|
|
400
|
+
"submit",
|
|
401
|
+
"keydown"
|
|
402
|
+
], Be = (e) => e instanceof Element ? e : void 0, Ve = (e) => {
|
|
466
403
|
var t;
|
|
467
404
|
if (!e) return;
|
|
468
405
|
let n = ((t = e.textContent) == null ? void 0 : t.trim()) || e.getAttribute("aria-label") || e.getAttribute("title") || "";
|
|
469
406
|
return n ? n.slice(0, 32) : void 0;
|
|
470
|
-
},
|
|
471
|
-
|
|
407
|
+
}, He = (e = {}) => {
|
|
408
|
+
var t;
|
|
409
|
+
let n = [], r = (t = e.eventNames) == null ? ze : t;
|
|
472
410
|
return {
|
|
473
411
|
name: "action",
|
|
474
|
-
|
|
475
|
-
init(n) {
|
|
412
|
+
init(e) {
|
|
476
413
|
if (typeof window > "u") return;
|
|
477
|
-
let
|
|
414
|
+
let t = {
|
|
478
415
|
capture: !0,
|
|
479
416
|
passive: !0
|
|
480
|
-
}, i = (
|
|
481
|
-
var
|
|
482
|
-
let r =
|
|
483
|
-
|
|
417
|
+
}, i = (t) => {
|
|
418
|
+
var n;
|
|
419
|
+
let r = Be(t.target), i = Ve(r), a = r == null ? void 0 : r.tagName.toLowerCase();
|
|
420
|
+
e.startSpan(`action.${t.type}`, E(E(E(E({}, e.config.hooks.getPageAttributes()), F({
|
|
484
421
|
errorType: "none",
|
|
485
422
|
eventLabel: "用户操作",
|
|
486
|
-
spanSubtype:
|
|
487
|
-
spanType:
|
|
488
|
-
targetLabel: (
|
|
489
|
-
})), {}, { [b.actionType]:
|
|
423
|
+
spanSubtype: t.type,
|
|
424
|
+
spanType: P.action,
|
|
425
|
+
targetLabel: (n = i == null ? a : i) == null ? t.type : n
|
|
426
|
+
})), {}, { [b.actionType]: t.type }, i ? { [b.targetTextShort]: i } : {}), a ? { [b.targetTag]: a } : {})).end();
|
|
490
427
|
};
|
|
491
|
-
for (let
|
|
428
|
+
for (let e of r) window.addEventListener(e, i, t), n.push(() => window.removeEventListener(e, i, t));
|
|
492
429
|
},
|
|
493
430
|
shutdown() {
|
|
494
|
-
for (;
|
|
431
|
+
for (; n.length;) {
|
|
495
432
|
var e;
|
|
496
|
-
(e =
|
|
433
|
+
(e = n.pop()) == null || e();
|
|
497
434
|
}
|
|
498
435
|
}
|
|
499
436
|
};
|
|
500
|
-
},
|
|
437
|
+
}, Ue = "body", We = 3e3, Ge = .8, Ke = [
|
|
501
438
|
"[data-loading=\"true\"]",
|
|
502
439
|
"[aria-busy=\"true\"]",
|
|
503
440
|
".loading",
|
|
@@ -505,96 +442,95 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
505
442
|
".spinner",
|
|
506
443
|
".skeleton",
|
|
507
444
|
".bk-loading"
|
|
508
|
-
],
|
|
445
|
+
], I = [
|
|
509
446
|
[.5, .5],
|
|
510
447
|
[.25, .25],
|
|
511
448
|
[.75, .25],
|
|
512
449
|
[.25, .75],
|
|
513
450
|
[.75, .75]
|
|
514
|
-
],
|
|
451
|
+
], qe = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, Je = (e, t) => typeof e != "number" || !Number.isFinite(e) ? t : Math.max(0, Math.min(1, e)), Ye = (e) => {
|
|
515
452
|
if (!e) return "";
|
|
516
453
|
let t = e.tagName.toLowerCase();
|
|
517
454
|
return e.id ? `${t}#${e.id}` : t;
|
|
518
|
-
},
|
|
455
|
+
}, Xe = (e, t) => e ? t.some((t) => {
|
|
519
456
|
try {
|
|
520
457
|
return e.matches(t) || !!e.closest(t);
|
|
521
458
|
} catch (e) {
|
|
522
459
|
return !1;
|
|
523
460
|
}
|
|
524
|
-
}) : !1,
|
|
461
|
+
}) : !1, Ze = (e) => {
|
|
525
462
|
if (typeof document > "u") return () => {};
|
|
526
463
|
if (document.readyState === "complete" || document.readyState === "interactive") return e(), () => {};
|
|
527
464
|
let t = () => {
|
|
528
465
|
document.removeEventListener("DOMContentLoaded", t), e();
|
|
529
466
|
};
|
|
530
467
|
return document.addEventListener("DOMContentLoaded", t), () => document.removeEventListener("DOMContentLoaded", t);
|
|
531
|
-
},
|
|
532
|
-
|
|
468
|
+
}, Qe = (e = {}) => {
|
|
469
|
+
var t, n;
|
|
470
|
+
let r, i, a = !1, o = {
|
|
471
|
+
checkDelay: qe(e.checkDelay, We),
|
|
472
|
+
ignoreSelectors: (t = e.ignoreSelectors) == null ? [] : t,
|
|
473
|
+
rootSelector: (n = e.rootSelector) == null ? Ue : n,
|
|
474
|
+
threshold: Je(e.threshold, Ge)
|
|
475
|
+
};
|
|
533
476
|
return {
|
|
534
477
|
name: "blank-screen",
|
|
535
|
-
|
|
536
|
-
init(i) {
|
|
537
|
-
var a, s;
|
|
478
|
+
init(e) {
|
|
538
479
|
if (typeof window > "u" || typeof document > "u") return;
|
|
539
|
-
let
|
|
480
|
+
let { checkDelay: t, rootSelector: n, threshold: s } = o, c = [...Ke, ...o.ignoreSelectors], l = e.meter.createCounter("browser.blank_screen.count", { description: "Number of suspected blank screen detections" }), u = () => {
|
|
540
481
|
try {
|
|
541
|
-
var
|
|
542
|
-
let
|
|
543
|
-
for (let [e, t] of
|
|
544
|
-
let
|
|
545
|
-
if (
|
|
546
|
-
|
|
482
|
+
var t, r;
|
|
483
|
+
let i = document.querySelector(n), a = 0, o = 0;
|
|
484
|
+
for (let [e, t] of I) {
|
|
485
|
+
let n = document.elementFromPoint(window.innerWidth * e, window.innerHeight * t);
|
|
486
|
+
if (Xe(n, c)) {
|
|
487
|
+
o += 1;
|
|
547
488
|
continue;
|
|
548
489
|
}
|
|
549
|
-
(
|
|
490
|
+
(n === i || n === document.body || n === document.documentElement) && (a += 1);
|
|
550
491
|
}
|
|
551
|
-
let
|
|
552
|
-
if (
|
|
553
|
-
let
|
|
554
|
-
errorType:
|
|
492
|
+
let u = I.length - o;
|
|
493
|
+
if (u === 0) return;
|
|
494
|
+
let d = a / u, f = d >= s, p = Ye(document.elementFromPoint(window.innerWidth / 2, window.innerHeight / 2)), m = E(E({}, F({
|
|
495
|
+
errorType: f ? "blank_screen" : "none",
|
|
555
496
|
eventLabel: "白屏",
|
|
556
|
-
result:
|
|
497
|
+
result: f ? N.error : N.success,
|
|
557
498
|
spanSubtype: "blank_screen",
|
|
558
|
-
spanType:
|
|
559
|
-
targetLabel:
|
|
560
|
-
targetValue:
|
|
499
|
+
spanType: P.error,
|
|
500
|
+
targetLabel: n,
|
|
501
|
+
targetValue: d
|
|
561
502
|
})), {}, {
|
|
562
|
-
"blank_screen.score":
|
|
563
|
-
"blank_screen.threshold":
|
|
564
|
-
"blank_screen.root":
|
|
565
|
-
"blank_screen.detected":
|
|
566
|
-
"blank_screen.sample_total":
|
|
567
|
-
"blank_screen.sample_valid":
|
|
568
|
-
"blank_screen.sample_loading":
|
|
569
|
-
"blank_screen.center_element":
|
|
570
|
-
"blank_screen.dom_node_count": (
|
|
503
|
+
"blank_screen.score": d,
|
|
504
|
+
"blank_screen.threshold": s,
|
|
505
|
+
"blank_screen.root": n,
|
|
506
|
+
"blank_screen.detected": f,
|
|
507
|
+
"blank_screen.sample_total": I.length,
|
|
508
|
+
"blank_screen.sample_valid": u,
|
|
509
|
+
"blank_screen.sample_loading": o,
|
|
510
|
+
"blank_screen.center_element": p,
|
|
511
|
+
"blank_screen.dom_node_count": (t = (r = document.body) == null ? void 0 : r.getElementsByTagName("*").length) == null ? 0 : t
|
|
571
512
|
});
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}));
|
|
578
|
-
} catch (e) {
|
|
579
|
-
if (i.config.debug) {
|
|
580
|
-
var n;
|
|
581
|
-
(n = globalThis.console) == null || n.warn("[bk-ot][blank-screen] detection failed:", e);
|
|
513
|
+
f && (l.add(1, e.applyRedact({ "blank_screen.root": n })), e.startSpan("browser.blank_screen", m).end());
|
|
514
|
+
} catch (t) {
|
|
515
|
+
if (e.config.debug) {
|
|
516
|
+
var i;
|
|
517
|
+
(i = globalThis.console) == null || i.warn("[bk-ot][blank-screen] detection failed:", t);
|
|
582
518
|
}
|
|
583
519
|
}
|
|
584
520
|
};
|
|
585
|
-
|
|
586
|
-
|
|
521
|
+
i = Ze(() => {
|
|
522
|
+
a || (r = window.setTimeout(u, t));
|
|
587
523
|
});
|
|
588
524
|
},
|
|
589
525
|
shutdown() {
|
|
590
|
-
|
|
526
|
+
a = !0, i == null || i(), i = void 0, r !== void 0 && typeof window < "u" && (window.clearTimeout(r), r = void 0);
|
|
591
527
|
}
|
|
592
528
|
};
|
|
593
|
-
},
|
|
529
|
+
}, $e = ["http.url", "url.full"], et = ["http.status_code", "http.response.status_code"], tt = ["http.method", "http.request.method"], nt = (e) => ({ test: e }), rt = (e, t, n) => {
|
|
594
530
|
var r;
|
|
595
531
|
t.setAttributes(e.applyRedact(e.config.hooks.getPageAttributes()));
|
|
596
532
|
let i;
|
|
597
|
-
for (let n of
|
|
533
|
+
for (let n of $e) {
|
|
598
534
|
var a;
|
|
599
535
|
let r = (a = t.attributes) == null ? void 0 : a[n];
|
|
600
536
|
if (typeof r == "string") {
|
|
@@ -602,35 +538,35 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
602
538
|
typeof a == "string" && (i = a, t.setAttribute(n, a));
|
|
603
539
|
}
|
|
604
540
|
}
|
|
605
|
-
let o =
|
|
541
|
+
let o = et.map((e) => {
|
|
606
542
|
var n;
|
|
607
543
|
return (n = t.attributes) == null ? void 0 : n[e];
|
|
608
|
-
}).find((e) => typeof e == "number"), s =
|
|
544
|
+
}).find((e) => typeof e == "number"), s = tt.map((e) => {
|
|
609
545
|
var n;
|
|
610
546
|
return (n = t.attributes) == null ? void 0 : n[e];
|
|
611
|
-
}).find((e) => typeof e == "string"), c = (r = i) == null ?
|
|
547
|
+
}).find((e) => typeof e == "string"), c = (r = i) == null ? $e.map((e) => {
|
|
612
548
|
var n;
|
|
613
549
|
return (n = t.attributes) == null ? void 0 : n[e];
|
|
614
550
|
}).find((e) => typeof e == "string") : r;
|
|
615
|
-
t.setAttributes(e.applyRedact(
|
|
551
|
+
t.setAttributes(e.applyRedact(Le({
|
|
616
552
|
method: s,
|
|
617
553
|
statusCode: o,
|
|
618
554
|
subtype: n,
|
|
619
555
|
url: c,
|
|
620
556
|
urlPathTemplate: c ? e.config.hooks.getViewPathGroup(c) : void 0
|
|
621
557
|
})));
|
|
622
|
-
},
|
|
623
|
-
t.setAttributes(e.applyRedact(
|
|
558
|
+
}, it = (e, t, n) => {
|
|
559
|
+
t.setAttributes(e.applyRedact(E(E({}, e.config.hooks.getPageAttributes()), F({
|
|
624
560
|
errorType: "none",
|
|
625
561
|
eventLabel: "文档加载",
|
|
626
562
|
spanSubtype: n,
|
|
627
|
-
spanType:
|
|
563
|
+
spanType: P.document,
|
|
628
564
|
targetLabel: e.config.hooks.getViewPathGroup(typeof location > "u" ? "" : location.href),
|
|
629
565
|
traceScene: "page_load"
|
|
630
566
|
}))));
|
|
631
|
-
},
|
|
567
|
+
}, at = (e, t, n) => {
|
|
632
568
|
let r = e.config.hooks.redactUrl(n.name);
|
|
633
|
-
t.setAttributes(e.applyRedact(
|
|
569
|
+
t.setAttributes(e.applyRedact(E(E(E({}, e.config.hooks.getPageAttributes()), Re({
|
|
634
570
|
duration: n.duration,
|
|
635
571
|
initiatorType: n.initiatorType || "other",
|
|
636
572
|
responseStatus: n.responseStatus,
|
|
@@ -638,57 +574,63 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
638
574
|
url: r,
|
|
639
575
|
urlPathTemplate: e.config.hooks.getViewPathGroup(n.name)
|
|
640
576
|
})), {}, { "url.full": r })));
|
|
641
|
-
},
|
|
642
|
-
|
|
577
|
+
}, ot = (e = {}) => {
|
|
578
|
+
var t, n, r, i;
|
|
579
|
+
let a = [], o = {
|
|
580
|
+
documentLoad: (t = e.documentLoad) == null ? !0 : t,
|
|
581
|
+
fetch: (n = e.fetch) == null ? !0 : n,
|
|
582
|
+
xhr: (r = e.xhr) == null ? !0 : r,
|
|
583
|
+
userInteraction: (i = e.userInteraction) == null ? !0 : i
|
|
584
|
+
};
|
|
643
585
|
return {
|
|
644
586
|
name: "official-instrumentations",
|
|
645
|
-
enabled: !!(
|
|
646
|
-
init(
|
|
647
|
-
return
|
|
648
|
-
let
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
587
|
+
enabled: !!(o.documentLoad || o.fetch || o.xhr || o.userInteraction),
|
|
588
|
+
init(e) {
|
|
589
|
+
return A(function* () {
|
|
590
|
+
let t = [nt((t) => M(e.config, t))], n = [nt((t) => Ee(e.config, t))], [r, i, s, c] = yield Promise.all([
|
|
591
|
+
o.documentLoad ? import("@opentelemetry/instrumentation-document-load") : Promise.resolve(null),
|
|
592
|
+
o.fetch ? import("@opentelemetry/instrumentation-fetch") : Promise.resolve(null),
|
|
593
|
+
o.xhr ? import("@opentelemetry/instrumentation-xml-http-request") : Promise.resolve(null),
|
|
594
|
+
o.userInteraction ? import("@opentelemetry/instrumentation-user-interaction") : Promise.resolve(null)
|
|
653
595
|
]);
|
|
654
|
-
if (
|
|
596
|
+
if (r && a.push(new r.DocumentLoadInstrumentation({
|
|
655
597
|
semconvStabilityOptIn: "http",
|
|
656
598
|
applyCustomAttributesOnSpan: {
|
|
657
|
-
documentLoad: (
|
|
658
|
-
documentFetch: (
|
|
659
|
-
resourceFetch: (
|
|
599
|
+
documentLoad: (t) => it(e, t, "navigate"),
|
|
600
|
+
documentFetch: (t) => it(e, t, "document_fetch"),
|
|
601
|
+
resourceFetch: (t, n) => at(e, t, n)
|
|
660
602
|
}
|
|
661
|
-
})),
|
|
662
|
-
applyCustomAttributesOnSpan: (
|
|
663
|
-
ignoreUrls:
|
|
664
|
-
propagateTraceHeaderCorsUrls:
|
|
603
|
+
})), i && a.push(new i.FetchInstrumentation({
|
|
604
|
+
applyCustomAttributesOnSpan: (t) => rt(e, t, "fetch"),
|
|
605
|
+
ignoreUrls: t,
|
|
606
|
+
propagateTraceHeaderCorsUrls: n,
|
|
665
607
|
semconvStabilityOptIn: "http",
|
|
666
608
|
ignoreNetworkEvents: !1
|
|
667
|
-
})), s &&
|
|
668
|
-
applyCustomAttributesOnSpan: (
|
|
669
|
-
ignoreUrls:
|
|
670
|
-
propagateTraceHeaderCorsUrls:
|
|
609
|
+
})), s && a.push(new s.XMLHttpRequestInstrumentation({
|
|
610
|
+
applyCustomAttributesOnSpan: (t) => rt(e, t, "xhr"),
|
|
611
|
+
ignoreUrls: t,
|
|
612
|
+
propagateTraceHeaderCorsUrls: n,
|
|
671
613
|
semconvStabilityOptIn: "http",
|
|
672
614
|
ignoreNetworkEvents: !1
|
|
673
615
|
})), c) {
|
|
674
|
-
let
|
|
675
|
-
|
|
616
|
+
let e = o.userInteraction !== null && typeof o.userInteraction == "object" ? { eventNames: o.userInteraction.eventNames } : void 0;
|
|
617
|
+
a.push(new c.UserInteractionInstrumentation(e));
|
|
676
618
|
}
|
|
677
|
-
p({ instrumentations:
|
|
619
|
+
p({ instrumentations: a });
|
|
678
620
|
})();
|
|
679
621
|
},
|
|
680
622
|
shutdown() {
|
|
681
|
-
for (;
|
|
682
|
-
var e,
|
|
683
|
-
(e =
|
|
623
|
+
for (; a.length;) {
|
|
624
|
+
var e, t;
|
|
625
|
+
(e = a.pop()) == null || (t = e.disable) == null || t.call(e);
|
|
684
626
|
}
|
|
685
627
|
}
|
|
686
628
|
};
|
|
687
|
-
},
|
|
629
|
+
}, st = (e) => {
|
|
688
630
|
let t = 5381;
|
|
689
631
|
for (let n = 0; n < e.length; n++) t = t * 33 ^ e.charCodeAt(n);
|
|
690
632
|
return (t >>> 0).toString(36);
|
|
691
|
-
},
|
|
633
|
+
}, ct = (e, t) => {
|
|
692
634
|
let n = /* @__PURE__ */ new Map(), r = 0, i = (t) => {
|
|
693
635
|
if (!(t - r < e)) {
|
|
694
636
|
r = t;
|
|
@@ -710,54 +652,48 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
710
652
|
count: o.count
|
|
711
653
|
});
|
|
712
654
|
} };
|
|
713
|
-
},
|
|
714
|
-
if (t) return
|
|
715
|
-
},
|
|
716
|
-
let
|
|
655
|
+
}, lt = 6e4, ut = 5, dt = /^https?:|^\/\//i, ft = (e, t) => {
|
|
656
|
+
if (t) return dt.test(t) ? e(t) : t;
|
|
657
|
+
}, pt = () => {
|
|
658
|
+
let e;
|
|
717
659
|
return {
|
|
718
660
|
name: "csp-violation",
|
|
719
|
-
|
|
720
|
-
init(e) {
|
|
661
|
+
init(t) {
|
|
721
662
|
if (typeof window > "u" || typeof document > "u") return;
|
|
722
|
-
let n =
|
|
723
|
-
let r =
|
|
663
|
+
let n = ct(lt, ut), r = (e) => {
|
|
664
|
+
let r = st(`${e.violatedDirective}|${e.blockedURI}|${e.sourceFile}|${e.lineNumber}`), i = n.allow(r);
|
|
724
665
|
if (!i.allowed) return;
|
|
725
|
-
let a =
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
"csp.window_count": i.count,
|
|
749
|
-
[b.exceptionFingerprint]: r,
|
|
750
|
-
"error.source": "csp"
|
|
751
|
-
}, c ? { "csp.original_policy": t.originalPolicy } : {})
|
|
752
|
-
});
|
|
666
|
+
let a = ft(t.config.hooks.redactUrl, e.blockedURI), o = e.sourceFile ? t.config.hooks.redactUrl(e.sourceFile) : void 0, s = i.count === 1;
|
|
667
|
+
t.startSpan("csp.violation", E(E(E({}, t.config.hooks.getPageAttributes()), F({
|
|
668
|
+
errorType: "csp",
|
|
669
|
+
eventLabel: "CSP 错误",
|
|
670
|
+
result: N.error,
|
|
671
|
+
spanSubtype: "csp",
|
|
672
|
+
spanType: P.error,
|
|
673
|
+
targetLabel: a == null ? e.effectiveDirective : a,
|
|
674
|
+
targetValue: e.statusCode
|
|
675
|
+
})), {}, {
|
|
676
|
+
"csp.blocked_uri": a,
|
|
677
|
+
"csp.violated_directive": e.violatedDirective,
|
|
678
|
+
"csp.effective_directive": e.effectiveDirective,
|
|
679
|
+
"csp.disposition": e.disposition,
|
|
680
|
+
"csp.source_file": o,
|
|
681
|
+
"csp.line_number": e.lineNumber,
|
|
682
|
+
"csp.column_number": e.columnNumber,
|
|
683
|
+
"csp.status_code": e.statusCode,
|
|
684
|
+
"csp.fingerprint": r,
|
|
685
|
+
"csp.window_count": i.count,
|
|
686
|
+
[b.exceptionFingerprint]: r,
|
|
687
|
+
"error.source": "csp"
|
|
688
|
+
}, s ? { "csp.original_policy": e.originalPolicy } : {})).end();
|
|
753
689
|
};
|
|
754
|
-
document.addEventListener("securitypolicyviolation", r),
|
|
690
|
+
document.addEventListener("securitypolicyviolation", r), e = () => document.removeEventListener("securitypolicyviolation", r);
|
|
755
691
|
},
|
|
756
692
|
shutdown() {
|
|
757
|
-
|
|
693
|
+
e == null || e(), e = void 0;
|
|
758
694
|
}
|
|
759
695
|
};
|
|
760
|
-
},
|
|
696
|
+
}, L = (e) => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${e}-${Date.now()}-${Math.random().toString(16).slice(2)}`, mt = "BK_RUM_DEVICE_ID", ht = 250, gt = () => navigator.connection, _t = () => navigator.userAgentData, vt = (e) => {
|
|
761
697
|
for (let [t, n] of [
|
|
762
698
|
["Edge", /Edg\/([\d.]+)/],
|
|
763
699
|
["Chrome", /Chrome\/([\d.]+)/],
|
|
@@ -774,21 +710,21 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
774
710
|
name: "Other",
|
|
775
711
|
version: void 0
|
|
776
712
|
};
|
|
777
|
-
},
|
|
713
|
+
}, yt = (e, t) => {
|
|
778
714
|
let n = `${t == null ? "" : t} ${e}`;
|
|
779
715
|
return /iphone|ipad|ipod/i.test(n) ? "iOS" : /android/i.test(n) ? "Android" : /mac/i.test(n) ? "macOS" : /win/i.test(n) ? "Windows" : /linux/i.test(n) ? "Linux" : "Other";
|
|
780
|
-
},
|
|
716
|
+
}, bt = (e) => {
|
|
781
717
|
let t = null;
|
|
782
718
|
try {
|
|
783
719
|
t = window.localStorage.getItem(e);
|
|
784
720
|
} catch (e) {}
|
|
785
721
|
if (t) return t;
|
|
786
|
-
let n =
|
|
722
|
+
let n = L("device");
|
|
787
723
|
try {
|
|
788
724
|
window.localStorage.setItem(e, n);
|
|
789
725
|
} catch (e) {}
|
|
790
726
|
return n;
|
|
791
|
-
},
|
|
727
|
+
}, xt = () => {
|
|
792
728
|
var e, t;
|
|
793
729
|
return typeof window > "u" ? {} : {
|
|
794
730
|
"browser.viewport.width": window.innerWidth,
|
|
@@ -796,8 +732,8 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
796
732
|
"browser.screen.width": (e = window.screen) == null ? void 0 : e.width,
|
|
797
733
|
"browser.screen.height": (t = window.screen) == null ? void 0 : t.height
|
|
798
734
|
};
|
|
799
|
-
},
|
|
800
|
-
let e =
|
|
735
|
+
}, St = () => {
|
|
736
|
+
let e = gt();
|
|
801
737
|
return e ? {
|
|
802
738
|
"network.effective_type": e.effectiveType,
|
|
803
739
|
"network.connection_type": e.type,
|
|
@@ -805,9 +741,9 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
805
741
|
"network.rtt": e.rtt,
|
|
806
742
|
"network.save_data": e.saveData
|
|
807
743
|
} : {};
|
|
808
|
-
},
|
|
744
|
+
}, Ct = () => {
|
|
809
745
|
if (typeof navigator > "u") return {};
|
|
810
|
-
let e =
|
|
746
|
+
let e = _t(), t = navigator.userAgent, n = vt(t), r = yt(t, e == null ? void 0 : e.platform), i = e != null && e.mobile || /mobi|android|iphone|ipad|ipod/i.test(t) ? "mobile" : "desktop";
|
|
811
747
|
return {
|
|
812
748
|
"device.memory": navigator.deviceMemory,
|
|
813
749
|
"device.cpu_cores": navigator.hardwareConcurrency,
|
|
@@ -821,45 +757,44 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
821
757
|
"user_agent.version": n.version,
|
|
822
758
|
"user_agent.os.name": r
|
|
823
759
|
};
|
|
824
|
-
},
|
|
760
|
+
}, wt = (e, t) => {
|
|
825
761
|
let n;
|
|
826
762
|
return () => {
|
|
827
763
|
n !== void 0 && window.clearTimeout(n), n = window.setTimeout(() => {
|
|
828
764
|
n = void 0, e();
|
|
829
765
|
}, t);
|
|
830
766
|
};
|
|
831
|
-
},
|
|
832
|
-
|
|
767
|
+
}, Tt = (e = {}) => {
|
|
768
|
+
var t;
|
|
769
|
+
let n = [], r = (t = e.storageKey) == null ? mt : t;
|
|
833
770
|
return {
|
|
834
771
|
name: "device",
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
let i =
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
let e = () => {
|
|
847
|
-
n.setRuntimeAttributes(Dt());
|
|
772
|
+
init(e) {
|
|
773
|
+
let t = typeof window > "u" ? L("device") : bt(r);
|
|
774
|
+
if (e.setRuntimeAttributes(E(E(E({ "device.id": t }, Ct()), xt()), St())), typeof window > "u") return;
|
|
775
|
+
let i = wt(() => {
|
|
776
|
+
e.setRuntimeAttributes(xt());
|
|
777
|
+
}, ht);
|
|
778
|
+
window.addEventListener("resize", i), window.addEventListener("orientationchange", i), n.push(() => window.removeEventListener("resize", i), () => window.removeEventListener("orientationchange", i));
|
|
779
|
+
let a = gt();
|
|
780
|
+
if (a && typeof a.addEventListener == "function") {
|
|
781
|
+
let t = () => {
|
|
782
|
+
e.setRuntimeAttributes(St());
|
|
848
783
|
};
|
|
849
|
-
|
|
850
|
-
var
|
|
851
|
-
(
|
|
784
|
+
a.addEventListener("change", t), n.push(() => {
|
|
785
|
+
var e;
|
|
786
|
+
(e = a.removeEventListener) == null || e.call(a, "change", t);
|
|
852
787
|
});
|
|
853
788
|
}
|
|
854
789
|
},
|
|
855
790
|
shutdown() {
|
|
856
|
-
for (;
|
|
791
|
+
for (; n.length;) {
|
|
857
792
|
var e;
|
|
858
|
-
(e =
|
|
793
|
+
(e = n.pop()) == null || e();
|
|
859
794
|
}
|
|
860
795
|
}
|
|
861
796
|
};
|
|
862
|
-
},
|
|
797
|
+
}, Et = 6e4, Dt = 5, Ot = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t, kt = (e) => {
|
|
863
798
|
if (e instanceof Error) return e.message;
|
|
864
799
|
if (typeof e == "string") return e;
|
|
865
800
|
try {
|
|
@@ -867,103 +802,89 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
867
802
|
} catch (t) {
|
|
868
803
|
return String(e);
|
|
869
804
|
}
|
|
870
|
-
},
|
|
805
|
+
}, At = (e) => {
|
|
871
806
|
var t;
|
|
872
807
|
return e instanceof Error ? (t = e.stack) == null ? "" : t : "";
|
|
873
|
-
},
|
|
808
|
+
}, jt = (e) => e.slice(0, 80), Mt = (e) => {
|
|
874
809
|
var t, n;
|
|
875
810
|
return (t = (n = e.split("\n").find((e) => e.trim().startsWith("at "))) == null ? void 0 : n.trim()) == null ? "" : t;
|
|
876
|
-
},
|
|
877
|
-
let
|
|
878
|
-
if (!
|
|
879
|
-
let
|
|
880
|
-
message:
|
|
881
|
-
name:
|
|
882
|
-
},
|
|
883
|
-
errorType:
|
|
811
|
+
}, Nt = (e) => e === "unhandledrejection" ? "promise" : e === "resource" ? "resource_load" : "js", R = ({ context: e, error: n, exceptionType: r, extra: i = {}, source: a, spanName: o, throttle: s }) => {
|
|
812
|
+
let c = kt(n), l = At(n), u = st(`${a}|${c}|${l.slice(0, 256)}`), d = s.allow(u);
|
|
813
|
+
if (!d.allowed) return;
|
|
814
|
+
let f = n instanceof Error ? n : {
|
|
815
|
+
message: c,
|
|
816
|
+
name: r == null ? a : r
|
|
817
|
+
}, p = E(E(E(E({}, e.config.hooks.getPageAttributes()), e.config.hooks.getErrorAttributes()), F({
|
|
818
|
+
errorType: Nt(a),
|
|
884
819
|
eventLabel: "错误",
|
|
885
|
-
result:
|
|
886
|
-
spanSubtype:
|
|
887
|
-
spanType:
|
|
888
|
-
targetLabel:
|
|
820
|
+
result: N.error,
|
|
821
|
+
spanSubtype: Nt(a),
|
|
822
|
+
spanType: P.error,
|
|
823
|
+
targetLabel: n instanceof Error ? n.name : r == null ? a : r
|
|
889
824
|
})), {}, {
|
|
890
|
-
"exception.message":
|
|
891
|
-
[b.exceptionMessageShort]:
|
|
892
|
-
"exception.stacktrace":
|
|
893
|
-
[b.exceptionStackTopFrame]:
|
|
894
|
-
"exception.type":
|
|
895
|
-
[b.exceptionFingerprint]:
|
|
825
|
+
"exception.message": c,
|
|
826
|
+
[b.exceptionMessageShort]: jt(c),
|
|
827
|
+
"exception.stacktrace": l,
|
|
828
|
+
[b.exceptionStackTopFrame]: Mt(l),
|
|
829
|
+
"exception.type": n instanceof Error ? n.name : r == null ? a : r,
|
|
830
|
+
[b.exceptionFingerprint]: u,
|
|
896
831
|
"error.handled": !1,
|
|
897
|
-
"error.source":
|
|
898
|
-
"error.window_count":
|
|
899
|
-
},
|
|
900
|
-
|
|
901
|
-
severityText: "ERROR",
|
|
902
|
-
body: d,
|
|
903
|
-
attributes: _
|
|
904
|
-
});
|
|
905
|
-
if (h) {
|
|
906
|
-
h.setAttributes(e.applyRedact(_)), h.recordException(g), h.setStatus({
|
|
907
|
-
code: t.ERROR,
|
|
908
|
-
message: d
|
|
909
|
-
}), v();
|
|
910
|
-
return;
|
|
911
|
-
}
|
|
912
|
-
let y = e.startSpan(l, _);
|
|
913
|
-
y.recordException(g), y.setStatus({
|
|
832
|
+
"error.source": a,
|
|
833
|
+
"error.window_count": d.count
|
|
834
|
+
}, i), m = e.startSpan(o, p);
|
|
835
|
+
m.recordException(f), m.setStatus({
|
|
914
836
|
code: t.ERROR,
|
|
915
|
-
message:
|
|
916
|
-
}),
|
|
917
|
-
},
|
|
918
|
-
let t = [];
|
|
837
|
+
message: c
|
|
838
|
+
}), m.end();
|
|
839
|
+
}, Pt = (e = {}) => {
|
|
840
|
+
let t = [], n = Ot(e.windowMs, Et), r = Ot(e.maxPerWindow, Dt);
|
|
919
841
|
return {
|
|
920
842
|
name: "error",
|
|
921
|
-
|
|
922
|
-
init(n) {
|
|
843
|
+
init(e) {
|
|
923
844
|
if (typeof window > "u") return;
|
|
924
|
-
let
|
|
925
|
-
var
|
|
926
|
-
let
|
|
927
|
-
|
|
928
|
-
context:
|
|
929
|
-
throttle:
|
|
845
|
+
let i = ct(n, r), a = (t) => {
|
|
846
|
+
var n;
|
|
847
|
+
let r = !t.error && !t.filename && t.message === "Script error.";
|
|
848
|
+
R({
|
|
849
|
+
context: e,
|
|
850
|
+
throttle: i,
|
|
930
851
|
spanName: "browser.error",
|
|
931
852
|
source: "window.error",
|
|
932
|
-
error: (
|
|
933
|
-
extra:
|
|
934
|
-
"code.filepath":
|
|
935
|
-
"code.lineno":
|
|
936
|
-
"code.column":
|
|
937
|
-
},
|
|
853
|
+
error: (n = t.error) == null ? t.message : n,
|
|
854
|
+
extra: E({
|
|
855
|
+
"code.filepath": t.filename,
|
|
856
|
+
"code.lineno": t.lineno,
|
|
857
|
+
"code.column": t.colno
|
|
858
|
+
}, r ? { "error.cross_origin": !0 } : {})
|
|
938
859
|
});
|
|
939
|
-
},
|
|
940
|
-
|
|
941
|
-
context:
|
|
942
|
-
throttle:
|
|
860
|
+
}, o = (t) => {
|
|
861
|
+
R({
|
|
862
|
+
context: e,
|
|
863
|
+
throttle: i,
|
|
943
864
|
spanName: "browser.unhandledrejection",
|
|
944
865
|
source: "unhandledrejection",
|
|
945
|
-
error:
|
|
946
|
-
exceptionType:
|
|
866
|
+
error: t.reason,
|
|
867
|
+
exceptionType: t.reason instanceof Error ? t.reason.name : "UnhandledRejection"
|
|
947
868
|
});
|
|
948
|
-
},
|
|
949
|
-
if (
|
|
950
|
-
let
|
|
951
|
-
if (!(
|
|
952
|
-
let
|
|
953
|
-
|
|
954
|
-
context:
|
|
955
|
-
throttle:
|
|
869
|
+
}, s = (t) => {
|
|
870
|
+
if (t instanceof ErrorEvent) return;
|
|
871
|
+
let n = t.target;
|
|
872
|
+
if (!(n instanceof Element)) return;
|
|
873
|
+
let r = n, a = r.src || r.href || n.currentSrc || "";
|
|
874
|
+
R({
|
|
875
|
+
context: e,
|
|
876
|
+
throttle: i,
|
|
956
877
|
spanName: "browser.resource_error",
|
|
957
878
|
source: "resource",
|
|
958
|
-
error: /* @__PURE__ */ Error(`Resource load failed: ${
|
|
879
|
+
error: /* @__PURE__ */ Error(`Resource load failed: ${n.tagName.toLowerCase()} ${a}`),
|
|
959
880
|
exceptionType: "ResourceError",
|
|
960
881
|
extra: {
|
|
961
|
-
"url.full":
|
|
962
|
-
"html.tag":
|
|
882
|
+
"url.full": e.config.hooks.redactUrl(a),
|
|
883
|
+
"html.tag": n.tagName
|
|
963
884
|
}
|
|
964
885
|
});
|
|
965
886
|
};
|
|
966
|
-
window.addEventListener("error",
|
|
887
|
+
window.addEventListener("error", a), window.addEventListener("unhandledrejection", o), window.addEventListener("error", s, !0), t.push(() => window.removeEventListener("error", a), () => window.removeEventListener("unhandledrejection", o), () => window.removeEventListener("error", s, !0));
|
|
967
888
|
},
|
|
968
889
|
shutdown() {
|
|
969
890
|
for (; t.length;) {
|
|
@@ -972,13 +893,13 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
972
893
|
}
|
|
973
894
|
}
|
|
974
895
|
};
|
|
975
|
-
},
|
|
896
|
+
}, Ft = 10 * 1024, It = 10, Lt = (e) => e.body, Rt = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t, z = /* @__PURE__ */ new WeakMap(), B = (e, t) => e.length <= t ? {
|
|
976
897
|
body: e,
|
|
977
898
|
truncated: !1
|
|
978
899
|
} : {
|
|
979
900
|
body: e.slice(0, t),
|
|
980
901
|
truncated: !0
|
|
981
|
-
},
|
|
902
|
+
}, zt = (e, t) => {
|
|
982
903
|
if (!e) return;
|
|
983
904
|
if (e instanceof Headers) return e.get(t) || void 0;
|
|
984
905
|
let n = t.toLowerCase();
|
|
@@ -988,30 +909,30 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
988
909
|
}
|
|
989
910
|
let i = Object.keys(e).find((e) => e.toLowerCase() === n);
|
|
990
911
|
return i ? e[i] : void 0;
|
|
991
|
-
},
|
|
912
|
+
}, Bt = (e) => {
|
|
992
913
|
let t = {};
|
|
993
914
|
return e.forEach((e, n) => {
|
|
994
915
|
t[n] = e instanceof File ? `[File name=${e.name} type=${e.type || "unknown"} size=${e.size}]` : e;
|
|
995
916
|
}), JSON.stringify(t);
|
|
996
|
-
},
|
|
997
|
-
var e =
|
|
998
|
-
return e == null ? "" : typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : e instanceof FormData ?
|
|
917
|
+
}, Vt = function() {
|
|
918
|
+
var e = A(function* (e) {
|
|
919
|
+
return e == null ? "" : typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : e instanceof FormData ? Bt(e) : e instanceof Blob ? e.text() : e instanceof ArrayBuffer || ArrayBuffer.isView(e) ? new TextDecoder().decode(e) : e instanceof Document ? new XMLSerializer().serializeToString(e) : String(e);
|
|
999
920
|
});
|
|
1000
921
|
return function(t) {
|
|
1001
922
|
return e.apply(this, arguments);
|
|
1002
923
|
};
|
|
1003
|
-
}(),
|
|
1004
|
-
var e =
|
|
1005
|
-
let r = yield
|
|
1006
|
-
if (r) return
|
|
924
|
+
}(), Ht = function() {
|
|
925
|
+
var e = A(function* (e, t, n) {
|
|
926
|
+
let r = yield Vt(e);
|
|
927
|
+
if (r) return E(E({}, B(r, t)), {}, { contentType: n });
|
|
1007
928
|
});
|
|
1008
929
|
return function(t, n, r) {
|
|
1009
930
|
return e.apply(this, arguments);
|
|
1010
931
|
};
|
|
1011
|
-
}(),
|
|
1012
|
-
var e =
|
|
932
|
+
}(), V = function() {
|
|
933
|
+
var e = A(function* (e, t, n) {
|
|
1013
934
|
try {
|
|
1014
|
-
return yield
|
|
935
|
+
return yield Ht(e, t, n);
|
|
1015
936
|
} catch (e) {
|
|
1016
937
|
return;
|
|
1017
938
|
}
|
|
@@ -1019,20 +940,20 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1019
940
|
return function(t, n, r) {
|
|
1020
941
|
return e.apply(this, arguments);
|
|
1021
942
|
};
|
|
1022
|
-
}(),
|
|
1023
|
-
var e =
|
|
943
|
+
}(), Ut = (e) => e instanceof Request ? e.url : String(e), Wt = (e, t) => t != null && t.method ? t.method : e instanceof Request ? e.method : "GET", Gt = (e, t, n) => t != null && t.body ? () => V(t.body, n, zt(t.headers, "content-type")) : (e instanceof Request, () => Promise.resolve(void 0)), Kt = function() {
|
|
944
|
+
var e = A(function* (e, t) {
|
|
1024
945
|
try {
|
|
1025
946
|
let n = e.headers.get("content-type") || void 0, r = e.headers.get("content-length");
|
|
1026
947
|
if (r) {
|
|
1027
948
|
let e = Number(r);
|
|
1028
|
-
if (Number.isFinite(e) && e > t *
|
|
949
|
+
if (Number.isFinite(e) && e > t * It) return {
|
|
1029
950
|
body: "",
|
|
1030
951
|
contentType: n,
|
|
1031
952
|
truncated: !0
|
|
1032
953
|
};
|
|
1033
954
|
}
|
|
1034
955
|
let i = e.clone();
|
|
1035
|
-
return
|
|
956
|
+
return V(i.body ? yield i.text() : "", t, n);
|
|
1036
957
|
} catch (e) {
|
|
1037
958
|
return;
|
|
1038
959
|
}
|
|
@@ -1040,192 +961,195 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1040
961
|
return function(t, n) {
|
|
1041
962
|
return e.apply(this, arguments);
|
|
1042
963
|
};
|
|
1043
|
-
}(),
|
|
1044
|
-
if (e.responseType === "" || e.responseType === "text") return
|
|
1045
|
-
if (e.responseType === "json") return
|
|
1046
|
-
},
|
|
1047
|
-
if (n) return e.redact(
|
|
964
|
+
}(), qt = (e, t) => {
|
|
965
|
+
if (e.responseType === "" || e.responseType === "text") return E(E({}, B(e.responseText || "", t)), {}, { contentType: e.getResponseHeader("content-type") || void 0 });
|
|
966
|
+
if (e.responseType === "json") return E(E({}, B(JSON.stringify(e.response), t)), {}, { contentType: e.getResponseHeader("content-type") || void 0 });
|
|
967
|
+
}, Jt = (e, t, n) => {
|
|
968
|
+
if (n) return e.redact(E(E({}, t), {}, {
|
|
1048
969
|
body: n.body,
|
|
1049
970
|
truncated: n.truncated
|
|
1050
971
|
}));
|
|
1051
|
-
},
|
|
1052
|
-
let
|
|
1053
|
-
|
|
1054
|
-
let d = !!n || typeof s == "number" && s >= 400, f = r.toUpperCase(), p = d ? Xt(u, {
|
|
1055
|
-
contentType: i == null ? void 0 : i.contentType,
|
|
972
|
+
}, H = ({ config: e, context: t, duration: n, error: r, method: i, request: a, response: s, status: c, subtype: l, url: u }) => {
|
|
973
|
+
let d = !!r || typeof c == "number" && c >= 400, f = i.toUpperCase(), p = d ? Jt(e, {
|
|
974
|
+
contentType: a == null ? void 0 : a.contentType,
|
|
1056
975
|
method: f,
|
|
1057
|
-
status:
|
|
976
|
+
status: c,
|
|
1058
977
|
type: "request",
|
|
1059
|
-
url:
|
|
1060
|
-
},
|
|
1061
|
-
contentType:
|
|
978
|
+
url: u
|
|
979
|
+
}, a) : void 0, m = d ? Jt(e, {
|
|
980
|
+
contentType: s == null ? void 0 : s.contentType,
|
|
1062
981
|
method: f,
|
|
1063
|
-
status:
|
|
982
|
+
status: c,
|
|
1064
983
|
type: "response",
|
|
1065
|
-
url:
|
|
1066
|
-
},
|
|
1067
|
-
duration:
|
|
984
|
+
url: u
|
|
985
|
+
}, s) : void 0, h = E(E(E({}, t.config.hooks.getPageAttributes()), Le({
|
|
986
|
+
duration: n,
|
|
1068
987
|
method: f,
|
|
1069
|
-
statusCode:
|
|
1070
|
-
subtype:
|
|
1071
|
-
url:
|
|
1072
|
-
urlPathTemplate:
|
|
988
|
+
statusCode: c,
|
|
989
|
+
subtype: l,
|
|
990
|
+
url: t.config.hooks.redactUrl(u),
|
|
991
|
+
urlPathTemplate: t.config.hooks.getViewPathGroup(u)
|
|
1073
992
|
})), {}, {
|
|
1074
|
-
"http.duration":
|
|
993
|
+
"http.duration": n,
|
|
1075
994
|
"http.request.method": f,
|
|
1076
|
-
"url.full":
|
|
995
|
+
"url.full": t.config.hooks.redactUrl(u)
|
|
1077
996
|
});
|
|
1078
|
-
if (typeof
|
|
997
|
+
if (typeof c == "number" && (h["http.response.status_code"] = c), p != null && (h["http.request.body"] = p), m != null && (h["http.response.body"] = m), d) {
|
|
1079
998
|
var g, _;
|
|
1080
|
-
h["http_body.request.truncated"] = (g =
|
|
999
|
+
h["http_body.request.truncated"] = (g = a == null ? void 0 : a.truncated) == null ? !1 : g, h["http_body.response.truncated"] = (_ = s == null ? void 0 : s.truncated) == null ? !1 : _;
|
|
1081
1000
|
}
|
|
1082
|
-
if (
|
|
1001
|
+
if (r instanceof Error) {
|
|
1083
1002
|
var v;
|
|
1084
|
-
h["exception.message"] =
|
|
1003
|
+
h["exception.message"] = r.message, h["exception.type"] = r.name, h["exception.stacktrace"] = (v = r.stack) == null ? "" : v;
|
|
1085
1004
|
}
|
|
1086
|
-
|
|
1005
|
+
t.emitLog({
|
|
1087
1006
|
severityNumber: d ? o.ERROR : o.INFO,
|
|
1088
1007
|
severityText: d ? "ERROR" : "INFO",
|
|
1089
1008
|
body: d ? "HTTP request completed with error" : "HTTP request completed",
|
|
1090
1009
|
attributes: h
|
|
1091
1010
|
});
|
|
1092
|
-
},
|
|
1093
|
-
|
|
1011
|
+
}, Yt = (e = {}) => {
|
|
1012
|
+
var t;
|
|
1013
|
+
let n = [], r = {
|
|
1014
|
+
maxBodySize: Rt(e.maxBodySize, Ft),
|
|
1015
|
+
redact: (t = e.redact) == null ? Lt : t
|
|
1016
|
+
};
|
|
1094
1017
|
return {
|
|
1095
1018
|
name: "http-body",
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
let r = e.enabled ? e.maxBodySize : zt, i = window.fetch;
|
|
1019
|
+
init(e) {
|
|
1020
|
+
if (typeof window > "u") return;
|
|
1021
|
+
let { maxBodySize: t } = r, i = window.fetch;
|
|
1100
1022
|
if (typeof i == "function") {
|
|
1101
|
-
let
|
|
1102
|
-
var
|
|
1103
|
-
let
|
|
1104
|
-
if (
|
|
1105
|
-
let
|
|
1023
|
+
let a = function() {
|
|
1024
|
+
var n = A(function* (n, a) {
|
|
1025
|
+
let o = Ut(n);
|
|
1026
|
+
if (M(e.config, o)) return i(n, a);
|
|
1027
|
+
let s = Wt(n, a), c = Gt(n, a, t), l = performance.now();
|
|
1106
1028
|
try {
|
|
1107
|
-
let
|
|
1108
|
-
return
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1029
|
+
let u = yield i(n, a), d = performance.now() - l, f = u.status >= 400;
|
|
1030
|
+
return H({
|
|
1031
|
+
config: r,
|
|
1032
|
+
context: e,
|
|
1033
|
+
duration: d,
|
|
1034
|
+
method: s,
|
|
1035
|
+
request: f ? yield c() : void 0,
|
|
1036
|
+
response: f ? yield Kt(u, t) : void 0,
|
|
1037
|
+
status: u.status,
|
|
1115
1038
|
subtype: "fetch",
|
|
1116
|
-
url:
|
|
1117
|
-
}),
|
|
1118
|
-
} catch (
|
|
1119
|
-
let
|
|
1120
|
-
throw
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1039
|
+
url: o
|
|
1040
|
+
}), u;
|
|
1041
|
+
} catch (t) {
|
|
1042
|
+
let n = yield c();
|
|
1043
|
+
throw H({
|
|
1044
|
+
config: r,
|
|
1045
|
+
context: e,
|
|
1046
|
+
duration: performance.now() - l,
|
|
1047
|
+
error: t,
|
|
1048
|
+
method: s,
|
|
1049
|
+
request: n,
|
|
1126
1050
|
subtype: "fetch",
|
|
1127
|
-
url:
|
|
1128
|
-
}),
|
|
1051
|
+
url: o
|
|
1052
|
+
}), t;
|
|
1129
1053
|
}
|
|
1130
1054
|
});
|
|
1131
|
-
return function(
|
|
1132
|
-
return
|
|
1055
|
+
return function(e, t) {
|
|
1056
|
+
return n.apply(this, arguments);
|
|
1133
1057
|
};
|
|
1134
1058
|
}();
|
|
1135
|
-
window.fetch =
|
|
1136
|
-
window.fetch ===
|
|
1059
|
+
window.fetch = a, n.push(() => {
|
|
1060
|
+
window.fetch === a && (window.fetch = i);
|
|
1137
1061
|
});
|
|
1138
1062
|
}
|
|
1139
1063
|
let a = XMLHttpRequest.prototype.open, o = XMLHttpRequest.prototype.send, s = XMLHttpRequest.prototype.setRequestHeader, c = function(e, t, ...n) {
|
|
1140
1064
|
var r;
|
|
1141
|
-
return
|
|
1065
|
+
return z.set(this, {
|
|
1142
1066
|
method: e,
|
|
1143
1067
|
startTime: performance.now(),
|
|
1144
1068
|
url: String(t)
|
|
1145
1069
|
}), a.call(this, e, t, (r = n[0]) == null ? !0 : r, n[1], n[2]);
|
|
1146
1070
|
}, l = function(e, t) {
|
|
1147
|
-
let n =
|
|
1071
|
+
let n = z.get(this);
|
|
1148
1072
|
if (n) {
|
|
1149
1073
|
var r;
|
|
1150
1074
|
let i = e.toLowerCase(), a = (r = n.requestHeaders) == null ? {} : r, o = a[i];
|
|
1151
1075
|
a[i] = o ? `${o}, ${t}` : t, n.requestHeaders = a;
|
|
1152
1076
|
}
|
|
1153
1077
|
return s.call(this, e, t);
|
|
1154
|
-
}, u = function(
|
|
1155
|
-
var
|
|
1156
|
-
let
|
|
1157
|
-
if (
|
|
1158
|
-
var
|
|
1159
|
-
|
|
1078
|
+
}, u = function(n) {
|
|
1079
|
+
var i = this;
|
|
1080
|
+
let a = z.get(this);
|
|
1081
|
+
if (a) {
|
|
1082
|
+
var s;
|
|
1083
|
+
a.requestBody = n, a.requestContentType = (s = a.requestHeaders) == null ? void 0 : s["content-type"];
|
|
1160
1084
|
}
|
|
1161
1085
|
return this.addEventListener("abort", () => {
|
|
1162
|
-
let e =
|
|
1086
|
+
let e = z.get(this);
|
|
1163
1087
|
e && (e.aborted = !0);
|
|
1164
1088
|
}, { once: !0 }), this.addEventListener("error", () => {
|
|
1165
|
-
let e =
|
|
1089
|
+
let e = z.get(this);
|
|
1166
1090
|
e && (e.networkError = !0);
|
|
1167
1091
|
}, { once: !0 }), this.addEventListener("loadend", () => {
|
|
1168
|
-
|
|
1169
|
-
let
|
|
1170
|
-
if (!
|
|
1171
|
-
let
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1092
|
+
A(function* () {
|
|
1093
|
+
let n = z.get(i);
|
|
1094
|
+
if (!n || M(e.config, n.url) || n.aborted) return;
|
|
1095
|
+
let a = n.networkError || i.status >= 400, o = a ? qt(i, t) : void 0, s = a ? yield V(n.requestBody, t, n.requestContentType) : void 0;
|
|
1096
|
+
H({
|
|
1097
|
+
config: r,
|
|
1098
|
+
context: e,
|
|
1099
|
+
duration: performance.now() - n.startTime,
|
|
1100
|
+
error: n.networkError ? /* @__PURE__ */ Error("XHR network error") : void 0,
|
|
1101
|
+
method: n.method,
|
|
1102
|
+
request: s,
|
|
1103
|
+
response: o,
|
|
1104
|
+
status: i.status,
|
|
1180
1105
|
subtype: "xhr",
|
|
1181
|
-
url:
|
|
1106
|
+
url: n.url
|
|
1182
1107
|
});
|
|
1183
1108
|
})();
|
|
1184
|
-
}, { once: !0 }), o.call(this,
|
|
1109
|
+
}, { once: !0 }), o.call(this, n);
|
|
1185
1110
|
};
|
|
1186
|
-
XMLHttpRequest.prototype.open = c, XMLHttpRequest.prototype.setRequestHeader = l, XMLHttpRequest.prototype.send = u,
|
|
1111
|
+
XMLHttpRequest.prototype.open = c, XMLHttpRequest.prototype.setRequestHeader = l, XMLHttpRequest.prototype.send = u, n.push(() => {
|
|
1187
1112
|
XMLHttpRequest.prototype.open === c && (XMLHttpRequest.prototype.open = a), XMLHttpRequest.prototype.setRequestHeader === l && (XMLHttpRequest.prototype.setRequestHeader = s), XMLHttpRequest.prototype.send === u && (XMLHttpRequest.prototype.send = o);
|
|
1188
1113
|
});
|
|
1189
1114
|
},
|
|
1190
1115
|
shutdown() {
|
|
1191
|
-
for (;
|
|
1116
|
+
for (; n.length;) {
|
|
1192
1117
|
var e;
|
|
1193
|
-
(e =
|
|
1118
|
+
(e = n.pop()) == null || e();
|
|
1194
1119
|
}
|
|
1195
1120
|
}
|
|
1196
1121
|
};
|
|
1197
|
-
},
|
|
1198
|
-
let t;
|
|
1122
|
+
}, Xt = 50, Zt = (e, t) => typeof e == "number" && Number.isFinite(e) && e >= 0 ? e : t, Qt = (e = {}) => {
|
|
1123
|
+
let t, n = Zt(e.threshold, Xt);
|
|
1199
1124
|
return {
|
|
1200
1125
|
name: "long-task",
|
|
1201
|
-
|
|
1202
|
-
init(n) {
|
|
1126
|
+
init(e) {
|
|
1203
1127
|
var r;
|
|
1204
1128
|
if (typeof PerformanceObserver > "u" || !((r = PerformanceObserver.supportedEntryTypes) != null && r.includes("longtask"))) return;
|
|
1205
|
-
let i = e.
|
|
1129
|
+
let i = e.meter.createCounter("browser.long_task.count", { description: "Number of long tasks observed (duration >= threshold)" }), a = e.meter.createHistogram("browser.long_task.duration", {
|
|
1206
1130
|
unit: "ms",
|
|
1207
1131
|
description: "Duration of long tasks"
|
|
1208
1132
|
});
|
|
1209
1133
|
try {
|
|
1210
|
-
t = new PerformanceObserver((
|
|
1211
|
-
let
|
|
1212
|
-
for (let h of
|
|
1213
|
-
var
|
|
1214
|
-
if (h.duration <
|
|
1215
|
-
let
|
|
1216
|
-
|
|
1134
|
+
t = new PerformanceObserver((t) => {
|
|
1135
|
+
let r = e.applyRedact(E(E({}, e.config.hooks.getPageAttributes()), e.config.hooks.getMetricAttributes()));
|
|
1136
|
+
for (let h of t.getEntries()) {
|
|
1137
|
+
var o, s, c, l, u, d, f, p, m;
|
|
1138
|
+
if (h.duration < n) continue;
|
|
1139
|
+
let t = (o = h.attribution) == null ? void 0 : o[0], g = E(E({}, r), {}, { [b.longtaskAttributionScript]: (s = (c = t == null ? void 0 : t.containerSrc) == null ? t == null ? void 0 : t.name : c) == null ? "unknown" : s }), _ = h.duration > 100 ? N.warning : N.success;
|
|
1140
|
+
e.startSpan("browser.long_task", E(E(E({}, r), F({
|
|
1217
1141
|
duration: h.duration,
|
|
1218
|
-
errorType: _ ===
|
|
1142
|
+
errorType: _ === N.warning ? "longtask_blocking" : "none",
|
|
1219
1143
|
eventLabel: "长任务",
|
|
1220
1144
|
result: _,
|
|
1221
|
-
spanSubtype: (l =
|
|
1222
|
-
spanType:
|
|
1223
|
-
targetLabel: (u = (d = (f =
|
|
1145
|
+
spanSubtype: (l = t == null ? void 0 : t.name) == null ? "unknown" : l,
|
|
1146
|
+
spanType: P.longtask,
|
|
1147
|
+
targetLabel: (u = (d = (f = t == null ? void 0 : t.containerSrc) == null ? t == null ? void 0 : t.containerName : f) == null ? t == null ? void 0 : t.name : d) == null ? "unknown" : u,
|
|
1224
1148
|
targetValue: h.duration
|
|
1225
1149
|
})), {}, {
|
|
1226
1150
|
[b.longtaskBlockingDuration]: h.duration,
|
|
1227
|
-
[b.longtaskAttributionScript]: (p = (m =
|
|
1228
|
-
}), { startTime: performance.timeOrigin + h.startTime }).end(performance.timeOrigin + h.startTime + h.duration),
|
|
1151
|
+
[b.longtaskAttributionScript]: (p = (m = t == null ? void 0 : t.containerSrc) == null ? t == null ? void 0 : t.name : m) == null ? "unknown" : p
|
|
1152
|
+
}), { startTime: performance.timeOrigin + h.startTime }).end(performance.timeOrigin + h.startTime + h.duration), i.add(1, g), a.record(h.duration, g);
|
|
1229
1153
|
}
|
|
1230
1154
|
}), t.observe({
|
|
1231
1155
|
type: "longtask",
|
|
@@ -1239,62 +1163,61 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1239
1163
|
t == null || t.disconnect(), t = void 0;
|
|
1240
1164
|
}
|
|
1241
1165
|
};
|
|
1242
|
-
},
|
|
1243
|
-
let n =
|
|
1244
|
-
|
|
1166
|
+
}, U = /* @__PURE__ */ new Set(), W = "", G, K, q = !1, J = () => typeof location > "u" ? "" : location.href, Y = (e, t) => {
|
|
1167
|
+
let n = J();
|
|
1168
|
+
W = n;
|
|
1245
1169
|
let r = {
|
|
1246
1170
|
fromUrl: t,
|
|
1247
1171
|
source: e,
|
|
1248
1172
|
toUrl: n
|
|
1249
1173
|
};
|
|
1250
|
-
for (let e of Array.from(
|
|
1174
|
+
for (let e of Array.from(U)) e(r);
|
|
1175
|
+
}, $t = () => {
|
|
1176
|
+
Y("popstate", W || J());
|
|
1251
1177
|
}, en = () => {
|
|
1252
|
-
|
|
1178
|
+
Y("hashchange", W || J());
|
|
1253
1179
|
}, tn = () => {
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
X || typeof window > "u" || typeof history > "u" || (X = !0, q = Z(), J = history.pushState, Y = history.replaceState, history.pushState = function(e, t, n) {
|
|
1257
|
-
let r = q || Z(), i = J == null ? void 0 : J.apply(this, [
|
|
1180
|
+
q || typeof window > "u" || typeof history > "u" || (q = !0, W = J(), G = history.pushState, K = history.replaceState, history.pushState = function(e, t, n) {
|
|
1181
|
+
let r = W || J(), i = G == null ? void 0 : G.apply(this, [
|
|
1258
1182
|
e,
|
|
1259
1183
|
t,
|
|
1260
1184
|
n
|
|
1261
1185
|
]);
|
|
1262
|
-
return
|
|
1186
|
+
return Y("pushState", r), i;
|
|
1263
1187
|
}, history.replaceState = function(e, t, n) {
|
|
1264
|
-
let r =
|
|
1188
|
+
let r = W || J(), i = K == null ? void 0 : K.apply(this, [
|
|
1265
1189
|
e,
|
|
1266
1190
|
t,
|
|
1267
1191
|
n
|
|
1268
1192
|
]);
|
|
1269
|
-
return
|
|
1270
|
-
}, window.addEventListener("popstate",
|
|
1271
|
-
},
|
|
1272
|
-
!
|
|
1273
|
-
},
|
|
1274
|
-
|
|
1275
|
-
}),
|
|
1276
|
-
let
|
|
1193
|
+
return Y("replaceState", r), i;
|
|
1194
|
+
}, window.addEventListener("popstate", $t), window.addEventListener("hashchange", en));
|
|
1195
|
+
}, nn = () => {
|
|
1196
|
+
!q || typeof window > "u" || typeof history > "u" || (G && (history.pushState = G), K && (history.replaceState = K), window.removeEventListener("popstate", $t), window.removeEventListener("hashchange", en), G = void 0, K = void 0, q = !1, W = "");
|
|
1197
|
+
}, rn = (e) => typeof window > "u" || typeof history > "u" ? () => {} : (tn(), U.add(e), () => {
|
|
1198
|
+
U.delete(e), U.size === 0 && nn();
|
|
1199
|
+
}), an = () => typeof location > "u" ? "" : location.href, on = () => {
|
|
1200
|
+
let e = [];
|
|
1277
1201
|
return {
|
|
1278
1202
|
name: "page-view",
|
|
1279
|
-
|
|
1280
|
-
init(e) {
|
|
1203
|
+
init(t) {
|
|
1281
1204
|
if (typeof window > "u") return;
|
|
1282
|
-
let n = "", r, i = (
|
|
1283
|
-
let a =
|
|
1205
|
+
let n = "", r, i = (e, i = n) => {
|
|
1206
|
+
let a = an();
|
|
1284
1207
|
if (a === n) return;
|
|
1285
|
-
r == null || r.setAttribute("view.end_reason",
|
|
1286
|
-
let o =
|
|
1287
|
-
|
|
1208
|
+
r == null || r.setAttribute("view.end_reason", e), r == null || r.end(), n = a;
|
|
1209
|
+
let o = L("view"), s = t.config.hooks.getViewPathGroup(a), c = e === "load" ? "initial_load" : "route_change", l = t.config.hooks.redactUrl(a), u = t.config.hooks.redactUrl(i);
|
|
1210
|
+
t.setView({
|
|
1288
1211
|
id: o,
|
|
1289
1212
|
loadingType: c,
|
|
1290
1213
|
url: l,
|
|
1291
1214
|
urlPathGroup: s
|
|
1292
1215
|
});
|
|
1293
|
-
let d =
|
|
1216
|
+
let d = e === "load", f = E(E(E({}, t.config.hooks.getPageAttributes()), F({
|
|
1294
1217
|
errorType: "none",
|
|
1295
1218
|
eventLabel: d ? "文档加载" : "路由切换",
|
|
1296
|
-
spanSubtype: d ? "navigate" :
|
|
1297
|
-
spanType: d ?
|
|
1219
|
+
spanSubtype: d ? "navigate" : e,
|
|
1220
|
+
spanType: d ? P.document : P.route,
|
|
1298
1221
|
targetLabel: s,
|
|
1299
1222
|
traceScene: d ? "page_load" : "route_change"
|
|
1300
1223
|
})), {}, {
|
|
@@ -1303,140 +1226,138 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1303
1226
|
[b.viewUrlPathGroup]: s,
|
|
1304
1227
|
[b.viewLoadingType]: c,
|
|
1305
1228
|
"url.previous": u,
|
|
1306
|
-
"event.source":
|
|
1307
|
-
}, d ? { "document.referrer":
|
|
1308
|
-
r =
|
|
1309
|
-
}, a =
|
|
1229
|
+
"event.source": e
|
|
1230
|
+
}, d ? { "document.referrer": t.config.hooks.redactUrl(document.referrer || "") } : {});
|
|
1231
|
+
r = t.startSpan("browser.view", f), t.startSpan("browser.page_view", E({}, f)).end();
|
|
1232
|
+
}, a = rn((e) => {
|
|
1310
1233
|
i(e.source, e.fromUrl);
|
|
1311
1234
|
});
|
|
1312
1235
|
i("load");
|
|
1313
1236
|
let o = () => {
|
|
1314
1237
|
r == null || r.setAttribute("view.end_reason", "shutdown"), r == null || r.end(), r = void 0;
|
|
1315
1238
|
};
|
|
1316
|
-
window.addEventListener("pagehide", o),
|
|
1239
|
+
window.addEventListener("pagehide", o), e.push(a, () => window.removeEventListener("pagehide", o), o);
|
|
1317
1240
|
},
|
|
1318
1241
|
shutdown() {
|
|
1319
|
-
for (;
|
|
1320
|
-
var
|
|
1321
|
-
(
|
|
1242
|
+
for (; e.length;) {
|
|
1243
|
+
var t;
|
|
1244
|
+
(t = e.pop()) == null || t();
|
|
1322
1245
|
}
|
|
1323
1246
|
}
|
|
1324
1247
|
};
|
|
1325
|
-
},
|
|
1326
|
-
let
|
|
1248
|
+
}, sn = (e) => e.transferSize === 0 && e.decodedBodySize > 0 ? !0 : void 0, cn = () => {
|
|
1249
|
+
let e, t = /* @__PURE__ */ new Set();
|
|
1327
1250
|
return {
|
|
1328
1251
|
name: "resource",
|
|
1329
|
-
|
|
1330
|
-
init(e) {
|
|
1252
|
+
init(n) {
|
|
1331
1253
|
var r;
|
|
1332
1254
|
if (typeof PerformanceObserver > "u" || !((r = PerformanceObserver.supportedEntryTypes) != null && r.includes("resource"))) return;
|
|
1333
|
-
let i = (
|
|
1334
|
-
if (!
|
|
1335
|
-
let r = `${
|
|
1336
|
-
if (
|
|
1337
|
-
|
|
1338
|
-
let i =
|
|
1339
|
-
|
|
1255
|
+
let i = (e) => {
|
|
1256
|
+
if (!e.name || M(n.config, e.name)) return;
|
|
1257
|
+
let r = `${e.name}|${e.startTime}`;
|
|
1258
|
+
if (t.has(r)) return;
|
|
1259
|
+
t.add(r);
|
|
1260
|
+
let i = n.config.hooks.redactUrl(e.name), a = e.duration;
|
|
1261
|
+
n.startSpan("browser.resource", E(E(E({}, n.config.hooks.getPageAttributes()), Re({
|
|
1340
1262
|
duration: a,
|
|
1341
|
-
initiatorType:
|
|
1342
|
-
responseStatus:
|
|
1343
|
-
transferSize:
|
|
1263
|
+
initiatorType: e.initiatorType || "other",
|
|
1264
|
+
responseStatus: e.responseStatus,
|
|
1265
|
+
transferSize: e.transferSize,
|
|
1344
1266
|
url: i,
|
|
1345
|
-
urlPathTemplate:
|
|
1267
|
+
urlPathTemplate: n.config.hooks.getViewPathGroup(e.name)
|
|
1346
1268
|
})), {}, {
|
|
1347
1269
|
"url.full": i,
|
|
1348
|
-
[b.transferSize]:
|
|
1349
|
-
[b.cacheHit]:
|
|
1350
|
-
[b.nextHopProtocol]:
|
|
1351
|
-
initiator_type:
|
|
1352
|
-
"resource.encoded_body_size":
|
|
1353
|
-
"resource.decoded_body_size":
|
|
1354
|
-
}), { startTime: performance.timeOrigin +
|
|
1270
|
+
[b.transferSize]: e.transferSize,
|
|
1271
|
+
[b.cacheHit]: sn(e),
|
|
1272
|
+
[b.nextHopProtocol]: e.nextHopProtocol,
|
|
1273
|
+
initiator_type: e.initiatorType || "other",
|
|
1274
|
+
"resource.encoded_body_size": e.encodedBodySize,
|
|
1275
|
+
"resource.decoded_body_size": e.decodedBodySize
|
|
1276
|
+
}), { startTime: performance.timeOrigin + e.startTime }).end(performance.timeOrigin + e.startTime + a);
|
|
1355
1277
|
};
|
|
1356
1278
|
try {
|
|
1357
|
-
|
|
1279
|
+
e = new PerformanceObserver((e) => {
|
|
1358
1280
|
for (let t of e.getEntries()) i(t);
|
|
1359
|
-
}),
|
|
1281
|
+
}), e.observe({
|
|
1360
1282
|
type: "resource",
|
|
1361
1283
|
buffered: !0
|
|
1362
1284
|
});
|
|
1363
|
-
} catch (
|
|
1364
|
-
|
|
1285
|
+
} catch (t) {
|
|
1286
|
+
e = void 0;
|
|
1365
1287
|
}
|
|
1366
1288
|
},
|
|
1367
1289
|
shutdown() {
|
|
1368
|
-
|
|
1290
|
+
e == null || e.disconnect(), e = void 0, t.clear();
|
|
1369
1291
|
}
|
|
1370
1292
|
};
|
|
1371
|
-
},
|
|
1372
|
-
let
|
|
1293
|
+
}, ln = () => {
|
|
1294
|
+
let e = [], t = !1;
|
|
1373
1295
|
return {
|
|
1374
1296
|
name: "route-timing",
|
|
1375
|
-
|
|
1376
|
-
init(e) {
|
|
1297
|
+
init(n) {
|
|
1377
1298
|
if (typeof window > "u" || typeof history > "u") return;
|
|
1378
|
-
let r =
|
|
1299
|
+
let r = n.meter.createHistogram("browser.route_change.duration", {
|
|
1379
1300
|
unit: "ms",
|
|
1380
1301
|
description: "Estimated SPA route change duration (route start to next idle)"
|
|
1381
|
-
}), i = (
|
|
1382
|
-
if (
|
|
1302
|
+
}), i = (e, i, a) => {
|
|
1303
|
+
if (t) return;
|
|
1383
1304
|
let o = performance.now(), s = performance.timeOrigin + o, c = () => {
|
|
1384
|
-
if (
|
|
1385
|
-
let c = performance.now() - o, l = c > 500 ?
|
|
1386
|
-
r.record(c, u),
|
|
1305
|
+
if (t || typeof document < "u" && document.visibilityState === "hidden") return;
|
|
1306
|
+
let c = performance.now() - o, l = c > 500 ? N.warning : N.success, u = n.applyRedact(E(E(E({}, n.config.hooks.getPageAttributes()), n.config.hooks.getMetricAttributes()), {}, { "route.change.source": e }));
|
|
1307
|
+
r.record(c, u), n.startSpan("browser.route_change", E(E(E({}, u), F({
|
|
1387
1308
|
duration: c,
|
|
1388
|
-
errorType: l ===
|
|
1309
|
+
errorType: l === N.warning ? "slow" : "none",
|
|
1389
1310
|
eventLabel: "路由切换",
|
|
1390
1311
|
result: l,
|
|
1391
|
-
spanSubtype:
|
|
1392
|
-
spanType:
|
|
1393
|
-
targetLabel:
|
|
1312
|
+
spanSubtype: e,
|
|
1313
|
+
spanType: P.route,
|
|
1314
|
+
targetLabel: n.config.hooks.getViewPathGroup(a),
|
|
1394
1315
|
targetValue: c,
|
|
1395
1316
|
traceScene: "route_change"
|
|
1396
1317
|
})), {}, {
|
|
1397
|
-
"url.full":
|
|
1398
|
-
"url.previous":
|
|
1318
|
+
"url.full": n.config.hooks.redactUrl(a),
|
|
1319
|
+
"url.previous": n.config.hooks.redactUrl(i)
|
|
1399
1320
|
}), { startTime: s }).end();
|
|
1400
1321
|
};
|
|
1401
1322
|
requestAnimationFrame(() => requestAnimationFrame(() => setTimeout(c, 0)));
|
|
1402
|
-
}, a =
|
|
1323
|
+
}, a = rn((e) => {
|
|
1403
1324
|
e.fromUrl !== e.toUrl && i(e.source, e.fromUrl, e.toUrl);
|
|
1404
1325
|
});
|
|
1405
|
-
|
|
1326
|
+
e.push(a);
|
|
1406
1327
|
},
|
|
1407
1328
|
shutdown() {
|
|
1408
|
-
for (
|
|
1409
|
-
var
|
|
1410
|
-
(
|
|
1329
|
+
for (t = !0; e.length;) {
|
|
1330
|
+
var n;
|
|
1331
|
+
(n = e.pop()) == null || n();
|
|
1411
1332
|
}
|
|
1412
1333
|
}
|
|
1413
1334
|
};
|
|
1414
|
-
},
|
|
1335
|
+
}, un = 1800 * 1e3, dn = 1440 * 60 * 1e3, fn = 6e4, pn = 5e3, mn = [
|
|
1415
1336
|
"click",
|
|
1416
1337
|
"keydown",
|
|
1417
1338
|
"scroll",
|
|
1418
1339
|
"mousemove",
|
|
1419
1340
|
"touchstart"
|
|
1420
|
-
], gn = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 && e <= t +
|
|
1341
|
+
], hn = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t, gn = (e, t) => typeof e == "number" && Number.isFinite(e) && e > 0 && e <= t + pn, X = (e, t) => {
|
|
1421
1342
|
if (!e) return null;
|
|
1422
1343
|
try {
|
|
1423
1344
|
let n = JSON.parse(e);
|
|
1424
1345
|
if (typeof (n == null ? void 0 : n.id) == "string" && gn(n.ts, t) && gn(n.startedAt, t)) return n;
|
|
1425
1346
|
} catch (e) {}
|
|
1426
1347
|
return null;
|
|
1427
|
-
},
|
|
1348
|
+
}, _n = (e, t) => {
|
|
1428
1349
|
if (typeof window > "u") return null;
|
|
1429
1350
|
let n = null;
|
|
1430
1351
|
try {
|
|
1431
1352
|
n = window.localStorage.getItem(e);
|
|
1432
1353
|
} catch (e) {}
|
|
1433
|
-
let r =
|
|
1354
|
+
let r = X(n, t);
|
|
1434
1355
|
if (r) return r;
|
|
1435
1356
|
try {
|
|
1436
1357
|
n = window.sessionStorage.getItem(e);
|
|
1437
1358
|
} catch (e) {}
|
|
1438
|
-
return r =
|
|
1439
|
-
},
|
|
1359
|
+
return r = X(n, t), r;
|
|
1360
|
+
}, Z = (e, t) => {
|
|
1440
1361
|
if (typeof window > "u") return;
|
|
1441
1362
|
let n = JSON.stringify(t);
|
|
1442
1363
|
try {
|
|
@@ -1445,23 +1366,23 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1445
1366
|
try {
|
|
1446
1367
|
window.localStorage.setItem(e, n);
|
|
1447
1368
|
} catch (e) {}
|
|
1448
|
-
},
|
|
1449
|
-
let r = Date.now(), i =
|
|
1369
|
+
}, vn = (e, t, n) => {
|
|
1370
|
+
let r = Date.now(), i = _n(e, r);
|
|
1450
1371
|
if (i) {
|
|
1451
1372
|
let a = r - i.ts >= t, o = r - i.startedAt >= n;
|
|
1452
1373
|
if (!a && !o) {
|
|
1453
|
-
let t =
|
|
1454
|
-
return
|
|
1374
|
+
let t = E(E({}, i), {}, { ts: r });
|
|
1375
|
+
return Z(e, t), {
|
|
1455
1376
|
id: t.id,
|
|
1456
1377
|
rotated: !1
|
|
1457
1378
|
};
|
|
1458
1379
|
}
|
|
1459
1380
|
let s = a ? "inactivity" : "maxLifetime", c = {
|
|
1460
|
-
id:
|
|
1381
|
+
id: L("session"),
|
|
1461
1382
|
startedAt: r,
|
|
1462
1383
|
ts: r
|
|
1463
1384
|
};
|
|
1464
|
-
return
|
|
1385
|
+
return Z(e, c), {
|
|
1465
1386
|
id: c.id,
|
|
1466
1387
|
prevId: i.id,
|
|
1467
1388
|
reason: s,
|
|
@@ -1469,70 +1390,69 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1469
1390
|
};
|
|
1470
1391
|
}
|
|
1471
1392
|
let a = {
|
|
1472
|
-
id:
|
|
1393
|
+
id: L("session"),
|
|
1473
1394
|
startedAt: r,
|
|
1474
1395
|
ts: r
|
|
1475
1396
|
};
|
|
1476
|
-
return
|
|
1397
|
+
return Z(e, a), {
|
|
1477
1398
|
id: a.id,
|
|
1478
1399
|
reason: "init",
|
|
1479
1400
|
rotated: !0
|
|
1480
1401
|
};
|
|
1481
|
-
},
|
|
1402
|
+
}, yn = (e) => {
|
|
1482
1403
|
let t = "";
|
|
1483
1404
|
try {
|
|
1484
1405
|
t = new URL(e).host;
|
|
1485
1406
|
} catch (n) {
|
|
1486
1407
|
t = e;
|
|
1487
1408
|
}
|
|
1488
|
-
return `bk_ot_session__${
|
|
1489
|
-
},
|
|
1409
|
+
return `bk_ot_session__${st(t || "default")}`;
|
|
1410
|
+
}, bn = (e, t) => {
|
|
1490
1411
|
if (!t.rotated || !t.reason) return;
|
|
1491
1412
|
let n = Date.now();
|
|
1492
1413
|
e.emitLog({
|
|
1493
1414
|
severityNumber: o.INFO,
|
|
1494
1415
|
severityText: "INFO",
|
|
1495
1416
|
body: t.reason === "init" ? "session.start" : "session.rotate",
|
|
1496
|
-
attributes:
|
|
1417
|
+
attributes: E(E({}, e.config.hooks.getPageAttributes()), {}, {
|
|
1497
1418
|
[b.sessionHasReplay]: !1,
|
|
1498
1419
|
[b.sessionId]: t.id,
|
|
1499
1420
|
[b.sessionStartTime]: n,
|
|
1500
1421
|
"session.rotate.reason": t.reason
|
|
1501
1422
|
}, t.prevId ? { "session.previous_id": t.prevId } : {})
|
|
1502
1423
|
});
|
|
1503
|
-
},
|
|
1504
|
-
let t = [];
|
|
1424
|
+
}, xn = (e = {}) => {
|
|
1425
|
+
let t = [], n = hn(e.inactivityMs, un), r = hn(e.maxLifetimeMs, dn);
|
|
1505
1426
|
return {
|
|
1506
1427
|
name: "session",
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
let i = e.enabled ? (r = e.storageKey) == null ? xn(n.config.transport.endpoint) : r : xn(n.config.transport.endpoint), a = e.enabled ? e.inactivityMs : dn, o = e.enabled ? e.maxLifetimeMs : fn, s = "", c = () => {
|
|
1428
|
+
init(i) {
|
|
1429
|
+
var a;
|
|
1430
|
+
let o = (a = e.storageKey) == null ? yn(i.config.transport.endpoint) : a, s = "", c = () => {
|
|
1511
1431
|
if (typeof window > "u") {
|
|
1512
|
-
s || (s =
|
|
1432
|
+
s || (s = L("session"), i.setRuntimeAttributes({
|
|
1513
1433
|
[b.sessionHasReplay]: !1,
|
|
1514
1434
|
[b.sessionId]: s
|
|
1515
1435
|
}));
|
|
1516
1436
|
return;
|
|
1517
1437
|
}
|
|
1518
|
-
let e =
|
|
1519
|
-
|
|
1438
|
+
let e = vn(o, n, r);
|
|
1439
|
+
i.setRuntimeAttributes({
|
|
1520
1440
|
[b.sessionHasReplay]: !1,
|
|
1521
1441
|
[b.sessionId]: e.id
|
|
1522
|
-
}), e.id !== s && (s = e.id,
|
|
1442
|
+
}), e.id !== s && (s = e.id, bn(i, e));
|
|
1523
1443
|
};
|
|
1524
1444
|
if (c(), typeof window > "u" || typeof document > "u") return;
|
|
1525
1445
|
let l = Date.now(), u = () => {
|
|
1526
1446
|
let e = Date.now();
|
|
1527
|
-
e - l <
|
|
1447
|
+
e - l < fn || (l = e, c());
|
|
1528
1448
|
}, d = {
|
|
1529
1449
|
capture: !0,
|
|
1530
1450
|
passive: !0
|
|
1531
1451
|
};
|
|
1532
|
-
|
|
1452
|
+
mn.forEach((e) => {
|
|
1533
1453
|
window.addEventListener(e, u, d);
|
|
1534
1454
|
}), t.push(() => {
|
|
1535
|
-
|
|
1455
|
+
mn.forEach((e) => {
|
|
1536
1456
|
window.removeEventListener(e, u, d);
|
|
1537
1457
|
});
|
|
1538
1458
|
});
|
|
@@ -1541,14 +1461,14 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1541
1461
|
};
|
|
1542
1462
|
document.addEventListener("visibilitychange", f), t.push(() => document.removeEventListener("visibilitychange", f));
|
|
1543
1463
|
let p = (e) => {
|
|
1544
|
-
if (e.storageArea !== window.localStorage || e.key !==
|
|
1545
|
-
let t = Date.now(),
|
|
1546
|
-
if (!(!
|
|
1547
|
-
s =
|
|
1464
|
+
if (e.storageArea !== window.localStorage || e.key !== o || !e.newValue) return;
|
|
1465
|
+
let t = Date.now(), n = X(e.newValue, t);
|
|
1466
|
+
if (!(!n || n.id === s)) {
|
|
1467
|
+
s = n.id;
|
|
1548
1468
|
try {
|
|
1549
|
-
window.sessionStorage.setItem(
|
|
1469
|
+
window.sessionStorage.setItem(o, e.newValue);
|
|
1550
1470
|
} catch (e) {}
|
|
1551
|
-
|
|
1471
|
+
i.setRuntimeAttributes({ [b.sessionId]: n.id });
|
|
1552
1472
|
}
|
|
1553
1473
|
};
|
|
1554
1474
|
window.addEventListener("storage", p), t.push(() => window.removeEventListener("storage", p));
|
|
@@ -1560,18 +1480,18 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1560
1480
|
}
|
|
1561
1481
|
}
|
|
1562
1482
|
};
|
|
1563
|
-
},
|
|
1564
|
-
if (typeof performance > "u") return
|
|
1483
|
+
}, Sn = "unknown", Cn = (e) => e ? e.replace(/_/g, "-") : Sn, wn = () => {
|
|
1484
|
+
if (typeof performance > "u") return Sn;
|
|
1565
1485
|
let e = performance.getEntriesByType("navigation")[0];
|
|
1566
|
-
return
|
|
1567
|
-
},
|
|
1486
|
+
return Cn(e == null ? void 0 : e.type);
|
|
1487
|
+
}, Tn = (e, t) => {
|
|
1568
1488
|
var n;
|
|
1569
1489
|
return {
|
|
1570
1490
|
"rum.navigation.type": (n = e.navigationType) == null ? t : n,
|
|
1571
1491
|
[b.vitalMetric]: e.name.toLowerCase(),
|
|
1572
1492
|
[b.vitalRating]: e.rating
|
|
1573
1493
|
};
|
|
1574
|
-
},
|
|
1494
|
+
}, En = (e, t) => {
|
|
1575
1495
|
var n;
|
|
1576
1496
|
let r = (n = e.attribution) == null ? {} : n, i = {}, a = (e) => r[e], o = (e, t, n) => {
|
|
1577
1497
|
t != null && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") && (i[e] = typeof t == "string" && n ? n(t) : t);
|
|
@@ -1595,61 +1515,60 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1595
1515
|
default: break;
|
|
1596
1516
|
}
|
|
1597
1517
|
return i;
|
|
1598
|
-
},
|
|
1599
|
-
let
|
|
1518
|
+
}, Dn = () => {
|
|
1519
|
+
let e = !1;
|
|
1600
1520
|
return {
|
|
1601
1521
|
name: "web-vitals",
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
return M(function* () {
|
|
1522
|
+
init(t) {
|
|
1523
|
+
return A(function* () {
|
|
1605
1524
|
if (typeof window > "u") return;
|
|
1606
1525
|
let n;
|
|
1607
1526
|
try {
|
|
1608
1527
|
n = yield import("web-vitals/attribution");
|
|
1609
|
-
} catch (
|
|
1610
|
-
if (
|
|
1528
|
+
} catch (e) {
|
|
1529
|
+
if (t.config.debug) {
|
|
1611
1530
|
var r;
|
|
1612
|
-
(r = globalThis.console) == null || r.warn("[bk-ot] web-vitals load failed:",
|
|
1531
|
+
(r = globalThis.console) == null || r.warn("[bk-ot] web-vitals load failed:", e);
|
|
1613
1532
|
}
|
|
1614
1533
|
return;
|
|
1615
1534
|
}
|
|
1616
|
-
if (
|
|
1617
|
-
let { onCLS: i, onFCP: a, onINP: o, onLCP: s, onTTFB: c } = n, l =
|
|
1535
|
+
if (e) return;
|
|
1536
|
+
let { onCLS: i, onFCP: a, onINP: o, onLCP: s, onTTFB: c } = n, l = wn(), u = t.meter.createHistogram("browser.web_vital.cls", {
|
|
1618
1537
|
unit: "1",
|
|
1619
1538
|
description: "Cumulative Layout Shift"
|
|
1620
|
-
}), d =
|
|
1539
|
+
}), d = t.meter.createHistogram("browser.web_vital.duration", {
|
|
1621
1540
|
unit: "ms",
|
|
1622
1541
|
description: "Web Vitals duration metrics, including FCP, INP, LCP and TTFB"
|
|
1623
|
-
}), f = (
|
|
1624
|
-
let n =
|
|
1625
|
-
|
|
1626
|
-
duration:
|
|
1627
|
-
errorType:
|
|
1542
|
+
}), f = (e) => {
|
|
1543
|
+
let n = e.name.toLowerCase();
|
|
1544
|
+
t.startSpan("browser.web_vital", E(E(E(E(E({}, t.config.hooks.getPageAttributes()), t.config.hooks.getMetricAttributes()), Tn(e, l)), F({
|
|
1545
|
+
duration: e.name === "CLS" ? void 0 : e.value,
|
|
1546
|
+
errorType: e.rating === "good" ? "none" : "slow",
|
|
1628
1547
|
eventLabel: "Web 指标",
|
|
1629
|
-
result:
|
|
1548
|
+
result: Fe(e.rating),
|
|
1630
1549
|
spanSubtype: n,
|
|
1631
|
-
spanType:
|
|
1550
|
+
spanType: P.vital,
|
|
1632
1551
|
targetLabel: n,
|
|
1633
|
-
targetValue:
|
|
1552
|
+
targetValue: e.value
|
|
1634
1553
|
})), {}, {
|
|
1635
1554
|
[b.vitalMetric]: n,
|
|
1636
|
-
[b.vitalValue]:
|
|
1637
|
-
[b.vitalRating]:
|
|
1638
|
-
"vital.id":
|
|
1639
|
-
},
|
|
1555
|
+
[b.vitalValue]: e.value,
|
|
1556
|
+
[b.vitalRating]: e.rating,
|
|
1557
|
+
"vital.id": e.id
|
|
1558
|
+
}, En(e, t.config.hooks.redactUrl))).end();
|
|
1640
1559
|
}, p = (n) => {
|
|
1641
|
-
|
|
1560
|
+
e || !Number.isFinite(n.value) || (d.record(n.value, t.applyRedact(E(E(E({}, t.config.hooks.getPageAttributes()), t.config.hooks.getMetricAttributes()), Tn(n, l)))), f(n));
|
|
1642
1561
|
};
|
|
1643
1562
|
i((n) => {
|
|
1644
|
-
|
|
1563
|
+
e || !Number.isFinite(n.value) || (u.record(n.value, t.applyRedact(E(E(E({}, t.config.hooks.getPageAttributes()), t.config.hooks.getMetricAttributes()), Tn(n, l)))), f(n));
|
|
1645
1564
|
}), a(p), o(p), s(p), c(p);
|
|
1646
1565
|
})();
|
|
1647
1566
|
},
|
|
1648
1567
|
shutdown() {
|
|
1649
|
-
|
|
1568
|
+
e = !0;
|
|
1650
1569
|
}
|
|
1651
1570
|
};
|
|
1652
|
-
},
|
|
1571
|
+
}, On = 64 * 1024, kn = 6e4, An = 5, jn = (e) => e == null ? 0 : typeof e == "string" ? e.length > On || typeof TextEncoder > "u" ? e.length : new TextEncoder().encode(e).byteLength : e instanceof ArrayBuffer || ArrayBuffer.isView(e) ? e.byteLength : typeof Blob < "u" && e instanceof Blob ? e.size : 0, Mn = (e, t) => {
|
|
1653
1572
|
let n = {
|
|
1654
1573
|
"network.protocol.name": "websocket",
|
|
1655
1574
|
"url.full": t(e)
|
|
@@ -1662,13 +1581,13 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1662
1581
|
metricAttributes: r,
|
|
1663
1582
|
spanAttributes: n
|
|
1664
1583
|
};
|
|
1665
|
-
},
|
|
1584
|
+
}, Nn = (e, n) => {
|
|
1666
1585
|
var r;
|
|
1667
|
-
let { bytesCounter: i, connectDurationHistogram: a, context: s, errorCounter: c, errorThrottle: l, isDisposed: u, messageCounter: d, url: f } = n, { metricAttributes: p, spanAttributes: m } =
|
|
1586
|
+
let { bytesCounter: i, connectDurationHistogram: a, context: s, errorCounter: c, errorThrottle: l, isDisposed: u, messageCounter: d, url: f } = n, { metricAttributes: p, spanAttributes: m } = Mn(f, s.config.hooks.redactUrl), h = (r = m["server.address"]) == null ? m["url.full"] : r, g = s.startSpan("websocket.connect", E(E(E({}, m), F({
|
|
1668
1587
|
errorType: "none",
|
|
1669
1588
|
eventLabel: "WebSocket",
|
|
1670
1589
|
spanSubtype: "websocket",
|
|
1671
|
-
spanType:
|
|
1590
|
+
spanType: P.custom,
|
|
1672
1591
|
targetLabel: h
|
|
1673
1592
|
})), m["server.address"] ? { [b.targetDomain]: m["server.address"] } : {})), _ = performance.now(), v = !1, y = (e) => {
|
|
1674
1593
|
if (v) return;
|
|
@@ -1677,13 +1596,13 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1677
1596
|
e === "error" && g.setStatus({
|
|
1678
1597
|
code: t.ERROR,
|
|
1679
1598
|
message: "websocket connect failed"
|
|
1680
|
-
}), g.setAttributes(
|
|
1599
|
+
}), g.setAttributes(F({
|
|
1681
1600
|
duration: n,
|
|
1682
1601
|
errorType: e === "error" ? "network" : "none",
|
|
1683
1602
|
eventLabel: "WebSocket",
|
|
1684
|
-
result: e === "error" ?
|
|
1603
|
+
result: e === "error" ? N.error : N.success,
|
|
1685
1604
|
spanSubtype: "websocket",
|
|
1686
|
-
spanType:
|
|
1605
|
+
spanType: P.custom,
|
|
1687
1606
|
targetLabel: h,
|
|
1688
1607
|
targetValue: n
|
|
1689
1608
|
})), g.end(), e === "opened" && !u() && a.record(n, p);
|
|
@@ -1692,23 +1611,23 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1692
1611
|
u() || y("opened");
|
|
1693
1612
|
}), e.addEventListener("message", (e) => {
|
|
1694
1613
|
if (u()) return;
|
|
1695
|
-
let t =
|
|
1696
|
-
d.add(1, t), i.add(
|
|
1614
|
+
let t = E(E({}, p), {}, { "websocket.direction": "in" });
|
|
1615
|
+
d.add(1, t), i.add(jn(e.data), t);
|
|
1697
1616
|
}), e.addEventListener("error", () => {
|
|
1698
1617
|
if (u()) return;
|
|
1699
1618
|
let e = v ? "runtime" : "connect";
|
|
1700
|
-
c.add(1,
|
|
1619
|
+
c.add(1, E(E({}, p), {}, { "websocket.error.phase": e })), y("error");
|
|
1701
1620
|
let t = l.allow(`ws:error:${f}`);
|
|
1702
1621
|
t.allowed && s.emitLog({
|
|
1703
1622
|
severityNumber: o.ERROR,
|
|
1704
1623
|
severityText: "ERROR",
|
|
1705
1624
|
body: "websocket.error",
|
|
1706
|
-
attributes:
|
|
1625
|
+
attributes: E(E(E({}, m), F({
|
|
1707
1626
|
errorType: "network",
|
|
1708
1627
|
eventLabel: "WebSocket 错误",
|
|
1709
|
-
result:
|
|
1628
|
+
result: N.error,
|
|
1710
1629
|
spanSubtype: "websocket",
|
|
1711
|
-
spanType:
|
|
1630
|
+
spanType: P.custom,
|
|
1712
1631
|
targetLabel: h
|
|
1713
1632
|
})), {}, {
|
|
1714
1633
|
"websocket.error.phase": e,
|
|
@@ -1720,12 +1639,12 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1720
1639
|
severityNumber: o.INFO,
|
|
1721
1640
|
severityText: "INFO",
|
|
1722
1641
|
body: "websocket.close",
|
|
1723
|
-
attributes:
|
|
1642
|
+
attributes: E(E(E({}, m), F({
|
|
1724
1643
|
errorType: e.wasClean ? "none" : "network",
|
|
1725
1644
|
eventLabel: "WebSocket 关闭",
|
|
1726
|
-
result: e.wasClean ?
|
|
1645
|
+
result: e.wasClean ? N.success : N.warning,
|
|
1727
1646
|
spanSubtype: "websocket",
|
|
1728
|
-
spanType:
|
|
1647
|
+
spanType: P.custom,
|
|
1729
1648
|
targetLabel: h,
|
|
1730
1649
|
targetValue: e.code
|
|
1731
1650
|
})), {}, {
|
|
@@ -1738,109 +1657,108 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1738
1657
|
let ee = e.send.bind(e);
|
|
1739
1658
|
e.send = (e) => {
|
|
1740
1659
|
if (!u()) {
|
|
1741
|
-
let t =
|
|
1742
|
-
d.add(1, t), i.add(
|
|
1660
|
+
let t = E(E({}, p), {}, { "websocket.direction": "out" });
|
|
1661
|
+
d.add(1, t), i.add(jn(e), t);
|
|
1743
1662
|
}
|
|
1744
1663
|
return ee(e);
|
|
1745
1664
|
};
|
|
1746
|
-
},
|
|
1747
|
-
let t, n
|
|
1665
|
+
}, Pn = () => {
|
|
1666
|
+
let e, t, n = !1;
|
|
1748
1667
|
return {
|
|
1749
1668
|
name: "websocket",
|
|
1750
|
-
|
|
1751
|
-
init(e) {
|
|
1669
|
+
init(r) {
|
|
1752
1670
|
if (typeof window > "u" || window.WebSocket === void 0) return;
|
|
1753
1671
|
let i = window.WebSocket;
|
|
1754
|
-
|
|
1755
|
-
let a =
|
|
1672
|
+
e = i;
|
|
1673
|
+
let a = r.meter.createCounter("browser.websocket.message.count", { description: "Total number of WebSocket messages observed" }), o = r.meter.createCounter("browser.websocket.message.bytes", {
|
|
1756
1674
|
unit: "By",
|
|
1757
1675
|
description: "Total bytes transferred over WebSocket (best-effort)"
|
|
1758
|
-
}), s =
|
|
1676
|
+
}), s = r.meter.createCounter("browser.websocket.error.count", { description: "Total number of WebSocket error events" }), c = r.meter.createHistogram("browser.websocket.connect.duration", {
|
|
1759
1677
|
unit: "ms",
|
|
1760
1678
|
description: "WebSocket connection establishment duration (only successful connects)"
|
|
1761
|
-
}), l =
|
|
1762
|
-
|
|
1763
|
-
let d = Reflect.construct(
|
|
1764
|
-
if (
|
|
1765
|
-
let f =
|
|
1766
|
-
return !f ||
|
|
1679
|
+
}), l = ct(kn, An), u = () => n;
|
|
1680
|
+
t = new Proxy(i, { construct(e, t, i) {
|
|
1681
|
+
let d = Reflect.construct(e, t, i);
|
|
1682
|
+
if (n) return d;
|
|
1683
|
+
let f = t[0] == null ? "" : String(t[0]);
|
|
1684
|
+
return !f || M(r.config, f) || Nn(d, {
|
|
1767
1685
|
bytesCounter: o,
|
|
1768
1686
|
connectDurationHistogram: c,
|
|
1769
|
-
context:
|
|
1687
|
+
context: r,
|
|
1770
1688
|
errorCounter: s,
|
|
1771
1689
|
errorThrottle: l,
|
|
1772
1690
|
isDisposed: u,
|
|
1773
1691
|
messageCounter: a,
|
|
1774
1692
|
url: f
|
|
1775
1693
|
}), d;
|
|
1776
|
-
} }), window.WebSocket =
|
|
1694
|
+
} }), window.WebSocket = t;
|
|
1777
1695
|
},
|
|
1778
1696
|
shutdown() {
|
|
1779
|
-
|
|
1697
|
+
n = !0, typeof window < "u" && e && window.WebSocket === t && (window.WebSocket = e), t = void 0, e = void 0;
|
|
1780
1698
|
}
|
|
1781
1699
|
};
|
|
1782
|
-
},
|
|
1700
|
+
}, Q = "BK_RUM_SAMPLING", Fn = /* @__PURE__ */ new Map(), In = (e) => Fn.get(e), Ln = (e, t) => (Fn.set(e, t), t), Rn = ({ sampling: e }) => {
|
|
1783
1701
|
if (e.rate <= 0) return !1;
|
|
1784
1702
|
if (e.rate >= 1) return !0;
|
|
1785
1703
|
try {
|
|
1786
|
-
let t = sessionStorage.getItem(
|
|
1704
|
+
let t = sessionStorage.getItem(Q);
|
|
1787
1705
|
if (t) return t === "1";
|
|
1788
1706
|
let n = Math.random() < e.rate;
|
|
1789
|
-
return sessionStorage.setItem(
|
|
1707
|
+
return sessionStorage.setItem(Q, n ? "1" : "0"), Ln(Q, n), n;
|
|
1790
1708
|
} catch (t) {
|
|
1791
|
-
let n =
|
|
1792
|
-
return typeof n == "boolean" ? n :
|
|
1709
|
+
let n = In(Q);
|
|
1710
|
+
return typeof n == "boolean" ? n : Ln(Q, Math.random() < e.rate);
|
|
1793
1711
|
}
|
|
1794
|
-
},
|
|
1712
|
+
}, zn = (e) => ({
|
|
1795
1713
|
url: e.endpoint,
|
|
1796
1714
|
headers: e.headers,
|
|
1797
1715
|
concurrencyLimit: e.concurrencyLimit,
|
|
1798
1716
|
timeoutMillis: e.timeoutMillis
|
|
1799
|
-
}),
|
|
1717
|
+
}), Bn = "bk-rum", Vn = (e, t, n) => n ? new Proxy(e, { get(e, n, r) {
|
|
1800
1718
|
if (n === "export") return (n, r) => {
|
|
1801
1719
|
var i;
|
|
1802
1720
|
return (i = globalThis.console) == null || i.log(`[bk-ot][${t}]`, n), e.export(n, r);
|
|
1803
1721
|
};
|
|
1804
1722
|
let i = Reflect.get(e, n, r);
|
|
1805
1723
|
return typeof i == "function" ? i.bind(e) : i;
|
|
1806
|
-
} }) : e,
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1724
|
+
} }) : e, Hn = (e) => [ot(e.instrumentations)], Un = (e, t) => e === void 0 ? t : e !== !1, Wn = (e) => typeof e == "object" && e ? e : void 0, $ = (e, t, n) => Un(e, t) ? [n(Wn(e))] : [], Gn = (e) => [
|
|
1725
|
+
...$(e.device, !0, Tt),
|
|
1726
|
+
...$(e.session, !0, xn),
|
|
1727
|
+
...$(e.pageView, !0, on),
|
|
1728
|
+
...$(e.httpBody, !1, Yt),
|
|
1729
|
+
...$(e.error, !0, Pt),
|
|
1730
|
+
...$(e.webVitals, !0, Dn),
|
|
1731
|
+
...$(e.resource, !0, cn),
|
|
1732
|
+
...$(e.blankScreen, !0, Qe),
|
|
1733
|
+
...$(e.action, !1, He),
|
|
1734
|
+
...$(e.websocket, !1, Pn),
|
|
1735
|
+
...$(e.longTask, !1, Qt),
|
|
1736
|
+
...$(e.cspViolation, !1, pt),
|
|
1737
|
+
...$(e.routeTiming, !1, ln)
|
|
1820
1738
|
], Kn = class {
|
|
1821
1739
|
assertBeforeStart(e) {
|
|
1822
1740
|
if (this.phase !== "idle") throw Error(`[bk-ot] ${e}() must be called before start(); set autoStart: false before registration.`);
|
|
1823
1741
|
}
|
|
1824
1742
|
constructor(o) {
|
|
1825
|
-
var x = this;
|
|
1826
|
-
|
|
1743
|
+
var x = this, S, C;
|
|
1744
|
+
w(this, "loggerProvider", void 0), w(this, "meterProvider", void 0), w(this, "phase", "idle"), w(this, "pluginManager", void 0), w(this, "plugins", void 0), w(this, "registeredInstrumentations", void 0), w(this, "runtimeContext", void 0), w(this, "sampled", void 0), w(this, "teardownCallbacks", []), w(this, "tracerProvider", void 0), w(this, "applyRedact", (e) => this.config.hooks.redactAttributes(e)), w(this, "config", void 0), w(this, "emitLog", (e) => {
|
|
1827
1745
|
var t;
|
|
1828
|
-
let n =
|
|
1746
|
+
let n = E(E({}, e), {}, { attributes: this.applyRedact(E(E({}, this.getRuntimeAttributes()), (t = e.attributes) == null ? {} : t)) });
|
|
1829
1747
|
this.logger.emit(n);
|
|
1830
|
-
}),
|
|
1748
|
+
}), w(this, "flush", A(function* () {
|
|
1831
1749
|
yield x.pluginManager.flush(), yield x.tracerProvider.forceFlush(), yield x.meterProvider.forceFlush(), yield x.loggerProvider.forceFlush();
|
|
1832
|
-
})),
|
|
1750
|
+
})), w(this, "getRuntimeAttributes", () => this.runtimeContext.getAttributes()), w(this, "logger", void 0), w(this, "meter", void 0), w(this, "reportAction", ({ attributes: e = {}, targetTag: t, targetText: n, type: r }) => {
|
|
1833
1751
|
var i;
|
|
1834
1752
|
if (!this.sampled) return;
|
|
1835
1753
|
let a = n == null ? void 0 : n.slice(0, 32);
|
|
1836
|
-
this.startSpan(`action.${r}`,
|
|
1754
|
+
this.startSpan(`action.${r}`, E(E(E(E(E({}, this.config.hooks.getPageAttributes()), F({
|
|
1837
1755
|
errorType: "none",
|
|
1838
1756
|
eventLabel: "用户操作",
|
|
1839
1757
|
spanSubtype: r,
|
|
1840
|
-
spanType:
|
|
1758
|
+
spanType: P.action,
|
|
1841
1759
|
targetLabel: (i = a == null ? t : a) == null ? r : i
|
|
1842
1760
|
})), {}, { [b.actionType]: r }, a ? { [b.targetTextShort]: a } : {}), t ? { [b.targetTag]: t } : {}), e)).end();
|
|
1843
|
-
}),
|
|
1761
|
+
}), w(this, "reportCustomEvent", ({ attributes: e = {}, error: n, name: r }) => {
|
|
1844
1762
|
if (!this.sampled) {
|
|
1845
1763
|
if (this.config.debug) {
|
|
1846
1764
|
var i;
|
|
@@ -1848,25 +1766,25 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1848
1766
|
}
|
|
1849
1767
|
return;
|
|
1850
1768
|
}
|
|
1851
|
-
let a = this.startSpan(`custom.${r}`,
|
|
1769
|
+
let a = this.startSpan(`custom.${r}`, E(E(E(E(E({}, this.config.hooks.getPageAttributes()), this.config.hooks.getCustomAttributes()), F({
|
|
1852
1770
|
errorType: n ? "custom" : "none",
|
|
1853
1771
|
eventLabel: "自定义事件",
|
|
1854
|
-
result: n ?
|
|
1772
|
+
result: n ? N.error : N.success,
|
|
1855
1773
|
spanSubtype: r,
|
|
1856
|
-
spanType:
|
|
1774
|
+
spanType: P.custom,
|
|
1857
1775
|
targetLabel: r
|
|
1858
1776
|
})), e), {}, { "rum.custom.name": r }));
|
|
1859
1777
|
n && (a.recordException(n), a.setStatus({
|
|
1860
1778
|
code: t.ERROR,
|
|
1861
1779
|
message: n.message
|
|
1862
1780
|
})), a.end();
|
|
1863
|
-
}),
|
|
1781
|
+
}), w(this, "setRuntimeAttributes", (e) => {
|
|
1864
1782
|
this.runtimeContext.setAttributes(e);
|
|
1865
|
-
}),
|
|
1783
|
+
}), w(this, "setUser", (e) => {
|
|
1866
1784
|
this.runtimeContext.setUser(e);
|
|
1867
|
-
}),
|
|
1785
|
+
}), w(this, "setView", (e) => {
|
|
1868
1786
|
this.runtimeContext.setView(e);
|
|
1869
|
-
}),
|
|
1787
|
+
}), w(this, "shutdown", A(function* () {
|
|
1870
1788
|
if (x.phase !== "stopped") {
|
|
1871
1789
|
for (yield x.flush(); x.teardownCallbacks.length;) {
|
|
1872
1790
|
var e;
|
|
@@ -1878,7 +1796,7 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1878
1796
|
}
|
|
1879
1797
|
yield x.tracerProvider.shutdown(), yield x.meterProvider.shutdown(), yield x.loggerProvider.shutdown(), a.disable(), r.disable(), n.disable(), x.phase = "stopped";
|
|
1880
1798
|
}
|
|
1881
|
-
})),
|
|
1799
|
+
})), w(this, "start", A(function* () {
|
|
1882
1800
|
if (!(x.phase === "started" || x.phase === "starting")) {
|
|
1883
1801
|
if (x.phase === "stopped") throw Error("[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.");
|
|
1884
1802
|
if (!x.config.enabled) {
|
|
@@ -1913,30 +1831,30 @@ var De = (e, t) => typeof e.enabled == "function" ? e.enabled(t) : e.enabled !==
|
|
|
1913
1831
|
}
|
|
1914
1832
|
x.phase = "started";
|
|
1915
1833
|
}
|
|
1916
|
-
})),
|
|
1834
|
+
})), w(this, "startSpan", (t, n = {}, r) => this.tracer.startSpan(t, {
|
|
1917
1835
|
kind: e.INTERNAL,
|
|
1918
1836
|
startTime: r == null ? void 0 : r.startTime,
|
|
1919
|
-
attributes: this.applyRedact(
|
|
1920
|
-
})),
|
|
1921
|
-
let
|
|
1922
|
-
exporter:
|
|
1837
|
+
attributes: this.applyRedact(E(E({}, this.getRuntimeAttributes()), n))
|
|
1838
|
+
})), w(this, "tracer", void 0), w(this, "use", (e) => (this.assertBeforeStart("use"), this.sampled && this.plugins.push(e), this)), w(this, "useInstrumentation", (e) => (this.assertBeforeStart("useInstrumentation"), this.config.enabled && this.registeredInstrumentations.push(e), this)), this.config = ge(o), this.sampled = this.config.enabled && Rn(this.config);
|
|
1839
|
+
let T = m(this.config.resourceAttributes), D = Vn(new f(zn(this.config.transport.traces)), "traces", this.config.debug), ie = Vn(new d(zn(this.config.transport.metrics)), "metrics", this.config.debug), ae = Vn(new u(zn(this.config.transport.logs)), "logs", this.config.debug), O = new ke(this.config.spanProcessor === "simple" ? new te(D) : new y(D, this.config.spanBatch), this.config), oe = new v({
|
|
1840
|
+
exporter: ie,
|
|
1923
1841
|
exportIntervalMillis: this.config.metricIntervalMillis
|
|
1924
|
-
}),
|
|
1842
|
+
}), k = new h(ae);
|
|
1925
1843
|
this.tracerProvider = new re({
|
|
1926
|
-
resource:
|
|
1844
|
+
resource: T,
|
|
1927
1845
|
sampler: new ee({ root: new ne(+!!this.sampled) }),
|
|
1928
|
-
spanProcessors: [
|
|
1846
|
+
spanProcessors: [O]
|
|
1929
1847
|
}), this.meterProvider = new _({
|
|
1930
|
-
resource:
|
|
1931
|
-
readers: [
|
|
1848
|
+
resource: T,
|
|
1849
|
+
readers: [oe]
|
|
1932
1850
|
}), this.loggerProvider = new g({
|
|
1933
|
-
resource:
|
|
1934
|
-
processors: [
|
|
1935
|
-
}), this.tracer = this.tracerProvider.getTracer(
|
|
1851
|
+
resource: T,
|
|
1852
|
+
processors: [k]
|
|
1853
|
+
}), this.tracer = this.tracerProvider.getTracer(Bn), this.meter = this.meterProvider.getMeter(Bn), this.logger = this.loggerProvider.getLogger(Bn), this.runtimeContext = new Ae({ "rum.sampled": this.sampled }, this.config.user), this.registeredInstrumentations = this.config.enabled ? [...(S = this.config.instrumentations.custom) == null ? [] : S] : [], this.plugins = [...this.config.enabled ? Hn(this.config) : [], ...this.sampled ? [...Gn(this.config.plugins), ...(C = this.config.plugins.custom) == null ? [] : C] : []], this.pluginManager = new be(this.plugins), this.config.autoStart && this.start().catch((e) => {
|
|
1936
1854
|
var t;
|
|
1937
1855
|
(t = globalThis.console) == null || t.warn("[bk-ot] auto start failed:", e);
|
|
1938
1856
|
});
|
|
1939
1857
|
}
|
|
1940
1858
|
};
|
|
1941
1859
|
//#endregion
|
|
1942
|
-
export { Kn as BkOpenTelemetry,
|
|
1860
|
+
export { Kn as BkOpenTelemetry, ke as FilteringSpanProcessor, b as RUM_ATTRIBUTES, N as RUM_SPAN_RESULT, P as RUM_SPAN_TYPE, Ae as RumRuntimeContext, F as buildRumSpanAttributes, He as createActionPlugin, Qe as createBlankScreenPlugin, ot as createCommonInstrumentationsPlugin, pt as createCspViolationPlugin, Tt as createDevicePlugin, Pt as createErrorPlugin, Yt as createHttpBodyPlugin, Qt as createLongTaskPlugin, on as createPageViewPlugin, ye as createPlugin, cn as createResourcePlugin, ln as createRouteTimingPlugin, xn as createSessionPlugin, Pn as createWebSocketPlugin, Dn as createWebVitalsPlugin, je as getDurationBucket, ge as resolveConfig };
|