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