@elastic/opentelemetry-browser 0.1.0 → 0.2.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.
@@ -1,22 +1,17 @@
1
1
  (() => {
2
- // node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.js
3
- var _globalThis = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
2
+ // node_modules/@opentelemetry/api/build/esnext/version.js
3
+ var VERSION = "1.9.1";
4
4
 
5
- // node_modules/@opentelemetry/api/build/esm/version.js
6
- var VERSION = "1.9.0";
7
-
8
- // node_modules/@opentelemetry/api/build/esm/internal/semver.js
5
+ // node_modules/@opentelemetry/api/build/esnext/internal/semver.js
9
6
  var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
10
7
  function _makeCompatibilityCheck(ownVersion) {
11
- var acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
12
- var rejectedVersions = /* @__PURE__ */ new Set();
13
- var myVersionMatch = ownVersion.match(re);
8
+ const acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
9
+ const rejectedVersions = /* @__PURE__ */ new Set();
10
+ const myVersionMatch = ownVersion.match(re);
14
11
  if (!myVersionMatch) {
15
- return function() {
16
- return false;
17
- };
12
+ return () => false;
18
13
  }
19
- var ownVersionParsed = {
14
+ const ownVersionParsed = {
20
15
  major: +myVersionMatch[1],
21
16
  minor: +myVersionMatch[2],
22
17
  patch: +myVersionMatch[3],
@@ -42,11 +37,11 @@
42
37
  if (rejectedVersions.has(globalVersion)) {
43
38
  return false;
44
39
  }
45
- var globalVersionMatch = globalVersion.match(re);
40
+ const globalVersionMatch = globalVersion.match(re);
46
41
  if (!globalVersionMatch) {
47
42
  return _reject(globalVersion);
48
43
  }
49
- var globalVersionParsed = {
44
+ const globalVersionParsed = {
50
45
  major: +globalVersionMatch[1],
51
46
  minor: +globalVersionMatch[2],
52
47
  patch: +globalVersionMatch[3],
@@ -72,129 +67,75 @@
72
67
  }
73
68
  var isCompatible = _makeCompatibilityCheck(VERSION);
74
69
 
75
- // node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
70
+ // node_modules/@opentelemetry/api/build/esnext/internal/global-utils.js
76
71
  var major = VERSION.split(".")[0];
77
- var GLOBAL_OPENTELEMETRY_API_KEY = /* @__PURE__ */ Symbol.for("opentelemetry.js.api." + major);
78
- var _global = _globalThis;
79
- function registerGlobal(type, instance, diag3, allowOverride) {
72
+ var GLOBAL_OPENTELEMETRY_API_KEY = /* @__PURE__ */ Symbol.for(`opentelemetry.js.api.${major}`);
73
+ var _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
74
+ function registerGlobal(type, instance, diag3, allowOverride = false) {
80
75
  var _a;
81
- if (allowOverride === void 0) {
82
- allowOverride = false;
83
- }
84
- var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
76
+ const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
85
77
  version: VERSION
86
78
  };
87
79
  if (!allowOverride && api[type]) {
88
- var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
80
+ const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);
89
81
  diag3.error(err.stack || err.message);
90
82
  return false;
91
83
  }
92
84
  if (api.version !== VERSION) {
93
- var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" + VERSION);
85
+ const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);
94
86
  diag3.error(err.stack || err.message);
95
87
  return false;
96
88
  }
97
89
  api[type] = instance;
98
- diag3.debug("@opentelemetry/api: Registered a global for " + type + " v" + VERSION + ".");
90
+ diag3.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);
99
91
  return true;
100
92
  }
101
93
  function getGlobal(type) {
102
94
  var _a, _b;
103
- var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
95
+ const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
104
96
  if (!globalVersion || !isCompatible(globalVersion)) {
105
97
  return;
106
98
  }
107
99
  return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
108
100
  }
109
101
  function unregisterGlobal(type, diag3) {
110
- diag3.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION + ".");
111
- var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
102
+ diag3.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);
103
+ const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
112
104
  if (api) {
113
105
  delete api[type];
114
106
  }
115
107
  }
116
108
 
117
- // node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
118
- var __read = function(o2, n2) {
119
- var m2 = typeof Symbol === "function" && o2[Symbol.iterator];
120
- if (!m2) return o2;
121
- var i2 = m2.call(o2), r2, ar = [], e2;
122
- try {
123
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done) ar.push(r2.value);
124
- } catch (error) {
125
- e2 = { error };
126
- } finally {
127
- try {
128
- if (r2 && !r2.done && (m2 = i2["return"])) m2.call(i2);
129
- } finally {
130
- if (e2) throw e2.error;
131
- }
109
+ // node_modules/@opentelemetry/api/build/esnext/diag/ComponentLogger.js
110
+ var DiagComponentLogger = class {
111
+ constructor(props) {
112
+ this._namespace = props.namespace || "DiagComponentLogger";
132
113
  }
133
- return ar;
134
- };
135
- var __spreadArray = function(to, from, pack) {
136
- if (pack || arguments.length === 2) for (var i2 = 0, l2 = from.length, ar; i2 < l2; i2++) {
137
- if (ar || !(i2 in from)) {
138
- if (!ar) ar = Array.prototype.slice.call(from, 0, i2);
139
- ar[i2] = from[i2];
140
- }
114
+ debug(...args) {
115
+ return logProxy("debug", this._namespace, args);
116
+ }
117
+ error(...args) {
118
+ return logProxy("error", this._namespace, args);
119
+ }
120
+ info(...args) {
121
+ return logProxy("info", this._namespace, args);
122
+ }
123
+ warn(...args) {
124
+ return logProxy("warn", this._namespace, args);
125
+ }
126
+ verbose(...args) {
127
+ return logProxy("verbose", this._namespace, args);
141
128
  }
142
- return to.concat(ar || Array.prototype.slice.call(from));
143
129
  };
144
- var DiagComponentLogger = (
145
- /** @class */
146
- (function() {
147
- function DiagComponentLogger2(props) {
148
- this._namespace = props.namespace || "DiagComponentLogger";
149
- }
150
- DiagComponentLogger2.prototype.debug = function() {
151
- var args = [];
152
- for (var _i = 0; _i < arguments.length; _i++) {
153
- args[_i] = arguments[_i];
154
- }
155
- return logProxy("debug", this._namespace, args);
156
- };
157
- DiagComponentLogger2.prototype.error = function() {
158
- var args = [];
159
- for (var _i = 0; _i < arguments.length; _i++) {
160
- args[_i] = arguments[_i];
161
- }
162
- return logProxy("error", this._namespace, args);
163
- };
164
- DiagComponentLogger2.prototype.info = function() {
165
- var args = [];
166
- for (var _i = 0; _i < arguments.length; _i++) {
167
- args[_i] = arguments[_i];
168
- }
169
- return logProxy("info", this._namespace, args);
170
- };
171
- DiagComponentLogger2.prototype.warn = function() {
172
- var args = [];
173
- for (var _i = 0; _i < arguments.length; _i++) {
174
- args[_i] = arguments[_i];
175
- }
176
- return logProxy("warn", this._namespace, args);
177
- };
178
- DiagComponentLogger2.prototype.verbose = function() {
179
- var args = [];
180
- for (var _i = 0; _i < arguments.length; _i++) {
181
- args[_i] = arguments[_i];
182
- }
183
- return logProxy("verbose", this._namespace, args);
184
- };
185
- return DiagComponentLogger2;
186
- })()
187
- );
188
130
  function logProxy(funcName, namespace, args) {
189
- var logger3 = getGlobal("diag");
131
+ const logger3 = getGlobal("diag");
190
132
  if (!logger3) {
191
133
  return;
192
134
  }
193
- args.unshift(namespace);
194
- return logger3[funcName].apply(logger3, __spreadArray([], __read(args), false));
135
+ return logger3[funcName](namespace, ...args);
195
136
  }
196
137
 
197
- // node_modules/@opentelemetry/api/build/esm/diag/types.js
138
+ // node_modules/@opentelemetry/api/build/esnext/diag/types.js
198
139
  var DiagLogLevel;
199
140
  (function(DiagLogLevel2) {
200
141
  DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
@@ -206,7 +147,7 @@
206
147
  DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL";
207
148
  })(DiagLogLevel || (DiagLogLevel = {}));
208
149
 
209
- // node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
150
+ // node_modules/@opentelemetry/api/build/esnext/diag/internal/logLevelLogger.js
210
151
  function createLogLevelDiagLogger(maxLevel, logger3) {
211
152
  if (maxLevel < DiagLogLevel.NONE) {
212
153
  maxLevel = DiagLogLevel.NONE;
@@ -215,7 +156,7 @@
215
156
  }
216
157
  logger3 = logger3 || {};
217
158
  function _filterFunc(funcName, theLevel) {
218
- var theFunc = logger3[funcName];
159
+ const theFunc = logger3[funcName];
219
160
  if (typeof theFunc === "function" && maxLevel >= theLevel) {
220
161
  return theFunc.bind(logger3);
221
162
  }
@@ -231,390 +172,239 @@
231
172
  };
232
173
  }
233
174
 
234
- // node_modules/@opentelemetry/api/build/esm/api/diag.js
235
- var __read2 = function(o2, n2) {
236
- var m2 = typeof Symbol === "function" && o2[Symbol.iterator];
237
- if (!m2) return o2;
238
- var i2 = m2.call(o2), r2, ar = [], e2;
239
- try {
240
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done) ar.push(r2.value);
241
- } catch (error) {
242
- e2 = { error };
243
- } finally {
244
- try {
245
- if (r2 && !r2.done && (m2 = i2["return"])) m2.call(i2);
246
- } finally {
247
- if (e2) throw e2.error;
175
+ // node_modules/@opentelemetry/api/build/esnext/api/diag.js
176
+ var API_NAME = "diag";
177
+ var DiagAPI = class _DiagAPI {
178
+ /** Get the singleton instance of the DiagAPI API */
179
+ static instance() {
180
+ if (!this._instance) {
181
+ this._instance = new _DiagAPI();
248
182
  }
183
+ return this._instance;
249
184
  }
250
- return ar;
251
- };
252
- var __spreadArray2 = function(to, from, pack) {
253
- if (pack || arguments.length === 2) for (var i2 = 0, l2 = from.length, ar; i2 < l2; i2++) {
254
- if (ar || !(i2 in from)) {
255
- if (!ar) ar = Array.prototype.slice.call(from, 0, i2);
256
- ar[i2] = from[i2];
185
+ /**
186
+ * Private internal constructor
187
+ * @private
188
+ */
189
+ constructor() {
190
+ function _logProxy(funcName) {
191
+ return function(...args) {
192
+ const logger3 = getGlobal("diag");
193
+ if (!logger3)
194
+ return;
195
+ return logger3[funcName](...args);
196
+ };
257
197
  }
258
- }
259
- return to.concat(ar || Array.prototype.slice.call(from));
260
- };
261
- var API_NAME = "diag";
262
- var DiagAPI = (
263
- /** @class */
264
- (function() {
265
- function DiagAPI2() {
266
- function _logProxy(funcName) {
267
- return function() {
268
- var args = [];
269
- for (var _i = 0; _i < arguments.length; _i++) {
270
- args[_i] = arguments[_i];
271
- }
272
- var logger3 = getGlobal("diag");
273
- if (!logger3)
274
- return;
275
- return logger3[funcName].apply(logger3, __spreadArray2([], __read2(args), false));
198
+ const self2 = this;
199
+ const setLogger = (logger3, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {
200
+ var _a, _b, _c;
201
+ if (logger3 === self2) {
202
+ const err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
203
+ self2.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
204
+ return false;
205
+ }
206
+ if (typeof optionsOrLogLevel === "number") {
207
+ optionsOrLogLevel = {
208
+ logLevel: optionsOrLogLevel
276
209
  };
277
210
  }
278
- var self2 = this;
279
- var setLogger = function(logger3, optionsOrLogLevel) {
280
- var _a, _b, _c;
281
- if (optionsOrLogLevel === void 0) {
282
- optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
283
- }
284
- if (logger3 === self2) {
285
- var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
286
- self2.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
287
- return false;
288
- }
289
- if (typeof optionsOrLogLevel === "number") {
290
- optionsOrLogLevel = {
291
- logLevel: optionsOrLogLevel
292
- };
293
- }
294
- var oldLogger = getGlobal("diag");
295
- var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger3);
296
- if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
297
- var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
298
- oldLogger.warn("Current logger will be overwritten from " + stack);
299
- newLogger.warn("Current logger will overwrite one already registered from " + stack);
300
- }
301
- return registerGlobal("diag", newLogger, self2, true);
302
- };
303
- self2.setLogger = setLogger;
304
- self2.disable = function() {
305
- unregisterGlobal(API_NAME, self2);
306
- };
307
- self2.createComponentLogger = function(options) {
308
- return new DiagComponentLogger(options);
309
- };
310
- self2.verbose = _logProxy("verbose");
311
- self2.debug = _logProxy("debug");
312
- self2.info = _logProxy("info");
313
- self2.warn = _logProxy("warn");
314
- self2.error = _logProxy("error");
315
- }
316
- DiagAPI2.instance = function() {
317
- if (!this._instance) {
318
- this._instance = new DiagAPI2();
211
+ const oldLogger = getGlobal("diag");
212
+ const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger3);
213
+ if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
214
+ const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
215
+ oldLogger.warn(`Current logger will be overwritten from ${stack}`);
216
+ newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);
319
217
  }
320
- return this._instance;
218
+ return registerGlobal("diag", newLogger, self2, true);
321
219
  };
322
- return DiagAPI2;
323
- })()
324
- );
325
-
326
- // node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js
327
- var __read3 = function(o2, n2) {
328
- var m2 = typeof Symbol === "function" && o2[Symbol.iterator];
329
- if (!m2) return o2;
330
- var i2 = m2.call(o2), r2, ar = [], e2;
331
- try {
332
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done) ar.push(r2.value);
333
- } catch (error) {
334
- e2 = { error };
335
- } finally {
336
- try {
337
- if (r2 && !r2.done && (m2 = i2["return"])) m2.call(i2);
338
- } finally {
339
- if (e2) throw e2.error;
340
- }
220
+ self2.setLogger = setLogger;
221
+ self2.disable = () => {
222
+ unregisterGlobal(API_NAME, self2);
223
+ };
224
+ self2.createComponentLogger = (options) => {
225
+ return new DiagComponentLogger(options);
226
+ };
227
+ self2.verbose = _logProxy("verbose");
228
+ self2.debug = _logProxy("debug");
229
+ self2.info = _logProxy("info");
230
+ self2.warn = _logProxy("warn");
231
+ self2.error = _logProxy("error");
341
232
  }
342
- return ar;
343
233
  };
344
- var __values = function(o2) {
345
- var s2 = typeof Symbol === "function" && Symbol.iterator, m2 = s2 && o2[s2], i2 = 0;
346
- if (m2) return m2.call(o2);
347
- if (o2 && typeof o2.length === "number") return {
348
- next: function() {
349
- if (o2 && i2 >= o2.length) o2 = void 0;
350
- return { value: o2 && o2[i2++], done: !o2 };
351
- }
352
- };
353
- throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined.");
354
- };
355
- var BaggageImpl = (
356
- /** @class */
357
- (function() {
358
- function BaggageImpl2(entries) {
359
- this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map();
234
+
235
+ // node_modules/@opentelemetry/api/build/esnext/baggage/internal/baggage-impl.js
236
+ var BaggageImpl = class _BaggageImpl {
237
+ constructor(entries) {
238
+ this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map();
239
+ }
240
+ getEntry(key) {
241
+ const entry = this._entries.get(key);
242
+ if (!entry) {
243
+ return void 0;
360
244
  }
361
- BaggageImpl2.prototype.getEntry = function(key) {
362
- var entry = this._entries.get(key);
363
- if (!entry) {
364
- return void 0;
365
- }
366
- return Object.assign({}, entry);
367
- };
368
- BaggageImpl2.prototype.getAllEntries = function() {
369
- return Array.from(this._entries.entries()).map(function(_a) {
370
- var _b = __read3(_a, 2), k2 = _b[0], v2 = _b[1];
371
- return [k2, v2];
372
- });
373
- };
374
- BaggageImpl2.prototype.setEntry = function(key, entry) {
375
- var newBaggage = new BaggageImpl2(this._entries);
376
- newBaggage._entries.set(key, entry);
377
- return newBaggage;
378
- };
379
- BaggageImpl2.prototype.removeEntry = function(key) {
380
- var newBaggage = new BaggageImpl2(this._entries);
245
+ return Object.assign({}, entry);
246
+ }
247
+ getAllEntries() {
248
+ return Array.from(this._entries.entries());
249
+ }
250
+ setEntry(key, entry) {
251
+ const newBaggage = new _BaggageImpl(this._entries);
252
+ newBaggage._entries.set(key, entry);
253
+ return newBaggage;
254
+ }
255
+ removeEntry(key) {
256
+ const newBaggage = new _BaggageImpl(this._entries);
257
+ newBaggage._entries.delete(key);
258
+ return newBaggage;
259
+ }
260
+ removeEntries(...keys) {
261
+ const newBaggage = new _BaggageImpl(this._entries);
262
+ for (const key of keys) {
381
263
  newBaggage._entries.delete(key);
382
- return newBaggage;
383
- };
384
- BaggageImpl2.prototype.removeEntries = function() {
385
- var e_1, _a;
386
- var keys = [];
387
- for (var _i = 0; _i < arguments.length; _i++) {
388
- keys[_i] = arguments[_i];
389
- }
390
- var newBaggage = new BaggageImpl2(this._entries);
391
- try {
392
- for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {
393
- var key = keys_1_1.value;
394
- newBaggage._entries.delete(key);
395
- }
396
- } catch (e_1_1) {
397
- e_1 = { error: e_1_1 };
398
- } finally {
399
- try {
400
- if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);
401
- } finally {
402
- if (e_1) throw e_1.error;
403
- }
404
- }
405
- return newBaggage;
406
- };
407
- BaggageImpl2.prototype.clear = function() {
408
- return new BaggageImpl2();
409
- };
410
- return BaggageImpl2;
411
- })()
412
- );
264
+ }
265
+ return newBaggage;
266
+ }
267
+ clear() {
268
+ return new _BaggageImpl();
269
+ }
270
+ };
413
271
 
414
- // node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js
272
+ // node_modules/@opentelemetry/api/build/esnext/baggage/internal/symbol.js
415
273
  var baggageEntryMetadataSymbol = /* @__PURE__ */ Symbol("BaggageEntryMetadata");
416
274
 
417
- // node_modules/@opentelemetry/api/build/esm/baggage/utils.js
275
+ // node_modules/@opentelemetry/api/build/esnext/baggage/utils.js
418
276
  var diag = DiagAPI.instance();
419
- function createBaggage(entries) {
420
- if (entries === void 0) {
421
- entries = {};
422
- }
277
+ function createBaggage(entries = {}) {
423
278
  return new BaggageImpl(new Map(Object.entries(entries)));
424
279
  }
425
280
  function baggageEntryMetadataFromString(str) {
426
281
  if (typeof str !== "string") {
427
- diag.error("Cannot create baggage metadata from unknown type: " + typeof str);
282
+ diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);
428
283
  str = "";
429
284
  }
430
285
  return {
431
286
  __TYPE__: baggageEntryMetadataSymbol,
432
- toString: function() {
287
+ toString() {
433
288
  return str;
434
289
  }
435
290
  };
436
291
  }
437
292
 
438
- // node_modules/@opentelemetry/api/build/esm/context/context.js
293
+ // node_modules/@opentelemetry/api/build/esnext/context/context.js
439
294
  function createContextKey(description) {
440
295
  return Symbol.for(description);
441
296
  }
442
- var BaseContext = (
443
- /** @class */
444
- /* @__PURE__ */ (function() {
445
- function BaseContext2(parentContext) {
446
- var self2 = this;
447
- self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
448
- self2.getValue = function(key) {
449
- return self2._currentContext.get(key);
450
- };
451
- self2.setValue = function(key, value) {
452
- var context2 = new BaseContext2(self2._currentContext);
453
- context2._currentContext.set(key, value);
454
- return context2;
455
- };
456
- self2.deleteValue = function(key) {
457
- var context2 = new BaseContext2(self2._currentContext);
458
- context2._currentContext.delete(key);
459
- return context2;
460
- };
461
- }
462
- return BaseContext2;
463
- })()
464
- );
465
- var ROOT_CONTEXT = new BaseContext();
466
-
467
- // node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js
468
- var __extends = /* @__PURE__ */ (function() {
469
- var extendStatics = function(d2, b2) {
470
- extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
471
- d3.__proto__ = b3;
472
- } || function(d3, b3) {
473
- for (var p2 in b3) if (Object.prototype.hasOwnProperty.call(b3, p2)) d3[p2] = b3[p2];
474
- };
475
- return extendStatics(d2, b2);
476
- };
477
- return function(d2, b2) {
478
- if (typeof b2 !== "function" && b2 !== null)
479
- throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
480
- extendStatics(d2, b2);
481
- function __() {
482
- this.constructor = d2;
483
- }
484
- d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
485
- };
486
- })();
487
- var NoopMeter = (
488
- /** @class */
489
- (function() {
490
- function NoopMeter2() {
491
- }
492
- NoopMeter2.prototype.createGauge = function(_name, _options) {
493
- return NOOP_GAUGE_METRIC;
494
- };
495
- NoopMeter2.prototype.createHistogram = function(_name, _options) {
496
- return NOOP_HISTOGRAM_METRIC;
497
- };
498
- NoopMeter2.prototype.createCounter = function(_name, _options) {
499
- return NOOP_COUNTER_METRIC;
500
- };
501
- NoopMeter2.prototype.createUpDownCounter = function(_name, _options) {
502
- return NOOP_UP_DOWN_COUNTER_METRIC;
503
- };
504
- NoopMeter2.prototype.createObservableGauge = function(_name, _options) {
505
- return NOOP_OBSERVABLE_GAUGE_METRIC;
506
- };
507
- NoopMeter2.prototype.createObservableCounter = function(_name, _options) {
508
- return NOOP_OBSERVABLE_COUNTER_METRIC;
509
- };
510
- NoopMeter2.prototype.createObservableUpDownCounter = function(_name, _options) {
511
- return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
512
- };
513
- NoopMeter2.prototype.addBatchObservableCallback = function(_callback, _observables) {
514
- };
515
- NoopMeter2.prototype.removeBatchObservableCallback = function(_callback) {
516
- };
517
- return NoopMeter2;
518
- })()
519
- );
520
- var NoopMetric = (
521
- /** @class */
522
- /* @__PURE__ */ (function() {
523
- function NoopMetric2() {
524
- }
525
- return NoopMetric2;
526
- })()
527
- );
528
- var NoopCounterMetric = (
529
- /** @class */
530
- (function(_super) {
531
- __extends(NoopCounterMetric2, _super);
532
- function NoopCounterMetric2() {
533
- return _super !== null && _super.apply(this, arguments) || this;
534
- }
535
- NoopCounterMetric2.prototype.add = function(_value, _attributes) {
536
- };
537
- return NoopCounterMetric2;
538
- })(NoopMetric)
539
- );
540
- var NoopUpDownCounterMetric = (
541
- /** @class */
542
- (function(_super) {
543
- __extends(NoopUpDownCounterMetric2, _super);
544
- function NoopUpDownCounterMetric2() {
545
- return _super !== null && _super.apply(this, arguments) || this;
546
- }
547
- NoopUpDownCounterMetric2.prototype.add = function(_value, _attributes) {
548
- };
549
- return NoopUpDownCounterMetric2;
550
- })(NoopMetric)
551
- );
552
- var NoopGaugeMetric = (
553
- /** @class */
554
- (function(_super) {
555
- __extends(NoopGaugeMetric2, _super);
556
- function NoopGaugeMetric2() {
557
- return _super !== null && _super.apply(this, arguments) || this;
558
- }
559
- NoopGaugeMetric2.prototype.record = function(_value, _attributes) {
560
- };
561
- return NoopGaugeMetric2;
562
- })(NoopMetric)
563
- );
564
- var NoopHistogramMetric = (
565
- /** @class */
566
- (function(_super) {
567
- __extends(NoopHistogramMetric2, _super);
568
- function NoopHistogramMetric2() {
569
- return _super !== null && _super.apply(this, arguments) || this;
570
- }
571
- NoopHistogramMetric2.prototype.record = function(_value, _attributes) {
572
- };
573
- return NoopHistogramMetric2;
574
- })(NoopMetric)
575
- );
576
- var NoopObservableMetric = (
577
- /** @class */
578
- (function() {
579
- function NoopObservableMetric2() {
580
- }
581
- NoopObservableMetric2.prototype.addCallback = function(_callback) {
297
+ var BaseContext = class _BaseContext {
298
+ /**
299
+ * Construct a new context which inherits values from an optional parent context.
300
+ *
301
+ * @param parentContext a context from which to inherit values
302
+ */
303
+ constructor(parentContext) {
304
+ const self2 = this;
305
+ self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
306
+ self2.getValue = (key) => self2._currentContext.get(key);
307
+ self2.setValue = (key, value) => {
308
+ const context2 = new _BaseContext(self2._currentContext);
309
+ context2._currentContext.set(key, value);
310
+ return context2;
582
311
  };
583
- NoopObservableMetric2.prototype.removeCallback = function(_callback) {
312
+ self2.deleteValue = (key) => {
313
+ const context2 = new _BaseContext(self2._currentContext);
314
+ context2._currentContext.delete(key);
315
+ return context2;
584
316
  };
585
- return NoopObservableMetric2;
586
- })()
587
- );
588
- var NoopObservableCounterMetric = (
589
- /** @class */
590
- (function(_super) {
591
- __extends(NoopObservableCounterMetric2, _super);
592
- function NoopObservableCounterMetric2() {
593
- return _super !== null && _super.apply(this, arguments) || this;
594
- }
595
- return NoopObservableCounterMetric2;
596
- })(NoopObservableMetric)
597
- );
598
- var NoopObservableGaugeMetric = (
599
- /** @class */
600
- (function(_super) {
601
- __extends(NoopObservableGaugeMetric2, _super);
602
- function NoopObservableGaugeMetric2() {
603
- return _super !== null && _super.apply(this, arguments) || this;
604
- }
605
- return NoopObservableGaugeMetric2;
606
- })(NoopObservableMetric)
607
- );
608
- var NoopObservableUpDownCounterMetric = (
609
- /** @class */
610
- (function(_super) {
611
- __extends(NoopObservableUpDownCounterMetric2, _super);
612
- function NoopObservableUpDownCounterMetric2() {
613
- return _super !== null && _super.apply(this, arguments) || this;
614
- }
615
- return NoopObservableUpDownCounterMetric2;
616
- })(NoopObservableMetric)
617
- );
317
+ }
318
+ };
319
+ var ROOT_CONTEXT = new BaseContext();
320
+
321
+ // node_modules/@opentelemetry/api/build/esnext/metrics/NoopMeter.js
322
+ var NoopMeter = class {
323
+ constructor() {
324
+ }
325
+ /**
326
+ * @see {@link Meter.createGauge}
327
+ */
328
+ createGauge(_name, _options) {
329
+ return NOOP_GAUGE_METRIC;
330
+ }
331
+ /**
332
+ * @see {@link Meter.createHistogram}
333
+ */
334
+ createHistogram(_name, _options) {
335
+ return NOOP_HISTOGRAM_METRIC;
336
+ }
337
+ /**
338
+ * @see {@link Meter.createCounter}
339
+ */
340
+ createCounter(_name, _options) {
341
+ return NOOP_COUNTER_METRIC;
342
+ }
343
+ /**
344
+ * @see {@link Meter.createUpDownCounter}
345
+ */
346
+ createUpDownCounter(_name, _options) {
347
+ return NOOP_UP_DOWN_COUNTER_METRIC;
348
+ }
349
+ /**
350
+ * @see {@link Meter.createObservableGauge}
351
+ */
352
+ createObservableGauge(_name, _options) {
353
+ return NOOP_OBSERVABLE_GAUGE_METRIC;
354
+ }
355
+ /**
356
+ * @see {@link Meter.createObservableCounter}
357
+ */
358
+ createObservableCounter(_name, _options) {
359
+ return NOOP_OBSERVABLE_COUNTER_METRIC;
360
+ }
361
+ /**
362
+ * @see {@link Meter.createObservableUpDownCounter}
363
+ */
364
+ createObservableUpDownCounter(_name, _options) {
365
+ return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
366
+ }
367
+ /**
368
+ * @see {@link Meter.addBatchObservableCallback}
369
+ */
370
+ addBatchObservableCallback(_callback, _observables) {
371
+ }
372
+ /**
373
+ * @see {@link Meter.removeBatchObservableCallback}
374
+ */
375
+ removeBatchObservableCallback(_callback) {
376
+ }
377
+ };
378
+ var NoopMetric = class {
379
+ };
380
+ var NoopCounterMetric = class extends NoopMetric {
381
+ add(_value, _attributes) {
382
+ }
383
+ };
384
+ var NoopUpDownCounterMetric = class extends NoopMetric {
385
+ add(_value, _attributes) {
386
+ }
387
+ };
388
+ var NoopGaugeMetric = class extends NoopMetric {
389
+ record(_value, _attributes) {
390
+ }
391
+ };
392
+ var NoopHistogramMetric = class extends NoopMetric {
393
+ record(_value, _attributes) {
394
+ }
395
+ };
396
+ var NoopObservableMetric = class {
397
+ addCallback(_callback) {
398
+ }
399
+ removeCallback(_callback) {
400
+ }
401
+ };
402
+ var NoopObservableCounterMetric = class extends NoopObservableMetric {
403
+ };
404
+ var NoopObservableGaugeMetric = class extends NoopObservableMetric {
405
+ };
406
+ var NoopObservableUpDownCounterMetric = class extends NoopObservableMetric {
407
+ };
618
408
  var NOOP_METER = new NoopMeter();
619
409
  var NOOP_COUNTER_METRIC = new NoopCounterMetric();
620
410
  var NOOP_GAUGE_METRIC = new NoopGaugeMetric();
@@ -627,22 +417,22 @@
627
417
  return NOOP_METER;
628
418
  }
629
419
 
630
- // node_modules/@opentelemetry/api/build/esm/metrics/Metric.js
420
+ // node_modules/@opentelemetry/api/build/esnext/metrics/Metric.js
631
421
  var ValueType;
632
422
  (function(ValueType2) {
633
423
  ValueType2[ValueType2["INT"] = 0] = "INT";
634
424
  ValueType2[ValueType2["DOUBLE"] = 1] = "DOUBLE";
635
425
  })(ValueType || (ValueType = {}));
636
426
 
637
- // node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js
427
+ // node_modules/@opentelemetry/api/build/esnext/propagation/TextMapPropagator.js
638
428
  var defaultTextMapGetter = {
639
- get: function(carrier, key) {
429
+ get(carrier, key) {
640
430
  if (carrier == null) {
641
431
  return void 0;
642
432
  }
643
433
  return carrier[key];
644
434
  },
645
- keys: function(carrier) {
435
+ keys(carrier) {
646
436
  if (carrier == null) {
647
437
  return [];
648
438
  }
@@ -650,7 +440,7 @@
650
440
  }
651
441
  };
652
442
  var defaultTextMapSetter = {
653
- set: function(carrier, key, value) {
443
+ set(carrier, key, value) {
654
444
  if (carrier == null) {
655
445
  return;
656
446
  }
@@ -658,137 +448,91 @@
658
448
  }
659
449
  };
660
450
 
661
- // node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
662
- var __read4 = function(o2, n2) {
663
- var m2 = typeof Symbol === "function" && o2[Symbol.iterator];
664
- if (!m2) return o2;
665
- var i2 = m2.call(o2), r2, ar = [], e2;
666
- try {
667
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done) ar.push(r2.value);
668
- } catch (error) {
669
- e2 = { error };
670
- } finally {
671
- try {
672
- if (r2 && !r2.done && (m2 = i2["return"])) m2.call(i2);
673
- } finally {
674
- if (e2) throw e2.error;
675
- }
451
+ // node_modules/@opentelemetry/api/build/esnext/context/NoopContextManager.js
452
+ var NoopContextManager = class {
453
+ active() {
454
+ return ROOT_CONTEXT;
676
455
  }
677
- return ar;
678
- };
679
- var __spreadArray3 = function(to, from, pack) {
680
- if (pack || arguments.length === 2) for (var i2 = 0, l2 = from.length, ar; i2 < l2; i2++) {
681
- if (ar || !(i2 in from)) {
682
- if (!ar) ar = Array.prototype.slice.call(from, 0, i2);
683
- ar[i2] = from[i2];
684
- }
456
+ with(_context, fn, thisArg, ...args) {
457
+ return fn.call(thisArg, ...args);
685
458
  }
686
- return to.concat(ar || Array.prototype.slice.call(from));
687
- };
688
- var NoopContextManager = (
689
- /** @class */
690
- (function() {
691
- function NoopContextManager2() {
692
- }
693
- NoopContextManager2.prototype.active = function() {
694
- return ROOT_CONTEXT;
695
- };
696
- NoopContextManager2.prototype.with = function(_context, fn, thisArg) {
697
- var args = [];
698
- for (var _i = 3; _i < arguments.length; _i++) {
699
- args[_i - 3] = arguments[_i];
700
- }
701
- return fn.call.apply(fn, __spreadArray3([thisArg], __read4(args), false));
702
- };
703
- NoopContextManager2.prototype.bind = function(_context, target) {
704
- return target;
705
- };
706
- NoopContextManager2.prototype.enable = function() {
707
- return this;
708
- };
709
- NoopContextManager2.prototype.disable = function() {
710
- return this;
711
- };
712
- return NoopContextManager2;
713
- })()
714
- );
715
-
716
- // node_modules/@opentelemetry/api/build/esm/api/context.js
717
- var __read5 = function(o2, n2) {
718
- var m2 = typeof Symbol === "function" && o2[Symbol.iterator];
719
- if (!m2) return o2;
720
- var i2 = m2.call(o2), r2, ar = [], e2;
721
- try {
722
- while ((n2 === void 0 || n2-- > 0) && !(r2 = i2.next()).done) ar.push(r2.value);
723
- } catch (error) {
724
- e2 = { error };
725
- } finally {
726
- try {
727
- if (r2 && !r2.done && (m2 = i2["return"])) m2.call(i2);
728
- } finally {
729
- if (e2) throw e2.error;
730
- }
459
+ bind(_context, target) {
460
+ return target;
731
461
  }
732
- return ar;
733
- };
734
- var __spreadArray4 = function(to, from, pack) {
735
- if (pack || arguments.length === 2) for (var i2 = 0, l2 = from.length, ar; i2 < l2; i2++) {
736
- if (ar || !(i2 in from)) {
737
- if (!ar) ar = Array.prototype.slice.call(from, 0, i2);
738
- ar[i2] = from[i2];
739
- }
462
+ enable() {
463
+ return this;
464
+ }
465
+ disable() {
466
+ return this;
740
467
  }
741
- return to.concat(ar || Array.prototype.slice.call(from));
742
468
  };
469
+
470
+ // node_modules/@opentelemetry/api/build/esnext/api/context.js
743
471
  var API_NAME2 = "context";
744
472
  var NOOP_CONTEXT_MANAGER = new NoopContextManager();
745
- var ContextAPI = (
746
- /** @class */
747
- (function() {
748
- function ContextAPI2() {
473
+ var ContextAPI = class _ContextAPI {
474
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
475
+ constructor() {
476
+ }
477
+ /** Get the singleton instance of the Context API */
478
+ static getInstance() {
479
+ if (!this._instance) {
480
+ this._instance = new _ContextAPI();
749
481
  }
750
- ContextAPI2.getInstance = function() {
751
- if (!this._instance) {
752
- this._instance = new ContextAPI2();
753
- }
754
- return this._instance;
755
- };
756
- ContextAPI2.prototype.setGlobalContextManager = function(contextManager) {
757
- return registerGlobal(API_NAME2, contextManager, DiagAPI.instance());
758
- };
759
- ContextAPI2.prototype.active = function() {
760
- return this._getContextManager().active();
761
- };
762
- ContextAPI2.prototype.with = function(context2, fn, thisArg) {
763
- var _a;
764
- var args = [];
765
- for (var _i = 3; _i < arguments.length; _i++) {
766
- args[_i - 3] = arguments[_i];
767
- }
768
- return (_a = this._getContextManager()).with.apply(_a, __spreadArray4([context2, fn, thisArg], __read5(args), false));
769
- };
770
- ContextAPI2.prototype.bind = function(context2, target) {
771
- return this._getContextManager().bind(context2, target);
772
- };
773
- ContextAPI2.prototype._getContextManager = function() {
774
- return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
775
- };
776
- ContextAPI2.prototype.disable = function() {
777
- this._getContextManager().disable();
778
- unregisterGlobal(API_NAME2, DiagAPI.instance());
779
- };
780
- return ContextAPI2;
781
- })()
782
- );
482
+ return this._instance;
483
+ }
484
+ /**
485
+ * Set the current context manager.
486
+ *
487
+ * @returns true if the context manager was successfully registered, else false
488
+ */
489
+ setGlobalContextManager(contextManager) {
490
+ return registerGlobal(API_NAME2, contextManager, DiagAPI.instance());
491
+ }
492
+ /**
493
+ * Get the currently active context
494
+ */
495
+ active() {
496
+ return this._getContextManager().active();
497
+ }
498
+ /**
499
+ * Execute a function with an active context
500
+ *
501
+ * @param context context to be active during function execution
502
+ * @param fn function to execute in a context
503
+ * @param thisArg optional receiver to be used for calling fn
504
+ * @param args optional arguments forwarded to fn
505
+ */
506
+ with(context2, fn, thisArg, ...args) {
507
+ return this._getContextManager().with(context2, fn, thisArg, ...args);
508
+ }
509
+ /**
510
+ * Bind a context to a target function or event emitter
511
+ *
512
+ * @param context context to bind to the event emitter or function. Defaults to the currently active context
513
+ * @param target function or event emitter to bind
514
+ */
515
+ bind(context2, target) {
516
+ return this._getContextManager().bind(context2, target);
517
+ }
518
+ _getContextManager() {
519
+ return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
520
+ }
521
+ /** Disable and remove the global context manager */
522
+ disable() {
523
+ this._getContextManager().disable();
524
+ unregisterGlobal(API_NAME2, DiagAPI.instance());
525
+ }
526
+ };
783
527
 
784
- // node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
528
+ // node_modules/@opentelemetry/api/build/esnext/trace/trace_flags.js
785
529
  var TraceFlags;
786
530
  (function(TraceFlags2) {
787
531
  TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
788
532
  TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
789
533
  })(TraceFlags || (TraceFlags = {}));
790
534
 
791
- // node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js
535
+ // node_modules/@opentelemetry/api/build/esnext/trace/invalid-span-constants.js
792
536
  var INVALID_SPANID = "0000000000000000";
793
537
  var INVALID_TRACEID = "00000000000000000000000000000000";
794
538
  var INVALID_SPAN_CONTEXT = {
@@ -797,52 +541,54 @@
797
541
  traceFlags: TraceFlags.NONE
798
542
  };
799
543
 
800
- // node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js
801
- var NonRecordingSpan = (
802
- /** @class */
803
- (function() {
804
- function NonRecordingSpan2(_spanContext) {
805
- if (_spanContext === void 0) {
806
- _spanContext = INVALID_SPAN_CONTEXT;
807
- }
808
- this._spanContext = _spanContext;
809
- }
810
- NonRecordingSpan2.prototype.spanContext = function() {
811
- return this._spanContext;
812
- };
813
- NonRecordingSpan2.prototype.setAttribute = function(_key, _value) {
814
- return this;
815
- };
816
- NonRecordingSpan2.prototype.setAttributes = function(_attributes) {
817
- return this;
818
- };
819
- NonRecordingSpan2.prototype.addEvent = function(_name, _attributes) {
820
- return this;
821
- };
822
- NonRecordingSpan2.prototype.addLink = function(_link) {
823
- return this;
824
- };
825
- NonRecordingSpan2.prototype.addLinks = function(_links) {
826
- return this;
827
- };
828
- NonRecordingSpan2.prototype.setStatus = function(_status) {
829
- return this;
830
- };
831
- NonRecordingSpan2.prototype.updateName = function(_name) {
832
- return this;
833
- };
834
- NonRecordingSpan2.prototype.end = function(_endTime) {
835
- };
836
- NonRecordingSpan2.prototype.isRecording = function() {
837
- return false;
838
- };
839
- NonRecordingSpan2.prototype.recordException = function(_exception, _time) {
840
- };
841
- return NonRecordingSpan2;
842
- })()
843
- );
544
+ // node_modules/@opentelemetry/api/build/esnext/trace/NonRecordingSpan.js
545
+ var NonRecordingSpan = class {
546
+ constructor(spanContext = INVALID_SPAN_CONTEXT) {
547
+ this._spanContext = spanContext;
548
+ }
549
+ // Returns a SpanContext.
550
+ spanContext() {
551
+ return this._spanContext;
552
+ }
553
+ // By default does nothing
554
+ setAttribute(_key, _value) {
555
+ return this;
556
+ }
557
+ // By default does nothing
558
+ setAttributes(_attributes) {
559
+ return this;
560
+ }
561
+ // By default does nothing
562
+ addEvent(_name, _attributes) {
563
+ return this;
564
+ }
565
+ addLink(_link) {
566
+ return this;
567
+ }
568
+ addLinks(_links) {
569
+ return this;
570
+ }
571
+ // By default does nothing
572
+ setStatus(_status) {
573
+ return this;
574
+ }
575
+ // By default does nothing
576
+ updateName(_name) {
577
+ return this;
578
+ }
579
+ // By default does nothing
580
+ end(_endTime) {
581
+ }
582
+ // isRecording always returns false for NonRecordingSpan.
583
+ isRecording() {
584
+ return false;
585
+ }
586
+ // By default does nothing
587
+ recordException(_exception, _time) {
588
+ }
589
+ };
844
590
 
845
- // node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
591
+ // node_modules/@opentelemetry/api/build/esnext/trace/context-utils.js
846
592
  var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
847
593
  function getSpan(context2) {
848
594
  return context2.getValue(SPAN_KEY) || void 0;
@@ -864,14 +610,126 @@
864
610
  return (_a = getSpan(context2)) === null || _a === void 0 ? void 0 : _a.spanContext();
865
611
  }
866
612
 
867
- // node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
868
- var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
869
- var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
613
+ // node_modules/@opentelemetry/api/build/esnext/trace/spancontext-utils.js
614
+ var isHex = new Uint8Array([
615
+ 0,
616
+ 0,
617
+ 0,
618
+ 0,
619
+ 0,
620
+ 0,
621
+ 0,
622
+ 0,
623
+ 0,
624
+ 0,
625
+ 0,
626
+ 0,
627
+ 0,
628
+ 0,
629
+ 0,
630
+ 0,
631
+ 0,
632
+ 0,
633
+ 0,
634
+ 0,
635
+ 0,
636
+ 0,
637
+ 0,
638
+ 0,
639
+ 0,
640
+ 0,
641
+ 0,
642
+ 0,
643
+ 0,
644
+ 0,
645
+ 0,
646
+ 0,
647
+ 0,
648
+ 0,
649
+ 0,
650
+ 0,
651
+ 0,
652
+ 0,
653
+ 0,
654
+ 0,
655
+ 0,
656
+ 0,
657
+ 0,
658
+ 0,
659
+ 0,
660
+ 0,
661
+ 0,
662
+ 0,
663
+ 1,
664
+ 1,
665
+ 1,
666
+ 1,
667
+ 1,
668
+ 1,
669
+ 1,
670
+ 1,
671
+ 1,
672
+ 1,
673
+ 0,
674
+ 0,
675
+ 0,
676
+ 0,
677
+ 0,
678
+ 0,
679
+ 0,
680
+ 1,
681
+ 1,
682
+ 1,
683
+ 1,
684
+ 1,
685
+ 1,
686
+ 0,
687
+ 0,
688
+ 0,
689
+ 0,
690
+ 0,
691
+ 0,
692
+ 0,
693
+ 0,
694
+ 0,
695
+ 0,
696
+ 0,
697
+ 0,
698
+ 0,
699
+ 0,
700
+ 0,
701
+ 0,
702
+ 0,
703
+ 0,
704
+ 0,
705
+ 0,
706
+ 0,
707
+ 0,
708
+ 0,
709
+ 0,
710
+ 0,
711
+ 0,
712
+ 1,
713
+ 1,
714
+ 1,
715
+ 1,
716
+ 1,
717
+ 1
718
+ ]);
719
+ function isValidHex(id, length) {
720
+ if (typeof id !== "string" || id.length !== length)
721
+ return false;
722
+ let r2 = 0;
723
+ for (let i2 = 0; i2 < id.length; i2 += 4) {
724
+ r2 += (isHex[id.charCodeAt(i2)] | 0) + (isHex[id.charCodeAt(i2 + 1)] | 0) + (isHex[id.charCodeAt(i2 + 2)] | 0) + (isHex[id.charCodeAt(i2 + 3)] | 0);
725
+ }
726
+ return r2 === length;
727
+ }
870
728
  function isValidTraceId(traceId) {
871
- return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
729
+ return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;
872
730
  }
873
731
  function isValidSpanId(spanId) {
874
- return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
732
+ return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;
875
733
  }
876
734
  function isSpanContextValid(spanContext) {
877
735
  return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
@@ -880,129 +738,115 @@
880
738
  return new NonRecordingSpan(spanContext);
881
739
  }
882
740
 
883
- // node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
741
+ // node_modules/@opentelemetry/api/build/esnext/trace/NoopTracer.js
884
742
  var contextApi = ContextAPI.getInstance();
885
- var NoopTracer = (
886
- /** @class */
887
- (function() {
888
- function NoopTracer2() {
889
- }
890
- NoopTracer2.prototype.startSpan = function(name, options, context2) {
891
- if (context2 === void 0) {
892
- context2 = contextApi.active();
893
- }
894
- var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
895
- if (root) {
896
- return new NonRecordingSpan();
897
- }
898
- var parentFromContext = context2 && getSpanContext(context2);
899
- if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
900
- return new NonRecordingSpan(parentFromContext);
901
- } else {
902
- return new NonRecordingSpan();
903
- }
904
- };
905
- NoopTracer2.prototype.startActiveSpan = function(name, arg2, arg3, arg4) {
906
- var opts;
907
- var ctx;
908
- var fn;
909
- if (arguments.length < 2) {
910
- return;
911
- } else if (arguments.length === 2) {
912
- fn = arg2;
913
- } else if (arguments.length === 3) {
914
- opts = arg2;
915
- fn = arg3;
916
- } else {
917
- opts = arg2;
918
- ctx = arg3;
919
- fn = arg4;
920
- }
921
- var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
922
- var span = this.startSpan(name, opts, parentContext);
923
- var contextWithSpanSet = setSpan(parentContext, span);
924
- return contextApi.with(contextWithSpanSet, fn, void 0, span);
925
- };
926
- return NoopTracer2;
927
- })()
928
- );
743
+ var NoopTracer = class {
744
+ // startSpan starts a noop span.
745
+ startSpan(name, options, context2 = contextApi.active()) {
746
+ const root = Boolean(options === null || options === void 0 ? void 0 : options.root);
747
+ if (root) {
748
+ return new NonRecordingSpan();
749
+ }
750
+ const parentFromContext = context2 && getSpanContext(context2);
751
+ if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
752
+ return new NonRecordingSpan(parentFromContext);
753
+ } else {
754
+ return new NonRecordingSpan();
755
+ }
756
+ }
757
+ startActiveSpan(name, arg2, arg3, arg4) {
758
+ let opts;
759
+ let ctx;
760
+ let fn;
761
+ if (arguments.length < 2) {
762
+ return;
763
+ } else if (arguments.length === 2) {
764
+ fn = arg2;
765
+ } else if (arguments.length === 3) {
766
+ opts = arg2;
767
+ fn = arg3;
768
+ } else {
769
+ opts = arg2;
770
+ ctx = arg3;
771
+ fn = arg4;
772
+ }
773
+ const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
774
+ const span = this.startSpan(name, opts, parentContext);
775
+ const contextWithSpanSet = setSpan(parentContext, span);
776
+ return contextApi.with(contextWithSpanSet, fn, void 0, span);
777
+ }
778
+ };
929
779
  function isSpanContext(spanContext) {
930
- return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number";
780
+ return spanContext !== null && typeof spanContext === "object" && "spanId" in spanContext && typeof spanContext["spanId"] === "string" && "traceId" in spanContext && typeof spanContext["traceId"] === "string" && "traceFlags" in spanContext && typeof spanContext["traceFlags"] === "number";
931
781
  }
932
782
 
933
- // node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
783
+ // node_modules/@opentelemetry/api/build/esnext/trace/ProxyTracer.js
934
784
  var NOOP_TRACER = new NoopTracer();
935
- var ProxyTracer = (
936
- /** @class */
937
- (function() {
938
- function ProxyTracer2(_provider, name, version, options) {
939
- this._provider = _provider;
940
- this.name = name;
941
- this.version = version;
942
- this.options = options;
943
- }
944
- ProxyTracer2.prototype.startSpan = function(name, options, context2) {
945
- return this._getTracer().startSpan(name, options, context2);
946
- };
947
- ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
948
- var tracer = this._getTracer();
949
- return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
950
- };
951
- ProxyTracer2.prototype._getTracer = function() {
952
- if (this._delegate) {
953
- return this._delegate;
954
- }
955
- var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
956
- if (!tracer) {
957
- return NOOP_TRACER;
958
- }
959
- this._delegate = tracer;
785
+ var ProxyTracer = class {
786
+ constructor(provider, name, version2, options) {
787
+ this._provider = provider;
788
+ this.name = name;
789
+ this.version = version2;
790
+ this.options = options;
791
+ }
792
+ startSpan(name, options, context2) {
793
+ return this._getTracer().startSpan(name, options, context2);
794
+ }
795
+ startActiveSpan(_name, _options, _context, _fn) {
796
+ const tracer = this._getTracer();
797
+ return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
798
+ }
799
+ /**
800
+ * Try to get a tracer from the proxy tracer provider.
801
+ * If the proxy tracer provider has no delegate, return a noop tracer.
802
+ */
803
+ _getTracer() {
804
+ if (this._delegate) {
960
805
  return this._delegate;
961
- };
962
- return ProxyTracer2;
963
- })()
964
- );
965
-
966
- // node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js
967
- var NoopTracerProvider = (
968
- /** @class */
969
- (function() {
970
- function NoopTracerProvider2() {
971
- }
972
- NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) {
973
- return new NoopTracer();
974
- };
975
- return NoopTracerProvider2;
976
- })()
977
- );
806
+ }
807
+ const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
808
+ if (!tracer) {
809
+ return NOOP_TRACER;
810
+ }
811
+ this._delegate = tracer;
812
+ return this._delegate;
813
+ }
814
+ };
815
+
816
+ // node_modules/@opentelemetry/api/build/esnext/trace/NoopTracerProvider.js
817
+ var NoopTracerProvider = class {
818
+ getTracer(_name, _version, _options) {
819
+ return new NoopTracer();
820
+ }
821
+ };
978
822
 
979
- // node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js
823
+ // node_modules/@opentelemetry/api/build/esnext/trace/ProxyTracerProvider.js
980
824
  var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
981
- var ProxyTracerProvider = (
982
- /** @class */
983
- (function() {
984
- function ProxyTracerProvider2() {
985
- }
986
- ProxyTracerProvider2.prototype.getTracer = function(name, version, options) {
987
- var _a;
988
- return (_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options);
989
- };
990
- ProxyTracerProvider2.prototype.getDelegate = function() {
991
- var _a;
992
- return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
993
- };
994
- ProxyTracerProvider2.prototype.setDelegate = function(delegate) {
995
- this._delegate = delegate;
996
- };
997
- ProxyTracerProvider2.prototype.getDelegateTracer = function(name, version, options) {
998
- var _a;
999
- return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
1000
- };
1001
- return ProxyTracerProvider2;
1002
- })()
1003
- );
825
+ var ProxyTracerProvider = class {
826
+ /**
827
+ * Get a {@link ProxyTracer}
828
+ */
829
+ getTracer(name, version2, options) {
830
+ var _a;
831
+ return (_a = this.getDelegateTracer(name, version2, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version2, options);
832
+ }
833
+ getDelegate() {
834
+ var _a;
835
+ return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
836
+ }
837
+ /**
838
+ * Set the delegate tracer provider
839
+ */
840
+ setDelegate(delegate) {
841
+ this._delegate = delegate;
842
+ }
843
+ getDelegateTracer(name, version2, options) {
844
+ var _a;
845
+ return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version2, options);
846
+ }
847
+ };
1004
848
 
1005
- // node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js
849
+ // node_modules/@opentelemetry/api/build/esnext/trace/SamplingResult.js
1006
850
  var SamplingDecision;
1007
851
  (function(SamplingDecision3) {
1008
852
  SamplingDecision3[SamplingDecision3["NOT_RECORD"] = 0] = "NOT_RECORD";
@@ -1010,7 +854,7 @@
1010
854
  SamplingDecision3[SamplingDecision3["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED";
1011
855
  })(SamplingDecision || (SamplingDecision = {}));
1012
856
 
1013
- // node_modules/@opentelemetry/api/build/esm/trace/span_kind.js
857
+ // node_modules/@opentelemetry/api/build/esnext/trace/span_kind.js
1014
858
  var SpanKind;
1015
859
  (function(SpanKind2) {
1016
860
  SpanKind2[SpanKind2["INTERNAL"] = 0] = "INTERNAL";
@@ -1020,7 +864,7 @@
1020
864
  SpanKind2[SpanKind2["CONSUMER"] = 4] = "CONSUMER";
1021
865
  })(SpanKind || (SpanKind = {}));
1022
866
 
1023
- // node_modules/@opentelemetry/api/build/esm/trace/status.js
867
+ // node_modules/@opentelemetry/api/build/esnext/trace/status.js
1024
868
  var SpanStatusCode;
1025
869
  (function(SpanStatusCode2) {
1026
870
  SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET";
@@ -1028,77 +872,76 @@
1028
872
  SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR";
1029
873
  })(SpanStatusCode || (SpanStatusCode = {}));
1030
874
 
1031
- // node_modules/@opentelemetry/api/build/esm/context-api.js
875
+ // node_modules/@opentelemetry/api/build/esnext/context-api.js
1032
876
  var context = ContextAPI.getInstance();
1033
877
 
1034
- // node_modules/@opentelemetry/api/build/esm/diag-api.js
878
+ // node_modules/@opentelemetry/api/build/esnext/diag-api.js
1035
879
  var diag2 = DiagAPI.instance();
1036
880
 
1037
- // node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js
1038
- var NoopMeterProvider = (
1039
- /** @class */
1040
- (function() {
1041
- function NoopMeterProvider2() {
1042
- }
1043
- NoopMeterProvider2.prototype.getMeter = function(_name, _version, _options) {
1044
- return NOOP_METER;
1045
- };
1046
- return NoopMeterProvider2;
1047
- })()
1048
- );
881
+ // node_modules/@opentelemetry/api/build/esnext/metrics/NoopMeterProvider.js
882
+ var NoopMeterProvider = class {
883
+ getMeter(_name, _version, _options) {
884
+ return NOOP_METER;
885
+ }
886
+ };
1049
887
  var NOOP_METER_PROVIDER = new NoopMeterProvider();
1050
888
 
1051
- // node_modules/@opentelemetry/api/build/esm/api/metrics.js
889
+ // node_modules/@opentelemetry/api/build/esnext/api/metrics.js
1052
890
  var API_NAME3 = "metrics";
1053
- var MetricsAPI = (
1054
- /** @class */
1055
- (function() {
1056
- function MetricsAPI2() {
891
+ var MetricsAPI = class _MetricsAPI {
892
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
893
+ constructor() {
894
+ }
895
+ /** Get the singleton instance of the Metrics API */
896
+ static getInstance() {
897
+ if (!this._instance) {
898
+ this._instance = new _MetricsAPI();
1057
899
  }
1058
- MetricsAPI2.getInstance = function() {
1059
- if (!this._instance) {
1060
- this._instance = new MetricsAPI2();
1061
- }
1062
- return this._instance;
1063
- };
1064
- MetricsAPI2.prototype.setGlobalMeterProvider = function(provider) {
1065
- return registerGlobal(API_NAME3, provider, DiagAPI.instance());
1066
- };
1067
- MetricsAPI2.prototype.getMeterProvider = function() {
1068
- return getGlobal(API_NAME3) || NOOP_METER_PROVIDER;
1069
- };
1070
- MetricsAPI2.prototype.getMeter = function(name, version, options) {
1071
- return this.getMeterProvider().getMeter(name, version, options);
1072
- };
1073
- MetricsAPI2.prototype.disable = function() {
1074
- unregisterGlobal(API_NAME3, DiagAPI.instance());
1075
- };
1076
- return MetricsAPI2;
1077
- })()
1078
- );
900
+ return this._instance;
901
+ }
902
+ /**
903
+ * Set the current global meter provider.
904
+ * Returns true if the meter provider was successfully registered, else false.
905
+ */
906
+ setGlobalMeterProvider(provider) {
907
+ return registerGlobal(API_NAME3, provider, DiagAPI.instance());
908
+ }
909
+ /**
910
+ * Returns the global meter provider.
911
+ */
912
+ getMeterProvider() {
913
+ return getGlobal(API_NAME3) || NOOP_METER_PROVIDER;
914
+ }
915
+ /**
916
+ * Returns a meter from the global meter provider.
917
+ */
918
+ getMeter(name, version2, options) {
919
+ return this.getMeterProvider().getMeter(name, version2, options);
920
+ }
921
+ /** Remove the global meter provider */
922
+ disable() {
923
+ unregisterGlobal(API_NAME3, DiagAPI.instance());
924
+ }
925
+ };
1079
926
 
1080
- // node_modules/@opentelemetry/api/build/esm/metrics-api.js
927
+ // node_modules/@opentelemetry/api/build/esnext/metrics-api.js
1081
928
  var metrics = MetricsAPI.getInstance();
1082
929
 
1083
- // node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js
1084
- var NoopTextMapPropagator = (
1085
- /** @class */
1086
- (function() {
1087
- function NoopTextMapPropagator2() {
1088
- }
1089
- NoopTextMapPropagator2.prototype.inject = function(_context, _carrier) {
1090
- };
1091
- NoopTextMapPropagator2.prototype.extract = function(context2, _carrier) {
1092
- return context2;
1093
- };
1094
- NoopTextMapPropagator2.prototype.fields = function() {
1095
- return [];
1096
- };
1097
- return NoopTextMapPropagator2;
1098
- })()
1099
- );
930
+ // node_modules/@opentelemetry/api/build/esnext/propagation/NoopTextMapPropagator.js
931
+ var NoopTextMapPropagator = class {
932
+ /** Noop inject function does nothing */
933
+ inject(_context, _carrier) {
934
+ }
935
+ /** Noop extract function does nothing and returns the input context */
936
+ extract(context2, _carrier) {
937
+ return context2;
938
+ }
939
+ fields() {
940
+ return [];
941
+ }
942
+ };
1100
943
 
1101
- // node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js
944
+ // node_modules/@opentelemetry/api/build/esnext/baggage/context-helpers.js
1102
945
  var BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key");
1103
946
  function getBaggage(context2) {
1104
947
  return context2.getValue(BAGGAGE_KEY) || void 0;
@@ -1113,100 +956,125 @@
1113
956
  return context2.deleteValue(BAGGAGE_KEY);
1114
957
  }
1115
958
 
1116
- // node_modules/@opentelemetry/api/build/esm/api/propagation.js
959
+ // node_modules/@opentelemetry/api/build/esnext/api/propagation.js
1117
960
  var API_NAME4 = "propagation";
1118
961
  var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
1119
- var PropagationAPI = (
1120
- /** @class */
1121
- (function() {
1122
- function PropagationAPI2() {
1123
- this.createBaggage = createBaggage;
1124
- this.getBaggage = getBaggage;
1125
- this.getActiveBaggage = getActiveBaggage;
1126
- this.setBaggage = setBaggage;
1127
- this.deleteBaggage = deleteBaggage;
1128
- }
1129
- PropagationAPI2.getInstance = function() {
1130
- if (!this._instance) {
1131
- this._instance = new PropagationAPI2();
1132
- }
1133
- return this._instance;
1134
- };
1135
- PropagationAPI2.prototype.setGlobalPropagator = function(propagator) {
1136
- return registerGlobal(API_NAME4, propagator, DiagAPI.instance());
1137
- };
1138
- PropagationAPI2.prototype.inject = function(context2, carrier, setter) {
1139
- if (setter === void 0) {
1140
- setter = defaultTextMapSetter;
1141
- }
1142
- return this._getGlobalPropagator().inject(context2, carrier, setter);
1143
- };
1144
- PropagationAPI2.prototype.extract = function(context2, carrier, getter) {
1145
- if (getter === void 0) {
1146
- getter = defaultTextMapGetter;
1147
- }
1148
- return this._getGlobalPropagator().extract(context2, carrier, getter);
1149
- };
1150
- PropagationAPI2.prototype.fields = function() {
1151
- return this._getGlobalPropagator().fields();
1152
- };
1153
- PropagationAPI2.prototype.disable = function() {
1154
- unregisterGlobal(API_NAME4, DiagAPI.instance());
1155
- };
1156
- PropagationAPI2.prototype._getGlobalPropagator = function() {
1157
- return getGlobal(API_NAME4) || NOOP_TEXT_MAP_PROPAGATOR;
1158
- };
1159
- return PropagationAPI2;
1160
- })()
1161
- );
962
+ var PropagationAPI = class _PropagationAPI {
963
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
964
+ constructor() {
965
+ this.createBaggage = createBaggage;
966
+ this.getBaggage = getBaggage;
967
+ this.getActiveBaggage = getActiveBaggage;
968
+ this.setBaggage = setBaggage;
969
+ this.deleteBaggage = deleteBaggage;
970
+ }
971
+ /** Get the singleton instance of the Propagator API */
972
+ static getInstance() {
973
+ if (!this._instance) {
974
+ this._instance = new _PropagationAPI();
975
+ }
976
+ return this._instance;
977
+ }
978
+ /**
979
+ * Set the current propagator.
980
+ *
981
+ * @returns true if the propagator was successfully registered, else false
982
+ */
983
+ setGlobalPropagator(propagator) {
984
+ return registerGlobal(API_NAME4, propagator, DiagAPI.instance());
985
+ }
986
+ /**
987
+ * Inject context into a carrier to be propagated inter-process
988
+ *
989
+ * @param context Context carrying tracing data to inject
990
+ * @param carrier carrier to inject context into
991
+ * @param setter Function used to set values on the carrier
992
+ */
993
+ inject(context2, carrier, setter = defaultTextMapSetter) {
994
+ return this._getGlobalPropagator().inject(context2, carrier, setter);
995
+ }
996
+ /**
997
+ * Extract context from a carrier
998
+ *
999
+ * @param context Context which the newly created context will inherit from
1000
+ * @param carrier Carrier to extract context from
1001
+ * @param getter Function used to extract keys from a carrier
1002
+ */
1003
+ extract(context2, carrier, getter = defaultTextMapGetter) {
1004
+ return this._getGlobalPropagator().extract(context2, carrier, getter);
1005
+ }
1006
+ /**
1007
+ * Return a list of all fields which may be used by the propagator.
1008
+ */
1009
+ fields() {
1010
+ return this._getGlobalPropagator().fields();
1011
+ }
1012
+ /** Remove the global propagator */
1013
+ disable() {
1014
+ unregisterGlobal(API_NAME4, DiagAPI.instance());
1015
+ }
1016
+ _getGlobalPropagator() {
1017
+ return getGlobal(API_NAME4) || NOOP_TEXT_MAP_PROPAGATOR;
1018
+ }
1019
+ };
1162
1020
 
1163
- // node_modules/@opentelemetry/api/build/esm/propagation-api.js
1021
+ // node_modules/@opentelemetry/api/build/esnext/propagation-api.js
1164
1022
  var propagation = PropagationAPI.getInstance();
1165
1023
 
1166
- // node_modules/@opentelemetry/api/build/esm/api/trace.js
1024
+ // node_modules/@opentelemetry/api/build/esnext/api/trace.js
1167
1025
  var API_NAME5 = "trace";
1168
- var TraceAPI = (
1169
- /** @class */
1170
- (function() {
1171
- function TraceAPI2() {
1172
- this._proxyTracerProvider = new ProxyTracerProvider();
1173
- this.wrapSpanContext = wrapSpanContext;
1174
- this.isSpanContextValid = isSpanContextValid;
1175
- this.deleteSpan = deleteSpan;
1176
- this.getSpan = getSpan;
1177
- this.getActiveSpan = getActiveSpan;
1178
- this.getSpanContext = getSpanContext;
1179
- this.setSpan = setSpan;
1180
- this.setSpanContext = setSpanContext;
1181
- }
1182
- TraceAPI2.getInstance = function() {
1183
- if (!this._instance) {
1184
- this._instance = new TraceAPI2();
1185
- }
1186
- return this._instance;
1187
- };
1188
- TraceAPI2.prototype.setGlobalTracerProvider = function(provider) {
1189
- var success = registerGlobal(API_NAME5, this._proxyTracerProvider, DiagAPI.instance());
1190
- if (success) {
1191
- this._proxyTracerProvider.setDelegate(provider);
1192
- }
1193
- return success;
1194
- };
1195
- TraceAPI2.prototype.getTracerProvider = function() {
1196
- return getGlobal(API_NAME5) || this._proxyTracerProvider;
1197
- };
1198
- TraceAPI2.prototype.getTracer = function(name, version) {
1199
- return this.getTracerProvider().getTracer(name, version);
1200
- };
1201
- TraceAPI2.prototype.disable = function() {
1202
- unregisterGlobal(API_NAME5, DiagAPI.instance());
1203
- this._proxyTracerProvider = new ProxyTracerProvider();
1204
- };
1205
- return TraceAPI2;
1206
- })()
1207
- );
1026
+ var TraceAPI = class _TraceAPI {
1027
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
1028
+ constructor() {
1029
+ this._proxyTracerProvider = new ProxyTracerProvider();
1030
+ this.wrapSpanContext = wrapSpanContext;
1031
+ this.isSpanContextValid = isSpanContextValid;
1032
+ this.deleteSpan = deleteSpan;
1033
+ this.getSpan = getSpan;
1034
+ this.getActiveSpan = getActiveSpan;
1035
+ this.getSpanContext = getSpanContext;
1036
+ this.setSpan = setSpan;
1037
+ this.setSpanContext = setSpanContext;
1038
+ }
1039
+ /** Get the singleton instance of the Trace API */
1040
+ static getInstance() {
1041
+ if (!this._instance) {
1042
+ this._instance = new _TraceAPI();
1043
+ }
1044
+ return this._instance;
1045
+ }
1046
+ /**
1047
+ * Set the current global tracer.
1048
+ *
1049
+ * @returns true if the tracer provider was successfully registered, else false
1050
+ */
1051
+ setGlobalTracerProvider(provider) {
1052
+ const success = registerGlobal(API_NAME5, this._proxyTracerProvider, DiagAPI.instance());
1053
+ if (success) {
1054
+ this._proxyTracerProvider.setDelegate(provider);
1055
+ }
1056
+ return success;
1057
+ }
1058
+ /**
1059
+ * Returns the global tracer provider.
1060
+ */
1061
+ getTracerProvider() {
1062
+ return getGlobal(API_NAME5) || this._proxyTracerProvider;
1063
+ }
1064
+ /**
1065
+ * Returns a tracer from the global tracer provider.
1066
+ */
1067
+ getTracer(name, version2) {
1068
+ return this.getTracerProvider().getTracer(name, version2);
1069
+ }
1070
+ /** Remove the global tracer provider */
1071
+ disable() {
1072
+ unregisterGlobal(API_NAME5, DiagAPI.instance());
1073
+ this._proxyTracerProvider = new ProxyTracerProvider();
1074
+ }
1075
+ };
1208
1076
 
1209
- // node_modules/@opentelemetry/api/build/esm/trace-api.js
1077
+ // node_modules/@opentelemetry/api/build/esnext/trace-api.js
1210
1078
  var trace = TraceAPI.getInstance();
1211
1079
 
1212
1080
  // node_modules/@opentelemetry/api-logs/build/esm/types/LogRecord.js
@@ -1243,6 +1111,9 @@
1243
1111
  var NoopLogger = class {
1244
1112
  emit(_logRecord) {
1245
1113
  }
1114
+ enabled() {
1115
+ return false;
1116
+ }
1246
1117
  };
1247
1118
  var NOOP_LOGGER = new NoopLogger();
1248
1119
 
@@ -1250,7 +1121,7 @@
1250
1121
  var GLOBAL_LOGS_API_KEY = /* @__PURE__ */ Symbol.for("io.opentelemetry.js.api.logs");
1251
1122
  var _global2 = globalThis;
1252
1123
  function makeGetter(requiredVersion, instance, fallback) {
1253
- return (version) => version === requiredVersion ? instance : fallback;
1124
+ return (version2) => version2 === requiredVersion ? instance : fallback;
1254
1125
  }
1255
1126
  var API_BACKWARDS_COMPATIBILITY_VERSION = 1;
1256
1127
 
@@ -1264,10 +1135,10 @@
1264
1135
 
1265
1136
  // node_modules/@opentelemetry/api-logs/build/esm/ProxyLogger.js
1266
1137
  var ProxyLogger = class {
1267
- constructor(provider, name, version, options) {
1138
+ constructor(provider, name, version2, options) {
1268
1139
  this._provider = provider;
1269
1140
  this.name = name;
1270
- this.version = version;
1141
+ this.version = version2;
1271
1142
  this.options = options;
1272
1143
  }
1273
1144
  /**
@@ -1278,6 +1149,9 @@
1278
1149
  emit(logRecord) {
1279
1150
  this._getLogger().emit(logRecord);
1280
1151
  }
1152
+ enabled(options) {
1153
+ return this._getLogger().enabled(options);
1154
+ }
1281
1155
  /**
1282
1156
  * Try to get a logger from the proxy logger provider.
1283
1157
  * If the proxy logger provider has no delegate, return a noop logger.
@@ -1297,9 +1171,9 @@
1297
1171
 
1298
1172
  // node_modules/@opentelemetry/api-logs/build/esm/ProxyLoggerProvider.js
1299
1173
  var ProxyLoggerProvider = class {
1300
- getLogger(name, version, options) {
1174
+ getLogger(name, version2, options) {
1301
1175
  var _a;
1302
- return (_a = this._getDelegateLogger(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyLogger(this, name, version, options);
1176
+ return (_a = this._getDelegateLogger(name, version2, options)) !== null && _a !== void 0 ? _a : new ProxyLogger(this, name, version2, options);
1303
1177
  }
1304
1178
  /**
1305
1179
  * Get the delegate logger provider.
@@ -1320,9 +1194,9 @@
1320
1194
  /**
1321
1195
  * @internal
1322
1196
  */
1323
- _getDelegateLogger(name, version, options) {
1197
+ _getDelegateLogger(name, version2, options) {
1324
1198
  var _a;
1325
- return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getLogger(name, version, options);
1199
+ return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getLogger(name, version2, options);
1326
1200
  }
1327
1201
  };
1328
1202
 
@@ -1359,8 +1233,8 @@
1359
1233
  *
1360
1234
  * @returns Logger
1361
1235
  */
1362
- getLogger(name, version, options) {
1363
- return this.getLoggerProvider().getLogger(name, version, options);
1236
+ getLogger(name, version2, options) {
1237
+ return this.getLoggerProvider().getLogger(name, version2, options);
1364
1238
  }
1365
1239
  /** Remove the global logger provider */
1366
1240
  disable() {
@@ -1692,7 +1566,7 @@
1692
1566
  }
1693
1567
 
1694
1568
  // node_modules/@opentelemetry/core/build/esm/version.js
1695
- var VERSION2 = "2.6.0";
1569
+ var VERSION2 = "2.7.0";
1696
1570
 
1697
1571
  // node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js
1698
1572
  var ATTR_ERROR_TYPE = "error.type";
@@ -2069,6 +1943,9 @@
2069
1943
  const keys = Object.keys(two);
2070
1944
  for (let i2 = 0, j2 = keys.length; i2 < j2; i2++) {
2071
1945
  const key = keys[i2];
1946
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
1947
+ continue;
1948
+ }
2072
1949
  result[key] = takeValue(two[key]);
2073
1950
  }
2074
1951
  }
@@ -2081,6 +1958,9 @@
2081
1958
  const keys = Object.keys(two);
2082
1959
  for (let i2 = 0, j2 = keys.length; i2 < j2; i2++) {
2083
1960
  const key = keys[i2];
1961
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
1962
+ continue;
1963
+ }
2084
1964
  const twoValue = two[key];
2085
1965
  if (isPrimitive(twoValue)) {
2086
1966
  if (typeof twoValue === "undefined") {
@@ -2289,225 +2169,72 @@
2289
2169
  code: ExportResultCode.FAILED,
2290
2170
  error: new Error("Concurrent export limit reached")
2291
2171
  });
2292
- return;
2293
- }
2294
- const serializedRequest = this._serializer.serializeRequest(internalRepresentation);
2295
- if (serializedRequest == null) {
2296
- resultCallback({
2297
- code: ExportResultCode.FAILED,
2298
- error: new Error("Nothing to send")
2299
- });
2300
- return;
2301
- }
2302
- this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => {
2303
- if (response.status === "success") {
2304
- if (response.data != null) {
2305
- try {
2306
- this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));
2307
- } catch (e2) {
2308
- this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e2, response.data);
2309
- }
2310
- }
2311
- resultCallback({
2312
- code: ExportResultCode.SUCCESS
2313
- });
2314
- return;
2315
- } else if (response.status === "failure" && response.error) {
2316
- resultCallback({
2317
- code: ExportResultCode.FAILED,
2318
- error: response.error
2319
- });
2320
- return;
2321
- } else if (response.status === "retryable") {
2322
- resultCallback({
2323
- code: ExportResultCode.FAILED,
2324
- error: response.error ?? new OTLPExporterError("Export failed with retryable status")
2325
- });
2326
- } else {
2327
- resultCallback({
2328
- code: ExportResultCode.FAILED,
2329
- error: new OTLPExporterError("Export failed with unknown error")
2330
- });
2331
- }
2332
- }, (reason) => resultCallback({
2333
- code: ExportResultCode.FAILED,
2334
- error: reason
2335
- })));
2336
- }
2337
- forceFlush() {
2338
- return this._promiseQueue.awaitAll();
2339
- }
2340
- async shutdown() {
2341
- this._diagLogger.debug("shutdown started");
2342
- await this.forceFlush();
2343
- this._transport.shutdown();
2344
- }
2345
- };
2346
- function createOtlpExportDelegate(components, settings) {
2347
- return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout);
2348
- }
2349
-
2350
- // node_modules/@opentelemetry/otlp-exporter-base/build/esnext/otlp-network-export-delegate.js
2351
- function createOtlpNetworkExportDelegate(options, serializer, transport) {
2352
- return createOtlpExportDelegate({
2353
- transport,
2354
- serializer,
2355
- promiseHandler: createBoundedQueueExportPromiseHandler(options)
2356
- }, { timeout: options.timeoutMillis });
2357
- }
2358
-
2359
- // node_modules/@opentelemetry/otlp-transformer/build/esm/common/internal.js
2360
- function createResource(resource, encoder) {
2361
- const result = {
2362
- attributes: toAttributes(resource.attributes, encoder),
2363
- droppedAttributesCount: 0
2364
- };
2365
- const schemaUrl = resource.schemaUrl;
2366
- if (schemaUrl && schemaUrl !== "")
2367
- result.schemaUrl = schemaUrl;
2368
- return result;
2369
- }
2370
- function createInstrumentationScope(scope) {
2371
- return {
2372
- name: scope.name,
2373
- version: scope.version
2374
- };
2375
- }
2376
- function toAttributes(attributes, encoder) {
2377
- return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key], encoder));
2378
- }
2379
- function toKeyValue(key, value, encoder) {
2380
- return {
2381
- key,
2382
- value: toAnyValue(value, encoder)
2383
- };
2384
- }
2385
- function toAnyValue(value, encoder) {
2386
- const t2 = typeof value;
2387
- if (t2 === "string")
2388
- return { stringValue: value };
2389
- if (t2 === "number") {
2390
- if (!Number.isInteger(value))
2391
- return { doubleValue: value };
2392
- return { intValue: value };
2393
- }
2394
- if (t2 === "boolean")
2395
- return { boolValue: value };
2396
- if (value instanceof Uint8Array)
2397
- return { bytesValue: encoder.encodeUint8Array(value) };
2398
- if (Array.isArray(value)) {
2399
- const values = new Array(value.length);
2400
- for (let i2 = 0; i2 < value.length; i2++) {
2401
- values[i2] = toAnyValue(value[i2], encoder);
2402
- }
2403
- return { arrayValue: { values } };
2404
- }
2405
- if (t2 === "object" && value != null) {
2406
- const keys = Object.keys(value);
2407
- const values = new Array(keys.length);
2408
- for (let i2 = 0; i2 < keys.length; i2++) {
2409
- values[i2] = {
2410
- key: keys[i2],
2411
- value: toAnyValue(value[keys[i2]], encoder)
2412
- };
2413
- }
2414
- return { kvlistValue: { values } };
2415
- }
2416
- return {};
2417
- }
2418
-
2419
- // node_modules/@opentelemetry/otlp-transformer/build/esm/logs/internal.js
2420
- function createExportLogsServiceRequest(logRecords, encoder) {
2421
- return {
2422
- resourceLogs: logRecordsToResourceLogs(logRecords, encoder)
2423
- };
2424
- }
2425
- function createResourceMap(logRecords) {
2426
- const resourceMap = /* @__PURE__ */ new Map();
2427
- for (const record of logRecords) {
2428
- const { resource, instrumentationScope: { name, version = "", schemaUrl = "" } } = record;
2429
- let ismMap = resourceMap.get(resource);
2430
- if (!ismMap) {
2431
- ismMap = /* @__PURE__ */ new Map();
2432
- resourceMap.set(resource, ismMap);
2433
- }
2434
- const ismKey = `${name}@${version}:${schemaUrl}`;
2435
- let records = ismMap.get(ismKey);
2436
- if (!records) {
2437
- records = [];
2438
- ismMap.set(ismKey, records);
2439
- }
2440
- records.push(record);
2441
- }
2442
- return resourceMap;
2443
- }
2444
- function logRecordsToResourceLogs(logRecords, encoder) {
2445
- const resourceMap = createResourceMap(logRecords);
2446
- return Array.from(resourceMap, ([resource, ismMap]) => {
2447
- const processedResource = createResource(resource, encoder);
2448
- return {
2449
- resource: processedResource,
2450
- scopeLogs: Array.from(ismMap, ([, scopeLogs]) => {
2451
- return {
2452
- scope: createInstrumentationScope(scopeLogs[0].instrumentationScope),
2453
- logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)),
2454
- schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl
2455
- };
2456
- }),
2457
- schemaUrl: processedResource.schemaUrl
2458
- };
2459
- });
2460
- }
2461
- function toLogRecord(log, encoder) {
2462
- return {
2463
- timeUnixNano: encoder.encodeHrTime(log.hrTime),
2464
- observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved),
2465
- severityNumber: toSeverityNumber(log.severityNumber),
2466
- severityText: log.severityText,
2467
- body: toAnyValue(log.body, encoder),
2468
- eventName: log.eventName,
2469
- attributes: toLogAttributes(log.attributes, encoder),
2470
- droppedAttributesCount: log.droppedAttributesCount,
2471
- flags: log.spanContext?.traceFlags,
2472
- traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId),
2473
- spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId)
2474
- };
2475
- }
2476
- function toSeverityNumber(severityNumber) {
2477
- return severityNumber;
2478
- }
2479
- function toLogAttributes(attributes, encoder) {
2480
- return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key], encoder));
2481
- }
2482
-
2483
- // node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js
2484
- function hrTimeToNanos(hrTime2) {
2485
- const NANOSECONDS = BigInt(1e9);
2486
- return BigInt(Math.trunc(hrTime2[0])) * NANOSECONDS + BigInt(Math.trunc(hrTime2[1]));
2487
- }
2488
- function encodeAsString(hrTime2) {
2489
- const nanos = hrTimeToNanos(hrTime2);
2490
- return nanos.toString();
2491
- }
2492
- var encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : hrTimeToNanoseconds;
2493
- function identity(value) {
2494
- return value;
2495
- }
2496
- var JSON_ENCODER = {
2497
- encodeHrTime: encodeTimestamp,
2498
- encodeSpanContext: identity,
2499
- encodeOptionalSpanContext: identity,
2500
- encodeUint8Array: (bytes) => {
2501
- if (typeof Buffer !== "undefined") {
2502
- return Buffer.from(bytes).toString("base64");
2503
- }
2504
- const chars = new Array(bytes.length);
2505
- for (let i2 = 0; i2 < bytes.length; i2++) {
2506
- chars[i2] = String.fromCharCode(bytes[i2]);
2172
+ return;
2507
2173
  }
2508
- return btoa(chars.join(""));
2174
+ const serializedRequest = this._serializer.serializeRequest(internalRepresentation);
2175
+ if (serializedRequest == null) {
2176
+ resultCallback({
2177
+ code: ExportResultCode.FAILED,
2178
+ error: new Error("Nothing to send")
2179
+ });
2180
+ return;
2181
+ }
2182
+ this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => {
2183
+ if (response.status === "success") {
2184
+ if (response.data != null) {
2185
+ try {
2186
+ this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));
2187
+ } catch (e2) {
2188
+ this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e2, response.data);
2189
+ }
2190
+ }
2191
+ resultCallback({
2192
+ code: ExportResultCode.SUCCESS
2193
+ });
2194
+ return;
2195
+ } else if (response.status === "failure" && response.error) {
2196
+ resultCallback({
2197
+ code: ExportResultCode.FAILED,
2198
+ error: response.error
2199
+ });
2200
+ return;
2201
+ } else if (response.status === "retryable") {
2202
+ resultCallback({
2203
+ code: ExportResultCode.FAILED,
2204
+ error: response.error ?? new OTLPExporterError("Export failed with retryable status")
2205
+ });
2206
+ } else {
2207
+ resultCallback({
2208
+ code: ExportResultCode.FAILED,
2209
+ error: new OTLPExporterError("Export failed with unknown error")
2210
+ });
2211
+ }
2212
+ }, (reason) => resultCallback({
2213
+ code: ExportResultCode.FAILED,
2214
+ error: reason
2215
+ })));
2216
+ }
2217
+ forceFlush() {
2218
+ return this._promiseQueue.awaitAll();
2219
+ }
2220
+ async shutdown() {
2221
+ this._diagLogger.debug("shutdown started");
2222
+ await this.forceFlush();
2223
+ this._transport.shutdown();
2509
2224
  }
