@obtrace/browser 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/console.js +30 -6
- package/dist/browser/errors.js +51 -18
- package/dist/browser/index.js +45 -8
- package/dist/browser/resources.js +14 -9
- package/dist/browser/supabase-intercept.js +133 -0
- package/dist/browser/supabase.js +104 -0
- package/dist/browser_entry.bundle.js +2535 -419
- package/dist/browser_entry.bundle.js.map +4 -4
- package/dist/core/otel-web-setup.js +30 -3
- package/dist/types/browser/console.d.ts +2 -1
- package/dist/types/browser/errors.d.ts +2 -1
- package/dist/types/browser/supabase-intercept.d.ts +2 -0
- package/dist/types/browser/supabase.d.ts +12 -0
- package/dist/types/core/otel-web-setup.d.ts +2 -0
- package/package.json +3 -1
|
@@ -13504,6 +13504,168 @@ var TraceAPI = class _TraceAPI {
|
|
|
13504
13504
|
// node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
13505
13505
|
var trace = TraceAPI.getInstance();
|
|
13506
13506
|
|
|
13507
|
+
// node_modules/@opentelemetry/api-logs/build/esm/types/LogRecord.js
|
|
13508
|
+
var SeverityNumber;
|
|
13509
|
+
(function(SeverityNumber3) {
|
|
13510
|
+
SeverityNumber3[SeverityNumber3["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
13511
|
+
SeverityNumber3[SeverityNumber3["TRACE"] = 1] = "TRACE";
|
|
13512
|
+
SeverityNumber3[SeverityNumber3["TRACE2"] = 2] = "TRACE2";
|
|
13513
|
+
SeverityNumber3[SeverityNumber3["TRACE3"] = 3] = "TRACE3";
|
|
13514
|
+
SeverityNumber3[SeverityNumber3["TRACE4"] = 4] = "TRACE4";
|
|
13515
|
+
SeverityNumber3[SeverityNumber3["DEBUG"] = 5] = "DEBUG";
|
|
13516
|
+
SeverityNumber3[SeverityNumber3["DEBUG2"] = 6] = "DEBUG2";
|
|
13517
|
+
SeverityNumber3[SeverityNumber3["DEBUG3"] = 7] = "DEBUG3";
|
|
13518
|
+
SeverityNumber3[SeverityNumber3["DEBUG4"] = 8] = "DEBUG4";
|
|
13519
|
+
SeverityNumber3[SeverityNumber3["INFO"] = 9] = "INFO";
|
|
13520
|
+
SeverityNumber3[SeverityNumber3["INFO2"] = 10] = "INFO2";
|
|
13521
|
+
SeverityNumber3[SeverityNumber3["INFO3"] = 11] = "INFO3";
|
|
13522
|
+
SeverityNumber3[SeverityNumber3["INFO4"] = 12] = "INFO4";
|
|
13523
|
+
SeverityNumber3[SeverityNumber3["WARN"] = 13] = "WARN";
|
|
13524
|
+
SeverityNumber3[SeverityNumber3["WARN2"] = 14] = "WARN2";
|
|
13525
|
+
SeverityNumber3[SeverityNumber3["WARN3"] = 15] = "WARN3";
|
|
13526
|
+
SeverityNumber3[SeverityNumber3["WARN4"] = 16] = "WARN4";
|
|
13527
|
+
SeverityNumber3[SeverityNumber3["ERROR"] = 17] = "ERROR";
|
|
13528
|
+
SeverityNumber3[SeverityNumber3["ERROR2"] = 18] = "ERROR2";
|
|
13529
|
+
SeverityNumber3[SeverityNumber3["ERROR3"] = 19] = "ERROR3";
|
|
13530
|
+
SeverityNumber3[SeverityNumber3["ERROR4"] = 20] = "ERROR4";
|
|
13531
|
+
SeverityNumber3[SeverityNumber3["FATAL"] = 21] = "FATAL";
|
|
13532
|
+
SeverityNumber3[SeverityNumber3["FATAL2"] = 22] = "FATAL2";
|
|
13533
|
+
SeverityNumber3[SeverityNumber3["FATAL3"] = 23] = "FATAL3";
|
|
13534
|
+
SeverityNumber3[SeverityNumber3["FATAL4"] = 24] = "FATAL4";
|
|
13535
|
+
})(SeverityNumber || (SeverityNumber = {}));
|
|
13536
|
+
|
|
13537
|
+
// node_modules/@opentelemetry/api-logs/build/esm/NoopLogger.js
|
|
13538
|
+
var NoopLogger = (
|
|
13539
|
+
/** @class */
|
|
13540
|
+
(function() {
|
|
13541
|
+
function NoopLogger5() {
|
|
13542
|
+
}
|
|
13543
|
+
NoopLogger5.prototype.emit = function(_logRecord) {
|
|
13544
|
+
};
|
|
13545
|
+
return NoopLogger5;
|
|
13546
|
+
})()
|
|
13547
|
+
);
|
|
13548
|
+
var NOOP_LOGGER = new NoopLogger();
|
|
13549
|
+
|
|
13550
|
+
// node_modules/@opentelemetry/api-logs/build/esm/NoopLoggerProvider.js
|
|
13551
|
+
var NoopLoggerProvider = (
|
|
13552
|
+
/** @class */
|
|
13553
|
+
(function() {
|
|
13554
|
+
function NoopLoggerProvider5() {
|
|
13555
|
+
}
|
|
13556
|
+
NoopLoggerProvider5.prototype.getLogger = function(_name, _version, _options) {
|
|
13557
|
+
return new NoopLogger();
|
|
13558
|
+
};
|
|
13559
|
+
return NoopLoggerProvider5;
|
|
13560
|
+
})()
|
|
13561
|
+
);
|
|
13562
|
+
var NOOP_LOGGER_PROVIDER = new NoopLoggerProvider();
|
|
13563
|
+
|
|
13564
|
+
// node_modules/@opentelemetry/api-logs/build/esm/ProxyLogger.js
|
|
13565
|
+
var ProxyLogger = (
|
|
13566
|
+
/** @class */
|
|
13567
|
+
(function() {
|
|
13568
|
+
function ProxyLogger5(_provider, name, version, options) {
|
|
13569
|
+
this._provider = _provider;
|
|
13570
|
+
this.name = name;
|
|
13571
|
+
this.version = version;
|
|
13572
|
+
this.options = options;
|
|
13573
|
+
}
|
|
13574
|
+
ProxyLogger5.prototype.emit = function(logRecord) {
|
|
13575
|
+
this._getLogger().emit(logRecord);
|
|
13576
|
+
};
|
|
13577
|
+
ProxyLogger5.prototype._getLogger = function() {
|
|
13578
|
+
if (this._delegate) {
|
|
13579
|
+
return this._delegate;
|
|
13580
|
+
}
|
|
13581
|
+
var logger = this._provider.getDelegateLogger(this.name, this.version, this.options);
|
|
13582
|
+
if (!logger) {
|
|
13583
|
+
return NOOP_LOGGER;
|
|
13584
|
+
}
|
|
13585
|
+
this._delegate = logger;
|
|
13586
|
+
return this._delegate;
|
|
13587
|
+
};
|
|
13588
|
+
return ProxyLogger5;
|
|
13589
|
+
})()
|
|
13590
|
+
);
|
|
13591
|
+
|
|
13592
|
+
// node_modules/@opentelemetry/api-logs/build/esm/ProxyLoggerProvider.js
|
|
13593
|
+
var ProxyLoggerProvider = (
|
|
13594
|
+
/** @class */
|
|
13595
|
+
(function() {
|
|
13596
|
+
function ProxyLoggerProvider5() {
|
|
13597
|
+
}
|
|
13598
|
+
ProxyLoggerProvider5.prototype.getLogger = function(name, version, options) {
|
|
13599
|
+
var _a4;
|
|
13600
|
+
return (_a4 = this.getDelegateLogger(name, version, options)) !== null && _a4 !== void 0 ? _a4 : new ProxyLogger(this, name, version, options);
|
|
13601
|
+
};
|
|
13602
|
+
ProxyLoggerProvider5.prototype.getDelegate = function() {
|
|
13603
|
+
var _a4;
|
|
13604
|
+
return (_a4 = this._delegate) !== null && _a4 !== void 0 ? _a4 : NOOP_LOGGER_PROVIDER;
|
|
13605
|
+
};
|
|
13606
|
+
ProxyLoggerProvider5.prototype.setDelegate = function(delegate) {
|
|
13607
|
+
this._delegate = delegate;
|
|
13608
|
+
};
|
|
13609
|
+
ProxyLoggerProvider5.prototype.getDelegateLogger = function(name, version, options) {
|
|
13610
|
+
var _a4;
|
|
13611
|
+
return (_a4 = this._delegate) === null || _a4 === void 0 ? void 0 : _a4.getLogger(name, version, options);
|
|
13612
|
+
};
|
|
13613
|
+
return ProxyLoggerProvider5;
|
|
13614
|
+
})()
|
|
13615
|
+
);
|
|
13616
|
+
|
|
13617
|
+
// node_modules/@opentelemetry/api-logs/build/esm/platform/browser/globalThis.js
|
|
13618
|
+
var _globalThis = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
13619
|
+
|
|
13620
|
+
// node_modules/@opentelemetry/api-logs/build/esm/internal/global-utils.js
|
|
13621
|
+
var GLOBAL_LOGS_API_KEY = /* @__PURE__ */ Symbol.for("io.opentelemetry.js.api.logs");
|
|
13622
|
+
var _global2 = _globalThis;
|
|
13623
|
+
function makeGetter(requiredVersion, instance, fallback) {
|
|
13624
|
+
return function(version) {
|
|
13625
|
+
return version === requiredVersion ? instance : fallback;
|
|
13626
|
+
};
|
|
13627
|
+
}
|
|
13628
|
+
var API_BACKWARDS_COMPATIBILITY_VERSION = 1;
|
|
13629
|
+
|
|
13630
|
+
// node_modules/@opentelemetry/api-logs/build/esm/api/logs.js
|
|
13631
|
+
var LogsAPI = (
|
|
13632
|
+
/** @class */
|
|
13633
|
+
(function() {
|
|
13634
|
+
function LogsAPI5() {
|
|
13635
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider();
|
|
13636
|
+
}
|
|
13637
|
+
LogsAPI5.getInstance = function() {
|
|
13638
|
+
if (!this._instance) {
|
|
13639
|
+
this._instance = new LogsAPI5();
|
|
13640
|
+
}
|
|
13641
|
+
return this._instance;
|
|
13642
|
+
};
|
|
13643
|
+
LogsAPI5.prototype.setGlobalLoggerProvider = function(provider) {
|
|
13644
|
+
if (_global2[GLOBAL_LOGS_API_KEY]) {
|
|
13645
|
+
return this.getLoggerProvider();
|
|
13646
|
+
}
|
|
13647
|
+
_global2[GLOBAL_LOGS_API_KEY] = makeGetter(API_BACKWARDS_COMPATIBILITY_VERSION, provider, NOOP_LOGGER_PROVIDER);
|
|
13648
|
+
this._proxyLoggerProvider.setDelegate(provider);
|
|
13649
|
+
return provider;
|
|
13650
|
+
};
|
|
13651
|
+
LogsAPI5.prototype.getLoggerProvider = function() {
|
|
13652
|
+
var _a4, _b;
|
|
13653
|
+
return (_b = (_a4 = _global2[GLOBAL_LOGS_API_KEY]) === null || _a4 === void 0 ? void 0 : _a4.call(_global2, API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider;
|
|
13654
|
+
};
|
|
13655
|
+
LogsAPI5.prototype.getLogger = function(name, version, options) {
|
|
13656
|
+
return this.getLoggerProvider().getLogger(name, version, options);
|
|
13657
|
+
};
|
|
13658
|
+
LogsAPI5.prototype.disable = function() {
|
|
13659
|
+
delete _global2[GLOBAL_LOGS_API_KEY];
|
|
13660
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider();
|
|
13661
|
+
};
|
|
13662
|
+
return LogsAPI5;
|
|
13663
|
+
})()
|
|
13664
|
+
);
|
|
13665
|
+
|
|
13666
|
+
// node_modules/@opentelemetry/api-logs/build/esm/index.js
|
|
13667
|
+
var logs = LogsAPI.getInstance();
|
|
13668
|
+
|
|
13507
13669
|
// src/browser/offline.ts
|
|
13508
13670
|
var DB_NAME = "obtrace_offline";
|
|
13509
13671
|
var STORE_NAME = "queue";
|
|
@@ -14186,15 +14348,15 @@ function parseEnvironment(values) {
|
|
|
14186
14348
|
}
|
|
14187
14349
|
|
|
14188
14350
|
// node_modules/@opentelemetry/core/build/esm/platform/browser/globalThis.js
|
|
14189
|
-
var
|
|
14351
|
+
var _globalThis2 = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
14190
14352
|
|
|
14191
14353
|
// node_modules/@opentelemetry/core/build/esm/platform/browser/environment.js
|
|
14192
14354
|
function getEnv() {
|
|
14193
|
-
var globalEnv = parseEnvironment(
|
|
14355
|
+
var globalEnv = parseEnvironment(_globalThis2);
|
|
14194
14356
|
return Object.assign({}, DEFAULT_ENVIRONMENT, globalEnv);
|
|
14195
14357
|
}
|
|
14196
14358
|
function getEnvWithoutDefaults() {
|
|
14197
|
-
return parseEnvironment(
|
|
14359
|
+
return parseEnvironment(_globalThis2);
|
|
14198
14360
|
}
|
|
14199
14361
|
|
|
14200
14362
|
// node_modules/@opentelemetry/core/build/esm/common/hex-to-binary.js
|
|
@@ -14315,9 +14477,9 @@ function addHrTimes(time1, time2) {
|
|
|
14315
14477
|
|
|
14316
14478
|
// node_modules/@opentelemetry/core/build/esm/ExportResult.js
|
|
14317
14479
|
var ExportResultCode;
|
|
14318
|
-
(function(
|
|
14319
|
-
|
|
14320
|
-
|
|
14480
|
+
(function(ExportResultCode4) {
|
|
14481
|
+
ExportResultCode4[ExportResultCode4["SUCCESS"] = 0] = "SUCCESS";
|
|
14482
|
+
ExportResultCode4[ExportResultCode4["FAILED"] = 1] = "FAILED";
|
|
14321
14483
|
})(ExportResultCode || (ExportResultCode = {}));
|
|
14322
14484
|
|
|
14323
14485
|
// node_modules/@opentelemetry/core/build/esm/propagation/composite.js
|
|
@@ -14747,27 +14909,27 @@ function isUrlIgnored(url, ignoredUrls) {
|
|
|
14747
14909
|
var Deferred = (
|
|
14748
14910
|
/** @class */
|
|
14749
14911
|
(function() {
|
|
14750
|
-
function
|
|
14912
|
+
function Deferred3() {
|
|
14751
14913
|
var _this = this;
|
|
14752
14914
|
this._promise = new Promise(function(resolve2, reject) {
|
|
14753
14915
|
_this._resolve = resolve2;
|
|
14754
14916
|
_this._reject = reject;
|
|
14755
14917
|
});
|
|
14756
14918
|
}
|
|
14757
|
-
Object.defineProperty(
|
|
14919
|
+
Object.defineProperty(Deferred3.prototype, "promise", {
|
|
14758
14920
|
get: function() {
|
|
14759
14921
|
return this._promise;
|
|
14760
14922
|
},
|
|
14761
14923
|
enumerable: false,
|
|
14762
14924
|
configurable: true
|
|
14763
14925
|
});
|
|
14764
|
-
|
|
14926
|
+
Deferred3.prototype.resolve = function(val) {
|
|
14765
14927
|
this._resolve(val);
|
|
14766
14928
|
};
|
|
14767
|
-
|
|
14929
|
+
Deferred3.prototype.reject = function(err) {
|
|
14768
14930
|
this._reject(err);
|
|
14769
14931
|
};
|
|
14770
|
-
return
|
|
14932
|
+
return Deferred3;
|
|
14771
14933
|
})()
|
|
14772
14934
|
);
|
|
14773
14935
|
|
|
@@ -14801,27 +14963,27 @@ var __spreadArray = function(to, from, pack) {
|
|
|
14801
14963
|
var BindOnceFuture = (
|
|
14802
14964
|
/** @class */
|
|
14803
14965
|
(function() {
|
|
14804
|
-
function
|
|
14966
|
+
function BindOnceFuture3(_callback, _that) {
|
|
14805
14967
|
this._callback = _callback;
|
|
14806
14968
|
this._that = _that;
|
|
14807
14969
|
this._isCalled = false;
|
|
14808
14970
|
this._deferred = new Deferred();
|
|
14809
14971
|
}
|
|
14810
|
-
Object.defineProperty(
|
|
14972
|
+
Object.defineProperty(BindOnceFuture3.prototype, "isCalled", {
|
|
14811
14973
|
get: function() {
|
|
14812
14974
|
return this._isCalled;
|
|
14813
14975
|
},
|
|
14814
14976
|
enumerable: false,
|
|
14815
14977
|
configurable: true
|
|
14816
14978
|
});
|
|
14817
|
-
Object.defineProperty(
|
|
14979
|
+
Object.defineProperty(BindOnceFuture3.prototype, "promise", {
|
|
14818
14980
|
get: function() {
|
|
14819
14981
|
return this._deferred.promise;
|
|
14820
14982
|
},
|
|
14821
14983
|
enumerable: false,
|
|
14822
14984
|
configurable: true
|
|
14823
14985
|
});
|
|
14824
|
-
|
|
14986
|
+
BindOnceFuture3.prototype.call = function() {
|
|
14825
14987
|
var _a4;
|
|
14826
14988
|
var _this = this;
|
|
14827
14989
|
var args = [];
|
|
@@ -14842,7 +15004,7 @@ var BindOnceFuture = (
|
|
|
14842
15004
|
}
|
|
14843
15005
|
return this._deferred.promise;
|
|
14844
15006
|
};
|
|
14845
|
-
return
|
|
15007
|
+
return BindOnceFuture3;
|
|
14846
15008
|
})()
|
|
14847
15009
|
);
|
|
14848
15010
|
|
|
@@ -16690,19 +16852,19 @@ function shouldPropagateTraceHeaders(spanUrl, propagateTraceHeaderCorsUrls) {
|
|
|
16690
16852
|
var OTLPExporterBase = (
|
|
16691
16853
|
/** @class */
|
|
16692
16854
|
(function() {
|
|
16693
|
-
function
|
|
16855
|
+
function OTLPExporterBase3(_delegate) {
|
|
16694
16856
|
this._delegate = _delegate;
|
|
16695
16857
|
}
|
|
16696
|
-
|
|
16858
|
+
OTLPExporterBase3.prototype.export = function(items, resultCallback) {
|
|
16697
16859
|
this._delegate.export(items, resultCallback);
|
|
16698
16860
|
};
|
|
16699
|
-
|
|
16861
|
+
OTLPExporterBase3.prototype.forceFlush = function() {
|
|
16700
16862
|
return this._delegate.forceFlush();
|
|
16701
16863
|
};
|
|
16702
|
-
|
|
16864
|
+
OTLPExporterBase3.prototype.shutdown = function() {
|
|
16703
16865
|
return this._delegate.shutdown();
|
|
16704
16866
|
};
|
|
16705
|
-
return
|
|
16867
|
+
return OTLPExporterBase3;
|
|
16706
16868
|
})()
|
|
16707
16869
|
);
|
|
16708
16870
|
|
|
@@ -16729,15 +16891,15 @@ var __extends3 = /* @__PURE__ */ (function() {
|
|
|
16729
16891
|
var OTLPExporterError = (
|
|
16730
16892
|
/** @class */
|
|
16731
16893
|
(function(_super) {
|
|
16732
|
-
__extends3(
|
|
16733
|
-
function
|
|
16894
|
+
__extends3(OTLPExporterError3, _super);
|
|
16895
|
+
function OTLPExporterError3(message, code, data) {
|
|
16734
16896
|
var _this = _super.call(this, message) || this;
|
|
16735
16897
|
_this.name = "OTLPExporterError";
|
|
16736
16898
|
_this.data = data;
|
|
16737
16899
|
_this.code = code;
|
|
16738
16900
|
return _this;
|
|
16739
16901
|
}
|
|
16740
|
-
return
|
|
16902
|
+
return OTLPExporterError3;
|
|
16741
16903
|
})(Error)
|
|
16742
16904
|
);
|
|
16743
16905
|
|
|
@@ -16872,11 +17034,11 @@ var __generator2 = function(thisArg, body) {
|
|
|
16872
17034
|
var BoundedQueueExportPromiseHandler = (
|
|
16873
17035
|
/** @class */
|
|
16874
17036
|
(function() {
|
|
16875
|
-
function
|
|
17037
|
+
function BoundedQueueExportPromiseHandler3(concurrencyLimit) {
|
|
16876
17038
|
this._sendingPromises = [];
|
|
16877
17039
|
this._concurrencyLimit = concurrencyLimit;
|
|
16878
17040
|
}
|
|
16879
|
-
|
|
17041
|
+
BoundedQueueExportPromiseHandler3.prototype.pushPromise = function(promise) {
|
|
16880
17042
|
var _this = this;
|
|
16881
17043
|
if (this.hasReachedLimit()) {
|
|
16882
17044
|
throw new Error("Concurrency Limit reached");
|
|
@@ -16888,10 +17050,10 @@ var BoundedQueueExportPromiseHandler = (
|
|
|
16888
17050
|
};
|
|
16889
17051
|
promise.then(popPromise, popPromise);
|
|
16890
17052
|
};
|
|
16891
|
-
|
|
17053
|
+
BoundedQueueExportPromiseHandler3.prototype.hasReachedLimit = function() {
|
|
16892
17054
|
return this._sendingPromises.length >= this._concurrencyLimit;
|
|
16893
17055
|
};
|
|
16894
|
-
|
|
17056
|
+
BoundedQueueExportPromiseHandler3.prototype.awaitAll = function() {
|
|
16895
17057
|
return __awaiter2(this, void 0, void 0, function() {
|
|
16896
17058
|
return __generator2(this, function(_a4) {
|
|
16897
17059
|
switch (_a4.label) {
|
|
@@ -16907,7 +17069,7 @@ var BoundedQueueExportPromiseHandler = (
|
|
|
16907
17069
|
});
|
|
16908
17070
|
});
|
|
16909
17071
|
};
|
|
16910
|
-
return
|
|
17072
|
+
return BoundedQueueExportPromiseHandler3;
|
|
16911
17073
|
})()
|
|
16912
17074
|
);
|
|
16913
17075
|
function createBoundedQueueExportPromiseHandler(options) {
|
|
@@ -17029,7 +17191,7 @@ var __generator3 = function(thisArg, body) {
|
|
|
17029
17191
|
var OTLPExportDelegate = (
|
|
17030
17192
|
/** @class */
|
|
17031
17193
|
(function() {
|
|
17032
|
-
function
|
|
17194
|
+
function OTLPExportDelegate3(_transport, _serializer, _responseHandler, _promiseQueue, _timeout) {
|
|
17033
17195
|
this._transport = _transport;
|
|
17034
17196
|
this._serializer = _serializer;
|
|
17035
17197
|
this._responseHandler = _responseHandler;
|
|
@@ -17039,7 +17201,7 @@ var OTLPExportDelegate = (
|
|
|
17039
17201
|
namespace: "OTLPExportDelegate"
|
|
17040
17202
|
});
|
|
17041
17203
|
}
|
|
17042
|
-
|
|
17204
|
+
OTLPExportDelegate3.prototype.export = function(internalRepresentation, resultCallback) {
|
|
17043
17205
|
var _this = this;
|
|
17044
17206
|
this._diagLogger.debug("items to be sent", internalRepresentation);
|
|
17045
17207
|
if (this._promiseQueue.hasReachedLimit()) {
|
|
@@ -17094,10 +17256,10 @@ var OTLPExportDelegate = (
|
|
|
17094
17256
|
});
|
|
17095
17257
|
}));
|
|
17096
17258
|
};
|
|
17097
|
-
|
|
17259
|
+
OTLPExportDelegate3.prototype.forceFlush = function() {
|
|
17098
17260
|
return this._promiseQueue.awaitAll();
|
|
17099
17261
|
};
|
|
17100
|
-
|
|
17262
|
+
OTLPExportDelegate3.prototype.shutdown = function() {
|
|
17101
17263
|
return __awaiter3(this, void 0, void 0, function() {
|
|
17102
17264
|
return __generator3(this, function(_a4) {
|
|
17103
17265
|
switch (_a4.label) {
|
|
@@ -17115,7 +17277,7 @@ var OTLPExportDelegate = (
|
|
|
17115
17277
|
});
|
|
17116
17278
|
});
|
|
17117
17279
|
};
|
|
17118
|
-
return
|
|
17280
|
+
return OTLPExportDelegate3;
|
|
17119
17281
|
})()
|
|
17120
17282
|
);
|
|
17121
17283
|
function createOtlpExportDelegate(components, settings) {
|
|
@@ -17132,21 +17294,21 @@ function createOtlpNetworkExportDelegate(options, serializer, transport) {
|
|
|
17132
17294
|
}
|
|
17133
17295
|
|
|
17134
17296
|
// node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js
|
|
17135
|
-
function hrTimeToNanos(
|
|
17297
|
+
function hrTimeToNanos(hrTime4) {
|
|
17136
17298
|
var NANOSECONDS = BigInt(1e9);
|
|
17137
|
-
return BigInt(
|
|
17299
|
+
return BigInt(hrTime4[0]) * NANOSECONDS + BigInt(hrTime4[1]);
|
|
17138
17300
|
}
|
|
17139
17301
|
function toLongBits(value) {
|
|
17140
17302
|
var low = Number(BigInt.asUintN(32, value));
|
|
17141
17303
|
var high = Number(BigInt.asUintN(32, value >> BigInt(32)));
|
|
17142
17304
|
return { low, high };
|
|
17143
17305
|
}
|
|
17144
|
-
function encodeAsLongBits(
|
|
17145
|
-
var nanos = hrTimeToNanos(
|
|
17306
|
+
function encodeAsLongBits(hrTime4) {
|
|
17307
|
+
var nanos = hrTimeToNanos(hrTime4);
|
|
17146
17308
|
return toLongBits(nanos);
|
|
17147
17309
|
}
|
|
17148
|
-
function encodeAsString(
|
|
17149
|
-
var nanos = hrTimeToNanos(
|
|
17310
|
+
function encodeAsString(hrTime4) {
|
|
17311
|
+
var nanos = hrTimeToNanos(hrTime4);
|
|
17150
17312
|
return nanos.toString();
|
|
17151
17313
|
}
|
|
17152
17314
|
var encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : hrTimeToNanoseconds;
|
|
@@ -17433,13 +17595,13 @@ function instrumentationScopeId(instrumentationScope) {
|
|
|
17433
17595
|
var TimeoutError = (
|
|
17434
17596
|
/** @class */
|
|
17435
17597
|
(function(_super) {
|
|
17436
|
-
__extends4(
|
|
17437
|
-
function
|
|
17598
|
+
__extends4(TimeoutError3, _super);
|
|
17599
|
+
function TimeoutError3(message) {
|
|
17438
17600
|
var _this = _super.call(this, message) || this;
|
|
17439
|
-
Object.setPrototypeOf(_this,
|
|
17601
|
+
Object.setPrototypeOf(_this, TimeoutError3.prototype);
|
|
17440
17602
|
return _this;
|
|
17441
17603
|
}
|
|
17442
|
-
return
|
|
17604
|
+
return TimeoutError3;
|
|
17443
17605
|
})(Error)
|
|
17444
17606
|
);
|
|
17445
17607
|
function callWithTimeout(promise, timeout) {
|
|
@@ -22144,10 +22306,10 @@ function getJitter() {
|
|
|
22144
22306
|
var RetryingTransport = (
|
|
22145
22307
|
/** @class */
|
|
22146
22308
|
(function() {
|
|
22147
|
-
function
|
|
22309
|
+
function RetryingTransport3(_transport) {
|
|
22148
22310
|
this._transport = _transport;
|
|
22149
22311
|
}
|
|
22150
|
-
|
|
22312
|
+
RetryingTransport3.prototype.retry = function(data, timeoutMillis, inMillis) {
|
|
22151
22313
|
var _this = this;
|
|
22152
22314
|
return new Promise(function(resolve2, reject) {
|
|
22153
22315
|
setTimeout(function() {
|
|
@@ -22155,7 +22317,7 @@ var RetryingTransport = (
|
|
|
22155
22317
|
}, inMillis);
|
|
22156
22318
|
});
|
|
22157
22319
|
};
|
|
22158
|
-
|
|
22320
|
+
RetryingTransport3.prototype.send = function(data, timeoutMillis) {
|
|
22159
22321
|
var _a4;
|
|
22160
22322
|
return __awaiter11(this, void 0, void 0, function() {
|
|
22161
22323
|
var deadline, result2, attempts, nextBackoff, backoff, retryInMillis, remainingTimeoutMillis;
|
|
@@ -22189,10 +22351,10 @@ var RetryingTransport = (
|
|
|
22189
22351
|
});
|
|
22190
22352
|
});
|
|
22191
22353
|
};
|
|
22192
|
-
|
|
22354
|
+
RetryingTransport3.prototype.shutdown = function() {
|
|
22193
22355
|
return this._transport.shutdown();
|
|
22194
22356
|
};
|
|
22195
|
-
return
|
|
22357
|
+
return RetryingTransport3;
|
|
22196
22358
|
})()
|
|
22197
22359
|
);
|
|
22198
22360
|
function createRetryingTransport(options) {
|
|
@@ -22632,6 +22794,217 @@ var OTLPMetricExporter = (
|
|
|
22632
22794
|
})(OTLPMetricExporterBase)
|
|
22633
22795
|
);
|
|
22634
22796
|
|
|
22797
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs/build/esm/types/LogRecord.js
|
|
22798
|
+
var SeverityNumber2;
|
|
22799
|
+
(function(SeverityNumber3) {
|
|
22800
|
+
SeverityNumber3[SeverityNumber3["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
22801
|
+
SeverityNumber3[SeverityNumber3["TRACE"] = 1] = "TRACE";
|
|
22802
|
+
SeverityNumber3[SeverityNumber3["TRACE2"] = 2] = "TRACE2";
|
|
22803
|
+
SeverityNumber3[SeverityNumber3["TRACE3"] = 3] = "TRACE3";
|
|
22804
|
+
SeverityNumber3[SeverityNumber3["TRACE4"] = 4] = "TRACE4";
|
|
22805
|
+
SeverityNumber3[SeverityNumber3["DEBUG"] = 5] = "DEBUG";
|
|
22806
|
+
SeverityNumber3[SeverityNumber3["DEBUG2"] = 6] = "DEBUG2";
|
|
22807
|
+
SeverityNumber3[SeverityNumber3["DEBUG3"] = 7] = "DEBUG3";
|
|
22808
|
+
SeverityNumber3[SeverityNumber3["DEBUG4"] = 8] = "DEBUG4";
|
|
22809
|
+
SeverityNumber3[SeverityNumber3["INFO"] = 9] = "INFO";
|
|
22810
|
+
SeverityNumber3[SeverityNumber3["INFO2"] = 10] = "INFO2";
|
|
22811
|
+
SeverityNumber3[SeverityNumber3["INFO3"] = 11] = "INFO3";
|
|
22812
|
+
SeverityNumber3[SeverityNumber3["INFO4"] = 12] = "INFO4";
|
|
22813
|
+
SeverityNumber3[SeverityNumber3["WARN"] = 13] = "WARN";
|
|
22814
|
+
SeverityNumber3[SeverityNumber3["WARN2"] = 14] = "WARN2";
|
|
22815
|
+
SeverityNumber3[SeverityNumber3["WARN3"] = 15] = "WARN3";
|
|
22816
|
+
SeverityNumber3[SeverityNumber3["WARN4"] = 16] = "WARN4";
|
|
22817
|
+
SeverityNumber3[SeverityNumber3["ERROR"] = 17] = "ERROR";
|
|
22818
|
+
SeverityNumber3[SeverityNumber3["ERROR2"] = 18] = "ERROR2";
|
|
22819
|
+
SeverityNumber3[SeverityNumber3["ERROR3"] = 19] = "ERROR3";
|
|
22820
|
+
SeverityNumber3[SeverityNumber3["ERROR4"] = 20] = "ERROR4";
|
|
22821
|
+
SeverityNumber3[SeverityNumber3["FATAL"] = 21] = "FATAL";
|
|
22822
|
+
SeverityNumber3[SeverityNumber3["FATAL2"] = 22] = "FATAL2";
|
|
22823
|
+
SeverityNumber3[SeverityNumber3["FATAL3"] = 23] = "FATAL3";
|
|
22824
|
+
SeverityNumber3[SeverityNumber3["FATAL4"] = 24] = "FATAL4";
|
|
22825
|
+
})(SeverityNumber2 || (SeverityNumber2 = {}));
|
|
22826
|
+
|
|
22827
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs/build/esm/NoopLogger.js
|
|
22828
|
+
var NoopLogger2 = class {
|
|
22829
|
+
emit(_logRecord) {
|
|
22830
|
+
}
|
|
22831
|
+
};
|
|
22832
|
+
var NOOP_LOGGER2 = new NoopLogger2();
|
|
22833
|
+
|
|
22834
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs/build/esm/internal/global-utils.js
|
|
22835
|
+
var GLOBAL_LOGS_API_KEY2 = /* @__PURE__ */ Symbol.for("io.opentelemetry.js.api.logs");
|
|
22836
|
+
var _global3 = globalThis;
|
|
22837
|
+
function makeGetter2(requiredVersion, instance, fallback) {
|
|
22838
|
+
return (version) => version === requiredVersion ? instance : fallback;
|
|
22839
|
+
}
|
|
22840
|
+
var API_BACKWARDS_COMPATIBILITY_VERSION2 = 1;
|
|
22841
|
+
|
|
22842
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs/build/esm/NoopLoggerProvider.js
|
|
22843
|
+
var NoopLoggerProvider2 = class {
|
|
22844
|
+
getLogger(_name, _version, _options) {
|
|
22845
|
+
return new NoopLogger2();
|
|
22846
|
+
}
|
|
22847
|
+
};
|
|
22848
|
+
var NOOP_LOGGER_PROVIDER2 = new NoopLoggerProvider2();
|
|
22849
|
+
|
|
22850
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs/build/esm/ProxyLogger.js
|
|
22851
|
+
var ProxyLogger2 = class {
|
|
22852
|
+
constructor(provider, name, version, options) {
|
|
22853
|
+
this._provider = provider;
|
|
22854
|
+
this.name = name;
|
|
22855
|
+
this.version = version;
|
|
22856
|
+
this.options = options;
|
|
22857
|
+
}
|
|
22858
|
+
/**
|
|
22859
|
+
* Emit a log record. This method should only be used by log appenders.
|
|
22860
|
+
*
|
|
22861
|
+
* @param logRecord
|
|
22862
|
+
*/
|
|
22863
|
+
emit(logRecord) {
|
|
22864
|
+
this._getLogger().emit(logRecord);
|
|
22865
|
+
}
|
|
22866
|
+
/**
|
|
22867
|
+
* Try to get a logger from the proxy logger provider.
|
|
22868
|
+
* If the proxy logger provider has no delegate, return a noop logger.
|
|
22869
|
+
*/
|
|
22870
|
+
_getLogger() {
|
|
22871
|
+
if (this._delegate) {
|
|
22872
|
+
return this._delegate;
|
|
22873
|
+
}
|
|
22874
|
+
const logger = this._provider._getDelegateLogger(this.name, this.version, this.options);
|
|
22875
|
+
if (!logger) {
|
|
22876
|
+
return NOOP_LOGGER2;
|
|
22877
|
+
}
|
|
22878
|
+
this._delegate = logger;
|
|
22879
|
+
return this._delegate;
|
|
22880
|
+
}
|
|
22881
|
+
};
|
|
22882
|
+
|
|
22883
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs/build/esm/ProxyLoggerProvider.js
|
|
22884
|
+
var ProxyLoggerProvider2 = class {
|
|
22885
|
+
getLogger(name, version, options) {
|
|
22886
|
+
var _a4;
|
|
22887
|
+
return (_a4 = this._getDelegateLogger(name, version, options)) !== null && _a4 !== void 0 ? _a4 : new ProxyLogger2(this, name, version, options);
|
|
22888
|
+
}
|
|
22889
|
+
/**
|
|
22890
|
+
* Get the delegate logger provider.
|
|
22891
|
+
* Used by tests only.
|
|
22892
|
+
* @internal
|
|
22893
|
+
*/
|
|
22894
|
+
_getDelegate() {
|
|
22895
|
+
var _a4;
|
|
22896
|
+
return (_a4 = this._delegate) !== null && _a4 !== void 0 ? _a4 : NOOP_LOGGER_PROVIDER2;
|
|
22897
|
+
}
|
|
22898
|
+
/**
|
|
22899
|
+
* Set the delegate logger provider
|
|
22900
|
+
* @internal
|
|
22901
|
+
*/
|
|
22902
|
+
_setDelegate(delegate) {
|
|
22903
|
+
this._delegate = delegate;
|
|
22904
|
+
}
|
|
22905
|
+
/**
|
|
22906
|
+
* @internal
|
|
22907
|
+
*/
|
|
22908
|
+
_getDelegateLogger(name, version, options) {
|
|
22909
|
+
var _a4;
|
|
22910
|
+
return (_a4 = this._delegate) === null || _a4 === void 0 ? void 0 : _a4.getLogger(name, version, options);
|
|
22911
|
+
}
|
|
22912
|
+
};
|
|
22913
|
+
|
|
22914
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs/build/esm/api/logs.js
|
|
22915
|
+
var LogsAPI2 = class _LogsAPI {
|
|
22916
|
+
constructor() {
|
|
22917
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider2();
|
|
22918
|
+
}
|
|
22919
|
+
static getInstance() {
|
|
22920
|
+
if (!this._instance) {
|
|
22921
|
+
this._instance = new _LogsAPI();
|
|
22922
|
+
}
|
|
22923
|
+
return this._instance;
|
|
22924
|
+
}
|
|
22925
|
+
setGlobalLoggerProvider(provider) {
|
|
22926
|
+
if (_global3[GLOBAL_LOGS_API_KEY2]) {
|
|
22927
|
+
return this.getLoggerProvider();
|
|
22928
|
+
}
|
|
22929
|
+
_global3[GLOBAL_LOGS_API_KEY2] = makeGetter2(API_BACKWARDS_COMPATIBILITY_VERSION2, provider, NOOP_LOGGER_PROVIDER2);
|
|
22930
|
+
this._proxyLoggerProvider._setDelegate(provider);
|
|
22931
|
+
return provider;
|
|
22932
|
+
}
|
|
22933
|
+
/**
|
|
22934
|
+
* Returns the global logger provider.
|
|
22935
|
+
*
|
|
22936
|
+
* @returns LoggerProvider
|
|
22937
|
+
*/
|
|
22938
|
+
getLoggerProvider() {
|
|
22939
|
+
var _a4, _b;
|
|
22940
|
+
return (_b = (_a4 = _global3[GLOBAL_LOGS_API_KEY2]) === null || _a4 === void 0 ? void 0 : _a4.call(_global3, API_BACKWARDS_COMPATIBILITY_VERSION2)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider;
|
|
22941
|
+
}
|
|
22942
|
+
/**
|
|
22943
|
+
* Returns a logger from the global logger provider.
|
|
22944
|
+
*
|
|
22945
|
+
* @returns Logger
|
|
22946
|
+
*/
|
|
22947
|
+
getLogger(name, version, options) {
|
|
22948
|
+
return this.getLoggerProvider().getLogger(name, version, options);
|
|
22949
|
+
}
|
|
22950
|
+
/** Remove the global logger provider */
|
|
22951
|
+
disable() {
|
|
22952
|
+
delete _global3[GLOBAL_LOGS_API_KEY2];
|
|
22953
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider2();
|
|
22954
|
+
}
|
|
22955
|
+
};
|
|
22956
|
+
|
|
22957
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/api-logs/build/esm/index.js
|
|
22958
|
+
var logs2 = LogsAPI2.getInstance();
|
|
22959
|
+
|
|
22960
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js
|
|
22961
|
+
var SUPPRESS_TRACING_KEY2 = createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");
|
|
22962
|
+
function suppressTracing2(context2) {
|
|
22963
|
+
return context2.setValue(SUPPRESS_TRACING_KEY2, true);
|
|
22964
|
+
}
|
|
22965
|
+
|
|
22966
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js
|
|
22967
|
+
function loggingErrorHandler2() {
|
|
22968
|
+
return (ex) => {
|
|
22969
|
+
diag2.error(stringifyException2(ex));
|
|
22970
|
+
};
|
|
22971
|
+
}
|
|
22972
|
+
function stringifyException2(ex) {
|
|
22973
|
+
if (typeof ex === "string") {
|
|
22974
|
+
return ex;
|
|
22975
|
+
} else {
|
|
22976
|
+
return JSON.stringify(flattenException2(ex));
|
|
22977
|
+
}
|
|
22978
|
+
}
|
|
22979
|
+
function flattenException2(ex) {
|
|
22980
|
+
const result2 = {};
|
|
22981
|
+
let current = ex;
|
|
22982
|
+
while (current !== null) {
|
|
22983
|
+
Object.getOwnPropertyNames(current).forEach((propertyName) => {
|
|
22984
|
+
if (result2[propertyName])
|
|
22985
|
+
return;
|
|
22986
|
+
const value = current[propertyName];
|
|
22987
|
+
if (value) {
|
|
22988
|
+
result2[propertyName] = String(value);
|
|
22989
|
+
}
|
|
22990
|
+
});
|
|
22991
|
+
current = Object.getPrototypeOf(current);
|
|
22992
|
+
}
|
|
22993
|
+
return result2;
|
|
22994
|
+
}
|
|
22995
|
+
|
|
22996
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js
|
|
22997
|
+
var delegateHandler2 = loggingErrorHandler2();
|
|
22998
|
+
function globalErrorHandler2(ex) {
|
|
22999
|
+
try {
|
|
23000
|
+
delegateHandler2(ex);
|
|
23001
|
+
} catch {
|
|
23002
|
+
}
|
|
23003
|
+
}
|
|
23004
|
+
|
|
23005
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/version.js
|
|
23006
|
+
var VERSION4 = "2.6.1";
|
|
23007
|
+
|
|
22635
23008
|
// node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js
|
|
22636
23009
|
var TMP_HTTP_URL = "http.url";
|
|
22637
23010
|
var TMP_HTTP_USER_AGENT = "http.user_agent";
|
|
@@ -22639,140 +23012,1681 @@ var SEMATTRS_HTTP_URL = TMP_HTTP_URL;
|
|
|
22639
23012
|
var SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT;
|
|
22640
23013
|
|
|
22641
23014
|
// node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js
|
|
23015
|
+
var ATTR_EXCEPTION_MESSAGE = "exception.message";
|
|
23016
|
+
var ATTR_EXCEPTION_STACKTRACE = "exception.stacktrace";
|
|
23017
|
+
var ATTR_EXCEPTION_TYPE = "exception.type";
|
|
22642
23018
|
var ATTR_SERVICE_NAME = "service.name";
|
|
22643
23019
|
var ATTR_SERVICE_VERSION = "service.version";
|
|
23020
|
+
var ATTR_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language";
|
|
23021
|
+
var TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs";
|
|
23022
|
+
var ATTR_TELEMETRY_SDK_NAME = "telemetry.sdk.name";
|
|
23023
|
+
var ATTR_TELEMETRY_SDK_VERSION = "telemetry.sdk.version";
|
|
22644
23024
|
|
|
22645
|
-
// node_modules/@opentelemetry/
|
|
22646
|
-
var
|
|
22647
|
-
/** @class */
|
|
22648
|
-
(function() {
|
|
22649
|
-
function NoopLogger4() {
|
|
22650
|
-
}
|
|
22651
|
-
NoopLogger4.prototype.emit = function(_logRecord) {
|
|
22652
|
-
};
|
|
22653
|
-
return NoopLogger4;
|
|
22654
|
-
})()
|
|
22655
|
-
);
|
|
22656
|
-
var NOOP_LOGGER = new NoopLogger();
|
|
23025
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/semconv.js
|
|
23026
|
+
var ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name";
|
|
22657
23027
|
|
|
22658
|
-
// node_modules/@opentelemetry/
|
|
22659
|
-
var
|
|
22660
|
-
|
|
22661
|
-
|
|
22662
|
-
|
|
22663
|
-
|
|
22664
|
-
|
|
22665
|
-
return new NoopLogger();
|
|
22666
|
-
};
|
|
22667
|
-
return NoopLoggerProvider4;
|
|
22668
|
-
})()
|
|
22669
|
-
);
|
|
22670
|
-
var NOOP_LOGGER_PROVIDER = new NoopLoggerProvider();
|
|
23028
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/platform/browser/sdk-info.js
|
|
23029
|
+
var SDK_INFO2 = {
|
|
23030
|
+
[ATTR_TELEMETRY_SDK_NAME]: "opentelemetry",
|
|
23031
|
+
[ATTR_PROCESS_RUNTIME_NAME]: "browser",
|
|
23032
|
+
[ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,
|
|
23033
|
+
[ATTR_TELEMETRY_SDK_VERSION]: VERSION4
|
|
23034
|
+
};
|
|
22671
23035
|
|
|
22672
|
-
// node_modules/@opentelemetry/
|
|
22673
|
-
var
|
|
22674
|
-
/** @class */
|
|
22675
|
-
(function() {
|
|
22676
|
-
function ProxyLogger4(_provider, name, version, options) {
|
|
22677
|
-
this._provider = _provider;
|
|
22678
|
-
this.name = name;
|
|
22679
|
-
this.version = version;
|
|
22680
|
-
this.options = options;
|
|
22681
|
-
}
|
|
22682
|
-
ProxyLogger4.prototype.emit = function(logRecord) {
|
|
22683
|
-
this._getLogger().emit(logRecord);
|
|
22684
|
-
};
|
|
22685
|
-
ProxyLogger4.prototype._getLogger = function() {
|
|
22686
|
-
if (this._delegate) {
|
|
22687
|
-
return this._delegate;
|
|
22688
|
-
}
|
|
22689
|
-
var logger = this._provider.getDelegateLogger(this.name, this.version, this.options);
|
|
22690
|
-
if (!logger) {
|
|
22691
|
-
return NOOP_LOGGER;
|
|
22692
|
-
}
|
|
22693
|
-
this._delegate = logger;
|
|
22694
|
-
return this._delegate;
|
|
22695
|
-
};
|
|
22696
|
-
return ProxyLogger4;
|
|
22697
|
-
})()
|
|
22698
|
-
);
|
|
23036
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js
|
|
23037
|
+
var otperformance2 = performance;
|
|
22699
23038
|
|
|
22700
|
-
// node_modules/@opentelemetry/
|
|
22701
|
-
var
|
|
22702
|
-
|
|
23039
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/common/time.js
|
|
23040
|
+
var NANOSECOND_DIGITS2 = 9;
|
|
23041
|
+
var NANOSECOND_DIGITS_IN_MILLIS2 = 6;
|
|
23042
|
+
var MILLISECONDS_TO_NANOSECONDS2 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS2);
|
|
23043
|
+
var SECOND_TO_NANOSECONDS2 = Math.pow(10, NANOSECOND_DIGITS2);
|
|
23044
|
+
function millisToHrTime2(epochMillis) {
|
|
23045
|
+
const epochSeconds = epochMillis / 1e3;
|
|
23046
|
+
const seconds = Math.trunc(epochSeconds);
|
|
23047
|
+
const nanos = Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS2);
|
|
23048
|
+
return [seconds, nanos];
|
|
23049
|
+
}
|
|
23050
|
+
function hrTime2(performanceNow) {
|
|
23051
|
+
const timeOrigin = millisToHrTime2(otperformance2.timeOrigin);
|
|
23052
|
+
const now = millisToHrTime2(typeof performanceNow === "number" ? performanceNow : otperformance2.now());
|
|
23053
|
+
return addHrTimes2(timeOrigin, now);
|
|
23054
|
+
}
|
|
23055
|
+
function timeInputToHrTime2(time) {
|
|
23056
|
+
if (isTimeInputHrTime2(time)) {
|
|
23057
|
+
return time;
|
|
23058
|
+
} else if (typeof time === "number") {
|
|
23059
|
+
if (time < otperformance2.timeOrigin) {
|
|
23060
|
+
return hrTime2(time);
|
|
23061
|
+
} else {
|
|
23062
|
+
return millisToHrTime2(time);
|
|
23063
|
+
}
|
|
23064
|
+
} else if (time instanceof Date) {
|
|
23065
|
+
return millisToHrTime2(time.getTime());
|
|
23066
|
+
} else {
|
|
23067
|
+
throw TypeError("Invalid input type");
|
|
23068
|
+
}
|
|
23069
|
+
}
|
|
23070
|
+
function isTimeInputHrTime2(value) {
|
|
23071
|
+
return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number";
|
|
23072
|
+
}
|
|
23073
|
+
function addHrTimes2(time1, time2) {
|
|
23074
|
+
const out = [time1[0] + time2[0], time1[1] + time2[1]];
|
|
23075
|
+
if (out[1] >= SECOND_TO_NANOSECONDS2) {
|
|
23076
|
+
out[1] -= SECOND_TO_NANOSECONDS2;
|
|
23077
|
+
out[0] += 1;
|
|
23078
|
+
}
|
|
23079
|
+
return out;
|
|
23080
|
+
}
|
|
23081
|
+
|
|
23082
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/ExportResult.js
|
|
23083
|
+
var ExportResultCode2;
|
|
23084
|
+
(function(ExportResultCode4) {
|
|
23085
|
+
ExportResultCode4[ExportResultCode4["SUCCESS"] = 0] = "SUCCESS";
|
|
23086
|
+
ExportResultCode4[ExportResultCode4["FAILED"] = 1] = "FAILED";
|
|
23087
|
+
})(ExportResultCode2 || (ExportResultCode2 = {}));
|
|
23088
|
+
|
|
23089
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/utils/timeout.js
|
|
23090
|
+
var TimeoutError2 = class _TimeoutError extends Error {
|
|
23091
|
+
constructor(message) {
|
|
23092
|
+
super(message);
|
|
23093
|
+
Object.setPrototypeOf(this, _TimeoutError.prototype);
|
|
23094
|
+
}
|
|
23095
|
+
};
|
|
23096
|
+
function callWithTimeout2(promise, timeout) {
|
|
23097
|
+
let timeoutHandle;
|
|
23098
|
+
const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) {
|
|
23099
|
+
timeoutHandle = setTimeout(function timeoutHandler() {
|
|
23100
|
+
reject(new TimeoutError2("Operation timed out."));
|
|
23101
|
+
}, timeout);
|
|
23102
|
+
});
|
|
23103
|
+
return Promise.race([promise, timeoutPromise]).then((result2) => {
|
|
23104
|
+
clearTimeout(timeoutHandle);
|
|
23105
|
+
return result2;
|
|
23106
|
+
}, (reason) => {
|
|
23107
|
+
clearTimeout(timeoutHandle);
|
|
23108
|
+
throw reason;
|
|
23109
|
+
});
|
|
23110
|
+
}
|
|
23111
|
+
|
|
23112
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/utils/promise.js
|
|
23113
|
+
var Deferred2 = class {
|
|
23114
|
+
_promise;
|
|
23115
|
+
_resolve;
|
|
23116
|
+
_reject;
|
|
23117
|
+
constructor() {
|
|
23118
|
+
this._promise = new Promise((resolve2, reject) => {
|
|
23119
|
+
this._resolve = resolve2;
|
|
23120
|
+
this._reject = reject;
|
|
23121
|
+
});
|
|
23122
|
+
}
|
|
23123
|
+
get promise() {
|
|
23124
|
+
return this._promise;
|
|
23125
|
+
}
|
|
23126
|
+
resolve(val) {
|
|
23127
|
+
this._resolve(val);
|
|
23128
|
+
}
|
|
23129
|
+
reject(err) {
|
|
23130
|
+
this._reject(err);
|
|
23131
|
+
}
|
|
23132
|
+
};
|
|
23133
|
+
|
|
23134
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/utils/callback.js
|
|
23135
|
+
var BindOnceFuture2 = class {
|
|
23136
|
+
_isCalled = false;
|
|
23137
|
+
_deferred = new Deferred2();
|
|
23138
|
+
_callback;
|
|
23139
|
+
_that;
|
|
23140
|
+
constructor(callback, that) {
|
|
23141
|
+
this._callback = callback;
|
|
23142
|
+
this._that = that;
|
|
23143
|
+
}
|
|
23144
|
+
get isCalled() {
|
|
23145
|
+
return this._isCalled;
|
|
23146
|
+
}
|
|
23147
|
+
get promise() {
|
|
23148
|
+
return this._deferred.promise;
|
|
23149
|
+
}
|
|
23150
|
+
call(...args) {
|
|
23151
|
+
if (!this._isCalled) {
|
|
23152
|
+
this._isCalled = true;
|
|
23153
|
+
try {
|
|
23154
|
+
Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err));
|
|
23155
|
+
} catch (err) {
|
|
23156
|
+
this._deferred.reject(err);
|
|
23157
|
+
}
|
|
23158
|
+
}
|
|
23159
|
+
return this._deferred.promise;
|
|
23160
|
+
}
|
|
23161
|
+
};
|
|
23162
|
+
|
|
23163
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/internal/exporter.js
|
|
23164
|
+
function _export2(exporter, arg) {
|
|
23165
|
+
return new Promise((resolve2) => {
|
|
23166
|
+
context.with(suppressTracing2(context.active()), () => {
|
|
23167
|
+
exporter.export(arg, resolve2);
|
|
23168
|
+
});
|
|
23169
|
+
});
|
|
23170
|
+
}
|
|
23171
|
+
|
|
23172
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/core/build/esm/index.js
|
|
23173
|
+
var internal2 = {
|
|
23174
|
+
_export: _export2
|
|
23175
|
+
};
|
|
23176
|
+
|
|
23177
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources/build/esm/default-service-name.js
|
|
23178
|
+
var serviceName;
|
|
23179
|
+
function defaultServiceName2() {
|
|
23180
|
+
if (serviceName === void 0) {
|
|
23181
|
+
try {
|
|
23182
|
+
const argv0 = globalThis.process.argv0;
|
|
23183
|
+
serviceName = argv0 ? `unknown_service:${argv0}` : "unknown_service";
|
|
23184
|
+
} catch {
|
|
23185
|
+
serviceName = "unknown_service";
|
|
23186
|
+
}
|
|
23187
|
+
}
|
|
23188
|
+
return serviceName;
|
|
23189
|
+
}
|
|
23190
|
+
|
|
23191
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources/build/esm/utils.js
|
|
23192
|
+
var isPromiseLike = (val) => {
|
|
23193
|
+
return val !== null && typeof val === "object" && typeof val.then === "function";
|
|
23194
|
+
};
|
|
23195
|
+
|
|
23196
|
+
// node_modules/@opentelemetry/sdk-logs/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js
|
|
23197
|
+
var ResourceImpl = class _ResourceImpl {
|
|
23198
|
+
_rawAttributes;
|
|
23199
|
+
_asyncAttributesPending = false;
|
|
23200
|
+
_schemaUrl;
|
|
23201
|
+
_memoizedAttributes;
|
|
23202
|
+
static FromAttributeList(attributes, options) {
|
|
23203
|
+
const res = new _ResourceImpl({}, options);
|
|
23204
|
+
res._rawAttributes = guardedRawAttributes(attributes);
|
|
23205
|
+
res._asyncAttributesPending = attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;
|
|
23206
|
+
return res;
|
|
23207
|
+
}
|
|
23208
|
+
constructor(resource, options) {
|
|
23209
|
+
const attributes = resource.attributes ?? {};
|
|
23210
|
+
this._rawAttributes = Object.entries(attributes).map(([k, v]) => {
|
|
23211
|
+
if (isPromiseLike(v)) {
|
|
23212
|
+
this._asyncAttributesPending = true;
|
|
23213
|
+
}
|
|
23214
|
+
return [k, v];
|
|
23215
|
+
});
|
|
23216
|
+
this._rawAttributes = guardedRawAttributes(this._rawAttributes);
|
|
23217
|
+
this._schemaUrl = validateSchemaUrl(options?.schemaUrl);
|
|
23218
|
+
}
|
|
23219
|
+
get asyncAttributesPending() {
|
|
23220
|
+
return this._asyncAttributesPending;
|
|
23221
|
+
}
|
|
23222
|
+
async waitForAsyncAttributes() {
|
|
23223
|
+
if (!this.asyncAttributesPending) {
|
|
23224
|
+
return;
|
|
23225
|
+
}
|
|
23226
|
+
for (let i = 0; i < this._rawAttributes.length; i++) {
|
|
23227
|
+
const [k, v] = this._rawAttributes[i];
|
|
23228
|
+
this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];
|
|
23229
|
+
}
|
|
23230
|
+
this._asyncAttributesPending = false;
|
|
23231
|
+
}
|
|
23232
|
+
get attributes() {
|
|
23233
|
+
if (this.asyncAttributesPending) {
|
|
23234
|
+
diag2.error("Accessing resource attributes before async attributes settled");
|
|
23235
|
+
}
|
|
23236
|
+
if (this._memoizedAttributes) {
|
|
23237
|
+
return this._memoizedAttributes;
|
|
23238
|
+
}
|
|
23239
|
+
const attrs = {};
|
|
23240
|
+
for (const [k, v] of this._rawAttributes) {
|
|
23241
|
+
if (isPromiseLike(v)) {
|
|
23242
|
+
diag2.debug(`Unsettled resource attribute ${k} skipped`);
|
|
23243
|
+
continue;
|
|
23244
|
+
}
|
|
23245
|
+
if (v != null) {
|
|
23246
|
+
attrs[k] ??= v;
|
|
23247
|
+
}
|
|
23248
|
+
}
|
|
23249
|
+
if (!this._asyncAttributesPending) {
|
|
23250
|
+
this._memoizedAttributes = attrs;
|
|
23251
|
+
}
|
|
23252
|
+
return attrs;
|
|
23253
|
+
}
|
|
23254
|
+
getRawAttributes() {
|
|
23255
|
+
return this._rawAttributes;
|
|
23256
|
+
}
|
|
23257
|
+
get schemaUrl() {
|
|
23258
|
+
return this._schemaUrl;
|
|
23259
|
+
}
|
|
23260
|
+
merge(resource) {
|
|
23261
|
+
if (resource == null)
|
|
23262
|
+
return this;
|
|
23263
|
+
const mergedSchemaUrl = mergeSchemaUrl(this, resource);
|
|
23264
|
+
const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : void 0;
|
|
23265
|
+
return _ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions);
|
|
23266
|
+
}
|
|
23267
|
+
};
|
|
23268
|
+
function resourceFromAttributes(attributes, options) {
|
|
23269
|
+
return ResourceImpl.FromAttributeList(Object.entries(attributes), options);
|
|
23270
|
+
}
|
|
23271
|
+
function defaultResource() {
|
|
23272
|
+
return resourceFromAttributes({
|
|
23273
|
+
[ATTR_SERVICE_NAME]: defaultServiceName2(),
|
|
23274
|
+
[ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO2[ATTR_TELEMETRY_SDK_LANGUAGE],
|
|
23275
|
+
[ATTR_TELEMETRY_SDK_NAME]: SDK_INFO2[ATTR_TELEMETRY_SDK_NAME],
|
|
23276
|
+
[ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO2[ATTR_TELEMETRY_SDK_VERSION]
|
|
23277
|
+
});
|
|
23278
|
+
}
|
|
23279
|
+
function guardedRawAttributes(attributes) {
|
|
23280
|
+
return attributes.map(([k, v]) => {
|
|
23281
|
+
if (isPromiseLike(v)) {
|
|
23282
|
+
return [
|
|
23283
|
+
k,
|
|
23284
|
+
v.catch((err) => {
|
|
23285
|
+
diag2.debug("promise rejection for resource attribute: %s - %s", k, err);
|
|
23286
|
+
return void 0;
|
|
23287
|
+
})
|
|
23288
|
+
];
|
|
23289
|
+
}
|
|
23290
|
+
return [k, v];
|
|
23291
|
+
});
|
|
23292
|
+
}
|
|
23293
|
+
function validateSchemaUrl(schemaUrl) {
|
|
23294
|
+
if (typeof schemaUrl === "string" || schemaUrl === void 0) {
|
|
23295
|
+
return schemaUrl;
|
|
23296
|
+
}
|
|
23297
|
+
diag2.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl);
|
|
23298
|
+
return void 0;
|
|
23299
|
+
}
|
|
23300
|
+
function mergeSchemaUrl(old, updating) {
|
|
23301
|
+
const oldSchemaUrl = old?.schemaUrl;
|
|
23302
|
+
const updatingSchemaUrl = updating?.schemaUrl;
|
|
23303
|
+
const isOldEmpty = oldSchemaUrl === void 0 || oldSchemaUrl === "";
|
|
23304
|
+
const isUpdatingEmpty = updatingSchemaUrl === void 0 || updatingSchemaUrl === "";
|
|
23305
|
+
if (isOldEmpty) {
|
|
23306
|
+
return updatingSchemaUrl;
|
|
23307
|
+
}
|
|
23308
|
+
if (isUpdatingEmpty) {
|
|
23309
|
+
return oldSchemaUrl;
|
|
23310
|
+
}
|
|
23311
|
+
if (oldSchemaUrl === updatingSchemaUrl) {
|
|
23312
|
+
return oldSchemaUrl;
|
|
23313
|
+
}
|
|
23314
|
+
diag2.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.', oldSchemaUrl, updatingSchemaUrl);
|
|
23315
|
+
return void 0;
|
|
23316
|
+
}
|
|
23317
|
+
|
|
23318
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/utils/validation.js
|
|
23319
|
+
function isLogAttributeValue(val) {
|
|
23320
|
+
return isLogAttributeValueInternal(val, /* @__PURE__ */ new WeakSet());
|
|
23321
|
+
}
|
|
23322
|
+
function isLogAttributeValueInternal(val, visited) {
|
|
23323
|
+
if (val == null) {
|
|
23324
|
+
return true;
|
|
23325
|
+
}
|
|
23326
|
+
if (typeof val === "string" || typeof val === "number" || typeof val === "boolean") {
|
|
23327
|
+
return true;
|
|
23328
|
+
}
|
|
23329
|
+
if (val instanceof Uint8Array) {
|
|
23330
|
+
return true;
|
|
23331
|
+
}
|
|
23332
|
+
if (typeof val === "object") {
|
|
23333
|
+
if (visited.has(val)) {
|
|
23334
|
+
return false;
|
|
23335
|
+
}
|
|
23336
|
+
visited.add(val);
|
|
23337
|
+
if (Array.isArray(val)) {
|
|
23338
|
+
return val.every((item) => isLogAttributeValueInternal(item, visited));
|
|
23339
|
+
}
|
|
23340
|
+
const obj = val;
|
|
23341
|
+
if (obj.constructor !== Object && obj.constructor !== void 0) {
|
|
23342
|
+
return false;
|
|
23343
|
+
}
|
|
23344
|
+
return Object.values(obj).every((item) => isLogAttributeValueInternal(item, visited));
|
|
23345
|
+
}
|
|
23346
|
+
return false;
|
|
23347
|
+
}
|
|
23348
|
+
|
|
23349
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/LogRecordImpl.js
|
|
23350
|
+
var LogRecordImpl = class {
|
|
23351
|
+
hrTime;
|
|
23352
|
+
hrTimeObserved;
|
|
23353
|
+
spanContext;
|
|
23354
|
+
resource;
|
|
23355
|
+
instrumentationScope;
|
|
23356
|
+
attributes = {};
|
|
23357
|
+
_severityText;
|
|
23358
|
+
_severityNumber;
|
|
23359
|
+
_body;
|
|
23360
|
+
_eventName;
|
|
23361
|
+
_attributesCount = 0;
|
|
23362
|
+
_droppedAttributesCount = 0;
|
|
23363
|
+
_isReadonly = false;
|
|
23364
|
+
_logRecordLimits;
|
|
23365
|
+
set severityText(severityText) {
|
|
23366
|
+
if (this._isLogRecordReadonly()) {
|
|
23367
|
+
return;
|
|
23368
|
+
}
|
|
23369
|
+
this._severityText = severityText;
|
|
23370
|
+
}
|
|
23371
|
+
get severityText() {
|
|
23372
|
+
return this._severityText;
|
|
23373
|
+
}
|
|
23374
|
+
set severityNumber(severityNumber) {
|
|
23375
|
+
if (this._isLogRecordReadonly()) {
|
|
23376
|
+
return;
|
|
23377
|
+
}
|
|
23378
|
+
this._severityNumber = severityNumber;
|
|
23379
|
+
}
|
|
23380
|
+
get severityNumber() {
|
|
23381
|
+
return this._severityNumber;
|
|
23382
|
+
}
|
|
23383
|
+
set body(body) {
|
|
23384
|
+
if (this._isLogRecordReadonly()) {
|
|
23385
|
+
return;
|
|
23386
|
+
}
|
|
23387
|
+
this._body = body;
|
|
23388
|
+
}
|
|
23389
|
+
get body() {
|
|
23390
|
+
return this._body;
|
|
23391
|
+
}
|
|
23392
|
+
get eventName() {
|
|
23393
|
+
return this._eventName;
|
|
23394
|
+
}
|
|
23395
|
+
set eventName(eventName) {
|
|
23396
|
+
if (this._isLogRecordReadonly()) {
|
|
23397
|
+
return;
|
|
23398
|
+
}
|
|
23399
|
+
this._eventName = eventName;
|
|
23400
|
+
}
|
|
23401
|
+
get droppedAttributesCount() {
|
|
23402
|
+
return this._droppedAttributesCount;
|
|
23403
|
+
}
|
|
23404
|
+
constructor(_sharedState, instrumentationScope, logRecord) {
|
|
23405
|
+
const { timestamp, observedTimestamp, eventName, severityNumber, severityText, body, attributes = {}, exception, context: context2 } = logRecord;
|
|
23406
|
+
const now = Date.now();
|
|
23407
|
+
this.hrTime = timeInputToHrTime2(timestamp ?? now);
|
|
23408
|
+
this.hrTimeObserved = timeInputToHrTime2(observedTimestamp ?? now);
|
|
23409
|
+
if (context2) {
|
|
23410
|
+
const spanContext = trace.getSpanContext(context2);
|
|
23411
|
+
if (spanContext && isSpanContextValid(spanContext)) {
|
|
23412
|
+
this.spanContext = spanContext;
|
|
23413
|
+
}
|
|
23414
|
+
}
|
|
23415
|
+
this.severityNumber = severityNumber;
|
|
23416
|
+
this.severityText = severityText;
|
|
23417
|
+
this.body = body;
|
|
23418
|
+
this.resource = _sharedState.resource;
|
|
23419
|
+
this.instrumentationScope = instrumentationScope;
|
|
23420
|
+
this._logRecordLimits = _sharedState.logRecordLimits;
|
|
23421
|
+
this._eventName = eventName;
|
|
23422
|
+
this.setAttributes(attributes);
|
|
23423
|
+
if (exception != null) {
|
|
23424
|
+
this._setException(exception);
|
|
23425
|
+
}
|
|
23426
|
+
}
|
|
23427
|
+
setAttribute(key, value) {
|
|
23428
|
+
if (this._isLogRecordReadonly()) {
|
|
23429
|
+
return this;
|
|
23430
|
+
}
|
|
23431
|
+
if (key.length === 0) {
|
|
23432
|
+
diag2.warn(`Invalid attribute key: ${key}`);
|
|
23433
|
+
return this;
|
|
23434
|
+
}
|
|
23435
|
+
if (!isLogAttributeValue(value)) {
|
|
23436
|
+
diag2.warn(`Invalid attribute value set for key: ${key}`);
|
|
23437
|
+
return this;
|
|
23438
|
+
}
|
|
23439
|
+
const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key);
|
|
23440
|
+
if (isNewKey && this._attributesCount >= this._logRecordLimits.attributeCountLimit) {
|
|
23441
|
+
this._droppedAttributesCount++;
|
|
23442
|
+
if (this._droppedAttributesCount === 1) {
|
|
23443
|
+
diag2.warn("Dropping extra attributes.");
|
|
23444
|
+
}
|
|
23445
|
+
return this;
|
|
23446
|
+
}
|
|
23447
|
+
this.attributes[key] = this._truncateToSize(value);
|
|
23448
|
+
if (isNewKey) {
|
|
23449
|
+
this._attributesCount++;
|
|
23450
|
+
}
|
|
23451
|
+
return this;
|
|
23452
|
+
}
|
|
23453
|
+
setAttributes(attributes) {
|
|
23454
|
+
for (const [k, v] of Object.entries(attributes)) {
|
|
23455
|
+
this.setAttribute(k, v);
|
|
23456
|
+
}
|
|
23457
|
+
return this;
|
|
23458
|
+
}
|
|
23459
|
+
setBody(body) {
|
|
23460
|
+
this.body = body;
|
|
23461
|
+
return this;
|
|
23462
|
+
}
|
|
23463
|
+
setEventName(eventName) {
|
|
23464
|
+
this.eventName = eventName;
|
|
23465
|
+
return this;
|
|
23466
|
+
}
|
|
23467
|
+
setSeverityNumber(severityNumber) {
|
|
23468
|
+
this.severityNumber = severityNumber;
|
|
23469
|
+
return this;
|
|
23470
|
+
}
|
|
23471
|
+
setSeverityText(severityText) {
|
|
23472
|
+
this.severityText = severityText;
|
|
23473
|
+
return this;
|
|
23474
|
+
}
|
|
23475
|
+
/**
|
|
23476
|
+
* @internal
|
|
23477
|
+
* A LogRecordProcessor may freely modify logRecord for the duration of the OnEmit call.
|
|
23478
|
+
* If logRecord is needed after OnEmit returns (i.e. for asynchronous processing) only reads are permitted.
|
|
23479
|
+
*/
|
|
23480
|
+
_makeReadonly() {
|
|
23481
|
+
this._isReadonly = true;
|
|
23482
|
+
}
|
|
23483
|
+
_truncateToSize(value) {
|
|
23484
|
+
const limit = this._logRecordLimits.attributeValueLengthLimit;
|
|
23485
|
+
if (limit <= 0) {
|
|
23486
|
+
diag2.warn(`Attribute value limit must be positive, got ${limit}`);
|
|
23487
|
+
return value;
|
|
23488
|
+
}
|
|
23489
|
+
if (value == null) {
|
|
23490
|
+
return value;
|
|
23491
|
+
}
|
|
23492
|
+
if (typeof value === "string") {
|
|
23493
|
+
return this._truncateToLimitUtil(value, limit);
|
|
23494
|
+
}
|
|
23495
|
+
if (value instanceof Uint8Array) {
|
|
23496
|
+
return value;
|
|
23497
|
+
}
|
|
23498
|
+
if (Array.isArray(value)) {
|
|
23499
|
+
return value.map((val) => this._truncateToSize(val));
|
|
23500
|
+
}
|
|
23501
|
+
if (typeof value === "object") {
|
|
23502
|
+
const truncatedObj = {};
|
|
23503
|
+
for (const [k, v] of Object.entries(value)) {
|
|
23504
|
+
truncatedObj[k] = this._truncateToSize(v);
|
|
23505
|
+
}
|
|
23506
|
+
return truncatedObj;
|
|
23507
|
+
}
|
|
23508
|
+
return value;
|
|
23509
|
+
}
|
|
23510
|
+
_setException(exception) {
|
|
23511
|
+
let hasMinimumAttributes = false;
|
|
23512
|
+
if (typeof exception === "string" || typeof exception === "number") {
|
|
23513
|
+
if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_MESSAGE)) {
|
|
23514
|
+
this.setAttribute(ATTR_EXCEPTION_MESSAGE, String(exception));
|
|
23515
|
+
}
|
|
23516
|
+
hasMinimumAttributes = true;
|
|
23517
|
+
} else if (exception && typeof exception === "object") {
|
|
23518
|
+
const exceptionObj = exception;
|
|
23519
|
+
if (exceptionObj.code) {
|
|
23520
|
+
if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_TYPE)) {
|
|
23521
|
+
this.setAttribute(ATTR_EXCEPTION_TYPE, exceptionObj.code.toString());
|
|
23522
|
+
}
|
|
23523
|
+
hasMinimumAttributes = true;
|
|
23524
|
+
} else if (exceptionObj.name) {
|
|
23525
|
+
if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_TYPE)) {
|
|
23526
|
+
this.setAttribute(ATTR_EXCEPTION_TYPE, exceptionObj.name);
|
|
23527
|
+
}
|
|
23528
|
+
hasMinimumAttributes = true;
|
|
23529
|
+
}
|
|
23530
|
+
if (exceptionObj.message) {
|
|
23531
|
+
if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_MESSAGE)) {
|
|
23532
|
+
this.setAttribute(ATTR_EXCEPTION_MESSAGE, exceptionObj.message);
|
|
23533
|
+
}
|
|
23534
|
+
hasMinimumAttributes = true;
|
|
23535
|
+
}
|
|
23536
|
+
if (exceptionObj.stack) {
|
|
23537
|
+
if (!Object.hasOwn(this.attributes, ATTR_EXCEPTION_STACKTRACE)) {
|
|
23538
|
+
this.setAttribute(ATTR_EXCEPTION_STACKTRACE, exceptionObj.stack);
|
|
23539
|
+
}
|
|
23540
|
+
hasMinimumAttributes = true;
|
|
23541
|
+
}
|
|
23542
|
+
}
|
|
23543
|
+
if (!hasMinimumAttributes) {
|
|
23544
|
+
diag2.warn(`Failed to record an exception ${exception}`);
|
|
23545
|
+
}
|
|
23546
|
+
}
|
|
23547
|
+
_truncateToLimitUtil(value, limit) {
|
|
23548
|
+
if (value.length <= limit) {
|
|
23549
|
+
return value;
|
|
23550
|
+
}
|
|
23551
|
+
return value.substring(0, limit);
|
|
23552
|
+
}
|
|
23553
|
+
_isLogRecordReadonly() {
|
|
23554
|
+
if (this._isReadonly) {
|
|
23555
|
+
diag2.warn("Can not execute the operation on emitted log record");
|
|
23556
|
+
}
|
|
23557
|
+
return this._isReadonly;
|
|
23558
|
+
}
|
|
23559
|
+
};
|
|
23560
|
+
|
|
23561
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/Logger.js
|
|
23562
|
+
var Logger = class {
|
|
23563
|
+
instrumentationScope;
|
|
23564
|
+
_sharedState;
|
|
23565
|
+
_loggerConfig;
|
|
23566
|
+
constructor(instrumentationScope, sharedState) {
|
|
23567
|
+
this.instrumentationScope = instrumentationScope;
|
|
23568
|
+
this._sharedState = sharedState;
|
|
23569
|
+
this._loggerConfig = this._sharedState.getLoggerConfig(this.instrumentationScope);
|
|
23570
|
+
}
|
|
23571
|
+
emit(logRecord) {
|
|
23572
|
+
const loggerConfig = this._loggerConfig;
|
|
23573
|
+
const currentContext = logRecord.context || context.active();
|
|
23574
|
+
const recordSeverity = logRecord.severityNumber ?? SeverityNumber2.UNSPECIFIED;
|
|
23575
|
+
if (recordSeverity !== SeverityNumber2.UNSPECIFIED && recordSeverity < loggerConfig.minimumSeverity) {
|
|
23576
|
+
return;
|
|
23577
|
+
}
|
|
23578
|
+
if (loggerConfig.traceBased) {
|
|
23579
|
+
const spanContext = trace.getSpanContext(currentContext);
|
|
23580
|
+
if (spanContext && isSpanContextValid(spanContext)) {
|
|
23581
|
+
const isSampled = (spanContext.traceFlags & TraceFlags.SAMPLED) === TraceFlags.SAMPLED;
|
|
23582
|
+
if (!isSampled) {
|
|
23583
|
+
return;
|
|
23584
|
+
}
|
|
23585
|
+
}
|
|
23586
|
+
}
|
|
23587
|
+
const logRecordInstance = new LogRecordImpl(this._sharedState, this.instrumentationScope, {
|
|
23588
|
+
context: currentContext,
|
|
23589
|
+
...logRecord
|
|
23590
|
+
});
|
|
23591
|
+
this._sharedState.activeProcessor.onEmit(logRecordInstance, currentContext);
|
|
23592
|
+
logRecordInstance._makeReadonly();
|
|
23593
|
+
}
|
|
23594
|
+
};
|
|
23595
|
+
|
|
23596
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/export/NoopLogRecordProcessor.js
|
|
23597
|
+
var NoopLogRecordProcessor = class {
|
|
23598
|
+
forceFlush() {
|
|
23599
|
+
return Promise.resolve();
|
|
23600
|
+
}
|
|
23601
|
+
onEmit(_logRecord, _context) {
|
|
23602
|
+
}
|
|
23603
|
+
shutdown() {
|
|
23604
|
+
return Promise.resolve();
|
|
23605
|
+
}
|
|
23606
|
+
};
|
|
23607
|
+
|
|
23608
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/MultiLogRecordProcessor.js
|
|
23609
|
+
var MultiLogRecordProcessor = class {
|
|
23610
|
+
processors;
|
|
23611
|
+
forceFlushTimeoutMillis;
|
|
23612
|
+
constructor(processors, forceFlushTimeoutMillis) {
|
|
23613
|
+
this.processors = processors;
|
|
23614
|
+
this.forceFlushTimeoutMillis = forceFlushTimeoutMillis;
|
|
23615
|
+
}
|
|
23616
|
+
async forceFlush() {
|
|
23617
|
+
const timeout = this.forceFlushTimeoutMillis;
|
|
23618
|
+
await Promise.all(this.processors.map((processor2) => callWithTimeout2(processor2.forceFlush(), timeout)));
|
|
23619
|
+
}
|
|
23620
|
+
onEmit(logRecord, context2) {
|
|
23621
|
+
this.processors.forEach((processors) => processors.onEmit(logRecord, context2));
|
|
23622
|
+
}
|
|
23623
|
+
async shutdown() {
|
|
23624
|
+
await Promise.all(this.processors.map((processor2) => processor2.shutdown()));
|
|
23625
|
+
}
|
|
23626
|
+
};
|
|
23627
|
+
|
|
23628
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/internal/utils.js
|
|
23629
|
+
function getInstrumentationScopeKey(scope) {
|
|
23630
|
+
return `${scope.name}@${scope.version || ""}:${scope.schemaUrl || ""}`;
|
|
23631
|
+
}
|
|
23632
|
+
|
|
23633
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/internal/LoggerProviderSharedState.js
|
|
23634
|
+
var DEFAULT_LOGGER_CONFIG = {
|
|
23635
|
+
disabled: false,
|
|
23636
|
+
minimumSeverity: SeverityNumber2.UNSPECIFIED,
|
|
23637
|
+
traceBased: false
|
|
23638
|
+
};
|
|
23639
|
+
var DEFAULT_LOGGER_CONFIGURATOR = () => ({
|
|
23640
|
+
...DEFAULT_LOGGER_CONFIG
|
|
23641
|
+
});
|
|
23642
|
+
var LoggerProviderSharedState = class {
|
|
23643
|
+
loggers = /* @__PURE__ */ new Map();
|
|
23644
|
+
activeProcessor;
|
|
23645
|
+
registeredLogRecordProcessors = [];
|
|
23646
|
+
resource;
|
|
23647
|
+
forceFlushTimeoutMillis;
|
|
23648
|
+
logRecordLimits;
|
|
23649
|
+
processors;
|
|
23650
|
+
_loggerConfigurator;
|
|
23651
|
+
_loggerConfigs = /* @__PURE__ */ new Map();
|
|
23652
|
+
constructor(resource, forceFlushTimeoutMillis, logRecordLimits, processors, loggerConfigurator) {
|
|
23653
|
+
this.resource = resource;
|
|
23654
|
+
this.forceFlushTimeoutMillis = forceFlushTimeoutMillis;
|
|
23655
|
+
this.logRecordLimits = logRecordLimits;
|
|
23656
|
+
this.processors = processors;
|
|
23657
|
+
if (processors.length > 0) {
|
|
23658
|
+
this.registeredLogRecordProcessors = processors;
|
|
23659
|
+
this.activeProcessor = new MultiLogRecordProcessor(this.registeredLogRecordProcessors, this.forceFlushTimeoutMillis);
|
|
23660
|
+
} else {
|
|
23661
|
+
this.activeProcessor = new NoopLogRecordProcessor();
|
|
23662
|
+
}
|
|
23663
|
+
this._loggerConfigurator = loggerConfigurator ?? DEFAULT_LOGGER_CONFIGURATOR;
|
|
23664
|
+
}
|
|
23665
|
+
/**
|
|
23666
|
+
* Get the LoggerConfig for a given instrumentation scope.
|
|
23667
|
+
* Uses the LoggerConfigurator function to compute the config on first access
|
|
23668
|
+
* and caches the result.
|
|
23669
|
+
*
|
|
23670
|
+
* @experimental This feature is in development as per the OpenTelemetry specification.
|
|
23671
|
+
*/
|
|
23672
|
+
getLoggerConfig(instrumentationScope) {
|
|
23673
|
+
const key = getInstrumentationScopeKey(instrumentationScope);
|
|
23674
|
+
let config = this._loggerConfigs.get(key);
|
|
23675
|
+
if (config) {
|
|
23676
|
+
return config;
|
|
23677
|
+
}
|
|
23678
|
+
config = this._loggerConfigurator(instrumentationScope);
|
|
23679
|
+
this._loggerConfigs.set(key, config);
|
|
23680
|
+
return config;
|
|
23681
|
+
}
|
|
23682
|
+
};
|
|
23683
|
+
|
|
23684
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/LoggerProvider.js
|
|
23685
|
+
var DEFAULT_LOGGER_NAME = "unknown";
|
|
23686
|
+
var LoggerProvider = class {
|
|
23687
|
+
_shutdownOnce;
|
|
23688
|
+
_sharedState;
|
|
23689
|
+
constructor(config = {}) {
|
|
23690
|
+
const mergedConfig = {
|
|
23691
|
+
resource: config.resource ?? defaultResource(),
|
|
23692
|
+
forceFlushTimeoutMillis: config.forceFlushTimeoutMillis ?? 3e4,
|
|
23693
|
+
logRecordLimits: {
|
|
23694
|
+
attributeCountLimit: config.logRecordLimits?.attributeCountLimit ?? 128,
|
|
23695
|
+
attributeValueLengthLimit: config.logRecordLimits?.attributeValueLengthLimit ?? Infinity
|
|
23696
|
+
},
|
|
23697
|
+
loggerConfigurator: config.loggerConfigurator ?? DEFAULT_LOGGER_CONFIGURATOR,
|
|
23698
|
+
processors: config.processors ?? []
|
|
23699
|
+
};
|
|
23700
|
+
this._sharedState = new LoggerProviderSharedState(mergedConfig.resource, mergedConfig.forceFlushTimeoutMillis, mergedConfig.logRecordLimits, mergedConfig.processors, mergedConfig.loggerConfigurator);
|
|
23701
|
+
this._shutdownOnce = new BindOnceFuture2(this._shutdown, this);
|
|
23702
|
+
}
|
|
23703
|
+
/**
|
|
23704
|
+
* Get a logger with the configuration of the LoggerProvider.
|
|
23705
|
+
*/
|
|
23706
|
+
getLogger(name, version, options) {
|
|
23707
|
+
if (this._shutdownOnce.isCalled) {
|
|
23708
|
+
diag2.warn("A shutdown LoggerProvider cannot provide a Logger");
|
|
23709
|
+
return NOOP_LOGGER2;
|
|
23710
|
+
}
|
|
23711
|
+
if (!name) {
|
|
23712
|
+
diag2.warn("Logger requested without instrumentation scope name.");
|
|
23713
|
+
}
|
|
23714
|
+
const loggerName = name || DEFAULT_LOGGER_NAME;
|
|
23715
|
+
const key = `${loggerName}@${version || ""}:${options?.schemaUrl || ""}`;
|
|
23716
|
+
if (!this._sharedState.loggers.has(key)) {
|
|
23717
|
+
this._sharedState.loggers.set(key, new Logger({ name: loggerName, version, schemaUrl: options?.schemaUrl }, this._sharedState));
|
|
23718
|
+
}
|
|
23719
|
+
return this._sharedState.loggers.get(key);
|
|
23720
|
+
}
|
|
23721
|
+
/**
|
|
23722
|
+
* Notifies all registered LogRecordProcessor to flush any buffered data.
|
|
23723
|
+
*
|
|
23724
|
+
* Returns a promise which is resolved when all flushes are complete.
|
|
23725
|
+
*/
|
|
23726
|
+
forceFlush() {
|
|
23727
|
+
if (this._shutdownOnce.isCalled) {
|
|
23728
|
+
diag2.warn("invalid attempt to force flush after LoggerProvider shutdown");
|
|
23729
|
+
return this._shutdownOnce.promise;
|
|
23730
|
+
}
|
|
23731
|
+
return this._sharedState.activeProcessor.forceFlush();
|
|
23732
|
+
}
|
|
23733
|
+
/**
|
|
23734
|
+
* Flush all buffered data and shut down the LoggerProvider and all registered
|
|
23735
|
+
* LogRecordProcessor.
|
|
23736
|
+
*
|
|
23737
|
+
* Returns a promise which is resolved when all flushes are complete.
|
|
23738
|
+
*/
|
|
23739
|
+
shutdown() {
|
|
23740
|
+
if (this._shutdownOnce.isCalled) {
|
|
23741
|
+
diag2.warn("shutdown may only be called once per LoggerProvider");
|
|
23742
|
+
return this._shutdownOnce.promise;
|
|
23743
|
+
}
|
|
23744
|
+
return this._shutdownOnce.call();
|
|
23745
|
+
}
|
|
23746
|
+
_shutdown() {
|
|
23747
|
+
return this._sharedState.activeProcessor.shutdown();
|
|
23748
|
+
}
|
|
23749
|
+
};
|
|
23750
|
+
|
|
23751
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/export/BatchLogRecordProcessorBase.js
|
|
23752
|
+
var BatchLogRecordProcessorBase = class {
|
|
23753
|
+
_maxExportBatchSize;
|
|
23754
|
+
_maxQueueSize;
|
|
23755
|
+
_scheduledDelayMillis;
|
|
23756
|
+
_exportTimeoutMillis;
|
|
23757
|
+
_exporter;
|
|
23758
|
+
_isExporting = false;
|
|
23759
|
+
_finishedLogRecords = [];
|
|
23760
|
+
_timer;
|
|
23761
|
+
_shutdownOnce;
|
|
23762
|
+
constructor(exporter, config) {
|
|
23763
|
+
this._exporter = exporter;
|
|
23764
|
+
this._maxExportBatchSize = config?.maxExportBatchSize ?? 512;
|
|
23765
|
+
this._maxQueueSize = config?.maxQueueSize ?? 2048;
|
|
23766
|
+
this._scheduledDelayMillis = config?.scheduledDelayMillis ?? 5e3;
|
|
23767
|
+
this._exportTimeoutMillis = config?.exportTimeoutMillis ?? 3e4;
|
|
23768
|
+
this._shutdownOnce = new BindOnceFuture2(this._shutdown, this);
|
|
23769
|
+
if (this._maxExportBatchSize > this._maxQueueSize) {
|
|
23770
|
+
diag2.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize");
|
|
23771
|
+
this._maxExportBatchSize = this._maxQueueSize;
|
|
23772
|
+
}
|
|
23773
|
+
}
|
|
23774
|
+
onEmit(logRecord) {
|
|
23775
|
+
if (this._shutdownOnce.isCalled) {
|
|
23776
|
+
return;
|
|
23777
|
+
}
|
|
23778
|
+
this._addToBuffer(logRecord);
|
|
23779
|
+
}
|
|
23780
|
+
forceFlush() {
|
|
23781
|
+
if (this._shutdownOnce.isCalled) {
|
|
23782
|
+
return this._shutdownOnce.promise;
|
|
23783
|
+
}
|
|
23784
|
+
return this._flushAll();
|
|
23785
|
+
}
|
|
23786
|
+
shutdown() {
|
|
23787
|
+
return this._shutdownOnce.call();
|
|
23788
|
+
}
|
|
23789
|
+
async _shutdown() {
|
|
23790
|
+
this.onShutdown();
|
|
23791
|
+
await this._flushAll();
|
|
23792
|
+
await this._exporter.shutdown();
|
|
23793
|
+
}
|
|
23794
|
+
/** Add a LogRecord in the buffer. */
|
|
23795
|
+
_addToBuffer(logRecord) {
|
|
23796
|
+
if (this._finishedLogRecords.length >= this._maxQueueSize) {
|
|
23797
|
+
return;
|
|
23798
|
+
}
|
|
23799
|
+
this._finishedLogRecords.push(logRecord);
|
|
23800
|
+
this._maybeStartTimer();
|
|
23801
|
+
}
|
|
23802
|
+
/**
|
|
23803
|
+
* Send all LogRecords to the exporter respecting the batch size limit
|
|
23804
|
+
* This function is used only on forceFlush or shutdown,
|
|
23805
|
+
* for all other cases _flush should be used
|
|
23806
|
+
* */
|
|
23807
|
+
_flushAll() {
|
|
23808
|
+
return new Promise((resolve2, reject) => {
|
|
23809
|
+
const promises = [];
|
|
23810
|
+
const batchCount = Math.ceil(this._finishedLogRecords.length / this._maxExportBatchSize);
|
|
23811
|
+
for (let i = 0; i < batchCount; i++) {
|
|
23812
|
+
promises.push(this._flushOneBatch());
|
|
23813
|
+
}
|
|
23814
|
+
Promise.all(promises).then(() => {
|
|
23815
|
+
resolve2();
|
|
23816
|
+
}).catch(reject);
|
|
23817
|
+
});
|
|
23818
|
+
}
|
|
23819
|
+
_flushOneBatch() {
|
|
23820
|
+
this._clearTimer();
|
|
23821
|
+
if (this._finishedLogRecords.length === 0) {
|
|
23822
|
+
return Promise.resolve();
|
|
23823
|
+
}
|
|
23824
|
+
return callWithTimeout2(this._export(this._finishedLogRecords.splice(0, this._maxExportBatchSize)), this._exportTimeoutMillis);
|
|
23825
|
+
}
|
|
23826
|
+
_maybeStartTimer() {
|
|
23827
|
+
if (this._isExporting)
|
|
23828
|
+
return;
|
|
23829
|
+
const flush = () => {
|
|
23830
|
+
this._isExporting = true;
|
|
23831
|
+
this._flushOneBatch().then(() => {
|
|
23832
|
+
this._isExporting = false;
|
|
23833
|
+
if (this._finishedLogRecords.length > 0) {
|
|
23834
|
+
this._clearTimer();
|
|
23835
|
+
this._maybeStartTimer();
|
|
23836
|
+
}
|
|
23837
|
+
}).catch((e) => {
|
|
23838
|
+
this._isExporting = false;
|
|
23839
|
+
globalErrorHandler2(e);
|
|
23840
|
+
});
|
|
23841
|
+
};
|
|
23842
|
+
if (this._finishedLogRecords.length >= this._maxExportBatchSize) {
|
|
23843
|
+
return flush();
|
|
23844
|
+
}
|
|
23845
|
+
if (this._timer !== void 0)
|
|
23846
|
+
return;
|
|
23847
|
+
this._timer = setTimeout(() => flush(), this._scheduledDelayMillis);
|
|
23848
|
+
if (typeof this._timer !== "number") {
|
|
23849
|
+
this._timer.unref();
|
|
23850
|
+
}
|
|
23851
|
+
}
|
|
23852
|
+
_clearTimer() {
|
|
23853
|
+
if (this._timer !== void 0) {
|
|
23854
|
+
clearTimeout(this._timer);
|
|
23855
|
+
this._timer = void 0;
|
|
23856
|
+
}
|
|
23857
|
+
}
|
|
23858
|
+
_export(logRecords) {
|
|
23859
|
+
const doExport = () => internal2._export(this._exporter, logRecords).then((result2) => {
|
|
23860
|
+
if (result2.code !== ExportResultCode2.SUCCESS) {
|
|
23861
|
+
globalErrorHandler2(result2.error ?? new Error(`BatchLogRecordProcessor: log record export failed (status ${result2})`));
|
|
23862
|
+
}
|
|
23863
|
+
}).catch(globalErrorHandler2);
|
|
23864
|
+
const pendingResources = [];
|
|
23865
|
+
for (let i = 0; i < logRecords.length; i++) {
|
|
23866
|
+
const resource = logRecords[i].resource;
|
|
23867
|
+
if (resource.asyncAttributesPending && typeof resource.waitForAsyncAttributes === "function") {
|
|
23868
|
+
pendingResources.push(resource.waitForAsyncAttributes());
|
|
23869
|
+
}
|
|
23870
|
+
}
|
|
23871
|
+
if (pendingResources.length === 0) {
|
|
23872
|
+
return doExport();
|
|
23873
|
+
} else {
|
|
23874
|
+
return Promise.all(pendingResources).then(doExport, globalErrorHandler2);
|
|
23875
|
+
}
|
|
23876
|
+
}
|
|
23877
|
+
};
|
|
23878
|
+
|
|
23879
|
+
// node_modules/@opentelemetry/sdk-logs/build/esm/platform/browser/export/BatchLogRecordProcessor.js
|
|
23880
|
+
var BatchLogRecordProcessor = class extends BatchLogRecordProcessorBase {
|
|
23881
|
+
_visibilityChangeListener;
|
|
23882
|
+
_pageHideListener;
|
|
23883
|
+
constructor(exporter, config) {
|
|
23884
|
+
super(exporter, config);
|
|
23885
|
+
this._onInit(config);
|
|
23886
|
+
}
|
|
23887
|
+
onShutdown() {
|
|
23888
|
+
if (typeof document === "undefined") {
|
|
23889
|
+
return;
|
|
23890
|
+
}
|
|
23891
|
+
if (this._visibilityChangeListener) {
|
|
23892
|
+
document.removeEventListener("visibilitychange", this._visibilityChangeListener);
|
|
23893
|
+
}
|
|
23894
|
+
if (this._pageHideListener) {
|
|
23895
|
+
document.removeEventListener("pagehide", this._pageHideListener);
|
|
23896
|
+
}
|
|
23897
|
+
}
|
|
23898
|
+
_onInit(config) {
|
|
23899
|
+
if (config?.disableAutoFlushOnDocumentHide === true || typeof document === "undefined") {
|
|
23900
|
+
return;
|
|
23901
|
+
}
|
|
23902
|
+
this._visibilityChangeListener = () => {
|
|
23903
|
+
if (document.visibilityState === "hidden") {
|
|
23904
|
+
void this.forceFlush();
|
|
23905
|
+
}
|
|
23906
|
+
};
|
|
23907
|
+
this._pageHideListener = () => {
|
|
23908
|
+
void this.forceFlush();
|
|
23909
|
+
};
|
|
23910
|
+
document.addEventListener("visibilitychange", this._visibilityChangeListener);
|
|
23911
|
+
document.addEventListener("pagehide", this._pageHideListener);
|
|
23912
|
+
}
|
|
23913
|
+
};
|
|
23914
|
+
|
|
23915
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js
|
|
23916
|
+
var OTLPExporterBase2 = class {
|
|
23917
|
+
_delegate;
|
|
23918
|
+
constructor(delegate) {
|
|
23919
|
+
this._delegate = delegate;
|
|
23920
|
+
}
|
|
23921
|
+
/**
|
|
23922
|
+
* Export items.
|
|
23923
|
+
* @param items
|
|
23924
|
+
* @param resultCallback
|
|
23925
|
+
*/
|
|
23926
|
+
export(items, resultCallback) {
|
|
23927
|
+
this._delegate.export(items, resultCallback);
|
|
23928
|
+
}
|
|
23929
|
+
forceFlush() {
|
|
23930
|
+
return this._delegate.forceFlush();
|
|
23931
|
+
}
|
|
23932
|
+
shutdown() {
|
|
23933
|
+
return this._delegate.shutdown();
|
|
23934
|
+
}
|
|
23935
|
+
};
|
|
23936
|
+
|
|
23937
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js
|
|
23938
|
+
var OTLPExporterError2 = class extends Error {
|
|
23939
|
+
code;
|
|
23940
|
+
name = "OTLPExporterError";
|
|
23941
|
+
data;
|
|
23942
|
+
constructor(message, code, data) {
|
|
23943
|
+
super(message);
|
|
23944
|
+
this.data = data;
|
|
23945
|
+
this.code = code;
|
|
23946
|
+
}
|
|
23947
|
+
};
|
|
23948
|
+
|
|
23949
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js
|
|
23950
|
+
function validateTimeoutMillis2(timeoutMillis) {
|
|
23951
|
+
if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {
|
|
23952
|
+
return timeoutMillis;
|
|
23953
|
+
}
|
|
23954
|
+
throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`);
|
|
23955
|
+
}
|
|
23956
|
+
function wrapStaticHeadersInFunction2(headers) {
|
|
23957
|
+
if (headers == null) {
|
|
23958
|
+
return void 0;
|
|
23959
|
+
}
|
|
23960
|
+
return async () => headers;
|
|
23961
|
+
}
|
|
23962
|
+
function mergeOtlpSharedConfigurationWithDefaults2(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
23963
|
+
return {
|
|
23964
|
+
timeoutMillis: validateTimeoutMillis2(userProvidedConfiguration.timeoutMillis ?? fallbackConfiguration.timeoutMillis ?? defaultConfiguration.timeoutMillis),
|
|
23965
|
+
concurrencyLimit: userProvidedConfiguration.concurrencyLimit ?? fallbackConfiguration.concurrencyLimit ?? defaultConfiguration.concurrencyLimit,
|
|
23966
|
+
compression: userProvidedConfiguration.compression ?? fallbackConfiguration.compression ?? defaultConfiguration.compression
|
|
23967
|
+
};
|
|
23968
|
+
}
|
|
23969
|
+
function getSharedConfigurationDefaults2() {
|
|
23970
|
+
return {
|
|
23971
|
+
timeoutMillis: 1e4,
|
|
23972
|
+
concurrencyLimit: 30,
|
|
23973
|
+
compression: "none"
|
|
23974
|
+
};
|
|
23975
|
+
}
|
|
23976
|
+
|
|
23977
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js
|
|
23978
|
+
var BoundedQueueExportPromiseHandler2 = class {
|
|
23979
|
+
_concurrencyLimit;
|
|
23980
|
+
_sendingPromises = [];
|
|
23981
|
+
/**
|
|
23982
|
+
* @param concurrencyLimit maximum promises allowed in a queue at the same time.
|
|
23983
|
+
*/
|
|
23984
|
+
constructor(concurrencyLimit) {
|
|
23985
|
+
this._concurrencyLimit = concurrencyLimit;
|
|
23986
|
+
}
|
|
23987
|
+
pushPromise(promise) {
|
|
23988
|
+
if (this.hasReachedLimit()) {
|
|
23989
|
+
throw new Error("Concurrency Limit reached");
|
|
23990
|
+
}
|
|
23991
|
+
this._sendingPromises.push(promise);
|
|
23992
|
+
const popPromise = () => {
|
|
23993
|
+
const index2 = this._sendingPromises.indexOf(promise);
|
|
23994
|
+
void this._sendingPromises.splice(index2, 1);
|
|
23995
|
+
};
|
|
23996
|
+
promise.then(popPromise, popPromise);
|
|
23997
|
+
}
|
|
23998
|
+
hasReachedLimit() {
|
|
23999
|
+
return this._sendingPromises.length >= this._concurrencyLimit;
|
|
24000
|
+
}
|
|
24001
|
+
async awaitAll() {
|
|
24002
|
+
await Promise.all(this._sendingPromises);
|
|
24003
|
+
}
|
|
24004
|
+
};
|
|
24005
|
+
function createBoundedQueueExportPromiseHandler2(options) {
|
|
24006
|
+
return new BoundedQueueExportPromiseHandler2(options.concurrencyLimit);
|
|
24007
|
+
}
|
|
24008
|
+
|
|
24009
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/core/build/esm/common/time.js
|
|
24010
|
+
var NANOSECOND_DIGITS3 = 9;
|
|
24011
|
+
var NANOSECOND_DIGITS_IN_MILLIS3 = 6;
|
|
24012
|
+
var MILLISECONDS_TO_NANOSECONDS3 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS3);
|
|
24013
|
+
var SECOND_TO_NANOSECONDS3 = Math.pow(10, NANOSECOND_DIGITS3);
|
|
24014
|
+
function hrTimeToNanoseconds3(time) {
|
|
24015
|
+
return time[0] * SECOND_TO_NANOSECONDS3 + time[1];
|
|
24016
|
+
}
|
|
24017
|
+
|
|
24018
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/core/build/esm/ExportResult.js
|
|
24019
|
+
var ExportResultCode3;
|
|
24020
|
+
(function(ExportResultCode4) {
|
|
24021
|
+
ExportResultCode4[ExportResultCode4["SUCCESS"] = 0] = "SUCCESS";
|
|
24022
|
+
ExportResultCode4[ExportResultCode4["FAILED"] = 1] = "FAILED";
|
|
24023
|
+
})(ExportResultCode3 || (ExportResultCode3 = {}));
|
|
24024
|
+
|
|
24025
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js
|
|
24026
|
+
function isPartialSuccessResponse2(response) {
|
|
24027
|
+
return Object.prototype.hasOwnProperty.call(response, "partialSuccess");
|
|
24028
|
+
}
|
|
24029
|
+
function createLoggingPartialSuccessResponseHandler2() {
|
|
24030
|
+
return {
|
|
24031
|
+
handleResponse(response) {
|
|
24032
|
+
if (response == null || !isPartialSuccessResponse2(response) || response.partialSuccess == null || Object.keys(response.partialSuccess).length === 0) {
|
|
24033
|
+
return;
|
|
24034
|
+
}
|
|
24035
|
+
diag2.warn("Received Partial Success response:", JSON.stringify(response.partialSuccess));
|
|
24036
|
+
}
|
|
24037
|
+
};
|
|
24038
|
+
}
|
|
24039
|
+
|
|
24040
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js
|
|
24041
|
+
var OTLPExportDelegate2 = class {
|
|
24042
|
+
_diagLogger;
|
|
24043
|
+
_transport;
|
|
24044
|
+
_serializer;
|
|
24045
|
+
_responseHandler;
|
|
24046
|
+
_promiseQueue;
|
|
24047
|
+
_timeout;
|
|
24048
|
+
constructor(transport, serializer, responseHandler, promiseQueue, timeout) {
|
|
24049
|
+
this._transport = transport;
|
|
24050
|
+
this._serializer = serializer;
|
|
24051
|
+
this._responseHandler = responseHandler;
|
|
24052
|
+
this._promiseQueue = promiseQueue;
|
|
24053
|
+
this._timeout = timeout;
|
|
24054
|
+
this._diagLogger = diag2.createComponentLogger({
|
|
24055
|
+
namespace: "OTLPExportDelegate"
|
|
24056
|
+
});
|
|
24057
|
+
}
|
|
24058
|
+
export(internalRepresentation, resultCallback) {
|
|
24059
|
+
this._diagLogger.debug("items to be sent", internalRepresentation);
|
|
24060
|
+
if (this._promiseQueue.hasReachedLimit()) {
|
|
24061
|
+
resultCallback({
|
|
24062
|
+
code: ExportResultCode3.FAILED,
|
|
24063
|
+
error: new Error("Concurrent export limit reached")
|
|
24064
|
+
});
|
|
24065
|
+
return;
|
|
24066
|
+
}
|
|
24067
|
+
const serializedRequest = this._serializer.serializeRequest(internalRepresentation);
|
|
24068
|
+
if (serializedRequest == null) {
|
|
24069
|
+
resultCallback({
|
|
24070
|
+
code: ExportResultCode3.FAILED,
|
|
24071
|
+
error: new Error("Nothing to send")
|
|
24072
|
+
});
|
|
24073
|
+
return;
|
|
24074
|
+
}
|
|
24075
|
+
this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => {
|
|
24076
|
+
if (response.status === "success") {
|
|
24077
|
+
if (response.data != null) {
|
|
24078
|
+
try {
|
|
24079
|
+
this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));
|
|
24080
|
+
} catch (e) {
|
|
24081
|
+
this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e, response.data);
|
|
24082
|
+
}
|
|
24083
|
+
}
|
|
24084
|
+
resultCallback({
|
|
24085
|
+
code: ExportResultCode3.SUCCESS
|
|
24086
|
+
});
|
|
24087
|
+
return;
|
|
24088
|
+
} else if (response.status === "failure" && response.error) {
|
|
24089
|
+
resultCallback({
|
|
24090
|
+
code: ExportResultCode3.FAILED,
|
|
24091
|
+
error: response.error
|
|
24092
|
+
});
|
|
24093
|
+
return;
|
|
24094
|
+
} else if (response.status === "retryable") {
|
|
24095
|
+
resultCallback({
|
|
24096
|
+
code: ExportResultCode3.FAILED,
|
|
24097
|
+
error: response.error ?? new OTLPExporterError2("Export failed with retryable status")
|
|
24098
|
+
});
|
|
24099
|
+
} else {
|
|
24100
|
+
resultCallback({
|
|
24101
|
+
code: ExportResultCode3.FAILED,
|
|
24102
|
+
error: new OTLPExporterError2("Export failed with unknown error")
|
|
24103
|
+
});
|
|
24104
|
+
}
|
|
24105
|
+
}, (reason) => resultCallback({
|
|
24106
|
+
code: ExportResultCode3.FAILED,
|
|
24107
|
+
error: reason
|
|
24108
|
+
})));
|
|
24109
|
+
}
|
|
24110
|
+
forceFlush() {
|
|
24111
|
+
return this._promiseQueue.awaitAll();
|
|
24112
|
+
}
|
|
24113
|
+
async shutdown() {
|
|
24114
|
+
this._diagLogger.debug("shutdown started");
|
|
24115
|
+
await this.forceFlush();
|
|
24116
|
+
this._transport.shutdown();
|
|
24117
|
+
}
|
|
24118
|
+
};
|
|
24119
|
+
function createOtlpExportDelegate2(components, settings) {
|
|
24120
|
+
return new OTLPExportDelegate2(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler2(), components.promiseHandler, settings.timeout);
|
|
24121
|
+
}
|
|
24122
|
+
|
|
24123
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js
|
|
24124
|
+
function createOtlpNetworkExportDelegate2(options, serializer, transport) {
|
|
24125
|
+
return createOtlpExportDelegate2({
|
|
24126
|
+
transport,
|
|
24127
|
+
serializer,
|
|
24128
|
+
promiseHandler: createBoundedQueueExportPromiseHandler2(options)
|
|
24129
|
+
}, { timeout: options.timeoutMillis });
|
|
24130
|
+
}
|
|
24131
|
+
|
|
24132
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-transformer/build/esm/common/internal.js
|
|
24133
|
+
function createResource2(resource, encoder) {
|
|
24134
|
+
const result2 = {
|
|
24135
|
+
attributes: toAttributes2(resource.attributes, encoder),
|
|
24136
|
+
droppedAttributesCount: 0
|
|
24137
|
+
};
|
|
24138
|
+
const schemaUrl = resource.schemaUrl;
|
|
24139
|
+
if (schemaUrl && schemaUrl !== "")
|
|
24140
|
+
result2.schemaUrl = schemaUrl;
|
|
24141
|
+
return result2;
|
|
24142
|
+
}
|
|
24143
|
+
function createInstrumentationScope2(scope) {
|
|
24144
|
+
return {
|
|
24145
|
+
name: scope.name,
|
|
24146
|
+
version: scope.version
|
|
24147
|
+
};
|
|
24148
|
+
}
|
|
24149
|
+
function toAttributes2(attributes, encoder) {
|
|
24150
|
+
return Object.keys(attributes).map((key) => toKeyValue2(key, attributes[key], encoder));
|
|
24151
|
+
}
|
|
24152
|
+
function toKeyValue2(key, value, encoder) {
|
|
24153
|
+
return {
|
|
24154
|
+
key,
|
|
24155
|
+
value: toAnyValue2(value, encoder)
|
|
24156
|
+
};
|
|
24157
|
+
}
|
|
24158
|
+
function toAnyValue2(value, encoder) {
|
|
24159
|
+
const t = typeof value;
|
|
24160
|
+
if (t === "string")
|
|
24161
|
+
return { stringValue: value };
|
|
24162
|
+
if (t === "number") {
|
|
24163
|
+
if (!Number.isInteger(value))
|
|
24164
|
+
return { doubleValue: value };
|
|
24165
|
+
return { intValue: value };
|
|
24166
|
+
}
|
|
24167
|
+
if (t === "boolean")
|
|
24168
|
+
return { boolValue: value };
|
|
24169
|
+
if (value instanceof Uint8Array)
|
|
24170
|
+
return { bytesValue: encoder.encodeUint8Array(value) };
|
|
24171
|
+
if (Array.isArray(value)) {
|
|
24172
|
+
const values = new Array(value.length);
|
|
24173
|
+
for (let i = 0; i < value.length; i++) {
|
|
24174
|
+
values[i] = toAnyValue2(value[i], encoder);
|
|
24175
|
+
}
|
|
24176
|
+
return { arrayValue: { values } };
|
|
24177
|
+
}
|
|
24178
|
+
if (t === "object" && value != null) {
|
|
24179
|
+
const keys = Object.keys(value);
|
|
24180
|
+
const values = new Array(keys.length);
|
|
24181
|
+
for (let i = 0; i < keys.length; i++) {
|
|
24182
|
+
values[i] = {
|
|
24183
|
+
key: keys[i],
|
|
24184
|
+
value: toAnyValue2(value[keys[i]], encoder)
|
|
24185
|
+
};
|
|
24186
|
+
}
|
|
24187
|
+
return { kvlistValue: { values } };
|
|
24188
|
+
}
|
|
24189
|
+
return {};
|
|
24190
|
+
}
|
|
24191
|
+
|
|
24192
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-transformer/build/esm/logs/internal.js
|
|
24193
|
+
function createExportLogsServiceRequest(logRecords, encoder) {
|
|
24194
|
+
return {
|
|
24195
|
+
resourceLogs: logRecordsToResourceLogs(logRecords, encoder)
|
|
24196
|
+
};
|
|
24197
|
+
}
|
|
24198
|
+
function createResourceMap2(logRecords) {
|
|
24199
|
+
const resourceMap = /* @__PURE__ */ new Map();
|
|
24200
|
+
for (const record2 of logRecords) {
|
|
24201
|
+
const { resource, instrumentationScope: { name, version = "", schemaUrl = "" } } = record2;
|
|
24202
|
+
let ismMap = resourceMap.get(resource);
|
|
24203
|
+
if (!ismMap) {
|
|
24204
|
+
ismMap = /* @__PURE__ */ new Map();
|
|
24205
|
+
resourceMap.set(resource, ismMap);
|
|
24206
|
+
}
|
|
24207
|
+
const ismKey = `${name}@${version}:${schemaUrl}`;
|
|
24208
|
+
let records = ismMap.get(ismKey);
|
|
24209
|
+
if (!records) {
|
|
24210
|
+
records = [];
|
|
24211
|
+
ismMap.set(ismKey, records);
|
|
24212
|
+
}
|
|
24213
|
+
records.push(record2);
|
|
24214
|
+
}
|
|
24215
|
+
return resourceMap;
|
|
24216
|
+
}
|
|
24217
|
+
function logRecordsToResourceLogs(logRecords, encoder) {
|
|
24218
|
+
const resourceMap = createResourceMap2(logRecords);
|
|
24219
|
+
return Array.from(resourceMap, ([resource, ismMap]) => {
|
|
24220
|
+
const processedResource = createResource2(resource, encoder);
|
|
24221
|
+
return {
|
|
24222
|
+
resource: processedResource,
|
|
24223
|
+
scopeLogs: Array.from(ismMap, ([, scopeLogs]) => {
|
|
24224
|
+
return {
|
|
24225
|
+
scope: createInstrumentationScope2(scopeLogs[0].instrumentationScope),
|
|
24226
|
+
logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)),
|
|
24227
|
+
schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl
|
|
24228
|
+
};
|
|
24229
|
+
}),
|
|
24230
|
+
schemaUrl: processedResource.schemaUrl
|
|
24231
|
+
};
|
|
24232
|
+
});
|
|
24233
|
+
}
|
|
24234
|
+
function toLogRecord(log, encoder) {
|
|
24235
|
+
return {
|
|
24236
|
+
timeUnixNano: encoder.encodeHrTime(log.hrTime),
|
|
24237
|
+
observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved),
|
|
24238
|
+
severityNumber: toSeverityNumber(log.severityNumber),
|
|
24239
|
+
severityText: log.severityText,
|
|
24240
|
+
body: toAnyValue2(log.body, encoder),
|
|
24241
|
+
eventName: log.eventName,
|
|
24242
|
+
attributes: toLogAttributes(log.attributes, encoder),
|
|
24243
|
+
droppedAttributesCount: log.droppedAttributesCount,
|
|
24244
|
+
flags: log.spanContext?.traceFlags,
|
|
24245
|
+
traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId),
|
|
24246
|
+
spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId)
|
|
24247
|
+
};
|
|
24248
|
+
}
|
|
24249
|
+
function toSeverityNumber(severityNumber) {
|
|
24250
|
+
return severityNumber;
|
|
24251
|
+
}
|
|
24252
|
+
function toLogAttributes(attributes, encoder) {
|
|
24253
|
+
return Object.keys(attributes).map((key) => toKeyValue2(key, attributes[key], encoder));
|
|
24254
|
+
}
|
|
24255
|
+
|
|
24256
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js
|
|
24257
|
+
function hrTimeToNanos2(hrTime4) {
|
|
24258
|
+
const NANOSECONDS = BigInt(1e9);
|
|
24259
|
+
return BigInt(Math.trunc(hrTime4[0])) * NANOSECONDS + BigInt(Math.trunc(hrTime4[1]));
|
|
24260
|
+
}
|
|
24261
|
+
function encodeAsString2(hrTime4) {
|
|
24262
|
+
const nanos = hrTimeToNanos2(hrTime4);
|
|
24263
|
+
return nanos.toString();
|
|
24264
|
+
}
|
|
24265
|
+
var encodeTimestamp2 = typeof BigInt !== "undefined" ? encodeAsString2 : hrTimeToNanoseconds3;
|
|
24266
|
+
function identity2(value) {
|
|
24267
|
+
return value;
|
|
24268
|
+
}
|
|
24269
|
+
var JSON_ENCODER = {
|
|
24270
|
+
encodeHrTime: encodeTimestamp2,
|
|
24271
|
+
encodeSpanContext: identity2,
|
|
24272
|
+
encodeOptionalSpanContext: identity2,
|
|
24273
|
+
encodeUint8Array: (bytes) => {
|
|
24274
|
+
if (typeof Buffer !== "undefined") {
|
|
24275
|
+
return Buffer.from(bytes).toString("base64");
|
|
24276
|
+
}
|
|
24277
|
+
const chars2 = new Array(bytes.length);
|
|
24278
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
24279
|
+
chars2[i] = String.fromCharCode(bytes[i]);
|
|
24280
|
+
}
|
|
24281
|
+
return btoa(chars2.join(""));
|
|
24282
|
+
}
|
|
24283
|
+
};
|
|
24284
|
+
|
|
24285
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-transformer/build/esm/logs/json/logs.js
|
|
24286
|
+
var JsonLogsSerializer = {
|
|
24287
|
+
serializeRequest: (arg) => {
|
|
24288
|
+
const request = createExportLogsServiceRequest(arg, JSON_ENCODER);
|
|
24289
|
+
const encoder = new TextEncoder();
|
|
24290
|
+
return encoder.encode(JSON.stringify(request));
|
|
24291
|
+
},
|
|
24292
|
+
deserializeResponse: (arg) => {
|
|
24293
|
+
if (arg.length === 0) {
|
|
24294
|
+
return {};
|
|
24295
|
+
}
|
|
24296
|
+
const decoder = new TextDecoder();
|
|
24297
|
+
return JSON.parse(decoder.decode(arg));
|
|
24298
|
+
}
|
|
24299
|
+
};
|
|
24300
|
+
|
|
24301
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js
|
|
24302
|
+
var MAX_ATTEMPTS2 = 5;
|
|
24303
|
+
var INITIAL_BACKOFF2 = 1e3;
|
|
24304
|
+
var MAX_BACKOFF2 = 5e3;
|
|
24305
|
+
var BACKOFF_MULTIPLIER2 = 1.5;
|
|
24306
|
+
var JITTER2 = 0.2;
|
|
24307
|
+
function getJitter2() {
|
|
24308
|
+
return Math.random() * (2 * JITTER2) - JITTER2;
|
|
24309
|
+
}
|
|
24310
|
+
var RetryingTransport2 = class {
|
|
24311
|
+
_transport;
|
|
24312
|
+
constructor(transport) {
|
|
24313
|
+
this._transport = transport;
|
|
24314
|
+
}
|
|
24315
|
+
retry(data, timeoutMillis, inMillis) {
|
|
24316
|
+
return new Promise((resolve2, reject) => {
|
|
24317
|
+
setTimeout(() => {
|
|
24318
|
+
this._transport.send(data, timeoutMillis).then(resolve2, reject);
|
|
24319
|
+
}, inMillis);
|
|
24320
|
+
});
|
|
24321
|
+
}
|
|
24322
|
+
async send(data, timeoutMillis) {
|
|
24323
|
+
let attempts = MAX_ATTEMPTS2;
|
|
24324
|
+
let nextBackoff = INITIAL_BACKOFF2;
|
|
24325
|
+
const deadline = Date.now() + timeoutMillis;
|
|
24326
|
+
let result2 = await this._transport.send(data, timeoutMillis);
|
|
24327
|
+
while (result2.status === "retryable" && attempts > 0) {
|
|
24328
|
+
attempts--;
|
|
24329
|
+
const backoff = Math.max(Math.min(nextBackoff * (1 + getJitter2()), MAX_BACKOFF2), 0);
|
|
24330
|
+
nextBackoff = nextBackoff * BACKOFF_MULTIPLIER2;
|
|
24331
|
+
const retryInMillis = result2.retryInMillis ?? backoff;
|
|
24332
|
+
const remainingTimeoutMillis = deadline - Date.now();
|
|
24333
|
+
if (retryInMillis > remainingTimeoutMillis) {
|
|
24334
|
+
diag2.info(`Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(remainingTimeoutMillis)}ms, not retrying further.`);
|
|
24335
|
+
return result2;
|
|
24336
|
+
}
|
|
24337
|
+
diag2.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);
|
|
24338
|
+
result2 = await this.retry(data, remainingTimeoutMillis, retryInMillis);
|
|
24339
|
+
}
|
|
24340
|
+
if (result2.status === "success") {
|
|
24341
|
+
diag2.verbose(`Export succeeded after ${MAX_ATTEMPTS2 - attempts} retry attempts.`);
|
|
24342
|
+
} else if (result2.status === "retryable") {
|
|
24343
|
+
diag2.info(`Export failed after maximum retry attempts (${MAX_ATTEMPTS2}).`);
|
|
24344
|
+
} else {
|
|
24345
|
+
diag2.info(`Export failed with non-retryable error: ${result2.error}`);
|
|
24346
|
+
}
|
|
24347
|
+
return result2;
|
|
24348
|
+
}
|
|
24349
|
+
shutdown() {
|
|
24350
|
+
return this._transport.shutdown();
|
|
24351
|
+
}
|
|
24352
|
+
};
|
|
24353
|
+
function createRetryingTransport2(options) {
|
|
24354
|
+
return new RetryingTransport2(options.transport);
|
|
24355
|
+
}
|
|
24356
|
+
|
|
24357
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js
|
|
24358
|
+
function isExportHTTPErrorRetryable(statusCode) {
|
|
24359
|
+
return statusCode === 429 || statusCode === 502 || statusCode === 503 || statusCode === 504;
|
|
24360
|
+
}
|
|
24361
|
+
function parseRetryAfterToMills2(retryAfter) {
|
|
24362
|
+
if (retryAfter == null) {
|
|
24363
|
+
return void 0;
|
|
24364
|
+
}
|
|
24365
|
+
const seconds = Number.parseInt(retryAfter, 10);
|
|
24366
|
+
if (Number.isInteger(seconds)) {
|
|
24367
|
+
return seconds > 0 ? seconds * 1e3 : -1;
|
|
24368
|
+
}
|
|
24369
|
+
const delay = new Date(retryAfter).getTime() - Date.now();
|
|
24370
|
+
if (delay >= 0) {
|
|
24371
|
+
return delay;
|
|
24372
|
+
}
|
|
24373
|
+
return 0;
|
|
24374
|
+
}
|
|
24375
|
+
|
|
24376
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/fetch-transport.js
|
|
24377
|
+
var MAX_KEEPALIVE_BODY_SIZE = 60 * 1024;
|
|
24378
|
+
var MAX_KEEPALIVE_REQUESTS = 9;
|
|
24379
|
+
var pendingBodySize = 0;
|
|
24380
|
+
var pendingKeepaliveCount = 0;
|
|
24381
|
+
var FetchTransport = class {
|
|
24382
|
+
_parameters;
|
|
24383
|
+
constructor(parameters) {
|
|
24384
|
+
this._parameters = parameters;
|
|
24385
|
+
}
|
|
24386
|
+
async send(data, timeoutMillis) {
|
|
24387
|
+
const abortController = new AbortController();
|
|
24388
|
+
const timeout = setTimeout(() => abortController.abort(), timeoutMillis);
|
|
24389
|
+
let fetchApi = globalThis.fetch;
|
|
24390
|
+
if (typeof fetchApi.__original === "function") {
|
|
24391
|
+
fetchApi = fetchApi.__original;
|
|
24392
|
+
}
|
|
24393
|
+
const requestSize = data.byteLength;
|
|
24394
|
+
const wouldExceedSize = pendingBodySize + requestSize > MAX_KEEPALIVE_BODY_SIZE;
|
|
24395
|
+
const wouldExceedCount = pendingKeepaliveCount >= MAX_KEEPALIVE_REQUESTS;
|
|
24396
|
+
const useKeepalive = !wouldExceedSize && !wouldExceedCount;
|
|
24397
|
+
if (useKeepalive) {
|
|
24398
|
+
pendingBodySize += requestSize;
|
|
24399
|
+
pendingKeepaliveCount++;
|
|
24400
|
+
} else {
|
|
24401
|
+
const reason = wouldExceedSize ? "size limit" : "count limit";
|
|
24402
|
+
diag2.debug(`keepalive disabled: ${(requestSize / 1024).toFixed(1)}KB payload, ${pendingKeepaliveCount} pending (${reason})`);
|
|
24403
|
+
}
|
|
24404
|
+
try {
|
|
24405
|
+
const url = new URL(this._parameters.url);
|
|
24406
|
+
const response = await fetchApi(url.href, {
|
|
24407
|
+
method: "POST",
|
|
24408
|
+
headers: await this._parameters.headers(),
|
|
24409
|
+
body: data,
|
|
24410
|
+
signal: abortController.signal,
|
|
24411
|
+
keepalive: useKeepalive,
|
|
24412
|
+
mode: globalThis.location ? globalThis.location.origin === url.origin ? "same-origin" : "cors" : "no-cors"
|
|
24413
|
+
});
|
|
24414
|
+
if (response.status >= 200 && response.status <= 299) {
|
|
24415
|
+
diag2.debug(`export response success (status: ${response.status})`);
|
|
24416
|
+
return { status: "success" };
|
|
24417
|
+
} else if (isExportHTTPErrorRetryable(response.status)) {
|
|
24418
|
+
diag2.warn(`export response retryable (status: ${response.status})`);
|
|
24419
|
+
const retryAfter = response.headers.get("Retry-After");
|
|
24420
|
+
const retryInMillis = parseRetryAfterToMills2(retryAfter);
|
|
24421
|
+
return { status: "retryable", retryInMillis };
|
|
24422
|
+
}
|
|
24423
|
+
diag2.error(`export response failure (status: ${response.status})`);
|
|
24424
|
+
return {
|
|
24425
|
+
status: "failure",
|
|
24426
|
+
error: new Error(`Fetch request failed with non-retryable status ${response.status}`)
|
|
24427
|
+
};
|
|
24428
|
+
} catch (error) {
|
|
24429
|
+
if (isFetchNetworkErrorRetryable(error)) {
|
|
24430
|
+
diag2.warn(`export request retryable (network error: ${error})`);
|
|
24431
|
+
return {
|
|
24432
|
+
status: "retryable",
|
|
24433
|
+
error: new Error("Fetch request encountered a network error", {
|
|
24434
|
+
cause: error
|
|
24435
|
+
})
|
|
24436
|
+
};
|
|
24437
|
+
}
|
|
24438
|
+
diag2.error(`export request failure (error: ${error})`);
|
|
24439
|
+
return {
|
|
24440
|
+
status: "failure",
|
|
24441
|
+
error: new Error("Fetch request errored", { cause: error })
|
|
24442
|
+
};
|
|
24443
|
+
} finally {
|
|
24444
|
+
clearTimeout(timeout);
|
|
24445
|
+
if (useKeepalive) {
|
|
24446
|
+
pendingBodySize -= requestSize;
|
|
24447
|
+
pendingKeepaliveCount--;
|
|
24448
|
+
}
|
|
24449
|
+
}
|
|
24450
|
+
}
|
|
24451
|
+
shutdown() {
|
|
24452
|
+
}
|
|
24453
|
+
};
|
|
24454
|
+
function createFetchTransport(parameters) {
|
|
24455
|
+
return new FetchTransport(parameters);
|
|
24456
|
+
}
|
|
24457
|
+
function isFetchNetworkErrorRetryable(error) {
|
|
24458
|
+
return error instanceof TypeError && !error.cause;
|
|
24459
|
+
}
|
|
24460
|
+
|
|
24461
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-browser-http-export-delegate.js
|
|
24462
|
+
function createOtlpFetchExportDelegate(options, serializer) {
|
|
24463
|
+
return createOtlpNetworkExportDelegate2(options, serializer, createRetryingTransport2({
|
|
24464
|
+
transport: createFetchTransport(options)
|
|
24465
|
+
}));
|
|
24466
|
+
}
|
|
24467
|
+
|
|
24468
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js
|
|
24469
|
+
function validateAndNormalizeHeaders2(partialHeaders) {
|
|
24470
|
+
const headers = {};
|
|
24471
|
+
Object.entries(partialHeaders ?? {}).forEach(([key, value]) => {
|
|
24472
|
+
if (typeof value !== "undefined") {
|
|
24473
|
+
headers[key] = String(value);
|
|
24474
|
+
} else {
|
|
24475
|
+
diag2.warn(`Header "${key}" has invalid value (${value}) and will be ignored`);
|
|
24476
|
+
}
|
|
24477
|
+
});
|
|
24478
|
+
return headers;
|
|
24479
|
+
}
|
|
24480
|
+
|
|
24481
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js
|
|
24482
|
+
function mergeHeaders2(userProvidedHeaders, fallbackHeaders, defaultHeaders) {
|
|
24483
|
+
return async () => {
|
|
24484
|
+
const requiredHeaders = {
|
|
24485
|
+
...await defaultHeaders()
|
|
24486
|
+
};
|
|
24487
|
+
const headers = {};
|
|
24488
|
+
if (fallbackHeaders != null) {
|
|
24489
|
+
Object.assign(headers, await fallbackHeaders());
|
|
24490
|
+
}
|
|
24491
|
+
if (userProvidedHeaders != null) {
|
|
24492
|
+
Object.assign(headers, validateAndNormalizeHeaders2(await userProvidedHeaders()));
|
|
24493
|
+
}
|
|
24494
|
+
return Object.assign(headers, requiredHeaders);
|
|
24495
|
+
};
|
|
24496
|
+
}
|
|
24497
|
+
function validateUserProvidedUrl2(url) {
|
|
24498
|
+
if (url == null) {
|
|
24499
|
+
return void 0;
|
|
24500
|
+
}
|
|
24501
|
+
try {
|
|
24502
|
+
const base = globalThis.location?.href;
|
|
24503
|
+
return new URL(url, base).href;
|
|
24504
|
+
} catch {
|
|
24505
|
+
throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`);
|
|
24506
|
+
}
|
|
24507
|
+
}
|
|
24508
|
+
function mergeOtlpHttpConfigurationWithDefaults2(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
24509
|
+
return {
|
|
24510
|
+
...mergeOtlpSharedConfigurationWithDefaults2(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),
|
|
24511
|
+
headers: mergeHeaders2(userProvidedConfiguration.headers, fallbackConfiguration.headers, defaultConfiguration.headers),
|
|
24512
|
+
url: validateUserProvidedUrl2(userProvidedConfiguration.url) ?? fallbackConfiguration.url ?? defaultConfiguration.url
|
|
24513
|
+
};
|
|
24514
|
+
}
|
|
24515
|
+
function getHttpConfigurationDefaults2(requiredHeaders, signalResourcePath) {
|
|
24516
|
+
return {
|
|
24517
|
+
...getSharedConfigurationDefaults2(),
|
|
24518
|
+
headers: async () => requiredHeaders,
|
|
24519
|
+
url: "http://localhost:4318/" + signalResourcePath
|
|
24520
|
+
};
|
|
24521
|
+
}
|
|
24522
|
+
|
|
24523
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-http-options.js
|
|
24524
|
+
function convertLegacyHeaders(config) {
|
|
24525
|
+
if (typeof config.headers === "function") {
|
|
24526
|
+
return config.headers;
|
|
24527
|
+
}
|
|
24528
|
+
return wrapStaticHeadersInFunction2(config.headers);
|
|
24529
|
+
}
|
|
24530
|
+
|
|
24531
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-browser-http-options.js
|
|
24532
|
+
function convertLegacyBrowserHttpOptions2(config, signalResourcePath, requiredHeaders) {
|
|
24533
|
+
return mergeOtlpHttpConfigurationWithDefaults2(
|
|
24534
|
+
{
|
|
24535
|
+
url: config.url,
|
|
24536
|
+
timeoutMillis: config.timeoutMillis,
|
|
24537
|
+
headers: convertLegacyHeaders(config),
|
|
24538
|
+
concurrencyLimit: config.concurrencyLimit
|
|
24539
|
+
},
|
|
24540
|
+
{},
|
|
24541
|
+
// no fallback for browser case
|
|
24542
|
+
getHttpConfigurationDefaults2(requiredHeaders, signalResourcePath)
|
|
24543
|
+
);
|
|
24544
|
+
}
|
|
24545
|
+
|
|
24546
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/create-legacy-browser-delegate.js
|
|
24547
|
+
function createLegacyOtlpBrowserExportDelegate2(config, serializer, signalResourcePath, requiredHeaders) {
|
|
24548
|
+
const options = convertLegacyBrowserHttpOptions2(config, signalResourcePath, requiredHeaders);
|
|
24549
|
+
return createOtlpFetchExportDelegate(options, serializer);
|
|
24550
|
+
}
|
|
24551
|
+
|
|
24552
|
+
// node_modules/@opentelemetry/exporter-logs-otlp-http/build/esm/platform/browser/OTLPLogExporter.js
|
|
24553
|
+
var OTLPLogExporter = class extends OTLPExporterBase2 {
|
|
24554
|
+
constructor(config = {}) {
|
|
24555
|
+
super(createLegacyOtlpBrowserExportDelegate2(config, JsonLogsSerializer, "v1/logs", { "Content-Type": "application/json" }));
|
|
24556
|
+
}
|
|
24557
|
+
};
|
|
24558
|
+
|
|
24559
|
+
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/api-logs/build/esm/NoopLogger.js
|
|
24560
|
+
var NoopLogger3 = (
|
|
24561
|
+
/** @class */
|
|
24562
|
+
(function() {
|
|
24563
|
+
function NoopLogger5() {
|
|
24564
|
+
}
|
|
24565
|
+
NoopLogger5.prototype.emit = function(_logRecord) {
|
|
24566
|
+
};
|
|
24567
|
+
return NoopLogger5;
|
|
24568
|
+
})()
|
|
24569
|
+
);
|
|
24570
|
+
var NOOP_LOGGER3 = new NoopLogger3();
|
|
24571
|
+
|
|
24572
|
+
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/api-logs/build/esm/NoopLoggerProvider.js
|
|
24573
|
+
var NoopLoggerProvider3 = (
|
|
24574
|
+
/** @class */
|
|
24575
|
+
(function() {
|
|
24576
|
+
function NoopLoggerProvider5() {
|
|
24577
|
+
}
|
|
24578
|
+
NoopLoggerProvider5.prototype.getLogger = function(_name, _version, _options) {
|
|
24579
|
+
return new NoopLogger3();
|
|
24580
|
+
};
|
|
24581
|
+
return NoopLoggerProvider5;
|
|
24582
|
+
})()
|
|
24583
|
+
);
|
|
24584
|
+
var NOOP_LOGGER_PROVIDER3 = new NoopLoggerProvider3();
|
|
24585
|
+
|
|
24586
|
+
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/api-logs/build/esm/ProxyLogger.js
|
|
24587
|
+
var ProxyLogger3 = (
|
|
24588
|
+
/** @class */
|
|
24589
|
+
(function() {
|
|
24590
|
+
function ProxyLogger5(_provider, name, version, options) {
|
|
24591
|
+
this._provider = _provider;
|
|
24592
|
+
this.name = name;
|
|
24593
|
+
this.version = version;
|
|
24594
|
+
this.options = options;
|
|
24595
|
+
}
|
|
24596
|
+
ProxyLogger5.prototype.emit = function(logRecord) {
|
|
24597
|
+
this._getLogger().emit(logRecord);
|
|
24598
|
+
};
|
|
24599
|
+
ProxyLogger5.prototype._getLogger = function() {
|
|
24600
|
+
if (this._delegate) {
|
|
24601
|
+
return this._delegate;
|
|
24602
|
+
}
|
|
24603
|
+
var logger = this._provider.getDelegateLogger(this.name, this.version, this.options);
|
|
24604
|
+
if (!logger) {
|
|
24605
|
+
return NOOP_LOGGER3;
|
|
24606
|
+
}
|
|
24607
|
+
this._delegate = logger;
|
|
24608
|
+
return this._delegate;
|
|
24609
|
+
};
|
|
24610
|
+
return ProxyLogger5;
|
|
24611
|
+
})()
|
|
24612
|
+
);
|
|
24613
|
+
|
|
24614
|
+
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/api-logs/build/esm/ProxyLoggerProvider.js
|
|
24615
|
+
var ProxyLoggerProvider3 = (
|
|
24616
|
+
/** @class */
|
|
22703
24617
|
(function() {
|
|
22704
|
-
function
|
|
24618
|
+
function ProxyLoggerProvider5() {
|
|
22705
24619
|
}
|
|
22706
|
-
|
|
24620
|
+
ProxyLoggerProvider5.prototype.getLogger = function(name, version, options) {
|
|
22707
24621
|
var _a4;
|
|
22708
|
-
return (_a4 = this.getDelegateLogger(name, version, options)) !== null && _a4 !== void 0 ? _a4 : new
|
|
24622
|
+
return (_a4 = this.getDelegateLogger(name, version, options)) !== null && _a4 !== void 0 ? _a4 : new ProxyLogger3(this, name, version, options);
|
|
22709
24623
|
};
|
|
22710
|
-
|
|
24624
|
+
ProxyLoggerProvider5.prototype.getDelegate = function() {
|
|
22711
24625
|
var _a4;
|
|
22712
|
-
return (_a4 = this._delegate) !== null && _a4 !== void 0 ? _a4 :
|
|
24626
|
+
return (_a4 = this._delegate) !== null && _a4 !== void 0 ? _a4 : NOOP_LOGGER_PROVIDER3;
|
|
22713
24627
|
};
|
|
22714
|
-
|
|
24628
|
+
ProxyLoggerProvider5.prototype.setDelegate = function(delegate) {
|
|
22715
24629
|
this._delegate = delegate;
|
|
22716
24630
|
};
|
|
22717
|
-
|
|
24631
|
+
ProxyLoggerProvider5.prototype.getDelegateLogger = function(name, version, options) {
|
|
22718
24632
|
var _a4;
|
|
22719
24633
|
return (_a4 = this._delegate) === null || _a4 === void 0 ? void 0 : _a4.getLogger(name, version, options);
|
|
22720
24634
|
};
|
|
22721
|
-
return
|
|
24635
|
+
return ProxyLoggerProvider5;
|
|
22722
24636
|
})()
|
|
22723
24637
|
);
|
|
22724
24638
|
|
|
22725
24639
|
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/api-logs/build/esm/platform/browser/globalThis.js
|
|
22726
|
-
var
|
|
24640
|
+
var _globalThis4 = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
22727
24641
|
|
|
22728
24642
|
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/api-logs/build/esm/internal/global-utils.js
|
|
22729
|
-
var
|
|
22730
|
-
var
|
|
22731
|
-
function
|
|
24643
|
+
var GLOBAL_LOGS_API_KEY3 = /* @__PURE__ */ Symbol.for("io.opentelemetry.js.api.logs");
|
|
24644
|
+
var _global4 = _globalThis4;
|
|
24645
|
+
function makeGetter3(requiredVersion, instance, fallback) {
|
|
22732
24646
|
return function(version) {
|
|
22733
24647
|
return version === requiredVersion ? instance : fallback;
|
|
22734
24648
|
};
|
|
22735
24649
|
}
|
|
22736
|
-
var
|
|
24650
|
+
var API_BACKWARDS_COMPATIBILITY_VERSION3 = 1;
|
|
22737
24651
|
|
|
22738
24652
|
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/api-logs/build/esm/api/logs.js
|
|
22739
|
-
var
|
|
24653
|
+
var LogsAPI3 = (
|
|
22740
24654
|
/** @class */
|
|
22741
24655
|
(function() {
|
|
22742
|
-
function
|
|
22743
|
-
this._proxyLoggerProvider = new
|
|
24656
|
+
function LogsAPI5() {
|
|
24657
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider3();
|
|
22744
24658
|
}
|
|
22745
|
-
|
|
24659
|
+
LogsAPI5.getInstance = function() {
|
|
22746
24660
|
if (!this._instance) {
|
|
22747
|
-
this._instance = new
|
|
24661
|
+
this._instance = new LogsAPI5();
|
|
22748
24662
|
}
|
|
22749
24663
|
return this._instance;
|
|
22750
24664
|
};
|
|
22751
|
-
|
|
22752
|
-
if (
|
|
24665
|
+
LogsAPI5.prototype.setGlobalLoggerProvider = function(provider) {
|
|
24666
|
+
if (_global4[GLOBAL_LOGS_API_KEY3]) {
|
|
22753
24667
|
return this.getLoggerProvider();
|
|
22754
24668
|
}
|
|
22755
|
-
|
|
24669
|
+
_global4[GLOBAL_LOGS_API_KEY3] = makeGetter3(API_BACKWARDS_COMPATIBILITY_VERSION3, provider, NOOP_LOGGER_PROVIDER3);
|
|
22756
24670
|
this._proxyLoggerProvider.setDelegate(provider);
|
|
22757
24671
|
return provider;
|
|
22758
24672
|
};
|
|
22759
|
-
|
|
24673
|
+
LogsAPI5.prototype.getLoggerProvider = function() {
|
|
22760
24674
|
var _a4, _b;
|
|
22761
|
-
return (_b = (_a4 =
|
|
24675
|
+
return (_b = (_a4 = _global4[GLOBAL_LOGS_API_KEY3]) === null || _a4 === void 0 ? void 0 : _a4.call(_global4, API_BACKWARDS_COMPATIBILITY_VERSION3)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider;
|
|
22762
24676
|
};
|
|
22763
|
-
|
|
24677
|
+
LogsAPI5.prototype.getLogger = function(name, version, options) {
|
|
22764
24678
|
return this.getLoggerProvider().getLogger(name, version, options);
|
|
22765
24679
|
};
|
|
22766
|
-
|
|
22767
|
-
delete
|
|
22768
|
-
this._proxyLoggerProvider = new
|
|
24680
|
+
LogsAPI5.prototype.disable = function() {
|
|
24681
|
+
delete _global4[GLOBAL_LOGS_API_KEY3];
|
|
24682
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider3();
|
|
22769
24683
|
};
|
|
22770
|
-
return
|
|
24684
|
+
return LogsAPI5;
|
|
22771
24685
|
})()
|
|
22772
24686
|
);
|
|
22773
24687
|
|
|
22774
24688
|
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/api-logs/build/esm/index.js
|
|
22775
|
-
var
|
|
24689
|
+
var logs3 = LogsAPI3.getInstance();
|
|
22776
24690
|
|
|
22777
24691
|
// node_modules/@opentelemetry/instrumentation-fetch/node_modules/@opentelemetry/instrumentation/build/esm/instrumentation.js
|
|
22778
24692
|
var shimmer = __toESM(require_shimmer());
|
|
@@ -22804,7 +24718,7 @@ var InstrumentationAbstract = (
|
|
|
22804
24718
|
});
|
|
22805
24719
|
this._tracer = trace.getTracer(instrumentationName, instrumentationVersion);
|
|
22806
24720
|
this._meter = metrics.getMeter(instrumentationName, instrumentationVersion);
|
|
22807
|
-
this._logger =
|
|
24721
|
+
this._logger = logs3.getLogger(instrumentationName, instrumentationVersion);
|
|
22808
24722
|
this._updateMetricInstruments();
|
|
22809
24723
|
}
|
|
22810
24724
|
Object.defineProperty(InstrumentationAbstract4.prototype, "meter", {
|
|
@@ -23202,7 +25116,7 @@ function getFormDataSize(formData) {
|
|
|
23202
25116
|
}
|
|
23203
25117
|
|
|
23204
25118
|
// node_modules/@opentelemetry/instrumentation-fetch/build/esm/version.js
|
|
23205
|
-
var
|
|
25119
|
+
var VERSION5 = "0.57.2";
|
|
23206
25120
|
|
|
23207
25121
|
// node_modules/@opentelemetry/instrumentation-fetch/build/esm/fetch.js
|
|
23208
25122
|
var __extends17 = /* @__PURE__ */ (function() {
|
|
@@ -23261,9 +25175,9 @@ var FetchInstrumentation = (
|
|
|
23261
25175
|
if (config === void 0) {
|
|
23262
25176
|
config = {};
|
|
23263
25177
|
}
|
|
23264
|
-
var _this = _super.call(this, "@opentelemetry/instrumentation-fetch",
|
|
25178
|
+
var _this = _super.call(this, "@opentelemetry/instrumentation-fetch", VERSION5, config) || this;
|
|
23265
25179
|
_this.component = "fetch";
|
|
23266
|
-
_this.version =
|
|
25180
|
+
_this.version = VERSION5;
|
|
23267
25181
|
_this.moduleName = _this.component;
|
|
23268
25182
|
_this._usedResources = /* @__PURE__ */ new WeakSet();
|
|
23269
25183
|
_this._tasksCount = 0;
|
|
@@ -23511,16 +25425,16 @@ var FetchInstrumentation = (
|
|
|
23511
25425
|
return;
|
|
23512
25426
|
}
|
|
23513
25427
|
if (isWrapped(fetch)) {
|
|
23514
|
-
this._unwrap(
|
|
25428
|
+
this._unwrap(_globalThis2, "fetch");
|
|
23515
25429
|
this._diag.debug("removing previous patch for constructor");
|
|
23516
25430
|
}
|
|
23517
|
-
this._wrap(
|
|
25431
|
+
this._wrap(_globalThis2, "fetch", this._patchConstructor());
|
|
23518
25432
|
};
|
|
23519
25433
|
FetchInstrumentation2.prototype.disable = function() {
|
|
23520
25434
|
if (isNode) {
|
|
23521
25435
|
return;
|
|
23522
25436
|
}
|
|
23523
|
-
this._unwrap(
|
|
25437
|
+
this._unwrap(_globalThis2, "fetch");
|
|
23524
25438
|
this._usedResources = /* @__PURE__ */ new WeakSet();
|
|
23525
25439
|
};
|
|
23526
25440
|
return FetchInstrumentation2;
|
|
@@ -23528,136 +25442,136 @@ var FetchInstrumentation = (
|
|
|
23528
25442
|
);
|
|
23529
25443
|
|
|
23530
25444
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/api-logs/build/esm/NoopLogger.js
|
|
23531
|
-
var
|
|
25445
|
+
var NoopLogger4 = (
|
|
23532
25446
|
/** @class */
|
|
23533
25447
|
(function() {
|
|
23534
|
-
function
|
|
25448
|
+
function NoopLogger5() {
|
|
23535
25449
|
}
|
|
23536
|
-
|
|
25450
|
+
NoopLogger5.prototype.emit = function(_logRecord) {
|
|
23537
25451
|
};
|
|
23538
|
-
return
|
|
25452
|
+
return NoopLogger5;
|
|
23539
25453
|
})()
|
|
23540
25454
|
);
|
|
23541
|
-
var
|
|
25455
|
+
var NOOP_LOGGER4 = new NoopLogger4();
|
|
23542
25456
|
|
|
23543
25457
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/api-logs/build/esm/NoopLoggerProvider.js
|
|
23544
|
-
var
|
|
25458
|
+
var NoopLoggerProvider4 = (
|
|
23545
25459
|
/** @class */
|
|
23546
25460
|
(function() {
|
|
23547
|
-
function
|
|
25461
|
+
function NoopLoggerProvider5() {
|
|
23548
25462
|
}
|
|
23549
|
-
|
|
23550
|
-
return new
|
|
25463
|
+
NoopLoggerProvider5.prototype.getLogger = function(_name, _version, _options) {
|
|
25464
|
+
return new NoopLogger4();
|
|
23551
25465
|
};
|
|
23552
|
-
return
|
|
25466
|
+
return NoopLoggerProvider5;
|
|
23553
25467
|
})()
|
|
23554
25468
|
);
|
|
23555
|
-
var
|
|
25469
|
+
var NOOP_LOGGER_PROVIDER4 = new NoopLoggerProvider4();
|
|
23556
25470
|
|
|
23557
25471
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/api-logs/build/esm/ProxyLogger.js
|
|
23558
|
-
var
|
|
25472
|
+
var ProxyLogger4 = (
|
|
23559
25473
|
/** @class */
|
|
23560
25474
|
(function() {
|
|
23561
|
-
function
|
|
25475
|
+
function ProxyLogger5(_provider, name, version, options) {
|
|
23562
25476
|
this._provider = _provider;
|
|
23563
25477
|
this.name = name;
|
|
23564
25478
|
this.version = version;
|
|
23565
25479
|
this.options = options;
|
|
23566
25480
|
}
|
|
23567
|
-
|
|
25481
|
+
ProxyLogger5.prototype.emit = function(logRecord) {
|
|
23568
25482
|
this._getLogger().emit(logRecord);
|
|
23569
25483
|
};
|
|
23570
|
-
|
|
25484
|
+
ProxyLogger5.prototype._getLogger = function() {
|
|
23571
25485
|
if (this._delegate) {
|
|
23572
25486
|
return this._delegate;
|
|
23573
25487
|
}
|
|
23574
25488
|
var logger = this._provider.getDelegateLogger(this.name, this.version, this.options);
|
|
23575
25489
|
if (!logger) {
|
|
23576
|
-
return
|
|
25490
|
+
return NOOP_LOGGER4;
|
|
23577
25491
|
}
|
|
23578
25492
|
this._delegate = logger;
|
|
23579
25493
|
return this._delegate;
|
|
23580
25494
|
};
|
|
23581
|
-
return
|
|
25495
|
+
return ProxyLogger5;
|
|
23582
25496
|
})()
|
|
23583
25497
|
);
|
|
23584
25498
|
|
|
23585
25499
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/api-logs/build/esm/ProxyLoggerProvider.js
|
|
23586
|
-
var
|
|
25500
|
+
var ProxyLoggerProvider4 = (
|
|
23587
25501
|
/** @class */
|
|
23588
25502
|
(function() {
|
|
23589
|
-
function
|
|
25503
|
+
function ProxyLoggerProvider5() {
|
|
23590
25504
|
}
|
|
23591
|
-
|
|
25505
|
+
ProxyLoggerProvider5.prototype.getLogger = function(name, version, options) {
|
|
23592
25506
|
var _a4;
|
|
23593
|
-
return (_a4 = this.getDelegateLogger(name, version, options)) !== null && _a4 !== void 0 ? _a4 : new
|
|
25507
|
+
return (_a4 = this.getDelegateLogger(name, version, options)) !== null && _a4 !== void 0 ? _a4 : new ProxyLogger4(this, name, version, options);
|
|
23594
25508
|
};
|
|
23595
|
-
|
|
25509
|
+
ProxyLoggerProvider5.prototype.getDelegate = function() {
|
|
23596
25510
|
var _a4;
|
|
23597
|
-
return (_a4 = this._delegate) !== null && _a4 !== void 0 ? _a4 :
|
|
25511
|
+
return (_a4 = this._delegate) !== null && _a4 !== void 0 ? _a4 : NOOP_LOGGER_PROVIDER4;
|
|
23598
25512
|
};
|
|
23599
|
-
|
|
25513
|
+
ProxyLoggerProvider5.prototype.setDelegate = function(delegate) {
|
|
23600
25514
|
this._delegate = delegate;
|
|
23601
25515
|
};
|
|
23602
|
-
|
|
25516
|
+
ProxyLoggerProvider5.prototype.getDelegateLogger = function(name, version, options) {
|
|
23603
25517
|
var _a4;
|
|
23604
25518
|
return (_a4 = this._delegate) === null || _a4 === void 0 ? void 0 : _a4.getLogger(name, version, options);
|
|
23605
25519
|
};
|
|
23606
|
-
return
|
|
25520
|
+
return ProxyLoggerProvider5;
|
|
23607
25521
|
})()
|
|
23608
25522
|
);
|
|
23609
25523
|
|
|
23610
25524
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/api-logs/build/esm/platform/browser/globalThis.js
|
|
23611
|
-
var
|
|
25525
|
+
var _globalThis5 = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
23612
25526
|
|
|
23613
25527
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/api-logs/build/esm/internal/global-utils.js
|
|
23614
|
-
var
|
|
23615
|
-
var
|
|
23616
|
-
function
|
|
25528
|
+
var GLOBAL_LOGS_API_KEY4 = /* @__PURE__ */ Symbol.for("io.opentelemetry.js.api.logs");
|
|
25529
|
+
var _global5 = _globalThis5;
|
|
25530
|
+
function makeGetter4(requiredVersion, instance, fallback) {
|
|
23617
25531
|
return function(version) {
|
|
23618
25532
|
return version === requiredVersion ? instance : fallback;
|
|
23619
25533
|
};
|
|
23620
25534
|
}
|
|
23621
|
-
var
|
|
25535
|
+
var API_BACKWARDS_COMPATIBILITY_VERSION4 = 1;
|
|
23622
25536
|
|
|
23623
25537
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/api-logs/build/esm/api/logs.js
|
|
23624
|
-
var
|
|
25538
|
+
var LogsAPI4 = (
|
|
23625
25539
|
/** @class */
|
|
23626
25540
|
(function() {
|
|
23627
|
-
function
|
|
23628
|
-
this._proxyLoggerProvider = new
|
|
25541
|
+
function LogsAPI5() {
|
|
25542
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider4();
|
|
23629
25543
|
}
|
|
23630
|
-
|
|
25544
|
+
LogsAPI5.getInstance = function() {
|
|
23631
25545
|
if (!this._instance) {
|
|
23632
|
-
this._instance = new
|
|
25546
|
+
this._instance = new LogsAPI5();
|
|
23633
25547
|
}
|
|
23634
25548
|
return this._instance;
|
|
23635
25549
|
};
|
|
23636
|
-
|
|
23637
|
-
if (
|
|
25550
|
+
LogsAPI5.prototype.setGlobalLoggerProvider = function(provider) {
|
|
25551
|
+
if (_global5[GLOBAL_LOGS_API_KEY4]) {
|
|
23638
25552
|
return this.getLoggerProvider();
|
|
23639
25553
|
}
|
|
23640
|
-
|
|
25554
|
+
_global5[GLOBAL_LOGS_API_KEY4] = makeGetter4(API_BACKWARDS_COMPATIBILITY_VERSION4, provider, NOOP_LOGGER_PROVIDER4);
|
|
23641
25555
|
this._proxyLoggerProvider.setDelegate(provider);
|
|
23642
25556
|
return provider;
|
|
23643
25557
|
};
|
|
23644
|
-
|
|
25558
|
+
LogsAPI5.prototype.getLoggerProvider = function() {
|
|
23645
25559
|
var _a4, _b;
|
|
23646
|
-
return (_b = (_a4 =
|
|
25560
|
+
return (_b = (_a4 = _global5[GLOBAL_LOGS_API_KEY4]) === null || _a4 === void 0 ? void 0 : _a4.call(_global5, API_BACKWARDS_COMPATIBILITY_VERSION4)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider;
|
|
23647
25561
|
};
|
|
23648
|
-
|
|
25562
|
+
LogsAPI5.prototype.getLogger = function(name, version, options) {
|
|
23649
25563
|
return this.getLoggerProvider().getLogger(name, version, options);
|
|
23650
25564
|
};
|
|
23651
|
-
|
|
23652
|
-
delete
|
|
23653
|
-
this._proxyLoggerProvider = new
|
|
25565
|
+
LogsAPI5.prototype.disable = function() {
|
|
25566
|
+
delete _global5[GLOBAL_LOGS_API_KEY4];
|
|
25567
|
+
this._proxyLoggerProvider = new ProxyLoggerProvider4();
|
|
23654
25568
|
};
|
|
23655
|
-
return
|
|
25569
|
+
return LogsAPI5;
|
|
23656
25570
|
})()
|
|
23657
25571
|
);
|
|
23658
25572
|
|
|
23659
25573
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/api-logs/build/esm/index.js
|
|
23660
|
-
var
|
|
25574
|
+
var logs4 = LogsAPI4.getInstance();
|
|
23661
25575
|
|
|
23662
25576
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/node_modules/@opentelemetry/instrumentation/build/esm/instrumentation.js
|
|
23663
25577
|
var shimmer2 = __toESM(require_shimmer());
|
|
@@ -23689,7 +25603,7 @@ var InstrumentationAbstract2 = (
|
|
|
23689
25603
|
});
|
|
23690
25604
|
this._tracer = trace.getTracer(instrumentationName, instrumentationVersion);
|
|
23691
25605
|
this._meter = metrics.getMeter(instrumentationName, instrumentationVersion);
|
|
23692
|
-
this._logger =
|
|
25606
|
+
this._logger = logs4.getLogger(instrumentationName, instrumentationVersion);
|
|
23693
25607
|
this._updateMetricInstruments();
|
|
23694
25608
|
}
|
|
23695
25609
|
Object.defineProperty(InstrumentationAbstract4.prototype, "meter", {
|
|
@@ -23923,7 +25837,7 @@ function getFormDataSize2(formData) {
|
|
|
23923
25837
|
}
|
|
23924
25838
|
|
|
23925
25839
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/build/esm/version.js
|
|
23926
|
-
var
|
|
25840
|
+
var VERSION6 = "0.57.2";
|
|
23927
25841
|
|
|
23928
25842
|
// node_modules/@opentelemetry/instrumentation-xml-http-request/build/esm/enums/AttributeNames.js
|
|
23929
25843
|
var AttributeNames2;
|
|
@@ -23960,9 +25874,9 @@ var XMLHttpRequestInstrumentation = (
|
|
|
23960
25874
|
if (config === void 0) {
|
|
23961
25875
|
config = {};
|
|
23962
25876
|
}
|
|
23963
|
-
var _this = _super.call(this, "@opentelemetry/instrumentation-xml-http-request",
|
|
25877
|
+
var _this = _super.call(this, "@opentelemetry/instrumentation-xml-http-request", VERSION6, config) || this;
|
|
23964
25878
|
_this.component = "xml-http-request";
|
|
23965
|
-
_this.version =
|
|
25879
|
+
_this.version = VERSION6;
|
|
23966
25880
|
_this.moduleName = _this.component;
|
|
23967
25881
|
_this._tasksCount = 0;
|
|
23968
25882
|
_this._xhrMem = /* @__PURE__ */ new WeakMap();
|
|
@@ -24251,138 +26165,6 @@ var XMLHttpRequestInstrumentation = (
|
|
|
24251
26165
|
})(InstrumentationBase2)
|
|
24252
26166
|
);
|
|
24253
26167
|
|
|
24254
|
-
// node_modules/@opentelemetry/api-logs/build/esm/NoopLogger.js
|
|
24255
|
-
var NoopLogger3 = (
|
|
24256
|
-
/** @class */
|
|
24257
|
-
(function() {
|
|
24258
|
-
function NoopLogger4() {
|
|
24259
|
-
}
|
|
24260
|
-
NoopLogger4.prototype.emit = function(_logRecord) {
|
|
24261
|
-
};
|
|
24262
|
-
return NoopLogger4;
|
|
24263
|
-
})()
|
|
24264
|
-
);
|
|
24265
|
-
var NOOP_LOGGER3 = new NoopLogger3();
|
|
24266
|
-
|
|
24267
|
-
// node_modules/@opentelemetry/api-logs/build/esm/NoopLoggerProvider.js
|
|
24268
|
-
var NoopLoggerProvider3 = (
|
|
24269
|
-
/** @class */
|
|
24270
|
-
(function() {
|
|
24271
|
-
function NoopLoggerProvider4() {
|
|
24272
|
-
}
|
|
24273
|
-
NoopLoggerProvider4.prototype.getLogger = function(_name, _version, _options) {
|
|
24274
|
-
return new NoopLogger3();
|
|
24275
|
-
};
|
|
24276
|
-
return NoopLoggerProvider4;
|
|
24277
|
-
})()
|
|
24278
|
-
);
|
|
24279
|
-
var NOOP_LOGGER_PROVIDER3 = new NoopLoggerProvider3();
|
|
24280
|
-
|
|
24281
|
-
// node_modules/@opentelemetry/api-logs/build/esm/ProxyLogger.js
|
|
24282
|
-
var ProxyLogger3 = (
|
|
24283
|
-
/** @class */
|
|
24284
|
-
(function() {
|
|
24285
|
-
function ProxyLogger4(_provider, name, version, options) {
|
|
24286
|
-
this._provider = _provider;
|
|
24287
|
-
this.name = name;
|
|
24288
|
-
this.version = version;
|
|
24289
|
-
this.options = options;
|
|
24290
|
-
}
|
|
24291
|
-
ProxyLogger4.prototype.emit = function(logRecord) {
|
|
24292
|
-
this._getLogger().emit(logRecord);
|
|
24293
|
-
};
|
|
24294
|
-
ProxyLogger4.prototype._getLogger = function() {
|
|
24295
|
-
if (this._delegate) {
|
|
24296
|
-
return this._delegate;
|
|
24297
|
-
}
|
|
24298
|
-
var logger = this._provider.getDelegateLogger(this.name, this.version, this.options);
|
|
24299
|
-
if (!logger) {
|
|
24300
|
-
return NOOP_LOGGER3;
|
|
24301
|
-
}
|
|
24302
|
-
this._delegate = logger;
|
|
24303
|
-
return this._delegate;
|
|
24304
|
-
};
|
|
24305
|
-
return ProxyLogger4;
|
|
24306
|
-
})()
|
|
24307
|
-
);
|
|
24308
|
-
|
|
24309
|
-
// node_modules/@opentelemetry/api-logs/build/esm/ProxyLoggerProvider.js
|
|
24310
|
-
var ProxyLoggerProvider3 = (
|
|
24311
|
-
/** @class */
|
|
24312
|
-
(function() {
|
|
24313
|
-
function ProxyLoggerProvider4() {
|
|
24314
|
-
}
|
|
24315
|
-
ProxyLoggerProvider4.prototype.getLogger = function(name, version, options) {
|
|
24316
|
-
var _a4;
|
|
24317
|
-
return (_a4 = this.getDelegateLogger(name, version, options)) !== null && _a4 !== void 0 ? _a4 : new ProxyLogger3(this, name, version, options);
|
|
24318
|
-
};
|
|
24319
|
-
ProxyLoggerProvider4.prototype.getDelegate = function() {
|
|
24320
|
-
var _a4;
|
|
24321
|
-
return (_a4 = this._delegate) !== null && _a4 !== void 0 ? _a4 : NOOP_LOGGER_PROVIDER3;
|
|
24322
|
-
};
|
|
24323
|
-
ProxyLoggerProvider4.prototype.setDelegate = function(delegate) {
|
|
24324
|
-
this._delegate = delegate;
|
|
24325
|
-
};
|
|
24326
|
-
ProxyLoggerProvider4.prototype.getDelegateLogger = function(name, version, options) {
|
|
24327
|
-
var _a4;
|
|
24328
|
-
return (_a4 = this._delegate) === null || _a4 === void 0 ? void 0 : _a4.getLogger(name, version, options);
|
|
24329
|
-
};
|
|
24330
|
-
return ProxyLoggerProvider4;
|
|
24331
|
-
})()
|
|
24332
|
-
);
|
|
24333
|
-
|
|
24334
|
-
// node_modules/@opentelemetry/api-logs/build/esm/platform/browser/globalThis.js
|
|
24335
|
-
var _globalThis4 = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
24336
|
-
|
|
24337
|
-
// node_modules/@opentelemetry/api-logs/build/esm/internal/global-utils.js
|
|
24338
|
-
var GLOBAL_LOGS_API_KEY3 = /* @__PURE__ */ Symbol.for("io.opentelemetry.js.api.logs");
|
|
24339
|
-
var _global4 = _globalThis4;
|
|
24340
|
-
function makeGetter3(requiredVersion, instance, fallback) {
|
|
24341
|
-
return function(version) {
|
|
24342
|
-
return version === requiredVersion ? instance : fallback;
|
|
24343
|
-
};
|
|
24344
|
-
}
|
|
24345
|
-
var API_BACKWARDS_COMPATIBILITY_VERSION3 = 1;
|
|
24346
|
-
|
|
24347
|
-
// node_modules/@opentelemetry/api-logs/build/esm/api/logs.js
|
|
24348
|
-
var LogsAPI3 = (
|
|
24349
|
-
/** @class */
|
|
24350
|
-
(function() {
|
|
24351
|
-
function LogsAPI4() {
|
|
24352
|
-
this._proxyLoggerProvider = new ProxyLoggerProvider3();
|
|
24353
|
-
}
|
|
24354
|
-
LogsAPI4.getInstance = function() {
|
|
24355
|
-
if (!this._instance) {
|
|
24356
|
-
this._instance = new LogsAPI4();
|
|
24357
|
-
}
|
|
24358
|
-
return this._instance;
|
|
24359
|
-
};
|
|
24360
|
-
LogsAPI4.prototype.setGlobalLoggerProvider = function(provider) {
|
|
24361
|
-
if (_global4[GLOBAL_LOGS_API_KEY3]) {
|
|
24362
|
-
return this.getLoggerProvider();
|
|
24363
|
-
}
|
|
24364
|
-
_global4[GLOBAL_LOGS_API_KEY3] = makeGetter3(API_BACKWARDS_COMPATIBILITY_VERSION3, provider, NOOP_LOGGER_PROVIDER3);
|
|
24365
|
-
this._proxyLoggerProvider.setDelegate(provider);
|
|
24366
|
-
return provider;
|
|
24367
|
-
};
|
|
24368
|
-
LogsAPI4.prototype.getLoggerProvider = function() {
|
|
24369
|
-
var _a4, _b;
|
|
24370
|
-
return (_b = (_a4 = _global4[GLOBAL_LOGS_API_KEY3]) === null || _a4 === void 0 ? void 0 : _a4.call(_global4, API_BACKWARDS_COMPATIBILITY_VERSION3)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider;
|
|
24371
|
-
};
|
|
24372
|
-
LogsAPI4.prototype.getLogger = function(name, version, options) {
|
|
24373
|
-
return this.getLoggerProvider().getLogger(name, version, options);
|
|
24374
|
-
};
|
|
24375
|
-
LogsAPI4.prototype.disable = function() {
|
|
24376
|
-
delete _global4[GLOBAL_LOGS_API_KEY3];
|
|
24377
|
-
this._proxyLoggerProvider = new ProxyLoggerProvider3();
|
|
24378
|
-
};
|
|
24379
|
-
return LogsAPI4;
|
|
24380
|
-
})()
|
|
24381
|
-
);
|
|
24382
|
-
|
|
24383
|
-
// node_modules/@opentelemetry/api-logs/build/esm/index.js
|
|
24384
|
-
var logs3 = LogsAPI3.getInstance();
|
|
24385
|
-
|
|
24386
26168
|
// node_modules/@opentelemetry/instrumentation/build/esm/autoLoaderUtils.js
|
|
24387
26169
|
function enableInstrumentations(instrumentations, tracerProvider, meterProvider, loggerProvider) {
|
|
24388
26170
|
for (var i = 0, j = instrumentations.length; i < j; i++) {
|
|
@@ -24412,7 +26194,7 @@ function registerInstrumentations(options) {
|
|
|
24412
26194
|
var _a4, _b;
|
|
24413
26195
|
var tracerProvider = options.tracerProvider || trace.getTracerProvider();
|
|
24414
26196
|
var meterProvider = options.meterProvider || metrics.getMeterProvider();
|
|
24415
|
-
var loggerProvider = options.loggerProvider ||
|
|
26197
|
+
var loggerProvider = options.loggerProvider || logs.getLoggerProvider();
|
|
24416
26198
|
var instrumentations = (_b = (_a4 = options.instrumentations) === null || _a4 === void 0 ? void 0 : _a4.flat()) !== null && _b !== void 0 ? _b : [];
|
|
24417
26199
|
enableInstrumentations(instrumentations, tracerProvider, meterProvider, loggerProvider);
|
|
24418
26200
|
return function() {
|
|
@@ -24450,7 +26232,7 @@ var InstrumentationAbstract3 = (
|
|
|
24450
26232
|
});
|
|
24451
26233
|
this._tracer = trace.getTracer(instrumentationName, instrumentationVersion);
|
|
24452
26234
|
this._meter = metrics.getMeter(instrumentationName, instrumentationVersion);
|
|
24453
|
-
this._logger =
|
|
26235
|
+
this._logger = logs.getLogger(instrumentationName, instrumentationVersion);
|
|
24454
26236
|
this._updateMetricInstruments();
|
|
24455
26237
|
}
|
|
24456
26238
|
Object.defineProperty(InstrumentationAbstract4.prototype, "meter", {
|
|
@@ -25953,7 +27735,7 @@ function scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule
|
|
|
25953
27735
|
var zoneSymbol = __symbol__;
|
|
25954
27736
|
var isWindowExists = typeof window !== "undefined";
|
|
25955
27737
|
var internalWindow = isWindowExists ? window : void 0;
|
|
25956
|
-
var
|
|
27738
|
+
var _global6 = isWindowExists && internalWindow || globalThis;
|
|
25957
27739
|
var REMOVE_ATTRIBUTE = "removeAttribute";
|
|
25958
27740
|
function bindArguments(args, source) {
|
|
25959
27741
|
for (let i = args.length - 1; i >= 0; i--) {
|
|
@@ -25993,13 +27775,13 @@ function isPropertyWritable(propertyDesc) {
|
|
|
25993
27775
|
return !(typeof propertyDesc.get === "function" && typeof propertyDesc.set === "undefined");
|
|
25994
27776
|
}
|
|
25995
27777
|
var isWebWorker = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope;
|
|
25996
|
-
var isNode2 = !("nw" in
|
|
27778
|
+
var isNode2 = !("nw" in _global6) && typeof _global6.process !== "undefined" && _global6.process.toString() === "[object process]";
|
|
25997
27779
|
var isBrowser = !isNode2 && !isWebWorker && !!(isWindowExists && internalWindow["HTMLElement"]);
|
|
25998
|
-
var isMix = typeof
|
|
27780
|
+
var isMix = typeof _global6.process !== "undefined" && _global6.process.toString() === "[object process]" && !isWebWorker && !!(isWindowExists && internalWindow["HTMLElement"]);
|
|
25999
27781
|
var zoneSymbolEventNames$1 = {};
|
|
26000
27782
|
var enableBeforeunloadSymbol = zoneSymbol("enable_beforeunload");
|
|
26001
27783
|
var wrapFn = function(event) {
|
|
26002
|
-
event = event ||
|
|
27784
|
+
event = event || _global6.event;
|
|
26003
27785
|
if (!event) {
|
|
26004
27786
|
return;
|
|
26005
27787
|
}
|
|
@@ -26007,7 +27789,7 @@ var wrapFn = function(event) {
|
|
|
26007
27789
|
if (!eventNameSymbol) {
|
|
26008
27790
|
eventNameSymbol = zoneSymbolEventNames$1[event.type] = zoneSymbol("ON_PROPERTY" + event.type);
|
|
26009
27791
|
}
|
|
26010
|
-
const target = this || event.target ||
|
|
27792
|
+
const target = this || event.target || _global6;
|
|
26011
27793
|
const listener = target[eventNameSymbol];
|
|
26012
27794
|
let result2;
|
|
26013
27795
|
if (isBrowser && target === internalWindow && event.type === "error") {
|
|
@@ -26029,7 +27811,7 @@ var wrapFn = function(event) {
|
|
|
26029
27811
|
// that behavior behind a global configuration flag. Consumers can enable this
|
|
26030
27812
|
// flag explicitly if they want the `beforeunload` event to be handled as defined
|
|
26031
27813
|
// in the specification.
|
|
26032
|
-
|
|
27814
|
+
_global6[enableBeforeunloadSymbol] && // The IDL event definition is `attribute DOMString returnValue`, so we check whether
|
|
26033
27815
|
// `typeof result` is a string.
|
|
26034
27816
|
typeof result2 === "string"
|
|
26035
27817
|
) {
|
|
@@ -26066,8 +27848,8 @@ function patchProperty(obj, prop, prototype) {
|
|
|
26066
27848
|
}
|
|
26067
27849
|
desc.set = function(newValue) {
|
|
26068
27850
|
let target = this;
|
|
26069
|
-
if (!target && obj ===
|
|
26070
|
-
target =
|
|
27851
|
+
if (!target && obj === _global6) {
|
|
27852
|
+
target = _global6;
|
|
26071
27853
|
}
|
|
26072
27854
|
if (!target) {
|
|
26073
27855
|
return;
|
|
@@ -26084,8 +27866,8 @@ function patchProperty(obj, prop, prototype) {
|
|
|
26084
27866
|
};
|
|
26085
27867
|
desc.get = function() {
|
|
26086
27868
|
let target = this;
|
|
26087
|
-
if (!target && obj ===
|
|
26088
|
-
target =
|
|
27869
|
+
if (!target && obj === _global6) {
|
|
27870
|
+
target = _global6;
|
|
26089
27871
|
}
|
|
26090
27872
|
if (!target) {
|
|
26091
27873
|
return null;
|
|
@@ -26127,11 +27909,11 @@ function patchOnProperties(obj, properties, prototype) {
|
|
|
26127
27909
|
}
|
|
26128
27910
|
var originalInstanceKey = zoneSymbol("originalInstance");
|
|
26129
27911
|
function patchClass(className) {
|
|
26130
|
-
const OriginalClass =
|
|
27912
|
+
const OriginalClass = _global6[className];
|
|
26131
27913
|
if (!OriginalClass)
|
|
26132
27914
|
return;
|
|
26133
|
-
|
|
26134
|
-
|
|
27915
|
+
_global6[zoneSymbol(className)] = OriginalClass;
|
|
27916
|
+
_global6[className] = function() {
|
|
26135
27917
|
const a = bindArguments(arguments, className);
|
|
26136
27918
|
switch (a.length) {
|
|
26137
27919
|
case 0:
|
|
@@ -26153,7 +27935,7 @@ function patchClass(className) {
|
|
|
26153
27935
|
throw new Error("Arg list too long.");
|
|
26154
27936
|
}
|
|
26155
27937
|
};
|
|
26156
|
-
attachOriginToPatched(
|
|
27938
|
+
attachOriginToPatched(_global6[className], OriginalClass);
|
|
26157
27939
|
const instance = new OriginalClass(function() {
|
|
26158
27940
|
});
|
|
26159
27941
|
let prop;
|
|
@@ -26162,11 +27944,11 @@ function patchClass(className) {
|
|
|
26162
27944
|
continue;
|
|
26163
27945
|
(function(prop2) {
|
|
26164
27946
|
if (typeof instance[prop2] === "function") {
|
|
26165
|
-
|
|
27947
|
+
_global6[className].prototype[prop2] = function() {
|
|
26166
27948
|
return this[originalInstanceKey][prop2].apply(this[originalInstanceKey], arguments);
|
|
26167
27949
|
};
|
|
26168
27950
|
} else {
|
|
26169
|
-
ObjectDefineProperty(
|
|
27951
|
+
ObjectDefineProperty(_global6[className].prototype, prop2, {
|
|
26170
27952
|
set: function(fn) {
|
|
26171
27953
|
if (typeof fn === "function") {
|
|
26172
27954
|
this[originalInstanceKey][prop2] = wrapWithCurrentZone(fn, className + "." + prop2);
|
|
@@ -26184,7 +27966,7 @@ function patchClass(className) {
|
|
|
26184
27966
|
}
|
|
26185
27967
|
for (prop in OriginalClass) {
|
|
26186
27968
|
if (prop !== "prototype" && OriginalClass.hasOwnProperty(prop)) {
|
|
26187
|
-
|
|
27969
|
+
_global6[className][prop] = OriginalClass[prop];
|
|
26188
27970
|
}
|
|
26189
27971
|
}
|
|
26190
27972
|
}
|
|
@@ -26295,7 +28077,7 @@ function prepareEventNames(eventName, eventNameToString) {
|
|
|
26295
28077
|
zoneSymbolEventNames[eventName][FALSE_STR] = symbol;
|
|
26296
28078
|
zoneSymbolEventNames[eventName][TRUE_STR] = symbolCapture;
|
|
26297
28079
|
}
|
|
26298
|
-
function patchEventTarget(
|
|
28080
|
+
function patchEventTarget(_global7, api, apis, patchOptions) {
|
|
26299
28081
|
const ADD_EVENT_LISTENER = patchOptions && patchOptions.add || ADD_EVENT_LISTENER_STR;
|
|
26300
28082
|
const REMOVE_EVENT_LISTENER = patchOptions && patchOptions.rm || REMOVE_EVENT_LISTENER_STR;
|
|
26301
28083
|
const LISTENERS_EVENT_LISTENER = patchOptions && patchOptions.listeners || "eventListeners";
|
|
@@ -26327,11 +28109,11 @@ function patchEventTarget(_global6, api, apis, patchOptions) {
|
|
|
26327
28109
|
return error;
|
|
26328
28110
|
};
|
|
26329
28111
|
function globalCallback(context2, event, isCapture) {
|
|
26330
|
-
event = event ||
|
|
28112
|
+
event = event || _global7.event;
|
|
26331
28113
|
if (!event) {
|
|
26332
28114
|
return;
|
|
26333
28115
|
}
|
|
26334
|
-
const target = context2 || event.target ||
|
|
28116
|
+
const target = context2 || event.target || _global7;
|
|
26335
28117
|
const tasks = target[zoneSymbolEventNames[event.type][isCapture ? TRUE_STR : FALSE_STR]];
|
|
26336
28118
|
if (tasks) {
|
|
26337
28119
|
const errors = [];
|
|
@@ -26479,7 +28261,7 @@ function patchEventTarget(_global6, api, apis, patchOptions) {
|
|
|
26479
28261
|
};
|
|
26480
28262
|
const compare = patchOptions2 && patchOptions2.diff ? patchOptions2.diff : compareTaskCallbackVsDelegate;
|
|
26481
28263
|
const unpatchedEvents = Zone[zoneSymbol("UNPATCHED_EVENTS")];
|
|
26482
|
-
const passiveEvents =
|
|
28264
|
+
const passiveEvents = _global7[zoneSymbol("PASSIVE_EVENTS")];
|
|
26483
28265
|
function copyEventListenerOptions(options) {
|
|
26484
28266
|
if (typeof options === "object" && options !== null) {
|
|
26485
28267
|
const newOptions = { ...options };
|
|
@@ -26492,7 +28274,7 @@ function patchEventTarget(_global6, api, apis, patchOptions) {
|
|
|
26492
28274
|
}
|
|
26493
28275
|
const makeAddListener = function(nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget2 = false, prepend = false) {
|
|
26494
28276
|
return function() {
|
|
26495
|
-
const target = this ||
|
|
28277
|
+
const target = this || _global7;
|
|
26496
28278
|
let eventName = arguments[0];
|
|
26497
28279
|
if (patchOptions2 && patchOptions2.transferEventName) {
|
|
26498
28280
|
eventName = patchOptions2.transferEventName(eventName);
|
|
@@ -26616,7 +28398,7 @@ function patchEventTarget(_global6, api, apis, patchOptions) {
|
|
|
26616
28398
|
proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true);
|
|
26617
28399
|
}
|
|
26618
28400
|
proto[REMOVE_EVENT_LISTENER] = function() {
|
|
26619
|
-
const target = this ||
|
|
28401
|
+
const target = this || _global7;
|
|
26620
28402
|
let eventName = arguments[0];
|
|
26621
28403
|
if (patchOptions2 && patchOptions2.transferEventName) {
|
|
26622
28404
|
eventName = patchOptions2.transferEventName(eventName);
|
|
@@ -26661,7 +28443,7 @@ function patchEventTarget(_global6, api, apis, patchOptions) {
|
|
|
26661
28443
|
return nativeRemoveEventListener.apply(this, arguments);
|
|
26662
28444
|
};
|
|
26663
28445
|
proto[LISTENERS_EVENT_LISTENER] = function() {
|
|
26664
|
-
const target = this ||
|
|
28446
|
+
const target = this || _global7;
|
|
26665
28447
|
let eventName = arguments[0];
|
|
26666
28448
|
if (patchOptions2 && patchOptions2.transferEventName) {
|
|
26667
28449
|
eventName = patchOptions2.transferEventName(eventName);
|
|
@@ -26676,7 +28458,7 @@ function patchEventTarget(_global6, api, apis, patchOptions) {
|
|
|
26676
28458
|
return listeners;
|
|
26677
28459
|
};
|
|
26678
28460
|
proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function() {
|
|
26679
|
-
const target = this ||
|
|
28461
|
+
const target = this || _global7;
|
|
26680
28462
|
let eventName = arguments[0];
|
|
26681
28463
|
if (!eventName) {
|
|
26682
28464
|
const keys = Object.keys(target);
|
|
@@ -26882,9 +28664,9 @@ function patchTimer(window2, setName, cancelName, nameSuffix) {
|
|
|
26882
28664
|
}
|
|
26883
28665
|
});
|
|
26884
28666
|
}
|
|
26885
|
-
function patchCustomElements(
|
|
28667
|
+
function patchCustomElements(_global7, api) {
|
|
26886
28668
|
const { isBrowser: isBrowser2, isMix: isMix2 } = api.getGlobalObjects();
|
|
26887
|
-
if (!isBrowser2 && !isMix2 || !
|
|
28669
|
+
if (!isBrowser2 && !isMix2 || !_global7["customElements"] || !("customElements" in _global7)) {
|
|
26888
28670
|
return;
|
|
26889
28671
|
}
|
|
26890
28672
|
const callbacks = [
|
|
@@ -26897,9 +28679,9 @@ function patchCustomElements(_global6, api) {
|
|
|
26897
28679
|
"formResetCallback",
|
|
26898
28680
|
"formStateRestoreCallback"
|
|
26899
28681
|
];
|
|
26900
|
-
api.patchCallbacks(api,
|
|
28682
|
+
api.patchCallbacks(api, _global7.customElements, "customElements", "define", callbacks);
|
|
26901
28683
|
}
|
|
26902
|
-
function eventTargetPatch(
|
|
28684
|
+
function eventTargetPatch(_global7, api) {
|
|
26903
28685
|
if (Zone[api.symbol("patchEventTarget")]) {
|
|
26904
28686
|
return;
|
|
26905
28687
|
}
|
|
@@ -26914,11 +28696,11 @@ function eventTargetPatch(_global6, api) {
|
|
|
26914
28696
|
zoneSymbolEventNames2[eventName][FALSE_STR2] = symbol;
|
|
26915
28697
|
zoneSymbolEventNames2[eventName][TRUE_STR2] = symbolCapture;
|
|
26916
28698
|
}
|
|
26917
|
-
const EVENT_TARGET =
|
|
28699
|
+
const EVENT_TARGET = _global7["EventTarget"];
|
|
26918
28700
|
if (!EVENT_TARGET || !EVENT_TARGET.prototype) {
|
|
26919
28701
|
return;
|
|
26920
28702
|
}
|
|
26921
|
-
api.patchEventTarget(
|
|
28703
|
+
api.patchEventTarget(_global7, api, [EVENT_TARGET && EVENT_TARGET.prototype]);
|
|
26922
28704
|
return true;
|
|
26923
28705
|
}
|
|
26924
28706
|
function patchEvent(global3, api) {
|
|
@@ -26945,14 +28727,14 @@ function patchFilteredProperties(target, onProperties, ignoreProperties, prototy
|
|
|
26945
28727
|
function getOnEventNames(target) {
|
|
26946
28728
|
return Object.getOwnPropertyNames(target).filter((name) => name.startsWith("on") && name.length > 2).map((name) => name.substring(2));
|
|
26947
28729
|
}
|
|
26948
|
-
function propertyDescriptorPatch(api,
|
|
28730
|
+
function propertyDescriptorPatch(api, _global7) {
|
|
26949
28731
|
if (isNode2 && !isMix) {
|
|
26950
28732
|
return;
|
|
26951
28733
|
}
|
|
26952
28734
|
if (Zone[api.symbol("patchEvents")]) {
|
|
26953
28735
|
return;
|
|
26954
28736
|
}
|
|
26955
|
-
const ignoreProperties =
|
|
28737
|
+
const ignoreProperties = _global7["__Zone_ignore_on_properties"];
|
|
26956
28738
|
let patchTargets = [];
|
|
26957
28739
|
if (isBrowser) {
|
|
26958
28740
|
const internalWindow2 = window;
|
|
@@ -26984,7 +28766,7 @@ function propertyDescriptorPatch(api, _global6) {
|
|
|
26984
28766
|
"WebSocket"
|
|
26985
28767
|
]);
|
|
26986
28768
|
for (let i = 0; i < patchTargets.length; i++) {
|
|
26987
|
-
const target =
|
|
28769
|
+
const target = _global7[patchTargets[i]];
|
|
26988
28770
|
target && target.prototype && patchFilteredProperties(target.prototype, getOnEventNames(target.prototype), ignoreProperties);
|
|
26989
28771
|
}
|
|
26990
28772
|
}
|
|
@@ -27766,6 +29548,121 @@ var Zone$1 = loadZone();
|
|
|
27766
29548
|
patchCommon(Zone$1);
|
|
27767
29549
|
patchBrowser(Zone$1);
|
|
27768
29550
|
|
|
29551
|
+
// src/browser/supabase.ts
|
|
29552
|
+
var SUPABASE_DOMAIN = ".supabase.co";
|
|
29553
|
+
function isSupabaseURL(url) {
|
|
29554
|
+
try {
|
|
29555
|
+
const u = new URL(url);
|
|
29556
|
+
return u.hostname.endsWith(SUPABASE_DOMAIN);
|
|
29557
|
+
} catch {
|
|
29558
|
+
return false;
|
|
29559
|
+
}
|
|
29560
|
+
}
|
|
29561
|
+
function parseSupabaseURL(url, method) {
|
|
29562
|
+
let u;
|
|
29563
|
+
try {
|
|
29564
|
+
u = new URL(url);
|
|
29565
|
+
} catch {
|
|
29566
|
+
return null;
|
|
29567
|
+
}
|
|
29568
|
+
if (!u.hostname.endsWith(SUPABASE_DOMAIN)) return null;
|
|
29569
|
+
const ref = u.hostname.replace(SUPABASE_DOMAIN, "");
|
|
29570
|
+
const path = u.pathname;
|
|
29571
|
+
const segments = path.split("/").filter(Boolean);
|
|
29572
|
+
if (segments[0] === "rest" && segments[1] === "v1" && segments[2]) {
|
|
29573
|
+
const table = segments[2];
|
|
29574
|
+
const op = restMethodToOp(method);
|
|
29575
|
+
const select = u.searchParams.get("select") || "*";
|
|
29576
|
+
const filters = extractFilters(u.searchParams);
|
|
29577
|
+
const detail = op === "SELECT" ? `${op} ${select} FROM ${table}` : `${op} ${table}`;
|
|
29578
|
+
return { ref, service: "postgrest", operation: op, table, detail: filters ? `${detail} WHERE ${filters}` : detail };
|
|
29579
|
+
}
|
|
29580
|
+
if (segments[0] === "auth" && segments[1] === "v1") {
|
|
29581
|
+
const action = segments[2] || "session";
|
|
29582
|
+
const op = authActionToOp(action);
|
|
29583
|
+
return { ref, service: "auth", operation: op, table: "", detail: `AUTH ${op}` };
|
|
29584
|
+
}
|
|
29585
|
+
if (segments[0] === "storage" && segments[1] === "v1") {
|
|
29586
|
+
const subCmd = segments[2] || "object";
|
|
29587
|
+
const bucket = segments[3] || "";
|
|
29588
|
+
const filePath = segments.slice(4).join("/");
|
|
29589
|
+
const op = `${method.toUpperCase()} ${subCmd}`;
|
|
29590
|
+
return { ref, service: "storage", operation: op, table: "", detail: bucket ? `STORAGE ${op} ${bucket}/${filePath}` : `STORAGE ${op}` };
|
|
29591
|
+
}
|
|
29592
|
+
if (segments[0] === "realtime") {
|
|
29593
|
+
return { ref, service: "realtime", operation: "subscribe", table: "", detail: "REALTIME subscribe" };
|
|
29594
|
+
}
|
|
29595
|
+
if (segments[0] === "functions" && segments[1] === "v1" && segments[2]) {
|
|
29596
|
+
const fnName = segments[2];
|
|
29597
|
+
return { ref, service: "edge-function", operation: `invoke:${fnName}`, table: "", detail: `EDGE FUNCTION ${fnName}` };
|
|
29598
|
+
}
|
|
29599
|
+
return { ref, service: "unknown", operation: method.toUpperCase(), table: "", detail: `${method.toUpperCase()} ${path}` };
|
|
29600
|
+
}
|
|
29601
|
+
function restMethodToOp(method) {
|
|
29602
|
+
switch (method.toUpperCase()) {
|
|
29603
|
+
case "GET":
|
|
29604
|
+
return "SELECT";
|
|
29605
|
+
case "POST":
|
|
29606
|
+
return "INSERT";
|
|
29607
|
+
case "PATCH":
|
|
29608
|
+
return "UPDATE";
|
|
29609
|
+
case "PUT":
|
|
29610
|
+
return "UPSERT";
|
|
29611
|
+
case "DELETE":
|
|
29612
|
+
return "DELETE";
|
|
29613
|
+
default:
|
|
29614
|
+
return method.toUpperCase();
|
|
29615
|
+
}
|
|
29616
|
+
}
|
|
29617
|
+
function authActionToOp(action) {
|
|
29618
|
+
switch (action) {
|
|
29619
|
+
case "token":
|
|
29620
|
+
return "login";
|
|
29621
|
+
case "signup":
|
|
29622
|
+
return "signup";
|
|
29623
|
+
case "logout":
|
|
29624
|
+
return "logout";
|
|
29625
|
+
case "recover":
|
|
29626
|
+
return "recover";
|
|
29627
|
+
case "magiclink":
|
|
29628
|
+
return "magic_link";
|
|
29629
|
+
case "otp":
|
|
29630
|
+
return "otp";
|
|
29631
|
+
case "user":
|
|
29632
|
+
return "get_user";
|
|
29633
|
+
case "callback":
|
|
29634
|
+
return "oauth_callback";
|
|
29635
|
+
default:
|
|
29636
|
+
return action;
|
|
29637
|
+
}
|
|
29638
|
+
}
|
|
29639
|
+
function extractFilters(params) {
|
|
29640
|
+
const filters = [];
|
|
29641
|
+
for (const [key, value] of params.entries()) {
|
|
29642
|
+
if (key === "select" || key === "apikey" || key === "order" || key === "limit" || key === "offset") continue;
|
|
29643
|
+
const match = value.match(/^(eq|neq|gt|gte|lt|lte|like|ilike|is|in|cs|cd|not)\.(.+)/);
|
|
29644
|
+
if (match) {
|
|
29645
|
+
filters.push(`${key} ${match[1]} ${match[2]}`);
|
|
29646
|
+
}
|
|
29647
|
+
}
|
|
29648
|
+
return filters.join(" AND ");
|
|
29649
|
+
}
|
|
29650
|
+
function enrichSupabaseSpan(span, url, method) {
|
|
29651
|
+
const parsed = parseSupabaseURL(url, method);
|
|
29652
|
+
if (!parsed) return;
|
|
29653
|
+
span.setAttribute("supabase.ref", parsed.ref);
|
|
29654
|
+
span.setAttribute("supabase.service", parsed.service);
|
|
29655
|
+
span.setAttribute("supabase.operation", parsed.operation);
|
|
29656
|
+
span.setAttribute("supabase.detail", parsed.detail);
|
|
29657
|
+
span.setAttribute("peer.service", `supabase.${parsed.service}`);
|
|
29658
|
+
if (parsed.service === "postgrest") {
|
|
29659
|
+
span.setAttribute("db.system", "postgresql");
|
|
29660
|
+
span.setAttribute("db.operation", parsed.operation);
|
|
29661
|
+
if (parsed.table) span.setAttribute("db.sql.table", parsed.table);
|
|
29662
|
+
}
|
|
29663
|
+
span.updateName(`supabase.${parsed.service} ${parsed.detail}`);
|
|
29664
|
+
}
|
|
29665
|
+
|
|
27769
29666
|
// src/core/otel-web-setup.ts
|
|
27770
29667
|
function setupOtelWeb(config) {
|
|
27771
29668
|
const baseUrl = (config.ingestBaseUrl || "https://ingest.obtrace.ai").replace(/\/$/, "");
|
|
@@ -27815,14 +29712,33 @@ function setupOtelWeb(config) {
|
|
|
27815
29712
|
]
|
|
27816
29713
|
});
|
|
27817
29714
|
metrics.setGlobalMeterProvider(meterProvider);
|
|
29715
|
+
const logExporter = new OTLPLogExporter({
|
|
29716
|
+
url: `${baseUrl}/otlp/v1/logs`,
|
|
29717
|
+
headers: authHeaders
|
|
29718
|
+
});
|
|
29719
|
+
const loggerProvider = new LoggerProvider({
|
|
29720
|
+
resource,
|
|
29721
|
+
processors: [new BatchLogRecordProcessor(logExporter)]
|
|
29722
|
+
});
|
|
27818
29723
|
const ingestPattern = new RegExp(`^${baseUrl.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`);
|
|
27819
29724
|
const instrumentations = [];
|
|
29725
|
+
const applySupabaseAttrs = (span, req, _result) => {
|
|
29726
|
+
try {
|
|
29727
|
+
const url = typeof req === "string" ? req : req instanceof URL ? req.href : req?.url || "";
|
|
29728
|
+
const method = req?.method || "GET";
|
|
29729
|
+
if (url && isSupabaseURL(url)) {
|
|
29730
|
+
enrichSupabaseSpan(span, url, method);
|
|
29731
|
+
}
|
|
29732
|
+
} catch {
|
|
29733
|
+
}
|
|
29734
|
+
};
|
|
27820
29735
|
if (config.instrumentGlobalFetch !== false) {
|
|
27821
29736
|
instrumentations.push(
|
|
27822
29737
|
new FetchInstrumentation({
|
|
27823
29738
|
propagateTraceHeaderCorsUrls: /.*/,
|
|
27824
29739
|
ignoreUrls: [ingestPattern],
|
|
27825
|
-
clearTimingResources: true
|
|
29740
|
+
clearTimingResources: true,
|
|
29741
|
+
applyCustomAttributesOnSpan: applySupabaseAttrs
|
|
27826
29742
|
})
|
|
27827
29743
|
);
|
|
27828
29744
|
}
|
|
@@ -27841,8 +29757,8 @@ function setupOtelWeb(config) {
|
|
|
27841
29757
|
tracerProvider,
|
|
27842
29758
|
instrumentations
|
|
27843
29759
|
});
|
|
27844
|
-
const tracer = trace.getTracer("@obtrace/sdk-browser", "2.
|
|
27845
|
-
const meter = metrics.getMeter("@obtrace/sdk-browser", "2.
|
|
29760
|
+
const tracer = trace.getTracer("@obtrace/sdk-browser", "2.4.0");
|
|
29761
|
+
const meter = metrics.getMeter("@obtrace/sdk-browser", "2.4.0");
|
|
27846
29762
|
const forceFlush = async () => {
|
|
27847
29763
|
try {
|
|
27848
29764
|
await tracerProvider.forceFlush();
|
|
@@ -27852,13 +29768,18 @@ function setupOtelWeb(config) {
|
|
|
27852
29768
|
await meterProvider.forceFlush();
|
|
27853
29769
|
} catch {
|
|
27854
29770
|
}
|
|
29771
|
+
try {
|
|
29772
|
+
await loggerProvider.forceFlush();
|
|
29773
|
+
} catch {
|
|
29774
|
+
}
|
|
27855
29775
|
};
|
|
27856
29776
|
const shutdown = async () => {
|
|
27857
29777
|
await forceFlush();
|
|
27858
29778
|
await tracerProvider.shutdown();
|
|
27859
29779
|
await meterProvider.shutdown();
|
|
29780
|
+
await loggerProvider.shutdown();
|
|
27860
29781
|
};
|
|
27861
|
-
return { tracer, meter, shutdown, forceFlush };
|
|
29782
|
+
return { tracer, meter, loggerProvider, shutdown, forceFlush };
|
|
27862
29783
|
}
|
|
27863
29784
|
|
|
27864
29785
|
// src/browser/breadcrumbs.ts
|
|
@@ -27900,65 +29821,93 @@ function installClickBreadcrumbs() {
|
|
|
27900
29821
|
}
|
|
27901
29822
|
|
|
27902
29823
|
// src/browser/errors.ts
|
|
27903
|
-
|
|
29824
|
+
var processing = false;
|
|
29825
|
+
function installBrowserErrorHooks(tracer, logger, sessionId) {
|
|
27904
29826
|
if (typeof window === "undefined") {
|
|
27905
29827
|
return () => void 0;
|
|
27906
29828
|
}
|
|
27907
29829
|
const onError = (ev) => {
|
|
29830
|
+
if (processing) return;
|
|
27908
29831
|
const message = ev.message || "window.error";
|
|
27909
29832
|
addBreadcrumb({ timestamp: Date.now(), category: "error", message, level: "error" });
|
|
27910
29833
|
try {
|
|
29834
|
+
processing = true;
|
|
27911
29835
|
const breadcrumbs = getBreadcrumbs();
|
|
27912
29836
|
const stack = ev.error instanceof Error ? ev.error.stack || "" : "";
|
|
27913
|
-
const
|
|
29837
|
+
const errorType = ev.error?.constructor?.name || "Error";
|
|
29838
|
+
const attrs = {
|
|
29839
|
+
"error.message": message,
|
|
29840
|
+
"error.file": ev.filename || "",
|
|
29841
|
+
"error.line": ev.lineno || 0,
|
|
29842
|
+
"error.column": ev.colno || 0,
|
|
29843
|
+
"error.stack": stack.slice(0, 4096),
|
|
29844
|
+
"error.type": errorType,
|
|
29845
|
+
"breadcrumbs.count": breadcrumbs.length,
|
|
29846
|
+
"breadcrumbs.json": JSON.stringify(breadcrumbs.slice(-20)),
|
|
29847
|
+
...sessionId ? { "session.id": sessionId } : {}
|
|
29848
|
+
};
|
|
29849
|
+
logger.emit({
|
|
29850
|
+
severityNumber: SeverityNumber.ERROR,
|
|
29851
|
+
severityText: "ERROR",
|
|
29852
|
+
body: message,
|
|
27914
29853
|
attributes: {
|
|
27915
|
-
"
|
|
27916
|
-
|
|
27917
|
-
"error.line": ev.lineno || 0,
|
|
27918
|
-
"error.column": ev.colno || 0,
|
|
27919
|
-
"error.stack": stack.slice(0, 4096),
|
|
27920
|
-
"error.type": ev.error?.constructor?.name || "Error",
|
|
27921
|
-
"breadcrumbs.count": breadcrumbs.length,
|
|
27922
|
-
"breadcrumbs.json": JSON.stringify(breadcrumbs.slice(-20)),
|
|
27923
|
-
...sessionId ? { "session.id": sessionId } : {}
|
|
29854
|
+
"log.source": "window.error",
|
|
29855
|
+
...attrs
|
|
27924
29856
|
}
|
|
27925
29857
|
});
|
|
29858
|
+
const span = tracer.startSpan("browser.error", { attributes: attrs });
|
|
27926
29859
|
span.setStatus({ code: SpanStatusCode.ERROR, message });
|
|
27927
29860
|
if (ev.error instanceof Error) {
|
|
27928
29861
|
span.recordException(ev.error);
|
|
27929
29862
|
}
|
|
27930
29863
|
span.end();
|
|
27931
29864
|
} catch {
|
|
29865
|
+
} finally {
|
|
29866
|
+
processing = false;
|
|
27932
29867
|
}
|
|
27933
29868
|
};
|
|
27934
29869
|
const onRejection = (ev) => {
|
|
29870
|
+
if (processing) return;
|
|
27935
29871
|
let reason;
|
|
27936
29872
|
let stack = "";
|
|
29873
|
+
let errorType = "UnhandledRejection";
|
|
27937
29874
|
if (ev.reason instanceof Error) {
|
|
27938
29875
|
reason = `${ev.reason.name}: ${ev.reason.message}`;
|
|
27939
29876
|
stack = ev.reason.stack || "";
|
|
29877
|
+
errorType = ev.reason.constructor?.name || "Error";
|
|
27940
29878
|
} else {
|
|
27941
29879
|
reason = typeof ev.reason === "string" ? ev.reason : JSON.stringify(ev.reason ?? {});
|
|
27942
29880
|
}
|
|
27943
29881
|
addBreadcrumb({ timestamp: Date.now(), category: "error", message: reason, level: "error" });
|
|
27944
29882
|
try {
|
|
29883
|
+
processing = true;
|
|
27945
29884
|
const breadcrumbs = getBreadcrumbs();
|
|
27946
|
-
const
|
|
29885
|
+
const attrs = {
|
|
29886
|
+
"error.message": reason,
|
|
29887
|
+
"error.stack": stack.slice(0, 4096),
|
|
29888
|
+
"error.type": errorType,
|
|
29889
|
+
"breadcrumbs.count": breadcrumbs.length,
|
|
29890
|
+
"breadcrumbs.json": JSON.stringify(breadcrumbs.slice(-20)),
|
|
29891
|
+
...sessionId ? { "session.id": sessionId } : {}
|
|
29892
|
+
};
|
|
29893
|
+
logger.emit({
|
|
29894
|
+
severityNumber: SeverityNumber.ERROR,
|
|
29895
|
+
severityText: "ERROR",
|
|
29896
|
+
body: reason,
|
|
27947
29897
|
attributes: {
|
|
27948
|
-
"
|
|
27949
|
-
|
|
27950
|
-
"error.type": ev.reason?.constructor?.name || "UnhandledRejection",
|
|
27951
|
-
"breadcrumbs.count": breadcrumbs.length,
|
|
27952
|
-
"breadcrumbs.json": JSON.stringify(breadcrumbs.slice(-20)),
|
|
27953
|
-
...sessionId ? { "session.id": sessionId } : {}
|
|
29898
|
+
"log.source": "unhandledrejection",
|
|
29899
|
+
...attrs
|
|
27954
29900
|
}
|
|
27955
29901
|
});
|
|
29902
|
+
const span = tracer.startSpan("browser.unhandledrejection", { attributes: attrs });
|
|
27956
29903
|
span.setStatus({ code: SpanStatusCode.ERROR, message: reason });
|
|
27957
29904
|
if (ev.reason instanceof Error) {
|
|
27958
29905
|
span.recordException(ev.reason);
|
|
27959
29906
|
}
|
|
27960
29907
|
span.end();
|
|
27961
29908
|
} catch {
|
|
29909
|
+
} finally {
|
|
29910
|
+
processing = false;
|
|
27962
29911
|
}
|
|
27963
29912
|
};
|
|
27964
29913
|
window.addEventListener("error", onError);
|
|
@@ -28235,9 +30184,17 @@ var LEVEL_MAP = {
|
|
|
28235
30184
|
warn: "warn",
|
|
28236
30185
|
error: "error"
|
|
28237
30186
|
};
|
|
30187
|
+
var SEVERITY_MAP = {
|
|
30188
|
+
debug: SeverityNumber.DEBUG,
|
|
30189
|
+
log: SeverityNumber.INFO,
|
|
30190
|
+
info: SeverityNumber.INFO,
|
|
30191
|
+
warn: SeverityNumber.WARN,
|
|
30192
|
+
error: SeverityNumber.ERROR
|
|
30193
|
+
};
|
|
28238
30194
|
var patched = false;
|
|
28239
30195
|
var originals = {};
|
|
28240
|
-
|
|
30196
|
+
var emitting = false;
|
|
30197
|
+
function installConsoleCapture(tracer, logger, sessionId) {
|
|
28241
30198
|
if (patched || typeof console === "undefined") return () => {
|
|
28242
30199
|
};
|
|
28243
30200
|
patched = true;
|
|
@@ -28249,7 +30206,9 @@ function installConsoleCapture(tracer, sessionId) {
|
|
|
28249
30206
|
const level = LEVEL_MAP[method];
|
|
28250
30207
|
console[method] = (...args) => {
|
|
28251
30208
|
original(...args);
|
|
30209
|
+
if (emitting) return;
|
|
28252
30210
|
try {
|
|
30211
|
+
emitting = true;
|
|
28253
30212
|
let message;
|
|
28254
30213
|
let attrs = {};
|
|
28255
30214
|
const safeStringify = (v) => {
|
|
@@ -28293,21 +30252,32 @@ function installConsoleCapture(tracer, sessionId) {
|
|
|
28293
30252
|
}
|
|
28294
30253
|
}
|
|
28295
30254
|
addBreadcrumb({ timestamp: Date.now(), category: `console.${method}`, message, level, data: attrs });
|
|
28296
|
-
|
|
28297
|
-
|
|
30255
|
+
logger.emit({
|
|
30256
|
+
severityNumber: SEVERITY_MAP[method] ?? SeverityNumber.INFO,
|
|
30257
|
+
severityText: level.toUpperCase(),
|
|
30258
|
+
body: message.slice(0, 4096),
|
|
28298
30259
|
attributes: {
|
|
28299
|
-
"log.severity": level.toUpperCase(),
|
|
28300
|
-
"log.message": message.slice(0, 1024),
|
|
28301
30260
|
"session.id": sessionId,
|
|
30261
|
+
"log.source": "console",
|
|
28302
30262
|
...attrs
|
|
28303
30263
|
}
|
|
28304
30264
|
});
|
|
28305
30265
|
if (method === "error") {
|
|
30266
|
+
const spanName = isErrorObj || attrs["error.stack"] ? "browser.error" : "browser.console";
|
|
30267
|
+
const span = tracer.startSpan(spanName, {
|
|
30268
|
+
attributes: {
|
|
30269
|
+
"error.message": message.slice(0, 1024),
|
|
30270
|
+
"session.id": sessionId,
|
|
30271
|
+
...attrs
|
|
30272
|
+
}
|
|
30273
|
+
});
|
|
28306
30274
|
span.setStatus({ code: SpanStatusCode.ERROR, message: message.slice(0, 1024) });
|
|
28307
30275
|
if (isErrorObj) span.recordException(firstArg);
|
|
30276
|
+
span.end();
|
|
28308
30277
|
}
|
|
28309
|
-
span.end();
|
|
28310
30278
|
} catch {
|
|
30279
|
+
} finally {
|
|
30280
|
+
emitting = false;
|
|
28311
30281
|
}
|
|
28312
30282
|
};
|
|
28313
30283
|
}
|
|
@@ -28390,14 +30360,19 @@ function installResourceTiming(meter) {
|
|
|
28390
30360
|
};
|
|
28391
30361
|
const gauge = meter.createGauge("browser.resource.duration", { unit: "ms" });
|
|
28392
30362
|
const observer = new PerformanceObserver((list2) => {
|
|
28393
|
-
|
|
28394
|
-
const
|
|
28395
|
-
|
|
28396
|
-
|
|
28397
|
-
|
|
28398
|
-
|
|
28399
|
-
|
|
28400
|
-
|
|
30363
|
+
try {
|
|
30364
|
+
for (const entry of list2.getEntries()) {
|
|
30365
|
+
const res = entry;
|
|
30366
|
+
if (res.duration < 100) continue;
|
|
30367
|
+
const name = typeof res.name === "string" ? res.name : "";
|
|
30368
|
+
const shortName = name.split("?")[0].split("/").pop() || name.slice(0, 80) || "unknown";
|
|
30369
|
+
gauge.record(res.duration, {
|
|
30370
|
+
"resource.type": String(res.initiatorType || "other"),
|
|
30371
|
+
"resource.name": String(shortName),
|
|
30372
|
+
"resource.transfer_size": Number(res.transferSize) || 0
|
|
30373
|
+
});
|
|
30374
|
+
}
|
|
30375
|
+
} catch {
|
|
28401
30376
|
}
|
|
28402
30377
|
});
|
|
28403
30378
|
try {
|
|
@@ -28454,6 +30429,127 @@ function installMemoryTracking(meter) {
|
|
|
28454
30429
|
return () => clearInterval(timer);
|
|
28455
30430
|
}
|
|
28456
30431
|
|
|
30432
|
+
// src/browser/supabase-intercept.ts
|
|
30433
|
+
function installSupabaseFetchInterceptor(tracer, sessionId) {
|
|
30434
|
+
if (typeof window === "undefined" || typeof window.fetch === "undefined") return () => {
|
|
30435
|
+
};
|
|
30436
|
+
const originalFetch = window.fetch;
|
|
30437
|
+
window.fetch = async function(input2, init) {
|
|
30438
|
+
const url = typeof input2 === "string" ? input2 : input2 instanceof URL ? input2.href : input2 instanceof Request ? input2.url : "";
|
|
30439
|
+
if (!url || !isSupabaseURL(url)) {
|
|
30440
|
+
return originalFetch.call(this, input2, init);
|
|
30441
|
+
}
|
|
30442
|
+
const method = init?.method || (input2 instanceof Request ? input2.method : "GET") || "GET";
|
|
30443
|
+
const parsed = parseSupabaseURL(url, method);
|
|
30444
|
+
if (!parsed) {
|
|
30445
|
+
return originalFetch.call(this, input2, init);
|
|
30446
|
+
}
|
|
30447
|
+
const rootSpan = tracer.startSpan(`supabase.${parsed.service} ${parsed.detail}`, {
|
|
30448
|
+
attributes: {
|
|
30449
|
+
"supabase.ref": parsed.ref,
|
|
30450
|
+
"supabase.service": parsed.service,
|
|
30451
|
+
"supabase.operation": parsed.operation,
|
|
30452
|
+
"supabase.detail": parsed.detail,
|
|
30453
|
+
"http.method": method.toUpperCase(),
|
|
30454
|
+
"http.url": url.split("?")[0],
|
|
30455
|
+
"peer.service": `supabase.${parsed.service}`,
|
|
30456
|
+
"session.id": sessionId,
|
|
30457
|
+
...parsed.service === "postgrest" ? {
|
|
30458
|
+
"db.system": "postgresql",
|
|
30459
|
+
"db.operation": parsed.operation,
|
|
30460
|
+
"db.sql.table": parsed.table
|
|
30461
|
+
} : {}
|
|
30462
|
+
}
|
|
30463
|
+
});
|
|
30464
|
+
const rootCtx = trace.setSpan(context.active(), rootSpan);
|
|
30465
|
+
const startMs = performance.now();
|
|
30466
|
+
try {
|
|
30467
|
+
const response = await originalFetch.call(this, input2, init);
|
|
30468
|
+
const durationMs = performance.now() - startMs;
|
|
30469
|
+
rootSpan.setAttribute("http.status_code", response.status);
|
|
30470
|
+
rootSpan.setAttribute("supabase.duration_ms", Math.round(durationMs));
|
|
30471
|
+
context.with(rootCtx, () => {
|
|
30472
|
+
createChildSpans(tracer, parsed, method, response.status, durationMs, sessionId);
|
|
30473
|
+
});
|
|
30474
|
+
if (response.status >= 400) {
|
|
30475
|
+
rootSpan.setStatus({ code: SpanStatusCode.ERROR, message: `HTTP ${response.status}` });
|
|
30476
|
+
addBreadcrumb({ timestamp: Date.now(), category: "supabase", message: `${parsed.detail} \u2192 ${response.status}`, level: "error" });
|
|
30477
|
+
} else {
|
|
30478
|
+
rootSpan.setStatus({ code: SpanStatusCode.OK });
|
|
30479
|
+
addBreadcrumb({ timestamp: Date.now(), category: "supabase", message: `${parsed.detail} \u2192 ${response.status} (${Math.round(durationMs)}ms)`, level: "info" });
|
|
30480
|
+
}
|
|
30481
|
+
rootSpan.end();
|
|
30482
|
+
return response;
|
|
30483
|
+
} catch (err) {
|
|
30484
|
+
rootSpan.setStatus({ code: SpanStatusCode.ERROR, message: err instanceof Error ? err.message : "fetch failed" });
|
|
30485
|
+
if (err instanceof Error) rootSpan.recordException(err);
|
|
30486
|
+
rootSpan.end();
|
|
30487
|
+
addBreadcrumb({ timestamp: Date.now(), category: "supabase", message: `${parsed.detail} \u2192 FAILED`, level: "error" });
|
|
30488
|
+
throw err;
|
|
30489
|
+
}
|
|
30490
|
+
};
|
|
30491
|
+
return () => {
|
|
30492
|
+
window.fetch = originalFetch;
|
|
30493
|
+
};
|
|
30494
|
+
}
|
|
30495
|
+
function createChildSpans(tracer, parsed, method, status, _durationMs, sessionId) {
|
|
30496
|
+
const synth = { "session.id": sessionId, "supabase.ref": parsed.ref, "span.synthetic": "true" };
|
|
30497
|
+
const gatewaySpan = tracer.startSpan("supabase.gateway", {
|
|
30498
|
+
attributes: {
|
|
30499
|
+
...synth,
|
|
30500
|
+
"http.method": method.toUpperCase(),
|
|
30501
|
+
"http.status_code": status,
|
|
30502
|
+
"peer.service": "supabase.kong"
|
|
30503
|
+
}
|
|
30504
|
+
});
|
|
30505
|
+
const gatewayCtx = trace.setSpan(context.active(), gatewaySpan);
|
|
30506
|
+
context.with(gatewayCtx, () => {
|
|
30507
|
+
if (parsed.service === "postgrest") {
|
|
30508
|
+
const dbSpan = tracer.startSpan("supabase.db.query", {
|
|
30509
|
+
attributes: {
|
|
30510
|
+
...synth,
|
|
30511
|
+
"db.system": "postgresql",
|
|
30512
|
+
"db.operation": parsed.operation,
|
|
30513
|
+
"db.sql.table": parsed.table,
|
|
30514
|
+
"db.statement": parsed.detail,
|
|
30515
|
+
"peer.service": "supabase.postgresql"
|
|
30516
|
+
}
|
|
30517
|
+
});
|
|
30518
|
+
if (status >= 400) dbSpan.setStatus({ code: SpanStatusCode.ERROR, message: `HTTP ${status}` });
|
|
30519
|
+
else dbSpan.setStatus({ code: SpanStatusCode.OK });
|
|
30520
|
+
dbSpan.end();
|
|
30521
|
+
}
|
|
30522
|
+
if (parsed.service === "auth") {
|
|
30523
|
+
const authSpan = tracer.startSpan("supabase.auth." + parsed.operation, {
|
|
30524
|
+
attributes: { ...synth, "auth.operation": parsed.operation, "peer.service": "supabase.gotrue" }
|
|
30525
|
+
});
|
|
30526
|
+
if (status >= 400) authSpan.setStatus({ code: SpanStatusCode.ERROR, message: `HTTP ${status}` });
|
|
30527
|
+
else authSpan.setStatus({ code: SpanStatusCode.OK });
|
|
30528
|
+
authSpan.end();
|
|
30529
|
+
}
|
|
30530
|
+
if (parsed.service === "storage") {
|
|
30531
|
+
const storageSpan = tracer.startSpan("supabase.storage." + parsed.operation, {
|
|
30532
|
+
attributes: { ...synth, "storage.operation": parsed.operation, "peer.service": "supabase.storage" }
|
|
30533
|
+
});
|
|
30534
|
+
if (status >= 400) storageSpan.setStatus({ code: SpanStatusCode.ERROR, message: `HTTP ${status}` });
|
|
30535
|
+
else storageSpan.setStatus({ code: SpanStatusCode.OK });
|
|
30536
|
+
storageSpan.end();
|
|
30537
|
+
}
|
|
30538
|
+
if (parsed.service === "edge-function") {
|
|
30539
|
+
const fnName = parsed.operation.replace("invoke:", "");
|
|
30540
|
+
const fnSpan = tracer.startSpan("supabase.function." + fnName, {
|
|
30541
|
+
attributes: { ...synth, "faas.name": fnName, "faas.trigger": "http", "peer.service": "supabase.edge-runtime" }
|
|
30542
|
+
});
|
|
30543
|
+
if (status >= 400) fnSpan.setStatus({ code: SpanStatusCode.ERROR, message: `HTTP ${status}` });
|
|
30544
|
+
else fnSpan.setStatus({ code: SpanStatusCode.OK });
|
|
30545
|
+
fnSpan.end();
|
|
30546
|
+
}
|
|
30547
|
+
});
|
|
30548
|
+
if (status >= 400) gatewaySpan.setStatus({ code: SpanStatusCode.ERROR, message: `HTTP ${status}` });
|
|
30549
|
+
else gatewaySpan.setStatus({ code: SpanStatusCode.OK });
|
|
30550
|
+
gatewaySpan.end();
|
|
30551
|
+
}
|
|
30552
|
+
|
|
28457
30553
|
// src/browser/index.ts
|
|
28458
30554
|
var instances = /* @__PURE__ */ new Set();
|
|
28459
30555
|
var replayBuffers = /* @__PURE__ */ new Set();
|
|
@@ -28558,22 +30654,6 @@ function teardownSharedRrwebRecording() {
|
|
|
28558
30654
|
}
|
|
28559
30655
|
rrwebRecording = false;
|
|
28560
30656
|
}
|
|
28561
|
-
function severityToNumber(level) {
|
|
28562
|
-
switch (level) {
|
|
28563
|
-
case "debug":
|
|
28564
|
-
return 5;
|
|
28565
|
-
case "info":
|
|
28566
|
-
return 9;
|
|
28567
|
-
case "warn":
|
|
28568
|
-
return 13;
|
|
28569
|
-
case "error":
|
|
28570
|
-
return 17;
|
|
28571
|
-
case "fatal":
|
|
28572
|
-
return 21;
|
|
28573
|
-
default:
|
|
28574
|
-
return 9;
|
|
28575
|
-
}
|
|
28576
|
-
}
|
|
28577
30657
|
function userAttrs() {
|
|
28578
30658
|
if (!currentUser) return {};
|
|
28579
30659
|
const attrs = {};
|
|
@@ -28600,6 +30680,7 @@ function initBrowserSDK(config) {
|
|
|
28600
30680
|
const otel = setupOtelWeb({ ...config, tracesSampleRate: sampleRate, sessionId: replay.sessionId });
|
|
28601
30681
|
const tracer = otel.tracer;
|
|
28602
30682
|
const meter = otel.meter;
|
|
30683
|
+
const logger = otel.loggerProvider.getLogger("@obtrace/sdk-browser", "2.4.0");
|
|
28603
30684
|
const client = new ObtraceClient({
|
|
28604
30685
|
...config,
|
|
28605
30686
|
replay: {
|
|
@@ -28640,14 +30721,15 @@ function initBrowserSDK(config) {
|
|
|
28640
30721
|
}).catch(() => {
|
|
28641
30722
|
});
|
|
28642
30723
|
if (config.vitals?.enabled !== false) cleanups.push(installWebVitals(meter, !!config.vitals?.reportAllChanges));
|
|
28643
|
-
cleanups.push(installBrowserErrorHooks(tracer, replay.sessionId));
|
|
30724
|
+
cleanups.push(installBrowserErrorHooks(tracer, logger, replay.sessionId));
|
|
28644
30725
|
cleanups.push(installClickBreadcrumbs());
|
|
28645
30726
|
cleanups.push(installClickTracking(tracer, replay.sessionId));
|
|
28646
30727
|
cleanups.push(installResourceTiming(meter));
|
|
28647
30728
|
cleanups.push(installLongTaskDetection(tracer));
|
|
28648
30729
|
cleanups.push(installMemoryTracking(meter));
|
|
30730
|
+
cleanups.push(installSupabaseFetchInterceptor(tracer, replay.sessionId));
|
|
28649
30731
|
if (config.captureConsole !== false) {
|
|
28650
|
-
cleanups.push(installConsoleCapture(tracer, replay.sessionId));
|
|
30732
|
+
cleanups.push(installConsoleCapture(tracer, logger, replay.sessionId));
|
|
28651
30733
|
}
|
|
28652
30734
|
cleanups.push(installOfflineSupport());
|
|
28653
30735
|
if (shouldReplay && config.replay?.enabled !== false && typeof window !== "undefined") {
|
|
@@ -28694,21 +30776,40 @@ function initBrowserSDK(config) {
|
|
|
28694
30776
|
window.addEventListener("beforeunload", onBeforeUnload);
|
|
28695
30777
|
cleanups.push(() => window.removeEventListener("beforeunload", onBeforeUnload));
|
|
28696
30778
|
}
|
|
30779
|
+
const sevToOtel = {
|
|
30780
|
+
debug: SeverityNumber.DEBUG,
|
|
30781
|
+
info: SeverityNumber.INFO,
|
|
30782
|
+
warn: SeverityNumber.WARN,
|
|
30783
|
+
error: SeverityNumber.ERROR,
|
|
30784
|
+
fatal: SeverityNumber.FATAL
|
|
30785
|
+
};
|
|
28697
30786
|
const log = (level, message, context2) => {
|
|
28698
30787
|
addBreadcrumb({ timestamp: Date.now(), category: "log", message, level: level === "fatal" ? "error" : level });
|
|
28699
|
-
|
|
30788
|
+
logger.emit({
|
|
30789
|
+
severityNumber: sevToOtel[level] ?? SeverityNumber.INFO,
|
|
30790
|
+
severityText: level.toUpperCase(),
|
|
30791
|
+
body: message.slice(0, 4096),
|
|
28700
30792
|
attributes: {
|
|
28701
|
-
"log.severity": level.toUpperCase(),
|
|
28702
|
-
"log.severity_number": severityToNumber(level),
|
|
28703
|
-
"log.message": message,
|
|
28704
30793
|
"session.id": replay.sessionId,
|
|
30794
|
+
"log.source": "sdk",
|
|
28705
30795
|
...userAttrs(),
|
|
28706
30796
|
...context2?.traceId ? { "obtrace.trace_id": context2.traceId } : {},
|
|
28707
30797
|
...context2?.attrs
|
|
28708
30798
|
}
|
|
28709
30799
|
});
|
|
28710
|
-
if (level === "error" || level === "fatal")
|
|
28711
|
-
|
|
30800
|
+
if (level === "error" || level === "fatal") {
|
|
30801
|
+
const span = tracer.startSpan("browser.error", {
|
|
30802
|
+
attributes: {
|
|
30803
|
+
"error.message": message,
|
|
30804
|
+
"session.id": replay.sessionId,
|
|
30805
|
+
...userAttrs(),
|
|
30806
|
+
...context2?.traceId ? { "obtrace.trace_id": context2.traceId } : {},
|
|
30807
|
+
...context2?.attrs
|
|
30808
|
+
}
|
|
30809
|
+
});
|
|
30810
|
+
span.setStatus({ code: SpanStatusCode.ERROR, message });
|
|
30811
|
+
span.end();
|
|
30812
|
+
}
|
|
28712
30813
|
};
|
|
28713
30814
|
const metricFn = (name, value, unit, context2) => {
|
|
28714
30815
|
const gauge = meter.createGauge(name, { unit: unit ?? "1" });
|
|
@@ -28716,11 +30817,26 @@ function initBrowserSDK(config) {
|
|
|
28716
30817
|
};
|
|
28717
30818
|
const captureException = (error, context2) => {
|
|
28718
30819
|
const msg = error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
30820
|
+
const stack = error instanceof Error ? (error.stack || "").slice(0, 4096) : "";
|
|
28719
30821
|
const breadcrumbs = getBreadcrumbs();
|
|
28720
30822
|
addBreadcrumb({ timestamp: Date.now(), category: "error", message: msg, level: "error" });
|
|
30823
|
+
logger.emit({
|
|
30824
|
+
severityNumber: SeverityNumber.ERROR,
|
|
30825
|
+
severityText: "ERROR",
|
|
30826
|
+
body: msg,
|
|
30827
|
+
attributes: {
|
|
30828
|
+
"session.id": replay.sessionId,
|
|
30829
|
+
"log.source": "exception",
|
|
30830
|
+
"error.stack": stack,
|
|
30831
|
+
"error.type": error instanceof Error ? error.name : "Error",
|
|
30832
|
+
...userAttrs(),
|
|
30833
|
+
...context2?.attrs
|
|
30834
|
+
}
|
|
30835
|
+
});
|
|
28721
30836
|
const span = tracer.startSpan("browser.exception", {
|
|
28722
30837
|
attributes: {
|
|
28723
30838
|
"error.message": msg,
|
|
30839
|
+
"error.stack": stack,
|
|
28724
30840
|
"session.id": replay.sessionId,
|
|
28725
30841
|
"breadcrumbs.count": breadcrumbs.length,
|
|
28726
30842
|
"breadcrumbs.json": JSON.stringify(breadcrumbs.slice(-20)),
|