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