2510
2225
  };
2226
+ function createOtlpExportDelegate(components, settings) {
2227
+ return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout);
2228
+ }
2229
+
2230
+ // node_modules/@opentelemetry/otlp-exporter-base/build/esnext/otlp-network-export-delegate.js
2231
+ function createOtlpNetworkExportDelegate(options, serializer, transport) {
2232
+ return createOtlpExportDelegate({
2233
+ transport,
2234
+ serializer,
2235
+ promiseHandler: createBoundedQueueExportPromiseHandler(options)
2236
+ }, { timeout: options.timeoutMillis });
2237
+ }
2511
2238
 
2512
2239
  // node_modules/@opentelemetry/sdk-metrics/build/esm/export/AggregationTemporality.js
2513
2240
  var AggregationTemporality;
@@ -4030,12 +3757,36 @@
4030
3757
  _exportInterval;
4031
3758
  _exportTimeout;
4032
3759
  constructor(options) {
4033
- const { exporter, exportIntervalMillis = 6e4, metricProducers } = options;
3760
+ const { exporter, exportIntervalMillis = 6e4, metricProducers, cardinalityLimits } = options;
4034
3761
  let { exportTimeoutMillis = 3e4 } = options;
4035
3762
  super({
4036
3763
  aggregationSelector: exporter.selectAggregation?.bind(exporter),
4037
3764
  aggregationTemporalitySelector: exporter.selectAggregationTemporality?.bind(exporter),
4038
- metricProducers
3765
+ metricProducers,
3766
+ cardinalitySelector: (instrumentType) => {
3767
+ const limits = {
3768
+ default: 2e3,
3769
+ ...cardinalityLimits
3770
+ };
3771
+ switch (instrumentType) {
3772
+ case InstrumentType.COUNTER:
3773
+ return limits.counter ?? limits.default;
3774
+ case InstrumentType.GAUGE:
3775
+ return limits.gauge ?? limits.default;
3776
+ case InstrumentType.HISTOGRAM:
3777
+ return limits.histogram ?? limits.default;
3778
+ case InstrumentType.OBSERVABLE_COUNTER:
3779
+ return limits.observableCounter ?? limits.default;
3780
+ case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:
3781
+ return limits.observableUpDownCounter ?? limits.default;
3782
+ case InstrumentType.OBSERVABLE_GAUGE:
3783
+ return limits.observableGauge ?? limits.default;
3784
+ case InstrumentType.UP_DOWN_COUNTER:
3785
+ return limits.upDownCounter ?? limits.default;
3786
+ default:
3787
+ return limits.default;
3788
+ }
3789
+ }
4039
3790
  });
4040
3791
  if (exportIntervalMillis <= 0) {
4041
3792
  throw Error("exportIntervalMillis must be greater than 0");
@@ -5515,14 +5266,14 @@
5515
5266
  /**
5516
5267
  * Get a meter with the configuration of the MeterProvider.
5517
5268
  */
5518
- getMeter(name, version = "", options = {}) {
5269
+ getMeter(name, version2 = "", options = {}) {
5519
5270
  if (this._shutdown) {
5520
5271
  diag2.warn("A shutdown MeterProvider cannot provide a Meter");
5521
5272
  return createNoopMeter();
5522
5273
  }
5523
5274
  return this._sharedState.getMeterSharedState({
5524
5275
  name,
5525
- version,
5276
+ version: version2,
5526
5277
  schemaUrl: options.schemaUrl
5527
5278
  }).meter;
5528
5279
  }
@@ -5566,6 +5317,66 @@
5566
5317
  EAggregationTemporality2[EAggregationTemporality2["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE";
5567
5318
  })(EAggregationTemporality || (EAggregationTemporality = {}));
5568
5319
 
5320
+ // node_modules/@opentelemetry/otlp-transformer/build/esm/common/internal.js
5321
+ function createResource(resource, encoder) {
5322
+ const result = {
5323
+ attributes: toAttributes(resource.attributes, encoder),
5324
+ droppedAttributesCount: 0
5325
+ };
5326
+ const schemaUrl = resource.schemaUrl;
5327
+ if (schemaUrl && schemaUrl !== "")
5328
+ result.schemaUrl = schemaUrl;
5329
+ return result;
5330
+ }
5331
+ function createInstrumentationScope(scope) {
5332
+ return {
5333
+ name: scope.name,
5334
+ version: scope.version
5335
+ };
5336
+ }
5337
+ function toAttributes(attributes, encoder) {
5338
+ return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key], encoder));
5339
+ }
5340
+ function toKeyValue(key, value, encoder) {
5341
+ return {
5342
+ key,
5343
+ value: toAnyValue(value, encoder)
5344
+ };
5345
+ }
5346
+ function toAnyValue(value, encoder) {
5347
+ const t2 = typeof value;
5348
+ if (t2 === "string")
5349
+ return { stringValue: value };
5350
+ if (t2 === "number") {
5351
+ if (!Number.isInteger(value))
5352
+ return { doubleValue: value };
5353
+ return { intValue: value };
5354
+ }
5355
+ if (t2 === "boolean")
5356
+ return { boolValue: value };
5357
+ if (value instanceof Uint8Array)
5358
+ return { bytesValue: encoder.encodeUint8Array(value) };
5359
+ if (Array.isArray(value)) {
5360
+ const values = new Array(value.length);
5361
+ for (let i2 = 0; i2 < value.length; i2++) {
5362
+ values[i2] = toAnyValue(value[i2], encoder);
5363
+ }
5364
+ return { arrayValue: { values } };
5365
+ }
5366
+ if (t2 === "object" && value != null) {
5367
+ const keys = Object.keys(value);
5368
+ const values = new Array(keys.length);
5369
+ for (let i2 = 0; i2 < keys.length; i2++) {
5370
+ values[i2] = {
5371
+ key: keys[i2],
5372
+ value: toAnyValue(value[keys[i2]], encoder)
5373
+ };
5374
+ }
5375
+ return { kvlistValue: { values } };
5376
+ }
5377
+ return {};
5378
+ }
5379
+
5569
5380
  // node_modules/@opentelemetry/otlp-transformer/build/esm/metrics/internal.js
