@globalart/nestjs-logger 2.4.3 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1586 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -6
- package/dist/index.d.mts +5 -6
- package/dist/index.mjs +1586 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -14
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
1
|
import { ConfigurableModuleBuilder, Inject, Injectable, Module, RequestMethod, SetMetadata } from "@nestjs/common";
|
|
3
2
|
import { APP_INTERCEPTOR, Reflector } from "@nestjs/core";
|
|
4
3
|
import { hostname } from "os";
|
|
@@ -6,8 +5,32 @@ import { nanoid } from "nanoid";
|
|
|
6
5
|
import { AsyncLocalStorage } from "async_hooks";
|
|
7
6
|
import { randomBytes, randomUUID } from "crypto";
|
|
8
7
|
//#region \0rolldown/runtime.js
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
13
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
14
|
+
var __exportAll = (all, no_symbols) => {
|
|
15
|
+
let target = {};
|
|
16
|
+
for (var name in all) __defProp(target, name, {
|
|
17
|
+
get: all[name],
|
|
18
|
+
enumerable: true
|
|
19
|
+
});
|
|
20
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
21
|
+
return target;
|
|
22
|
+
};
|
|
23
|
+
var __copyProps = (to, from, except, desc) => {
|
|
24
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
25
|
+
key = keys[i];
|
|
26
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
27
|
+
get: ((k) => from[k]).bind(null, key),
|
|
28
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
11
34
|
//#endregion
|
|
12
35
|
//#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/util/isFunction.js
|
|
13
36
|
var require_isFunction = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -7048,11 +7071,1523 @@ const DEFAULT_LOGGER_CONFIG = {
|
|
|
7048
7071
|
exclude: []
|
|
7049
7072
|
};
|
|
7050
7073
|
//#endregion
|
|
7074
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/version.js
|
|
7075
|
+
var VERSION;
|
|
7076
|
+
var init_version = __esmMin((() => {
|
|
7077
|
+
VERSION = "1.9.1";
|
|
7078
|
+
}));
|
|
7079
|
+
//#endregion
|
|
7080
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
7081
|
+
/**
|
|
7082
|
+
* Create a function to test an API version to see if it is compatible with the provided ownVersion.
|
|
7083
|
+
*
|
|
7084
|
+
* The returned function has the following semantics:
|
|
7085
|
+
* - Exact match is always compatible
|
|
7086
|
+
* - Major versions must match exactly
|
|
7087
|
+
* - 1.x package cannot use global 2.x package
|
|
7088
|
+
* - 2.x package cannot use global 1.x package
|
|
7089
|
+
* - 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
|
|
7090
|
+
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
|
|
7091
|
+
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
|
|
7092
|
+
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
|
|
7093
|
+
* - Patch and build tag differences are not considered at this time
|
|
7094
|
+
*
|
|
7095
|
+
* @param ownVersion version which should be checked against
|
|
7096
|
+
*/
|
|
7097
|
+
function _makeCompatibilityCheck(ownVersion) {
|
|
7098
|
+
const acceptedVersions = new Set([ownVersion]);
|
|
7099
|
+
const rejectedVersions = /* @__PURE__ */ new Set();
|
|
7100
|
+
const myVersionMatch = ownVersion.match(re);
|
|
7101
|
+
if (!myVersionMatch) return () => false;
|
|
7102
|
+
const ownVersionParsed = {
|
|
7103
|
+
major: +myVersionMatch[1],
|
|
7104
|
+
minor: +myVersionMatch[2],
|
|
7105
|
+
patch: +myVersionMatch[3],
|
|
7106
|
+
prerelease: myVersionMatch[4]
|
|
7107
|
+
};
|
|
7108
|
+
if (ownVersionParsed.prerelease != null) return function isExactmatch(globalVersion) {
|
|
7109
|
+
return globalVersion === ownVersion;
|
|
7110
|
+
};
|
|
7111
|
+
function _reject(v) {
|
|
7112
|
+
rejectedVersions.add(v);
|
|
7113
|
+
return false;
|
|
7114
|
+
}
|
|
7115
|
+
function _accept(v) {
|
|
7116
|
+
acceptedVersions.add(v);
|
|
7117
|
+
return true;
|
|
7118
|
+
}
|
|
7119
|
+
return function isCompatible(globalVersion) {
|
|
7120
|
+
if (acceptedVersions.has(globalVersion)) return true;
|
|
7121
|
+
if (rejectedVersions.has(globalVersion)) return false;
|
|
7122
|
+
const globalVersionMatch = globalVersion.match(re);
|
|
7123
|
+
if (!globalVersionMatch) return _reject(globalVersion);
|
|
7124
|
+
const globalVersionParsed = {
|
|
7125
|
+
major: +globalVersionMatch[1],
|
|
7126
|
+
minor: +globalVersionMatch[2],
|
|
7127
|
+
patch: +globalVersionMatch[3],
|
|
7128
|
+
prerelease: globalVersionMatch[4]
|
|
7129
|
+
};
|
|
7130
|
+
if (globalVersionParsed.prerelease != null) return _reject(globalVersion);
|
|
7131
|
+
if (ownVersionParsed.major !== globalVersionParsed.major) return _reject(globalVersion);
|
|
7132
|
+
if (ownVersionParsed.major === 0) {
|
|
7133
|
+
if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) return _accept(globalVersion);
|
|
7134
|
+
return _reject(globalVersion);
|
|
7135
|
+
}
|
|
7136
|
+
if (ownVersionParsed.minor <= globalVersionParsed.minor) return _accept(globalVersion);
|
|
7137
|
+
return _reject(globalVersion);
|
|
7138
|
+
};
|
|
7139
|
+
}
|
|
7140
|
+
var re, isCompatible;
|
|
7141
|
+
var init_semver = __esmMin((() => {
|
|
7142
|
+
init_version();
|
|
7143
|
+
re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
7144
|
+
isCompatible = _makeCompatibilityCheck(VERSION);
|
|
7145
|
+
}));
|
|
7146
|
+
//#endregion
|
|
7147
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
|
|
7148
|
+
function registerGlobal(type, instance, diag, allowOverride = false) {
|
|
7149
|
+
var _a;
|
|
7150
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { version: VERSION };
|
|
7151
|
+
if (!allowOverride && api[type]) {
|
|
7152
|
+
const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);
|
|
7153
|
+
diag.error(err.stack || err.message);
|
|
7154
|
+
return false;
|
|
7155
|
+
}
|
|
7156
|
+
if (api.version !== "1.9.1") {
|
|
7157
|
+
const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);
|
|
7158
|
+
diag.error(err.stack || err.message);
|
|
7159
|
+
return false;
|
|
7160
|
+
}
|
|
7161
|
+
api[type] = instance;
|
|
7162
|
+
diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);
|
|
7163
|
+
return true;
|
|
7164
|
+
}
|
|
7165
|
+
function getGlobal(type) {
|
|
7166
|
+
var _a, _b;
|
|
7167
|
+
const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
|
|
7168
|
+
if (!globalVersion || !isCompatible(globalVersion)) return;
|
|
7169
|
+
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
|
7170
|
+
}
|
|
7171
|
+
function unregisterGlobal(type, diag) {
|
|
7172
|
+
diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);
|
|
7173
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
7174
|
+
if (api) delete api[type];
|
|
7175
|
+
}
|
|
7176
|
+
var major, GLOBAL_OPENTELEMETRY_API_KEY, _global;
|
|
7177
|
+
var init_global_utils = __esmMin((() => {
|
|
7178
|
+
init_version();
|
|
7179
|
+
init_semver();
|
|
7180
|
+
major = VERSION.split(".")[0];
|
|
7181
|
+
GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);
|
|
7182
|
+
_global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
7183
|
+
}));
|
|
7184
|
+
//#endregion
|
|
7185
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
|
|
7186
|
+
function logProxy(funcName, namespace, args) {
|
|
7187
|
+
const logger = getGlobal("diag");
|
|
7188
|
+
if (!logger) return;
|
|
7189
|
+
return logger[funcName](namespace, ...args);
|
|
7190
|
+
}
|
|
7191
|
+
var DiagComponentLogger;
|
|
7192
|
+
var init_ComponentLogger = __esmMin((() => {
|
|
7193
|
+
init_global_utils();
|
|
7194
|
+
DiagComponentLogger = class {
|
|
7195
|
+
constructor(props) {
|
|
7196
|
+
this._namespace = props.namespace || "DiagComponentLogger";
|
|
7197
|
+
}
|
|
7198
|
+
debug(...args) {
|
|
7199
|
+
return logProxy("debug", this._namespace, args);
|
|
7200
|
+
}
|
|
7201
|
+
error(...args) {
|
|
7202
|
+
return logProxy("error", this._namespace, args);
|
|
7203
|
+
}
|
|
7204
|
+
info(...args) {
|
|
7205
|
+
return logProxy("info", this._namespace, args);
|
|
7206
|
+
}
|
|
7207
|
+
warn(...args) {
|
|
7208
|
+
return logProxy("warn", this._namespace, args);
|
|
7209
|
+
}
|
|
7210
|
+
verbose(...args) {
|
|
7211
|
+
return logProxy("verbose", this._namespace, args);
|
|
7212
|
+
}
|
|
7213
|
+
};
|
|
7214
|
+
}));
|
|
7215
|
+
//#endregion
|
|
7216
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/diag/types.js
|
|
7217
|
+
var DiagLogLevel;
|
|
7218
|
+
var init_types = __esmMin((() => {
|
|
7219
|
+
(function(DiagLogLevel) {
|
|
7220
|
+
/** Diagnostic Logging level setting to disable all logging (except and forced logs) */
|
|
7221
|
+
DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE";
|
|
7222
|
+
/** Identifies an error scenario */
|
|
7223
|
+
DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR";
|
|
7224
|
+
/** Identifies a warning scenario */
|
|
7225
|
+
DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN";
|
|
7226
|
+
/** General informational log message */
|
|
7227
|
+
DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO";
|
|
7228
|
+
/** General debug log message */
|
|
7229
|
+
DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG";
|
|
7230
|
+
/**
|
|
7231
|
+
* Detailed trace level logging should only be used for development, should only be set
|
|
7232
|
+
* in a development environment.
|
|
7233
|
+
*/
|
|
7234
|
+
DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE";
|
|
7235
|
+
/** Used to set the logging level to include all logging */
|
|
7236
|
+
DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL";
|
|
7237
|
+
})(DiagLogLevel || (DiagLogLevel = {}));
|
|
7238
|
+
}));
|
|
7239
|
+
//#endregion
|
|
7240
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
|
|
7241
|
+
function createLogLevelDiagLogger(maxLevel, logger) {
|
|
7242
|
+
if (maxLevel < DiagLogLevel.NONE) maxLevel = DiagLogLevel.NONE;
|
|
7243
|
+
else if (maxLevel > DiagLogLevel.ALL) maxLevel = DiagLogLevel.ALL;
|
|
7244
|
+
logger = logger || {};
|
|
7245
|
+
function _filterFunc(funcName, theLevel) {
|
|
7246
|
+
const theFunc = logger[funcName];
|
|
7247
|
+
if (typeof theFunc === "function" && maxLevel >= theLevel) return theFunc.bind(logger);
|
|
7248
|
+
return function() {};
|
|
7249
|
+
}
|
|
7250
|
+
return {
|
|
7251
|
+
error: _filterFunc("error", DiagLogLevel.ERROR),
|
|
7252
|
+
warn: _filterFunc("warn", DiagLogLevel.WARN),
|
|
7253
|
+
info: _filterFunc("info", DiagLogLevel.INFO),
|
|
7254
|
+
debug: _filterFunc("debug", DiagLogLevel.DEBUG),
|
|
7255
|
+
verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE)
|
|
7256
|
+
};
|
|
7257
|
+
}
|
|
7258
|
+
var init_logLevelLogger = __esmMin((() => {
|
|
7259
|
+
init_types();
|
|
7260
|
+
}));
|
|
7261
|
+
//#endregion
|
|
7262
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/api/diag.js
|
|
7263
|
+
var API_NAME$4, DiagAPI;
|
|
7264
|
+
var init_diag = __esmMin((() => {
|
|
7265
|
+
init_ComponentLogger();
|
|
7266
|
+
init_logLevelLogger();
|
|
7267
|
+
init_types();
|
|
7268
|
+
init_global_utils();
|
|
7269
|
+
API_NAME$4 = "diag";
|
|
7270
|
+
DiagAPI = class DiagAPI {
|
|
7271
|
+
/** Get the singleton instance of the DiagAPI API */
|
|
7272
|
+
static instance() {
|
|
7273
|
+
if (!this._instance) this._instance = new DiagAPI();
|
|
7274
|
+
return this._instance;
|
|
7275
|
+
}
|
|
7276
|
+
/**
|
|
7277
|
+
* Private internal constructor
|
|
7278
|
+
* @private
|
|
7279
|
+
*/
|
|
7280
|
+
constructor() {
|
|
7281
|
+
function _logProxy(funcName) {
|
|
7282
|
+
return function(...args) {
|
|
7283
|
+
const logger = getGlobal("diag");
|
|
7284
|
+
if (!logger) return;
|
|
7285
|
+
return logger[funcName](...args);
|
|
7286
|
+
};
|
|
7287
|
+
}
|
|
7288
|
+
const self = this;
|
|
7289
|
+
const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {
|
|
7290
|
+
var _a, _b, _c;
|
|
7291
|
+
if (logger === self) {
|
|
7292
|
+
const err = /* @__PURE__ */ new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
7293
|
+
self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
7294
|
+
return false;
|
|
7295
|
+
}
|
|
7296
|
+
if (typeof optionsOrLogLevel === "number") optionsOrLogLevel = { logLevel: optionsOrLogLevel };
|
|
7297
|
+
const oldLogger = getGlobal("diag");
|
|
7298
|
+
const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
|
7299
|
+
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
7300
|
+
const stack = (_c = (/* @__PURE__ */ new Error()).stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
7301
|
+
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
|
7302
|
+
newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);
|
|
7303
|
+
}
|
|
7304
|
+
return registerGlobal("diag", newLogger, self, true);
|
|
7305
|
+
};
|
|
7306
|
+
self.setLogger = setLogger;
|
|
7307
|
+
self.disable = () => {
|
|
7308
|
+
unregisterGlobal(API_NAME$4, self);
|
|
7309
|
+
};
|
|
7310
|
+
self.createComponentLogger = (options) => {
|
|
7311
|
+
return new DiagComponentLogger(options);
|
|
7312
|
+
};
|
|
7313
|
+
self.verbose = _logProxy("verbose");
|
|
7314
|
+
self.debug = _logProxy("debug");
|
|
7315
|
+
self.info = _logProxy("info");
|
|
7316
|
+
self.warn = _logProxy("warn");
|
|
7317
|
+
self.error = _logProxy("error");
|
|
7318
|
+
}
|
|
7319
|
+
};
|
|
7320
|
+
}));
|
|
7321
|
+
//#endregion
|
|
7322
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js
|
|
7323
|
+
var BaggageImpl;
|
|
7324
|
+
var init_baggage_impl = __esmMin((() => {
|
|
7325
|
+
BaggageImpl = class BaggageImpl {
|
|
7326
|
+
constructor(entries) {
|
|
7327
|
+
this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map();
|
|
7328
|
+
}
|
|
7329
|
+
getEntry(key) {
|
|
7330
|
+
const entry = this._entries.get(key);
|
|
7331
|
+
if (!entry) return;
|
|
7332
|
+
return Object.assign({}, entry);
|
|
7333
|
+
}
|
|
7334
|
+
getAllEntries() {
|
|
7335
|
+
return Array.from(this._entries.entries());
|
|
7336
|
+
}
|
|
7337
|
+
setEntry(key, entry) {
|
|
7338
|
+
const newBaggage = new BaggageImpl(this._entries);
|
|
7339
|
+
newBaggage._entries.set(key, entry);
|
|
7340
|
+
return newBaggage;
|
|
7341
|
+
}
|
|
7342
|
+
removeEntry(key) {
|
|
7343
|
+
const newBaggage = new BaggageImpl(this._entries);
|
|
7344
|
+
newBaggage._entries.delete(key);
|
|
7345
|
+
return newBaggage;
|
|
7346
|
+
}
|
|
7347
|
+
removeEntries(...keys) {
|
|
7348
|
+
const newBaggage = new BaggageImpl(this._entries);
|
|
7349
|
+
for (const key of keys) newBaggage._entries.delete(key);
|
|
7350
|
+
return newBaggage;
|
|
7351
|
+
}
|
|
7352
|
+
clear() {
|
|
7353
|
+
return new BaggageImpl();
|
|
7354
|
+
}
|
|
7355
|
+
};
|
|
7356
|
+
}));
|
|
7357
|
+
//#endregion
|
|
7358
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js
|
|
7359
|
+
var baggageEntryMetadataSymbol;
|
|
7360
|
+
var init_symbol = __esmMin((() => {
|
|
7361
|
+
baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata");
|
|
7362
|
+
}));
|
|
7363
|
+
//#endregion
|
|
7364
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/baggage/utils.js
|
|
7365
|
+
/**
|
|
7366
|
+
* Create a new Baggage with optional entries
|
|
7367
|
+
*
|
|
7368
|
+
* @param entries An array of baggage entries the new baggage should contain
|
|
7369
|
+
*/
|
|
7370
|
+
function createBaggage(entries = {}) {
|
|
7371
|
+
return new BaggageImpl(new Map(Object.entries(entries)));
|
|
7372
|
+
}
|
|
7373
|
+
/**
|
|
7374
|
+
* Create a serializable BaggageEntryMetadata object from a string.
|
|
7375
|
+
*
|
|
7376
|
+
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
|
7377
|
+
*
|
|
7378
|
+
* @since 1.0.0
|
|
7379
|
+
*/
|
|
7380
|
+
function baggageEntryMetadataFromString(str) {
|
|
7381
|
+
if (typeof str !== "string") {
|
|
7382
|
+
diag$1.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);
|
|
7383
|
+
str = "";
|
|
7384
|
+
}
|
|
7385
|
+
return {
|
|
7386
|
+
__TYPE__: baggageEntryMetadataSymbol,
|
|
7387
|
+
toString() {
|
|
7388
|
+
return str;
|
|
7389
|
+
}
|
|
7390
|
+
};
|
|
7391
|
+
}
|
|
7392
|
+
var diag$1;
|
|
7393
|
+
var init_utils$1 = __esmMin((() => {
|
|
7394
|
+
init_diag();
|
|
7395
|
+
init_baggage_impl();
|
|
7396
|
+
init_symbol();
|
|
7397
|
+
diag$1 = DiagAPI.instance();
|
|
7398
|
+
}));
|
|
7399
|
+
//#endregion
|
|
7400
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/context/context.js
|
|
7401
|
+
/**
|
|
7402
|
+
* Get a key to uniquely identify a context value
|
|
7403
|
+
*
|
|
7404
|
+
* @since 1.0.0
|
|
7405
|
+
*/
|
|
7406
|
+
function createContextKey(description) {
|
|
7407
|
+
return Symbol.for(description);
|
|
7408
|
+
}
|
|
7409
|
+
var BaseContext, ROOT_CONTEXT;
|
|
7410
|
+
var init_context$1 = __esmMin((() => {
|
|
7411
|
+
BaseContext = class BaseContext {
|
|
7412
|
+
/**
|
|
7413
|
+
* Construct a new context which inherits values from an optional parent context.
|
|
7414
|
+
*
|
|
7415
|
+
* @param parentContext a context from which to inherit values
|
|
7416
|
+
*/
|
|
7417
|
+
constructor(parentContext) {
|
|
7418
|
+
const self = this;
|
|
7419
|
+
self._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
|
7420
|
+
self.getValue = (key) => self._currentContext.get(key);
|
|
7421
|
+
self.setValue = (key, value) => {
|
|
7422
|
+
const context = new BaseContext(self._currentContext);
|
|
7423
|
+
context._currentContext.set(key, value);
|
|
7424
|
+
return context;
|
|
7425
|
+
};
|
|
7426
|
+
self.deleteValue = (key) => {
|
|
7427
|
+
const context = new BaseContext(self._currentContext);
|
|
7428
|
+
context._currentContext.delete(key);
|
|
7429
|
+
return context;
|
|
7430
|
+
};
|
|
7431
|
+
}
|
|
7432
|
+
};
|
|
7433
|
+
ROOT_CONTEXT = new BaseContext();
|
|
7434
|
+
}));
|
|
7435
|
+
//#endregion
|
|
7436
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js
|
|
7437
|
+
var consoleMap, _originalConsoleMethods, DiagConsoleLogger;
|
|
7438
|
+
var init_consoleLogger = __esmMin((() => {
|
|
7439
|
+
consoleMap = [
|
|
7440
|
+
{
|
|
7441
|
+
n: "error",
|
|
7442
|
+
c: "error"
|
|
7443
|
+
},
|
|
7444
|
+
{
|
|
7445
|
+
n: "warn",
|
|
7446
|
+
c: "warn"
|
|
7447
|
+
},
|
|
7448
|
+
{
|
|
7449
|
+
n: "info",
|
|
7450
|
+
c: "info"
|
|
7451
|
+
},
|
|
7452
|
+
{
|
|
7453
|
+
n: "debug",
|
|
7454
|
+
c: "debug"
|
|
7455
|
+
},
|
|
7456
|
+
{
|
|
7457
|
+
n: "verbose",
|
|
7458
|
+
c: "trace"
|
|
7459
|
+
}
|
|
7460
|
+
];
|
|
7461
|
+
_originalConsoleMethods = {};
|
|
7462
|
+
if (typeof console !== "undefined") {
|
|
7463
|
+
for (const key of [
|
|
7464
|
+
"error",
|
|
7465
|
+
"warn",
|
|
7466
|
+
"info",
|
|
7467
|
+
"debug",
|
|
7468
|
+
"trace",
|
|
7469
|
+
"log"
|
|
7470
|
+
]) if (typeof console[key] === "function") _originalConsoleMethods[key] = console[key];
|
|
7471
|
+
}
|
|
7472
|
+
DiagConsoleLogger = class {
|
|
7473
|
+
constructor() {
|
|
7474
|
+
function _consoleFunc(funcName) {
|
|
7475
|
+
return function(...args) {
|
|
7476
|
+
let theFunc = _originalConsoleMethods[funcName];
|
|
7477
|
+
if (typeof theFunc !== "function") theFunc = _originalConsoleMethods["log"];
|
|
7478
|
+
if (typeof theFunc !== "function" && console) {
|
|
7479
|
+
theFunc = console[funcName];
|
|
7480
|
+
if (typeof theFunc !== "function") theFunc = console.log;
|
|
7481
|
+
}
|
|
7482
|
+
if (typeof theFunc === "function") return theFunc.apply(console, args);
|
|
7483
|
+
};
|
|
7484
|
+
}
|
|
7485
|
+
for (let i = 0; i < consoleMap.length; i++) this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
|
|
7486
|
+
}
|
|
7487
|
+
};
|
|
7488
|
+
}));
|
|
7489
|
+
//#endregion
|
|
7490
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js
|
|
7491
|
+
/**
|
|
7492
|
+
* Create a no-op Meter
|
|
7493
|
+
*
|
|
7494
|
+
* @since 1.3.0
|
|
7495
|
+
*/
|
|
7496
|
+
function createNoopMeter() {
|
|
7497
|
+
return NOOP_METER;
|
|
7498
|
+
}
|
|
7499
|
+
var NoopMeter, NoopMetric, NoopCounterMetric, NoopUpDownCounterMetric, NoopGaugeMetric, NoopHistogramMetric, NoopObservableMetric, NoopObservableCounterMetric, NoopObservableGaugeMetric, NoopObservableUpDownCounterMetric, NOOP_METER, NOOP_COUNTER_METRIC, NOOP_GAUGE_METRIC, NOOP_HISTOGRAM_METRIC, NOOP_UP_DOWN_COUNTER_METRIC, NOOP_OBSERVABLE_COUNTER_METRIC, NOOP_OBSERVABLE_GAUGE_METRIC, NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
7500
|
+
var init_NoopMeter = __esmMin((() => {
|
|
7501
|
+
NoopMeter = class {
|
|
7502
|
+
constructor() {}
|
|
7503
|
+
/**
|
|
7504
|
+
* @see {@link Meter.createGauge}
|
|
7505
|
+
*/
|
|
7506
|
+
createGauge(_name, _options) {
|
|
7507
|
+
return NOOP_GAUGE_METRIC;
|
|
7508
|
+
}
|
|
7509
|
+
/**
|
|
7510
|
+
* @see {@link Meter.createHistogram}
|
|
7511
|
+
*/
|
|
7512
|
+
createHistogram(_name, _options) {
|
|
7513
|
+
return NOOP_HISTOGRAM_METRIC;
|
|
7514
|
+
}
|
|
7515
|
+
/**
|
|
7516
|
+
* @see {@link Meter.createCounter}
|
|
7517
|
+
*/
|
|
7518
|
+
createCounter(_name, _options) {
|
|
7519
|
+
return NOOP_COUNTER_METRIC;
|
|
7520
|
+
}
|
|
7521
|
+
/**
|
|
7522
|
+
* @see {@link Meter.createUpDownCounter}
|
|
7523
|
+
*/
|
|
7524
|
+
createUpDownCounter(_name, _options) {
|
|
7525
|
+
return NOOP_UP_DOWN_COUNTER_METRIC;
|
|
7526
|
+
}
|
|
7527
|
+
/**
|
|
7528
|
+
* @see {@link Meter.createObservableGauge}
|
|
7529
|
+
*/
|
|
7530
|
+
createObservableGauge(_name, _options) {
|
|
7531
|
+
return NOOP_OBSERVABLE_GAUGE_METRIC;
|
|
7532
|
+
}
|
|
7533
|
+
/**
|
|
7534
|
+
* @see {@link Meter.createObservableCounter}
|
|
7535
|
+
*/
|
|
7536
|
+
createObservableCounter(_name, _options) {
|
|
7537
|
+
return NOOP_OBSERVABLE_COUNTER_METRIC;
|
|
7538
|
+
}
|
|
7539
|
+
/**
|
|
7540
|
+
* @see {@link Meter.createObservableUpDownCounter}
|
|
7541
|
+
*/
|
|
7542
|
+
createObservableUpDownCounter(_name, _options) {
|
|
7543
|
+
return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
7544
|
+
}
|
|
7545
|
+
/**
|
|
7546
|
+
* @see {@link Meter.addBatchObservableCallback}
|
|
7547
|
+
*/
|
|
7548
|
+
addBatchObservableCallback(_callback, _observables) {}
|
|
7549
|
+
/**
|
|
7550
|
+
* @see {@link Meter.removeBatchObservableCallback}
|
|
7551
|
+
*/
|
|
7552
|
+
removeBatchObservableCallback(_callback) {}
|
|
7553
|
+
};
|
|
7554
|
+
NoopMetric = class {};
|
|
7555
|
+
NoopCounterMetric = class extends NoopMetric {
|
|
7556
|
+
add(_value, _attributes) {}
|
|
7557
|
+
};
|
|
7558
|
+
NoopUpDownCounterMetric = class extends NoopMetric {
|
|
7559
|
+
add(_value, _attributes) {}
|
|
7560
|
+
};
|
|
7561
|
+
NoopGaugeMetric = class extends NoopMetric {
|
|
7562
|
+
record(_value, _attributes) {}
|
|
7563
|
+
};
|
|
7564
|
+
NoopHistogramMetric = class extends NoopMetric {
|
|
7565
|
+
record(_value, _attributes) {}
|
|
7566
|
+
};
|
|
7567
|
+
NoopObservableMetric = class {
|
|
7568
|
+
addCallback(_callback) {}
|
|
7569
|
+
removeCallback(_callback) {}
|
|
7570
|
+
};
|
|
7571
|
+
NoopObservableCounterMetric = class extends NoopObservableMetric {};
|
|
7572
|
+
NoopObservableGaugeMetric = class extends NoopObservableMetric {};
|
|
7573
|
+
NoopObservableUpDownCounterMetric = class extends NoopObservableMetric {};
|
|
7574
|
+
NOOP_METER = new NoopMeter();
|
|
7575
|
+
NOOP_COUNTER_METRIC = new NoopCounterMetric();
|
|
7576
|
+
NOOP_GAUGE_METRIC = new NoopGaugeMetric();
|
|
7577
|
+
NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
|
|
7578
|
+
NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
|
|
7579
|
+
NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
|
|
7580
|
+
NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
|
|
7581
|
+
NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();
|
|
7582
|
+
}));
|
|
7583
|
+
//#endregion
|
|
7584
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/metrics/Metric.js
|
|
7585
|
+
var ValueType;
|
|
7586
|
+
var init_Metric = __esmMin((() => {
|
|
7587
|
+
(function(ValueType) {
|
|
7588
|
+
ValueType[ValueType["INT"] = 0] = "INT";
|
|
7589
|
+
ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE";
|
|
7590
|
+
})(ValueType || (ValueType = {}));
|
|
7591
|
+
}));
|
|
7592
|
+
//#endregion
|
|
7593
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js
|
|
7594
|
+
var defaultTextMapGetter, defaultTextMapSetter;
|
|
7595
|
+
var init_TextMapPropagator = __esmMin((() => {
|
|
7596
|
+
defaultTextMapGetter = {
|
|
7597
|
+
get(carrier, key) {
|
|
7598
|
+
if (carrier == null) return;
|
|
7599
|
+
return carrier[key];
|
|
7600
|
+
},
|
|
7601
|
+
keys(carrier) {
|
|
7602
|
+
if (carrier == null) return [];
|
|
7603
|
+
return Object.keys(carrier);
|
|
7604
|
+
}
|
|
7605
|
+
};
|
|
7606
|
+
defaultTextMapSetter = { set(carrier, key, value) {
|
|
7607
|
+
if (carrier == null) return;
|
|
7608
|
+
carrier[key] = value;
|
|
7609
|
+
} };
|
|
7610
|
+
}));
|
|
7611
|
+
//#endregion
|
|
7612
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
|
|
7613
|
+
var NoopContextManager;
|
|
7614
|
+
var init_NoopContextManager = __esmMin((() => {
|
|
7615
|
+
init_context$1();
|
|
7616
|
+
NoopContextManager = class {
|
|
7617
|
+
active() {
|
|
7618
|
+
return ROOT_CONTEXT;
|
|
7619
|
+
}
|
|
7620
|
+
with(_context, fn, thisArg, ...args) {
|
|
7621
|
+
return fn.call(thisArg, ...args);
|
|
7622
|
+
}
|
|
7623
|
+
bind(_context, target) {
|
|
7624
|
+
return target;
|
|
7625
|
+
}
|
|
7626
|
+
enable() {
|
|
7627
|
+
return this;
|
|
7628
|
+
}
|
|
7629
|
+
disable() {
|
|
7630
|
+
return this;
|
|
7631
|
+
}
|
|
7632
|
+
};
|
|
7633
|
+
}));
|
|
7634
|
+
//#endregion
|
|
7635
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/api/context.js
|
|
7636
|
+
var API_NAME$3, NOOP_CONTEXT_MANAGER, ContextAPI;
|
|
7637
|
+
var init_context = __esmMin((() => {
|
|
7638
|
+
init_NoopContextManager();
|
|
7639
|
+
init_global_utils();
|
|
7640
|
+
init_diag();
|
|
7641
|
+
API_NAME$3 = "context";
|
|
7642
|
+
NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
7643
|
+
ContextAPI = class ContextAPI {
|
|
7644
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
7645
|
+
constructor() {}
|
|
7646
|
+
/** Get the singleton instance of the Context API */
|
|
7647
|
+
static getInstance() {
|
|
7648
|
+
if (!this._instance) this._instance = new ContextAPI();
|
|
7649
|
+
return this._instance;
|
|
7650
|
+
}
|
|
7651
|
+
/**
|
|
7652
|
+
* Set the current context manager.
|
|
7653
|
+
*
|
|
7654
|
+
* @returns true if the context manager was successfully registered, else false
|
|
7655
|
+
*/
|
|
7656
|
+
setGlobalContextManager(contextManager) {
|
|
7657
|
+
return registerGlobal(API_NAME$3, contextManager, DiagAPI.instance());
|
|
7658
|
+
}
|
|
7659
|
+
/**
|
|
7660
|
+
* Get the currently active context
|
|
7661
|
+
*/
|
|
7662
|
+
active() {
|
|
7663
|
+
return this._getContextManager().active();
|
|
7664
|
+
}
|
|
7665
|
+
/**
|
|
7666
|
+
* Execute a function with an active context
|
|
7667
|
+
*
|
|
7668
|
+
* @param context context to be active during function execution
|
|
7669
|
+
* @param fn function to execute in a context
|
|
7670
|
+
* @param thisArg optional receiver to be used for calling fn
|
|
7671
|
+
* @param args optional arguments forwarded to fn
|
|
7672
|
+
*/
|
|
7673
|
+
with(context, fn, thisArg, ...args) {
|
|
7674
|
+
return this._getContextManager().with(context, fn, thisArg, ...args);
|
|
7675
|
+
}
|
|
7676
|
+
/**
|
|
7677
|
+
* Bind a context to a target function or event emitter
|
|
7678
|
+
*
|
|
7679
|
+
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
7680
|
+
* @param target function or event emitter to bind
|
|
7681
|
+
*/
|
|
7682
|
+
bind(context, target) {
|
|
7683
|
+
return this._getContextManager().bind(context, target);
|
|
7684
|
+
}
|
|
7685
|
+
_getContextManager() {
|
|
7686
|
+
return getGlobal(API_NAME$3) || NOOP_CONTEXT_MANAGER;
|
|
7687
|
+
}
|
|
7688
|
+
/** Disable and remove the global context manager */
|
|
7689
|
+
disable() {
|
|
7690
|
+
this._getContextManager().disable();
|
|
7691
|
+
unregisterGlobal(API_NAME$3, DiagAPI.instance());
|
|
7692
|
+
}
|
|
7693
|
+
};
|
|
7694
|
+
}));
|
|
7695
|
+
//#endregion
|
|
7696
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
|
|
7697
|
+
var TraceFlags;
|
|
7698
|
+
var init_trace_flags = __esmMin((() => {
|
|
7699
|
+
(function(TraceFlags) {
|
|
7700
|
+
/** Represents no flag set. */
|
|
7701
|
+
TraceFlags[TraceFlags["NONE"] = 0] = "NONE";
|
|
7702
|
+
/** Bit to represent whether trace is sampled in trace flags. */
|
|
7703
|
+
TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED";
|
|
7704
|
+
})(TraceFlags || (TraceFlags = {}));
|
|
7705
|
+
}));
|
|
7706
|
+
//#endregion
|
|
7707
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js
|
|
7708
|
+
var INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT;
|
|
7709
|
+
var init_invalid_span_constants = __esmMin((() => {
|
|
7710
|
+
init_trace_flags();
|
|
7711
|
+
INVALID_SPANID = "0000000000000000";
|
|
7712
|
+
INVALID_TRACEID = "00000000000000000000000000000000";
|
|
7713
|
+
INVALID_SPAN_CONTEXT = {
|
|
7714
|
+
traceId: INVALID_TRACEID,
|
|
7715
|
+
spanId: INVALID_SPANID,
|
|
7716
|
+
traceFlags: TraceFlags.NONE
|
|
7717
|
+
};
|
|
7718
|
+
}));
|
|
7719
|
+
//#endregion
|
|
7720
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js
|
|
7721
|
+
var NonRecordingSpan;
|
|
7722
|
+
var init_NonRecordingSpan = __esmMin((() => {
|
|
7723
|
+
init_invalid_span_constants();
|
|
7724
|
+
NonRecordingSpan = class {
|
|
7725
|
+
constructor(spanContext = INVALID_SPAN_CONTEXT) {
|
|
7726
|
+
this._spanContext = spanContext;
|
|
7727
|
+
}
|
|
7728
|
+
spanContext() {
|
|
7729
|
+
return this._spanContext;
|
|
7730
|
+
}
|
|
7731
|
+
setAttribute(_key, _value) {
|
|
7732
|
+
return this;
|
|
7733
|
+
}
|
|
7734
|
+
setAttributes(_attributes) {
|
|
7735
|
+
return this;
|
|
7736
|
+
}
|
|
7737
|
+
addEvent(_name, _attributes) {
|
|
7738
|
+
return this;
|
|
7739
|
+
}
|
|
7740
|
+
addLink(_link) {
|
|
7741
|
+
return this;
|
|
7742
|
+
}
|
|
7743
|
+
addLinks(_links) {
|
|
7744
|
+
return this;
|
|
7745
|
+
}
|
|
7746
|
+
setStatus(_status) {
|
|
7747
|
+
return this;
|
|
7748
|
+
}
|
|
7749
|
+
updateName(_name) {
|
|
7750
|
+
return this;
|
|
7751
|
+
}
|
|
7752
|
+
end(_endTime) {}
|
|
7753
|
+
isRecording() {
|
|
7754
|
+
return false;
|
|
7755
|
+
}
|
|
7756
|
+
recordException(_exception, _time) {}
|
|
7757
|
+
};
|
|
7758
|
+
}));
|
|
7759
|
+
//#endregion
|
|
7760
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
|
|
7761
|
+
/**
|
|
7762
|
+
* Return the span if one exists
|
|
7763
|
+
*
|
|
7764
|
+
* @param context context to get span from
|
|
7765
|
+
*/
|
|
7766
|
+
function getSpan(context) {
|
|
7767
|
+
return context.getValue(SPAN_KEY) || void 0;
|
|
7768
|
+
}
|
|
7769
|
+
/**
|
|
7770
|
+
* Gets the span from the current context, if one exists.
|
|
7771
|
+
*/
|
|
7772
|
+
function getActiveSpan() {
|
|
7773
|
+
return getSpan(ContextAPI.getInstance().active());
|
|
7774
|
+
}
|
|
7775
|
+
/**
|
|
7776
|
+
* Set the span on a context
|
|
7777
|
+
*
|
|
7778
|
+
* @param context context to use as parent
|
|
7779
|
+
* @param span span to set active
|
|
7780
|
+
*/
|
|
7781
|
+
function setSpan(context, span) {
|
|
7782
|
+
return context.setValue(SPAN_KEY, span);
|
|
7783
|
+
}
|
|
7784
|
+
/**
|
|
7785
|
+
* Remove current span stored in the context
|
|
7786
|
+
*
|
|
7787
|
+
* @param context context to delete span from
|
|
7788
|
+
*/
|
|
7789
|
+
function deleteSpan(context) {
|
|
7790
|
+
return context.deleteValue(SPAN_KEY);
|
|
7791
|
+
}
|
|
7792
|
+
/**
|
|
7793
|
+
* Wrap span context in a NoopSpan and set as span in a new
|
|
7794
|
+
* context
|
|
7795
|
+
*
|
|
7796
|
+
* @param context context to set active span on
|
|
7797
|
+
* @param spanContext span context to be wrapped
|
|
7798
|
+
*/
|
|
7799
|
+
function setSpanContext(context, spanContext) {
|
|
7800
|
+
return setSpan(context, new NonRecordingSpan(spanContext));
|
|
7801
|
+
}
|
|
7802
|
+
/**
|
|
7803
|
+
* Get the span context of the span if it exists.
|
|
7804
|
+
*
|
|
7805
|
+
* @param context context to get values from
|
|
7806
|
+
*/
|
|
7807
|
+
function getSpanContext(context) {
|
|
7808
|
+
var _a;
|
|
7809
|
+
return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();
|
|
7810
|
+
}
|
|
7811
|
+
var SPAN_KEY;
|
|
7812
|
+
var init_context_utils = __esmMin((() => {
|
|
7813
|
+
init_context$1();
|
|
7814
|
+
init_NonRecordingSpan();
|
|
7815
|
+
init_context();
|
|
7816
|
+
SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
7817
|
+
}));
|
|
7818
|
+
//#endregion
|
|
7819
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
|
|
7820
|
+
function isValidHex(id, length) {
|
|
7821
|
+
if (typeof id !== "string" || id.length !== length) return false;
|
|
7822
|
+
let r = 0;
|
|
7823
|
+
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);
|
|
7824
|
+
return r === length;
|
|
7825
|
+
}
|
|
7826
|
+
/**
|
|
7827
|
+
* @since 1.0.0
|
|
7828
|
+
*/
|
|
7829
|
+
function isValidTraceId(traceId) {
|
|
7830
|
+
return isValidHex(traceId, 32) && traceId !== "00000000000000000000000000000000";
|
|
7831
|
+
}
|
|
7832
|
+
/**
|
|
7833
|
+
* @since 1.0.0
|
|
7834
|
+
*/
|
|
7835
|
+
function isValidSpanId(spanId) {
|
|
7836
|
+
return isValidHex(spanId, 16) && spanId !== "0000000000000000";
|
|
7837
|
+
}
|
|
7838
|
+
/**
|
|
7839
|
+
* Returns true if this {@link SpanContext} is valid.
|
|
7840
|
+
* @return true if this {@link SpanContext} is valid.
|
|
7841
|
+
*
|
|
7842
|
+
* @since 1.0.0
|
|
7843
|
+
*/
|
|
7844
|
+
function isSpanContextValid(spanContext) {
|
|
7845
|
+
return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
|
|
7846
|
+
}
|
|
7847
|
+
/**
|
|
7848
|
+
* Wrap the given {@link SpanContext} in a new non-recording {@link Span}
|
|
7849
|
+
*
|
|
7850
|
+
* @param spanContext span context to be wrapped
|
|
7851
|
+
* @returns a new non-recording {@link Span} with the provided context
|
|
7852
|
+
*/
|
|
7853
|
+
function wrapSpanContext(spanContext) {
|
|
7854
|
+
return new NonRecordingSpan(spanContext);
|
|
7855
|
+
}
|
|
7856
|
+
var isHex;
|
|
7857
|
+
var init_spancontext_utils = __esmMin((() => {
|
|
7858
|
+
init_invalid_span_constants();
|
|
7859
|
+
init_NonRecordingSpan();
|
|
7860
|
+
isHex = new Uint8Array([
|
|
7861
|
+
0,
|
|
7862
|
+
0,
|
|
7863
|
+
0,
|
|
7864
|
+
0,
|
|
7865
|
+
0,
|
|
7866
|
+
0,
|
|
7867
|
+
0,
|
|
7868
|
+
0,
|
|
7869
|
+
0,
|
|
7870
|
+
0,
|
|
7871
|
+
0,
|
|
7872
|
+
0,
|
|
7873
|
+
0,
|
|
7874
|
+
0,
|
|
7875
|
+
0,
|
|
7876
|
+
0,
|
|
7877
|
+
0,
|
|
7878
|
+
0,
|
|
7879
|
+
0,
|
|
7880
|
+
0,
|
|
7881
|
+
0,
|
|
7882
|
+
0,
|
|
7883
|
+
0,
|
|
7884
|
+
0,
|
|
7885
|
+
0,
|
|
7886
|
+
0,
|
|
7887
|
+
0,
|
|
7888
|
+
0,
|
|
7889
|
+
0,
|
|
7890
|
+
0,
|
|
7891
|
+
0,
|
|
7892
|
+
0,
|
|
7893
|
+
0,
|
|
7894
|
+
0,
|
|
7895
|
+
0,
|
|
7896
|
+
0,
|
|
7897
|
+
0,
|
|
7898
|
+
0,
|
|
7899
|
+
0,
|
|
7900
|
+
0,
|
|
7901
|
+
0,
|
|
7902
|
+
0,
|
|
7903
|
+
0,
|
|
7904
|
+
0,
|
|
7905
|
+
0,
|
|
7906
|
+
0,
|
|
7907
|
+
0,
|
|
7908
|
+
0,
|
|
7909
|
+
1,
|
|
7910
|
+
1,
|
|
7911
|
+
1,
|
|
7912
|
+
1,
|
|
7913
|
+
1,
|
|
7914
|
+
1,
|
|
7915
|
+
1,
|
|
7916
|
+
1,
|
|
7917
|
+
1,
|
|
7918
|
+
1,
|
|
7919
|
+
0,
|
|
7920
|
+
0,
|
|
7921
|
+
0,
|
|
7922
|
+
0,
|
|
7923
|
+
0,
|
|
7924
|
+
0,
|
|
7925
|
+
0,
|
|
7926
|
+
1,
|
|
7927
|
+
1,
|
|
7928
|
+
1,
|
|
7929
|
+
1,
|
|
7930
|
+
1,
|
|
7931
|
+
1,
|
|
7932
|
+
0,
|
|
7933
|
+
0,
|
|
7934
|
+
0,
|
|
7935
|
+
0,
|
|
7936
|
+
0,
|
|
7937
|
+
0,
|
|
7938
|
+
0,
|
|
7939
|
+
0,
|
|
7940
|
+
0,
|
|
7941
|
+
0,
|
|
7942
|
+
0,
|
|
7943
|
+
0,
|
|
7944
|
+
0,
|
|
7945
|
+
0,
|
|
7946
|
+
0,
|
|
7947
|
+
0,
|
|
7948
|
+
0,
|
|
7949
|
+
0,
|
|
7950
|
+
0,
|
|
7951
|
+
0,
|
|
7952
|
+
0,
|
|
7953
|
+
0,
|
|
7954
|
+
0,
|
|
7955
|
+
0,
|
|
7956
|
+
0,
|
|
7957
|
+
0,
|
|
7958
|
+
1,
|
|
7959
|
+
1,
|
|
7960
|
+
1,
|
|
7961
|
+
1,
|
|
7962
|
+
1,
|
|
7963
|
+
1
|
|
7964
|
+
]);
|
|
7965
|
+
}));
|
|
7966
|
+
//#endregion
|
|
7967
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
|
|
7968
|
+
function isSpanContext(spanContext) {
|
|
7969
|
+
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";
|
|
7970
|
+
}
|
|
7971
|
+
var contextApi, NoopTracer;
|
|
7972
|
+
var init_NoopTracer = __esmMin((() => {
|
|
7973
|
+
init_context();
|
|
7974
|
+
init_context_utils();
|
|
7975
|
+
init_NonRecordingSpan();
|
|
7976
|
+
init_spancontext_utils();
|
|
7977
|
+
contextApi = ContextAPI.getInstance();
|
|
7978
|
+
NoopTracer = class {
|
|
7979
|
+
startSpan(name, options, context = contextApi.active()) {
|
|
7980
|
+
if (Boolean(options === null || options === void 0 ? void 0 : options.root)) return new NonRecordingSpan();
|
|
7981
|
+
const parentFromContext = context && getSpanContext(context);
|
|
7982
|
+
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) return new NonRecordingSpan(parentFromContext);
|
|
7983
|
+
else return new NonRecordingSpan();
|
|
7984
|
+
}
|
|
7985
|
+
startActiveSpan(name, arg2, arg3, arg4) {
|
|
7986
|
+
let opts;
|
|
7987
|
+
let ctx;
|
|
7988
|
+
let fn;
|
|
7989
|
+
if (arguments.length < 2) return;
|
|
7990
|
+
else if (arguments.length === 2) fn = arg2;
|
|
7991
|
+
else if (arguments.length === 3) {
|
|
7992
|
+
opts = arg2;
|
|
7993
|
+
fn = arg3;
|
|
7994
|
+
} else {
|
|
7995
|
+
opts = arg2;
|
|
7996
|
+
ctx = arg3;
|
|
7997
|
+
fn = arg4;
|
|
7998
|
+
}
|
|
7999
|
+
const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
8000
|
+
const span = this.startSpan(name, opts, parentContext);
|
|
8001
|
+
const contextWithSpanSet = setSpan(parentContext, span);
|
|
8002
|
+
return contextApi.with(contextWithSpanSet, fn, void 0, span);
|
|
8003
|
+
}
|
|
8004
|
+
};
|
|
8005
|
+
}));
|
|
8006
|
+
//#endregion
|
|
8007
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
|
|
8008
|
+
var NOOP_TRACER, ProxyTracer;
|
|
8009
|
+
var init_ProxyTracer = __esmMin((() => {
|
|
8010
|
+
init_NoopTracer();
|
|
8011
|
+
NOOP_TRACER = new NoopTracer();
|
|
8012
|
+
ProxyTracer = class {
|
|
8013
|
+
constructor(provider, name, version, options) {
|
|
8014
|
+
this._provider = provider;
|
|
8015
|
+
this.name = name;
|
|
8016
|
+
this.version = version;
|
|
8017
|
+
this.options = options;
|
|
8018
|
+
}
|
|
8019
|
+
startSpan(name, options, context) {
|
|
8020
|
+
return this._getTracer().startSpan(name, options, context);
|
|
8021
|
+
}
|
|
8022
|
+
startActiveSpan(_name, _options, _context, _fn) {
|
|
8023
|
+
const tracer = this._getTracer();
|
|
8024
|
+
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
8025
|
+
}
|
|
8026
|
+
/**
|
|
8027
|
+
* Try to get a tracer from the proxy tracer provider.
|
|
8028
|
+
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
8029
|
+
*/
|
|
8030
|
+
_getTracer() {
|
|
8031
|
+
if (this._delegate) return this._delegate;
|
|
8032
|
+
const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
8033
|
+
if (!tracer) return NOOP_TRACER;
|
|
8034
|
+
this._delegate = tracer;
|
|
8035
|
+
return this._delegate;
|
|
8036
|
+
}
|
|
8037
|
+
};
|
|
8038
|
+
}));
|
|
8039
|
+
//#endregion
|
|
8040
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js
|
|
8041
|
+
var NoopTracerProvider;
|
|
8042
|
+
var init_NoopTracerProvider = __esmMin((() => {
|
|
8043
|
+
init_NoopTracer();
|
|
8044
|
+
NoopTracerProvider = class {
|
|
8045
|
+
getTracer(_name, _version, _options) {
|
|
8046
|
+
return new NoopTracer();
|
|
8047
|
+
}
|
|
8048
|
+
};
|
|
8049
|
+
}));
|
|
8050
|
+
//#endregion
|
|
8051
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js
|
|
8052
|
+
var NOOP_TRACER_PROVIDER, ProxyTracerProvider;
|
|
8053
|
+
var init_ProxyTracerProvider = __esmMin((() => {
|
|
8054
|
+
init_ProxyTracer();
|
|
8055
|
+
init_NoopTracerProvider();
|
|
8056
|
+
NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
8057
|
+
ProxyTracerProvider = class {
|
|
8058
|
+
/**
|
|
8059
|
+
* Get a {@link ProxyTracer}
|
|
8060
|
+
*/
|
|
8061
|
+
getTracer(name, version, options) {
|
|
8062
|
+
var _a;
|
|
8063
|
+
return (_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options);
|
|
8064
|
+
}
|
|
8065
|
+
getDelegate() {
|
|
8066
|
+
var _a;
|
|
8067
|
+
return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
|
|
8068
|
+
}
|
|
8069
|
+
/**
|
|
8070
|
+
* Set the delegate tracer provider
|
|
8071
|
+
*/
|
|
8072
|
+
setDelegate(delegate) {
|
|
8073
|
+
this._delegate = delegate;
|
|
8074
|
+
}
|
|
8075
|
+
getDelegateTracer(name, version, options) {
|
|
8076
|
+
var _a;
|
|
8077
|
+
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
|
|
8078
|
+
}
|
|
8079
|
+
};
|
|
8080
|
+
}));
|
|
8081
|
+
//#endregion
|
|
8082
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js
|
|
8083
|
+
var SamplingDecision;
|
|
8084
|
+
var init_SamplingResult = __esmMin((() => {
|
|
8085
|
+
(function(SamplingDecision) {
|
|
8086
|
+
/**
|
|
8087
|
+
* `Span.isRecording() === false`, span will not be recorded and all events
|
|
8088
|
+
* and attributes will be dropped.
|
|
8089
|
+
*/
|
|
8090
|
+
SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD";
|
|
8091
|
+
/**
|
|
8092
|
+
* `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}
|
|
8093
|
+
* MUST NOT be set.
|
|
8094
|
+
*/
|
|
8095
|
+
SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD";
|
|
8096
|
+
/**
|
|
8097
|
+
* `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}
|
|
8098
|
+
* MUST be set.
|
|
8099
|
+
*/
|
|
8100
|
+
SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED";
|
|
8101
|
+
})(SamplingDecision || (SamplingDecision = {}));
|
|
8102
|
+
}));
|
|
8103
|
+
//#endregion
|
|
8104
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/span_kind.js
|
|
8105
|
+
var SpanKind;
|
|
8106
|
+
var init_span_kind = __esmMin((() => {
|
|
8107
|
+
(function(SpanKind) {
|
|
8108
|
+
/** Default value. Indicates that the span is used internally. */
|
|
8109
|
+
SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL";
|
|
8110
|
+
/**
|
|
8111
|
+
* Indicates that the span covers server-side handling of an RPC or other
|
|
8112
|
+
* remote request.
|
|
8113
|
+
*/
|
|
8114
|
+
SpanKind[SpanKind["SERVER"] = 1] = "SERVER";
|
|
8115
|
+
/**
|
|
8116
|
+
* Indicates that the span covers the client-side wrapper around an RPC or
|
|
8117
|
+
* other remote request.
|
|
8118
|
+
*/
|
|
8119
|
+
SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT";
|
|
8120
|
+
/**
|
|
8121
|
+
* Indicates that the span describes producer sending a message to a
|
|
8122
|
+
* broker. Unlike client and server, there is no direct critical path latency
|
|
8123
|
+
* relationship between producer and consumer spans.
|
|
8124
|
+
*/
|
|
8125
|
+
SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER";
|
|
8126
|
+
/**
|
|
8127
|
+
* Indicates that the span describes consumer receiving a message from a
|
|
8128
|
+
* broker. Unlike client and server, there is no direct critical path latency
|
|
8129
|
+
* relationship between producer and consumer spans.
|
|
8130
|
+
*/
|
|
8131
|
+
SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER";
|
|
8132
|
+
})(SpanKind || (SpanKind = {}));
|
|
8133
|
+
}));
|
|
8134
|
+
//#endregion
|
|
8135
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/status.js
|
|
8136
|
+
var SpanStatusCode;
|
|
8137
|
+
var init_status = __esmMin((() => {
|
|
8138
|
+
(function(SpanStatusCode) {
|
|
8139
|
+
/**
|
|
8140
|
+
* The default status.
|
|
8141
|
+
*/
|
|
8142
|
+
SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET";
|
|
8143
|
+
/**
|
|
8144
|
+
* The operation has been validated by an Application developer or
|
|
8145
|
+
* Operator to have completed successfully.
|
|
8146
|
+
*/
|
|
8147
|
+
SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK";
|
|
8148
|
+
/**
|
|
8149
|
+
* The operation contains an error.
|
|
8150
|
+
*/
|
|
8151
|
+
SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR";
|
|
8152
|
+
})(SpanStatusCode || (SpanStatusCode = {}));
|
|
8153
|
+
}));
|
|
8154
|
+
//#endregion
|
|
8155
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js
|
|
8156
|
+
/**
|
|
8157
|
+
* Key is opaque string up to 256 characters printable. It MUST begin with a
|
|
8158
|
+
* lowercase letter, and can only contain lowercase letters a-z, digits 0-9,
|
|
8159
|
+
* underscores _, dashes -, asterisks *, and forward slashes /.
|
|
8160
|
+
* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the
|
|
8161
|
+
* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.
|
|
8162
|
+
* see https://www.w3.org/TR/trace-context/#key
|
|
8163
|
+
*/
|
|
8164
|
+
function validateKey(key) {
|
|
8165
|
+
return VALID_KEY_REGEX.test(key);
|
|
8166
|
+
}
|
|
8167
|
+
/**
|
|
8168
|
+
* Value is opaque string up to 256 characters printable ASCII RFC0020
|
|
8169
|
+
* characters (i.e., the range 0x20 to 0x7E) except comma , and =.
|
|
8170
|
+
*/
|
|
8171
|
+
function validateValue(value) {
|
|
8172
|
+
return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value);
|
|
8173
|
+
}
|
|
8174
|
+
var VALID_KEY_CHAR_RANGE, VALID_KEY_REGEX, VALID_VALUE_BASE_REGEX, INVALID_VALUE_COMMA_EQUAL_REGEX;
|
|
8175
|
+
var init_tracestate_validators = __esmMin((() => {
|
|
8176
|
+
VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]";
|
|
8177
|
+
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}`})$`);
|
|
8178
|
+
VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
|
|
8179
|
+
INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
|
|
8180
|
+
}));
|
|
8181
|
+
//#endregion
|
|
8182
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js
|
|
8183
|
+
var MAX_TRACE_STATE_ITEMS, MAX_TRACE_STATE_LEN, LIST_MEMBERS_SEPARATOR, LIST_MEMBER_KEY_VALUE_SPLITTER, TraceStateImpl;
|
|
8184
|
+
var init_tracestate_impl = __esmMin((() => {
|
|
8185
|
+
init_tracestate_validators();
|
|
8186
|
+
MAX_TRACE_STATE_ITEMS = 32;
|
|
8187
|
+
MAX_TRACE_STATE_LEN = 512;
|
|
8188
|
+
LIST_MEMBERS_SEPARATOR = ",";
|
|
8189
|
+
LIST_MEMBER_KEY_VALUE_SPLITTER = "=";
|
|
8190
|
+
TraceStateImpl = class TraceStateImpl {
|
|
8191
|
+
constructor(rawTraceState) {
|
|
8192
|
+
this._internalState = /* @__PURE__ */ new Map();
|
|
8193
|
+
if (rawTraceState) this._parse(rawTraceState);
|
|
8194
|
+
}
|
|
8195
|
+
set(key, value) {
|
|
8196
|
+
const traceState = this._clone();
|
|
8197
|
+
if (traceState._internalState.has(key)) traceState._internalState.delete(key);
|
|
8198
|
+
traceState._internalState.set(key, value);
|
|
8199
|
+
return traceState;
|
|
8200
|
+
}
|
|
8201
|
+
unset(key) {
|
|
8202
|
+
const traceState = this._clone();
|
|
8203
|
+
traceState._internalState.delete(key);
|
|
8204
|
+
return traceState;
|
|
8205
|
+
}
|
|
8206
|
+
get(key) {
|
|
8207
|
+
return this._internalState.get(key);
|
|
8208
|
+
}
|
|
8209
|
+
serialize() {
|
|
8210
|
+
return Array.from(this._internalState.keys()).reduceRight((agg, key) => {
|
|
8211
|
+
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));
|
|
8212
|
+
return agg;
|
|
8213
|
+
}, []).join(LIST_MEMBERS_SEPARATOR);
|
|
8214
|
+
}
|
|
8215
|
+
_parse(rawTraceState) {
|
|
8216
|
+
if (rawTraceState.length > MAX_TRACE_STATE_LEN) return;
|
|
8217
|
+
this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reduceRight((agg, part) => {
|
|
8218
|
+
const listMember = part.trim();
|
|
8219
|
+
const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
|
|
8220
|
+
if (i !== -1) {
|
|
8221
|
+
const key = listMember.slice(0, i);
|
|
8222
|
+
const value = listMember.slice(i + 1, part.length);
|
|
8223
|
+
if (validateKey(key) && validateValue(value)) agg.set(key, value);
|
|
8224
|
+
}
|
|
8225
|
+
return agg;
|
|
8226
|
+
}, /* @__PURE__ */ new Map());
|
|
8227
|
+
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS));
|
|
8228
|
+
}
|
|
8229
|
+
_keys() {
|
|
8230
|
+
return Array.from(this._internalState.keys()).reverse();
|
|
8231
|
+
}
|
|
8232
|
+
_clone() {
|
|
8233
|
+
const traceState = new TraceStateImpl();
|
|
8234
|
+
traceState._internalState = new Map(this._internalState);
|
|
8235
|
+
return traceState;
|
|
8236
|
+
}
|
|
8237
|
+
};
|
|
8238
|
+
}));
|
|
8239
|
+
//#endregion
|
|
8240
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js
|
|
8241
|
+
/**
|
|
8242
|
+
* @since 1.1.0
|
|
8243
|
+
*/
|
|
8244
|
+
function createTraceState(rawTraceState) {
|
|
8245
|
+
return new TraceStateImpl(rawTraceState);
|
|
8246
|
+
}
|
|
8247
|
+
var init_utils = __esmMin((() => {
|
|
8248
|
+
init_tracestate_impl();
|
|
8249
|
+
}));
|
|
8250
|
+
//#endregion
|
|
8251
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/context-api.js
|
|
8252
|
+
var context;
|
|
8253
|
+
var init_context_api = __esmMin((() => {
|
|
8254
|
+
init_context();
|
|
8255
|
+
context = ContextAPI.getInstance();
|
|
8256
|
+
}));
|
|
8257
|
+
//#endregion
|
|
8258
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/diag-api.js
|
|
8259
|
+
var diag;
|
|
8260
|
+
var init_diag_api = __esmMin((() => {
|
|
8261
|
+
init_diag();
|
|
8262
|
+
diag = DiagAPI.instance();
|
|
8263
|
+
}));
|
|
8264
|
+
//#endregion
|
|
8265
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js
|
|
8266
|
+
var NoopMeterProvider, NOOP_METER_PROVIDER;
|
|
8267
|
+
var init_NoopMeterProvider = __esmMin((() => {
|
|
8268
|
+
init_NoopMeter();
|
|
8269
|
+
NoopMeterProvider = class {
|
|
8270
|
+
getMeter(_name, _version, _options) {
|
|
8271
|
+
return NOOP_METER;
|
|
8272
|
+
}
|
|
8273
|
+
};
|
|
8274
|
+
NOOP_METER_PROVIDER = new NoopMeterProvider();
|
|
8275
|
+
}));
|
|
8276
|
+
//#endregion
|
|
8277
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/api/metrics.js
|
|
8278
|
+
var API_NAME$2, MetricsAPI;
|
|
8279
|
+
var init_metrics = __esmMin((() => {
|
|
8280
|
+
init_NoopMeterProvider();
|
|
8281
|
+
init_global_utils();
|
|
8282
|
+
init_diag();
|
|
8283
|
+
API_NAME$2 = "metrics";
|
|
8284
|
+
MetricsAPI = class MetricsAPI {
|
|
8285
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
8286
|
+
constructor() {}
|
|
8287
|
+
/** Get the singleton instance of the Metrics API */
|
|
8288
|
+
static getInstance() {
|
|
8289
|
+
if (!this._instance) this._instance = new MetricsAPI();
|
|
8290
|
+
return this._instance;
|
|
8291
|
+
}
|
|
8292
|
+
/**
|
|
8293
|
+
* Set the current global meter provider.
|
|
8294
|
+
* Returns true if the meter provider was successfully registered, else false.
|
|
8295
|
+
*/
|
|
8296
|
+
setGlobalMeterProvider(provider) {
|
|
8297
|
+
return registerGlobal(API_NAME$2, provider, DiagAPI.instance());
|
|
8298
|
+
}
|
|
8299
|
+
/**
|
|
8300
|
+
* Returns the global meter provider.
|
|
8301
|
+
*/
|
|
8302
|
+
getMeterProvider() {
|
|
8303
|
+
return getGlobal(API_NAME$2) || NOOP_METER_PROVIDER;
|
|
8304
|
+
}
|
|
8305
|
+
/**
|
|
8306
|
+
* Returns a meter from the global meter provider.
|
|
8307
|
+
*/
|
|
8308
|
+
getMeter(name, version, options) {
|
|
8309
|
+
return this.getMeterProvider().getMeter(name, version, options);
|
|
8310
|
+
}
|
|
8311
|
+
/** Remove the global meter provider */
|
|
8312
|
+
disable() {
|
|
8313
|
+
unregisterGlobal(API_NAME$2, DiagAPI.instance());
|
|
8314
|
+
}
|
|
8315
|
+
};
|
|
8316
|
+
}));
|
|
8317
|
+
//#endregion
|
|
8318
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/metrics-api.js
|
|
8319
|
+
var metrics;
|
|
8320
|
+
var init_metrics_api = __esmMin((() => {
|
|
8321
|
+
init_metrics();
|
|
8322
|
+
metrics = MetricsAPI.getInstance();
|
|
8323
|
+
}));
|
|
8324
|
+
//#endregion
|
|
8325
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js
|
|
8326
|
+
var NoopTextMapPropagator;
|
|
8327
|
+
var init_NoopTextMapPropagator = __esmMin((() => {
|
|
8328
|
+
NoopTextMapPropagator = class {
|
|
8329
|
+
/** Noop inject function does nothing */
|
|
8330
|
+
inject(_context, _carrier) {}
|
|
8331
|
+
/** Noop extract function does nothing and returns the input context */
|
|
8332
|
+
extract(context, _carrier) {
|
|
8333
|
+
return context;
|
|
8334
|
+
}
|
|
8335
|
+
fields() {
|
|
8336
|
+
return [];
|
|
8337
|
+
}
|
|
8338
|
+
};
|
|
8339
|
+
}));
|
|
8340
|
+
//#endregion
|
|
8341
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js
|
|
8342
|
+
/**
|
|
8343
|
+
* Retrieve the current baggage from the given context
|
|
8344
|
+
*
|
|
8345
|
+
* @param {Context} Context that manage all context values
|
|
8346
|
+
* @returns {Baggage} Extracted baggage from the context
|
|
8347
|
+
*/
|
|
8348
|
+
function getBaggage(context) {
|
|
8349
|
+
return context.getValue(BAGGAGE_KEY) || void 0;
|
|
8350
|
+
}
|
|
8351
|
+
/**
|
|
8352
|
+
* Retrieve the current baggage from the active/current context
|
|
8353
|
+
*
|
|
8354
|
+
* @returns {Baggage} Extracted baggage from the context
|
|
8355
|
+
*/
|
|
8356
|
+
function getActiveBaggage() {
|
|
8357
|
+
return getBaggage(ContextAPI.getInstance().active());
|
|
8358
|
+
}
|
|
8359
|
+
/**
|
|
8360
|
+
* Store a baggage in the given context
|
|
8361
|
+
*
|
|
8362
|
+
* @param {Context} Context that manage all context values
|
|
8363
|
+
* @param {Baggage} baggage that will be set in the actual context
|
|
8364
|
+
*/
|
|
8365
|
+
function setBaggage(context, baggage) {
|
|
8366
|
+
return context.setValue(BAGGAGE_KEY, baggage);
|
|
8367
|
+
}
|
|
8368
|
+
/**
|
|
8369
|
+
* Delete the baggage stored in the given context
|
|
8370
|
+
*
|
|
8371
|
+
* @param {Context} Context that manage all context values
|
|
8372
|
+
*/
|
|
8373
|
+
function deleteBaggage(context) {
|
|
8374
|
+
return context.deleteValue(BAGGAGE_KEY);
|
|
8375
|
+
}
|
|
8376
|
+
var BAGGAGE_KEY;
|
|
8377
|
+
var init_context_helpers = __esmMin((() => {
|
|
8378
|
+
init_context();
|
|
8379
|
+
init_context$1();
|
|
8380
|
+
BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key");
|
|
8381
|
+
}));
|
|
8382
|
+
//#endregion
|
|
8383
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/api/propagation.js
|
|
8384
|
+
var API_NAME$1, NOOP_TEXT_MAP_PROPAGATOR, PropagationAPI;
|
|
8385
|
+
var init_propagation = __esmMin((() => {
|
|
8386
|
+
init_global_utils();
|
|
8387
|
+
init_NoopTextMapPropagator();
|
|
8388
|
+
init_TextMapPropagator();
|
|
8389
|
+
init_context_helpers();
|
|
8390
|
+
init_utils$1();
|
|
8391
|
+
init_diag();
|
|
8392
|
+
API_NAME$1 = "propagation";
|
|
8393
|
+
NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
|
|
8394
|
+
PropagationAPI = class PropagationAPI {
|
|
8395
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
8396
|
+
constructor() {
|
|
8397
|
+
this.createBaggage = createBaggage;
|
|
8398
|
+
this.getBaggage = getBaggage;
|
|
8399
|
+
this.getActiveBaggage = getActiveBaggage;
|
|
8400
|
+
this.setBaggage = setBaggage;
|
|
8401
|
+
this.deleteBaggage = deleteBaggage;
|
|
8402
|
+
}
|
|
8403
|
+
/** Get the singleton instance of the Propagator API */
|
|
8404
|
+
static getInstance() {
|
|
8405
|
+
if (!this._instance) this._instance = new PropagationAPI();
|
|
8406
|
+
return this._instance;
|
|
8407
|
+
}
|
|
8408
|
+
/**
|
|
8409
|
+
* Set the current propagator.
|
|
8410
|
+
*
|
|
8411
|
+
* @returns true if the propagator was successfully registered, else false
|
|
8412
|
+
*/
|
|
8413
|
+
setGlobalPropagator(propagator) {
|
|
8414
|
+
return registerGlobal(API_NAME$1, propagator, DiagAPI.instance());
|
|
8415
|
+
}
|
|
8416
|
+
/**
|
|
8417
|
+
* Inject context into a carrier to be propagated inter-process
|
|
8418
|
+
*
|
|
8419
|
+
* @param context Context carrying tracing data to inject
|
|
8420
|
+
* @param carrier carrier to inject context into
|
|
8421
|
+
* @param setter Function used to set values on the carrier
|
|
8422
|
+
*/
|
|
8423
|
+
inject(context, carrier, setter = defaultTextMapSetter) {
|
|
8424
|
+
return this._getGlobalPropagator().inject(context, carrier, setter);
|
|
8425
|
+
}
|
|
8426
|
+
/**
|
|
8427
|
+
* Extract context from a carrier
|
|
8428
|
+
*
|
|
8429
|
+
* @param context Context which the newly created context will inherit from
|
|
8430
|
+
* @param carrier Carrier to extract context from
|
|
8431
|
+
* @param getter Function used to extract keys from a carrier
|
|
8432
|
+
*/
|
|
8433
|
+
extract(context, carrier, getter = defaultTextMapGetter) {
|
|
8434
|
+
return this._getGlobalPropagator().extract(context, carrier, getter);
|
|
8435
|
+
}
|
|
8436
|
+
/**
|
|
8437
|
+
* Return a list of all fields which may be used by the propagator.
|
|
8438
|
+
*/
|
|
8439
|
+
fields() {
|
|
8440
|
+
return this._getGlobalPropagator().fields();
|
|
8441
|
+
}
|
|
8442
|
+
/** Remove the global propagator */
|
|
8443
|
+
disable() {
|
|
8444
|
+
unregisterGlobal(API_NAME$1, DiagAPI.instance());
|
|
8445
|
+
}
|
|
8446
|
+
_getGlobalPropagator() {
|
|
8447
|
+
return getGlobal(API_NAME$1) || NOOP_TEXT_MAP_PROPAGATOR;
|
|
8448
|
+
}
|
|
8449
|
+
};
|
|
8450
|
+
}));
|
|
8451
|
+
//#endregion
|
|
8452
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/propagation-api.js
|
|
8453
|
+
var propagation;
|
|
8454
|
+
var init_propagation_api = __esmMin((() => {
|
|
8455
|
+
init_propagation();
|
|
8456
|
+
propagation = PropagationAPI.getInstance();
|
|
8457
|
+
}));
|
|
8458
|
+
//#endregion
|
|
8459
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/api/trace.js
|
|
8460
|
+
var API_NAME, TraceAPI;
|
|
8461
|
+
var init_trace = __esmMin((() => {
|
|
8462
|
+
init_global_utils();
|
|
8463
|
+
init_ProxyTracerProvider();
|
|
8464
|
+
init_spancontext_utils();
|
|
8465
|
+
init_context_utils();
|
|
8466
|
+
init_diag();
|
|
8467
|
+
API_NAME = "trace";
|
|
8468
|
+
TraceAPI = class TraceAPI {
|
|
8469
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
8470
|
+
constructor() {
|
|
8471
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
8472
|
+
this.wrapSpanContext = wrapSpanContext;
|
|
8473
|
+
this.isSpanContextValid = isSpanContextValid;
|
|
8474
|
+
this.deleteSpan = deleteSpan;
|
|
8475
|
+
this.getSpan = getSpan;
|
|
8476
|
+
this.getActiveSpan = getActiveSpan;
|
|
8477
|
+
this.getSpanContext = getSpanContext;
|
|
8478
|
+
this.setSpan = setSpan;
|
|
8479
|
+
this.setSpanContext = setSpanContext;
|
|
8480
|
+
}
|
|
8481
|
+
/** Get the singleton instance of the Trace API */
|
|
8482
|
+
static getInstance() {
|
|
8483
|
+
if (!this._instance) this._instance = new TraceAPI();
|
|
8484
|
+
return this._instance;
|
|
8485
|
+
}
|
|
8486
|
+
/**
|
|
8487
|
+
* Set the current global tracer.
|
|
8488
|
+
*
|
|
8489
|
+
* @returns true if the tracer provider was successfully registered, else false
|
|
8490
|
+
*/
|
|
8491
|
+
setGlobalTracerProvider(provider) {
|
|
8492
|
+
const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());
|
|
8493
|
+
if (success) this._proxyTracerProvider.setDelegate(provider);
|
|
8494
|
+
return success;
|
|
8495
|
+
}
|
|
8496
|
+
/**
|
|
8497
|
+
* Returns the global tracer provider.
|
|
8498
|
+
*/
|
|
8499
|
+
getTracerProvider() {
|
|
8500
|
+
return getGlobal(API_NAME) || this._proxyTracerProvider;
|
|
8501
|
+
}
|
|
8502
|
+
/**
|
|
8503
|
+
* Returns a tracer from the global tracer provider.
|
|
8504
|
+
*/
|
|
8505
|
+
getTracer(name, version) {
|
|
8506
|
+
return this.getTracerProvider().getTracer(name, version);
|
|
8507
|
+
}
|
|
8508
|
+
/** Remove the global tracer provider */
|
|
8509
|
+
disable() {
|
|
8510
|
+
unregisterGlobal(API_NAME, DiagAPI.instance());
|
|
8511
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
8512
|
+
}
|
|
8513
|
+
};
|
|
8514
|
+
}));
|
|
8515
|
+
//#endregion
|
|
8516
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
8517
|
+
var trace;
|
|
8518
|
+
var init_trace_api = __esmMin((() => {
|
|
8519
|
+
init_trace();
|
|
8520
|
+
trace = TraceAPI.getInstance();
|
|
8521
|
+
}));
|
|
8522
|
+
//#endregion
|
|
8523
|
+
//#region ../../../../node_modules/@opentelemetry/api/build/esm/index.js
|
|
8524
|
+
var esm_exports = /* @__PURE__ */ __exportAll({
|
|
8525
|
+
DiagConsoleLogger: () => DiagConsoleLogger,
|
|
8526
|
+
DiagLogLevel: () => DiagLogLevel,
|
|
8527
|
+
INVALID_SPANID: () => INVALID_SPANID,
|
|
8528
|
+
INVALID_SPAN_CONTEXT: () => INVALID_SPAN_CONTEXT,
|
|
8529
|
+
INVALID_TRACEID: () => INVALID_TRACEID,
|
|
8530
|
+
ProxyTracer: () => ProxyTracer,
|
|
8531
|
+
ProxyTracerProvider: () => ProxyTracerProvider,
|
|
8532
|
+
ROOT_CONTEXT: () => ROOT_CONTEXT,
|
|
8533
|
+
SamplingDecision: () => SamplingDecision,
|
|
8534
|
+
SpanKind: () => SpanKind,
|
|
8535
|
+
SpanStatusCode: () => SpanStatusCode,
|
|
8536
|
+
TraceFlags: () => TraceFlags,
|
|
8537
|
+
ValueType: () => ValueType,
|
|
8538
|
+
baggageEntryMetadataFromString: () => baggageEntryMetadataFromString,
|
|
8539
|
+
context: () => context,
|
|
8540
|
+
createContextKey: () => createContextKey,
|
|
8541
|
+
createNoopMeter: () => createNoopMeter,
|
|
8542
|
+
createTraceState: () => createTraceState,
|
|
8543
|
+
default: () => esm_default,
|
|
8544
|
+
defaultTextMapGetter: () => defaultTextMapGetter,
|
|
8545
|
+
defaultTextMapSetter: () => defaultTextMapSetter,
|
|
8546
|
+
diag: () => diag,
|
|
8547
|
+
isSpanContextValid: () => isSpanContextValid,
|
|
8548
|
+
isValidSpanId: () => isValidSpanId,
|
|
8549
|
+
isValidTraceId: () => isValidTraceId,
|
|
8550
|
+
metrics: () => metrics,
|
|
8551
|
+
propagation: () => propagation,
|
|
8552
|
+
trace: () => trace
|
|
8553
|
+
});
|
|
8554
|
+
var esm_default;
|
|
8555
|
+
var init_esm = __esmMin((() => {
|
|
8556
|
+
init_utils$1();
|
|
8557
|
+
init_context$1();
|
|
8558
|
+
init_consoleLogger();
|
|
8559
|
+
init_types();
|
|
8560
|
+
init_NoopMeter();
|
|
8561
|
+
init_Metric();
|
|
8562
|
+
init_TextMapPropagator();
|
|
8563
|
+
init_ProxyTracer();
|
|
8564
|
+
init_ProxyTracerProvider();
|
|
8565
|
+
init_SamplingResult();
|
|
8566
|
+
init_span_kind();
|
|
8567
|
+
init_status();
|
|
8568
|
+
init_trace_flags();
|
|
8569
|
+
init_utils();
|
|
8570
|
+
init_spancontext_utils();
|
|
8571
|
+
init_invalid_span_constants();
|
|
8572
|
+
init_context_api();
|
|
8573
|
+
init_diag_api();
|
|
8574
|
+
init_metrics_api();
|
|
8575
|
+
init_propagation_api();
|
|
8576
|
+
init_trace_api();
|
|
8577
|
+
esm_default = {
|
|
8578
|
+
context,
|
|
8579
|
+
diag,
|
|
8580
|
+
metrics,
|
|
8581
|
+
propagation,
|
|
8582
|
+
trace
|
|
8583
|
+
};
|
|
8584
|
+
}));
|
|
8585
|
+
//#endregion
|
|
7051
8586
|
//#region src/utils/opentelemetry-trace.ts
|
|
7052
8587
|
let cachedGetter = void 0;
|
|
7053
8588
|
function createGetter() {
|
|
7054
8589
|
try {
|
|
7055
|
-
const api =
|
|
8590
|
+
const api = (init_esm(), __toCommonJS(esm_exports));
|
|
7056
8591
|
return () => {
|
|
7057
8592
|
const span = api.trace?.getSpan?.(api.context?.active?.());
|
|
7058
8593
|
if (!span) return {};
|
|
@@ -7074,7 +8609,7 @@ function getOpenTelemetryTraceIds() {
|
|
|
7074
8609
|
//#region src/core/trace-context.storage.ts
|
|
7075
8610
|
const traceContextStorage = new AsyncLocalStorage();
|
|
7076
8611
|
//#endregion
|
|
7077
|
-
//#region \0@oxc-project+runtime@0.
|
|
8612
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorate.js
|
|
7078
8613
|
function __decorate(decorators, target, key, desc) {
|
|
7079
8614
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
7080
8615
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -7108,13 +8643,12 @@ let TraceContextService = class TraceContextService {
|
|
|
7108
8643
|
};
|
|
7109
8644
|
TraceContextService = __decorate([Injectable()], TraceContextService);
|
|
7110
8645
|
//#endregion
|
|
7111
|
-
//#region \0@oxc-project+runtime@0.
|
|
8646
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorateMetadata.js
|
|
7112
8647
|
function __decorateMetadata(k, v) {
|
|
7113
8648
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
7114
8649
|
}
|
|
7115
8650
|
//#endregion
|
|
7116
8651
|
//#region src/core/logger.service.ts
|
|
7117
|
-
var _ref$2;
|
|
7118
8652
|
const PINO_LEVEL_TO_LOG_LEVEL = {
|
|
7119
8653
|
60: "error",
|
|
7120
8654
|
50: "error",
|
|
@@ -7124,6 +8658,11 @@ const PINO_LEVEL_TO_LOG_LEVEL = {
|
|
|
7124
8658
|
10: "verbose"
|
|
7125
8659
|
};
|
|
7126
8660
|
let LoggerService = class LoggerService {
|
|
8661
|
+
config;
|
|
8662
|
+
formatter;
|
|
8663
|
+
writer;
|
|
8664
|
+
contextResolver;
|
|
8665
|
+
traceContextService;
|
|
7127
8666
|
context;
|
|
7128
8667
|
constructor(config, formatter, writer, contextResolver, traceContextService) {
|
|
7129
8668
|
this.config = config;
|
|
@@ -7193,10 +8732,10 @@ LoggerService = __decorate([Injectable(), __decorateMetadata("design:paramtypes"
|
|
|
7193
8732
|
Object,
|
|
7194
8733
|
Object,
|
|
7195
8734
|
Object,
|
|
7196
|
-
typeof
|
|
8735
|
+
typeof TraceContextService === "undefined" ? Object : TraceContextService
|
|
7197
8736
|
])], LoggerService);
|
|
7198
8737
|
//#endregion
|
|
7199
|
-
//#region \0@oxc-project+runtime@0.
|
|
8738
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorateParam.js
|
|
7200
8739
|
function __decorateParam(paramIndex, decorator) {
|
|
7201
8740
|
return function(target, key) {
|
|
7202
8741
|
decorator(target, key, paramIndex);
|
|
@@ -7204,8 +8743,12 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
7204
8743
|
}
|
|
7205
8744
|
//#endregion
|
|
7206
8745
|
//#region src/core/http-logger.interceptor.ts
|
|
7207
|
-
var _ref$1, _ref2$1;
|
|
7208
8746
|
let HttpLoggerInterceptor = class HttpLoggerInterceptor {
|
|
8747
|
+
logger;
|
|
8748
|
+
dataSanitizer;
|
|
8749
|
+
requestIdGenerator;
|
|
8750
|
+
config;
|
|
8751
|
+
reflector;
|
|
7209
8752
|
hostname = hostname();
|
|
7210
8753
|
pid = process.pid;
|
|
7211
8754
|
constructor(logger, dataSanitizer, requestIdGenerator, config, reflector) {
|
|
@@ -7355,11 +8898,11 @@ HttpLoggerInterceptor = __decorate([
|
|
|
7355
8898
|
Injectable(),
|
|
7356
8899
|
__decorateParam(3, Inject(LOGGER_CONFIG_TOKEN)),
|
|
7357
8900
|
__decorateMetadata("design:paramtypes", [
|
|
7358
|
-
typeof
|
|
8901
|
+
typeof LoggerService === "undefined" ? Object : LoggerService,
|
|
7359
8902
|
Object,
|
|
7360
8903
|
Object,
|
|
7361
8904
|
Object,
|
|
7362
|
-
typeof
|
|
8905
|
+
typeof Reflector === "undefined" ? Object : Reflector
|
|
7363
8906
|
])
|
|
7364
8907
|
], HttpLoggerInterceptor);
|
|
7365
8908
|
//#endregion
|
|
@@ -7382,6 +8925,7 @@ const getAllContextTokens = () => {
|
|
|
7382
8925
|
//#endregion
|
|
7383
8926
|
//#region src/formatters/base-formatter.ts
|
|
7384
8927
|
var BaseFormatter = class {
|
|
8928
|
+
options;
|
|
7385
8929
|
constructor(options) {
|
|
7386
8930
|
this.options = options;
|
|
7387
8931
|
}
|
|
@@ -7420,7 +8964,23 @@ let TextFormatter = class TextFormatter extends BaseFormatter {
|
|
|
7420
8964
|
return entry.trace ? this.addTrace(result, entry.trace) : result;
|
|
7421
8965
|
}
|
|
7422
8966
|
formatHttpRequest(entry) {
|
|
7423
|
-
|
|
8967
|
+
const parts = [];
|
|
8968
|
+
if (this.options.timestamp) parts.push(this.colorize(`[${new Date(entry.time).toISOString()}]`, "gray"));
|
|
8969
|
+
const level = entry.level >= 50 ? "error" : entry.level >= 40 ? "warn" : "info";
|
|
8970
|
+
parts.push(this.colorize(`[${level.toUpperCase()}]`, this.getColorForLevel(entry.level)));
|
|
8971
|
+
parts.push(this.colorize("[HTTP]", "cyan"));
|
|
8972
|
+
const { method, url, statusCode, responseTime } = {
|
|
8973
|
+
method: entry.req.method,
|
|
8974
|
+
url: entry.req.url,
|
|
8975
|
+
statusCode: entry.res.statusCode,
|
|
8976
|
+
responseTime: entry.responseTime
|
|
8977
|
+
};
|
|
8978
|
+
parts.push(this.colorize(`${method} ${url} ${statusCode} ${responseTime}ms`, "bright"));
|
|
8979
|
+
if (entry.traceId || entry.spanId) {
|
|
8980
|
+
const ids = [entry.traceId, entry.spanId].filter(Boolean).join("/");
|
|
8981
|
+
parts.push(this.colorize(`[${ids}]`, "magenta"));
|
|
8982
|
+
}
|
|
8983
|
+
return parts.join(" ");
|
|
7424
8984
|
}
|
|
7425
8985
|
buildLogParts(entry) {
|
|
7426
8986
|
const parts = [];
|
|
@@ -7599,14 +9159,19 @@ let ConsoleWriter = class ConsoleWriter {
|
|
|
7599
9159
|
ConsoleWriter = __decorate([Injectable()], ConsoleWriter);
|
|
7600
9160
|
//#endregion
|
|
7601
9161
|
//#region src/factories/dynamic-context-logger.factory.ts
|
|
7602
|
-
var _ref, _ref2, _ref3;
|
|
7603
9162
|
let DynamicContextLoggerFactory = class DynamicContextLoggerFactory {
|
|
9163
|
+
config;
|
|
9164
|
+
formatterFactory;
|
|
9165
|
+
writer;
|
|
9166
|
+
contextResolver;
|
|
9167
|
+
traceContextService;
|
|
7604
9168
|
loggerCache = /* @__PURE__ */ new Map();
|
|
7605
|
-
constructor(config, formatterFactory, writer, contextResolver) {
|
|
9169
|
+
constructor(config, formatterFactory, writer, contextResolver, traceContextService) {
|
|
7606
9170
|
this.config = config;
|
|
7607
9171
|
this.formatterFactory = formatterFactory;
|
|
7608
9172
|
this.writer = writer;
|
|
7609
9173
|
this.contextResolver = contextResolver;
|
|
9174
|
+
this.traceContextService = traceContextService;
|
|
7610
9175
|
}
|
|
7611
9176
|
createLogger(context) {
|
|
7612
9177
|
if (this.loggerCache.has(context)) return this.loggerCache.get(context);
|
|
@@ -7615,7 +9180,7 @@ let DynamicContextLoggerFactory = class DynamicContextLoggerFactory {
|
|
|
7615
9180
|
timestamp: this.config.timestamp,
|
|
7616
9181
|
context: this.config.context
|
|
7617
9182
|
});
|
|
7618
|
-
const logger = new LoggerService(this.config, formatter, this.writer, this.contextResolver);
|
|
9183
|
+
const logger = new LoggerService(this.config, formatter, this.writer, this.contextResolver, this.traceContextService);
|
|
7619
9184
|
logger.setContext(context);
|
|
7620
9185
|
this.loggerCache.set(context, logger);
|
|
7621
9186
|
return logger;
|
|
@@ -7626,14 +9191,16 @@ DynamicContextLoggerFactory = __decorate([
|
|
|
7626
9191
|
__decorateParam(0, Inject(LOGGER_CONFIG_TOKEN)),
|
|
7627
9192
|
__decorateMetadata("design:paramtypes", [
|
|
7628
9193
|
Object,
|
|
7629
|
-
typeof
|
|
7630
|
-
typeof
|
|
7631
|
-
typeof
|
|
9194
|
+
typeof FormatterFactory === "undefined" ? Object : FormatterFactory,
|
|
9195
|
+
typeof ConsoleWriter === "undefined" ? Object : ConsoleWriter,
|
|
9196
|
+
typeof ContextResolver === "undefined" ? Object : ContextResolver,
|
|
9197
|
+
typeof TraceContextService === "undefined" ? Object : TraceContextService
|
|
7632
9198
|
])
|
|
7633
9199
|
], DynamicContextLoggerFactory);
|
|
7634
9200
|
//#endregion
|
|
7635
9201
|
//#region src/utils/data-sanitizer.ts
|
|
7636
9202
|
let DataSanitizer = class DataSanitizer {
|
|
9203
|
+
sensitiveFields;
|
|
7637
9204
|
redactedValue = "[REDACTED]";
|
|
7638
9205
|
constructor(sensitiveFields) {
|
|
7639
9206
|
this.sensitiveFields = sensitiveFields;
|