@utk09/ui-observability 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +75 -64
- package/dist/{batch-DEK4bv9N.js → batch-4xKzzSCj.js} +3 -3
- package/dist/{batch-DEK4bv9N.js.map → batch-4xKzzSCj.js.map} +1 -1
- package/dist/{batch-DEVFs28i.cjs → batch-cys7e53Q.cjs} +2 -2
- package/dist/{batch-DEVFs28i.cjs.map → batch-cys7e53Q.cjs.map} +1 -1
- package/dist/{bus-DNFvTkif.cjs → bus-B6vzPmQM.cjs} +2 -2
- package/dist/{bus-DNFvTkif.cjs.map → bus-B6vzPmQM.cjs.map} +1 -1
- package/dist/{bus-HVQ8E72V.js → bus-DrixwdiX.js} +11 -11
- package/dist/{bus-HVQ8E72V.js.map → bus-DrixwdiX.js.map} +1 -1
- package/dist/capture/network.d.ts +2 -0
- package/dist/capture/types.d.ts +3 -0
- package/dist/{console-C9Y639mn.js → console-B3vGRW5p.js} +3 -3
- package/dist/{console-C9Y639mn.js.map → console-B3vGRW5p.js.map} +1 -1
- package/dist/{console-DssDxq1B.cjs → console-ChfuJlf9.cjs} +2 -2
- package/dist/{console-DssDxq1B.cjs.map → console-ChfuJlf9.cjs.map} +1 -1
- package/dist/constants-Be83LICb.cjs +2 -0
- package/dist/constants-Be83LICb.cjs.map +1 -0
- package/dist/{constants-N99w84xy.js → constants-CQ_D7jIW.js} +39 -12
- package/dist/constants-CQ_D7jIW.js.map +1 -0
- package/dist/constants.d.ts +27 -1
- package/dist/core/diagnostics.d.ts +1 -1
- package/dist/core/meter.d.ts +45 -0
- package/dist/core/pipeline.d.ts +5 -12
- package/dist/core/record.d.ts +7 -0
- package/dist/core/runtime.d.ts +17 -0
- package/dist/core/sampling.d.ts +2 -0
- package/dist/core/sender.d.ts +2 -0
- package/dist/{errors-CQusIGWJ.js → errors-BGs5NOrw.js} +4 -4
- package/dist/{errors-CQusIGWJ.js.map → errors-BGs5NOrw.js.map} +1 -1
- package/dist/{errors-BTWuVnHZ.cjs → errors-BMJm7KZZ.cjs} +2 -2
- package/dist/{errors-BTWuVnHZ.cjs.map → errors-BMJm7KZZ.cjs.map} +1 -1
- package/dist/{identity-B1GDS1Tb.cjs → identity-DXyV86o-.cjs} +2 -2
- package/dist/{identity-B1GDS1Tb.cjs.map → identity-DXyV86o-.cjs.map} +1 -1
- package/dist/{identity-D4DPjTM9.js → identity-rpEyjvVg.js} +2 -2
- package/dist/{identity-D4DPjTM9.js.map → identity-rpEyjvVg.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +520 -355
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-ukzC82dm.cjs → indexeddb-storage-BXaPVPyG.cjs} +2 -2
- package/dist/{indexeddb-storage-ukzC82dm.cjs.map → indexeddb-storage-BXaPVPyG.cjs.map} +1 -1
- package/dist/{indexeddb-storage-B8SGUzSV.js → indexeddb-storage-Q9fDYlyn.js} +15 -15
- package/dist/{indexeddb-storage-B8SGUzSV.js.map → indexeddb-storage-Q9fDYlyn.js.map} +1 -1
- package/dist/{interactions-CnjfQgw3.js → interactions-B8zjCjga.js} +2 -2
- package/dist/{interactions-CnjfQgw3.js.map → interactions-B8zjCjga.js.map} +1 -1
- package/dist/{interactions-CcxrVzpg.cjs → interactions-BAGRmtrv.cjs} +2 -2
- package/dist/{interactions-CcxrVzpg.cjs.map → interactions-BAGRmtrv.cjs.map} +1 -1
- package/dist/{journey-DxlfdFJV.cjs → journey-BGSyy8Es.cjs} +2 -2
- package/dist/{journey-DxlfdFJV.cjs.map → journey-BGSyy8Es.cjs.map} +1 -1
- package/dist/{journey-DjvDzHyp.js → journey-_dQQ1eMP.js} +19 -19
- package/dist/{journey-DjvDzHyp.js.map → journey-_dQQ1eMP.js.map} +1 -1
- package/dist/library-request-BIG3Xpx3.cjs +2 -0
- package/dist/library-request-BIG3Xpx3.cjs.map +1 -0
- package/dist/library-request-DX6ev9oG.js +25 -0
- package/dist/library-request-DX6ev9oG.js.map +1 -0
- package/dist/{long-frames-CZk3XOkH.js → long-frames-B0tKuChx.js} +3 -3
- package/dist/{long-frames-CZk3XOkH.js.map → long-frames-B0tKuChx.js.map} +1 -1
- package/dist/{long-frames-BGik_Yhy.cjs → long-frames-Cq2LgNnp.cjs} +2 -2
- package/dist/{long-frames-BGik_Yhy.cjs.map → long-frames-Cq2LgNnp.cjs.map} +1 -1
- package/dist/models/config.d.ts +23 -0
- package/dist/models/metric.d.ts +50 -0
- package/dist/network-C6kJbW6K.cjs +2 -0
- package/dist/network-C6kJbW6K.cjs.map +1 -0
- package/dist/network-CMnEvGJB.js +211 -0
- package/dist/network-CMnEvGJB.js.map +1 -0
- package/dist/{platform-DW3GFIUE.cjs → platform-DNOJjpOm.cjs} +2 -2
- package/dist/{platform-DW3GFIUE.cjs.map → platform-DNOJjpOm.cjs.map} +1 -1
- package/dist/{platform-Cjts-8k8.js → platform-j0uMPwHi.js} +3 -3
- package/dist/{platform-Cjts-8k8.js.map → platform-j0uMPwHi.js.map} +1 -1
- package/dist/{remote-rules-ByS34k4e.cjs → remote-rules-DgoBJxZL.cjs} +2 -2
- package/dist/{remote-rules-ByS34k4e.cjs.map → remote-rules-DgoBJxZL.cjs.map} +1 -1
- package/dist/{remote-rules-M-XZ1xbe.js → remote-rules-UggoZqfP.js} +11 -11
- package/dist/{remote-rules-M-XZ1xbe.js.map → remote-rules-UggoZqfP.js.map} +1 -1
- package/dist/{sampling-BN3Oi6SV.js → sampling-BLMD8EGM.js} +28 -27
- package/dist/sampling-BLMD8EGM.js.map +1 -0
- package/dist/sampling-MthcVXXU.cjs +2 -0
- package/dist/sampling-MthcVXXU.cjs.map +1 -0
- package/dist/{sanitize-Dwj9JCkI.js → sanitize-BNwgPj_B.js} +2 -2
- package/dist/{sanitize-Dwj9JCkI.js.map → sanitize-BNwgPj_B.js.map} +1 -1
- package/dist/{sanitize-DKp5MRsa.cjs → sanitize-BqzPc4Jg.cjs} +2 -2
- package/dist/{sanitize-DKp5MRsa.cjs.map → sanitize-BqzPc4Jg.cjs.map} +1 -1
- package/dist/{sender-BBY0IcUo.js → sender--0_VzPbN.js} +408 -268
- package/dist/sender--0_VzPbN.js.map +1 -0
- package/dist/sender-SPGMqZjD.cjs +3 -0
- package/dist/sender-SPGMqZjD.cjs.map +1 -0
- package/dist/{storm-CKuaBp7i.cjs → storm-CTy1dfvs.cjs} +2 -2
- package/dist/{storm-CKuaBp7i.cjs.map → storm-CTy1dfvs.cjs.map} +1 -1
- package/dist/{storm-DhtL2eVr.js → storm-knaj4GUH.js} +2 -2
- package/dist/{storm-DhtL2eVr.js.map → storm-knaj4GUH.js.map} +1 -1
- package/dist/transport/custom-transport.d.ts +3 -2
- package/dist/transport/exit-flush.d.ts +13 -2
- package/dist/transport/http-transport.d.ts +6 -4
- package/dist/transport/retry-engine.d.ts +3 -1
- package/dist/transport/serializers/otlp-metrics.d.ts +3 -0
- package/dist/transport/serializers/otlp.d.ts +30 -0
- package/dist/transport/serializers/select.d.ts +20 -4
- package/dist/transport/status-transport.d.ts +19 -11
- package/dist/utils/library-request.d.ts +12 -0
- package/package.json +1 -1
- package/dist/constants-N99w84xy.js.map +0 -1
- package/dist/constants-X86IDwkC.cjs +0 -2
- package/dist/constants-X86IDwkC.cjs.map +0 -1
- package/dist/library-request-BZ1ekVtl.cjs +0 -2
- package/dist/library-request-BZ1ekVtl.cjs.map +0 -1
- package/dist/library-request-C8kc5YWv.js +0 -14
- package/dist/library-request-C8kc5YWv.js.map +0 -1
- package/dist/network-51iicpLl.js +0 -174
- package/dist/network-51iicpLl.js.map +0 -1
- package/dist/network-jBbjyAJP.cjs +0 -2
- package/dist/network-jBbjyAJP.cjs.map +0 -1
- package/dist/sampling-BN3Oi6SV.js.map +0 -1
- package/dist/sampling-b2ck5X98.cjs +0 -2
- package/dist/sampling-b2ck5X98.cjs.map +0 -1
- package/dist/sender-BBY0IcUo.js.map +0 -1
- package/dist/sender-BXoAZKum.cjs +0 -3
- package/dist/sender-BXoAZKum.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import { A as e,
|
|
2
|
-
import { n as
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { A as e, At as t, Bt as n, Cn as r, D as i, F as a, Ft as o, Gt as s, Ht as c, I as l, It as u, Kt as d, L as f, Lt as p, Qt as m, Rt as h, S as g, Sn as _, Ut as ee, Vt as te, Wt as ne, Zt as re, _n as ie, _t as ae, a as v, c as y, d as b, en as x, f as oe, ft as se, gn as S, hn as ce, i as le, in as ue, j as de, k as C, l as fe, lt as pe, m as me, mn as he, n as w, o as ge, p as T, qt as _e, r as ve, s as E, sn as ye, u as D, ut as O, vn as be, vt as k, xn as xe, yt as Se, z as Ce, zt as we } from "./constants-CQ_D7jIW.js";
|
|
2
|
+
import { n as Te, r as Ee, t as De } from "./error-like-Ywo5uRHo.js";
|
|
3
|
+
import { a as Oe, i as ke, n as Ae, o as je, r as Me } from "./sampling-BLMD8EGM.js";
|
|
4
|
+
import { a as Ne, i as Pe, n as Fe, o as A, r as j } from "./sanitize-BNwgPj_B.js";
|
|
5
|
+
import { a as Ie, i as Le, n as Re, o as ze, r as Be, s as Ve, t as He } from "./identity-rpEyjvVg.js";
|
|
6
|
+
import { n as Ue, r as We, t as Ge } from "./platform-j0uMPwHi.js";
|
|
7
|
+
import { n as M, t as Ke } from "./batch-4xKzzSCj.js";
|
|
8
|
+
import { r as qe } from "./library-request-DX6ev9oG.js";
|
|
9
|
+
import { r as Je } from "./deadline-5_PecIl5.js";
|
|
10
|
+
import { n as Ye, t as Xe } from "./journey-_dQQ1eMP.js";
|
|
10
11
|
//#region src/utils/timer.ts
|
|
11
|
-
function
|
|
12
|
-
return Math.round((performance.now() - e) *
|
|
12
|
+
function N(e) {
|
|
13
|
+
return Math.round((performance.now() - e) * Ce) / Ce;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function P(e, t, n, r, i) {
|
|
15
16
|
e.logMetric(`${t}.duration`, n, "ms", "histogram", {
|
|
16
17
|
status: r,
|
|
17
18
|
...i
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
let a =
|
|
21
|
+
function Ze(e, t, n, r, i) {
|
|
22
|
+
let a = N(n);
|
|
22
23
|
e.error(`${t} failed`, r, {
|
|
23
24
|
"action.duration_ms": a,
|
|
24
25
|
status: "FAILURE",
|
|
25
26
|
...i
|
|
26
|
-
}),
|
|
27
|
+
}), P(e, t, a, "FAILURE", i);
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function Qe(e, t, n, r) {
|
|
29
30
|
let i = performance.now();
|
|
30
31
|
try {
|
|
31
32
|
let a = n();
|
|
32
|
-
return
|
|
33
|
+
return P(e, t, N(i), "SUCCESS", r), a;
|
|
33
34
|
} catch (n) {
|
|
34
|
-
throw
|
|
35
|
+
throw Ze(e, t, i, n, r), n;
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
async function
|
|
38
|
+
async function $e(e, t, n, r) {
|
|
38
39
|
let i = performance.now();
|
|
39
40
|
try {
|
|
40
41
|
let a = await n();
|
|
41
|
-
return
|
|
42
|
+
return P(e, t, N(i), "SUCCESS", r), a;
|
|
42
43
|
} catch (n) {
|
|
43
|
-
throw
|
|
44
|
+
throw Ze(e, t, i, n, r), n;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
//#endregion
|
|
47
48
|
//#region src/core/logger.ts
|
|
48
|
-
var
|
|
49
|
-
function
|
|
49
|
+
var et = [i, ye];
|
|
50
|
+
function tt(e, t) {
|
|
50
51
|
let n = t.guard("record.sanitize_failed", "The library could not read the error reason.", () => {
|
|
51
|
-
if (!(e instanceof Error) && !
|
|
52
|
+
if (!(e instanceof Error) && !Ee(e)) return;
|
|
52
53
|
let t = Error(e.message);
|
|
53
54
|
return t.name = e.name, t.stack = e.stack, t;
|
|
54
55
|
});
|
|
@@ -56,38 +57,38 @@ function Ze(e, t) {
|
|
|
56
57
|
let r = t.guard("record.sanitize_failed", "The library could not convert the error reason to text.", () => String(e));
|
|
57
58
|
return Error(r ?? typeof e);
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function nt(e, t, n) {
|
|
60
61
|
return n.guard("record.sanitize_failed", "The library could not read the error reason.", () => e instanceof Error ? e : t) ?? t;
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
+
function rt(e, t) {
|
|
63
64
|
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" || typeof e == "symbol") return e;
|
|
64
65
|
if (typeof e == "object" && e) return t.guard("record.sanitize_failed", "The library could not read the properties of the error reason.", () => {
|
|
65
|
-
let t = e, n =
|
|
66
|
+
let t = e, n = Ee(e), r = {}, i = 0;
|
|
66
67
|
for (let e of Object.keys(t)) {
|
|
67
68
|
let a = t[e];
|
|
68
|
-
(!n || !
|
|
69
|
+
(!n || !De.has(e)) && Te(a) && (r[e] = a, i++);
|
|
69
70
|
}
|
|
70
71
|
return i === 0 ? void 0 : r;
|
|
71
72
|
});
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function it(e) {
|
|
74
75
|
if (typeof e != "object" || !e || Array.isArray(e) || e instanceof Error) return !1;
|
|
75
76
|
let t = Object.getPrototypeOf(e);
|
|
76
77
|
return t === null || Object.getPrototypeOf(t) === null;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
return
|
|
79
|
+
function at(e) {
|
|
80
|
+
return et.some((t) => e === t || e.startsWith(`${t}.`)) ? "system" : "log";
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function F(e, t) {
|
|
82
83
|
return e === void 0 ? {} : t.guard("record.sanitize_failed", "The library could not read the payload.", () => ({ ...e })) ?? { "uiobs.sanitize_failed": !0 };
|
|
83
84
|
}
|
|
84
|
-
var
|
|
85
|
+
var I = class e {
|
|
85
86
|
bind;
|
|
86
87
|
namespace;
|
|
87
88
|
options;
|
|
88
89
|
levelType;
|
|
89
90
|
constructor(e, t, n = {}) {
|
|
90
|
-
this.bind = e, this.namespace = t, this.options = n, this.levelType =
|
|
91
|
+
this.bind = e, this.namespace = t, this.options = n, this.levelType = at(t);
|
|
91
92
|
}
|
|
92
93
|
child(t, n = {}) {
|
|
93
94
|
return new e(this.bind, `${this.namespace}.${t}`, { scopedContext: {
|
|
@@ -119,22 +120,23 @@ var F = class e {
|
|
|
119
120
|
logEvent = (e, t) => {
|
|
120
121
|
this.write("INFO", "event", e, t);
|
|
121
122
|
};
|
|
122
|
-
logMetric = (e, t, n =
|
|
123
|
+
logMetric = (e, t, n = l, r = "gauge", i) => {
|
|
123
124
|
if (!Number.isFinite(t)) {
|
|
124
125
|
this.bind().diagnostics.report("record.dropped_malformed", "The metric value is not a finite number. The library dropped the metric.", { "metric.name": e });
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
|
-
let o = {
|
|
128
|
-
...
|
|
128
|
+
let a = F(i, this.bind().diagnostics), o = {
|
|
129
|
+
...a,
|
|
129
130
|
"metric.name": e,
|
|
130
131
|
"metric.value": t,
|
|
131
132
|
"metric.unit": n,
|
|
132
|
-
"metric.type": r
|
|
133
|
+
"metric.type": r,
|
|
134
|
+
[k.attributeKeys]: Object.keys(a)
|
|
133
135
|
};
|
|
134
136
|
this.write("INFO", "metric", e, o, !0);
|
|
135
137
|
};
|
|
136
|
-
timeSync = (e, t, n) =>
|
|
137
|
-
timeAsync = (e, t, n) =>
|
|
138
|
+
timeSync = (e, t, n) => Qe(this, e, t, n);
|
|
139
|
+
timeAsync = (e, t, n) => $e(this, e, t, n);
|
|
138
140
|
write(e, t, n, r, i = !1) {
|
|
139
141
|
let a = this.bind();
|
|
140
142
|
if (a.isDestroyed()) return;
|
|
@@ -148,7 +150,7 @@ var F = class e {
|
|
|
148
150
|
body: n,
|
|
149
151
|
namespace: this.namespace,
|
|
150
152
|
scoped: this.options.scopedContext,
|
|
151
|
-
payload: i ? r :
|
|
153
|
+
payload: i ? r : F(r, a.diagnostics)
|
|
152
154
|
}), c = o ? o.body : s === "sampling" ? n : void 0;
|
|
153
155
|
t !== "metric" && c !== void 0 && a.breadcrumbs.push({
|
|
154
156
|
t: Date.now(),
|
|
@@ -161,26 +163,26 @@ var F = class e {
|
|
|
161
163
|
if (i.isDestroyed()) return;
|
|
162
164
|
let a = i.builder.isEnabled(e);
|
|
163
165
|
if (!a && !this.mirrors(i, e)) return;
|
|
164
|
-
let o = r === void 0 && (i.diagnostics.guard("record.sanitize_failed", "The library could not read the error slot.", () =>
|
|
166
|
+
let o = r === void 0 && (i.diagnostics.guard("record.sanitize_failed", "The library could not read the error slot.", () => it(n)) ?? !1), s = o ? n : r, c = o ? void 0 : n, l = c === void 0 ? void 0 : tt(c, i.diagnostics), u = l === void 0 ? void 0 : nt(c, l, i.diagnostics);
|
|
165
167
|
if (!a) {
|
|
166
168
|
this.print(i, e, t, s, u, null);
|
|
167
169
|
return;
|
|
168
170
|
}
|
|
169
|
-
let d = l ?
|
|
171
|
+
let d = l ? rt(c, i.diagnostics) : void 0, { record: f, dropped: p } = i.builder.build({
|
|
170
172
|
level: e,
|
|
171
173
|
type: this.levelType,
|
|
172
174
|
body: t,
|
|
173
175
|
namespace: this.namespace,
|
|
174
176
|
scoped: this.options.scopedContext,
|
|
175
177
|
payload: {
|
|
176
|
-
...
|
|
178
|
+
...F(s, i.diagnostics),
|
|
177
179
|
...l ? {
|
|
178
180
|
"error.type": l.name,
|
|
179
181
|
"error.message": l.message,
|
|
180
182
|
"error.stack_trace": l.stack
|
|
181
183
|
} : {},
|
|
182
|
-
...d === void 0 ? {} : { [
|
|
183
|
-
[
|
|
184
|
+
...d === void 0 ? {} : { [ge]: d },
|
|
185
|
+
[v]: i.breadcrumbs.snapshot()
|
|
184
186
|
}
|
|
185
187
|
});
|
|
186
188
|
this.print(i, e, t, s, u, f, p), i.emit(f);
|
|
@@ -191,73 +193,73 @@ var F = class e {
|
|
|
191
193
|
mirrors(e, t) {
|
|
192
194
|
return e.config.enabled && e.console.accepts(t);
|
|
193
195
|
}
|
|
194
|
-
},
|
|
196
|
+
}, ot = {
|
|
195
197
|
TRACE: "debug",
|
|
196
198
|
DEBUG: "debug",
|
|
197
199
|
INFO: "info",
|
|
198
200
|
WARN: "warn",
|
|
199
201
|
ERROR: "error",
|
|
200
202
|
FATAL: "error"
|
|
201
|
-
},
|
|
203
|
+
}, st = class {
|
|
202
204
|
settings;
|
|
203
205
|
diagnostics;
|
|
204
206
|
limits;
|
|
205
|
-
constructor(e,
|
|
206
|
-
this.settings = e, this.diagnostics =
|
|
207
|
+
constructor(e, n, r = t) {
|
|
208
|
+
this.settings = e, this.diagnostics = n, this.limits = r;
|
|
207
209
|
}
|
|
208
210
|
update(e) {
|
|
209
211
|
this.settings = e;
|
|
210
212
|
}
|
|
211
213
|
accepts(e) {
|
|
212
|
-
return this.settings.level === null || !Object.hasOwn(
|
|
214
|
+
return this.settings.level === null || !Object.hasOwn(O, this.settings.level) ? !1 : O[e] >= O[this.settings.level];
|
|
213
215
|
}
|
|
214
216
|
write(e, t, n, r, i) {
|
|
215
|
-
if (!this.accepts(t) || typeof console > "u" ||
|
|
216
|
-
let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s =
|
|
217
|
+
if (!this.accepts(t) || typeof console > "u" || Ne()) return;
|
|
218
|
+
let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s = ot[t];
|
|
217
219
|
this.diagnostics.guard("handler.threw", `The library could not print to console.${s}.`, () => {
|
|
218
220
|
let c = [];
|
|
219
|
-
i !== void 0 && c.push(i), r !== void 0 && c.push(
|
|
221
|
+
i !== void 0 && c.push(i), r !== void 0 && c.push(Fe(r, this.limits, this.diagnostics)), A(() => {
|
|
220
222
|
console[s](a, o.namespace, e, o[t], "", n, ...c);
|
|
221
223
|
});
|
|
222
224
|
});
|
|
223
225
|
}
|
|
224
|
-
},
|
|
226
|
+
}, ct = class {
|
|
225
227
|
value = 0;
|
|
226
228
|
next() {
|
|
227
229
|
return ++this.value;
|
|
228
230
|
}
|
|
229
|
-
},
|
|
230
|
-
function
|
|
231
|
-
return
|
|
231
|
+
}, lt = /^[0-9a-f]{32}$/, ut = /^[0-9a-f]{16}$/, dt = /[1-9a-f]/;
|
|
232
|
+
function ft(e) {
|
|
233
|
+
return lt.test(e.traceId) && dt.test(e.traceId) && ut.test(e.spanId) && dt.test(e.spanId);
|
|
232
234
|
}
|
|
233
|
-
function
|
|
234
|
-
return
|
|
235
|
+
function pt() {
|
|
236
|
+
return ze(16);
|
|
235
237
|
}
|
|
236
|
-
function
|
|
237
|
-
return
|
|
238
|
+
function mt() {
|
|
239
|
+
return ze(8);
|
|
238
240
|
}
|
|
239
|
-
function
|
|
241
|
+
function ht() {
|
|
240
242
|
return {
|
|
241
|
-
traceId:
|
|
242
|
-
spanId:
|
|
243
|
+
traceId: pt(),
|
|
244
|
+
spanId: mt(),
|
|
243
245
|
traceFlags: 1,
|
|
244
246
|
startedAt: Date.now()
|
|
245
247
|
};
|
|
246
248
|
}
|
|
247
|
-
function
|
|
249
|
+
function gt(e) {
|
|
248
250
|
return {
|
|
249
251
|
traceId: e.traceId,
|
|
250
252
|
spanId: e.spanId,
|
|
251
253
|
traceFlags: e.traceFlags
|
|
252
254
|
};
|
|
253
255
|
}
|
|
254
|
-
var
|
|
256
|
+
var _t = class {
|
|
255
257
|
diagnostics;
|
|
256
258
|
maxAgeMs;
|
|
257
259
|
load;
|
|
258
|
-
ambient =
|
|
260
|
+
ambient = ht();
|
|
259
261
|
otel;
|
|
260
|
-
constructor(e, t =
|
|
262
|
+
constructor(e, t = be, n) {
|
|
261
263
|
this.diagnostics = e, this.maxAgeMs = t, this.load = n;
|
|
262
264
|
}
|
|
263
265
|
async loadOtel() {
|
|
@@ -269,7 +271,7 @@ var pt = class {
|
|
|
269
271
|
}
|
|
270
272
|
resolve() {
|
|
271
273
|
let e = this.activeSpanContext();
|
|
272
|
-
return e === void 0 ? (Date.now() - this.ambient.startedAt > this.maxAgeMs && this.rotate("maxAge"),
|
|
274
|
+
return e === void 0 ? (Date.now() - this.ambient.startedAt > this.maxAgeMs && this.rotate("maxAge"), gt(this.ambient)) : e;
|
|
273
275
|
}
|
|
274
276
|
activeSpanContext() {
|
|
275
277
|
let e = this.otel;
|
|
@@ -277,7 +279,7 @@ var pt = class {
|
|
|
277
279
|
let t = e.trace.getActiveSpan();
|
|
278
280
|
if (t === void 0) return;
|
|
279
281
|
let n = t.spanContext();
|
|
280
|
-
if (
|
|
282
|
+
if (ft(n)) return {
|
|
281
283
|
traceId: n.traceId,
|
|
282
284
|
spanId: n.spanId,
|
|
283
285
|
traceFlags: n.traceFlags
|
|
@@ -285,7 +287,7 @@ var pt = class {
|
|
|
285
287
|
});
|
|
286
288
|
}
|
|
287
289
|
rotate(e) {
|
|
288
|
-
return this.ambient =
|
|
290
|
+
return this.ambient = ht(), gt(this.ambient);
|
|
289
291
|
}
|
|
290
292
|
headers() {
|
|
291
293
|
let e = {}, t = this.otel;
|
|
@@ -293,11 +295,11 @@ var pt = class {
|
|
|
293
295
|
t.propagation.inject(t.context.active(), e);
|
|
294
296
|
}), !e.traceparent) {
|
|
295
297
|
let t = this.resolve(), n = (t.traceFlags & 255).toString(16).padStart(2, "0");
|
|
296
|
-
e[
|
|
298
|
+
e[ie] = `00-${t.traceId}-${t.spanId}-${n}`;
|
|
297
299
|
}
|
|
298
300
|
return e;
|
|
299
301
|
}
|
|
300
|
-
},
|
|
302
|
+
}, vt = class {
|
|
301
303
|
buffer;
|
|
302
304
|
pointer = 0;
|
|
303
305
|
filled = !1;
|
|
@@ -314,45 +316,45 @@ var pt = class {
|
|
|
314
316
|
clear() {
|
|
315
317
|
this.buffer = Array(this.capacity), this.pointer = 0, this.filled = !1;
|
|
316
318
|
}
|
|
317
|
-
},
|
|
319
|
+
}, yt = Object.keys(O), bt = ["gzip", "none"], xt = [
|
|
318
320
|
"omit",
|
|
319
321
|
"same-origin",
|
|
320
322
|
"include"
|
|
321
|
-
],
|
|
323
|
+
], St = [
|
|
322
324
|
"auto",
|
|
323
325
|
"indexeddb",
|
|
324
326
|
"localstorage",
|
|
325
327
|
"memory",
|
|
326
328
|
"none"
|
|
327
|
-
],
|
|
329
|
+
], Ct = ["storage", "memory"], wt = [
|
|
328
330
|
"auto",
|
|
329
331
|
"sender",
|
|
330
332
|
"forwarder",
|
|
331
333
|
"off"
|
|
332
|
-
],
|
|
334
|
+
], Tt = [
|
|
333
335
|
"auto",
|
|
334
336
|
"provider",
|
|
335
337
|
"client"
|
|
336
|
-
],
|
|
338
|
+
], Et = [
|
|
337
339
|
"auto",
|
|
338
340
|
"context",
|
|
339
341
|
"tab",
|
|
340
342
|
"origin"
|
|
341
|
-
],
|
|
343
|
+
], Dt = [
|
|
342
344
|
"error",
|
|
343
345
|
"warn",
|
|
344
346
|
"info",
|
|
345
347
|
"log"
|
|
346
|
-
],
|
|
348
|
+
], Ot = ["limited", "until-delivered"], kt = {
|
|
347
349
|
logFlushIntervalMs: [100, 6e4],
|
|
348
350
|
logBatchSize: [1, 1e3],
|
|
349
351
|
metricFlushIntervalMs: [100, 6e4],
|
|
350
352
|
metricBatchSize: [1, 1e3]
|
|
351
|
-
},
|
|
353
|
+
}, At = {
|
|
352
354
|
maxBatches: [1, 5e3],
|
|
353
355
|
maxAgeMs: [6e4, 6048e5],
|
|
354
356
|
maxAttempts: [1, 20]
|
|
355
|
-
},
|
|
357
|
+
}, jt = {
|
|
356
358
|
maxBodyChars: [256, 65536],
|
|
357
359
|
maxAttributeChars: [256, 65536],
|
|
358
360
|
maxAttributeCount: [1, 1024],
|
|
@@ -360,138 +362,139 @@ var pt = class {
|
|
|
360
362
|
maxDepth: [1, 16],
|
|
361
363
|
maxArrayLength: [1, 1e4],
|
|
362
364
|
maxNodes: [100, 1e5],
|
|
363
|
-
maxRecordBytes: [1024,
|
|
364
|
-
},
|
|
365
|
+
maxRecordBytes: [1024, g]
|
|
366
|
+
}, Mt = [6e4, 864e5], Nt = [
|
|
365
367
|
"errors",
|
|
366
368
|
"rejections",
|
|
367
369
|
"resourceErrors",
|
|
368
370
|
"fetch",
|
|
369
371
|
"xhr",
|
|
372
|
+
"httpMetrics",
|
|
370
373
|
"interactions",
|
|
371
374
|
"navigation",
|
|
372
375
|
"webVitals",
|
|
373
376
|
"longFrames",
|
|
374
377
|
"fullUrls"
|
|
375
|
-
],
|
|
378
|
+
], Pt = "null", L = `a level name: ${R(yt)}`, Ft = `true, false or a list of ${R(Dt)}`, It = "a list of strings and RegExp patterns", Lt = "a list of origin URLs such as \"https://api.example\" and RegExp patterns", Rt = "a list of origin URLs such as \"https://app.example\". For a sandboxed frame, set bus.mode: \"sender\" in the frame", zt = "a list of strings";
|
|
376
379
|
function R(e) {
|
|
377
380
|
let t = e.map((e) => `"${e}"`);
|
|
378
381
|
return `${t.slice(0, -1).join(", ")} or ${t[t.length - 1]}`;
|
|
379
382
|
}
|
|
380
|
-
function
|
|
383
|
+
function Bt(e) {
|
|
381
384
|
return typeof e == "string" ? `"${e}"` : typeof e == "function" ? "a function" : typeof e == "object" && e ? "an object" : String(e);
|
|
382
385
|
}
|
|
383
|
-
function
|
|
384
|
-
e.report("config.invalid", `${t} must be ${n}. The value is ${
|
|
386
|
+
function z(e, t, n, r, i) {
|
|
387
|
+
e.report("config.invalid", `${t} must be ${n}. The value is ${Bt(r)}. The library keeps ${i}.`);
|
|
385
388
|
}
|
|
386
|
-
function
|
|
389
|
+
function B(e, t, n, r, i) {
|
|
387
390
|
if (t === void 0) return r;
|
|
388
391
|
let a = n.find((e) => e === t);
|
|
389
|
-
return a === void 0 ? (
|
|
392
|
+
return a === void 0 ? (z(i, e, R(n), t, `"${r}"`), r) : a;
|
|
390
393
|
}
|
|
391
|
-
function
|
|
392
|
-
return t === void 0 ? n : typeof t == "boolean" ? t : (
|
|
394
|
+
function V(e, t, n, r) {
|
|
395
|
+
return t === void 0 ? n : typeof t == "boolean" ? t : (z(r, e, "true or false", t, String(n)), n);
|
|
393
396
|
}
|
|
394
|
-
function
|
|
395
|
-
return t === void 0 ? n : typeof t == "number" && Number.isFinite(t) && t >= 0 ? t : (
|
|
397
|
+
function Vt(e, t, n, r) {
|
|
398
|
+
return t === void 0 ? n : typeof t == "number" && Number.isFinite(t) && t >= 0 ? t : (z(r, e, "a finite number of 0 or more", t, String(n)), n);
|
|
396
399
|
}
|
|
397
|
-
function
|
|
400
|
+
function Ht(e, t, n, r, i) {
|
|
398
401
|
if (t === void 0) return r;
|
|
399
402
|
let [a, o] = n;
|
|
400
|
-
return typeof t == "number" && Number.isInteger(t) && t >= a && t <= o ? t : (
|
|
403
|
+
return typeof t == "number" && Number.isInteger(t) && t >= a && t <= o ? t : (z(i, e, `an integer from ${String(a)} to ${String(o)}`, t, String(r)), r);
|
|
401
404
|
}
|
|
402
|
-
function
|
|
405
|
+
function H(e, t, n, r, i) {
|
|
403
406
|
let a = t ?? {}, o = Object.keys(r);
|
|
404
|
-
return Object.fromEntries(o.map((t) => [t,
|
|
407
|
+
return Object.fromEntries(o.map((t) => [t, Ht(`${e}.${t}`, a[t], r[t], n[t], i)]));
|
|
405
408
|
}
|
|
406
|
-
function
|
|
409
|
+
function U(e) {
|
|
407
410
|
if (typeof e != "string") return;
|
|
408
411
|
let t = e.toUpperCase();
|
|
409
|
-
return
|
|
412
|
+
return yt.find((e) => e === t);
|
|
410
413
|
}
|
|
411
|
-
function
|
|
414
|
+
function Ut(e, t, n, r) {
|
|
412
415
|
if (t === void 0) return n;
|
|
413
|
-
let i =
|
|
414
|
-
return i === void 0 ? (
|
|
416
|
+
let i = U(t);
|
|
417
|
+
return i === void 0 ? (z(r, e, L, t, `"${n}"`), n) : i;
|
|
415
418
|
}
|
|
416
|
-
function
|
|
419
|
+
function W(e, t, n, r, i, a) {
|
|
417
420
|
if (t === void 0) return n;
|
|
418
|
-
if (!Array.isArray(t)) return
|
|
421
|
+
if (!Array.isArray(t)) return z(a, e, r, t, "the list in force"), n;
|
|
419
422
|
let o = [], s = t;
|
|
420
423
|
for (let t of s) {
|
|
421
424
|
let n = i(t);
|
|
422
|
-
n === void 0 ? a.report("config.invalid", `The library ignores the ${e} entry ${
|
|
425
|
+
n === void 0 ? a.report("config.invalid", `The library ignores the ${e} entry ${Bt(t)}. ${e} must be ${r}.`) : o.push(n);
|
|
423
426
|
}
|
|
424
427
|
return o;
|
|
425
428
|
}
|
|
426
|
-
function
|
|
429
|
+
function Wt(e) {
|
|
427
430
|
return typeof e == "string" ? e : void 0;
|
|
428
431
|
}
|
|
429
|
-
function
|
|
432
|
+
function Gt(e) {
|
|
430
433
|
return typeof e == "string" || e instanceof RegExp ? e : void 0;
|
|
431
434
|
}
|
|
432
|
-
function
|
|
433
|
-
return
|
|
435
|
+
function Kt(e) {
|
|
436
|
+
return Dt.find((t) => t === e);
|
|
434
437
|
}
|
|
435
|
-
function
|
|
438
|
+
function qt(e) {
|
|
436
439
|
if (typeof e == "string") try {
|
|
437
440
|
let { origin: t } = new URL(e);
|
|
438
|
-
return t ===
|
|
441
|
+
return t === Pt ? void 0 : t;
|
|
439
442
|
} catch {
|
|
440
443
|
return;
|
|
441
444
|
}
|
|
442
445
|
}
|
|
443
|
-
function
|
|
444
|
-
return e instanceof RegExp ? e :
|
|
446
|
+
function Jt(e) {
|
|
447
|
+
return e instanceof RegExp ? e : qt(e);
|
|
445
448
|
}
|
|
446
|
-
function
|
|
449
|
+
function Yt(e) {
|
|
447
450
|
return typeof e != "object" || !e || Array.isArray(e) ? !1 : Object.values(e).every((e) => typeof e == "string");
|
|
448
451
|
}
|
|
449
|
-
function
|
|
450
|
-
if (e !== void 0) return typeof e == "function" ||
|
|
452
|
+
function Xt(e, t, n) {
|
|
453
|
+
if (e !== void 0) return typeof e == "function" || Yt(e) ? e : (z(n, "headers", "an object of strings or a function", e, "the headers in force"), t);
|
|
451
454
|
}
|
|
452
|
-
function
|
|
455
|
+
function Zt(e) {
|
|
453
456
|
return typeof e != "object" || !e ? !1 : typeof Reflect.get(e, "serialize") == "function";
|
|
454
457
|
}
|
|
455
|
-
function
|
|
456
|
-
return e === void 0 ? t ?? "otlp" : e === "otlp" || e === "ecs" ||
|
|
458
|
+
function Qt(e, t, n) {
|
|
459
|
+
return e === void 0 ? t ?? "otlp" : e === "otlp" || e === "ecs" || Zt(e) ? e : (n.report("config.invalid", `serializer must be "${x}", "ecs" or an implementation. The library uses "${x}".`), x);
|
|
457
460
|
}
|
|
458
|
-
var
|
|
459
|
-
function
|
|
461
|
+
var $t = new Set(Object.keys(de));
|
|
462
|
+
function en(e, t) {
|
|
460
463
|
let n = {}, r = Object.entries(e ?? {});
|
|
461
|
-
for (let [e, i] of r)
|
|
464
|
+
for (let [e, i] of r) $t.has(e) ? typeof i == "string" ? n[e] = i : t.report("config.invalid", `console.styles.${e} must be a string. The library keeps the style in force.`) : t.report("config.invalid", `The library ignores the unknown console.styles key "${e}". Check the spelling.`);
|
|
462
465
|
return n;
|
|
463
466
|
}
|
|
464
|
-
function
|
|
467
|
+
function tn(e, t, n) {
|
|
465
468
|
if (e === void 0) return t ?? "DEBUG";
|
|
466
|
-
let r =
|
|
467
|
-
return r === void 0 ? (
|
|
469
|
+
let r = U(e);
|
|
470
|
+
return r === void 0 ? (z(n, "console.level", L, e, "the console level in force"), t) : r;
|
|
468
471
|
}
|
|
469
|
-
function
|
|
470
|
-
if (
|
|
471
|
-
if (
|
|
472
|
+
function nn(t, n, r) {
|
|
473
|
+
if (t === void 0) return n;
|
|
474
|
+
if (t === !1) return {
|
|
472
475
|
level: null,
|
|
473
|
-
styles:
|
|
476
|
+
styles: n.styles
|
|
474
477
|
};
|
|
475
|
-
if (
|
|
476
|
-
level:
|
|
477
|
-
styles:
|
|
478
|
+
if (t === !0) return {
|
|
479
|
+
level: e,
|
|
480
|
+
styles: n.styles
|
|
478
481
|
};
|
|
479
|
-
if (typeof
|
|
480
|
-
let
|
|
481
|
-
return
|
|
482
|
-
level:
|
|
483
|
-
styles:
|
|
482
|
+
if (typeof t == "string") {
|
|
483
|
+
let e = U(t);
|
|
484
|
+
return e === void 0 ? (z(r, "console", L, t, "the console level in force"), n) : {
|
|
485
|
+
level: e,
|
|
486
|
+
styles: n.styles
|
|
484
487
|
};
|
|
485
488
|
}
|
|
486
|
-
return typeof
|
|
487
|
-
level:
|
|
489
|
+
return typeof t != "object" || !t ? (r.report("config.invalid", "console must be a boolean, a level or an object. The console settings in force stay."), n) : {
|
|
490
|
+
level: tn(t.level, n.level, r),
|
|
488
491
|
styles: {
|
|
489
|
-
...
|
|
490
|
-
...
|
|
492
|
+
...n.styles,
|
|
493
|
+
...en(t.styles, r)
|
|
491
494
|
}
|
|
492
495
|
};
|
|
493
496
|
}
|
|
494
|
-
function
|
|
497
|
+
function rn(e, t, n) {
|
|
495
498
|
let r = e ?? {};
|
|
496
499
|
return {
|
|
497
500
|
...t,
|
|
@@ -500,101 +503,113 @@ function Zt(e, t, n) {
|
|
|
500
503
|
...t.rates,
|
|
501
504
|
...r.rates
|
|
502
505
|
},
|
|
503
|
-
alwaysSampleTypes:
|
|
504
|
-
remote:
|
|
506
|
+
alwaysSampleTypes: W("sampling.alwaysSampleTypes", r.alwaysSampleTypes, t.alwaysSampleTypes, zt, Wt, n),
|
|
507
|
+
remote: V("sampling.remote", r.remote, t.remote, n)
|
|
505
508
|
};
|
|
506
509
|
}
|
|
507
|
-
function
|
|
510
|
+
function an(e, t, n) {
|
|
508
511
|
let r = e ?? {};
|
|
509
512
|
return {
|
|
510
|
-
mode:
|
|
511
|
-
trustedOrigins:
|
|
512
|
-
openFinRole:
|
|
513
|
+
mode: B("bus.mode", r.mode, wt, t.mode, n),
|
|
514
|
+
trustedOrigins: W("bus.trustedOrigins", r.trustedOrigins, t.trustedOrigins, Rt, qt, n),
|
|
515
|
+
openFinRole: B("bus.openFinRole", r.openFinRole, Tt, t.openFinRole, n)
|
|
513
516
|
};
|
|
514
517
|
}
|
|
515
|
-
function
|
|
518
|
+
function on(e, t, n) {
|
|
516
519
|
let r = e ?? {};
|
|
517
520
|
return {
|
|
518
|
-
scope:
|
|
519
|
-
maxAgeMs:
|
|
521
|
+
scope: B("journey.scope", r.scope, Et, t.scope, n),
|
|
522
|
+
maxAgeMs: Ht("journey.maxAgeMs", r.maxAgeMs, Mt, t.maxAgeMs, n)
|
|
520
523
|
};
|
|
521
524
|
}
|
|
522
|
-
function
|
|
525
|
+
function sn(e, t, n) {
|
|
523
526
|
let r = e ?? {};
|
|
524
527
|
return {
|
|
525
|
-
mode:
|
|
526
|
-
...
|
|
528
|
+
mode: B("retention.mode", r.mode, Ot, t.mode, n),
|
|
529
|
+
...H("retention", r, t, At, n)
|
|
527
530
|
};
|
|
528
531
|
}
|
|
529
|
-
function
|
|
530
|
-
return e === void 0 ? t : typeof e == "boolean" ? e : Array.isArray(e) ?
|
|
532
|
+
function cn(e, t, n) {
|
|
533
|
+
return e === void 0 ? t : typeof e == "boolean" ? e : Array.isArray(e) ? W("capture.console", e, [], Ft, Kt, n) : (z(n, "capture.console", Ft, e, "the value in force"), t);
|
|
531
534
|
}
|
|
532
|
-
function
|
|
535
|
+
function ln(e, t, n) {
|
|
533
536
|
let r = e ?? {}, i = {
|
|
534
537
|
...t,
|
|
535
538
|
...r,
|
|
536
|
-
console:
|
|
537
|
-
longFrameThresholdMs:
|
|
538
|
-
ignoreUrls:
|
|
539
|
-
propagateTraceHeaderTo:
|
|
539
|
+
console: cn(r.console, t.console, n),
|
|
540
|
+
longFrameThresholdMs: Vt("capture.longFrameThresholdMs", r.longFrameThresholdMs, t.longFrameThresholdMs, n),
|
|
541
|
+
ignoreUrls: W("capture.ignoreUrls", r.ignoreUrls, t.ignoreUrls, It, Gt, n),
|
|
542
|
+
propagateTraceHeaderTo: W("capture.propagateTraceHeaderTo", r.propagateTraceHeaderTo, t.propagateTraceHeaderTo, Lt, Jt, n)
|
|
540
543
|
};
|
|
541
|
-
for (let e of
|
|
544
|
+
for (let e of Nt) i[e] = V(`capture.${e}`, r[e], t[e], n);
|
|
542
545
|
return i;
|
|
543
546
|
}
|
|
544
|
-
function
|
|
545
|
-
let
|
|
546
|
-
|
|
547
|
+
function un(e, t, n, r) {
|
|
548
|
+
let i = t;
|
|
549
|
+
if (typeof e == "string" && e !== "") try {
|
|
550
|
+
new URL(e), i = e;
|
|
551
|
+
} catch (t) {
|
|
552
|
+
r.report("config.invalid", `metricsEndpoint is not a valid absolute URL: ${e}. The library keeps the value in force.`, void 0, t);
|
|
553
|
+
}
|
|
554
|
+
else e === "" ? i = "" : e !== void 0 && z(r, "metricsEndpoint", "a URL string", e, "the value in force");
|
|
555
|
+
return i !== "" && n !== "otlp" ? (r.report("config.invalid", `metricsEndpoint needs serializer "${x}". The library sends metric records as log records.`), "") : i;
|
|
556
|
+
}
|
|
557
|
+
function dn(e, t, n) {
|
|
558
|
+
let i = n ?? a, o = {
|
|
559
|
+
...i,
|
|
547
560
|
...e,
|
|
548
|
-
endpoint: e.endpoint === void 0 ?
|
|
549
|
-
enabled:
|
|
550
|
-
minLevel:
|
|
551
|
-
compression:
|
|
552
|
-
credentials:
|
|
553
|
-
headers: "headers" in e ?
|
|
554
|
-
storage:
|
|
555
|
-
identity:
|
|
556
|
-
serializer:
|
|
557
|
-
console:
|
|
558
|
-
sampling:
|
|
559
|
-
bus:
|
|
560
|
-
batching:
|
|
561
|
-
retention:
|
|
562
|
-
limits:
|
|
563
|
-
journey:
|
|
564
|
-
capture:
|
|
561
|
+
endpoint: e.endpoint === void 0 ? i.endpoint : e.endpoint,
|
|
562
|
+
enabled: V("enabled", e.enabled, i.enabled, t),
|
|
563
|
+
minLevel: Ut("minLevel", e.minLevel, i.minLevel, t),
|
|
564
|
+
compression: B("compression", e.compression, bt, i.compression, t),
|
|
565
|
+
credentials: B("credentials", e.credentials, xt, i.credentials, t),
|
|
566
|
+
headers: "headers" in e ? Xt(e.headers, i.headers, t) : i.headers,
|
|
567
|
+
storage: B("storage", e.storage, St, i.storage, t),
|
|
568
|
+
identity: B("identity", e.identity, Ct, i.identity, t),
|
|
569
|
+
serializer: Qt(e.serializer, n?.serializer, t),
|
|
570
|
+
console: nn(e.console, i.console, t),
|
|
571
|
+
sampling: rn(e.sampling, i.sampling, t),
|
|
572
|
+
bus: an(e.bus, i.bus, t),
|
|
573
|
+
batching: H("batching", e.batching, i.batching, kt, t),
|
|
574
|
+
retention: sn(e.retention, i.retention, t),
|
|
575
|
+
limits: H("limits", e.limits, i.limits, jt, t),
|
|
576
|
+
journey: on(e.journey, i.journey, t),
|
|
577
|
+
capture: ln(e.capture, i.capture, t)
|
|
565
578
|
};
|
|
566
|
-
if (i.transport !== void 0 && typeof
|
|
567
|
-
else if (
|
|
568
|
-
new URL(
|
|
579
|
+
if (o.metricsEndpoint = un(e.metricsEndpoint, i.metricsEndpoint, o.serializer, t), o.transport !== void 0 && typeof o.transport != "function" && (t.report("config.invalid", "transport must be a function. The library ignores the value."), o.transport = i.transport), o.onDrop !== void 0 && typeof o.onDrop != "function" && (t.report("config.invalid", "onDrop must be a function. The library ignores the value."), o.onDrop = i.onDrop), o.transportOnExit !== void 0 && typeof o.transportOnExit != "function" && (t.report("config.invalid", "transportOnExit must be a function. The library ignores the value."), o.transportOnExit = i.transportOnExit), o.endpoint === "") o.transport === void 0 && t.report("config.invalid", "endpoint is missing. The library drops each record. Set endpoint: null for console-only mode.");
|
|
580
|
+
else if (o.endpoint !== null) try {
|
|
581
|
+
new URL(o.endpoint);
|
|
569
582
|
} catch (e) {
|
|
570
|
-
t.report("config.invalid", `endpoint is not a valid absolute URL: ${
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
let
|
|
574
|
-
(typeof
|
|
575
|
-
let
|
|
576
|
-
(typeof
|
|
577
|
-
let
|
|
578
|
-
for (let [e, n] of
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
+
t.report("config.invalid", `endpoint is not a valid absolute URL: ${o.endpoint}.`, void 0, e);
|
|
584
|
+
}
|
|
585
|
+
o.metricsEndpoint !== "" && o.endpoint === null && !o.transport && t.report("config.invalid", "metricsEndpoint needs endpoint or transport. The library sends nothing to metricsEndpoint."), o.serviceName ||= (t.report("config.invalid", `serviceName is missing. Every record reports service.name as '${r}'.`), r);
|
|
586
|
+
let s = o.sampling.defaultRate;
|
|
587
|
+
(typeof s != "number" || s < 0 || s > 1) && (t.report("config.invalid", `sampling.defaultRate must be 0..1. The value is ${String(s)}. The library uses 1.`), o.sampling.defaultRate = 1);
|
|
588
|
+
let c = o.sampling.remoteMaxRate;
|
|
589
|
+
(typeof c != "number" || !(c >= 0 && c <= 1)) && (t.report("config.invalid", `sampling.remoteMaxRate must be 0..1. The value is ${String(c)}. The library uses 1.`), o.sampling.remoteMaxRate = 1);
|
|
590
|
+
let l = Object.entries(o.sampling.rates);
|
|
591
|
+
for (let [e, n] of l) (typeof n != "number" || n < 0 || n > 1) && (t.report("config.invalid", `sampling.rates["${e}"] must be 0..1. The value is ${String(n)}. The library uses 1.`), o.sampling.rates[e] = 1);
|
|
592
|
+
o.capture.ignoreUrls = o.capture.ignoreUrls.filter((e) => e !== n?.endpoint && e !== n?.metricsEndpoint);
|
|
593
|
+
for (let e of [o.endpoint, o.metricsEndpoint]) e && !o.capture.ignoreUrls.includes(e) && (o.capture.ignoreUrls = [...o.capture.ignoreUrls, e]);
|
|
594
|
+
return fn(e, t), o;
|
|
595
|
+
}
|
|
596
|
+
function fn(e, t) {
|
|
597
|
+
let n = /* @__PURE__ */ new Set([...Object.keys(a), ...xe]);
|
|
583
598
|
for (let r of Object.keys(e)) n.has(r) || t.report("config.invalid", `The library ignores the unknown config key "${r}". Check the spelling.`);
|
|
584
|
-
for (let n of
|
|
599
|
+
for (let n of C) {
|
|
585
600
|
let r = e[n];
|
|
586
601
|
if (typeof r != "object" || !r) continue;
|
|
587
|
-
let i = /* @__PURE__ */ new Set([...Object.keys(
|
|
602
|
+
let i = /* @__PURE__ */ new Set([...Object.keys(a[n]), ..._[n]]);
|
|
588
603
|
for (let e of Object.keys(r)) i.has(e) || t.report("config.invalid", `The library ignores the unknown config key "${n}.${e}". Check the spelling.`);
|
|
589
604
|
}
|
|
590
605
|
}
|
|
591
|
-
function
|
|
592
|
-
for (let n of Object.keys(t))
|
|
593
|
-
for (let n of
|
|
606
|
+
function pn(e, t) {
|
|
607
|
+
for (let n of Object.keys(t)) C.includes(n) || Object.assign(e, { [n]: t[n] });
|
|
608
|
+
for (let n of C) Object.assign(e[n], t[n]);
|
|
594
609
|
}
|
|
595
610
|
//#endregion
|
|
596
611
|
//#region src/core/context.ts
|
|
597
|
-
var
|
|
612
|
+
var mn = class {
|
|
598
613
|
map = /* @__PURE__ */ new Map();
|
|
599
614
|
set(e, t) {
|
|
600
615
|
this.map.set(e, t);
|
|
@@ -614,12 +629,12 @@ var sn = class {
|
|
|
614
629
|
getAll() {
|
|
615
630
|
return Object.fromEntries(this.map);
|
|
616
631
|
}
|
|
617
|
-
},
|
|
632
|
+
}, hn = class {
|
|
618
633
|
handler;
|
|
619
634
|
throttleMs;
|
|
620
635
|
counters = /* @__PURE__ */ new Map();
|
|
621
636
|
lastEmitted = /* @__PURE__ */ new Map();
|
|
622
|
-
constructor(e, t =
|
|
637
|
+
constructor(e, t = f) {
|
|
623
638
|
this.handler = e, this.throttleMs = t;
|
|
624
639
|
}
|
|
625
640
|
setHandler(e) {
|
|
@@ -642,12 +657,12 @@ var sn = class {
|
|
|
642
657
|
count: i
|
|
643
658
|
}, { handler: s } = this;
|
|
644
659
|
if (s) try {
|
|
645
|
-
|
|
660
|
+
A(() => {
|
|
646
661
|
s(o);
|
|
647
662
|
});
|
|
648
663
|
} catch (e) {
|
|
649
|
-
this.count("handler.threw"), typeof console < "u" &&
|
|
650
|
-
console.warn(`${
|
|
664
|
+
this.count("handler.threw"), typeof console < "u" && A(() => {
|
|
665
|
+
console.warn(`${se} The onDiagnostic handler threw an error.`, e);
|
|
651
666
|
});
|
|
652
667
|
}
|
|
653
668
|
}
|
|
@@ -676,10 +691,10 @@ var sn = class {
|
|
|
676
691
|
};
|
|
677
692
|
//#endregion
|
|
678
693
|
//#region src/core/drops.ts
|
|
679
|
-
function
|
|
694
|
+
function G(e, t) {
|
|
680
695
|
e.length < 20 && !e.includes(t) && e.push(t);
|
|
681
696
|
}
|
|
682
|
-
var
|
|
697
|
+
var gn = class {
|
|
683
698
|
config;
|
|
684
699
|
diagnostics;
|
|
685
700
|
pending = /* @__PURE__ */ new Map();
|
|
@@ -698,12 +713,12 @@ var ln = class {
|
|
|
698
713
|
journeyIds: [],
|
|
699
714
|
actions: []
|
|
700
715
|
}, this.pending.set(e, r)), r.records += t.length;
|
|
701
|
-
for (let e of n)
|
|
716
|
+
for (let e of n) G(r.batchIds, e);
|
|
702
717
|
for (let e of t) {
|
|
703
|
-
let t =
|
|
704
|
-
typeof t == "string" &&
|
|
705
|
-
let n =
|
|
706
|
-
typeof n == "string" &&
|
|
718
|
+
let t = Ke(e, E);
|
|
719
|
+
typeof t == "string" && G(r.journeyIds, t);
|
|
720
|
+
let n = M(e) ? e.body : void 0;
|
|
721
|
+
typeof n == "string" && G(r.actions, n);
|
|
707
722
|
}
|
|
708
723
|
this.scheduled || (this.scheduled = !0, queueMicrotask(() => {
|
|
709
724
|
this.flush();
|
|
@@ -717,8 +732,8 @@ var ln = class {
|
|
|
717
732
|
if (t) {
|
|
718
733
|
this.reporting = !0;
|
|
719
734
|
for (let n of e) this.diagnostics.guard("handler.threw", "The onDrop hook threw an error.", () => {
|
|
720
|
-
|
|
721
|
-
|
|
735
|
+
qe(() => {
|
|
736
|
+
A(() => {
|
|
722
737
|
t(n);
|
|
723
738
|
});
|
|
724
739
|
});
|
|
@@ -726,7 +741,7 @@ var ln = class {
|
|
|
726
741
|
this.reporting = !1;
|
|
727
742
|
}
|
|
728
743
|
}
|
|
729
|
-
},
|
|
744
|
+
}, _n = class {
|
|
730
745
|
onDrop;
|
|
731
746
|
held = [];
|
|
732
747
|
actions = 0;
|
|
@@ -740,10 +755,10 @@ var ln = class {
|
|
|
740
755
|
return this.held.length;
|
|
741
756
|
}
|
|
742
757
|
push(e) {
|
|
743
|
-
let t =
|
|
758
|
+
let t = M(e);
|
|
744
759
|
if ((t ? this.actions : this.held.length - this.actions) < (t ? 2e3 : 500)) this.actions += +!!t;
|
|
745
760
|
else {
|
|
746
|
-
let e = this.held.findIndex((e) =>
|
|
761
|
+
let e = this.held.findIndex((e) => M(e) === t), [n] = this.held.splice(e, 1);
|
|
747
762
|
this.onDrop(n);
|
|
748
763
|
}
|
|
749
764
|
this.held.push(e);
|
|
@@ -752,15 +767,118 @@ var ln = class {
|
|
|
752
767
|
let e = this.held;
|
|
753
768
|
return this.held = [], this.actions = 0, e;
|
|
754
769
|
}
|
|
755
|
-
},
|
|
756
|
-
|
|
770
|
+
}, vn = "overflow", yn = /* @__PURE__ */ new Set([
|
|
771
|
+
b,
|
|
772
|
+
D,
|
|
757
773
|
w,
|
|
758
|
-
|
|
774
|
+
T,
|
|
775
|
+
E,
|
|
776
|
+
y,
|
|
777
|
+
fe
|
|
778
|
+
]);
|
|
779
|
+
function bn(e = {}) {
|
|
780
|
+
let t = {};
|
|
781
|
+
for (let n of Object.keys(e).sort()) {
|
|
782
|
+
if (n.startsWith("metric.") || yn.has(n)) continue;
|
|
783
|
+
let r = e[n];
|
|
784
|
+
(typeof r == "string" || typeof r == "boolean" || typeof r == "number" && Number.isFinite(r)) && (t[n] = r);
|
|
785
|
+
}
|
|
786
|
+
return t;
|
|
787
|
+
}
|
|
788
|
+
function xn(e) {
|
|
789
|
+
if (!Array.isArray(e)) return null;
|
|
790
|
+
let t = Math.min(e.length, 51);
|
|
791
|
+
return Array.from({ length: t }, (t, n) => e[n]);
|
|
792
|
+
}
|
|
793
|
+
function Sn(e) {
|
|
794
|
+
return Array.isArray(e) && e.length <= 50 && e.every((t, n) => typeof t == "number" && Number.isFinite(t) && (n === 0 || t > e[n - 1]));
|
|
795
|
+
}
|
|
796
|
+
function Cn(e, t, n) {
|
|
797
|
+
let r = {
|
|
798
|
+
"metric.name": e.name,
|
|
799
|
+
"metric.unit": e.unit,
|
|
800
|
+
"metric.type": e.kind,
|
|
801
|
+
[k.start]: n,
|
|
802
|
+
[k.attributeKeys]: Object.keys(t.attributes)
|
|
803
|
+
};
|
|
804
|
+
return e.kind === "counter" ? (r["metric.value"] = t.sum, r) : {
|
|
805
|
+
...r,
|
|
806
|
+
[k.count]: t.count,
|
|
807
|
+
[k.sum]: t.sum,
|
|
808
|
+
[k.min]: t.min,
|
|
809
|
+
[k.max]: t.max,
|
|
810
|
+
[k.bounds]: e.boundaries,
|
|
811
|
+
[k.buckets]: t.buckets
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
var wn = class {
|
|
815
|
+
intervalMs;
|
|
816
|
+
emit;
|
|
817
|
+
diagnostics;
|
|
818
|
+
instruments = /* @__PURE__ */ new Map();
|
|
819
|
+
timer = null;
|
|
820
|
+
startedAt = 0;
|
|
821
|
+
constructor(e, t, n) {
|
|
822
|
+
this.intervalMs = e, this.emit = t, this.diagnostics = n;
|
|
823
|
+
}
|
|
824
|
+
record(e, t, n) {
|
|
825
|
+
!Number.isFinite(t) || e.kind === "counter" && t < 0 ? this.diagnostics.report("record.dropped_malformed", `The value of the metric ${e.name} is not valid. The library dropped it.`, { "metric.name": e.name }) : this.diagnostics.guard("record.sanitize_failed", `The library could not read the attributes of the metric ${e.name}.`, () => {
|
|
826
|
+
let r = this.instrumentOf(e);
|
|
827
|
+
r && (this.add(r, t, bn(n)), this.arm());
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
collect() {
|
|
831
|
+
this.timer !== null && (clearTimeout(this.timer), this.timer = null);
|
|
832
|
+
let e = `${String(this.startedAt)}000000`, t = [...this.instruments.values()];
|
|
833
|
+
this.instruments.clear();
|
|
834
|
+
for (let { def: n, series: r } of t) for (let t of r.values()) this.emit(n.name, t.attributes, Cn(n, t, e));
|
|
835
|
+
}
|
|
836
|
+
instrumentOf(e) {
|
|
837
|
+
let t = this.instruments.get(e.name);
|
|
838
|
+
if (t) return t.def.kind === e.kind ? t : (this.diagnostics.report("record.dropped_malformed", `The metric ${e.name} is a counter and a histogram. The library dropped the value.`, { "metric.name": e.name }), null);
|
|
839
|
+
let n = xn(e.boundaries), r = Sn(n);
|
|
840
|
+
e.kind === "histogram" && !r && this.diagnostics.report("config.invalid", `The boundaries of the metric ${e.name} must be at most 50 finite numbers in ascending order. The library uses the default boundaries.`);
|
|
841
|
+
let i = {
|
|
842
|
+
def: {
|
|
843
|
+
...e,
|
|
844
|
+
boundaries: r ? n : [...ae]
|
|
845
|
+
},
|
|
846
|
+
series: /* @__PURE__ */ new Map()
|
|
847
|
+
};
|
|
848
|
+
return this.instruments.set(e.name, i), i;
|
|
849
|
+
}
|
|
850
|
+
add(e, t, n) {
|
|
851
|
+
let r = JSON.stringify(n), i = e.series.get(r), a = n;
|
|
852
|
+
if (!i && e.series.size >= 100 && (r = vn, i = e.series.get(r), a = { [oe]: !0 }), !i) {
|
|
853
|
+
let n = e.def.kind === "histogram" ? e.def.boundaries.length + 1 : 0, o = Array(n).fill(0);
|
|
854
|
+
i = {
|
|
855
|
+
attributes: a,
|
|
856
|
+
count: 0,
|
|
857
|
+
sum: 0,
|
|
858
|
+
min: t,
|
|
859
|
+
max: t,
|
|
860
|
+
buckets: o
|
|
861
|
+
}, e.series.set(r, i);
|
|
862
|
+
}
|
|
863
|
+
if (i.count += 1, i.sum += t, i.min = Math.min(i.min, t), i.max = Math.max(i.max, t), i.buckets.length > 0) {
|
|
864
|
+
let n = e.def.boundaries.findIndex((e) => t <= e);
|
|
865
|
+
i.buckets[n === -1 ? i.buckets.length - 1 : n] += 1;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
arm() {
|
|
869
|
+
this.timer === null && (this.startedAt = Date.now(), this.timer = setTimeout(() => {
|
|
870
|
+
this.collect();
|
|
871
|
+
}, this.intervalMs()), Je(this.timer));
|
|
872
|
+
}
|
|
873
|
+
}, Tn = "error.", En = [
|
|
874
|
+
T,
|
|
875
|
+
E,
|
|
876
|
+
y
|
|
759
877
|
];
|
|
760
|
-
function
|
|
878
|
+
function K(e) {
|
|
761
879
|
return e;
|
|
762
880
|
}
|
|
763
|
-
var
|
|
881
|
+
var Dn = class {
|
|
764
882
|
deps;
|
|
765
883
|
resourceCache = null;
|
|
766
884
|
constructor(e) {
|
|
@@ -772,9 +890,9 @@ var pn = class {
|
|
|
772
890
|
isEnabled(e, t) {
|
|
773
891
|
let { config: n } = this.deps;
|
|
774
892
|
if (!n.enabled) return !1;
|
|
775
|
-
if (t !== void 0 &&
|
|
893
|
+
if (t !== void 0 && pe.includes(t)) return !0;
|
|
776
894
|
let r = this.deps.remote.sampling?.minLevel() ?? n.minLevel;
|
|
777
|
-
return
|
|
895
|
+
return O[e] >= O[r];
|
|
778
896
|
}
|
|
779
897
|
build(e) {
|
|
780
898
|
let { config: t, diagnostics: n, tracing: r, journey: i, sequence: a, limits: o, remote: s } = this.deps;
|
|
@@ -783,72 +901,73 @@ var pn = class {
|
|
|
783
901
|
dropped: "level"
|
|
784
902
|
};
|
|
785
903
|
let c = r.resolve(), l = i.current();
|
|
786
|
-
if (!
|
|
904
|
+
if (!Me({
|
|
787
905
|
level: e.level,
|
|
788
906
|
type: e.type,
|
|
789
907
|
namespace: e.namespace,
|
|
790
908
|
journeyId: l?.id ?? "",
|
|
791
|
-
traceId: c.traceId
|
|
909
|
+
traceId: c.traceId,
|
|
910
|
+
aggregated: e.aggregated
|
|
792
911
|
}, t, s.sampling?.current() ?? null)) return n.count("record.dropped_by_sampling"), {
|
|
793
912
|
record: null,
|
|
794
913
|
dropped: "sampling"
|
|
795
914
|
};
|
|
796
|
-
let u = a.next(), d =
|
|
915
|
+
let u = a.next(), d = Ge(n), f = t.capture.fullUrls ? d : We(d), p, m = 0;
|
|
797
916
|
try {
|
|
798
|
-
let t =
|
|
917
|
+
let t = j(this.deps.context.getAll(), o, n), r = j(e.scoped ?? {}, o, n), i = j(e.payload ?? {}, o, n);
|
|
799
918
|
m = t.bytes + r.bytes + i.bytes, p = {
|
|
800
|
-
...
|
|
801
|
-
...
|
|
802
|
-
...
|
|
919
|
+
...K(t.value),
|
|
920
|
+
...K(r.value),
|
|
921
|
+
...K(i.value)
|
|
803
922
|
};
|
|
804
923
|
} catch (e) {
|
|
805
|
-
n.report("record.sanitize_failed", "The library could not sanitize the attributes.", void 0, e), p = { [
|
|
924
|
+
n.report("record.sanitize_failed", "The library could not sanitize the attributes.", void 0, e), p = { [me]: !0 };
|
|
806
925
|
}
|
|
807
|
-
p[b] = e.type, p[
|
|
808
|
-
let h =
|
|
926
|
+
Object.assign(p, e.fixed), p[b] = e.type, p[D] = u, p[w] = e.namespace, p[T] = f, l && (p[E] = l.id, p[y] = l.name, l.parentId !== void 0 && (p[fe] = l.parentId));
|
|
927
|
+
let h = Pe(e.body, o.maxBodyChars);
|
|
809
928
|
h !== e.body && n.count("record.truncated");
|
|
810
929
|
let g = {
|
|
811
|
-
timeUnixNano:
|
|
930
|
+
timeUnixNano: je(),
|
|
812
931
|
traceId: c.traceId,
|
|
813
932
|
spanId: c.spanId,
|
|
814
933
|
traceFlags: c.traceFlags,
|
|
815
|
-
severityNumber:
|
|
934
|
+
severityNumber: ue[e.level],
|
|
816
935
|
severityText: e.level,
|
|
817
936
|
body: h,
|
|
818
937
|
attributes: p,
|
|
819
938
|
resource: this.resource()
|
|
820
939
|
}, _ = t.redact;
|
|
821
940
|
if (_) {
|
|
822
|
-
let
|
|
941
|
+
let t;
|
|
823
942
|
try {
|
|
824
|
-
|
|
943
|
+
t = _(g);
|
|
825
944
|
} catch (e) {
|
|
826
945
|
return n.report("record.dropped_by_redact", "The redact hook threw an error. The library dropped the record.", void 0, e), {
|
|
827
946
|
record: null,
|
|
828
947
|
dropped: "redact"
|
|
829
948
|
};
|
|
830
949
|
}
|
|
831
|
-
if (
|
|
950
|
+
if (t === null) return n.count("record.dropped_by_redact"), {
|
|
832
951
|
record: null,
|
|
833
952
|
dropped: "redact"
|
|
834
953
|
};
|
|
835
|
-
let
|
|
836
|
-
if (!
|
|
954
|
+
let r = t ?? g;
|
|
955
|
+
if (!Oe(r)) return r === g ? (n.report("record.dropped_malformed", "The redact hook changed the record to a shape that is not a record. The library dropped it."), {
|
|
837
956
|
record: null,
|
|
838
957
|
dropped: "malformed"
|
|
839
958
|
}) : (n.report("record.dropped_by_redact", "The redact hook returned a value that is not a record. The library dropped the record."), {
|
|
840
959
|
record: null,
|
|
841
960
|
dropped: "redact"
|
|
842
961
|
});
|
|
843
|
-
if (
|
|
844
|
-
if (
|
|
845
|
-
let
|
|
962
|
+
if (ke(r.severityText)) {
|
|
963
|
+
if (r !== g) {
|
|
964
|
+
let t = j(r.attributes, o, n);
|
|
846
965
|
g = {
|
|
847
|
-
...
|
|
848
|
-
attributes:
|
|
849
|
-
}, m = e.
|
|
966
|
+
...r,
|
|
967
|
+
attributes: K(t.value)
|
|
968
|
+
}, m = t.bytes, Object.assign(g.attributes, e.fixed);
|
|
850
969
|
}
|
|
851
|
-
g.severityNumber =
|
|
970
|
+
g.severityNumber = ue[g.severityText];
|
|
852
971
|
} else return n.report("record.dropped_malformed", "The redact hook set a severityText that is not a log level. The library dropped the record."), {
|
|
853
972
|
record: null,
|
|
854
973
|
dropped: "malformed"
|
|
@@ -861,52 +980,52 @@ var pn = class {
|
|
|
861
980
|
});
|
|
862
981
|
let t = {
|
|
863
982
|
[b]: e.type,
|
|
864
|
-
[
|
|
865
|
-
[
|
|
983
|
+
[D]: u,
|
|
984
|
+
[w]: e.namespace,
|
|
866
985
|
[le]: !0,
|
|
867
|
-
[
|
|
986
|
+
[ve]: m
|
|
868
987
|
};
|
|
869
|
-
for (let e of
|
|
870
|
-
for (let [e, n] of Object.entries(g.attributes)) e.startsWith(
|
|
871
|
-
let r =
|
|
872
|
-
r > o.maxRecordBytes && "error.data" in t && (Reflect.deleteProperty(t,
|
|
873
|
-
let i = g.attributes[
|
|
988
|
+
for (let e of En) e in g.attributes && (t[e] = g.attributes[e]);
|
|
989
|
+
for (let [e, n] of Object.entries(g.attributes)) e.startsWith(Tn) && (t[e] = n);
|
|
990
|
+
let r = j(t, o, n).bytes;
|
|
991
|
+
r > o.maxRecordBytes && "error.data" in t && (Reflect.deleteProperty(t, ge), r = j(t, o, n).bytes);
|
|
992
|
+
let i = g.attributes[v];
|
|
874
993
|
if (i !== void 0) {
|
|
875
|
-
let e =
|
|
876
|
-
r + e <= o.maxRecordBytes && (t[
|
|
994
|
+
let e = j(i, o, n).bytes;
|
|
995
|
+
r + e <= o.maxRecordBytes && (t[v] = i);
|
|
877
996
|
}
|
|
878
|
-
g.attributes = t;
|
|
997
|
+
Object.assign(t, e.fixed), g.attributes = t;
|
|
879
998
|
}
|
|
880
999
|
return { record: g };
|
|
881
1000
|
}
|
|
882
1001
|
resource() {
|
|
883
1002
|
if (this.resourceCache) return this.resourceCache;
|
|
884
|
-
let { config: e, identity:
|
|
1003
|
+
let { config: e, identity: t, platform: r } = this.deps;
|
|
885
1004
|
return this.resourceCache = {
|
|
886
|
-
[
|
|
887
|
-
[
|
|
888
|
-
[
|
|
889
|
-
[
|
|
890
|
-
[
|
|
891
|
-
[
|
|
1005
|
+
[te]: e.serviceName,
|
|
1006
|
+
[c]: e.serviceVersion,
|
|
1007
|
+
[p]: e.environment,
|
|
1008
|
+
[d]: ce,
|
|
1009
|
+
[_e]: S,
|
|
1010
|
+
[s]: he,
|
|
892
1011
|
[h]: r.platform,
|
|
893
|
-
[
|
|
894
|
-
[
|
|
895
|
-
[
|
|
896
|
-
[
|
|
897
|
-
...r.openfinUuid === void 0 ? {} : { [
|
|
898
|
-
...r.openfinName === void 0 ? {} : { [
|
|
1012
|
+
[ee]: t.sessionId,
|
|
1013
|
+
[ne]: t.tabId,
|
|
1014
|
+
[u]: t.contextId,
|
|
1015
|
+
[o]: r.userAgent,
|
|
1016
|
+
...r.openfinUuid === void 0 ? {} : { [n]: r.openfinUuid },
|
|
1017
|
+
...r.openfinName === void 0 ? {} : { [we]: r.openfinName }
|
|
899
1018
|
}, this.resourceCache;
|
|
900
1019
|
}
|
|
901
|
-
},
|
|
902
|
-
errors: async () => (await import("./errors-
|
|
903
|
-
network: async () => (await import("./network-
|
|
904
|
-
interactions: async () => (await import("./interactions-
|
|
1020
|
+
}, On = {
|
|
1021
|
+
errors: async () => (await import("./errors-BGs5NOrw.js")).ErrorCapture,
|
|
1022
|
+
network: async () => (await import("./network-CMnEvGJB.js")).NetworkCapture,
|
|
1023
|
+
interactions: async () => (await import("./interactions-B8zjCjga.js")).InteractionCapture,
|
|
905
1024
|
webVitals: async () => (await import("./web-vitals-Bflr5jSA.js")).WebVitalsCapture,
|
|
906
|
-
longFrames: async () => (await import("./long-frames-
|
|
907
|
-
console: async () => (await import("./console-
|
|
908
|
-
},
|
|
909
|
-
function
|
|
1025
|
+
longFrames: async () => (await import("./long-frames-B0tKuChx.js")).LongFrameCapture,
|
|
1026
|
+
console: async () => (await import("./console-B3vGRW5p.js")).ConsoleCapture
|
|
1027
|
+
}, q = Symbol.for(re), J = Symbol.for(m), kn = ["batching", "retention"];
|
|
1028
|
+
function An(e) {
|
|
910
1029
|
return JSON.stringify({
|
|
911
1030
|
...e,
|
|
912
1031
|
webVitalsLoader: e.webVitalsLoader !== void 0,
|
|
@@ -914,7 +1033,7 @@ function gn(e) {
|
|
|
914
1033
|
propagateTraceHeaderTo: e.propagateTraceHeaderTo.map(String)
|
|
915
1034
|
});
|
|
916
1035
|
}
|
|
917
|
-
function
|
|
1036
|
+
function Y(e) {
|
|
918
1037
|
return {
|
|
919
1038
|
...e,
|
|
920
1039
|
endpoint: null,
|
|
@@ -940,22 +1059,23 @@ var Z = class e {
|
|
|
940
1059
|
stores;
|
|
941
1060
|
identityBuiltAs;
|
|
942
1061
|
sessionTouch;
|
|
943
|
-
context = new
|
|
1062
|
+
context = new mn();
|
|
944
1063
|
breadcrumbs;
|
|
945
1064
|
tracing;
|
|
946
|
-
sequence = new
|
|
1065
|
+
sequence = new ct();
|
|
947
1066
|
journey;
|
|
948
1067
|
builder;
|
|
949
1068
|
remote = { sampling: null };
|
|
950
1069
|
console;
|
|
951
1070
|
drops;
|
|
1071
|
+
meter;
|
|
952
1072
|
bus = null;
|
|
953
1073
|
busBuilt;
|
|
954
1074
|
busLoad;
|
|
955
1075
|
storageBuiltAs;
|
|
956
1076
|
sender;
|
|
957
1077
|
senderLoad;
|
|
958
|
-
pendingRecords = new
|
|
1078
|
+
pendingRecords = new _n((e) => {
|
|
959
1079
|
this.dropHeld(e);
|
|
960
1080
|
});
|
|
961
1081
|
captures = [];
|
|
@@ -965,7 +1085,7 @@ var Z = class e {
|
|
|
965
1085
|
navigationTiming: !1,
|
|
966
1086
|
longFrames: !1
|
|
967
1087
|
};
|
|
968
|
-
bootBuffer = new
|
|
1088
|
+
bootBuffer = new _n((e) => {
|
|
969
1089
|
this.dropHeld(e);
|
|
970
1090
|
});
|
|
971
1091
|
forwardBuffer = [];
|
|
@@ -979,12 +1099,12 @@ var Z = class e {
|
|
|
979
1099
|
journeyOptions;
|
|
980
1100
|
tunablesLocked = !0;
|
|
981
1101
|
constructor(e, t = !1) {
|
|
982
|
-
this.degraded = t, this.diagnostics = new
|
|
983
|
-
...
|
|
1102
|
+
this.degraded = t, this.diagnostics = new hn(e.onDiagnostic), this.platform = Ue(this.diagnostics), this.config = dn(e, this.diagnostics), this.identityBuiltAs = this.config.identity, this.stores = this.identityBuiltAs === "memory" ? Be() : He, this.identity = Ve(this.diagnostics, this.stores), this.sessionTouch = new Re(this.diagnostics, this.stores), this.breadcrumbs = new vt(50), this.tracing = new _t(this.diagnostics, void 0, this.config.otelLoader), this.tracing.loadOtel(), this.limits = { ...this.config.limits }, this.console = new st(this.config.console, this.diagnostics, this.limits), this.drops = new gn(this.config, this.diagnostics), this.journeyOptions = {
|
|
1103
|
+
...Xe,
|
|
984
1104
|
maxAgeMs: this.config.journey.maxAgeMs
|
|
985
|
-
}, this.journey = new
|
|
1105
|
+
}, this.journey = new Ye(this.journeyOptions, this.diagnostics, this.identity.contextId, (e) => {
|
|
986
1106
|
this.bus?.broadcastJourney(e);
|
|
987
|
-
}, this.stores), this.builder = new
|
|
1107
|
+
}, this.stores), this.builder = new Dn({
|
|
988
1108
|
remote: this.remote,
|
|
989
1109
|
config: this.config,
|
|
990
1110
|
limits: this.limits,
|
|
@@ -995,7 +1115,24 @@ var Z = class e {
|
|
|
995
1115
|
sequence: this.sequence,
|
|
996
1116
|
identity: this.identity,
|
|
997
1117
|
platform: this.platform
|
|
1118
|
+
}), this.meter = new wn(() => this.config.batching.metricFlushIntervalMs, (e, t, n) => {
|
|
1119
|
+
this.emitPoint(e, t, n);
|
|
1120
|
+
}, this.diagnostics);
|
|
1121
|
+
}
|
|
1122
|
+
recordMetric(e, t, n) {
|
|
1123
|
+
this.destroyed || this.meter.record(e, t, n);
|
|
1124
|
+
}
|
|
1125
|
+
emitPoint(e, t, n) {
|
|
1126
|
+
let { record: r } = this.builder.build({
|
|
1127
|
+
level: "INFO",
|
|
1128
|
+
type: "metric",
|
|
1129
|
+
body: e,
|
|
1130
|
+
namespace: Se,
|
|
1131
|
+
payload: t,
|
|
1132
|
+
fixed: n,
|
|
1133
|
+
aggregated: !0
|
|
998
1134
|
});
|
|
1135
|
+
this.emit(r);
|
|
999
1136
|
}
|
|
1000
1137
|
busAccept = (e, t) => {
|
|
1001
1138
|
this.destroyed || this.ensureBus().then((n) => {
|
|
@@ -1005,7 +1142,7 @@ var Z = class e {
|
|
|
1005
1142
|
});
|
|
1006
1143
|
};
|
|
1007
1144
|
static pinned() {
|
|
1008
|
-
return globalThis[
|
|
1145
|
+
return globalThis[q] ?? null;
|
|
1009
1146
|
}
|
|
1010
1147
|
static current() {
|
|
1011
1148
|
let t = e.local;
|
|
@@ -1016,7 +1153,7 @@ var Z = class e {
|
|
|
1016
1153
|
static stopped() {
|
|
1017
1154
|
let t = e.local;
|
|
1018
1155
|
if (t?.destroyed) return t;
|
|
1019
|
-
let n = globalThis[
|
|
1156
|
+
let n = globalThis[J];
|
|
1020
1157
|
return n && X(n) ? n : null;
|
|
1021
1158
|
}
|
|
1022
1159
|
isDestroyed() {
|
|
@@ -1024,7 +1161,7 @@ var Z = class e {
|
|
|
1024
1161
|
}
|
|
1025
1162
|
static configure(t, n = !1) {
|
|
1026
1163
|
let r = e.local;
|
|
1027
|
-
if (r && !r.destroyed) return r.reconfigure(
|
|
1164
|
+
if (r && !r.destroyed) return r.reconfigure(Y(t)), r;
|
|
1028
1165
|
e.local = null;
|
|
1029
1166
|
let i = e.pinned();
|
|
1030
1167
|
if (i) {
|
|
@@ -1032,10 +1169,10 @@ var Z = class e {
|
|
|
1032
1169
|
if (!i.destroyed) return i.reconfigure(t), i;
|
|
1033
1170
|
}
|
|
1034
1171
|
let a = new e(t);
|
|
1035
|
-
return a.tunablesLocked = !n, globalThis[
|
|
1172
|
+
return a.tunablesLocked = !n, globalThis[q] = a, Reflect.deleteProperty(globalThis, J), a.init(), a;
|
|
1036
1173
|
}
|
|
1037
1174
|
static startDegraded(t, n) {
|
|
1038
|
-
let r = new e(
|
|
1175
|
+
let r = new e(Y(t), !0);
|
|
1039
1176
|
e.local = r;
|
|
1040
1177
|
let i = typeof n == "string" ? n : "before 0.9.0";
|
|
1041
1178
|
return r.diagnostics.report("runtime.version_mismatch", `Another copy of the library, version ${i}, owns the page runtime. This copy, version ${S}, runs in console-only mode and installs no capture. Load one version of the library on the page.`, {
|
|
@@ -1044,11 +1181,11 @@ var Z = class e {
|
|
|
1044
1181
|
}), r.init(), r;
|
|
1045
1182
|
}
|
|
1046
1183
|
reconfigure(e) {
|
|
1047
|
-
let t = this.keepDestination(e), n =
|
|
1048
|
-
this.keepStartupTunables(r),
|
|
1184
|
+
let t = this.keepDestination(e), n = An(this.config.capture), r = dn(t, this.diagnostics, this.config);
|
|
1185
|
+
this.keepStartupTunables(r), pn(this.config, r), this.diagnostics.setHandler(this.config.onDiagnostic), this.builder.invalidateResource(), this.console.update(this.config.console), this.keepBuiltStorage(), this.keepBuiltIdentity(), An(this.config.capture) !== n && this.installCaptures(), this.roleResolved && this.syncSender(), this.diagnostics.report("config.reconfigured", "A later configure() call updated the runtime.");
|
|
1049
1186
|
}
|
|
1050
1187
|
keepStartupTunables(e) {
|
|
1051
|
-
if (this.senderLoad !== void 0 && this.keepSections(e,
|
|
1188
|
+
if (this.senderLoad !== void 0 && this.keepSections(e, kn), !this.tunablesLocked) {
|
|
1052
1189
|
this.tunablesLocked = !0, Object.assign(this.limits, e.limits), this.journeyOptions.maxAgeMs = e.journey.maxAgeMs;
|
|
1053
1190
|
return;
|
|
1054
1191
|
}
|
|
@@ -1106,7 +1243,7 @@ var Z = class e {
|
|
|
1106
1243
|
}
|
|
1107
1244
|
async buildBus() {
|
|
1108
1245
|
try {
|
|
1109
|
-
let { Bus: e } = await import("./bus-
|
|
1246
|
+
let { Bus: e } = await import("./bus-DrixwdiX.js");
|
|
1110
1247
|
if (this.destroyed) return null;
|
|
1111
1248
|
let t = new e(this.config, this.diagnostics, this.platform, this.identity.contextId, this.identity.tabId, {
|
|
1112
1249
|
onRecords: (e) => {
|
|
@@ -1141,12 +1278,15 @@ var Z = class e {
|
|
|
1141
1278
|
async buildSender() {
|
|
1142
1279
|
this.storageBuiltAs = this.config.storage;
|
|
1143
1280
|
try {
|
|
1144
|
-
let { Sender: e } = await import("./sender
|
|
1281
|
+
let { Sender: e } = await import("./sender--0_VzPbN.js"), t = this.destroyed ? null : await e.create({
|
|
1145
1282
|
config: this.config,
|
|
1146
1283
|
diagnostics: this.diagnostics,
|
|
1147
1284
|
onGap: this.reportGap,
|
|
1148
1285
|
onLoss: this.reportLoss,
|
|
1149
|
-
remote: this.remote
|
|
1286
|
+
remote: this.remote,
|
|
1287
|
+
beforeExit: () => {
|
|
1288
|
+
this.meter.collect();
|
|
1289
|
+
}
|
|
1150
1290
|
});
|
|
1151
1291
|
if (!t || this.destroyed) {
|
|
1152
1292
|
await t?.destroy();
|
|
@@ -1160,9 +1300,9 @@ var Z = class e {
|
|
|
1160
1300
|
}
|
|
1161
1301
|
async installCaptures() {
|
|
1162
1302
|
if (this.degraded) return;
|
|
1163
|
-
let e = ++this.captureGeneration, t = this.config.capture,
|
|
1164
|
-
(t.errors || t.rejections || t.resourceErrors) &&
|
|
1165
|
-
let
|
|
1303
|
+
let e = ++this.captureGeneration, t = this.config.capture, n = [];
|
|
1304
|
+
(t.errors || t.rejections || t.resourceErrors) && n.push("errors"), (t.fetch || t.xhr) && n.push("network"), (t.interactions || t.navigation) && n.push("interactions"), t.webVitals && n.push("webVitals"), t.longFrames && n.push("longFrames"), (Array.isArray(t.console) ? t.console.length > 0 : t.console) && n.push("console");
|
|
1305
|
+
let r = await Promise.all(n.map((e) => this.loadCapture(e)));
|
|
1166
1306
|
if (e !== this.captureGeneration || this.destroyed) return;
|
|
1167
1307
|
this.uninstallCaptures();
|
|
1168
1308
|
let a = {
|
|
@@ -1170,10 +1310,13 @@ var Z = class e {
|
|
|
1170
1310
|
diagnostics: this.diagnostics,
|
|
1171
1311
|
breadcrumbs: this.breadcrumbs,
|
|
1172
1312
|
tracing: this.tracing,
|
|
1173
|
-
logger: new
|
|
1174
|
-
once: this.captureOnce
|
|
1313
|
+
logger: new I(() => this, i),
|
|
1314
|
+
once: this.captureOnce,
|
|
1315
|
+
recordMetric: (e, t, n) => {
|
|
1316
|
+
this.recordMetric(e, t, n);
|
|
1317
|
+
}
|
|
1175
1318
|
};
|
|
1176
|
-
for (let e of
|
|
1319
|
+
for (let e of r) e && this.captures.push(new e(a));
|
|
1177
1320
|
for (let e of this.captures) this.diagnostics.guard("capture.install_failed", `The library could not install the ${e.name} capture.`, () => {
|
|
1178
1321
|
e.install();
|
|
1179
1322
|
});
|
|
@@ -1185,7 +1328,7 @@ var Z = class e {
|
|
|
1185
1328
|
this.captures.length = 0;
|
|
1186
1329
|
}
|
|
1187
1330
|
loadCapture(e) {
|
|
1188
|
-
return this.diagnostics.guardAsync("capture.install_failed", `The library could not load the ${e} capture.`,
|
|
1331
|
+
return this.diagnostics.guardAsync("capture.install_failed", `The library could not load the ${e} capture.`, On[e]);
|
|
1189
1332
|
}
|
|
1190
1333
|
registerWorker(e) {
|
|
1191
1334
|
this.destroyed || this.constructBus().then((t) => {
|
|
@@ -1196,9 +1339,9 @@ var Z = class e {
|
|
|
1196
1339
|
}
|
|
1197
1340
|
async destroy() {
|
|
1198
1341
|
if (this.destroyed) return;
|
|
1199
|
-
this.destroyed = !0, this.uninstallCaptures();
|
|
1342
|
+
this.meter.collect(), this.destroyed = !0, this.uninstallCaptures();
|
|
1200
1343
|
let t = this.sender?.destroy();
|
|
1201
|
-
this.journey.destroy(), this.sendForwarded(), this.bus?.destroy(), this.drops.add("load_failed", this.pendingRecords.take()), await t, await this.senderLoad, e.pinned() === this && (Reflect.deleteProperty(globalThis,
|
|
1344
|
+
this.journey.destroy(), this.sendForwarded(), this.bus?.destroy(), this.drops.add("load_failed", this.pendingRecords.take()), await t, await this.senderLoad, e.pinned() === this && (Reflect.deleteProperty(globalThis, q), globalThis[J] = this);
|
|
1202
1345
|
}
|
|
1203
1346
|
emit(e) {
|
|
1204
1347
|
e && !this.destroyed && (this.sessionTouch.touch(this.identity.sessionId), this.ready ? this.route(e) : this.bootBuffer.push(e));
|
|
@@ -1223,7 +1366,7 @@ var Z = class e {
|
|
|
1223
1366
|
}
|
|
1224
1367
|
ingestForwarded(e) {
|
|
1225
1368
|
if (!Array.isArray(e)) this.diagnostics.count("record.dropped_malformed");
|
|
1226
|
-
else for (let t of e)
|
|
1369
|
+
else for (let t of e) Oe(t) ? Ae(t, this.config, this.remote.sampling?.current() ?? null) ? this.deliver(t) : this.diagnostics.count("record.dropped_by_sampling") : this.diagnostics.count("record.dropped_malformed");
|
|
1227
1370
|
}
|
|
1228
1371
|
releaseBootBuffer() {
|
|
1229
1372
|
let e = this.bootBuffer.take(), t = this.journey.current();
|
|
@@ -1235,29 +1378,29 @@ var Z = class e {
|
|
|
1235
1378
|
reportGap = (e, t) => {
|
|
1236
1379
|
this.drops.add(e.reason, t.flatMap((e) => e.records), t.map((e) => e.id));
|
|
1237
1380
|
let n = Date.now();
|
|
1238
|
-
n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new
|
|
1381
|
+
n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new I(() => this, ye).warn("stored records were dropped before delivery", {
|
|
1239
1382
|
"gap.batches": e.batches,
|
|
1240
1383
|
"gap.records": e.records,
|
|
1241
1384
|
"gap.reason": e.reason
|
|
1242
1385
|
}));
|
|
1243
1386
|
};
|
|
1244
1387
|
regenerateTabId() {
|
|
1245
|
-
let e =
|
|
1388
|
+
let e = Le(this.diagnostics);
|
|
1246
1389
|
this.diagnostics.report("bus.role_resolved", "Another context uses this tab id. A duplicated tab is the usual cause. The library makes a new tab id.", {
|
|
1247
1390
|
was: this.identity.tabId,
|
|
1248
1391
|
now: e
|
|
1249
|
-
}), this.identity.tabId = e,
|
|
1392
|
+
}), this.identity.tabId = e, Ie(e, this.diagnostics, this.stores), this.builder.invalidateResource();
|
|
1250
1393
|
}
|
|
1251
1394
|
async queueDepth() {
|
|
1252
1395
|
return await this.senderLoad, await this.sender?.queueDepth() ?? 0;
|
|
1253
1396
|
}
|
|
1254
1397
|
async flush() {
|
|
1255
|
-
this.ready || await this.started, this.role() === "forwarder" ? this.sendForwarded() : (await this.senderLoad, await this.sender?.flush());
|
|
1398
|
+
this.meter.collect(), this.ready || await this.started, this.role() === "forwarder" ? this.sendForwarded() : (await this.senderLoad, await this.sender?.flush());
|
|
1256
1399
|
}
|
|
1257
1400
|
};
|
|
1258
1401
|
//#endregion
|
|
1259
1402
|
//#region src/transport/memory-transport.ts
|
|
1260
|
-
function
|
|
1403
|
+
function jn() {
|
|
1261
1404
|
let e = [], t = [], n = { status: 200 };
|
|
1262
1405
|
return {
|
|
1263
1406
|
transport: (r) => (e.push(r), n.status >= 200 && n.status < 300 && t.push(r), Promise.resolve({ ...n })),
|
|
@@ -1276,100 +1419,122 @@ function vn() {
|
|
|
1276
1419
|
}
|
|
1277
1420
|
//#endregion
|
|
1278
1421
|
//#region src/index.ts
|
|
1279
|
-
var
|
|
1422
|
+
var Mn = /* @__PURE__ */ new Map();
|
|
1280
1423
|
function Q() {
|
|
1281
1424
|
return (Z.current() ?? Z.stopped()) || Z.configure({}, !0);
|
|
1282
1425
|
}
|
|
1283
|
-
function
|
|
1426
|
+
function Nn(e) {
|
|
1284
1427
|
Z.configure(e);
|
|
1285
1428
|
}
|
|
1286
|
-
function
|
|
1287
|
-
if (t) return new
|
|
1288
|
-
let n =
|
|
1289
|
-
return n || (n = new
|
|
1429
|
+
function Pn(e, t) {
|
|
1430
|
+
if (t) return new I(Q, e, t);
|
|
1431
|
+
let n = Mn.get(e);
|
|
1432
|
+
return n || (n = new I(Q, e), Mn.set(e, n)), n;
|
|
1290
1433
|
}
|
|
1291
1434
|
function $() {
|
|
1292
|
-
return
|
|
1435
|
+
return Pn("app");
|
|
1293
1436
|
}
|
|
1294
|
-
function
|
|
1437
|
+
function Fn(e, t) {
|
|
1295
1438
|
$().trace(e, t);
|
|
1296
1439
|
}
|
|
1297
|
-
function
|
|
1440
|
+
function In(e, t) {
|
|
1298
1441
|
$().debug(e, t);
|
|
1299
1442
|
}
|
|
1300
|
-
function
|
|
1443
|
+
function Ln(e, t) {
|
|
1301
1444
|
$().info(e, t);
|
|
1302
1445
|
}
|
|
1303
|
-
function
|
|
1446
|
+
function Rn(e, t) {
|
|
1304
1447
|
$().warn(e, t);
|
|
1305
1448
|
}
|
|
1306
|
-
function
|
|
1449
|
+
function zn(e, t, n) {
|
|
1307
1450
|
$().error(e, t, n);
|
|
1308
1451
|
}
|
|
1309
|
-
function
|
|
1452
|
+
function Bn(e, t, n) {
|
|
1310
1453
|
$().fatal(e, t, n);
|
|
1311
1454
|
}
|
|
1312
|
-
function
|
|
1455
|
+
function Vn(e, t) {
|
|
1313
1456
|
$().logAction(e, t);
|
|
1314
1457
|
}
|
|
1315
|
-
function
|
|
1458
|
+
function Hn(e, t) {
|
|
1316
1459
|
$().logEvent(e, t);
|
|
1317
1460
|
}
|
|
1318
|
-
function
|
|
1461
|
+
function Un(e, t, n, r, i) {
|
|
1319
1462
|
$().logMetric(e, t, n, r, i);
|
|
1320
1463
|
}
|
|
1321
|
-
function
|
|
1464
|
+
function Wn(e, t = {}) {
|
|
1465
|
+
let n = {
|
|
1466
|
+
name: e,
|
|
1467
|
+
kind: "counter",
|
|
1468
|
+
unit: t.unit ?? "count",
|
|
1469
|
+
boundaries: []
|
|
1470
|
+
};
|
|
1471
|
+
return { add: (e, t) => {
|
|
1472
|
+
Q().recordMetric(n, e, t);
|
|
1473
|
+
} };
|
|
1474
|
+
}
|
|
1475
|
+
function Gn(e, t = {}) {
|
|
1476
|
+
let n = {
|
|
1477
|
+
name: e,
|
|
1478
|
+
kind: "histogram",
|
|
1479
|
+
unit: t.unit ?? "count",
|
|
1480
|
+
boundaries: t.boundaries ?? ae
|
|
1481
|
+
};
|
|
1482
|
+
return { record: (e, t) => {
|
|
1483
|
+
Q().recordMetric(n, e, t);
|
|
1484
|
+
} };
|
|
1485
|
+
}
|
|
1486
|
+
function Kn(e, t, n) {
|
|
1322
1487
|
return $().timeSync(e, t, n);
|
|
1323
1488
|
}
|
|
1324
|
-
function
|
|
1489
|
+
function qn(e, t, n) {
|
|
1325
1490
|
return $().timeAsync(e, t, n);
|
|
1326
1491
|
}
|
|
1327
|
-
function
|
|
1492
|
+
function Jn(e, t) {
|
|
1328
1493
|
Q().context.set(e, t);
|
|
1329
1494
|
}
|
|
1330
|
-
function
|
|
1495
|
+
function Yn(e) {
|
|
1331
1496
|
Q().context.setMany(e);
|
|
1332
1497
|
}
|
|
1333
|
-
function
|
|
1498
|
+
function Xn(e) {
|
|
1334
1499
|
Q().context.remove(e);
|
|
1335
1500
|
}
|
|
1336
|
-
function
|
|
1501
|
+
function Zn(e, t) {
|
|
1337
1502
|
return Q().journey.start(e, t);
|
|
1338
1503
|
}
|
|
1339
|
-
function
|
|
1504
|
+
function Qn() {
|
|
1340
1505
|
Q().journey.end();
|
|
1341
1506
|
}
|
|
1342
|
-
function
|
|
1507
|
+
function $n() {
|
|
1343
1508
|
return Q().journey.current();
|
|
1344
1509
|
}
|
|
1345
|
-
function
|
|
1510
|
+
function er() {
|
|
1346
1511
|
return Q().journey.getToken();
|
|
1347
1512
|
}
|
|
1348
|
-
function
|
|
1513
|
+
function tr(e) {
|
|
1349
1514
|
return Q().journey.adopt(e, "manual", !0);
|
|
1350
1515
|
}
|
|
1351
|
-
function
|
|
1516
|
+
function nr(e) {
|
|
1352
1517
|
Q().registerWorker(e);
|
|
1353
1518
|
}
|
|
1354
|
-
function
|
|
1519
|
+
function rr() {
|
|
1355
1520
|
Q().tracing.rotate("explicit");
|
|
1356
1521
|
}
|
|
1357
|
-
function
|
|
1522
|
+
function ir() {
|
|
1358
1523
|
return Q().tracing.headers();
|
|
1359
1524
|
}
|
|
1360
|
-
function
|
|
1525
|
+
function ar() {
|
|
1361
1526
|
return Q().flush();
|
|
1362
1527
|
}
|
|
1363
|
-
function
|
|
1528
|
+
function or() {
|
|
1364
1529
|
return Q().queueDepth();
|
|
1365
1530
|
}
|
|
1366
|
-
function
|
|
1531
|
+
function sr() {
|
|
1367
1532
|
return Q().diagnostics.snapshot();
|
|
1368
1533
|
}
|
|
1369
|
-
async function
|
|
1534
|
+
async function cr() {
|
|
1370
1535
|
await Z.current()?.destroy();
|
|
1371
1536
|
}
|
|
1372
1537
|
//#endregion
|
|
1373
|
-
export {
|
|
1538
|
+
export { I as OneLogger, tr as adoptJourney, Nn as configure, Wn as counter, jn as createMemoryTransport, $n as currentJourney, In as debug, Qn as endJourney, zn as error, Bn as fatal, ar as flush, sr as getDiagnosticCounters, er as getJourneyToken, Pn as getLogger, or as getQueueDepth, ir as getTraceHeaders, Gn as histogram, Ln as info, Vn as logAction, Hn as logEvent, Un as logMetric, nr as registerWorker, Xn as removeContext, Jn as setContext, Yn as setContextMap, cr as shutdown, Zn as startJourney, rr as startTrace, qn as timeAsync, Kn as timeSync, Fn as trace, Rn as warn };
|
|
1374
1539
|
|
|
1375
1540
|
//# sourceMappingURL=index.js.map
|