5570
5381
  function toResourceMetrics(resourceMetrics, encoder) {
5571
5382
  const processedResource = createResource(resourceMetrics.resource, encoder);
@@ -5692,6 +5503,35 @@
5692
5503
  };
5693
5504
  }
5694
5505
 
5506
+ // node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js
5507
+ function hrTimeToNanos(hrTime2) {
5508
+ const NANOSECONDS = BigInt(1e9);
5509
+ return BigInt(Math.trunc(hrTime2[0])) * NANOSECONDS + BigInt(Math.trunc(hrTime2[1]));
5510
+ }
5511
+ function encodeAsString(hrTime2) {
5512
+ const nanos = hrTimeToNanos(hrTime2);
5513
+ return nanos.toString();
5514
+ }
5515
+ var encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : hrTimeToNanoseconds;
5516
+ function identity(value) {
5517
+ return value;
5518
+ }
5519
+ var JSON_ENCODER = {
5520
+ encodeHrTime: encodeTimestamp,
5521
+ encodeSpanContext: identity,
5522
+ encodeOptionalSpanContext: identity,
5523
+ encodeUint8Array: (bytes) => {
5524
+ if (typeof Buffer !== "undefined") {
5525
+ return Buffer.from(bytes).toString("base64");
5526
+ }
5527
+ const chars = new Array(bytes.length);
5528
+ for (let i2 = 0; i2 < bytes.length; i2++) {
5529
+ chars[i2] = String.fromCharCode(bytes[i2]);
5530
+ }
5531
+ return btoa(chars.join(""));
5532
+ }
5533
+ };
5534
+
5695
5535
  // node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js
