@trigger.dev/redis-worker 4.5.0-rc.4 → 4.5.0-rc.5
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 +891 -875
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.js +890 -874
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3617,12 +3617,12 @@ var require_common = __commonJS({
|
|
|
3617
3617
|
if (!debug.enabled) {
|
|
3618
3618
|
return;
|
|
3619
3619
|
}
|
|
3620
|
-
const
|
|
3620
|
+
const self2 = debug;
|
|
3621
3621
|
const curr = Number(/* @__PURE__ */ new Date());
|
|
3622
3622
|
const ms = curr - (prevTime || curr);
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3623
|
+
self2.diff = ms;
|
|
3624
|
+
self2.prev = prevTime;
|
|
3625
|
+
self2.curr = curr;
|
|
3626
3626
|
prevTime = curr;
|
|
3627
3627
|
args[0] = createDebug.coerce(args[0]);
|
|
3628
3628
|
if (typeof args[0] !== "string") {
|
|
@@ -3637,15 +3637,15 @@ var require_common = __commonJS({
|
|
|
3637
3637
|
const formatter = createDebug.formatters[format];
|
|
3638
3638
|
if (typeof formatter === "function") {
|
|
3639
3639
|
const val = args[index];
|
|
3640
|
-
match = formatter.call(
|
|
3640
|
+
match = formatter.call(self2, val);
|
|
3641
3641
|
args.splice(index, 1);
|
|
3642
3642
|
index--;
|
|
3643
3643
|
}
|
|
3644
3644
|
return match;
|
|
3645
3645
|
});
|
|
3646
|
-
createDebug.formatArgs.call(
|
|
3647
|
-
const logFn =
|
|
3648
|
-
logFn.apply(
|
|
3646
|
+
createDebug.formatArgs.call(self2, args);
|
|
3647
|
+
const logFn = self2.log || createDebug.log;
|
|
3648
|
+
logFn.apply(self2, args);
|
|
3649
3649
|
}
|
|
3650
3650
|
debug.namespace = namespace;
|
|
3651
3651
|
debug.useColors = createDebug.useColors();
|
|
@@ -7193,7 +7193,7 @@ var require_cluster = __commonJS({
|
|
|
7193
7193
|
if (err) {
|
|
7194
7194
|
return reject(err);
|
|
7195
7195
|
}
|
|
7196
|
-
const
|
|
7196
|
+
const self2 = this, groupedRecords = (0, util_1.groupSrvRecords)(records), sortedKeys = Object.keys(groupedRecords).sort((a, b) => parseInt(a) - parseInt(b));
|
|
7197
7197
|
function tryFirstOne(err2) {
|
|
7198
7198
|
if (!sortedKeys.length) {
|
|
7199
7199
|
return reject(err2);
|
|
@@ -7202,7 +7202,7 @@ var require_cluster = __commonJS({
|
|
|
7202
7202
|
if (!group.records.length) {
|
|
7203
7203
|
sortedKeys.shift();
|
|
7204
7204
|
}
|
|
7205
|
-
|
|
7205
|
+
self2.dnsLookup(record.name).then((host) => resolve({
|
|
7206
7206
|
host,
|
|
7207
7207
|
port: record.port
|
|
7208
7208
|
}), tryFirstOne);
|
|
@@ -8409,15 +8409,15 @@ var require_event_handler = __commonJS({
|
|
|
8409
8409
|
var utils_1 = require_utils2();
|
|
8410
8410
|
var DataHandler_1 = require_DataHandler();
|
|
8411
8411
|
var debug = (0, utils_1.Debug)("connection");
|
|
8412
|
-
function connectHandler(
|
|
8412
|
+
function connectHandler(self2) {
|
|
8413
8413
|
return function() {
|
|
8414
|
-
|
|
8415
|
-
|
|
8414
|
+
self2.setStatus("connect");
|
|
8415
|
+
self2.resetCommandQueue();
|
|
8416
8416
|
let flushed = false;
|
|
8417
|
-
const { connectionEpoch } =
|
|
8418
|
-
if (
|
|
8419
|
-
|
|
8420
|
-
if (connectionEpoch !==
|
|
8417
|
+
const { connectionEpoch } = self2;
|
|
8418
|
+
if (self2.condition.auth) {
|
|
8419
|
+
self2.auth(self2.condition.auth, function(err) {
|
|
8420
|
+
if (connectionEpoch !== self2.connectionEpoch) {
|
|
8421
8421
|
return;
|
|
8422
8422
|
}
|
|
8423
8423
|
if (err) {
|
|
@@ -8429,36 +8429,36 @@ var require_event_handler = __commonJS({
|
|
|
8429
8429
|
console.warn(`[ERROR] The server returned "wrong number of arguments for 'auth' command". You are probably passing both username and password to Redis version 5 or below. You should only pass the 'password' option for Redis version 5 and under.`);
|
|
8430
8430
|
} else {
|
|
8431
8431
|
flushed = true;
|
|
8432
|
-
|
|
8432
|
+
self2.recoverFromFatalError(err, err);
|
|
8433
8433
|
}
|
|
8434
8434
|
}
|
|
8435
8435
|
});
|
|
8436
8436
|
}
|
|
8437
|
-
if (
|
|
8438
|
-
|
|
8439
|
-
|
|
8437
|
+
if (self2.condition.select) {
|
|
8438
|
+
self2.select(self2.condition.select).catch((err) => {
|
|
8439
|
+
self2.silentEmit("error", err);
|
|
8440
8440
|
});
|
|
8441
8441
|
}
|
|
8442
|
-
if (!
|
|
8443
|
-
exports$1.readyHandler(
|
|
8442
|
+
if (!self2.options.enableReadyCheck) {
|
|
8443
|
+
exports$1.readyHandler(self2)();
|
|
8444
8444
|
}
|
|
8445
|
-
new DataHandler_1.default(
|
|
8446
|
-
stringNumbers:
|
|
8445
|
+
new DataHandler_1.default(self2, {
|
|
8446
|
+
stringNumbers: self2.options.stringNumbers
|
|
8447
8447
|
});
|
|
8448
|
-
if (
|
|
8449
|
-
|
|
8450
|
-
if (connectionEpoch !==
|
|
8448
|
+
if (self2.options.enableReadyCheck) {
|
|
8449
|
+
self2._readyCheck(function(err, info) {
|
|
8450
|
+
if (connectionEpoch !== self2.connectionEpoch) {
|
|
8451
8451
|
return;
|
|
8452
8452
|
}
|
|
8453
8453
|
if (err) {
|
|
8454
8454
|
if (!flushed) {
|
|
8455
|
-
|
|
8455
|
+
self2.recoverFromFatalError(new Error("Ready check failed: " + err.message), err);
|
|
8456
8456
|
}
|
|
8457
8457
|
} else {
|
|
8458
|
-
if (
|
|
8459
|
-
exports$1.readyHandler(
|
|
8458
|
+
if (self2.connector.check(info)) {
|
|
8459
|
+
exports$1.readyHandler(self2)();
|
|
8460
8460
|
} else {
|
|
8461
|
-
|
|
8461
|
+
self2.disconnect(true);
|
|
8462
8462
|
}
|
|
8463
8463
|
}
|
|
8464
8464
|
});
|
|
@@ -8511,152 +8511,152 @@ var require_event_handler = __commonJS({
|
|
|
8511
8511
|
}
|
|
8512
8512
|
}
|
|
8513
8513
|
}
|
|
8514
|
-
function closeHandler(
|
|
8514
|
+
function closeHandler(self2) {
|
|
8515
8515
|
return function() {
|
|
8516
|
-
const prevStatus =
|
|
8517
|
-
|
|
8518
|
-
if (
|
|
8519
|
-
abortIncompletePipelines(
|
|
8516
|
+
const prevStatus = self2.status;
|
|
8517
|
+
self2.setStatus("close");
|
|
8518
|
+
if (self2.commandQueue.length) {
|
|
8519
|
+
abortIncompletePipelines(self2.commandQueue);
|
|
8520
8520
|
}
|
|
8521
|
-
if (
|
|
8522
|
-
abortTransactionFragments(
|
|
8521
|
+
if (self2.offlineQueue.length) {
|
|
8522
|
+
abortTransactionFragments(self2.offlineQueue);
|
|
8523
8523
|
}
|
|
8524
8524
|
if (prevStatus === "ready") {
|
|
8525
|
-
if (!
|
|
8526
|
-
|
|
8525
|
+
if (!self2.prevCondition) {
|
|
8526
|
+
self2.prevCondition = self2.condition;
|
|
8527
8527
|
}
|
|
8528
|
-
if (
|
|
8529
|
-
|
|
8528
|
+
if (self2.commandQueue.length) {
|
|
8529
|
+
self2.prevCommandQueue = self2.commandQueue;
|
|
8530
8530
|
}
|
|
8531
8531
|
}
|
|
8532
|
-
if (
|
|
8533
|
-
|
|
8532
|
+
if (self2.manuallyClosing) {
|
|
8533
|
+
self2.manuallyClosing = false;
|
|
8534
8534
|
debug("skip reconnecting since the connection is manually closed.");
|
|
8535
8535
|
return close();
|
|
8536
8536
|
}
|
|
8537
|
-
if (typeof
|
|
8537
|
+
if (typeof self2.options.retryStrategy !== "function") {
|
|
8538
8538
|
debug("skip reconnecting because `retryStrategy` is not a function");
|
|
8539
8539
|
return close();
|
|
8540
8540
|
}
|
|
8541
|
-
const retryDelay =
|
|
8541
|
+
const retryDelay = self2.options.retryStrategy(++self2.retryAttempts);
|
|
8542
8542
|
if (typeof retryDelay !== "number") {
|
|
8543
8543
|
debug("skip reconnecting because `retryStrategy` doesn't return a number");
|
|
8544
8544
|
return close();
|
|
8545
8545
|
}
|
|
8546
8546
|
debug("reconnect in %sms", retryDelay);
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8547
|
+
self2.setStatus("reconnecting", retryDelay);
|
|
8548
|
+
self2.reconnectTimeout = setTimeout(function() {
|
|
8549
|
+
self2.reconnectTimeout = null;
|
|
8550
|
+
self2.connect().catch(utils_1.noop);
|
|
8551
8551
|
}, retryDelay);
|
|
8552
|
-
const { maxRetriesPerRequest } =
|
|
8552
|
+
const { maxRetriesPerRequest } = self2.options;
|
|
8553
8553
|
if (typeof maxRetriesPerRequest === "number") {
|
|
8554
8554
|
if (maxRetriesPerRequest < 0) {
|
|
8555
8555
|
debug("maxRetriesPerRequest is negative, ignoring...");
|
|
8556
8556
|
} else {
|
|
8557
|
-
const remainder =
|
|
8557
|
+
const remainder = self2.retryAttempts % (maxRetriesPerRequest + 1);
|
|
8558
8558
|
if (remainder === 0) {
|
|
8559
8559
|
debug("reach maxRetriesPerRequest limitation, flushing command queue...");
|
|
8560
|
-
|
|
8560
|
+
self2.flushQueue(new errors_1.MaxRetriesPerRequestError(maxRetriesPerRequest));
|
|
8561
8561
|
}
|
|
8562
8562
|
}
|
|
8563
8563
|
}
|
|
8564
8564
|
};
|
|
8565
8565
|
function close() {
|
|
8566
|
-
|
|
8567
|
-
|
|
8566
|
+
self2.setStatus("end");
|
|
8567
|
+
self2.flushQueue(new Error(utils_1.CONNECTION_CLOSED_ERROR_MSG));
|
|
8568
8568
|
}
|
|
8569
8569
|
}
|
|
8570
8570
|
exports$1.closeHandler = closeHandler;
|
|
8571
|
-
function errorHandler(
|
|
8571
|
+
function errorHandler(self2) {
|
|
8572
8572
|
return function(error) {
|
|
8573
8573
|
debug("error: %s", error);
|
|
8574
|
-
|
|
8574
|
+
self2.silentEmit("error", error);
|
|
8575
8575
|
};
|
|
8576
8576
|
}
|
|
8577
8577
|
exports$1.errorHandler = errorHandler;
|
|
8578
|
-
function readyHandler(
|
|
8578
|
+
function readyHandler(self2) {
|
|
8579
8579
|
return function() {
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
if (
|
|
8583
|
-
|
|
8584
|
-
const { sendCommand } =
|
|
8585
|
-
|
|
8580
|
+
self2.setStatus("ready");
|
|
8581
|
+
self2.retryAttempts = 0;
|
|
8582
|
+
if (self2.options.monitor) {
|
|
8583
|
+
self2.call("monitor").then(() => self2.setStatus("monitoring"), (error) => self2.emit("error", error));
|
|
8584
|
+
const { sendCommand } = self2;
|
|
8585
|
+
self2.sendCommand = function(command) {
|
|
8586
8586
|
if (Command_1.default.checkFlag("VALID_IN_MONITOR_MODE", command.name)) {
|
|
8587
|
-
return sendCommand.call(
|
|
8587
|
+
return sendCommand.call(self2, command);
|
|
8588
8588
|
}
|
|
8589
8589
|
command.reject(new Error("Connection is in monitoring mode, can't process commands."));
|
|
8590
8590
|
return command.promise;
|
|
8591
8591
|
};
|
|
8592
|
-
|
|
8593
|
-
delete
|
|
8592
|
+
self2.once("close", function() {
|
|
8593
|
+
delete self2.sendCommand;
|
|
8594
8594
|
});
|
|
8595
8595
|
return;
|
|
8596
8596
|
}
|
|
8597
|
-
const finalSelect =
|
|
8598
|
-
if (
|
|
8599
|
-
debug("set the connection name [%s]",
|
|
8600
|
-
|
|
8597
|
+
const finalSelect = self2.prevCondition ? self2.prevCondition.select : self2.condition.select;
|
|
8598
|
+
if (self2.options.connectionName) {
|
|
8599
|
+
debug("set the connection name [%s]", self2.options.connectionName);
|
|
8600
|
+
self2.client("setname", self2.options.connectionName).catch(utils_1.noop);
|
|
8601
8601
|
}
|
|
8602
|
-
if (
|
|
8602
|
+
if (self2.options.readOnly) {
|
|
8603
8603
|
debug("set the connection to readonly mode");
|
|
8604
|
-
|
|
8604
|
+
self2.readonly().catch(utils_1.noop);
|
|
8605
8605
|
}
|
|
8606
|
-
if (
|
|
8607
|
-
const condition =
|
|
8608
|
-
|
|
8609
|
-
if (condition.subscriber &&
|
|
8610
|
-
if (
|
|
8606
|
+
if (self2.prevCondition) {
|
|
8607
|
+
const condition = self2.prevCondition;
|
|
8608
|
+
self2.prevCondition = null;
|
|
8609
|
+
if (condition.subscriber && self2.options.autoResubscribe) {
|
|
8610
|
+
if (self2.condition.select !== finalSelect) {
|
|
8611
8611
|
debug("connect to db [%d]", finalSelect);
|
|
8612
|
-
|
|
8612
|
+
self2.select(finalSelect);
|
|
8613
8613
|
}
|
|
8614
8614
|
const subscribeChannels = condition.subscriber.channels("subscribe");
|
|
8615
8615
|
if (subscribeChannels.length) {
|
|
8616
8616
|
debug("subscribe %d channels", subscribeChannels.length);
|
|
8617
|
-
|
|
8617
|
+
self2.subscribe(subscribeChannels);
|
|
8618
8618
|
}
|
|
8619
8619
|
const psubscribeChannels = condition.subscriber.channels("psubscribe");
|
|
8620
8620
|
if (psubscribeChannels.length) {
|
|
8621
8621
|
debug("psubscribe %d channels", psubscribeChannels.length);
|
|
8622
|
-
|
|
8622
|
+
self2.psubscribe(psubscribeChannels);
|
|
8623
8623
|
}
|
|
8624
8624
|
const ssubscribeChannels = condition.subscriber.channels("ssubscribe");
|
|
8625
8625
|
if (ssubscribeChannels.length) {
|
|
8626
8626
|
debug("ssubscribe %d channels", ssubscribeChannels.length);
|
|
8627
|
-
|
|
8627
|
+
self2.ssubscribe(ssubscribeChannels);
|
|
8628
8628
|
}
|
|
8629
8629
|
}
|
|
8630
8630
|
}
|
|
8631
|
-
if (
|
|
8632
|
-
if (
|
|
8633
|
-
debug("resend %d unfulfilled commands",
|
|
8634
|
-
while (
|
|
8635
|
-
const item =
|
|
8636
|
-
if (item.select !==
|
|
8637
|
-
|
|
8631
|
+
if (self2.prevCommandQueue) {
|
|
8632
|
+
if (self2.options.autoResendUnfulfilledCommands) {
|
|
8633
|
+
debug("resend %d unfulfilled commands", self2.prevCommandQueue.length);
|
|
8634
|
+
while (self2.prevCommandQueue.length > 0) {
|
|
8635
|
+
const item = self2.prevCommandQueue.shift();
|
|
8636
|
+
if (item.select !== self2.condition.select && item.command.name !== "select") {
|
|
8637
|
+
self2.select(item.select);
|
|
8638
8638
|
}
|
|
8639
|
-
|
|
8639
|
+
self2.sendCommand(item.command, item.stream);
|
|
8640
8640
|
}
|
|
8641
8641
|
} else {
|
|
8642
|
-
|
|
8642
|
+
self2.prevCommandQueue = null;
|
|
8643
8643
|
}
|
|
8644
8644
|
}
|
|
8645
|
-
if (
|
|
8646
|
-
debug("send %d commands in offline queue",
|
|
8647
|
-
const offlineQueue =
|
|
8648
|
-
|
|
8645
|
+
if (self2.offlineQueue.length) {
|
|
8646
|
+
debug("send %d commands in offline queue", self2.offlineQueue.length);
|
|
8647
|
+
const offlineQueue = self2.offlineQueue;
|
|
8648
|
+
self2.resetOfflineQueue();
|
|
8649
8649
|
while (offlineQueue.length > 0) {
|
|
8650
8650
|
const item = offlineQueue.shift();
|
|
8651
|
-
if (item.select !==
|
|
8652
|
-
|
|
8651
|
+
if (item.select !== self2.condition.select && item.command.name !== "select") {
|
|
8652
|
+
self2.select(item.select);
|
|
8653
8653
|
}
|
|
8654
|
-
|
|
8654
|
+
self2.sendCommand(item.command, item.stream);
|
|
8655
8655
|
}
|
|
8656
8656
|
}
|
|
8657
|
-
if (
|
|
8657
|
+
if (self2.condition.select !== finalSelect) {
|
|
8658
8658
|
debug("connect to db [%d]", finalSelect);
|
|
8659
|
-
|
|
8659
|
+
self2.select(finalSelect);
|
|
8660
8660
|
}
|
|
8661
8661
|
};
|
|
8662
8662
|
}
|
|
@@ -9952,24 +9952,19 @@ var SimpleQueue = class {
|
|
|
9952
9952
|
}
|
|
9953
9953
|
};
|
|
9954
9954
|
|
|
9955
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
9956
|
-
var
|
|
9955
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/version.js
|
|
9956
|
+
var VERSION = "1.9.1";
|
|
9957
9957
|
|
|
9958
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
9959
|
-
var VERSION = "1.9.0";
|
|
9960
|
-
|
|
9961
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
9958
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
9962
9959
|
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
9963
9960
|
function _makeCompatibilityCheck(ownVersion) {
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9961
|
+
const acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
|
|
9962
|
+
const rejectedVersions = /* @__PURE__ */ new Set();
|
|
9963
|
+
const myVersionMatch = ownVersion.match(re);
|
|
9967
9964
|
if (!myVersionMatch) {
|
|
9968
|
-
return
|
|
9969
|
-
return false;
|
|
9970
|
-
};
|
|
9965
|
+
return () => false;
|
|
9971
9966
|
}
|
|
9972
|
-
|
|
9967
|
+
const ownVersionParsed = {
|
|
9973
9968
|
major: +myVersionMatch[1],
|
|
9974
9969
|
minor: +myVersionMatch[2],
|
|
9975
9970
|
patch: +myVersionMatch[3],
|
|
@@ -9995,11 +9990,11 @@ function _makeCompatibilityCheck(ownVersion) {
|
|
|
9995
9990
|
if (rejectedVersions.has(globalVersion)) {
|
|
9996
9991
|
return false;
|
|
9997
9992
|
}
|
|
9998
|
-
|
|
9993
|
+
const globalVersionMatch = globalVersion.match(re);
|
|
9999
9994
|
if (!globalVersionMatch) {
|
|
10000
9995
|
return _reject(globalVersion);
|
|
10001
9996
|
}
|
|
10002
|
-
|
|
9997
|
+
const globalVersionParsed = {
|
|
10003
9998
|
major: +globalVersionMatch[1],
|
|
10004
9999
|
minor: +globalVersionMatch[2],
|
|
10005
10000
|
patch: +globalVersionMatch[3],
|
|
@@ -10025,129 +10020,75 @@ function _makeCompatibilityCheck(ownVersion) {
|
|
|
10025
10020
|
}
|
|
10026
10021
|
var isCompatible = _makeCompatibilityCheck(VERSION);
|
|
10027
10022
|
|
|
10028
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10023
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
|
|
10029
10024
|
var major = VERSION.split(".")[0];
|
|
10030
|
-
var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(
|
|
10031
|
-
var _global =
|
|
10032
|
-
function registerGlobal(type, instance, diag, allowOverride) {
|
|
10025
|
+
var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);
|
|
10026
|
+
var _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
10027
|
+
function registerGlobal(type, instance, diag, allowOverride = false) {
|
|
10033
10028
|
var _a;
|
|
10034
|
-
|
|
10035
|
-
allowOverride = false;
|
|
10036
|
-
}
|
|
10037
|
-
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
|
10029
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
|
10038
10030
|
version: VERSION
|
|
10039
10031
|
};
|
|
10040
10032
|
if (!allowOverride && api[type]) {
|
|
10041
|
-
|
|
10033
|
+
const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);
|
|
10042
10034
|
diag.error(err.stack || err.message);
|
|
10043
10035
|
return false;
|
|
10044
10036
|
}
|
|
10045
10037
|
if (api.version !== VERSION) {
|
|
10046
|
-
|
|
10038
|
+
const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);
|
|
10047
10039
|
diag.error(err.stack || err.message);
|
|
10048
10040
|
return false;
|
|
10049
10041
|
}
|
|
10050
10042
|
api[type] = instance;
|
|
10051
|
-
diag.debug(
|
|
10043
|
+
diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);
|
|
10052
10044
|
return true;
|
|
10053
10045
|
}
|
|
10054
10046
|
function getGlobal(type) {
|
|
10055
10047
|
var _a, _b;
|
|
10056
|
-
|
|
10048
|
+
const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
|
|
10057
10049
|
if (!globalVersion || !isCompatible(globalVersion)) {
|
|
10058
10050
|
return;
|
|
10059
10051
|
}
|
|
10060
10052
|
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
|
10061
10053
|
}
|
|
10062
10054
|
function unregisterGlobal(type, diag) {
|
|
10063
|
-
diag.debug(
|
|
10064
|
-
|
|
10055
|
+
diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);
|
|
10056
|
+
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
10065
10057
|
if (api) {
|
|
10066
10058
|
delete api[type];
|
|
10067
10059
|
}
|
|
10068
10060
|
}
|
|
10069
10061
|
|
|
10070
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10071
|
-
var
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
var i = m.call(o), r, ar = [], e;
|
|
10075
|
-
try {
|
|
10076
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
10077
|
-
} catch (error) {
|
|
10078
|
-
e = { error };
|
|
10079
|
-
} finally {
|
|
10080
|
-
try {
|
|
10081
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
10082
|
-
} finally {
|
|
10083
|
-
if (e) throw e.error;
|
|
10084
|
-
}
|
|
10062
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
|
|
10063
|
+
var DiagComponentLogger = class {
|
|
10064
|
+
constructor(props) {
|
|
10065
|
+
this._namespace = props.namespace || "DiagComponentLogger";
|
|
10085
10066
|
}
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10067
|
+
debug(...args) {
|
|
10068
|
+
return logProxy("debug", this._namespace, args);
|
|
10069
|
+
}
|
|
10070
|
+
error(...args) {
|
|
10071
|
+
return logProxy("error", this._namespace, args);
|
|
10072
|
+
}
|
|
10073
|
+
info(...args) {
|
|
10074
|
+
return logProxy("info", this._namespace, args);
|
|
10075
|
+
}
|
|
10076
|
+
warn(...args) {
|
|
10077
|
+
return logProxy("warn", this._namespace, args);
|
|
10078
|
+
}
|
|
10079
|
+
verbose(...args) {
|
|
10080
|
+
return logProxy("verbose", this._namespace, args);
|
|
10094
10081
|
}
|
|
10095
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10096
10082
|
};
|
|
10097
|
-
var DiagComponentLogger = (
|
|
10098
|
-
/** @class */
|
|
10099
|
-
function() {
|
|
10100
|
-
function DiagComponentLogger2(props) {
|
|
10101
|
-
this._namespace = props.namespace || "DiagComponentLogger";
|
|
10102
|
-
}
|
|
10103
|
-
DiagComponentLogger2.prototype.debug = function() {
|
|
10104
|
-
var args = [];
|
|
10105
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10106
|
-
args[_i] = arguments[_i];
|
|
10107
|
-
}
|
|
10108
|
-
return logProxy("debug", this._namespace, args);
|
|
10109
|
-
};
|
|
10110
|
-
DiagComponentLogger2.prototype.error = function() {
|
|
10111
|
-
var args = [];
|
|
10112
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10113
|
-
args[_i] = arguments[_i];
|
|
10114
|
-
}
|
|
10115
|
-
return logProxy("error", this._namespace, args);
|
|
10116
|
-
};
|
|
10117
|
-
DiagComponentLogger2.prototype.info = function() {
|
|
10118
|
-
var args = [];
|
|
10119
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10120
|
-
args[_i] = arguments[_i];
|
|
10121
|
-
}
|
|
10122
|
-
return logProxy("info", this._namespace, args);
|
|
10123
|
-
};
|
|
10124
|
-
DiagComponentLogger2.prototype.warn = function() {
|
|
10125
|
-
var args = [];
|
|
10126
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10127
|
-
args[_i] = arguments[_i];
|
|
10128
|
-
}
|
|
10129
|
-
return logProxy("warn", this._namespace, args);
|
|
10130
|
-
};
|
|
10131
|
-
DiagComponentLogger2.prototype.verbose = function() {
|
|
10132
|
-
var args = [];
|
|
10133
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10134
|
-
args[_i] = arguments[_i];
|
|
10135
|
-
}
|
|
10136
|
-
return logProxy("verbose", this._namespace, args);
|
|
10137
|
-
};
|
|
10138
|
-
return DiagComponentLogger2;
|
|
10139
|
-
}()
|
|
10140
|
-
);
|
|
10141
10083
|
function logProxy(funcName, namespace, args) {
|
|
10142
|
-
|
|
10084
|
+
const logger2 = getGlobal("diag");
|
|
10143
10085
|
if (!logger2) {
|
|
10144
10086
|
return;
|
|
10145
10087
|
}
|
|
10146
|
-
|
|
10147
|
-
return logger2[funcName].apply(logger2, __spreadArray([], __read(args), false));
|
|
10088
|
+
return logger2[funcName](namespace, ...args);
|
|
10148
10089
|
}
|
|
10149
10090
|
|
|
10150
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10091
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js
|
|
10151
10092
|
var DiagLogLevel;
|
|
10152
10093
|
(function(DiagLogLevel2) {
|
|
10153
10094
|
DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
|
|
@@ -10159,7 +10100,7 @@ var DiagLogLevel;
|
|
|
10159
10100
|
DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL";
|
|
10160
10101
|
})(DiagLogLevel || (DiagLogLevel = {}));
|
|
10161
10102
|
|
|
10162
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10103
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
|
|
10163
10104
|
function createLogLevelDiagLogger(maxLevel, logger2) {
|
|
10164
10105
|
if (maxLevel < DiagLogLevel.NONE) {
|
|
10165
10106
|
maxLevel = DiagLogLevel.NONE;
|
|
@@ -10168,7 +10109,7 @@ function createLogLevelDiagLogger(maxLevel, logger2) {
|
|
|
10168
10109
|
}
|
|
10169
10110
|
logger2 = logger2 || {};
|
|
10170
10111
|
function _filterFunc(funcName, theLevel) {
|
|
10171
|
-
|
|
10112
|
+
const theFunc = logger2[funcName];
|
|
10172
10113
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
10173
10114
|
return theFunc.bind(logger2);
|
|
10174
10115
|
}
|
|
@@ -10184,278 +10125,181 @@ function createLogLevelDiagLogger(maxLevel, logger2) {
|
|
|
10184
10125
|
};
|
|
10185
10126
|
}
|
|
10186
10127
|
|
|
10187
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10188
|
-
var
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
} catch (error) {
|
|
10195
|
-
e = { error };
|
|
10196
|
-
} finally {
|
|
10197
|
-
try {
|
|
10198
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
10199
|
-
} finally {
|
|
10200
|
-
if (e) throw e.error;
|
|
10128
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js
|
|
10129
|
+
var API_NAME = "diag";
|
|
10130
|
+
var DiagAPI = class _DiagAPI {
|
|
10131
|
+
/** Get the singleton instance of the DiagAPI API */
|
|
10132
|
+
static instance() {
|
|
10133
|
+
if (!this._instance) {
|
|
10134
|
+
this._instance = new _DiagAPI();
|
|
10201
10135
|
}
|
|
10136
|
+
return this._instance;
|
|
10202
10137
|
}
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10138
|
+
/**
|
|
10139
|
+
* Private internal constructor
|
|
10140
|
+
* @private
|
|
10141
|
+
*/
|
|
10142
|
+
constructor() {
|
|
10143
|
+
function _logProxy(funcName) {
|
|
10144
|
+
return function(...args) {
|
|
10145
|
+
const logger2 = getGlobal("diag");
|
|
10146
|
+
if (!logger2)
|
|
10147
|
+
return;
|
|
10148
|
+
return logger2[funcName](...args);
|
|
10149
|
+
};
|
|
10210
10150
|
}
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10223
|
-
args[_i] = arguments[_i];
|
|
10224
|
-
}
|
|
10225
|
-
var logger2 = getGlobal("diag");
|
|
10226
|
-
if (!logger2)
|
|
10227
|
-
return;
|
|
10228
|
-
return logger2[funcName].apply(logger2, __spreadArray2([], __read2(args), false));
|
|
10151
|
+
const self2 = this;
|
|
10152
|
+
const setLogger = (logger2, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {
|
|
10153
|
+
var _a, _b, _c;
|
|
10154
|
+
if (logger2 === self2) {
|
|
10155
|
+
const err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
10156
|
+
self2.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
10157
|
+
return false;
|
|
10158
|
+
}
|
|
10159
|
+
if (typeof optionsOrLogLevel === "number") {
|
|
10160
|
+
optionsOrLogLevel = {
|
|
10161
|
+
logLevel: optionsOrLogLevel
|
|
10229
10162
|
};
|
|
10230
10163
|
}
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
|
|
10236
|
-
}
|
|
10237
|
-
if (logger2 === self) {
|
|
10238
|
-
var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
10239
|
-
self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
10240
|
-
return false;
|
|
10241
|
-
}
|
|
10242
|
-
if (typeof optionsOrLogLevel === "number") {
|
|
10243
|
-
optionsOrLogLevel = {
|
|
10244
|
-
logLevel: optionsOrLogLevel
|
|
10245
|
-
};
|
|
10246
|
-
}
|
|
10247
|
-
var oldLogger = getGlobal("diag");
|
|
10248
|
-
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger2);
|
|
10249
|
-
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
10250
|
-
var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
10251
|
-
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
10252
|
-
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
10253
|
-
}
|
|
10254
|
-
return registerGlobal("diag", newLogger, self, true);
|
|
10255
|
-
};
|
|
10256
|
-
self.setLogger = setLogger;
|
|
10257
|
-
self.disable = function() {
|
|
10258
|
-
unregisterGlobal(API_NAME, self);
|
|
10259
|
-
};
|
|
10260
|
-
self.createComponentLogger = function(options) {
|
|
10261
|
-
return new DiagComponentLogger(options);
|
|
10262
|
-
};
|
|
10263
|
-
self.verbose = _logProxy("verbose");
|
|
10264
|
-
self.debug = _logProxy("debug");
|
|
10265
|
-
self.info = _logProxy("info");
|
|
10266
|
-
self.warn = _logProxy("warn");
|
|
10267
|
-
self.error = _logProxy("error");
|
|
10268
|
-
}
|
|
10269
|
-
DiagAPI2.instance = function() {
|
|
10270
|
-
if (!this._instance) {
|
|
10271
|
-
this._instance = new DiagAPI2();
|
|
10164
|
+
const oldLogger = getGlobal("diag");
|
|
10165
|
+
const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger2);
|
|
10166
|
+
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
10167
|
+
const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
10168
|
+
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
|
|
10169
|
+
newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);
|
|
10272
10170
|
}
|
|
10273
|
-
return
|
|
10171
|
+
return registerGlobal("diag", newLogger, self2, true);
|
|
10172
|
+
};
|
|
10173
|
+
self2.setLogger = setLogger;
|
|
10174
|
+
self2.disable = () => {
|
|
10175
|
+
unregisterGlobal(API_NAME, self2);
|
|
10274
10176
|
};
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10177
|
+
self2.createComponentLogger = (options) => {
|
|
10178
|
+
return new DiagComponentLogger(options);
|
|
10179
|
+
};
|
|
10180
|
+
self2.verbose = _logProxy("verbose");
|
|
10181
|
+
self2.debug = _logProxy("debug");
|
|
10182
|
+
self2.info = _logProxy("info");
|
|
10183
|
+
self2.warn = _logProxy("warn");
|
|
10184
|
+
self2.error = _logProxy("error");
|
|
10185
|
+
}
|
|
10186
|
+
};
|
|
10278
10187
|
|
|
10279
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10188
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js
|
|
10280
10189
|
function createContextKey(description) {
|
|
10281
10190
|
return Symbol.for(description);
|
|
10282
10191
|
}
|
|
10283
|
-
var BaseContext =
|
|
10284
|
-
/**
|
|
10285
|
-
|
|
10286
|
-
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
self.deleteValue = function(key) {
|
|
10298
|
-
var context2 = new BaseContext2(self._currentContext);
|
|
10299
|
-
context2._currentContext.delete(key);
|
|
10300
|
-
return context2;
|
|
10301
|
-
};
|
|
10302
|
-
}
|
|
10303
|
-
return BaseContext2;
|
|
10304
|
-
}()
|
|
10305
|
-
);
|
|
10306
|
-
var ROOT_CONTEXT = new BaseContext();
|
|
10307
|
-
|
|
10308
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js
|
|
10309
|
-
var __extends = /* @__PURE__ */ function() {
|
|
10310
|
-
var extendStatics = function(d, b) {
|
|
10311
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
10312
|
-
d2.__proto__ = b2;
|
|
10313
|
-
} || function(d2, b2) {
|
|
10314
|
-
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
|
|
10315
|
-
};
|
|
10316
|
-
return extendStatics(d, b);
|
|
10317
|
-
};
|
|
10318
|
-
return function(d, b) {
|
|
10319
|
-
if (typeof b !== "function" && b !== null)
|
|
10320
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10321
|
-
extendStatics(d, b);
|
|
10322
|
-
function __() {
|
|
10323
|
-
this.constructor = d;
|
|
10324
|
-
}
|
|
10325
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
10326
|
-
};
|
|
10327
|
-
}();
|
|
10328
|
-
var NoopMeter = (
|
|
10329
|
-
/** @class */
|
|
10330
|
-
function() {
|
|
10331
|
-
function NoopMeter2() {
|
|
10332
|
-
}
|
|
10333
|
-
NoopMeter2.prototype.createGauge = function(_name, _options) {
|
|
10334
|
-
return NOOP_GAUGE_METRIC;
|
|
10335
|
-
};
|
|
10336
|
-
NoopMeter2.prototype.createHistogram = function(_name, _options) {
|
|
10337
|
-
return NOOP_HISTOGRAM_METRIC;
|
|
10338
|
-
};
|
|
10339
|
-
NoopMeter2.prototype.createCounter = function(_name, _options) {
|
|
10340
|
-
return NOOP_COUNTER_METRIC;
|
|
10341
|
-
};
|
|
10342
|
-
NoopMeter2.prototype.createUpDownCounter = function(_name, _options) {
|
|
10343
|
-
return NOOP_UP_DOWN_COUNTER_METRIC;
|
|
10344
|
-
};
|
|
10345
|
-
NoopMeter2.prototype.createObservableGauge = function(_name, _options) {
|
|
10346
|
-
return NOOP_OBSERVABLE_GAUGE_METRIC;
|
|
10347
|
-
};
|
|
10348
|
-
NoopMeter2.prototype.createObservableCounter = function(_name, _options) {
|
|
10349
|
-
return NOOP_OBSERVABLE_COUNTER_METRIC;
|
|
10350
|
-
};
|
|
10351
|
-
NoopMeter2.prototype.createObservableUpDownCounter = function(_name, _options) {
|
|
10352
|
-
return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
10353
|
-
};
|
|
10354
|
-
NoopMeter2.prototype.addBatchObservableCallback = function(_callback, _observables) {
|
|
10355
|
-
};
|
|
10356
|
-
NoopMeter2.prototype.removeBatchObservableCallback = function(_callback) {
|
|
10357
|
-
};
|
|
10358
|
-
return NoopMeter2;
|
|
10359
|
-
}()
|
|
10360
|
-
);
|
|
10361
|
-
var NoopMetric = (
|
|
10362
|
-
/** @class */
|
|
10363
|
-
/* @__PURE__ */ function() {
|
|
10364
|
-
function NoopMetric2() {
|
|
10365
|
-
}
|
|
10366
|
-
return NoopMetric2;
|
|
10367
|
-
}()
|
|
10368
|
-
);
|
|
10369
|
-
var NoopCounterMetric = (
|
|
10370
|
-
/** @class */
|
|
10371
|
-
function(_super) {
|
|
10372
|
-
__extends(NoopCounterMetric2, _super);
|
|
10373
|
-
function NoopCounterMetric2() {
|
|
10374
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
10375
|
-
}
|
|
10376
|
-
NoopCounterMetric2.prototype.add = function(_value, _attributes) {
|
|
10377
|
-
};
|
|
10378
|
-
return NoopCounterMetric2;
|
|
10379
|
-
}(NoopMetric)
|
|
10380
|
-
);
|
|
10381
|
-
var NoopUpDownCounterMetric = (
|
|
10382
|
-
/** @class */
|
|
10383
|
-
function(_super) {
|
|
10384
|
-
__extends(NoopUpDownCounterMetric2, _super);
|
|
10385
|
-
function NoopUpDownCounterMetric2() {
|
|
10386
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
10387
|
-
}
|
|
10388
|
-
NoopUpDownCounterMetric2.prototype.add = function(_value, _attributes) {
|
|
10389
|
-
};
|
|
10390
|
-
return NoopUpDownCounterMetric2;
|
|
10391
|
-
}(NoopMetric)
|
|
10392
|
-
);
|
|
10393
|
-
var NoopGaugeMetric = (
|
|
10394
|
-
/** @class */
|
|
10395
|
-
function(_super) {
|
|
10396
|
-
__extends(NoopGaugeMetric2, _super);
|
|
10397
|
-
function NoopGaugeMetric2() {
|
|
10398
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
10399
|
-
}
|
|
10400
|
-
NoopGaugeMetric2.prototype.record = function(_value, _attributes) {
|
|
10401
|
-
};
|
|
10402
|
-
return NoopGaugeMetric2;
|
|
10403
|
-
}(NoopMetric)
|
|
10404
|
-
);
|
|
10405
|
-
var NoopHistogramMetric = (
|
|
10406
|
-
/** @class */
|
|
10407
|
-
function(_super) {
|
|
10408
|
-
__extends(NoopHistogramMetric2, _super);
|
|
10409
|
-
function NoopHistogramMetric2() {
|
|
10410
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
10411
|
-
}
|
|
10412
|
-
NoopHistogramMetric2.prototype.record = function(_value, _attributes) {
|
|
10413
|
-
};
|
|
10414
|
-
return NoopHistogramMetric2;
|
|
10415
|
-
}(NoopMetric)
|
|
10416
|
-
);
|
|
10417
|
-
var NoopObservableMetric = (
|
|
10418
|
-
/** @class */
|
|
10419
|
-
function() {
|
|
10420
|
-
function NoopObservableMetric2() {
|
|
10421
|
-
}
|
|
10422
|
-
NoopObservableMetric2.prototype.addCallback = function(_callback) {
|
|
10192
|
+
var BaseContext = class _BaseContext {
|
|
10193
|
+
/**
|
|
10194
|
+
* Construct a new context which inherits values from an optional parent context.
|
|
10195
|
+
*
|
|
10196
|
+
* @param parentContext a context from which to inherit values
|
|
10197
|
+
*/
|
|
10198
|
+
constructor(parentContext) {
|
|
10199
|
+
const self2 = this;
|
|
10200
|
+
self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
|
10201
|
+
self2.getValue = (key) => self2._currentContext.get(key);
|
|
10202
|
+
self2.setValue = (key, value) => {
|
|
10203
|
+
const context2 = new _BaseContext(self2._currentContext);
|
|
10204
|
+
context2._currentContext.set(key, value);
|
|
10205
|
+
return context2;
|
|
10423
10206
|
};
|
|
10424
|
-
|
|
10207
|
+
self2.deleteValue = (key) => {
|
|
10208
|
+
const context2 = new _BaseContext(self2._currentContext);
|
|
10209
|
+
context2._currentContext.delete(key);
|
|
10210
|
+
return context2;
|
|
10425
10211
|
};
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
);
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
/**
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10445
|
-
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
|
|
10455
|
-
|
|
10456
|
-
return
|
|
10457
|
-
}
|
|
10458
|
-
|
|
10212
|
+
}
|
|
10213
|
+
};
|
|
10214
|
+
var ROOT_CONTEXT = new BaseContext();
|
|
10215
|
+
|
|
10216
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js
|
|
10217
|
+
var NoopMeter = class {
|
|
10218
|
+
constructor() {
|
|
10219
|
+
}
|
|
10220
|
+
/**
|
|
10221
|
+
* @see {@link Meter.createGauge}
|
|
10222
|
+
*/
|
|
10223
|
+
createGauge(_name, _options) {
|
|
10224
|
+
return NOOP_GAUGE_METRIC;
|
|
10225
|
+
}
|
|
10226
|
+
/**
|
|
10227
|
+
* @see {@link Meter.createHistogram}
|
|
10228
|
+
*/
|
|
10229
|
+
createHistogram(_name, _options) {
|
|
10230
|
+
return NOOP_HISTOGRAM_METRIC;
|
|
10231
|
+
}
|
|
10232
|
+
/**
|
|
10233
|
+
* @see {@link Meter.createCounter}
|
|
10234
|
+
*/
|
|
10235
|
+
createCounter(_name, _options) {
|
|
10236
|
+
return NOOP_COUNTER_METRIC;
|
|
10237
|
+
}
|
|
10238
|
+
/**
|
|
10239
|
+
* @see {@link Meter.createUpDownCounter}
|
|
10240
|
+
*/
|
|
10241
|
+
createUpDownCounter(_name, _options) {
|
|
10242
|
+
return NOOP_UP_DOWN_COUNTER_METRIC;
|
|
10243
|
+
}
|
|
10244
|
+
/**
|
|
10245
|
+
* @see {@link Meter.createObservableGauge}
|
|
10246
|
+
*/
|
|
10247
|
+
createObservableGauge(_name, _options) {
|
|
10248
|
+
return NOOP_OBSERVABLE_GAUGE_METRIC;
|
|
10249
|
+
}
|
|
10250
|
+
/**
|
|
10251
|
+
* @see {@link Meter.createObservableCounter}
|
|
10252
|
+
*/
|
|
10253
|
+
createObservableCounter(_name, _options) {
|
|
10254
|
+
return NOOP_OBSERVABLE_COUNTER_METRIC;
|
|
10255
|
+
}
|
|
10256
|
+
/**
|
|
10257
|
+
* @see {@link Meter.createObservableUpDownCounter}
|
|
10258
|
+
*/
|
|
10259
|
+
createObservableUpDownCounter(_name, _options) {
|
|
10260
|
+
return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
10261
|
+
}
|
|
10262
|
+
/**
|
|
10263
|
+
* @see {@link Meter.addBatchObservableCallback}
|
|
10264
|
+
*/
|
|
10265
|
+
addBatchObservableCallback(_callback, _observables) {
|
|
10266
|
+
}
|
|
10267
|
+
/**
|
|
10268
|
+
* @see {@link Meter.removeBatchObservableCallback}
|
|
10269
|
+
*/
|
|
10270
|
+
removeBatchObservableCallback(_callback) {
|
|
10271
|
+
}
|
|
10272
|
+
};
|
|
10273
|
+
var NoopMetric = class {
|
|
10274
|
+
};
|
|
10275
|
+
var NoopCounterMetric = class extends NoopMetric {
|
|
10276
|
+
add(_value, _attributes) {
|
|
10277
|
+
}
|
|
10278
|
+
};
|
|
10279
|
+
var NoopUpDownCounterMetric = class extends NoopMetric {
|
|
10280
|
+
add(_value, _attributes) {
|
|
10281
|
+
}
|
|
10282
|
+
};
|
|
10283
|
+
var NoopGaugeMetric = class extends NoopMetric {
|
|
10284
|
+
record(_value, _attributes) {
|
|
10285
|
+
}
|
|
10286
|
+
};
|
|
10287
|
+
var NoopHistogramMetric = class extends NoopMetric {
|
|
10288
|
+
record(_value, _attributes) {
|
|
10289
|
+
}
|
|
10290
|
+
};
|
|
10291
|
+
var NoopObservableMetric = class {
|
|
10292
|
+
addCallback(_callback) {
|
|
10293
|
+
}
|
|
10294
|
+
removeCallback(_callback) {
|
|
10295
|
+
}
|
|
10296
|
+
};
|
|
10297
|
+
var NoopObservableCounterMetric = class extends NoopObservableMetric {
|
|
10298
|
+
};
|
|
10299
|
+
var NoopObservableGaugeMetric = class extends NoopObservableMetric {
|
|
10300
|
+
};
|
|
10301
|
+
var NoopObservableUpDownCounterMetric = class extends NoopObservableMetric {
|
|
10302
|
+
};
|
|
10459
10303
|
var NOOP_METER = new NoopMeter();
|
|
10460
10304
|
var NOOP_COUNTER_METRIC = new NoopCounterMetric();
|
|
10461
10305
|
var NOOP_GAUGE_METRIC = new NoopGaugeMetric();
|
|
@@ -10465,144 +10309,98 @@ var NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
|
|
|
10465
10309
|
var NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
|
|
10466
10310
|
var NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();
|
|
10467
10311
|
|
|
10468
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10312
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/Metric.js
|
|
10469
10313
|
var ValueType;
|
|
10470
10314
|
(function(ValueType2) {
|
|
10471
10315
|
ValueType2[ValueType2["INT"] = 0] = "INT";
|
|
10472
10316
|
ValueType2[ValueType2["DOUBLE"] = 1] = "DOUBLE";
|
|
10473
10317
|
})(ValueType || (ValueType = {}));
|
|
10474
10318
|
|
|
10475
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10476
|
-
var
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
var i = m.call(o), r, ar = [], e;
|
|
10480
|
-
try {
|
|
10481
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
10482
|
-
} catch (error) {
|
|
10483
|
-
e = { error };
|
|
10484
|
-
} finally {
|
|
10485
|
-
try {
|
|
10486
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
10487
|
-
} finally {
|
|
10488
|
-
if (e) throw e.error;
|
|
10489
|
-
}
|
|
10319
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
|
|
10320
|
+
var NoopContextManager = class {
|
|
10321
|
+
active() {
|
|
10322
|
+
return ROOT_CONTEXT;
|
|
10490
10323
|
}
|
|
10491
|
-
|
|
10492
|
-
|
|
10493
|
-
var __spreadArray3 = function(to, from, pack) {
|
|
10494
|
-
if (arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
10495
|
-
if (ar || !(i in from)) {
|
|
10496
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
10497
|
-
ar[i] = from[i];
|
|
10498
|
-
}
|
|
10324
|
+
with(_context, fn, thisArg, ...args) {
|
|
10325
|
+
return fn.call(thisArg, ...args);
|
|
10499
10326
|
}
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
var NoopContextManager = (
|
|
10503
|
-
/** @class */
|
|
10504
|
-
function() {
|
|
10505
|
-
function NoopContextManager2() {
|
|
10506
|
-
}
|
|
10507
|
-
NoopContextManager2.prototype.active = function() {
|
|
10508
|
-
return ROOT_CONTEXT;
|
|
10509
|
-
};
|
|
10510
|
-
NoopContextManager2.prototype.with = function(_context, fn, thisArg) {
|
|
10511
|
-
var args = [];
|
|
10512
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
10513
|
-
args[_i - 3] = arguments[_i];
|
|
10514
|
-
}
|
|
10515
|
-
return fn.call.apply(fn, __spreadArray3([thisArg], __read3(args), false));
|
|
10516
|
-
};
|
|
10517
|
-
NoopContextManager2.prototype.bind = function(_context, target) {
|
|
10518
|
-
return target;
|
|
10519
|
-
};
|
|
10520
|
-
NoopContextManager2.prototype.enable = function() {
|
|
10521
|
-
return this;
|
|
10522
|
-
};
|
|
10523
|
-
NoopContextManager2.prototype.disable = function() {
|
|
10524
|
-
return this;
|
|
10525
|
-
};
|
|
10526
|
-
return NoopContextManager2;
|
|
10527
|
-
}()
|
|
10528
|
-
);
|
|
10529
|
-
|
|
10530
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/context.js
|
|
10531
|
-
var __read4 = function(o, n) {
|
|
10532
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
10533
|
-
if (!m) return o;
|
|
10534
|
-
var i = m.call(o), r, ar = [], e;
|
|
10535
|
-
try {
|
|
10536
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
10537
|
-
} catch (error) {
|
|
10538
|
-
e = { error };
|
|
10539
|
-
} finally {
|
|
10540
|
-
try {
|
|
10541
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
10542
|
-
} finally {
|
|
10543
|
-
if (e) throw e.error;
|
|
10544
|
-
}
|
|
10327
|
+
bind(_context, target) {
|
|
10328
|
+
return target;
|
|
10545
10329
|
}
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
10552
|
-
ar[i] = from[i];
|
|
10553
|
-
}
|
|
10330
|
+
enable() {
|
|
10331
|
+
return this;
|
|
10332
|
+
}
|
|
10333
|
+
disable() {
|
|
10334
|
+
return this;
|
|
10554
10335
|
}
|
|
10555
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10556
10336
|
};
|
|
10337
|
+
|
|
10338
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/context.js
|
|
10557
10339
|
var API_NAME2 = "context";
|
|
10558
10340
|
var NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
10559
|
-
var ContextAPI =
|
|
10560
|
-
/**
|
|
10561
|
-
|
|
10562
|
-
|
|
10341
|
+
var ContextAPI = class _ContextAPI {
|
|
10342
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
10343
|
+
constructor() {
|
|
10344
|
+
}
|
|
10345
|
+
/** Get the singleton instance of the Context API */
|
|
10346
|
+
static getInstance() {
|
|
10347
|
+
if (!this._instance) {
|
|
10348
|
+
this._instance = new _ContextAPI();
|
|
10563
10349
|
}
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10350
|
+
return this._instance;
|
|
10351
|
+
}
|
|
10352
|
+
/**
|
|
10353
|
+
* Set the current context manager.
|
|
10354
|
+
*
|
|
10355
|
+
* @returns true if the context manager was successfully registered, else false
|
|
10356
|
+
*/
|
|
10357
|
+
setGlobalContextManager(contextManager) {
|
|
10358
|
+
return registerGlobal(API_NAME2, contextManager, DiagAPI.instance());
|
|
10359
|
+
}
|
|
10360
|
+
/**
|
|
10361
|
+
* Get the currently active context
|
|
10362
|
+
*/
|
|
10363
|
+
active() {
|
|
10364
|
+
return this._getContextManager().active();
|
|
10365
|
+
}
|
|
10366
|
+
/**
|
|
10367
|
+
* Execute a function with an active context
|
|
10368
|
+
*
|
|
10369
|
+
* @param context context to be active during function execution
|
|
10370
|
+
* @param fn function to execute in a context
|
|
10371
|
+
* @param thisArg optional receiver to be used for calling fn
|
|
10372
|
+
* @param args optional arguments forwarded to fn
|
|
10373
|
+
*/
|
|
10374
|
+
with(context2, fn, thisArg, ...args) {
|
|
10375
|
+
return this._getContextManager().with(context2, fn, thisArg, ...args);
|
|
10376
|
+
}
|
|
10377
|
+
/**
|
|
10378
|
+
* Bind a context to a target function or event emitter
|
|
10379
|
+
*
|
|
10380
|
+
* @param context context to bind to the event emitter or function. Defaults to the currently active context
|
|
10381
|
+
* @param target function or event emitter to bind
|
|
10382
|
+
*/
|
|
10383
|
+
bind(context2, target) {
|
|
10384
|
+
return this._getContextManager().bind(context2, target);
|
|
10385
|
+
}
|
|
10386
|
+
_getContextManager() {
|
|
10387
|
+
return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
|
|
10388
|
+
}
|
|
10389
|
+
/** Disable and remove the global context manager */
|
|
10390
|
+
disable() {
|
|
10391
|
+
this._getContextManager().disable();
|
|
10392
|
+
unregisterGlobal(API_NAME2, DiagAPI.instance());
|
|
10393
|
+
}
|
|
10394
|
+
};
|
|
10597
10395
|
|
|
10598
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10396
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
|
|
10599
10397
|
var TraceFlags;
|
|
10600
10398
|
(function(TraceFlags2) {
|
|
10601
10399
|
TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
|
|
10602
10400
|
TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
|
|
10603
10401
|
})(TraceFlags || (TraceFlags = {}));
|
|
10604
10402
|
|
|
10605
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10403
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js
|
|
10606
10404
|
var INVALID_SPANID = "0000000000000000";
|
|
10607
10405
|
var INVALID_TRACEID = "00000000000000000000000000000000";
|
|
10608
10406
|
var INVALID_SPAN_CONTEXT = {
|
|
@@ -10611,52 +10409,54 @@ var INVALID_SPAN_CONTEXT = {
|
|
|
10611
10409
|
traceFlags: TraceFlags.NONE
|
|
10612
10410
|
};
|
|
10613
10411
|
|
|
10614
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10615
|
-
var NonRecordingSpan =
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
|
|
10622
|
-
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10630
|
-
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
10640
|
-
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
)
|
|
10412
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js
|
|
10413
|
+
var NonRecordingSpan = class {
|
|
10414
|
+
constructor(spanContext = INVALID_SPAN_CONTEXT) {
|
|
10415
|
+
this._spanContext = spanContext;
|
|
10416
|
+
}
|
|
10417
|
+
// Returns a SpanContext.
|
|
10418
|
+
spanContext() {
|
|
10419
|
+
return this._spanContext;
|
|
10420
|
+
}
|
|
10421
|
+
// By default does nothing
|
|
10422
|
+
setAttribute(_key, _value) {
|
|
10423
|
+
return this;
|
|
10424
|
+
}
|
|
10425
|
+
// By default does nothing
|
|
10426
|
+
setAttributes(_attributes) {
|
|
10427
|
+
return this;
|
|
10428
|
+
}
|
|
10429
|
+
// By default does nothing
|
|
10430
|
+
addEvent(_name, _attributes) {
|
|
10431
|
+
return this;
|
|
10432
|
+
}
|
|
10433
|
+
addLink(_link) {
|
|
10434
|
+
return this;
|
|
10435
|
+
}
|
|
10436
|
+
addLinks(_links) {
|
|
10437
|
+
return this;
|
|
10438
|
+
}
|
|
10439
|
+
// By default does nothing
|
|
10440
|
+
setStatus(_status) {
|
|
10441
|
+
return this;
|
|
10442
|
+
}
|
|
10443
|
+
// By default does nothing
|
|
10444
|
+
updateName(_name) {
|
|
10445
|
+
return this;
|
|
10446
|
+
}
|
|
10447
|
+
// By default does nothing
|
|
10448
|
+
end(_endTime) {
|
|
10449
|
+
}
|
|
10450
|
+
// isRecording always returns false for NonRecordingSpan.
|
|
10451
|
+
isRecording() {
|
|
10452
|
+
return false;
|
|
10453
|
+
}
|
|
10454
|
+
// By default does nothing
|
|
10455
|
+
recordException(_exception, _time) {
|
|
10456
|
+
}
|
|
10457
|
+
};
|
|
10658
10458
|
|
|
10659
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10459
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
|
|
10660
10460
|
var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
10661
10461
|
function getSpan(context2) {
|
|
10662
10462
|
return context2.getValue(SPAN_KEY) || void 0;
|
|
@@ -10678,14 +10478,126 @@ function getSpanContext(context2) {
|
|
|
10678
10478
|
return (_a = getSpan(context2)) === null || _a === void 0 ? void 0 : _a.spanContext();
|
|
10679
10479
|
}
|
|
10680
10480
|
|
|
10681
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10682
|
-
var
|
|
10683
|
-
|
|
10481
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
|
|
10482
|
+
var isHex = new Uint8Array([
|
|
10483
|
+
0,
|
|
10484
|
+
0,
|
|
10485
|
+
0,
|
|
10486
|
+
0,
|
|
10487
|
+
0,
|
|
10488
|
+
0,
|
|
10489
|
+
0,
|
|
10490
|
+
0,
|
|
10491
|
+
0,
|
|
10492
|
+
0,
|
|
10493
|
+
0,
|
|
10494
|
+
0,
|
|
10495
|
+
0,
|
|
10496
|
+
0,
|
|
10497
|
+
0,
|
|
10498
|
+
0,
|
|
10499
|
+
0,
|
|
10500
|
+
0,
|
|
10501
|
+
0,
|
|
10502
|
+
0,
|
|
10503
|
+
0,
|
|
10504
|
+
0,
|
|
10505
|
+
0,
|
|
10506
|
+
0,
|
|
10507
|
+
0,
|
|
10508
|
+
0,
|
|
10509
|
+
0,
|
|
10510
|
+
0,
|
|
10511
|
+
0,
|
|
10512
|
+
0,
|
|
10513
|
+
0,
|
|
10514
|
+
0,
|
|
10515
|
+
0,
|
|
10516
|
+
0,
|
|
10517
|
+
0,
|
|
10518
|
+
0,
|
|
10519
|
+
0,
|
|
10520
|
+
0,
|
|
10521
|
+
0,
|
|
10522
|
+
0,
|
|
10523
|
+
0,
|
|
10524
|
+
0,
|
|
10525
|
+
0,
|
|
10526
|
+
0,
|
|
10527
|
+
0,
|
|
10528
|
+
0,
|
|
10529
|
+
0,
|
|
10530
|
+
0,
|
|
10531
|
+
1,
|
|
10532
|
+
1,
|
|
10533
|
+
1,
|
|
10534
|
+
1,
|
|
10535
|
+
1,
|
|
10536
|
+
1,
|
|
10537
|
+
1,
|
|
10538
|
+
1,
|
|
10539
|
+
1,
|
|
10540
|
+
1,
|
|
10541
|
+
0,
|
|
10542
|
+
0,
|
|
10543
|
+
0,
|
|
10544
|
+
0,
|
|
10545
|
+
0,
|
|
10546
|
+
0,
|
|
10547
|
+
0,
|
|
10548
|
+
1,
|
|
10549
|
+
1,
|
|
10550
|
+
1,
|
|
10551
|
+
1,
|
|
10552
|
+
1,
|
|
10553
|
+
1,
|
|
10554
|
+
0,
|
|
10555
|
+
0,
|
|
10556
|
+
0,
|
|
10557
|
+
0,
|
|
10558
|
+
0,
|
|
10559
|
+
0,
|
|
10560
|
+
0,
|
|
10561
|
+
0,
|
|
10562
|
+
0,
|
|
10563
|
+
0,
|
|
10564
|
+
0,
|
|
10565
|
+
0,
|
|
10566
|
+
0,
|
|
10567
|
+
0,
|
|
10568
|
+
0,
|
|
10569
|
+
0,
|
|
10570
|
+
0,
|
|
10571
|
+
0,
|
|
10572
|
+
0,
|
|
10573
|
+
0,
|
|
10574
|
+
0,
|
|
10575
|
+
0,
|
|
10576
|
+
0,
|
|
10577
|
+
0,
|
|
10578
|
+
0,
|
|
10579
|
+
0,
|
|
10580
|
+
1,
|
|
10581
|
+
1,
|
|
10582
|
+
1,
|
|
10583
|
+
1,
|
|
10584
|
+
1,
|
|
10585
|
+
1
|
|
10586
|
+
]);
|
|
10587
|
+
function isValidHex(id, length) {
|
|
10588
|
+
if (typeof id !== "string" || id.length !== length)
|
|
10589
|
+
return false;
|
|
10590
|
+
let r = 0;
|
|
10591
|
+
for (let i = 0; i < id.length; i += 4) {
|
|
10592
|
+
r += (isHex[id.charCodeAt(i)] | 0) + (isHex[id.charCodeAt(i + 1)] | 0) + (isHex[id.charCodeAt(i + 2)] | 0) + (isHex[id.charCodeAt(i + 3)] | 0);
|
|
10593
|
+
}
|
|
10594
|
+
return r === length;
|
|
10595
|
+
}
|
|
10684
10596
|
function isValidTraceId(traceId) {
|
|
10685
|
-
return
|
|
10597
|
+
return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;
|
|
10686
10598
|
}
|
|
10687
10599
|
function isValidSpanId(spanId) {
|
|
10688
|
-
return
|
|
10600
|
+
return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;
|
|
10689
10601
|
}
|
|
10690
10602
|
function isSpanContextValid(spanContext) {
|
|
10691
10603
|
return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
|
|
@@ -10694,129 +10606,115 @@ function wrapSpanContext(spanContext) {
|
|
|
10694
10606
|
return new NonRecordingSpan(spanContext);
|
|
10695
10607
|
}
|
|
10696
10608
|
|
|
10697
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10609
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
|
|
10698
10610
|
var contextApi = ContextAPI.getInstance();
|
|
10699
|
-
var NoopTracer =
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
10724
|
-
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
10728
|
-
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
10736
|
-
var span = this.startSpan(name, opts, parentContext);
|
|
10737
|
-
var contextWithSpanSet = setSpan(parentContext, span);
|
|
10738
|
-
return contextApi.with(contextWithSpanSet, fn, void 0, span);
|
|
10739
|
-
};
|
|
10740
|
-
return NoopTracer2;
|
|
10741
|
-
}()
|
|
10742
|
-
);
|
|
10611
|
+
var NoopTracer = class {
|
|
10612
|
+
// startSpan starts a noop span.
|
|
10613
|
+
startSpan(name, options, context2 = contextApi.active()) {
|
|
10614
|
+
const root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
10615
|
+
if (root) {
|
|
10616
|
+
return new NonRecordingSpan();
|
|
10617
|
+
}
|
|
10618
|
+
const parentFromContext = context2 && getSpanContext(context2);
|
|
10619
|
+
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
|
|
10620
|
+
return new NonRecordingSpan(parentFromContext);
|
|
10621
|
+
} else {
|
|
10622
|
+
return new NonRecordingSpan();
|
|
10623
|
+
}
|
|
10624
|
+
}
|
|
10625
|
+
startActiveSpan(name, arg2, arg3, arg4) {
|
|
10626
|
+
let opts;
|
|
10627
|
+
let ctx;
|
|
10628
|
+
let fn;
|
|
10629
|
+
if (arguments.length < 2) {
|
|
10630
|
+
return;
|
|
10631
|
+
} else if (arguments.length === 2) {
|
|
10632
|
+
fn = arg2;
|
|
10633
|
+
} else if (arguments.length === 3) {
|
|
10634
|
+
opts = arg2;
|
|
10635
|
+
fn = arg3;
|
|
10636
|
+
} else {
|
|
10637
|
+
opts = arg2;
|
|
10638
|
+
ctx = arg3;
|
|
10639
|
+
fn = arg4;
|
|
10640
|
+
}
|
|
10641
|
+
const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
10642
|
+
const span = this.startSpan(name, opts, parentContext);
|
|
10643
|
+
const contextWithSpanSet = setSpan(parentContext, span);
|
|
10644
|
+
return contextApi.with(contextWithSpanSet, fn, void 0, span);
|
|
10645
|
+
}
|
|
10646
|
+
};
|
|
10743
10647
|
function isSpanContext(spanContext) {
|
|
10744
|
-
return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number";
|
|
10648
|
+
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";
|
|
10745
10649
|
}
|
|
10746
10650
|
|
|
10747
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10651
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
|
|
10748
10652
|
var NOOP_TRACER = new NoopTracer();
|
|
10749
|
-
var ProxyTracer =
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
10770
|
-
if (!tracer) {
|
|
10771
|
-
return NOOP_TRACER;
|
|
10772
|
-
}
|
|
10773
|
-
this._delegate = tracer;
|
|
10653
|
+
var ProxyTracer = class {
|
|
10654
|
+
constructor(provider, name, version, options) {
|
|
10655
|
+
this._provider = provider;
|
|
10656
|
+
this.name = name;
|
|
10657
|
+
this.version = version;
|
|
10658
|
+
this.options = options;
|
|
10659
|
+
}
|
|
10660
|
+
startSpan(name, options, context2) {
|
|
10661
|
+
return this._getTracer().startSpan(name, options, context2);
|
|
10662
|
+
}
|
|
10663
|
+
startActiveSpan(_name, _options, _context, _fn) {
|
|
10664
|
+
const tracer = this._getTracer();
|
|
10665
|
+
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
|
|
10666
|
+
}
|
|
10667
|
+
/**
|
|
10668
|
+
* Try to get a tracer from the proxy tracer provider.
|
|
10669
|
+
* If the proxy tracer provider has no delegate, return a noop tracer.
|
|
10670
|
+
*/
|
|
10671
|
+
_getTracer() {
|
|
10672
|
+
if (this._delegate) {
|
|
10774
10673
|
return this._delegate;
|
|
10775
|
-
}
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10674
|
+
}
|
|
10675
|
+
const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
10676
|
+
if (!tracer) {
|
|
10677
|
+
return NOOP_TRACER;
|
|
10678
|
+
}
|
|
10679
|
+
this._delegate = tracer;
|
|
10680
|
+
return this._delegate;
|
|
10681
|
+
}
|
|
10682
|
+
};
|
|
10779
10683
|
|
|
10780
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10781
|
-
var NoopTracerProvider =
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) {
|
|
10787
|
-
return new NoopTracer();
|
|
10788
|
-
};
|
|
10789
|
-
return NoopTracerProvider2;
|
|
10790
|
-
}()
|
|
10791
|
-
);
|
|
10684
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js
|
|
10685
|
+
var NoopTracerProvider = class {
|
|
10686
|
+
getTracer(_name, _version, _options) {
|
|
10687
|
+
return new NoopTracer();
|
|
10688
|
+
}
|
|
10689
|
+
};
|
|
10792
10690
|
|
|
10793
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10691
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js
|
|
10794
10692
|
var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
10795
|
-
var ProxyTracerProvider =
|
|
10796
|
-
/**
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
return
|
|
10816
|
-
}
|
|
10817
|
-
|
|
10693
|
+
var ProxyTracerProvider = class {
|
|
10694
|
+
/**
|
|
10695
|
+
* Get a {@link ProxyTracer}
|
|
10696
|
+
*/
|
|
10697
|
+
getTracer(name, version, options) {
|
|
10698
|
+
var _a;
|
|
10699
|
+
return (_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options);
|
|
10700
|
+
}
|
|
10701
|
+
getDelegate() {
|
|
10702
|
+
var _a;
|
|
10703
|
+
return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
|
|
10704
|
+
}
|
|
10705
|
+
/**
|
|
10706
|
+
* Set the delegate tracer provider
|
|
10707
|
+
*/
|
|
10708
|
+
setDelegate(delegate) {
|
|
10709
|
+
this._delegate = delegate;
|
|
10710
|
+
}
|
|
10711
|
+
getDelegateTracer(name, version, options) {
|
|
10712
|
+
var _a;
|
|
10713
|
+
return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
|
|
10714
|
+
}
|
|
10715
|
+
};
|
|
10818
10716
|
|
|
10819
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10717
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js
|
|
10820
10718
|
var SpanKind;
|
|
10821
10719
|
(function(SpanKind2) {
|
|
10822
10720
|
SpanKind2[SpanKind2["INTERNAL"] = 0] = "INTERNAL";
|
|
@@ -10826,7 +10724,7 @@ var SpanKind;
|
|
|
10826
10724
|
SpanKind2[SpanKind2["CONSUMER"] = 4] = "CONSUMER";
|
|
10827
10725
|
})(SpanKind || (SpanKind = {}));
|
|
10828
10726
|
|
|
10829
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10727
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/status.js
|
|
10830
10728
|
var SpanStatusCode;
|
|
10831
10729
|
(function(SpanStatusCode2) {
|
|
10832
10730
|
SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET";
|
|
@@ -10834,99 +10732,112 @@ var SpanStatusCode;
|
|
|
10834
10732
|
SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR";
|
|
10835
10733
|
})(SpanStatusCode || (SpanStatusCode = {}));
|
|
10836
10734
|
|
|
10837
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10735
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js
|
|
10838
10736
|
var context = ContextAPI.getInstance();
|
|
10839
10737
|
|
|
10840
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10841
|
-
var NoopMeterProvider =
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
NoopMeterProvider2.prototype.getMeter = function(_name, _version, _options) {
|
|
10847
|
-
return NOOP_METER;
|
|
10848
|
-
};
|
|
10849
|
-
return NoopMeterProvider2;
|
|
10850
|
-
}()
|
|
10851
|
-
);
|
|
10738
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js
|
|
10739
|
+
var NoopMeterProvider = class {
|
|
10740
|
+
getMeter(_name, _version, _options) {
|
|
10741
|
+
return NOOP_METER;
|
|
10742
|
+
}
|
|
10743
|
+
};
|
|
10852
10744
|
var NOOP_METER_PROVIDER = new NoopMeterProvider();
|
|
10853
10745
|
|
|
10854
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10746
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/metrics.js
|
|
10855
10747
|
var API_NAME3 = "metrics";
|
|
10856
|
-
var MetricsAPI =
|
|
10857
|
-
/**
|
|
10858
|
-
|
|
10859
|
-
|
|
10748
|
+
var MetricsAPI = class _MetricsAPI {
|
|
10749
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
10750
|
+
constructor() {
|
|
10751
|
+
}
|
|
10752
|
+
/** Get the singleton instance of the Metrics API */
|
|
10753
|
+
static getInstance() {
|
|
10754
|
+
if (!this._instance) {
|
|
10755
|
+
this._instance = new _MetricsAPI();
|
|
10860
10756
|
}
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10757
|
+
return this._instance;
|
|
10758
|
+
}
|
|
10759
|
+
/**
|
|
10760
|
+
* Set the current global meter provider.
|
|
10761
|
+
* Returns true if the meter provider was successfully registered, else false.
|
|
10762
|
+
*/
|
|
10763
|
+
setGlobalMeterProvider(provider) {
|
|
10764
|
+
return registerGlobal(API_NAME3, provider, DiagAPI.instance());
|
|
10765
|
+
}
|
|
10766
|
+
/**
|
|
10767
|
+
* Returns the global meter provider.
|
|
10768
|
+
*/
|
|
10769
|
+
getMeterProvider() {
|
|
10770
|
+
return getGlobal(API_NAME3) || NOOP_METER_PROVIDER;
|
|
10771
|
+
}
|
|
10772
|
+
/**
|
|
10773
|
+
* Returns a meter from the global meter provider.
|
|
10774
|
+
*/
|
|
10775
|
+
getMeter(name, version, options) {
|
|
10776
|
+
return this.getMeterProvider().getMeter(name, version, options);
|
|
10777
|
+
}
|
|
10778
|
+
/** Remove the global meter provider */
|
|
10779
|
+
disable() {
|
|
10780
|
+
unregisterGlobal(API_NAME3, DiagAPI.instance());
|
|
10781
|
+
}
|
|
10782
|
+
};
|
|
10882
10783
|
|
|
10883
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10784
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics-api.js
|
|
10884
10785
|
var metrics = MetricsAPI.getInstance();
|
|
10885
10786
|
|
|
10886
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10787
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js
|
|
10887
10788
|
var API_NAME4 = "trace";
|
|
10888
|
-
var TraceAPI =
|
|
10889
|
-
/**
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
}
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10789
|
+
var TraceAPI = class _TraceAPI {
|
|
10790
|
+
/** Empty private constructor prevents end users from constructing a new instance of the API */
|
|
10791
|
+
constructor() {
|
|
10792
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
10793
|
+
this.wrapSpanContext = wrapSpanContext;
|
|
10794
|
+
this.isSpanContextValid = isSpanContextValid;
|
|
10795
|
+
this.deleteSpan = deleteSpan;
|
|
10796
|
+
this.getSpan = getSpan;
|
|
10797
|
+
this.getActiveSpan = getActiveSpan;
|
|
10798
|
+
this.getSpanContext = getSpanContext;
|
|
10799
|
+
this.setSpan = setSpan;
|
|
10800
|
+
this.setSpanContext = setSpanContext;
|
|
10801
|
+
}
|
|
10802
|
+
/** Get the singleton instance of the Trace API */
|
|
10803
|
+
static getInstance() {
|
|
10804
|
+
if (!this._instance) {
|
|
10805
|
+
this._instance = new _TraceAPI();
|
|
10806
|
+
}
|
|
10807
|
+
return this._instance;
|
|
10808
|
+
}
|
|
10809
|
+
/**
|
|
10810
|
+
* Set the current global tracer.
|
|
10811
|
+
*
|
|
10812
|
+
* @returns true if the tracer provider was successfully registered, else false
|
|
10813
|
+
*/
|
|
10814
|
+
setGlobalTracerProvider(provider) {
|
|
10815
|
+
const success = registerGlobal(API_NAME4, this._proxyTracerProvider, DiagAPI.instance());
|
|
10816
|
+
if (success) {
|
|
10817
|
+
this._proxyTracerProvider.setDelegate(provider);
|
|
10818
|
+
}
|
|
10819
|
+
return success;
|
|
10820
|
+
}
|
|
10821
|
+
/**
|
|
10822
|
+
* Returns the global tracer provider.
|
|
10823
|
+
*/
|
|
10824
|
+
getTracerProvider() {
|
|
10825
|
+
return getGlobal(API_NAME4) || this._proxyTracerProvider;
|
|
10826
|
+
}
|
|
10827
|
+
/**
|
|
10828
|
+
* Returns a tracer from the global tracer provider.
|
|
10829
|
+
*/
|
|
10830
|
+
getTracer(name, version) {
|
|
10831
|
+
return this.getTracerProvider().getTracer(name, version);
|
|
10832
|
+
}
|
|
10833
|
+
/** Remove the global tracer provider */
|
|
10834
|
+
disable() {
|
|
10835
|
+
unregisterGlobal(API_NAME4, DiagAPI.instance());
|
|
10836
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
10837
|
+
}
|
|
10838
|
+
};
|
|
10928
10839
|
|
|
10929
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.
|
|
10840
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
10930
10841
|
var trace = TraceAPI.getInstance();
|
|
10931
10842
|
function getTracer(name) {
|
|
10932
10843
|
return trace.getTracer(name);
|
|
@@ -16423,9 +16334,13 @@ function deserialiseSnapshot(serialised) {
|
|
|
16423
16334
|
}
|
|
16424
16335
|
|
|
16425
16336
|
// src/mollifier/buffer.ts
|
|
16426
|
-
var
|
|
16427
|
-
|
|
16428
|
-
|
|
16337
|
+
var DEFAULT_ACK_GRACE_TTL_SECONDS = 30;
|
|
16338
|
+
var DEFAULT_RECONNECT_STEP_MS = 50;
|
|
16339
|
+
var DEFAULT_RECONNECT_MAX_MS = 1e3;
|
|
16340
|
+
var DEFAULT_MAX_RETRIES_PER_REQUEST = 20;
|
|
16341
|
+
var DRAINING_SET_KEY = "mollifier:draining";
|
|
16342
|
+
function mollifierReconnectDelayMs(times, random = Math.random, stepMs = DEFAULT_RECONNECT_STEP_MS, maxMs = DEFAULT_RECONNECT_MAX_MS) {
|
|
16343
|
+
const base = Math.min(times * stepMs, maxMs);
|
|
16429
16344
|
const half = Math.floor(base / 2);
|
|
16430
16345
|
return half + Math.round(random() * (base - half));
|
|
16431
16346
|
}
|
|
@@ -16442,15 +16357,19 @@ function makeIdempotencyClaimKey(input) {
|
|
|
16442
16357
|
var MollifierBuffer = class {
|
|
16443
16358
|
redis;
|
|
16444
16359
|
logger;
|
|
16360
|
+
ackGraceTtlSeconds;
|
|
16445
16361
|
constructor(options) {
|
|
16446
16362
|
this.logger = options.logger ?? new Logger("MollifierBuffer", "debug");
|
|
16363
|
+
this.ackGraceTtlSeconds = options.ackGraceTtlSeconds ?? DEFAULT_ACK_GRACE_TTL_SECONDS;
|
|
16364
|
+
const reconnectStepMs = options.reconnectStepMs ?? DEFAULT_RECONNECT_STEP_MS;
|
|
16365
|
+
const reconnectMaxMs = options.reconnectMaxMs ?? DEFAULT_RECONNECT_MAX_MS;
|
|
16447
16366
|
this.redis = createRedisClient(
|
|
16448
16367
|
{
|
|
16449
16368
|
...options.redisOptions,
|
|
16450
16369
|
retryStrategy(times) {
|
|
16451
|
-
return mollifierReconnectDelayMs(times);
|
|
16370
|
+
return mollifierReconnectDelayMs(times, Math.random, reconnectStepMs, reconnectMaxMs);
|
|
16452
16371
|
},
|
|
16453
|
-
maxRetriesPerRequest:
|
|
16372
|
+
maxRetriesPerRequest: options.maxRetriesPerRequest ?? DEFAULT_MAX_RETRIES_PER_REQUEST
|
|
16454
16373
|
},
|
|
16455
16374
|
{
|
|
16456
16375
|
onError: (error) => {
|
|
@@ -16507,6 +16426,7 @@ var MollifierBuffer = class {
|
|
|
16507
16426
|
const encoded = await this.redis.popAndMarkDraining(
|
|
16508
16427
|
queueKey,
|
|
16509
16428
|
orgsKey,
|
|
16429
|
+
DRAINING_SET_KEY,
|
|
16510
16430
|
entryPrefix,
|
|
16511
16431
|
envId,
|
|
16512
16432
|
"mollifier:org-envs:"
|
|
@@ -16764,13 +16684,16 @@ var MollifierBuffer = class {
|
|
|
16764
16684
|
async ack(runId) {
|
|
16765
16685
|
await this.redis.ackMollifierEntry(
|
|
16766
16686
|
`mollifier:entries:${runId}`,
|
|
16767
|
-
|
|
16687
|
+
DRAINING_SET_KEY,
|
|
16688
|
+
String(this.ackGraceTtlSeconds),
|
|
16689
|
+
runId
|
|
16768
16690
|
);
|
|
16769
16691
|
}
|
|
16770
16692
|
async requeue(runId) {
|
|
16771
16693
|
await this.redis.requeueMollifierEntry(
|
|
16772
16694
|
`mollifier:entries:${runId}`,
|
|
16773
16695
|
"mollifier:orgs",
|
|
16696
|
+
DRAINING_SET_KEY,
|
|
16774
16697
|
"mollifier:queue:",
|
|
16775
16698
|
runId,
|
|
16776
16699
|
"mollifier:org-envs:"
|
|
@@ -16785,10 +16708,36 @@ var MollifierBuffer = class {
|
|
|
16785
16708
|
async fail(runId, error) {
|
|
16786
16709
|
const result = await this.redis.failMollifierEntry(
|
|
16787
16710
|
`mollifier:entries:${runId}`,
|
|
16788
|
-
|
|
16711
|
+
DRAINING_SET_KEY,
|
|
16712
|
+
JSON.stringify(error),
|
|
16713
|
+
runId
|
|
16789
16714
|
);
|
|
16790
16715
|
return result === 1;
|
|
16791
16716
|
}
|
|
16717
|
+
// Observability-only: number of entries currently in DRAINING state
|
|
16718
|
+
// (popped, not yet acked/failed/requeued). The gauge in the webapp
|
|
16719
|
+
// drainer worker polls this on a short interval and emits it as
|
|
16720
|
+
// `mollifier.draining.current` for ops dashboards and post-crash
|
|
16721
|
+
// forensics. Cheap (single ZCARD).
|
|
16722
|
+
async getDrainingCount() {
|
|
16723
|
+
return this.redis.zcard(DRAINING_SET_KEY);
|
|
16724
|
+
}
|
|
16725
|
+
// Observability-only: list runIds that have been DRAINING longer than
|
|
16726
|
+
// `olderThanMs` (i.e. popped before `now - olderThanMs`). Bounded by
|
|
16727
|
+
// `limit` to keep the result set tractable when something has gone
|
|
16728
|
+
// very wrong. ZRANGEBYSCORE is O(log N + K). Score is the pop wall-clock
|
|
16729
|
+
// in milliseconds as written by the popAndMarkDraining Lua.
|
|
16730
|
+
async listStaleDraining(olderThanMs, limit) {
|
|
16731
|
+
const maxScore = Date.now() - Math.max(0, olderThanMs);
|
|
16732
|
+
return this.redis.zrangebyscore(
|
|
16733
|
+
DRAINING_SET_KEY,
|
|
16734
|
+
"-inf",
|
|
16735
|
+
String(maxScore),
|
|
16736
|
+
"LIMIT",
|
|
16737
|
+
0,
|
|
16738
|
+
Math.max(0, limit)
|
|
16739
|
+
);
|
|
16740
|
+
}
|
|
16792
16741
|
// Returns Redis-side TTL on the entry hash. Returns -1 for entries
|
|
16793
16742
|
// with no TTL — the steady state under the current design, where
|
|
16794
16743
|
// entries persist until drainer ack/fail. The ack grace TTL (30s
|
|
@@ -16889,10 +16838,11 @@ var MollifierBuffer = class {
|
|
|
16889
16838
|
`
|
|
16890
16839
|
});
|
|
16891
16840
|
this.redis.defineCommand("requeueMollifierEntry", {
|
|
16892
|
-
numberOfKeys:
|
|
16841
|
+
numberOfKeys: 3,
|
|
16893
16842
|
lua: `
|
|
16894
16843
|
local entryKey = KEYS[1]
|
|
16895
16844
|
local orgsKey = KEYS[2]
|
|
16845
|
+
local drainingSetKey = KEYS[3]
|
|
16896
16846
|
local queuePrefix = ARGV[1]
|
|
16897
16847
|
local runId = ARGV[2]
|
|
16898
16848
|
local orgEnvsPrefix = ARGV[3]
|
|
@@ -16920,18 +16870,31 @@ var MollifierBuffer = class {
|
|
|
16920
16870
|
redis.call('SADD', orgsKey, orgId)
|
|
16921
16871
|
redis.call('SADD', orgEnvsPrefix .. orgId, envId)
|
|
16922
16872
|
end
|
|
16873
|
+
-- Observability-only: leaving DRAINING state, so drop the
|
|
16874
|
+
-- entry from the draining-tracker set. ZREM on absent member
|
|
16875
|
+
-- is a no-op.
|
|
16876
|
+
redis.call('ZREM', drainingSetKey, runId)
|
|
16923
16877
|
return 1
|
|
16924
16878
|
`
|
|
16925
16879
|
});
|
|
16926
16880
|
this.redis.defineCommand("popAndMarkDraining", {
|
|
16927
|
-
numberOfKeys:
|
|
16881
|
+
numberOfKeys: 3,
|
|
16928
16882
|
lua: `
|
|
16929
16883
|
local queueKey = KEYS[1]
|
|
16930
16884
|
local orgsKey = KEYS[2]
|
|
16885
|
+
local drainingSetKey = KEYS[3]
|
|
16931
16886
|
local entryPrefix = ARGV[1]
|
|
16932
16887
|
local envId = ARGV[2]
|
|
16933
16888
|
local orgEnvsPrefix = ARGV[3]
|
|
16934
16889
|
|
|
16890
|
+
-- Wall-clock millis used as the ZADD score on the draining-tracker
|
|
16891
|
+
-- set. Computed once per script invocation so all observers see
|
|
16892
|
+
-- the same pop instant. redis.call('TIME') is deterministic per
|
|
16893
|
+
-- script execution (Lua sees it as a single read), satisfying the
|
|
16894
|
+
-- write-determinism contract on replicas/AOF replay.
|
|
16895
|
+
local timeArr = redis.call('TIME')
|
|
16896
|
+
local nowMs = tonumber(timeArr[1]) * 1000 + math.floor(tonumber(timeArr[2]) / 1000)
|
|
16897
|
+
|
|
16935
16898
|
-- Helper: prune org-level membership when an env's queue empties.
|
|
16936
16899
|
-- Called only from the success branch where we know orgId from the
|
|
16937
16900
|
-- popped entry. The no-runId branch below can't reach this because
|
|
@@ -16964,6 +16927,14 @@ var MollifierBuffer = class {
|
|
|
16964
16927
|
local entryKey = entryPrefix .. runId
|
|
16965
16928
|
if redis.call('EXISTS', entryKey) == 1 then
|
|
16966
16929
|
redis.call('HSET', entryKey, 'status', 'DRAINING')
|
|
16930
|
+
-- Observability-only: track the runId in the draining set
|
|
16931
|
+
-- with the pop wall-clock as score. Acked/failed/requeued
|
|
16932
|
+
-- in the corresponding Lua scripts. The set is NOT
|
|
16933
|
+
-- load-bearing for correctness \u2014 the per-entry hash carries
|
|
16934
|
+
-- status \u2014 so a missed ZREM on a partial Lua execution is
|
|
16935
|
+
-- recoverable via the stale-sweep + entry hash, not a
|
|
16936
|
+
-- correctness bug.
|
|
16937
|
+
redis.call('ZADD', drainingSetKey, nowMs, runId)
|
|
16967
16938
|
local raw = redis.call('HGETALL', entryKey)
|
|
16968
16939
|
local result = {}
|
|
16969
16940
|
for i = 1, #raw, 2 do
|
|
@@ -17201,10 +17172,18 @@ var MollifierBuffer = class {
|
|
|
17201
17172
|
`
|
|
17202
17173
|
});
|
|
17203
17174
|
this.redis.defineCommand("ackMollifierEntry", {
|
|
17204
|
-
numberOfKeys:
|
|
17175
|
+
numberOfKeys: 2,
|
|
17205
17176
|
lua: `
|
|
17206
17177
|
local entryKey = KEYS[1]
|
|
17178
|
+
local drainingSetKey = KEYS[2]
|
|
17207
17179
|
local graceTtlSeconds = tonumber(ARGV[1])
|
|
17180
|
+
local runId = ARGV[2]
|
|
17181
|
+
|
|
17182
|
+
-- Always ZREM from the draining-tracker \u2014 even if the entry hash
|
|
17183
|
+
-- has been concurrently torn down, the runId might still be in
|
|
17184
|
+
-- the set (e.g. fail() ran first and cleared the hash but a
|
|
17185
|
+
-- delayed ack races in). Idempotent: ZREM on absent is a no-op.
|
|
17186
|
+
redis.call('ZREM', drainingSetKey, runId)
|
|
17208
17187
|
|
|
17209
17188
|
-- Guard: never create a partial entry. If the hash is gone between
|
|
17210
17189
|
-- pop and ack (concurrent fail or eviction \u2014 QUEUED entries carry
|
|
@@ -17227,10 +17206,17 @@ var MollifierBuffer = class {
|
|
|
17227
17206
|
`
|
|
17228
17207
|
});
|
|
17229
17208
|
this.redis.defineCommand("failMollifierEntry", {
|
|
17230
|
-
numberOfKeys:
|
|
17209
|
+
numberOfKeys: 2,
|
|
17231
17210
|
lua: `
|
|
17232
17211
|
local entryKey = KEYS[1]
|
|
17212
|
+
local drainingSetKey = KEYS[2]
|
|
17233
17213
|
local errorPayload = ARGV[1]
|
|
17214
|
+
local runId = ARGV[2]
|
|
17215
|
+
|
|
17216
|
+
-- Always ZREM from the draining-tracker (idempotent on absent).
|
|
17217
|
+
-- Mirrors ack: the runId may be in the set even if the entry hash
|
|
17218
|
+
-- has been raced away.
|
|
17219
|
+
redis.call('ZREM', drainingSetKey, runId)
|
|
17234
17220
|
|
|
17235
17221
|
-- Guard: nothing to mark FAILED if the hash is gone (concurrent
|
|
17236
17222
|
-- ack/manual cleanup). Returning 0 lets the caller distinguish
|
|
@@ -17301,8 +17287,11 @@ var MollifierDrainer = class {
|
|
|
17301
17287
|
isRetryable;
|
|
17302
17288
|
pollIntervalMs;
|
|
17303
17289
|
maxOrgsPerTick;
|
|
17290
|
+
drainBatchSize;
|
|
17291
|
+
concurrency;
|
|
17292
|
+
maxBackoffMs;
|
|
17293
|
+
backoffFloorMs;
|
|
17304
17294
|
logger;
|
|
17305
|
-
limit;
|
|
17306
17295
|
// Rotation state. `orgCursor` advances through the active-orgs list.
|
|
17307
17296
|
// Each org has its own internal cursor in `perOrgEnvCursors` for
|
|
17308
17297
|
// cycling through that org's envs. Both reset on `start()`.
|
|
@@ -17319,8 +17308,11 @@ var MollifierDrainer = class {
|
|
|
17319
17308
|
this.isRetryable = options.isRetryable;
|
|
17320
17309
|
this.pollIntervalMs = options.pollIntervalMs ?? 100;
|
|
17321
17310
|
this.maxOrgsPerTick = options.maxOrgsPerTick ?? 500;
|
|
17311
|
+
this.drainBatchSize = Math.max(1, options.drainBatchSize ?? 1);
|
|
17312
|
+
this.concurrency = Math.max(1, options.concurrency);
|
|
17313
|
+
this.maxBackoffMs = options.maxBackoffMs ?? 5e3;
|
|
17314
|
+
this.backoffFloorMs = Math.max(1, options.backoffFloorMs ?? 100);
|
|
17322
17315
|
this.logger = options.logger ?? new Logger("MollifierDrainer", "debug");
|
|
17323
|
-
this.limit = pLimit(options.concurrency);
|
|
17324
17316
|
}
|
|
17325
17317
|
async runOnce() {
|
|
17326
17318
|
const orgs = await this.buffer.listOrgs();
|
|
@@ -17337,15 +17329,64 @@ var MollifierDrainer = class {
|
|
|
17337
17329
|
const envId = this.pickEnvForOrg(orgId, envsForOrg);
|
|
17338
17330
|
targets.push(envId);
|
|
17339
17331
|
}
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
|
|
17346
|
-
|
|
17347
|
-
|
|
17332
|
+
if (targets.length === 0) return { drained: 0, failed: 0 };
|
|
17333
|
+
const remaining = /* @__PURE__ */ new Map();
|
|
17334
|
+
const skip = /* @__PURE__ */ new Set();
|
|
17335
|
+
for (const envId of targets) remaining.set(envId, this.drainBatchSize);
|
|
17336
|
+
let cursor = 0;
|
|
17337
|
+
const pickNextEnv = () => {
|
|
17338
|
+
for (let i = 0; i < targets.length; i++) {
|
|
17339
|
+
const idx = (cursor + i) % targets.length;
|
|
17340
|
+
const envId = targets[idx];
|
|
17341
|
+
if (skip.has(envId)) continue;
|
|
17342
|
+
const r = remaining.get(envId) ?? 0;
|
|
17343
|
+
if (r > 0) {
|
|
17344
|
+
remaining.set(envId, r - 1);
|
|
17345
|
+
cursor = (idx + 1) % targets.length;
|
|
17346
|
+
return envId;
|
|
17347
|
+
}
|
|
17348
|
+
}
|
|
17349
|
+
return null;
|
|
17350
|
+
};
|
|
17351
|
+
let drained = 0;
|
|
17352
|
+
let failed = 0;
|
|
17353
|
+
const worker = async () => {
|
|
17354
|
+
while (true) {
|
|
17355
|
+
const envId = pickNextEnv();
|
|
17356
|
+
if (envId === null) return;
|
|
17357
|
+
let entry;
|
|
17358
|
+
try {
|
|
17359
|
+
entry = await this.buffer.pop(envId);
|
|
17360
|
+
} catch (err) {
|
|
17361
|
+
this.logger.error("MollifierDrainer.pop failed", { envId, err });
|
|
17362
|
+
if (!skip.has(envId)) {
|
|
17363
|
+
skip.add(envId);
|
|
17364
|
+
failed += 1;
|
|
17365
|
+
}
|
|
17366
|
+
continue;
|
|
17367
|
+
}
|
|
17368
|
+
if (!entry) {
|
|
17369
|
+
skip.add(envId);
|
|
17370
|
+
continue;
|
|
17371
|
+
}
|
|
17372
|
+
try {
|
|
17373
|
+
const outcome = await this.processEntry(entry);
|
|
17374
|
+
if (outcome === "drained") drained += 1;
|
|
17375
|
+
else failed += 1;
|
|
17376
|
+
} catch (err) {
|
|
17377
|
+
this.logger.error("MollifierDrainer.processEntry failed", {
|
|
17378
|
+
envId,
|
|
17379
|
+
runId: entry.runId,
|
|
17380
|
+
err
|
|
17381
|
+
});
|
|
17382
|
+
failed += 1;
|
|
17383
|
+
}
|
|
17384
|
+
}
|
|
17348
17385
|
};
|
|
17386
|
+
const totalBudget = targets.length * this.drainBatchSize;
|
|
17387
|
+
const workerCount = Math.min(this.concurrency, totalBudget);
|
|
17388
|
+
await Promise.all(Array.from({ length: workerCount }, () => worker()));
|
|
17389
|
+
return { drained, failed };
|
|
17349
17390
|
}
|
|
17350
17391
|
start() {
|
|
17351
17392
|
if (this.isRunning) return;
|
|
@@ -17419,8 +17460,8 @@ var MollifierDrainer = class {
|
|
|
17419
17460
|
// brief blip while preventing a tight retry loop during a long Redis
|
|
17420
17461
|
// outage. 1 → 200ms, 2 → 400ms, 3 → 800ms, 4 → 1.6s, 5 → 3.2s, 6+ → 5s.
|
|
17421
17462
|
backoffMs(consecutiveErrors) {
|
|
17422
|
-
const base = Math.max(this.pollIntervalMs,
|
|
17423
|
-
const capped = Math.min(base * 2 ** (consecutiveErrors - 1),
|
|
17463
|
+
const base = Math.max(this.pollIntervalMs, this.backoffFloorMs);
|
|
17464
|
+
const capped = Math.min(base * 2 ** (consecutiveErrors - 1), this.maxBackoffMs);
|
|
17424
17465
|
return capped;
|
|
17425
17466
|
}
|
|
17426
17467
|
delay(ms) {
|
|
@@ -17451,31 +17492,6 @@ var MollifierDrainer = class {
|
|
|
17451
17492
|
this.perOrgEnvCursors.set(orgId, (cursor + 1) % sorted.length);
|
|
17452
17493
|
return sorted[idx];
|
|
17453
17494
|
}
|
|
17454
|
-
// A failure for one env (e.g. a Redis hiccup mid-batch in `pop`, or in
|
|
17455
|
-
// `requeue`/`fail` during error recovery inside `processEntry`) must not
|
|
17456
|
-
// poison the rest of the batch — `Promise.all` would otherwise reject and
|
|
17457
|
-
// bubble all the way to `loop()`. Catch both stages here so the failed env
|
|
17458
|
-
// is just counted as "failed" for this tick and we move on.
|
|
17459
|
-
async processOneFromEnv(envId) {
|
|
17460
|
-
let entry;
|
|
17461
|
-
try {
|
|
17462
|
-
entry = await this.buffer.pop(envId);
|
|
17463
|
-
} catch (err) {
|
|
17464
|
-
this.logger.error("MollifierDrainer.pop failed", { envId, err });
|
|
17465
|
-
return "failed";
|
|
17466
|
-
}
|
|
17467
|
-
if (!entry) return "empty";
|
|
17468
|
-
try {
|
|
17469
|
-
return await this.processEntry(entry);
|
|
17470
|
-
} catch (err) {
|
|
17471
|
-
this.logger.error("MollifierDrainer.processEntry failed", {
|
|
17472
|
-
envId,
|
|
17473
|
-
runId: entry.runId,
|
|
17474
|
-
err
|
|
17475
|
-
});
|
|
17476
|
-
return "failed";
|
|
17477
|
-
}
|
|
17478
|
-
}
|
|
17479
17495
|
async processEntry(entry) {
|
|
17480
17496
|
try {
|
|
17481
17497
|
const payload = deserialiseSnapshot(entry.payload);
|