@brickkit/cli 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard-dist/CollapsiblePanel-CbUysOp5.js +2 -0
- package/dashboard-dist/CompositeRoot-D4sRkYq3.js +1 -0
- package/dashboard-dist/Geist-Variable.woff2 +0 -0
- package/dashboard-dist/GeistMono-Variable.woff2 +0 -0
- package/dashboard-dist/PopoverPopup-CiI2avT_.js +1 -0
- package/dashboard-dist/api-reference-mT9VNcPb.js +265 -0
- package/dashboard-dist/app.css +2 -2
- package/dashboard-dist/app.js +12 -13
- package/dashboard-dist/ccount-CcG1m-Yh.js +1 -0
- package/dashboard-dist/client-CwATkLJa.js +1 -0
- package/dashboard-dist/core-BEUWp6B5.js +1 -0
- package/dashboard-dist/docs-BRrtyxDB.js +4 -0
- package/dashboard-dist/docs.css +1 -1
- package/dashboard-dist/kit.js +1 -1
- package/dashboard-dist/popover-Bj9x-88h.js +1 -0
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +309 -211
- package/dist/bin.js.map +1 -1
- package/dist/build.js +463 -0
- package/dist/build.js.map +1 -0
- package/dist/client-contract-file.js +356 -1
- package/dist/client-contract-file.js.map +1 -0
- package/dist/compiler.d.ts +12 -3
- package/dist/compiler.js +1 -1
- package/dist/compiler2.js +13 -7
- package/dist/compiler2.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.js +1 -252
- package/dist/config2.d.ts +122 -0
- package/dist/config2.js +207 -0
- package/dist/config2.js.map +1 -0
- package/dist/dashboard-extension.d.ts +3 -2
- package/dist/{dev-telemetry-store.js → dashboard-host.js} +1381 -1432
- package/dist/dashboard-host.js.map +1 -0
- package/dist/dashboard-protocol.js +189 -0
- package/dist/dashboard-protocol.js.map +1 -0
- package/dist/dashboard.d.ts +8 -135
- package/dist/definitions.js +33 -0
- package/dist/definitions.js.map +1 -0
- package/dist/dev-application.js +34 -0
- package/dist/dev-application.js.map +1 -0
- package/dist/dev-protocol.js +21 -0
- package/dist/dev-protocol.js.map +1 -0
- package/dist/dev-reporter.d.ts +0 -2
- package/dist/dev-reporter.js +3 -3
- package/dist/dev-reporter.js.map +1 -1
- package/dist/dev-telemetry.js +8 -24
- package/dist/dev-telemetry.js.map +1 -1
- package/dist/dev-worker.js +80 -21
- package/dist/dev-worker.js.map +1 -1
- package/dist/index.d.ts +18 -87
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -0
- package/dist/lint/oxlint.d.ts +0 -2
- package/dist/lint/oxlint.js +6 -5
- package/dist/lint/oxlint.js.map +1 -1
- package/dist/own-module.js +7 -0
- package/dist/own-module.js.map +1 -0
- package/dist/plugin.d.ts +6 -11
- package/dist/plugin.js +6 -42
- package/dist/plugin.js.map +1 -1
- package/dist/production-dashboard.d.ts +2 -0
- package/dist/production-dashboard.js +51 -0
- package/dist/production-dashboard.js.map +1 -0
- package/dist/production-dashboard2.d.ts +34 -0
- package/dist/{presets.js → project.js} +107 -113
- package/dist/project.js.map +1 -0
- package/dist/serve.d.ts +24 -0
- package/dist/serve.js +1 -0
- package/dist/serve2.js +49 -0
- package/dist/serve2.js.map +1 -0
- package/dist/vite.d.ts +0 -2
- package/dist/vite.js +28 -51
- package/dist/vite.js.map +1 -1
- package/dist/workflows.d.ts +2 -4
- package/dist/workflows2.js +60 -39
- package/dist/workflows2.js.map +1 -1
- package/inspector-dist/client/assets/api.rpc-BvRk9kiK.js +0 -0
- package/inspector-dist/client/assets/api.stream._streamId-BvRk9kiK.js +0 -0
- package/inspector-dist/client/assets/app-CeSwVsRm.css +2 -0
- package/inspector-dist/client/assets/dist-BK8w6xOr.js +3930 -0
- package/inspector-dist/client/assets/dist-CG2aVufI.js +197 -0
- package/inspector-dist/client/assets/entry.client-D9jbgmTR.js +9391 -0
- package/inspector-dist/client/assets/highlighted-body-B3W2YXNL-CfRnuITN.js +34 -0
- package/inspector-dist/client/assets/home-hwPlkNhv.js +4034 -0
- package/inspector-dist/client/assets/jsx-runtime-CPEah4WQ.js +7084 -0
- package/inspector-dist/client/assets/manifest-0e76e9ac.js +1 -0
- package/inspector-dist/client/assets/mermaid-3ZIDBTTL-ZDR2PNY_.js +1 -0
- package/inspector-dist/client/assets/root-ChBNTZd2.css +2 -0
- package/inspector-dist/client/assets/root-SLeEf-sT.js +320 -0
- package/inspector-dist/client/assets/run-detail-DYbVkIFH.js +1871 -0
- package/inspector-dist/client/assets/tabs-CaJisoyb.js +73751 -0
- package/inspector-dist/client/assets/tabs-L5XKzOpP.css +1 -0
- package/inspector-dist/client/assets/zstd-browser-decoder-D94wmfAU.js +41 -0
- package/inspector-dist/server/assets/app-DGlfWVUI.js +99330 -0
- package/inspector-dist/server/assets/chunk-RLXIAIE6-F0SJZlei.js +42975 -0
- package/inspector-dist/server/assets/dist-BCbwm6jl.js +10325 -0
- package/inspector-dist/server/assets/dist-CG2aVufI.js +197 -0
- package/inspector-dist/server/assets/dist-Ce0I2PUv.js +1137 -0
- package/inspector-dist/server/assets/dist-DY0UlahA.js +1642 -0
- package/inspector-dist/server/assets/encryption-DdQgC8Rk.js +886 -0
- package/inspector-dist/server/assets/event-metadata-n7E4zEmT.js +145 -0
- package/inspector-dist/server/assets/functions-CNVQtbgg.js +1170 -0
- package/inspector-dist/server/assets/global-singleton-D8sIN5du.js +80 -0
- package/inspector-dist/server/assets/highlighted-body-B3W2YXNL-CWRzMxYD.js +34 -0
- package/inspector-dist/server/assets/mermaid-3ZIDBTTL-D0v0ngVr.js +1 -0
- package/inspector-dist/server/assets/parse-Begau9cA.js +469 -0
- package/inspector-dist/server/assets/rolldown-runtime-C1I3wEg2.js +43 -0
- package/inspector-dist/server/assets/serialization-format-BbuGfHog.js +476 -0
- package/inspector-dist/server/assets/token-BgMmJNP5.js +60 -0
- package/inspector-dist/server/assets/token-BrUX0bxz.js +55 -0
- package/inspector-dist/server/assets/token-util-DZN32qmT.js +455 -0
- package/inspector-dist/server/assets/wrapper-CIC3w0oC.js +3624 -0
- package/inspector-dist/server/assets/ws-transport-CxTYB11n.js +29476 -0
- package/inspector-dist/server/assets/zstd-browser-decoder-D7bCXbGg.js +38 -0
- package/inspector-dist/server/index.js +1 -58
- package/package.json +39 -28
- package/vite-client.d.ts +1 -1
- package/dashboard-dist/CollapsiblePanel-BX79_W-b.js +0 -2
- package/dashboard-dist/CompositeRoot-xzybXjnx.js +0 -1
- package/dashboard-dist/PopoverPopup-CvlmC7EL.js +0 -1
- package/dashboard-dist/api-reference-BcAYVYwJ.js +0 -260
- package/dashboard-dist/core-BGO9JZ1r.js +0 -1
- package/dashboard-dist/docs-DHikPD2v.js +0 -4
- package/dashboard-dist/popover-DG498XHH.js +0 -1
- package/dist/app-entry.js +0 -1
- package/dist/app-entry2.js +0 -19
- package/dist/app-entry2.js.map +0 -1
- package/dist/bin.d.ts.map +0 -1
- package/dist/client-contract-file2.js +0 -34
- package/dist/client-contract-file2.js.map +0 -1
- package/dist/client-contract.js +0 -1
- package/dist/client-contract2.js +0 -294
- package/dist/client-contract2.js.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/dashboard-extension.d.ts.map +0 -1
- package/dist/dev-reporter.d.ts.map +0 -1
- package/dist/dev-telemetry-store.js.map +0 -1
- package/dist/emit.d.ts +0 -7
- package/dist/emit.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lint/oxlint.d.ts.map +0 -1
- package/dist/plugin.d.ts.map +0 -1
- package/dist/presets.js.map +0 -1
- package/dist/runner.js +0 -523
- package/dist/runner.js.map +0 -1
- package/dist/vite.d.ts.map +0 -1
- package/dist/workflows.d.ts.map +0 -1
- package/inspector-dist/client/assets/api.rpc-l0sNRNKZ.js +0 -1
- package/inspector-dist/client/assets/api.stream._streamId-l0sNRNKZ.js +0 -1
- package/inspector-dist/client/assets/app-CvoGgWcV.css +0 -1
- package/inspector-dist/client/assets/entry.client-BJ6G3n5t.js +0 -11697
- package/inspector-dist/client/assets/highlighted-body-B3W2YXNL-C-3wZnxf.js +0 -19
- package/inspector-dist/client/assets/home-CSKAS4P2.js +0 -4979
- package/inspector-dist/client/assets/index-DECCyMR0.js +0 -4482
- package/inspector-dist/client/assets/index-Dot7CgrA.js +0 -9837
- package/inspector-dist/client/assets/index-HqNj_XIX.js +0 -200
- package/inspector-dist/client/assets/manifest-139c9319.js +0 -1
- package/inspector-dist/client/assets/mermaid-3ZIDBTTL-DC0K8uTy.js +0 -58626
- package/inspector-dist/client/assets/mermaid-3ZIDBTTL-F88p7PFX.css +0 -1
- package/inspector-dist/client/assets/root-BMHd_XHz.css +0 -1
- package/inspector-dist/client/assets/root-cbi6iYwg.js +0 -305
- package/inspector-dist/client/assets/run-detail-CWoGxu_0.css +0 -1
- package/inspector-dist/client/assets/run-detail-Cc7tSGNq.js +0 -6237
- package/inspector-dist/client/assets/world-config-context-BAD1QCrR.js +0 -26
- package/inspector-dist/client/assets/zstd-browser-decoder-BQoRpP7L.js +0 -28
- package/inspector-dist/server/assets/app-DUP5RybL.js +0 -174880
- package/inspector-dist/server/assets/highlighted-body-B3W2YXNL-D2g4hL2-.js +0 -71
- package/inspector-dist/server/assets/index-BfLBLRRi.js +0 -204
- package/inspector-dist/server/assets/index-BzrGWk7J.js +0 -1164
- package/inspector-dist/server/assets/index-D71yP6AL.js +0 -191
- package/inspector-dist/server/assets/index-wGSWRns3.js +0 -1296
- package/inspector-dist/server/assets/mermaid-3ZIDBTTL-DsvuKoEV.js +0 -58
- package/inspector-dist/server/assets/token-ClUZZwXl.js +0 -95
- package/inspector-dist/server/assets/token-util-DSxMZ6nI.js +0 -33
- package/inspector-dist/server/assets/wrapper-B3vstpCO.js +0 -67
- package/inspector-dist/server/assets/zstd-browser-decoder-Dn82m2BU.js +0 -77
|
@@ -0,0 +1,1642 @@
|
|
|
1
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/diag/types.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Defines the available internal logging levels for the diagnostic logger, the numeric values
|
|
4
|
+
* of the levels are defined to match the original values from the initial LogLevel to avoid
|
|
5
|
+
* compatibility/migration issues for any implementation that assume the numeric ordering.
|
|
6
|
+
*
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
var DiagLogLevel = /* @__PURE__ */ function(DiagLogLevel) {
|
|
10
|
+
/** Diagnostic Logging level setting to disable all logging (except and forced logs) */
|
|
11
|
+
DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE";
|
|
12
|
+
/** Identifies an error scenario */
|
|
13
|
+
DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR";
|
|
14
|
+
/** Identifies a warning scenario */
|
|
15
|
+
DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN";
|
|
16
|
+
/** General informational log message */
|
|
17
|
+
DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO";
|
|
18
|
+
/** General debug log message */
|
|
19
|
+
DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG";
|
|
20
|
+
/**
|
|
21
|
+
* Detailed trace level logging should only be used for development, should only be set
|
|
22
|
+
* in a development environment.
|
|
23
|
+
*/
|
|
24
|
+
DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE";
|
|
25
|
+
/** Used to set the logging level to include all logging */
|
|
26
|
+
DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL";
|
|
27
|
+
return DiagLogLevel;
|
|
28
|
+
}({});
|
|
29
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/version.mjs
|
|
30
|
+
var VERSION = "1.10.0";
|
|
31
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/internal/semver.mjs
|
|
32
|
+
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
33
|
+
/**
|
|
34
|
+
* Create a function to test an API version to see if it is compatible with the provided ownVersion.
|
|
35
|
+
*
|
|
36
|
+
* The returned function has the following semantics:
|
|
37
|
+
* - Exact match is always compatible
|
|
38
|
+
* - Major versions must match exactly
|
|
39
|
+
* - 1.x package cannot use global 2.x package
|
|
40
|
+
* - 2.x package cannot use global 1.x package
|
|
41
|
+
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
|
42
|
+
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
|
43
|
+
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
|
44
|
+
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
|
45
|
+
* - Patch and build tag differences are not considered at this time
|
|
46
|
+
*
|
|
47
|
+
* @param ownVersion version which should be checked against
|
|
48
|
+
*/
|
|
49
|
+
function _makeCompatibilityCheck(ownVersion) {
|
|
50
|
+
const acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
|
|
51
|
+
const rejectedVersions = /* @__PURE__ */ new Set();
|
|
52
|
+
const myVersionMatch = ownVersion.match(re);
|
|
53
|
+
if (!myVersionMatch) return () => false;
|
|
54
|
+
const ownVersionParsed = {
|
|
55
|
+
major: +myVersionMatch[1],
|
|
56
|
+
minor: +myVersionMatch[2],
|
|
57
|
+
patch: +myVersionMatch[3],
|
|
58
|
+
prerelease: myVersionMatch[4]
|
|
59
|
+
};
|
|
60
|
+
if (ownVersionParsed.prerelease != null) return function isExactmatch(globalVersion) {
|
|
61
|
+
return globalVersion === ownVersion;
|
|
62
|
+
};
|
|
63
|
+
function _reject(v) {
|
|
64
|
+
rejectedVersions.add(v);
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
function _accept(v) {
|
|
68
|
+
acceptedVersions.add(v);
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return function isCompatible(globalVersion) {
|
|
72
|
+
if (acceptedVersions.has(globalVersion)) return true;
|
|
73
|
+
if (rejectedVersions.has(globalVersion)) return false;
|
|
74
|
+
const globalVersionMatch = globalVersion.match(re);
|
|
75
|
+
if (!globalVersionMatch) return _reject(globalVersion);
|
|
76
|
+
const globalVersionParsed = {
|
|
77
|
+
major: +globalVersionMatch[1],
|
|
78
|
+
minor: +globalVersionMatch[2],
|
|
79
|
+
patch: +globalVersionMatch[3],
|
|
80
|
+
prerelease: globalVersionMatch[4]
|
|
81
|
+
};
|
|
82
|
+
if (globalVersionParsed.prerelease != null) return _reject(globalVersion);
|
|
83
|
+
if (ownVersionParsed.major !== globalVersionParsed.major) return _reject(globalVersion);
|
|
84
|
+
if (ownVersionParsed.major === 0) {
|
|
85
|
+
if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) return _accept(globalVersion);
|
|
86
|
+
return _reject(globalVersion);
|
|
87
|
+
}
|
|
88
|
+
if (ownVersionParsed.minor <= globalVersionParsed.minor) return _accept(globalVersion);
|
|
89
|
+
return _reject(globalVersion);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Test an API version to see if it is compatible with this API.
|
|
94
|
+
*
|
|
95
|
+
* - Exact match is always compatible
|
|
96
|
+
* - Major versions must match exactly
|
|
97
|
+
* - 1.x package cannot use global 2.x package
|
|
98
|
+
* - 2.x package cannot use global 1.x package
|
|
99
|
+
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
|
|
100
|
+
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
|
101
|
+
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
|
102
|
+
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
|
103
|
+
* - Patch and build tag differences are not considered at this time
|
|
104
|
+
*
|
|
105
|
+
* @param version version of the API requesting an instance of the global API
|
|
106
|
+
*/
|
|
107
|
+
var isCompatible = _makeCompatibilityCheck(VERSION);
|
|
108
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/internal/global-utils.mjs
|
|
109
|
+
var major = VERSION.split(".")[0];
|
|
110
|
+
var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);
|
|
111
|
+
var _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
112
|
+
function _makeGlobalApi() {
|
|
113
|
+
return Object.defineProperty({}, "version", {
|
|
114
|
+
value: VERSION,
|
|
115
|
+
enumerable: true,
|
|
116
|
+
writable: false,
|
|
117
|
+
configurable: false
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function registerGlobal(type, instance, diag, allowOverride = false) {
|
|
121
|
+
var _global$GLOBAL_OPENTE;
|
|
122
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_global$GLOBAL_OPENTE = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _global$GLOBAL_OPENTE !== void 0 ? _global$GLOBAL_OPENTE : _makeGlobalApi();
|
|
123
|
+
if (!allowOverride && api[type]) {
|
|
124
|
+
const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);
|
|
125
|
+
diag.error(err.stack || err.message);
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
if (api.version !== "1.10.0") {
|
|
129
|
+
const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);
|
|
130
|
+
diag.error(err.stack || err.message);
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
api[type] = instance;
|
|
134
|
+
diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
var _compatibleGlobalApi;
|
|
138
|
+
function getGlobal(type) {
|
|
139
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
140
|
+
if (api == null) return;
|
|
141
|
+
if (api !== _compatibleGlobalApi) {
|
|
142
|
+
if (!api.version || !isCompatible(api.version)) return;
|
|
143
|
+
_compatibleGlobalApi = api;
|
|
144
|
+
}
|
|
145
|
+
return api[type];
|
|
146
|
+
}
|
|
147
|
+
function unregisterGlobal(type, diag) {
|
|
148
|
+
diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);
|
|
149
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
150
|
+
if (api) delete api[type];
|
|
151
|
+
}
|
|
152
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/diag/ComponentLogger.mjs
|
|
153
|
+
/**
|
|
154
|
+
* Component Logger which is meant to be used as part of any component which
|
|
155
|
+
* will add automatically additional namespace in front of the log message.
|
|
156
|
+
* It will then forward all message to global diag logger
|
|
157
|
+
* @example
|
|
158
|
+
* const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });
|
|
159
|
+
* cLogger.debug('test');
|
|
160
|
+
* // @opentelemetry/instrumentation-http test
|
|
161
|
+
*/
|
|
162
|
+
var DiagComponentLogger = class {
|
|
163
|
+
constructor(props) {
|
|
164
|
+
this._namespace = props.namespace || "DiagComponentLogger";
|
|
165
|
+
}
|
|
166
|
+
debug(...args) {
|
|
167
|
+
return logProxy("debug", this._namespace, args);
|
|
168
|
+
}
|
|
169
|
+
error(...args) {
|
|
170
|
+
return logProxy("error", this._namespace, args);
|
|
171
|
+
}
|
|
172
|
+
info(...args) {
|
|
173
|
+
return logProxy("info", this._namespace, args);
|
|
174
|
+
}
|
|
175
|
+
warn(...args) {
|
|
176
|
+
return logProxy("warn", this._namespace, args);
|
|
177
|
+
}
|
|
178
|
+
verbose(...args) {
|
|
179
|
+
return logProxy("verbose", this._namespace, args);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
function logProxy(funcName, namespace, args) {
|
|
183
|
+
const logger = getGlobal("diag");
|
|
184
|
+
if (!logger) return;
|
|
185
|
+
return logger[funcName](namespace, ...args);
|
|
186
|
+
}
|
|
187
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/diag/internal/logLevelLogger.mjs
|
|
188
|
+
function createLogLevelDiagLogger(maxLevel, logger) {
|
|
189
|
+
if (maxLevel < 0) maxLevel = 0;
|
|
190
|
+
else if (maxLevel > 9999) maxLevel = 9999;
|
|
191
|
+
logger = logger || {};
|
|
192
|
+
function _filterFunc(funcName, theLevel) {
|
|
193
|
+
const theFunc = logger[funcName];
|
|
194
|
+
if (typeof theFunc === "function" && maxLevel >= theLevel) return theFunc.bind(logger);
|
|
195
|
+
return function() {};
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
error: _filterFunc("error", 30),
|
|
199
|
+
warn: _filterFunc("warn", 50),
|
|
200
|
+
info: _filterFunc("info", 60),
|
|
201
|
+
debug: _filterFunc("debug", 70),
|
|
202
|
+
verbose: _filterFunc("verbose", 80)
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/api/diag.mjs
|
|
206
|
+
var API_NAME$5 = "diag";
|
|
207
|
+
/**
|
|
208
|
+
* Singleton object which represents the entry point to the OpenTelemetry internal
|
|
209
|
+
* diagnostic API
|
|
210
|
+
*
|
|
211
|
+
* @since 1.0.0
|
|
212
|
+
*/
|
|
213
|
+
var DiagAPI = class DiagAPI {
|
|
214
|
+
/** Get the singleton instance of the DiagAPI API */
|
|
215
|
+
static instance() {
|
|
216
|
+
if (!this._instance) this._instance = new DiagAPI();
|
|
217
|
+
return this._instance;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Private internal constructor
|
|
221
|
+
* @private
|
|
222
|
+
*/
|
|
223
|
+
constructor() {
|
|
224
|
+
function _logProxy(funcName) {
|
|
225
|
+
return function(...args) {
|
|
226
|
+
const logger = getGlobal("diag");
|
|
227
|
+
if (!logger) return;
|
|
228
|
+
return logger[funcName](...args);
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
const self = this;
|
|
232
|
+
const setLogger = (logger, optionsOrLogLevel = { logLevel: 60 }) => {
|
|
233
|
+
var _optionsOrLogLevel$lo;
|
|
234
|
+
if (logger === self) {
|
|
235
|
+
var _err$stack;
|
|
236
|
+
const err = /* @__PURE__ */ new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
237
|
+
self.error((_err$stack = err.stack) !== null && _err$stack !== void 0 ? _err$stack : err.message);
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
if (typeof optionsOrLogLevel === "number") optionsOrLogLevel = { logLevel: optionsOrLogLevel };
|
|
241
|
+
const oldLogger = getGlobal("diag");
|
|
242
|
+
const newLogger = createLogLevelDiagLogger((_optionsOrLogLevel$lo = optionsOrLogLevel.logLevel) !== null && _optionsOrLogLevel$lo !== void 0 ? _optionsOrLogLevel$lo : 60, logger);
|
|
243
|
+
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
244
|
+
var _Error$stack;
|
|
245
|
+
const stack = (_Error$stack = (/* @__PURE__ */ new Error()).stack) !== null && _Error$stack !== void 0 ? _Error$stack : "<failed to generate stacktrace>";
|
|
246
|
+
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
|
247
|
+
newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);
|
|
248
|
+
}
|
|
249
|
+
return registerGlobal("diag", newLogger, self, true);
|
|
250
|
+
};
|
|
251
|
+
self.setLogger = setLogger;
|
|
252
|
+
self.disable = () => {
|
|
253
|
+
unregisterGlobal(API_NAME$5, self);
|
|
254
|
+
};
|
|
255
|
+
self.createComponentLogger = (options) => {
|
|
256
|
+
return new DiagComponentLogger(options);
|
|
257
|
+
};
|
|
258
|
+
self.verbose = _logProxy("verbose");
|
|
259
|
+
self.debug = _logProxy("debug");
|
|
260
|
+
self.info = _logProxy("info");
|
|
261
|
+
self.warn = _logProxy("warn");
|
|
262
|
+
self.error = _logProxy("error");
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/baggage/internal/baggage-impl.mjs
|
|
266
|
+
var BaggageImpl = class BaggageImpl {
|
|
267
|
+
constructor(entries) {
|
|
268
|
+
this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map();
|
|
269
|
+
}
|
|
270
|
+
getEntry(key) {
|
|
271
|
+
const entry = this._entries.get(key);
|
|
272
|
+
if (!entry) return;
|
|
273
|
+
return Object.assign({}, entry);
|
|
274
|
+
}
|
|
275
|
+
getAllEntries() {
|
|
276
|
+
return Array.from(this._entries.entries());
|
|
277
|
+
}
|
|
278
|
+
setEntry(key, entry) {
|
|
279
|
+
const newBaggage = new BaggageImpl(this._entries);
|
|
280
|
+
newBaggage._entries.set(key, entry);
|
|
281
|
+
return newBaggage;
|
|
282
|
+
}
|
|
283
|
+
removeEntry(key) {
|
|
284
|
+
const newBaggage = new BaggageImpl(this._entries);
|
|
285
|
+
newBaggage._entries.delete(key);
|
|
286
|
+
return newBaggage;
|
|
287
|
+
}
|
|
288
|
+
removeEntries(...keys) {
|
|
289
|
+
const newBaggage = new BaggageImpl(this._entries);
|
|
290
|
+
for (const key of keys) newBaggage._entries.delete(key);
|
|
291
|
+
return newBaggage;
|
|
292
|
+
}
|
|
293
|
+
clear() {
|
|
294
|
+
return new BaggageImpl();
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/baggage/internal/symbol.mjs
|
|
298
|
+
/**
|
|
299
|
+
* Symbol used to make BaggageEntryMetadata an opaque type
|
|
300
|
+
*/
|
|
301
|
+
var baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata");
|
|
302
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/baggage/utils.mjs
|
|
303
|
+
var diag$1 = DiagAPI.instance();
|
|
304
|
+
/**
|
|
305
|
+
* Create a new Baggage with optional entries
|
|
306
|
+
*
|
|
307
|
+
* @param entries An array of baggage entries the new baggage should contain
|
|
308
|
+
*/
|
|
309
|
+
function createBaggage(entries = {}) {
|
|
310
|
+
return new BaggageImpl(new Map(Object.entries(entries)));
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Create a serializable BaggageEntryMetadata object from a string.
|
|
314
|
+
*
|
|
315
|
+
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
|
316
|
+
*
|
|
317
|
+
* @since 1.0.0
|
|
318
|
+
*/
|
|
319
|
+
function baggageEntryMetadataFromString(str) {
|
|
320
|
+
if (typeof str !== "string") {
|
|
321
|
+
diag$1.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);
|
|
322
|
+
str = "";
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
__TYPE__: baggageEntryMetadataSymbol,
|
|
326
|
+
toString() {
|
|
327
|
+
return str;
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/context/context.mjs
|
|
332
|
+
/**
|
|
333
|
+
* Get a key to uniquely identify a context value
|
|
334
|
+
*
|
|
335
|
+
* @since 1.0.0
|
|
336
|
+
*/
|
|
337
|
+
function createContextKey(description) {
|
|
338
|
+
return Symbol.for(description);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* The root context is used as the default parent context when there is no active context
|
|
342
|
+
*
|
|
343
|
+
* @since 1.0.0
|
|
344
|
+
*/
|
|
345
|
+
var ROOT_CONTEXT = new class BaseContext {
|
|
346
|
+
/**
|
|
347
|
+
* Construct a new context which inherits values from an optional parent context.
|
|
348
|
+
*
|
|
349
|
+
* @param parentContext a context from which to inherit values
|
|
350
|
+
*/
|
|
351
|
+
constructor(parentContext) {
|
|
352
|
+
const self = this;
|
|
353
|
+
self._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
|
354
|
+
self.getValue = (key) => self._currentContext.get(key);
|
|
355
|
+
self.setValue = (key, value) => {
|
|
356
|
+
const context = new BaseContext(self._currentContext);
|
|
357
|
+
context._currentContext.set(key, value);
|
|
358
|
+
return context;
|
|
359
|
+
};
|
|
360
|
+
self.deleteValue = (key) => {
|
|
361
|
+
const context = new BaseContext(self._currentContext);
|
|
362
|
+
context._currentContext.delete(key);
|
|
363
|
+
return context;
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
}();
|
|
367
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/diag/consoleLogger.mjs
|
|
368
|
+
var consoleMap = [
|
|
369
|
+
{
|
|
370
|
+
n: "error",
|
|
371
|
+
c: "error"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
n: "warn",
|
|
375
|
+
c: "warn"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
n: "info",
|
|
379
|
+
c: "info"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
n: "debug",
|
|
383
|
+
c: "debug"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
n: "verbose",
|
|
387
|
+
c: "trace"
|
|
388
|
+
}
|
|
389
|
+
];
|
|
390
|
+
var _originalConsoleMethods = {};
|
|
391
|
+
if (typeof console !== "undefined") {
|
|
392
|
+
for (const key of [
|
|
393
|
+
"error",
|
|
394
|
+
"warn",
|
|
395
|
+
"info",
|
|
396
|
+
"debug",
|
|
397
|
+
"trace",
|
|
398
|
+
"log"
|
|
399
|
+
]) if (typeof console[key] === "function") _originalConsoleMethods[key] = console[key];
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* A simple Immutable Console based diagnostic logger which will output any messages to the Console.
|
|
403
|
+
* If you want to limit the amount of logging to a specific level or lower use the
|
|
404
|
+
* {@link createLogLevelDiagLogger}
|
|
405
|
+
*
|
|
406
|
+
* @since 1.0.0
|
|
407
|
+
*/
|
|
408
|
+
var DiagConsoleLogger = class {
|
|
409
|
+
constructor() {
|
|
410
|
+
function _consoleFunc(funcName) {
|
|
411
|
+
return function(...args) {
|
|
412
|
+
let theFunc = _originalConsoleMethods[funcName];
|
|
413
|
+
if (typeof theFunc !== "function") theFunc = _originalConsoleMethods["log"];
|
|
414
|
+
if (typeof theFunc !== "function" && console) {
|
|
415
|
+
theFunc = console[funcName];
|
|
416
|
+
if (typeof theFunc !== "function") theFunc = console.log;
|
|
417
|
+
}
|
|
418
|
+
if (typeof theFunc === "function") return theFunc.apply(console, args);
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
for (let i = 0; i < consoleMap.length; i++) this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/metrics/NoopMeter.mjs
|
|
425
|
+
/**
|
|
426
|
+
* NoopMeter is a noop implementation of the {@link Meter} interface. It reuses
|
|
427
|
+
* constant NoopMetrics for all of its methods.
|
|
428
|
+
*/
|
|
429
|
+
var NoopMeter = class {
|
|
430
|
+
constructor() {}
|
|
431
|
+
/**
|
|
432
|
+
* @see {@link Meter.createGauge}
|
|
433
|
+
*/
|
|
434
|
+
createGauge(_name, _options) {
|
|
435
|
+
return NOOP_GAUGE_METRIC;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* @see {@link Meter.createHistogram}
|
|
439
|
+
*/
|
|
440
|
+
createHistogram(_name, _options) {
|
|
441
|
+
return NOOP_HISTOGRAM_METRIC;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* @see {@link Meter.createCounter}
|
|
445
|
+
*/
|
|
446
|
+
createCounter(_name, _options) {
|
|
447
|
+
return NOOP_COUNTER_METRIC;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* @see {@link Meter.createUpDownCounter}
|
|
451
|
+
*/
|
|
452
|
+
createUpDownCounter(_name, _options) {
|
|
453
|
+
return NOOP_UP_DOWN_COUNTER_METRIC;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* @see {@link Meter.createObservableGauge}
|
|
457
|
+
*/
|
|
458
|
+
createObservableGauge(_name, _options) {
|
|
459
|
+
return NOOP_OBSERVABLE_GAUGE_METRIC;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* @see {@link Meter.createObservableCounter}
|
|
463
|
+
*/
|
|
464
|
+
createObservableCounter(_name, _options) {
|
|
465
|
+
return NOOP_OBSERVABLE_COUNTER_METRIC;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* @see {@link Meter.createObservableUpDownCounter}
|
|
469
|
+
*/
|
|
470
|
+
createObservableUpDownCounter(_name, _options) {
|
|
471
|
+
return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* @see {@link Meter.addBatchObservableCallback}
|
|
475
|
+
*/
|
|
476
|
+
addBatchObservableCallback(_callback, _observables) {}
|
|
477
|
+
/**
|
|
478
|
+
* @see {@link Meter.removeBatchObservableCallback}
|
|
479
|
+
*/
|
|
480
|
+
removeBatchObservableCallback(_callback) {}
|
|
481
|
+
};
|
|
482
|
+
var NoopMetric = class {};
|
|
483
|
+
var NoopCounterMetric = class extends NoopMetric {
|
|
484
|
+
add(_value, _attributes) {}
|
|
485
|
+
};
|
|
486
|
+
var NoopUpDownCounterMetric = class extends NoopMetric {
|
|
487
|
+
add(_value, _attributes) {}
|
|
488
|
+
};
|
|
489
|
+
var NoopGaugeMetric = class extends NoopMetric {
|
|
490
|
+
record(_value, _attributes) {}
|
|
491
|
+
};
|
|
492
|
+
var NoopHistogramMetric = class extends NoopMetric {
|
|
493
|
+
record(_value, _attributes) {}
|
|
494
|
+
};
|
|
495
|
+
var NoopObservableMetric = class {
|
|
496
|
+
addCallback(_callback) {}
|
|
497
|
+
removeCallback(_callback) {}
|
|
498
|
+
};
|
|
499
|
+
var NoopObservableCounterMetric = class extends NoopObservableMetric {};
|
|
500
|
+
var NoopObservableGaugeMetric = class extends NoopObservableMetric {};
|
|
501
|
+
var NoopObservableUpDownCounterMetric = class extends NoopObservableMetric {};
|
|
502
|
+
var NOOP_METER = new NoopMeter();
|
|
503
|
+
var NOOP_COUNTER_METRIC = new NoopCounterMetric();
|
|
504
|
+
var NOOP_GAUGE_METRIC = new NoopGaugeMetric();
|
|
505
|
+
var NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
|
|
506
|
+
var NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
|
|
507
|
+
var NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
|
|
508
|
+
var NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
|
|
509
|
+
var NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();
|
|
510
|
+
/**
|
|
511
|
+
* Create a no-op Meter
|
|
512
|
+
*
|
|
513
|
+
* @since 1.3.0
|
|
514
|
+
*/
|
|
515
|
+
function createNoopMeter() {
|
|
516
|
+
return NOOP_METER;
|
|
517
|
+
}
|
|
518
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/metrics/Metric.mjs
|
|
519
|
+
/**
|
|
520
|
+
* The Type of value. It describes how the data is reported.
|
|
521
|
+
*
|
|
522
|
+
* @since 1.3.0
|
|
523
|
+
*/
|
|
524
|
+
var ValueType = /* @__PURE__ */ function(ValueType) {
|
|
525
|
+
ValueType[ValueType["INT"] = 0] = "INT";
|
|
526
|
+
ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE";
|
|
527
|
+
return ValueType;
|
|
528
|
+
}({});
|
|
529
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/logs/NoopLogger.mjs
|
|
530
|
+
var NoopLogger = class {
|
|
531
|
+
emit(_logRecord) {}
|
|
532
|
+
enabled() {
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
var NOOP_LOGGER = new NoopLogger();
|
|
537
|
+
/**
|
|
538
|
+
* Create a no-op Logger
|
|
539
|
+
*/
|
|
540
|
+
function createNoopLogger() {
|
|
541
|
+
return NOOP_LOGGER;
|
|
542
|
+
}
|
|
543
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/logs/LogRecord.mjs
|
|
544
|
+
var SeverityNumber = /* @__PURE__ */ function(SeverityNumber) {
|
|
545
|
+
SeverityNumber[SeverityNumber["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
546
|
+
SeverityNumber[SeverityNumber["TRACE"] = 1] = "TRACE";
|
|
547
|
+
SeverityNumber[SeverityNumber["TRACE2"] = 2] = "TRACE2";
|
|
548
|
+
SeverityNumber[SeverityNumber["TRACE3"] = 3] = "TRACE3";
|
|
549
|
+
SeverityNumber[SeverityNumber["TRACE4"] = 4] = "TRACE4";
|
|
550
|
+
SeverityNumber[SeverityNumber["DEBUG"] = 5] = "DEBUG";
|
|
551
|
+
SeverityNumber[SeverityNumber["DEBUG2"] = 6] = "DEBUG2";
|
|
552
|
+
SeverityNumber[SeverityNumber["DEBUG3"] = 7] = "DEBUG3";
|
|
553
|
+
SeverityNumber[SeverityNumber["DEBUG4"] = 8] = "DEBUG4";
|
|
554
|
+
SeverityNumber[SeverityNumber["INFO"] = 9] = "INFO";
|
|
555
|
+
SeverityNumber[SeverityNumber["INFO2"] = 10] = "INFO2";
|
|
556
|
+
SeverityNumber[SeverityNumber["INFO3"] = 11] = "INFO3";
|
|
557
|
+
SeverityNumber[SeverityNumber["INFO4"] = 12] = "INFO4";
|
|
558
|
+
SeverityNumber[SeverityNumber["WARN"] = 13] = "WARN";
|
|
559
|
+
SeverityNumber[SeverityNumber["WARN2"] = 14] = "WARN2";
|
|
560
|
+
SeverityNumber[SeverityNumber["WARN3"] = 15] = "WARN3";
|
|
561
|
+
SeverityNumber[SeverityNumber["WARN4"] = 16] = "WARN4";
|
|
562
|
+
SeverityNumber[SeverityNumber["ERROR"] = 17] = "ERROR";
|
|
563
|
+
SeverityNumber[SeverityNumber["ERROR2"] = 18] = "ERROR2";
|
|
564
|
+
SeverityNumber[SeverityNumber["ERROR3"] = 19] = "ERROR3";
|
|
565
|
+
SeverityNumber[SeverityNumber["ERROR4"] = 20] = "ERROR4";
|
|
566
|
+
SeverityNumber[SeverityNumber["FATAL"] = 21] = "FATAL";
|
|
567
|
+
SeverityNumber[SeverityNumber["FATAL2"] = 22] = "FATAL2";
|
|
568
|
+
SeverityNumber[SeverityNumber["FATAL3"] = 23] = "FATAL3";
|
|
569
|
+
SeverityNumber[SeverityNumber["FATAL4"] = 24] = "FATAL4";
|
|
570
|
+
return SeverityNumber;
|
|
571
|
+
}({});
|
|
572
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/propagation/TextMapPropagator.mjs
|
|
573
|
+
/**
|
|
574
|
+
* @since 1.0.0
|
|
575
|
+
*/
|
|
576
|
+
var defaultTextMapGetter = {
|
|
577
|
+
get(carrier, key) {
|
|
578
|
+
if (carrier == null) return;
|
|
579
|
+
return carrier[key];
|
|
580
|
+
},
|
|
581
|
+
keys(carrier) {
|
|
582
|
+
if (carrier == null) return [];
|
|
583
|
+
return Object.keys(carrier);
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
/**
|
|
587
|
+
* @since 1.0.0
|
|
588
|
+
*/
|
|
589
|
+
var defaultTextMapSetter = { set(carrier, key, value) {
|
|
590
|
+
if (carrier == null) return;
|
|
591
|
+
carrier[key] = value;
|
|
592
|
+
} };
|
|
593
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/trace_flags.mjs
|
|
594
|
+
/**
|
|
595
|
+
* @since 1.0.0
|
|
596
|
+
*/
|
|
597
|
+
var TraceFlags = /* @__PURE__ */ function(TraceFlags) {
|
|
598
|
+
/** Represents no flag set. */
|
|
599
|
+
TraceFlags[TraceFlags["NONE"] = 0] = "NONE";
|
|
600
|
+
/** Bit to represent whether trace is sampled in trace flags. */
|
|
601
|
+
TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED";
|
|
602
|
+
return TraceFlags;
|
|
603
|
+
}({});
|
|
604
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/invalid-span-constants.mjs
|
|
605
|
+
/**
|
|
606
|
+
* @since 1.0.0
|
|
607
|
+
*/
|
|
608
|
+
var INVALID_SPANID = "0000000000000000";
|
|
609
|
+
/**
|
|
610
|
+
* @since 1.0.0
|
|
611
|
+
*/
|
|
612
|
+
var INVALID_TRACEID = "00000000000000000000000000000000";
|
|
613
|
+
/**
|
|
614
|
+
* @since 1.0.0
|
|
615
|
+
*/
|
|
616
|
+
var INVALID_SPAN_CONTEXT = {
|
|
617
|
+
traceId: INVALID_TRACEID,
|
|
618
|
+
spanId: INVALID_SPANID,
|
|
619
|
+
traceFlags: 0
|
|
620
|
+
};
|
|
621
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/NonRecordingSpan.mjs
|
|
622
|
+
/**
|
|
623
|
+
* The NonRecordingSpan is the default {@link Span} that is used when no Span
|
|
624
|
+
* implementation is available. All operations are no-op including context
|
|
625
|
+
* propagation.
|
|
626
|
+
*/
|
|
627
|
+
var NonRecordingSpan = class {
|
|
628
|
+
constructor(spanContext = INVALID_SPAN_CONTEXT) {
|
|
629
|
+
this._spanContext = spanContext;
|
|
630
|
+
}
|
|
631
|
+
spanContext() {
|
|
632
|
+
return this._spanContext;
|
|
633
|
+
}
|
|
634
|
+
setAttribute(_key, _value) {
|
|
635
|
+
return this;
|
|
636
|
+
}
|
|
637
|
+
setAttributes(_attributes) {
|
|
638
|
+
return this;
|
|
639
|
+
}
|
|
640
|
+
addEvent(_name, _attributes) {
|
|
641
|
+
return this;
|
|
642
|
+
}
|
|
643
|
+
addLink(_link) {
|
|
644
|
+
return this;
|
|
645
|
+
}
|
|
646
|
+
addLinks(_links) {
|
|
647
|
+
return this;
|
|
648
|
+
}
|
|
649
|
+
setStatus(_status) {
|
|
650
|
+
return this;
|
|
651
|
+
}
|
|
652
|
+
updateName(_name) {
|
|
653
|
+
return this;
|
|
654
|
+
}
|
|
655
|
+
end(_endTime) {}
|
|
656
|
+
isRecording() {
|
|
657
|
+
return false;
|
|
658
|
+
}
|
|
659
|
+
recordException(_exception, _time) {}
|
|
660
|
+
};
|
|
661
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/spancontext-utils.mjs
|
|
662
|
+
var isHex = new Uint8Array([
|
|
663
|
+
0,
|
|
664
|
+
0,
|
|
665
|
+
0,
|
|
666
|
+
0,
|
|
667
|
+
0,
|
|
668
|
+
0,
|
|
669
|
+
0,
|
|
670
|
+
0,
|
|
671
|
+
0,
|
|
672
|
+
0,
|
|
673
|
+
0,
|
|
674
|
+
0,
|
|
675
|
+
0,
|
|
676
|
+
0,
|
|
677
|
+
0,
|
|
678
|
+
0,
|
|
679
|
+
0,
|
|
680
|
+
0,
|
|
681
|
+
0,
|
|
682
|
+
0,
|
|
683
|
+
0,
|
|
684
|
+
0,
|
|
685
|
+
0,
|
|
686
|
+
0,
|
|
687
|
+
0,
|
|
688
|
+
0,
|
|
689
|
+
0,
|
|
690
|
+
0,
|
|
691
|
+
0,
|
|
692
|
+
0,
|
|
693
|
+
0,
|
|
694
|
+
0,
|
|
695
|
+
0,
|
|
696
|
+
0,
|
|
697
|
+
0,
|
|
698
|
+
0,
|
|
699
|
+
0,
|
|
700
|
+
0,
|
|
701
|
+
0,
|
|
702
|
+
0,
|
|
703
|
+
0,
|
|
704
|
+
0,
|
|
705
|
+
0,
|
|
706
|
+
0,
|
|
707
|
+
0,
|
|
708
|
+
0,
|
|
709
|
+
0,
|
|
710
|
+
0,
|
|
711
|
+
1,
|
|
712
|
+
1,
|
|
713
|
+
1,
|
|
714
|
+
1,
|
|
715
|
+
1,
|
|
716
|
+
1,
|
|
717
|
+
1,
|
|
718
|
+
1,
|
|
719
|
+
1,
|
|
720
|
+
1,
|
|
721
|
+
0,
|
|
722
|
+
0,
|
|
723
|
+
0,
|
|
724
|
+
0,
|
|
725
|
+
0,
|
|
726
|
+
0,
|
|
727
|
+
0,
|
|
728
|
+
1,
|
|
729
|
+
1,
|
|
730
|
+
1,
|
|
731
|
+
1,
|
|
732
|
+
1,
|
|
733
|
+
1,
|
|
734
|
+
0,
|
|
735
|
+
0,
|
|
736
|
+
0,
|
|
737
|
+
0,
|
|
738
|
+
0,
|
|
739
|
+
0,
|
|
740
|
+
0,
|
|
741
|
+
0,
|
|
742
|
+
0,
|
|
743
|
+
0,
|
|
744
|
+
0,
|
|
745
|
+
0,
|
|
746
|
+
0,
|
|
747
|
+
0,
|
|
748
|
+
0,
|
|
749
|
+
0,
|
|
750
|
+
0,
|
|
751
|
+
0,
|
|
752
|
+
0,
|
|
753
|
+
0,
|
|
754
|
+
0,
|
|
755
|
+
0,
|
|
756
|
+
0,
|
|
757
|
+
0,
|
|
758
|
+
0,
|
|
759
|
+
0,
|
|
760
|
+
1,
|
|
761
|
+
1,
|
|
762
|
+
1,
|
|
763
|
+
1,
|
|
764
|
+
1,
|
|
765
|
+
1
|
|
766
|
+
]);
|
|
767
|
+
function isValidHex(id, length) {
|
|
768
|
+
if (typeof id !== "string" || id.length !== length) return false;
|
|
769
|
+
let r = 0;
|
|
770
|
+
for (let i = 0; i < id.length; i += 4) r += (isHex[id.charCodeAt(i)] | 0) + (isHex[id.charCodeAt(i + 1)] | 0) + (isHex[id.charCodeAt(i + 2)] | 0) + (isHex[id.charCodeAt(i + 3)] | 0);
|
|
771
|
+
return r === length;
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* @since 1.0.0
|
|
775
|
+
*/
|
|
776
|
+
function isValidTraceId(traceId) {
|
|
777
|
+
return isValidHex(traceId, 32) && traceId !== "00000000000000000000000000000000";
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* @since 1.0.0
|
|
781
|
+
*/
|
|
782
|
+
function isValidSpanId(spanId) {
|
|
783
|
+
return isValidHex(spanId, 16) && spanId !== "0000000000000000";
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Returns true if this {@link SpanContext} is valid.
|
|
787
|
+
* @return true if this {@link SpanContext} is valid.
|
|
788
|
+
*
|
|
789
|
+
* @since 1.0.0
|
|
790
|
+
*/
|
|
791
|
+
function isSpanContextValid(spanContext) {
|
|
792
|
+
return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Wrap the given {@link SpanContext} in a new non-recording {@link Span}
|
|
796
|
+
*
|
|
797
|
+
* @param spanContext span context to be wrapped
|
|
798
|
+
* @returns a new non-recording {@link Span} with the provided context
|
|
799
|
+
*/
|
|
800
|
+
function wrapSpanContext(spanContext) {
|
|
801
|
+
return new NonRecordingSpan(spanContext);
|
|
802
|
+
}
|
|
803
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/context/NoopContextManager.mjs
|
|
804
|
+
var NoopContextManager = class {
|
|
805
|
+
active() {
|
|
806
|
+
return ROOT_CONTEXT;
|
|
807
|
+
}
|
|
808
|
+
with(_context, fn, thisArg, ...args) {
|
|
809
|
+
return fn.call(thisArg, ...args);
|
|
810
|
+
}
|
|
811
|
+
bind(_context, target) {
|
|
812
|
+
return target;
|
|
813
|
+
}
|
|
814
|
+
enable() {
|
|
815
|
+
return this;
|
|
816
|
+
}
|
|
817
|
+
disable() {
|
|
818
|
+
return this;
|
|
819
|
+
}
|
|
820
|
+
/** @experimental This API is experimental and may change in minor releases without prior notice. */
|
|
821
|
+
attach(_context) {
|
|
822
|
+
return { dispose() {} };
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/api/context.mjs
|
|
826
|
+
var API_NAME$4 = "context";
|
|
827
|
+
var NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
828
|
+
var NOOP_TOKEN = Object.freeze({ dispose: () => {} });
|
|
829
|
+
/**
|
|
830
|
+
* Singleton object which represents the entry point to the OpenTelemetry Context API
|
|
831
|
+
*
|
|
832
|
+
* @since 1.0.0
|
|
833
|
+
*/
|
|
834
|
+
var ContextAPI = class ContextAPI {
|
|
835
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
836
|
+
constructor() {
|
|
837
|
+
this._attachUnsupportedWarned = false;
|
|
838
|
+
}
|
|
839
|
+
/** Get the singleton instance of the Context API */
|
|
840
|
+
static getInstance() {
|
|
841
|
+
if (!this._instance) this._instance = new ContextAPI();
|
|
842
|
+
return this._instance;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* Set the current context manager.
|
|
846
|
+
*
|
|
847
|
+
* @returns true if the context manager was successfully registered, else false
|
|
848
|
+
*/
|
|
849
|
+
setGlobalContextManager(contextManager) {
|
|
850
|
+
return registerGlobal(API_NAME$4, contextManager, DiagAPI.instance());
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Get the currently active context
|
|
854
|
+
*/
|
|
855
|
+
active() {
|
|
856
|
+
return this._getContextManager().active();
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Execute a function with an active context
|
|
860
|
+
*
|
|
861
|
+
* @param context context to be active during function execution
|
|
862
|
+
* @param fn function to execute in a context
|
|
863
|
+
* @param thisArg optional receiver to be used for calling fn
|
|
864
|
+
* @param args optional arguments forwarded to fn
|
|
865
|
+
*/
|
|
866
|
+
with(context, fn, thisArg, ...args) {
|
|
867
|
+
return this._getContextManager().with(context, fn, thisArg, ...args);
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Bind a context to a target function or event emitter
|
|
871
|
+
*
|
|
872
|
+
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
873
|
+
* @param target function or event emitter to bind
|
|
874
|
+
*/
|
|
875
|
+
bind(context, target) {
|
|
876
|
+
return this._getContextManager().bind(context, target);
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* Imperatively sets `context` as active, returning a {@link ContextManagementToken} whose
|
|
880
|
+
* {@link ContextManagementToken.dispose} restores the previous context.
|
|
881
|
+
*
|
|
882
|
+
* This is a delicate, low-level API - prefer {@link with}/{@link bind}, which
|
|
883
|
+
* restore context automatically. Use `attach` only to bridge callback
|
|
884
|
+
* boundaries that `with` cannot wrap. Call `token.dispose()` when the
|
|
885
|
+
* operation is done.
|
|
886
|
+
*
|
|
887
|
+
* **Caveat for async functions:** If called inside an async function before
|
|
888
|
+
* the first `await`, the context change may leak into the caller's context
|
|
889
|
+
* and remain active there. Prefer {@link with} for async code.
|
|
890
|
+
*
|
|
891
|
+
* Support is best-effort and varies by the active ContextManager (see
|
|
892
|
+
* {@link ContextManager.attach}); if it does not implement `attach`, this logs
|
|
893
|
+
* a warning and returns a no-op token.
|
|
894
|
+
*
|
|
895
|
+
* @param context The Context to attach
|
|
896
|
+
* @returns A {@link ContextManagementToken} whose dispose() restores the previous Context
|
|
897
|
+
* @since 1.10.0
|
|
898
|
+
* @experimental This API is experimental and may change in minor releases without prior notice.
|
|
899
|
+
*/
|
|
900
|
+
attach(context) {
|
|
901
|
+
const contextManager = this._getContextManager();
|
|
902
|
+
if (contextManager.attach) return contextManager.attach(context);
|
|
903
|
+
if (!this._attachUnsupportedWarned) {
|
|
904
|
+
this._attachUnsupportedWarned = true;
|
|
905
|
+
DiagAPI.instance().warn("The current ContextManager does not implement attach(). The context will not be attached. Use a ContextManager that supports attach() (e.g. AsyncLocalStorageContextManager) or use with()/bind() instead.");
|
|
906
|
+
}
|
|
907
|
+
return NOOP_TOKEN;
|
|
908
|
+
}
|
|
909
|
+
_getContextManager() {
|
|
910
|
+
return getGlobal(API_NAME$4) || NOOP_CONTEXT_MANAGER;
|
|
911
|
+
}
|
|
912
|
+
/** Disable and remove the global context manager */
|
|
913
|
+
disable() {
|
|
914
|
+
this._getContextManager().disable();
|
|
915
|
+
unregisterGlobal(API_NAME$4, DiagAPI.instance());
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/context-utils.mjs
|
|
919
|
+
/**
|
|
920
|
+
* span key
|
|
921
|
+
*/
|
|
922
|
+
var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
923
|
+
/**
|
|
924
|
+
* Return the span if one exists
|
|
925
|
+
*
|
|
926
|
+
* @param context context to get span from
|
|
927
|
+
*/
|
|
928
|
+
function getSpan(context) {
|
|
929
|
+
return context.getValue(SPAN_KEY) || void 0;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Gets the span from the current context, if one exists.
|
|
933
|
+
*/
|
|
934
|
+
function getActiveSpan() {
|
|
935
|
+
return getSpan(ContextAPI.getInstance().active());
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Set the span on a context
|
|
939
|
+
*
|
|
940
|
+
* @param context context to use as parent
|
|
941
|
+
* @param span span to set active
|
|
942
|
+
*/
|
|
943
|
+
function setSpan(context, span) {
|
|
944
|
+
return context.setValue(SPAN_KEY, span);
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Remove current span stored in the context
|
|
948
|
+
*
|
|
949
|
+
* @param context context to delete span from
|
|
950
|
+
*/
|
|
951
|
+
function deleteSpan(context) {
|
|
952
|
+
return context.deleteValue(SPAN_KEY);
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Wrap span context in a NoopSpan and set as span in a new
|
|
956
|
+
* context
|
|
957
|
+
*
|
|
958
|
+
* @param context context to set active span on
|
|
959
|
+
* @param spanContext span context to be wrapped
|
|
960
|
+
*/
|
|
961
|
+
function setSpanContext(context, spanContext) {
|
|
962
|
+
return setSpan(context, new NonRecordingSpan(spanContext));
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Get the span context of the span if it exists.
|
|
966
|
+
*
|
|
967
|
+
* @param context context to get values from
|
|
968
|
+
*/
|
|
969
|
+
function getSpanContext(context) {
|
|
970
|
+
var _getSpan;
|
|
971
|
+
return (_getSpan = getSpan(context)) === null || _getSpan === void 0 ? void 0 : _getSpan.spanContext();
|
|
972
|
+
}
|
|
973
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/NoopTracer.mjs
|
|
974
|
+
var contextApi = ContextAPI.getInstance();
|
|
975
|
+
/**
|
|
976
|
+
* No-op implementations of {@link Tracer}.
|
|
977
|
+
*/
|
|
978
|
+
var NoopTracer = class {
|
|
979
|
+
startSpan(name, options, context = contextApi.active()) {
|
|
980
|
+
if (Boolean(options === null || options === void 0 ? void 0 : options.root)) return new NonRecordingSpan();
|
|
981
|
+
const parentFromContext = context && getSpanContext(context);
|
|
982
|
+
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) return new NonRecordingSpan(parentFromContext);
|
|
983
|
+
else return new NonRecordingSpan();
|
|
984
|
+
}
|
|
985
|
+
startActiveSpan(name, arg2, arg3, arg4) {
|
|
986
|
+
var _ctx;
|
|
987
|
+
let opts;
|
|
988
|
+
let ctx;
|
|
989
|
+
let fn;
|
|
990
|
+
if (arguments.length < 2) return;
|
|
991
|
+
else if (arguments.length === 2) fn = arg2;
|
|
992
|
+
else if (arguments.length === 3) {
|
|
993
|
+
opts = arg2;
|
|
994
|
+
fn = arg3;
|
|
995
|
+
} else {
|
|
996
|
+
opts = arg2;
|
|
997
|
+
ctx = arg3;
|
|
998
|
+
fn = arg4;
|
|
999
|
+
}
|
|
1000
|
+
const parentContext = (_ctx = ctx) !== null && _ctx !== void 0 ? _ctx : contextApi.active();
|
|
1001
|
+
const span = this.startSpan(name, opts, parentContext);
|
|
1002
|
+
const contextWithSpanSet = setSpan(parentContext, span);
|
|
1003
|
+
return contextApi.with(contextWithSpanSet, fn, void 0, span);
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
function isSpanContext(spanContext) {
|
|
1007
|
+
return spanContext !== null && typeof spanContext === "object" && "spanId" in spanContext && typeof spanContext["spanId"] === "string" && "traceId" in spanContext && typeof spanContext["traceId"] === "string" && "traceFlags" in spanContext && typeof spanContext["traceFlags"] === "number";
|
|
1008
|
+
}
|
|
1009
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/ProxyTracer.mjs
|
|
1010
|
+
var NOOP_TRACER = new NoopTracer();
|
|
1011
|
+
/**
|
|
1012
|
+
* Proxy tracer provided by the proxy tracer provider
|
|
1013
|
+
*
|
|
1014
|
+
* @since 1.0.0
|
|
1015
|
+
*/
|
|
1016
|
+
var ProxyTracer = class {
|
|
1017
|
+
constructor(provider, name, version, options) {
|
|
1018
|
+
this._provider = provider;
|
|
1019
|
+
this.name = name;
|
|
1020
|
+
this.version = version;
|
|
1021
|
+
this.options = options;
|
|
1022
|
+
}
|
|
1023
|
+
startSpan(name, options, context) {
|
|
1024
|
+
return this._getTracer().startSpan(name, options, context);
|
|
1025
|
+
}
|
|
1026
|
+
startActiveSpan(_name, _options, _context, _fn) {
|
|
1027
|
+
const tracer = this._getTracer();
|
|
1028
|
+
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Try to get a tracer from the proxy tracer provider.
|
|
1032
|
+
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
1033
|
+
*/
|
|
1034
|
+
_getTracer() {
|
|
1035
|
+
if (this._delegate) return this._delegate;
|
|
1036
|
+
const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
1037
|
+
if (!tracer) return NOOP_TRACER;
|
|
1038
|
+
this._delegate = tracer;
|
|
1039
|
+
return this._delegate;
|
|
1040
|
+
}
|
|
1041
|
+
};
|
|
1042
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/span_kind.mjs
|
|
1043
|
+
/**
|
|
1044
|
+
* @since 1.0.0
|
|
1045
|
+
*/
|
|
1046
|
+
var SpanKind = /* @__PURE__ */ function(SpanKind) {
|
|
1047
|
+
/** Default value. Indicates that the span is used internally. */
|
|
1048
|
+
SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL";
|
|
1049
|
+
/**
|
|
1050
|
+
* Indicates that the span covers server-side handling of an RPC or other
|
|
1051
|
+
* remote request.
|
|
1052
|
+
*/
|
|
1053
|
+
SpanKind[SpanKind["SERVER"] = 1] = "SERVER";
|
|
1054
|
+
/**
|
|
1055
|
+
* Indicates that the span covers the client-side wrapper around an RPC or
|
|
1056
|
+
* other remote request.
|
|
1057
|
+
*/
|
|
1058
|
+
SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT";
|
|
1059
|
+
/**
|
|
1060
|
+
* Indicates that the span describes producer sending a message to a
|
|
1061
|
+
* broker. Unlike client and server, there is no direct critical path latency
|
|
1062
|
+
* relationship between producer and consumer spans.
|
|
1063
|
+
*/
|
|
1064
|
+
SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER";
|
|
1065
|
+
/**
|
|
1066
|
+
* Indicates that the span describes consumer receiving a message from a
|
|
1067
|
+
* broker. Unlike client and server, there is no direct critical path latency
|
|
1068
|
+
* relationship between producer and consumer spans.
|
|
1069
|
+
*/
|
|
1070
|
+
SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER";
|
|
1071
|
+
return SpanKind;
|
|
1072
|
+
}({});
|
|
1073
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/status.mjs
|
|
1074
|
+
/**
|
|
1075
|
+
* An enumeration of status codes.
|
|
1076
|
+
*
|
|
1077
|
+
* @since 1.0.0
|
|
1078
|
+
*/
|
|
1079
|
+
var SpanStatusCode = /* @__PURE__ */ function(SpanStatusCode) {
|
|
1080
|
+
/**
|
|
1081
|
+
* The default status.
|
|
1082
|
+
*/
|
|
1083
|
+
SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET";
|
|
1084
|
+
/**
|
|
1085
|
+
* The operation has been validated by an Application developer or
|
|
1086
|
+
* Operator to have completed successfully.
|
|
1087
|
+
*/
|
|
1088
|
+
SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK";
|
|
1089
|
+
/**
|
|
1090
|
+
* The operation contains an error.
|
|
1091
|
+
*/
|
|
1092
|
+
SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR";
|
|
1093
|
+
return SpanStatusCode;
|
|
1094
|
+
}({});
|
|
1095
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/internal/tracestate-validators.mjs
|
|
1096
|
+
var VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]";
|
|
1097
|
+
var VALID_KEY_REGEX = new RegExp(`^(?:${`[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`}|${`[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`})$`);
|
|
1098
|
+
var VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
|
|
1099
|
+
var INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
|
|
1100
|
+
/**
|
|
1101
|
+
* Key is opaque string up to 256 characters printable. It MUST begin with a
|
|
1102
|
+
* lowercase letter, and can only contain lowercase letters a-z, digits 0-9,
|
|
1103
|
+
* underscores _, dashes -, asterisks *, and forward slashes /.
|
|
1104
|
+
* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the
|
|
1105
|
+
* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.
|
|
1106
|
+
* see https://www.w3.org/TR/trace-context/#key
|
|
1107
|
+
*/
|
|
1108
|
+
function validateKey(key) {
|
|
1109
|
+
return VALID_KEY_REGEX.test(key);
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Value is opaque string up to 256 characters printable ASCII RFC0020
|
|
1113
|
+
* characters (i.e., the range 0x20 to 0x7E) except comma , and =.
|
|
1114
|
+
*/
|
|
1115
|
+
function validateValue(value) {
|
|
1116
|
+
return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value);
|
|
1117
|
+
}
|
|
1118
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/internal/tracestate-impl.mjs
|
|
1119
|
+
var MAX_TRACE_STATE_ITEMS = 32;
|
|
1120
|
+
var MAX_TRACE_STATE_LEN = 512;
|
|
1121
|
+
var LIST_MEMBERS_SEPARATOR = ",";
|
|
1122
|
+
var LIST_MEMBER_KEY_VALUE_SPLITTER = "=";
|
|
1123
|
+
/**
|
|
1124
|
+
* TraceState must be a class and not a simple object type because of the spec
|
|
1125
|
+
* requirement (https://www.w3.org/TR/trace-context/#tracestate-field).
|
|
1126
|
+
*
|
|
1127
|
+
* Here is the list of allowed mutations:
|
|
1128
|
+
* - New key-value pair should be added into the beginning of the list
|
|
1129
|
+
* - The value of any key can be updated. Modified keys MUST be moved to the
|
|
1130
|
+
* beginning of the list.
|
|
1131
|
+
*
|
|
1132
|
+
* @deprecated Use TraceState from "@opentelemetry/core". This will be removed in the next major version.
|
|
1133
|
+
*/
|
|
1134
|
+
var TraceStateImpl = class TraceStateImpl {
|
|
1135
|
+
constructor(rawTraceState) {
|
|
1136
|
+
this._internalState = /* @__PURE__ */ new Map();
|
|
1137
|
+
if (rawTraceState) this._parse(rawTraceState);
|
|
1138
|
+
}
|
|
1139
|
+
set(key, value) {
|
|
1140
|
+
const currValue = this._internalState.get(key);
|
|
1141
|
+
let newLength = this.serialize().length;
|
|
1142
|
+
if (typeof currValue === "string") newLength += value.length - currValue.length;
|
|
1143
|
+
else {
|
|
1144
|
+
if (this._internalState.size >= MAX_TRACE_STATE_ITEMS) return this;
|
|
1145
|
+
newLength += key.length + value.length + (this._internalState.size > 0 ? 2 : 1);
|
|
1146
|
+
}
|
|
1147
|
+
if (newLength > MAX_TRACE_STATE_LEN) return this;
|
|
1148
|
+
const traceState = this._clone();
|
|
1149
|
+
if (traceState._internalState.has(key)) traceState._internalState.delete(key);
|
|
1150
|
+
traceState._internalState.set(key, value);
|
|
1151
|
+
return traceState;
|
|
1152
|
+
}
|
|
1153
|
+
unset(key) {
|
|
1154
|
+
const traceState = this._clone();
|
|
1155
|
+
traceState._internalState.delete(key);
|
|
1156
|
+
return traceState;
|
|
1157
|
+
}
|
|
1158
|
+
get(key) {
|
|
1159
|
+
return this._internalState.get(key);
|
|
1160
|
+
}
|
|
1161
|
+
serialize() {
|
|
1162
|
+
return Array.from(this._internalState.keys()).reduceRight((agg, key) => {
|
|
1163
|
+
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));
|
|
1164
|
+
return agg;
|
|
1165
|
+
}, []).join(LIST_MEMBERS_SEPARATOR);
|
|
1166
|
+
}
|
|
1167
|
+
_parse(rawTraceState) {
|
|
1168
|
+
if (rawTraceState.length > MAX_TRACE_STATE_LEN) return;
|
|
1169
|
+
this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reduceRight((agg, part) => {
|
|
1170
|
+
const listMember = part.trim();
|
|
1171
|
+
const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
|
|
1172
|
+
if (i !== -1) {
|
|
1173
|
+
const key = listMember.slice(0, i);
|
|
1174
|
+
const value = listMember.slice(i + 1, part.length);
|
|
1175
|
+
if (validateKey(key) && validateValue(value)) agg.set(key, value);
|
|
1176
|
+
}
|
|
1177
|
+
return agg;
|
|
1178
|
+
}, /* @__PURE__ */ new Map());
|
|
1179
|
+
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS));
|
|
1180
|
+
}
|
|
1181
|
+
_keys() {
|
|
1182
|
+
return Array.from(this._internalState.keys()).reverse();
|
|
1183
|
+
}
|
|
1184
|
+
_clone() {
|
|
1185
|
+
const traceState = new TraceStateImpl();
|
|
1186
|
+
traceState._internalState = new Map(this._internalState);
|
|
1187
|
+
return traceState;
|
|
1188
|
+
}
|
|
1189
|
+
};
|
|
1190
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/internal/utils.mjs
|
|
1191
|
+
/**
|
|
1192
|
+
* @deprecated Use TraceState from "@opentelemetry/core". This will be removed in the next major version.
|
|
1193
|
+
* @since 1.1.0
|
|
1194
|
+
*/
|
|
1195
|
+
function createTraceState(rawTraceState) {
|
|
1196
|
+
return new TraceStateImpl(rawTraceState);
|
|
1197
|
+
}
|
|
1198
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/NoopTracerProvider.mjs
|
|
1199
|
+
/**
|
|
1200
|
+
* An implementation of the {@link TracerProvider} which returns an impotent
|
|
1201
|
+
* Tracer for all calls to `getTracer`.
|
|
1202
|
+
*
|
|
1203
|
+
* All operations are no-op.
|
|
1204
|
+
*/
|
|
1205
|
+
var NoopTracerProvider = class {
|
|
1206
|
+
getTracer(_name, _version, _options) {
|
|
1207
|
+
return new NoopTracer();
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/ProxyTracerProvider.mjs
|
|
1211
|
+
var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
1212
|
+
/**
|
|
1213
|
+
* Tracer provider which provides {@link ProxyTracer}s.
|
|
1214
|
+
*
|
|
1215
|
+
* Before a delegate is set, tracers provided are NoOp.
|
|
1216
|
+
* When a delegate is set, traces are provided from the delegate.
|
|
1217
|
+
* When a delegate is set after tracers have already been provided,
|
|
1218
|
+
* all tracers already provided will use the provided delegate implementation.
|
|
1219
|
+
*
|
|
1220
|
+
* @deprecated This will be removed in the next major version.
|
|
1221
|
+
* @since 1.0.0
|
|
1222
|
+
*/
|
|
1223
|
+
var ProxyTracerProvider = class {
|
|
1224
|
+
/**
|
|
1225
|
+
* Get a {@link ProxyTracer}
|
|
1226
|
+
*/
|
|
1227
|
+
getTracer(name, version, options) {
|
|
1228
|
+
var _this$getDelegateTrac;
|
|
1229
|
+
return (_this$getDelegateTrac = this.getDelegateTracer(name, version, options)) !== null && _this$getDelegateTrac !== void 0 ? _this$getDelegateTrac : new ProxyTracer(this, name, version, options);
|
|
1230
|
+
}
|
|
1231
|
+
getDelegate() {
|
|
1232
|
+
var _this$_delegate;
|
|
1233
|
+
return (_this$_delegate = this._delegate) !== null && _this$_delegate !== void 0 ? _this$_delegate : NOOP_TRACER_PROVIDER;
|
|
1234
|
+
}
|
|
1235
|
+
/**
|
|
1236
|
+
* Set the delegate tracer provider
|
|
1237
|
+
*/
|
|
1238
|
+
setDelegate(delegate) {
|
|
1239
|
+
this._delegate = delegate;
|
|
1240
|
+
}
|
|
1241
|
+
getDelegateTracer(name, version, options) {
|
|
1242
|
+
var _this$_delegate2;
|
|
1243
|
+
return (_this$_delegate2 = this._delegate) === null || _this$_delegate2 === void 0 ? void 0 : _this$_delegate2.getTracer(name, version, options);
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace/SamplingResult.mjs
|
|
1247
|
+
/**
|
|
1248
|
+
* @deprecated use the one declared in @opentelemetry/sdk-trace instead.
|
|
1249
|
+
* A sampling decision that determines how a {@link Span} will be recorded
|
|
1250
|
+
* and collected.
|
|
1251
|
+
*
|
|
1252
|
+
* @since 1.0.0
|
|
1253
|
+
*/
|
|
1254
|
+
var SamplingDecision = /* @__PURE__ */ function(SamplingDecision) {
|
|
1255
|
+
/**
|
|
1256
|
+
* `Span.isRecording() === false`, span will not be recorded and all events
|
|
1257
|
+
* and attributes will be dropped.
|
|
1258
|
+
*/
|
|
1259
|
+
SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD";
|
|
1260
|
+
/**
|
|
1261
|
+
* `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}
|
|
1262
|
+
* MUST NOT be set.
|
|
1263
|
+
*/
|
|
1264
|
+
SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD";
|
|
1265
|
+
/**
|
|
1266
|
+
* `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}
|
|
1267
|
+
* MUST be set.
|
|
1268
|
+
*/
|
|
1269
|
+
SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED";
|
|
1270
|
+
return SamplingDecision;
|
|
1271
|
+
}({});
|
|
1272
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/context-api.mjs
|
|
1273
|
+
/**
|
|
1274
|
+
* Entrypoint for context API
|
|
1275
|
+
* @since 1.0.0
|
|
1276
|
+
*/
|
|
1277
|
+
var context = ContextAPI.getInstance();
|
|
1278
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/diag-api.mjs
|
|
1279
|
+
/**
|
|
1280
|
+
* Entrypoint for Diag API.
|
|
1281
|
+
* Defines Diagnostic handler used for internal diagnostic logging operations.
|
|
1282
|
+
* The default provides a Noop DiagLogger implementation which may be changed via the
|
|
1283
|
+
* diag.setLogger(logger: DiagLogger) function.
|
|
1284
|
+
*
|
|
1285
|
+
* @since 1.0.0
|
|
1286
|
+
*/
|
|
1287
|
+
var diag = DiagAPI.instance();
|
|
1288
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/logs/NoopLoggerProvider.mjs
|
|
1289
|
+
var NoopLoggerProvider = class {
|
|
1290
|
+
getLogger(_name, _version, _options) {
|
|
1291
|
+
return new NoopLogger();
|
|
1292
|
+
}
|
|
1293
|
+
};
|
|
1294
|
+
var NOOP_LOGGER_PROVIDER = new NoopLoggerProvider();
|
|
1295
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/logs/ProxyLogger.mjs
|
|
1296
|
+
var ProxyLogger = class {
|
|
1297
|
+
constructor(provider, name, version, options) {
|
|
1298
|
+
this._provider = provider;
|
|
1299
|
+
this.name = name;
|
|
1300
|
+
this.version = version;
|
|
1301
|
+
this.options = options;
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Emit a log record. This method should only be used by log appenders.
|
|
1305
|
+
*
|
|
1306
|
+
* @param logRecord
|
|
1307
|
+
*/
|
|
1308
|
+
emit(logRecord) {
|
|
1309
|
+
this._getLogger().emit(logRecord);
|
|
1310
|
+
}
|
|
1311
|
+
enabled(options) {
|
|
1312
|
+
return this._getLogger().enabled(options);
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Try to get a logger from the proxy logger provider.
|
|
1316
|
+
* If the proxy logger provider has no delegate, return a noop logger.
|
|
1317
|
+
*/
|
|
1318
|
+
_getLogger() {
|
|
1319
|
+
if (this._delegate) return this._delegate;
|
|
1320
|
+
const logger = this._provider._getDelegateLogger(this.name, this.version, this.options);
|
|
1321
|
+
if (!logger) return NOOP_LOGGER;
|
|
1322
|
+
this._delegate = logger;
|
|
1323
|
+
return this._delegate;
|
|
1324
|
+
}
|
|
1325
|
+
};
|
|
1326
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/logs/ProxyLoggerProvider.mjs
|
|
1327
|
+
var ProxyLoggerProvider = class {
|
|
1328
|
+
getLogger(name, version, options) {
|
|
1329
|
+
var _this$_getDelegateLog;
|
|
1330
|
+
return (_this$_getDelegateLog = this._getDelegateLogger(name, version, options)) !== null && _this$_getDelegateLog !== void 0 ? _this$_getDelegateLog : new ProxyLogger(this, name, version, options);
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Get the delegate logger provider.
|
|
1334
|
+
* Used by tests only.
|
|
1335
|
+
* @internal
|
|
1336
|
+
*/
|
|
1337
|
+
_getDelegate() {
|
|
1338
|
+
var _this$_delegate;
|
|
1339
|
+
return (_this$_delegate = this._delegate) !== null && _this$_delegate !== void 0 ? _this$_delegate : NOOP_LOGGER_PROVIDER;
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Set the delegate logger provider
|
|
1343
|
+
* @internal
|
|
1344
|
+
*/
|
|
1345
|
+
_setDelegate(delegate) {
|
|
1346
|
+
this._delegate = delegate;
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* @internal
|
|
1350
|
+
*/
|
|
1351
|
+
_getDelegateLogger(name, version, options) {
|
|
1352
|
+
var _this$_delegate2;
|
|
1353
|
+
return (_this$_delegate2 = this._delegate) === null || _this$_delegate2 === void 0 ? void 0 : _this$_delegate2.getLogger(name, version, options);
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1356
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/api/logs.mjs
|
|
1357
|
+
var API_NAME$3 = "logs";
|
|
1358
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/logs-api.mjs
|
|
1359
|
+
/**
|
|
1360
|
+
* Entrypoint for logs API
|
|
1361
|
+
*
|
|
1362
|
+
* @since 1.10.0
|
|
1363
|
+
*/
|
|
1364
|
+
var logs = class LogsAPI {
|
|
1365
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
1366
|
+
constructor() {
|
|
1367
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider();
|
|
1368
|
+
}
|
|
1369
|
+
/** Get the singleton instance of the Logs API */
|
|
1370
|
+
static getInstance() {
|
|
1371
|
+
if (!this._instance) this._instance = new LogsAPI();
|
|
1372
|
+
return this._instance;
|
|
1373
|
+
}
|
|
1374
|
+
setGlobalLoggerProvider(provider) {
|
|
1375
|
+
const success = registerGlobal(API_NAME$3, provider, DiagAPI.instance());
|
|
1376
|
+
if (success) this._proxyLoggerProvider._setDelegate(provider);
|
|
1377
|
+
return success;
|
|
1378
|
+
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Returns the global logger provider.
|
|
1381
|
+
*
|
|
1382
|
+
* @returns LoggerProvider
|
|
1383
|
+
*/
|
|
1384
|
+
getLoggerProvider() {
|
|
1385
|
+
return getGlobal(API_NAME$3) || this._proxyLoggerProvider;
|
|
1386
|
+
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Returns a Logger, creating one if one with the given name, version,
|
|
1389
|
+
* schemaUrl, and attributes is not already created.
|
|
1390
|
+
*
|
|
1391
|
+
* Getting a Logger may be expensive, especially when `attributes` are
|
|
1392
|
+
* provided. Reuse Logger instances where possible instead of calling
|
|
1393
|
+
* `getLogger()` on hot paths.
|
|
1394
|
+
*
|
|
1395
|
+
* @param name The name of the logger or instrumentation library.
|
|
1396
|
+
* @param version The version of the logger or instrumentation library.
|
|
1397
|
+
* @param options The options of the logger or instrumentation library.
|
|
1398
|
+
* @returns {@link Logger}
|
|
1399
|
+
*/
|
|
1400
|
+
getLogger(name, version, options) {
|
|
1401
|
+
return this.getLoggerProvider().getLogger(name, version, options);
|
|
1402
|
+
}
|
|
1403
|
+
/** Remove the global logger provider */
|
|
1404
|
+
disable() {
|
|
1405
|
+
unregisterGlobal(API_NAME$3, DiagAPI.instance());
|
|
1406
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider();
|
|
1407
|
+
}
|
|
1408
|
+
}.getInstance();
|
|
1409
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/metrics/NoopMeterProvider.mjs
|
|
1410
|
+
/**
|
|
1411
|
+
* An implementation of the {@link MeterProvider} which returns an impotent Meter
|
|
1412
|
+
* for all calls to `getMeter`
|
|
1413
|
+
*/
|
|
1414
|
+
var NoopMeterProvider = class {
|
|
1415
|
+
getMeter(_name, _version, _options) {
|
|
1416
|
+
return NOOP_METER;
|
|
1417
|
+
}
|
|
1418
|
+
};
|
|
1419
|
+
var NOOP_METER_PROVIDER = new NoopMeterProvider();
|
|
1420
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/api/metrics.mjs
|
|
1421
|
+
var API_NAME$2 = "metrics";
|
|
1422
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/metrics-api.mjs
|
|
1423
|
+
/**
|
|
1424
|
+
* Entrypoint for metrics API
|
|
1425
|
+
*
|
|
1426
|
+
* @since 1.3.0
|
|
1427
|
+
*/
|
|
1428
|
+
var metrics = class MetricsAPI {
|
|
1429
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
1430
|
+
constructor() {}
|
|
1431
|
+
/** Get the singleton instance of the Metrics API */
|
|
1432
|
+
static getInstance() {
|
|
1433
|
+
if (!this._instance) this._instance = new MetricsAPI();
|
|
1434
|
+
return this._instance;
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* Set the current global meter provider.
|
|
1438
|
+
* Returns true if the meter provider was successfully registered, else false.
|
|
1439
|
+
*/
|
|
1440
|
+
setGlobalMeterProvider(provider) {
|
|
1441
|
+
return registerGlobal(API_NAME$2, provider, DiagAPI.instance());
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Returns the global meter provider.
|
|
1445
|
+
*/
|
|
1446
|
+
getMeterProvider() {
|
|
1447
|
+
return getGlobal(API_NAME$2) || NOOP_METER_PROVIDER;
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Returns a meter from the global meter provider.
|
|
1451
|
+
*/
|
|
1452
|
+
getMeter(name, version, options) {
|
|
1453
|
+
return this.getMeterProvider().getMeter(name, version, options);
|
|
1454
|
+
}
|
|
1455
|
+
/** Remove the global meter provider */
|
|
1456
|
+
disable() {
|
|
1457
|
+
unregisterGlobal(API_NAME$2, DiagAPI.instance());
|
|
1458
|
+
}
|
|
1459
|
+
}.getInstance();
|
|
1460
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/propagation/NoopTextMapPropagator.mjs
|
|
1461
|
+
/**
|
|
1462
|
+
* No-op implementations of {@link TextMapPropagator}.
|
|
1463
|
+
*/
|
|
1464
|
+
var NoopTextMapPropagator = class {
|
|
1465
|
+
/** Noop inject function does nothing */
|
|
1466
|
+
inject(_context, _carrier) {}
|
|
1467
|
+
/** Noop extract function does nothing and returns the input context */
|
|
1468
|
+
extract(context, _carrier) {
|
|
1469
|
+
return context;
|
|
1470
|
+
}
|
|
1471
|
+
fields() {
|
|
1472
|
+
return [];
|
|
1473
|
+
}
|
|
1474
|
+
};
|
|
1475
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/baggage/context-helpers.mjs
|
|
1476
|
+
/**
|
|
1477
|
+
* Baggage key
|
|
1478
|
+
*/
|
|
1479
|
+
var BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key");
|
|
1480
|
+
/**
|
|
1481
|
+
* Retrieve the current baggage from the given context
|
|
1482
|
+
*
|
|
1483
|
+
* @param {Context} Context that manage all context values
|
|
1484
|
+
* @returns {Baggage} Extracted baggage from the context
|
|
1485
|
+
*/
|
|
1486
|
+
function getBaggage(context) {
|
|
1487
|
+
return context.getValue(BAGGAGE_KEY) || void 0;
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Retrieve the current baggage from the active/current context
|
|
1491
|
+
*
|
|
1492
|
+
* @returns {Baggage} Extracted baggage from the context
|
|
1493
|
+
*/
|
|
1494
|
+
function getActiveBaggage() {
|
|
1495
|
+
return getBaggage(ContextAPI.getInstance().active());
|
|
1496
|
+
}
|
|
1497
|
+
/**
|
|
1498
|
+
* Store a baggage in the given context
|
|
1499
|
+
*
|
|
1500
|
+
* @param {Context} Context that manage all context values
|
|
1501
|
+
* @param {Baggage} baggage that will be set in the actual context
|
|
1502
|
+
*/
|
|
1503
|
+
function setBaggage(context, baggage) {
|
|
1504
|
+
return context.setValue(BAGGAGE_KEY, baggage);
|
|
1505
|
+
}
|
|
1506
|
+
/**
|
|
1507
|
+
* Delete the baggage stored in the given context
|
|
1508
|
+
*
|
|
1509
|
+
* @param {Context} Context that manage all context values
|
|
1510
|
+
*/
|
|
1511
|
+
function deleteBaggage(context) {
|
|
1512
|
+
return context.deleteValue(BAGGAGE_KEY);
|
|
1513
|
+
}
|
|
1514
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/api/propagation.mjs
|
|
1515
|
+
var API_NAME$1 = "propagation";
|
|
1516
|
+
var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
|
|
1517
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/propagation-api.mjs
|
|
1518
|
+
/**
|
|
1519
|
+
* Entrypoint for propagation API
|
|
1520
|
+
*
|
|
1521
|
+
* @since 1.0.0
|
|
1522
|
+
*/
|
|
1523
|
+
var propagation = class PropagationAPI {
|
|
1524
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
1525
|
+
constructor() {
|
|
1526
|
+
this.createBaggage = createBaggage;
|
|
1527
|
+
this.getBaggage = getBaggage;
|
|
1528
|
+
this.getActiveBaggage = getActiveBaggage;
|
|
1529
|
+
this.setBaggage = setBaggage;
|
|
1530
|
+
this.deleteBaggage = deleteBaggage;
|
|
1531
|
+
}
|
|
1532
|
+
/** Get the singleton instance of the Propagator API */
|
|
1533
|
+
static getInstance() {
|
|
1534
|
+
if (!this._instance) this._instance = new PropagationAPI();
|
|
1535
|
+
return this._instance;
|
|
1536
|
+
}
|
|
1537
|
+
/**
|
|
1538
|
+
* Set the current propagator.
|
|
1539
|
+
*
|
|
1540
|
+
* @returns true if the propagator was successfully registered, else false
|
|
1541
|
+
*/
|
|
1542
|
+
setGlobalPropagator(propagator) {
|
|
1543
|
+
return registerGlobal(API_NAME$1, propagator, DiagAPI.instance());
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* Inject context into a carrier to be propagated inter-process
|
|
1547
|
+
*
|
|
1548
|
+
* @param context Context carrying tracing data to inject
|
|
1549
|
+
* @param carrier carrier to inject context into
|
|
1550
|
+
* @param setter Function used to set values on the carrier
|
|
1551
|
+
*/
|
|
1552
|
+
inject(context, carrier, setter = defaultTextMapSetter) {
|
|
1553
|
+
return this._getGlobalPropagator().inject(context, carrier, setter);
|
|
1554
|
+
}
|
|
1555
|
+
/**
|
|
1556
|
+
* Extract context from a carrier
|
|
1557
|
+
*
|
|
1558
|
+
* @param context Context which the newly created context will inherit from
|
|
1559
|
+
* @param carrier Carrier to extract context from
|
|
1560
|
+
* @param getter Function used to extract keys from a carrier
|
|
1561
|
+
*/
|
|
1562
|
+
extract(context, carrier, getter = defaultTextMapGetter) {
|
|
1563
|
+
return this._getGlobalPropagator().extract(context, carrier, getter);
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* Return a list of all fields which may be used by the propagator.
|
|
1567
|
+
*/
|
|
1568
|
+
fields() {
|
|
1569
|
+
return this._getGlobalPropagator().fields();
|
|
1570
|
+
}
|
|
1571
|
+
/** Remove the global propagator */
|
|
1572
|
+
disable() {
|
|
1573
|
+
unregisterGlobal(API_NAME$1, DiagAPI.instance());
|
|
1574
|
+
}
|
|
1575
|
+
_getGlobalPropagator() {
|
|
1576
|
+
return getGlobal(API_NAME$1) || NOOP_TEXT_MAP_PROPAGATOR;
|
|
1577
|
+
}
|
|
1578
|
+
}.getInstance();
|
|
1579
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/api/trace.mjs
|
|
1580
|
+
var API_NAME = "trace";
|
|
1581
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/trace-api.mjs
|
|
1582
|
+
/**
|
|
1583
|
+
* Entrypoint for trace API
|
|
1584
|
+
*
|
|
1585
|
+
* @since 1.0.0
|
|
1586
|
+
*/
|
|
1587
|
+
var trace = class TraceAPI {
|
|
1588
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
1589
|
+
constructor() {
|
|
1590
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
1591
|
+
this.wrapSpanContext = wrapSpanContext;
|
|
1592
|
+
this.isSpanContextValid = isSpanContextValid;
|
|
1593
|
+
this.deleteSpan = deleteSpan;
|
|
1594
|
+
this.getSpan = getSpan;
|
|
1595
|
+
this.getActiveSpan = getActiveSpan;
|
|
1596
|
+
this.getSpanContext = getSpanContext;
|
|
1597
|
+
this.setSpan = setSpan;
|
|
1598
|
+
this.setSpanContext = setSpanContext;
|
|
1599
|
+
}
|
|
1600
|
+
/** Get the singleton instance of the Trace API */
|
|
1601
|
+
static getInstance() {
|
|
1602
|
+
if (!this._instance) this._instance = new TraceAPI();
|
|
1603
|
+
return this._instance;
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Set the current global tracer.
|
|
1607
|
+
*
|
|
1608
|
+
* @returns true if the tracer provider was successfully registered, else false
|
|
1609
|
+
*/
|
|
1610
|
+
setGlobalTracerProvider(provider) {
|
|
1611
|
+
const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());
|
|
1612
|
+
if (success) this._proxyTracerProvider.setDelegate(provider);
|
|
1613
|
+
return success;
|
|
1614
|
+
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Returns the global tracer provider.
|
|
1617
|
+
*/
|
|
1618
|
+
getTracerProvider() {
|
|
1619
|
+
return getGlobal(API_NAME) || this._proxyTracerProvider;
|
|
1620
|
+
}
|
|
1621
|
+
/**
|
|
1622
|
+
* Returns a tracer from the global tracer provider.
|
|
1623
|
+
*/
|
|
1624
|
+
getTracer(name, version) {
|
|
1625
|
+
return this.getTracerProvider().getTracer(name, version);
|
|
1626
|
+
}
|
|
1627
|
+
/** Remove the global tracer provider */
|
|
1628
|
+
disable() {
|
|
1629
|
+
unregisterGlobal(API_NAME, DiagAPI.instance());
|
|
1630
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
1631
|
+
}
|
|
1632
|
+
}.getInstance();
|
|
1633
|
+
// ../../node_modules/.bun/@opentelemetry+api@1.10.0/node_modules/@opentelemetry/api/dist/index.mjs
|
|
1634
|
+
var src_default = {
|
|
1635
|
+
context,
|
|
1636
|
+
diag,
|
|
1637
|
+
logs,
|
|
1638
|
+
metrics,
|
|
1639
|
+
propagation,
|
|
1640
|
+
trace
|
|
1641
|
+
};
|
|
1642
|
+
export { DiagConsoleLogger, DiagLogLevel, INVALID_SPANID, INVALID_SPAN_CONTEXT, INVALID_TRACEID, ProxyTracer, ProxyTracerProvider, ROOT_CONTEXT, SamplingDecision, SeverityNumber, SpanKind, SpanStatusCode, TraceFlags, ValueType, baggageEntryMetadataFromString, context, createContextKey, createNoopLogger, createNoopMeter, createTraceState, src_default as default, defaultTextMapGetter, defaultTextMapSetter, diag, isSpanContextValid, isValidSpanId, isValidTraceId, logs, metrics, propagation, trace };
|