5696
5536
  var SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 256;
5697
5537
  var SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512;
@@ -5753,7 +5593,7 @@
5753
5593
  resourceSpans: spanRecordsToResourceSpans(spans, encoder)
5754
5594
  };
5755
5595
  }
5756
- function createResourceMap2(readableSpans) {
5596
+ function createResourceMap(readableSpans) {
5757
5597
  const resourceMap = /* @__PURE__ */ new Map();
5758
5598
  for (const record of readableSpans) {
5759
5599
  let ilsMap = resourceMap.get(record.resource);
@@ -5772,7 +5612,7 @@
5772
5612
  return resourceMap;
5773
5613
  }
5774
5614
  function spanRecordsToResourceSpans(readableSpans, encoder) {
5775
- const resourceMap = createResourceMap2(readableSpans);
5615
+ const resourceMap = createResourceMap(readableSpans);
5776
5616
  const out = [];
5777
5617
  const entryIterator = resourceMap.entries();
5778
5618
  let entry = entryIterator.next();
@@ -5805,6 +5645,70 @@
5805
5645
  return out;
5806
5646
  }
5807
5647
 
5648
+ // node_modules/@opentelemetry/otlp-transformer/build/esm/logs/internal.js
5649
+ function createExportLogsServiceRequest(logRecords, encoder) {
5650
+ return {
5651
+ resourceLogs: logRecordsToResourceLogs(logRecords, encoder)
5652
+ };
5653
+ }
5654
+ function createResourceMap2(logRecords) {
5655
+ const resourceMap = /* @__PURE__ */ new Map();
5656
+ for (const record of logRecords) {
5657
+ const { resource, instrumentationScope: { name, version: version2 = "", schemaUrl = "" } } = record;
5658
+ let ismMap = resourceMap.get(resource);
5659
+ if (!ismMap) {
5660
+ ismMap = /* @__PURE__ */ new Map();
5661
+ resourceMap.set(resource, ismMap);
5662
+ }
5663
+ const ismKey = `${name}@${version2}:${schemaUrl}`;
5664
+ let records = ismMap.get(ismKey);
5665
+ if (!records) {
5666
+ records = [];
5667
+ ismMap.set(ismKey, records);
5668
+ }
5669
+ records.push(record);
5670
+ }
5671
+ return resourceMap;
5672
+ }
5673
+ function logRecordsToResourceLogs(logRecords, encoder) {
5674
+ const resourceMap = createResourceMap2(logRecords);
5675
+ return Array.from(resourceMap, ([resource, ismMap]) => {
5676
+ const processedResource = createResource(resource, encoder);
5677
+ return {
5678
+ resource: processedResource,
5679
+ scopeLogs: Array.from(ismMap, ([, scopeLogs]) => {
5680
+ return {
5681
+ scope: createInstrumentationScope(scopeLogs[0].instrumentationScope),
5682
+ logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)),
5683
+ schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl
5684
+ };
5685
+ }),
5686
+ schemaUrl: processedResource.schemaUrl
5687
+ };
5688
+ });
5689
+ }
5690
+ function toLogRecord(log, encoder) {
5691
+ return {
5692
+ timeUnixNano: encoder.encodeHrTime(log.hrTime),
5693
+ observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved),
5694
+ severityNumber: toSeverityNumber(log.severityNumber),
5695
+ severityText: log.severityText,
5696
+ body: toAnyValue(log.body, encoder),
5697
+ eventName: log.eventName,
5698
+ attributes: toLogAttributes(log.attributes, encoder),
5699
+ droppedAttributesCount: log.droppedAttributesCount,
5700
+ flags: log.spanContext?.traceFlags,
5701
+ traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId),
5702
+ spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId)
5703
+ };
5704
+ }
5705
+ function toSeverityNumber(severityNumber) {
5706
+ return severityNumber;
5707
+ }
5708
+ function toLogAttributes(attributes, encoder) {
5709
+ return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key], encoder));
5710
+ }
5711
+
5808
5712
  // node_modules/@opentelemetry/otlp-transformer/build/esm/logs/json/logs.js
5809
5713
  var JsonLogsSerializer = {
5810
5714
  serializeRequest: (arg) => {
@@ -5817,7 +5721,12 @@
5817
5721
  return {};
5818
5722
  }
5819
5723
  const decoder = new TextDecoder();
5820
- return JSON.parse(decoder.decode(arg));
5724
+ try {
5725
+ return JSON.parse(decoder.decode(arg));
5726
+ } catch (err) {
5727
+ diag2.warn(`Failed to parse logs export response: ${err.message}. Returning empty response`);
5728
+ return {};
5729
+ }
5821
5730
  }
5822
5731
  };
5823
5732
 
@@ -5833,7 +5742,12 @@
5833
5742
  return {};
5834
5743
  }
5835
5744
  const decoder = new TextDecoder();
5836
- return JSON.parse(decoder.decode(arg));
5745
+ try {
5746
+ return JSON.parse(decoder.decode(arg));
5747
+ } catch (err) {
5748
+ diag2.warn(`Failed to parse metrics export response: ${err.message}. Returning empty response`);
5749
+ return {};
5750
+ }
5837
5751
  }
5838
5752
  };
5839
5753
 
@@ -5849,7 +5763,12 @@
5849
5763
  return {};
5850
5764
  }
5851
5765
  const decoder = new TextDecoder();
5852
- return JSON.parse(decoder.decode(arg));
5766
+ try {
5767
+ return JSON.parse(decoder.decode(arg));
5768
+ } catch (err) {
5769
+ diag2.warn(`Failed to parse trace export response: ${err.message}. Returning empty response`);
5770
+ return {};
5771
+ }
5853
5772
  }
5854
5773
  };
5855
5774
 
@@ -6251,7 +6170,8 @@
6251
6170
  _severityNumber;
6252
6171
  _body;
6253
6172
  _eventName;
6254
- totalAttributesCount = 0;
6173
+ _attributesCount = 0;
6174
+ _droppedAttributesCount = 0;
6255
6175
  _isReadonly = false;
6256
6176
  _logRecordLimits;
6257
6177
  set severityText(severityText) {
@@ -6291,7 +6211,7 @@
6291
6211
  this._eventName = eventName;
6292
6212
  }
6293
6213
  get droppedAttributesCount() {
6294
- return this.totalAttributesCount - Object.keys(this.attributes).length;
6214
+ return this._droppedAttributesCount;
6295
6215
  }
6296
6216
  constructor(_sharedState, instrumentationScope, logRecord) {
6297
6217
  const { timestamp, observedTimestamp, eventName, severityNumber, severityText, body, attributes = {}, exception, context: context2 } = logRecord;
@@ -6328,14 +6248,18 @@
6328
6248
  diag2.warn(`Invalid attribute value set for key: ${key}`);
6329
6249
  return this;
6330
6250
  }
6331
- this.totalAttributesCount += 1;
6332
- if (Object.keys(this.attributes).length >= this._logRecordLimits.attributeCountLimit && !Object.prototype.hasOwnProperty.call(this.attributes, key)) {
6333
- if (this.droppedAttributesCount === 1) {
6251
+ const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key);
6252
+ if (isNewKey && this._attributesCount >= this._logRecordLimits.attributeCountLimit) {
6253
+ this._droppedAttributesCount++;
6254
+ if (this._droppedAttributesCount === 1) {
6334
6255
  diag2.warn("Dropping extra attributes.");
6335
6256
  }
6336
6257
  return this;
6337
6258
  }
6338
6259
  this.attributes[key] = this._truncateToSize(value);
6260
+ if (isNewKey) {
6261
+ this._attributesCount++;
6262
+ }
6339
6263
  return this;
6340
6264
  }
6341
6265
  setAttributes(attributes) {
@@ -6476,9 +6400,42 @@
6476
6400
  context: currentContext,
6477
6401
  ...logRecord
6478
6402
  });
6403
+ this._sharedState.loggerMetrics.emitLog();
6479
6404
  this._sharedState.activeProcessor.onEmit(logRecordInstance, currentContext);
6480
6405
  logRecordInstance._makeReadonly();
6481
6406
  }
6407
+ enabled(options) {
6408
+ const loggerConfig = this._loggerConfig;
6409
+ if (loggerConfig.disabled) {
6410
+ return false;
6411
+ }
6412
+ const severityNumber = options?.severityNumber;
6413
+ if (typeof severityNumber === "number" && severityNumber !== SeverityNumber.UNSPECIFIED && severityNumber < loggerConfig.minimumSeverity) {
6414
+ return false;
6415
+ }
6416
+ const currentContext = options?.context || context.active();
6417
+ if (loggerConfig.traceBased) {
6418
+ const spanContext = trace.getSpanContext(currentContext);
6419
+ if (spanContext && isSpanContextValid(spanContext)) {
6420
+ const isSampled = (spanContext.traceFlags & TraceFlags.SAMPLED) === TraceFlags.SAMPLED;
6421
+ if (!isSampled) {
6422
+ return false;
6423
+ }
6424
+ }
6425
+ }
6426
+ const enabledOpts = {
6427
+ context: currentContext,
6428
+ instrumentationScope: this.instrumentationScope,
6429
+ severityNumber: options?.severityNumber,
6430
+ eventName: options?.eventName
6431
+ };
6432
+ for (const processor of this._sharedState.processors) {
6433
+ if (!processor.enabled || processor.enabled(enabledOpts)) {
6434
+ return true;
6435
+ }
6436
+ }
6437
+ return false;
6438
+ }
6482
6439
  };
6483
6440
 
6484
6441
  // node_modules/@opentelemetry/sdk-logs/build/esm/export/NoopLogRecordProcessor.js
@@ -6491,6 +6448,9 @@
6491
6448
  shutdown() {
6492
6449
  return Promise.resolve();
6493
6450
  }
6451
+ enabled(_options) {
6452
+ return false;
6453
+ }
6494
6454
  };
6495
6455
 
6496
6456
  // node_modules/@opentelemetry/sdk-logs/build/esm/MultiLogRecordProcessor.js
@@ -6511,6 +6471,14 @@
6511
6471
  async shutdown() {
6512
6472
  await Promise.all(this.processors.map((processor) => processor.shutdown()));
6513
6473
  }
6474
+ enabled(options) {
6475
+ for (const processor of this.processors) {
6476
+ if (!processor.enabled || processor.enabled(options)) {
6477
+ return true;
6478
+ }
6479
+ }
6480
+ return false;
6481
+ }
6514
6482
  };
6515
6483
 
6516
6484
  // node_modules/@opentelemetry/sdk-logs/build/esm/internal/utils.js
@@ -6518,6 +6486,26 @@
6518
6486
  return `${scope.name}@${scope.version || ""}:${scope.schemaUrl || ""}`;
6519
6487
  }
6520
6488
 
6489
+ // node_modules/@opentelemetry/sdk-logs/build/esm/semconv.js
6490
+ var METRIC_OTEL_SDK_LOG_CREATED = "otel.sdk.log.created";
6491
+
6492
+ // node_modules/@opentelemetry/sdk-logs/build/esm/LoggerMetrics.js
6493
+ var LoggerMetrics = class {
6494
+ createdLogs;
6495
+ constructor(meter) {
6496
+ this.createdLogs = meter.createCounter(METRIC_OTEL_SDK_LOG_CREATED, {
6497
+ unit: "{log_record}",
6498
+ description: "The number of logs submitted to enabled SDK Loggers."
6499
+ });
6500
+ }
6501
+ emitLog() {
6502
+ this.createdLogs.add(1);
6503
+ }
6504
+ };
6505
+
6506
+ // node_modules/@opentelemetry/sdk-logs/build/esm/version.js
6507
+ var VERSION4 = "0.215.0";
6508
+
6521
6509
  // node_modules/@opentelemetry/sdk-logs/build/esm/internal/LoggerProviderSharedState.js
6522
6510
  var DEFAULT_LOGGER_CONFIG = {
6523
6511
  disabled: false,
@@ -6535,9 +6523,10 @@
6535
6523
  forceFlushTimeoutMillis;
6536
6524
  logRecordLimits;
6537
6525
  processors;
6526
+ loggerMetrics;
6538
6527
  _loggerConfigurator;
6539
6528
  _loggerConfigs = /* @__PURE__ */ new Map();
6540
- constructor(resource, forceFlushTimeoutMillis, logRecordLimits, processors, loggerConfigurator) {
6529
+ constructor(resource, forceFlushTimeoutMillis, logRecordLimits, processors, loggerConfigurator, meterProvider) {
6541
6530
  this.resource = resource;
6542
6531
  this.forceFlushTimeoutMillis = forceFlushTimeoutMillis;
6543
6532
  this.logRecordLimits = logRecordLimits;
@@ -6549,6 +6538,8 @@
6549
6538
  this.activeProcessor = new NoopLogRecordProcessor();
6550
6539
  }
6551
6540
  this._loggerConfigurator = loggerConfigurator ?? DEFAULT_LOGGER_CONFIGURATOR;
6541
+ const meter = meterProvider ? meterProvider.getMeter("@opentelemetry/sdk-logs", VERSION4) : createNoopMeter();
6542
+ this.loggerMetrics = new LoggerMetrics(meter);
6552
6543
  }
6553
6544
  /**
6554
6545
  * Get the LoggerConfig for a given instrumentation scope.
@@ -6583,15 +6574,16 @@
6583
6574
  attributeValueLengthLimit: config.logRecordLimits?.attributeValueLengthLimit ?? Infinity
6584
6575
  },
6585
6576
  loggerConfigurator: config.loggerConfigurator ?? DEFAULT_LOGGER_CONFIGURATOR,
6586
- processors: config.processors ?? []
6577
+ processors: config.processors ?? [],
6578
+ meterProvider: config.meterProvider
6587
6579
  };
6588
- this._sharedState = new LoggerProviderSharedState(mergedConfig.resource, mergedConfig.forceFlushTimeoutMillis, mergedConfig.logRecordLimits, mergedConfig.processors, mergedConfig.loggerConfigurator);
6580
+ this._sharedState = new LoggerProviderSharedState(mergedConfig.resource, mergedConfig.forceFlushTimeoutMillis, mergedConfig.logRecordLimits, mergedConfig.processors, mergedConfig.loggerConfigurator, mergedConfig.meterProvider);
6589
6581
  this._shutdownOnce = new BindOnceFuture(this._shutdown, this);
6590
6582
  }
6591
6583
  /**
6592
6584
  * Get a logger with the configuration of the LoggerProvider.
6593
6585
  */
6594
- getLogger(name, version, options) {
6586
+ getLogger(name, version2, options) {
6595
6587
  if (this._shutdownOnce.isCalled) {
6596
6588
  diag2.warn("A shutdown LoggerProvider cannot provide a Logger");
6597
6589
  return NOOP_LOGGER;
@@ -6600,9 +6592,9 @@
6600
6592
  diag2.warn("Logger requested without instrumentation scope name.");
6601
6593
  }
6602
6594
  const loggerName = name || DEFAULT_LOGGER_NAME;
6603
- const key = `${loggerName}@${version || ""}:${options?.schemaUrl || ""}`;
6595
+ const key = `${loggerName}@${version2 || ""}:${options?.schemaUrl || ""}`;
6604
6596
  if (!this._sharedState.loggers.has(key)) {
6605
- this._sharedState.loggers.set(key, new Logger({ name: loggerName, version, schemaUrl: options?.schemaUrl }, this._sharedState));
6597
+ this._sharedState.loggers.set(key, new Logger({ name: loggerName, version: version2, schemaUrl: options?.schemaUrl }, this._sharedState));
6606
6598
  }
6607
6599
  return this._sharedState.loggers.get(key);
6608
6600
  }
@@ -6637,16 +6629,75 @@
6637
6629
  };
6638
6630
 
6639
6631
  // node_modules/@opentelemetry/sdk-logs/build/esm/export/BatchLogRecordProcessorBase.js
6632
+ async function waitForResources(logRecords) {
6633
+ const pendingResources = [];
6634
+ for (let i2 = 0, len = logRecords.length; i2 < len; i2++) {
6635
+ const logRecord = logRecords[i2];
6636
+ if (logRecord.resource.asyncAttributesPending && logRecord.resource.waitForAsyncAttributes) {
6637
+ pendingResources.push(logRecord.resource.waitForAsyncAttributes());
6638
+ }
6639
+ }
6640
+ if (pendingResources != null && pendingResources.length > 0) {
6641
+ await Promise.all(pendingResources);
6642
+ }
6643
+ }
6644
+ var ExportOperation = class {
6645
+ _exportCompleted;
6646
+ _exportScheduledPromise;
6647
+ _exportScheduledResolve;
6648
+ constructor(exporter, logRecords, exportTimeoutMillis) {
6649
+ this._exportScheduledPromise = new Promise((resolve) => {
6650
+ this._exportScheduledResolve = resolve;
6651
+ });
6652
+ this._exportCompleted = this._executeExport(exporter, logRecords, exportTimeoutMillis);
6653
+ }
6654
+ /** Get the promise that resolves when the export completes */
6655
+ get exportCompleted() {
6656
+ return this._exportCompleted;
6657
+ }
6658
+ /** Get the promise that resolves when exporter.export() has been called */
6659
+ get exportScheduled() {
6660
+ return this._exportScheduledPromise;
6661
+ }
6662
+ async _executeExport(exporter, logRecords, exportTimeoutMillis) {
6663
+ try {
6664
+ await waitForResources(logRecords);
6665
+ await context.with(suppressTracing(context.active()), async () => {
6666
+ return this._exportWithTimeout(exporter, logRecords, exportTimeoutMillis);
6667
+ });
6668
+ } catch (e2) {
6669
+ globalErrorHandler(e2);
6670
+ this._exportScheduledResolve();
6671
+ }
6672
+ }
6673
+ async _exportWithTimeout(exporter, logRecords, exportTimeoutMillis) {
6674
+ return new Promise((resolve, reject) => {
6675
+ const timer = setTimeout(() => {
6676
+ reject(new Error("Timeout"));
6677
+ }, exportTimeoutMillis);
6678
+ exporter.export(logRecords, (result) => {
6679
+ clearTimeout(timer);
6680
+ if (result.code === ExportResultCode.SUCCESS) {
6681
+ resolve();
6682
+ } else {
6683
+ reject(result.error ?? new Error("BatchLogRecordProcessor: log record export failed"));
6684
+ }
6685
+ });
6686
+ this._exportScheduledResolve();
6687
+ });
6688
+ }
6689
+ };
6640
6690
  var BatchLogRecordProcessorBase = class {
6641
6691
  _maxExportBatchSize;
6642
6692
  _maxQueueSize;
6643
6693
  _scheduledDelayMillis;
6644
6694
  _exportTimeoutMillis;
6645
6695
  _exporter;
6646
- _isExporting = false;
6696
+ _currentExport = null;
6647
6697
  _finishedLogRecords = [];
6648
6698
  _timer;
6649
6699
  _shutdownOnce;
6700
+ _flushing = false;
6650
6701
  constructor(exporter, config) {
6651
6702
  this._exporter = exporter;
6652
6703
  this._maxExportBatchSize = config?.maxExportBatchSize ?? 512;
@@ -6671,14 +6722,6 @@
6671
6722
  }
6672
6723
  return this._flushAll();
6673
6724
  }
6674
- shutdown() {
6675
- return this._shutdownOnce.call();
6676
- }
6677
- async _shutdown() {
6678
- this.onShutdown();
6679
- await this._flushAll();
6680
- await this._exporter.shutdown();
6681
- }
6682
6725
  /** Add a LogRecord in the buffer. */
6683
6726
  _addToBuffer(logRecord) {
6684
6727
  if (this._finishedLogRecords.length >= this._maxQueueSize) {
@@ -6687,52 +6730,112 @@
6687
6730
  this._finishedLogRecords.push(logRecord);
6688
6731
  this._maybeStartTimer();
6689
6732
  }
6733
+ shutdown() {
6734
+ return this._shutdownOnce.call();
6735
+ }
6736
+ async _shutdown() {
6737
+ this.onShutdown();
6738
+ await this._flushAll();
6739
+ await this._exporter.shutdown();
6740
+ }
6690
6741
  /**
6691
6742
  * Send all LogRecords to the exporter respecting the batch size limit
6692
6743
  * This function is used only on forceFlush or shutdown,
6693
- * for all other cases _flush should be used
6744
+ * for all other cases _exportOneBatch should be used
6694
6745
  * */
6695
- _flushAll() {
6696
- return new Promise((resolve, reject) => {
6697
- const promises = [];
6698
- const batchCount = Math.ceil(this._finishedLogRecords.length / this._maxExportBatchSize);
6699
- for (let i2 = 0; i2 < batchCount; i2++) {
6700
- promises.push(this._flushOneBatch());
6746
+ async _flushAll() {
6747
+ if (this._flushing) {
6748
+ return;
6749
+ }
6750
+ this._flushing = true;
6751
+ let toFlush = this._finishedLogRecords;
6752
+ this._finishedLogRecords = [];
6753
+ this._clearTimer();
6754
+ if (this._currentExport !== null) {
6755
+ await this._exporter.forceFlush();
6756
+ await this._currentExport.exportCompleted;
6757
+ this._currentExport = null;
6758
+ }
6759
+ while (toFlush.length > 0) {
6760
+ let batch;
6761
+ if (toFlush.length <= this._maxExportBatchSize) {
6762
+ batch = toFlush;
6763
+ toFlush = [];
6764
+ } else {
6765
+ batch = toFlush.splice(0, this._maxExportBatchSize);
6701
6766
  }
6702
- Promise.all(promises).then(() => {
6703
- resolve();
6704
- }).catch(reject);
6705
- });
6767
+ const exportOp = new ExportOperation(this._exporter, batch, this._exportTimeoutMillis);
6768
+ this._currentExport = exportOp;
6769
+ try {
6770
+ await exportOp.exportScheduled;
6771
+ await this._exporter.forceFlush();
6772
+ await exportOp.exportCompleted;
6773
+ } catch (e2) {
6774
+ globalErrorHandler(e2);
6775
+ } finally {
6776
+ this._currentExport = null;
6777
+ }
6778
+ }
6779
+ this._flushing = false;
6780
+ this._maybeStartTimer();
6706
6781
  }
6707
- _flushOneBatch() {
6708
- this._clearTimer();
6782
+ /**
6783
+ * Extracts one batch from the buffer.
6784
+ * Returns null if buffer is empty.
6785
+ */
6786
+ _extractBatch() {
6709
6787
  if (this._finishedLogRecords.length === 0) {
6710
- return Promise.resolve();
6788
+ return null;
6711
6789
  }
6712
- return callWithTimeout(this._export(this._finishedLogRecords.splice(0, this._maxExportBatchSize)), this._exportTimeoutMillis);
6790
+ if (this._finishedLogRecords.length <= this._maxExportBatchSize) {
6791
+ const batch = this._finishedLogRecords;
6792
+ this._finishedLogRecords = [];
6793
+ return batch;
6794
+ } else {
6795
+ return this._finishedLogRecords.splice(0, this._maxExportBatchSize);
6796
+ }
6797
+ }
6798
+ _exportOneBatch() {
6799
+ this._clearTimer();
6800
+ const logRecords = this._extractBatch();
6801
+ if (logRecords === null) {
6802
+ return;
6803
+ }
6804
+ const exportOp = new ExportOperation(this._exporter, logRecords, this._exportTimeoutMillis);
6805
+ this._currentExport = exportOp;
6806
+ exportOp.exportCompleted.then(() => {
6807
+ this._currentExport = null;
6808
+ this._maybeStartTimer();
6809
+ }).catch((error) => {
6810
+ this._currentExport = null;
6811
+ globalErrorHandler(error);
6812
+ this._maybeStartTimer();
6813
+ });
6713
6814
  }
6714
6815
  _maybeStartTimer() {
6715
- if (this._isExporting)
6816
+ if (this._shutdownOnce.isCalled) {
6716
6817
  return;
6717
- const flush = () => {
6718
- this._isExporting = true;
6719
- this._flushOneBatch().then(() => {
6720
- this._isExporting = false;
6721
- if (this._finishedLogRecords.length > 0) {
6722
- this._clearTimer();
6723
- this._maybeStartTimer();
6724
- }
6725
- }).catch((e2) => {
6726
- this._isExporting = false;
6727
- globalErrorHandler(e2);
6728
- });
6729
- };
6818
+ }
6819
+ if (this._flushing) {
6820
+ return;
6821
+ }
6822
+ if (this._finishedLogRecords.length === 0) {
6823
+ return;
6824
+ }
6825
+ if (this._currentExport !== null) {
6826
+ return;
6827
+ }
6730
6828
  if (this._finishedLogRecords.length >= this._maxExportBatchSize) {
6731
- return flush();
6829
+ this._exportOneBatch();
6830
+ return;
6732
6831
  }
6733
- if (this._timer !== void 0)
6832
+ if (this._timer !== void 0) {
6734
6833
  return;
6735
- this._timer = setTimeout(() => flush(), this._scheduledDelayMillis);
6834
+ }
6835
+ this._timer = setTimeout(() => {
6836
+ this._timer = void 0;
6837
+ this._exportOneBatch();
6838
+ }, this._scheduledDelayMillis);
6736
6839
  if (typeof this._timer !== "number") {
6737
6840
  this._timer.unref();
6738
6841
  }
@@ -6743,25 +6846,6 @@
6743
6846
  this._timer = void 0;
6744
6847
  }
6745
6848
  }
6746
- _export(logRecords) {
6747
- const doExport = () => internal._export(this._exporter, logRecords).then((result) => {
6748
- if (result.code !== ExportResultCode.SUCCESS) {
6749
- globalErrorHandler(result.error ?? new Error(`BatchLogRecordProcessor: log record export failed (status ${result})`));
6750
- }
6751
- }).catch(globalErrorHandler);
6752
- const pendingResources = [];
6753
- for (let i2 = 0; i2 < logRecords.length; i2++) {
6754
- const resource = logRecords[i2].resource;
6755
- if (resource.asyncAttributesPending && typeof resource.waitForAsyncAttributes === "function") {
6756
- pendingResources.push(resource.waitForAsyncAttributes());
6757
- }
6758
- }
6759
- if (pendingResources.length === 0) {
6760
- return doExport();
6761
- } else {
6762
- return Promise.all(pendingResources).then(doExport, globalErrorHandler);
6763
- }
6764
- }
6765
6849
  };
6766
6850
 
6767
6851
  // node_modules/@opentelemetry/sdk-logs/build/esm/platform/browser/export/BatchLogRecordProcessor.js
@@ -6844,12 +6928,16 @@
6844
6928
  this._performanceOffset = now - (this._performanceStartTime + otperformance.timeOrigin);
6845
6929
  this._startTimeProvided = opts.startTime != null;
6846
6930
  this._spanLimits = opts.spanLimits;
6847
- this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit || 0;
6931
+ this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit ?? 0;
6848
6932
  this._spanProcessor = opts.spanProcessor;
6849
6933
  this.name = opts.name;
6850
6934
  this.parentSpanContext = opts.parentSpanContext;
6851
6935
  this.kind = opts.kind;
6852
- this.links = opts.links || [];
6936
+ if (opts.links) {
6937
+ for (const link of opts.links) {
6938
+ this.addLink(link);
6939
+ }
6940
+ }
6853
6941
  this.startTime = this._getTime(opts.startTime ?? now);
6854
6942
  this.resource = opts.resource;
6855
6943
  this.instrumentationScope = opts.scope;
@@ -6886,8 +6974,10 @@
6886
6974
  return this;
6887
6975
  }
6888
6976
  setAttributes(attributes) {
6889
- for (const [k2, v2] of Object.entries(attributes)) {
6890
- this.setAttribute(k2, v2);
6977
+ for (const key in attributes) {
6978
+ if (Object.prototype.hasOwnProperty.call(attributes, key)) {
6979
+ this.setAttribute(key, attributes[key]);
6980
+ }
6891
6981
  }
6892
6982
  return this;
6893
6983
  }
@@ -6920,31 +7010,95 @@
6920
7010
  }
6921
7011
  attributesOrStartTime = void 0;
6922
7012
  }
6923
- const attributes = sanitizeAttributes(attributesOrStartTime);
7013
+ const sanitized = sanitizeAttributes(attributesOrStartTime);
7014
+ const { attributePerEventCountLimit } = this._spanLimits;
7015
+ const attributes = {};
7016
+ let droppedAttributesCount = 0;
7017
+ let eventAttributesCount = 0;
7018
+ for (const attr in sanitized) {
7019
+ if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) {
7020
+ continue;
7021
+ }
7022
+ const attrVal = sanitized[attr];
7023
+ if (attributePerEventCountLimit !== void 0 && eventAttributesCount >= attributePerEventCountLimit) {
7024
+ droppedAttributesCount++;
7025
+ continue;
7026
+ }
7027
+ attributes[attr] = this._truncateToSize(attrVal);
7028
+ eventAttributesCount++;
7029
+ }
6924
7030
  this.events.push({
6925
7031
  name,
6926
7032
  attributes,
6927
7033
  time: this._getTime(timeStamp),
6928
- droppedAttributesCount: 0
7034
+ droppedAttributesCount
6929
7035
  });
6930
7036
  return this;
6931
7037
  }
6932
7038
  addLink(link) {
6933
- this.links.push(link);
7039
+ if (this._isSpanEnded())
7040
+ return this;
7041
+ const { linkCountLimit } = this._spanLimits;
7042
+ if (linkCountLimit === 0) {
7043
+ this._droppedLinksCount++;
7044
+ return this;
7045
+ }
7046
+ if (linkCountLimit !== void 0 && this.links.length >= linkCountLimit) {
7047
+ if (this._droppedLinksCount === 0) {
7048
+ diag2.debug("Dropping extra links.");
7049
+ }
7050
+ this.links.shift();
7051
+ this._droppedLinksCount++;
7052
+ }
7053
+ const { attributePerLinkCountLimit } = this._spanLimits;
7054
+ const sanitized = sanitizeAttributes(link.attributes);
7055
+ const attributes = {};
7056
+ let droppedAttributesCount = 0;
7057
+ let linkAttributesCount = 0;
7058
+ for (const attr in sanitized) {
7059
+ if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) {
7060
+ continue;
7061
+ }
7062
+ const attrVal = sanitized[attr];
7063
+ if (attributePerLinkCountLimit !== void 0 && linkAttributesCount >= attributePerLinkCountLimit) {
7064
+ droppedAttributesCount++;
7065
+ continue;
7066
+ }
7067
+ attributes[attr] = this._truncateToSize(attrVal);
7068
+ linkAttributesCount++;
7069
+ }
7070
+ const processedLink = { context: link.context };
7071
+ if (linkAttributesCount > 0) {
7072
+ processedLink.attributes = attributes;
7073
+ }
7074
+ if (droppedAttributesCount > 0) {
7075
+ processedLink.droppedAttributesCount = droppedAttributesCount;
7076
+ }
7077
+ this.links.push(processedLink);
6934
7078
  return this;
6935
7079
  }
6936
7080
  addLinks(links) {
6937
- this.links.push(...links);
7081
+ for (const link of links) {
7082
+ this.addLink(link);
7083
+ }
6938
7084
  return this;
6939
7085
  }
6940
7086
  setStatus(status) {
6941
7087
  if (this._isSpanEnded())
6942
7088
  return this;
6943
- this.status = { ...status };
6944
- if (this.status.message != null && typeof status.message !== "string") {
6945
- diag2.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`);
6946
- delete this.status.message;
7089
+ if (status.code === SpanStatusCode.UNSET)
7090
+ return this;
7091
+ if (this.status.code === SpanStatusCode.OK)
7092
+ return this;
7093
+ const newStatus = { code: status.code };
7094
+ if (status.code === SpanStatusCode.ERROR) {
7095
+ if (typeof status.message === "string") {
7096
+ newStatus.message = status.message;
7097
+ } else if (status.message != null) {
7098
+ diag2.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`);
7099
+ }
6947
7100
  }
7101
+ this.status = newStatus;
6948
7102
  return this;
6949
7103
  }
6950
7104
  updateName(name) {
@@ -6968,6 +7122,9 @@
6968
7122
  if (this._droppedEventsCount > 0) {
6969
7123
  diag2.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);
6970
7124
  }
7125
+ if (this._droppedLinksCount > 0) {
7126
+ diag2.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`);
7127
+ }
6971
7128
  if (this._spanProcessor.onEnding) {
6972
7129
  this._spanProcessor.onEnding(this);
6973
7130
  }
@@ -7577,7 +7734,7 @@
7577
7734
  }
7578
7735
 
7579
7736
  // node_modules/@opentelemetry/sdk-trace-base/build/esm/version.js
7580
- var VERSION4 = "2.6.0";
7737
+ var VERSION5 = "2.7.0";
7581
7738
 
7582
7739
  // node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js
7583
7740
  var Tracer = class {
@@ -7601,7 +7758,7 @@
7601
7758
  this._resource = resource;
7602
7759
  this._spanProcessor = spanProcessor;
7603
7760
  this.instrumentationScope = instrumentationScope;
7604
- const meter = localConfig.meterProvider ? localConfig.meterProvider.getMeter("@opentelemetry/sdk-trace", VERSION4) : createNoopMeter();
7761
+ const meter = localConfig.meterProvider ? localConfig.meterProvider.getMeter("@opentelemetry/sdk-trace", VERSION5) : createNoopMeter();
7605
7762
  this._tracerMetrics = new TracerMetrics(meter);
7606
7763
  }
7607
7764
  /**
@@ -7772,10 +7929,10 @@
7772
7929
  }
7773
7930
  this._activeSpanProcessor = new MultiSpanProcessor(spanProcessors);
7774
7931
  }
7775
- getTracer(name, version, options) {
7776
- const key = `${name}@${version || ""}:${options?.schemaUrl || ""}`;
7932
+ getTracer(name, version2, options) {
7933
+ const key = `${name}@${version2 || ""}:${options?.schemaUrl || ""}`;
7777
7934
  if (!this._tracers.has(key)) {
7778
- this._tracers.set(key, new Tracer({ name, version, schemaUrl: options?.schemaUrl }, this._config, this._resource, this._activeSpanProcessor));
7935
+ this._tracers.set(key, new Tracer({ name, version: version2, schemaUrl: options?.schemaUrl }, this._config, this._resource, this._activeSpanProcessor));
7779
7936
  }
7780
7937
  return this._tracers.get(key);
7781
7938
  }
@@ -8502,7 +8659,7 @@
8502
8659
  })(AttributeNames || (AttributeNames = {}));
8503
8660
 
8504
8661
  // node_modules/@opentelemetry/instrumentation-document-load/build/esm/version.js
8505
- var PACKAGE_VERSION = "0.58.0";
8662
+ var PACKAGE_VERSION = "0.60.0";
8506
8663
  var PACKAGE_NAME = "@opentelemetry/instrumentation-document-load";
8507
8664
 
8508
8665
  // node_modules/@opentelemetry/instrumentation-document-load/build/esm/semconv.js
@@ -8917,20 +9074,20 @@
8917
9074
  }
8918
9075
 
8919
9076
  // node_modules/@opentelemetry/instrumentation-fetch/build/esm/version.js
8920
- var VERSION5 = "0.213.0";
9077
+ var VERSION6 = "0.215.0";
8921
9078
 
8922
9079
  // node_modules/@opentelemetry/instrumentation-fetch/build/esm/fetch.js
8923
9080
  var OBSERVER_WAIT_TIME_MS = 300;
8924
9081
  var hasBrowserPerformanceAPI = typeof PerformanceObserver !== "undefined";
8925
9082
  var FetchInstrumentation = class extends InstrumentationBase {
8926
9083
  component = "fetch";
8927
- version = VERSION5;
9084
+ version = VERSION6;
8928
9085
  moduleName = this.component;
8929
9086
  _usedResources = /* @__PURE__ */ new WeakSet();
8930
9087
  _tasksCount = 0;
8931
9088
  _semconvStability;
8932
9089
  constructor(config = {}) {
8933
- super("@opentelemetry/instrumentation-fetch", VERSION5, config);
9090
+ super("@opentelemetry/instrumentation-fetch", VERSION6, config);
8934
9091
  this._semconvStability = semconvStabilityFromStr("http", config?.semconvStabilityOptIn);
8935
9092
  }
8936
9093
  init() {
@@ -9115,27 +9272,18 @@
9115
9272
  _patchConstructor() {
9116
9273
  return (original) => {
9117
9274
  const plugin = this;
9118
- const readOnlyProps = /* @__PURE__ */ new Set(["url", "type", "redirected"]);
9119
- function createResponseProxy(target, originalResponse) {
9120
- return new Proxy(target, {
9121
- get(t2, prop, _receiver) {
9122
- if (typeof prop === "string" && readOnlyProps.has(prop)) {
9123
- return Reflect.get(originalResponse, prop);
9124
- }
9125
- if (prop === "clone") {
9126
- return function clone() {
9127
- return createResponseProxy(t2.clone(), originalResponse);
9128
- };
9129
- }
9130
- const value = Reflect.get(t2, prop, t2);
9131
- return typeof value === "function" ? value.bind(t2) : value;
9132
- }
9133
- });
9134
- }
9135
9275
  return function patchConstructor(...args) {
9276
+ if (!plugin._isEnabled) {
9277
+ return original.apply(this, args);
9278
+ }
9136
9279
  const self2 = this;
9137
9280
  const url = parseUrl(args[0] instanceof Request ? args[0].url : String(args[0])).href;
9138
- const options = args[0] instanceof Request ? args[0] : args[1] || {};
9281
+ let options;
9282
+ if (args[0] instanceof Request) {
9283
+ options = args[1] != null ? new Request(args[0], args[1]) : args[0];
9284
+ } else {
9285
+ options = args[1] || {};
9286
+ }
9139
9287
  const createdSpan = plugin._createSpan(url, options);
9140
9288
  if (!createdSpan) {
9141
9289
  return original.apply(this, args);
@@ -9175,55 +9323,12 @@
9175
9323
  });
9176
9324
  }
9177
9325
  }
9178
- function withCancelPropagation(body, readerClone) {
9179
- if (!body)
9180
- return null;
9181
- const reader = body.getReader();
9182
- return new ReadableStream({
9183
- async pull(controller) {
9184
- try {
9185
- const { value, done } = await reader.read();
9186
- if (done) {
9187
- reader.releaseLock();
9188
- controller.close();
9189
- } else {
9190
- controller.enqueue(value);
9191
- }
9192
- } catch (err) {
9193
- controller.error(err);
9194
- reader.cancel(err).catch((_2) => {
9195
- });
9196
- try {
9197
- reader.releaseLock();
9198
- } catch {
9199
- }
9200
- }
9201
- },
9202
- cancel(reason) {
9203
- readerClone.cancel(reason).catch((_2) => {
9204
- });
9205
- return reader.cancel(reason);
9206
- }
9207
- });
9208
- }
9209
- function onSuccess(span, resolve, response) {
9210
- let proxiedResponse = null;
9326
+ function onSuccess(span, response) {
9211
9327
  try {
9212
9328
  const resClone = response.clone();
9213
9329
  const body = resClone.body;
9214
9330
  if (body) {
9215
9331
  const reader = body.getReader();
9216
- const isNullBodyStatus = (
9217
- // 101 responses and protocol upgrading is handled internally by the browser
9218
- response.status === 204 || response.status === 205 || response.status === 304
9219
- );
9220
- const wrappedBody = isNullBodyStatus ? null : withCancelPropagation(response.body, reader);
9221
- const newResponse = new Response(wrappedBody, {
9222
- status: response.status,
9223
- statusText: response.statusText,
9224
- headers: response.headers
9225
- });
9226
- proxiedResponse = createResponseProxy(newResponse, response);
9227
9332
  const read = () => {
9228
9333
  reader.read().then(({ done }) => {
9229
9334
  if (done) {
@@ -9239,24 +9344,32 @@
9239
9344
  } else {
9240
9345
  endSpanOnSuccess(span, response);
9241
9346
  }
9242
- } finally {
9243
- resolve(proxiedResponse ?? response);
9347
+ } catch (error) {
9348
+ plugin._diag.error("Failed to read fetch response body", error);
9349
+ plugin._endSpan(span, spanData, {
9350
+ status: 0,
9351
+ url
9352
+ });
9244
9353
  }
9354
+ return response;
9245
9355
  }
9246
- function onError(span, reject, error) {
9356
+ function onError(span, error) {
9247
9357
  try {
9248
9358
  endSpanOnError(span, error);
9249
- } finally {
9250
- reject(error);
9359
+ } catch (e2) {
9360
+ plugin._diag.error("Failed to end span on fetch error", e2);
9361
+ plugin._endSpan(span, spanData, {
9362
+ status: error.status || 0,
9363
+ url
9364
+ });
9251
9365
  }
9366
+ throw error;
9252
9367
  }
9253
- return new Promise((resolve, reject) => {
9254
- return context.with(trace.setSpan(context.active(), createdSpan), () => {
9255
- plugin._callRequestHook(createdSpan, options);
9256
- plugin._addHeaders(options, url);
9257
- plugin._tasksCount++;
9258
- return original.apply(self2, options instanceof Request ? [options] : [url, options]).then(onSuccess.bind(self2, createdSpan, resolve), onError.bind(self2, createdSpan, reject));
9259
- });
9368
+ return context.with(trace.setSpan(context.active(), createdSpan), () => {
9369
+ plugin._callRequestHook(createdSpan, options);
9370
+ plugin._addHeaders(options, url);
9371
+ plugin._tasksCount++;
9372
+ return original.apply(self2, options instanceof Request ? [options] : [url, options]).then(onSuccess.bind(self2, createdSpan), onError.bind(self2, createdSpan));
9260
9373
  });
9261
9374
  };
9262
9375
  };
@@ -9315,26 +9428,34 @@
9315
9428
  this._diag.warn("this instrumentation is intended for web usage only, it does not instrument server-side fetch()");
9316
9429
  return;
9317
9430
  }
9318
- if (isWrapped(fetch)) {
9319
- this._unwrap(globalThis, "fetch");
9320
- this._diag.debug("removing previous patch for constructor");
9431
+ if (this._isEnabled) {
9432
+ return;
9433
+ }
9434
+ this._isEnabled = true;
9435
+ if (this._isFetchPatched) {
9436
+ this._diag.debug("fetch constructor already patched");
9437
+ return;
9321
9438
  }
9439
+ this._isFetchPatched = true;
9322
9440
  this._wrap(globalThis, "fetch", this._patchConstructor());
9323
9441
  }
9324
9442
  /**
9325
- * implements unpatch function
9443
+ * deactivates fetch instrumentation
9326
9444
  */
9327
9445
  disable() {
9328
9446
  if (!hasBrowserPerformanceAPI) {
9329
9447
  return;
9330
9448
  }
9331
- this._unwrap(globalThis, "fetch");
9449
+ if (!this._isEnabled) {
9450
+ return;
9451
+ }
9452
+ this._isEnabled = false;
9332
9453
  this._usedResources = /* @__PURE__ */ new WeakSet();
9333
9454
  }
9334
9455
  };
9335
9456
 
9336
9457
  // node_modules/@opentelemetry/instrumentation-long-task/build/esm/version.js
9337
- var PACKAGE_VERSION2 = "0.57.0";
9458
+ var PACKAGE_VERSION2 = "0.59.0";
9338
9459
  var PACKAGE_NAME2 = "@opentelemetry/instrumentation-long-task";
9339
9460
 
9340
9461
  // node_modules/@opentelemetry/instrumentation-long-task/build/esm/instrumentation.js
@@ -9418,7 +9539,7 @@
9418
9539
  })(AttributeNames3 || (AttributeNames3 = {}));
9419
9540
 
9420
9541
  // node_modules/@opentelemetry/instrumentation-user-interaction/build/esm/version.js
9421
- var PACKAGE_VERSION3 = "0.57.0";
9542
+ var PACKAGE_VERSION3 = "0.59.0";
9422
9543
  var PACKAGE_NAME3 = "@opentelemetry/instrumentation-user-interaction";
9423
9544
 
9424
9545
  // node_modules/@opentelemetry/instrumentation-user-interaction/build/esm/instrumentation.js
@@ -9476,6 +9597,9 @@
9476
9597
  * @param parentSpan
9477
9598
  */
9478
9599
  _createSpan(element, eventName, parentSpan) {
9600
+ if (!this._isEnabled) {
9601
+ return void 0;
9602
+ }
9479
9603
  if (!(element instanceof HTMLElement)) {
9480
9604
  return void 0;
9481
9605
  }
@@ -9679,7 +9803,8 @@
9679
9803
  * Patches the history api
9680
9804
  */
9681
9805
  _patchHistoryApi() {
9682
- this._unpatchHistoryApi();
9806
+ if (!this._isEnabled)
9807
+ return;
9683
9808
  this._wrap(history, "replaceState", this._patchHistoryMethod());
9684
9809
  this._wrap(history, "pushState", this._patchHistoryMethod());
9685
9810
  this._wrap(history, "back", this._patchHistoryMethod());
@@ -9693,6 +9818,9 @@
9693
9818
  const plugin = this;
9694
9819
  return (original) => {
9695
9820
  return function patchHistoryMethod(...args) {
9821
+ if (!plugin._isEnabled) {
9822
+ return original.apply(this, args);
9823
+ }
9696
9824
  const url = `${location.pathname}${location.hash}${location.search}`;
9697
9825
  const result = original.apply(this, args);
9698
9826
  const urlAfter = `${location.pathname}${location.hash}${location.search}`;
@@ -9703,21 +9831,6 @@
9703
9831
  };
9704
9832
  };
9705
9833
  }
9706
- /**
9707
- * unpatch the history api methods
9708
- */
9709
- _unpatchHistoryApi() {
9710
- if (isWrapped(history.replaceState))
9711
- this._unwrap(history, "replaceState");
9712
- if (isWrapped(history.pushState))
9713
- this._unwrap(history, "pushState");
9714
- if (isWrapped(history.back))
9715
- this._unwrap(history, "back");
9716
- if (isWrapped(history.forward))
9717
- this._unwrap(history, "forward");
9718
- if (isWrapped(history.go))
9719
- this._unwrap(history, "go");
9720
- }
9721
9834
  /**
9722
9835
  * Updates interaction span name
9723
9836
  * @param url
@@ -9848,21 +9961,16 @@
9848
9961
  * implements enable function
9849
9962
  */
9850
9963
  enable() {
9964
+ if (this._isEnabled) {
9965
+ return;
9966
+ }
9967
+ this._isEnabled = true;
9968
+ if (typeof this._zonePatched === "boolean") {
9969
+ return;
9970
+ }
9851
9971
  const ZoneWithPrototype = this._getZoneWithPrototype();
9852
9972
  this._diag.debug("applying patch to", this.moduleName, this.version, "zone:", !!ZoneWithPrototype);
9853
9973
  if (ZoneWithPrototype) {
9854
- if (isWrapped(ZoneWithPrototype.prototype.runTask)) {
9855
- this._unwrap(ZoneWithPrototype.prototype, "runTask");
9856
- this._diag.debug("removing previous patch from method runTask");
9857
- }
9858
- if (isWrapped(ZoneWithPrototype.prototype.scheduleTask)) {
9859
- this._unwrap(ZoneWithPrototype.prototype, "scheduleTask");
9860
- this._diag.debug("removing previous patch from method scheduleTask");
9861
- }
9862
- if (isWrapped(ZoneWithPrototype.prototype.cancelTask)) {
9863
- this._unwrap(ZoneWithPrototype.prototype, "cancelTask");
9864
- this._diag.debug("removing previous patch from method cancelTask");
9865
- }
9866
9974
  this._zonePatched = true;
9867
9975
  this._wrap(ZoneWithPrototype.prototype, "runTask", this._patchZoneRunTask());
9868
9976
  this._wrap(ZoneWithPrototype.prototype, "scheduleTask", this._patchZoneScheduleTask());
@@ -9871,14 +9979,6 @@
9871
9979
  this._zonePatched = false;
9872
9980
  const targets = this._getPatchableEventTargets();
9873
9981
  targets.forEach((target) => {
9874
- if (isWrapped(target.addEventListener)) {
9875
- this._unwrap(target, "addEventListener");
9876
- this._diag.debug("removing previous patch from method addEventListener");
9877
- }
9878
- if (isWrapped(target.removeEventListener)) {
9879
- this._unwrap(target, "removeEventListener");
9880
- this._diag.debug("removing previous patch from method removeEventListener");
9881
- }
9882
9982
  this._wrap(target, "addEventListener", this._patchAddEventListener());
9883
9983
  this._wrap(target, "removeEventListener", this._patchRemoveEventListener());
9884
9984
  });
@@ -9889,30 +9989,10 @@
9889
9989
  * implements unpatch function
9890
9990
  */
9891
9991
  disable() {
9892
- const ZoneWithPrototype = this._getZoneWithPrototype();
9893
- this._diag.debug("removing patch from", this.moduleName, this.version, "zone:", !!ZoneWithPrototype);
9894
- if (ZoneWithPrototype && this._zonePatched) {
9895
- if (isWrapped(ZoneWithPrototype.prototype.runTask)) {
9896
- this._unwrap(ZoneWithPrototype.prototype, "runTask");
9897
- }
9898
- if (isWrapped(ZoneWithPrototype.prototype.scheduleTask)) {
9899
- this._unwrap(ZoneWithPrototype.prototype, "scheduleTask");
9900
- }
9901
- if (isWrapped(ZoneWithPrototype.prototype.cancelTask)) {
9902
- this._unwrap(ZoneWithPrototype.prototype, "cancelTask");
9903
- }
9904
- } else {
9905
- const targets = this._getPatchableEventTargets();
9906
- targets.forEach((target) => {
9907
- if (isWrapped(target.addEventListener)) {
9908
- this._unwrap(target, "addEventListener");
9909
- }
9910
- if (isWrapped(target.removeEventListener)) {
9911
- this._unwrap(target, "removeEventListener");
9912
- }
9913
- });
9992
+ if (!this._isEnabled) {
9993
+ return;
9914
9994
  }
9915
- this._unpatchHistoryApi();
9995
+ this._isEnabled = false;
9916
9996
  }
9917
9997
  /**
9918
9998
  * returns Zone
@@ -10040,7 +10120,7 @@
10040
10120
  }
10041
10121
 
10042
10122
  // node_modules/@opentelemetry/instrumentation-xml-http-request/build/esm/version.js
10043
- var VERSION6 = "0.213.0";
10123
+ var VERSION7 = "0.215.0";
10044
10124
 
10045
10125
  // node_modules/@opentelemetry/instrumentation-xml-http-request/build/esm/enums/AttributeNames.js
10046
10126
  var AttributeNames4;
@@ -10052,14 +10132,14 @@
10052
10132
  var OBSERVER_WAIT_TIME_MS2 = 300;
10053
10133
  var XMLHttpRequestInstrumentation = class extends InstrumentationBase {
10054
10134
  component = "xml-http-request";
10055
- version = VERSION6;
10135
+ version = VERSION7;
10056
10136
  moduleName = this.component;
10057
10137
  _tasksCount = 0;
10058
10138
  _xhrMem = /* @__PURE__ */ new WeakMap();
10059
10139
  _usedResources = /* @__PURE__ */ new WeakSet();
10060
10140
  _semconvStability;
10061
10141
  constructor(config = {}) {
10062
- super("@opentelemetry/instrumentation-xml-http-request", VERSION6, config);
10142
+ super("@opentelemetry/instrumentation-xml-http-request", VERSION7, config);
10063
10143
  this._semconvStability = semconvStabilityFromStr("http", config?.semconvStabilityOptIn);
10064
10144
  }
10065
10145
  init() {
@@ -10451,7 +10531,7 @@
10451
10531
  };
10452
10532
 
10453
10533
  // node_modules/@opentelemetry/instrumentation-web-exception/build/esm/version.js
10454
- var PACKAGE_VERSION4 = "0.6.0";
10534
+ var PACKAGE_VERSION4 = "0.8.0";
10455
10535
  var PACKAGE_NAME4 = "@opentelemetry/instrumentation-web-exception";
10456
10536
 
10457
10537
  // node_modules/@opentelemetry/instrumentation-web-exception/build/esm/instrumentation.js
@@ -10504,6 +10584,9 @@
10504
10584
  }
10505
10585
  };
10506
10586
 
10587
+ // node_modules/@opentelemetry/browser-instrumentation/dist/package.js
10588
+ var version = "0.3.0";
10589
+
10507
10590
  // node_modules/@opentelemetry/browser-instrumentation/dist/web-vitals/semconv.js
10508
10591
  var WEB_VITAL_EVENT_NAME = "browser.web_vital";
10509
10592
  var ATTR_WEB_VITAL_NAME = "browser.web_vital.name";
@@ -10530,13 +10613,11 @@
10530
10613
  };
10531
10614
  var n = (t2) => {
10532
10615
  if ("loading" === document.readyState) return "loading";
10533
- {
10534
- const n2 = e();
10535
- if (n2) {
10536
- if (t2 < n2.domInteractive) return "loading";
10537
- if (0 === n2.domContentLoadedEventStart || t2 < n2.domContentLoadedEventStart) return "dom-interactive";
10538
- if (0 === n2.domComplete || t2 < n2.domComplete) return "dom-content-loaded";
10539
- }
10616
+ const n2 = e();
10617
+ if (n2) {
10618
+ if (t2 < n2.domInteractive) return "loading";
10619
+ if (0 === n2.domContentLoadedEventStart || t2 < n2.domContentLoadedEventStart) return "dom-interactive";
10620
+ if (0 === n2.domComplete || t2 < n2.domComplete) return "dom-content-loaded";
10540
10621
  }
10541
10622
  return "complete";
10542
10623
  };
@@ -10563,24 +10644,21 @@
10563
10644
  }
10564
10645
  var a = -1;
10565
10646
  var c = () => a;
10566
- var f = (t2) => {
10567
- addEventListener("pageshow", ((e2) => {
10647
+ var u = (t2) => {
10648
+ addEventListener("pageshow", (e2) => {
10568
10649
  e2.persisted && (a = e2.timeStamp, t2(e2));
10569
- }), true);
10650
+ }, true);
10570
10651
  };
10571
- var u = (t2, e2, n2, o2) => {
10652
+ var f = (t2, e2, n2, o2) => {
10572
10653
  let i2, r2;
10573
10654
  return (s2) => {
10574
10655
  e2.value >= 0 && (s2 || o2) && (r2 = e2.value - (i2 ?? 0), (r2 || void 0 === i2) && (i2 = e2.value, e2.delta = r2, e2.rating = ((t3, e3) => t3 > e3[1] ? "poor" : t3 > e3[0] ? "needs-improvement" : "good")(e2.value, n2), t2(e2)));
10575
10656
  };
10576
10657
  };
10577
10658
  var d = (t2) => {
10578
- requestAnimationFrame((() => requestAnimationFrame((() => t2()))));
10579
- };
10580
- var l = () => {
10581
- const t2 = e();
10582
- return t2?.activationStart ?? 0;
10659
+ requestAnimationFrame(() => requestAnimationFrame(t2));
10583
10660
  };
10661
+ var l = () => e()?.activationStart ?? 0;
10584
10662
  var h = (t2, n2 = -1) => {
10585
10663
  const o2 = e();
10586
10664
  let i2 = "navigate";
@@ -10590,71 +10668,71 @@
10590
10668
  var m = (t2, e2, n2 = {}) => {
10591
10669
  try {
10592
10670
  if (PerformanceObserver.supportedEntryTypes.includes(t2)) {
10593
- const o2 = new PerformanceObserver(((t3) => {
10594
- Promise.resolve().then((() => {
10671
+ const o2 = new PerformanceObserver((t3) => {
10672
+ queueMicrotask(() => {
10595
10673
  e2(t3.getEntries());
10596
- }));
10597
- }));
10674
+ });
10675
+ });
10598
10676
  return o2.observe({ type: t2, buffered: true, ...n2 }), o2;
10599
10677
  }
10600
10678
  } catch {
10601
10679
  }
10602
10680
  };
10603
- var p = (t2) => {
10681
+ var g = (t2) => {
10604
10682
  let e2 = false;
10605
10683
  return () => {
10606
10684
  e2 || (t2(), e2 = true);
10607
10685
  };
10608
10686
  };
10609
- var g = -1;
10687
+ var p = -1;
10610
10688
  var y = /* @__PURE__ */ new Set();
10611
10689
  var v = () => "hidden" !== document.visibilityState || document.prerendering ? 1 / 0 : 0;
10612
10690
  var b = (t2) => {
10613
10691
  if ("hidden" === document.visibilityState) {
10614
10692
  if ("visibilitychange" === t2.type) for (const t3 of y) t3();
10615
- isFinite(g) || (g = "visibilitychange" === t2.type ? t2.timeStamp : 0, removeEventListener("prerenderingchange", b, true));
10693
+ isFinite(p) || (p = "visibilitychange" === t2.type ? t2.timeStamp : 0, removeEventListener("prerenderingchange", b, true));
10616
10694
  }
10617
10695
  };
10618
10696
  var M = () => {
10619
- if (g < 0) {
10620
- const t2 = l(), e2 = document.prerendering ? void 0 : globalThis.performance.getEntriesByType("visibility-state").filter(((e3) => "hidden" === e3.name && e3.startTime > t2))[0]?.startTime;
10621
- g = e2 ?? v(), addEventListener("visibilitychange", b, true), addEventListener("prerenderingchange", b, true), f((() => {
10622
- setTimeout((() => {
10623
- g = v();
10624
- }));
10625
- }));
10697
+ if (p < 0) {
10698
+ const t2 = l(), e2 = document.prerendering ? void 0 : globalThis.performance.getEntriesByType("visibility-state").find((e3) => "hidden" === e3.name && e3.startTime >= t2)?.startTime;
10699
+ p = e2 ?? v(), addEventListener("visibilitychange", b, true), addEventListener("prerenderingchange", b, true), u(() => {
10700
+ setTimeout(() => {
10701
+ p = v();
10702
+ });
10703
+ });
10626
10704
  }
10627
10705
  return { get firstHiddenTime() {
10628
- return g;
10706
+ return p;
10629
10707
  }, onHidden(t2) {
10630
10708
  y.add(t2);
10631
10709
  } };
10632
10710
  };
10633
10711
  var T = (t2) => {
10634
- document.prerendering ? addEventListener("prerenderingchange", (() => t2()), true) : t2();
10712
+ document.prerendering ? addEventListener("prerenderingchange", t2, true) : t2();
10635
10713
  };
10636
10714
  var E = [1800, 3e3];
10637
10715
  var D = (t2, e2 = {}) => {
10638
- T((() => {
10716
+ T(() => {
10639
10717
  const n2 = M();
10640
10718
  let o2, i2 = h("FCP");
10641
- const r2 = m("paint", ((t3) => {
10719
+ const r2 = m("paint", (t3) => {
10642
10720
  for (const e3 of t3) "first-contentful-paint" === e3.name && (r2.disconnect(), e3.startTime < n2.firstHiddenTime && (i2.value = Math.max(e3.startTime - l(), 0), i2.entries.push(e3), o2(true)));
10643
- }));
10644
- r2 && (o2 = u(t2, i2, E, e2.reportAllChanges), f(((n3) => {
10645
- i2 = h("FCP"), o2 = u(t2, i2, E, e2.reportAllChanges), d((() => {
10721
+ });
10722
+ r2 && (o2 = f(t2, i2, E, e2.reportAllChanges), u((n3) => {
10723
+ i2 = h("FCP"), o2 = f(t2, i2, E, e2.reportAllChanges), d(() => {
10646
10724
  i2.value = performance.now() - n3.timeStamp, o2(true);
10647
- }));
10648
- })));
10649
- }));
10725
+ });
10726
+ }));
10727
+ });
10650
10728
  };
10651
10729
  var L = [0.1, 0.25];
10652
- var P = (t2) => t2.find(((t3) => 1 === t3.node?.nodeType)) || t2[0];
10653
- var S = (e2, o2 = {}) => {
10730
+ var S = (t2) => t2.find((t3) => 1 === t3.node?.nodeType) || t2[0];
10731
+ var P = (e2, o2 = {}) => {
10654
10732
  const r2 = s(o2 = Object.assign({}, o2), t), a2 = /* @__PURE__ */ new WeakMap();
10655
10733
  r2.t = (t2) => {
10656
10734
  if (t2?.sources?.length) {
10657
- const e3 = P(t2.sources), n2 = e3?.node;
10735
+ const e3 = S(t2.sources), n2 = e3?.node;
10658
10736
  if (n2) {
10659
10737
  const t3 = o2.generateTarget?.(n2) ?? i(n2);
10660
10738
  a2.set(e3, t3);
@@ -10663,59 +10741,57 @@
10663
10741
  };
10664
10742
  ((e3, n2 = {}) => {
10665
10743
  const o3 = M();
10666
- D(p((() => {
10744
+ D(g(() => {
10667
10745
  let i2, r3 = h("CLS", 0);
10668
10746
  const a3 = s(n2, t), c2 = (t2) => {
10669
10747
  for (const e4 of t2) a3.u(e4);
10670
10748
  a3.o > r3.value && (r3.value = a3.o, r3.entries = a3.i, i2());
10671
10749
  }, l2 = m("layout-shift", c2);
10672
- l2 && (i2 = u(e3, r3, L, n2.reportAllChanges), o3.onHidden((() => {
10750
+ l2 && (i2 = f(e3, r3, L, n2.reportAllChanges), o3.onHidden(() => {
10673
10751
  c2(l2.takeRecords()), i2(true);
10674
- })), f((() => {
10675
- a3.o = 0, r3 = h("CLS", 0), i2 = u(e3, r3, L, n2.reportAllChanges), d((() => i2()));
10676
- })), setTimeout(i2));
10677
- })));
10678
- })(((t2) => {
10679
- const o3 = ((t3) => {
10752
+ }), u(() => {
10753
+ a3.o = 0, r3 = h("CLS", 0), i2 = f(e3, r3, L, n2.reportAllChanges), d(i2);
10754
+ }), setTimeout(i2));
10755
+ }));
10756
+ })((t2) => {
10757
+ e2(((t3) => {
10680
10758
  let e3 = {};
10681
10759
  if (t3.entries.length) {
10682
- const o4 = t3.entries.reduce(((t4, e4) => t4.value > e4.value ? t4 : e4));
10683
- if (o4?.sources?.length) {
10684
- const t4 = P(o4.sources);
10685
- t4 && (e3 = { largestShiftTarget: a2.get(t4), largestShiftTime: o4.startTime, largestShiftValue: o4.value, largestShiftSource: t4, largestShiftEntry: o4, loadState: n(o4.startTime) });
10760
+ const o3 = t3.entries.reduce((t4, e4) => t4.value > e4.value ? t4 : e4);
10761
+ if (o3?.sources?.length) {
10762
+ const t4 = S(o3.sources);
10763
+ t4 && (e3 = { largestShiftTarget: a2.get(t4), largestShiftTime: o3.startTime, largestShiftValue: o3.value, largestShiftSource: t4, largestShiftEntry: o3, loadState: n(o3.startTime) });
10686
10764
  }
10687
10765
  }
10688
10766
  return Object.assign(t3, { attribution: e3 });
10689
- })(t2);
10690
- e2(o3);
10691
- }), o2);
10767
+ })(t2));
10768
+ }, o2);
10692
10769
  };
10693
10770
  var w = (t2, o2 = {}) => {
10694
- D(((o3) => {
10695
- const i2 = ((t3) => {
10771
+ D((o3) => {
10772
+ t2(((t3) => {
10696
10773
  let o4 = { timeToFirstByte: 0, firstByteToFCP: t3.value, loadState: n(c()) };
10697
10774
  if (t3.entries.length) {
10698
- const i3 = e(), r2 = t3.entries.at(-1);
10699
- if (i3) {
10700
- const e2 = i3.activationStart || 0, s2 = Math.max(0, i3.responseStart - e2);
10701
- o4 = { timeToFirstByte: s2, firstByteToFCP: t3.value - s2, loadState: n(t3.entries[0].startTime), navigationEntry: i3, fcpEntry: r2 };
10775
+ const i2 = e(), r2 = t3.entries.at(-1);
10776
+ if (i2) {
10777
+ const e2 = i2.activationStart || 0, s2 = Math.max(0, i2.responseStart - e2);
10778
+ o4 = { timeToFirstByte: s2, firstByteToFCP: t3.value - s2, loadState: n(t3.entries[0].startTime), navigationEntry: i2, fcpEntry: r2 };
10702
10779
  }
10703
10780
  }
10704
10781
  return Object.assign(t3, { attribution: o4 });
10705
- })(o3);
10706
- t2(i2);
10707
- }), o2);
10782
+ })(o3));
10783
+ }, o2);
10708
10784
  };
10709
10785
  var _ = 0;
10710
- var F = 1 / 0;
10711
- var k = 0;
10786
+ var k = 1 / 0;
10787
+ var F = 0;
10712
10788
  var B = (t2) => {
10713
- for (const e2 of t2) e2.interactionId && (F = Math.min(F, e2.interactionId), k = Math.max(k, e2.interactionId), _ = k ? (k - F) / 7 + 1 : 0);
10789
+ for (const e2 of t2) e2.interactionId && (k = Math.min(k, e2.interactionId), F = Math.max(F, e2.interactionId), _ = F ? (F - k) / 7 + 1 : 0);
10714
10790
  };
10715
10791
  var C;
10716
10792
  var O = () => C ? _ : performance.interactionCount ?? 0;
10717
10793
  var j = () => {
10718
- "interactionCount" in performance || C || (C = m("event", B, { type: "event", buffered: true, durationThreshold: 0 }));
10794
+ "interactionCount" in performance || C || (C = m("event", B, { durationThreshold: 0 }));
10719
10795
  };
10720
10796
  var I = 0;
10721
10797
  var A = class {
@@ -10735,7 +10811,7 @@
10735
10811
  const e2 = this.l.at(-1);
10736
10812
  let n2 = this.h.get(t2.interactionId);
10737
10813
  if (n2 || this.l.length < 10 || t2.duration > e2.T) {
10738
- if (n2 ? t2.duration > n2.T ? (n2.entries = [t2], n2.T = t2.duration) : t2.duration === n2.T && t2.startTime === n2.entries[0].startTime && n2.entries.push(t2) : (n2 = { id: t2.interactionId, entries: [t2], T: t2.duration }, this.h.set(n2.id, n2), this.l.push(n2)), this.l.sort(((t3, e3) => e3.T - t3.T)), this.l.length > 10) {
10814
+ if (n2 ? t2.duration > n2.T ? (n2.entries = [t2], n2.T = t2.duration) : t2.duration === n2.T && t2.startTime === n2.entries[0].startTime && n2.entries.push(t2) : (n2 = { id: t2.interactionId, entries: [t2], T: t2.duration }, this.h.set(n2.id, n2), this.l.push(n2)), this.l.sort((t3, e3) => e3.T - t3.T), this.l.length > 10) {
10739
10815
  const t3 = this.l.splice(10);
10740
10816
  for (const e3 of t3) this.h.delete(e3.id);
10741
10817
  }
@@ -10743,43 +10819,50 @@
10743
10819
  }
10744
10820
  }
10745
10821
  };
10746
- var W = (t2) => {
10747
- const e2 = globalThis.requestIdleCallback || setTimeout;
10748
- "hidden" === document.visibilityState ? t2() : (t2 = p(t2), addEventListener("visibilitychange", t2, { once: true, capture: true }), e2((() => {
10749
- t2(), removeEventListener("visibilitychange", t2, { capture: true });
10750
- })));
10822
+ var q = (t2) => {
10823
+ const e2 = globalThis.requestIdleCallback || setTimeout, n2 = globalThis.cancelIdleCallback || clearTimeout;
10824
+ if ("hidden" === document.visibilityState) t2();
10825
+ else {
10826
+ const o2 = g(t2);
10827
+ let i2 = -1;
10828
+ const r2 = () => {
10829
+ n2(i2), o2();
10830
+ };
10831
+ addEventListener("visibilitychange", r2, { once: true, capture: true }), i2 = e2(() => {
10832
+ removeEventListener("visibilitychange", r2, { capture: true }), o2();
10833
+ });
10834
+ }
10751
10835
  };
10752
- var q = [200, 500];
10836
+ var W = [200, 500];
10753
10837
  var x = (t2, e2 = {}) => {
10754
10838
  const o2 = s(e2 = Object.assign({}, e2), A);
10755
10839
  let r2 = [], a2 = [], c2 = 0;
10756
10840
  const d2 = /* @__PURE__ */ new WeakMap(), l2 = /* @__PURE__ */ new WeakMap();
10757
- let p2 = false;
10758
- const g2 = () => {
10759
- p2 || (W(y2), p2 = true);
10841
+ let g2 = false;
10842
+ const p2 = () => {
10843
+ g2 || (q(y2), g2 = true);
10760
10844
  }, y2 = () => {
10761
- const t3 = o2.l.map(((t4) => d2.get(t4.entries[0]))), e3 = a2.length - 50;
10762
- a2 = a2.filter(((n3, o3) => o3 >= e3 || t3.includes(n3)));
10845
+ const t3 = new Set(o2.l.map((t4) => d2.get(t4.entries[0]))), e3 = a2.length - 10;
10846
+ a2 = a2.filter((n3, o3) => o3 >= e3 || t3.has(n3));
10763
10847
  const n2 = /* @__PURE__ */ new Set();
10764
10848
  for (const t4 of a2) {
10765
10849
  const e4 = v2(t4.startTime, t4.processingEnd);
10766
10850
  for (const t5 of e4) n2.add(t5);
10767
10851
  }
10768
- const i2 = r2.length - 1 - 50;
10769
- r2 = r2.filter(((t4, e4) => t4.startTime > c2 && e4 > i2 || n2.has(t4))), p2 = false;
10852
+ r2 = r2.filter((t4) => t4.startTime > c2 || n2.has(t4)), g2 = false;
10770
10853
  };
10771
10854
  o2.m = (t3) => {
10772
- const e3 = t3.startTime + t3.duration;
10773
- let n2;
10855
+ const n2 = t3.startTime + t3.duration;
10856
+ let o3;
10774
10857
  c2 = Math.max(c2, t3.processingEnd);
10775
- for (let o3 = a2.length - 1; o3 >= 0; o3--) {
10776
- const i2 = a2[o3];
10777
- if (Math.abs(e3 - i2.renderTime) <= 8) {
10778
- n2 = i2, n2.startTime = Math.min(t3.startTime, n2.startTime), n2.processingStart = Math.min(t3.processingStart, n2.processingStart), n2.processingEnd = Math.max(t3.processingEnd, n2.processingEnd), n2.entries.push(t3);
10858
+ for (let i2 = a2.length - 1; i2 >= 0; i2--) {
10859
+ const r3 = a2[i2];
10860
+ if (Math.abs(n2 - r3.renderTime) <= 8) {
10861
+ o3 = r3, o3.startTime = Math.min(t3.startTime, o3.startTime), o3.processingStart = Math.min(t3.processingStart, o3.processingStart), o3.processingEnd = Math.max(t3.processingEnd, o3.processingEnd), false !== e2.includeProcessedEventEntries && o3.entries.push(t3);
10779
10862
  break;
10780
10863
  }
10781
10864
  }
10782
- n2 || (n2 = { startTime: t3.startTime, processingStart: t3.processingStart, processingEnd: t3.processingEnd, renderTime: e3, entries: [t3] }, a2.push(n2)), (t3.interactionId || "first-input" === t3.entryType) && d2.set(t3, n2), g2();
10865
+ o3 || (o3 = { startTime: t3.startTime, processingStart: t3.processingStart, processingEnd: t3.processingEnd, renderTime: n2, entries: false !== e2.includeProcessedEventEntries ? [t3] : [] }, a2.push(o3)), (t3.interactionId || "first-input" === t3.entryType) && d2.set(t3, o3), p2();
10783
10866
  }, o2.p = (t3) => {
10784
10867
  if (!l2.get(t3)) {
10785
10868
  const n2 = t3.entries[0].target;
@@ -10797,50 +10880,48 @@
10797
10880
  }
10798
10881
  return n2;
10799
10882
  }, b2 = (t3) => {
10800
- const e3 = t3.entries[0], i2 = d2.get(e3), r3 = e3.processingStart, s2 = Math.max(e3.startTime + e3.duration, r3), a3 = Math.min(i2.processingEnd, s2), c3 = i2.entries.sort(((t4, e4) => t4.processingStart - e4.processingStart)), f2 = v2(e3.startTime, a3), u2 = o2.h.get(e3.interactionId), h2 = { interactionTarget: l2.get(u2), interactionType: e3.name.startsWith("key") ? "keyboard" : "pointer", interactionTime: e3.startTime, nextPaintTime: s2, processedEventEntries: c3, longAnimationFrameEntries: f2, inputDelay: r3 - e3.startTime, processingDuration: a3 - r3, presentationDelay: s2 - a3, loadState: n(e3.startTime), longestScript: void 0, totalScriptDuration: void 0, totalStyleAndLayoutDuration: void 0, totalPaintDuration: void 0, totalUnattributedDuration: void 0 };
10801
- ((t4) => {
10883
+ const e3 = t3.entries[0], i2 = d2.get(e3), r3 = e3.processingStart, s2 = Math.max(e3.startTime + e3.duration, r3), a3 = Math.min(i2.processingEnd, s2), c3 = i2.entries.sort((t4, e4) => t4.processingStart - e4.processingStart), u2 = v2(e3.startTime, a3), f2 = o2.h.get(e3.interactionId), h2 = { interactionTarget: l2.get(f2), interactionType: e3.name.startsWith("key") ? "keyboard" : "pointer", interactionTime: e3.startTime, nextPaintTime: s2, processedEventEntries: c3, longAnimationFrameEntries: u2, inputDelay: r3 - e3.startTime, processingDuration: a3 - r3, presentationDelay: s2 - a3, loadState: n(e3.startTime), longestScript: void 0, totalScriptDuration: void 0, totalStyleAndLayoutDuration: void 0, totalPaintDuration: void 0, totalUnattributedDuration: void 0 };
10884
+ return ((t4) => {
10802
10885
  if (!t4.longAnimationFrameEntries?.length) return;
10803
10886
  const e4 = t4.interactionTime, n2 = t4.inputDelay, o3 = t4.processingDuration;
10804
- let i3, r4, s3 = 0, a4 = 0, c4 = 0, f3 = 0;
10887
+ let i3, r4, s3 = 0, a4 = 0, c4 = 0, u3 = 0;
10805
10888
  for (const c5 of t4.longAnimationFrameEntries) {
10806
10889
  a4 = a4 + c5.startTime + c5.duration - c5.styleAndLayoutStart;
10807
10890
  for (const t5 of c5.scripts) {
10808
10891
  const c6 = t5.startTime + t5.duration;
10809
10892
  if (c6 < e4) continue;
10810
- const u4 = c6 - Math.max(e4, t5.startTime), d4 = t5.duration ? u4 / t5.duration * t5.forcedStyleAndLayoutDuration : 0;
10811
- s3 += u4 - d4, a4 += d4, u4 > f3 && (r4 = t5.startTime < e4 + n2 ? "input-delay" : t5.startTime >= e4 + n2 + o3 ? "presentation-delay" : "processing-duration", i3 = t5, f3 = u4);
10893
+ const f4 = c6 - Math.max(e4, t5.startTime), d4 = t5.duration ? f4 / t5.duration * t5.forcedStyleAndLayoutDuration : 0;
10894
+ s3 += f4 - d4, a4 += d4, f4 > u3 && (r4 = t5.startTime < e4 + n2 ? "input-delay" : t5.startTime >= e4 + n2 + o3 ? "presentation-delay" : "processing-duration", i3 = t5, u3 = f4);
10812
10895
  }
10813
10896
  }
10814
- const u3 = t4.longAnimationFrameEntries.at(-1), d3 = u3 ? u3.startTime + u3.duration : 0;
10815
- d3 >= e4 + n2 + o3 && (c4 = t4.nextPaintTime - d3), i3 && r4 && (t4.longestScript = { entry: i3, subpart: r4, intersectingDuration: f3 }), t4.totalScriptDuration = s3, t4.totalStyleAndLayoutDuration = a4, t4.totalPaintDuration = c4, t4.totalUnattributedDuration = t4.nextPaintTime - e4 - s3 - a4 - c4;
10816
- })(h2);
10817
- return Object.assign(t3, { attribution: h2 });
10897
+ const f3 = t4.longAnimationFrameEntries.at(-1), d3 = f3 ? f3.startTime + f3.duration : 0;
10898
+ d3 >= e4 + n2 + o3 && (c4 = t4.nextPaintTime - d3), i3 && r4 && (t4.longestScript = { entry: i3, subpart: r4, intersectingDuration: u3 }), t4.totalScriptDuration = s3, t4.totalStyleAndLayoutDuration = a4, t4.totalPaintDuration = c4, t4.totalUnattributedDuration = t4.nextPaintTime - e4 - s3 - a4 - c4;
10899
+ })(h2), Object.assign(t3, { attribution: h2 });
10818
10900
  };
10819
- m("long-animation-frame", ((t3) => {
10820
- r2 = r2.concat(t3), g2();
10821
- })), ((t3, e3 = {}) => {
10901
+ m("long-animation-frame", (t3) => {
10902
+ r2 = r2.concat(t3), p2();
10903
+ }), ((t3, e3 = {}) => {
10822
10904
  if (!globalThis.PerformanceEventTiming || !("interactionId" in PerformanceEventTiming.prototype)) return;
10823
10905
  const n2 = M();
10824
- T((() => {
10906
+ T(() => {
10825
10907
  j();
10826
10908
  let o3, i2 = h("INP");
10827
10909
  const r3 = s(e3, A), a3 = (t4) => {
10828
- W((() => {
10910
+ q(() => {
10829
10911
  for (const e5 of t4) r3.u(e5);
10830
10912
  const e4 = r3.M();
10831
10913
  e4 && e4.T !== i2.value && (i2.value = e4.T, i2.entries = e4.entries, o3());
10832
- }));
10914
+ });
10833
10915
  }, c3 = m("event", a3, { durationThreshold: e3.durationThreshold ?? 40 });
10834
- o3 = u(t3, i2, q, e3.reportAllChanges), c3 && (c3.observe({ type: "first-input", buffered: true }), n2.onHidden((() => {
10916
+ o3 = f(t3, i2, W, e3.reportAllChanges), c3 && (c3.observe({ type: "first-input", buffered: true }), n2.onHidden(() => {
10835
10917
  a3(c3.takeRecords()), o3(true);
10836
- })), f((() => {
10837
- r3.v(), i2 = h("INP"), o3 = u(t3, i2, q, e3.reportAllChanges);
10838
- })));
10839
- }));
10840
- })(((e3) => {
10841
- const n2 = b2(e3);
10842
- t2(n2);
10843
- }), e2);
10918
+ }), u(() => {
10919
+ r3.v(), i2 = h("INP"), o3 = f(t3, i2, W, e3.reportAllChanges);
10920
+ }));
10921
+ });
10922
+ })((e3) => {
10923
+ t2(b2(e3));
10924
+ }, e2);
10844
10925
  };
10845
10926
  var N = class {
10846
10927
  m;
@@ -10848,18 +10929,18 @@
10848
10929
  this.m?.(t2);
10849
10930
  }
10850
10931
  };
10851
- var H = [2500, 4e3];
10852
- var R = (t2, n2 = {}) => {
10932
+ var $ = [2500, 4e3];
10933
+ var H = (t2, n2 = {}) => {
10853
10934
  const o2 = s(n2 = Object.assign({}, n2), N), r2 = /* @__PURE__ */ new WeakMap();
10854
10935
  o2.m = (t3) => {
10855
10936
  const e2 = t3.element;
10856
10937
  if (e2) {
10857
10938
  const o3 = n2.generateTarget?.(e2) ?? i(e2);
10858
10939
  r2.set(t3, o3);
10859
- }
10940
+ } else t3.id && r2.set(t3, `#${t3.id}`);
10860
10941
  };
10861
10942
  ((t3, e2 = {}) => {
10862
- T((() => {
10943
+ T(() => {
10863
10944
  const n3 = M();
10864
10945
  let o3, i2 = h("LCP");
10865
10946
  const r3 = s(e2, N), a2 = (t4) => {
@@ -10867,59 +10948,59 @@
10867
10948
  for (const e3 of t4) r3.u(e3), e3.startTime < n3.firstHiddenTime && (i2.value = Math.max(e3.startTime - l(), 0), i2.entries = [e3], o3());
10868
10949
  }, c2 = m("largest-contentful-paint", a2);
10869
10950
  if (c2) {
10870
- o3 = u(t3, i2, H, e2.reportAllChanges);
10871
- const n4 = p((() => {
10951
+ o3 = f(t3, i2, $, e2.reportAllChanges);
10952
+ const n4 = g(() => {
10872
10953
  a2(c2.takeRecords()), c2.disconnect(), o3(true);
10873
- })), r4 = (t4) => {
10874
- t4.isTrusted && (W(n4), removeEventListener(t4.type, r4, { capture: true }));
10954
+ }), r4 = (t4) => {
10955
+ t4.isTrusted && (q(n4), removeEventListener(t4.type, r4, { capture: true }));
10875
10956
  };
10876
10957
  for (const t4 of ["keydown", "click", "visibilitychange"]) addEventListener(t4, r4, { capture: true });
10877
- f(((n5) => {
10878
- i2 = h("LCP"), o3 = u(t3, i2, H, e2.reportAllChanges), d((() => {
10958
+ u((n5) => {
10959
+ i2 = h("LCP"), o3 = f(t3, i2, $, e2.reportAllChanges), d(() => {
10879
10960
  i2.value = performance.now() - n5.timeStamp, o3(true);
10880
- }));
10881
- }));
10961
+ });
10962
+ });
10882
10963
  }
10883
- }));
10884
- })(((n3) => {
10885
- const o3 = ((t3) => {
10964
+ });
10965
+ })((n3) => {
10966
+ t2(((t3) => {
10886
10967
  let n4 = { timeToFirstByte: 0, resourceLoadDelay: 0, resourceLoadDuration: 0, elementRenderDelay: t3.value };
10887
10968
  if (t3.entries.length) {
10888
- const o4 = e();
10889
- if (o4) {
10890
- const e2 = o4.activationStart || 0, i2 = t3.entries.at(-1), s2 = i2.url && performance.getEntriesByType("resource").filter(((t4) => t4.name === i2.url))[0], a2 = Math.max(0, o4.responseStart - e2), c2 = Math.max(a2, s2 ? (s2.requestStart || s2.startTime) - e2 : 0), f2 = Math.min(t3.value, Math.max(c2, s2 ? s2.responseEnd - e2 : 0));
10891
- n4 = { target: r2.get(i2), timeToFirstByte: a2, resourceLoadDelay: c2 - a2, resourceLoadDuration: f2 - c2, elementRenderDelay: t3.value - f2, navigationEntry: o4, lcpEntry: i2 }, i2.url && (n4.url = i2.url), s2 && (n4.lcpResourceEntry = s2);
10969
+ const o3 = t3.entries.at(-1), i2 = o3.url && performance.getEntriesByType("resource").find((t4) => t4.name === o3.url);
10970
+ n4.target = r2.get(o3), n4.lcpEntry = o3, o3.url && (n4.url = o3.url), i2 && (n4.lcpResourceEntry = i2);
10971
+ const s2 = e();
10972
+ if (s2) {
10973
+ const e2 = s2.activationStart || 0, o4 = Math.max(0, s2.responseStart - e2), r3 = Math.max(o4, i2 ? (i2.requestStart || i2.startTime) - e2 : 0), a2 = Math.min(t3.value, Math.max(r3, i2 ? i2.responseEnd - e2 : 0));
10974
+ n4 = { ...n4, timeToFirstByte: o4, resourceLoadDelay: r3 - o4, resourceLoadDuration: a2 - r3, elementRenderDelay: t3.value - a2, navigationEntry: s2 };
10892
10975
  }
10893
10976
  }
10894
10977
  return Object.assign(t3, { attribution: n4 });
10895
- })(n3);
10896
- t2(o3);
10897
- }), n2);
10978
+ })(n3));
10979
+ }, n2);
10898
10980
  };
10899
- var U = [800, 1800];
10900
- var V = (t2) => {
10901
- document.prerendering ? T((() => V(t2))) : "complete" !== document.readyState ? addEventListener("load", (() => V(t2)), true) : setTimeout(t2);
10981
+ var R = [800, 1800];
10982
+ var U = (t2) => {
10983
+ document.prerendering ? T(() => U(t2)) : "complete" !== document.readyState ? addEventListener("load", () => U(t2), true) : setTimeout(t2);
10902
10984
  };
10903
- var $ = (t2, n2 = {}) => {
10985
+ var V = (t2, n2 = {}) => {
10904
10986
  ((t3, n3 = {}) => {
10905
- let o2 = h("TTFB"), i2 = u(t3, o2, U, n3.reportAllChanges);
10906
- V((() => {
10987
+ let o2 = h("TTFB"), i2 = f(t3, o2, R, n3.reportAllChanges);
10988
+ U(() => {
10907
10989
  const r2 = e();
10908
- r2 && (o2.value = Math.max(r2.responseStart - l(), 0), o2.entries = [r2], i2(true), f((() => {
10909
- o2 = h("TTFB", 0), i2 = u(t3, o2, U, n3.reportAllChanges), i2(true);
10910
- })));
10911
- }));
10912
- })(((e2) => {
10913
- const n3 = ((t3) => {
10990
+ r2 && (o2.value = Math.max(r2.responseStart - l(), 0), o2.entries = [r2], i2(true), u(() => {
10991
+ o2 = h("TTFB", 0), i2 = f(t3, o2, R, n3.reportAllChanges), i2(true);
10992
+ }));
10993
+ });
10994
+ })((e2) => {
10995
+ t2(((t3) => {
10914
10996
  let e3 = { waitingDuration: 0, cacheDuration: 0, dnsDuration: 0, connectionDuration: 0, requestDuration: 0 };
10915
10997
  if (t3.entries.length) {
10916
- const n4 = t3.entries[0], o2 = n4.activationStart || 0, i2 = Math.max((n4.workerStart || n4.fetchStart) - o2, 0), r2 = Math.max(n4.domainLookupStart - o2, 0), s2 = Math.max(n4.connectStart - o2, 0), a2 = Math.max(n4.connectEnd - o2, 0);
10917
- e3 = { waitingDuration: i2, cacheDuration: r2 - i2, dnsDuration: s2 - r2, connectionDuration: a2 - s2, requestDuration: t3.value - a2, navigationEntry: n4 };
10998
+ const n3 = t3.entries[0], o2 = n3.activationStart || 0, i2 = Math.max((n3.workerStart || n3.fetchStart) - o2, 0), r2 = Math.max(n3.domainLookupStart - o2, 0), s2 = Math.max(n3.connectStart - o2, 0), a2 = Math.max(n3.connectEnd - o2, 0);
10999
+ e3 = { waitingDuration: i2, cacheDuration: r2 - i2, dnsDuration: s2 - r2, connectionDuration: a2 - s2, requestDuration: t3.value - a2, navigationEntry: n3 };
10918
11000
  }
10919
11001
  return Object.assign(t3, { attribution: e3 });
10920
- })(e2);
10921
- t2(n3);
10922
- }), n2);
11002
+ })(e2));
11003
+ }, n2);
10923
11004
  };
10924
11005
 
10925
11006
  // node_modules/@opentelemetry/browser-instrumentation/dist/web-vitals/instrumentation.js
@@ -10927,7 +11008,7 @@
10927
11008
  _applyCustomLogRecordData;
10928
11009
  _includeRawAttribution;
10929
11010
  constructor(config = {}) {
10930
- super("@opentelemetry/instrumentation-web-vitals", "0.1.0", config);
11011
+ super("@opentelemetry/browser-instrumentation/web-vitals", version, config);
10931
11012
  this._applyCustomLogRecordData = config.applyCustomLogRecordData;
10932
11013
  this._includeRawAttribution = config.includeRawAttribution ?? false;
10933
11014
  }
@@ -10950,11 +11031,11 @@
10950
11031
  }
10951
11032
  this._listenersRegistered = true;
10952
11033
  this._diag.debug(`Registering listeners`);
10953
- S((metric) => this._emitWebVital(metric));
11034
+ P((metric) => this._emitWebVital(metric));
10954
11035
  x((metric) => this._emitWebVital(metric));
10955
- R((metric) => this._emitWebVital(metric));
11036
+ H((metric) => this._emitWebVital(metric));
10956
11037
  w((metric) => this._emitWebVital(metric));
10957
- $((metric) => this._emitWebVital(metric));
11038
+ V((metric) => this._emitWebVital(metric));
10958
11039
  }
10959
11040
  /**
10960
11041
  * Disables the instrumentation, pausing log emission.
@@ -11326,7 +11407,7 @@
11326
11407
  var ATTR_USER_AGENT_ORIGINAL2 = "user_agent.original";
11327
11408
 
11328
11409
  // lib/version.js
11329
- var EDOT_VERSION = "0.1.0";
11410
+ var EDOT_VERSION = "0.2.0";
11330
11411
 
11331
11412
  // lib/detector.js
11332
11413
  function detectResource(attribs, serviceName2, serviceVersion) {
@@ -11387,11 +11468,11 @@
11387
11468
  for (const t2 of tests) {
11388
11469
  const match = t2.exec(userAgent);
11389
11470
  if (match) {
11390
- let version;
11471
+ let version2;
11391
11472
  if (match[1]) {
11392
- version = match[1].replaceAll("_", ".");
11473
+ version2 = match[1].replaceAll("_", ".");
11393
11474
  }
11394
- return { name, version };
11475
+ return { name, version: version2 };
11395
11476
  }
11396
11477
  }
11397
11478
  }
@@ -11464,11 +11545,11 @@
11464
11545
  for (const t2 of tests) {
11465
11546
  const match = t2.exec(userAgent);
11466
11547
  if (match) {
11467
- let version;
11548
+ let version2;
11468
11549
  if (match[1]) {
11469
- version = match[1].replaceAll("_", ".");
11550
+ version2 = match[1].replaceAll("_", ".");
11470
11551
  }
11471
- return { name, version };
11552
+ return { name, version: version2 };
11472
11553
  }
11473
11554
  }
11474
11555
  }