diff --git a/package.json b/package.json index 2b3bb20..ebc929e 100644 --- a/package.json +++ b/package.json @@ -35,18 +35,18 @@ "@langfuse/otel": "^5.4.1", "@langfuse/tracing": "^5.4.1", "@opentelemetry/api": "^1.9.0", - "@opentelemetry/core": "^2.0.1", - "@opentelemetry/exporter-trace-otlp-http": "^0.205.0", - "@opentelemetry/sdk-trace-base": "^2.0.1", - "@opentelemetry/sdk-trace-node": "^2.0.1", + "@opentelemetry/core": "^2.10.0", + "@opentelemetry/exporter-trace-otlp-http": "^0.221.0", + "@opentelemetry/sdk-trace-base": "^2.10.0", + "@opentelemetry/sdk-trace-node": "^2.10.0", "zod": "^4.1.13" }, "devDependencies": { "@types/node": "^22.10.0", "prettier": "^3.9.4", - "tsdown": "^0.18.0", + "tsdown": "^0.22.14", "typescript": "^5.7.2", - "vitest": "^4.0.0" + "vitest": "^4.1.11" }, "engines": { "node": ">=22" diff --git a/plugins/tracing/dist/index.mjs b/plugins/tracing/dist/index.mjs index f6887d3..44f49d5 100644 --- a/plugins/tracing/dist/index.mjs +++ b/plugins/tracing/dist/index.mjs @@ -1,20 +1,29 @@ import { createRequire } from "node:module"; -import * as fs from "node:fs/promises"; -import * as os$2 from "node:os"; -import * as path from "node:path"; +import * as fs$1 from "node:fs/promises"; +import * as os$1 from "node:os"; +import * as path$1 from "node:path"; +import * as fs from "fs"; import * as zlib from "zlib"; import { Readable } from "stream"; +import * as path from "path"; -//#region rolldown:runtime +//#region \0rolldown/runtime.js var __create = Object.create; var __defProp$1 = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res); -var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); -var __exportAll = (all, symbols) => { +var __esmMin = (fn, res, err) => () => { + if (err) throw err[0]; + try { + return fn && (res = fn(fn = 0)), res; + } catch (e) { + throw err = [e], e; + } +}; +var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); +var __exportAll = (all, no_symbols) => { let target = {}; for (var name in all) { __defProp$1(target, name, { @@ -22,7 +31,7 @@ var __exportAll = (all, symbols) => { enumerable: true }); } - if (symbols) { + if (!no_symbols) { __defProp$1(target, Symbol.toStringTag, { value: "Module" }); } return target; @@ -41,17 +50,17 @@ var __copyProps = (to, from, except, desc) => { } return to; }; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", { +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp$1(target, "default", { value: mod, enumerable: true }) : target, mod)); var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp$1({}, "__esModule", { value: true }), mod); -var __require = /* @__PURE__ */ createRequire(import.meta.url); +var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))(); //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js var _a$2; -function $constructor(name, initializer$2, params) { +function $constructor(name, initializer, params) { function init(inst, def) { if (!inst._zod) Object.defineProperty(inst, "_zod", { value: { @@ -63,7 +72,7 @@ function $constructor(name, initializer$2, params) { }); if (inst._zod.traits.has(name)) return; inst._zod.traits.add(name); - initializer$2(inst, def); + initializer(inst, def); const proto = _.prototype; const keys = Object.keys(proto); for (let i = 0; i < keys.length; i++) { @@ -75,10 +84,10 @@ function $constructor(name, initializer$2, params) { class Definition extends Parent {} Object.defineProperty(Definition, "name", { value: name }); function _(def) { - var _a$3; + var _a; const inst = params?.Parent ? new Definition() : this; init(inst, def); - (_a$3 = inst._zod).deferred ?? (_a$3.deferred = []); + (_a = inst._zod).deferred ?? (_a.deferred = []); for (const fn of inst._zod.deferred) fn(); return inst; } @@ -125,7 +134,6 @@ function cached(getter) { Object.defineProperty(this, "value", { value }); return value; } - throw new Error("cached value already set"); } }; } function nullish(input) { @@ -143,10 +151,10 @@ function floatSafeRemainder(val, step) { if (Math.abs(ratio - roundedRatio) < tolerance) return 0; return ratio - roundedRatio; } -const EVALUATING = /* @__PURE__ */ Symbol("evaluating"); -function defineLazy(object$1, key, getter) { +const EVALUATING = /* @__PURE__*/ Symbol("evaluating"); +function defineLazy(object, key, getter) { let value = void 0; - Object.defineProperty(object$1, key, { + Object.defineProperty(object, key, { get() { if (value === EVALUATING) return; if (value === void 0) { @@ -156,7 +164,7 @@ function defineLazy(object$1, key, getter) { return value; }, set(v) { - Object.defineProperty(object$1, key, { value: v }); + Object.defineProperty(object, key, { value: v }); }, configurable: true }); @@ -187,7 +195,7 @@ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace function isObject(data) { return typeof data === "object" && data !== null && !Array.isArray(data); } -const allowsEval = /* @__PURE__ */ cached(() => { +const allowsEval = /* @__PURE__*/ cached(() => { if (globalConfig.jitless) return false; if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false; try { @@ -214,7 +222,7 @@ function shallowClone(o) { if (o instanceof Set) return new Set(o); return o; } -const propertyKeyTypes = /* @__PURE__ */ new Set([ +const propertyKeyTypes = /* @__PURE__*/ new Set([ "string", "number", "symbol" @@ -389,19 +397,19 @@ function explicitlyAborted(x, startIndex = 0) { for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true; return false; } -function prefixIssues(path$1, issues) { +function prefixIssues(path, issues) { return issues.map((iss) => { - var _a$3; - (_a$3 = iss).path ?? (_a$3.path = []); - iss.path.unshift(path$1); + var _a; + (_a = iss).path ?? (_a.path = []); + iss.path.unshift(path); return iss; }); } function unwrapMessage(message) { return typeof message === "string" ? message : message?.message; } -function finalizeIssue(iss, ctx, config$1) { - const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config$1.customError?.(iss)) ?? unwrapMessage(config$1.localeError?.(iss)) ?? "Invalid input"; +function finalizeIssue(iss, ctx, config) { + const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input"; const { inst: _inst, continue: _continue, input: _input, ...rest } = iss; rest.path ?? (rest.path = []); rest.message = message; @@ -444,7 +452,7 @@ const initializer$1 = (inst, def) => { }; const $ZodError = $constructor("$ZodError", initializer$1); const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error }); -function flattenError(error, mapper = (issue$1) => issue$1.message) { +function flattenError(error, mapper = (issue) => issue.message) { const fieldErrors = {}; const formErrors = []; for (const sub of error.issues) if (sub.path.length > 0) { @@ -456,15 +464,15 @@ function flattenError(error, mapper = (issue$1) => issue$1.message) { fieldErrors }; } -function formatError(error, mapper = (issue$1) => issue$1.message) { +function formatError(error, mapper = (issue) => issue.message) { const fieldErrors = { _errors: [] }; - const processError = (error$1, path$1 = []) => { - for (const issue$1 of error$1.issues) if (issue$1.code === "invalid_union" && issue$1.errors.length) issue$1.errors.map((issues) => processError({ issues }, [...path$1, ...issue$1.path])); - else if (issue$1.code === "invalid_key") processError({ issues: issue$1.issues }, [...path$1, ...issue$1.path]); - else if (issue$1.code === "invalid_element") processError({ issues: issue$1.issues }, [...path$1, ...issue$1.path]); + const processError = (error, path = []) => { + for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path])); + else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]); + else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]); else { - const fullpath = [...path$1, ...issue$1.path]; - if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue$1)); + const fullpath = [...path, ...issue.path]; + if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue)); else { let curr = fieldErrors; let i = 0; @@ -473,7 +481,7 @@ function formatError(error, mapper = (issue$1) => issue$1.message) { if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] }; else { curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue$1)); + curr[el]._errors.push(mapper(issue)); } curr = curr[el]; i++; @@ -498,13 +506,12 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => { }, ctx); if (result instanceof Promise) throw new $ZodAsyncError(); if (result.issues.length) { - const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); captureStackTrace(e, _params?.callee); throw e; } return result.value; }; -const parse$1 = /* @__PURE__ */ _parse($ZodRealError); const _parseAsync = (_Err) => async (schema, value, _ctx, params) => { const ctx = _ctx ? { ..._ctx, @@ -516,13 +523,12 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => { }, ctx); if (result instanceof Promise) result = await result; if (result.issues.length) { - const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); captureStackTrace(e, params?.callee); throw e; } return result.value; }; -const parseAsync$1 = /* @__PURE__ */ _parseAsync($ZodRealError); const _safeParse = (_Err) => (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, @@ -541,7 +547,7 @@ const _safeParse = (_Err) => (schema, value, _ctx) => { data: result.value }; }; -const safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError); +const safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError); const _safeParseAsync = (_Err) => async (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, @@ -560,7 +566,7 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => { data: result.value }; }; -const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError); +const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError); const _encode = (_Err) => (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, @@ -568,11 +574,9 @@ const _encode = (_Err) => (schema, value, _ctx) => { } : { direction: "backward" }; return _parse(_Err)(schema, value, ctx); }; -const encode$1 = /* @__PURE__ */ _encode($ZodRealError); const _decode = (_Err) => (schema, value, _ctx) => { return _parse(_Err)(schema, value, _ctx); }; -const decode$1 = /* @__PURE__ */ _decode($ZodRealError); const _encodeAsync = (_Err) => async (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, @@ -580,11 +584,9 @@ const _encodeAsync = (_Err) => async (schema, value, _ctx) => { } : { direction: "backward" }; return _parseAsync(_Err)(schema, value, ctx); }; -const encodeAsync$1 = /* @__PURE__ */ _encodeAsync($ZodRealError); const _decodeAsync = (_Err) => async (schema, value, _ctx) => { return _parseAsync(_Err)(schema, value, _ctx); }; -const decodeAsync$1 = /* @__PURE__ */ _decodeAsync($ZodRealError); const _safeEncode = (_Err) => (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, @@ -592,11 +594,9 @@ const _safeEncode = (_Err) => (schema, value, _ctx) => { } : { direction: "backward" }; return _safeParse(_Err)(schema, value, ctx); }; -const safeEncode$1 = /* @__PURE__ */ _safeEncode($ZodRealError); const _safeDecode = (_Err) => (schema, value, _ctx) => { return _safeParse(_Err)(schema, value, _ctx); }; -const safeDecode$1 = /* @__PURE__ */ _safeDecode($ZodRealError); const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => { const ctx = _ctx ? { ..._ctx, @@ -604,11 +604,9 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => { } : { direction: "backward" }; return _safeParseAsync(_Err)(schema, value, ctx); }; -const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync($ZodRealError); const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => { return _safeParseAsync(_Err)(schema, value, _ctx); }; -const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError); //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js @@ -630,9 +628,9 @@ const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9 /** Returns a regex for validating an RFC 9562/4122 UUID. * * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */ -const uuid = (version$1) => { - if (!version$1) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; - return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$1}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); +const uuid = (version) => { + if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; + return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); }; /** Practical email validation */ const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; @@ -649,25 +647,25 @@ const base64url = /^[A-Za-z0-9_-]*$/; const httpProtocol = /^https?$/; const e164 = /^\+[1-9]\d{6,14}$/; const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`; -const date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`); +const date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`); function timeSource(args) { const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; } function time$1(args) { - return /* @__PURE__ */ new RegExp(`^${timeSource(args)}$`); + return new RegExp(`^${timeSource(args)}$`); } function datetime$1(args) { - const time$2 = timeSource({ precision: args.precision }); + const time = timeSource({ precision: args.precision }); const opts = ["Z"]; if (args.local) opts.push(""); if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); - const timeRegex = `${time$2}(?:${opts.join("|")})`; - return /* @__PURE__ */ new RegExp(`^${dateSource}T(?:${timeRegex})$`); + const timeRegex = `${time}(?:${opts.join("|")})`; + return new RegExp(`^${dateSource}T(?:${timeRegex})$`); } const string$1 = (params) => { const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; - return /* @__PURE__ */ new RegExp(`^${regex}$`); + return new RegExp(`^${regex}$`); }; const integer = /^-?\d+$/; const number$1 = /^-?\d+(?:\.\d+)?$/; @@ -677,25 +675,27 @@ const uppercase = /^[^a-z]*$/; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js -const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { - var _a$3; +const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => { + var _a; inst._zod ?? (inst._zod = {}); inst._zod.def = def; - (_a$3 = inst._zod).onattach ?? (_a$3.onattach = []); + (_a = inst._zod).onattach ?? (_a.onattach = []); }); const numericOriginMap = { number: "number", bigint: "bigint", object: "date" }; -const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => { +const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => { $ZodCheck.init(inst, def); const origin = numericOriginMap[typeof def.value]; - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; + inst._zod.onattach.push((inst) => { + const bag = inst._zod.bag; const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY; - if (def.value < curr) if (def.inclusive) bag.maximum = def.value; - else bag.exclusiveMaximum = def.value; + if (def.value < curr) { + if (def.inclusive) bag.maximum = def.value; + else bag.exclusiveMaximum = def.value; + } }); inst._zod.check = (payload) => { if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return; @@ -710,14 +710,16 @@ const $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (ins }); }; }); -const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => { +const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => { $ZodCheck.init(inst, def); const origin = numericOriginMap[typeof def.value]; - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; + inst._zod.onattach.push((inst) => { + const bag = inst._zod.bag; const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY; - if (def.value > curr) if (def.inclusive) bag.minimum = def.value; - else bag.exclusiveMinimum = def.value; + if (def.value > curr) { + if (def.inclusive) bag.minimum = def.value; + else bag.exclusiveMinimum = def.value; + } }); inst._zod.check = (payload) => { if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return; @@ -732,11 +734,11 @@ const $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan" }); }; }); -const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => { +const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => { $ZodCheck.init(inst, def); - inst._zod.onattach.push((inst$1) => { - var _a$3; - (_a$3 = inst$1._zod.bag).multipleOf ?? (_a$3.multipleOf = def.value); + inst._zod.onattach.push((inst) => { + var _a; + (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value); }); inst._zod.check = (payload) => { if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check."); @@ -751,14 +753,14 @@ const $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", }); }; }); -const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => { +const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => { $ZodCheck.init(inst, def); def.format = def.format || "float64"; const isInt = def.format?.includes("int"); const origin = isInt ? "int" : "number"; const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format]; - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; + inst._zod.onattach.push((inst) => { + const bag = inst._zod.bag; bag.format = def.format; bag.minimum = minimum; bag.maximum = maximum; @@ -822,16 +824,16 @@ const $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberForma }); }; }); -const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => { - var _a$3; +const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => { + var _a; $ZodCheck.init(inst, def); - (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { + (_a = inst._zod.def).when ?? (_a.when = (payload) => { const val = payload.value; return !nullish(val) && val.length !== void 0; }); - inst._zod.onattach.push((inst$1) => { - const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY; - if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum; + inst._zod.onattach.push((inst) => { + const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY; + if (def.maximum < curr) inst._zod.bag.maximum = def.maximum; }); inst._zod.check = (payload) => { const input = payload.value; @@ -848,16 +850,16 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i }); }; }); -const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => { - var _a$3; +const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => { + var _a; $ZodCheck.init(inst, def); - (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { + (_a = inst._zod.def).when ?? (_a.when = (payload) => { const val = payload.value; return !nullish(val) && val.length !== void 0; }); - inst._zod.onattach.push((inst$1) => { - const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; - if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum; + inst._zod.onattach.push((inst) => { + const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; + if (def.minimum > curr) inst._zod.bag.minimum = def.minimum; }); inst._zod.check = (payload) => { const input = payload.value; @@ -874,15 +876,15 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i }); }; }); -const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => { - var _a$3; +const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => { + var _a; $ZodCheck.init(inst, def); - (_a$3 = inst._zod.def).when ?? (_a$3.when = (payload) => { + (_a = inst._zod.def).when ?? (_a.when = (payload) => { const val = payload.value; return !nullish(val) && val.length !== void 0; }); - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; + inst._zod.onattach.push((inst) => { + const bag = inst._zod.bag; bag.minimum = def.length; bag.maximum = def.length; bag.length = def.length; @@ -910,18 +912,18 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual }); }; }); -const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => { - var _a$3, _b; +const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => { + var _a, _b; $ZodCheck.init(inst, def); - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; + inst._zod.onattach.push((inst) => { + const bag = inst._zod.bag; bag.format = def.format; if (def.pattern) { bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); bag.patterns.add(def.pattern); } }); - if (def.pattern) (_a$3 = inst._zod).check ?? (_a$3.check = (payload) => { + if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => { def.pattern.lastIndex = 0; if (def.pattern.test(payload.value)) return; payload.issues.push({ @@ -936,7 +938,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma }); else (_b = inst._zod).check ?? (_b.check = () => {}); }); -const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => { +const $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => { $ZodCheckStringFormat.init(inst, def); inst._zod.check = (payload) => { def.pattern.lastIndex = 0; @@ -952,21 +954,21 @@ const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def }); }; }); -const $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => { +const $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => { def.pattern ?? (def.pattern = lowercase); $ZodCheckStringFormat.init(inst, def); }); -const $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => { +const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => { def.pattern ?? (def.pattern = uppercase); $ZodCheckStringFormat.init(inst, def); }); -const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => { +const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => { $ZodCheck.init(inst, def); const escapedRegex = escapeRegex(def.includes); const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); def.pattern = pattern; - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; + inst._zod.onattach.push((inst) => { + const bag = inst._zod.bag; bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); bag.patterns.add(pattern); }); @@ -983,12 +985,12 @@ const $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (ins }); }; }); -const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => { +const $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => { $ZodCheck.init(inst, def); - const pattern = /* @__PURE__ */ new RegExp(`^${escapeRegex(def.prefix)}.*`); + const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`); def.pattern ?? (def.pattern = pattern); - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; + inst._zod.onattach.push((inst) => { + const bag = inst._zod.bag; bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); bag.patterns.add(pattern); }); @@ -1005,12 +1007,12 @@ const $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", }); }; }); -const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => { +const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => { $ZodCheck.init(inst, def); - const pattern = /* @__PURE__ */ new RegExp(`.*${escapeRegex(def.suffix)}$`); + const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`); def.pattern ?? (def.pattern = pattern); - inst._zod.onattach.push((inst$1) => { - const bag = inst$1._zod.bag; + inst._zod.onattach.push((inst) => { + const bag = inst._zod.bag; bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); bag.patterns.add(pattern); }); @@ -1027,7 +1029,7 @@ const $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (ins }); }; }); -const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => { +const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => { $ZodCheck.init(inst, def); inst._zod.check = (payload) => { payload.value = def.tx(payload.value); @@ -1076,8 +1078,8 @@ const version = { //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js -const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { - var _a$3; +const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => { + var _a; inst ?? (inst = {}); inst._zod.def = def; inst._zod.bag = inst._zod.bag || {}; @@ -1086,15 +1088,15 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst); for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst); if (checks.length === 0) { - (_a$3 = inst._zod).deferred ?? (_a$3.deferred = []); + (_a = inst._zod).deferred ?? (_a.deferred = []); inst._zod.deferred?.push(() => { inst._zod.run = inst._zod.parse; }); } else { - const runChecks = (payload, checks$1, ctx) => { + const runChecks = (payload, checks, ctx) => { let isAborted = aborted(payload); let asyncResult; - for (const ch of checks$1) { + for (const ch of checks) { if (ch._zod.def.when) { if (explicitlyAborted(payload)) continue; if (!ch._zod.def.when(payload)) continue; @@ -1125,7 +1127,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { const checkResult = runChecks(payload, checks, ctx); if (checkResult instanceof Promise) { if (ctx.async === false) throw new $ZodAsyncError(); - return checkResult.then((checkResult$1) => inst._zod.parse(checkResult$1, ctx)); + return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx)); } return inst._zod.parse(checkResult, ctx); }; @@ -1139,15 +1141,15 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { ...ctx, skipChecks: true }); - if (canary instanceof Promise) return canary.then((canary$1) => { - return handleCanaryResult(canary$1, payload, ctx); + if (canary instanceof Promise) return canary.then((canary) => { + return handleCanaryResult(canary, payload, ctx); }); return handleCanaryResult(canary, payload, ctx); } const result = inst._zod.parse(payload, ctx); if (result instanceof Promise) { if (ctx.async === false) throw new $ZodAsyncError(); - return result.then((result$1) => runChecks(result$1, checks, ctx)); + return result.then((result) => runChecks(result, checks, ctx)); } return runChecks(result, checks, ctx); }; @@ -1165,13 +1167,13 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { version: 1 })); }); -const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => { +const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag); inst._zod.parse = (payload, _) => { if (def.coerce) try { payload.value = String(payload.value); - } catch (_$1) {} + } catch (_) {} if (typeof payload.value === "string") return payload; payload.issues.push({ expected: "string", @@ -1182,15 +1184,15 @@ const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => { return payload; }; }); -const $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => { +const $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => { $ZodCheckStringFormat.init(inst, def); $ZodString.init(inst, def); }); -const $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => { +const $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => { def.pattern ?? (def.pattern = guid); $ZodStringFormat.init(inst, def); }); -const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => { +const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => { if (def.version) { const v = { v1: 1, @@ -1207,11 +1209,11 @@ const $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => { } else def.pattern ?? (def.pattern = uuid()); $ZodStringFormat.init(inst, def); }); -const $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => { +const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => { def.pattern ?? (def.pattern = email); $ZodStringFormat.init(inst, def); }); -const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => { +const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => { $ZodStringFormat.init(inst, def); inst._zod.check = (payload) => { try { @@ -1268,11 +1270,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => { } }; }); -const $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => { +const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => { def.pattern ?? (def.pattern = emoji()); $ZodStringFormat.init(inst, def); }); -const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => { +const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => { def.pattern ?? (def.pattern = nanoid); $ZodStringFormat.init(inst, def); }); @@ -1281,48 +1283,48 @@ const $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => { * (timestamps embedded in the id). Use {@link $ZodCUID2} instead. * See https://github.com/paralleldrive/cuid. */ -const $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => { +const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => { def.pattern ?? (def.pattern = cuid); $ZodStringFormat.init(inst, def); }); -const $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => { +const $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => { def.pattern ?? (def.pattern = cuid2); $ZodStringFormat.init(inst, def); }); -const $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => { +const $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => { def.pattern ?? (def.pattern = ulid); $ZodStringFormat.init(inst, def); }); -const $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => { +const $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => { def.pattern ?? (def.pattern = xid); $ZodStringFormat.init(inst, def); }); -const $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => { +const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => { def.pattern ?? (def.pattern = ksuid); $ZodStringFormat.init(inst, def); }); -const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => { +const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => { def.pattern ?? (def.pattern = datetime$1(def)); $ZodStringFormat.init(inst, def); }); -const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => { +const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => { def.pattern ?? (def.pattern = date$1); $ZodStringFormat.init(inst, def); }); -const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => { +const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => { def.pattern ?? (def.pattern = time$1(def)); $ZodStringFormat.init(inst, def); }); -const $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => { +const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => { def.pattern ?? (def.pattern = duration$1); $ZodStringFormat.init(inst, def); }); -const $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => { +const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => { def.pattern ?? (def.pattern = ipv4); $ZodStringFormat.init(inst, def); inst._zod.bag.format = `ipv4`; }); -const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => { +const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => { def.pattern ?? (def.pattern = ipv6); $ZodStringFormat.init(inst, def); inst._zod.bag.format = `ipv6`; @@ -1340,11 +1342,11 @@ const $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => { } }; }); -const $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => { +const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => { def.pattern ?? (def.pattern = cidrv4); $ZodStringFormat.init(inst, def); }); -const $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => { +const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => { def.pattern ?? (def.pattern = cidrv6); $ZodStringFormat.init(inst, def); inst._zod.check = (payload) => { @@ -1379,7 +1381,7 @@ function isValidBase64(data) { return false; } } -const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => { +const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => { def.pattern ?? (def.pattern = base64); $ZodStringFormat.init(inst, def); inst._zod.bag.contentEncoding = "base64"; @@ -1396,10 +1398,10 @@ const $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => { }); function isValidBase64URL(data) { if (!base64url.test(data)) return false; - const base64$1 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); - return isValidBase64(base64$1.padEnd(Math.ceil(base64$1.length / 4) * 4, "=")); + const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); + return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "=")); } -const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => { +const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => { def.pattern ?? (def.pattern = base64url); $ZodStringFormat.init(inst, def); inst._zod.bag.contentEncoding = "base64url"; @@ -1414,7 +1416,7 @@ const $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) }); }; }); -const $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => { +const $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => { def.pattern ?? (def.pattern = e164); $ZodStringFormat.init(inst, def); }); @@ -1433,7 +1435,7 @@ function isValidJWT(token, algorithm = null) { return false; } } -const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => { +const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => { $ZodStringFormat.init(inst, def); inst._zod.check = (payload) => { if (isValidJWT(payload.value, def.alg)) return; @@ -1446,7 +1448,7 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => { }); }; }); -const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => { +const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = inst._zod.bag.pattern ?? number$1; inst._zod.parse = (payload, _ctx) => { @@ -1466,11 +1468,11 @@ const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => { return payload; }; }); -const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => { +const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => { $ZodCheckNumberFormat.init(inst, def); $ZodNumber.init(inst, def); }); -const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => { +const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => { $ZodType.init(inst, def); inst._zod.pattern = boolean$1; inst._zod.parse = (payload, _ctx) => { @@ -1488,11 +1490,11 @@ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => { return payload; }; }); -const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => { +const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload) => payload; }); -const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => { +const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, _ctx) => { payload.issues.push({ @@ -1508,7 +1510,7 @@ function handleArrayResult(result, final, index) { if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues)); final.value[index] = result.value; } -const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => { +const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { const input = payload.value; @@ -1529,7 +1531,7 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => { value: item, issues: [] }, ctx); - if (result instanceof Promise) proms.push(result.then((result$1) => handleArrayResult(result$1, payload, i))); + if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i))); else handleArrayResult(result, payload, i); } if (proms.length) return Promise.all(proms).then(() => payload); @@ -1585,7 +1587,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) { value: input[key], issues: [] }, ctx); - if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalIn, isOptionalOut))); + if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut))); else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut); } if (unrecognized.length) payload.issues.push({ @@ -1599,7 +1601,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) { return payload; }); } -const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => { +const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => { $ZodType.init(inst, def); if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) { const sh = def.shape; @@ -1648,14 +1650,14 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => { value: input[key], issues: [] }, ctx); - if (r instanceof Promise) proms.push(r.then((r$1) => handlePropertyResult(r$1, payload, key, input, isOptionalIn, isOptionalOut))); + if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut))); else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut); } if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload; return handleCatchall(proms, input, payload, ctx, _normalized.value, inst); }; }); -const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => { +const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => { $ZodObject.init(inst, def); const superParse = inst._zod.parse; const _normalized = cached(() => normalizeDef(def)); @@ -1751,7 +1753,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) return (payload, ctx) => fn(shape, payload, ctx); }; let fastpass; - const isObject$1 = isObject; + const isObject$2 = isObject; const jit = !globalConfig.jitless; const allowsEval$1 = allowsEval; const fastEnabled = jit && allowsEval$1.value; @@ -1760,7 +1762,7 @@ const $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) inst._zod.parse = (payload, ctx) => { value ?? (value = _normalized.value); const input = payload.value; - if (!isObject$1(input)) { + if (!isObject$2(input)) { payload.issues.push({ expected: "object", code: "invalid_type", @@ -1796,7 +1798,7 @@ function handleUnionResults(results, final, inst, ctx) { }); return final; } -const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { +const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0); defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0); @@ -1806,7 +1808,7 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { defineLazy(inst._zod, "pattern", () => { if (def.options.every((o) => o._zod.pattern)) { const patterns = def.options.map((o) => o._zod.pattern); - return /* @__PURE__ */ new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`); + return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`); } }); const first = def.options.length === 1 ? def.options[0]._zod.run : null; @@ -1828,12 +1830,12 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { } } if (!async) return handleUnionResults(results, payload, inst, ctx); - return Promise.all(results).then((results$1) => { - return handleUnionResults(results$1, payload, inst, ctx); + return Promise.all(results).then((results) => { + return handleUnionResults(results, payload, inst, ctx); }); }; }); -const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => { +const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { const input = payload.value; @@ -1845,8 +1847,8 @@ const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, value: input, issues: [] }, ctx); - if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left$1, right$1]) => { - return handleIntersectionResults(payload, left$1, right$1); + if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => { + return handleIntersectionResults(payload, left, right); }); return handleIntersectionResults(payload, left, right); }; @@ -1932,7 +1934,7 @@ function handleIntersectionResults(result, left, right) { result.value = merged.data; return result; } -const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { +const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => { $ZodType.init(inst, def); inst._zod.parse = (payload, ctx) => { const input = payload.value; @@ -1973,9 +1975,9 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { value: input[key], issues: [] }, ctx); - if (result instanceof Promise) proms.push(result.then((result$1) => { - if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues)); - payload.value[outKey] = result$1.value; + if (result instanceof Promise) proms.push(result.then((result) => { + if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); + payload.value[outKey] = result.value; })); else { if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); @@ -2027,9 +2029,9 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { value: input[key], issues: [] }, ctx); - if (result instanceof Promise) proms.push(result.then((result$1) => { - if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues)); - payload.value[keyResult.value] = result$1.value; + if (result instanceof Promise) proms.push(result.then((result) => { + if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); + payload.value[keyResult.value] = result.value; })); else { if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues)); @@ -2041,12 +2043,12 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { return payload; }; }); -const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => { +const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => { $ZodType.init(inst, def); const values = getEnumValues(def.entries); const valuesSet = new Set(values); inst._zod.values = valuesSet; - inst._zod.pattern = /* @__PURE__ */ new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`); + inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`); inst._zod.parse = (payload, _ctx) => { const input = payload.value; if (valuesSet.has(input)) return payload; @@ -2059,7 +2061,7 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => { return payload; }; }); -const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => { +const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => { $ZodType.init(inst, def); inst._zod.optin = "optional"; inst._zod.parse = (payload, ctx) => { @@ -2083,16 +2085,16 @@ function handleOptionalResult(result, input) { }; return result; } -const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => { +const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => { $ZodType.init(inst, def); inst._zod.optin = "optional"; inst._zod.optout = "optional"; defineLazy(inst._zod, "values", () => { - return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0; + return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0; }); defineLazy(inst._zod, "pattern", () => { const pattern = def.innerType._zod.pattern; - return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0; + return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0; }); inst._zod.parse = (payload, ctx) => { if (def.innerType._zod.optin === "optional") { @@ -2105,7 +2107,7 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => return def.innerType._zod.run(payload, ctx); }; }); -const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => { +const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => { $ZodOptional.init(inst, def); defineLazy(inst._zod, "values", () => def.innerType._zod.values); defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern); @@ -2113,23 +2115,23 @@ const $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (ins return def.innerType._zod.run(payload, ctx); }; }); -const $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => { +const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); defineLazy(inst._zod, "pattern", () => { const pattern = def.innerType._zod.pattern; - return pattern ? /* @__PURE__ */ new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0; + return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0; }); defineLazy(inst._zod, "values", () => { - return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0; + return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0; }); inst._zod.parse = (payload, ctx) => { if (payload.value === null) return payload; return def.innerType._zod.run(payload, ctx); }; }); -const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => { +const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => { $ZodType.init(inst, def); inst._zod.optin = "optional"; defineLazy(inst._zod, "values", () => def.innerType._zod.values); @@ -2143,7 +2145,7 @@ const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => { return payload; } const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result$1) => handleDefaultResult(result$1, def)); + if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def)); return handleDefaultResult(result, def); }; }); @@ -2151,7 +2153,7 @@ function handleDefaultResult(payload, def) { if (payload.value === void 0) payload.value = def.defaultValue; return payload; } -const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => { +const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => { $ZodType.init(inst, def); inst._zod.optin = "optional"; defineLazy(inst._zod, "values", () => def.innerType._zod.values); @@ -2161,7 +2163,7 @@ const $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => return def.innerType._zod.run(payload, ctx); }; }); -const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => { +const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "values", () => { const v = def.innerType._zod.values; @@ -2169,7 +2171,7 @@ const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, d }); inst._zod.parse = (payload, ctx) => { const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result$1) => handleNonOptionalResult(result$1, inst)); + if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst)); return handleNonOptionalResult(result, inst); }; }); @@ -2182,7 +2184,7 @@ function handleNonOptionalResult(payload, inst) { }); return payload; } -const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { +const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => { $ZodType.init(inst, def); inst._zod.optin = "optional"; defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); @@ -2190,12 +2192,12 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx); const result = def.innerType._zod.run(payload, ctx); - if (result instanceof Promise) return result.then((result$1) => { - payload.value = result$1.value; - if (result$1.issues.length) { + if (result instanceof Promise) return result.then((result) => { + payload.value = result.value; + if (result.issues.length) { payload.value = def.catchValue({ ...payload, - error: { issues: result$1.issues.map((iss) => finalizeIssue(iss, ctx, config())) }, + error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) }, input: payload.value }); payload.issues = []; @@ -2216,7 +2218,7 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { return payload; }; }); -const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => { +const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "values", () => def.in._zod.values); defineLazy(inst._zod, "optin", () => def.in._zod.optin); @@ -2225,11 +2227,11 @@ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => { inst._zod.parse = (payload, ctx) => { if (ctx.direction === "backward") { const right = def.out._zod.run(payload, ctx); - if (right instanceof Promise) return right.then((right$1) => handlePipeResult(right$1, def.in, ctx)); + if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx)); return handlePipeResult(right, def.in, ctx); } const left = def.in._zod.run(payload, ctx); - if (left instanceof Promise) return left.then((left$1) => handlePipeResult(left$1, def.out, ctx)); + if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx)); return handlePipeResult(left, def.out, ctx); }; }); @@ -2244,7 +2246,7 @@ function handlePipeResult(left, next, ctx) { fallback: left.fallback }, ctx); } -const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => { +const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => { $ZodType.init(inst, def); defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues); defineLazy(inst._zod, "values", () => def.innerType._zod.values); @@ -2261,7 +2263,7 @@ function handleReadonlyResult(payload) { payload.value = Object.freeze(payload.value); return payload; } -const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => { +const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => { $ZodCheck.init(inst, def); $ZodType.init(inst, def); inst._zod.parse = (payload, _) => { @@ -2270,7 +2272,7 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => { inst._zod.check = (payload) => { const input = payload.value; const r = def.fn(input); - if (r instanceof Promise) return r.then((r$1) => handleRefineResult(r$1, payload, input, inst)); + if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst)); handleRefineResult(r, payload, input, inst); }; }); @@ -2297,9 +2299,9 @@ var $ZodRegistry = class { this._idmap = /* @__PURE__ */ new Map(); } add(schema, ..._meta) { - const meta$2 = _meta[0]; - this._map.set(schema, meta$2); - if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.set(meta$2.id, schema); + const meta = _meta[0]; + this._map.set(schema, meta); + if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema); return this; } clear() { @@ -2308,8 +2310,8 @@ var $ZodRegistry = class { return this; } remove(schema) { - const meta$2 = this._map.get(schema); - if (meta$2 && typeof meta$2 === "object" && "id" in meta$2) this._idmap.delete(meta$2.id); + const meta = this._map.get(schema); + if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id); this._map.delete(schema); return this; } @@ -2338,14 +2340,14 @@ const globalRegistry = globalThis.__zod_globalRegistry; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _string(Class, params) { return new Class({ type: "string", ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _email(Class, params) { return new Class({ type: "string", @@ -2355,7 +2357,7 @@ function _email(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _guid(Class, params) { return new Class({ type: "string", @@ -2365,7 +2367,7 @@ function _guid(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _uuid(Class, params) { return new Class({ type: "string", @@ -2375,7 +2377,7 @@ function _uuid(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _uuidv4(Class, params) { return new Class({ type: "string", @@ -2386,7 +2388,7 @@ function _uuidv4(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _uuidv6(Class, params) { return new Class({ type: "string", @@ -2397,7 +2399,7 @@ function _uuidv6(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _uuidv7(Class, params) { return new Class({ type: "string", @@ -2408,7 +2410,7 @@ function _uuidv7(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _url(Class, params) { return new Class({ type: "string", @@ -2418,7 +2420,7 @@ function _url(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _emoji(Class, params) { return new Class({ type: "string", @@ -2428,7 +2430,7 @@ function _emoji(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _nanoid(Class, params) { return new Class({ type: "string", @@ -2443,7 +2445,7 @@ function _nanoid(Class, params) { * (timestamps embedded in the id). Use {@link _cuid2} instead. * See https://github.com/paralleldrive/cuid. */ -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _cuid(Class, params) { return new Class({ type: "string", @@ -2453,7 +2455,7 @@ function _cuid(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _cuid2(Class, params) { return new Class({ type: "string", @@ -2463,7 +2465,7 @@ function _cuid2(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _ulid(Class, params) { return new Class({ type: "string", @@ -2473,7 +2475,7 @@ function _ulid(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _xid(Class, params) { return new Class({ type: "string", @@ -2483,7 +2485,7 @@ function _xid(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _ksuid(Class, params) { return new Class({ type: "string", @@ -2493,7 +2495,7 @@ function _ksuid(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _ipv4(Class, params) { return new Class({ type: "string", @@ -2503,7 +2505,7 @@ function _ipv4(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _ipv6(Class, params) { return new Class({ type: "string", @@ -2513,7 +2515,7 @@ function _ipv6(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _cidrv4(Class, params) { return new Class({ type: "string", @@ -2523,7 +2525,7 @@ function _cidrv4(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _cidrv6(Class, params) { return new Class({ type: "string", @@ -2533,7 +2535,7 @@ function _cidrv6(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _base64(Class, params) { return new Class({ type: "string", @@ -2543,7 +2545,7 @@ function _base64(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _base64url(Class, params) { return new Class({ type: "string", @@ -2553,7 +2555,7 @@ function _base64url(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _e164(Class, params) { return new Class({ type: "string", @@ -2563,7 +2565,7 @@ function _e164(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _jwt(Class, params) { return new Class({ type: "string", @@ -2573,7 +2575,7 @@ function _jwt(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _isoDateTime(Class, params) { return new Class({ type: "string", @@ -2585,7 +2587,7 @@ function _isoDateTime(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _isoDate(Class, params) { return new Class({ type: "string", @@ -2594,7 +2596,7 @@ function _isoDate(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _isoTime(Class, params) { return new Class({ type: "string", @@ -2604,7 +2606,7 @@ function _isoTime(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _isoDuration(Class, params) { return new Class({ type: "string", @@ -2613,7 +2615,7 @@ function _isoDuration(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _number(Class, params) { return new Class({ type: "number", @@ -2621,7 +2623,7 @@ function _number(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _int(Class, params) { return new Class({ type: "number", @@ -2631,25 +2633,25 @@ function _int(Class, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _boolean(Class, params) { return new Class({ type: "boolean", ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _unknown(Class) { return new Class({ type: "unknown" }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _never(Class, params) { return new Class({ type: "never", ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _lt(value, params) { return new $ZodCheckLessThan({ check: "less_than", @@ -2658,7 +2660,7 @@ function _lt(value, params) { inclusive: false }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _lte(value, params) { return new $ZodCheckLessThan({ check: "less_than", @@ -2667,7 +2669,7 @@ function _lte(value, params) { inclusive: true }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _gt(value, params) { return new $ZodCheckGreaterThan({ check: "greater_than", @@ -2676,7 +2678,7 @@ function _gt(value, params) { inclusive: false }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _gte(value, params) { return new $ZodCheckGreaterThan({ check: "greater_than", @@ -2685,7 +2687,7 @@ function _gte(value, params) { inclusive: true }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _multipleOf(value, params) { return new $ZodCheckMultipleOf({ check: "multiple_of", @@ -2693,7 +2695,7 @@ function _multipleOf(value, params) { value }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _maxLength(maximum, params) { return new $ZodCheckMaxLength({ check: "max_length", @@ -2701,7 +2703,7 @@ function _maxLength(maximum, params) { maximum }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _minLength(minimum, params) { return new $ZodCheckMinLength({ check: "min_length", @@ -2709,7 +2711,7 @@ function _minLength(minimum, params) { minimum }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _length(length, params) { return new $ZodCheckLengthEquals({ check: "length_equals", @@ -2717,7 +2719,7 @@ function _length(length, params) { length }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _regex(pattern, params) { return new $ZodCheckRegex({ check: "string_format", @@ -2726,7 +2728,7 @@ function _regex(pattern, params) { pattern }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _lowercase(params) { return new $ZodCheckLowerCase({ check: "string_format", @@ -2734,7 +2736,7 @@ function _lowercase(params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _uppercase(params) { return new $ZodCheckUpperCase({ check: "string_format", @@ -2742,7 +2744,7 @@ function _uppercase(params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _includes(includes, params) { return new $ZodCheckIncludes({ check: "string_format", @@ -2751,7 +2753,7 @@ function _includes(includes, params) { includes }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _startsWith(prefix, params) { return new $ZodCheckStartsWith({ check: "string_format", @@ -2760,7 +2762,7 @@ function _startsWith(prefix, params) { prefix }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _endsWith(suffix, params) { return new $ZodCheckEndsWith({ check: "string_format", @@ -2769,34 +2771,34 @@ function _endsWith(suffix, params) { suffix }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _overwrite(tx) { return new $ZodCheckOverwrite({ check: "overwrite", tx }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _normalize(form) { return /* @__PURE__ */ _overwrite((input) => input.normalize(form)); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _trim() { return /* @__PURE__ */ _overwrite((input) => input.trim()); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _toLowerCase() { return /* @__PURE__ */ _overwrite((input) => input.toLowerCase()); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _toUpperCase() { return /* @__PURE__ */ _overwrite((input) => input.toUpperCase()); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _slugify() { return /* @__PURE__ */ _overwrite((input) => slugify(input)); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _array(Class, element, params) { return new Class({ type: "array", @@ -2804,7 +2806,7 @@ function _array(Class, element, params) { ...normalizeParams(params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _refine(Class, fn, _params) { return new Class({ type: "custom", @@ -2813,13 +2815,13 @@ function _refine(Class, fn, _params) { ...normalizeParams(_params) }); } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _superRefine(fn, params) { const ch = /* @__PURE__ */ _check((payload) => { - payload.addIssue = (issue$1) => { - if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.def)); + payload.addIssue = (issue$2) => { + if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def)); else { - const _issue = issue$1; + const _issue = issue$2; if (_issue.fatal) _issue.continue = false; _issue.code ?? (_issue.code = "custom"); _issue.input ?? (_issue.input = payload.value); @@ -2832,7 +2834,7 @@ function _superRefine(fn, params) { }, params); return ch; } -/* @__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ function _check(fn, params) { const ch = new $ZodCheck({ check: "custom", @@ -2841,32 +2843,6 @@ function _check(fn, params) { ch._zod.check = fn; return ch; } -/* @__NO_SIDE_EFFECTS__ */ -function describe$1(description) { - const ch = new $ZodCheck({ check: "describe" }); - ch._zod.onattach = [(inst) => { - const existing = globalRegistry.get(inst) ?? {}; - globalRegistry.add(inst, { - ...existing, - description - }); - }]; - ch._zod.check = () => {}; - return ch; -} -/* @__NO_SIDE_EFFECTS__ */ -function meta$1(metadata) { - const ch = new $ZodCheck({ check: "meta" }); - ch._zod.onattach = [(inst) => { - const existing = globalRegistry.get(inst) ?? {}; - globalRegistry.add(inst, { - ...existing, - ...metadata - }); - }]; - ch._zod.check = () => {}; - return ch; -} //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js @@ -2888,11 +2864,11 @@ function initializeContext(params) { external: params?.external ?? void 0 }; } -function process$5(schema, ctx, _params = { +function process$3(schema, ctx, _params = { path: [], schemaPath: [] }) { - var _a$3; + var _a; const def = schema._zod.def; const seen = ctx.seen.get(schema); if (seen) { @@ -2925,17 +2901,17 @@ function process$5(schema, ctx, _params = { const parent = schema._zod.parent; if (parent) { if (!result.ref) result.ref = parent; - process$5(parent, ctx, params); + process$3(parent, ctx, params); ctx.seen.get(parent).isParent = true; } } - const meta$2 = ctx.metadataRegistry.get(schema); - if (meta$2) Object.assign(result.schema, meta$2); + const meta = ctx.metadataRegistry.get(schema); + if (meta) Object.assign(result.schema, meta); if (ctx.io === "input" && isTransforming(schema)) { delete result.schema.examples; delete result.schema.default; } - if (ctx.io === "input" && "_prefault" in result.schema) (_a$3 = result.schema).default ?? (_a$3.default = result.schema._prefault); + if (ctx.io === "input" && "_prefault" in result.schema) (_a = result.schema).default ?? (_a.default = result.schema._prefault); delete result.schema._prefault; return ctx.seen.get(schema).schema; } @@ -2955,7 +2931,7 @@ function extractDefs(ctx, schema) { const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions"; if (ctx.external) { const externalId = ctx.external.registry.get(entry[0])?.id; - const uriGenerator = ctx.external.uri ?? ((id$1) => id$1); + const uriGenerator = ctx.external.uri ?? ((id) => id); if (externalId) return { ref: uriGenerator(externalId) }; const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`; entry[1].defId = id; @@ -2978,9 +2954,9 @@ function extractDefs(ctx, schema) { const { ref, defId } = makeURI(entry); seen.def = { ...seen.schema }; if (defId) seen.defId = defId; - const schema$1 = seen.schema; - for (const key in schema$1) delete schema$1[key]; - schema$1.$ref = ref; + const schema = seen.schema; + for (const key in schema) delete schema[key]; + schema.$ref = ref; }; if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) { const seen = entry[1]; @@ -3023,8 +2999,8 @@ function finalize(ctx, schema) { const flattenRef = (zodSchema) => { const seen = ctx.seen.get(zodSchema); if (seen.ref === null) return; - const schema$1 = seen.def ?? seen.schema; - const _cached = { ...schema$1 }; + const schema = seen.def ?? seen.schema; + const _cached = { ...schema }; const ref = seen.ref; seen.ref = null; if (ref) { @@ -3032,17 +3008,17 @@ function finalize(ctx, schema) { const refSeen = ctx.seen.get(ref); const refSchema = refSeen.schema; if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) { - schema$1.allOf = schema$1.allOf ?? []; - schema$1.allOf.push(refSchema); - } else Object.assign(schema$1, refSchema); - Object.assign(schema$1, _cached); - if (zodSchema._zod.parent === ref) for (const key in schema$1) { + schema.allOf = schema.allOf ?? []; + schema.allOf.push(refSchema); + } else Object.assign(schema, refSchema); + Object.assign(schema, _cached); + if (zodSchema._zod.parent === ref) for (const key in schema) { if (key === "$ref" || key === "allOf") continue; - if (!(key in _cached)) delete schema$1[key]; + if (!(key in _cached)) delete schema[key]; } - if (refSchema.$ref && refSeen.def) for (const key in schema$1) { + if (refSchema.$ref && refSeen.def) for (const key in schema) { if (key === "$ref" || key === "allOf") continue; - if (key in refSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(refSeen.def[key])) delete schema$1[key]; + if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key]; } } const parent = zodSchema._zod.parent; @@ -3050,16 +3026,16 @@ function finalize(ctx, schema) { flattenRef(parent); const parentSeen = ctx.seen.get(parent); if (parentSeen?.schema.$ref) { - schema$1.$ref = parentSeen.schema.$ref; - if (parentSeen.def) for (const key in schema$1) { + schema.$ref = parentSeen.schema.$ref; + if (parentSeen.def) for (const key in schema) { if (key === "$ref" || key === "allOf") continue; - if (key in parentSeen.def && JSON.stringify(schema$1[key]) === JSON.stringify(parentSeen.def[key])) delete schema$1[key]; + if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) delete schema[key]; } } } ctx.override({ zodSchema, - jsonSchema: schema$1, + jsonSchema: schema, path: seen.path ?? [] }); }; @@ -3085,8 +3061,10 @@ function finalize(ctx, schema) { defs[seen.defId] = seen.def; } } - if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs; - else result.definitions = defs; + if (ctx.external) {} else if (Object.keys(defs).length > 0) { + if (ctx.target === "draft-2020-12") result.$defs = defs; + else result.definitions = defs; + } try { const finalized = JSON.parse(JSON.stringify(result)); Object.defineProperty(finalized, "~standard", { @@ -3145,7 +3123,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => { ...params, processors }); - process$5(schema, ctx); + process$3(schema, ctx); extractDefs(ctx, schema); return finalize(ctx, schema); }; @@ -3157,7 +3135,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) io, processors }); - process$5(schema, ctx); + process$3(schema, ctx); extractDefs(ctx, schema); return finalize(ctx, schema); }; @@ -3200,16 +3178,18 @@ const numberProcessor = (schema, ctx, _json, _params) => { const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY); const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY); const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0"; - if (exMin) if (legacy) { - json.minimum = exclusiveMinimum; - json.exclusiveMinimum = true; - } else json.exclusiveMinimum = exclusiveMinimum; - else if (typeof minimum === "number") json.minimum = minimum; - if (exMax) if (legacy) { - json.maximum = exclusiveMaximum; - json.exclusiveMaximum = true; - } else json.exclusiveMaximum = exclusiveMaximum; - else if (typeof maximum === "number") json.maximum = maximum; + if (exMin) { + if (legacy) { + json.minimum = exclusiveMinimum; + json.exclusiveMinimum = true; + } else json.exclusiveMinimum = exclusiveMinimum; + } else if (typeof minimum === "number") json.minimum = minimum; + if (exMax) { + if (legacy) { + json.maximum = exclusiveMaximum; + json.exclusiveMaximum = true; + } else json.exclusiveMaximum = exclusiveMaximum; + } else if (typeof maximum === "number") json.maximum = maximum; if (typeof multipleOf === "number") json.multipleOf = multipleOf; }; const booleanProcessor = (_schema, _ctx, json, _params) => { @@ -3239,7 +3219,7 @@ const arrayProcessor = (schema, ctx, _json, params) => { if (typeof minimum === "number") json.minItems = minimum; if (typeof maximum === "number") json.maxItems = maximum; json.type = "array"; - json.items = process$5(def.element, ctx, { + json.items = process$3(def.element, ctx, { ...params, path: [...params.path, "items"] }); @@ -3250,7 +3230,7 @@ const objectProcessor = (schema, ctx, _json, params) => { json.type = "object"; json.properties = {}; const shape = def.shape; - for (const key in shape) json.properties[key] = process$5(shape[key], ctx, { + for (const key in shape) json.properties[key] = process$3(shape[key], ctx, { ...params, path: [ ...params.path, @@ -3268,7 +3248,7 @@ const objectProcessor = (schema, ctx, _json, params) => { if (def.catchall?._zod.def.type === "never") json.additionalProperties = false; else if (!def.catchall) { if (ctx.io === "output") json.additionalProperties = false; - } else if (def.catchall) json.additionalProperties = process$5(def.catchall, ctx, { + } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, { ...params, path: [...params.path, "additionalProperties"] }); @@ -3276,7 +3256,7 @@ const objectProcessor = (schema, ctx, _json, params) => { const unionProcessor = (schema, ctx, json, params) => { const def = schema._zod.def; const isExclusive = def.inclusive === false; - const options = def.options.map((x, i) => process$5(x, ctx, { + const options = def.options.map((x, i) => process$3(x, ctx, { ...params, path: [ ...params.path, @@ -3289,7 +3269,7 @@ const unionProcessor = (schema, ctx, json, params) => { }; const intersectionProcessor = (schema, ctx, json, params) => { const def = schema._zod.def; - const a = process$5(def.left, ctx, { + const a = process$3(def.left, ctx, { ...params, path: [ ...params.path, @@ -3297,7 +3277,7 @@ const intersectionProcessor = (schema, ctx, json, params) => { 0 ] }); - const b = process$5(def.right, ctx, { + const b = process$3(def.right, ctx, { ...params, path: [ ...params.path, @@ -3315,7 +3295,7 @@ const recordProcessor = (schema, ctx, _json, params) => { const keyType = def.keyType; const patterns = keyType._zod.bag?.patterns; if (def.mode === "loose" && patterns && patterns.size > 0) { - const valueSchema = process$5(def.valueType, ctx, { + const valueSchema = process$3(def.valueType, ctx, { ...params, path: [ ...params.path, @@ -3326,11 +3306,11 @@ const recordProcessor = (schema, ctx, _json, params) => { json.patternProperties = {}; for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema; } else { - if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$5(def.keyType, ctx, { + if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$3(def.keyType, ctx, { ...params, path: [...params.path, "propertyNames"] }); - json.additionalProperties = process$5(def.valueType, ctx, { + json.additionalProperties = process$3(def.valueType, ctx, { ...params, path: [...params.path, "additionalProperties"] }); @@ -3343,7 +3323,7 @@ const recordProcessor = (schema, ctx, _json, params) => { }; const nullableProcessor = (schema, ctx, json, params) => { const def = schema._zod.def; - const inner = process$5(def.innerType, ctx, params); + const inner = process$3(def.innerType, ctx, params); const seen = ctx.seen.get(schema); if (ctx.target === "openapi-3.0") { seen.ref = def.innerType; @@ -3352,27 +3332,27 @@ const nullableProcessor = (schema, ctx, json, params) => { }; const nonoptionalProcessor = (schema, ctx, _json, params) => { const def = schema._zod.def; - process$5(def.innerType, ctx, params); + process$3(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; }; const defaultProcessor = (schema, ctx, json, params) => { const def = schema._zod.def; - process$5(def.innerType, ctx, params); + process$3(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; json.default = JSON.parse(JSON.stringify(def.defaultValue)); }; const prefaultProcessor = (schema, ctx, json, params) => { const def = schema._zod.def; - process$5(def.innerType, ctx, params); + process$3(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue)); }; const catchProcessor = (schema, ctx, json, params) => { const def = schema._zod.def; - process$5(def.innerType, ctx, params); + process$3(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; let catchValue; @@ -3387,48 +3367,48 @@ const pipeProcessor = (schema, ctx, _json, params) => { const def = schema._zod.def; const inIsTransform = def.in._zod.traits.has("$ZodTransform"); const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out; - process$5(innerType, ctx, params); + process$3(innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = innerType; }; const readonlyProcessor = (schema, ctx, json, params) => { const def = schema._zod.def; - process$5(def.innerType, ctx, params); + process$3(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; json.readOnly = true; }; const optionalProcessor = (schema, ctx, _json, params) => { const def = schema._zod.def; - process$5(def.innerType, ctx, params); + process$3(def.innerType, ctx, params); const seen = ctx.seen.get(schema); seen.ref = def.innerType; }; //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js -const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => { +const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => { $ZodISODateTime.init(inst, def); ZodStringFormat.init(inst, def); }); function datetime(params) { return _isoDateTime(ZodISODateTime, params); } -const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => { +const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => { $ZodISODate.init(inst, def); ZodStringFormat.init(inst, def); }); function date(params) { return _isoDate(ZodISODate, params); } -const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => { +const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => { $ZodISOTime.init(inst, def); ZodStringFormat.init(inst, def); }); function time(params) { return _isoTime(ZodISOTime, params); } -const ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => { +const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => { $ZodISODuration.init(inst, def); ZodStringFormat.init(inst, def); }); @@ -3444,12 +3424,12 @@ const initializer = (inst, issues) => { Object.defineProperties(inst, { format: { value: (mapper) => formatError(inst, mapper) }, flatten: { value: (mapper) => flattenError(inst, mapper) }, - addIssue: { value: (issue$1) => { - inst.issues.push(issue$1); + addIssue: { value: (issue) => { + inst.issues.push(issue); inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); } }, - addIssues: { value: (issues$1) => { - inst.issues.push(...issues$1); + addIssues: { value: (issues) => { + inst.issues.push(...issues); inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); } }, isEmpty: { get() { @@ -3457,7 +3437,7 @@ const initializer = (inst, issues) => { } } }); }; -const ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer, { Parent: Error }); +const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error }); //#endregion //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js @@ -3512,7 +3492,7 @@ function _installLazyMethods(inst, group, methods) { }); } } -const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { +const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => { $ZodType.init(inst, def); Object.assign(inst["~standard"], { jsonSchema: { input: createStandardJSONSchemaMethod(inst, "input"), @@ -3537,8 +3517,8 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params); _installLazyMethods(inst, "ZodType", { check(...chks) { - const def$1 = this.def; - return this.clone(mergeDefs(def$1, { checks: [...def$1.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: { + const def = this.def; + return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] @@ -3547,14 +3527,14 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { with(...chks) { return this.check(...chks); }, - clone(def$1, params) { - return clone(this, def$1, params); + clone(def, params) { + return clone(this, def, params); }, brand() { return this; }, - register(reg, meta$2) { - reg.add(this, meta$2); + register(reg, meta) { + reg.add(this, meta); return this; }, refine(check, params) { @@ -3638,7 +3618,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { return inst; }); /** @internal */ -const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => { +const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => { $ZodString.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params); @@ -3694,7 +3674,7 @@ const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => { } }); }); -const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => { +const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => { $ZodString.init(inst, def); _ZodString.init(inst, def); inst.email = (params) => inst.check(_email(ZodEmail, params)); @@ -3728,31 +3708,31 @@ const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => { function string(params) { return _string(ZodString, params); } -const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => { +const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => { $ZodStringFormat.init(inst, def); _ZodString.init(inst, def); }); -const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => { +const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => { $ZodEmail.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => { +const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => { $ZodGUID.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => { +const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => { $ZodUUID.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => { +const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => { $ZodURL.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => { +const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => { $ZodEmoji.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => { +const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => { $ZodNanoID.init(inst, def); ZodStringFormat.init(inst, def); }); @@ -3761,59 +3741,59 @@ const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => { * (timestamps embedded in the id). Use {@link ZodCUID2} instead. * See https://github.com/paralleldrive/cuid. */ -const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => { +const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => { $ZodCUID.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => { +const ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => { $ZodCUID2.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => { +const ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => { $ZodULID.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => { +const ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => { $ZodXID.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => { +const ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => { $ZodKSUID.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => { +const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => { $ZodIPv4.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => { +const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => { $ZodIPv6.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => { +const ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => { $ZodCIDRv4.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => { +const ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => { $ZodCIDRv6.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => { +const ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => { $ZodBase64.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => { +const ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => { $ZodBase64URL.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => { +const ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => { $ZodE164.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => { +const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => { $ZodJWT.init(inst, def); ZodStringFormat.init(inst, def); }); -const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => { +const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => { $ZodNumber.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params); @@ -3874,14 +3854,14 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => { function number(params) { return _number(ZodNumber, params); } -const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => { +const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => { $ZodNumberFormat.init(inst, def); ZodNumber.init(inst, def); }); function int(params) { return _int(ZodNumberFormat, params); } -const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => { +const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => { $ZodBoolean.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params); @@ -3889,7 +3869,7 @@ const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => { function boolean(params) { return _boolean(ZodBoolean, params); } -const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => { +const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => { $ZodUnknown.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params); @@ -3897,7 +3877,7 @@ const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => { function unknown() { return _unknown(ZodUnknown); } -const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => { +const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => { $ZodNever.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params); @@ -3905,7 +3885,7 @@ const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => { function never(params) { return _never(ZodNever, params); } -const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => { +const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => { $ZodArray.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params); @@ -3931,7 +3911,7 @@ const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => { function array(element, params) { return _array(ZodArray, element, params); } -const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => { +const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => { $ZodObjectJIT.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params); @@ -3996,13 +3976,14 @@ const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => { }); }); function object(shape, params) { - return new ZodObject({ + const def = { type: "object", shape: shape ?? {}, ...normalizeParams(params) - }); + }; + return new ZodObject(def); } -const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => { +const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => { $ZodUnion.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params); @@ -4015,7 +3996,7 @@ function union(options, params) { ...normalizeParams(params) }); } -const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => { +const ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => { $ZodIntersection.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params); @@ -4027,7 +4008,7 @@ function intersection(left, right) { right }); } -const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => { +const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => { $ZodRecord.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params); @@ -4048,7 +4029,7 @@ function record(keyType, valueType, params) { ...normalizeParams(params) }); } -const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => { +const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => { $ZodEnum.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params); @@ -4079,13 +4060,14 @@ const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => { }; }); function _enum(values, params) { + const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values; return new ZodEnum({ type: "enum", - entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values, + entries, ...normalizeParams(params) }); } -const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => { +const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => { $ZodTransform.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params); @@ -4103,8 +4085,8 @@ const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => } }; const output = def.transform(payload.value, payload); - if (output instanceof Promise) return output.then((output$1) => { - payload.value = output$1; + if (output instanceof Promise) return output.then((output) => { + payload.value = output; payload.fallback = true; return payload; }); @@ -4119,7 +4101,7 @@ function transform(fn) { transform: fn }); } -const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => { +const ZodOptional = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => { $ZodOptional.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params); @@ -4131,7 +4113,7 @@ function optional(innerType) { innerType }); } -const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => { +const ZodExactOptional = /*@__PURE__*/ $constructor("ZodExactOptional", (inst, def) => { $ZodExactOptional.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params); @@ -4143,7 +4125,7 @@ function exactOptional(innerType) { innerType }); } -const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => { +const ZodNullable = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => { $ZodNullable.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params); @@ -4155,7 +4137,7 @@ function nullable(innerType) { innerType }); } -const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => { +const ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => { $ZodDefault.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params); @@ -4171,7 +4153,7 @@ function _default(innerType, defaultValue) { } }); } -const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => { +const ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => { $ZodPrefault.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params); @@ -4186,7 +4168,7 @@ function prefault(innerType, defaultValue) { } }); } -const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => { +const ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => { $ZodNonOptional.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params); @@ -4199,7 +4181,7 @@ function nonoptional(innerType, params) { ...normalizeParams(params) }); } -const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => { +const ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => { $ZodCatch.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params); @@ -4213,7 +4195,7 @@ function _catch(innerType, catchValue) { catchValue: typeof catchValue === "function" ? catchValue : () => catchValue }); } -const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => { +const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => { $ZodPipe.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params); @@ -4227,7 +4209,7 @@ function pipe(in_, out) { out }); } -const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => { +const ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => { $ZodReadonly.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params); @@ -4239,7 +4221,7 @@ function readonly(innerType) { innerType }); } -const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => { +const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => { $ZodCustom.init(inst, def); ZodType.init(inst, def); inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params); @@ -4250,8 +4232,6 @@ function refine(fn, _params = {}) { function superRefine(fn, params) { return _superRefine(fn, params); } -const describe = describe$1; -const meta = meta$1; //#endregion //#region src/config.ts @@ -4341,7 +4321,7 @@ function stripUndefined(value) { } async function readConfigFile(file) { try { - const raw = JSON.parse(await fs.readFile(file, "utf-8")); + const raw = JSON.parse(await fs$1.readFile(file, "utf-8")); return PartialConfigSchema.parse(stripUndefined({ ...raw, enabled: raw.enabled != null ? parseBoolean(raw.enabled) : void 0, @@ -4368,12 +4348,12 @@ function readJwtPayload(token) { } async function readCodexUserEmail(authFile) { try { - const raw = JSON.parse(await fs.readFile(authFile, "utf-8")); + const raw = JSON.parse(await fs$1.readFile(authFile, "utf-8")); const token = CodexAuthSchema.parse(raw).tokens?.id_token; if (!token) return void 0; - const email$1 = readJwtPayload(token)?.email; - if (typeof email$1 !== "string") return void 0; - const trimmed = email$1.trim(); + const email = readJwtPayload(token)?.email; + if (typeof email !== "string") return void 0; + const trimmed = email.trim(); return trimmed.length > 0 ? trimmed : void 0; } catch { return; @@ -4398,22 +4378,22 @@ function readEnvConfig(env) { fail_on_error: parseBoolean(env.LANGFUSE_CODEX_FAIL_ON_ERROR) })); } -const getHomeDir = () => process.env.HOME ?? os$2.homedir(); +const getHomeDir = () => process.env.HOME ?? os$1.homedir(); function getCodexAuthFile(home, env) { const codexHome = env.CODEX_HOME?.trim(); - return codexHome ? path.join(codexHome, "auth.json") : path.join(home, ".codex", "auth.json"); + return codexHome ? path$1.join(codexHome, "auth.json") : path$1.join(home, ".codex", "auth.json"); } async function getConfig(options) { const home = options?.home ?? getHomeDir(); const cwd = options?.cwd ?? process.cwd(); const env = options?.env ?? process.env; - const [globalConfig$1, localConfig] = await Promise.all([readConfigFile(path.join(home, ".codex", "langfuse.json")), readConfigFile(path.join(cwd, ".codex", "langfuse.json"))]); + const [globalConfig, localConfig] = await Promise.all([readConfigFile(path$1.join(home, ".codex", "langfuse.json")), readConfigFile(path$1.join(cwd, ".codex", "langfuse.json"))]); const envConfig = readEnvConfig(env); - const codexUserId = globalConfig$1?.user_id ?? localConfig?.user_id ?? envConfig.user_id ? void 0 : await readCodexUserEmail(getCodexAuthFile(home, env)); + const codexUserId = globalConfig?.user_id ?? localConfig?.user_id ?? envConfig.user_id ? void 0 : await readCodexUserEmail(getCodexAuthFile(home, env)); return ConfigSchema.parse({ ...DEFAULTS, ...codexUserId ? { user_id: codexUserId } : {}, - ...globalConfig$1, + ...globalConfig, ...localConfig, ...envConfig }); @@ -4421,9 +4401,9 @@ async function getConfig(options) { //#endregion //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/version.js -var VERSION; -var init_version = __esmMin((() => { - VERSION = "1.9.1"; +var VERSION$1; +var init_version$1 = __esmMin((() => { + VERSION$1 = "1.9.1"; })); //#endregion @@ -4445,7 +4425,7 @@ var init_version = __esmMin((() => { * @param ownVersion version which should be checked against */ function _makeCompatibilityCheck(ownVersion) { - const acceptedVersions = new Set([ownVersion]); + const acceptedVersions = /* @__PURE__ */ new Set([ownVersion]); const rejectedVersions = /* @__PURE__ */ new Set(); const myVersionMatch = ownVersion.match(re); if (!myVersionMatch) return () => false; @@ -4466,7 +4446,7 @@ function _makeCompatibilityCheck(ownVersion) { acceptedVersions.add(v); return true; } - return function isCompatible$1(globalVersion) { + return function isCompatible(globalVersion) { if (acceptedVersions.has(globalVersion)) return true; if (rejectedVersions.has(globalVersion)) return false; const globalVersionMatch = globalVersion.match(re); @@ -4489,46 +4469,46 @@ function _makeCompatibilityCheck(ownVersion) { } var re, isCompatible; var init_semver = __esmMin((() => { - init_version(); + init_version$1(); re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; - isCompatible = _makeCompatibilityCheck(VERSION); + isCompatible = _makeCompatibilityCheck(VERSION$1); })); //#endregion //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js -function registerGlobal(type, instance, diag$2, allowOverride = false) { - var _a$3; - const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a$3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a$3 !== void 0 ? _a$3 : { version: VERSION }; +function registerGlobal(type, instance, diag, allowOverride = false) { + var _a; + const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { version: VERSION$1 }; if (!allowOverride && api[type]) { const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`); - diag$2.error(err.stack || err.message); + diag.error(err.stack || err.message); return false; } - if (api.version !== VERSION) { - const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`); - diag$2.error(err.stack || err.message); + if (api.version !== "1.9.1") { + const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION$1}`); + diag.error(err.stack || err.message); return false; } api[type] = instance; - diag$2.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`); + diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION$1}.`); return true; } function getGlobal(type) { - var _a$3, _b; - const globalVersion = (_a$3 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a$3 === void 0 ? void 0 : _a$3.version; + var _a, _b; + const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version; if (!globalVersion || !isCompatible(globalVersion)) return; return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; } -function unregisterGlobal(type, diag$2) { - diag$2.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`); +function unregisterGlobal(type, diag) { + diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION$1}.`); const api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; if (api) delete api[type]; } var major, GLOBAL_OPENTELEMETRY_API_KEY, _global; var init_global_utils = __esmMin((() => { - init_version(); + init_version$1(); init_semver(); - major = VERSION.split(".")[0]; + major = VERSION$1.split(".")[0]; GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`); _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {}; })); @@ -4570,24 +4550,24 @@ var init_ComponentLogger = __esmMin((() => { var DiagLogLevel; var init_types$1 = __esmMin((() => { ; - (function(DiagLogLevel$1) { + (function(DiagLogLevel) { /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ - DiagLogLevel$1[DiagLogLevel$1["NONE"] = 0] = "NONE"; + DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE"; /** Identifies an error scenario */ - DiagLogLevel$1[DiagLogLevel$1["ERROR"] = 30] = "ERROR"; + DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR"; /** Identifies a warning scenario */ - DiagLogLevel$1[DiagLogLevel$1["WARN"] = 50] = "WARN"; + DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN"; /** General informational log message */ - DiagLogLevel$1[DiagLogLevel$1["INFO"] = 60] = "INFO"; + DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO"; /** General debug log message */ - DiagLogLevel$1[DiagLogLevel$1["DEBUG"] = 70] = "DEBUG"; + DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG"; /** * Detailed trace level logging should only be used for development, should only be set * in a development environment. */ - DiagLogLevel$1[DiagLogLevel$1["VERBOSE"] = 80] = "VERBOSE"; + DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE"; /** Used to set the logging level to include all logging */ - DiagLogLevel$1[DiagLogLevel$1["ALL"] = 9999] = "ALL"; + DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL"; })(DiagLogLevel || (DiagLogLevel = {})); })); @@ -4641,12 +4621,12 @@ var init_diag = __esmMin((() => { return logger[funcName](...args); }; } - const self$1 = this; + const self = this; const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => { - var _a$3, _b, _c; - if (logger === self$1) { + var _a, _b, _c; + if (logger === self) { const err = /* @__PURE__ */ new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation"); - self$1.error((_a$3 = err.stack) !== null && _a$3 !== void 0 ? _a$3 : err.message); + self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message); return false; } if (typeof optionsOrLogLevel === "number") optionsOrLogLevel = { logLevel: optionsOrLogLevel }; @@ -4657,20 +4637,20 @@ var init_diag = __esmMin((() => { oldLogger.warn(`Current logger will be overwritten from ${stack}`); newLogger.warn(`Current logger will overwrite one already registered from ${stack}`); } - return registerGlobal("diag", newLogger, self$1, true); + return registerGlobal("diag", newLogger, self, true); }; - self$1.setLogger = setLogger; - self$1.disable = () => { - unregisterGlobal(API_NAME$4, self$1); + self.setLogger = setLogger; + self.disable = () => { + unregisterGlobal(API_NAME$4, self); }; - self$1.createComponentLogger = (options) => { + self.createComponentLogger = (options) => { return new DiagComponentLogger(options); }; - self$1.verbose = _logProxy("verbose"); - self$1.debug = _logProxy("debug"); - self$1.info = _logProxy("info"); - self$1.warn = _logProxy("warn"); - self$1.error = _logProxy("error"); + self.verbose = _logProxy("verbose"); + self.debug = _logProxy("debug"); + self.info = _logProxy("info"); + self.warn = _logProxy("warn"); + self.error = _logProxy("error"); } }; })); @@ -4775,18 +4755,18 @@ var init_context$1 = __esmMin((() => { * @param parentContext a context from which to inherit values */ constructor(parentContext) { - const self$1 = this; - self$1._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map(); - self$1.getValue = (key) => self$1._currentContext.get(key); - self$1.setValue = (key, value) => { - const context$1 = new BaseContext(self$1._currentContext); - context$1._currentContext.set(key, value); - return context$1; + const self = this; + self._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map(); + self.getValue = (key) => self._currentContext.get(key); + self.setValue = (key, value) => { + const context = new BaseContext(self._currentContext); + context._currentContext.set(key, value); + return context; }; - self$1.deleteValue = (key) => { - const context$1 = new BaseContext(self$1._currentContext); - context$1._currentContext.delete(key); - return context$1; + self.deleteValue = (key) => { + const context = new BaseContext(self._currentContext); + context._currentContext.delete(key); + return context; }; } }; @@ -4948,9 +4928,9 @@ var init_NoopMeter = __esmMin((() => { var ValueType; var init_Metric = __esmMin((() => { ; - (function(ValueType$1) { - ValueType$1[ValueType$1["INT"] = 0] = "INT"; - ValueType$1[ValueType$1["DOUBLE"] = 1] = "DOUBLE"; + (function(ValueType) { + ValueType[ValueType["INT"] = 0] = "INT"; + ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE"; })(ValueType || (ValueType = {})); })); @@ -5037,8 +5017,8 @@ var init_context = __esmMin((() => { * @param thisArg optional receiver to be used for calling fn * @param args optional arguments forwarded to fn */ - with(context$1, fn, thisArg, ...args) { - return this._getContextManager().with(context$1, fn, thisArg, ...args); + with(context, fn, thisArg, ...args) { + return this._getContextManager().with(context, fn, thisArg, ...args); } /** * Bind a context to a target function or event emitter @@ -5046,8 +5026,8 @@ var init_context = __esmMin((() => { * @param context context to bind to the event emitter or function. Defaults to the currently active context * @param target function or event emitter to bind */ - bind(context$1, target) { - return this._getContextManager().bind(context$1, target); + bind(context, target) { + return this._getContextManager().bind(context, target); } _getContextManager() { return getGlobal(API_NAME$3) || NOOP_CONTEXT_MANAGER; @@ -5065,11 +5045,11 @@ var init_context = __esmMin((() => { var TraceFlags; var init_trace_flags = __esmMin((() => { ; - (function(TraceFlags$1) { + (function(TraceFlags) { /** Represents no flag set. */ - TraceFlags$1[TraceFlags$1["NONE"] = 0] = "NONE"; + TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; /** Bit to represent whether trace is sampled in trace flags. */ - TraceFlags$1[TraceFlags$1["SAMPLED"] = 1] = "SAMPLED"; + TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; })(TraceFlags || (TraceFlags = {})); })); @@ -5135,8 +5115,8 @@ var init_NonRecordingSpan = __esmMin((() => { * * @param context context to get span from */ -function getSpan(context$1) { - return context$1.getValue(SPAN_KEY) || void 0; +function getSpan(context) { + return context.getValue(SPAN_KEY) || void 0; } /** * Gets the span from the current context, if one exists. @@ -5150,16 +5130,16 @@ function getActiveSpan() { * @param context context to use as parent * @param span span to set active */ -function setSpan(context$1, span) { - return context$1.setValue(SPAN_KEY, span); +function setSpan(context, span) { + return context.setValue(SPAN_KEY, span); } /** * Remove current span stored in the context * * @param context context to delete span from */ -function deleteSpan(context$1) { - return context$1.deleteValue(SPAN_KEY); +function deleteSpan(context) { + return context.deleteValue(SPAN_KEY); } /** * Wrap span context in a NoopSpan and set as span in a new @@ -5168,17 +5148,17 @@ function deleteSpan(context$1) { * @param context context to set active span on * @param spanContext span context to be wrapped */ -function setSpanContext(context$1, spanContext) { - return setSpan(context$1, new NonRecordingSpan(spanContext)); +function setSpanContext(context, spanContext) { + return setSpan(context, new NonRecordingSpan(spanContext)); } /** * Get the span context of the span if it exists. * * @param context context to get values from */ -function getSpanContext(context$1) { - var _a$3; - return (_a$3 = getSpan(context$1)) === null || _a$3 === void 0 ? void 0 : _a$3.spanContext(); +function getSpanContext(context) { + var _a; + return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext(); } var SPAN_KEY; var init_context_utils = __esmMin((() => { @@ -5200,13 +5180,13 @@ function isValidHex(id, length) { * @since 1.0.0 */ function isValidTraceId(traceId) { - return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID; + return isValidHex(traceId, 32) && traceId !== "00000000000000000000000000000000"; } /** * @since 1.0.0 */ function isValidSpanId(spanId) { - return isValidHex(spanId, 16) && spanId !== INVALID_SPANID; + return isValidHex(spanId, 16) && spanId !== "0000000000000000"; } /** * Returns true if this {@link SpanContext} is valid. @@ -5350,9 +5330,9 @@ var init_NoopTracer = __esmMin((() => { init_spancontext_utils(); contextApi = ContextAPI.getInstance(); NoopTracer = class { - startSpan(name, options, context$1 = contextApi.active()) { + startSpan(name, options, context = contextApi.active()) { if (Boolean(options === null || options === void 0 ? void 0 : options.root)) return new NonRecordingSpan(); - const parentFromContext = context$1 && getSpanContext(context$1); + const parentFromContext = context && getSpanContext(context); if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) return new NonRecordingSpan(parentFromContext); else return new NonRecordingSpan(); } @@ -5385,14 +5365,14 @@ var init_ProxyTracer = __esmMin((() => { init_NoopTracer(); NOOP_TRACER = new NoopTracer(); ProxyTracer = class { - constructor(provider, name, version$1, options) { + constructor(provider, name, version, options) { this._provider = provider; this.name = name; - this.version = version$1; + this.version = version; this.options = options; } - startSpan(name, options, context$1) { - return this._getTracer().startSpan(name, options, context$1); + startSpan(name, options, context) { + return this._getTracer().startSpan(name, options, context); } startActiveSpan(_name, _options, _context, _fn) { const tracer = this._getTracer(); @@ -5435,13 +5415,13 @@ var init_ProxyTracerProvider = __esmMin((() => { /** * Get a {@link ProxyTracer} */ - getTracer(name, version$1, options) { - var _a$3; - return (_a$3 = this.getDelegateTracer(name, version$1, options)) !== null && _a$3 !== void 0 ? _a$3 : new ProxyTracer(this, name, version$1, options); + getTracer(name, version, options) { + var _a; + return (_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options); } getDelegate() { - var _a$3; - return (_a$3 = this._delegate) !== null && _a$3 !== void 0 ? _a$3 : NOOP_TRACER_PROVIDER; + var _a; + return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER; } /** * Set the delegate tracer provider @@ -5449,9 +5429,9 @@ var init_ProxyTracerProvider = __esmMin((() => { setDelegate(delegate) { this._delegate = delegate; } - getDelegateTracer(name, version$1, options) { - var _a$3; - return (_a$3 = this._delegate) === null || _a$3 === void 0 ? void 0 : _a$3.getTracer(name, version$1, options); + getDelegateTracer(name, version, options) { + var _a; + return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options); } }; })); @@ -5461,22 +5441,22 @@ var init_ProxyTracerProvider = __esmMin((() => { var SamplingDecision; var init_SamplingResult = __esmMin((() => { ; - (function(SamplingDecision$1) { + (function(SamplingDecision) { /** * `Span.isRecording() === false`, span will not be recorded and all events * and attributes will be dropped. */ - SamplingDecision$1[SamplingDecision$1["NOT_RECORD"] = 0] = "NOT_RECORD"; + SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; /** * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} * MUST NOT be set. */ - SamplingDecision$1[SamplingDecision$1["RECORD"] = 1] = "RECORD"; + SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; /** * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} * MUST be set. */ - SamplingDecision$1[SamplingDecision$1["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; + SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; })(SamplingDecision || (SamplingDecision = {})); })); @@ -5485,31 +5465,31 @@ var init_SamplingResult = __esmMin((() => { var SpanKind; var init_span_kind = __esmMin((() => { ; - (function(SpanKind$1) { + (function(SpanKind) { /** Default value. Indicates that the span is used internally. */ - SpanKind$1[SpanKind$1["INTERNAL"] = 0] = "INTERNAL"; + SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; /** * Indicates that the span covers server-side handling of an RPC or other * remote request. */ - SpanKind$1[SpanKind$1["SERVER"] = 1] = "SERVER"; + SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; /** * Indicates that the span covers the client-side wrapper around an RPC or * other remote request. */ - SpanKind$1[SpanKind$1["CLIENT"] = 2] = "CLIENT"; + SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; /** * Indicates that the span describes producer sending a message to a * broker. Unlike client and server, there is no direct critical path latency * relationship between producer and consumer spans. */ - SpanKind$1[SpanKind$1["PRODUCER"] = 3] = "PRODUCER"; + SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; /** * Indicates that the span describes consumer receiving a message from a * broker. Unlike client and server, there is no direct critical path latency * relationship between producer and consumer spans. */ - SpanKind$1[SpanKind$1["CONSUMER"] = 4] = "CONSUMER"; + SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; })(SpanKind || (SpanKind = {})); })); @@ -5518,20 +5498,20 @@ var init_span_kind = __esmMin((() => { var SpanStatusCode; var init_status = __esmMin((() => { ; - (function(SpanStatusCode$1) { + (function(SpanStatusCode) { /** * The default status. */ - SpanStatusCode$1[SpanStatusCode$1["UNSET"] = 0] = "UNSET"; + SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; /** * The operation has been validated by an Application developer or * Operator to have completed successfully. */ - SpanStatusCode$1[SpanStatusCode$1["OK"] = 1] = "OK"; + SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; /** * The operation contains an error. */ - SpanStatusCode$1[SpanStatusCode$1["ERROR"] = 2] = "ERROR"; + SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; })(SpanStatusCode || (SpanStatusCode = {})); })); @@ -5555,12 +5535,10 @@ function validateKey(key) { function validateValue(value) { return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); } -var VALID_KEY_CHAR_RANGE, VALID_KEY, VALID_VENDOR_KEY, VALID_KEY_REGEX, VALID_VALUE_BASE_REGEX, INVALID_VALUE_COMMA_EQUAL_REGEX; +var VALID_KEY_CHAR_RANGE, VALID_KEY_REGEX, VALID_VALUE_BASE_REGEX, INVALID_VALUE_COMMA_EQUAL_REGEX; var init_tracestate_validators = __esmMin((() => { VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; - VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; - VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; - VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + VALID_KEY_REGEX = new RegExp(`^(?:${`[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`}|${`[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`})$`); VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; })); @@ -5697,8 +5675,8 @@ var init_metrics = __esmMin((() => { /** * Returns a meter from the global meter provider. */ - getMeter(name, version$1, options) { - return this.getMeterProvider().getMeter(name, version$1, options); + getMeter(name, version, options) { + return this.getMeterProvider().getMeter(name, version, options); } /** Remove the global meter provider */ disable() { @@ -5723,8 +5701,8 @@ var init_NoopTextMapPropagator = __esmMin((() => { /** Noop inject function does nothing */ inject(_context, _carrier) {} /** Noop extract function does nothing and returns the input context */ - extract(context$1, _carrier) { - return context$1; + extract(context, _carrier) { + return context; } fields() { return []; @@ -5740,8 +5718,8 @@ var init_NoopTextMapPropagator = __esmMin((() => { * @param {Context} Context that manage all context values * @returns {Baggage} Extracted baggage from the context */ -function getBaggage(context$1) { - return context$1.getValue(BAGGAGE_KEY) || void 0; +function getBaggage(context) { + return context.getValue(BAGGAGE_KEY) || void 0; } /** * Retrieve the current baggage from the active/current context @@ -5757,16 +5735,16 @@ function getActiveBaggage() { * @param {Context} Context that manage all context values * @param {Baggage} baggage that will be set in the actual context */ -function setBaggage(context$1, baggage) { - return context$1.setValue(BAGGAGE_KEY, baggage); +function setBaggage(context, baggage) { + return context.setValue(BAGGAGE_KEY, baggage); } /** * Delete the baggage stored in the given context * * @param {Context} Context that manage all context values */ -function deleteBaggage(context$1) { - return context$1.deleteValue(BAGGAGE_KEY); +function deleteBaggage(context) { + return context.deleteValue(BAGGAGE_KEY); } var BAGGAGE_KEY; var init_context_helpers = __esmMin((() => { @@ -5816,8 +5794,8 @@ var init_propagation = __esmMin((() => { * @param carrier carrier to inject context into * @param setter Function used to set values on the carrier */ - inject(context$1, carrier, setter = defaultTextMapSetter) { - return this._getGlobalPropagator().inject(context$1, carrier, setter); + inject(context, carrier, setter = defaultTextMapSetter) { + return this._getGlobalPropagator().inject(context, carrier, setter); } /** * Extract context from a carrier @@ -5826,8 +5804,8 @@ var init_propagation = __esmMin((() => { * @param carrier Carrier to extract context from * @param getter Function used to extract keys from a carrier */ - extract(context$1, carrier, getter = defaultTextMapGetter) { - return this._getGlobalPropagator().extract(context$1, carrier, getter); + extract(context, carrier, getter = defaultTextMapGetter) { + return this._getGlobalPropagator().extract(context, carrier, getter); } /** * Return a list of all fields which may be used by the propagator. @@ -5900,8 +5878,8 @@ var init_trace$1 = __esmMin((() => { /** * Returns a tracer from the global tracer provider. */ - getTracer(name, version$1) { - return this.getTracerProvider().getTracer(name, version$1); + getTracer(name, version) { + return this.getTracerProvider().getTracer(name, version); } /** Remove the global tracer provider */ disable() { @@ -5997,8 +5975,8 @@ function getEnv(key) { if (typeof process !== "undefined" && process.env[key]) return process.env[key]; else if (typeof globalThis !== "undefined") return globalThis[key]; } -function base64ToBytes(base64$1) { - const binString = atob(base64$1); +function base64ToBytes(base64) { + const binString = atob(base64); return Uint8Array.from(binString, (m) => m.codePointAt(0)); } function bytesToBase64(bytes) { @@ -6038,10 +6016,10 @@ var Logger = class { * * @param config - Configuration options for the logger */ - constructor(config$1 = { level: 1 }) { + constructor(config = { level: 1 }) { this.config = { enableTimestamp: true, - ...config$1 + ...config }; } /** @@ -6139,15 +6117,15 @@ var Logger = class { } }; var _a; -var _LoggerSingleton = class _LoggerSingleton$1 { +var _LoggerSingleton = class _LoggerSingleton { /** * Gets the singleton logger instance, creating it if it doesn't exist. * * @returns The singleton logger instance */ static getInstance() { - if (!_LoggerSingleton$1.instance) _LoggerSingleton$1.instance = new Logger(_LoggerSingleton$1.defaultConfig); - return _LoggerSingleton$1.instance; + if (!_LoggerSingleton.instance) _LoggerSingleton.instance = new Logger(_LoggerSingleton.defaultConfig); + return _LoggerSingleton.instance; } /** * Configures the global logger with new settings. @@ -6155,17 +6133,17 @@ var _LoggerSingleton = class _LoggerSingleton$1 { * * @param config - The new logger configuration */ - static configure(config$1) { - _LoggerSingleton$1.defaultConfig = config$1; - _LoggerSingleton$1.instance = new Logger(config$1); + static configure(config) { + _LoggerSingleton.defaultConfig = config; + _LoggerSingleton.instance = new Logger(config); } /** * Resets the singleton logger instance and configuration. * Useful for testing or reinitializing the logger. */ static reset() { - _LoggerSingleton$1.instance = null; - _LoggerSingleton$1.defaultConfig = { level: 1 }; + _LoggerSingleton.instance = null; + _LoggerSingleton.defaultConfig = { level: 1 }; } }; _LoggerSingleton.instance = null; @@ -7017,11 +6995,13 @@ if (typeof globalThis.Headers !== "undefined") Headers = globalThis.Headers; else Headers = class Headers2 { constructor(init) { this.headers = /* @__PURE__ */ new Map(); - if (init) if (init instanceof Headers2) init.forEach((value, key) => this.append(key, value)); - else if (Array.isArray(init)) for (const [key, value] of init) if (typeof key === "string" && typeof value === "string") this.append(key, value); - else throw new TypeError("Each header entry must be a [string, string] tuple"); - else for (const [key, value] of Object.entries(init)) if (typeof value === "string") this.append(key, value); - else throw new TypeError("Header values must be strings"); + if (init) { + if (init instanceof Headers2) init.forEach((value, key) => this.append(key, value)); + else if (Array.isArray(init)) for (const [key, value] of init) if (typeof key === "string" && typeof value === "string") this.append(key, value); + else throw new TypeError("Each header entry must be a [string, string] tuple"); + else for (const [key, value] of Object.entries(init)) if (typeof value === "string") this.append(key, value); + else throw new TypeError("Header values must be strings"); + } } append(name, value) { const key = name.toLowerCase(); @@ -7251,7 +7231,8 @@ var HttpResponsePromise = class _HttpResponsePromise extends Promise { * @returns An `HttpResponsePromise` instance. */ static fromExecutor(executor) { - return new _HttpResponsePromise(new Promise(executor)); + const promise = new Promise(executor); + return new _HttpResponsePromise(promise); } /** * Creates an `HttpResponsePromise` from a resolved result. @@ -7260,7 +7241,8 @@ var HttpResponsePromise = class _HttpResponsePromise extends Promise { * @returns An `HttpResponsePromise` instance. */ static fromResult(result) { - return new _HttpResponsePromise(Promise.resolve(result)); + const promise = Promise.resolve(result); + return new _HttpResponsePromise(promise); } unwrap() { if (!this.unwrappedPromise) this.unwrappedPromise = this.innerPromise.then(({ data }) => data); @@ -7337,8 +7319,8 @@ function trimSlashes(str) { if (str.endsWith("/")) end = str.length - 1; return start === 0 && end === str.length ? str : str.slice(start, end); } -function base64ToBytes2(base64$1) { - const binString = atob(base64$1); +function base64ToBytes2(base64) { + const binString = atob(base64); return Uint8Array.from(binString, (m) => m.codePointAt(0)); } function bytesToBase642(bytes) { @@ -8752,12 +8734,12 @@ var DatasetItems = class { } async __list(request = {}, requestOptions) { var _a2, _b, _c, _d, _e, _f, _g, _h; - const { datasetName, sourceTraceId, sourceObservationId, version: version$1, page, limit } = request; + const { datasetName, sourceTraceId, sourceObservationId, version, page, limit } = request; const _queryParams = {}; if (datasetName != null) _queryParams["datasetName"] = datasetName; if (sourceTraceId != null) _queryParams["sourceTraceId"] = sourceTraceId; if (sourceObservationId != null) _queryParams["sourceObservationId"] = sourceObservationId; - if (version$1 != null) _queryParams["version"] = version$1; + if (version != null) _queryParams["version"] = version; if (page != null) _queryParams["page"] = page.toString(); if (limit != null) _queryParams["limit"] = limit.toString(); let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ @@ -9871,7 +9853,7 @@ var ObservationsV1 = class { } async __getMany(request = {}, requestOptions) { var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit, name, userId, type: type_, traceId, level, parentObservationId, environment, fromStartTime, toStartTime, version: version$1, filter } = request; + const { page, limit, name, userId, type: type_, traceId, level, parentObservationId, environment, fromStartTime, toStartTime, version, filter } = request; const _queryParams = {}; if (page != null) _queryParams["page"] = page.toString(); if (limit != null) _queryParams["limit"] = limit.toString(); @@ -9881,11 +9863,13 @@ var ObservationsV1 = class { if (traceId != null) _queryParams["traceId"] = traceId; if (level != null) _queryParams["level"] = level; if (parentObservationId != null) _queryParams["parentObservationId"] = parentObservationId; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; + if (environment != null) { + if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + } if (fromStartTime != null) _queryParams["fromStartTime"] = fromStartTime; if (toStartTime != null) _queryParams["toStartTime"] = toStartTime; - if (version$1 != null) _queryParams["version"] = version$1; + if (version != null) _queryParams["version"] = version; if (filter != null) _queryParams["filter"] = filter; let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), @@ -11090,7 +11074,7 @@ var Observations = class { } async __getMany(request = {}, requestOptions) { var _a2, _b, _c, _d, _e, _f, _g, _h; - const { fields, expandMetadata, limit, cursor, parseIoAsJson, name, userId, type: type_, traceId, level, parentObservationId, environment, fromStartTime, toStartTime, version: version$1, filter } = request; + const { fields, expandMetadata, limit, cursor, parseIoAsJson, name, userId, type: type_, traceId, level, parentObservationId, environment, fromStartTime, toStartTime, version, filter } = request; const _queryParams = {}; if (fields != null) _queryParams["fields"] = fields; if (expandMetadata != null) _queryParams["expandMetadata"] = expandMetadata; @@ -11103,11 +11087,13 @@ var Observations = class { if (traceId != null) _queryParams["traceId"] = traceId; if (level != null) _queryParams["level"] = level; if (parentObservationId != null) _queryParams["parentObservationId"] = parentObservationId; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; + if (environment != null) { + if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + } if (fromStartTime != null) _queryParams["fromStartTime"] = fromStartTime; if (toStartTime != null) _queryParams["toStartTime"] = toStartTime; - if (version$1 != null) _queryParams["version"] = version$1; + if (version != null) _queryParams["version"] = version; if (filter != null) _queryParams["filter"] = filter; let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), @@ -12351,10 +12337,10 @@ var PromptVersion = class { * newLabels: ["newLabels", "newLabels"] * }) */ - update(name, version$1, request, requestOptions) { - return HttpResponsePromise.fromPromise(this.__update(name, version$1, request, requestOptions)); + update(name, version, request, requestOptions) { + return HttpResponsePromise.fromPromise(this.__update(name, version, request, requestOptions)); } - async __update(name, version$1, request, requestOptions) { + async __update(name, version, request, requestOptions) { var _a2, _b, _c, _d, _e, _f, _g, _h; let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), @@ -12363,7 +12349,7 @@ var PromptVersion = class { "X-Langfuse-Public-Key": (_g = requestOptions == null ? void 0 : requestOptions.xLangfusePublicKey) != null ? _g : (_f = this._options) == null ? void 0 : _f.xLangfusePublicKey }), requestOptions == null ? void 0 : requestOptions.headers); const _response = await fetcher({ - url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(name)}/versions/${encodeURIComponent(version$1)}`), + url: url_exports.join((_h = await Supplier.get(this._options.baseUrl)) != null ? _h : await Supplier.get(this._options.environment), `/api/public/v2/prompts/${encodeURIComponent(name)}/versions/${encodeURIComponent(version)}`), method: "PATCH", headers: _headers, contentType: "application/json", @@ -12438,9 +12424,9 @@ var Prompts = class { } async __get(promptName, request = {}, requestOptions) { var _a2, _b, _c, _d, _e, _f, _g, _h; - const { version: version$1, label, resolve } = request; + const { version, label, resolve } = request; const _queryParams = {}; - if (version$1 != null) _queryParams["version"] = version$1.toString(); + if (version != null) _queryParams["version"] = version.toString(); if (label != null) _queryParams["label"] = label; if (resolve != null) _queryParams["resolve"] = resolve.toString(); let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ @@ -12670,10 +12656,10 @@ var Prompts = class { } async __delete(promptName, request = {}, requestOptions) { var _a2, _b, _c, _d, _e, _f, _g, _h; - const { label, version: version$1 } = request; + const { label, version } = request; const _queryParams = {}; if (label != null) _queryParams["label"] = label; - if (version$1 != null) _queryParams["version"] = version$1.toString(); + if (version != null) _queryParams["version"] = version.toString(); let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, @@ -13536,8 +13522,10 @@ var Scores = class { if (name != null) _queryParams["name"] = name; if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; + if (environment != null) { + if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + } if (source != null) _queryParams["source"] = source; if (operator != null) _queryParams["operator"] = operator; if (value != null) _queryParams["value"] = value.toString(); @@ -13549,8 +13537,10 @@ var Scores = class { if (observationId != null) _queryParams["observationId"] = observationId; if (queueId != null) _queryParams["queueId"] = queueId; if (dataType != null) _queryParams["dataType"] = dataType; - if (traceTags != null) if (Array.isArray(traceTags)) _queryParams["traceTags"] = traceTags.map((item) => item); - else _queryParams["traceTags"] = traceTags; + if (traceTags != null) { + if (Array.isArray(traceTags)) _queryParams["traceTags"] = traceTags.map((item) => item); + else _queryParams["traceTags"] = traceTags; + } if (fields != null) _queryParams["fields"] = fields; if (filter != null) _queryParams["filter"] = filter; let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ @@ -13703,8 +13693,10 @@ var Sessions = class { if (limit != null) _queryParams["limit"] = limit.toString(); if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; + if (environment != null) { + if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + } let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader(), "X-Langfuse-Sdk-Name": (_c = requestOptions == null ? void 0 : requestOptions.xLangfuseSdkName) != null ? _c : (_b = this._options) == null ? void 0 : _b.xLangfuseSdkName, @@ -13984,7 +13976,7 @@ var Trace = class { } async __list(request = {}, requestOptions) { var _a2, _b, _c, _d, _e, _f, _g, _h; - const { page, limit, userId, name, sessionId, fromTimestamp, toTimestamp, orderBy, tags, version: version$1, release, environment, fields, filter } = request; + const { page, limit, userId, name, sessionId, fromTimestamp, toTimestamp, orderBy, tags, version, release, environment, fields, filter } = request; const _queryParams = {}; if (page != null) _queryParams["page"] = page.toString(); if (limit != null) _queryParams["limit"] = limit.toString(); @@ -13994,12 +13986,16 @@ var Trace = class { if (fromTimestamp != null) _queryParams["fromTimestamp"] = fromTimestamp; if (toTimestamp != null) _queryParams["toTimestamp"] = toTimestamp; if (orderBy != null) _queryParams["orderBy"] = orderBy; - if (tags != null) if (Array.isArray(tags)) _queryParams["tags"] = tags.map((item) => item); - else _queryParams["tags"] = tags; - if (version$1 != null) _queryParams["version"] = version$1; + if (tags != null) { + if (Array.isArray(tags)) _queryParams["tags"] = tags.map((item) => item); + else _queryParams["tags"] = tags; + } + if (version != null) _queryParams["version"] = version; if (release != null) _queryParams["release"] = release; - if (environment != null) if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); - else _queryParams["environment"] = environment; + if (environment != null) { + if (Array.isArray(environment)) _queryParams["environment"] = environment.map((item) => item); + else _queryParams["environment"] = environment; + } if (fields != null) _queryParams["fields"] = fields; if (filter != null) _queryParams["filter"] = filter; let _headers = mergeHeaders$1((_a2 = this._options) == null ? void 0 : _a2.headers, mergeOnlyDefinedHeaders({ @@ -15258,8 +15254,8 @@ var LangfuseOtelContextKeys = { var LANGFUSE_BAGGAGE_PREFIX = "langfuse_"; var LANGFUSE_BAGGAGE_TAGS_SEPARATOR = ","; var LANGFUSE_TRACE_ID_BAGGAGE_KEY = "langfuse_trace_id"; -function getLangfuseTraceIdFromBaggage(context$1) { - const baggage = propagation.getBaggage(context$1); +function getLangfuseTraceIdFromBaggage(context) { + const baggage = propagation.getBaggage(context); const entry = baggage == null ? void 0 : baggage.getEntry(LANGFUSE_TRACE_ID_BAGGAGE_KEY); if (!(entry == null ? void 0 : entry.value)) return void 0; return entry.value.toLowerCase(); @@ -15269,7 +15265,7 @@ function propagateAttributes(params, fn) { let context$1 = context.active(); const span = trace.getActiveSpan(); const asBaggage = (_a2 = params.asBaggage) != null ? _a2 : false; - const { userId, sessionId, metadata, version: version$1, tags, traceName, _internalExperiment } = params; + const { userId, sessionId, metadata, version, tags, traceName, _internalExperiment } = params; if (userId) { if (isValidPropagatedString({ value: userId, @@ -15294,13 +15290,13 @@ function propagateAttributes(params, fn) { asBaggage }); } - if (version$1) { + if (version) { if (isValidPropagatedString({ - value: version$1, + value: version, attributeName: "version" })) context$1 = setPropagatedAttribute({ key: "version", - value: version$1, + value: version, context: context$1, span, asBaggage @@ -15356,49 +15352,52 @@ function propagateAttributes(params, fn) { } return context.with(context$1, fn); } -function getPropagatedAttributesFromContext(context$1) { +function getPropagatedAttributesFromContext(context) { const propagatedAttributes = {}; - const baggage = propagation.getBaggage(context$1); + const baggage = propagation.getBaggage(context); if (baggage) baggage.getAllEntries().forEach(([baggageKey, baggageEntry]) => { - if (baggageKey === LANGFUSE_TRACE_ID_BAGGAGE_KEY) return; + if (baggageKey === "langfuse_trace_id") return; if (baggageKey.startsWith(LANGFUSE_BAGGAGE_PREFIX)) { const spanKey = getSpanKeyFromBaggageKey(baggageKey); - if (spanKey) propagatedAttributes[spanKey] = baggageKey == getBaggageKeyForPropagatedKey("tags") ? baggageEntry.value.split(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) : baggageEntry.value; + if (spanKey) { + const isMergedTags = baggageKey == getBaggageKeyForPropagatedKey("tags"); + propagatedAttributes[spanKey] = isMergedTags ? baggageEntry.value.split(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) : baggageEntry.value; + } } }); - const userId = context$1.getValue(LangfuseOtelContextKeys["userId"]); + const userId = context.getValue(LangfuseOtelContextKeys["userId"]); if (userId && typeof userId === "string") { const spanKey = getSpanKeyForPropagatedKey("userId"); propagatedAttributes[spanKey] = userId; } - const sessionId = context$1.getValue(LangfuseOtelContextKeys["sessionId"]); + const sessionId = context.getValue(LangfuseOtelContextKeys["sessionId"]); if (sessionId && typeof sessionId === "string") { const spanKey = getSpanKeyForPropagatedKey("sessionId"); propagatedAttributes[spanKey] = sessionId; } - const version$1 = context$1.getValue(LangfuseOtelContextKeys["version"]); - if (version$1 && typeof version$1 === "string") { + const version = context.getValue(LangfuseOtelContextKeys["version"]); + if (version && typeof version === "string") { const spanKey = getSpanKeyForPropagatedKey("version"); - propagatedAttributes[spanKey] = version$1; + propagatedAttributes[spanKey] = version; } - const traceName = context$1.getValue(LangfuseOtelContextKeys["traceName"]); + const traceName = context.getValue(LangfuseOtelContextKeys["traceName"]); if (traceName && typeof traceName === "string") { const spanKey = getSpanKeyForPropagatedKey("traceName"); propagatedAttributes[spanKey] = traceName; } - const tags = context$1.getValue(LangfuseOtelContextKeys["tags"]); + const tags = context.getValue(LangfuseOtelContextKeys["tags"]); if (tags && Array.isArray(tags)) { const spanKey = getSpanKeyForPropagatedKey("tags"); propagatedAttributes[spanKey] = tags; } - const metadata = context$1.getValue(LangfuseOtelContextKeys["metadata"]); + const metadata = context.getValue(LangfuseOtelContextKeys["metadata"]); if (metadata && typeof metadata === "object" && metadata !== null) for (const [k, v] of Object.entries(metadata)) { const spanKey = `langfuse.trace.metadata.${k}`; propagatedAttributes[spanKey] = String(v); } for (const key of experimentKeys) { const contextKey = LangfuseOtelContextKeys[key]; - const value = context$1.getValue(contextKey); + const value = context.getValue(contextKey); if (value && typeof value === "string") { const spanKey = getSpanKeyForPropagatedKey(key); propagatedAttributes[spanKey] = value; @@ -15409,38 +15408,40 @@ function getPropagatedAttributesFromContext(context$1) { } function setPropagatedAttribute(params) { const { key, value, span, asBaggage } = params; - let context$1 = params.context; - let mergedMetadata = key === "metadata" ? getContextMergedMetadata(context$1, value) : {}; - let mergedTags = key === "tags" ? getContextMergedTags(context$1, value) : []; + let context = params.context; + let mergedMetadata = key === "metadata" ? getContextMergedMetadata(context, value) : {}; + let mergedTags = key === "tags" ? getContextMergedTags(context, value) : []; const contextKey = getContextKeyForPropagatedKey(key); - if (key === "metadata") context$1 = context$1.setValue(contextKey, mergedMetadata); - else if (key === "tags") context$1 = context$1.setValue(contextKey, mergedTags); - else context$1 = context$1.setValue(contextKey, value); - if (span && span.isRecording()) if (key === "metadata") for (const [k, v] of Object.entries(mergedMetadata)) span.setAttribute(`langfuse.trace.metadata.${k}`, v); - else if (key === "tags") { - const spanKey = getSpanKeyForPropagatedKey(key); - span.setAttribute(spanKey, mergedTags); - } else { - const spanKey = getSpanKeyForPropagatedKey(key); - span.setAttribute(spanKey, value); + if (key === "metadata") context = context.setValue(contextKey, mergedMetadata); + else if (key === "tags") context = context.setValue(contextKey, mergedTags); + else context = context.setValue(contextKey, value); + if (span && span.isRecording()) { + if (key === "metadata") for (const [k, v] of Object.entries(mergedMetadata)) span.setAttribute(`langfuse.trace.metadata.${k}`, v); + else if (key === "tags") { + const spanKey = getSpanKeyForPropagatedKey(key); + span.setAttribute(spanKey, mergedTags); + } else { + const spanKey = getSpanKeyForPropagatedKey(key); + span.setAttribute(spanKey, value); + } } if (asBaggage) { const baggageKey = getBaggageKeyForPropagatedKey(key); - let baggage = propagation.getBaggage(context$1) || propagation.createBaggage(); + let baggage = propagation.getBaggage(context) || propagation.createBaggage(); if (key === "metadata") for (const [k, v] of Object.entries(mergedMetadata)) baggage = baggage.setEntry(`${baggageKey}_${k}`, { value: v }); else if (key === "tags") baggage = baggage.setEntry(baggageKey, { value: mergedTags.join(LANGFUSE_BAGGAGE_TAGS_SEPARATOR) }); else baggage = baggage.setEntry(baggageKey, { value }); - context$1 = propagation.setBaggage(context$1, baggage); + context = propagation.setBaggage(context, baggage); } - return context$1; + return context; } -function getContextMergedTags(context$1, newTags) { - const existingTags = context$1.getValue(LangfuseOtelContextKeys["tags"]); +function getContextMergedTags(context, newTags) { + const existingTags = context.getValue(LangfuseOtelContextKeys["tags"]); if (existingTags && Array.isArray(existingTags)) return [.../* @__PURE__ */ new Set([...existingTags, ...newTags])]; else return newTags; } -function getContextMergedMetadata(context$1, newMetadata) { - const existingMetadata = context$1.getValue(LangfuseOtelContextKeys["metadata"]); +function getContextMergedMetadata(context, newMetadata) { + const existingMetadata = context.getValue(LangfuseOtelContextKeys["metadata"]); if (existingMetadata && typeof existingMetadata === "object" && existingMetadata !== null && !Array.isArray(existingMetadata)) return { ...existingMetadata, ...newMetadata @@ -15478,10 +15479,7 @@ function getSpanKeyForPropagatedKey(key) { case "experimentItemId": return "langfuse.experiment.item.id"; case "experimentItemMetadata": return "langfuse.experiment.item.metadata"; case "experimentItemRootObservationId": return "langfuse.experiment.item.root_observation_id"; - default: { - const fallback = key; - throw Error("Unhandled propagated key", fallback); - } + default: throw Error("Unhandled propagated key", key); } } function getBaggageKeyForPropagatedKey(key) { @@ -15499,10 +15497,7 @@ function getBaggageKeyForPropagatedKey(key) { case "experimentItemId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_id`; case "experimentItemMetadata": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_metadata`; case "experimentItemRootObservationId": return `${LANGFUSE_BAGGAGE_PREFIX}experiment_item_root_observation_id`; - default: { - const fallback = key; - throw Error("Unhandled propagated key", fallback); - } + default: throw Error("Unhandled propagated key", key); } } function getSpanKeyFromBaggageKey(baggageKey) { @@ -15526,28 +15521,28 @@ function getSpanKeyFromBaggageKey(baggageKey) { } //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js -var require_suppress_tracing$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js +var require_suppress_tracing = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; const SUPPRESS_TRACING_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); - function suppressTracing(context$1) { - return context$1.setValue(SUPPRESS_TRACING_KEY, true); + function suppressTracing(context) { + return context.setValue(SUPPRESS_TRACING_KEY, true); } exports.suppressTracing = suppressTracing; - function unsuppressTracing(context$1) { - return context$1.deleteValue(SUPPRESS_TRACING_KEY); + function unsuppressTracing(context) { + return context.deleteValue(SUPPRESS_TRACING_KEY); } exports.unsuppressTracing = unsuppressTracing; - function isTracingSuppressed(context$1) { - return context$1.getValue(SUPPRESS_TRACING_KEY) === true; + function isTracingSuppressed(context) { + return context.getValue(SUPPRESS_TRACING_KEY) === true; } exports.isTracingSuppressed = isTracingSuppressed; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/constants.js -var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/constants.js +var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; @@ -15560,12 +15555,12 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/utils.js -var require_utils$7 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils$5 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; + exports.parseKeyPairsIntoRecord = exports.parseBaggageHeaderString = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const constants_1 = require_constants$1(); + const constants_1 = require_constants(); function serializeKeyPairs(keyPairs) { return keyPairs.reduce((hValue, current) => { const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; @@ -15611,6 +15606,36 @@ var require_utils$7 = /* @__PURE__ */ __commonJSMin(((exports) => { } exports.parsePairKeyValue = parsePairKeyValue; /** + * Parses a single baggage header string into the provided record, applying limits defined in this package. + * Uses indexOf/substring in a while loop to avoid allocating a full array of split entries. + * Returns the updated pair count so callers can track totals across multiple header values. + */ + function parseBaggageHeaderString(value, baggage, count, totalSize) { + let start = 0; + while (start < value.length && count < constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS) { + const end = value.indexOf(constants_1.BAGGAGE_ITEMS_SEPARATOR, start); + const entryEnd = end === -1 ? value.length : end; + const entryLength = entryEnd - start; + if (entryLength <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS) { + const keyPair = parsePairKeyValue(value.substring(start, entryEnd)); + if (keyPair) { + const entrySize = (count === 0 ? 0 : 1) + entryLength; + if (totalSize + entrySize > constants_1.BAGGAGE_MAX_TOTAL_LENGTH) break; + baggage[keyPair.key] = keyPair.metadata ? { + value: keyPair.value, + metadata: keyPair.metadata + } : { value: keyPair.value }; + count++; + totalSize += entrySize; + } + } + if (end === -1) break; + start = end + 1; + } + return [count, totalSize]; + } + exports.parseBaggageHeaderString = parseBaggageHeaderString; + /** * Parse a string serialized in the baggage HTTP Format (without metadata): * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md */ @@ -15626,14 +15651,14 @@ var require_utils$7 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js -var require_W3CBaggagePropagator$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js +var require_W3CBaggagePropagator = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.W3CBaggagePropagator = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing$1(); - const constants_1 = require_constants$1(); - const utils_1 = require_utils$7(); + const suppress_tracing_1 = require_suppress_tracing(); + const constants_1 = require_constants(); + const utils_1 = require_utils$5(); /** * Propagates {@link Baggage} through Context format propagation. * @@ -15641,31 +15666,25 @@ var require_W3CBaggagePropagator$1 = /* @__PURE__ */ __commonJSMin(((exports) => * https://w3c.github.io/baggage/ */ var W3CBaggagePropagator = class { - inject(context$1, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context$1); - if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context$1)) return; + inject(context, carrier, setter) { + const baggage = api_1.propagation.getBaggage(context); + if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) return; const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); if (headerValue.length > 0) setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); } - extract(context$1, carrier, getter) { + extract(context, carrier, getter) { const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); - const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; - if (!baggageString) return context$1; + if (!headerValue) return context; const baggage = {}; - if (baggageString.length === 0) return context$1; - baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { - const keyPair = (0, utils_1.parsePairKeyValue)(entry); - if (keyPair) { - const baggageEntry = { value: keyPair.value }; - if (keyPair.metadata) baggageEntry.metadata = keyPair.metadata; - baggage[keyPair.key] = baggageEntry; - } - }); - if (Object.entries(baggage).length === 0) return context$1; - return api_1.propagation.setBaggage(context$1, api_1.propagation.createBaggage(baggage)); + let count = 0; + let totalSize = 0; + if (Array.isArray(headerValue)) for (let i = 0; i < headerValue.length; i++) [count, totalSize] = (0, utils_1.parseBaggageHeaderString)(headerValue[i], baggage, count, totalSize); + else [count] = (0, utils_1.parseBaggageHeaderString)(headerValue, baggage, count, totalSize); + if (count === 0) return context; + return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); } fields() { return [constants_1.BAGGAGE_HEADER]; @@ -15675,8 +15694,8 @@ var require_W3CBaggagePropagator$1 = /* @__PURE__ */ __commonJSMin(((exports) => })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js -var require_anchored_clock$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js +var require_anchored_clock = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AnchoredClock = void 0; /** @@ -15724,8 +15743,8 @@ var require_anchored_clock$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/attributes.js -var require_attributes$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/attributes.js +var require_attributes = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); @@ -15787,8 +15806,8 @@ var require_attributes$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js -var require_logging_error_handler$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js +var require_logging_error_handler = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.loggingErrorHandler = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); @@ -15831,12 +15850,12 @@ var require_logging_error_handler$1 = /* @__PURE__ */ __commonJSMin(((exports) = })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js -var require_global_error_handler$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js +var require_global_error_handler = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; /** The global error handler delegate */ - let delegateHandler = (0, require_logging_error_handler$1().loggingErrorHandler)(); + let delegateHandler = (0, require_logging_error_handler().loggingErrorHandler)(); /** * Set the global error handler * @param {ErrorHandler} handler @@ -15858,12 +15877,12 @@ var require_global_error_handler$1 = /* @__PURE__ */ __commonJSMin(((exports) => })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/environment.js -var require_environment$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/environment.js +var require_environment = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const util_1$1 = __require("util"); + const util_1 = __require("util"); /** * Retrieves a number from an environment variable. * - Returns `undefined` if the environment variable is empty, unset, contains only whitespace, or is not a number. @@ -15877,7 +15896,7 @@ var require_environment$1 = /* @__PURE__ */ __commonJSMin(((exports) => { if (raw == null || raw.trim() === "") return; const value = Number(raw); if (isNaN(value)) { - api_1.diag.warn(`Unknown value ${(0, util_1$1.inspect)(raw)} for ${key}, expected a number, using defaults`); + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); return; } return value; @@ -15911,7 +15930,7 @@ var require_environment$1 = /* @__PURE__ */ __commonJSMin(((exports) => { if (raw === "true") return true; else if (raw === "false") return false; else { - api_1.diag.warn(`Unknown value ${(0, util_1$1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); return false; } } @@ -15934,8 +15953,8 @@ var require_environment$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/globalThis.js -var require_globalThis$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/globalThis.js +var require_globalThis = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports._globalThis = void 0; /** @@ -15945,11 +15964,11 @@ var require_globalThis$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/version.js -var require_version$3 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/version.js +var require_version$2 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.VERSION = void 0; - exports.VERSION = "2.7.1"; + exports.VERSION = "2.10.0"; })); //#endregion @@ -15959,7 +15978,7 @@ var require_version$3 = /* @__PURE__ */ __commonJSMin(((exports) => { * @param values - An array of values to be used as keys and values in the map. * @returns A populated version of the map with the values and keys derived from the values. */ -/* @__NO_SIDE_EFFECTS__ */ +/*#__NO_SIDE_EFFECTS__*/ function createConstMap(values) { let res = {}; const len = values.length; @@ -16232,7 +16251,7 @@ var init_SemanticAttributes = __esmMin((() => { SEMATTRS_MESSAGE_ID = TMP_MESSAGE_ID; SEMATTRS_MESSAGE_COMPRESSED_SIZE = TMP_MESSAGE_COMPRESSED_SIZE; SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = TMP_MESSAGE_UNCOMPRESSED_SIZE; - SemanticAttributes = /* @__PURE__ */ createConstMap([ + SemanticAttributes = /*#__PURE__*/ createConstMap([ TMP_AWS_LAMBDA_INVOKED_ARN, TMP_DB_SYSTEM, TMP_DB_CONNECTION_STRING, @@ -16456,7 +16475,7 @@ var init_SemanticAttributes = __esmMin((() => { DBSYSTEMVALUES_ELASTICSEARCH = TMP_DBSYSTEMVALUES_ELASTICSEARCH; DBSYSTEMVALUES_MEMCACHED = TMP_DBSYSTEMVALUES_MEMCACHED; DBSYSTEMVALUES_COCKROACHDB = TMP_DBSYSTEMVALUES_COCKROACHDB; - DbSystemValues = /* @__PURE__ */ createConstMap([ + DbSystemValues = /*#__PURE__*/ createConstMap([ TMP_DBSYSTEMVALUES_OTHER_SQL, TMP_DBSYSTEMVALUES_MSSQL, TMP_DBSYSTEMVALUES_MYSQL, @@ -16527,7 +16546,7 @@ var init_SemanticAttributes = __esmMin((() => { DBCASSANDRACONSISTENCYLEVELVALUES_ANY = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY; DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL; DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL; - DbCassandraConsistencyLevelValues = /* @__PURE__ */ createConstMap([ + DbCassandraConsistencyLevelValues = /*#__PURE__*/ createConstMap([ TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, @@ -16550,7 +16569,7 @@ var init_SemanticAttributes = __esmMin((() => { FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; FAASTRIGGERVALUES_OTHER = TMP_FAASTRIGGERVALUES_OTHER; - FaasTriggerValues = /* @__PURE__ */ createConstMap([ + FaasTriggerValues = /*#__PURE__*/ createConstMap([ TMP_FAASTRIGGERVALUES_DATASOURCE, TMP_FAASTRIGGERVALUES_HTTP, TMP_FAASTRIGGERVALUES_PUBSUB, @@ -16563,7 +16582,7 @@ var init_SemanticAttributes = __esmMin((() => { FAASDOCUMENTOPERATIONVALUES_INSERT = TMP_FAASDOCUMENTOPERATIONVALUES_INSERT; FAASDOCUMENTOPERATIONVALUES_EDIT = TMP_FAASDOCUMENTOPERATIONVALUES_EDIT; FAASDOCUMENTOPERATIONVALUES_DELETE = TMP_FAASDOCUMENTOPERATIONVALUES_DELETE; - FaasDocumentOperationValues = /* @__PURE__ */ createConstMap([ + FaasDocumentOperationValues = /*#__PURE__*/ createConstMap([ TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, TMP_FAASDOCUMENTOPERATIONVALUES_DELETE @@ -16576,7 +16595,7 @@ var init_SemanticAttributes = __esmMin((() => { FAASINVOKEDPROVIDERVALUES_AWS = TMP_FAASINVOKEDPROVIDERVALUES_AWS; FAASINVOKEDPROVIDERVALUES_AZURE = TMP_FAASINVOKEDPROVIDERVALUES_AZURE; FAASINVOKEDPROVIDERVALUES_GCP = TMP_FAASINVOKEDPROVIDERVALUES_GCP; - FaasInvokedProviderValues = /* @__PURE__ */ createConstMap([ + FaasInvokedProviderValues = /*#__PURE__*/ createConstMap([ TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, TMP_FAASINVOKEDPROVIDERVALUES_AWS, TMP_FAASINVOKEDPROVIDERVALUES_AZURE, @@ -16596,7 +16615,7 @@ var init_SemanticAttributes = __esmMin((() => { NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; NETTRANSPORTVALUES_OTHER = TMP_NETTRANSPORTVALUES_OTHER; - NetTransportValues = /* @__PURE__ */ createConstMap([ + NetTransportValues = /*#__PURE__*/ createConstMap([ TMP_NETTRANSPORTVALUES_IP_TCP, TMP_NETTRANSPORTVALUES_IP_UDP, TMP_NETTRANSPORTVALUES_IP, @@ -16615,7 +16634,7 @@ var init_SemanticAttributes = __esmMin((() => { NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN; - NetHostConnectionTypeValues = /* @__PURE__ */ createConstMap([ + NetHostConnectionTypeValues = /*#__PURE__*/ createConstMap([ TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, @@ -16664,7 +16683,7 @@ var init_SemanticAttributes = __esmMin((() => { NETHOSTCONNECTIONSUBTYPEVALUES_NR = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR; NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA; NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA; - NetHostConnectionSubtypeValues = /* @__PURE__ */ createConstMap([ + NetHostConnectionSubtypeValues = /*#__PURE__*/ createConstMap([ TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, @@ -16708,12 +16727,12 @@ var init_SemanticAttributes = __esmMin((() => { TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC = "topic"; MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; MESSAGINGDESTINATIONKINDVALUES_TOPIC = TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC; - MessagingDestinationKindValues = /* @__PURE__ */ createConstMap([TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC]); + MessagingDestinationKindValues = /*#__PURE__*/ createConstMap([TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC]); TMP_MESSAGINGOPERATIONVALUES_RECEIVE = "receive"; TMP_MESSAGINGOPERATIONVALUES_PROCESS = "process"; MESSAGINGOPERATIONVALUES_RECEIVE = TMP_MESSAGINGOPERATIONVALUES_RECEIVE; MESSAGINGOPERATIONVALUES_PROCESS = TMP_MESSAGINGOPERATIONVALUES_PROCESS; - MessagingOperationValues = /* @__PURE__ */ createConstMap([TMP_MESSAGINGOPERATIONVALUES_RECEIVE, TMP_MESSAGINGOPERATIONVALUES_PROCESS]); + MessagingOperationValues = /*#__PURE__*/ createConstMap([TMP_MESSAGINGOPERATIONVALUES_RECEIVE, TMP_MESSAGINGOPERATIONVALUES_PROCESS]); TMP_RPCGRPCSTATUSCODEVALUES_OK = 0; TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED = 1; TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN = 2; @@ -16771,7 +16790,7 @@ var init_SemanticAttributes = __esmMin((() => { TMP_MESSAGETYPEVALUES_RECEIVED = "RECEIVED"; MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; MESSAGETYPEVALUES_RECEIVED = TMP_MESSAGETYPEVALUES_RECEIVED; - MessageTypeValues = /* @__PURE__ */ createConstMap([TMP_MESSAGETYPEVALUES_SENT, TMP_MESSAGETYPEVALUES_RECEIVED]); + MessageTypeValues = /*#__PURE__*/ createConstMap([TMP_MESSAGETYPEVALUES_SENT, TMP_MESSAGETYPEVALUES_RECEIVED]); })); //#endregion @@ -16947,7 +16966,7 @@ var init_SemanticResourceAttributes = __esmMin((() => { SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; SEMRESATTRS_WEBENGINE_VERSION = TMP_WEBENGINE_VERSION; SEMRESATTRS_WEBENGINE_DESCRIPTION = TMP_WEBENGINE_DESCRIPTION; - SemanticResourceAttributes = /* @__PURE__ */ createConstMap([ + SemanticResourceAttributes = /*#__PURE__*/ createConstMap([ TMP_CLOUD_PROVIDER, TMP_CLOUD_ACCOUNT_ID, TMP_CLOUD_REGION, @@ -17038,7 +17057,7 @@ var init_SemanticResourceAttributes = __esmMin((() => { CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; CLOUDPROVIDERVALUES_GCP = TMP_CLOUDPROVIDERVALUES_GCP; - CloudProviderValues = /* @__PURE__ */ createConstMap([ + CloudProviderValues = /*#__PURE__*/ createConstMap([ TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, TMP_CLOUDPROVIDERVALUES_AWS, TMP_CLOUDPROVIDERVALUES_AZURE, @@ -17078,7 +17097,7 @@ var init_SemanticResourceAttributes = __esmMin((() => { CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE; CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS; CLOUDPLATFORMVALUES_GCP_APP_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE; - CloudPlatformValues = /* @__PURE__ */ createConstMap([ + CloudPlatformValues = /*#__PURE__*/ createConstMap([ TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, TMP_CLOUDPLATFORMVALUES_AWS_EC2, @@ -17101,7 +17120,7 @@ var init_SemanticResourceAttributes = __esmMin((() => { TMP_AWSECSLAUNCHTYPEVALUES_FARGATE = "fargate"; AWSECSLAUNCHTYPEVALUES_EC2 = TMP_AWSECSLAUNCHTYPEVALUES_EC2; AWSECSLAUNCHTYPEVALUES_FARGATE = TMP_AWSECSLAUNCHTYPEVALUES_FARGATE; - AwsEcsLaunchtypeValues = /* @__PURE__ */ createConstMap([TMP_AWSECSLAUNCHTYPEVALUES_EC2, TMP_AWSECSLAUNCHTYPEVALUES_FARGATE]); + AwsEcsLaunchtypeValues = /*#__PURE__*/ createConstMap([TMP_AWSECSLAUNCHTYPEVALUES_EC2, TMP_AWSECSLAUNCHTYPEVALUES_FARGATE]); TMP_HOSTARCHVALUES_AMD64 = "amd64"; TMP_HOSTARCHVALUES_ARM32 = "arm32"; TMP_HOSTARCHVALUES_ARM64 = "arm64"; @@ -17116,7 +17135,7 @@ var init_SemanticResourceAttributes = __esmMin((() => { HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; HOSTARCHVALUES_X86 = TMP_HOSTARCHVALUES_X86; - HostArchValues = /* @__PURE__ */ createConstMap([ + HostArchValues = /*#__PURE__*/ createConstMap([ TMP_HOSTARCHVALUES_AMD64, TMP_HOSTARCHVALUES_ARM32, TMP_HOSTARCHVALUES_ARM64, @@ -17147,7 +17166,7 @@ var init_SemanticResourceAttributes = __esmMin((() => { OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; OSTYPEVALUES_Z_OS = TMP_OSTYPEVALUES_Z_OS; - OsTypeValues = /* @__PURE__ */ createConstMap([ + OsTypeValues = /*#__PURE__*/ createConstMap([ TMP_OSTYPEVALUES_WINDOWS, TMP_OSTYPEVALUES_LINUX, TMP_OSTYPEVALUES_DARWIN, @@ -17180,7 +17199,7 @@ var init_SemanticResourceAttributes = __esmMin((() => { TELEMETRYSDKLANGUAGEVALUES_PYTHON = TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON; TELEMETRYSDKLANGUAGEVALUES_RUBY = TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY; TELEMETRYSDKLANGUAGEVALUES_WEBJS = TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS; - TelemetrySdkLanguageValues = /* @__PURE__ */ createConstMap([ + TelemetrySdkLanguageValues = /*#__PURE__*/ createConstMap([ TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, @@ -17202,7 +17221,7 @@ var init_resource = __esmMin((() => { //#endregion //#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js -var ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED, ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE, ATTR_ASPNETCORE_RATE_LIMITING_POLICY, ATTR_ASPNETCORE_RATE_LIMITING_RESULT, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED, ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED, ATTR_ASPNETCORE_ROUTING_IS_FALLBACK, ATTR_ASPNETCORE_ROUTING_MATCH_STATUS, ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE, ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS, ATTR_ASPNETCORE_USER_IS_AUTHENTICATED, ATTR_CLIENT_ADDRESS, ATTR_CLIENT_PORT, ATTR_CODE_COLUMN_NUMBER, ATTR_CODE_FILE_PATH, ATTR_CODE_FUNCTION_NAME, ATTR_CODE_LINE_NUMBER, ATTR_CODE_STACKTRACE, ATTR_DB_COLLECTION_NAME, ATTR_DB_NAMESPACE, ATTR_DB_OPERATION_BATCH_SIZE, ATTR_DB_OPERATION_NAME, ATTR_DB_QUERY_SUMMARY, ATTR_DB_QUERY_TEXT, ATTR_DB_RESPONSE_STATUS_CODE, ATTR_DB_STORED_PROCEDURE_NAME, ATTR_DB_SYSTEM_NAME, DB_SYSTEM_NAME_VALUE_MARIADB, DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER, DB_SYSTEM_NAME_VALUE_MYSQL, DB_SYSTEM_NAME_VALUE_POSTGRESQL, ATTR_DEPLOYMENT_ENVIRONMENT_NAME, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST, ATTR_DOTNET_GC_HEAP_GENERATION, DOTNET_GC_HEAP_GENERATION_VALUE_GEN0, DOTNET_GC_HEAP_GENERATION_VALUE_GEN1, DOTNET_GC_HEAP_GENERATION_VALUE_GEN2, DOTNET_GC_HEAP_GENERATION_VALUE_LOH, DOTNET_GC_HEAP_GENERATION_VALUE_POH, ATTR_ERROR_TYPE, ERROR_TYPE_VALUE_OTHER, ATTR_EXCEPTION_ESCAPED, ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, HTTP_REQUEST_METHOD_VALUE_OTHER, HTTP_REQUEST_METHOD_VALUE_CONNECT, HTTP_REQUEST_METHOD_VALUE_DELETE, HTTP_REQUEST_METHOD_VALUE_GET, HTTP_REQUEST_METHOD_VALUE_HEAD, HTTP_REQUEST_METHOD_VALUE_OPTIONS, HTTP_REQUEST_METHOD_VALUE_PATCH, HTTP_REQUEST_METHOD_VALUE_POST, HTTP_REQUEST_METHOD_VALUE_PUT, HTTP_REQUEST_METHOD_VALUE_TRACE, ATTR_HTTP_REQUEST_METHOD_ORIGINAL, ATTR_HTTP_REQUEST_RESEND_COUNT, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_HTTP_ROUTE, ATTR_JVM_GC_ACTION, ATTR_JVM_GC_NAME, ATTR_JVM_MEMORY_POOL_NAME, ATTR_JVM_MEMORY_TYPE, JVM_MEMORY_TYPE_VALUE_HEAP, JVM_MEMORY_TYPE_VALUE_NON_HEAP, ATTR_JVM_THREAD_DAEMON, ATTR_JVM_THREAD_STATE, JVM_THREAD_STATE_VALUE_BLOCKED, JVM_THREAD_STATE_VALUE_NEW, JVM_THREAD_STATE_VALUE_RUNNABLE, JVM_THREAD_STATE_VALUE_TERMINATED, JVM_THREAD_STATE_VALUE_TIMED_WAITING, JVM_THREAD_STATE_VALUE_WAITING, ATTR_NETWORK_LOCAL_ADDRESS, ATTR_NETWORK_LOCAL_PORT, ATTR_NETWORK_PEER_ADDRESS, ATTR_NETWORK_PEER_PORT, ATTR_NETWORK_PROTOCOL_NAME, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_NETWORK_TRANSPORT, NETWORK_TRANSPORT_VALUE_PIPE, NETWORK_TRANSPORT_VALUE_QUIC, NETWORK_TRANSPORT_VALUE_TCP, NETWORK_TRANSPORT_VALUE_UDP, NETWORK_TRANSPORT_VALUE_UNIX, ATTR_NETWORK_TYPE, NETWORK_TYPE_VALUE_IPV4, NETWORK_TYPE_VALUE_IPV6, ATTR_OTEL_EVENT_NAME, ATTR_OTEL_SCOPE_NAME, ATTR_OTEL_SCOPE_VERSION, ATTR_OTEL_STATUS_CODE, OTEL_STATUS_CODE_VALUE_ERROR, OTEL_STATUS_CODE_VALUE_OK, ATTR_OTEL_STATUS_DESCRIPTION, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_SERVICE_INSTANCE_ID, ATTR_SERVICE_NAME, ATTR_SERVICE_NAMESPACE, ATTR_SERVICE_VERSION, ATTR_SIGNALR_CONNECTION_STATUS, SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN, SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE, SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT, ATTR_SIGNALR_TRANSPORT, SIGNALR_TRANSPORT_VALUE_LONG_POLLING, SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS, SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS, ATTR_TELEMETRY_DISTRO_NAME, ATTR_TELEMETRY_DISTRO_VERSION, ATTR_TELEMETRY_SDK_LANGUAGE, TELEMETRY_SDK_LANGUAGE_VALUE_CPP, TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET, TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG, TELEMETRY_SDK_LANGUAGE_VALUE_GO, TELEMETRY_SDK_LANGUAGE_VALUE_JAVA, TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, TELEMETRY_SDK_LANGUAGE_VALUE_PHP, TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON, TELEMETRY_SDK_LANGUAGE_VALUE_RUBY, TELEMETRY_SDK_LANGUAGE_VALUE_RUST, TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT, TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, ATTR_URL_FRAGMENT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_QUERY, ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL; +var ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED, ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED, ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE, ATTR_ASPNETCORE_RATE_LIMITING_POLICY, ATTR_ASPNETCORE_RATE_LIMITING_RESULT, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER, ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED, ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED, ATTR_ASPNETCORE_ROUTING_IS_FALLBACK, ATTR_ASPNETCORE_ROUTING_MATCH_STATUS, ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE, ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS, ATTR_ASPNETCORE_USER_IS_AUTHENTICATED, ATTR_CLIENT_ADDRESS, ATTR_CLIENT_PORT, ATTR_CODE_COLUMN_NUMBER, ATTR_CODE_FILE_PATH, ATTR_CODE_FUNCTION_NAME, ATTR_CODE_LINE_NUMBER, ATTR_CODE_STACKTRACE, ATTR_DB_COLLECTION_NAME, ATTR_DB_NAMESPACE, ATTR_DB_OPERATION_BATCH_SIZE, ATTR_DB_OPERATION_NAME, ATTR_DB_QUERY_SUMMARY, ATTR_DB_QUERY_TEXT, ATTR_DB_RESPONSE_STATUS_CODE, ATTR_DB_STORED_PROCEDURE_NAME, ATTR_DB_SYSTEM_NAME, DB_SYSTEM_NAME_VALUE_MARIADB, DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER, DB_SYSTEM_NAME_VALUE_MYSQL, DB_SYSTEM_NAME_VALUE_POSTGRESQL, ATTR_DEPLOYMENT_ENVIRONMENT_NAME, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING, DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST, ATTR_DOTNET_GC_HEAP_GENERATION, DOTNET_GC_HEAP_GENERATION_VALUE_GEN0, DOTNET_GC_HEAP_GENERATION_VALUE_GEN1, DOTNET_GC_HEAP_GENERATION_VALUE_GEN2, DOTNET_GC_HEAP_GENERATION_VALUE_LOH, DOTNET_GC_HEAP_GENERATION_VALUE_POH, ATTR_ERROR_TYPE$1, ERROR_TYPE_VALUE_OTHER, ATTR_EXCEPTION_ESCAPED, ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, HTTP_REQUEST_METHOD_VALUE_OTHER, HTTP_REQUEST_METHOD_VALUE_CONNECT, HTTP_REQUEST_METHOD_VALUE_DELETE, HTTP_REQUEST_METHOD_VALUE_GET, HTTP_REQUEST_METHOD_VALUE_HEAD, HTTP_REQUEST_METHOD_VALUE_OPTIONS, HTTP_REQUEST_METHOD_VALUE_PATCH, HTTP_REQUEST_METHOD_VALUE_POST, HTTP_REQUEST_METHOD_VALUE_PUT, HTTP_REQUEST_METHOD_VALUE_TRACE, ATTR_HTTP_REQUEST_METHOD_ORIGINAL, ATTR_HTTP_REQUEST_RESEND_COUNT, ATTR_HTTP_RESPONSE_HEADER, ATTR_HTTP_RESPONSE_STATUS_CODE$1, ATTR_HTTP_ROUTE, ATTR_JVM_GC_ACTION, ATTR_JVM_GC_NAME, ATTR_JVM_MEMORY_POOL_NAME, ATTR_JVM_MEMORY_TYPE, JVM_MEMORY_TYPE_VALUE_HEAP, JVM_MEMORY_TYPE_VALUE_NON_HEAP, ATTR_JVM_THREAD_DAEMON, ATTR_JVM_THREAD_STATE, JVM_THREAD_STATE_VALUE_BLOCKED, JVM_THREAD_STATE_VALUE_NEW, JVM_THREAD_STATE_VALUE_RUNNABLE, JVM_THREAD_STATE_VALUE_TERMINATED, JVM_THREAD_STATE_VALUE_TIMED_WAITING, JVM_THREAD_STATE_VALUE_WAITING, ATTR_NETWORK_LOCAL_ADDRESS, ATTR_NETWORK_LOCAL_PORT, ATTR_NETWORK_PEER_ADDRESS, ATTR_NETWORK_PEER_PORT, ATTR_NETWORK_PROTOCOL_NAME, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_NETWORK_TRANSPORT, NETWORK_TRANSPORT_VALUE_PIPE, NETWORK_TRANSPORT_VALUE_QUIC, NETWORK_TRANSPORT_VALUE_TCP, NETWORK_TRANSPORT_VALUE_UDP, NETWORK_TRANSPORT_VALUE_UNIX, ATTR_NETWORK_TYPE, NETWORK_TYPE_VALUE_IPV4, NETWORK_TYPE_VALUE_IPV6, ATTR_OTEL_EVENT_NAME, ATTR_OTEL_SCOPE_NAME, ATTR_OTEL_SCOPE_VERSION, ATTR_OTEL_STATUS_CODE, OTEL_STATUS_CODE_VALUE_ERROR, OTEL_STATUS_CODE_VALUE_OK, ATTR_OTEL_STATUS_DESCRIPTION, ATTR_SERVER_ADDRESS$1, ATTR_SERVER_PORT$1, ATTR_SERVICE_INSTANCE_ID, ATTR_SERVICE_NAME, ATTR_SERVICE_NAMESPACE, ATTR_SERVICE_VERSION, ATTR_SIGNALR_CONNECTION_STATUS, SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN, SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE, SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT, ATTR_SIGNALR_TRANSPORT, SIGNALR_TRANSPORT_VALUE_LONG_POLLING, SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS, SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS, ATTR_TELEMETRY_DISTRO_NAME, ATTR_TELEMETRY_DISTRO_VERSION, ATTR_TELEMETRY_SDK_LANGUAGE, TELEMETRY_SDK_LANGUAGE_VALUE_CPP, TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET, TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG, TELEMETRY_SDK_LANGUAGE_VALUE_GO, TELEMETRY_SDK_LANGUAGE_VALUE_JAVA, TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, TELEMETRY_SDK_LANGUAGE_VALUE_PHP, TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON, TELEMETRY_SDK_LANGUAGE_VALUE_RUBY, TELEMETRY_SDK_LANGUAGE_VALUE_RUST, TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT, TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, ATTR_URL_FRAGMENT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_QUERY, ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL; var init_stable_attributes = __esmMin((() => { ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result"; ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; @@ -17253,7 +17272,7 @@ var init_stable_attributes = __esmMin((() => { DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = "gen2"; DOTNET_GC_HEAP_GENERATION_VALUE_LOH = "loh"; DOTNET_GC_HEAP_GENERATION_VALUE_POH = "poh"; - ATTR_ERROR_TYPE = "error.type"; + ATTR_ERROR_TYPE$1 = "error.type"; ERROR_TYPE_VALUE_OTHER = "_OTHER"; ATTR_EXCEPTION_ESCAPED = "exception.escaped"; ATTR_EXCEPTION_MESSAGE = "exception.message"; @@ -17274,7 +17293,7 @@ var init_stable_attributes = __esmMin((() => { ATTR_HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original"; ATTR_HTTP_REQUEST_RESEND_COUNT = "http.request.resend_count"; ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`; - ATTR_HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"; + ATTR_HTTP_RESPONSE_STATUS_CODE$1 = "http.response.status_code"; ATTR_HTTP_ROUTE = "http.route"; ATTR_JVM_GC_ACTION = "jvm.gc.action"; ATTR_JVM_GC_NAME = "jvm.gc.name"; @@ -17312,8 +17331,8 @@ var init_stable_attributes = __esmMin((() => { OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; OTEL_STATUS_CODE_VALUE_OK = "OK"; ATTR_OTEL_STATUS_DESCRIPTION = "otel.status_description"; - ATTR_SERVER_ADDRESS = "server.address"; - ATTR_SERVER_PORT = "server.port"; + ATTR_SERVER_ADDRESS$1 = "server.address"; + ATTR_SERVER_PORT$1 = "server.port"; ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; ATTR_SERVICE_NAME = "service.name"; ATTR_SERVICE_NAMESPACE = "service.namespace"; @@ -17454,7 +17473,7 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ ATTR_DB_SYSTEM_NAME: () => ATTR_DB_SYSTEM_NAME, ATTR_DEPLOYMENT_ENVIRONMENT_NAME: () => ATTR_DEPLOYMENT_ENVIRONMENT_NAME, ATTR_DOTNET_GC_HEAP_GENERATION: () => ATTR_DOTNET_GC_HEAP_GENERATION, - ATTR_ERROR_TYPE: () => ATTR_ERROR_TYPE, + ATTR_ERROR_TYPE: () => ATTR_ERROR_TYPE$1, ATTR_EXCEPTION_ESCAPED: () => ATTR_EXCEPTION_ESCAPED, ATTR_EXCEPTION_MESSAGE: () => ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE: () => ATTR_EXCEPTION_STACKTRACE, @@ -17464,7 +17483,7 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ ATTR_HTTP_REQUEST_METHOD_ORIGINAL: () => ATTR_HTTP_REQUEST_METHOD_ORIGINAL, ATTR_HTTP_REQUEST_RESEND_COUNT: () => ATTR_HTTP_REQUEST_RESEND_COUNT, ATTR_HTTP_RESPONSE_HEADER: () => ATTR_HTTP_RESPONSE_HEADER, - ATTR_HTTP_RESPONSE_STATUS_CODE: () => ATTR_HTTP_RESPONSE_STATUS_CODE, + ATTR_HTTP_RESPONSE_STATUS_CODE: () => ATTR_HTTP_RESPONSE_STATUS_CODE$1, ATTR_HTTP_ROUTE: () => ATTR_HTTP_ROUTE, ATTR_JVM_GC_ACTION: () => ATTR_JVM_GC_ACTION, ATTR_JVM_GC_NAME: () => ATTR_JVM_GC_NAME, @@ -17485,8 +17504,8 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ ATTR_OTEL_SCOPE_VERSION: () => ATTR_OTEL_SCOPE_VERSION, ATTR_OTEL_STATUS_CODE: () => ATTR_OTEL_STATUS_CODE, ATTR_OTEL_STATUS_DESCRIPTION: () => ATTR_OTEL_STATUS_DESCRIPTION, - ATTR_SERVER_ADDRESS: () => ATTR_SERVER_ADDRESS, - ATTR_SERVER_PORT: () => ATTR_SERVER_PORT, + ATTR_SERVER_ADDRESS: () => ATTR_SERVER_ADDRESS$1, + ATTR_SERVER_PORT: () => ATTR_SERVER_PORT$1, ATTR_SERVICE_INSTANCE_ID: () => ATTR_SERVICE_INSTANCE_ID, ATTR_SERVICE_NAME: () => ATTR_SERVICE_NAME, ATTR_SERVICE_NAMESPACE: () => ATTR_SERVICE_NAMESPACE, @@ -17504,7 +17523,7 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ ATTR_URL_QUERY: () => ATTR_URL_QUERY, ATTR_URL_SCHEME: () => ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL: () => ATTR_USER_AGENT_ORIGINAL, - AWSECSLAUNCHTYPEVALUES_EC2: () => AWSECSLAUNCHTYPEVALUES_EC2, + AWSECSLAUNCHTYPEVALUES_EC2: () => "ec2", AWSECSLAUNCHTYPEVALUES_FARGATE: () => AWSECSLAUNCHTYPEVALUES_FARGATE, AwsEcsLaunchtypeValues: () => AwsEcsLaunchtypeValues, CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS: () => CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, @@ -17525,22 +17544,22 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE: () => CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE: () => CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, CLOUDPROVIDERVALUES_ALIBABA_CLOUD: () => CLOUDPROVIDERVALUES_ALIBABA_CLOUD, - CLOUDPROVIDERVALUES_AWS: () => CLOUDPROVIDERVALUES_AWS, + CLOUDPROVIDERVALUES_AWS: () => "aws", CLOUDPROVIDERVALUES_AZURE: () => CLOUDPROVIDERVALUES_AZURE, - CLOUDPROVIDERVALUES_GCP: () => CLOUDPROVIDERVALUES_GCP, + CLOUDPROVIDERVALUES_GCP: () => "gcp", CloudPlatformValues: () => CloudPlatformValues, CloudProviderValues: () => CloudProviderValues, - DBCASSANDRACONSISTENCYLEVELVALUES_ALL: () => DBCASSANDRACONSISTENCYLEVELVALUES_ALL, - DBCASSANDRACONSISTENCYLEVELVALUES_ANY: () => DBCASSANDRACONSISTENCYLEVELVALUES_ANY, + DBCASSANDRACONSISTENCYLEVELVALUES_ALL: () => "all", + DBCASSANDRACONSISTENCYLEVELVALUES_ANY: () => "any", DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL: () => DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, - DBCASSANDRACONSISTENCYLEVELVALUES_ONE: () => DBCASSANDRACONSISTENCYLEVELVALUES_ONE, + DBCASSANDRACONSISTENCYLEVELVALUES_ONE: () => "one", DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL: () => DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, DBCASSANDRACONSISTENCYLEVELVALUES_THREE: () => DBCASSANDRACONSISTENCYLEVELVALUES_THREE, - DBCASSANDRACONSISTENCYLEVELVALUES_TWO: () => DBCASSANDRACONSISTENCYLEVELVALUES_TWO, + DBCASSANDRACONSISTENCYLEVELVALUES_TWO: () => "two", DBSYSTEMVALUES_ADABAS: () => DBSYSTEMVALUES_ADABAS, DBSYSTEMVALUES_CACHE: () => DBSYSTEMVALUES_CACHE, DBSYSTEMVALUES_CASSANDRA: () => DBSYSTEMVALUES_CASSANDRA, @@ -17550,16 +17569,16 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ DBSYSTEMVALUES_COSMOSDB: () => DBSYSTEMVALUES_COSMOSDB, DBSYSTEMVALUES_COUCHBASE: () => DBSYSTEMVALUES_COUCHBASE, DBSYSTEMVALUES_COUCHDB: () => DBSYSTEMVALUES_COUCHDB, - DBSYSTEMVALUES_DB2: () => DBSYSTEMVALUES_DB2, + DBSYSTEMVALUES_DB2: () => "db2", DBSYSTEMVALUES_DERBY: () => DBSYSTEMVALUES_DERBY, DBSYSTEMVALUES_DYNAMODB: () => DBSYSTEMVALUES_DYNAMODB, - DBSYSTEMVALUES_EDB: () => DBSYSTEMVALUES_EDB, + DBSYSTEMVALUES_EDB: () => "edb", DBSYSTEMVALUES_ELASTICSEARCH: () => DBSYSTEMVALUES_ELASTICSEARCH, DBSYSTEMVALUES_FILEMAKER: () => DBSYSTEMVALUES_FILEMAKER, DBSYSTEMVALUES_FIREBIRD: () => DBSYSTEMVALUES_FIREBIRD, DBSYSTEMVALUES_FIRSTSQL: () => DBSYSTEMVALUES_FIRSTSQL, DBSYSTEMVALUES_GEODE: () => DBSYSTEMVALUES_GEODE, - DBSYSTEMVALUES_H2: () => DBSYSTEMVALUES_H2, + DBSYSTEMVALUES_H2: () => "h2", DBSYSTEMVALUES_HANADB: () => DBSYSTEMVALUES_HANADB, DBSYSTEMVALUES_HBASE: () => DBSYSTEMVALUES_HBASE, DBSYSTEMVALUES_HIVE: () => DBSYSTEMVALUES_HIVE, @@ -17599,8 +17618,8 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ DOTNET_GC_HEAP_GENERATION_VALUE_GEN0: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN0, DOTNET_GC_HEAP_GENERATION_VALUE_GEN1: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN1, DOTNET_GC_HEAP_GENERATION_VALUE_GEN2: () => DOTNET_GC_HEAP_GENERATION_VALUE_GEN2, - DOTNET_GC_HEAP_GENERATION_VALUE_LOH: () => DOTNET_GC_HEAP_GENERATION_VALUE_LOH, - DOTNET_GC_HEAP_GENERATION_VALUE_POH: () => DOTNET_GC_HEAP_GENERATION_VALUE_POH, + DOTNET_GC_HEAP_GENERATION_VALUE_LOH: () => "loh", + DOTNET_GC_HEAP_GENERATION_VALUE_POH: () => "poh", DbCassandraConsistencyLevelValues: () => DbCassandraConsistencyLevelValues, DbSystemValues: () => DbSystemValues, ERROR_TYPE_VALUE_OTHER: () => ERROR_TYPE_VALUE_OTHER, @@ -17609,9 +17628,9 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ FAASDOCUMENTOPERATIONVALUES_EDIT: () => FAASDOCUMENTOPERATIONVALUES_EDIT, FAASDOCUMENTOPERATIONVALUES_INSERT: () => FAASDOCUMENTOPERATIONVALUES_INSERT, FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD: () => FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, - FAASINVOKEDPROVIDERVALUES_AWS: () => FAASINVOKEDPROVIDERVALUES_AWS, + FAASINVOKEDPROVIDERVALUES_AWS: () => "aws", FAASINVOKEDPROVIDERVALUES_AZURE: () => FAASINVOKEDPROVIDERVALUES_AZURE, - FAASINVOKEDPROVIDERVALUES_GCP: () => FAASINVOKEDPROVIDERVALUES_GCP, + FAASINVOKEDPROVIDERVALUES_GCP: () => "gcp", FAASTRIGGERVALUES_DATASOURCE: () => FAASTRIGGERVALUES_DATASOURCE, FAASTRIGGERVALUES_HTTP: () => FAASTRIGGERVALUES_HTTP, FAASTRIGGERVALUES_OTHER: () => FAASTRIGGERVALUES_OTHER, @@ -17626,28 +17645,28 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ HOSTARCHVALUES_IA64: () => HOSTARCHVALUES_IA64, HOSTARCHVALUES_PPC32: () => HOSTARCHVALUES_PPC32, HOSTARCHVALUES_PPC64: () => HOSTARCHVALUES_PPC64, - HOSTARCHVALUES_X86: () => HOSTARCHVALUES_X86, - HTTPFLAVORVALUES_HTTP_1_0: () => HTTPFLAVORVALUES_HTTP_1_0, - HTTPFLAVORVALUES_HTTP_1_1: () => HTTPFLAVORVALUES_HTTP_1_1, - HTTPFLAVORVALUES_HTTP_2_0: () => HTTPFLAVORVALUES_HTTP_2_0, + HOSTARCHVALUES_X86: () => "x86", + HTTPFLAVORVALUES_HTTP_1_0: () => "1.0", + HTTPFLAVORVALUES_HTTP_1_1: () => "1.1", + HTTPFLAVORVALUES_HTTP_2_0: () => "2.0", HTTPFLAVORVALUES_QUIC: () => HTTPFLAVORVALUES_QUIC, HTTPFLAVORVALUES_SPDY: () => HTTPFLAVORVALUES_SPDY, HTTP_REQUEST_METHOD_VALUE_CONNECT: () => HTTP_REQUEST_METHOD_VALUE_CONNECT, HTTP_REQUEST_METHOD_VALUE_DELETE: () => HTTP_REQUEST_METHOD_VALUE_DELETE, - HTTP_REQUEST_METHOD_VALUE_GET: () => HTTP_REQUEST_METHOD_VALUE_GET, + HTTP_REQUEST_METHOD_VALUE_GET: () => "GET", HTTP_REQUEST_METHOD_VALUE_HEAD: () => HTTP_REQUEST_METHOD_VALUE_HEAD, HTTP_REQUEST_METHOD_VALUE_OPTIONS: () => HTTP_REQUEST_METHOD_VALUE_OPTIONS, HTTP_REQUEST_METHOD_VALUE_OTHER: () => HTTP_REQUEST_METHOD_VALUE_OTHER, HTTP_REQUEST_METHOD_VALUE_PATCH: () => HTTP_REQUEST_METHOD_VALUE_PATCH, HTTP_REQUEST_METHOD_VALUE_POST: () => HTTP_REQUEST_METHOD_VALUE_POST, - HTTP_REQUEST_METHOD_VALUE_PUT: () => HTTP_REQUEST_METHOD_VALUE_PUT, + HTTP_REQUEST_METHOD_VALUE_PUT: () => "PUT", HTTP_REQUEST_METHOD_VALUE_TRACE: () => HTTP_REQUEST_METHOD_VALUE_TRACE, HostArchValues: () => HostArchValues, HttpFlavorValues: () => HttpFlavorValues, JVM_MEMORY_TYPE_VALUE_HEAP: () => JVM_MEMORY_TYPE_VALUE_HEAP, JVM_MEMORY_TYPE_VALUE_NON_HEAP: () => JVM_MEMORY_TYPE_VALUE_NON_HEAP, JVM_THREAD_STATE_VALUE_BLOCKED: () => JVM_THREAD_STATE_VALUE_BLOCKED, - JVM_THREAD_STATE_VALUE_NEW: () => JVM_THREAD_STATE_VALUE_NEW, + JVM_THREAD_STATE_VALUE_NEW: () => "new", JVM_THREAD_STATE_VALUE_RUNNABLE: () => JVM_THREAD_STATE_VALUE_RUNNABLE, JVM_THREAD_STATE_VALUE_TERMINATED: () => JVM_THREAD_STATE_VALUE_TERMINATED, JVM_THREAD_STATE_VALUE_TIMED_WAITING: () => JVM_THREAD_STATE_VALUE_TIMED_WAITING, @@ -17720,16 +17739,16 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, NETHOSTCONNECTIONSUBTYPEVALUES_GPRS: () => NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, - NETHOSTCONNECTIONSUBTYPEVALUES_GSM: () => NETHOSTCONNECTIONSUBTYPEVALUES_GSM, + NETHOSTCONNECTIONSUBTYPEVALUES_GSM: () => "gsm", NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, NETHOSTCONNECTIONSUBTYPEVALUES_HSPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA: () => NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, NETHOSTCONNECTIONSUBTYPEVALUES_IDEN: () => NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN: () => NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, - NETHOSTCONNECTIONSUBTYPEVALUES_LTE: () => NETHOSTCONNECTIONSUBTYPEVALUES_LTE, + NETHOSTCONNECTIONSUBTYPEVALUES_LTE: () => "lte", NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA: () => NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, - NETHOSTCONNECTIONSUBTYPEVALUES_NR: () => NETHOSTCONNECTIONSUBTYPEVALUES_NR, + NETHOSTCONNECTIONSUBTYPEVALUES_NR: () => "nr", NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA: () => NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA: () => NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, NETHOSTCONNECTIONSUBTYPEVALUES_UMTS: () => NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, @@ -17739,7 +17758,7 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ NETHOSTCONNECTIONTYPEVALUES_WIFI: () => NETHOSTCONNECTIONTYPEVALUES_WIFI, NETHOSTCONNECTIONTYPEVALUES_WIRED: () => NETHOSTCONNECTIONTYPEVALUES_WIRED, NETTRANSPORTVALUES_INPROC: () => NETTRANSPORTVALUES_INPROC, - NETTRANSPORTVALUES_IP: () => NETTRANSPORTVALUES_IP, + NETTRANSPORTVALUES_IP: () => "ip", NETTRANSPORTVALUES_IP_TCP: () => NETTRANSPORTVALUES_IP_TCP, NETTRANSPORTVALUES_IP_UDP: () => NETTRANSPORTVALUES_IP_UDP, NETTRANSPORTVALUES_OTHER: () => NETTRANSPORTVALUES_OTHER, @@ -17747,15 +17766,15 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ NETTRANSPORTVALUES_UNIX: () => NETTRANSPORTVALUES_UNIX, NETWORK_TRANSPORT_VALUE_PIPE: () => NETWORK_TRANSPORT_VALUE_PIPE, NETWORK_TRANSPORT_VALUE_QUIC: () => NETWORK_TRANSPORT_VALUE_QUIC, - NETWORK_TRANSPORT_VALUE_TCP: () => NETWORK_TRANSPORT_VALUE_TCP, - NETWORK_TRANSPORT_VALUE_UDP: () => NETWORK_TRANSPORT_VALUE_UDP, + NETWORK_TRANSPORT_VALUE_TCP: () => "tcp", + NETWORK_TRANSPORT_VALUE_UDP: () => "udp", NETWORK_TRANSPORT_VALUE_UNIX: () => NETWORK_TRANSPORT_VALUE_UNIX, NETWORK_TYPE_VALUE_IPV4: () => NETWORK_TYPE_VALUE_IPV4, NETWORK_TYPE_VALUE_IPV6: () => NETWORK_TYPE_VALUE_IPV6, NetHostConnectionSubtypeValues: () => NetHostConnectionSubtypeValues, NetHostConnectionTypeValues: () => NetHostConnectionTypeValues, NetTransportValues: () => NetTransportValues, - OSTYPEVALUES_AIX: () => OSTYPEVALUES_AIX, + OSTYPEVALUES_AIX: () => "aix", OSTYPEVALUES_DARWIN: () => OSTYPEVALUES_DARWIN, OSTYPEVALUES_DRAGONFLYBSD: () => OSTYPEVALUES_DRAGONFLYBSD, OSTYPEVALUES_FREEBSD: () => OSTYPEVALUES_FREEBSD, @@ -17767,25 +17786,25 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ OSTYPEVALUES_WINDOWS: () => OSTYPEVALUES_WINDOWS, OSTYPEVALUES_Z_OS: () => OSTYPEVALUES_Z_OS, OTEL_STATUS_CODE_VALUE_ERROR: () => OTEL_STATUS_CODE_VALUE_ERROR, - OTEL_STATUS_CODE_VALUE_OK: () => OTEL_STATUS_CODE_VALUE_OK, + OTEL_STATUS_CODE_VALUE_OK: () => "OK", OsTypeValues: () => OsTypeValues, - RPCGRPCSTATUSCODEVALUES_ABORTED: () => RPCGRPCSTATUSCODEVALUES_ABORTED, - RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS: () => RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, - RPCGRPCSTATUSCODEVALUES_CANCELLED: () => RPCGRPCSTATUSCODEVALUES_CANCELLED, - RPCGRPCSTATUSCODEVALUES_DATA_LOSS: () => RPCGRPCSTATUSCODEVALUES_DATA_LOSS, - RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED: () => RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, - RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION: () => RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, - RPCGRPCSTATUSCODEVALUES_INTERNAL: () => RPCGRPCSTATUSCODEVALUES_INTERNAL, - RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT: () => RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, - RPCGRPCSTATUSCODEVALUES_NOT_FOUND: () => RPCGRPCSTATUSCODEVALUES_NOT_FOUND, - RPCGRPCSTATUSCODEVALUES_OK: () => RPCGRPCSTATUSCODEVALUES_OK, - RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE: () => RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, - RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED: () => RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, - RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED: () => RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, - RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED: () => RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, - RPCGRPCSTATUSCODEVALUES_UNAVAILABLE: () => RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, - RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED: () => RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, - RPCGRPCSTATUSCODEVALUES_UNKNOWN: () => RPCGRPCSTATUSCODEVALUES_UNKNOWN, + RPCGRPCSTATUSCODEVALUES_ABORTED: () => 10, + RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS: () => 6, + RPCGRPCSTATUSCODEVALUES_CANCELLED: () => 1, + RPCGRPCSTATUSCODEVALUES_DATA_LOSS: () => 15, + RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED: () => 4, + RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION: () => 9, + RPCGRPCSTATUSCODEVALUES_INTERNAL: () => 13, + RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT: () => 3, + RPCGRPCSTATUSCODEVALUES_NOT_FOUND: () => 5, + RPCGRPCSTATUSCODEVALUES_OK: () => 0, + RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE: () => 11, + RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED: () => 7, + RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED: () => 8, + RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED: () => 16, + RPCGRPCSTATUSCODEVALUES_UNAVAILABLE: () => 14, + RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED: () => 12, + RPCGRPCSTATUSCODEVALUES_UNKNOWN: () => 2, RpcGrpcStatusCodeValues: () => RpcGrpcStatusCodeValues, SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET: () => SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET, SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: () => SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, @@ -18004,23 +18023,23 @@ var esm_exports$1 = /* @__PURE__ */ __exportAll({ SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS: () => SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS, SemanticAttributes: () => SemanticAttributes, SemanticResourceAttributes: () => SemanticResourceAttributes, - TELEMETRYSDKLANGUAGEVALUES_CPP: () => TELEMETRYSDKLANGUAGEVALUES_CPP, + TELEMETRYSDKLANGUAGEVALUES_CPP: () => "cpp", TELEMETRYSDKLANGUAGEVALUES_DOTNET: () => TELEMETRYSDKLANGUAGEVALUES_DOTNET, TELEMETRYSDKLANGUAGEVALUES_ERLANG: () => TELEMETRYSDKLANGUAGEVALUES_ERLANG, - TELEMETRYSDKLANGUAGEVALUES_GO: () => TELEMETRYSDKLANGUAGEVALUES_GO, + TELEMETRYSDKLANGUAGEVALUES_GO: () => "go", TELEMETRYSDKLANGUAGEVALUES_JAVA: () => TELEMETRYSDKLANGUAGEVALUES_JAVA, TELEMETRYSDKLANGUAGEVALUES_NODEJS: () => TELEMETRYSDKLANGUAGEVALUES_NODEJS, - TELEMETRYSDKLANGUAGEVALUES_PHP: () => TELEMETRYSDKLANGUAGEVALUES_PHP, + TELEMETRYSDKLANGUAGEVALUES_PHP: () => "php", TELEMETRYSDKLANGUAGEVALUES_PYTHON: () => TELEMETRYSDKLANGUAGEVALUES_PYTHON, TELEMETRYSDKLANGUAGEVALUES_RUBY: () => TELEMETRYSDKLANGUAGEVALUES_RUBY, TELEMETRYSDKLANGUAGEVALUES_WEBJS: () => TELEMETRYSDKLANGUAGEVALUES_WEBJS, - TELEMETRY_SDK_LANGUAGE_VALUE_CPP: () => TELEMETRY_SDK_LANGUAGE_VALUE_CPP, + TELEMETRY_SDK_LANGUAGE_VALUE_CPP: () => "cpp", TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET: () => TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET, TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG: () => TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG, - TELEMETRY_SDK_LANGUAGE_VALUE_GO: () => TELEMETRY_SDK_LANGUAGE_VALUE_GO, + TELEMETRY_SDK_LANGUAGE_VALUE_GO: () => "go", TELEMETRY_SDK_LANGUAGE_VALUE_JAVA: () => TELEMETRY_SDK_LANGUAGE_VALUE_JAVA, TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS: () => TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, - TELEMETRY_SDK_LANGUAGE_VALUE_PHP: () => TELEMETRY_SDK_LANGUAGE_VALUE_PHP, + TELEMETRY_SDK_LANGUAGE_VALUE_PHP: () => "php", TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON: () => TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON, TELEMETRY_SDK_LANGUAGE_VALUE_RUBY: () => TELEMETRY_SDK_LANGUAGE_VALUE_RUBY, TELEMETRY_SDK_LANGUAGE_VALUE_RUST: () => TELEMETRY_SDK_LANGUAGE_VALUE_RUST, @@ -18037,7 +18056,7 @@ var init_esm$1 = __esmMin((() => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/semconv.js +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/semconv.js var require_semconv$4 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ATTR_PROCESS_RUNTIME_NAME = void 0; @@ -18052,11 +18071,11 @@ var require_semconv$4 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js -var require_sdk_info$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js +var require_sdk_info = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.SDK_INFO = void 0; - const version_1 = require_version$3(); + const version_1 = require_version$2(); const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); const semconv_1 = require_semconv$4(); /** Constants describing the SDK in use */ @@ -18069,11 +18088,11 @@ var require_sdk_info$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/index.js -var require_node$6 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node$3 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.otperformance = exports.SDK_INFO = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = void 0; - var environment_1 = require_environment$1(); + var environment_1 = require_environment(); Object.defineProperty(exports, "getStringFromEnv", { enumerable: true, get: function() { @@ -18098,14 +18117,14 @@ var require_node$6 = /* @__PURE__ */ __commonJSMin(((exports) => { return environment_1.getStringListFromEnv; } }); - var globalThis_1 = require_globalThis$1(); + var globalThis_1 = require_globalThis(); Object.defineProperty(exports, "_globalThis", { enumerable: true, get: function() { return globalThis_1._globalThis; } }); - var sdk_info_1 = require_sdk_info$1(); + var sdk_info_1 = require_sdk_info(); Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { @@ -18119,11 +18138,11 @@ var require_node$6 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/index.js -var require_platform$6 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform$3 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = void 0; - var node_1 = require_node$6(); + var node_1 = require_node$3(); Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { @@ -18169,11 +18188,11 @@ var require_platform$6 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/time.js -var require_time$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/time.js +var require_time = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; - const platform_1 = require_platform$6(); + exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToSeconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; + const platform_1 = require_platform$3(); const NANOSECOND_DIGITS = 9; const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, 6); const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); @@ -18206,11 +18225,12 @@ var require_time$1 = /* @__PURE__ */ __commonJSMin(((exports) => { * Converts a TimeInput to an HrTime, defaults to _hrtime(). * @param time */ - function timeInputToHrTime(time$2) { - if (isTimeInputHrTime(time$2)) return time$2; - else if (typeof time$2 === "number") if (time$2 < platform_1.otperformance.timeOrigin) return hrTime(time$2); - else return millisToHrTime(time$2); - else if (time$2 instanceof Date) return millisToHrTime(time$2.getTime()); + function timeInputToHrTime(time) { + if (isTimeInputHrTime(time)) return time; + else if (typeof time === "number") { + if (time < platform_1.otperformance.timeOrigin / 2) return hrTime(time); + else return millisToHrTime(time); + } else if (time instanceof Date) return millisToHrTime(time.getTime()); else throw TypeError("Invalid input type"); } exports.timeInputToHrTime = timeInputToHrTime; @@ -18233,37 +18253,45 @@ var require_time$1 = /* @__PURE__ */ __commonJSMin(((exports) => { * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" * @param time */ - function hrTimeToTimeStamp(time$2) { + function hrTimeToTimeStamp(time) { const precision = NANOSECOND_DIGITS; - const tmp = `${"0".repeat(precision)}${time$2[1]}Z`; + const tmp = `${"0".repeat(precision)}${time[1]}Z`; const nanoString = tmp.substring(tmp.length - precision - 1); - return (/* @__PURE__ */ new Date(time$2[0] * 1e3)).toISOString().replace("000Z", nanoString); + return (/* @__PURE__ */ new Date(time[0] * 1e3)).toISOString().replace("000Z", nanoString); } exports.hrTimeToTimeStamp = hrTimeToTimeStamp; /** * Convert hrTime to nanoseconds. * @param time */ - function hrTimeToNanoseconds(time$2) { - return time$2[0] * SECOND_TO_NANOSECONDS + time$2[1]; + function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; } exports.hrTimeToNanoseconds = hrTimeToNanoseconds; /** + * Convert hrTime to microseconds. + * @param time + */ + function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1e3; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + /** * Convert hrTime to milliseconds. * @param time */ - function hrTimeToMilliseconds(time$2) { - return time$2[0] * 1e3 + time$2[1] / 1e6; + function hrTimeToMilliseconds(time) { + return time[0] * 1e3 + time[1] / 1e6; } exports.hrTimeToMilliseconds = hrTimeToMilliseconds; /** - * Convert hrTime to microseconds. + * Convert hrTime to seconds. * @param time */ - function hrTimeToMicroseconds(time$2) { - return time$2[0] * 1e6 + time$2[1] / 1e3; + function hrTimeToSeconds(time) { + return time[0] + time[1] / SECOND_TO_NANOSECONDS; } - exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + exports.hrTimeToSeconds = hrTimeToSeconds; /** * check if time is HrTime * @param value @@ -18295,8 +18323,8 @@ var require_time$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/timer-util.js -var require_timer_util$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/timer-util.js +var require_timer_util = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.unrefTimer = void 0; /** @@ -18310,19 +18338,20 @@ var require_timer_util$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/ExportResult.js -var require_ExportResult$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/ExportResult.js +var require_ExportResult = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ExportResultCode = void 0; - (function(ExportResultCode$1) { - ExportResultCode$1[ExportResultCode$1["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode$1[ExportResultCode$1["FAILED"] = 1] = "FAILED"; - })(exports.ExportResultCode || (exports.ExportResultCode = {})); + var ExportResultCode; + (function(ExportResultCode) { + ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; + ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; + })(ExportResultCode || (exports.ExportResultCode = ExportResultCode = {})); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/propagation/composite.js -var require_composite$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/propagation/composite.js +var require_composite = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.CompositePropagator = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); @@ -18335,8 +18364,8 @@ var require_composite$1 = /* @__PURE__ */ __commonJSMin(((exports) => { * * @param [config] Configuration object for composite propagator */ - constructor(config$1 = {}) { - this._propagators = config$1.propagators ?? []; + constructor(config = {}) { + this._propagators = config.propagators ?? []; const fields = /* @__PURE__ */ new Set(); for (const propagator of this._propagators) { const propagatorFields = typeof propagator.fields === "function" ? propagator.fields() : []; @@ -18353,9 +18382,9 @@ var require_composite$1 = /* @__PURE__ */ __commonJSMin(((exports) => { * @param context Context to inject * @param carrier Carrier into which context will be injected */ - inject(context$1, carrier, setter) { + inject(context, carrier, setter) { for (const propagator of this._propagators) try { - propagator.inject(context$1, carrier, setter); + propagator.inject(context, carrier, setter); } catch (err) { api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); } @@ -18369,7 +18398,7 @@ var require_composite$1 = /* @__PURE__ */ __commonJSMin(((exports) => { * @param context Context to add values to * @param carrier Carrier from which to extract context */ - extract(context$1, carrier, getter) { + extract(context, carrier, getter) { return this._propagators.reduce((ctx, propagator) => { try { return propagator.extract(ctx, carrier, getter); @@ -18377,7 +18406,7 @@ var require_composite$1 = /* @__PURE__ */ __commonJSMin(((exports) => { api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); } return ctx; - }, context$1); + }, context); } fields() { return this._fields.slice(); @@ -18387,14 +18416,12 @@ var require_composite$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/validators.js -var require_validators$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/validators.js +var require_validators = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.validateValue = exports.validateKey = void 0; const VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; - const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; - const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; - const VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); + const VALID_KEY_REGEX = new RegExp(`^(?:${`[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`}|${`[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`})$`); const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; /** @@ -18420,11 +18447,11 @@ var require_validators$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/TraceState.js -var require_TraceState$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/TraceState.js +var require_TraceState = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.TraceState = void 0; - const validators_1 = require_validators$1(); + const validators_1 = require_validators(); const MAX_TRACE_STATE_ITEMS = 32; const MAX_TRACE_STATE_LEN = 512; const LIST_MEMBERS_SEPARATOR = ","; @@ -18515,17 +18542,17 @@ var require_TraceState$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js -var require_W3CTraceContextPropagator$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js +var require_W3CTraceContextPropagator = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing$1(); - const TraceState_1 = require_TraceState$1(); + const suppress_tracing_1 = require_suppress_tracing(); + const TraceState_1 = require_TraceState(); exports.TRACE_PARENT_HEADER = "traceparent"; exports.TRACE_STATE_HEADER = "tracestate"; const VERSION = "00"; - const TRACE_PARENT_REGEX = /* @__PURE__ */ new RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`); + const TRACE_PARENT_REGEX = new RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`); /** * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} * @param traceParent - A meta property that comes from server. @@ -18554,27 +18581,27 @@ var require_W3CTraceContextPropagator$1 = /* @__PURE__ */ __commonJSMin(((export * https://www.w3.org/TR/trace-context/ */ var W3CTraceContextPropagator = class { - inject(context$1, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context$1); - if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context$1) || !(0, api_1.isSpanContextValid)(spanContext)) return; + inject(context, carrier, setter) { + const spanContext = api_1.trace.getSpanContext(context); + if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context) || !(0, api_1.isSpanContextValid)(spanContext)) return; const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); if (spanContext.traceState) setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); } - extract(context$1, carrier, getter) { + extract(context, carrier, getter) { const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) return context$1; + if (!traceParentHeader) return context; const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; - if (typeof traceParent !== "string") return context$1; + if (typeof traceParent !== "string") return context; const spanContext = parseTraceParent(traceParent); - if (!spanContext) return context$1; + if (!spanContext) return context; spanContext.isRemote = true; const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); if (traceStateHeader) { const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : void 0); } - return api_1.trace.setSpanContext(context$1, spanContext); + return api_1.trace.setSpanContext(context, spanContext); } fields() { return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; @@ -18584,31 +18611,32 @@ var require_W3CTraceContextPropagator$1 = /* @__PURE__ */ __commonJSMin(((export })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js -var require_rpc_metadata$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js +var require_rpc_metadata = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; const RPC_METADATA_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); + var RPCType; (function(RPCType) { RPCType["HTTP"] = "http"; - })(exports.RPCType || (exports.RPCType = {})); - function setRPCMetadata(context$1, meta$2) { - return context$1.setValue(RPC_METADATA_KEY, meta$2); + })(RPCType || (exports.RPCType = RPCType = {})); + function setRPCMetadata(context, meta) { + return context.setValue(RPC_METADATA_KEY, meta); } exports.setRPCMetadata = setRPCMetadata; - function deleteRPCMetadata(context$1) { - return context$1.deleteValue(RPC_METADATA_KEY); + function deleteRPCMetadata(context) { + return context.deleteValue(RPC_METADATA_KEY); } exports.deleteRPCMetadata = deleteRPCMetadata; - function getRPCMetadata(context$1) { - return context$1.getValue(RPC_METADATA_KEY); + function getRPCMetadata(context) { + return context.getValue(RPC_METADATA_KEY); } exports.getRPCMetadata = getRPCMetadata; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js -var require_lodash_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js +var require_lodash_merge = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isPlainObject = void 0; /** @@ -18714,8 +18742,10 @@ var require_lodash_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { unmasked = true; } catch {} const result = nativeObjectToString.call(value); - if (unmasked) if (isOwn) value[symToStringTag] = tag; - else delete value[symToStringTag]; + if (unmasked) { + if (isOwn) value[symToStringTag] = tag; + else delete value[symToStringTag]; + } return result; } /** @@ -18731,11 +18761,11 @@ var require_lodash_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/merge.js -var require_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/merge.js +var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.merge = void 0; - const lodash_merge_1 = require_lodash_merge$1(); + const lodash_merge_1 = require_lodash_merge(); const MAX_LEVEL = 20; /** * Merges objects together @@ -18776,40 +18806,43 @@ var require_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { result[key] = takeValue(two[key]); } } - } else if (isObject(one)) if (isObject(two)) { - if (!shouldMerge(one, two)) return two; - result = Object.assign({}, one); - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - if (key === "__proto__" || key === "constructor" || key === "prototype") continue; - const twoValue = two[key]; - if (isPrimitive(twoValue)) if (typeof twoValue === "undefined") delete result[key]; - else result[key] = twoValue; - else { - const obj1 = result[key]; - const obj2 = twoValue; - if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) delete result[key]; - else { - if (isObject(obj1) && isObject(obj2)) { - const arr1 = objects.get(obj1) || []; - const arr2 = objects.get(obj2) || []; - arr1.push({ - obj: one, - key - }); - arr2.push({ - obj: two, - key - }); - objects.set(obj1, arr1); - objects.set(obj2, arr2); + } else if (isObject(one)) { + if (isObject(two)) { + if (!shouldMerge(one, two)) return two; + result = Object.assign({}, one); + const keys = Object.keys(two); + for (let i = 0, j = keys.length; i < j; i++) { + const key = keys[i]; + if (key === "__proto__" || key === "constructor" || key === "prototype") continue; + const twoValue = two[key]; + if (isPrimitive(twoValue)) { + if (typeof twoValue === "undefined") delete result[key]; + else result[key] = twoValue; + } else { + const obj1 = result[key]; + const obj2 = twoValue; + if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) delete result[key]; + else { + if (isObject(obj1) && isObject(obj2)) { + const arr1 = objects.get(obj1) || []; + const arr2 = objects.get(obj2) || []; + arr1.push({ + obj: one, + key + }); + arr2.push({ + obj: two, + key + }); + objects.set(obj1, arr1); + objects.set(obj2, arr2); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); } - result[key] = mergeTwoObjects(result[key], twoValue, level, objects); } } - } - } else result = two; + } else result = two; + } return result; } /** @@ -18845,8 +18878,8 @@ var require_merge$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/timeout.js -var require_timeout$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/timeout.js +var require_timeout = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.callWithTimeout = exports.TimeoutError = void 0; /** @@ -18887,8 +18920,8 @@ var require_timeout$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/url.js -var require_url$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/url.js +var require_url = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.isUrlIgnored = exports.urlMatches = void 0; function urlMatches(url, urlToMatch) { @@ -18910,8 +18943,8 @@ var require_url$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/promise.js -var require_promise$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/promise.js +var require_promise = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.Deferred = void 0; var Deferred = class { @@ -18938,11 +18971,11 @@ var require_promise$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/callback.js -var require_callback$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/callback.js +var require_callback = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BindOnceFuture = void 0; - const promise_1 = require_promise$1(); + const promise_1 = require_promise(); /** * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. */ @@ -18977,8 +19010,8 @@ var require_callback$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/configuration.js -var require_configuration$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/configuration.js +var require_configuration = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.diagLogLevelFromString = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); @@ -19008,12 +19041,12 @@ var require_configuration$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/exporter.js -var require_exporter$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/exporter.js +var require_exporter = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports._export = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing$1(); + const suppress_tracing_1 = require_suppress_tracing(); /** * @internal * Shared functionality used by Exporters while exporting data, including suppression of Traces. @@ -19029,25 +19062,26 @@ var require_exporter$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/index.js -var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/index.js +var require_src$8 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; - var W3CBaggagePropagator_1 = require_W3CBaggagePropagator$1(); + exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToSeconds = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; + exports.internal = void 0; + var W3CBaggagePropagator_1 = require_W3CBaggagePropagator(); Object.defineProperty(exports, "W3CBaggagePropagator", { enumerable: true, get: function() { return W3CBaggagePropagator_1.W3CBaggagePropagator; } }); - var anchored_clock_1 = require_anchored_clock$1(); + var anchored_clock_1 = require_anchored_clock(); Object.defineProperty(exports, "AnchoredClock", { enumerable: true, get: function() { return anchored_clock_1.AnchoredClock; } }); - var attributes_1 = require_attributes$1(); + var attributes_1 = require_attributes(); Object.defineProperty(exports, "isAttributeValue", { enumerable: true, get: function() { @@ -19060,7 +19094,7 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return attributes_1.sanitizeAttributes; } }); - var global_error_handler_1 = require_global_error_handler$1(); + var global_error_handler_1 = require_global_error_handler(); Object.defineProperty(exports, "globalErrorHandler", { enumerable: true, get: function() { @@ -19073,14 +19107,14 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return global_error_handler_1.setGlobalErrorHandler; } }); - var logging_error_handler_1 = require_logging_error_handler$1(); + var logging_error_handler_1 = require_logging_error_handler(); Object.defineProperty(exports, "loggingErrorHandler", { enumerable: true, get: function() { return logging_error_handler_1.loggingErrorHandler; } }); - var time_1 = require_time$1(); + var time_1 = require_time(); Object.defineProperty(exports, "addHrTimes", { enumerable: true, get: function() { @@ -19123,6 +19157,12 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return time_1.hrTimeToNanoseconds; } }); + Object.defineProperty(exports, "hrTimeToSeconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToSeconds; + } + }); Object.defineProperty(exports, "hrTimeToTimeStamp", { enumerable: true, get: function() { @@ -19153,28 +19193,28 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return time_1.timeInputToHrTime; } }); - var timer_util_1 = require_timer_util$1(); + var timer_util_1 = require_timer_util(); Object.defineProperty(exports, "unrefTimer", { enumerable: true, get: function() { return timer_util_1.unrefTimer; } }); - var ExportResult_1 = require_ExportResult$1(); + var ExportResult_1 = require_ExportResult(); Object.defineProperty(exports, "ExportResultCode", { enumerable: true, get: function() { return ExportResult_1.ExportResultCode; } }); - var utils_1 = require_utils$7(); + var utils_1 = require_utils$5(); Object.defineProperty(exports, "parseKeyPairsIntoRecord", { enumerable: true, get: function() { return utils_1.parseKeyPairsIntoRecord; } }); - var platform_1 = require_platform$6(); + var platform_1 = require_platform$3(); Object.defineProperty(exports, "SDK_INFO", { enumerable: true, get: function() { @@ -19217,14 +19257,14 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return platform_1.otperformance; } }); - var composite_1 = require_composite$1(); + var composite_1 = require_composite(); Object.defineProperty(exports, "CompositePropagator", { enumerable: true, get: function() { return composite_1.CompositePropagator; } }); - var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator$1(); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator(); Object.defineProperty(exports, "TRACE_PARENT_HEADER", { enumerable: true, get: function() { @@ -19249,7 +19289,7 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return W3CTraceContextPropagator_1.parseTraceParent; } }); - var rpc_metadata_1 = require_rpc_metadata$1(); + var rpc_metadata_1 = require_rpc_metadata(); Object.defineProperty(exports, "RPCType", { enumerable: true, get: function() { @@ -19274,7 +19314,7 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return rpc_metadata_1.setRPCMetadata; } }); - var suppress_tracing_1 = require_suppress_tracing$1(); + var suppress_tracing_1 = require_suppress_tracing(); Object.defineProperty(exports, "isTracingSuppressed", { enumerable: true, get: function() { @@ -19293,21 +19333,21 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return suppress_tracing_1.unsuppressTracing; } }); - var TraceState_1 = require_TraceState$1(); + var TraceState_1 = require_TraceState(); Object.defineProperty(exports, "TraceState", { enumerable: true, get: function() { return TraceState_1.TraceState; } }); - var merge_1 = require_merge$1(); + var merge_1 = require_merge(); Object.defineProperty(exports, "merge", { enumerable: true, get: function() { return merge_1.merge; } }); - var timeout_1 = require_timeout$1(); + var timeout_1 = require_timeout(); Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() { @@ -19320,7 +19360,7 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return timeout_1.callWithTimeout; } }); - var url_1 = require_url$1(); + var url_1 = require_url(); Object.defineProperty(exports, "isUrlIgnored", { enumerable: true, get: function() { @@ -19333,32 +19373,32 @@ var require_src$9 = /* @__PURE__ */ __commonJSMin(((exports) => { return url_1.urlMatches; } }); - var callback_1 = require_callback$1(); + var callback_1 = require_callback(); Object.defineProperty(exports, "BindOnceFuture", { enumerable: true, get: function() { return callback_1.BindOnceFuture; } }); - var configuration_1 = require_configuration$1(); + var configuration_1 = require_configuration(); Object.defineProperty(exports, "diagLogLevelFromString", { enumerable: true, get: function() { return configuration_1.diagLogLevelFromString; } }); - const exporter_1 = require_exporter$1(); + const exporter_1 = require_exporter(); exports.internal = { _export: exporter_1._export }; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js var OTLPExporterBase; var init_OTLPExporterBase = __esmMin((() => { OTLPExporterBase = class { _delegate; - constructor(_delegate) { - this._delegate = _delegate; + constructor(delegate) { + this._delegate = delegate; } /** * Export items. @@ -19374,11 +19414,14 @@ var init_OTLPExporterBase = __esmMin((() => { shutdown() { return this._delegate.shutdown(); } + setMetrics(metrics) { + this._delegate.setMetrics(metrics); + } }; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js var OTLPExporterError; var init_types = __esmMin((() => { OTLPExporterError = class extends Error { @@ -19394,14 +19437,14 @@ var init_types = __esmMin((() => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js function validateTimeoutMillis(timeoutMillis) { if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) return timeoutMillis; throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`); } function wrapStaticHeadersInFunction(headers) { if (headers == null) return; - return () => headers; + return async () => headers; } /** * @param userProvidedConfiguration Configuration options provided by the user in code. @@ -19425,18 +19468,18 @@ function getSharedConfigurationDefaults() { var init_shared_configuration = __esmMin((() => {})); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/legacy-node-configuration.js +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/legacy-node-configuration.js var CompressionAlgorithm; var init_legacy_node_configuration = __esmMin((() => { ; - (function(CompressionAlgorithm$1) { - CompressionAlgorithm$1["NONE"] = "none"; - CompressionAlgorithm$1["GZIP"] = "gzip"; + (function(CompressionAlgorithm) { + CompressionAlgorithm["NONE"] = "none"; + CompressionAlgorithm["GZIP"] = "gzip"; })(CompressionAlgorithm || (CompressionAlgorithm = {})); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js /** * Promise queue for keeping track of export promises. Finished promises will be auto-dequeued. * Allows for awaiting all promises in the queue. @@ -19474,1220 +19517,1471 @@ var init_bounded_queue_export_promise_handler = __esmMin((() => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js -var require_suppress_tracing = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; - const SUPPRESS_TRACING_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING"); - function suppressTracing(context$1) { - return context$1.setValue(SUPPRESS_TRACING_KEY, true); - } - exports.suppressTracing = suppressTracing; - function unsuppressTracing(context$1) { - return context$1.deleteValue(SUPPRESS_TRACING_KEY); - } - exports.unsuppressTracing = unsuppressTracing; - function isTracingSuppressed(context$1) { - return context$1.getValue(SUPPRESS_TRACING_KEY) === true; - } - exports.isTracingSuppressed = isTracingSuppressed; +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js +function isPartialSuccessResponse(response) { + return Object.prototype.hasOwnProperty.call(response, "partialSuccess"); +} +/** +* Default response handler that logs a partial success to the console. +*/ +function createLoggingPartialSuccessResponseHandler() { + return { handleResponse(response) { + if (response == null || !isPartialSuccessResponse(response) || response.partialSuccess == null || Object.keys(response.partialSuccess).length === 0) return; + diag.warn("Received Partial Success response:", JSON.stringify(response.partialSuccess)); + } }; +} +var init_logging_response_handler = __esmMin((() => { + init_esm$2(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/constants.js -var require_constants = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; - exports.BAGGAGE_KEY_PAIR_SEPARATOR = "="; - exports.BAGGAGE_PROPERTIES_SEPARATOR = ";"; - exports.BAGGAGE_ITEMS_SEPARATOR = ","; - exports.BAGGAGE_HEADER = "baggage"; - exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; - exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; - exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js +/** +* Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all +* signals. +*/ +function createOtlpExportDelegate(components, settings) { + return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, components.metrics, settings.timeout); +} +var import_src$6, OTLPExportDelegate; +var init_otlp_export_delegate = __esmMin((() => { + import_src$6 = require_src$8(); + init_types(); + init_logging_response_handler(); + init_esm$2(); + OTLPExportDelegate = class { + _metrics; + _diagLogger; + _transport; + _serializer; + _responseHandler; + _promiseQueue; + _timeout; + constructor(transport, serializer, responseHandler, promiseQueue, metrics, timeout) { + this._transport = transport; + this._serializer = serializer; + this._responseHandler = responseHandler; + this._promiseQueue = promiseQueue; + this._timeout = timeout; + this._diagLogger = diag.createComponentLogger({ namespace: "OTLPExportDelegate" }); + this._metrics = metrics; + } + export(internalRepresentation, resultCallback) { + this._diagLogger.debug("items to be sent", internalRepresentation); + if (this._promiseQueue.hasReachedLimit()) { + resultCallback({ + code: import_src$6.ExportResultCode.FAILED, + error: /* @__PURE__ */ new Error("Concurrent export limit reached") + }); + return; + } + const serializedRequest = this._serializer.serializeRequest(internalRepresentation); + if (serializedRequest == null) { + resultCallback({ + code: import_src$6.ExportResultCode.FAILED, + error: /* @__PURE__ */ new Error("Nothing to send") + }); + return; + } + const finishExport = this._metrics.startExport(internalRepresentation); + this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => { + if (response.status === "success") { + finishExport(void 0); + if (response.data != null) try { + this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data)); + } catch (e) { + this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e, response.data); + } + resultCallback({ code: import_src$6.ExportResultCode.SUCCESS }); + return; + } else if (response.status === "failure" && response.error) { + finishExport(response.error); + resultCallback({ + code: import_src$6.ExportResultCode.FAILED, + error: response.error + }); + return; + } else if (response.status === "retryable") { + finishExport("export_max_retries"); + resultCallback({ + code: import_src$6.ExportResultCode.FAILED, + error: response.error ?? new OTLPExporterError("Export failed with retryable status") + }); + } else { + finishExport("export_failed"); + resultCallback({ + code: import_src$6.ExportResultCode.FAILED, + error: new OTLPExporterError("Export failed with unknown error") + }); + } + }, (reason) => { + finishExport(reason); + resultCallback({ + code: import_src$6.ExportResultCode.FAILED, + error: reason + }); + })); + } + forceFlush() { + return this._promiseQueue.awaitAll(); + } + setMetrics(metrics) { + this._metrics = metrics; + } + async shutdown() { + this._diagLogger.debug("shutdown started"); + await this.forceFlush(); + this._transport.shutdown(); + } + }; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/utils.js -var require_utils$6 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const constants_1 = require_constants(); - function serializeKeyPairs(keyPairs) { - return keyPairs.reduce((hValue, current) => { - const value = `${hValue}${hValue !== "" ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ""}${current}`; - return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; - }, ""); - } - exports.serializeKeyPairs = serializeKeyPairs; - function getKeyPairs(baggage) { - return baggage.getAllEntries().map(([key, value]) => { - let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`; - if (value.metadata !== void 0) entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString(); - return entry; - }); - } - exports.getKeyPairs = getKeyPairs; - function parsePairKeyValue(entry) { - const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); - if (valueProps.length <= 0) return; - const keyPairPart = valueProps.shift(); - if (!keyPairPart) return; - const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); - if (separatorIndex <= 0) return; - const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); - const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); - let metadata; - if (valueProps.length > 0) metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); - return { - key, - value, - metadata - }; - } - exports.parsePairKeyValue = parsePairKeyValue; - /** - * Parse a string serialized in the baggage HTTP Format (without metadata): - * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md - */ - function parseKeyPairsIntoRecord(value) { - const result = {}; - if (typeof value === "string" && value.length > 0) value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { - const keyPair = parsePairKeyValue(entry); - if (keyPair !== void 0 && keyPair.value.length > 0) result[keyPair.key] = keyPair.value; - }); - return result; - } - exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js +function createOtlpNetworkExportDelegate(options, serializer, metrics, transport) { + return createOtlpExportDelegate({ + transport, + serializer, + promiseHandler: createBoundedQueueExportPromiseHandler(options), + metrics + }, { timeout: options.timeoutMillis }); +} +var init_otlp_network_export_delegate = __esmMin((() => { + init_bounded_queue_export_promise_handler(); + init_otlp_export_delegate(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js -var require_W3CBaggagePropagator = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.W3CBaggagePropagator = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing(); - const constants_1 = require_constants(); - const utils_1 = require_utils$6(); - /** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ - */ - var W3CBaggagePropagator = class { - inject(context$1, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context$1); - if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context$1)) return; - const keyPairs = (0, utils_1.getKeyPairs)(baggage).filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }).slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); - if (headerValue.length > 0) setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - extract(context$1, carrier, getter) { - const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); - const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue; - if (!baggageString) return context$1; - const baggage = {}; - if (baggageString.length === 0) return context$1; - baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => { - const keyPair = (0, utils_1.parsePairKeyValue)(entry); - if (keyPair) { - const baggageEntry = { value: keyPair.value }; - if (keyPair.metadata) baggageEntry.metadata = keyPair.metadata; - baggage[keyPair.key] = baggageEntry; - } - }); - if (Object.entries(baggage).length === 0) return context$1; - return api_1.propagation.setBaggage(context$1, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/semconv.js +var ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_OTEL_COMPONENT_NAME, ATTR_OTEL_COMPONENT_TYPE, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_ERROR_TYPE; +var init_semconv = __esmMin((() => { + ATTR_HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"; + ATTR_OTEL_COMPONENT_NAME = "otel.component.name"; + ATTR_OTEL_COMPONENT_TYPE = "otel.component.type"; + ATTR_SERVER_ADDRESS = "server.address"; + ATTR_SERVER_PORT = "server.port"; + ATTR_ERROR_TYPE = "error.type"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/version.js +var VERSION; +var init_version = __esmMin((() => { + VERSION = "0.221.0"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/ExporterMetrics.js +var import_src$5, componentCounter, ExporterMetrics; +var init_ExporterMetrics = __esmMin((() => { + init_esm$2(); + import_src$5 = require_src$8(); + init_semconv(); + init_version(); + componentCounter = /* @__PURE__ */ new Map(); + ExporterMetrics = class { + inflight; + exported; + duration; + standardAttrs; + responseAttributesFromError; + helper; + constructor(options) { + const { componentType, metricsHelper, meterProvider, url, responseAttributesFromError } = options; + this.responseAttributesFromError = responseAttributesFromError; + const meter = meterProvider ? meterProvider.getMeter("@opentelemetry/otlp-exporter", VERSION) : createNoopMeter(); + const counter = componentCounter.get(componentType) ?? 0; + componentCounter.set(componentType, counter + 1); + this.standardAttrs = { + [ATTR_OTEL_COMPONENT_TYPE]: componentType, + [ATTR_OTEL_COMPONENT_NAME]: `${componentType}/${counter}` + }; + if (url) { + let urlToParse = url; + if (!url.includes("://")) urlToParse = `http://${url}`; + try { + const parsedUrl = new URL(urlToParse); + this.standardAttrs[ATTR_SERVER_ADDRESS] = parsedUrl.hostname; + let port = void 0; + if (parsedUrl.port) port = Number(parsedUrl.port); + else if (parsedUrl.protocol === "http:") port = 80; + else if (parsedUrl.protocol === "https:") port = 443; + if (typeof port === "number") this.standardAttrs[ATTR_SERVER_PORT] = port; + } catch {} + } + this.helper = metricsHelper; + this.inflight = meter.createUpDownCounter(`otel.sdk.exporter.${this.helper.name}.inflight`, { + unit: `{${this.helper.name}}`, + description: `The number of ${this.helper.name}s which were passed to the exporter, but that have not been exported yet (neither successful, nor failed).` + }); + this.exported = meter.createCounter(`otel.sdk.exporter.${this.helper.name}.exported`, { + unit: `{${this.helper.name}}`, + description: `The number of ${this.helper.name}s for which the export has finished, either successful or failed.` + }); + this.duration = meter.createHistogram("otel.sdk.exporter.operation.duration", { + unit: "s", + description: "The duration of exporting a batch of telemetry records.", + advice: { explicitBucketBoundaries: [] } + }); + } + startExport(request) { + const numItems = this.helper.countItems(request); + const startTime = (0, import_src$5.hrTime)(); + this.inflight.add(numItems, this.standardAttrs); + return (error) => { + const endTime = (0, import_src$5.hrTime)(); + this.inflight.add(-numItems, this.standardAttrs); + const exportedAttrs = error ? { + ...this.standardAttrs, + [ATTR_ERROR_TYPE]: error instanceof Error ? error.name : "export_failed" + } : this.standardAttrs; + this.exported.add(numItems, exportedAttrs); + const durationAttrs = { + ...exportedAttrs, + ...this.responseAttributesFromError(error) + }; + const duration = (0, import_src$5.hrTimeToMilliseconds)((0, import_src$5.hrTimeDuration)(startTime, endTime)) / 1e3; + this.duration.record(duration, durationAttrs); + }; } }; - exports.W3CBaggagePropagator = W3CBaggagePropagator; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/anchored-clock.js -var require_anchored_clock = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index.js +var esm_exports = /* @__PURE__ */ __exportAll({ + CompressionAlgorithm: () => CompressionAlgorithm, + ExporterMetrics: () => ExporterMetrics, + OTLPExporterBase: () => OTLPExporterBase, + OTLPExporterError: () => OTLPExporterError, + createOtlpNetworkExportDelegate: () => createOtlpNetworkExportDelegate, + getSharedConfigurationDefaults: () => getSharedConfigurationDefaults, + mergeOtlpSharedConfigurationWithDefaults: () => mergeOtlpSharedConfigurationWithDefaults +}); +var init_esm = __esmMin((() => { + init_OTLPExporterBase(); + init_types(); + init_shared_configuration(); + init_legacy_node_configuration(); + init_otlp_network_export_delegate(); + init_ExporterMetrics(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/index.js +var require_metrics$2 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.AnchoredClock = void 0; - /** - * A utility for returning wall times anchored to a given point in time. Wall time measurements will - * not be taken from the system, but instead are computed by adding a monotonic clock time - * to the anchor point. - * - * This is needed because the system time can change and result in unexpected situations like - * spans ending before they are started. Creating an anchored clock for each local root span - * ensures that span timings and durations are accurate while preventing span times from drifting - * too far from the system clock. - * - * Only creating an anchored clock once per local trace ensures span times are correct relative - * to each other. For example, a child span will never have a start time before its parent even - * if the system clock is corrected during the local trace. - * - * Heavily inspired by the OTel Java anchored clock - * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java - */ - var AnchoredClock = class { - _monotonicClock; - _epochMillis; - _performanceMillis; - /** - * Create a new AnchoredClock anchored to the current time returned by systemClock. - * - * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date - * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance - */ - constructor(systemClock, monotonicClock) { - this._monotonicClock = monotonicClock; - this._epochMillis = systemClock.now(); - this._performanceMillis = monotonicClock.now(); - } - /** - * Returns the current time by adding the number of milliseconds since the - * AnchoredClock was created to the creation epoch time - */ - now() { - const delta = this._monotonicClock.now() - this._performanceMillis; - return this._epochMillis + delta; + exports.MetricsExporterMetricsHelper = void 0; + exports.MetricsExporterMetricsHelper = { + name: "metric_data_point", + countItems: (request) => { + let count = 0; + for (const scopeMetrics of request.scopeMetrics) for (const metric of scopeMetrics.metrics) count += metric.dataPoints.length; + return count; } }; - exports.AnchoredClock = AnchoredClock; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/attributes.js -var require_attributes = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/index.js +var require_trace$2 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - function sanitizeAttributes(attributes) { - const out = {}; - if (typeof attributes !== "object" || attributes == null) return out; - for (const [key, val] of Object.entries(attributes)) { - if (!isAttributeKey(key)) { - api_1.diag.warn(`Invalid attribute key: ${key}`); - continue; - } - if (!isAttributeValue(val)) { - api_1.diag.warn(`Invalid attribute value set for key: ${key}`); - continue; - } - if (Array.isArray(val)) out[key] = val.slice(); - else out[key] = val; - } - return out; - } - exports.sanitizeAttributes = sanitizeAttributes; - function isAttributeKey(key) { - return typeof key === "string" && key.length > 0; - } - exports.isAttributeKey = isAttributeKey; - function isAttributeValue(val) { - if (val == null) return true; - if (Array.isArray(val)) return isHomogeneousAttributeValueArray(val); - return isValidPrimitiveAttributeValue(val); - } - exports.isAttributeValue = isAttributeValue; - function isHomogeneousAttributeValueArray(arr) { - let type; - for (const element of arr) { - if (element == null) continue; - if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; - continue; - } - return false; - } - if (typeof element === type) continue; - return false; - } - return true; - } - function isValidPrimitiveAttributeValue(val) { - switch (typeof val) { - case "number": - case "boolean": - case "string": return true; - } - return false; - } + exports.TraceExporterMetricsHelper = void 0; + exports.TraceExporterMetricsHelper = { + name: "span", + countItems: (request) => request.length + }; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js -var require_logging_error_handler = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/index.js +var require_logs$3 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.loggingErrorHandler = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - /** - * Returns a function that logs an error using the provided logger, or a - * console logger if one was not provided. - */ - function loggingErrorHandler() { - return (ex) => { - api_1.diag.error(stringifyException(ex)); - }; - } - exports.loggingErrorHandler = loggingErrorHandler; - /** - * Converts an exception into a string representation - * @param {Exception} ex - */ - function stringifyException(ex) { - if (typeof ex === "string") return ex; - else return JSON.stringify(flattenException(ex)); - } + exports.LogsExporterMetricsHelper = void 0; + exports.LogsExporterMetricsHelper = { + name: "log", + countItems: (request) => request.length + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/protobuf/utils.js +var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.estimateVarintSize = void 0; /** - * Flattens an exception into key-value pairs by traversing the prototype chain - * and coercing values to strings. Duplicate properties will not be overwritten; - * the first insert wins. + * Estimate size of a number encoded as varint. + * @param v value to calculate size for + * @returns size in bytes of the varint encoding of the value */ - function flattenException(ex) { - const result = {}; - let current = ex; - while (current !== null) { - Object.getOwnPropertyNames(current).forEach((propertyName) => { - if (result[propertyName]) return; - const value = current[propertyName]; - if (value) result[propertyName] = String(value); - }); - current = Object.getPrototypeOf(current); - } - return result; + function estimateVarintSize(v) { + if (v < 0) return 10; + if (v < 128) return 1; + if (v < 16384) return 2; + if (v < 2097152) return 3; + if (v < 268435456) return 4; + if (v < 34359738368) return 5; + if (v < 4398046511104) return 6; + if (v < 562949953421312) return 7; + if (v < 72057594037927940) return 8; + return 9; } + exports.estimateVarintSize = estimateVarintSize; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js -var require_global_error_handler = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/protobuf/protobuf-writer.js +var require_protobuf_writer = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; - /** The global error handler delegate */ - let delegateHandler = (0, require_logging_error_handler().loggingErrorHandler)(); + exports.ProtobufWriter = exports.GROWING_BUFFER_DEBUG_MESSAGE = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const utils_1 = require_utils$4(); + exports.GROWING_BUFFER_DEBUG_MESSAGE = "ProtobufWriter: estimated size was too small, growing buffer."; /** - * Set the global error handler - * @param {ErrorHandler} handler + * bytes reserved for length in length-delimited fields + * using 1 to assume most length-delimited fields are small */ - function setGlobalErrorHandler(handler) { - delegateHandler = handler; - } - exports.setGlobalErrorHandler = setGlobalErrorHandler; + const RESERVED_LENGTH_BYTES = 1; /** - * Return the global error handler - * @param {Exception} ex + * Primitive protobuf writer, optimized to avoid small object allocations. + * Grows buffer dynamically if initial size is exceeded. */ - function globalErrorHandler(ex) { - try { - delegateHandler(ex); - } catch {} - } - exports.globalErrorHandler = globalErrorHandler; + var ProtobufWriter = class { + _buffer; + _textEncoder; + _dataView; + pos = 0; + constructor(estimatedSize = 65536) { + this._buffer = new Uint8Array(estimatedSize); + this._textEncoder = new TextEncoder(); + this._dataView = new DataView(this._buffer.buffer, this._buffer.byteOffset); + } + /** + * Ensure buffer has capacity for at least size more bytes + */ + _ensureCapacity(size) { + const needed = this.pos + size; + if (needed <= this._buffer.length) return; + api_1.diag.debug(exports.GROWING_BUFFER_DEBUG_MESSAGE); + let newSize = this._buffer.length * 2; + while (newSize < needed) newSize *= 2; + const newBuffer = new Uint8Array(newSize); + newBuffer.set(this._buffer); + this._buffer = newBuffer; + this._dataView = new DataView(this._buffer.buffer, this._buffer.byteOffset); + } + /** + * Get the written bytes as a Uint8Array + */ + finish() { + return this._buffer.subarray(0, this.pos); + } + /** + * Insert placeholder for length. Update later with {@link finishLengthDelimited} + * Returns the position where to write the length. + */ + startLengthDelimited() { + const lengthPos = this.pos; + this._ensureCapacity(RESERVED_LENGTH_BYTES); + this.pos += RESERVED_LENGTH_BYTES; + return lengthPos; + } + /** + * Write length varint at placeholder position and shift content forward if needed. + * Most messages are small (< 128 bytes), so we reserve 1 byte and only shift + * when the length needs more bytes. + */ + finishLengthDelimited(pos, length) { + const v = length >>> 0; + const varintSize = (0, utils_1.estimateVarintSize)(v); + if (varintSize > RESERVED_LENGTH_BYTES) { + const additionalBytes = varintSize - RESERVED_LENGTH_BYTES; + this._ensureCapacity(additionalBytes); + this._buffer.copyWithin(pos + varintSize, pos + RESERVED_LENGTH_BYTES, this.pos); + this.pos += additionalBytes; + } + let writePos = pos; + if (v < 128) this._buffer[writePos] = v; + else if (v < 16384) { + this._buffer[writePos++] = v & 127 | 128; + this._buffer[writePos] = v >>> 7; + } else if (v < 2097152) { + this._buffer[writePos++] = v & 127 | 128; + this._buffer[writePos++] = v >>> 7 & 127 | 128; + this._buffer[writePos] = v >>> 14; + } else if (v < 268435456) { + this._buffer[writePos++] = v & 127 | 128; + this._buffer[writePos++] = v >>> 7 & 127 | 128; + this._buffer[writePos++] = v >>> 14 & 127 | 128; + this._buffer[writePos] = v >>> 21; + } else { + this._buffer[writePos++] = v & 127 | 128; + this._buffer[writePos++] = v >>> 7 & 127 | 128; + this._buffer[writePos++] = v >>> 14 & 127 | 128; + this._buffer[writePos++] = v >>> 21 & 127 | 128; + this._buffer[writePos] = v >>> 28; + } + } + /** + * Write a sint32 value using zigzag encoding + */ + writeSint32(value) { + this.writeVarint((value << 1 ^ value >> 31) >>> 0); + } + /** + * Write a signed 64-bit fixed integer (sfixed64) from a JS number. + * Handles negative values via two's complement. + */ + writeSfixed64(value) { + let low; + let high; + if (value >= 0) { + low = value >>> 0; + high = value / 4294967296 >>> 0; + } else { + const abs = Math.abs(value); + low = abs >>> 0; + high = abs / 4294967296 >>> 0; + low = ~low >>> 0; + high = ~high >>> 0; + low = low + 1 >>> 0; + if (low === 0) high = high + 1 >>> 0; + } + this.writeFixed64(low, high); + } + /** + * Write a varint (variable-length integer) + */ + writeVarint(value) { + this._ensureCapacity((0, utils_1.estimateVarintSize)(value)); + if (value >= 0 && value <= 4294967295) { + let v = value >>> 0; + while (v > 127) { + this._buffer[this.pos++] = v & 127 | 128; + v >>>= 7; + } + this._buffer[this.pos++] = v; + } else { + let low; + let high; + if (value >= 0) { + low = value >>> 0; + high = value / 4294967296 >>> 0; + } else { + const abs = Math.abs(value); + low = abs >>> 0; + high = abs / 4294967296 >>> 0; + low = ~low >>> 0; + high = ~high >>> 0; + low = low + 1 >>> 0; + if (low === 0) high = high + 1 >>> 0; + } + while (high > 0 || low > 127) { + this._buffer[this.pos++] = low & 127 | 128; + low = (low >>> 7 | high << 25) >>> 0; + high >>>= 7; + } + this._buffer[this.pos++] = low & 127; + } + } + /** + * Write a 32-bit fixed integer (little-endian) + */ + writeFixed32(value) { + this._ensureCapacity(4); + const v = value >>> 0; + this._buffer[this.pos++] = v & 255; + this._buffer[this.pos++] = v >>> 8 & 255; + this._buffer[this.pos++] = v >>> 16 & 255; + this._buffer[this.pos++] = v >>> 24 & 255; + } + /** + * Write a 64-bit fixed integer (little-endian) + * @param low - Low 32 bits + * @param high - High 32 bits + */ + writeFixed64(low, high) { + this._ensureCapacity(8); + const l = low >>> 0; + const h = high >>> 0; + this._buffer[this.pos++] = l & 255; + this._buffer[this.pos++] = l >>> 8 & 255; + this._buffer[this.pos++] = l >>> 16 & 255; + this._buffer[this.pos++] = l >>> 24 & 255; + this._buffer[this.pos++] = h & 255; + this._buffer[this.pos++] = h >>> 8 & 255; + this._buffer[this.pos++] = h >>> 16 & 255; + this._buffer[this.pos++] = h >>> 24 & 255; + } + /** + * Write length-delimited data (varint length + bytes) + */ + writeBytes(bytes) { + this.writeVarint(bytes.length); + this._ensureCapacity(bytes.length); + this._buffer.set(bytes, this.pos); + this.pos += bytes.length; + } + /** + * Write a field key (field number + wire type) + */ + writeTag(fieldNumber, wireType) { + this.writeVarint(fieldNumber << 3 | wireType); + } + /** + * Write a double (64-bit IEEE 754) + */ + writeDouble(value) { + this._ensureCapacity(8); + this._dataView.setFloat64(this.pos, value, true); + this.pos += 8; + } + /** + * Write a string as UTF-8 bytes (length-delimited) + */ + writeString(str) { + let isAscii = true; + const len = str.length; + for (let i = 0; i < len; i++) if (str.charCodeAt(i) > 127) { + isAscii = false; + break; + } + if (isAscii) { + this.writeVarint(len); + this._ensureCapacity(len); + for (let i = 0; i < len; i++) this._buffer[this.pos++] = str.charCodeAt(i); + } else { + const bytes = this._textEncoder.encode(str); + this.writeBytes(bytes); + } + } + }; + exports.ProtobufWriter = ProtobufWriter; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/environment.js -var require_environment = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/hex-to-binary.js +var require_hex_to_binary = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const util_1 = __require("util"); - /** - * Retrieves a number from an environment variable. - * - Returns `undefined` if the environment variable is empty, unset, contains only whitespace, or is not a number. - * - Returns a number in all other cases. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {number | undefined} - The number value or `undefined`. - */ - function getNumberFromEnv(key) { - const raw = process.env[key]; - if (raw == null || raw.trim() === "") return; - const value = Number(raw); - if (isNaN(value)) { - api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected a number, using defaults`); - return; - } - return value; - } - exports.getNumberFromEnv = getNumberFromEnv; - /** - * Retrieves a string from an environment variable. - * - Returns `undefined` if the environment variable is empty, unset, or contains only whitespace. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {string | undefined} - The string value or `undefined`. - */ - function getStringFromEnv(key) { - const raw = process.env[key]; - if (raw == null || raw.trim() === "") return; - return raw; + exports.hexToBinary = void 0; + function intValue(charCode) { + if (charCode >= 48 && charCode <= 57) return charCode - 48; + if (charCode >= 97 && charCode <= 102) return charCode - 87; + return charCode - 55; } - exports.getStringFromEnv = getStringFromEnv; - /** - * Retrieves a boolean value from an environment variable. - * - Trims leading and trailing whitespace and ignores casing. - * - Returns `false` if the environment variable is empty, unset, or contains only whitespace. - * - Returns `false` for strings that cannot be mapped to a boolean. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {boolean} - The boolean value or `false` if the environment variable is unset empty, unset, or contains only whitespace. - */ - function getBooleanFromEnv(key) { - const raw = process.env[key]?.trim().toLowerCase(); - if (raw == null || raw === "") return false; - if (raw === "true") return true; - else if (raw === "false") return false; - else { - api_1.diag.warn(`Unknown value ${(0, util_1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); - return false; + function hexToBinary(hexStr) { + const buf = new Uint8Array(hexStr.length / 2); + let offset = 0; + for (let i = 0; i < hexStr.length; i += 2) { + const hi = intValue(hexStr.charCodeAt(i)); + const lo = intValue(hexStr.charCodeAt(i + 1)); + buf[offset++] = hi << 4 | lo; } + return buf; } - exports.getBooleanFromEnv = getBooleanFromEnv; - /** - * Retrieves a list of strings from an environment variable. - * - Uses ',' as the delimiter. - * - Trims leading and trailing whitespace from each entry. - * - Excludes empty entries. - * - Returns `undefined` if the environment variable is empty or contains only whitespace. - * - Returns an empty array if all entries are empty or whitespace. - * - * @param {string} key - The name of the environment variable to retrieve. - * @returns {string[] | undefined} - The list of strings or `undefined`. - */ - function getStringListFromEnv(key) { - return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== ""); - } - exports.getStringListFromEnv = getStringListFromEnv; + exports.hexToBinary = hexToBinary; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js -var require_globalThis = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+api-logs@0.221.0/node_modules/@opentelemetry/api-logs/build/src/types/LogRecord.js +var require_LogRecord = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports._globalThis = void 0; - /** only globals that common to node and browsers are allowed */ - exports._globalThis = typeof globalThis === "object" ? globalThis : global; + exports.SeverityNumber = void 0; + var SeverityNumber; + (function(SeverityNumber) { + SeverityNumber[SeverityNumber["UNSPECIFIED"] = 0] = "UNSPECIFIED"; + SeverityNumber[SeverityNumber["TRACE"] = 1] = "TRACE"; + SeverityNumber[SeverityNumber["TRACE2"] = 2] = "TRACE2"; + SeverityNumber[SeverityNumber["TRACE3"] = 3] = "TRACE3"; + SeverityNumber[SeverityNumber["TRACE4"] = 4] = "TRACE4"; + SeverityNumber[SeverityNumber["DEBUG"] = 5] = "DEBUG"; + SeverityNumber[SeverityNumber["DEBUG2"] = 6] = "DEBUG2"; + SeverityNumber[SeverityNumber["DEBUG3"] = 7] = "DEBUG3"; + SeverityNumber[SeverityNumber["DEBUG4"] = 8] = "DEBUG4"; + SeverityNumber[SeverityNumber["INFO"] = 9] = "INFO"; + SeverityNumber[SeverityNumber["INFO2"] = 10] = "INFO2"; + SeverityNumber[SeverityNumber["INFO3"] = 11] = "INFO3"; + SeverityNumber[SeverityNumber["INFO4"] = 12] = "INFO4"; + SeverityNumber[SeverityNumber["WARN"] = 13] = "WARN"; + SeverityNumber[SeverityNumber["WARN2"] = 14] = "WARN2"; + SeverityNumber[SeverityNumber["WARN3"] = 15] = "WARN3"; + SeverityNumber[SeverityNumber["WARN4"] = 16] = "WARN4"; + SeverityNumber[SeverityNumber["ERROR"] = 17] = "ERROR"; + SeverityNumber[SeverityNumber["ERROR2"] = 18] = "ERROR2"; + SeverityNumber[SeverityNumber["ERROR3"] = 19] = "ERROR3"; + SeverityNumber[SeverityNumber["ERROR4"] = 20] = "ERROR4"; + SeverityNumber[SeverityNumber["FATAL"] = 21] = "FATAL"; + SeverityNumber[SeverityNumber["FATAL2"] = 22] = "FATAL2"; + SeverityNumber[SeverityNumber["FATAL3"] = 23] = "FATAL3"; + SeverityNumber[SeverityNumber["FATAL4"] = 24] = "FATAL4"; + })(SeverityNumber || (exports.SeverityNumber = SeverityNumber = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api-logs@0.221.0/node_modules/@opentelemetry/api-logs/build/src/NoopLogger.js +var require_NoopLogger = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createNoopLogger = exports.NOOP_LOGGER = exports.NoopLogger = void 0; + var NoopLogger = class { + emit(_logRecord) {} + enabled() { + return false; + } + }; + exports.NoopLogger = NoopLogger; + exports.NOOP_LOGGER = new NoopLogger(); + /** + * Create a no-op Logger + */ + function createNoopLogger() { + return exports.NOOP_LOGGER; + } + exports.createNoopLogger = createNoopLogger; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/performance.js -var require_performance = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+api-logs@0.221.0/node_modules/@opentelemetry/api-logs/build/src/internal/global-utils.js +var require_global_utils = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.otperformance = void 0; - const perf_hooks_1 = __require("perf_hooks"); - exports.otperformance = perf_hooks_1.performance; + exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_LOGS_API_KEY = void 0; + exports.GLOBAL_LOGS_API_KEY = Symbol.for("io.opentelemetry.js.api.logs"); + exports._global = globalThis; + /** + * Make a function which accepts a version integer and returns the instance of an API if the version + * is compatible, or a fallback version (usually NOOP) if it is not. + * + * @param requiredVersion Backwards compatibility version which is required to return the instance + * @param instance Instance which should be returned if the required version is compatible + * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible + */ + function makeGetter(requiredVersion, instance, fallback) { + return (version) => version === requiredVersion ? instance : fallback; + } + exports.makeGetter = makeGetter; + /** + * A number which should be incremented each time a backwards incompatible + * change is made to the API. This number is used when an API package + * attempts to access the global API to ensure it is getting a compatible + * version. If the global API is not compatible with the API package + * attempting to get it, a NOOP API implementation will be returned. + */ + exports.API_BACKWARDS_COMPATIBILITY_VERSION = 1; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/version.js -var require_version$2 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+api-logs@0.221.0/node_modules/@opentelemetry/api-logs/build/src/NoopLoggerProvider.js +var require_NoopLoggerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.VERSION = void 0; - exports.VERSION = "2.1.0"; + exports.NOOP_LOGGER_PROVIDER = exports.NoopLoggerProvider = void 0; + const NoopLogger_1 = require_NoopLogger(); + var NoopLoggerProvider = class { + getLogger(_name, _version, _options) { + return new NoopLogger_1.NoopLogger(); + } + }; + exports.NoopLoggerProvider = NoopLoggerProvider; + exports.NOOP_LOGGER_PROVIDER = new NoopLoggerProvider(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/semconv.js -var require_semconv$3 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+api-logs@0.221.0/node_modules/@opentelemetry/api-logs/build/src/ProxyLogger.js +var require_ProxyLogger = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.ATTR_PROCESS_RUNTIME_NAME = void 0; - /** - * The name of the runtime of this process. - * - * @example OpenJDK Runtime Environment - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; + exports.ProxyLogger = void 0; + const NoopLogger_1 = require_NoopLogger(); + var ProxyLogger = class { + constructor(provider, name, version, options) { + this._provider = provider; + this.name = name; + this.version = version; + this.options = options; + } + /** + * Emit a log record. This method should only be used by log appenders. + * + * @param logRecord + */ + emit(logRecord) { + this._getLogger().emit(logRecord); + } + enabled(options) { + return this._getLogger().enabled(options); + } + /** + * Try to get a logger from the proxy logger provider. + * If the proxy logger provider has no delegate, return a noop logger. + */ + _getLogger() { + if (this._delegate) return this._delegate; + const logger = this._provider._getDelegateLogger(this.name, this.version, this.options); + if (!logger) return NoopLogger_1.NOOP_LOGGER; + this._delegate = logger; + return this._delegate; + } + }; + exports.ProxyLogger = ProxyLogger; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js -var require_sdk_info = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+api-logs@0.221.0/node_modules/@opentelemetry/api-logs/build/src/ProxyLoggerProvider.js +var require_ProxyLoggerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.SDK_INFO = void 0; - const version_1 = require_version$2(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const semconv_1 = require_semconv$3(); - /** Constants describing the SDK in use */ - exports.SDK_INFO = { - [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: "opentelemetry", - [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "node", - [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, - [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: version_1.VERSION + exports.ProxyLoggerProvider = void 0; + const NoopLoggerProvider_1 = require_NoopLoggerProvider(); + const ProxyLogger_1 = require_ProxyLogger(); + var ProxyLoggerProvider = class { + getLogger(name, version, options) { + var _a; + return (_a = this._getDelegateLogger(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyLogger_1.ProxyLogger(this, name, version, options); + } + /** + * Get the delegate logger provider. + * Used by tests only. + * @internal + */ + _getDelegate() { + var _a; + return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; + } + /** + * Set the delegate logger provider + * @internal + */ + _setDelegate(delegate) { + this._delegate = delegate; + } + /** + * @internal + */ + _getDelegateLogger(name, version, options) { + var _a; + return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getLogger(name, version, options); + } }; + exports.ProxyLoggerProvider = ProxyLoggerProvider; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js -var require_timer_util = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+api-logs@0.221.0/node_modules/@opentelemetry/api-logs/build/src/api/logs.js +var require_logs$2 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.unrefTimer = void 0; - function unrefTimer(timer) { - timer.unref(); - } - exports.unrefTimer = unrefTimer; + exports.LogsAPI = void 0; + const global_utils_1 = require_global_utils(); + const NoopLoggerProvider_1 = require_NoopLoggerProvider(); + const ProxyLoggerProvider_1 = require_ProxyLoggerProvider(); + var LogsAPI = class LogsAPI { + constructor() { + this._proxyLoggerProvider = new ProxyLoggerProvider_1.ProxyLoggerProvider(); + } + static getInstance() { + if (!this._instance) this._instance = new LogsAPI(); + return this._instance; + } + setGlobalLoggerProvider(provider) { + if (global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) return this.getLoggerProvider(); + global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY] = (0, global_utils_1.makeGetter)(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER); + this._proxyLoggerProvider._setDelegate(provider); + return provider; + } + /** + * Returns the global logger provider. + * + * @returns LoggerProvider + */ + getLoggerProvider() { + var _a, _b; + return (_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider; + } + /** + * Returns a Logger, creating one if one with the given name, version, + * schemaUrl, and attributes is not already created. + * + * Getting a Logger may be expensive, especially when `attributes` are + * provided. Reuse Logger instances where possible instead of calling + * `getLogger()` on hot paths. + * + * @param name The name of the logger or instrumentation library. + * @param version The version of the logger or instrumentation library. + * @param options The options of the logger or instrumentation library. + * @returns {@link Logger} + */ + getLogger(name, version, options) { + return this.getLoggerProvider().getLogger(name, version, options); + } + /** Remove the global logger provider */ + disable() { + delete global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]; + this._proxyLoggerProvider = new ProxyLoggerProvider_1.ProxyLoggerProvider(); + } + }; + exports.LogsAPI = LogsAPI; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/index.js -var require_node$5 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+api-logs@0.221.0/node_modules/@opentelemetry/api-logs/build/src/index.js +var require_src$7 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = void 0; - var environment_1 = require_environment(); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return environment_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { + exports.logs = exports.createNoopLogger = exports.SeverityNumber = void 0; + var LogRecord_1 = require_LogRecord(); + Object.defineProperty(exports, "SeverityNumber", { enumerable: true, get: function() { - return environment_1.getBooleanFromEnv; + return LogRecord_1.SeverityNumber; } }); - Object.defineProperty(exports, "getNumberFromEnv", { + var NoopLogger_1 = require_NoopLogger(); + Object.defineProperty(exports, "createNoopLogger", { enumerable: true, get: function() { - return environment_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return environment_1.getStringListFromEnv; - } - }); - var globalThis_1 = require_globalThis(); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return globalThis_1._globalThis; - } - }); - var performance_1 = require_performance(); - Object.defineProperty(exports, "otperformance", { - enumerable: true, - get: function() { - return performance_1.otperformance; - } - }); - var sdk_info_1 = require_sdk_info(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return sdk_info_1.SDK_INFO; - } - }); - var timer_util_1 = require_timer_util(); - Object.defineProperty(exports, "unrefTimer", { - enumerable: true, - get: function() { - return timer_util_1.unrefTimer; + return NoopLogger_1.createNoopLogger; } }); + const logs_1 = require_logs$2(); + exports.logs = logs_1.LogsAPI.getInstance(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/index.js -var require_platform$5 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/protobuf/common-serializer.js +var require_common_serializer = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.unrefTimer = exports.otperformance = exports._globalThis = exports.SDK_INFO = void 0; - var node_1 = require_node$5(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return node_1.SDK_INFO; - } - }); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return node_1._globalThis; - } - }); - Object.defineProperty(exports, "otperformance", { - enumerable: true, - get: function() { - return node_1.otperformance; - } - }); - Object.defineProperty(exports, "unrefTimer", { - enumerable: true, - get: function() { - return node_1.unrefTimer; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { - enumerable: true, - get: function() { - return node_1.getBooleanFromEnv; - } - }); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return node_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getNumberFromEnv", { - enumerable: true, - get: function() { - return node_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return node_1.getStringListFromEnv; + exports.writeResource = exports.writeInstrumentationScope = exports.writeAnyValue = exports.writeKeyValue = exports.writeAttributes = exports.writeHrTimeAsFixed64 = void 0; + /** + * Write HrTime [seconds, nanoseconds] directly as fixed64 to the serializer. + * Converts to nanoseconds and writes as 64-bit little-endian integer without allocations. + * + * HrTime represents: total_nanos = seconds * 1_000_000_000 + nanoseconds + * We need to split this into low (bits 0-31) and high (bits 32-63). + * + * @param serializer - The protobuf writer + * @param hrTime - HrTime tuple [seconds, nanoseconds] + */ + function writeHrTimeAsFixed64(serializer, hrTime) { + const seconds = hrTime[0]; + const nanos = hrTime[1]; + const nanosPerSecond = 1e9; + const secondsLower16Bits = seconds & 65535; + const secondsUpperBits = seconds / 65536 >>> 0; + const nanosFromLower16Bits = secondsLower16Bits * nanosPerSecond; + const nanosFromUpperBits = secondsUpperBits * nanosPerSecond; + const lower16ContributionLow32 = nanosFromLower16Bits >>> 0; + const lower16ContributionHigh32 = Math.floor(nanosFromLower16Bits / 4294967296); + const upperBitsContributionLow32 = (nanosFromUpperBits & 65535) * 65536 >>> 0; + const upperBitsContributionHigh32 = nanosFromUpperBits / 65536 >>> 0; + const low32WithCarry = lower16ContributionLow32 + upperBitsContributionLow32 + nanos; + const totalLow = low32WithCarry >>> 0; + const carry = Math.floor(low32WithCarry / 4294967296); + const totalHigh = lower16ContributionHigh32 + upperBitsContributionHigh32 + carry >>> 0; + serializer.writeFixed64(totalLow, totalHigh); + } + exports.writeHrTimeAsFixed64 = writeHrTimeAsFixed64; + /** + * Write Attributes directly to protobuf as repeated KeyValue + */ + function writeAttributes(writer, attributes, fieldNumber) { + for (const key in attributes) { + if (!Object.prototype.hasOwnProperty.call(attributes, key)) continue; + const value = attributes[key]; + writer.writeTag(fieldNumber, 2); + const kvStart = writer.startLengthDelimited(); + const startPos = writer.pos; + writeKeyValue(writer, key, value); + writer.finishLengthDelimited(kvStart, writer.pos - startPos); } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/common/time.js -var require_time = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.addHrTimes = exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = exports.getTimeOrigin = exports.millisToHrTime = void 0; - const platform_1 = require_platform$5(); - const NANOSECOND_DIGITS = 9; - const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, 6); - const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + } + exports.writeAttributes = writeAttributes; /** - * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). - * @param epochMillis + * Write a KeyValue pair directly to protobuf */ - function millisToHrTime(epochMillis) { - const epochSeconds = epochMillis / 1e3; - return [Math.trunc(epochSeconds), Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS)]; - } - exports.millisToHrTime = millisToHrTime; - function getTimeOrigin() { - let timeOrigin = platform_1.otperformance.timeOrigin; - if (typeof timeOrigin !== "number") { - const perf = platform_1.otperformance; - timeOrigin = perf.timing && perf.timing.fetchStart; - } - return timeOrigin; + function writeKeyValue(writer, key, value) { + writer.writeTag(1, 2); + writer.writeString(key); + writer.writeTag(2, 2); + const valueStart = writer.startLengthDelimited(); + const startPos = writer.pos; + writeAnyValue(writer, value); + writer.finishLengthDelimited(valueStart, writer.pos - startPos); } - exports.getTimeOrigin = getTimeOrigin; + exports.writeKeyValue = writeKeyValue; + const MIN_64_BIT_INT = -(2 ** 63); + const MAX_64_BIT_INT = 2 ** 63; /** - * Returns an hrtime calculated via performance component. - * @param performanceNow + * Write an AnyValue directly from raw attribute value to protobuf */ - function hrTime(performanceNow) { - return addHrTimes(millisToHrTime(getTimeOrigin()), millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now())); + function writeAnyValue(writer, value) { + const t = typeof value; + if (t === "string") { + writer.writeTag(1, 2); + writer.writeString(value); + } else if (t === "boolean") { + writer.writeTag(2, 0); + writer.writeVarint(value ? 1 : 0); + } else if (t === "number") { + const numValue = value; + if (Number.isInteger(numValue) && numValue >= MIN_64_BIT_INT && numValue < MAX_64_BIT_INT) { + writer.writeTag(3, 0); + writer.writeVarint(numValue); + } else { + writer.writeTag(4, 1); + writer.writeDouble(numValue); + } + } else if (value instanceof Uint8Array) { + writer.writeTag(7, 2); + writer.writeBytes(value); + } else if (Array.isArray(value)) { + writer.writeTag(5, 2); + const arrayStart = writer.startLengthDelimited(); + const arrayStartPos = writer.pos; + for (const item of value) { + writer.writeTag(1, 2); + const itemStart = writer.startLengthDelimited(); + const itemStartPos = writer.pos; + writeAnyValue(writer, item); + writer.finishLengthDelimited(itemStart, writer.pos - itemStartPos); + } + writer.finishLengthDelimited(arrayStart, writer.pos - arrayStartPos); + } else if (t === "object" && value != null) { + writer.writeTag(6, 2); + const kvlistStart = writer.startLengthDelimited(); + const kvlistStartPos = writer.pos; + const obj = value; + for (const k in obj) { + if (!Object.prototype.hasOwnProperty.call(obj, k)) continue; + const v = obj[k]; + writer.writeTag(1, 2); + const kvStart = writer.startLengthDelimited(); + const kvStartPos = writer.pos; + writer.writeTag(1, 2); + writer.writeString(k); + writer.writeTag(2, 2); + const valueStart = writer.startLengthDelimited(); + const valueStartPos = writer.pos; + writeAnyValue(writer, v); + writer.finishLengthDelimited(valueStart, writer.pos - valueStartPos); + writer.finishLengthDelimited(kvStart, writer.pos - kvStartPos); + } + writer.finishLengthDelimited(kvlistStart, writer.pos - kvlistStartPos); + } } - exports.hrTime = hrTime; + exports.writeAnyValue = writeAnyValue; /** + * Write an InstrumentationScope message. * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time + * Proto fields (InstrumentationScope): + * 1 name string (wire type 2) + * 2 version string (wire type 2) */ - function timeInputToHrTime(time$2) { - if (isTimeInputHrTime(time$2)) return time$2; - else if (typeof time$2 === "number") if (time$2 < getTimeOrigin()) return hrTime(time$2); - else return millisToHrTime(time$2); - else if (time$2 instanceof Date) return millisToHrTime(time$2.getTime()); - else throw TypeError("Invalid input type"); + function writeInstrumentationScope(writer, scope, fieldNumber) { + writer.writeTag(fieldNumber, 2); + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + writer.writeTag(1, 2); + writer.writeString(scope.name); + if (scope.version) { + writer.writeTag(2, 2); + writer.writeString(scope.version); + } + if (scope.attributes) writeAttributes(writer, scope.attributes, 3); + if (scope.droppedAttributesCount) { + writer.writeTag(4, 0); + writer.writeVarint(scope.droppedAttributesCount); + } + writer.finishLengthDelimited(start, writer.pos - startPos); } - exports.timeInputToHrTime = timeInputToHrTime; + exports.writeInstrumentationScope = writeInstrumentationScope; /** - * Returns a duration of two hrTime. - * @param startTime - * @param endTime + * Write a Resource message and its enclosing tag. + * + * Proto fields (Resource): + * 1 attributes repeated KeyValue (wire type 2) + * 2 dropped_attributes_count uint32 (wire type 0) */ - function hrTimeDuration(startTime, endTime) { - let seconds = endTime[0] - startTime[0]; - let nanos = endTime[1] - startTime[1]; - if (nanos < 0) { - seconds -= 1; - nanos += SECOND_TO_NANOSECONDS; - } - return [seconds, nanos]; + function writeResource(writer, resource, fieldNumber) { + writer.writeTag(fieldNumber, 2); + const resourceStart = writer.startLengthDelimited(); + const resourceStartPos = writer.pos; + if (resource.attributes) writeAttributes(writer, resource.attributes, 1); + writer.writeTag(2, 0); + writer.writeVarint(0); + writer.finishLengthDelimited(resourceStart, writer.pos - resourceStartPos); } - exports.hrTimeDuration = hrTimeDuration; + exports.writeResource = writeResource; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/protobuf/protobuf-size-estimator.js +var require_protobuf_size_estimator = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufSizeEstimator = void 0; + const utils_1 = require_utils$4(); /** - * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" - * @param time - */ - function hrTimeToTimeStamp(time$2) { - const precision = NANOSECOND_DIGITS; - const tmp = `${"0".repeat(precision)}${time$2[1]}Z`; - const nanoString = tmp.substring(tmp.length - precision - 1); - return (/* @__PURE__ */ new Date(time$2[0] * 1e3)).toISOString().replace("000Z", nanoString); + * Calculate UTF-8 byte length without encoding + * @param str valid UTF-16 string + */ + function utf8ByteLength(str) { + const len = str.length; + let byteLen = 0; + for (let i = 0; i < len; i++) { + const code = str.charCodeAt(i); + if (code < 128) byteLen += 1; + else if (code < 2048) byteLen += 2; + else if (code < 55296 || code >= 57344) byteLen += 3; + else { + i++; + byteLen += 4; + } + } + return byteLen; } - exports.hrTimeToTimeStamp = hrTimeToTimeStamp; /** - * Convert hrTime to nanoseconds. - * @param time + * Size estimator for protobuf messages. + * Implements the same interface as ProtobufWriter but only counts bytes without allocating a buffer. + * @internal */ - function hrTimeToNanoseconds(time$2) { - return time$2[0] * SECOND_TO_NANOSECONDS + time$2[1]; - } - exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + var ProtobufSizeEstimator = class { + pos = 0; + startLengthDelimited() { + return this.pos; + } + finishLengthDelimited(_, length) { + this.pos += (0, utils_1.estimateVarintSize)(length); + } + writeVarint(value) { + this.pos += (0, utils_1.estimateVarintSize)(value); + } + writeSint32(value) { + this.pos += (0, utils_1.estimateVarintSize)((value << 1 ^ value >> 31) >>> 0); + } + writeSfixed64(_value) { + this.pos += 8; + } + writeFixed32(_value) { + this.pos += 4; + } + writeFixed64(_low, _high) { + this.pos += 8; + } + writeBytes(bytes) { + this.pos += (0, utils_1.estimateVarintSize)(bytes.length); + this.pos += bytes.length; + } + writeTag(fieldNumber, wireType) { + this.writeVarint(fieldNumber << 3 | wireType); + } + writeDouble(_value) { + this.pos += 8; + } + writeString(str) { + const byteLen = utf8ByteLength(str); + this.pos += (0, utils_1.estimateVarintSize)(byteLen); + this.pos += byteLen; + } + }; + exports.ProtobufSizeEstimator = ProtobufSizeEstimator; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs-serializer.js +var require_logs_serializer = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serializeLogsExportRequest = void 0; + const protobuf_writer_1 = require_protobuf_writer(); + const hex_to_binary_1 = require_hex_to_binary(); + const api_logs_1 = require_src$7(); + const common_serializer_1 = require_common_serializer(); + const protobuf_size_estimator_1 = require_protobuf_size_estimator(); /** - * Convert hrTime to milliseconds. - * @param time + * Serialize a single LogRecord directly from ReadableLogRecord */ - function hrTimeToMilliseconds(time$2) { - return time$2[0] * 1e3 + time$2[1] / 1e6; + function serializeLogRecord(writer, logRecord) { + const logStart = writer.startLengthDelimited(); + const logStartPos = writer.pos; + writer.writeTag(1, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, logRecord.hrTime); + if (logRecord.severityNumber !== void 0 && logRecord.severityNumber !== api_logs_1.SeverityNumber.UNSPECIFIED) { + writer.writeTag(2, 0); + writer.writeVarint(logRecord.severityNumber); + } + if (logRecord.severityText) { + writer.writeTag(3, 2); + writer.writeString(logRecord.severityText); + } + if (logRecord.body !== void 0) { + writer.writeTag(5, 2); + const bodyStart = writer.startLengthDelimited(); + const bodyStartPos = writer.pos; + (0, common_serializer_1.writeAnyValue)(writer, logRecord.body); + writer.finishLengthDelimited(bodyStart, writer.pos - bodyStartPos); + } + if (logRecord.attributes) (0, common_serializer_1.writeAttributes)(writer, logRecord.attributes, 6); + writer.writeTag(7, 0); + writer.writeVarint(logRecord.droppedAttributesCount); + if (logRecord.spanContext?.traceFlags) { + writer.writeTag(8, 5); + writer.writeFixed32(logRecord.spanContext.traceFlags); + } + if (logRecord.spanContext?.traceId) { + writer.writeTag(9, 2); + writer.writeBytes((0, hex_to_binary_1.hexToBinary)(logRecord.spanContext.traceId)); + } + if (logRecord.spanContext?.spanId) { + writer.writeTag(10, 2); + writer.writeBytes((0, hex_to_binary_1.hexToBinary)(logRecord.spanContext.spanId)); + } + writer.writeTag(11, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, logRecord.hrTimeObserved); + if (logRecord.eventName) { + writer.writeTag(12, 2); + writer.writeString(logRecord.eventName); + } + writer.finishLengthDelimited(logStart, writer.pos - logStartPos); } - exports.hrTimeToMilliseconds = hrTimeToMilliseconds; /** - * Convert hrTime to microseconds. - * @param time + * Serialize ScopeLogs directly from SDK types */ - function hrTimeToMicroseconds(time$2) { - return time$2[0] * 1e6 + time$2[1] / 1e3; + function serializeScopeLogs(writer, scope, logRecords) { + const scopeLogsStart = writer.startLengthDelimited(); + const scopeLogsStartPos = writer.pos; + (0, common_serializer_1.writeInstrumentationScope)(writer, scope, 1); + for (const logRecord of logRecords) { + writer.writeTag(2, 2); + serializeLogRecord(writer, logRecord); + } + if (scope.schemaUrl) { + writer.writeTag(3, 2); + writer.writeString(scope.schemaUrl); + } + writer.finishLengthDelimited(scopeLogsStart, writer.pos - scopeLogsStartPos); } - exports.hrTimeToMicroseconds = hrTimeToMicroseconds; /** - * check if time is HrTime - * @param value + * Serialize ResourceLogs directly from SDK Resource type */ - function isTimeInputHrTime(value) { - return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + function serializeResourceLogs(writer, resource, scopeMap) { + const resourceLogsStart = writer.startLengthDelimited(); + const resourceLogsStartPos = writer.pos; + (0, common_serializer_1.writeResource)(writer, resource, 1); + for (const scopeLogs of scopeMap.values()) { + writer.writeTag(2, 2); + const scope = scopeLogs[0].instrumentationScope; + serializeScopeLogs(writer, scope, scopeLogs); + } + if (resource.schemaUrl) { + writer.writeTag(3, 2); + writer.writeString(resource.schemaUrl); + } + writer.finishLengthDelimited(resourceLogsStart, writer.pos - resourceLogsStartPos); } - exports.isTimeInputHrTime = isTimeInputHrTime; /** - * check if input value is a correct types.TimeInput - * @param value + * Group log records by resource and instrumentation scope */ - function isTimeInput(value) { - return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + function createResourceMap(logRecords) { + const resourceMap = /* @__PURE__ */ new Map(); + for (const record of logRecords) { + const resource = record.resource; + const scope = record.instrumentationScope; + let ismMap = resourceMap.get(resource); + if (!ismMap) { + ismMap = /* @__PURE__ */ new Map(); + resourceMap.set(resource, ismMap); + } + let records = ismMap.get(scope); + if (!records) { + records = []; + ismMap.set(scope, records); + } + records.push(record); + } + return resourceMap; } - exports.isTimeInput = isTimeInput; /** - * Given 2 HrTime formatted times, return their sum as an HrTime. + * Serialize ExportLogsServiceRequest directly from ReadableLogRecord[] */ - function addHrTimes(time1, time2) { - const out = [time1[0] + time2[0], time1[1] + time2[1]]; - if (out[1] >= SECOND_TO_NANOSECONDS) { - out[1] -= SECOND_TO_NANOSECONDS; - out[0] += 1; + function serializeLogsExportRequest(logRecords) { + const resourceMap = createResourceMap(logRecords); + const estimator = new protobuf_size_estimator_1.ProtobufSizeEstimator(); + for (const [resource, scopeMap] of resourceMap) { + estimator.writeTag(1, 2); + serializeResourceLogs(estimator, resource, scopeMap); } - return out; + const writer = new protobuf_writer_1.ProtobufWriter(estimator.pos); + for (const [resource, scopeMap] of resourceMap) { + writer.writeTag(1, 2); + serializeResourceLogs(writer, resource, scopeMap); + } + return writer.finish(); } - exports.addHrTimes = addHrTimes; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/ExportResult.js -var require_ExportResult = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExportResultCode = void 0; - (function(ExportResultCode$1) { - ExportResultCode$1[ExportResultCode$1["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode$1[ExportResultCode$1["FAILED"] = 1] = "FAILED"; - })(exports.ExportResultCode || (exports.ExportResultCode = {})); + exports.serializeLogsExportRequest = serializeLogsExportRequest; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/propagation/composite.js -var require_composite = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/protobuf/protobuf-reader.js +var require_protobuf_reader = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.CompositePropagator = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - /** Combines multiple propagators into a single propagator. */ - var CompositePropagator = class { - _propagators; - _fields; - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ - constructor(config$1 = {}) { - this._propagators = config$1.propagators ?? []; - this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), []))); + exports.ProtobufReader = void 0; + /** + * Minimal binary protobuf reader. + * Only implements the wire-types that we currently need; this is not intended + * to be a general-purpose protobuf reader. + * + * Since the values we parse are generally small and not very nested, it's public + * interface does not enforce the same low-allocation philosophy that ProtobufWriter does. + * If this is needed in the future, we should refactor this to fit the use-case. + */ + var ProtobufReader = class { + pos = 0; + _buf; + _textDecoder; + constructor(buf) { + this._buf = buf; + this._textDecoder = new TextDecoder(); + } + isAtEnd() { + return this.pos >= this._buf.length; + } + /** Read a varint and decode it as a tag, returning field number and wire type. */ + readTag() { + const raw = this.readVarint(); + return { + fieldNumber: raw >>> 3, + wireType: raw & 7 + }; } /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same carrier key, the propagator later in the list - * will "win". - * - * @param context Context to inject - * @param carrier Carrier into which context will be injected - */ - inject(context$1, carrier, setter) { - for (const propagator of this._propagators) try { - propagator.inject(context$1, carrier, setter); - } catch (err) { - api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); + * Read a base-128 varint. + * Returns a JS `number`; precision above 2^53 is silently lost. + * Throws if the buffer is truncated mid-varint. + */ + readVarint() { + let result = 0; + let shift = 0; + let terminated = false; + while (this.pos < this._buf.length) { + const b = this._buf[this.pos++]; + result += (b & 127) * Math.pow(2, shift); + shift += 7; + if ((b & 128) === 0) { + terminated = true; + break; + } } + if (!terminated) throw new Error("Truncated buffer: unexpected end of data while reading varint"); + return result; + } + /** Read a length-delimited byte sequence (bytes field or embedded message). */ + readBytes() { + const len = this.readVarint(); + if (this.pos + len > this._buf.length) throw new Error(`Truncated buffer: expected ${len} bytes at position ${this.pos}, but only ${this._buf.length - this.pos} available`); + const slice = this._buf.subarray(this.pos, this.pos + len); + this.pos += len; + return slice; + } + /** Read a length-delimited UTF-8 string. */ + readString() { + return this._textDecoder.decode(this.readBytes()); } /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same context key, the propagator later in the list - * will "win". + * Skip an unknown field. + * Handles wire types 0 (varint), 1 (64-bit), 2 (length-delimited), + * and 5 (32-bit). * - * @param context Context to add values to - * @param carrier Carrier from which to extract context + * Wire types 3 and 4 (start-group / end-group) are deprecated in proto3 + * and are not used by any OpenTelemetry proto definition. Encountering + * them is treated as an error. */ - extract(context$1, carrier, getter) { - return this._propagators.reduce((ctx, propagator) => { - try { - return propagator.extract(ctx, carrier, getter); - } catch (err) { - api_1.diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`); - } - return ctx; - }, context$1); - } - fields() { - return this._fields.slice(); + skip(wireType) { + switch (wireType) { + case 0: + this.readVarint(); + break; + case 1: + this.pos += 8; + break; + case 2: + this.readBytes(); + break; + case 5: + this.pos += 4; + break; + default: throw new Error(`Unknown wire type ${wireType}, cannot safely skip`); + } } }; - exports.CompositePropagator = CompositePropagator; + exports.ProtobufReader = ProtobufReader; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/validators.js -var require_validators = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/response-deserializer.js +var require_response_deserializer$2 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.validateValue = exports.validateKey = void 0; - const VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]"; - const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; - const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; - const VALID_KEY_REGEX = /* @__PURE__ */ new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); - const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; - const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + exports.deserializeExportLogsServiceResponse = void 0; + const protobuf_reader_1 = require_protobuf_reader(); /** - * Key is opaque string up to 256 characters printable. It MUST begin with a - * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, - * underscores _, dashes -, asterisks *, and forward slashes /. - * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the - * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. - * see https://www.w3.org/TR/trace-context/#key + * Parse an ExportLogsPartialSuccess embedded message from raw bytes. + * + * Field map (opentelemetry/proto/collector/logs/v1/logs_service.proto): + * 1 rejected_log_records int64 (varint) + * 2 error_message string (length-delimited) */ - function validateKey(key) { - return VALID_KEY_REGEX.test(key); + function deserializePartialSuccess(data) { + const reader = new protobuf_reader_1.ProtobufReader(data); + const result = {}; + while (!reader.isAtEnd()) { + const { fieldNumber, wireType } = reader.readTag(); + switch (fieldNumber) { + case 1: + if (wireType === 0) result.rejectedLogRecords = reader.readVarint(); + else reader.skip(wireType); + break; + case 2: + if (wireType === 2) result.errorMessage = reader.readString(); + else reader.skip(wireType); + break; + default: reader.skip(wireType); + } + } + return result; } - exports.validateKey = validateKey; /** - * Value is opaque string up to 256 characters printable ASCII RFC0020 - * characters (i.e., the range 0x20 to 0x7E) except comma , and =. + * Parse an ExportLogsServiceResponse protobuf message from raw bytes. + * + * Field map (opentelemetry/proto/collector/logs/v1/logs_service.proto): + * 1 partial_success ExportLogsPartialSuccess (length-delimited) */ - function validateValue(value) { - return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + function deserializeExportLogsServiceResponse(data) { + const reader = new protobuf_reader_1.ProtobufReader(data); + const result = {}; + while (!reader.isAtEnd()) { + const { fieldNumber, wireType } = reader.readTag(); + switch (fieldNumber) { + case 1: + if (wireType === 2) result.partialSuccess = deserializePartialSuccess(reader.readBytes()); + else reader.skip(wireType); + break; + default: reader.skip(wireType); + } + } + return result; } - exports.validateValue = validateValue; + exports.deserializeExportLogsServiceResponse = deserializeExportLogsServiceResponse; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/TraceState.js -var require_TraceState = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs.js +var require_logs$1 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.TraceState = void 0; - const validators_1 = require_validators(); - const MAX_TRACE_STATE_ITEMS = 32; - const MAX_TRACE_STATE_LEN = 512; - const LIST_MEMBERS_SEPARATOR = ","; - const LIST_MEMBER_KEY_VALUE_SPLITTER = "="; - /** - * TraceState must be a class and not a simple object type because of the spec - * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). - * - * Here is the list of allowed mutations: - * - New key-value pair should be added into the beginning of the list - * - The value of any key can be updated. Modified keys MUST be moved to the - * beginning of the list. - */ - var TraceState = class TraceState { - _internalState = /* @__PURE__ */ new Map(); - constructor(rawTraceState) { - if (rawTraceState) this._parse(rawTraceState); - } - set(key, value) { - const traceState = this._clone(); - if (traceState._internalState.has(key)) traceState._internalState.delete(key); - traceState._internalState.set(key, value); - return traceState; - } - unset(key) { - const traceState = this._clone(); - traceState._internalState.delete(key); - return traceState; - } - get(key) { - return this._internalState.get(key); - } - serialize() { - return this._keys().reduce((agg, key) => { - agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); - return agg; - }, []).join(LIST_MEMBERS_SEPARATOR); - } - _parse(rawTraceState) { - if (rawTraceState.length > MAX_TRACE_STATE_LEN) return; - this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((agg, part) => { - const listMember = part.trim(); - const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); - if (i !== -1) { - const key = listMember.slice(0, i); - const value = listMember.slice(i + 1, part.length); - if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) agg.set(key, value); - } - return agg; - }, /* @__PURE__ */ new Map()); - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS)); - } - _keys() { - return Array.from(this._internalState.keys()).reverse(); - } - _clone() { - const traceState = new TraceState(); - traceState._internalState = new Map(this._internalState); - return traceState; + exports.ProtobufLogsSerializer = void 0; + const logs_serializer_1 = require_logs_serializer(); + const response_deserializer_1 = require_response_deserializer$2(); + exports.ProtobufLogsSerializer = { + serializeRequest: (arg) => { + return (0, logs_serializer_1.serializeLogsExportRequest)(arg); + }, + deserializeResponse: (arg) => { + return (0, response_deserializer_1.deserializeExportLogsServiceResponse)(arg); } }; - exports.TraceState = TraceState; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js -var require_W3CTraceContextPropagator = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/index.js +var require_protobuf$2 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing(); - const TraceState_1 = require_TraceState(); - exports.TRACE_PARENT_HEADER = "traceparent"; - exports.TRACE_STATE_HEADER = "tracestate"; - const VERSION = "00"; - const TRACE_PARENT_REGEX = /* @__PURE__ */ new RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`); - /** - * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} - * @param traceParent - A meta property that comes from server. - * It should be dynamically generated server side to have the server's request trace Id, - * a parent span Id that was set on the server's request span, - * and the trace flags to indicate the server's sampling decision - * (01 = sampled, 00 = not sampled). - * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' - * For more information see {@link https://www.w3.org/TR/trace-context/} - */ - function parseTraceParent(traceParent) { - const match = TRACE_PARENT_REGEX.exec(traceParent); - if (!match) return null; - if (match[1] === "00" && match[5]) return null; - return { - traceId: match[2], - spanId: match[3], - traceFlags: parseInt(match[4], 16) - }; - } - exports.parseTraceParent = parseTraceParent; - /** - * Propagates {@link SpanContext} through Trace Context format propagation. - * - * Based on the Trace Context specification: - * https://www.w3.org/TR/trace-context/ - */ - var W3CTraceContextPropagator = class { - inject(context$1, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context$1); - if (!spanContext || (0, suppress_tracing_1.isTracingSuppressed)(context$1) || !(0, api_1.isSpanContextValid)(spanContext)) return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } - extract(context$1, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) return context$1; - const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader; - if (typeof traceParent !== "string") return context$1; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) return context$1; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === "string" ? state : void 0); - } - return api_1.trace.setSpanContext(context$1, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + exports.ProtobufLogsSerializer = void 0; + var logs_1 = require_logs$1(); + Object.defineProperty(exports, "ProtobufLogsSerializer", { + enumerable: true, + get: function() { + return logs_1.ProtobufLogsSerializer; } - }; - exports.W3CTraceContextPropagator = W3CTraceContextPropagator; + }); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js -var require_rpc_metadata = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationTemporality.js +var require_AggregationTemporality = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; - const RPC_METADATA_KEY = (0, (init_esm$2(), __toCommonJS(esm_exports$2)).createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"); - (function(RPCType) { - RPCType["HTTP"] = "http"; - })(exports.RPCType || (exports.RPCType = {})); - function setRPCMetadata(context$1, meta$2) { - return context$1.setValue(RPC_METADATA_KEY, meta$2); - } - exports.setRPCMetadata = setRPCMetadata; - function deleteRPCMetadata(context$1) { - return context$1.deleteValue(RPC_METADATA_KEY); - } - exports.deleteRPCMetadata = deleteRPCMetadata; - function getRPCMetadata(context$1) { - return context$1.getValue(RPC_METADATA_KEY); - } - exports.getRPCMetadata = getRPCMetadata; + exports.AggregationTemporality = void 0; + /** + * AggregationTemporality indicates the way additive quantities are expressed. + */ + var AggregationTemporality; + (function(AggregationTemporality) { + AggregationTemporality[AggregationTemporality["DELTA"] = 0] = "DELTA"; + AggregationTemporality[AggregationTemporality["CUMULATIVE"] = 1] = "CUMULATIVE"; + })(AggregationTemporality || (exports.AggregationTemporality = AggregationTemporality = {})); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js -var require_lodash_merge = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricData.js +var require_MetricData = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.isPlainObject = void 0; - /** - * based on lodash in order to support esm builds without esModuleInterop. - * lodash is using MIT License. - **/ - const objectTag = "[object Object]"; - const nullTag = "[object Null]"; - const undefinedTag = "[object Undefined]"; - const funcToString = Function.prototype.toString; - const objectCtorString = funcToString.call(Object); - const getPrototypeOf = Object.getPrototypeOf; - const objectProto = Object.prototype; - const hasOwnProperty = objectProto.hasOwnProperty; - const symToStringTag = Symbol ? Symbol.toStringTag : void 0; - const nativeObjectToString = objectProto.toString; + exports.DataPointType = exports.InstrumentType = void 0; /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true + * Supported types of metric instruments. */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) !== objectTag) return false; - const proto = getPrototypeOf(value); - if (proto === null) return true; - const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; - } - exports.isPlainObject = isPlainObject; + var InstrumentType; + (function(InstrumentType) { + InstrumentType["COUNTER"] = "COUNTER"; + InstrumentType["GAUGE"] = "GAUGE"; + InstrumentType["HISTOGRAM"] = "HISTOGRAM"; + InstrumentType["UP_DOWN_COUNTER"] = "UP_DOWN_COUNTER"; + InstrumentType["OBSERVABLE_COUNTER"] = "OBSERVABLE_COUNTER"; + InstrumentType["OBSERVABLE_GAUGE"] = "OBSERVABLE_GAUGE"; + InstrumentType["OBSERVABLE_UP_DOWN_COUNTER"] = "OBSERVABLE_UP_DOWN_COUNTER"; + })(InstrumentType || (exports.InstrumentType = InstrumentType = {})); /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == "object"; - } - /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * The aggregated point data type. */ - function baseGetTag(value) { - if (value == null) return value === void 0 ? undefinedTag : nullTag; - return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); - } - /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ - function getRawTag(value) { - const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; - let unmasked = false; - try { - value[symToStringTag] = void 0; - unmasked = true; - } catch {} - const result = nativeObjectToString.call(value); - if (unmasked) if (isOwn) value[symToStringTag] = tag; - else delete value[symToStringTag]; - return result; - } - /** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ - function objectToString(value) { - return nativeObjectToString.call(value); - } + var DataPointType; + (function(DataPointType) { + /** + * A histogram data point contains a histogram statistics of collected + * values with a list of explicit bucket boundaries and statistics such + * as min, max, count, and sum of all collected values. + */ + DataPointType[DataPointType["HISTOGRAM"] = 0] = "HISTOGRAM"; + /** + * An exponential histogram data point contains a histogram statistics of + * collected values where bucket boundaries are automatically calculated + * using an exponential function, and statistics such as min, max, count, + * and sum of all collected values. + */ + DataPointType[DataPointType["EXPONENTIAL_HISTOGRAM"] = 1] = "EXPONENTIAL_HISTOGRAM"; + /** + * A gauge metric data point has only a single numeric value. + */ + DataPointType[DataPointType["GAUGE"] = 2] = "GAUGE"; + /** + * A sum metric data point has a single numeric value and a + * monotonicity-indicator. + */ + DataPointType[DataPointType["SUM"] = 3] = "SUM"; + })(DataPointType || (exports.DataPointType = DataPointType = {})); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/merge.js -var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/utils.js +var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.merge = void 0; - const lodash_merge_1 = require_lodash_merge(); - const MAX_LEVEL = 20; - /** - * Merges objects together - * @param args - objects / values to be merged - */ - function merge(...args) { - let result = args.shift(); - const objects = /* @__PURE__ */ new WeakMap(); - while (args.length > 0) result = mergeTwoObjects(result, args.shift(), 0, objects); - return result; - } - exports.merge = merge; - function takeValue(value) { - if (isArray(value)) return value.slice(); - return value; - } + exports.equalsCaseInsensitive = exports.binarySearchUB = exports.setEquals = exports.callWithTimeout = exports.TimeoutError = exports.instrumentationScopeId = exports.hashAttributes = void 0; /** - * Merges two objects - * @param one - first object - * @param two - second object - * @param level - current deep level - * @param objects - objects holder that has been already referenced - to prevent - * cyclic dependency + * Converting the unordered attributes into unique identifier string. + * @param attributes user provided unordered Attributes. */ - function mergeTwoObjects(one, two, level = 0, objects) { - let result; - if (level > MAX_LEVEL) return; - level++; - if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) result = takeValue(two); - else if (isArray(one)) { - result = one.slice(); - if (isArray(two)) for (let i = 0, j = two.length; i < j; i++) result.push(takeValue(two[i])); - else if (isObject(two)) { - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - result[key] = takeValue(two[key]); - } - } - } else if (isObject(one)) if (isObject(two)) { - if (!shouldMerge(one, two)) return two; - result = Object.assign({}, one); - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - const twoValue = two[key]; - if (isPrimitive(twoValue)) if (typeof twoValue === "undefined") delete result[key]; - else result[key] = twoValue; - else { - const obj1 = result[key]; - const obj2 = twoValue; - if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) delete result[key]; - else { - if (isObject(obj1) && isObject(obj2)) { - const arr1 = objects.get(obj1) || []; - const arr2 = objects.get(obj2) || []; - arr1.push({ - obj: one, - key - }); - arr2.push({ - obj: two, - key - }); - objects.set(obj1, arr1); - objects.set(obj2, arr2); - } - result[key] = mergeTwoObjects(result[key], twoValue, level, objects); - } - } - } - } else result = two; - return result; + function hashAttributes(attributes) { + let keys = Object.keys(attributes); + if (keys.length === 0) return ""; + keys = keys.sort(); + return JSON.stringify(keys.map((key) => [key, attributes[key]])); } + exports.hashAttributes = hashAttributes; /** - * Function to check if object has been already reference - * @param obj - * @param key - * @param objects + * Converting the instrumentation scope object to a unique identifier string. + * @param instrumentationScope */ - function wasObjectReferenced(obj, key, objects) { - const arr = objects.get(obj[key]) || []; - for (let i = 0, j = arr.length; i < j; i++) { - const info = arr[i]; - if (info.key === key && info.obj === obj) return true; - } - return false; - } - function isArray(value) { - return Array.isArray(value); - } - function isFunction(value) { - return typeof value === "function"; - } - function isObject(value) { - return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object"; - } - function isPrimitive(value) { - return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null; - } - function shouldMerge(one, two) { - if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) return false; - return true; + function instrumentationScopeId(instrumentationScope) { + return `${instrumentationScope.name}:${instrumentationScope.version ?? ""}:${instrumentationScope.schemaUrl ?? ""}`; } -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/timeout.js -var require_timeout = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.callWithTimeout = exports.TimeoutError = void 0; + exports.instrumentationScopeId = instrumentationScopeId; /** * Error that is thrown on timeouts. */ @@ -20723,23346 +21017,7650 @@ var require_timeout = /* @__PURE__ */ __commonJSMin(((exports) => { }); } exports.callWithTimeout = callWithTimeout; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/url.js -var require_url = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isUrlIgnored = exports.urlMatches = void 0; - function urlMatches(url, urlToMatch) { - if (typeof urlToMatch === "string") return url === urlToMatch; - else return !!url.match(urlToMatch); + function setEquals(lhs, rhs) { + if (lhs.size !== rhs.size) return false; + for (const item of lhs) if (!rhs.has(item)) return false; + return true; } - exports.urlMatches = urlMatches; + exports.setEquals = setEquals; /** - * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} - * @param url - * @param ignoredUrls + * Binary search the sorted array to the find upper bound for the value. + * @param arr + * @param value + * @returns */ - function isUrlIgnored(url, ignoredUrls) { - if (!ignoredUrls) return false; - for (const ignoreUrl of ignoredUrls) if (urlMatches(url, ignoreUrl)) return true; - return false; - } - exports.isUrlIgnored = isUrlIgnored; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/promise.js -var require_promise = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Deferred = void 0; - var Deferred = class { - _promise; - _resolve; - _reject; - constructor() { - this._promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - }); - } - get promise() { - return this._promise; - } - resolve(val) { - this._resolve(val); - } - reject(err) { - this._reject(err); + function binarySearchUB(arr, value) { + let lo = 0; + let hi = arr.length - 1; + let ret = arr.length; + while (hi >= lo) { + const mid = lo + Math.trunc((hi - lo) / 2); + if (arr[mid] < value) lo = mid + 1; + else { + ret = mid; + hi = mid - 1; + } } - }; - exports.Deferred = Deferred; + return ret; + } + exports.binarySearchUB = binarySearchUB; + function equalsCaseInsensitive(lhs, rhs) { + return lhs.toLowerCase() === rhs.toLowerCase(); + } + exports.equalsCaseInsensitive = equalsCaseInsensitive; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/callback.js -var require_callback = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/types.js +var require_types$1 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.BindOnceFuture = void 0; - const promise_1 = require_promise(); - /** - * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. - */ - var BindOnceFuture = class { - _callback; - _that; - _isCalled = false; - _deferred = new promise_1.Deferred(); - constructor(_callback, _that) { - this._callback = _callback; - this._that = _that; - } - get isCalled() { - return this._isCalled; - } - get promise() { - return this._deferred.promise; - } - call(...args) { - if (!this._isCalled) { - this._isCalled = true; - try { - Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err)); - } catch (err) { - this._deferred.reject(err); - } - } - return this._deferred.promise; - } - }; - exports.BindOnceFuture = BindOnceFuture; + exports.AggregatorKind = void 0; + /** The kind of aggregator. */ + var AggregatorKind; + (function(AggregatorKind) { + AggregatorKind[AggregatorKind["DROP"] = 0] = "DROP"; + AggregatorKind[AggregatorKind["SUM"] = 1] = "SUM"; + AggregatorKind[AggregatorKind["LAST_VALUE"] = 2] = "LAST_VALUE"; + AggregatorKind[AggregatorKind["HISTOGRAM"] = 3] = "HISTOGRAM"; + AggregatorKind[AggregatorKind["EXPONENTIAL_HISTOGRAM"] = 4] = "EXPONENTIAL_HISTOGRAM"; + })(AggregatorKind || (exports.AggregatorKind = AggregatorKind = {})); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/utils/configuration.js -var require_configuration = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Drop.js +var require_Drop = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.diagLogLevelFromString = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const logLevelMap = { - ALL: api_1.DiagLogLevel.ALL, - VERBOSE: api_1.DiagLogLevel.VERBOSE, - DEBUG: api_1.DiagLogLevel.DEBUG, - INFO: api_1.DiagLogLevel.INFO, - WARN: api_1.DiagLogLevel.WARN, - ERROR: api_1.DiagLogLevel.ERROR, - NONE: api_1.DiagLogLevel.NONE + exports.DropAggregator = void 0; + const types_1 = require_types$1(); + /** Basic aggregator for None which keeps no recorded value. */ + var DropAggregator = class { + kind = types_1.AggregatorKind.DROP; + createAccumulation() {} + merge(_previous, _delta) {} + diff(_previous, _current) {} + toMetricData(_descriptor, _aggregationTemporality, _accumulationByAttributes, _endTime) {} }; - /** - * Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined. - * @param value - */ - function diagLogLevelFromString(value) { - if (value == null) return; - const resolvedLogLevel = logLevelMap[value.toUpperCase()]; - if (resolvedLogLevel == null) { - api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); - return api_1.DiagLogLevel.INFO; - } - return resolvedLogLevel; - } - exports.diagLogLevelFromString = diagLogLevelFromString; + exports.DropAggregator = DropAggregator; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/internal/exporter.js -var require_exporter = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Histogram.js +var require_Histogram = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports._export = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const suppress_tracing_1 = require_suppress_tracing(); - /** - * @internal - * Shared functionality used by Exporters while exporting data, including suppression of Traces. - */ - function _export(exporter, arg) { - return new Promise((resolve) => { - api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { - exporter.export(arg, (result) => { - resolve(result); - }); - }); - }); + exports.HistogramAggregator = exports.HistogramAccumulation = void 0; + const types_1 = require_types$1(); + const MetricData_1 = require_MetricData(); + const utils_1 = require_utils$3(); + function createNewEmptyCheckpoint(boundaries) { + const counts = boundaries.map(() => 0); + counts.push(0); + return { + buckets: { + boundaries, + counts + }, + sum: 0, + count: 0, + hasMinMax: false, + min: Infinity, + max: -Infinity + }; } - exports._export = _export; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+core@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/index.js -var require_src$8 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.internal = exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.unrefTimer = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; - var W3CBaggagePropagator_1 = require_W3CBaggagePropagator(); - Object.defineProperty(exports, "W3CBaggagePropagator", { - enumerable: true, - get: function() { - return W3CBaggagePropagator_1.W3CBaggagePropagator; + var HistogramAccumulation = class { + startTime; + _boundaries; + _recordMinMax; + _current; + constructor(startTime, boundaries, recordMinMax = true, current = createNewEmptyCheckpoint(boundaries)) { + this.startTime = startTime; + this._boundaries = boundaries; + this._recordMinMax = recordMinMax; + this._current = current; } - }); - var anchored_clock_1 = require_anchored_clock(); - Object.defineProperty(exports, "AnchoredClock", { - enumerable: true, - get: function() { - return anchored_clock_1.AnchoredClock; + record(value) { + if (Number.isNaN(value)) return; + this._current.count += 1; + this._current.sum += value; + if (this._recordMinMax) { + this._current.min = Math.min(value, this._current.min); + this._current.max = Math.max(value, this._current.max); + this._current.hasMinMax = true; + } + const idx = (0, utils_1.binarySearchUB)(this._boundaries, value); + this._current.buckets.counts[idx] += 1; } - }); - var attributes_1 = require_attributes(); - Object.defineProperty(exports, "isAttributeValue", { - enumerable: true, - get: function() { - return attributes_1.isAttributeValue; + setStartTime(startTime) { + this.startTime = startTime; } - }); - Object.defineProperty(exports, "sanitizeAttributes", { - enumerable: true, - get: function() { - return attributes_1.sanitizeAttributes; + toPointValue() { + return this._current; } - }); - var global_error_handler_1 = require_global_error_handler(); - Object.defineProperty(exports, "globalErrorHandler", { - enumerable: true, - get: function() { - return global_error_handler_1.globalErrorHandler; + }; + exports.HistogramAccumulation = HistogramAccumulation; + /** + * Basic aggregator which observes events and counts them in pre-defined buckets + * and provides the total sum and count of all observations. + */ + var HistogramAggregator = class { + kind = types_1.AggregatorKind.HISTOGRAM; + _boundaries; + _recordMinMax; + /** + * @param _boundaries sorted upper bounds of recorded values. + * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. + */ + constructor(boundaries, recordMinMax) { + this._boundaries = boundaries; + this._recordMinMax = recordMinMax; } - }); - Object.defineProperty(exports, "setGlobalErrorHandler", { - enumerable: true, - get: function() { - return global_error_handler_1.setGlobalErrorHandler; + createAccumulation(startTime) { + return new HistogramAccumulation(startTime, this._boundaries, this._recordMinMax); } - }); - var logging_error_handler_1 = require_logging_error_handler(); - Object.defineProperty(exports, "loggingErrorHandler", { - enumerable: true, - get: function() { - return logging_error_handler_1.loggingErrorHandler; + /** + * Return the result of the merge of two histogram accumulations. As long as one Aggregator + * instance produces all Accumulations with constant boundaries we don't need to worry about + * merging accumulations with different boundaries. + */ + merge(previous, delta) { + const previousValue = previous.toPointValue(); + const deltaValue = delta.toPointValue(); + const previousCounts = previousValue.buckets.counts; + const deltaCounts = deltaValue.buckets.counts; + const mergedCounts = new Array(previousCounts.length); + for (let idx = 0; idx < previousCounts.length; idx++) mergedCounts[idx] = previousCounts[idx] + deltaCounts[idx]; + let min = Infinity; + let max = -Infinity; + if (this._recordMinMax) { + if (previousValue.hasMinMax && deltaValue.hasMinMax) { + min = Math.min(previousValue.min, deltaValue.min); + max = Math.max(previousValue.max, deltaValue.max); + } else if (previousValue.hasMinMax) { + min = previousValue.min; + max = previousValue.max; + } else if (deltaValue.hasMinMax) { + min = deltaValue.min; + max = deltaValue.max; + } + } + return new HistogramAccumulation(previous.startTime, previousValue.buckets.boundaries, this._recordMinMax, { + buckets: { + boundaries: previousValue.buckets.boundaries, + counts: mergedCounts + }, + count: previousValue.count + deltaValue.count, + sum: previousValue.sum + deltaValue.sum, + hasMinMax: this._recordMinMax && (previousValue.hasMinMax || deltaValue.hasMinMax), + min, + max + }); } - }); - var time_1 = require_time(); - Object.defineProperty(exports, "addHrTimes", { - enumerable: true, - get: function() { - return time_1.addHrTimes; + /** + * Returns a new DELTA aggregation by comparing two cumulative measurements. + */ + diff(previous, current) { + const previousValue = previous.toPointValue(); + const currentValue = current.toPointValue(); + const previousCounts = previousValue.buckets.counts; + const currentCounts = currentValue.buckets.counts; + const diffedCounts = new Array(previousCounts.length); + for (let idx = 0; idx < previousCounts.length; idx++) diffedCounts[idx] = currentCounts[idx] - previousCounts[idx]; + return new HistogramAccumulation(current.startTime, previousValue.buckets.boundaries, this._recordMinMax, { + buckets: { + boundaries: previousValue.buckets.boundaries, + counts: diffedCounts + }, + count: currentValue.count - previousValue.count, + sum: currentValue.sum - previousValue.sum, + hasMinMax: false, + min: Infinity, + max: -Infinity + }); } - }); - Object.defineProperty(exports, "getTimeOrigin", { - enumerable: true, - get: function() { - return time_1.getTimeOrigin; + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.HISTOGRAM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + const pointValue = accumulation.toPointValue(); + const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: { + min: pointValue.hasMinMax ? pointValue.min : void 0, + max: pointValue.hasMinMax ? pointValue.max : void 0, + sum: !allowsNegativeValues ? pointValue.sum : void 0, + buckets: pointValue.buckets, + count: pointValue.count + } + }; + }) + }; } - }); - Object.defineProperty(exports, "hrTime", { - enumerable: true, - get: function() { - return time_1.hrTime; + }; + exports.HistogramAggregator = HistogramAggregator; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/Buckets.js +var require_Buckets = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Buckets = void 0; + var Buckets = class Buckets { + backing; + indexBase; + indexStart; + indexEnd; + /** + * The term index refers to the number of the exponential histogram bucket + * used to determine its boundaries. The lower boundary of a bucket is + * determined by base ** index and the upper boundary of a bucket is + * determined by base ** (index + 1). index values are signed to account + * for values less than or equal to 1. + * + * indexBase is the index of the 0th position in the + * backing array, i.e., backing[0] is the count + * in the bucket with index `indexBase`. + * + * indexStart is the smallest index value represented + * in the backing array. + * + * indexEnd is the largest index value represented in + * the backing array. + */ + constructor(backing = new BucketsBacking(), indexBase = 0, indexStart = 0, indexEnd = 0) { + this.backing = backing; + this.indexBase = indexBase; + this.indexStart = indexStart; + this.indexEnd = indexEnd; } - }); - Object.defineProperty(exports, "hrTimeDuration", { - enumerable: true, - get: function() { - return time_1.hrTimeDuration; + /** + * Offset is the bucket index of the smallest entry in the counts array + * @returns {number} + */ + get offset() { + return this.indexStart; } - }); - Object.defineProperty(exports, "hrTimeToMicroseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToMicroseconds; + /** + * Buckets is a view into the backing array. + * @returns {number} + */ + get length() { + if (this.backing.length === 0) return 0; + if (this.indexEnd === this.indexStart && this.at(0) === 0) return 0; + return this.indexEnd - this.indexStart + 1; } - }); - Object.defineProperty(exports, "hrTimeToMilliseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToMilliseconds; + /** + * An array of counts, where count[i] carries the count + * of the bucket at index (offset+i). count[i] is the count of + * values greater than base^(offset+i) and less than or equal to + * base^(offset+i+1). + * @returns {number} The logical counts based on the backing array + */ + counts() { + return Array.from({ length: this.length }, (_, i) => this.at(i)); } - }); - Object.defineProperty(exports, "hrTimeToNanoseconds", { - enumerable: true, - get: function() { - return time_1.hrTimeToNanoseconds; + /** + * At returns the count of the bucket at a position in the logical + * array of counts. + * @param position + * @returns {number} + */ + at(position) { + const bias = this.indexBase - this.indexStart; + if (position < bias) position += this.backing.length; + position -= bias; + return this.backing.countAt(position); } - }); - Object.defineProperty(exports, "hrTimeToTimeStamp", { - enumerable: true, - get: function() { - return time_1.hrTimeToTimeStamp; + /** + * incrementBucket increments the backing array index by `increment` + * @param bucketIndex + * @param increment + */ + incrementBucket(bucketIndex, increment) { + this.backing.increment(bucketIndex, increment); } - }); - Object.defineProperty(exports, "isTimeInput", { - enumerable: true, - get: function() { - return time_1.isTimeInput; + /** + * decrementBucket decrements the backing array index by `decrement` + * if decrement is greater than the current value, it's set to 0. + * @param bucketIndex + * @param decrement + */ + decrementBucket(bucketIndex, decrement) { + this.backing.decrement(bucketIndex, decrement); } - }); - Object.defineProperty(exports, "isTimeInputHrTime", { - enumerable: true, - get: function() { - return time_1.isTimeInputHrTime; + /** + * trim removes leading and / or trailing zero buckets (which can occur + * after diffing two histos) and rotates the backing array so that the + * smallest non-zero index is in the 0th position of the backing array + */ + trim() { + for (let i = 0; i < this.length; i++) if (this.at(i) !== 0) { + this.indexStart += i; + break; + } else if (i === this.length - 1) { + this.indexStart = this.indexEnd = this.indexBase = 0; + return; + } + for (let i = this.length - 1; i >= 0; i--) if (this.at(i) !== 0) { + this.indexEnd -= this.length - i - 1; + break; + } + this._rotate(); } - }); - Object.defineProperty(exports, "millisToHrTime", { - enumerable: true, - get: function() { - return time_1.millisToHrTime; + /** + * downscale first rotates, then collapses 2**`by`-to-1 buckets. + * @param by + */ + downscale(by) { + this._rotate(); + const size = 1 + this.indexEnd - this.indexStart; + const each = 1 << by; + let inpos = 0; + let outpos = 0; + for (let pos = this.indexStart; pos <= this.indexEnd;) { + let mod = pos % each; + if (mod < 0) mod += each; + for (let i = mod; i < each && inpos < size; i++) { + this._relocateBucket(outpos, inpos); + inpos++; + pos++; + } + outpos++; + } + this.indexStart >>= by; + this.indexEnd >>= by; + this.indexBase = this.indexStart; } - }); - Object.defineProperty(exports, "timeInputToHrTime", { - enumerable: true, - get: function() { - return time_1.timeInputToHrTime; + /** + * Clone returns a deep copy of Buckets + * @returns {Buckets} + */ + clone() { + return new Buckets(this.backing.clone(), this.indexBase, this.indexStart, this.indexEnd); } - }); - var ExportResult_1 = require_ExportResult(); - Object.defineProperty(exports, "ExportResultCode", { - enumerable: true, - get: function() { - return ExportResult_1.ExportResultCode; + /** + * _rotate shifts the backing array contents so that indexStart == + * indexBase to simplify the downscale logic. + */ + _rotate() { + const bias = this.indexBase - this.indexStart; + if (bias === 0) return; + else if (bias > 0) { + this.backing.reverse(0, this.backing.length); + this.backing.reverse(0, bias); + this.backing.reverse(bias, this.backing.length); + } else { + this.backing.reverse(0, this.backing.length); + this.backing.reverse(0, this.backing.length + bias); + } + this.indexBase = this.indexStart; } - }); - var utils_1 = require_utils$6(); - Object.defineProperty(exports, "parseKeyPairsIntoRecord", { - enumerable: true, - get: function() { - return utils_1.parseKeyPairsIntoRecord; + /** + * _relocateBucket adds the count in counts[src] to counts[dest] and + * resets count[src] to zero. + */ + _relocateBucket(dest, src) { + if (dest === src) return; + this.incrementBucket(dest, this.backing.emptyBucket(src)); } - }); - var platform_1 = require_platform$5(); - Object.defineProperty(exports, "SDK_INFO", { - enumerable: true, - get: function() { - return platform_1.SDK_INFO; + }; + exports.Buckets = Buckets; + /** + * BucketsBacking holds the raw buckets and some utility methods to + * manage them. + */ + var BucketsBacking = class BucketsBacking { + _counts; + constructor(counts = [0]) { + this._counts = counts; } - }); - Object.defineProperty(exports, "_globalThis", { - enumerable: true, - get: function() { - return platform_1._globalThis; - } - }); - Object.defineProperty(exports, "getStringFromEnv", { - enumerable: true, - get: function() { - return platform_1.getStringFromEnv; - } - }); - Object.defineProperty(exports, "getBooleanFromEnv", { - enumerable: true, - get: function() { - return platform_1.getBooleanFromEnv; - } - }); - Object.defineProperty(exports, "getNumberFromEnv", { - enumerable: true, - get: function() { - return platform_1.getNumberFromEnv; - } - }); - Object.defineProperty(exports, "getStringListFromEnv", { - enumerable: true, - get: function() { - return platform_1.getStringListFromEnv; - } - }); - Object.defineProperty(exports, "otperformance", { - enumerable: true, - get: function() { - return platform_1.otperformance; - } - }); - Object.defineProperty(exports, "unrefTimer", { - enumerable: true, - get: function() { - return platform_1.unrefTimer; - } - }); - var composite_1 = require_composite(); - Object.defineProperty(exports, "CompositePropagator", { - enumerable: true, - get: function() { - return composite_1.CompositePropagator; - } - }); - var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator(); - Object.defineProperty(exports, "TRACE_PARENT_HEADER", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.TRACE_PARENT_HEADER; - } - }); - Object.defineProperty(exports, "TRACE_STATE_HEADER", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.TRACE_STATE_HEADER; - } - }); - Object.defineProperty(exports, "W3CTraceContextPropagator", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.W3CTraceContextPropagator; - } - }); - Object.defineProperty(exports, "parseTraceParent", { - enumerable: true, - get: function() { - return W3CTraceContextPropagator_1.parseTraceParent; - } - }); - var rpc_metadata_1 = require_rpc_metadata(); - Object.defineProperty(exports, "RPCType", { - enumerable: true, - get: function() { - return rpc_metadata_1.RPCType; - } - }); - Object.defineProperty(exports, "deleteRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.deleteRPCMetadata; - } - }); - Object.defineProperty(exports, "getRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.getRPCMetadata; - } - }); - Object.defineProperty(exports, "setRPCMetadata", { - enumerable: true, - get: function() { - return rpc_metadata_1.setRPCMetadata; - } - }); - var suppress_tracing_1 = require_suppress_tracing(); - Object.defineProperty(exports, "isTracingSuppressed", { - enumerable: true, - get: function() { - return suppress_tracing_1.isTracingSuppressed; - } - }); - Object.defineProperty(exports, "suppressTracing", { - enumerable: true, - get: function() { - return suppress_tracing_1.suppressTracing; - } - }); - Object.defineProperty(exports, "unsuppressTracing", { - enumerable: true, - get: function() { - return suppress_tracing_1.unsuppressTracing; - } - }); - var TraceState_1 = require_TraceState(); - Object.defineProperty(exports, "TraceState", { - enumerable: true, - get: function() { - return TraceState_1.TraceState; + /** + * length returns the physical size of the backing array, which + * is >= buckets.length() + */ + get length() { + return this._counts.length; } - }); - var merge_1 = require_merge(); - Object.defineProperty(exports, "merge", { - enumerable: true, - get: function() { - return merge_1.merge; + /** + * countAt returns the count in a specific bucket + */ + countAt(pos) { + return this._counts[pos]; } - }); - var timeout_1 = require_timeout(); - Object.defineProperty(exports, "TimeoutError", { - enumerable: true, - get: function() { - return timeout_1.TimeoutError; + /** + * growTo grows a backing array and copies old entries + * into their correct new positions. + */ + growTo(newSize, oldPositiveLimit, newPositiveLimit) { + const tmp = new Array(newSize).fill(0); + tmp.splice(newPositiveLimit, this._counts.length - oldPositiveLimit, ...this._counts.slice(oldPositiveLimit)); + tmp.splice(0, oldPositiveLimit, ...this._counts.slice(0, oldPositiveLimit)); + this._counts = tmp; } - }); - Object.defineProperty(exports, "callWithTimeout", { - enumerable: true, - get: function() { - return timeout_1.callWithTimeout; + /** + * reverse the items in the backing array in the range [from, limit). + */ + reverse(from, limit) { + const num = Math.floor((from + limit) / 2) - from; + for (let i = 0; i < num; i++) { + const tmp = this._counts[from + i]; + this._counts[from + i] = this._counts[limit - i - 1]; + this._counts[limit - i - 1] = tmp; + } } - }); - var url_1 = require_url(); - Object.defineProperty(exports, "isUrlIgnored", { - enumerable: true, - get: function() { - return url_1.isUrlIgnored; + /** + * emptyBucket empties the count from a bucket, for + * moving into another. + */ + emptyBucket(src) { + const tmp = this._counts[src]; + this._counts[src] = 0; + return tmp; } - }); - Object.defineProperty(exports, "urlMatches", { - enumerable: true, - get: function() { - return url_1.urlMatches; + /** + * increments a bucket by `increment` + */ + increment(bucketIndex, increment) { + this._counts[bucketIndex] += increment; } - }); - var callback_1 = require_callback(); - Object.defineProperty(exports, "BindOnceFuture", { - enumerable: true, - get: function() { - return callback_1.BindOnceFuture; + /** + * decrements a bucket by `decrement` + */ + decrement(bucketIndex, decrement) { + if (this._counts[bucketIndex] >= decrement) this._counts[bucketIndex] -= decrement; + else this._counts[bucketIndex] = 0; } - }); - var configuration_1 = require_configuration(); - Object.defineProperty(exports, "diagLogLevelFromString", { - enumerable: true, - get: function() { - return configuration_1.diagLogLevelFromString; + /** + * clone returns a deep copy of BucketsBacking + */ + clone() { + return new BucketsBacking([...this._counts]); } - }); - const exporter_1 = require_exporter(); - exports.internal = { _export: exporter_1._export }; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js -function isPartialSuccessResponse(response) { - return Object.prototype.hasOwnProperty.call(response, "partialSuccess"); -} -/** -* Default response handler that logs a partial success to the console. -*/ -function createLoggingPartialSuccessResponseHandler() { - return { handleResponse(response) { - if (response == null || !isPartialSuccessResponse(response) || response.partialSuccess == null || Object.keys(response.partialSuccess).length === 0) return; - diag.warn("Received Partial Success response:", JSON.stringify(response.partialSuccess)); - } }; -} -var init_logging_response_handler = __esmMin((() => { - init_esm$2(); + }; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js -/** -* Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all -* signals. -*/ -function createOtlpExportDelegate(components, settings) { - return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout); -} -var import_src$5, OTLPExportDelegate; -var init_otlp_export_delegate = __esmMin((() => { - import_src$5 = require_src$8(); - init_types(); - init_logging_response_handler(); - init_esm$2(); - OTLPExportDelegate = class { - _transport; - _serializer; - _responseHandler; - _promiseQueue; - _timeout; - _diagLogger; - constructor(_transport, _serializer, _responseHandler, _promiseQueue, _timeout) { - this._transport = _transport; - this._serializer = _serializer; - this._responseHandler = _responseHandler; - this._promiseQueue = _promiseQueue; - this._timeout = _timeout; - this._diagLogger = diag.createComponentLogger({ namespace: "OTLPExportDelegate" }); - } - export(internalRepresentation, resultCallback) { - this._diagLogger.debug("items to be sent", internalRepresentation); - if (this._promiseQueue.hasReachedLimit()) { - resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: /* @__PURE__ */ new Error("Concurrent export limit reached") - }); - return; - } - const serializedRequest = this._serializer.serializeRequest(internalRepresentation); - if (serializedRequest == null) { - resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: /* @__PURE__ */ new Error("Nothing to send") - }); - return; - } - this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => { - if (response.status === "success") { - if (response.data != null) try { - this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data)); - } catch (e) { - this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e, response.data); - } - resultCallback({ code: import_src$5.ExportResultCode.SUCCESS }); - return; - } else if (response.status === "failure" && response.error) { - resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: response.error - }); - return; - } else if (response.status === "retryable") resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: new OTLPExporterError("Export failed with retryable status") - }); - else resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: new OTLPExporterError("Export failed with unknown error") - }); - }, (reason) => resultCallback({ - code: import_src$5.ExportResultCode.FAILED, - error: reason - }))); - } - forceFlush() { - return this._promiseQueue.awaitAll(); - } - async shutdown() { - this._diagLogger.debug("shutdown started"); - await this.forceFlush(); - this._transport.shutdown(); - } - }; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js -function createOtlpNetworkExportDelegate(options, serializer, transport) { - return createOtlpExportDelegate({ - transport, - serializer, - promiseHandler: createBoundedQueueExportPromiseHandler(options) - }, { timeout: options.timeoutMillis }); -} -var init_otlp_network_export_delegate = __esmMin((() => { - init_bounded_queue_export_promise_handler(); - init_otlp_export_delegate(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index.js -var esm_exports = /* @__PURE__ */ __exportAll({ - CompressionAlgorithm: () => CompressionAlgorithm, - OTLPExporterBase: () => OTLPExporterBase, - OTLPExporterError: () => OTLPExporterError, - createOtlpNetworkExportDelegate: () => createOtlpNetworkExportDelegate, - getSharedConfigurationDefaults: () => getSharedConfigurationDefaults, - mergeOtlpSharedConfigurationWithDefaults: () => mergeOtlpSharedConfigurationWithDefaults -}); -var init_esm = __esmMin((() => { - init_OTLPExporterBase(); - init_types(); - init_shared_configuration(); - init_legacy_node_configuration(); - init_otlp_network_export_delegate(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/version.js -var require_version$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ieee754.js +var require_ieee754 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.VERSION = void 0; - exports.VERSION = "0.205.0"; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js -var require_aspromise = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = asPromise; - /** - * Callback as used by {@link util.asPromise}. - * @typedef asPromiseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {...*} params Additional arguments - * @returns {undefined} - */ + exports.getSignificand = exports.getNormalBase2 = exports.MIN_VALUE = exports.MAX_NORMAL_EXPONENT = exports.MIN_NORMAL_EXPONENT = exports.SIGNIFICAND_WIDTH = void 0; /** - * Returns a promise from a node-style callback function. - * @memberof util - * @param {asPromiseCallback} fn Function to call - * @param {*} ctx Function context - * @param {...*} params Function arguments - * @returns {Promise<*>} Promisified function + * The functions and constants in this file allow us to interact + * with the internal representation of an IEEE 64-bit floating point + * number. We need to work with all 64-bits, thus, care needs to be + * taken when working with Javascript's bitwise operators (<<, >>, &, + * |, etc) as they truncate operands to 32-bits. In order to work around + * this we work with the 64-bits as two 32-bit halves, perform bitwise + * operations on them independently, and combine the results (if needed). */ - function asPromise(fn, ctx) { - var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true; - while (index < arguments.length) params[offset++] = arguments[index++]; - return new Promise(function executor(resolve, reject) { - params[offset] = function callback(err) { - if (pending) { - pending = false; - if (err) reject(err); - else { - var params$1 = new Array(arguments.length - 1), offset$1 = 0; - while (offset$1 < params$1.length) params$1[offset$1++] = arguments[offset$1]; - resolve.apply(null, params$1); - } - } - }; - try { - fn.apply(ctx || null, params); - } catch (err) { - if (pending) { - pending = false; - reject(err); - } - } - }); - } -})); - -//#endregion -//#region ../../node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js -var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => { + exports.SIGNIFICAND_WIDTH = 52; /** - * A minimal base64 implementation for number arrays. - * @memberof util - * @namespace + * EXPONENT_MASK is set to 1 for the hi 32-bits of an IEEE 754 + * floating point exponent: 0x7ff00000. */ - var base64 = exports; + const EXPONENT_MASK = 2146435072; /** - * Calculates the byte length of a base64 encoded string. - * @param {string} string Base64 encoded string - * @returns {number} Byte length + * SIGNIFICAND_MASK is the mask for the significand portion of the hi 32-bits + * of an IEEE 754 double-precision floating-point value: 0xfffff */ - base64.length = function length(string$2) { - var p = string$2.length; - if (!p) return 0; - var n = 0; - while (--p % 4 > 1 && string$2.charAt(p) === "=") ++n; - return Math.ceil(string$2.length * 3) / 4 - n; - }; - var b64 = new Array(64); - var s64 = new Array(123); - for (var i = 0; i < 64;) s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++; - /** - * Encodes a buffer to a base64 encoded string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} Base64 encoded string - */ - base64.encode = function encode$2(buffer, start, end) { - var parts = null, chunk = []; - var i = 0, j = 0, t; - while (start < end) { - var b = buffer[start++]; - switch (j) { - case 0: - chunk[i++] = b64[b >> 2]; - t = (b & 3) << 4; - j = 1; - break; - case 1: - chunk[i++] = b64[t | b >> 4]; - t = (b & 15) << 2; - j = 2; - break; - case 2: - chunk[i++] = b64[t | b >> 6]; - chunk[i++] = b64[b & 63]; - j = 0; - break; - } - if (i > 8191) { - (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk)); - i = 0; - } - } - if (j) { - chunk[i++] = b64[t]; - chunk[i++] = 61; - if (j === 1) chunk[i++] = 61; - } - if (parts) { - if (i) parts.push(String.fromCharCode.apply(String, chunk.slice(0, i))); - return parts.join(""); - } - return String.fromCharCode.apply(String, chunk.slice(0, i)); - }; - var invalidEncoding = "invalid encoding"; - /** - * Decodes a base64 encoded string to a buffer. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Number of bytes written - * @throws {Error} If encoding is invalid - */ - base64.decode = function decode$2(string$2, buffer, offset) { - var start = offset; - var j = 0, t; - for (var i = 0; i < string$2.length;) { - var c = string$2.charCodeAt(i++); - if (c === 61 && j > 1) break; - if ((c = s64[c]) === void 0) throw Error(invalidEncoding); - switch (j) { - case 0: - t = c; - j = 1; - break; - case 1: - buffer[offset++] = t << 2 | (c & 48) >> 4; - t = c; - j = 2; - break; - case 2: - buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2; - t = c; - j = 3; - break; - case 3: - buffer[offset++] = (t & 3) << 6 | c; - j = 0; - break; - } - } - if (j === 1) throw Error(invalidEncoding); - return offset - start; - }; + const SIGNIFICAND_MASK = 1048575; /** - * Tests if the specified string appears to be base64 encoded. - * @param {string} string String to test - * @returns {boolean} `true` if probably base64 encoded, otherwise false + * EXPONENT_BIAS is the exponent bias specified for encoding + * the IEEE 754 double-precision floating point exponent: 1023 */ - base64.test = function test(string$2) { - return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string$2); - }; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@protobufjs+eventemitter@1.1.1/node_modules/@protobufjs/eventemitter/index.js -var require_eventemitter = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = EventEmitter; + const EXPONENT_BIAS = 1023; /** - * Constructs a new event emitter instance. - * @classdesc A minimal event emitter. - * @memberof util - * @constructor + * MIN_NORMAL_EXPONENT is the minimum exponent of a normalized + * floating point: -1022. */ - function EventEmitter() { - /** - * Registered listeners. - * @type {Object.} - * @private - */ - this._listeners = Object.create(null); - } + exports.MIN_NORMAL_EXPONENT = -1022; /** - * Event listener as used by {@link util.EventEmitter}. - * @typedef EventEmitterListener - * @type {function} - * @param {...*} args Arguments - * @returns {undefined} + * MAX_NORMAL_EXPONENT is the maximum exponent of a normalized + * floating point: 1023. */ + exports.MAX_NORMAL_EXPONENT = EXPONENT_BIAS; /** - * Registers an event listener. - * @param {string} evt Event name - * @param {EventEmitterListener} fn Listener - * @param {*} [ctx] Listener context - * @returns {this} `this` + * MIN_VALUE is the smallest normal number */ - EventEmitter.prototype.on = function on(evt, fn, ctx) { - (this._listeners[evt] || (this._listeners[evt] = [])).push({ - fn, - ctx: ctx || this - }); - return this; - }; + exports.MIN_VALUE = Math.pow(2, -1022); /** - * Removes an event listener or any matching listeners if arguments are omitted. - * @param {string} [evt] Event name. Removes all listeners if omitted. - * @param {EventEmitterListener} [fn] Listener to remove. Removes all listeners of `evt` if omitted. - * @returns {this} `this` + * getNormalBase2 extracts the normalized base-2 fractional exponent. + * This returns k for the equation f x 2**k where f is + * in the range [1, 2). Note that this function is not called for + * subnormal numbers. + * @param {number} value - the value to determine normalized base-2 fractional + * exponent for + * @returns {number} the normalized base-2 exponent */ - EventEmitter.prototype.off = function off(evt, fn) { - if (evt === void 0) this._listeners = Object.create(null); - else if (fn === void 0) this._listeners[evt] = []; - else { - var listeners = this._listeners[evt]; - if (!listeners) return this; - for (var i = 0; i < listeners.length;) if (listeners[i].fn === fn) listeners.splice(i, 1); - else ++i; - } - return this; - }; + function getNormalBase2(value) { + const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8)); + dv.setFloat64(0, value); + return ((dv.getUint32(0) & EXPONENT_MASK) >> 20) - EXPONENT_BIAS; + } + exports.getNormalBase2 = getNormalBase2; /** - * Emits an event by calling its listeners with the specified arguments. - * @param {string} evt Event name - * @param {...*} args Arguments - * @returns {this} `this` + * GetSignificand returns the 52 bit (unsigned) significand as a signed value. + * @param {number} value - the floating point number to extract the significand from + * @returns {number} The 52-bit significand */ - EventEmitter.prototype.emit = function emit(evt) { - var listeners = this._listeners[evt]; - if (listeners) { - var args = [], i = 1; - for (; i < arguments.length;) args.push(arguments[i++]); - for (i = 0; i < listeners.length;) listeners[i].fn.apply(listeners[i++].ctx, args); - } - return this; - }; + function getSignificand(value) { + const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8)); + dv.setFloat64(0, value); + const hiBits = dv.getUint32(0); + const loBits = dv.getUint32(4); + return (hiBits & SIGNIFICAND_MASK) * Math.pow(2, 32) + loBits; + } + exports.getSignificand = getSignificand; })); //#endregion -//#region ../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js -var require_float = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = factory(factory); - /** - * Reads / writes floats / doubles from / to buffers. - * @name util.float - * @namespace - */ - /** - * Writes a 32 bit float to a buffer using little endian byte order. - * @name util.float.writeFloatLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - /** - * Writes a 32 bit float to a buffer using big endian byte order. - * @name util.float.writeFloatBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - /** - * Reads a 32 bit float from a buffer using little endian byte order. - * @name util.float.readFloatLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - /** - * Reads a 32 bit float from a buffer using big endian byte order. - * @name util.float.readFloatBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - /** - * Writes a 64 bit double to a buffer using little endian byte order. - * @name util.float.writeDoubleLE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - /** - * Writes a 64 bit double to a buffer using big endian byte order. - * @name util.float.writeDoubleBE - * @function - * @param {number} val Value to write - * @param {Uint8Array} buf Target buffer - * @param {number} pos Target buffer offset - * @returns {undefined} - */ - /** - * Reads a 64 bit double from a buffer using little endian byte order. - * @name util.float.readDoubleLE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - /** - * Reads a 64 bit double from a buffer using big endian byte order. - * @name util.float.readDoubleBE - * @function - * @param {Uint8Array} buf Source buffer - * @param {number} pos Source buffer offset - * @returns {number} Value read - */ - function factory(exports$1) { - if (typeof Float32Array !== "undefined") (function() { - var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128; - function writeFloat_f32_cpy(val, buf, pos) { - f32[0] = val; - buf[pos] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - } - function writeFloat_f32_rev(val, buf, pos) { - f32[0] = val; - buf[pos] = f8b[3]; - buf[pos + 1] = f8b[2]; - buf[pos + 2] = f8b[1]; - buf[pos + 3] = f8b[0]; - } - /* istanbul ignore next */ - exports$1.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev; - /* istanbul ignore next */ - exports$1.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy; - function readFloat_f32_cpy(buf, pos) { - f8b[0] = buf[pos]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - return f32[0]; - } - function readFloat_f32_rev(buf, pos) { - f8b[3] = buf[pos]; - f8b[2] = buf[pos + 1]; - f8b[1] = buf[pos + 2]; - f8b[0] = buf[pos + 3]; - return f32[0]; - } - /* istanbul ignore next */ - exports$1.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev; - /* istanbul ignore next */ - exports$1.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy; - })(); - else (function() { - function writeFloat_ieee754(writeUint, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) val = -val; - if (val === 0) writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos); - else if (isNaN(val)) writeUint(2143289344, buf, pos); - else if (val > 34028234663852886e22) writeUint((sign << 31 | 2139095040) >>> 0, buf, pos); - else if (val < 11754943508222875e-54) writeUint((sign << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf, pos); - else { - var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607; - writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos); - } - } - exports$1.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE); - exports$1.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE); - function readFloat_ieee754(readUint, buf, pos) { - var uint = readUint(buf, pos), sign = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607; - return exponent === 255 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 1401298464324817e-60 * mantissa : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608); - } - exports$1.readFloatLE = readFloat_ieee754.bind(null, readUintLE); - exports$1.readFloatBE = readFloat_ieee754.bind(null, readUintBE); - })(); - if (typeof Float64Array !== "undefined") (function() { - var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128; - function writeDouble_f64_cpy(val, buf, pos) { - f64[0] = val; - buf[pos] = f8b[0]; - buf[pos + 1] = f8b[1]; - buf[pos + 2] = f8b[2]; - buf[pos + 3] = f8b[3]; - buf[pos + 4] = f8b[4]; - buf[pos + 5] = f8b[5]; - buf[pos + 6] = f8b[6]; - buf[pos + 7] = f8b[7]; - } - function writeDouble_f64_rev(val, buf, pos) { - f64[0] = val; - buf[pos] = f8b[7]; - buf[pos + 1] = f8b[6]; - buf[pos + 2] = f8b[5]; - buf[pos + 3] = f8b[4]; - buf[pos + 4] = f8b[3]; - buf[pos + 5] = f8b[2]; - buf[pos + 6] = f8b[1]; - buf[pos + 7] = f8b[0]; - } - /* istanbul ignore next */ - exports$1.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev; - /* istanbul ignore next */ - exports$1.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy; - function readDouble_f64_cpy(buf, pos) { - f8b[0] = buf[pos]; - f8b[1] = buf[pos + 1]; - f8b[2] = buf[pos + 2]; - f8b[3] = buf[pos + 3]; - f8b[4] = buf[pos + 4]; - f8b[5] = buf[pos + 5]; - f8b[6] = buf[pos + 6]; - f8b[7] = buf[pos + 7]; - return f64[0]; - } - function readDouble_f64_rev(buf, pos) { - f8b[7] = buf[pos]; - f8b[6] = buf[pos + 1]; - f8b[5] = buf[pos + 2]; - f8b[4] = buf[pos + 3]; - f8b[3] = buf[pos + 4]; - f8b[2] = buf[pos + 5]; - f8b[1] = buf[pos + 6]; - f8b[0] = buf[pos + 7]; - return f64[0]; - } - /* istanbul ignore next */ - exports$1.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev; - /* istanbul ignore next */ - exports$1.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy; - })(); - else (function() { - function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) { - var sign = val < 0 ? 1 : 0; - if (sign) val = -val; - if (val === 0) { - writeUint(0, buf, pos + off0); - writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos + off1); - } else if (isNaN(val)) { - writeUint(0, buf, pos + off0); - writeUint(2146959360, buf, pos + off1); - } else if (val > 17976931348623157e292) { - writeUint(0, buf, pos + off0); - writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1); - } else { - var mantissa; - if (val < 22250738585072014e-324) { - mantissa = val / 5e-324; - writeUint(mantissa >>> 0, buf, pos + off0); - writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1); - } else { - var exponent = Math.floor(Math.log(val) / Math.LN2); - if (exponent === 1024) exponent = 1023; - mantissa = val * Math.pow(2, -exponent); - writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0); - writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1); - } - } - } - exports$1.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4); - exports$1.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0); - function readDouble_ieee754(readUint, off0, off1, buf, pos) { - var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1); - var sign = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo; - return exponent === 2047 ? mantissa ? NaN : sign * Infinity : exponent === 0 ? sign * 5e-324 * mantissa : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496); - } - exports$1.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4); - exports$1.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0); - })(); - return exports$1; - } - function writeUintLE(val, buf, pos) { - buf[pos] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; - } - function writeUintBE(val, buf, pos) { - buf[pos] = val >>> 24; - buf[pos + 1] = val >>> 16 & 255; - buf[pos + 2] = val >>> 8 & 255; - buf[pos + 3] = val & 255; - } - function readUintLE(buf, pos) { - return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0; +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/util.js +var require_util = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.nextGreaterSquare = exports.ldexp = void 0; + /** + * Note: other languages provide this as a built in function. This is + * a naive, but functionally correct implementation. This is used sparingly, + * when creating a new mapping in a running application. + * + * ldexp returns frac × 2**exp. With the following special cases: + * ldexp(±0, exp) = ±0 + * ldexp(±Inf, exp) = ±Inf + * ldexp(NaN, exp) = NaN + * @param frac + * @param exp + * @returns {number} + */ + function ldexp(frac, exp) { + if (frac === 0 || frac === Number.POSITIVE_INFINITY || frac === Number.NEGATIVE_INFINITY || Number.isNaN(frac)) return frac; + return frac * Math.pow(2, exp); } - function readUintBE(buf, pos) { - return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; + exports.ldexp = ldexp; + /** + * Computes the next power of two that is greater than or equal to v. + * This implementation more efficient than, but functionally equivalent + * to Math.pow(2, Math.ceil(Math.log(x)/Math.log(2))). + * @param v + * @returns {number} + */ + function nextGreaterSquare(v) { + v--; + v |= v >> 1; + v |= v >> 2; + v |= v >> 4; + v |= v >> 8; + v |= v >> 16; + v++; + return v; } + exports.nextGreaterSquare = nextGreaterSquare; })); //#endregion -//#region ../../node_modules/.pnpm/@protobufjs+inquire@1.1.2/node_modules/@protobufjs/inquire/index.js -var require_inquire = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = inquire; - /** - * Requires a module only if available. - * @memberof util - * @param {string} moduleName Module to require - * @returns {?Object} Required module if available and not empty, otherwise `null` - * @deprecated Legacy optional require helper. Will be removed in a future release. - */ - function inquire(moduleName) { - try { - if (typeof __require !== "function") return null; - var mod = __require(moduleName); - if (mod && (mod.length || Object.keys(mod).length)) return mod; - return null; - } catch (err) { - return null; - } - } +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/types.js +var require_types = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MappingError = void 0; + var MappingError = class extends Error {}; + exports.MappingError = MappingError; })); //#endregion -//#region ../../node_modules/.pnpm/@protobufjs+utf8@1.1.1/node_modules/@protobufjs/utf8/index.js -var require_utf8 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ExponentMapping.js +var require_ExponentMapping = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExponentMapping = void 0; + const ieee754 = require_ieee754(); + const util = require_util(); + const types_1 = require_types(); /** - * A minimal UTF8 implementation for number arrays. - * @memberof util - * @namespace + * ExponentMapping implements exponential mapping functions for + * scales <=0. For scales > 0 LogarithmMapping should be used. */ - var utf8 = exports, replacementChar = "�"; - /** - * Calculates the UTF8 byte length of a string. - * @param {string} string String - * @returns {number} Byte length - */ - utf8.length = function utf8_length(string$2) { - var len = 0, c = 0; - for (var i = 0; i < string$2.length; ++i) { - c = string$2.charCodeAt(i); - if (c < 128) len += 1; - else if (c < 2048) len += 2; - else if ((c & 64512) === 55296 && (string$2.charCodeAt(i + 1) & 64512) === 56320) { - ++i; - len += 4; - } else len += 3; + var ExponentMapping = class { + _shift; + constructor(scale) { + this._shift = -scale; } - return len; - }; - /** - * Reads UTF8 bytes as a string. - * @param {Uint8Array} buffer Source buffer - * @param {number} start Source start - * @param {number} end Source end - * @returns {string} String read - */ - utf8.read = function utf8_read(buffer, start, end) { - if (end - start < 1) return ""; - var str = ""; - for (var i = start; i < end;) { - var t = buffer[i++]; - if (t <= 127) str += String.fromCharCode(t); - else if (t >= 192 && t < 224) { - var c2 = (t & 31) << 6 | buffer[i++] & 63; - str += c2 >= 128 ? String.fromCharCode(c2) : replacementChar; - } else if (t >= 224 && t < 240) { - var c3 = (t & 15) << 12 | (buffer[i++] & 63) << 6 | buffer[i++] & 63; - str += c3 >= 2048 ? String.fromCharCode(c3) : replacementChar; - } else if (t >= 240) { - var t2 = (t & 7) << 18 | (buffer[i++] & 63) << 12 | (buffer[i++] & 63) << 6 | buffer[i++] & 63; - if (t2 < 65536 || t2 > 1114111) str += replacementChar; - else { - t2 -= 65536; - str += String.fromCharCode(55296 + (t2 >> 10)); - str += String.fromCharCode(56320 + (t2 & 1023)); - } - } + /** + * Maps positive floating point values to indexes corresponding to scale + * @param value + * @returns {number} index for provided value at the current scale + */ + mapToIndex(value) { + if (value < ieee754.MIN_VALUE) return this._minNormalLowerBoundaryIndex(); + return ieee754.getNormalBase2(value) + this._rightShift(ieee754.getSignificand(value) - 1, ieee754.SIGNIFICAND_WIDTH) >> this._shift; } - return str; - }; - /** - * Writes a string as UTF8 bytes. - * @param {string} string Source string - * @param {Uint8Array} buffer Destination buffer - * @param {number} offset Destination offset - * @returns {number} Bytes written - */ - utf8.write = function utf8_write(string$2, buffer, offset) { - var start = offset, c1, c2; - for (var i = 0; i < string$2.length; ++i) { - c1 = string$2.charCodeAt(i); - if (c1 < 128) buffer[offset++] = c1; - else if (c1 < 2048) { - buffer[offset++] = c1 >> 6 | 192; - buffer[offset++] = c1 & 63 | 128; - } else if ((c1 & 64512) === 55296 && ((c2 = string$2.charCodeAt(i + 1)) & 64512) === 56320) { - c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023); - ++i; - buffer[offset++] = c1 >> 18 | 240; - buffer[offset++] = c1 >> 12 & 63 | 128; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } else { - buffer[offset++] = c1 >> 12 | 224; - buffer[offset++] = c1 >> 6 & 63 | 128; - buffer[offset++] = c1 & 63 | 128; - } + /** + * Returns the lower bucket boundary for the given index for scale + * + * @param index + * @returns {number} + */ + lowerBoundary(index) { + const minIndex = this._minNormalLowerBoundaryIndex(); + if (index < minIndex) throw new types_1.MappingError(`underflow: ${index} is < minimum lower boundary: ${minIndex}`); + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index > maxIndex) throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); + return util.ldexp(1, index << this._shift); + } + /** + * The scale used by this mapping + * @returns {number} + */ + get scale() { + if (this._shift === 0) return 0; + return -this._shift; + } + _minNormalLowerBoundaryIndex() { + let index = ieee754.MIN_NORMAL_EXPONENT >> this._shift; + if (this._shift < 2) index--; + return index; + } + _maxNormalLowerBoundaryIndex() { + return ieee754.MAX_NORMAL_EXPONENT >> this._shift; + } + _rightShift(value, shift) { + return Math.floor(value * Math.pow(2, -shift)); } - return offset - start; }; + exports.ExponentMapping = ExponentMapping; })); //#endregion -//#region ../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js -var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = pool; - /** - * An allocator as used by {@link util.pool}. - * @typedef PoolAllocator - * @type {function} - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - /** - * A slicer as used by {@link util.pool}. - * @typedef PoolSlicer - * @type {function} - * @param {number} start Start offset - * @param {number} end End offset - * @returns {Uint8Array} Buffer slice - * @this {Uint8Array} - */ - /** - * A general purpose buffer pool. - * @memberof util - * @function - * @param {PoolAllocator} alloc Allocator - * @param {PoolSlicer} slice Slicer - * @param {number} [size=8192] Slab size - * @returns {PoolAllocator} Pooled allocator - */ - function pool(alloc, slice, size) { - var SIZE = size || 8192; - var MAX = SIZE >>> 1; - var slab = null; - var offset = SIZE; - return function pool_alloc(size$1) { - if (size$1 < 1 || size$1 > MAX) return alloc(size$1); - if (offset + size$1 > SIZE) { - slab = alloc(SIZE); - offset = 0; - } - var buf = slice.call(slab, offset, offset += size$1); - if (offset & 7) offset = (offset | 7) + 1; - return buf; - }; - } -})); - -//#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/util/longbits.js -var require_longbits = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = LongBits; - var util = require_minimal$1(); +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/LogarithmMapping.js +var require_LogarithmMapping = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.LogarithmMapping = void 0; + const ieee754 = require_ieee754(); + const util = require_util(); + const types_1 = require_types(); /** - * Constructs new long bits. - * @classdesc Helper class for working with the low and high bits of a 64 bit value. - * @memberof util - * @constructor - * @param {number} lo Low 32 bits, unsigned - * @param {number} hi High 32 bits, unsigned + * LogarithmMapping implements exponential mapping functions for scale > 0. + * For scales <= 0 the exponent mapping should be used. */ - function LongBits(lo, hi) { + var LogarithmMapping = class { + _scale; + _scaleFactor; + _inverseFactor; + constructor(scale) { + this._scale = scale; + this._scaleFactor = util.ldexp(Math.LOG2E, scale); + this._inverseFactor = util.ldexp(Math.LN2, -scale); + } /** - * Low bits. - * @type {number} + * Maps positive floating point values to indexes corresponding to scale + * @param value + * @returns {number} index for provided value at the current scale */ - this.lo = lo >>> 0; + mapToIndex(value) { + if (value <= ieee754.MIN_VALUE) return this._minNormalLowerBoundaryIndex() - 1; + if (ieee754.getSignificand(value) === 0) return (ieee754.getNormalBase2(value) << this._scale) - 1; + const index = Math.floor(Math.log(value) * this._scaleFactor); + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index >= maxIndex) return maxIndex; + return index; + } /** - * High bits. - * @type {number} + * Returns the lower bucket boundary for the given index for scale + * + * @param index + * @returns {number} */ - this.hi = hi >>> 0; - } - /** - * Zero bits. - * @memberof util.LongBits - * @type {util.LongBits} - */ - var zero = LongBits.zero = new LongBits(0, 0); - zero.toNumber = function() { - return 0; - }; - zero.zzEncode = zero.zzDecode = function() { - return this; - }; - zero.length = function() { - return 1; - }; - /** - * Zero hash. - * @memberof util.LongBits - * @type {string} - */ - var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0"; - /** - * Constructs new long bits from the specified number. - * @param {number} value Value - * @returns {util.LongBits} Instance - */ - LongBits.fromNumber = function fromNumber(value) { - if (value === 0) return zero; - var sign = value < 0; - if (sign) value = -value; - var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0; - if (sign) { - hi = ~hi >>> 0; - lo = ~lo >>> 0; - if (++lo > 4294967295) { - lo = 0; - if (++hi > 4294967295) hi = 0; + lowerBoundary(index) { + const maxIndex = this._maxNormalLowerBoundaryIndex(); + if (index >= maxIndex) { + if (index === maxIndex) return 2 * Math.exp((index - (1 << this._scale)) / this._scaleFactor); + throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); + } + const minIndex = this._minNormalLowerBoundaryIndex(); + if (index <= minIndex) { + if (index === minIndex) return ieee754.MIN_VALUE; + else if (index === minIndex - 1) return Math.exp((index + (1 << this._scale)) / this._scaleFactor) / 2; + throw new types_1.MappingError(`overflow: ${index} is < minimum lower boundary: ${minIndex}`); } + return Math.exp(index * this._inverseFactor); } - return new LongBits(lo, hi); - }; - /** - * Constructs new long bits from a number, long or string. - * @param {Long|number|string} value Value - * @returns {util.LongBits} Instance - */ - LongBits.from = function from(value) { - if (typeof value === "number") return LongBits.fromNumber(value); - if (util.isString(value)) - /* istanbul ignore else */ - if (util.Long) value = util.Long.fromString(value); - else return LongBits.fromNumber(parseInt(value, 10)); - return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero; - }; - /** - * Converts this long bits to a possibly unsafe JavaScript number. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {number} Possibly unsafe number - */ - LongBits.prototype.toNumber = function toNumber(unsigned) { - if (!unsigned && this.hi >>> 31) { - var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0; - if (!lo) hi = hi + 1 >>> 0; - return -(lo + hi * 4294967296); + /** + * The scale used by this mapping + * @returns {number} + */ + get scale() { + return this._scale; + } + _minNormalLowerBoundaryIndex() { + return ieee754.MIN_NORMAL_EXPONENT << this._scale; + } + _maxNormalLowerBoundaryIndex() { + return (ieee754.MAX_NORMAL_EXPONENT + 1 << this._scale) - 1; } - return this.lo + this.hi * 4294967296; - }; - /** - * Converts this long bits to a long. - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long} Long - */ - LongBits.prototype.toLong = function toLong(unsigned) { - return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { - low: this.lo | 0, - high: this.hi | 0, - unsigned: Boolean(unsigned) - }; - }; - var charCodeAt = String.prototype.charCodeAt; - /** - * Constructs new long bits from the specified 8 characters long hash. - * @param {string} hash Hash - * @returns {util.LongBits} Bits - */ - LongBits.fromHash = function fromHash(hash) { - if (hash === zeroHash) return zero; - return new LongBits((charCodeAt.call(hash, 0) | charCodeAt.call(hash, 1) << 8 | charCodeAt.call(hash, 2) << 16 | charCodeAt.call(hash, 3) << 24) >>> 0, (charCodeAt.call(hash, 4) | charCodeAt.call(hash, 5) << 8 | charCodeAt.call(hash, 6) << 16 | charCodeAt.call(hash, 7) << 24) >>> 0); - }; - /** - * Converts this long bits to a 8 characters long hash. - * @returns {string} Hash - */ - LongBits.prototype.toHash = function toHash() { - return String.fromCharCode(this.lo & 255, this.lo >>> 8 & 255, this.lo >>> 16 & 255, this.lo >>> 24, this.hi & 255, this.hi >>> 8 & 255, this.hi >>> 16 & 255, this.hi >>> 24); - }; - /** - * Zig-zag encodes this long bits. - * @returns {util.LongBits} `this` - */ - LongBits.prototype.zzEncode = function zzEncode() { - var mask = this.hi >> 31; - this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0; - this.lo = (this.lo << 1 ^ mask) >>> 0; - return this; - }; - /** - * Zig-zag decodes this long bits. - * @returns {util.LongBits} `this` - */ - LongBits.prototype.zzDecode = function zzDecode() { - var mask = -(this.lo & 1); - this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0; - this.hi = (this.hi >>> 1 ^ mask) >>> 0; - return this; }; + exports.LogarithmMapping = LogarithmMapping; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/getMapping.js +var require_getMapping = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMapping = void 0; + const ExponentMapping_1 = require_ExponentMapping(); + const LogarithmMapping_1 = require_LogarithmMapping(); + const types_1 = require_types(); + const MIN_SCALE = -10; + const MAX_SCALE = 20; + const PREBUILT_MAPPINGS = Array.from({ length: 31 }, (_, i) => { + if (i > 10) return new LogarithmMapping_1.LogarithmMapping(i - 10); + return new ExponentMapping_1.ExponentMapping(i - 10); + }); /** - * Calculates the length of this longbits when encoded as a varint. - * @returns {number} Length + * getMapping returns an appropriate mapping for the given scale. For scales -10 + * to 0 the underlying type will be ExponentMapping. For scales 1 to 20 the + * underlying type will be LogarithmMapping. + * @param scale a number in the range [-10, 20] + * @returns {Mapping} */ - LongBits.prototype.length = function length() { - var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24; - return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10; - }; + function getMapping(scale) { + if (scale > MAX_SCALE || scale < MIN_SCALE) throw new types_1.MappingError(`expected scale >= ${MIN_SCALE} && <= ${MAX_SCALE}, got: ${scale}`); + return PREBUILT_MAPPINGS[scale + 10]; + } + exports.getMapping = getMapping; })); //#endregion -//#region ../../node_modules/.pnpm/long@5.3.2/node_modules/long/umd/index.js -var require_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => { - (function(global$1, factory) { - function preferDefault(exports$1) { - return exports$1.default || exports$1; +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/ExponentialHistogram.js +var require_ExponentialHistogram = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = void 0; + const types_1 = require_types$1(); + const MetricData_1 = require_MetricData(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const Buckets_1 = require_Buckets(); + const getMapping_1 = require_getMapping(); + const util_1 = require_util(); + var HighLow = class HighLow { + static combine(h1, h2) { + return new HighLow(Math.min(h1.low, h2.low), Math.max(h1.high, h2.high)); } - if (typeof define === "function" && define.amd) define([], function() { - var exports$1 = {}; - factory(exports$1); - return preferDefault(exports$1); - }); - else if (typeof exports === "object") { - factory(exports); - if (typeof module === "object") module.exports = preferDefault(exports); - } else (function() { - var exports$1 = {}; - factory(exports$1); - global$1.Long = preferDefault(exports$1); - })(); - })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : exports, function(_exports) { - "use strict"; - Object.defineProperty(_exports, "__esModule", { value: true }); - _exports.default = void 0; - /** - * @license - * Copyright 2009 The Closure Library Authors - * Copyright 2020 Daniel Wirtz / The long.js Authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - var wasm = null; - try { - wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([ - 0, - 97, - 115, - 109, - 1, - 0, - 0, - 0, - 1, - 13, - 2, - 96, - 0, - 1, - 127, - 96, - 4, - 127, - 127, - 127, - 127, - 1, - 127, - 3, - 7, - 6, - 0, - 1, - 1, - 1, - 1, - 1, - 6, - 6, - 1, - 127, - 1, - 65, - 0, - 11, - 7, - 50, - 6, - 3, - 109, - 117, - 108, - 0, - 1, - 5, - 100, - 105, - 118, - 95, - 115, - 0, - 2, - 5, - 100, - 105, - 118, - 95, - 117, - 0, - 3, - 5, - 114, - 101, - 109, - 95, - 115, - 0, - 4, - 5, - 114, - 101, - 109, - 95, - 117, - 0, - 5, - 8, - 103, - 101, - 116, - 95, - 104, - 105, - 103, - 104, - 0, - 0, - 10, - 191, - 1, - 6, - 4, - 0, - 35, - 0, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 126, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 127, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 128, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 129, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11, - 36, - 1, - 1, - 126, - 32, - 0, - 173, - 32, - 1, - 173, - 66, - 32, - 134, - 132, - 32, - 2, - 173, - 32, - 3, - 173, - 66, - 32, - 134, - 132, - 130, - 34, - 4, - 66, - 32, - 135, - 167, - 36, - 0, - 32, - 4, - 167, - 11 - ])), {}).exports; - } catch {} - /** - * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. - * See the from* functions below for more convenient ways of constructing Longs. - * @exports Long - * @class A Long class for representing a 64 bit two's-complement integer value. - * @param {number} low The low (signed) 32 bits of the long - * @param {number} high The high (signed) 32 bits of the long - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @constructor - */ - function Long(low, high, unsigned) { - /** - * The low 32 bits as a signed value. - * @type {number} - */ - this.low = low | 0; - /** - * The high 32 bits as a signed value. - * @type {number} - */ - this.high = high | 0; - /** - * Whether unsigned or not. - * @type {boolean} - */ - this.unsigned = !!unsigned; + low; + high; + constructor(low, high) { + this.low = low; + this.high = high; } - /** - * An indicator used to reliably determine if an object is a Long or not. - * @type {boolean} - * @const - * @private - */ - Long.prototype.__isLong__; - Object.defineProperty(Long.prototype, "__isLong__", { value: true }); - /** - * @function - * @param {*} obj Object - * @returns {boolean} - * @inner - */ - function isLong(obj) { - return (obj && obj["__isLong__"]) === true; + }; + const MAX_SCALE = 20; + const DEFAULT_MAX_SIZE = 160; + const MIN_MAX_SIZE = 2; + var ExponentialHistogramAccumulation = class ExponentialHistogramAccumulation { + startTime; + _maxSize; + _recordMinMax; + _sum; + _count; + _zeroCount; + _min; + _max; + _positive; + _negative; + _mapping; + constructor(startTime, maxSize = DEFAULT_MAX_SIZE, recordMinMax = true, sum = 0, count = 0, zeroCount = 0, min = Number.POSITIVE_INFINITY, max = Number.NEGATIVE_INFINITY, positive = new Buckets_1.Buckets(), negative = new Buckets_1.Buckets(), mapping = (0, getMapping_1.getMapping)(MAX_SCALE)) { + this.startTime = startTime; + this._maxSize = maxSize; + this._recordMinMax = recordMinMax; + this._sum = sum; + this._count = count; + this._zeroCount = zeroCount; + this._min = min; + this._max = max; + this._positive = positive; + this._negative = negative; + this._mapping = mapping; + if (this._maxSize < MIN_MAX_SIZE) { + api_1.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \ + changing to the minimum size of: ${MIN_MAX_SIZE}`); + this._maxSize = MIN_MAX_SIZE; + } } /** - * @function - * @param {*} value number - * @returns {number} - * @inner + * record updates a histogram with a single count + * @param {Number} value */ - function ctz32(value) { - var c = Math.clz32(value & -value); - return value ? 31 - c : c; + record(value) { + this.updateByIncrement(value, 1); } /** - * Tests if the specified object is a Long. - * @function - * @param {*} obj Object - * @returns {boolean} - */ - Long.isLong = isLong; - /** - * A cache of the Long representations of small integer values. - * @type {!Object} - * @inner - */ - var INT_CACHE = {}; - /** - * A cache of the Long representations of small unsigned integer values. - * @type {!Object} - * @inner - */ - var UINT_CACHE = {}; - /** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner + * Sets the start time for this accumulation + * @param {HrTime} startTime */ - function fromInt(value, unsigned) { - var obj, cachedObj, cache; - if (unsigned) { - value >>>= 0; - if (cache = 0 <= value && value < 256) { - cachedObj = UINT_CACHE[value]; - if (cachedObj) return cachedObj; - } - obj = fromBits(value, 0, true); - if (cache) UINT_CACHE[value] = obj; - return obj; - } else { - value |= 0; - if (cache = -128 <= value && value < 128) { - cachedObj = INT_CACHE[value]; - if (cachedObj) return cachedObj; - } - obj = fromBits(value, value < 0 ? -1 : 0, false); - if (cache) INT_CACHE[value] = obj; - return obj; - } + setStartTime(startTime) { + this.startTime = startTime; } /** - * Returns a Long representing the given 32 bit integer value. - * @function - * @param {number} value The 32 bit integer in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - Long.fromInt = fromInt; - /** - * @param {number} value - * @param {boolean=} unsigned - * @returns {!Long} - * @inner + * Returns the datapoint representation of this accumulation + * @param {HrTime} startTime */ - function fromNumber(value, unsigned) { - if (isNaN(value)) return unsigned ? UZERO : ZERO; - if (unsigned) { - if (value < 0) return UZERO; - if (value >= TWO_PWR_64_DBL) return MAX_UNSIGNED_VALUE; - } else { - if (value <= -TWO_PWR_63_DBL) return MIN_VALUE; - if (value + 1 >= TWO_PWR_63_DBL) return MAX_VALUE; - } - if (value < 0) return fromNumber(-value, unsigned).neg(); - return fromBits(value % TWO_PWR_32_DBL | 0, value / TWO_PWR_32_DBL | 0, unsigned); + toPointValue() { + return { + hasMinMax: this._recordMinMax, + min: this.min, + max: this.max, + sum: this.sum, + positive: { + offset: this.positive.offset, + bucketCounts: this.positive.counts() + }, + negative: { + offset: this.negative.offset, + bucketCounts: this.negative.counts() + }, + count: this.count, + scale: this.scale, + zeroCount: this.zeroCount + }; } /** - * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. - * @function - * @param {number} value The number in question - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - Long.fromNumber = fromNumber; - /** - * @param {number} lowBits - * @param {number} highBits - * @param {boolean=} unsigned - * @returns {!Long} - * @inner + * @returns {Number} The sum of values recorded by this accumulation */ - function fromBits(lowBits, highBits, unsigned) { - return new Long(lowBits, highBits, unsigned); + get sum() { + return this._sum; } /** - * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is - * assumed to use 32 bits. - * @function - * @param {number} lowBits The low 32 bits - * @param {number} highBits The high 32 bits - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - Long.fromBits = fromBits; - /** - * @function - * @param {number} base - * @param {number} exponent - * @returns {number} - * @inner - */ - var pow_dbl = Math.pow; - /** - * @param {string} str - * @param {(boolean|number)=} unsigned - * @param {number=} radix - * @returns {!Long} - * @inner + * @returns {Number} The minimum value recorded by this accumulation */ - function fromString(str, unsigned, radix) { - if (str.length === 0) throw Error("empty string"); - if (typeof unsigned === "number") { - radix = unsigned; - unsigned = false; - } else unsigned = !!unsigned; - if (str === "NaN" || str === "Infinity" || str === "+Infinity" || str === "-Infinity") return unsigned ? UZERO : ZERO; - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError("radix"); - var p; - if ((p = str.indexOf("-")) > 0) throw Error("interior hyphen"); - else if (p === 0) return fromString(str.substring(1), unsigned, radix).neg(); - var radixToPower = fromNumber(pow_dbl(radix, 8)); - var result = ZERO; - for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); - if (size < 8) { - var power = fromNumber(pow_dbl(radix, size)); - result = result.mul(power).add(fromNumber(value)); - } else { - result = result.mul(radixToPower); - result = result.add(fromNumber(value)); - } - } - result.unsigned = unsigned; - return result; + get min() { + return this._min; } /** - * Returns a Long representation of the given string, written using the specified radix. - * @function - * @param {string} str The textual representation of the Long - * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed - * @param {number=} radix The radix in which the text is written (2-36), defaults to 10 - * @returns {!Long} The corresponding Long value + * @returns {Number} The maximum value recorded by this accumulation */ - Long.fromString = fromString; + get max() { + return this._max; + } /** - * @function - * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val - * @param {boolean=} unsigned - * @returns {!Long} - * @inner + * @returns {Number} The count of values recorded by this accumulation */ - function fromValue(val, unsigned) { - if (typeof val === "number") return fromNumber(val, unsigned); - if (typeof val === "string") return fromString(val, unsigned); - return fromBits(val.low, val.high, typeof unsigned === "boolean" ? unsigned : val.unsigned); + get count() { + return this._count; } /** - * Converts the specified value to a Long using the appropriate from* function for its type. - * @function - * @param {!Long|number|bigint|string|!{low: number, high: number, unsigned: boolean}} val Value - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} + * @returns {Number} The number of 0 values recorded by this accumulation */ - Long.fromValue = fromValue; + get zeroCount() { + return this._zeroCount; + } /** - * @type {number} - * @const - * @inner + * @returns {Number} The scale used by this accumulation */ - var TWO_PWR_16_DBL = 65536; + get scale() { + if (this._count === this._zeroCount) return 0; + return this._mapping.scale; + } /** - * @type {number} - * @const - * @inner + * positive holds the positive values + * @returns {Buckets} */ - var TWO_PWR_24_DBL = 1 << 24; + get positive() { + return this._positive; + } /** - * @type {number} - * @const - * @inner + * negative holds the negative values by their absolute value + * @returns {Buckets} */ - var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + get negative() { + return this._negative; + } /** - * @type {number} - * @const - * @inner + * updateByIncr supports updating a histogram with a non-negative + * increment. + * @param value + * @param increment */ - var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + updateByIncrement(value, increment) { + if (Number.isNaN(value)) return; + if (value > this._max) this._max = value; + if (value < this._min) this._min = value; + this._count += increment; + if (value === 0) { + this._zeroCount += increment; + return; + } + this._sum += value * increment; + if (value > 0) this._updateBuckets(this._positive, value, increment); + else this._updateBuckets(this._negative, -value, increment); + } /** - * @type {number} - * @const - * @inner + * merge combines data from previous value into self + * @param {ExponentialHistogramAccumulation} previous */ - var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + merge(previous) { + if (this._count === 0) { + this._min = previous.min; + this._max = previous.max; + } else if (previous.count !== 0) { + if (previous.min < this.min) this._min = previous.min; + if (previous.max > this.max) this._max = previous.max; + } + this.startTime = previous.startTime; + this._sum += previous.sum; + this._count += previous.count; + this._zeroCount += previous.zeroCount; + const minScale = this._minScale(previous); + this._downscale(this.scale - minScale); + this._mergeBuckets(this.positive, previous, previous.positive, minScale); + this._mergeBuckets(this.negative, previous, previous.negative, minScale); + } /** - * @type {!Long} - * @const - * @inner + * diff subtracts other from self + * @param {ExponentialHistogramAccumulation} other */ - var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + diff(other) { + this._min = Infinity; + this._max = -Infinity; + this._sum -= other.sum; + this._count -= other.count; + this._zeroCount -= other.zeroCount; + const minScale = this._minScale(other); + this._downscale(this.scale - minScale); + this._diffBuckets(this.positive, other, other.positive, minScale); + this._diffBuckets(this.negative, other, other.negative, minScale); + } /** - * @type {!Long} - * @inner + * clone returns a deep copy of self + * @returns {ExponentialHistogramAccumulation} */ - var ZERO = fromInt(0); + clone() { + return new ExponentialHistogramAccumulation(this.startTime, this._maxSize, this._recordMinMax, this._sum, this._count, this._zeroCount, this._min, this._max, this.positive.clone(), this.negative.clone(), this._mapping); + } /** - * Signed zero. - * @type {!Long} + * _updateBuckets maps the incoming value to a bucket index for the current + * scale. If the bucket index is outside of the range of the backing array, + * it will rescale the backing array and update the mapping for the new scale. */ - Long.ZERO = ZERO; + _updateBuckets(buckets, value, increment) { + let index = this._mapping.mapToIndex(value); + let rescalingNeeded = false; + let high = 0; + let low = 0; + if (buckets.length === 0) { + buckets.indexStart = index; + buckets.indexEnd = buckets.indexStart; + buckets.indexBase = buckets.indexStart; + } else if (index < buckets.indexStart && buckets.indexEnd - index >= this._maxSize) { + rescalingNeeded = true; + low = index; + high = buckets.indexEnd; + } else if (index > buckets.indexEnd && index - buckets.indexStart >= this._maxSize) { + rescalingNeeded = true; + low = buckets.indexStart; + high = index; + } + if (rescalingNeeded) { + const change = this._changeScale(high, low); + this._downscale(change); + index = this._mapping.mapToIndex(value); + } + this._incrementIndexBy(buckets, index, increment); + } /** - * @type {!Long} - * @inner + * _incrementIndexBy increments the count of the bucket specified by `index`. + * If the index is outside of the range [buckets.indexStart, buckets.indexEnd] + * the boundaries of the backing array will be adjusted and more buckets will + * be added if needed. */ - var UZERO = fromInt(0, true); + _incrementIndexBy(buckets, index, increment) { + if (increment === 0) return; + if (buckets.length === 0) buckets.indexStart = buckets.indexEnd = buckets.indexBase = index; + if (index < buckets.indexStart) { + const span = buckets.indexEnd - index; + if (span >= buckets.backing.length) this._grow(buckets, span + 1); + buckets.indexStart = index; + } else if (index > buckets.indexEnd) { + const span = index - buckets.indexStart; + if (span >= buckets.backing.length) this._grow(buckets, span + 1); + buckets.indexEnd = index; + } + let bucketIndex = index - buckets.indexBase; + if (bucketIndex < 0) bucketIndex += buckets.backing.length; + buckets.incrementBucket(bucketIndex, increment); + } /** - * Unsigned zero. - * @type {!Long} + * grow resizes the backing array by doubling in size up to maxSize. + * This extends the array with a bunch of zeros and copies the + * existing counts to the same position. */ - Long.UZERO = UZERO; + _grow(buckets, needed) { + const size = buckets.backing.length; + const bias = buckets.indexBase - buckets.indexStart; + const oldPositiveLimit = size - bias; + let newSize = (0, util_1.nextGreaterSquare)(needed); + if (newSize > this._maxSize) newSize = this._maxSize; + const newPositiveLimit = newSize - bias; + buckets.backing.growTo(newSize, oldPositiveLimit, newPositiveLimit); + } /** - * @type {!Long} - * @inner + * _changeScale computes how much downscaling is needed by shifting the + * high and low values until they are separated by no more than size. */ - var ONE = fromInt(1); + _changeScale(high, low) { + let change = 0; + while (high - low >= this._maxSize) { + high >>= 1; + low >>= 1; + change++; + } + return change; + } /** - * Signed one. - * @type {!Long} + * _downscale subtracts `change` from the current mapping scale. */ - Long.ONE = ONE; + _downscale(change) { + if (change === 0) return; + if (change < 0) throw new Error(`impossible change of scale: ${this.scale}`); + const newScale = this._mapping.scale - change; + this._positive.downscale(change); + this._negative.downscale(change); + this._mapping = (0, getMapping_1.getMapping)(newScale); + } /** - * @type {!Long} - * @inner + * _minScale is used by diff and merge to compute an ideal combined scale */ - var UONE = fromInt(1, true); + _minScale(other) { + const minScale = Math.min(this.scale, other.scale); + const highLowPos = HighLow.combine(this._highLowAtScale(this.positive, this.scale, minScale), this._highLowAtScale(other.positive, other.scale, minScale)); + const highLowNeg = HighLow.combine(this._highLowAtScale(this.negative, this.scale, minScale), this._highLowAtScale(other.negative, other.scale, minScale)); + return Math.min(minScale - this._changeScale(highLowPos.high, highLowPos.low), minScale - this._changeScale(highLowNeg.high, highLowNeg.low)); + } /** - * Unsigned one. - * @type {!Long} + * _highLowAtScale is used by diff and merge to compute an ideal combined scale. */ - Long.UONE = UONE; + _highLowAtScale(buckets, currentScale, newScale) { + if (buckets.length === 0) return new HighLow(0, -1); + const shift = currentScale - newScale; + return new HighLow(buckets.indexStart >> shift, buckets.indexEnd >> shift); + } /** - * @type {!Long} - * @inner + * _mergeBuckets translates index values from another histogram and + * adds the values into the corresponding buckets of this histogram. */ - var NEG_ONE = fromInt(-1); + _mergeBuckets(ours, other, theirs, scale) { + const theirOffset = theirs.offset; + const theirChange = other.scale - scale; + for (let i = 0; i < theirs.length; i++) this._incrementIndexBy(ours, theirOffset + i >> theirChange, theirs.at(i)); + } /** - * Signed negative one. - * @type {!Long} + * _diffBuckets translates index values from another histogram and + * subtracts the values in the corresponding buckets of this histogram. */ - Long.NEG_ONE = NEG_ONE; + _diffBuckets(ours, other, theirs, scale) { + const theirOffset = theirs.offset; + const theirChange = other.scale - scale; + for (let i = 0; i < theirs.length; i++) { + let bucketIndex = (theirOffset + i >> theirChange) - ours.indexBase; + if (bucketIndex < 0) bucketIndex += ours.backing.length; + ours.decrementBucket(bucketIndex, theirs.at(i)); + } + ours.trim(); + } + }; + exports.ExponentialHistogramAccumulation = ExponentialHistogramAccumulation; + /** + * Aggregator for ExponentialHistogramAccumulations + */ + var ExponentialHistogramAggregator = class { + kind = types_1.AggregatorKind.EXPONENTIAL_HISTOGRAM; + _maxSize; + _recordMinMax; /** - * @type {!Long} - * @inner + * @param _maxSize Maximum number of buckets for each of the positive + * and negative ranges, exclusive of the zero-bucket. + * @param _recordMinMax If set to true, min and max will be recorded. + * Otherwise, min and max will not be recorded. */ - var MAX_VALUE = fromBits(-1, 2147483647, false); + constructor(maxSize, recordMinMax) { + this._maxSize = maxSize; + this._recordMinMax = recordMinMax; + } + createAccumulation(startTime) { + return new ExponentialHistogramAccumulation(startTime, this._maxSize, this._recordMinMax); + } /** - * Maximum signed value. - * @type {!Long} + * Return the result of the merge of two exponential histogram accumulations. */ - Long.MAX_VALUE = MAX_VALUE; + merge(previous, delta) { + const result = delta.clone(); + result.merge(previous); + return result; + } /** - * @type {!Long} - * @inner + * Returns a new DELTA aggregation by comparing two cumulative measurements. */ - var MAX_UNSIGNED_VALUE = fromBits(-1, -1, true); - /** - * Maximum unsigned value. - * @type {!Long} - */ - Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE; - /** - * @type {!Long} - * @inner - */ - var MIN_VALUE = fromBits(0, -2147483648, false); - /** - * Minimum signed value. - * @type {!Long} - */ - Long.MIN_VALUE = MIN_VALUE; - /** - * @alias Long.prototype - * @inner - */ - var LongPrototype = Long.prototype; - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - * @this {!Long} - * @returns {number} - */ - LongPrototype.toInt = function toInt() { - return this.unsigned ? this.low >>> 0 : this.low; - }; - /** - * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). - * @this {!Long} - * @returns {number} - */ - LongPrototype.toNumber = function toNumber() { - if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); - return this.high * TWO_PWR_32_DBL + (this.low >>> 0); - }; - /** - * Converts the Long to a string written in the specified radix. - * @this {!Long} - * @param {number=} radix Radix (2-36), defaults to 10 - * @returns {string} - * @override - * @throws {RangeError} If `radix` is out of range - */ - LongPrototype.toString = function toString(radix) { - radix = radix || 10; - if (radix < 2 || 36 < radix) throw RangeError("radix"); - if (this.isZero()) return "0"; - if (this.isNegative()) if (this.eq(MIN_VALUE)) { - var radixLong = fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); - return div.toString(radix) + rem1.toInt().toString(radix); - } else return "-" + this.neg().toString(radix); - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), rem = this; - var result = ""; - while (true) { - var remDiv = rem.div(radixToPower), digits = (rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0).toString(radix); - rem = remDiv; - if (rem.isZero()) return digits + result; - else { - while (digits.length < 6) digits = "0" + digits; - result = "" + digits + result; - } - } - }; - /** - * Gets the high 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed high bits - */ - LongPrototype.getHighBits = function getHighBits() { - return this.high; - }; - /** - * Gets the high 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned high bits - */ - LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; - }; - /** - * Gets the low 32 bits as a signed integer. - * @this {!Long} - * @returns {number} Signed low bits - */ - LongPrototype.getLowBits = function getLowBits() { - return this.low; - }; - /** - * Gets the low 32 bits as an unsigned integer. - * @this {!Long} - * @returns {number} Unsigned low bits - */ - LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { - return this.low >>> 0; - }; - /** - * Gets the number of bits needed to represent the absolute value of this Long. - * @this {!Long} - * @returns {number} - */ - LongPrototype.getNumBitsAbs = function getNumBitsAbs() { - if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) if ((val & 1 << bit) != 0) break; - return this.high != 0 ? bit + 33 : bit + 1; - }; - /** - * Tests if this Long can be safely represented as a JavaScript number. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isSafeInteger = function isSafeInteger() { - var top11Bits = this.high >> 21; - if (!top11Bits) return true; - if (this.unsigned) return false; - return top11Bits === -1 && !(this.low === 0 && this.high === -2097152); - }; - /** - * Tests if this Long's value equals zero. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isZero = function isZero() { - return this.high === 0 && this.low === 0; - }; - /** - * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}. - * @returns {boolean} - */ - LongPrototype.eqz = LongPrototype.isZero; - /** - * Tests if this Long's value is negative. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; - }; - /** - * Tests if this Long's value is positive or zero. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; - }; - /** - * Tests if this Long's value is odd. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; - }; - /** - * Tests if this Long's value is even. - * @this {!Long} - * @returns {boolean} - */ - LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; - }; - /** - * Tests if this Long's value equals the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.equals = function equals(other) { - if (!isLong(other)) other = fromValue(other); - if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) return false; - return this.high === other.high && this.low === other.low; - }; - /** - * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.eq = LongPrototype.equals; - /** - * Tests if this Long's value differs from the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.notEquals = function notEquals(other) { - return !this.eq(other); - }; - /** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.neq = LongPrototype.notEquals; - /** - * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.ne = LongPrototype.notEquals; - /** - * Tests if this Long's value is less than the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.lessThan = function lessThan(other) { - return this.comp(other) < 0; - }; - /** - * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.lt = LongPrototype.lessThan; - /** - * Tests if this Long's value is less than or equal the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.lessThanOrEqual = function lessThanOrEqual(other) { - return this.comp(other) <= 0; - }; - /** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.lte = LongPrototype.lessThanOrEqual; - /** - * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.le = LongPrototype.lessThanOrEqual; - /** - * Tests if this Long's value is greater than the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.greaterThan = function greaterThan(other) { - return this.comp(other) > 0; - }; - /** - * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.gt = LongPrototype.greaterThan; - /** - * Tests if this Long's value is greater than or equal the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) { - return this.comp(other) >= 0; - }; - /** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.gte = LongPrototype.greaterThanOrEqual; - /** - * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {boolean} - */ - LongPrototype.ge = LongPrototype.greaterThanOrEqual; - /** - * Compares this Long's value with the specified's. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ - LongPrototype.compare = function compare(other) { - if (!isLong(other)) other = fromValue(other); - if (this.eq(other)) return 0; - var thisNeg = this.isNegative(), otherNeg = other.isNegative(); - if (thisNeg && !otherNeg) return -1; - if (!thisNeg && otherNeg) return 1; - if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; - return other.high >>> 0 > this.high >>> 0 || other.high === this.high && other.low >>> 0 > this.low >>> 0 ? -1 : 1; - }; - /** - * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}. - * @function - * @param {!Long|number|bigint|string} other Other value - * @returns {number} 0 if they are the same, 1 if the this is greater and -1 - * if the given one is greater - */ - LongPrototype.comp = LongPrototype.compare; - /** - * Negates this Long's value. - * @this {!Long} - * @returns {!Long} Negated Long - */ - LongPrototype.negate = function negate() { - if (!this.unsigned && this.eq(MIN_VALUE)) return MIN_VALUE; - return this.not().add(ONE); - }; + diff(previous, current) { + const result = current.clone(); + result.diff(previous); + return result; + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.EXPONENTIAL_HISTOGRAM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + const pointValue = accumulation.toPointValue(); + const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: { + min: pointValue.hasMinMax ? pointValue.min : void 0, + max: pointValue.hasMinMax ? pointValue.max : void 0, + sum: !allowsNegativeValues ? pointValue.sum : void 0, + positive: { + offset: pointValue.positive.offset, + bucketCounts: pointValue.positive.bucketCounts + }, + negative: { + offset: pointValue.negative.offset, + bucketCounts: pointValue.negative.bucketCounts + }, + count: pointValue.count, + scale: pointValue.scale, + zeroCount: pointValue.zeroCount + } + }; + }) + }; + } + }; + exports.ExponentialHistogramAggregator = ExponentialHistogramAggregator; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/LastValue.js +var require_LastValue = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.LastValueAggregator = exports.LastValueAccumulation = void 0; + const types_1 = require_types$1(); + const core_1 = require_src$8(); + const MetricData_1 = require_MetricData(); + var LastValueAccumulation = class { + startTime; + _current; + sampleTime; + constructor(startTime, current = 0, sampleTime = [0, 0]) { + this.startTime = startTime; + this._current = current; + this.sampleTime = sampleTime; + } + record(value) { + this._current = value; + this.sampleTime = (0, core_1.millisToHrTime)(Date.now()); + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } + }; + exports.LastValueAccumulation = LastValueAccumulation; + /** Basic aggregator which calculates a LastValue from individual measurements. */ + var LastValueAggregator = class { + kind = types_1.AggregatorKind.LAST_VALUE; + createAccumulation(startTime) { + return new LastValueAccumulation(startTime); + } /** - * Negates this Long's value. This is an alias of {@link Long#negate}. - * @function - * @returns {!Long} Negated Long + * Returns the result of the merge of the given accumulations. + * + * Return the newly captured (delta) accumulation for LastValueAggregator. */ - LongPrototype.neg = LongPrototype.negate; + merge(previous, delta) { + const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(delta.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? delta : previous; + return new LastValueAccumulation(previous.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); + } /** - * Returns the sum of this and the specified Long. - * @this {!Long} - * @param {!Long|number|bigint|string} addend Addend - * @returns {!Long} Sum + * Returns a new DELTA aggregation by comparing two cumulative measurements. + * + * A delta aggregation is not meaningful to LastValueAggregator, just return + * the newly captured (delta) accumulation for LastValueAggregator. */ - LongPrototype.add = function add(addend) { - if (!isLong(addend)) addend = fromValue(addend); - var a48 = this.high >>> 16; - var a32 = this.high & 65535; - var a16 = this.low >>> 16; - var a00 = this.low & 65535; - var b48 = addend.high >>> 16; - var b32 = addend.high & 65535; - var b16 = addend.low >>> 16; - var b00 = addend.low & 65535; - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 + b00; - c16 += c00 >>> 16; - c00 &= 65535; - c16 += a16 + b16; - c32 += c16 >>> 16; - c16 &= 65535; - c32 += a32 + b32; - c48 += c32 >>> 16; - c32 &= 65535; - c48 += a48 + b48; - c48 &= 65535; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); - }; + diff(previous, current) { + const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(current.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? current : previous; + return new LastValueAccumulation(current.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.GAUGE, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: accumulation.toPointValue() + }; + }) + }; + } + }; + exports.LastValueAggregator = LastValueAggregator; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Sum.js +var require_Sum = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SumAggregator = exports.SumAccumulation = void 0; + const types_1 = require_types$1(); + const MetricData_1 = require_MetricData(); + var SumAccumulation = class { + startTime; + monotonic; + _current; + reset; + constructor(startTime, monotonic, current = 0, reset = false) { + this.startTime = startTime; + this.monotonic = monotonic; + this._current = current; + this.reset = reset; + } + record(value) { + if (this.monotonic && value < 0) return; + this._current += value; + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } + }; + exports.SumAccumulation = SumAccumulation; + /** Basic aggregator which calculates a Sum from individual measurements. */ + var SumAggregator = class { + kind = types_1.AggregatorKind.SUM; + monotonic; + constructor(monotonic) { + this.monotonic = monotonic; + } + createAccumulation(startTime) { + return new SumAccumulation(startTime, this.monotonic); + } /** - * Returns the difference of this and the specified Long. - * @this {!Long} - * @param {!Long|number|bigint|string} subtrahend Subtrahend - * @returns {!Long} Difference + * Returns the result of the merge of the given accumulations. */ - LongPrototype.subtract = function subtract(subtrahend) { - if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); - return this.add(subtrahend.neg()); - }; + merge(previous, delta) { + const prevPv = previous.toPointValue(); + const deltaPv = delta.toPointValue(); + if (delta.reset) return new SumAccumulation(delta.startTime, this.monotonic, deltaPv, delta.reset); + return new SumAccumulation(previous.startTime, this.monotonic, prevPv + deltaPv); + } /** - * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}. - * @function - * @param {!Long|number|bigint|string} subtrahend Subtrahend - * @returns {!Long} Difference + * Returns a new DELTA aggregation by comparing two cumulative measurements. */ - LongPrototype.sub = LongPrototype.subtract; - /** - * Returns the product of this and the specified Long. - * @this {!Long} - * @param {!Long|number|bigint|string} multiplier Multiplier - * @returns {!Long} Product - */ - LongPrototype.multiply = function multiply(multiplier) { - if (this.isZero()) return this; - if (!isLong(multiplier)) multiplier = fromValue(multiplier); - if (wasm) return fromBits(wasm["mul"](this.low, this.high, multiplier.low, multiplier.high), wasm["get_high"](), this.unsigned); - if (multiplier.isZero()) return this.unsigned ? UZERO : ZERO; - if (this.eq(MIN_VALUE)) return multiplier.isOdd() ? MIN_VALUE : ZERO; - if (multiplier.eq(MIN_VALUE)) return this.isOdd() ? MIN_VALUE : ZERO; - if (this.isNegative()) if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); - else return this.neg().mul(multiplier).neg(); - else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); - if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24)) return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); - var a48 = this.high >>> 16; - var a32 = this.high & 65535; - var a16 = this.low >>> 16; - var a00 = this.low & 65535; - var b48 = multiplier.high >>> 16; - var b32 = multiplier.high & 65535; - var b16 = multiplier.low >>> 16; - var b00 = multiplier.low & 65535; - var c48 = 0, c32 = 0, c16 = 0, c00 = 0; - c00 += a00 * b00; - c16 += c00 >>> 16; - c00 &= 65535; - c16 += a16 * b00; - c32 += c16 >>> 16; - c16 &= 65535; - c16 += a00 * b16; - c32 += c16 >>> 16; - c16 &= 65535; - c32 += a32 * b00; - c48 += c32 >>> 16; - c32 &= 65535; - c32 += a16 * b16; - c48 += c32 >>> 16; - c32 &= 65535; - c32 += a00 * b32; - c48 += c32 >>> 16; - c32 &= 65535; - c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; - c48 &= 65535; - return fromBits(c16 << 16 | c00, c48 << 16 | c32, this.unsigned); - }; - /** - * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}. - * @function - * @param {!Long|number|bigint|string} multiplier Multiplier - * @returns {!Long} Product - */ - LongPrototype.mul = LongPrototype.multiply; - /** - * Returns this Long divided by the specified. The result is signed if this Long is signed or - * unsigned if this Long is unsigned. - * @this {!Long} - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Quotient - */ - LongPrototype.divide = function divide(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (divisor.isZero()) throw Error("division by zero"); - if (wasm) { - if (!this.unsigned && this.high === -2147483648 && divisor.low === -1 && divisor.high === -1) return this; - return fromBits((this.unsigned ? wasm["div_u"] : wasm["div_s"])(this.low, this.high, divisor.low, divisor.high), wasm["get_high"](), this.unsigned); - } - if (this.isZero()) return this.unsigned ? UZERO : ZERO; - var approx, rem, res; - if (!this.unsigned) { - if (this.eq(MIN_VALUE)) if (divisor.eq(ONE) || divisor.eq(NEG_ONE)) return MIN_VALUE; - else if (divisor.eq(MIN_VALUE)) return ONE; - else { - approx = this.shr(1).div(divisor).shl(1); - if (approx.eq(ZERO)) return divisor.isNegative() ? ONE : NEG_ONE; - else { - rem = this.sub(divisor.mul(approx)); - res = approx.add(rem.div(divisor)); - return res; - } - } - else if (divisor.eq(MIN_VALUE)) return this.unsigned ? UZERO : ZERO; - if (this.isNegative()) { - if (divisor.isNegative()) return this.neg().div(divisor.neg()); - return this.neg().div(divisor).neg(); - } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); - res = ZERO; - } else { - if (!divisor.unsigned) divisor = divisor.toUnsigned(); - if (divisor.gt(this)) return UZERO; - if (divisor.gt(this.shru(1))) return UONE; - res = UZERO; - } - rem = this; - while (rem.gte(divisor)) { - approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); - var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = log2 <= 48 ? 1 : pow_dbl(2, log2 - 48), approxRes = fromNumber(approx), approxRem = approxRes.mul(divisor); - while (approxRem.isNegative() || approxRem.gt(rem)) { - approx -= delta; - approxRes = fromNumber(approx, this.unsigned); - approxRem = approxRes.mul(divisor); - } - if (approxRes.isZero()) approxRes = ONE; - res = res.add(approxRes); - rem = rem.sub(approxRem); - } - return res; - }; - /** - * Returns this Long divided by the specified. This is an alias of {@link Long#divide}. - * @function - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Quotient - */ - LongPrototype.div = LongPrototype.divide; - /** - * Returns this Long modulo the specified. - * @this {!Long} - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Remainder - */ - LongPrototype.modulo = function modulo(divisor) { - if (!isLong(divisor)) divisor = fromValue(divisor); - if (wasm) return fromBits((this.unsigned ? wasm["rem_u"] : wasm["rem_s"])(this.low, this.high, divisor.low, divisor.high), wasm["get_high"](), this.unsigned); - return this.sub(this.div(divisor).mul(divisor)); - }; - /** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Remainder - */ - LongPrototype.mod = LongPrototype.modulo; - /** - * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}. - * @function - * @param {!Long|number|bigint|string} divisor Divisor - * @returns {!Long} Remainder - */ - LongPrototype.rem = LongPrototype.modulo; - /** - * Returns the bitwise NOT of this Long. - * @this {!Long} - * @returns {!Long} - */ - LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); - }; - /** - * Returns count leading zeros of this Long. - * @this {!Long} - * @returns {!number} - */ - LongPrototype.countLeadingZeros = function countLeadingZeros() { - return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32; - }; - /** - * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ - LongPrototype.clz = LongPrototype.countLeadingZeros; - /** - * Returns count trailing zeros of this Long. - * @this {!Long} - * @returns {!number} - */ - LongPrototype.countTrailingZeros = function countTrailingZeros() { - return this.low ? ctz32(this.low) : ctz32(this.high) + 32; - }; - /** - * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}. - * @function - * @param {!Long} - * @returns {!number} - */ - LongPrototype.ctz = LongPrototype.countTrailingZeros; - /** - * Returns the bitwise AND of this Long and the specified. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other Long - * @returns {!Long} - */ - LongPrototype.and = function and(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low & other.low, this.high & other.high, this.unsigned); - }; - /** - * Returns the bitwise OR of this Long and the specified. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other Long - * @returns {!Long} - */ - LongPrototype.or = function or(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low | other.low, this.high | other.high, this.unsigned); - }; - /** - * Returns the bitwise XOR of this Long and the given one. - * @this {!Long} - * @param {!Long|number|bigint|string} other Other Long - * @returns {!Long} - */ - LongPrototype.xor = function xor(other) { - if (!isLong(other)) other = fromValue(other); - return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); - }; - /** - * Returns this Long with bits shifted to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shiftLeft = function shiftLeft(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - else if (numBits < 32) return fromBits(this.low << numBits, this.high << numBits | this.low >>> 32 - numBits, this.unsigned); - else return fromBits(0, this.low << numBits - 32, this.unsigned); - }; - /** - * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shl = LongPrototype.shiftLeft; - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shiftRight = function shiftRight(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - else if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >> numBits, this.unsigned); - else return fromBits(this.high >> numBits - 32, this.high >= 0 ? 0 : -1, this.unsigned); - }; - /** - * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shr = LongPrototype.shiftRight; - /** - * Returns this Long with bits logically shifted to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits < 32) return fromBits(this.low >>> numBits | this.high << 32 - numBits, this.high >>> numBits, this.unsigned); - if (numBits === 32) return fromBits(this.high, 0, this.unsigned); - return fromBits(this.high >>> numBits - 32, 0, this.unsigned); - }; - /** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shru = LongPrototype.shiftRightUnsigned; - /** - * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ - LongPrototype.shr_u = LongPrototype.shiftRightUnsigned; - /** - * Returns this Long with bits rotated to the left by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - LongPrototype.rotateLeft = function rotateLeft(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = 32 - numBits; - return fromBits(this.low << numBits | this.high >>> b, this.high << numBits | this.low >>> b, this.unsigned); - } - numBits -= 32; - b = 32 - numBits; - return fromBits(this.high << numBits | this.low >>> b, this.low << numBits | this.high >>> b, this.unsigned); - }; - /** - * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - LongPrototype.rotl = LongPrototype.rotateLeft; - /** - * Returns this Long with bits rotated to the right by the given amount. - * @this {!Long} - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - LongPrototype.rotateRight = function rotateRight(numBits) { - var b; - if (isLong(numBits)) numBits = numBits.toInt(); - if ((numBits &= 63) === 0) return this; - if (numBits === 32) return fromBits(this.high, this.low, this.unsigned); - if (numBits < 32) { - b = 32 - numBits; - return fromBits(this.high << b | this.low >>> numBits, this.low << b | this.high >>> numBits, this.unsigned); - } - numBits -= 32; - b = 32 - numBits; - return fromBits(this.low << b | this.high >>> numBits, this.high << b | this.low >>> numBits, this.unsigned); - }; - /** - * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}. - * @function - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Rotated Long - */ - LongPrototype.rotr = LongPrototype.rotateRight; - /** - * Converts this Long to signed. - * @this {!Long} - * @returns {!Long} Signed long - */ - LongPrototype.toSigned = function toSigned() { - if (!this.unsigned) return this; - return fromBits(this.low, this.high, false); - }; - /** - * Converts this Long to unsigned. - * @this {!Long} - * @returns {!Long} Unsigned long - */ - LongPrototype.toUnsigned = function toUnsigned() { - if (this.unsigned) return this; - return fromBits(this.low, this.high, true); - }; - /** - * Converts this Long to its byte representation. - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @this {!Long} - * @returns {!Array.} Byte representation - */ - LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); - }; - /** - * Converts this Long to its little endian byte representation. - * @this {!Long} - * @returns {!Array.} Little endian byte representation - */ - LongPrototype.toBytesLE = function toBytesLE() { - var hi = this.high, lo = this.low; - return [ - lo & 255, - lo >>> 8 & 255, - lo >>> 16 & 255, - lo >>> 24, - hi & 255, - hi >>> 8 & 255, - hi >>> 16 & 255, - hi >>> 24 - ]; - }; - /** - * Converts this Long to its big endian byte representation. - * @this {!Long} - * @returns {!Array.} Big endian byte representation - */ - LongPrototype.toBytesBE = function toBytesBE() { - var hi = this.high, lo = this.low; - return [ - hi >>> 24, - hi >>> 16 & 255, - hi >>> 8 & 255, - hi & 255, - lo >>> 24, - lo >>> 16 & 255, - lo >>> 8 & 255, - lo & 255 - ]; - }; - /** - * Creates a Long from its byte representation. - * @param {!Array.} bytes Byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @param {boolean=} le Whether little or big endian, defaults to big endian - * @returns {Long} The corresponding Long value - */ - Long.fromBytes = function fromBytes(bytes, unsigned, le) { - return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); - }; - /** - * Creates a Long from its little endian byte representation. - * @param {!Array.} bytes Little endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ - Long.fromBytesLE = function fromBytesLE(bytes, unsigned) { - return new Long(bytes[0] | bytes[1] << 8 | bytes[2] << 16 | bytes[3] << 24, bytes[4] | bytes[5] << 8 | bytes[6] << 16 | bytes[7] << 24, unsigned); - }; - /** - * Creates a Long from its big endian byte representation. - * @param {!Array.} bytes Big endian byte representation - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {Long} The corresponding Long value - */ - Long.fromBytesBE = function fromBytesBE(bytes, unsigned) { - return new Long(bytes[4] << 24 | bytes[5] << 16 | bytes[6] << 8 | bytes[7], bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], unsigned); - }; - if (typeof BigInt === "function") { - /** - * Returns a Long representing the given big integer. - * @function - * @param {number} value The big integer value - * @param {boolean=} unsigned Whether unsigned or not, defaults to signed - * @returns {!Long} The corresponding Long value - */ - Long.fromBigInt = function fromBigInt(value, unsigned) { - return fromBits(Number(BigInt.asIntN(32, value)), Number(BigInt.asIntN(32, value >> BigInt(32))), unsigned); - }; - Long.fromValue = function fromValueWithBigInt(value, unsigned) { - if (typeof value === "bigint") return Long.fromBigInt(value, unsigned); - return fromValue(value, unsigned); - }; + diff(previous, current) { + const prevPv = previous.toPointValue(); + const currPv = current.toPointValue(); /** - * Converts the Long to its big integer representation. - * @this {!Long} - * @returns {bigint} + * If the SumAggregator is a monotonic one and the previous point value is + * greater than the current one, a reset is deemed to be happened. + * Return the current point value to prevent the value from been reset. */ - LongPrototype.toBigInt = function toBigInt() { - var lowBigInt = BigInt(this.low >>> 0); - return BigInt(this.unsigned ? this.high >>> 0 : this.high) << BigInt(32) | lowBigInt; + if (this.monotonic && prevPv > currPv) return new SumAccumulation(current.startTime, this.monotonic, currPv, true); + return new SumAccumulation(current.startTime, this.monotonic, currPv - prevPv); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.SUM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: accumulation.toPointValue() + }; + }), + isMonotonic: this.monotonic }; } - _exports.default = Long; + }; + exports.SumAggregator = SumAggregator; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/index.js +var require_aggregator = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SumAggregator = exports.SumAccumulation = exports.LastValueAggregator = exports.LastValueAccumulation = exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = exports.HistogramAggregator = exports.HistogramAccumulation = exports.DropAggregator = void 0; + var Drop_1 = require_Drop(); + Object.defineProperty(exports, "DropAggregator", { + enumerable: true, + get: function() { + return Drop_1.DropAggregator; + } + }); + var Histogram_1 = require_Histogram(); + Object.defineProperty(exports, "HistogramAccumulation", { + enumerable: true, + get: function() { + return Histogram_1.HistogramAccumulation; + } + }); + Object.defineProperty(exports, "HistogramAggregator", { + enumerable: true, + get: function() { + return Histogram_1.HistogramAggregator; + } + }); + var ExponentialHistogram_1 = require_ExponentialHistogram(); + Object.defineProperty(exports, "ExponentialHistogramAccumulation", { + enumerable: true, + get: function() { + return ExponentialHistogram_1.ExponentialHistogramAccumulation; + } + }); + Object.defineProperty(exports, "ExponentialHistogramAggregator", { + enumerable: true, + get: function() { + return ExponentialHistogram_1.ExponentialHistogramAggregator; + } + }); + var LastValue_1 = require_LastValue(); + Object.defineProperty(exports, "LastValueAccumulation", { + enumerable: true, + get: function() { + return LastValue_1.LastValueAccumulation; + } + }); + Object.defineProperty(exports, "LastValueAggregator", { + enumerable: true, + get: function() { + return LastValue_1.LastValueAggregator; + } + }); + var Sum_1 = require_Sum(); + Object.defineProperty(exports, "SumAccumulation", { + enumerable: true, + get: function() { + return Sum_1.SumAccumulation; + } + }); + Object.defineProperty(exports, "SumAggregator", { + enumerable: true, + get: function() { + return Sum_1.SumAggregator; + } }); })); //#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/util/minimal.js -var require_minimal$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - var util = exports; - util.asPromise = require_aspromise(); - util.base64 = require_base64(); - util.EventEmitter = require_eventemitter(); - util.float = require_float(); - util.inquire = require_inquire(); - util.utf8 = require_utf8(); - util.pool = require_pool(); - util.LongBits = require_longbits(); - /** - * Tests if the specified key can affect object prototypes. - * @memberof util - * @param {string} key Key to test - * @returns {boolean} `true` if the key is unsafe - */ - function isUnsafeProperty(key) { - return key === "__proto__" || key === "prototype" || key === "constructor"; - } - util.isUnsafeProperty = isUnsafeProperty; - /** - * Whether running within node or not. - * @memberof util - * @type {boolean} - */ - util.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node); - /** - * Global object reference. - * @memberof util - * @type {Object} - */ - util.global = util.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || exports; - /** - * An immuable empty array. - * @memberof util - * @type {Array.<*>} - * @const - */ - util.emptyArray = Object.freeze ? Object.freeze([]) : []; - /** - * An immutable empty object. - * @type {Object} - * @const - */ - util.emptyObject = Object.freeze ? Object.freeze({}) : ( /* istanbul ignore next */ {}); - /** - * Tests if the specified value is an integer. - * @function - * @param {*} value Value to test - * @returns {boolean} `true` if the value is an integer - */ - util.isInteger = Number.isInteger || function isInteger(value) { - return typeof value === "number" && isFinite(value) && Math.floor(value) === value; - }; - /** - * Tests if the specified value is a string. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a string - */ - util.isString = function isString(value) { - return typeof value === "string" || value instanceof String; - }; +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/Aggregation.js +var require_Aggregation = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_AGGREGATION = exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = exports.HISTOGRAM_AGGREGATION = exports.LAST_VALUE_AGGREGATION = exports.SUM_AGGREGATION = exports.DROP_AGGREGATION = exports.DefaultAggregation = exports.ExponentialHistogramAggregation = exports.ExplicitBucketHistogramAggregation = exports.HistogramAggregation = exports.LastValueAggregation = exports.SumAggregation = exports.DropAggregation = void 0; + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const aggregator_1 = require_aggregator(); + const MetricData_1 = require_MetricData(); /** - * Tests if the specified value is a non-null object. - * @param {*} value Value to test - * @returns {boolean} `true` if the value is a non-null object + * The default drop aggregation. */ - util.isObject = function isObject$1(value) { - return value && typeof value === "object"; + var DropAggregation = class DropAggregation { + static DEFAULT_INSTANCE = new aggregator_1.DropAggregator(); + createAggregator(_instrument) { + return DropAggregation.DEFAULT_INSTANCE; + } }; + exports.DropAggregation = DropAggregation; /** - * Checks if a property on a message is considered to be present. - * This is an alias of {@link util.isSet}. - * @function - * @param {Object} obj Plain object or message instance - * @param {string} prop Property name - * @returns {boolean} `true` if considered to be present, otherwise `false` + * The default sum aggregation. */ - util.isset = util.isSet = function isSet(obj, prop) { - var value = obj[prop]; - if (value != null && obj.hasOwnProperty(prop)) return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; - return false; + var SumAggregation = class SumAggregation { + static MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(true); + static NON_MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(false); + createAggregator(instrument) { + switch (instrument.type) { + case MetricData_1.InstrumentType.COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: + case MetricData_1.InstrumentType.HISTOGRAM: return SumAggregation.MONOTONIC_INSTANCE; + default: return SumAggregation.NON_MONOTONIC_INSTANCE; + } + } }; + exports.SumAggregation = SumAggregation; /** - * Any compatible Buffer instance. - * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings. - * @interface Buffer - * @extends Uint8Array - */ - /** - * Node's Buffer class if available. - * @type {Constructor} + * The default last value aggregation. */ - util.Buffer = (function() { - try { - var Buffer$1 = util.global.Buffer; - return Buffer$1.prototype.utf8Write ? Buffer$1 : null; - } catch (e) { - /* istanbul ignore next */ - return null; + var LastValueAggregation = class LastValueAggregation { + static DEFAULT_INSTANCE = new aggregator_1.LastValueAggregator(); + createAggregator(_instrument) { + return LastValueAggregation.DEFAULT_INSTANCE; } - })(); - util._Buffer_from = null; - util._Buffer_allocUnsafe = null; - /** - * Creates a new buffer of whatever type supported by the environment. - * @param {number|number[]} [sizeOrArray=0] Buffer size or number array - * @returns {Uint8Array|Buffer} Buffer - */ - util.newBuffer = function newBuffer(sizeOrArray) { - /* istanbul ignore next */ - return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray); }; + exports.LastValueAggregation = LastValueAggregation; /** - * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. - * @type {Constructor} - */ - util.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array; - /** - * Any compatible Long instance. - * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js. - * @interface Long - * @property {number} low Low bits - * @property {number} high High bits - * @property {boolean} unsigned Whether unsigned or not + * The default histogram aggregation. + */ - /** - * Long.js's Long class if available. - * @type {Constructor} - */ - util.Long = util.global.dcodeIO && util.global.dcodeIO.Long || util.global.Long || (function() { - try { - var Long = require_umd(); - return Long && Long.isLong ? Long : null; - } catch (e) { - /* istanbul ignore next */ - return null; + var HistogramAggregation = class HistogramAggregation { + static DEFAULT_INSTANCE = new aggregator_1.HistogramAggregator([ + 0, + 5, + 10, + 25, + 50, + 75, + 100, + 250, + 500, + 750, + 1e3, + 2500, + 5e3, + 7500, + 1e4 + ], true); + createAggregator(_instrument) { + return HistogramAggregation.DEFAULT_INSTANCE; } - })(); - /** - * Regular expression used to verify 2 bit (`bool`) map keys. - * @type {RegExp} - * @const - */ - util.key2Re = /^true|false|0|1$/; - /** - * Regular expression used to verify 32 bit (`int32` etc.) map keys. - * @type {RegExp} - * @const - */ - util.key32Re = /^-?(?:0|[1-9][0-9]*)$/; - /** - * Regular expression used to verify 64 bit (`int64` etc.) map keys. - * @type {RegExp} - * @const - */ - util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/; - /** - * Converts a number or long to an 8 characters long hash string. - * @param {Long|number} value Value to convert - * @returns {string} Hash - */ - util.longToHash = function longToHash(value) { - return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash; }; + exports.HistogramAggregation = HistogramAggregation; /** - * Converts an 8 characters long hash string to a long or number. - * @param {string} hash Hash - * @param {boolean} [unsigned=false] Whether unsigned or not - * @returns {Long|number} Original value + * The explicit bucket histogram aggregation. */ - util.longFromHash = function longFromHash(hash, unsigned) { - var bits = util.LongBits.fromHash(hash); - if (util.Long) return util.Long.fromBits(bits.lo, bits.hi, unsigned); - return bits.toNumber(Boolean(unsigned)); + var ExplicitBucketHistogramAggregation = class { + _boundaries; + _recordMinMax; + /** + * @param boundaries the bucket boundaries of the histogram aggregation + * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. + */ + constructor(boundaries, recordMinMax = true) { + if (boundaries == null) throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array"); + boundaries = boundaries.concat(); + boundaries = boundaries.sort((a, b) => a - b); + const minusInfinityIndex = boundaries.lastIndexOf(-Infinity); + let infinityIndex = boundaries.indexOf(Infinity); + if (infinityIndex === -1) infinityIndex = void 0; + this._boundaries = boundaries.slice(minusInfinityIndex + 1, infinityIndex); + this._recordMinMax = recordMinMax; + } + createAggregator(_instrument) { + return new aggregator_1.HistogramAggregator(this._boundaries, this._recordMinMax); + } }; - /** - * Merges the properties of the source object into the destination object. - * @memberof util - * @param {Object.} dst Destination object - * @param {...(Object.|boolean)} src Source objects, optionally followed by an `ifNotSet` flag - * @returns {Object.} Destination object - */ - function merge(dst) { - var ifNotSet = typeof arguments[arguments.length - 1] === "boolean", limit = ifNotSet ? arguments.length - 1 : arguments.length; - ifNotSet = ifNotSet && arguments[arguments.length - 1]; - for (var a = 1; a < limit; ++a) { - var src = arguments[a]; - if (!src) continue; - for (var keys = Object.keys(src), i = 0; i < keys.length; ++i) if (!isUnsafeProperty(keys[i]) && (dst[keys[i]] === void 0 || !ifNotSet)) dst[keys[i]] = src[keys[i]]; + exports.ExplicitBucketHistogramAggregation = ExplicitBucketHistogramAggregation; + var ExponentialHistogramAggregation = class { + _maxSize; + _recordMinMax; + constructor(maxSize = 160, recordMinMax = true) { + this._maxSize = maxSize; + this._recordMinMax = recordMinMax; + } + createAggregator(_instrument) { + return new aggregator_1.ExponentialHistogramAggregator(this._maxSize, this._recordMinMax); } - return dst; - } - util.merge = merge; - /** - * Schema declaration nesting limit. - * @memberof util - * @type {number} - */ - util.nestingLimit = 32; - /** - * Recursion limit. - * @memberof util - * @type {number} - */ - util.recursionLimit = 100; - /** - * Makes a property safe for assignment as an own property. - * @memberof util - * @param {Object.} obj Object - * @param {string} key Property key - * @returns {undefined} - */ - util.makeProp = function makeProp(obj, key) { - Object.defineProperty(obj, key, { - enumerable: true, - configurable: true, - writable: true - }); }; + exports.ExponentialHistogramAggregation = ExponentialHistogramAggregation; /** - * Converts the first character of a string to lower case. - * @param {string} str String to convert - * @returns {string} Converted string + * The default aggregation. */ - util.lcFirst = function lcFirst(str) { - return str.charAt(0).toLowerCase() + str.substring(1); + var DefaultAggregation = class { + _resolve(instrument) { + switch (instrument.type) { + case MetricData_1.InstrumentType.COUNTER: + case MetricData_1.InstrumentType.UP_DOWN_COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: + case MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: return exports.SUM_AGGREGATION; + case MetricData_1.InstrumentType.GAUGE: + case MetricData_1.InstrumentType.OBSERVABLE_GAUGE: return exports.LAST_VALUE_AGGREGATION; + case MetricData_1.InstrumentType.HISTOGRAM: + if (instrument.advice.explicitBucketBoundaries) return new ExplicitBucketHistogramAggregation(instrument.advice.explicitBucketBoundaries); + return exports.HISTOGRAM_AGGREGATION; + } + api.diag.warn(`Unable to recognize instrument type: ${instrument.type}`); + return exports.DROP_AGGREGATION; + } + createAggregator(instrument) { + return this._resolve(instrument).createAggregator(instrument); + } }; - /** - * Creates a custom error constructor. - * @memberof util - * @param {string} name Error name - * @returns {Constructor} Custom error constructor - */ - function newError(name) { - function CustomError(message, properties) { - if (!(this instanceof CustomError)) return new CustomError(message, properties); - Object.defineProperty(this, "message", { get: function() { - return message; - } }); - /* istanbul ignore next */ - if (Error.captureStackTrace) Error.captureStackTrace(this, CustomError); - else Object.defineProperty(this, "stack", { value: (/* @__PURE__ */ new Error()).stack || "" }); - if (properties) merge(this, properties); - } - CustomError.prototype = Object.create(Error.prototype, { - constructor: { - value: CustomError, - writable: true, - enumerable: false, - configurable: true - }, - name: { - get: function get() { - return name; - }, - set: void 0, - enumerable: false, - configurable: true - }, - toString: { - value: function value() { - return this.name + ": " + this.message; - }, - writable: true, - enumerable: false, - configurable: true + exports.DefaultAggregation = DefaultAggregation; + exports.DROP_AGGREGATION = new DropAggregation(); + exports.SUM_AGGREGATION = new SumAggregation(); + exports.LAST_VALUE_AGGREGATION = new LastValueAggregation(); + exports.HISTOGRAM_AGGREGATION = new HistogramAggregation(); + exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = new ExponentialHistogramAggregation(); + exports.DEFAULT_AGGREGATION = new DefaultAggregation(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/AggregationOption.js +var require_AggregationOption = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toAggregation = exports.AggregationType = void 0; + const Aggregation_1 = require_Aggregation(); + var AggregationType; + (function(AggregationType) { + AggregationType[AggregationType["DEFAULT"] = 0] = "DEFAULT"; + AggregationType[AggregationType["DROP"] = 1] = "DROP"; + AggregationType[AggregationType["SUM"] = 2] = "SUM"; + AggregationType[AggregationType["LAST_VALUE"] = 3] = "LAST_VALUE"; + AggregationType[AggregationType["EXPLICIT_BUCKET_HISTOGRAM"] = 4] = "EXPLICIT_BUCKET_HISTOGRAM"; + AggregationType[AggregationType["EXPONENTIAL_HISTOGRAM"] = 5] = "EXPONENTIAL_HISTOGRAM"; + })(AggregationType || (exports.AggregationType = AggregationType = {})); + function toAggregation(option) { + switch (option.type) { + case AggregationType.DEFAULT: return Aggregation_1.DEFAULT_AGGREGATION; + case AggregationType.DROP: return Aggregation_1.DROP_AGGREGATION; + case AggregationType.SUM: return Aggregation_1.SUM_AGGREGATION; + case AggregationType.LAST_VALUE: return Aggregation_1.LAST_VALUE_AGGREGATION; + case AggregationType.EXPONENTIAL_HISTOGRAM: { + const expOption = option; + return new Aggregation_1.ExponentialHistogramAggregation(expOption.options?.maxSize, expOption.options?.recordMinMax); } - }); - return CustomError; - } - util.newError = newError; - /** - * Constructs a new protocol error. - * @classdesc Error subclass indicating a protocol specifc error. - * @memberof util - * @extends Error - * @template T extends Message - * @constructor - * @param {string} message Error message - * @param {Object.} [properties] Additional properties - * @example - * try { - * MyMessage.decode(someBuffer); // throws if required fields are missing - * } catch (e) { - * if (e instanceof ProtocolError && e.instance) - * console.log("decoded so far: " + JSON.stringify(e.instance)); - * } - */ - util.ProtocolError = newError("ProtocolError"); - /** - * So far decoded message instance. - * @name util.ProtocolError#instance - * @type {Message} - */ + case AggregationType.EXPLICIT_BUCKET_HISTOGRAM: { + const expOption = option; + if (expOption.options == null) return Aggregation_1.HISTOGRAM_AGGREGATION; + else return new Aggregation_1.ExplicitBucketHistogramAggregation(expOption.options?.boundaries, expOption.options?.recordMinMax); + } + default: throw new Error("Unsupported Aggregation"); + } + } + exports.toAggregation = toAggregation; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationSelector.js +var require_AggregationSelector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = exports.DEFAULT_AGGREGATION_SELECTOR = void 0; + const AggregationTemporality_1 = require_AggregationTemporality(); + const AggregationOption_1 = require_AggregationOption(); + const DEFAULT_AGGREGATION_SELECTOR = (_instrumentType) => { + return { type: AggregationOption_1.AggregationType.DEFAULT }; + }; + exports.DEFAULT_AGGREGATION_SELECTOR = DEFAULT_AGGREGATION_SELECTOR; + const DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = (_instrumentType) => AggregationTemporality_1.AggregationTemporality.CUMULATIVE; + exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/semconv.js +var require_semconv$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_ERROR_TYPE = exports.METRIC_OTEL_SDK_METRIC_READER_COLLECTION_DURATION = exports.OTEL_COMPONENT_TYPE_VALUE_PERIODIC_METRIC_READER = exports.ATTR_OTEL_COMPONENT_TYPE = exports.ATTR_OTEL_COMPONENT_NAME = void 0; /** - * A OneOf getter as returned by {@link util.oneOfGetter}. - * @typedef OneOfGetter - * @type {function} - * @returns {string|undefined} Set field name, if any + * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance. + * + * @example otlp_grpc_span_exporter/0 + * @example custom-name + * + * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts. + * E.g. implementations **MUST NOT** use UUIDs as values for this attribute. + * + * Implementations **MAY** achieve these goals by following a `/` pattern, e.g. `batching_span_processor/0`. + * Hereby `otel.component.type` refers to the corresponding attribute value of the component. + * + * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed. + * For example, `` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an + * instance of the given component type is started. + * + * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0` + * as `otel.component.name`, the second one `batching_span_processor/1` and so on. + * These values will therefore be reused in the case of an application restart. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ + exports.ATTR_OTEL_COMPONENT_NAME = "otel.component.name"; /** - * Builds a getter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfGetter} Unbound getter + * A name identifying the type of the OpenTelemetry component. + * + * @example batching_span_processor + * @example com.example.MySpanExporter + * + * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type. + * E.g. for Java the fully qualified classname **SHOULD** be used in this case. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - util.oneOfGetter = function getOneOf(fieldNames) { - var fieldMap = {}; - for (var i = 0; i < fieldNames.length; ++i) fieldMap[fieldNames[i]] = 1; - /** - * @returns {string|undefined} Set field name, if any - * @this Object - * @ignore - */ - return function() { - for (var keys = Object.keys(this), i$1 = keys.length - 1; i$1 > -1; --i$1) if (fieldMap[keys[i$1]] === 1 && this[keys[i$1]] !== void 0 && this[keys[i$1]] !== null) return keys[i$1]; - }; - }; + exports.ATTR_OTEL_COMPONENT_TYPE = "otel.component.type"; /** - * A OneOf setter as returned by {@link util.oneOfSetter}. - * @typedef OneOfSetter - * @type {function} - * @param {string|undefined} value Field name - * @returns {undefined} + * Enum value "periodic_metric_reader" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}. + * + * The builtin SDK periodically exporting metric reader + * + * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ + exports.OTEL_COMPONENT_TYPE_VALUE_PERIODIC_METRIC_READER = "periodic_metric_reader"; /** - * Builds a setter for a oneof's present field name. - * @param {string[]} fieldNames Field names - * @returns {OneOfSetter} Unbound setter + * The duration of the collect operation of the metric reader. + * + * @note For successful collections, `error.type` **MUST NOT** be set. For failed collections, `error.type` **SHOULD** contain the failure cause. + * It can happen that metrics collection is successful for some MetricProducers, while others fail. In that case `error.type` **SHOULD** be set to any of the failure causes. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - util.oneOfSetter = function setOneOf(fieldNames) { - /** - * @param {string} name Field name - * @returns {undefined} - * @this Object - * @ignore - */ - return function(name) { - for (var i = 0; i < fieldNames.length; ++i) if (fieldNames[i] !== name) delete this[fieldNames[i]]; - }; - }; + exports.METRIC_OTEL_SDK_METRIC_READER_COLLECTION_DURATION = "otel.sdk.metric_reader.collection.duration"; /** - * Default conversion options used for {@link Message#toJSON} implementations. + * Describes a class of error the operation ended with. + * + * @example timeout + * @example java.net.UnknownHostException + * @example server_certificate_invalid + * @example 500 + * + * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality. + * + * When `error.type` is set to a type (e.g., an exception type), its + * canonical class name identifying the type within the artifact **SHOULD** be used. + * + * Instrumentations **SHOULD** document the list of errors they report. + * + * The cardinality of `error.type` within one instrumentation library **SHOULD** be low. + * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications + * should be prepared for `error.type` to have high cardinality at query time when no + * additional filters are applied. * - * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`. * - * - Longs become strings - * - Enums become string keys - * - Bytes become base64 encoded strings - * - (Sub-)Messages become plain objects - * - Maps become plain objects with all string keys - * - Repeated fields become arrays - * - NaN and Infinity for float and double fields become strings + * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes), + * it's **RECOMMENDED** to: * - * @type {IConversionOptions} - * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + * - Use a domain-specific attribute + * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. */ - util.toJSONOptions = { - longs: String, - enums: String, - bytes: String, - json: true - }; - util._configure = function() { - var Buffer$1 = util.Buffer; - /* istanbul ignore if */ - if (!Buffer$1) { - util._Buffer_from = util._Buffer_allocUnsafe = null; - return; + exports.ATTR_ERROR_TYPE = "error.type"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricReaderMetrics.js +var require_MetricReaderMetrics = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricReaderMetrics = void 0; + const semconv_1 = require_semconv$3(); + const componentCounter = /* @__PURE__ */ new Map(); + /** + * Generates `otel.sdk.metric_reader.*` self-observability metrics. + * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#metric-otelsdkmetric_readercollectionduration + */ + var MetricReaderMetrics = class { + collectionDuration; + standardAttrs; + constructor(componentType, meter) { + const counter = componentCounter.get(componentType) ?? 0; + componentCounter.set(componentType, counter + 1); + this.standardAttrs = { + [semconv_1.ATTR_OTEL_COMPONENT_TYPE]: componentType, + [semconv_1.ATTR_OTEL_COMPONENT_NAME]: `${componentType}/${counter}` + }; + this.collectionDuration = meter.createHistogram(semconv_1.METRIC_OTEL_SDK_METRIC_READER_COLLECTION_DURATION, { + unit: "s", + description: "The duration of the collect operation of the metric reader.", + advice: { explicitBucketBoundaries: [] } + }); + } + recordCollection(durationSecs, error) { + const attrs = error ? { + ...this.standardAttrs, + [semconv_1.ATTR_ERROR_TYPE]: error + } : this.standardAttrs; + this.collectionDuration.record(durationSecs, attrs); } - util._Buffer_from = Buffer$1.from !== Uint8Array.from && Buffer$1.from || function Buffer_from(value, encoding) { - return new Buffer$1(value, encoding); - }; - util._Buffer_allocUnsafe = Buffer$1.allocUnsafe || function Buffer_allocUnsafe(size) { - return new Buffer$1(size); - }; }; + exports.MetricReaderMetrics = MetricReaderMetrics; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/version.js +var require_version$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "2.10.0"; })); //#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/writer.js -var require_writer = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = Writer; - var util = require_minimal$1(); - var BufferWriter; - var LongBits = util.LongBits, base64 = util.base64, utf8 = util.utf8; +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricReader.js +var require_MetricReader = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricReader = void 0; + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const utils_1 = require_utils$3(); + const AggregationSelector_1 = require_AggregationSelector(); + const MetricReaderMetrics_1 = require_MetricReaderMetrics(); + const version_1 = require_version$1(); + const core_1 = require_src$8(); /** - * Constructs a new writer operation instance. - * @classdesc Scheduled writer operation. - * @constructor - * @param {function(*, Uint8Array, number)} fn Function to call - * @param {number} len Value byte length - * @param {*} val Value to write - * @ignore + * A registered reader of metrics that, when linked to a {@link MetricProducer}, offers global + * control over metrics. */ - function Op(fn, len, val) { - /** - * Function to call. - * @type {function(Uint8Array, number, *)} - */ - this.fn = fn; - /** - * Value byte length. - * @type {number} - */ - this.len = len; - /** - * Next operation. - * @type {Writer.Op|undefined} - */ - this.next = void 0; + var MetricReader = class { + _shutdown = false; + _metricProducers; + _sdkMetricProducer; + _selfObsMetrics; + _aggregationTemporalitySelector; + _aggregationSelector; + _cardinalitySelector; + _otelComponentType; + constructor(options) { + this._aggregationSelector = options?.aggregationSelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_SELECTOR; + this._aggregationTemporalitySelector = options?.aggregationTemporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; + this._metricProducers = options?.metricProducers ?? []; + this._cardinalitySelector = options?.cardinalitySelector; + this._otelComponentType = options?.otelComponentType ?? this.constructor.name; + this._selfObsMetrics = new MetricReaderMetrics_1.MetricReaderMetrics(this._otelComponentType, api.createNoopMeter()); + } + setMetricProducer(metricProducer) { + if (this._sdkMetricProducer) throw new Error("MetricReader can not be bound to a MeterProvider again."); + this._sdkMetricProducer = metricProducer; + this.onInitialized(); + } + _setSelfObsMeterProvider(meterProvider) { + const meter = meterProvider.getMeter("@opentelemetry/sdk-metrics", version_1.VERSION); + this._selfObsMetrics = new MetricReaderMetrics_1.MetricReaderMetrics(this._otelComponentType, meter); + } + selectAggregation(instrumentType) { + return this._aggregationSelector(instrumentType); + } + selectAggregationTemporality(instrumentType) { + return this._aggregationTemporalitySelector(instrumentType); + } + selectCardinalityLimit(instrumentType) { + return this._cardinalitySelector ? this._cardinalitySelector(instrumentType) : 2e3; + } /** - * Value to write. - * @type {*} + * Handle once the SDK has initialized this {@link MetricReader} + * Overriding this method is optional. */ - this.val = val; - } - /* istanbul ignore next */ - function noop() {} - /** - * Constructs a new writer state instance. - * @classdesc Copied writer state. - * @memberof Writer - * @constructor - * @param {Writer} writer Writer to copy state from - * @ignore - */ - function State(writer) { - /** - * Current head. - * @type {Writer.Op} - */ - this.head = writer.head; - /** - * Current tail. - * @type {Writer.Op} - */ - this.tail = writer.tail; - /** - * Current buffer length. - * @type {number} - */ - this.len = writer.len; - /** - * Next state. - * @type {State|null} - */ - this.next = writer.states; - } - /** - * Constructs a new writer instance. - * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`. - * @constructor - */ - function Writer() { - /** - * Current length. - * @type {number} - */ - this.len = 0; - /** - * Operations head. - * @type {Object} - */ - this.head = new Op(noop, 0, 0); - /** - * Operations tail - * @type {Object} - */ - this.tail = this.head; - /** - * Linked forked states. - * @type {Object|null} - */ - this.states = null; - } - var create = function create() { - return util.Buffer ? function create_buffer_setup() { - return (Writer.create = function create_buffer() { - return new BufferWriter(); - })(); - } : function create_array() { - return new Writer(); - }; - }; - /** - * Creates a new writer. - * @function - * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer} - */ - Writer.create = create(); - /** - * Allocates a buffer of the specified size. - * @param {number} size Buffer size - * @returns {Uint8Array} Buffer - */ - Writer.alloc = function alloc(size) { - return new util.Array(size); - }; - /* istanbul ignore else */ - if (util.Array !== Array) Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray); - /** - * Pushes a new operation to the queue. - * @param {function(Uint8Array, number, *)} fn Function to call - * @param {number} len Value byte length - * @param {number} val Value to write - * @returns {Writer} `this` - * @private - */ - Writer.prototype._push = function push(fn, len, val) { - this.tail = this.tail.next = new Op(fn, len, val); - this.len += len; - return this; - }; - function writeByte(val, buf, pos) { - buf[pos] = val & 255; - } - function writeVarint32(val, buf, pos) { - while (val > 127) { - buf[pos++] = val & 127 | 128; - val >>>= 7; - } - buf[pos] = val; - } - /** - * Constructs a new varint writer operation instance. - * @classdesc Scheduled varint writer operation. - * @extends Op - * @constructor - * @param {number} len Value byte length - * @param {number} val Value to write - * @ignore - */ - function VarintOp(len, val) { - this.len = len; - this.next = void 0; - this.val = val; - } - VarintOp.prototype = Object.create(Op.prototype); - VarintOp.prototype.fn = writeVarint32; - /** - * Writes an unsigned 32 bit value as a varint. - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.uint32 = function write_uint32(value) { - this.len += (this.tail = this.tail.next = new VarintOp((value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5, value)).len; - return this; - }; - /** - * Writes a signed 32 bit value as a varint. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.int32 = function write_int32(value) { - return (value |= 0) < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) : this.uint32(value); - }; - /** - * Writes a 32 bit value as a varint, zig-zag encoded. - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.sint32 = function write_sint32(value) { - return this.uint32((value << 1 ^ value >> 31) >>> 0); - }; - function writeVarint64(val, buf, pos) { - var lo = val.lo, hi = val.hi; - while (hi) { - buf[pos++] = lo & 127 | 128; - lo = (lo >>> 7 | hi << 25) >>> 0; - hi >>>= 7; - } - while (lo > 127) { - buf[pos++] = lo & 127 | 128; - lo = lo >>> 7; + onInitialized() {} + async collect(options) { + if (this._sdkMetricProducer === void 0) throw new Error("MetricReader is not bound to a MetricProducer"); + if (this._shutdown) throw new Error("MetricReader is shutdown"); + const startTime = (0, core_1.hrTime)(); + const [sdkCollectionResults, ...additionalCollectionResults] = await Promise.all([this._sdkMetricProducer.collect({ timeoutMillis: options?.timeoutMillis }), ...this._metricProducers.map((producer) => producer.collect({ timeoutMillis: options?.timeoutMillis }))]); + const endTime = (0, core_1.hrTime)(); + const errors = sdkCollectionResults.errors.concat(additionalCollectionResults.flatMap((result) => result.errors)); + const collectDuration = (0, core_1.hrTimeToSeconds)((0, core_1.hrTimeDuration)(startTime, endTime)); + this._selfObsMetrics.recordCollection(collectDuration, errors.length > 0 ? errors[0].name ?? "collect_error" : void 0); + return { + resourceMetrics: { + resource: sdkCollectionResults.resourceMetrics.resource, + scopeMetrics: sdkCollectionResults.resourceMetrics.scopeMetrics.concat(additionalCollectionResults.flatMap((result) => result.resourceMetrics.scopeMetrics)) + }, + errors + }; } - buf[pos++] = lo; - } - /** - * Writes an unsigned 64 bit value as a varint. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.uint64 = function write_uint64(value) { - var bits = LongBits.from(value); - return this._push(writeVarint64, bits.length(), bits); - }; - /** - * Writes a signed 64 bit value as a varint. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.int64 = Writer.prototype.uint64; - /** - * Writes a signed 64 bit value as a varint, zig-zag encoded. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.sint64 = function write_sint64(value) { - var bits = LongBits.from(value).zzEncode(); - return this._push(writeVarint64, bits.length(), bits); - }; - /** - * Writes a boolish value as a varint. - * @param {boolean} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.bool = function write_bool(value) { - return this._push(writeByte, 1, value ? 1 : 0); - }; - function writeFixed32(val, buf, pos) { - buf[pos] = val & 255; - buf[pos + 1] = val >>> 8 & 255; - buf[pos + 2] = val >>> 16 & 255; - buf[pos + 3] = val >>> 24; - } - /** - * Writes an unsigned 32 bit value as fixed 32 bits. - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.fixed32 = function write_fixed32(value) { - return this._push(writeFixed32, 4, value >>> 0); - }; - /** - * Writes a signed 32 bit value as fixed 32 bits. - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.sfixed32 = Writer.prototype.fixed32; - /** - * Writes an unsigned 64 bit value as fixed 64 bits. - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.fixed64 = function write_fixed64(value) { - var bits = LongBits.from(value); - return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi); - }; - /** - * Writes a signed 64 bit value as fixed 64 bits. - * @function - * @param {Long|number|string} value Value to write - * @returns {Writer} `this` - * @throws {TypeError} If `value` is a string and no long library is present. - */ - Writer.prototype.sfixed64 = Writer.prototype.fixed64; - /** - * Writes a float (32 bit). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.float = function write_float(value) { - return this._push(util.float.writeFloatLE, 4, value); - }; - /** - * Writes a double (64 bit float). - * @function - * @param {number} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.double = function write_double(value) { - return this._push(util.float.writeDoubleLE, 8, value); - }; - var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) { - buf.set(val, pos); - } : function writeBytes_for(val, buf, pos) { - for (var i = 0; i < val.length; ++i) buf[pos + i] = val[i]; - }; - /** - * Writes a sequence of bytes. - * @param {Uint8Array|string} value Buffer or base64 encoded string to write - * @returns {Writer} `this` - */ - Writer.prototype.bytes = function write_bytes(value) { - var len = value.length >>> 0; - if (!len) return this._push(writeByte, 1, 0); - if (util.isString(value)) { - var buf = Writer.alloc(len = base64.length(value)); - base64.decode(value, buf, 0); - value = buf; + async shutdown(options) { + if (this._shutdown) { + api.diag.error("Cannot call shutdown twice."); + return; + } + if (options?.timeoutMillis == null) await this.onShutdown(); + else await (0, utils_1.callWithTimeout)(this.onShutdown(), options.timeoutMillis); + this._shutdown = true; } - return this.uint32(len)._push(writeBytes, len, value); - }; - /** - * Writes a string. - * @param {string} value Value to write - * @returns {Writer} `this` - */ - Writer.prototype.string = function write_string(value) { - var len = utf8.length(value); - return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0); - }; - /** - * Forks this writer's state by pushing it to a stack. - * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. - * @returns {Writer} `this` - */ - Writer.prototype.fork = function fork() { - this.states = new State(this); - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; - return this; - }; - /** - * Resets this instance to the last state. - * @returns {Writer} `this` - */ - Writer.prototype.reset = function reset() { - if (this.states) { - this.head = this.states.head; - this.tail = this.states.tail; - this.len = this.states.len; - this.states = this.states.next; - } else { - this.head = this.tail = new Op(noop, 0, 0); - this.len = 0; + async forceFlush(options) { + if (this._shutdown) { + api.diag.warn("Cannot forceFlush on already shutdown MetricReader."); + return; + } + if (options?.timeoutMillis == null) { + await this.onForceFlush(); + return; + } + await (0, utils_1.callWithTimeout)(this.onForceFlush(), options.timeoutMillis); } - return this; }; + exports.MetricReader = MetricReader; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricDataSplitter.js +var require_MetricDataSplitter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.splitMetricData = void 0; /** - * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. - * @returns {Writer} `this` + * Splits a ResourceMetrics object into smaller ResourceMetrics objects + * such that no batch exceeds maxExportBatchSize data points. + * @param resourceMetrics The metrics to split. + * @param maxExportBatchSize The maximum number of data points per batch. + * @internal */ - Writer.prototype.ldelim = function ldelim() { - var head = this.head, tail = this.tail, len = this.len; - this.reset().uint32(len); - if (len) { - this.tail.next = head.next; - this.tail = tail; - this.len += len; + function splitMetricData(resourceMetrics, maxExportBatchSize) { + if (!Number.isInteger(maxExportBatchSize) || maxExportBatchSize <= 0) throw new Error("maxExportBatchSize must be a positive integer"); + const batches = []; + let currentBatchPoints = 0; + let currentScopeMetrics = []; + function flush() { + if (currentScopeMetrics.length > 0) { + batches.push({ + resource: resourceMetrics.resource, + scopeMetrics: currentScopeMetrics + }); + currentScopeMetrics = []; + currentBatchPoints = 0; + } } - return this; - }; - /** - * Finishes the write operation. - * @returns {Uint8Array} Finished buffer - */ - Writer.prototype.finish = function finish() { - var head = this.head.next, buf = this.constructor.alloc(this.len), pos = 0; - while (head) { - head.fn(head.val, buf, pos); - pos += head.len; - head = head.next; + for (const scopeMetric of resourceMetrics.scopeMetrics) { + let scopeMetricCopy = null; + for (const metric of scopeMetric.metrics) { + const dataPoints = metric.dataPoints; + if (dataPoints.length === 0) { + if (!scopeMetricCopy) { + scopeMetricCopy = { + scope: scopeMetric.scope, + metrics: [] + }; + currentScopeMetrics.push(scopeMetricCopy); + } + scopeMetricCopy.metrics.push(metric); + continue; + } + let offset = 0; + while (offset < dataPoints.length) { + const spaceLeft = maxExportBatchSize - currentBatchPoints; + const take = Math.min(spaceLeft, dataPoints.length - offset); + if (!scopeMetricCopy) { + scopeMetricCopy = { + scope: scopeMetric.scope, + metrics: [] + }; + currentScopeMetrics.push(scopeMetricCopy); + } + const metricCopy = { + ...metric, + dataPoints: dataPoints.slice(offset, offset + take) + }; + scopeMetricCopy.metrics.push(metricCopy); + offset += take; + currentBatchPoints += take; + if (currentBatchPoints === maxExportBatchSize) { + flush(); + scopeMetricCopy = null; + } + } + } } - return buf; - }; - Writer._configure = function(BufferWriter_) { - BufferWriter = BufferWriter_; - Writer.create = create(); - BufferWriter._configure(); - }; + flush(); + return batches; + } + exports.splitMetricData = splitMetricData; })); //#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/writer_buffer.js -var require_writer_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = BufferWriter; - var Writer = require_writer(); - (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter; - var util = require_minimal$1(); +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/PeriodicExportingMetricReader.js +var require_PeriodicExportingMetricReader = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PeriodicExportingMetricReader = void 0; + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + const MetricReader_1 = require_MetricReader(); + const utils_1 = require_utils$3(); + const MetricData_1 = require_MetricData(); + const MetricDataSplitter_1 = require_MetricDataSplitter(); + const semconv_1 = require_semconv$3(); /** - * Constructs a new buffer writer instance. - * @classdesc Wire format writer using node buffers. - * @extends Writer - * @constructor + * {@link MetricReader} which collects metrics based on a user-configurable time interval, and passes the metrics to + * the configured {@link PushMetricExporter} */ - function BufferWriter() { - Writer.call(this); - } - BufferWriter._configure = function() { + var PeriodicExportingMetricReader = class extends MetricReader_1.MetricReader { + _interval; + _exporter; + _exportInterval; + _exportTimeout; + _maxExportBatchSize; + _ongoingExportPromise = null; + constructor(options) { + const { exporter, exportIntervalMillis = 6e4, metricProducers, cardinalityLimits, maxExportBatchSize } = options; + let { exportTimeoutMillis = 3e4 } = options; + super({ + aggregationSelector: exporter.selectAggregation?.bind(exporter), + aggregationTemporalitySelector: exporter.selectAggregationTemporality?.bind(exporter), + otelComponentType: semconv_1.OTEL_COMPONENT_TYPE_VALUE_PERIODIC_METRIC_READER, + metricProducers, + cardinalitySelector: (instrumentType) => { + const limits = { + default: 2e3, + ...cardinalityLimits + }; + switch (instrumentType) { + case MetricData_1.InstrumentType.COUNTER: return limits.counter ?? limits.default; + case MetricData_1.InstrumentType.GAUGE: return limits.gauge ?? limits.default; + case MetricData_1.InstrumentType.HISTOGRAM: return limits.histogram ?? limits.default; + case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: return limits.observableCounter ?? limits.default; + case MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: return limits.observableUpDownCounter ?? limits.default; + case MetricData_1.InstrumentType.OBSERVABLE_GAUGE: return limits.observableGauge ?? limits.default; + case MetricData_1.InstrumentType.UP_DOWN_COUNTER: return limits.upDownCounter ?? limits.default; + default: return limits.default; + } + } + }); + if (exportIntervalMillis <= 0) throw Error("exportIntervalMillis must be greater than 0"); + if (exportTimeoutMillis <= 0) throw Error("exportTimeoutMillis must be greater than 0"); + if (maxExportBatchSize !== void 0 && (!Number.isInteger(maxExportBatchSize) || maxExportBatchSize <= 0)) throw Error("maxExportBatchSize must be a positive integer"); + if (exportIntervalMillis < exportTimeoutMillis) { + if ("exportIntervalMillis" in options && "exportTimeoutMillis" in options) throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis"); + else { + api.diag.info(`Timeout of ${exportTimeoutMillis} exceeds the interval of ${exportIntervalMillis}. Clamping timeout to interval duration.`); + exportTimeoutMillis = exportIntervalMillis; + } + } + this._exportInterval = exportIntervalMillis; + this._exportTimeout = exportTimeoutMillis; + this._exporter = exporter; + this._maxExportBatchSize = maxExportBatchSize; + } + async _runOnce() { + try { + await this._doRun(); + } catch (err) { + (0, core_1.globalErrorHandler)(err); + } + } + async _doRun() { + if (this._ongoingExportPromise) { + api.diag.debug("PeriodicExportingMetricReader: export already in progress, skipping"); + return; + } + const currentRun = async () => { + const { resourceMetrics, errors } = await this.collect({ timeoutMillis: this._exportTimeout }); + if (errors.length > 0) api.diag.error("PeriodicExportingMetricReader: metrics collection errors", ...errors); + if (resourceMetrics.resource.asyncAttributesPending) try { + await resourceMetrics.resource.waitForAsyncAttributes?.(); + } catch (e) { + api.diag.debug("Error while resolving async portion of resource: ", e); + (0, core_1.globalErrorHandler)(e); + } + if (resourceMetrics.scopeMetrics.length === 0) return; + const batches = this._maxExportBatchSize ? (0, MetricDataSplitter_1.splitMetricData)(resourceMetrics, this._maxExportBatchSize) : [resourceMetrics]; + let anyErr = null; + for (const batch of batches) try { + const result = await (0, utils_1.callWithTimeout)(core_1.internal._export(this._exporter, batch), this._exportTimeout); + if (result.code !== core_1.ExportResultCode.SUCCESS) anyErr = /* @__PURE__ */ new Error(`PeriodicExportingMetricReader: metrics export failed (error ${result.error})`); + } catch (e) { + if (e instanceof utils_1.TimeoutError) { + api.diag.error(`PeriodicExportingMetricReader: metrics export timed out after ${this._exportTimeout}ms`); + break; + } else { + api.diag.error("PeriodicExportingMetricReader: metrics export threw error", e); + anyErr = e instanceof Error ? e : new Error(String(e)); + } + } + if (anyErr) throw anyErr; + }; + this._ongoingExportPromise = currentRun(); + try { + await this._ongoingExportPromise; + } finally { + this._ongoingExportPromise = null; + } + } + onInitialized() { + this._interval = setInterval(() => { + this._runOnce(); + }, this._exportInterval); + if (typeof this._interval !== "number") this._interval.unref(); + } + async onForceFlush() { + await this._awaitOngoingExport(); + if (this._ongoingExportPromise) await this._awaitOngoingExport(); + else await this._runOnce(); + await this._exporter.forceFlush(); + } /** - * Allocates a buffer of the specified size. - * @function - * @param {number} size Buffer size - * @returns {Buffer} Buffer + * Helper function to wait for an ongoing export to complete. + * Errors are swallowed and handled by the original _runOnce(). */ - BufferWriter.alloc = util._Buffer_allocUnsafe; - BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) { - buf.set(val, pos); - } : function writeBytesBuffer_copy(val, buf, pos) { - if (val.copy) val.copy(buf, pos, 0, val.length); - else for (var i = 0; i < val.length;) buf[pos++] = val[i++]; - }; - }; - /** - * @override - */ - BufferWriter.prototype.bytes = function write_bytes_buffer(value) { - if (util.isString(value)) value = util._Buffer_from(value, "base64"); - var len = value.length >>> 0; - this.uint32(len); - if (len) this._push(BufferWriter.writeBytesBuffer, len, value); - return this; - }; - function writeStringBuffer(val, buf, pos) { - if (val.length < 40) util.utf8.write(val, buf, pos); - else if (buf.utf8Write) buf.utf8Write(val, pos); - else buf.write(val, pos); - } - /** - * @override - */ - BufferWriter.prototype.string = function write_string_buffer(value) { - var len = util.Buffer.byteLength(value); - this.uint32(len); - if (len) this._push(writeStringBuffer, len, value); - return this; + async _awaitOngoingExport() { + if (this._ongoingExportPromise) { + api.diag.debug("PeriodicExportingMetricReader: export already in progress, awaiting ongoing export"); + try { + await this._ongoingExportPromise; + } catch {} + } + } + async onShutdown() { + if (this._interval) clearInterval(this._interval); + await this.onForceFlush(); + await this._exporter.shutdown(); + } }; - /** - * Finishes the write operation. - * @name BufferWriter#finish - * @function - * @returns {Buffer} Finished buffer - */ - BufferWriter._configure(); + exports.PeriodicExportingMetricReader = PeriodicExportingMetricReader; })); //#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/reader.js -var require_reader = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = Reader; - var util = require_minimal$1(); - var BufferReader; - var LongBits = util.LongBits, utf8 = util.utf8; - /* istanbul ignore next */ - function indexOutOfRange(reader, writeLength) { - return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len); - } +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/InMemoryMetricExporter.js +var require_InMemoryMetricExporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InMemoryMetricExporter = void 0; + const core_1 = require_src$8(); /** - * Constructs a new reader instance using the specified buffer. - * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`. - * @constructor - * @param {Uint8Array} buffer Buffer to read from + * In-memory Metrics Exporter is a Push Metric Exporter + * which accumulates metrics data in the local memory and + * allows to inspect it (useful for e.g. unit tests). */ - function Reader(buffer) { - /** - * Read buffer. - * @type {Uint8Array} - */ - this.buf = buffer; + var InMemoryMetricExporter = class { + _shutdown = false; + _aggregationTemporality; + _metrics = []; + constructor(aggregationTemporality) { + this._aggregationTemporality = aggregationTemporality; + } /** - * Read buffer position. - * @type {number} + * @inheritedDoc */ - this.pos = 0; + export(metrics, resultCallback) { + if (this._shutdown) { + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.FAILED }), 0); + return; + } + this._metrics.push(metrics); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } /** - * Read buffer length. - * @type {number} + * Returns all the collected resource metrics + * @returns ResourceMetrics[] */ - this.len = buffer.length; - } - var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) { - if (buffer instanceof Uint8Array || Array.isArray(buffer)) return new Reader(buffer); - throw Error("illegal buffer"); - } : function create_array(buffer) { - if (Array.isArray(buffer)) return new Reader(buffer); - throw Error("illegal buffer"); - }; - var create = function create() { - return util.Buffer ? function create_buffer_setup(buffer) { - return (Reader.create = function create_buffer(buffer$1) { - return util.Buffer.isBuffer(buffer$1) ? new BufferReader(buffer$1) : create_array(buffer$1); - })(buffer); - } : create_array; - }; - /** - * Creates a new reader using the specified buffer. - * @function - * @param {Uint8Array|Buffer} buffer Buffer to read from - * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader} - * @throws {Error} If `buffer` is not a valid buffer - */ - Reader.create = create(); - Reader.prototype._slice = util.Array.prototype.subarray || util.Array.prototype.slice; - /** - * Reads a varint as an unsigned 32 bit value. - * @function - * @returns {number} Value read - */ - Reader.prototype.uint32 = (function read_uint32_setup() { - var value = 4294967295; - return function read_uint32() { - value = (this.buf[this.pos] & 127) >>> 0; - if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; - if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; - if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; - if (this.buf[this.pos++] < 128) return value; - value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; - if (this.buf[this.pos++] < 128) return value; - /* istanbul ignore if */ - if ((this.pos += 5) > this.len) { - this.pos = this.len; - throw indexOutOfRange(this, 10); - } - return value; - }; - })(); - /** - * Reads a varint as a signed 32 bit value. - * @returns {number} Value read - */ - Reader.prototype.int32 = function read_int32() { - return this.uint32() | 0; - }; - /** - * Reads a zig-zag encoded varint as a signed 32 bit value. - * @returns {number} Value read - */ - Reader.prototype.sint32 = function read_sint32() { - var value = this.uint32(); - return value >>> 1 ^ -(value & 1) | 0; - }; - function readLongVarint() { - var bits = new LongBits(0, 0); - var i = 0; - if (this.len - this.pos > 4) { - for (; i < 4; ++i) { - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) return bits; - } - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0; - bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0; - if (this.buf[this.pos++] < 128) return bits; - i = 0; - } else { - for (; i < 3; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) throw indexOutOfRange(this); - bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0; - if (this.buf[this.pos++] < 128) return bits; - } - bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0; - return bits; + getMetrics() { + return this._metrics; } - if (this.len - this.pos > 4) for (; i < 5; ++i) { - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) return bits; + forceFlush() { + return Promise.resolve(); } - else for (; i < 5; ++i) { - /* istanbul ignore if */ - if (this.pos >= this.len) throw indexOutOfRange(this); - bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0; - if (this.buf[this.pos++] < 128) return bits; + reset() { + this._metrics = []; } - /* istanbul ignore next */ - throw Error("invalid varint encoding"); - } - /** - * Reads a varint as a signed 64 bit value. - * @name Reader#int64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a varint as an unsigned 64 bit value. - * @name Reader#uint64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a zig-zag encoded varint as a signed 64 bit value. - * @name Reader#sint64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a varint as a boolean. - * @returns {boolean} Value read - */ - Reader.prototype.bool = function read_bool() { - return this.uint32() !== 0; - }; - function readFixed32_end(buf, end) { - return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0; - } - /** - * Reads fixed 32 bits as an unsigned 32 bit integer. - * @returns {number} Value read - */ - Reader.prototype.fixed32 = function read_fixed32() { - /* istanbul ignore if */ - if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); - return readFixed32_end(this.buf, this.pos += 4); - }; - /** - * Reads fixed 32 bits as a signed 32 bit integer. - * @returns {number} Value read - */ - Reader.prototype.sfixed32 = function read_sfixed32() { - /* istanbul ignore if */ - if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); - return readFixed32_end(this.buf, this.pos += 4) | 0; - }; - function readFixed64() { - /* istanbul ignore if */ - if (this.pos + 8 > this.len) throw indexOutOfRange(this, 8); - return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4)); - } - /** - * Reads fixed 64 bits. - * @name Reader#fixed64 - * @function - * @returns {Long} Value read - */ - /** - * Reads zig-zag encoded fixed 64 bits. - * @name Reader#sfixed64 - * @function - * @returns {Long} Value read - */ - /** - * Reads a float (32 bit) as a number. - * @function - * @returns {number} Value read - */ - Reader.prototype.float = function read_float() { - /* istanbul ignore if */ - if (this.pos + 4 > this.len) throw indexOutOfRange(this, 4); - var value = util.float.readFloatLE(this.buf, this.pos); - this.pos += 4; - return value; - }; - /** - * Reads a double (64 bit float) as a number. - * @function - * @returns {number} Value read - */ - Reader.prototype.double = function read_double() { - /* istanbul ignore if */ - if (this.pos + 8 > this.len) throw indexOutOfRange(this, 4); - var value = util.float.readDoubleLE(this.buf, this.pos); - this.pos += 8; - return value; - }; - /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @returns {Uint8Array} Value read - */ - Reader.prototype.bytes = function read_bytes() { - var length = this.uint32(), start = this.pos, end = this.pos + length; - /* istanbul ignore if */ - if (end > this.len) throw indexOutOfRange(this, length); - this.pos += length; - if (Array.isArray(this.buf)) return this.buf.slice(start, end); - if (start === end) { - var nativeBuffer = util.Buffer; - return nativeBuffer ? nativeBuffer.alloc(0) : new this.buf.constructor(0); + selectAggregationTemporality(_instrumentType) { + return this._aggregationTemporality; } - return this._slice.call(this.buf, start, end); - }; - /** - * Reads a string preceeded by its byte length as a varint. - * @returns {string} Value read - */ - Reader.prototype.string = function read_string() { - var bytes = this.bytes(); - return utf8.read(bytes, 0, bytes.length); - }; - /** - * Skips the specified number of bytes if specified, otherwise skips a varint. - * @param {number} [length] Length if known, otherwise a varint is assumed - * @returns {Reader} `this` - */ - Reader.prototype.skip = function skip(length) { - if (typeof length === "number") { - /* istanbul ignore if */ - if (this.pos + length > this.len) throw indexOutOfRange(this, length); - this.pos += length; - } else do - /* istanbul ignore if */ - if (this.pos >= this.len) throw indexOutOfRange(this); - while (this.buf[this.pos++] & 128); - return this; - }; - /** - * Recursion limit. - * @type {number} - */ - Reader.recursionLimit = util.recursionLimit; - /** - * Skips the next element of the specified wire type. - * @param {number} wireType Wire type received - * @param {number} [depth] Depth of recursion to control nested calls; 0 if omitted - * @returns {Reader} `this` - */ - Reader.prototype.skipType = function(wireType, depth) { - if (depth === void 0) depth = 0; - if (depth > Reader.recursionLimit) throw Error("maximum nesting depth exceeded"); - switch (wireType) { - case 0: - this.skip(); - break; - case 1: - this.skip(8); - break; - case 2: - this.skip(this.uint32()); - break; - case 3: - while ((wireType = this.uint32() & 7) !== 4) this.skipType(wireType, depth + 1); - break; - case 5: - this.skip(4); - break; - default: throw Error("invalid wire type " + wireType + " at offset " + this.pos); + shutdown() { + this._shutdown = true; + return Promise.resolve(); } - return this; - }; - Reader._configure = function(BufferReader_) { - BufferReader = BufferReader_; - Reader.create = create(); - BufferReader._configure(); - var fn = util.Long ? "toLong" : "toNumber"; - util.merge(Reader.prototype, { - int64: function read_int64() { - return readLongVarint.call(this)[fn](false); - }, - uint64: function read_uint64() { - return readLongVarint.call(this)[fn](true); - }, - sint64: function read_sint64() { - return readLongVarint.call(this).zzDecode()[fn](false); - }, - fixed64: function read_fixed64() { - return readFixed64.call(this)[fn](true); - }, - sfixed64: function read_sfixed64() { - return readFixed64.call(this)[fn](false); - } - }); }; + exports.InMemoryMetricExporter = InMemoryMetricExporter; })); //#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/reader_buffer.js -var require_reader_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = BufferReader; - var Reader = require_reader(); - (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader; - var util = require_minimal$1(); - /** - * Constructs a new buffer reader instance. - * @classdesc Wire format reader using node buffers. - * @extends Reader - * @constructor - * @param {Buffer} buffer Buffer to read from - */ - function BufferReader(buffer) { - Reader.call(this, buffer); - /** - * Read buffer. - * @name BufferReader#buf - * @type {Buffer} - */ - } - BufferReader._configure = function() { - /* istanbul ignore else */ - if (util.Buffer) BufferReader.prototype._slice = util.Buffer.prototype.slice; - }; - /** - * @override - */ - BufferReader.prototype.string = function read_string_buffer() { - var len = this.uint32(); - return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len)); - }; - /** - * Reads a sequence of bytes preceeded by its length as a varint. - * @name BufferReader#bytes - * @function - * @returns {Buffer} Value read - */ - BufferReader._configure(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/rpc/service.js -var require_service = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = Service; - var util = require_minimal$1(); - (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service; +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/ConsoleMetricExporter.js +var require_ConsoleMetricExporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ConsoleMetricExporter = void 0; + const core_1 = require_src$8(); + const AggregationSelector_1 = require_AggregationSelector(); /** - * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * This is an implementation of {@link PushMetricExporter} that prints metrics to the + * console. This class can be used for diagnostic purposes. * - * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`. - * @typedef rpc.ServiceMethodCallback - * @template TRes extends Message - * @type {function} - * @param {Error|null} error Error, if any - * @param {TRes} [response] Response message - * @returns {undefined} - */ - /** - * A service method part of a {@link rpc.Service} as created by {@link Service.create}. - * @typedef rpc.ServiceMethod - * @template TReq extends Message - * @template TRes extends Message - * @type {function} - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message - * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined` - */ - /** - * Constructs a new RPC service instance. - * @classdesc An RPC service as returned by {@link Service#create}. - * @exports rpc.Service - * @extends util.EventEmitter - * @constructor - * @param {RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * NOTE: This {@link PushMetricExporter} is intended for diagnostics use only, output rendered to the console may change at any time. */ - function Service(rpcImpl, requestDelimited, responseDelimited) { - if (typeof rpcImpl !== "function") throw TypeError("rpcImpl must be a function"); - util.EventEmitter.call(this); - /** - * RPC implementation. Becomes `null` once the service is ended. - * @type {RPCImpl|null} - */ - this.rpcImpl = rpcImpl; - /** - * Whether requests are length-delimited. - * @type {boolean} - */ - this.requestDelimited = Boolean(requestDelimited); - /** - * Whether responses are length-delimited. - * @type {boolean} - */ - this.responseDelimited = Boolean(responseDelimited); - } - /** - * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}. - * @param {Method|rpc.ServiceMethod} method Reflected or static method - * @param {Constructor} requestCtor Request constructor - * @param {Constructor} responseCtor Response constructor - * @param {TReq|Properties} request Request message or plain object - * @param {rpc.ServiceMethodCallback} callback Service callback - * @returns {undefined} - * @template TReq extends Message - * @template TRes extends Message - */ - Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) { - if (!request) throw TypeError("request must be specified"); - var self$1 = this; - if (!callback) return util.asPromise(rpcCall, self$1, method, requestCtor, responseCtor, request); - if (!self$1.rpcImpl) { - setTimeout(function() { - callback(Error("already ended")); - }, 0); - return; + var ConsoleMetricExporter = class ConsoleMetricExporter { + _shutdown = false; + _temporalitySelector; + constructor(options) { + this._temporalitySelector = options?.temporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; } - try { - return self$1.rpcImpl(method, requestCtor[self$1.requestDelimited ? "encodeDelimited" : "encode"](request).finish(), function rpcCallback(err, response) { - if (err) { - self$1.emit("error", err, method); - return callback(err); - } - if (response === null) { - self$1.end(true); - return; - } - if (!(response instanceof responseCtor)) try { - response = responseCtor[self$1.responseDelimited ? "decodeDelimited" : "decode"](response); - } catch (err$1) { - self$1.emit("error", err$1, method); - return callback(err$1); - } - self$1.emit("data", response, method); - return callback(null, response); - }); - } catch (err) { - self$1.emit("error", err, method); - setTimeout(function() { - callback(err); - }, 0); - return; + export(metrics, resultCallback) { + if (this._shutdown) { + resultCallback({ code: core_1.ExportResultCode.FAILED }); + return; + } + return ConsoleMetricExporter._sendMetrics(metrics, resultCallback); } - }; - /** - * Ends this service and emits the `end` event. - * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation. - * @returns {rpc.Service} `this` - */ - Service.prototype.end = function end(endedByRPC) { - if (this.rpcImpl) { - if (!endedByRPC) this.rpcImpl(null, null, null); - this.rpcImpl = null; - this.emit("end").off(); + forceFlush() { + return Promise.resolve(); + } + selectAggregationTemporality(_instrumentType) { + return this._temporalitySelector(_instrumentType); + } + shutdown() { + this._shutdown = true; + return Promise.resolve(); + } + static _sendMetrics(metrics, done) { + for (const scopeMetrics of metrics.scopeMetrics) for (const metric of scopeMetrics.metrics) console.dir({ + descriptor: metric.descriptor, + dataPointType: metric.dataPointType, + dataPoints: metric.dataPoints + }, { depth: null }); + done({ code: core_1.ExportResultCode.SUCCESS }); } - return this; }; + exports.ConsoleMetricExporter = ConsoleMetricExporter; })); //#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/rpc.js -var require_rpc = /* @__PURE__ */ __commonJSMin(((exports) => { - /** - * Streaming RPC helpers. - * @namespace - */ - var rpc = exports; - /** - * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets. - * @typedef RPCImpl - * @type {function} - * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called - * @param {Uint8Array} requestData Request data - * @param {RPCImplCallback} callback Callback function - * @returns {undefined} - * @example - * function rpcImpl(method, requestData, callback) { - * if (protobuf.util.lcFirst(method.name) !== "myMethod") // compatible with static code - * throw Error("no such method"); - * asynchronouslyObtainAResponse(requestData, function(err, responseData) { - * callback(err, responseData); - * }); - * } - */ - /** - * Node-style callback as used by {@link RPCImpl}. - * @typedef RPCImplCallback - * @type {function} - * @param {Error|null} error Error, if any, otherwise `null` - * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error - * @returns {undefined} - */ - rpc.Service = require_service(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/roots.js -var require_roots = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = Object.create(null); -})); -/** -* Named roots. -* This is where pbjs stores generated structures (the option `-r, --root` specifies a name). -* Can also be used manually to make roots available across modules. -* @name roots -* @type {Object.} -* @example -* // pbjs -r myroot -o compiled.js ... -* -* // in another module: -* require("./compiled.js"); -* -* // in any subsequent module: -* var root = protobuf.roots["myroot"]; -*/ - -//#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/src/index-minimal.js -var require_index_minimal = /* @__PURE__ */ __commonJSMin(((exports) => { - var protobuf = exports; - /** - * Build type, one of `"full"`, `"light"` or `"minimal"`. - * @name build - * @type {string} - * @const - */ - protobuf.build = "minimal"; - protobuf.Writer = require_writer(); - protobuf.BufferWriter = require_writer_buffer(); - protobuf.Reader = require_reader(); - protobuf.BufferReader = require_reader_buffer(); - protobuf.util = require_minimal$1(); - protobuf.rpc = require_rpc(); - protobuf.roots = require_roots(); - protobuf.configure = configure; - /* istanbul ignore next */ +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/default-service-name.js +var require_default_service_name = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports._clearDefaultServiceNameCache = exports.defaultServiceName = void 0; + let serviceName; /** - * Reconfigures the library according to the environment. - * @returns {undefined} + * Returns the default service name for OpenTelemetry resources. + * In Node.js environments, returns "unknown_service:". + * In browser/edge environments, returns "unknown_service". */ - function configure() { - protobuf.util._configure(); - protobuf.Writer._configure(protobuf.BufferWriter); - protobuf.Reader._configure(protobuf.BufferReader); + function defaultServiceName() { + if (serviceName === void 0) try { + const argv0 = globalThis.process.argv0; + serviceName = argv0 ? `unknown_service:${argv0}` : "unknown_service"; + } catch { + serviceName = "unknown_service"; + } + return serviceName; + } + exports.defaultServiceName = defaultServiceName; + /** @internal For testing purposes only */ + function _clearDefaultServiceNameCache() { + serviceName = void 0; } - configure(); + exports._clearDefaultServiceNameCache = _clearDefaultServiceNameCache; })); //#endregion -//#region ../../node_modules/.pnpm/protobufjs@7.6.2/node_modules/protobufjs/minimal.js -var require_minimal = /* @__PURE__ */ __commonJSMin(((exports, module) => { - module.exports = require_index_minimal(); +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/utils.js +var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isPromiseLike = void 0; + const isPromiseLike = (val) => { + return val !== null && typeof val === "object" && typeof val.then === "function"; + }; + exports.isPromiseLike = isPromiseLike; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js -var require_root = /* @__PURE__ */ __commonJSMin(((exports, module) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js +var require_ResourceImpl = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - var $protobuf = require_minimal(); - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); - $root.opentelemetry = (function() { - /** - * Namespace opentelemetry. - * @exports opentelemetry - * @namespace - */ - var opentelemetry = {}; - opentelemetry.proto = (function() { - /** - * Namespace proto. - * @memberof opentelemetry - * @namespace - */ - var proto = {}; - proto.common = (function() { - /** - * Namespace common. - * @memberof opentelemetry.proto - * @namespace - */ - var common = {}; - common.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.common - * @namespace - */ - var v1 = {}; - v1.AnyValue = (function() { - /** - * Properties of an AnyValue. - * @memberof opentelemetry.proto.common.v1 - * @interface IAnyValue - * @property {string|null} [stringValue] AnyValue stringValue - * @property {boolean|null} [boolValue] AnyValue boolValue - * @property {number|Long|null} [intValue] AnyValue intValue - * @property {number|null} [doubleValue] AnyValue doubleValue - * @property {opentelemetry.proto.common.v1.IArrayValue|null} [arrayValue] AnyValue arrayValue - * @property {opentelemetry.proto.common.v1.IKeyValueList|null} [kvlistValue] AnyValue kvlistValue - * @property {Uint8Array|null} [bytesValue] AnyValue bytesValue - */ - /** - * Constructs a new AnyValue. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents an AnyValue. - * @implements IAnyValue - * @constructor - * @param {opentelemetry.proto.common.v1.IAnyValue=} [properties] Properties to set - */ - function AnyValue(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * AnyValue stringValue. - * @member {string|null|undefined} stringValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.stringValue = null; - /** - * AnyValue boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.boolValue = null; - /** - * AnyValue intValue. - * @member {number|Long|null|undefined} intValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.intValue = null; - /** - * AnyValue doubleValue. - * @member {number|null|undefined} doubleValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.doubleValue = null; - /** - * AnyValue arrayValue. - * @member {opentelemetry.proto.common.v1.IArrayValue|null|undefined} arrayValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.arrayValue = null; - /** - * AnyValue kvlistValue. - * @member {opentelemetry.proto.common.v1.IKeyValueList|null|undefined} kvlistValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.kvlistValue = null; - /** - * AnyValue bytesValue. - * @member {Uint8Array|null|undefined} bytesValue - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - AnyValue.prototype.bytesValue = null; - var $oneOfFields; - /** - * AnyValue value. - * @member {"stringValue"|"boolValue"|"intValue"|"doubleValue"|"arrayValue"|"kvlistValue"|"bytesValue"|undefined} value - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - */ - Object.defineProperty(AnyValue.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = [ - "stringValue", - "boolValue", - "intValue", - "doubleValue", - "arrayValue", - "kvlistValue", - "bytesValue" - ]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new AnyValue instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {opentelemetry.proto.common.v1.IAnyValue=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue instance - */ - AnyValue.create = function create(properties) { - return new AnyValue(properties); - }; - /** - * Encodes the specified AnyValue message. Does not implicitly {@link opentelemetry.proto.common.v1.AnyValue.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {opentelemetry.proto.common.v1.IAnyValue} message AnyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AnyValue.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(10).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) writer.uint32(16).bool(message.boolValue); - if (message.intValue != null && Object.hasOwnProperty.call(message, "intValue")) writer.uint32(24).int64(message.intValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(33).double(message.doubleValue); - if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) $root.opentelemetry.proto.common.v1.ArrayValue.encode(message.arrayValue, writer.uint32(42).fork()).ldelim(); - if (message.kvlistValue != null && Object.hasOwnProperty.call(message, "kvlistValue")) $root.opentelemetry.proto.common.v1.KeyValueList.encode(message.kvlistValue, writer.uint32(50).fork()).ldelim(); - if (message.bytesValue != null && Object.hasOwnProperty.call(message, "bytesValue")) writer.uint32(58).bytes(message.bytesValue); - return writer; - }; - /** - * Encodes the specified AnyValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.AnyValue.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {opentelemetry.proto.common.v1.IAnyValue} message AnyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AnyValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an AnyValue message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AnyValue.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.AnyValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.stringValue = reader.string(); - break; - case 2: - message.boolValue = reader.bool(); - break; - case 3: - message.intValue = reader.int64(); - break; - case 4: - message.doubleValue = reader.double(); - break; - case 5: - message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.decode(reader, reader.uint32()); - break; - case 6: - message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.decode(reader, reader.uint32()); - break; - case 7: - message.bytesValue = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an AnyValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AnyValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an AnyValue message. - * @function verify - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AnyValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - properties.value = 1; - if (!$util.isString(message.stringValue)) return "stringValue: string expected"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (typeof message.boolValue !== "boolean") return "boolValue: boolean expected"; - } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high))) return "intValue: integer|Long expected"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (typeof message.doubleValue !== "number") return "doubleValue: number expected"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - var error = $root.opentelemetry.proto.common.v1.ArrayValue.verify(message.arrayValue); - if (error) return "arrayValue." + error; - } - if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - var error = $root.opentelemetry.proto.common.v1.KeyValueList.verify(message.kvlistValue); - if (error) return "kvlistValue." + error; - } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (!(message.bytesValue && typeof message.bytesValue.length === "number" || $util.isString(message.bytesValue))) return "bytesValue: buffer expected"; - } - return null; - }; - /** - * Creates an AnyValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.AnyValue} AnyValue - */ - AnyValue.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.AnyValue) return object$1; - var message = new $root.opentelemetry.proto.common.v1.AnyValue(); - if (object$1.stringValue != null) message.stringValue = String(object$1.stringValue); - if (object$1.boolValue != null) message.boolValue = Boolean(object$1.boolValue); - if (object$1.intValue != null) { - if ($util.Long) (message.intValue = $util.Long.fromValue(object$1.intValue)).unsigned = false; - else if (typeof object$1.intValue === "string") message.intValue = parseInt(object$1.intValue, 10); - else if (typeof object$1.intValue === "number") message.intValue = object$1.intValue; - else if (typeof object$1.intValue === "object") message.intValue = new $util.LongBits(object$1.intValue.low >>> 0, object$1.intValue.high >>> 0).toNumber(); - } - if (object$1.doubleValue != null) message.doubleValue = Number(object$1.doubleValue); - if (object$1.arrayValue != null) { - if (typeof object$1.arrayValue !== "object") throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected"); - message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.fromObject(object$1.arrayValue); - } - if (object$1.kvlistValue != null) { - if (typeof object$1.kvlistValue !== "object") throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected"); - message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.fromObject(object$1.kvlistValue); - } - if (object$1.bytesValue != null) { - if (typeof object$1.bytesValue === "string") $util.base64.decode(object$1.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object$1.bytesValue)), 0); - else if (object$1.bytesValue.length >= 0) message.bytesValue = object$1.bytesValue; - } - return message; - }; - /** - * Creates a plain object from an AnyValue message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {opentelemetry.proto.common.v1.AnyValue} message AnyValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AnyValue.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object$1.stringValue = message.stringValue; - if (options.oneofs) object$1.value = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object$1.boolValue = message.boolValue; - if (options.oneofs) object$1.value = "boolValue"; - } - if (message.intValue != null && message.hasOwnProperty("intValue")) { - if (typeof message.intValue === "number") object$1.intValue = options.longs === String ? String(message.intValue) : message.intValue; - else object$1.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue; - if (options.oneofs) object$1.value = "intValue"; - } - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { - object$1.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (options.oneofs) object$1.value = "doubleValue"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - object$1.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.toObject(message.arrayValue, options); - if (options.oneofs) object$1.value = "arrayValue"; - } - if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { - object$1.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.toObject(message.kvlistValue, options); - if (options.oneofs) object$1.value = "kvlistValue"; - } - if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { - object$1.bytesValue = options.bytes === String ? $util.base64.encode(message.bytesValue, 0, message.bytesValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesValue) : message.bytesValue; - if (options.oneofs) object$1.value = "bytesValue"; - } - return object$1; - }; - /** - * Converts this AnyValue to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.AnyValue - * @instance - * @returns {Object.} JSON object - */ - AnyValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for AnyValue - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.AnyValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AnyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.AnyValue"; - }; - return AnyValue; - })(); - v1.ArrayValue = (function() { - /** - * Properties of an ArrayValue. - * @memberof opentelemetry.proto.common.v1 - * @interface IArrayValue - * @property {Array.|null} [values] ArrayValue values - */ - /** - * Constructs a new ArrayValue. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents an ArrayValue. - * @implements IArrayValue - * @constructor - * @param {opentelemetry.proto.common.v1.IArrayValue=} [properties] Properties to set - */ - function ArrayValue(properties) { - this.values = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ArrayValue values. - * @member {Array.} values - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @instance - */ - ArrayValue.prototype.values = $util.emptyArray; - /** - * Creates a new ArrayValue instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {opentelemetry.proto.common.v1.IArrayValue=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue instance - */ - ArrayValue.create = function create(properties) { - return new ArrayValue(properties); - }; - /** - * Encodes the specified ArrayValue message. Does not implicitly {@link opentelemetry.proto.common.v1.ArrayValue.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {opentelemetry.proto.common.v1.IArrayValue} message ArrayValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ArrayValue.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.values[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.ArrayValue.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {opentelemetry.proto.common.v1.IArrayValue} message ArrayValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ArrayValue message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ArrayValue.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.ArrayValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.values && message.values.length)) message.values = []; - message.values.push($root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ArrayValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ArrayValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ArrayValue message. - * @function verify - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ArrayValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.values[i]); - if (error) return "values." + error; - } - } - return null; - }; - /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.ArrayValue} ArrayValue - */ - ArrayValue.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.ArrayValue) return object$1; - var message = new $root.opentelemetry.proto.common.v1.ArrayValue(); - if (object$1.values) { - if (!Array.isArray(object$1.values)) throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected"); - message.values = []; - for (var i = 0; i < object$1.values.length; ++i) { - if (typeof object$1.values[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected"); - message.values[i] = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.values[i]); - } - } - return message; - }; - /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {opentelemetry.proto.common.v1.ArrayValue} message ArrayValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ArrayValue.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.values = []; - if (message.values && message.values.length) { - object$1.values = []; - for (var j = 0; j < message.values.length; ++j) object$1.values[j] = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.values[j], options); - } - return object$1; - }; - /** - * Converts this ArrayValue to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @instance - * @returns {Object.} JSON object - */ - ArrayValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ArrayValue - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.ArrayValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.ArrayValue"; - }; - return ArrayValue; - })(); - v1.KeyValueList = (function() { - /** - * Properties of a KeyValueList. - * @memberof opentelemetry.proto.common.v1 - * @interface IKeyValueList - * @property {Array.|null} [values] KeyValueList values - */ - /** - * Constructs a new KeyValueList. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents a KeyValueList. - * @implements IKeyValueList - * @constructor - * @param {opentelemetry.proto.common.v1.IKeyValueList=} [properties] Properties to set - */ - function KeyValueList(properties) { - this.values = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * KeyValueList values. - * @member {Array.} values - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @instance - */ - KeyValueList.prototype.values = $util.emptyArray; - /** - * Creates a new KeyValueList instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {opentelemetry.proto.common.v1.IKeyValueList=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList instance - */ - KeyValueList.create = function create(properties) { - return new KeyValueList(properties); - }; - /** - * Encodes the specified KeyValueList message. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValueList.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {opentelemetry.proto.common.v1.IKeyValueList} message KeyValueList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValueList.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.values != null && message.values.length) for (var i = 0; i < message.values.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.values[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified KeyValueList message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValueList.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {opentelemetry.proto.common.v1.IKeyValueList} message KeyValueList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValueList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a KeyValueList message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValueList.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.KeyValueList(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.values && message.values.length)) message.values = []; - message.values.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a KeyValueList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValueList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a KeyValueList message. - * @function verify - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyValueList.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.values[i]); - if (error) return "values." + error; - } - } - return null; - }; - /** - * Creates a KeyValueList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.KeyValueList} KeyValueList - */ - KeyValueList.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.KeyValueList) return object$1; - var message = new $root.opentelemetry.proto.common.v1.KeyValueList(); - if (object$1.values) { - if (!Array.isArray(object$1.values)) throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected"); - message.values = []; - for (var i = 0; i < object$1.values.length; ++i) { - if (typeof object$1.values[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected"); - message.values[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.values[i]); - } - } - return message; - }; - /** - * Creates a plain object from a KeyValueList message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {opentelemetry.proto.common.v1.KeyValueList} message KeyValueList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyValueList.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.values = []; - if (message.values && message.values.length) { - object$1.values = []; - for (var j = 0; j < message.values.length; ++j) object$1.values[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.values[j], options); - } - return object$1; - }; - /** - * Converts this KeyValueList to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @instance - * @returns {Object.} JSON object - */ - KeyValueList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for KeyValueList - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.KeyValueList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyValueList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.KeyValueList"; - }; - return KeyValueList; - })(); - v1.KeyValue = (function() { - /** - * Properties of a KeyValue. - * @memberof opentelemetry.proto.common.v1 - * @interface IKeyValue - * @property {string|null} [key] KeyValue key - * @property {opentelemetry.proto.common.v1.IAnyValue|null} [value] KeyValue value - */ - /** - * Constructs a new KeyValue. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents a KeyValue. - * @implements IKeyValue - * @constructor - * @param {opentelemetry.proto.common.v1.IKeyValue=} [properties] Properties to set - */ - function KeyValue(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * KeyValue key. - * @member {string|null|undefined} key - * @memberof opentelemetry.proto.common.v1.KeyValue - * @instance - */ - KeyValue.prototype.key = null; - /** - * KeyValue value. - * @member {opentelemetry.proto.common.v1.IAnyValue|null|undefined} value - * @memberof opentelemetry.proto.common.v1.KeyValue - * @instance - */ - KeyValue.prototype.value = null; - /** - * Creates a new KeyValue instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {opentelemetry.proto.common.v1.IKeyValue=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue instance - */ - KeyValue.create = function create(properties) { - return new KeyValue(properties); - }; - /** - * Encodes the specified KeyValue message. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValue.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {opentelemetry.proto.common.v1.IKeyValue} message KeyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValue.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) writer.uint32(10).string(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.value, writer.uint32(18).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.KeyValue.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {opentelemetry.proto.common.v1.IKeyValue} message KeyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a KeyValue message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValue.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.KeyValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - message.value = $root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a KeyValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a KeyValue message. - * @function verify - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - if (!$util.isString(message.key)) return "key: string expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.value); - if (error) return "value." + error; - } - return null; - }; - /** - * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.KeyValue} KeyValue - */ - KeyValue.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.KeyValue) return object$1; - var message = new $root.opentelemetry.proto.common.v1.KeyValue(); - if (object$1.key != null) message.key = String(object$1.key); - if (object$1.value != null) { - if (typeof object$1.value !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected"); - message.value = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.value); - } - return message; - }; - /** - * Creates a plain object from a KeyValue message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {opentelemetry.proto.common.v1.KeyValue} message KeyValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyValue.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - object$1.key = ""; - object$1.value = null; - } - if (message.key != null && message.hasOwnProperty("key")) object$1.key = message.key; - if (message.value != null && message.hasOwnProperty("value")) object$1.value = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.value, options); - return object$1; - }; - /** - * Converts this KeyValue to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.KeyValue - * @instance - * @returns {Object.} JSON object - */ - KeyValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for KeyValue - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.KeyValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.KeyValue"; - }; - return KeyValue; - })(); - v1.InstrumentationScope = (function() { - /** - * Properties of an InstrumentationScope. - * @memberof opentelemetry.proto.common.v1 - * @interface IInstrumentationScope - * @property {string|null} [name] InstrumentationScope name - * @property {string|null} [version] InstrumentationScope version - * @property {Array.|null} [attributes] InstrumentationScope attributes - * @property {number|null} [droppedAttributesCount] InstrumentationScope droppedAttributesCount - */ - /** - * Constructs a new InstrumentationScope. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents an InstrumentationScope. - * @implements IInstrumentationScope - * @constructor - * @param {opentelemetry.proto.common.v1.IInstrumentationScope=} [properties] Properties to set - */ - function InstrumentationScope(properties) { - this.attributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * InstrumentationScope name. - * @member {string|null|undefined} name - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - */ - InstrumentationScope.prototype.name = null; - /** - * InstrumentationScope version. - * @member {string|null|undefined} version - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - */ - InstrumentationScope.prototype.version = null; - /** - * InstrumentationScope attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - */ - InstrumentationScope.prototype.attributes = $util.emptyArray; - /** - * InstrumentationScope droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - */ - InstrumentationScope.prototype.droppedAttributesCount = null; - /** - * Creates a new InstrumentationScope instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {opentelemetry.proto.common.v1.IInstrumentationScope=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope instance - */ - InstrumentationScope.create = function create(properties) { - return new InstrumentationScope(properties); - }; - /** - * Encodes the specified InstrumentationScope message. Does not implicitly {@link opentelemetry.proto.common.v1.InstrumentationScope.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {opentelemetry.proto.common.v1.IInstrumentationScope} message InstrumentationScope message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstrumentationScope.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(18).string(message.version); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(26).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(32).uint32(message.droppedAttributesCount); - return writer; - }; - /** - * Encodes the specified InstrumentationScope message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.InstrumentationScope.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {opentelemetry.proto.common.v1.IInstrumentationScope} message InstrumentationScope message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstrumentationScope.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an InstrumentationScope message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstrumentationScope.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.InstrumentationScope(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.version = reader.string(); - break; - case 3: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 4: - message.droppedAttributesCount = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an InstrumentationScope message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstrumentationScope.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an InstrumentationScope message. - * @function verify - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstrumentationScope.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!$util.isString(message.name)) return "name: string expected"; - } - if (message.version != null && message.hasOwnProperty("version")) { - if (!$util.isString(message.version)) return "version: string expected"; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - return null; - }; - /** - * Creates an InstrumentationScope message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.InstrumentationScope} InstrumentationScope - */ - InstrumentationScope.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.InstrumentationScope) return object$1; - var message = new $root.opentelemetry.proto.common.v1.InstrumentationScope(); - if (object$1.name != null) message.name = String(object$1.name); - if (object$1.version != null) message.version = String(object$1.version); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - return message; - }; - /** - * Creates a plain object from an InstrumentationScope message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {opentelemetry.proto.common.v1.InstrumentationScope} message InstrumentationScope - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstrumentationScope.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.attributes = []; - if (options.defaults) { - object$1.name = ""; - object$1.version = ""; - object$1.droppedAttributesCount = 0; - } - if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) object$1.version = message.version; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - return object$1; - }; - /** - * Converts this InstrumentationScope to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @instance - * @returns {Object.} JSON object - */ - InstrumentationScope.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for InstrumentationScope - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.InstrumentationScope - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstrumentationScope.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.InstrumentationScope"; - }; - return InstrumentationScope; - })(); - v1.EntityRef = (function() { - /** - * Properties of an EntityRef. - * @memberof opentelemetry.proto.common.v1 - * @interface IEntityRef - * @property {string|null} [schemaUrl] EntityRef schemaUrl - * @property {string|null} [type] EntityRef type - * @property {Array.|null} [idKeys] EntityRef idKeys - * @property {Array.|null} [descriptionKeys] EntityRef descriptionKeys - */ - /** - * Constructs a new EntityRef. - * @memberof opentelemetry.proto.common.v1 - * @classdesc Represents an EntityRef. - * @implements IEntityRef - * @constructor - * @param {opentelemetry.proto.common.v1.IEntityRef=} [properties] Properties to set - */ - function EntityRef(properties) { - this.idKeys = []; - this.descriptionKeys = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * EntityRef schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - */ - EntityRef.prototype.schemaUrl = null; - /** - * EntityRef type. - * @member {string|null|undefined} type - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - */ - EntityRef.prototype.type = null; - /** - * EntityRef idKeys. - * @member {Array.} idKeys - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - */ - EntityRef.prototype.idKeys = $util.emptyArray; - /** - * EntityRef descriptionKeys. - * @member {Array.} descriptionKeys - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - */ - EntityRef.prototype.descriptionKeys = $util.emptyArray; - /** - * Creates a new EntityRef instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {opentelemetry.proto.common.v1.IEntityRef=} [properties] Properties to set - * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef instance - */ - EntityRef.create = function create(properties) { - return new EntityRef(properties); - }; - /** - * Encodes the specified EntityRef message. Does not implicitly {@link opentelemetry.proto.common.v1.EntityRef.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {opentelemetry.proto.common.v1.IEntityRef} message EntityRef message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityRef.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(10).string(message.schemaUrl); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(18).string(message.type); - if (message.idKeys != null && message.idKeys.length) for (var i = 0; i < message.idKeys.length; ++i) writer.uint32(26).string(message.idKeys[i]); - if (message.descriptionKeys != null && message.descriptionKeys.length) for (var i = 0; i < message.descriptionKeys.length; ++i) writer.uint32(34).string(message.descriptionKeys[i]); - return writer; - }; - /** - * Encodes the specified EntityRef message, length delimited. Does not implicitly {@link opentelemetry.proto.common.v1.EntityRef.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {opentelemetry.proto.common.v1.IEntityRef} message EntityRef message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityRef.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an EntityRef message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityRef.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.common.v1.EntityRef(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.schemaUrl = reader.string(); - break; - case 2: - message.type = reader.string(); - break; - case 3: - if (!(message.idKeys && message.idKeys.length)) message.idKeys = []; - message.idKeys.push(reader.string()); - break; - case 4: - if (!(message.descriptionKeys && message.descriptionKeys.length)) message.descriptionKeys = []; - message.descriptionKeys.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an EntityRef message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityRef.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an EntityRef message. - * @function verify - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityRef.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - if (message.type != null && message.hasOwnProperty("type")) { - if (!$util.isString(message.type)) return "type: string expected"; - } - if (message.idKeys != null && message.hasOwnProperty("idKeys")) { - if (!Array.isArray(message.idKeys)) return "idKeys: array expected"; - for (var i = 0; i < message.idKeys.length; ++i) if (!$util.isString(message.idKeys[i])) return "idKeys: string[] expected"; - } - if (message.descriptionKeys != null && message.hasOwnProperty("descriptionKeys")) { - if (!Array.isArray(message.descriptionKeys)) return "descriptionKeys: array expected"; - for (var i = 0; i < message.descriptionKeys.length; ++i) if (!$util.isString(message.descriptionKeys[i])) return "descriptionKeys: string[] expected"; - } - return null; - }; - /** - * Creates an EntityRef message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.common.v1.EntityRef} EntityRef - */ - EntityRef.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.common.v1.EntityRef) return object$1; - var message = new $root.opentelemetry.proto.common.v1.EntityRef(); - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - if (object$1.type != null) message.type = String(object$1.type); - if (object$1.idKeys) { - if (!Array.isArray(object$1.idKeys)) throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected"); - message.idKeys = []; - for (var i = 0; i < object$1.idKeys.length; ++i) message.idKeys[i] = String(object$1.idKeys[i]); - } - if (object$1.descriptionKeys) { - if (!Array.isArray(object$1.descriptionKeys)) throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected"); - message.descriptionKeys = []; - for (var i = 0; i < object$1.descriptionKeys.length; ++i) message.descriptionKeys[i] = String(object$1.descriptionKeys[i]); - } - return message; - }; - /** - * Creates a plain object from an EntityRef message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {opentelemetry.proto.common.v1.EntityRef} message EntityRef - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityRef.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.idKeys = []; - object$1.descriptionKeys = []; - } - if (options.defaults) { - object$1.schemaUrl = ""; - object$1.type = ""; - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - if (message.type != null && message.hasOwnProperty("type")) object$1.type = message.type; - if (message.idKeys && message.idKeys.length) { - object$1.idKeys = []; - for (var j = 0; j < message.idKeys.length; ++j) object$1.idKeys[j] = message.idKeys[j]; - } - if (message.descriptionKeys && message.descriptionKeys.length) { - object$1.descriptionKeys = []; - for (var j = 0; j < message.descriptionKeys.length; ++j) object$1.descriptionKeys[j] = message.descriptionKeys[j]; - } - return object$1; - }; - /** - * Converts this EntityRef to JSON. - * @function toJSON - * @memberof opentelemetry.proto.common.v1.EntityRef - * @instance - * @returns {Object.} JSON object - */ - EntityRef.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for EntityRef - * @function getTypeUrl - * @memberof opentelemetry.proto.common.v1.EntityRef - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.common.v1.EntityRef"; - }; - return EntityRef; - })(); - return v1; - })(); - return common; - })(); - proto.resource = (function() { - /** - * Namespace resource. - * @memberof opentelemetry.proto - * @namespace - */ - var resource = {}; - resource.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.resource - * @namespace - */ - var v1 = {}; - v1.Resource = (function() { - /** - * Properties of a Resource. - * @memberof opentelemetry.proto.resource.v1 - * @interface IResource - * @property {Array.|null} [attributes] Resource attributes - * @property {number|null} [droppedAttributesCount] Resource droppedAttributesCount - * @property {Array.|null} [entityRefs] Resource entityRefs - */ - /** - * Constructs a new Resource. - * @memberof opentelemetry.proto.resource.v1 - * @classdesc Represents a Resource. - * @implements IResource - * @constructor - * @param {opentelemetry.proto.resource.v1.IResource=} [properties] Properties to set - */ - function Resource(properties) { - this.attributes = []; - this.entityRefs = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Resource attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.resource.v1.Resource - * @instance - */ - Resource.prototype.attributes = $util.emptyArray; - /** - * Resource droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.resource.v1.Resource - * @instance - */ - Resource.prototype.droppedAttributesCount = null; - /** - * Resource entityRefs. - * @member {Array.} entityRefs - * @memberof opentelemetry.proto.resource.v1.Resource - * @instance - */ - Resource.prototype.entityRefs = $util.emptyArray; - /** - * Creates a new Resource instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {opentelemetry.proto.resource.v1.IResource=} [properties] Properties to set - * @returns {opentelemetry.proto.resource.v1.Resource} Resource instance - */ - Resource.create = function create(properties) { - return new Resource(properties); - }; - /** - * Encodes the specified Resource message. Does not implicitly {@link opentelemetry.proto.resource.v1.Resource.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {opentelemetry.proto.resource.v1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(10).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(16).uint32(message.droppedAttributesCount); - if (message.entityRefs != null && message.entityRefs.length) for (var i = 0; i < message.entityRefs.length; ++i) $root.opentelemetry.proto.common.v1.EntityRef.encode(message.entityRefs[i], writer.uint32(26).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Resource message, length delimited. Does not implicitly {@link opentelemetry.proto.resource.v1.Resource.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {opentelemetry.proto.resource.v1.IResource} message Resource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Resource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Resource message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.resource.v1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.resource.v1.Resource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.droppedAttributesCount = reader.uint32(); - break; - case 3: - if (!(message.entityRefs && message.entityRefs.length)) message.entityRefs = []; - message.entityRefs.push($root.opentelemetry.proto.common.v1.EntityRef.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Resource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.resource.v1.Resource} Resource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Resource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Resource message. - * @function verify - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Resource.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - if (message.entityRefs != null && message.hasOwnProperty("entityRefs")) { - if (!Array.isArray(message.entityRefs)) return "entityRefs: array expected"; - for (var i = 0; i < message.entityRefs.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.EntityRef.verify(message.entityRefs[i]); - if (error) return "entityRefs." + error; - } - } - return null; - }; - /** - * Creates a Resource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.resource.v1.Resource} Resource - */ - Resource.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.resource.v1.Resource) return object$1; - var message = new $root.opentelemetry.proto.resource.v1.Resource(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - if (object$1.entityRefs) { - if (!Array.isArray(object$1.entityRefs)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected"); - message.entityRefs = []; - for (var i = 0; i < object$1.entityRefs.length; ++i) { - if (typeof object$1.entityRefs[i] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected"); - message.entityRefs[i] = $root.opentelemetry.proto.common.v1.EntityRef.fromObject(object$1.entityRefs[i]); - } - } - return message; - }; - /** - * Creates a plain object from a Resource message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {opentelemetry.proto.resource.v1.Resource} message Resource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Resource.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.attributes = []; - object$1.entityRefs = []; - } - if (options.defaults) object$1.droppedAttributesCount = 0; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - if (message.entityRefs && message.entityRefs.length) { - object$1.entityRefs = []; - for (var j = 0; j < message.entityRefs.length; ++j) object$1.entityRefs[j] = $root.opentelemetry.proto.common.v1.EntityRef.toObject(message.entityRefs[j], options); - } - return object$1; - }; - /** - * Converts this Resource to JSON. - * @function toJSON - * @memberof opentelemetry.proto.resource.v1.Resource - * @instance - * @returns {Object.} JSON object - */ - Resource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Resource - * @function getTypeUrl - * @memberof opentelemetry.proto.resource.v1.Resource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.resource.v1.Resource"; - }; - return Resource; - })(); - return v1; - })(); - return resource; - })(); - proto.trace = (function() { - /** - * Namespace trace. - * @memberof opentelemetry.proto - * @namespace - */ - var trace$1 = {}; - trace$1.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.trace - * @namespace - */ - var v1 = {}; - v1.TracesData = (function() { - /** - * Properties of a TracesData. - * @memberof opentelemetry.proto.trace.v1 - * @interface ITracesData - * @property {Array.|null} [resourceSpans] TracesData resourceSpans - */ - /** - * Constructs a new TracesData. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a TracesData. - * @implements ITracesData - * @constructor - * @param {opentelemetry.proto.trace.v1.ITracesData=} [properties] Properties to set - */ - function TracesData(properties) { - this.resourceSpans = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * TracesData resourceSpans. - * @member {Array.} resourceSpans - * @memberof opentelemetry.proto.trace.v1.TracesData - * @instance - */ - TracesData.prototype.resourceSpans = $util.emptyArray; - /** - * Creates a new TracesData instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {opentelemetry.proto.trace.v1.ITracesData=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData instance - */ - TracesData.create = function create(properties) { - return new TracesData(properties); - }; - /** - * Encodes the specified TracesData message. Does not implicitly {@link opentelemetry.proto.trace.v1.TracesData.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {opentelemetry.proto.trace.v1.ITracesData} message TracesData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TracesData.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceSpans != null && message.resourceSpans.length) for (var i = 0; i < message.resourceSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified TracesData message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.TracesData.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {opentelemetry.proto.trace.v1.ITracesData} message TracesData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TracesData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a TracesData message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TracesData.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.TracesData(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceSpans && message.resourceSpans.length)) message.resourceSpans = []; - message.resourceSpans.push($root.opentelemetry.proto.trace.v1.ResourceSpans.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a TracesData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TracesData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a TracesData message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TracesData.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { - if (!Array.isArray(message.resourceSpans)) return "resourceSpans: array expected"; - for (var i = 0; i < message.resourceSpans.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i]); - if (error) return "resourceSpans." + error; - } - } - return null; - }; - /** - * Creates a TracesData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.TracesData} TracesData - */ - TracesData.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.TracesData) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.TracesData(); - if (object$1.resourceSpans) { - if (!Array.isArray(object$1.resourceSpans)) throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected"); - message.resourceSpans = []; - for (var i = 0; i < object$1.resourceSpans.length; ++i) { - if (typeof object$1.resourceSpans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected"); - message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object$1.resourceSpans[i]); - } - } - return message; - }; - /** - * Creates a plain object from a TracesData message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {opentelemetry.proto.trace.v1.TracesData} message TracesData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TracesData.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceSpans = []; - if (message.resourceSpans && message.resourceSpans.length) { - object$1.resourceSpans = []; - for (var j = 0; j < message.resourceSpans.length; ++j) object$1.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); - } - return object$1; - }; - /** - * Converts this TracesData to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.TracesData - * @instance - * @returns {Object.} JSON object - */ - TracesData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for TracesData - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.TracesData - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TracesData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.TracesData"; - }; - return TracesData; - })(); - v1.ResourceSpans = (function() { - /** - * Properties of a ResourceSpans. - * @memberof opentelemetry.proto.trace.v1 - * @interface IResourceSpans - * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceSpans resource - * @property {Array.|null} [scopeSpans] ResourceSpans scopeSpans - * @property {string|null} [schemaUrl] ResourceSpans schemaUrl - */ - /** - * Constructs a new ResourceSpans. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a ResourceSpans. - * @implements IResourceSpans - * @constructor - * @param {opentelemetry.proto.trace.v1.IResourceSpans=} [properties] Properties to set - */ - function ResourceSpans(properties) { - this.scopeSpans = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ResourceSpans resource. - * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @instance - */ - ResourceSpans.prototype.resource = null; - /** - * ResourceSpans scopeSpans. - * @member {Array.} scopeSpans - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @instance - */ - ResourceSpans.prototype.scopeSpans = $util.emptyArray; - /** - * ResourceSpans schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @instance - */ - ResourceSpans.prototype.schemaUrl = null; - /** - * Creates a new ResourceSpans instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {opentelemetry.proto.trace.v1.IResourceSpans=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans instance - */ - ResourceSpans.create = function create(properties) { - return new ResourceSpans(properties); - }; - /** - * Encodes the specified ResourceSpans message. Does not implicitly {@link opentelemetry.proto.trace.v1.ResourceSpans.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {opentelemetry.proto.trace.v1.IResourceSpans} message ResourceSpans message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSpans.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - if (message.scopeSpans != null && message.scopeSpans.length) for (var i = 0; i < message.scopeSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ScopeSpans.encode(message.scopeSpans[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ResourceSpans message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.ResourceSpans.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {opentelemetry.proto.trace.v1.IResourceSpans} message ResourceSpans message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceSpans.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ResourceSpans message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSpans.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.ResourceSpans(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.scopeSpans && message.scopeSpans.length)) message.scopeSpans = []; - message.scopeSpans.push($root.opentelemetry.proto.trace.v1.ScopeSpans.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ResourceSpans message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceSpans.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ResourceSpans message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceSpans.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error) return "resource." + error; - } - if (message.scopeSpans != null && message.hasOwnProperty("scopeSpans")) { - if (!Array.isArray(message.scopeSpans)) return "scopeSpans: array expected"; - for (var i = 0; i < message.scopeSpans.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.ScopeSpans.verify(message.scopeSpans[i]); - if (error) return "scopeSpans." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ResourceSpans message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.ResourceSpans} ResourceSpans - */ - ResourceSpans.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.ResourceSpans) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.ResourceSpans(); - if (object$1.resource != null) { - if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected"); - message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); - } - if (object$1.scopeSpans) { - if (!Array.isArray(object$1.scopeSpans)) throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected"); - message.scopeSpans = []; - for (var i = 0; i < object$1.scopeSpans.length; ++i) { - if (typeof object$1.scopeSpans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected"); - message.scopeSpans[i] = $root.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(object$1.scopeSpans[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ResourceSpans message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {opentelemetry.proto.trace.v1.ResourceSpans} message ResourceSpans - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceSpans.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.scopeSpans = []; - if (options.defaults) { - object$1.resource = null; - object$1.schemaUrl = ""; - } - if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); - if (message.scopeSpans && message.scopeSpans.length) { - object$1.scopeSpans = []; - for (var j = 0; j < message.scopeSpans.length; ++j) object$1.scopeSpans[j] = $root.opentelemetry.proto.trace.v1.ScopeSpans.toObject(message.scopeSpans[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ResourceSpans to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @instance - * @returns {Object.} JSON object - */ - ResourceSpans.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ResourceSpans - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.ResourceSpans - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceSpans.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.ResourceSpans"; - }; - return ResourceSpans; - })(); - v1.ScopeSpans = (function() { - /** - * Properties of a ScopeSpans. - * @memberof opentelemetry.proto.trace.v1 - * @interface IScopeSpans - * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeSpans scope - * @property {Array.|null} [spans] ScopeSpans spans - * @property {string|null} [schemaUrl] ScopeSpans schemaUrl - */ - /** - * Constructs a new ScopeSpans. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a ScopeSpans. - * @implements IScopeSpans - * @constructor - * @param {opentelemetry.proto.trace.v1.IScopeSpans=} [properties] Properties to set - */ - function ScopeSpans(properties) { - this.spans = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ScopeSpans scope. - * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @instance - */ - ScopeSpans.prototype.scope = null; - /** - * ScopeSpans spans. - * @member {Array.} spans - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @instance - */ - ScopeSpans.prototype.spans = $util.emptyArray; - /** - * ScopeSpans schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @instance - */ - ScopeSpans.prototype.schemaUrl = null; - /** - * Creates a new ScopeSpans instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {opentelemetry.proto.trace.v1.IScopeSpans=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans instance - */ - ScopeSpans.create = function create(properties) { - return new ScopeSpans(properties); - }; - /** - * Encodes the specified ScopeSpans message. Does not implicitly {@link opentelemetry.proto.trace.v1.ScopeSpans.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {opentelemetry.proto.trace.v1.IScopeSpans} message ScopeSpans message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeSpans.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); - if (message.spans != null && message.spans.length) for (var i = 0; i < message.spans.length; ++i) $root.opentelemetry.proto.trace.v1.Span.encode(message.spans[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ScopeSpans message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.ScopeSpans.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {opentelemetry.proto.trace.v1.IScopeSpans} message ScopeSpans message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeSpans.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ScopeSpans message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeSpans.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.ScopeSpans(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.spans && message.spans.length)) message.spans = []; - message.spans.push($root.opentelemetry.proto.trace.v1.Span.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ScopeSpans message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeSpans.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ScopeSpans message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScopeSpans.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) { - var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error) return "scope." + error; - } - if (message.spans != null && message.hasOwnProperty("spans")) { - if (!Array.isArray(message.spans)) return "spans: array expected"; - for (var i = 0; i < message.spans.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.Span.verify(message.spans[i]); - if (error) return "spans." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ScopeSpans message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.ScopeSpans} ScopeSpans - */ - ScopeSpans.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.ScopeSpans) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.ScopeSpans(); - if (object$1.scope != null) { - if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected"); - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); - } - if (object$1.spans) { - if (!Array.isArray(object$1.spans)) throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected"); - message.spans = []; - for (var i = 0; i < object$1.spans.length; ++i) { - if (typeof object$1.spans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected"); - message.spans[i] = $root.opentelemetry.proto.trace.v1.Span.fromObject(object$1.spans[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ScopeSpans message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {opentelemetry.proto.trace.v1.ScopeSpans} message ScopeSpans - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScopeSpans.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.spans = []; - if (options.defaults) { - object$1.scope = null; - object$1.schemaUrl = ""; - } - if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); - if (message.spans && message.spans.length) { - object$1.spans = []; - for (var j = 0; j < message.spans.length; ++j) object$1.spans[j] = $root.opentelemetry.proto.trace.v1.Span.toObject(message.spans[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ScopeSpans to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @instance - * @returns {Object.} JSON object - */ - ScopeSpans.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ScopeSpans - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.ScopeSpans - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScopeSpans.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.ScopeSpans"; - }; - return ScopeSpans; - })(); - v1.Span = (function() { - /** - * Properties of a Span. - * @memberof opentelemetry.proto.trace.v1 - * @interface ISpan - * @property {Uint8Array|null} [traceId] Span traceId - * @property {Uint8Array|null} [spanId] Span spanId - * @property {string|null} [traceState] Span traceState - * @property {Uint8Array|null} [parentSpanId] Span parentSpanId - * @property {number|null} [flags] Span flags - * @property {string|null} [name] Span name - * @property {opentelemetry.proto.trace.v1.Span.SpanKind|null} [kind] Span kind - * @property {number|Long|null} [startTimeUnixNano] Span startTimeUnixNano - * @property {number|Long|null} [endTimeUnixNano] Span endTimeUnixNano - * @property {Array.|null} [attributes] Span attributes - * @property {number|null} [droppedAttributesCount] Span droppedAttributesCount - * @property {Array.|null} [events] Span events - * @property {number|null} [droppedEventsCount] Span droppedEventsCount - * @property {Array.|null} [links] Span links - * @property {number|null} [droppedLinksCount] Span droppedLinksCount - * @property {opentelemetry.proto.trace.v1.IStatus|null} [status] Span status - */ - /** - * Constructs a new Span. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a Span. - * @implements ISpan - * @constructor - * @param {opentelemetry.proto.trace.v1.ISpan=} [properties] Properties to set - */ - function Span(properties) { - this.attributes = []; - this.events = []; - this.links = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Span traceId. - * @member {Uint8Array|null|undefined} traceId - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.traceId = null; - /** - * Span spanId. - * @member {Uint8Array|null|undefined} spanId - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.spanId = null; - /** - * Span traceState. - * @member {string|null|undefined} traceState - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.traceState = null; - /** - * Span parentSpanId. - * @member {Uint8Array|null|undefined} parentSpanId - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.parentSpanId = null; - /** - * Span flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.flags = null; - /** - * Span name. - * @member {string|null|undefined} name - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.name = null; - /** - * Span kind. - * @member {opentelemetry.proto.trace.v1.Span.SpanKind|null|undefined} kind - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.kind = null; - /** - * Span startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.startTimeUnixNano = null; - /** - * Span endTimeUnixNano. - * @member {number|Long|null|undefined} endTimeUnixNano - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.endTimeUnixNano = null; - /** - * Span attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.attributes = $util.emptyArray; - /** - * Span droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.droppedAttributesCount = null; - /** - * Span events. - * @member {Array.} events - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.events = $util.emptyArray; - /** - * Span droppedEventsCount. - * @member {number|null|undefined} droppedEventsCount - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.droppedEventsCount = null; - /** - * Span links. - * @member {Array.} links - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.links = $util.emptyArray; - /** - * Span droppedLinksCount. - * @member {number|null|undefined} droppedLinksCount - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.droppedLinksCount = null; - /** - * Span status. - * @member {opentelemetry.proto.trace.v1.IStatus|null|undefined} status - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - */ - Span.prototype.status = null; - /** - * Creates a new Span instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {opentelemetry.proto.trace.v1.ISpan=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.Span} Span instance - */ - Span.create = function create(properties) { - return new Span(properties); - }; - /** - * Encodes the specified Span message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {opentelemetry.proto.trace.v1.ISpan} message Span message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Span.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(10).bytes(message.traceId); - if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(18).bytes(message.spanId); - if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) writer.uint32(26).string(message.traceState); - if (message.parentSpanId != null && Object.hasOwnProperty.call(message, "parentSpanId")) writer.uint32(34).bytes(message.parentSpanId); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(42).string(message.name); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(48).int32(message.kind); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(57).fixed64(message.startTimeUnixNano); - if (message.endTimeUnixNano != null && Object.hasOwnProperty.call(message, "endTimeUnixNano")) writer.uint32(65).fixed64(message.endTimeUnixNano); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(74).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(80).uint32(message.droppedAttributesCount); - if (message.events != null && message.events.length) for (var i = 0; i < message.events.length; ++i) $root.opentelemetry.proto.trace.v1.Span.Event.encode(message.events[i], writer.uint32(90).fork()).ldelim(); - if (message.droppedEventsCount != null && Object.hasOwnProperty.call(message, "droppedEventsCount")) writer.uint32(96).uint32(message.droppedEventsCount); - if (message.links != null && message.links.length) for (var i = 0; i < message.links.length; ++i) $root.opentelemetry.proto.trace.v1.Span.Link.encode(message.links[i], writer.uint32(106).fork()).ldelim(); - if (message.droppedLinksCount != null && Object.hasOwnProperty.call(message, "droppedLinksCount")) writer.uint32(112).uint32(message.droppedLinksCount); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) $root.opentelemetry.proto.trace.v1.Status.encode(message.status, writer.uint32(122).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(133).fixed32(message.flags); - return writer; - }; - /** - * Encodes the specified Span message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {opentelemetry.proto.trace.v1.ISpan} message Span message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Span.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Span message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.Span} Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Span.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.traceId = reader.bytes(); - break; - case 2: - message.spanId = reader.bytes(); - break; - case 3: - message.traceState = reader.string(); - break; - case 4: - message.parentSpanId = reader.bytes(); - break; - case 16: - message.flags = reader.fixed32(); - break; - case 5: - message.name = reader.string(); - break; - case 6: - message.kind = reader.int32(); - break; - case 7: - message.startTimeUnixNano = reader.fixed64(); - break; - case 8: - message.endTimeUnixNano = reader.fixed64(); - break; - case 9: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 10: - message.droppedAttributesCount = reader.uint32(); - break; - case 11: - if (!(message.events && message.events.length)) message.events = []; - message.events.push($root.opentelemetry.proto.trace.v1.Span.Event.decode(reader, reader.uint32())); - break; - case 12: - message.droppedEventsCount = reader.uint32(); - break; - case 13: - if (!(message.links && message.links.length)) message.links = []; - message.links.push($root.opentelemetry.proto.trace.v1.Span.Link.decode(reader, reader.uint32())); - break; - case 14: - message.droppedLinksCount = reader.uint32(); - break; - case 15: - message.status = $root.opentelemetry.proto.trace.v1.Status.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Span message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.Span} Span - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Span.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Span message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Span.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.traceId != null && message.hasOwnProperty("traceId")) { - if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) { - if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; - } - if (message.traceState != null && message.hasOwnProperty("traceState")) { - if (!$util.isString(message.traceState)) return "traceState: string expected"; - } - if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) { - if (!(message.parentSpanId && typeof message.parentSpanId.length === "number" || $util.isString(message.parentSpanId))) return "parentSpanId: buffer expected"; - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - if (message.name != null && message.hasOwnProperty("name")) { - if (!$util.isString(message.name)) return "name: string expected"; - } - if (message.kind != null && message.hasOwnProperty("kind")) switch (message.kind) { - default: return "kind: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: break; - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.endTimeUnixNano != null && message.hasOwnProperty("endTimeUnixNano")) { - if (!$util.isInteger(message.endTimeUnixNano) && !(message.endTimeUnixNano && $util.isInteger(message.endTimeUnixNano.low) && $util.isInteger(message.endTimeUnixNano.high))) return "endTimeUnixNano: integer|Long expected"; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.Span.Event.verify(message.events[i]); - if (error) return "events." + error; - } - } - if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) { - if (!$util.isInteger(message.droppedEventsCount)) return "droppedEventsCount: integer expected"; - } - if (message.links != null && message.hasOwnProperty("links")) { - if (!Array.isArray(message.links)) return "links: array expected"; - for (var i = 0; i < message.links.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.Span.Link.verify(message.links[i]); - if (error) return "links." + error; - } - } - if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) { - if (!$util.isInteger(message.droppedLinksCount)) return "droppedLinksCount: integer expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.opentelemetry.proto.trace.v1.Status.verify(message.status); - if (error) return "status." + error; - } - return null; - }; - /** - * Creates a Span message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.Span} Span - */ - Span.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.Span(); - if (object$1.traceId != null) { - if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); - else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; - } - if (object$1.spanId != null) { - if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); - else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; - } - if (object$1.traceState != null) message.traceState = String(object$1.traceState); - if (object$1.parentSpanId != null) { - if (typeof object$1.parentSpanId === "string") $util.base64.decode(object$1.parentSpanId, message.parentSpanId = $util.newBuffer($util.base64.length(object$1.parentSpanId)), 0); - else if (object$1.parentSpanId.length >= 0) message.parentSpanId = object$1.parentSpanId; - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - if (object$1.name != null) message.name = String(object$1.name); - switch (object$1.kind) { - default: - if (typeof object$1.kind === "number") { - message.kind = object$1.kind; - break; - } - break; - case "SPAN_KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "SPAN_KIND_INTERNAL": - case 1: - message.kind = 1; - break; - case "SPAN_KIND_SERVER": - case 2: - message.kind = 2; - break; - case "SPAN_KIND_CLIENT": - case 3: - message.kind = 3; - break; - case "SPAN_KIND_PRODUCER": - case 4: - message.kind = 4; - break; - case "SPAN_KIND_CONSUMER": - case 5: - message.kind = 5; - break; - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.endTimeUnixNano != null) { - if ($util.Long) (message.endTimeUnixNano = $util.Long.fromValue(object$1.endTimeUnixNano)).unsigned = false; - else if (typeof object$1.endTimeUnixNano === "string") message.endTimeUnixNano = parseInt(object$1.endTimeUnixNano, 10); - else if (typeof object$1.endTimeUnixNano === "number") message.endTimeUnixNano = object$1.endTimeUnixNano; - else if (typeof object$1.endTimeUnixNano === "object") message.endTimeUnixNano = new $util.LongBits(object$1.endTimeUnixNano.low >>> 0, object$1.endTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - if (object$1.events) { - if (!Array.isArray(object$1.events)) throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected"); - message.events = []; - for (var i = 0; i < object$1.events.length; ++i) { - if (typeof object$1.events[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected"); - message.events[i] = $root.opentelemetry.proto.trace.v1.Span.Event.fromObject(object$1.events[i]); - } - } - if (object$1.droppedEventsCount != null) message.droppedEventsCount = object$1.droppedEventsCount >>> 0; - if (object$1.links) { - if (!Array.isArray(object$1.links)) throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected"); - message.links = []; - for (var i = 0; i < object$1.links.length; ++i) { - if (typeof object$1.links[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected"); - message.links[i] = $root.opentelemetry.proto.trace.v1.Span.Link.fromObject(object$1.links[i]); - } - } - if (object$1.droppedLinksCount != null) message.droppedLinksCount = object$1.droppedLinksCount >>> 0; - if (object$1.status != null) { - if (typeof object$1.status !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected"); - message.status = $root.opentelemetry.proto.trace.v1.Status.fromObject(object$1.status); - } - return message; - }; - /** - * Creates a plain object from a Span message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {opentelemetry.proto.trace.v1.Span} message Span - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Span.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.attributes = []; - object$1.events = []; - object$1.links = []; - } - if (options.defaults) { - if (options.bytes === String) object$1.traceId = ""; - else { - object$1.traceId = []; - if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); - } - if (options.bytes === String) object$1.spanId = ""; - else { - object$1.spanId = []; - if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); - } - object$1.traceState = ""; - if (options.bytes === String) object$1.parentSpanId = ""; - else { - object$1.parentSpanId = []; - if (options.bytes !== Array) object$1.parentSpanId = $util.newBuffer(object$1.parentSpanId); - } - object$1.name = ""; - object$1.kind = options.enums === String ? "SPAN_KIND_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.endTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.endTimeUnixNano = options.longs === String ? "0" : 0; - object$1.droppedAttributesCount = 0; - object$1.droppedEventsCount = 0; - object$1.droppedLinksCount = 0; - object$1.status = null; - object$1.flags = 0; - } - if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; - if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; - if (message.traceState != null && message.hasOwnProperty("traceState")) object$1.traceState = message.traceState; - if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) object$1.parentSpanId = options.bytes === String ? $util.base64.encode(message.parentSpanId, 0, message.parentSpanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.parentSpanId) : message.parentSpanId; - if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; - if (message.kind != null && message.hasOwnProperty("kind")) object$1.kind = options.enums === String ? $root.opentelemetry.proto.trace.v1.Span.SpanKind[message.kind] === void 0 ? message.kind : $root.opentelemetry.proto.trace.v1.Span.SpanKind[message.kind] : message.kind; - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.endTimeUnixNano != null && message.hasOwnProperty("endTimeUnixNano")) if (typeof message.endTimeUnixNano === "number") object$1.endTimeUnixNano = options.longs === String ? String(message.endTimeUnixNano) : message.endTimeUnixNano; - else object$1.endTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.endTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.endTimeUnixNano.low >>> 0, message.endTimeUnixNano.high >>> 0).toNumber() : message.endTimeUnixNano; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - if (message.events && message.events.length) { - object$1.events = []; - for (var j = 0; j < message.events.length; ++j) object$1.events[j] = $root.opentelemetry.proto.trace.v1.Span.Event.toObject(message.events[j], options); - } - if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) object$1.droppedEventsCount = message.droppedEventsCount; - if (message.links && message.links.length) { - object$1.links = []; - for (var j = 0; j < message.links.length; ++j) object$1.links[j] = $root.opentelemetry.proto.trace.v1.Span.Link.toObject(message.links[j], options); - } - if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) object$1.droppedLinksCount = message.droppedLinksCount; - if (message.status != null && message.hasOwnProperty("status")) object$1.status = $root.opentelemetry.proto.trace.v1.Status.toObject(message.status, options); - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - return object$1; - }; - /** - * Converts this Span to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.Span - * @instance - * @returns {Object.} JSON object - */ - Span.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Span - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.Span - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Span.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span"; - }; - /** - * SpanKind enum. - * @name opentelemetry.proto.trace.v1.Span.SpanKind - * @enum {number} - * @property {number} SPAN_KIND_UNSPECIFIED=0 SPAN_KIND_UNSPECIFIED value - * @property {number} SPAN_KIND_INTERNAL=1 SPAN_KIND_INTERNAL value - * @property {number} SPAN_KIND_SERVER=2 SPAN_KIND_SERVER value - * @property {number} SPAN_KIND_CLIENT=3 SPAN_KIND_CLIENT value - * @property {number} SPAN_KIND_PRODUCER=4 SPAN_KIND_PRODUCER value - * @property {number} SPAN_KIND_CONSUMER=5 SPAN_KIND_CONSUMER value - */ - Span.SpanKind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SPAN_KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "SPAN_KIND_INTERNAL"] = 1; - values[valuesById[2] = "SPAN_KIND_SERVER"] = 2; - values[valuesById[3] = "SPAN_KIND_CLIENT"] = 3; - values[valuesById[4] = "SPAN_KIND_PRODUCER"] = 4; - values[valuesById[5] = "SPAN_KIND_CONSUMER"] = 5; - return values; - })(); - Span.Event = (function() { - /** - * Properties of an Event. - * @memberof opentelemetry.proto.trace.v1.Span - * @interface IEvent - * @property {number|Long|null} [timeUnixNano] Event timeUnixNano - * @property {string|null} [name] Event name - * @property {Array.|null} [attributes] Event attributes - * @property {number|null} [droppedAttributesCount] Event droppedAttributesCount - */ - /** - * Constructs a new Event. - * @memberof opentelemetry.proto.trace.v1.Span - * @classdesc Represents an Event. - * @implements IEvent - * @constructor - * @param {opentelemetry.proto.trace.v1.Span.IEvent=} [properties] Properties to set - */ - function Event(properties) { - this.attributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Event timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - */ - Event.prototype.timeUnixNano = null; - /** - * Event name. - * @member {string|null|undefined} name - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - */ - Event.prototype.name = null; - /** - * Event attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - */ - Event.prototype.attributes = $util.emptyArray; - /** - * Event droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - */ - Event.prototype.droppedAttributesCount = null; - /** - * Creates a new Event instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {opentelemetry.proto.trace.v1.Span.IEvent=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.Span.Event} Event instance - */ - Event.create = function create(properties) { - return new Event(properties); - }; - /** - * Encodes the specified Event message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Event.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {opentelemetry.proto.trace.v1.Span.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(9).fixed64(message.timeUnixNano); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(18).string(message.name); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(26).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(32).uint32(message.droppedAttributesCount); - return writer; - }; - /** - * Encodes the specified Event message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Event.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {opentelemetry.proto.trace.v1.Span.IEvent} message Event message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Event.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an Event message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.Span.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span.Event(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.timeUnixNano = reader.fixed64(); - break; - case 2: - message.name = reader.string(); - break; - case 3: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 4: - message.droppedAttributesCount = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an Event message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.Span.Event} Event - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Event.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an Event message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Event.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.name != null && message.hasOwnProperty("name")) { - if (!$util.isString(message.name)) return "name: string expected"; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - return null; - }; - /** - * Creates an Event message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.Span.Event} Event - */ - Event.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span.Event) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.Span.Event(); - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.name != null) message.name = String(object$1.name); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - return message; - }; - /** - * Creates a plain object from an Event message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {opentelemetry.proto.trace.v1.Span.Event} message Event - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Event.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.attributes = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - object$1.name = ""; - object$1.droppedAttributesCount = 0; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - return object$1; - }; - /** - * Converts this Event to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @instance - * @returns {Object.} JSON object - */ - Event.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Event - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.Span.Event - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Event.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span.Event"; - }; - return Event; - })(); - Span.Link = (function() { - /** - * Properties of a Link. - * @memberof opentelemetry.proto.trace.v1.Span - * @interface ILink - * @property {Uint8Array|null} [traceId] Link traceId - * @property {Uint8Array|null} [spanId] Link spanId - * @property {string|null} [traceState] Link traceState - * @property {Array.|null} [attributes] Link attributes - * @property {number|null} [droppedAttributesCount] Link droppedAttributesCount - * @property {number|null} [flags] Link flags - */ - /** - * Constructs a new Link. - * @memberof opentelemetry.proto.trace.v1.Span - * @classdesc Represents a Link. - * @implements ILink - * @constructor - * @param {opentelemetry.proto.trace.v1.Span.ILink=} [properties] Properties to set - */ - function Link(properties) { - this.attributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Link traceId. - * @member {Uint8Array|null|undefined} traceId - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.traceId = null; - /** - * Link spanId. - * @member {Uint8Array|null|undefined} spanId - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.spanId = null; - /** - * Link traceState. - * @member {string|null|undefined} traceState - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.traceState = null; - /** - * Link attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.attributes = $util.emptyArray; - /** - * Link droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.droppedAttributesCount = null; - /** - * Link flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - */ - Link.prototype.flags = null; - /** - * Creates a new Link instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {opentelemetry.proto.trace.v1.Span.ILink=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.Span.Link} Link instance - */ - Link.create = function create(properties) { - return new Link(properties); - }; - /** - * Encodes the specified Link message. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Link.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {opentelemetry.proto.trace.v1.Span.ILink} message Link message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Link.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(10).bytes(message.traceId); - if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(18).bytes(message.spanId); - if (message.traceState != null && Object.hasOwnProperty.call(message, "traceState")) writer.uint32(26).string(message.traceState); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(34).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(40).uint32(message.droppedAttributesCount); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(53).fixed32(message.flags); - return writer; - }; - /** - * Encodes the specified Link message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Span.Link.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {opentelemetry.proto.trace.v1.Span.ILink} message Link message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Link.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Link message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.Span.Link} Link - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Link.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Span.Link(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.traceId = reader.bytes(); - break; - case 2: - message.spanId = reader.bytes(); - break; - case 3: - message.traceState = reader.string(); - break; - case 4: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 5: - message.droppedAttributesCount = reader.uint32(); - break; - case 6: - message.flags = reader.fixed32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Link message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.Span.Link} Link - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Link.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Link message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Link.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.traceId != null && message.hasOwnProperty("traceId")) { - if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) { - if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; - } - if (message.traceState != null && message.hasOwnProperty("traceState")) { - if (!$util.isString(message.traceState)) return "traceState: string expected"; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - return null; - }; - /** - * Creates a Link message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.Span.Link} Link - */ - Link.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Span.Link) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.Span.Link(); - if (object$1.traceId != null) { - if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); - else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; - } - if (object$1.spanId != null) { - if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); - else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; - } - if (object$1.traceState != null) message.traceState = String(object$1.traceState); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - return message; - }; - /** - * Creates a plain object from a Link message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {opentelemetry.proto.trace.v1.Span.Link} message Link - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Link.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.attributes = []; - if (options.defaults) { - if (options.bytes === String) object$1.traceId = ""; - else { - object$1.traceId = []; - if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); - } - if (options.bytes === String) object$1.spanId = ""; - else { - object$1.spanId = []; - if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); - } - object$1.traceState = ""; - object$1.droppedAttributesCount = 0; - object$1.flags = 0; - } - if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; - if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; - if (message.traceState != null && message.hasOwnProperty("traceState")) object$1.traceState = message.traceState; - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - return object$1; - }; - /** - * Converts this Link to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @instance - * @returns {Object.} JSON object - */ - Link.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Link - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.Span.Link - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Link.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Span.Link"; - }; - return Link; - })(); - return Span; - })(); - v1.Status = (function() { - /** - * Properties of a Status. - * @memberof opentelemetry.proto.trace.v1 - * @interface IStatus - * @property {string|null} [message] Status message - * @property {opentelemetry.proto.trace.v1.Status.StatusCode|null} [code] Status code - */ - /** - * Constructs a new Status. - * @memberof opentelemetry.proto.trace.v1 - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {opentelemetry.proto.trace.v1.IStatus=} [properties] Properties to set - */ - function Status(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Status message. - * @member {string|null|undefined} message - * @memberof opentelemetry.proto.trace.v1.Status - * @instance - */ - Status.prototype.message = null; - /** - * Status code. - * @member {opentelemetry.proto.trace.v1.Status.StatusCode|null|undefined} code - * @memberof opentelemetry.proto.trace.v1.Status - * @instance - */ - Status.prototype.code = null; - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {opentelemetry.proto.trace.v1.IStatus=} [properties] Properties to set - * @returns {opentelemetry.proto.trace.v1.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - /** - * Encodes the specified Status message. Does not implicitly {@link opentelemetry.proto.trace.v1.Status.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {opentelemetry.proto.trace.v1.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) writer.uint32(18).string(message.message); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(24).int32(message.code); - return writer; - }; - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link opentelemetry.proto.trace.v1.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {opentelemetry.proto.trace.v1.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.trace.v1.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.trace.v1.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 2: - message.message = reader.string(); - break; - case 3: - message.code = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.trace.v1.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Status message. - * @function verify - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) { - if (!$util.isString(message.message)) return "message: string expected"; - } - if (message.code != null && message.hasOwnProperty("code")) switch (message.code) { - default: return "code: enum value expected"; - case 0: - case 1: - case 2: break; - } - return null; - }; - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.trace.v1.Status} Status - */ - Status.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.trace.v1.Status) return object$1; - var message = new $root.opentelemetry.proto.trace.v1.Status(); - if (object$1.message != null) message.message = String(object$1.message); - switch (object$1.code) { - default: - if (typeof object$1.code === "number") { - message.code = object$1.code; - break; - } - break; - case "STATUS_CODE_UNSET": - case 0: - message.code = 0; - break; - case "STATUS_CODE_OK": - case 1: - message.code = 1; - break; - case "STATUS_CODE_ERROR": - case 2: - message.code = 2; - break; - } - return message; - }; - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {opentelemetry.proto.trace.v1.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - object$1.message = ""; - object$1.code = options.enums === String ? "STATUS_CODE_UNSET" : 0; - } - if (message.message != null && message.hasOwnProperty("message")) object$1.message = message.message; - if (message.code != null && message.hasOwnProperty("code")) object$1.code = options.enums === String ? $root.opentelemetry.proto.trace.v1.Status.StatusCode[message.code] === void 0 ? message.code : $root.opentelemetry.proto.trace.v1.Status.StatusCode[message.code] : message.code; - return object$1; - }; - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof opentelemetry.proto.trace.v1.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof opentelemetry.proto.trace.v1.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.trace.v1.Status"; - }; - /** - * StatusCode enum. - * @name opentelemetry.proto.trace.v1.Status.StatusCode - * @enum {number} - * @property {number} STATUS_CODE_UNSET=0 STATUS_CODE_UNSET value - * @property {number} STATUS_CODE_OK=1 STATUS_CODE_OK value - * @property {number} STATUS_CODE_ERROR=2 STATUS_CODE_ERROR value - */ - Status.StatusCode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_CODE_UNSET"] = 0; - values[valuesById[1] = "STATUS_CODE_OK"] = 1; - values[valuesById[2] = "STATUS_CODE_ERROR"] = 2; - return values; - })(); - return Status; - })(); - /** - * SpanFlags enum. - * @name opentelemetry.proto.trace.v1.SpanFlags - * @enum {number} - * @property {number} SPAN_FLAGS_DO_NOT_USE=0 SPAN_FLAGS_DO_NOT_USE value - * @property {number} SPAN_FLAGS_TRACE_FLAGS_MASK=255 SPAN_FLAGS_TRACE_FLAGS_MASK value - * @property {number} SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK=256 SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK value - * @property {number} SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK=512 SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK value - */ - v1.SpanFlags = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SPAN_FLAGS_DO_NOT_USE"] = 0; - values[valuesById[255] = "SPAN_FLAGS_TRACE_FLAGS_MASK"] = 255; - values[valuesById[256] = "SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK"] = 256; - values[valuesById[512] = "SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK"] = 512; - return values; - })(); - return v1; - })(); - return trace$1; - })(); - proto.collector = (function() { - /** - * Namespace collector. - * @memberof opentelemetry.proto - * @namespace - */ - var collector = {}; - collector.trace = (function() { - /** - * Namespace trace. - * @memberof opentelemetry.proto.collector - * @namespace - */ - var trace$1 = {}; - trace$1.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.collector.trace - * @namespace - */ - var v1 = {}; - v1.TraceService = (function() { - /** - * Constructs a new TraceService service. - * @memberof opentelemetry.proto.collector.trace.v1 - * @classdesc Represents a TraceService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function TraceService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (TraceService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TraceService; - /** - * Creates new TraceService service using the specified rpc implementation. - * @function create - * @memberof opentelemetry.proto.collector.trace.v1.TraceService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {TraceService} RPC service. Useful where requests and/or responses are streamed. - */ - TraceService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - /** - * Callback as used by {@link opentelemetry.proto.collector.trace.v1.TraceService#export_}. - * @memberof opentelemetry.proto.collector.trace.v1.TraceService - * @typedef ExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} [response] ExportTraceServiceResponse - */ - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.trace.v1.TraceService - * @instance - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} request ExportTraceServiceRequest message or plain object - * @param {opentelemetry.proto.collector.trace.v1.TraceService.ExportCallback} callback Node-style callback called with the error, if any, and ExportTraceServiceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TraceService.prototype["export"] = function export_(request, callback) { - return this.rpcCall(export_, $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest, $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse, request, callback); - }, "name", { value: "Export" }); - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.trace.v1.TraceService - * @instance - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} request ExportTraceServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return TraceService; - })(); - v1.ExportTraceServiceRequest = (function() { - /** - * Properties of an ExportTraceServiceRequest. - * @memberof opentelemetry.proto.collector.trace.v1 - * @interface IExportTraceServiceRequest - * @property {Array.|null} [resourceSpans] ExportTraceServiceRequest resourceSpans - */ - /** - * Constructs a new ExportTraceServiceRequest. - * @memberof opentelemetry.proto.collector.trace.v1 - * @classdesc Represents an ExportTraceServiceRequest. - * @implements IExportTraceServiceRequest - * @constructor - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest=} [properties] Properties to set - */ - function ExportTraceServiceRequest(properties) { - this.resourceSpans = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportTraceServiceRequest resourceSpans. - * @member {Array.} resourceSpans - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @instance - */ - ExportTraceServiceRequest.prototype.resourceSpans = $util.emptyArray; - /** - * Creates a new ExportTraceServiceRequest instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest instance - */ - ExportTraceServiceRequest.create = function create(properties) { - return new ExportTraceServiceRequest(properties); - }; - /** - * Encodes the specified ExportTraceServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} message ExportTraceServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTraceServiceRequest.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceSpans != null && message.resourceSpans.length) for (var i = 0; i < message.resourceSpans.length; ++i) $root.opentelemetry.proto.trace.v1.ResourceSpans.encode(message.resourceSpans[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportTraceServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceRequest} message ExportTraceServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTraceServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportTraceServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTraceServiceRequest.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceSpans && message.resourceSpans.length)) message.resourceSpans = []; - message.resourceSpans.push($root.opentelemetry.proto.trace.v1.ResourceSpans.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportTraceServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTraceServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportTraceServiceRequest message. - * @function verify - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportTraceServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceSpans != null && message.hasOwnProperty("resourceSpans")) { - if (!Array.isArray(message.resourceSpans)) return "resourceSpans: array expected"; - for (var i = 0; i < message.resourceSpans.length; ++i) { - var error = $root.opentelemetry.proto.trace.v1.ResourceSpans.verify(message.resourceSpans[i]); - if (error) return "resourceSpans." + error; - } - } - return null; - }; - /** - * Creates an ExportTraceServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} ExportTraceServiceRequest - */ - ExportTraceServiceRequest.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest) return object$1; - var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest(); - if (object$1.resourceSpans) { - if (!Array.isArray(object$1.resourceSpans)) throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected"); - message.resourceSpans = []; - for (var i = 0; i < object$1.resourceSpans.length; ++i) { - if (typeof object$1.resourceSpans[i] !== "object") throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected"); - message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object$1.resourceSpans[i]); - } - } - return message; - }; - /** - * Creates a plain object from an ExportTraceServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest} message ExportTraceServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportTraceServiceRequest.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceSpans = []; - if (message.resourceSpans && message.resourceSpans.length) { - object$1.resourceSpans = []; - for (var j = 0; j < message.resourceSpans.length; ++j) object$1.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); - } - return object$1; - }; - /** - * Converts this ExportTraceServiceRequest to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @instance - * @returns {Object.} JSON object - */ - ExportTraceServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportTraceServiceRequest - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportTraceServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"; - }; - return ExportTraceServiceRequest; - })(); - v1.ExportTraceServiceResponse = (function() { - /** - * Properties of an ExportTraceServiceResponse. - * @memberof opentelemetry.proto.collector.trace.v1 - * @interface IExportTraceServiceResponse - * @property {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess|null} [partialSuccess] ExportTraceServiceResponse partialSuccess - */ - /** - * Constructs a new ExportTraceServiceResponse. - * @memberof opentelemetry.proto.collector.trace.v1 - * @classdesc Represents an ExportTraceServiceResponse. - * @implements IExportTraceServiceResponse - * @constructor - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse=} [properties] Properties to set - */ - function ExportTraceServiceResponse(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportTraceServiceResponse partialSuccess. - * @member {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess|null|undefined} partialSuccess - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @instance - */ - ExportTraceServiceResponse.prototype.partialSuccess = null; - /** - * Creates a new ExportTraceServiceResponse instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse instance - */ - ExportTraceServiceResponse.create = function create(properties) { - return new ExportTraceServiceResponse(properties); - }; - /** - * Encodes the specified ExportTraceServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse} message ExportTraceServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTraceServiceResponse.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportTraceServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTraceServiceResponse} message ExportTraceServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTraceServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportTraceServiceResponse message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTraceServiceResponse.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportTraceServiceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTraceServiceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportTraceServiceResponse message. - * @function verify - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportTraceServiceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(message.partialSuccess); - if (error) return "partialSuccess." + error; - } - return null; - }; - /** - * Creates an ExportTraceServiceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} ExportTraceServiceResponse - */ - ExportTraceServiceResponse.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse) return object$1; - var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse(); - if (object$1.partialSuccess != null) { - if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected"); - message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(object$1.partialSuccess); - } - return message; - }; - /** - * Creates a plain object from an ExportTraceServiceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse} message ExportTraceServiceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportTraceServiceResponse.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) object$1.partialSuccess = null; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(message.partialSuccess, options); - return object$1; - }; - /** - * Converts this ExportTraceServiceResponse to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @instance - * @returns {Object.} JSON object - */ - ExportTraceServiceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportTraceServiceResponse - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportTraceServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"; - }; - return ExportTraceServiceResponse; - })(); - v1.ExportTracePartialSuccess = (function() { - /** - * Properties of an ExportTracePartialSuccess. - * @memberof opentelemetry.proto.collector.trace.v1 - * @interface IExportTracePartialSuccess - * @property {number|Long|null} [rejectedSpans] ExportTracePartialSuccess rejectedSpans - * @property {string|null} [errorMessage] ExportTracePartialSuccess errorMessage - */ - /** - * Constructs a new ExportTracePartialSuccess. - * @memberof opentelemetry.proto.collector.trace.v1 - * @classdesc Represents an ExportTracePartialSuccess. - * @implements IExportTracePartialSuccess - * @constructor - * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess=} [properties] Properties to set - */ - function ExportTracePartialSuccess(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportTracePartialSuccess rejectedSpans. - * @member {number|Long|null|undefined} rejectedSpans - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @instance - */ - ExportTracePartialSuccess.prototype.rejectedSpans = null; - /** - * ExportTracePartialSuccess errorMessage. - * @member {string|null|undefined} errorMessage - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @instance - */ - ExportTracePartialSuccess.prototype.errorMessage = null; - /** - * Creates a new ExportTracePartialSuccess instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess instance - */ - ExportTracePartialSuccess.create = function create(properties) { - return new ExportTracePartialSuccess(properties); - }; - /** - * Encodes the specified ExportTracePartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess} message ExportTracePartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTracePartialSuccess.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.rejectedSpans != null && Object.hasOwnProperty.call(message, "rejectedSpans")) writer.uint32(8).int64(message.rejectedSpans); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); - return writer; - }; - /** - * Encodes the specified ExportTracePartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {opentelemetry.proto.collector.trace.v1.IExportTracePartialSuccess} message ExportTracePartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportTracePartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportTracePartialSuccess message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTracePartialSuccess.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.rejectedSpans = reader.int64(); - break; - case 2: - message.errorMessage = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportTracePartialSuccess message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportTracePartialSuccess.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportTracePartialSuccess message. - * @function verify - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportTracePartialSuccess.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) { - if (!$util.isInteger(message.rejectedSpans) && !(message.rejectedSpans && $util.isInteger(message.rejectedSpans.low) && $util.isInteger(message.rejectedSpans.high))) return "rejectedSpans: integer|Long expected"; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { - if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; - } - return null; - }; - /** - * Creates an ExportTracePartialSuccess message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} ExportTracePartialSuccess - */ - ExportTracePartialSuccess.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess) return object$1; - var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess(); - if (object$1.rejectedSpans != null) { - if ($util.Long) (message.rejectedSpans = $util.Long.fromValue(object$1.rejectedSpans)).unsigned = false; - else if (typeof object$1.rejectedSpans === "string") message.rejectedSpans = parseInt(object$1.rejectedSpans, 10); - else if (typeof object$1.rejectedSpans === "number") message.rejectedSpans = object$1.rejectedSpans; - else if (typeof object$1.rejectedSpans === "object") message.rejectedSpans = new $util.LongBits(object$1.rejectedSpans.low >>> 0, object$1.rejectedSpans.high >>> 0).toNumber(); - } - if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); - return message; - }; - /** - * Creates a plain object from an ExportTracePartialSuccess message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess} message ExportTracePartialSuccess - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportTracePartialSuccess.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.rejectedSpans = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.rejectedSpans = options.longs === String ? "0" : 0; - object$1.errorMessage = ""; - } - if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) if (typeof message.rejectedSpans === "number") object$1.rejectedSpans = options.longs === String ? String(message.rejectedSpans) : message.rejectedSpans; - else object$1.rejectedSpans = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedSpans) : options.longs === Number ? new $util.LongBits(message.rejectedSpans.low >>> 0, message.rejectedSpans.high >>> 0).toNumber() : message.rejectedSpans; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; - return object$1; - }; - /** - * Converts this ExportTracePartialSuccess to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @instance - * @returns {Object.} JSON object - */ - ExportTracePartialSuccess.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportTracePartialSuccess - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportTracePartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"; - }; - return ExportTracePartialSuccess; - })(); - return v1; - })(); - return trace$1; - })(); - collector.metrics = (function() { - /** - * Namespace metrics. - * @memberof opentelemetry.proto.collector - * @namespace - */ - var metrics$1 = {}; - metrics$1.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.collector.metrics - * @namespace - */ - var v1 = {}; - v1.MetricsService = (function() { - /** - * Constructs a new MetricsService service. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @classdesc Represents a MetricsService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function MetricsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (MetricsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MetricsService; - /** - * Creates new MetricsService service using the specified rpc implementation. - * @function create - * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {MetricsService} RPC service. Useful where requests and/or responses are streamed. - */ - MetricsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - /** - * Callback as used by {@link opentelemetry.proto.collector.metrics.v1.MetricsService#export_}. - * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService - * @typedef ExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} [response] ExportMetricsServiceResponse - */ - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService - * @instance - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} request ExportMetricsServiceRequest message or plain object - * @param {opentelemetry.proto.collector.metrics.v1.MetricsService.ExportCallback} callback Node-style callback called with the error, if any, and ExportMetricsServiceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(MetricsService.prototype["export"] = function export_(request, callback) { - return this.rpcCall(export_, $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest, $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse, request, callback); - }, "name", { value: "Export" }); - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.metrics.v1.MetricsService - * @instance - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} request ExportMetricsServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return MetricsService; - })(); - v1.ExportMetricsServiceRequest = (function() { - /** - * Properties of an ExportMetricsServiceRequest. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @interface IExportMetricsServiceRequest - * @property {Array.|null} [resourceMetrics] ExportMetricsServiceRequest resourceMetrics - */ - /** - * Constructs a new ExportMetricsServiceRequest. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @classdesc Represents an ExportMetricsServiceRequest. - * @implements IExportMetricsServiceRequest - * @constructor - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest=} [properties] Properties to set - */ - function ExportMetricsServiceRequest(properties) { - this.resourceMetrics = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportMetricsServiceRequest resourceMetrics. - * @member {Array.} resourceMetrics - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @instance - */ - ExportMetricsServiceRequest.prototype.resourceMetrics = $util.emptyArray; - /** - * Creates a new ExportMetricsServiceRequest instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest instance - */ - ExportMetricsServiceRequest.create = function create(properties) { - return new ExportMetricsServiceRequest(properties); - }; - /** - * Encodes the specified ExportMetricsServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} message ExportMetricsServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsServiceRequest.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceMetrics != null && message.resourceMetrics.length) for (var i = 0; i < message.resourceMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportMetricsServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceRequest} message ExportMetricsServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportMetricsServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsServiceRequest.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceMetrics && message.resourceMetrics.length)) message.resourceMetrics = []; - message.resourceMetrics.push($root.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportMetricsServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportMetricsServiceRequest message. - * @function verify - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportMetricsServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { - if (!Array.isArray(message.resourceMetrics)) return "resourceMetrics: array expected"; - for (var i = 0; i < message.resourceMetrics.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i]); - if (error) return "resourceMetrics." + error; - } - } - return null; - }; - /** - * Creates an ExportMetricsServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} ExportMetricsServiceRequest - */ - ExportMetricsServiceRequest.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) return object$1; - var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest(); - if (object$1.resourceMetrics) { - if (!Array.isArray(object$1.resourceMetrics)) throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected"); - message.resourceMetrics = []; - for (var i = 0; i < object$1.resourceMetrics.length; ++i) { - if (typeof object$1.resourceMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected"); - message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object$1.resourceMetrics[i]); - } - } - return message; - }; - /** - * Creates a plain object from an ExportMetricsServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest} message ExportMetricsServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportMetricsServiceRequest.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceMetrics = []; - if (message.resourceMetrics && message.resourceMetrics.length) { - object$1.resourceMetrics = []; - for (var j = 0; j < message.resourceMetrics.length; ++j) object$1.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); - } - return object$1; - }; - /** - * Converts this ExportMetricsServiceRequest to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @instance - * @returns {Object.} JSON object - */ - ExportMetricsServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportMetricsServiceRequest - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportMetricsServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"; - }; - return ExportMetricsServiceRequest; - })(); - v1.ExportMetricsServiceResponse = (function() { - /** - * Properties of an ExportMetricsServiceResponse. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @interface IExportMetricsServiceResponse - * @property {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess|null} [partialSuccess] ExportMetricsServiceResponse partialSuccess - */ - /** - * Constructs a new ExportMetricsServiceResponse. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @classdesc Represents an ExportMetricsServiceResponse. - * @implements IExportMetricsServiceResponse - * @constructor - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse=} [properties] Properties to set - */ - function ExportMetricsServiceResponse(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportMetricsServiceResponse partialSuccess. - * @member {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess|null|undefined} partialSuccess - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @instance - */ - ExportMetricsServiceResponse.prototype.partialSuccess = null; - /** - * Creates a new ExportMetricsServiceResponse instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse instance - */ - ExportMetricsServiceResponse.create = function create(properties) { - return new ExportMetricsServiceResponse(properties); - }; - /** - * Encodes the specified ExportMetricsServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse} message ExportMetricsServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsServiceResponse.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportMetricsServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsServiceResponse} message ExportMetricsServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportMetricsServiceResponse message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsServiceResponse.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportMetricsServiceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsServiceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportMetricsServiceResponse message. - * @function verify - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportMetricsServiceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(message.partialSuccess); - if (error) return "partialSuccess." + error; - } - return null; - }; - /** - * Creates an ExportMetricsServiceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} ExportMetricsServiceResponse - */ - ExportMetricsServiceResponse.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse) return object$1; - var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse(); - if (object$1.partialSuccess != null) { - if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected"); - message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(object$1.partialSuccess); - } - return message; - }; - /** - * Creates a plain object from an ExportMetricsServiceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse} message ExportMetricsServiceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportMetricsServiceResponse.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) object$1.partialSuccess = null; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(message.partialSuccess, options); - return object$1; - }; - /** - * Converts this ExportMetricsServiceResponse to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @instance - * @returns {Object.} JSON object - */ - ExportMetricsServiceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportMetricsServiceResponse - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportMetricsServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"; - }; - return ExportMetricsServiceResponse; - })(); - v1.ExportMetricsPartialSuccess = (function() { - /** - * Properties of an ExportMetricsPartialSuccess. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @interface IExportMetricsPartialSuccess - * @property {number|Long|null} [rejectedDataPoints] ExportMetricsPartialSuccess rejectedDataPoints - * @property {string|null} [errorMessage] ExportMetricsPartialSuccess errorMessage - */ - /** - * Constructs a new ExportMetricsPartialSuccess. - * @memberof opentelemetry.proto.collector.metrics.v1 - * @classdesc Represents an ExportMetricsPartialSuccess. - * @implements IExportMetricsPartialSuccess - * @constructor - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess=} [properties] Properties to set - */ - function ExportMetricsPartialSuccess(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportMetricsPartialSuccess rejectedDataPoints. - * @member {number|Long|null|undefined} rejectedDataPoints - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @instance - */ - ExportMetricsPartialSuccess.prototype.rejectedDataPoints = null; - /** - * ExportMetricsPartialSuccess errorMessage. - * @member {string|null|undefined} errorMessage - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @instance - */ - ExportMetricsPartialSuccess.prototype.errorMessage = null; - /** - * Creates a new ExportMetricsPartialSuccess instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess instance - */ - ExportMetricsPartialSuccess.create = function create(properties) { - return new ExportMetricsPartialSuccess(properties); - }; - /** - * Encodes the specified ExportMetricsPartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess} message ExportMetricsPartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsPartialSuccess.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.rejectedDataPoints != null && Object.hasOwnProperty.call(message, "rejectedDataPoints")) writer.uint32(8).int64(message.rejectedDataPoints); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); - return writer; - }; - /** - * Encodes the specified ExportMetricsPartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.metrics.v1.IExportMetricsPartialSuccess} message ExportMetricsPartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportMetricsPartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportMetricsPartialSuccess message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsPartialSuccess.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.rejectedDataPoints = reader.int64(); - break; - case 2: - message.errorMessage = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportMetricsPartialSuccess message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportMetricsPartialSuccess.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportMetricsPartialSuccess message. - * @function verify - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportMetricsPartialSuccess.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) { - if (!$util.isInteger(message.rejectedDataPoints) && !(message.rejectedDataPoints && $util.isInteger(message.rejectedDataPoints.low) && $util.isInteger(message.rejectedDataPoints.high))) return "rejectedDataPoints: integer|Long expected"; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { - if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; - } - return null; - }; - /** - * Creates an ExportMetricsPartialSuccess message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} ExportMetricsPartialSuccess - */ - ExportMetricsPartialSuccess.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess) return object$1; - var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess(); - if (object$1.rejectedDataPoints != null) { - if ($util.Long) (message.rejectedDataPoints = $util.Long.fromValue(object$1.rejectedDataPoints)).unsigned = false; - else if (typeof object$1.rejectedDataPoints === "string") message.rejectedDataPoints = parseInt(object$1.rejectedDataPoints, 10); - else if (typeof object$1.rejectedDataPoints === "number") message.rejectedDataPoints = object$1.rejectedDataPoints; - else if (typeof object$1.rejectedDataPoints === "object") message.rejectedDataPoints = new $util.LongBits(object$1.rejectedDataPoints.low >>> 0, object$1.rejectedDataPoints.high >>> 0).toNumber(); - } - if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); - return message; - }; - /** - * Creates a plain object from an ExportMetricsPartialSuccess message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess} message ExportMetricsPartialSuccess - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportMetricsPartialSuccess.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.rejectedDataPoints = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.rejectedDataPoints = options.longs === String ? "0" : 0; - object$1.errorMessage = ""; - } - if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) if (typeof message.rejectedDataPoints === "number") object$1.rejectedDataPoints = options.longs === String ? String(message.rejectedDataPoints) : message.rejectedDataPoints; - else object$1.rejectedDataPoints = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedDataPoints) : options.longs === Number ? new $util.LongBits(message.rejectedDataPoints.low >>> 0, message.rejectedDataPoints.high >>> 0).toNumber() : message.rejectedDataPoints; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; - return object$1; - }; - /** - * Converts this ExportMetricsPartialSuccess to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @instance - * @returns {Object.} JSON object - */ - ExportMetricsPartialSuccess.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportMetricsPartialSuccess - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportMetricsPartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"; - }; - return ExportMetricsPartialSuccess; - })(); - return v1; - })(); - return metrics$1; - })(); - collector.logs = (function() { - /** - * Namespace logs. - * @memberof opentelemetry.proto.collector - * @namespace - */ - var logs = {}; - logs.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.collector.logs - * @namespace - */ - var v1 = {}; - v1.LogsService = (function() { - /** - * Constructs a new LogsService service. - * @memberof opentelemetry.proto.collector.logs.v1 - * @classdesc Represents a LogsService - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function LogsService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (LogsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LogsService; - /** - * Creates new LogsService service using the specified rpc implementation. - * @function create - * @memberof opentelemetry.proto.collector.logs.v1.LogsService - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {LogsService} RPC service. Useful where requests and/or responses are streamed. - */ - LogsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - /** - * Callback as used by {@link opentelemetry.proto.collector.logs.v1.LogsService#export_}. - * @memberof opentelemetry.proto.collector.logs.v1.LogsService - * @typedef ExportCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} [response] ExportLogsServiceResponse - */ - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.logs.v1.LogsService - * @instance - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} request ExportLogsServiceRequest message or plain object - * @param {opentelemetry.proto.collector.logs.v1.LogsService.ExportCallback} callback Node-style callback called with the error, if any, and ExportLogsServiceResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(LogsService.prototype["export"] = function export_(request, callback) { - return this.rpcCall(export_, $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest, $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse, request, callback); - }, "name", { value: "Export" }); - /** - * Calls Export. - * @function export - * @memberof opentelemetry.proto.collector.logs.v1.LogsService - * @instance - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} request ExportLogsServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - return LogsService; - })(); - v1.ExportLogsServiceRequest = (function() { - /** - * Properties of an ExportLogsServiceRequest. - * @memberof opentelemetry.proto.collector.logs.v1 - * @interface IExportLogsServiceRequest - * @property {Array.|null} [resourceLogs] ExportLogsServiceRequest resourceLogs - */ - /** - * Constructs a new ExportLogsServiceRequest. - * @memberof opentelemetry.proto.collector.logs.v1 - * @classdesc Represents an ExportLogsServiceRequest. - * @implements IExportLogsServiceRequest - * @constructor - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest=} [properties] Properties to set - */ - function ExportLogsServiceRequest(properties) { - this.resourceLogs = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportLogsServiceRequest resourceLogs. - * @member {Array.} resourceLogs - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @instance - */ - ExportLogsServiceRequest.prototype.resourceLogs = $util.emptyArray; - /** - * Creates a new ExportLogsServiceRequest instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest instance - */ - ExportLogsServiceRequest.create = function create(properties) { - return new ExportLogsServiceRequest(properties); - }; - /** - * Encodes the specified ExportLogsServiceRequest message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} message ExportLogsServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsServiceRequest.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceLogs != null && message.resourceLogs.length) for (var i = 0; i < message.resourceLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportLogsServiceRequest message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceRequest} message ExportLogsServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportLogsServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsServiceRequest.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceLogs && message.resourceLogs.length)) message.resourceLogs = []; - message.resourceLogs.push($root.opentelemetry.proto.logs.v1.ResourceLogs.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportLogsServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportLogsServiceRequest message. - * @function verify - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportLogsServiceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { - if (!Array.isArray(message.resourceLogs)) return "resourceLogs: array expected"; - for (var i = 0; i < message.resourceLogs.length; ++i) { - var error = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i]); - if (error) return "resourceLogs." + error; - } - } - return null; - }; - /** - * Creates an ExportLogsServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} ExportLogsServiceRequest - */ - ExportLogsServiceRequest.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) return object$1; - var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest(); - if (object$1.resourceLogs) { - if (!Array.isArray(object$1.resourceLogs)) throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected"); - message.resourceLogs = []; - for (var i = 0; i < object$1.resourceLogs.length; ++i) { - if (typeof object$1.resourceLogs[i] !== "object") throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected"); - message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object$1.resourceLogs[i]); - } - } - return message; - }; - /** - * Creates a plain object from an ExportLogsServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest} message ExportLogsServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportLogsServiceRequest.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceLogs = []; - if (message.resourceLogs && message.resourceLogs.length) { - object$1.resourceLogs = []; - for (var j = 0; j < message.resourceLogs.length; ++j) object$1.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); - } - return object$1; - }; - /** - * Converts this ExportLogsServiceRequest to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @instance - * @returns {Object.} JSON object - */ - ExportLogsServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportLogsServiceRequest - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportLogsServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"; - }; - return ExportLogsServiceRequest; - })(); - v1.ExportLogsServiceResponse = (function() { - /** - * Properties of an ExportLogsServiceResponse. - * @memberof opentelemetry.proto.collector.logs.v1 - * @interface IExportLogsServiceResponse - * @property {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess|null} [partialSuccess] ExportLogsServiceResponse partialSuccess - */ - /** - * Constructs a new ExportLogsServiceResponse. - * @memberof opentelemetry.proto.collector.logs.v1 - * @classdesc Represents an ExportLogsServiceResponse. - * @implements IExportLogsServiceResponse - * @constructor - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse=} [properties] Properties to set - */ - function ExportLogsServiceResponse(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportLogsServiceResponse partialSuccess. - * @member {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess|null|undefined} partialSuccess - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @instance - */ - ExportLogsServiceResponse.prototype.partialSuccess = null; - /** - * Creates a new ExportLogsServiceResponse instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse instance - */ - ExportLogsServiceResponse.create = function create(properties) { - return new ExportLogsServiceResponse(properties); - }; - /** - * Encodes the specified ExportLogsServiceResponse message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse} message ExportLogsServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsServiceResponse.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.partialSuccess != null && Object.hasOwnProperty.call(message, "partialSuccess")) $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(message.partialSuccess, writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified ExportLogsServiceResponse message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsServiceResponse} message ExportLogsServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportLogsServiceResponse message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsServiceResponse.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportLogsServiceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsServiceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportLogsServiceResponse message. - * @function verify - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportLogsServiceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) { - var error = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(message.partialSuccess); - if (error) return "partialSuccess." + error; - } - return null; - }; - /** - * Creates an ExportLogsServiceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} ExportLogsServiceResponse - */ - ExportLogsServiceResponse.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse) return object$1; - var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse(); - if (object$1.partialSuccess != null) { - if (typeof object$1.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected"); - message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(object$1.partialSuccess); - } - return message; - }; - /** - * Creates a plain object from an ExportLogsServiceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse} message ExportLogsServiceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportLogsServiceResponse.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) object$1.partialSuccess = null; - if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object$1.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(message.partialSuccess, options); - return object$1; - }; - /** - * Converts this ExportLogsServiceResponse to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @instance - * @returns {Object.} JSON object - */ - ExportLogsServiceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportLogsServiceResponse - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportLogsServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"; - }; - return ExportLogsServiceResponse; - })(); - v1.ExportLogsPartialSuccess = (function() { - /** - * Properties of an ExportLogsPartialSuccess. - * @memberof opentelemetry.proto.collector.logs.v1 - * @interface IExportLogsPartialSuccess - * @property {number|Long|null} [rejectedLogRecords] ExportLogsPartialSuccess rejectedLogRecords - * @property {string|null} [errorMessage] ExportLogsPartialSuccess errorMessage - */ - /** - * Constructs a new ExportLogsPartialSuccess. - * @memberof opentelemetry.proto.collector.logs.v1 - * @classdesc Represents an ExportLogsPartialSuccess. - * @implements IExportLogsPartialSuccess - * @constructor - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess=} [properties] Properties to set - */ - function ExportLogsPartialSuccess(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExportLogsPartialSuccess rejectedLogRecords. - * @member {number|Long|null|undefined} rejectedLogRecords - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @instance - */ - ExportLogsPartialSuccess.prototype.rejectedLogRecords = null; - /** - * ExportLogsPartialSuccess errorMessage. - * @member {string|null|undefined} errorMessage - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @instance - */ - ExportLogsPartialSuccess.prototype.errorMessage = null; - /** - * Creates a new ExportLogsPartialSuccess instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess=} [properties] Properties to set - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess instance - */ - ExportLogsPartialSuccess.create = function create(properties) { - return new ExportLogsPartialSuccess(properties); - }; - /** - * Encodes the specified ExportLogsPartialSuccess message. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess} message ExportLogsPartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsPartialSuccess.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.rejectedLogRecords != null && Object.hasOwnProperty.call(message, "rejectedLogRecords")) writer.uint32(8).int64(message.rejectedLogRecords); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(18).string(message.errorMessage); - return writer; - }; - /** - * Encodes the specified ExportLogsPartialSuccess message, length delimited. Does not implicitly {@link opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.logs.v1.IExportLogsPartialSuccess} message ExportLogsPartialSuccess message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportLogsPartialSuccess.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExportLogsPartialSuccess message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsPartialSuccess.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.rejectedLogRecords = reader.int64(); - break; - case 2: - message.errorMessage = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExportLogsPartialSuccess message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportLogsPartialSuccess.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExportLogsPartialSuccess message. - * @function verify - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportLogsPartialSuccess.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) { - if (!$util.isInteger(message.rejectedLogRecords) && !(message.rejectedLogRecords && $util.isInteger(message.rejectedLogRecords.low) && $util.isInteger(message.rejectedLogRecords.high))) return "rejectedLogRecords: integer|Long expected"; - } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) { - if (!$util.isString(message.errorMessage)) return "errorMessage: string expected"; - } - return null; - }; - /** - * Creates an ExportLogsPartialSuccess message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} ExportLogsPartialSuccess - */ - ExportLogsPartialSuccess.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess) return object$1; - var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess(); - if (object$1.rejectedLogRecords != null) { - if ($util.Long) (message.rejectedLogRecords = $util.Long.fromValue(object$1.rejectedLogRecords)).unsigned = false; - else if (typeof object$1.rejectedLogRecords === "string") message.rejectedLogRecords = parseInt(object$1.rejectedLogRecords, 10); - else if (typeof object$1.rejectedLogRecords === "number") message.rejectedLogRecords = object$1.rejectedLogRecords; - else if (typeof object$1.rejectedLogRecords === "object") message.rejectedLogRecords = new $util.LongBits(object$1.rejectedLogRecords.low >>> 0, object$1.rejectedLogRecords.high >>> 0).toNumber(); - } - if (object$1.errorMessage != null) message.errorMessage = String(object$1.errorMessage); - return message; - }; - /** - * Creates a plain object from an ExportLogsPartialSuccess message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess} message ExportLogsPartialSuccess - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportLogsPartialSuccess.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.rejectedLogRecords = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.rejectedLogRecords = options.longs === String ? "0" : 0; - object$1.errorMessage = ""; - } - if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) if (typeof message.rejectedLogRecords === "number") object$1.rejectedLogRecords = options.longs === String ? String(message.rejectedLogRecords) : message.rejectedLogRecords; - else object$1.rejectedLogRecords = options.longs === String ? $util.Long.prototype.toString.call(message.rejectedLogRecords) : options.longs === Number ? new $util.LongBits(message.rejectedLogRecords.low >>> 0, message.rejectedLogRecords.high >>> 0).toNumber() : message.rejectedLogRecords; - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) object$1.errorMessage = message.errorMessage; - return object$1; - }; - /** - * Converts this ExportLogsPartialSuccess to JSON. - * @function toJSON - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @instance - * @returns {Object.} JSON object - */ - ExportLogsPartialSuccess.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExportLogsPartialSuccess - * @function getTypeUrl - * @memberof opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportLogsPartialSuccess.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"; - }; - return ExportLogsPartialSuccess; - })(); - return v1; - })(); - return logs; - })(); - return collector; - })(); - proto.metrics = (function() { - /** - * Namespace metrics. - * @memberof opentelemetry.proto - * @namespace - */ - var metrics$1 = {}; - metrics$1.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.metrics - * @namespace - */ - var v1 = {}; - v1.MetricsData = (function() { - /** - * Properties of a MetricsData. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IMetricsData - * @property {Array.|null} [resourceMetrics] MetricsData resourceMetrics - */ - /** - * Constructs a new MetricsData. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a MetricsData. - * @implements IMetricsData - * @constructor - * @param {opentelemetry.proto.metrics.v1.IMetricsData=} [properties] Properties to set - */ - function MetricsData(properties) { - this.resourceMetrics = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * MetricsData resourceMetrics. - * @member {Array.} resourceMetrics - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @instance - */ - MetricsData.prototype.resourceMetrics = $util.emptyArray; - /** - * Creates a new MetricsData instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {opentelemetry.proto.metrics.v1.IMetricsData=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData instance - */ - MetricsData.create = function create(properties) { - return new MetricsData(properties); - }; - /** - * Encodes the specified MetricsData message. Does not implicitly {@link opentelemetry.proto.metrics.v1.MetricsData.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {opentelemetry.proto.metrics.v1.IMetricsData} message MetricsData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricsData.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceMetrics != null && message.resourceMetrics.length) for (var i = 0; i < message.resourceMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(message.resourceMetrics[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified MetricsData message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.MetricsData.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {opentelemetry.proto.metrics.v1.IMetricsData} message MetricsData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetricsData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a MetricsData message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricsData.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.MetricsData(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceMetrics && message.resourceMetrics.length)) message.resourceMetrics = []; - message.resourceMetrics.push($root.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a MetricsData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetricsData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a MetricsData message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetricsData.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceMetrics != null && message.hasOwnProperty("resourceMetrics")) { - if (!Array.isArray(message.resourceMetrics)) return "resourceMetrics: array expected"; - for (var i = 0; i < message.resourceMetrics.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(message.resourceMetrics[i]); - if (error) return "resourceMetrics." + error; - } - } - return null; - }; - /** - * Creates a MetricsData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.MetricsData} MetricsData - */ - MetricsData.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.MetricsData) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.MetricsData(); - if (object$1.resourceMetrics) { - if (!Array.isArray(object$1.resourceMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected"); - message.resourceMetrics = []; - for (var i = 0; i < object$1.resourceMetrics.length; ++i) { - if (typeof object$1.resourceMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected"); - message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object$1.resourceMetrics[i]); - } - } - return message; - }; - /** - * Creates a plain object from a MetricsData message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {opentelemetry.proto.metrics.v1.MetricsData} message MetricsData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetricsData.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceMetrics = []; - if (message.resourceMetrics && message.resourceMetrics.length) { - object$1.resourceMetrics = []; - for (var j = 0; j < message.resourceMetrics.length; ++j) object$1.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); - } - return object$1; - }; - /** - * Converts this MetricsData to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @instance - * @returns {Object.} JSON object - */ - MetricsData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for MetricsData - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.MetricsData - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MetricsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.MetricsData"; - }; - return MetricsData; - })(); - v1.ResourceMetrics = (function() { - /** - * Properties of a ResourceMetrics. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IResourceMetrics - * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceMetrics resource - * @property {Array.|null} [scopeMetrics] ResourceMetrics scopeMetrics - * @property {string|null} [schemaUrl] ResourceMetrics schemaUrl - */ - /** - * Constructs a new ResourceMetrics. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a ResourceMetrics. - * @implements IResourceMetrics - * @constructor - * @param {opentelemetry.proto.metrics.v1.IResourceMetrics=} [properties] Properties to set - */ - function ResourceMetrics(properties) { - this.scopeMetrics = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ResourceMetrics resource. - * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @instance - */ - ResourceMetrics.prototype.resource = null; - /** - * ResourceMetrics scopeMetrics. - * @member {Array.} scopeMetrics - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @instance - */ - ResourceMetrics.prototype.scopeMetrics = $util.emptyArray; - /** - * ResourceMetrics schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @instance - */ - ResourceMetrics.prototype.schemaUrl = null; - /** - * Creates a new ResourceMetrics instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IResourceMetrics=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics instance - */ - ResourceMetrics.create = function create(properties) { - return new ResourceMetrics(properties); - }; - /** - * Encodes the specified ResourceMetrics message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ResourceMetrics.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IResourceMetrics} message ResourceMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceMetrics.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - if (message.scopeMetrics != null && message.scopeMetrics.length) for (var i = 0; i < message.scopeMetrics.length; ++i) $root.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(message.scopeMetrics[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ResourceMetrics message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ResourceMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IResourceMetrics} message ResourceMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ResourceMetrics message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceMetrics.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.scopeMetrics && message.scopeMetrics.length)) message.scopeMetrics = []; - message.scopeMetrics.push($root.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ResourceMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ResourceMetrics message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error) return "resource." + error; - } - if (message.scopeMetrics != null && message.hasOwnProperty("scopeMetrics")) { - if (!Array.isArray(message.scopeMetrics)) return "scopeMetrics: array expected"; - for (var i = 0; i < message.scopeMetrics.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(message.scopeMetrics[i]); - if (error) return "scopeMetrics." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ResourceMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ResourceMetrics} ResourceMetrics - */ - ResourceMetrics.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ResourceMetrics) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics(); - if (object$1.resource != null) { - if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected"); - message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); - } - if (object$1.scopeMetrics) { - if (!Array.isArray(object$1.scopeMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected"); - message.scopeMetrics = []; - for (var i = 0; i < object$1.scopeMetrics.length; ++i) { - if (typeof object$1.scopeMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected"); - message.scopeMetrics[i] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(object$1.scopeMetrics[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ResourceMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.ResourceMetrics} message ResourceMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceMetrics.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.scopeMetrics = []; - if (options.defaults) { - object$1.resource = null; - object$1.schemaUrl = ""; - } - if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); - if (message.scopeMetrics && message.scopeMetrics.length) { - object$1.scopeMetrics = []; - for (var j = 0; j < message.scopeMetrics.length; ++j) object$1.scopeMetrics[j] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(message.scopeMetrics[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ResourceMetrics to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @instance - * @returns {Object.} JSON object - */ - ResourceMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ResourceMetrics - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ResourceMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ResourceMetrics"; - }; - return ResourceMetrics; - })(); - v1.ScopeMetrics = (function() { - /** - * Properties of a ScopeMetrics. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IScopeMetrics - * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeMetrics scope - * @property {Array.|null} [metrics] ScopeMetrics metrics - * @property {string|null} [schemaUrl] ScopeMetrics schemaUrl - */ - /** - * Constructs a new ScopeMetrics. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a ScopeMetrics. - * @implements IScopeMetrics - * @constructor - * @param {opentelemetry.proto.metrics.v1.IScopeMetrics=} [properties] Properties to set - */ - function ScopeMetrics(properties) { - this.metrics = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ScopeMetrics scope. - * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @instance - */ - ScopeMetrics.prototype.scope = null; - /** - * ScopeMetrics metrics. - * @member {Array.} metrics - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @instance - */ - ScopeMetrics.prototype.metrics = $util.emptyArray; - /** - * ScopeMetrics schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @instance - */ - ScopeMetrics.prototype.schemaUrl = null; - /** - * Creates a new ScopeMetrics instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IScopeMetrics=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics instance - */ - ScopeMetrics.create = function create(properties) { - return new ScopeMetrics(properties); - }; - /** - * Encodes the specified ScopeMetrics message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ScopeMetrics.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IScopeMetrics} message ScopeMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeMetrics.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); - if (message.metrics != null && message.metrics.length) for (var i = 0; i < message.metrics.length; ++i) $root.opentelemetry.proto.metrics.v1.Metric.encode(message.metrics[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ScopeMetrics message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ScopeMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.IScopeMetrics} message ScopeMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ScopeMetrics message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeMetrics.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.metrics && message.metrics.length)) message.metrics = []; - message.metrics.push($root.opentelemetry.proto.metrics.v1.Metric.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ScopeMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ScopeMetrics message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScopeMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) { - var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error) return "scope." + error; - } - if (message.metrics != null && message.hasOwnProperty("metrics")) { - if (!Array.isArray(message.metrics)) return "metrics: array expected"; - for (var i = 0; i < message.metrics.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.Metric.verify(message.metrics[i]); - if (error) return "metrics." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ScopeMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ScopeMetrics} ScopeMetrics - */ - ScopeMetrics.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ScopeMetrics) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics(); - if (object$1.scope != null) { - if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected"); - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); - } - if (object$1.metrics) { - if (!Array.isArray(object$1.metrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected"); - message.metrics = []; - for (var i = 0; i < object$1.metrics.length; ++i) { - if (typeof object$1.metrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected"); - message.metrics[i] = $root.opentelemetry.proto.metrics.v1.Metric.fromObject(object$1.metrics[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ScopeMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {opentelemetry.proto.metrics.v1.ScopeMetrics} message ScopeMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScopeMetrics.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.metrics = []; - if (options.defaults) { - object$1.scope = null; - object$1.schemaUrl = ""; - } - if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); - if (message.metrics && message.metrics.length) { - object$1.metrics = []; - for (var j = 0; j < message.metrics.length; ++j) object$1.metrics[j] = $root.opentelemetry.proto.metrics.v1.Metric.toObject(message.metrics[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ScopeMetrics to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @instance - * @returns {Object.} JSON object - */ - ScopeMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ScopeMetrics - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ScopeMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScopeMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ScopeMetrics"; - }; - return ScopeMetrics; - })(); - v1.Metric = (function() { - /** - * Properties of a Metric. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IMetric - * @property {string|null} [name] Metric name - * @property {string|null} [description] Metric description - * @property {string|null} [unit] Metric unit - * @property {opentelemetry.proto.metrics.v1.IGauge|null} [gauge] Metric gauge - * @property {opentelemetry.proto.metrics.v1.ISum|null} [sum] Metric sum - * @property {opentelemetry.proto.metrics.v1.IHistogram|null} [histogram] Metric histogram - * @property {opentelemetry.proto.metrics.v1.IExponentialHistogram|null} [exponentialHistogram] Metric exponentialHistogram - * @property {opentelemetry.proto.metrics.v1.ISummary|null} [summary] Metric summary - * @property {Array.|null} [metadata] Metric metadata - */ - /** - * Constructs a new Metric. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Metric. - * @implements IMetric - * @constructor - * @param {opentelemetry.proto.metrics.v1.IMetric=} [properties] Properties to set - */ - function Metric(properties) { - this.metadata = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Metric name. - * @member {string|null|undefined} name - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.name = null; - /** - * Metric description. - * @member {string|null|undefined} description - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.description = null; - /** - * Metric unit. - * @member {string|null|undefined} unit - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.unit = null; - /** - * Metric gauge. - * @member {opentelemetry.proto.metrics.v1.IGauge|null|undefined} gauge - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.gauge = null; - /** - * Metric sum. - * @member {opentelemetry.proto.metrics.v1.ISum|null|undefined} sum - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.sum = null; - /** - * Metric histogram. - * @member {opentelemetry.proto.metrics.v1.IHistogram|null|undefined} histogram - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.histogram = null; - /** - * Metric exponentialHistogram. - * @member {opentelemetry.proto.metrics.v1.IExponentialHistogram|null|undefined} exponentialHistogram - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.exponentialHistogram = null; - /** - * Metric summary. - * @member {opentelemetry.proto.metrics.v1.ISummary|null|undefined} summary - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.summary = null; - /** - * Metric metadata. - * @member {Array.} metadata - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Metric.prototype.metadata = $util.emptyArray; - var $oneOfFields; - /** - * Metric data. - * @member {"gauge"|"sum"|"histogram"|"exponentialHistogram"|"summary"|undefined} data - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - */ - Object.defineProperty(Metric.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = [ - "gauge", - "sum", - "histogram", - "exponentialHistogram", - "summary" - ]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new Metric instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {opentelemetry.proto.metrics.v1.IMetric=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Metric} Metric instance - */ - Metric.create = function create(properties) { - return new Metric(properties); - }; - /** - * Encodes the specified Metric message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Metric.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {opentelemetry.proto.metrics.v1.IMetric} message Metric message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metric.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(18).string(message.description); - if (message.unit != null && Object.hasOwnProperty.call(message, "unit")) writer.uint32(26).string(message.unit); - if (message.gauge != null && Object.hasOwnProperty.call(message, "gauge")) $root.opentelemetry.proto.metrics.v1.Gauge.encode(message.gauge, writer.uint32(42).fork()).ldelim(); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) $root.opentelemetry.proto.metrics.v1.Sum.encode(message.sum, writer.uint32(58).fork()).ldelim(); - if (message.histogram != null && Object.hasOwnProperty.call(message, "histogram")) $root.opentelemetry.proto.metrics.v1.Histogram.encode(message.histogram, writer.uint32(74).fork()).ldelim(); - if (message.exponentialHistogram != null && Object.hasOwnProperty.call(message, "exponentialHistogram")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(message.exponentialHistogram, writer.uint32(82).fork()).ldelim(); - if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) $root.opentelemetry.proto.metrics.v1.Summary.encode(message.summary, writer.uint32(90).fork()).ldelim(); - if (message.metadata != null && message.metadata.length) for (var i = 0; i < message.metadata.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.metadata[i], writer.uint32(98).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Metric message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Metric.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {opentelemetry.proto.metrics.v1.IMetric} message Metric message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metric.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Metric message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Metric} Metric - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metric.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Metric(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.unit = reader.string(); - break; - case 5: - message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.decode(reader, reader.uint32()); - break; - case 7: - message.sum = $root.opentelemetry.proto.metrics.v1.Sum.decode(reader, reader.uint32()); - break; - case 9: - message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.decode(reader, reader.uint32()); - break; - case 10: - message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(reader, reader.uint32()); - break; - case 11: - message.summary = $root.opentelemetry.proto.metrics.v1.Summary.decode(reader, reader.uint32()); - break; - case 12: - if (!(message.metadata && message.metadata.length)) message.metadata = []; - message.metadata.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Metric message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Metric} Metric - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metric.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Metric message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metric.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) { - if (!$util.isString(message.name)) return "name: string expected"; - } - if (message.description != null && message.hasOwnProperty("description")) { - if (!$util.isString(message.description)) return "description: string expected"; - } - if (message.unit != null && message.hasOwnProperty("unit")) { - if (!$util.isString(message.unit)) return "unit: string expected"; - } - if (message.gauge != null && message.hasOwnProperty("gauge")) { - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.Gauge.verify(message.gauge); - if (error) return "gauge." + error; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - if (properties.data === 1) return "data: multiple values"; - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.Sum.verify(message.sum); - if (error) return "sum." + error; - } - if (message.histogram != null && message.hasOwnProperty("histogram")) { - if (properties.data === 1) return "data: multiple values"; - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.Histogram.verify(message.histogram); - if (error) return "histogram." + error; - } - if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { - if (properties.data === 1) return "data: multiple values"; - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(message.exponentialHistogram); - if (error) return "exponentialHistogram." + error; - } - if (message.summary != null && message.hasOwnProperty("summary")) { - if (properties.data === 1) return "data: multiple values"; - properties.data = 1; - var error = $root.opentelemetry.proto.metrics.v1.Summary.verify(message.summary); - if (error) return "summary." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - if (!Array.isArray(message.metadata)) return "metadata: array expected"; - for (var i = 0; i < message.metadata.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.metadata[i]); - if (error) return "metadata." + error; - } - } - return null; - }; - /** - * Creates a Metric message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Metric} Metric - */ - Metric.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Metric) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Metric(); - if (object$1.name != null) message.name = String(object$1.name); - if (object$1.description != null) message.description = String(object$1.description); - if (object$1.unit != null) message.unit = String(object$1.unit); - if (object$1.gauge != null) { - if (typeof object$1.gauge !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected"); - message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.fromObject(object$1.gauge); - } - if (object$1.sum != null) { - if (typeof object$1.sum !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected"); - message.sum = $root.opentelemetry.proto.metrics.v1.Sum.fromObject(object$1.sum); - } - if (object$1.histogram != null) { - if (typeof object$1.histogram !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected"); - message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.fromObject(object$1.histogram); - } - if (object$1.exponentialHistogram != null) { - if (typeof object$1.exponentialHistogram !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected"); - message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(object$1.exponentialHistogram); - } - if (object$1.summary != null) { - if (typeof object$1.summary !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected"); - message.summary = $root.opentelemetry.proto.metrics.v1.Summary.fromObject(object$1.summary); - } - if (object$1.metadata) { - if (!Array.isArray(object$1.metadata)) throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected"); - message.metadata = []; - for (var i = 0; i < object$1.metadata.length; ++i) { - if (typeof object$1.metadata[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected"); - message.metadata[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.metadata[i]); - } - } - return message; - }; - /** - * Creates a plain object from a Metric message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {opentelemetry.proto.metrics.v1.Metric} message Metric - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metric.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.metadata = []; - if (options.defaults) { - object$1.name = ""; - object$1.description = ""; - object$1.unit = ""; - } - if (message.name != null && message.hasOwnProperty("name")) object$1.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) object$1.description = message.description; - if (message.unit != null && message.hasOwnProperty("unit")) object$1.unit = message.unit; - if (message.gauge != null && message.hasOwnProperty("gauge")) { - object$1.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.toObject(message.gauge, options); - if (options.oneofs) object$1.data = "gauge"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - object$1.sum = $root.opentelemetry.proto.metrics.v1.Sum.toObject(message.sum, options); - if (options.oneofs) object$1.data = "sum"; - } - if (message.histogram != null && message.hasOwnProperty("histogram")) { - object$1.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.toObject(message.histogram, options); - if (options.oneofs) object$1.data = "histogram"; - } - if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { - object$1.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(message.exponentialHistogram, options); - if (options.oneofs) object$1.data = "exponentialHistogram"; - } - if (message.summary != null && message.hasOwnProperty("summary")) { - object$1.summary = $root.opentelemetry.proto.metrics.v1.Summary.toObject(message.summary, options); - if (options.oneofs) object$1.data = "summary"; - } - if (message.metadata && message.metadata.length) { - object$1.metadata = []; - for (var j = 0; j < message.metadata.length; ++j) object$1.metadata[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.metadata[j], options); - } - return object$1; - }; - /** - * Converts this Metric to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Metric - * @instance - * @returns {Object.} JSON object - */ - Metric.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Metric - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Metric - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Metric"; - }; - return Metric; - })(); - v1.Gauge = (function() { - /** - * Properties of a Gauge. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IGauge - * @property {Array.|null} [dataPoints] Gauge dataPoints - */ - /** - * Constructs a new Gauge. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Gauge. - * @implements IGauge - * @constructor - * @param {opentelemetry.proto.metrics.v1.IGauge=} [properties] Properties to set - */ - function Gauge(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Gauge dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @instance - */ - Gauge.prototype.dataPoints = $util.emptyArray; - /** - * Creates a new Gauge instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {opentelemetry.proto.metrics.v1.IGauge=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge instance - */ - Gauge.create = function create(properties) { - return new Gauge(properties); - }; - /** - * Encodes the specified Gauge message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Gauge.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {opentelemetry.proto.metrics.v1.IGauge} message Gauge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Gauge.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Gauge message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Gauge.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {opentelemetry.proto.metrics.v1.IGauge} message Gauge message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Gauge.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Gauge message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Gauge.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Gauge(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Gauge message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Gauge.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Gauge message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Gauge.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - return null; - }; - /** - * Creates a Gauge message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Gauge} Gauge - */ - Gauge.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Gauge) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Gauge(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object$1.dataPoints[i]); - } - } - return message; - }; - /** - * Creates a plain object from a Gauge message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {opentelemetry.proto.metrics.v1.Gauge} message Gauge - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Gauge.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); - } - return object$1; - }; - /** - * Converts this Gauge to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @instance - * @returns {Object.} JSON object - */ - Gauge.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Gauge - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Gauge - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Gauge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Gauge"; - }; - return Gauge; - })(); - v1.Sum = (function() { - /** - * Properties of a Sum. - * @memberof opentelemetry.proto.metrics.v1 - * @interface ISum - * @property {Array.|null} [dataPoints] Sum dataPoints - * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] Sum aggregationTemporality - * @property {boolean|null} [isMonotonic] Sum isMonotonic - */ - /** - * Constructs a new Sum. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Sum. - * @implements ISum - * @constructor - * @param {opentelemetry.proto.metrics.v1.ISum=} [properties] Properties to set - */ - function Sum(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Sum dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.Sum - * @instance - */ - Sum.prototype.dataPoints = $util.emptyArray; - /** - * Sum aggregationTemporality. - * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality - * @memberof opentelemetry.proto.metrics.v1.Sum - * @instance - */ - Sum.prototype.aggregationTemporality = null; - /** - * Sum isMonotonic. - * @member {boolean|null|undefined} isMonotonic - * @memberof opentelemetry.proto.metrics.v1.Sum - * @instance - */ - Sum.prototype.isMonotonic = null; - /** - * Creates a new Sum instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {opentelemetry.proto.metrics.v1.ISum=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Sum} Sum instance - */ - Sum.create = function create(properties) { - return new Sum(properties); - }; - /** - * Encodes the specified Sum message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Sum.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {opentelemetry.proto.metrics.v1.ISum} message Sum message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sum.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); - if (message.isMonotonic != null && Object.hasOwnProperty.call(message, "isMonotonic")) writer.uint32(24).bool(message.isMonotonic); - return writer; - }; - /** - * Encodes the specified Sum message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Sum.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {opentelemetry.proto.metrics.v1.ISum} message Sum message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sum.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Sum message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Sum} Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sum.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Sum(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(reader, reader.uint32())); - break; - case 2: - message.aggregationTemporality = reader.int32(); - break; - case 3: - message.isMonotonic = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Sum message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Sum} Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sum.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Sum message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Sum.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { - default: return "aggregationTemporality: enum value expected"; - case 0: - case 1: - case 2: break; - } - if (message.isMonotonic != null && message.hasOwnProperty("isMonotonic")) { - if (typeof message.isMonotonic !== "boolean") return "isMonotonic: boolean expected"; - } - return null; - }; - /** - * Creates a Sum message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Sum} Sum - */ - Sum.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Sum) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Sum(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object$1.dataPoints[i]); - } - } - switch (object$1.aggregationTemporality) { - default: - if (typeof object$1.aggregationTemporality === "number") { - message.aggregationTemporality = object$1.aggregationTemporality; - break; - } - break; - case "AGGREGATION_TEMPORALITY_UNSPECIFIED": - case 0: - message.aggregationTemporality = 0; - break; - case "AGGREGATION_TEMPORALITY_DELTA": - case 1: - message.aggregationTemporality = 1; - break; - case "AGGREGATION_TEMPORALITY_CUMULATIVE": - case 2: - message.aggregationTemporality = 2; - break; - } - if (object$1.isMonotonic != null) message.isMonotonic = Boolean(object$1.isMonotonic); - return message; - }; - /** - * Creates a plain object from a Sum message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {opentelemetry.proto.metrics.v1.Sum} message Sum - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Sum.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (options.defaults) { - object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; - object$1.isMonotonic = false; - } - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; - if (message.isMonotonic != null && message.hasOwnProperty("isMonotonic")) object$1.isMonotonic = message.isMonotonic; - return object$1; - }; - /** - * Converts this Sum to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Sum - * @instance - * @returns {Object.} JSON object - */ - Sum.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Sum - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Sum - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Sum"; - }; - return Sum; - })(); - v1.Histogram = (function() { - /** - * Properties of a Histogram. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IHistogram - * @property {Array.|null} [dataPoints] Histogram dataPoints - * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] Histogram aggregationTemporality - */ - /** - * Constructs a new Histogram. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Histogram. - * @implements IHistogram - * @constructor - * @param {opentelemetry.proto.metrics.v1.IHistogram=} [properties] Properties to set - */ - function Histogram(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Histogram dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @instance - */ - Histogram.prototype.dataPoints = $util.emptyArray; - /** - * Histogram aggregationTemporality. - * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @instance - */ - Histogram.prototype.aggregationTemporality = null; - /** - * Creates a new Histogram instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogram=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram instance - */ - Histogram.create = function create(properties) { - return new Histogram(properties); - }; - /** - * Encodes the specified Histogram message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Histogram.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogram} message Histogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Histogram.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); - return writer; - }; - /** - * Encodes the specified Histogram message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Histogram.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogram} message Histogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Histogram.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Histogram message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Histogram.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Histogram(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(reader, reader.uint32())); - break; - case 2: - message.aggregationTemporality = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Histogram message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Histogram.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Histogram message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Histogram.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { - default: return "aggregationTemporality: enum value expected"; - case 0: - case 1: - case 2: break; - } - return null; - }; - /** - * Creates a Histogram message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Histogram} Histogram - */ - Histogram.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Histogram) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Histogram(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(object$1.dataPoints[i]); - } - } - switch (object$1.aggregationTemporality) { - default: - if (typeof object$1.aggregationTemporality === "number") { - message.aggregationTemporality = object$1.aggregationTemporality; - break; - } - break; - case "AGGREGATION_TEMPORALITY_UNSPECIFIED": - case 0: - message.aggregationTemporality = 0; - break; - case "AGGREGATION_TEMPORALITY_DELTA": - case 1: - message.aggregationTemporality = 1; - break; - case "AGGREGATION_TEMPORALITY_CUMULATIVE": - case 2: - message.aggregationTemporality = 2; - break; - } - return message; - }; - /** - * Creates a plain object from a Histogram message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {opentelemetry.proto.metrics.v1.Histogram} message Histogram - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Histogram.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (options.defaults) object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(message.dataPoints[j], options); - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; - return object$1; - }; - /** - * Converts this Histogram to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @instance - * @returns {Object.} JSON object - */ - Histogram.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Histogram - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Histogram - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Histogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Histogram"; - }; - return Histogram; - })(); - v1.ExponentialHistogram = (function() { - /** - * Properties of an ExponentialHistogram. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IExponentialHistogram - * @property {Array.|null} [dataPoints] ExponentialHistogram dataPoints - * @property {opentelemetry.proto.metrics.v1.AggregationTemporality|null} [aggregationTemporality] ExponentialHistogram aggregationTemporality - */ - /** - * Constructs a new ExponentialHistogram. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents an ExponentialHistogram. - * @implements IExponentialHistogram - * @constructor - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram=} [properties] Properties to set - */ - function ExponentialHistogram(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExponentialHistogram dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @instance - */ - ExponentialHistogram.prototype.dataPoints = $util.emptyArray; - /** - * ExponentialHistogram aggregationTemporality. - * @member {opentelemetry.proto.metrics.v1.AggregationTemporality|null|undefined} aggregationTemporality - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @instance - */ - ExponentialHistogram.prototype.aggregationTemporality = null; - /** - * Creates a new ExponentialHistogram instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram instance - */ - ExponentialHistogram.create = function create(properties) { - return new ExponentialHistogram(properties); - }; - /** - * Encodes the specified ExponentialHistogram message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogram.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram} message ExponentialHistogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExponentialHistogram.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - if (message.aggregationTemporality != null && Object.hasOwnProperty.call(message, "aggregationTemporality")) writer.uint32(16).int32(message.aggregationTemporality); - return writer; - }; - /** - * Encodes the specified ExponentialHistogram message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogram.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogram} message ExponentialHistogram message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExponentialHistogram.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExponentialHistogram message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExponentialHistogram.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(reader, reader.uint32())); - break; - case 2: - message.aggregationTemporality = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExponentialHistogram message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExponentialHistogram.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExponentialHistogram message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExponentialHistogram.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) switch (message.aggregationTemporality) { - default: return "aggregationTemporality: enum value expected"; - case 0: - case 1: - case 2: break; - } - return null; - }; - /** - * Creates an ExponentialHistogram message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogram} ExponentialHistogram - */ - ExponentialHistogram.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogram) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(object$1.dataPoints[i]); - } - } - switch (object$1.aggregationTemporality) { - default: - if (typeof object$1.aggregationTemporality === "number") { - message.aggregationTemporality = object$1.aggregationTemporality; - break; - } - break; - case "AGGREGATION_TEMPORALITY_UNSPECIFIED": - case 0: - message.aggregationTemporality = 0; - break; - case "AGGREGATION_TEMPORALITY_DELTA": - case 1: - message.aggregationTemporality = 1; - break; - case "AGGREGATION_TEMPORALITY_CUMULATIVE": - case 2: - message.aggregationTemporality = 2; - break; - } - return message; - }; - /** - * Creates a plain object from an ExponentialHistogram message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogram} message ExponentialHistogram - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExponentialHistogram.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (options.defaults) object$1.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(message.dataPoints[j], options); - } - if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object$1.aggregationTemporality = options.enums === String ? $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] === void 0 ? message.aggregationTemporality : $root.opentelemetry.proto.metrics.v1.AggregationTemporality[message.aggregationTemporality] : message.aggregationTemporality; - return object$1; - }; - /** - * Converts this ExponentialHistogram to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @instance - * @returns {Object.} JSON object - */ - ExponentialHistogram.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExponentialHistogram - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogram - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExponentialHistogram.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogram"; - }; - return ExponentialHistogram; - })(); - v1.Summary = (function() { - /** - * Properties of a Summary. - * @memberof opentelemetry.proto.metrics.v1 - * @interface ISummary - * @property {Array.|null} [dataPoints] Summary dataPoints - */ - /** - * Constructs a new Summary. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a Summary. - * @implements ISummary - * @constructor - * @param {opentelemetry.proto.metrics.v1.ISummary=} [properties] Properties to set - */ - function Summary(properties) { - this.dataPoints = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Summary dataPoints. - * @member {Array.} dataPoints - * @memberof opentelemetry.proto.metrics.v1.Summary - * @instance - */ - Summary.prototype.dataPoints = $util.emptyArray; - /** - * Creates a new Summary instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {opentelemetry.proto.metrics.v1.ISummary=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Summary} Summary instance - */ - Summary.create = function create(properties) { - return new Summary(properties); - }; - /** - * Encodes the specified Summary message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Summary.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {opentelemetry.proto.metrics.v1.ISummary} message Summary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Summary.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.dataPoints != null && message.dataPoints.length) for (var i = 0; i < message.dataPoints.length; ++i) $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(message.dataPoints[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Summary message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Summary.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {opentelemetry.proto.metrics.v1.ISummary} message Summary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Summary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Summary message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Summary} Summary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Summary.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Summary(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.dataPoints && message.dataPoints.length)) message.dataPoints = []; - message.dataPoints.push($root.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Summary message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Summary} Summary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Summary.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Summary message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Summary.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataPoints != null && message.hasOwnProperty("dataPoints")) { - if (!Array.isArray(message.dataPoints)) return "dataPoints: array expected"; - for (var i = 0; i < message.dataPoints.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(message.dataPoints[i]); - if (error) return "dataPoints." + error; - } - } - return null; - }; - /** - * Creates a Summary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Summary} Summary - */ - Summary.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Summary) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Summary(); - if (object$1.dataPoints) { - if (!Array.isArray(object$1.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected"); - message.dataPoints = []; - for (var i = 0; i < object$1.dataPoints.length; ++i) { - if (typeof object$1.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected"); - message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(object$1.dataPoints[i]); - } - } - return message; - }; - /** - * Creates a plain object from a Summary message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {opentelemetry.proto.metrics.v1.Summary} message Summary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Summary.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.dataPoints = []; - if (message.dataPoints && message.dataPoints.length) { - object$1.dataPoints = []; - for (var j = 0; j < message.dataPoints.length; ++j) object$1.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(message.dataPoints[j], options); - } - return object$1; - }; - /** - * Converts this Summary to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Summary - * @instance - * @returns {Object.} JSON object - */ - Summary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Summary - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Summary - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Summary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Summary"; - }; - return Summary; - })(); - /** - * AggregationTemporality enum. - * @name opentelemetry.proto.metrics.v1.AggregationTemporality - * @enum {number} - * @property {number} AGGREGATION_TEMPORALITY_UNSPECIFIED=0 AGGREGATION_TEMPORALITY_UNSPECIFIED value - * @property {number} AGGREGATION_TEMPORALITY_DELTA=1 AGGREGATION_TEMPORALITY_DELTA value - * @property {number} AGGREGATION_TEMPORALITY_CUMULATIVE=2 AGGREGATION_TEMPORALITY_CUMULATIVE value - */ - v1.AggregationTemporality = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "AGGREGATION_TEMPORALITY_DELTA"] = 1; - values[valuesById[2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2; - return values; - })(); - /** - * DataPointFlags enum. - * @name opentelemetry.proto.metrics.v1.DataPointFlags - * @enum {number} - * @property {number} DATA_POINT_FLAGS_DO_NOT_USE=0 DATA_POINT_FLAGS_DO_NOT_USE value - * @property {number} DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK=1 DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK value - */ - v1.DataPointFlags = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DATA_POINT_FLAGS_DO_NOT_USE"] = 0; - values[valuesById[1] = "DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"] = 1; - return values; - })(); - v1.NumberDataPoint = (function() { - /** - * Properties of a NumberDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @interface INumberDataPoint - * @property {Array.|null} [attributes] NumberDataPoint attributes - * @property {number|Long|null} [startTimeUnixNano] NumberDataPoint startTimeUnixNano - * @property {number|Long|null} [timeUnixNano] NumberDataPoint timeUnixNano - * @property {number|null} [asDouble] NumberDataPoint asDouble - * @property {number|Long|null} [asInt] NumberDataPoint asInt - * @property {Array.|null} [exemplars] NumberDataPoint exemplars - * @property {number|null} [flags] NumberDataPoint flags - */ - /** - * Constructs a new NumberDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a NumberDataPoint. - * @implements INumberDataPoint - * @constructor - * @param {opentelemetry.proto.metrics.v1.INumberDataPoint=} [properties] Properties to set - */ - function NumberDataPoint(properties) { - this.attributes = []; - this.exemplars = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * NumberDataPoint attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.attributes = $util.emptyArray; - /** - * NumberDataPoint startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.startTimeUnixNano = null; - /** - * NumberDataPoint timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.timeUnixNano = null; - /** - * NumberDataPoint asDouble. - * @member {number|null|undefined} asDouble - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.asDouble = null; - /** - * NumberDataPoint asInt. - * @member {number|Long|null|undefined} asInt - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.asInt = null; - /** - * NumberDataPoint exemplars. - * @member {Array.} exemplars - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.exemplars = $util.emptyArray; - /** - * NumberDataPoint flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - NumberDataPoint.prototype.flags = null; - var $oneOfFields; - /** - * NumberDataPoint value. - * @member {"asDouble"|"asInt"|undefined} value - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - */ - Object.defineProperty(NumberDataPoint.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["asDouble", "asInt"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new NumberDataPoint instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.INumberDataPoint=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint instance - */ - NumberDataPoint.create = function create(properties) { - return new NumberDataPoint(properties); - }; - /** - * Encodes the specified NumberDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.NumberDataPoint.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.INumberDataPoint} message NumberDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NumberDataPoint.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); - if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) writer.uint32(33).double(message.asDouble); - if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(42).fork()).ldelim(); - if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) writer.uint32(49).sfixed64(message.asInt); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(58).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(64).uint32(message.flags); - return writer; - }; - /** - * Encodes the specified NumberDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.NumberDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.INumberDataPoint} message NumberDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NumberDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a NumberDataPoint message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NumberDataPoint.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 7: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.startTimeUnixNano = reader.fixed64(); - break; - case 3: - message.timeUnixNano = reader.fixed64(); - break; - case 4: - message.asDouble = reader.double(); - break; - case 6: - message.asInt = reader.sfixed64(); - break; - case 5: - if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; - message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); - break; - case 8: - message.flags = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a NumberDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NumberDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a NumberDataPoint message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NumberDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.asDouble != null && message.hasOwnProperty("asDouble")) { - properties.value = 1; - if (typeof message.asDouble !== "number") return "asDouble: number expected"; - } - if (message.asInt != null && message.hasOwnProperty("asInt")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (!$util.isInteger(message.asInt) && !(message.asInt && $util.isInteger(message.asInt.low) && $util.isInteger(message.asInt.high))) return "asInt: integer|Long expected"; - } - if (message.exemplars != null && message.hasOwnProperty("exemplars")) { - if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i = 0; i < message.exemplars.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); - if (error) return "exemplars." + error; - } - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - return null; - }; - /** - * Creates a NumberDataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.NumberDataPoint} NumberDataPoint - */ - NumberDataPoint.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.NumberDataPoint) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.asDouble != null) message.asDouble = Number(object$1.asDouble); - if (object$1.asInt != null) { - if ($util.Long) (message.asInt = $util.Long.fromValue(object$1.asInt)).unsigned = false; - else if (typeof object$1.asInt === "string") message.asInt = parseInt(object$1.asInt, 10); - else if (typeof object$1.asInt === "number") message.asInt = object$1.asInt; - else if (typeof object$1.asInt === "object") message.asInt = new $util.LongBits(object$1.asInt.low >>> 0, object$1.asInt.high >>> 0).toNumber(); - } - if (object$1.exemplars) { - if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected"); - message.exemplars = []; - for (var i = 0; i < object$1.exemplars.length; ++i) { - if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected"); - message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); - } - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - return message; - }; - /** - * Creates a plain object from a NumberDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.NumberDataPoint} message NumberDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NumberDataPoint.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.exemplars = []; - object$1.attributes = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - object$1.flags = 0; - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.asDouble != null && message.hasOwnProperty("asDouble")) { - object$1.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; - if (options.oneofs) object$1.value = "asDouble"; - } - if (message.exemplars && message.exemplars.length) { - object$1.exemplars = []; - for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); - } - if (message.asInt != null && message.hasOwnProperty("asInt")) { - if (typeof message.asInt === "number") object$1.asInt = options.longs === String ? String(message.asInt) : message.asInt; - else object$1.asInt = options.longs === String ? $util.Long.prototype.toString.call(message.asInt) : options.longs === Number ? new $util.LongBits(message.asInt.low >>> 0, message.asInt.high >>> 0).toNumber() : message.asInt; - if (options.oneofs) object$1.value = "asInt"; - } - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - return object$1; - }; - /** - * Converts this NumberDataPoint to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @instance - * @returns {Object.} JSON object - */ - NumberDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for NumberDataPoint - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.NumberDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NumberDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.NumberDataPoint"; - }; - return NumberDataPoint; - })(); - v1.HistogramDataPoint = (function() { - /** - * Properties of a HistogramDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IHistogramDataPoint - * @property {Array.|null} [attributes] HistogramDataPoint attributes - * @property {number|Long|null} [startTimeUnixNano] HistogramDataPoint startTimeUnixNano - * @property {number|Long|null} [timeUnixNano] HistogramDataPoint timeUnixNano - * @property {number|Long|null} [count] HistogramDataPoint count - * @property {number|null} [sum] HistogramDataPoint sum - * @property {Array.|null} [bucketCounts] HistogramDataPoint bucketCounts - * @property {Array.|null} [explicitBounds] HistogramDataPoint explicitBounds - * @property {Array.|null} [exemplars] HistogramDataPoint exemplars - * @property {number|null} [flags] HistogramDataPoint flags - * @property {number|null} [min] HistogramDataPoint min - * @property {number|null} [max] HistogramDataPoint max - */ - /** - * Constructs a new HistogramDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a HistogramDataPoint. - * @implements IHistogramDataPoint - * @constructor - * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint=} [properties] Properties to set - */ - function HistogramDataPoint(properties) { - this.attributes = []; - this.bucketCounts = []; - this.explicitBounds = []; - this.exemplars = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * HistogramDataPoint attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.attributes = $util.emptyArray; - /** - * HistogramDataPoint startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.startTimeUnixNano = null; - /** - * HistogramDataPoint timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.timeUnixNano = null; - /** - * HistogramDataPoint count. - * @member {number|Long|null|undefined} count - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.count = null; - /** - * HistogramDataPoint sum. - * @member {number|null|undefined} sum - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.sum = null; - /** - * HistogramDataPoint bucketCounts. - * @member {Array.} bucketCounts - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.bucketCounts = $util.emptyArray; - /** - * HistogramDataPoint explicitBounds. - * @member {Array.} explicitBounds - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.explicitBounds = $util.emptyArray; - /** - * HistogramDataPoint exemplars. - * @member {Array.} exemplars - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.exemplars = $util.emptyArray; - /** - * HistogramDataPoint flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.flags = null; - /** - * HistogramDataPoint min. - * @member {number|null|undefined} min - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.min = null; - /** - * HistogramDataPoint max. - * @member {number|null|undefined} max - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - HistogramDataPoint.prototype.max = null; - var $oneOfFields; - /** - * HistogramDataPoint _sum. - * @member {"sum"|undefined} _sum - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - Object.defineProperty(HistogramDataPoint.prototype, "_sum", { - get: $util.oneOfGetter($oneOfFields = ["sum"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * HistogramDataPoint _min. - * @member {"min"|undefined} _min - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - Object.defineProperty(HistogramDataPoint.prototype, "_min", { - get: $util.oneOfGetter($oneOfFields = ["min"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * HistogramDataPoint _max. - * @member {"max"|undefined} _max - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - */ - Object.defineProperty(HistogramDataPoint.prototype, "_max", { - get: $util.oneOfGetter($oneOfFields = ["max"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new HistogramDataPoint instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint instance - */ - HistogramDataPoint.create = function create(properties) { - return new HistogramDataPoint(properties); - }; - /** - * Encodes the specified HistogramDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.HistogramDataPoint.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint} message HistogramDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramDataPoint.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); - if (message.bucketCounts != null && message.bucketCounts.length) { - writer.uint32(50).fork(); - for (var i = 0; i < message.bucketCounts.length; ++i) writer.fixed64(message.bucketCounts[i]); - writer.ldelim(); - } - if (message.explicitBounds != null && message.explicitBounds.length) { - writer.uint32(58).fork(); - for (var i = 0; i < message.explicitBounds.length; ++i) writer.double(message.explicitBounds[i]); - writer.ldelim(); - } - if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(66).fork()).ldelim(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(74).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(80).uint32(message.flags); - if (message.min != null && Object.hasOwnProperty.call(message, "min")) writer.uint32(89).double(message.min); - if (message.max != null && Object.hasOwnProperty.call(message, "max")) writer.uint32(97).double(message.max); - return writer; - }; - /** - * Encodes the specified HistogramDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.HistogramDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IHistogramDataPoint} message HistogramDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistogramDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a HistogramDataPoint message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramDataPoint.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 9: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.startTimeUnixNano = reader.fixed64(); - break; - case 3: - message.timeUnixNano = reader.fixed64(); - break; - case 4: - message.count = reader.fixed64(); - break; - case 5: - message.sum = reader.double(); - break; - case 6: - if (!(message.bucketCounts && message.bucketCounts.length)) message.bucketCounts = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) message.bucketCounts.push(reader.fixed64()); - } else message.bucketCounts.push(reader.fixed64()); - break; - case 7: - if (!(message.explicitBounds && message.explicitBounds.length)) message.explicitBounds = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) message.explicitBounds.push(reader.double()); - } else message.explicitBounds.push(reader.double()); - break; - case 8: - if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; - message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); - break; - case 10: - message.flags = reader.uint32(); - break; - case 11: - message.min = reader.double(); - break; - case 12: - message.max = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a HistogramDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HistogramDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a HistogramDataPoint message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HistogramDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.count != null && message.hasOwnProperty("count")) { - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - properties._sum = 1; - if (typeof message.sum !== "number") return "sum: number expected"; - } - if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { - if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; - for (var i = 0; i < message.bucketCounts.length; ++i) if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) return "bucketCounts: integer|Long[] expected"; - } - if (message.explicitBounds != null && message.hasOwnProperty("explicitBounds")) { - if (!Array.isArray(message.explicitBounds)) return "explicitBounds: array expected"; - for (var i = 0; i < message.explicitBounds.length; ++i) if (typeof message.explicitBounds[i] !== "number") return "explicitBounds: number[] expected"; - } - if (message.exemplars != null && message.hasOwnProperty("exemplars")) { - if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i = 0; i < message.exemplars.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); - if (error) return "exemplars." + error; - } - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - if (message.min != null && message.hasOwnProperty("min")) { - properties._min = 1; - if (typeof message.min !== "number") return "min: number expected"; - } - if (message.max != null && message.hasOwnProperty("max")) { - properties._max = 1; - if (typeof message.max !== "number") return "max: number expected"; - } - return null; - }; - /** - * Creates a HistogramDataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.HistogramDataPoint} HistogramDataPoint - */ - HistogramDataPoint.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.HistogramDataPoint) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.count != null) { - if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; - else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); - else if (typeof object$1.count === "number") message.count = object$1.count; - else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); - } - if (object$1.sum != null) message.sum = Number(object$1.sum); - if (object$1.bucketCounts) { - if (!Array.isArray(object$1.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected"); - message.bucketCounts = []; - for (var i = 0; i < object$1.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object$1.bucketCounts[i])).unsigned = false; - else if (typeof object$1.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object$1.bucketCounts[i], 10); - else if (typeof object$1.bucketCounts[i] === "number") message.bucketCounts[i] = object$1.bucketCounts[i]; - else if (typeof object$1.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object$1.bucketCounts[i].low >>> 0, object$1.bucketCounts[i].high >>> 0).toNumber(); - } - if (object$1.explicitBounds) { - if (!Array.isArray(object$1.explicitBounds)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected"); - message.explicitBounds = []; - for (var i = 0; i < object$1.explicitBounds.length; ++i) message.explicitBounds[i] = Number(object$1.explicitBounds[i]); - } - if (object$1.exemplars) { - if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected"); - message.exemplars = []; - for (var i = 0; i < object$1.exemplars.length; ++i) { - if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected"); - message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); - } - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - if (object$1.min != null) message.min = Number(object$1.min); - if (object$1.max != null) message.max = Number(object$1.max); - return message; - }; - /** - * Creates a plain object from a HistogramDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.HistogramDataPoint} message HistogramDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HistogramDataPoint.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.bucketCounts = []; - object$1.explicitBounds = []; - object$1.exemplars = []; - object$1.attributes = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.count = options.longs === String ? "0" : 0; - object$1.flags = 0; - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; - else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.sum != null && message.hasOwnProperty("sum")) { - object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; - if (options.oneofs) object$1._sum = "sum"; - } - if (message.bucketCounts && message.bucketCounts.length) { - object$1.bucketCounts = []; - for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object$1.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; - else object$1.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber() : message.bucketCounts[j]; - } - if (message.explicitBounds && message.explicitBounds.length) { - object$1.explicitBounds = []; - for (var j = 0; j < message.explicitBounds.length; ++j) object$1.explicitBounds[j] = options.json && !isFinite(message.explicitBounds[j]) ? String(message.explicitBounds[j]) : message.explicitBounds[j]; - } - if (message.exemplars && message.exemplars.length) { - object$1.exemplars = []; - for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); - } - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - if (message.min != null && message.hasOwnProperty("min")) { - object$1.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; - if (options.oneofs) object$1._min = "min"; - } - if (message.max != null && message.hasOwnProperty("max")) { - object$1.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; - if (options.oneofs) object$1._max = "max"; - } - return object$1; - }; - /** - * Converts this HistogramDataPoint to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @instance - * @returns {Object.} JSON object - */ - HistogramDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for HistogramDataPoint - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.HistogramDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HistogramDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.HistogramDataPoint"; - }; - return HistogramDataPoint; - })(); - v1.ExponentialHistogramDataPoint = (function() { - /** - * Properties of an ExponentialHistogramDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IExponentialHistogramDataPoint - * @property {Array.|null} [attributes] ExponentialHistogramDataPoint attributes - * @property {number|Long|null} [startTimeUnixNano] ExponentialHistogramDataPoint startTimeUnixNano - * @property {number|Long|null} [timeUnixNano] ExponentialHistogramDataPoint timeUnixNano - * @property {number|Long|null} [count] ExponentialHistogramDataPoint count - * @property {number|null} [sum] ExponentialHistogramDataPoint sum - * @property {number|null} [scale] ExponentialHistogramDataPoint scale - * @property {number|Long|null} [zeroCount] ExponentialHistogramDataPoint zeroCount - * @property {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null} [positive] ExponentialHistogramDataPoint positive - * @property {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null} [negative] ExponentialHistogramDataPoint negative - * @property {number|null} [flags] ExponentialHistogramDataPoint flags - * @property {Array.|null} [exemplars] ExponentialHistogramDataPoint exemplars - * @property {number|null} [min] ExponentialHistogramDataPoint min - * @property {number|null} [max] ExponentialHistogramDataPoint max - * @property {number|null} [zeroThreshold] ExponentialHistogramDataPoint zeroThreshold - */ - /** - * Constructs a new ExponentialHistogramDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents an ExponentialHistogramDataPoint. - * @implements IExponentialHistogramDataPoint - * @constructor - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint=} [properties] Properties to set - */ - function ExponentialHistogramDataPoint(properties) { - this.attributes = []; - this.exemplars = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ExponentialHistogramDataPoint attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.attributes = $util.emptyArray; - /** - * ExponentialHistogramDataPoint startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.startTimeUnixNano = null; - /** - * ExponentialHistogramDataPoint timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.timeUnixNano = null; - /** - * ExponentialHistogramDataPoint count. - * @member {number|Long|null|undefined} count - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.count = null; - /** - * ExponentialHistogramDataPoint sum. - * @member {number|null|undefined} sum - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.sum = null; - /** - * ExponentialHistogramDataPoint scale. - * @member {number|null|undefined} scale - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.scale = null; - /** - * ExponentialHistogramDataPoint zeroCount. - * @member {number|Long|null|undefined} zeroCount - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.zeroCount = null; - /** - * ExponentialHistogramDataPoint positive. - * @member {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null|undefined} positive - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.positive = null; - /** - * ExponentialHistogramDataPoint negative. - * @member {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets|null|undefined} negative - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.negative = null; - /** - * ExponentialHistogramDataPoint flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.flags = null; - /** - * ExponentialHistogramDataPoint exemplars. - * @member {Array.} exemplars - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.exemplars = $util.emptyArray; - /** - * ExponentialHistogramDataPoint min. - * @member {number|null|undefined} min - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.min = null; - /** - * ExponentialHistogramDataPoint max. - * @member {number|null|undefined} max - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.max = null; - /** - * ExponentialHistogramDataPoint zeroThreshold. - * @member {number|null|undefined} zeroThreshold - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - ExponentialHistogramDataPoint.prototype.zeroThreshold = null; - var $oneOfFields; - /** - * ExponentialHistogramDataPoint _sum. - * @member {"sum"|undefined} _sum - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_sum", { - get: $util.oneOfGetter($oneOfFields = ["sum"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * ExponentialHistogramDataPoint _min. - * @member {"min"|undefined} _min - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_min", { - get: $util.oneOfGetter($oneOfFields = ["min"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * ExponentialHistogramDataPoint _max. - * @member {"max"|undefined} _max - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - */ - Object.defineProperty(ExponentialHistogramDataPoint.prototype, "_max", { - get: $util.oneOfGetter($oneOfFields = ["max"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new ExponentialHistogramDataPoint instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint instance - */ - ExponentialHistogramDataPoint.create = function create(properties) { - return new ExponentialHistogramDataPoint(properties); - }; - /** - * Encodes the specified ExponentialHistogramDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint} message ExponentialHistogramDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExponentialHistogramDataPoint.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(10).fork()).ldelim(); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); - if (message.scale != null && Object.hasOwnProperty.call(message, "scale")) writer.uint32(48).sint32(message.scale); - if (message.zeroCount != null && Object.hasOwnProperty.call(message, "zeroCount")) writer.uint32(57).fixed64(message.zeroCount); - if (message.positive != null && Object.hasOwnProperty.call(message, "positive")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(message.positive, writer.uint32(66).fork()).ldelim(); - if (message.negative != null && Object.hasOwnProperty.call(message, "negative")) $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(message.negative, writer.uint32(74).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(80).uint32(message.flags); - if (message.exemplars != null && message.exemplars.length) for (var i = 0; i < message.exemplars.length; ++i) $root.opentelemetry.proto.metrics.v1.Exemplar.encode(message.exemplars[i], writer.uint32(90).fork()).ldelim(); - if (message.min != null && Object.hasOwnProperty.call(message, "min")) writer.uint32(97).double(message.min); - if (message.max != null && Object.hasOwnProperty.call(message, "max")) writer.uint32(105).double(message.max); - if (message.zeroThreshold != null && Object.hasOwnProperty.call(message, "zeroThreshold")) writer.uint32(113).double(message.zeroThreshold); - return writer; - }; - /** - * Encodes the specified ExponentialHistogramDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.IExponentialHistogramDataPoint} message ExponentialHistogramDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExponentialHistogramDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an ExponentialHistogramDataPoint message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExponentialHistogramDataPoint.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.startTimeUnixNano = reader.fixed64(); - break; - case 3: - message.timeUnixNano = reader.fixed64(); - break; - case 4: - message.count = reader.fixed64(); - break; - case 5: - message.sum = reader.double(); - break; - case 6: - message.scale = reader.sint32(); - break; - case 7: - message.zeroCount = reader.fixed64(); - break; - case 8: - message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(reader, reader.uint32()); - break; - case 9: - message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(reader, reader.uint32()); - break; - case 10: - message.flags = reader.uint32(); - break; - case 11: - if (!(message.exemplars && message.exemplars.length)) message.exemplars = []; - message.exemplars.push($root.opentelemetry.proto.metrics.v1.Exemplar.decode(reader, reader.uint32())); - break; - case 12: - message.min = reader.double(); - break; - case 13: - message.max = reader.double(); - break; - case 14: - message.zeroThreshold = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an ExponentialHistogramDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExponentialHistogramDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an ExponentialHistogramDataPoint message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExponentialHistogramDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.count != null && message.hasOwnProperty("count")) { - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - properties._sum = 1; - if (typeof message.sum !== "number") return "sum: number expected"; - } - if (message.scale != null && message.hasOwnProperty("scale")) { - if (!$util.isInteger(message.scale)) return "scale: integer expected"; - } - if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) { - if (!$util.isInteger(message.zeroCount) && !(message.zeroCount && $util.isInteger(message.zeroCount.low) && $util.isInteger(message.zeroCount.high))) return "zeroCount: integer|Long expected"; - } - if (message.positive != null && message.hasOwnProperty("positive")) { - var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.positive); - if (error) return "positive." + error; - } - if (message.negative != null && message.hasOwnProperty("negative")) { - var error = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(message.negative); - if (error) return "negative." + error; - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - if (message.exemplars != null && message.hasOwnProperty("exemplars")) { - if (!Array.isArray(message.exemplars)) return "exemplars: array expected"; - for (var i = 0; i < message.exemplars.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.Exemplar.verify(message.exemplars[i]); - if (error) return "exemplars." + error; - } - } - if (message.min != null && message.hasOwnProperty("min")) { - properties._min = 1; - if (typeof message.min !== "number") return "min: number expected"; - } - if (message.max != null && message.hasOwnProperty("max")) { - properties._max = 1; - if (typeof message.max !== "number") return "max: number expected"; - } - if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) { - if (typeof message.zeroThreshold !== "number") return "zeroThreshold: number expected"; - } - return null; - }; - /** - * Creates an ExponentialHistogramDataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} ExponentialHistogramDataPoint - */ - ExponentialHistogramDataPoint.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.count != null) { - if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; - else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); - else if (typeof object$1.count === "number") message.count = object$1.count; - else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); - } - if (object$1.sum != null) message.sum = Number(object$1.sum); - if (object$1.scale != null) message.scale = object$1.scale | 0; - if (object$1.zeroCount != null) { - if ($util.Long) (message.zeroCount = $util.Long.fromValue(object$1.zeroCount)).unsigned = false; - else if (typeof object$1.zeroCount === "string") message.zeroCount = parseInt(object$1.zeroCount, 10); - else if (typeof object$1.zeroCount === "number") message.zeroCount = object$1.zeroCount; - else if (typeof object$1.zeroCount === "object") message.zeroCount = new $util.LongBits(object$1.zeroCount.low >>> 0, object$1.zeroCount.high >>> 0).toNumber(); - } - if (object$1.positive != null) { - if (typeof object$1.positive !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected"); - message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object$1.positive); - } - if (object$1.negative != null) { - if (typeof object$1.negative !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected"); - message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object$1.negative); - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - if (object$1.exemplars) { - if (!Array.isArray(object$1.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected"); - message.exemplars = []; - for (var i = 0; i < object$1.exemplars.length; ++i) { - if (typeof object$1.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected"); - message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object$1.exemplars[i]); - } - } - if (object$1.min != null) message.min = Number(object$1.min); - if (object$1.max != null) message.max = Number(object$1.max); - if (object$1.zeroThreshold != null) message.zeroThreshold = Number(object$1.zeroThreshold); - return message; - }; - /** - * Creates a plain object from an ExponentialHistogramDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint} message ExponentialHistogramDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExponentialHistogramDataPoint.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.attributes = []; - object$1.exemplars = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.count = options.longs === String ? "0" : 0; - object$1.scale = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.zeroCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.zeroCount = options.longs === String ? "0" : 0; - object$1.positive = null; - object$1.negative = null; - object$1.flags = 0; - object$1.zeroThreshold = 0; - } - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; - else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.sum != null && message.hasOwnProperty("sum")) { - object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; - if (options.oneofs) object$1._sum = "sum"; - } - if (message.scale != null && message.hasOwnProperty("scale")) object$1.scale = message.scale; - if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) if (typeof message.zeroCount === "number") object$1.zeroCount = options.longs === String ? String(message.zeroCount) : message.zeroCount; - else object$1.zeroCount = options.longs === String ? $util.Long.prototype.toString.call(message.zeroCount) : options.longs === Number ? new $util.LongBits(message.zeroCount.low >>> 0, message.zeroCount.high >>> 0).toNumber() : message.zeroCount; - if (message.positive != null && message.hasOwnProperty("positive")) object$1.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.positive, options); - if (message.negative != null && message.hasOwnProperty("negative")) object$1.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.negative, options); - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - if (message.exemplars && message.exemplars.length) { - object$1.exemplars = []; - for (var j = 0; j < message.exemplars.length; ++j) object$1.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); - } - if (message.min != null && message.hasOwnProperty("min")) { - object$1.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; - if (options.oneofs) object$1._min = "min"; - } - if (message.max != null && message.hasOwnProperty("max")) { - object$1.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; - if (options.oneofs) object$1._max = "max"; - } - if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) object$1.zeroThreshold = options.json && !isFinite(message.zeroThreshold) ? String(message.zeroThreshold) : message.zeroThreshold; - return object$1; - }; - /** - * Converts this ExponentialHistogramDataPoint to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @instance - * @returns {Object.} JSON object - */ - ExponentialHistogramDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ExponentialHistogramDataPoint - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExponentialHistogramDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"; - }; - ExponentialHistogramDataPoint.Buckets = (function() { - /** - * Properties of a Buckets. - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @interface IBuckets - * @property {number|null} [offset] Buckets offset - * @property {Array.|null} [bucketCounts] Buckets bucketCounts - */ - /** - * Constructs a new Buckets. - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint - * @classdesc Represents a Buckets. - * @implements IBuckets - * @constructor - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets=} [properties] Properties to set - */ - function Buckets(properties) { - this.bucketCounts = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Buckets offset. - * @member {number|null|undefined} offset - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @instance - */ - Buckets.prototype.offset = null; - /** - * Buckets bucketCounts. - * @member {Array.} bucketCounts - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @instance - */ - Buckets.prototype.bucketCounts = $util.emptyArray; - /** - * Creates a new Buckets instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets instance - */ - Buckets.create = function create(properties) { - return new Buckets(properties); - }; - /** - * Encodes the specified Buckets message. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets} message Buckets message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Buckets.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) writer.uint32(8).sint32(message.offset); - if (message.bucketCounts != null && message.bucketCounts.length) { - writer.uint32(18).fork(); - for (var i = 0; i < message.bucketCounts.length; ++i) writer.uint64(message.bucketCounts[i]); - writer.ldelim(); - } - return writer; - }; - /** - * Encodes the specified Buckets message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.IBuckets} message Buckets message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Buckets.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a Buckets message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Buckets.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.offset = reader.sint32(); - break; - case 2: - if (!(message.bucketCounts && message.bucketCounts.length)) message.bucketCounts = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) message.bucketCounts.push(reader.uint64()); - } else message.bucketCounts.push(reader.uint64()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a Buckets message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Buckets.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a Buckets message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Buckets.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.offset != null && message.hasOwnProperty("offset")) { - if (!$util.isInteger(message.offset)) return "offset: integer expected"; - } - if (message.bucketCounts != null && message.hasOwnProperty("bucketCounts")) { - if (!Array.isArray(message.bucketCounts)) return "bucketCounts: array expected"; - for (var i = 0; i < message.bucketCounts.length; ++i) if (!$util.isInteger(message.bucketCounts[i]) && !(message.bucketCounts[i] && $util.isInteger(message.bucketCounts[i].low) && $util.isInteger(message.bucketCounts[i].high))) return "bucketCounts: integer|Long[] expected"; - } - return null; - }; - /** - * Creates a Buckets message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} Buckets - */ - Buckets.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets(); - if (object$1.offset != null) message.offset = object$1.offset | 0; - if (object$1.bucketCounts) { - if (!Array.isArray(object$1.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected"); - message.bucketCounts = []; - for (var i = 0; i < object$1.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object$1.bucketCounts[i])).unsigned = true; - else if (typeof object$1.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object$1.bucketCounts[i], 10); - else if (typeof object$1.bucketCounts[i] === "number") message.bucketCounts[i] = object$1.bucketCounts[i]; - else if (typeof object$1.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object$1.bucketCounts[i].low >>> 0, object$1.bucketCounts[i].high >>> 0).toNumber(true); - } - return message; - }; - /** - * Creates a plain object from a Buckets message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets} message Buckets - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Buckets.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.bucketCounts = []; - if (options.defaults) object$1.offset = 0; - if (message.offset != null && message.hasOwnProperty("offset")) object$1.offset = message.offset; - if (message.bucketCounts && message.bucketCounts.length) { - object$1.bucketCounts = []; - for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object$1.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; - else object$1.bucketCounts[j] = options.longs === String ? $util.Long.prototype.toString.call(message.bucketCounts[j]) : options.longs === Number ? new $util.LongBits(message.bucketCounts[j].low >>> 0, message.bucketCounts[j].high >>> 0).toNumber(true) : message.bucketCounts[j]; - } - return object$1; - }; - /** - * Converts this Buckets to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @instance - * @returns {Object.} JSON object - */ - Buckets.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Buckets - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Buckets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"; - }; - return Buckets; - })(); - return ExponentialHistogramDataPoint; - })(); - v1.SummaryDataPoint = (function() { - /** - * Properties of a SummaryDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @interface ISummaryDataPoint - * @property {Array.|null} [attributes] SummaryDataPoint attributes - * @property {number|Long|null} [startTimeUnixNano] SummaryDataPoint startTimeUnixNano - * @property {number|Long|null} [timeUnixNano] SummaryDataPoint timeUnixNano - * @property {number|Long|null} [count] SummaryDataPoint count - * @property {number|null} [sum] SummaryDataPoint sum - * @property {Array.|null} [quantileValues] SummaryDataPoint quantileValues - * @property {number|null} [flags] SummaryDataPoint flags - */ - /** - * Constructs a new SummaryDataPoint. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents a SummaryDataPoint. - * @implements ISummaryDataPoint - * @constructor - * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint=} [properties] Properties to set - */ - function SummaryDataPoint(properties) { - this.attributes = []; - this.quantileValues = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * SummaryDataPoint attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.attributes = $util.emptyArray; - /** - * SummaryDataPoint startTimeUnixNano. - * @member {number|Long|null|undefined} startTimeUnixNano - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.startTimeUnixNano = null; - /** - * SummaryDataPoint timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.timeUnixNano = null; - /** - * SummaryDataPoint count. - * @member {number|Long|null|undefined} count - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.count = null; - /** - * SummaryDataPoint sum. - * @member {number|null|undefined} sum - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.sum = null; - /** - * SummaryDataPoint quantileValues. - * @member {Array.} quantileValues - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.quantileValues = $util.emptyArray; - /** - * SummaryDataPoint flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - */ - SummaryDataPoint.prototype.flags = null; - /** - * Creates a new SummaryDataPoint instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint instance - */ - SummaryDataPoint.create = function create(properties) { - return new SummaryDataPoint(properties); - }; - /** - * Encodes the specified SummaryDataPoint message. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint} message SummaryDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummaryDataPoint.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.startTimeUnixNano != null && Object.hasOwnProperty.call(message, "startTimeUnixNano")) writer.uint32(17).fixed64(message.startTimeUnixNano); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(25).fixed64(message.timeUnixNano); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) writer.uint32(33).fixed64(message.count); - if (message.sum != null && Object.hasOwnProperty.call(message, "sum")) writer.uint32(41).double(message.sum); - if (message.quantileValues != null && message.quantileValues.length) for (var i = 0; i < message.quantileValues.length; ++i) $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(message.quantileValues[i], writer.uint32(50).fork()).ldelim(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(58).fork()).ldelim(); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(64).uint32(message.flags); - return writer; - }; - /** - * Encodes the specified SummaryDataPoint message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.ISummaryDataPoint} message SummaryDataPoint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SummaryDataPoint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a SummaryDataPoint message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummaryDataPoint.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 7: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.startTimeUnixNano = reader.fixed64(); - break; - case 3: - message.timeUnixNano = reader.fixed64(); - break; - case 4: - message.count = reader.fixed64(); - break; - case 5: - message.sum = reader.double(); - break; - case 6: - if (!(message.quantileValues && message.quantileValues.length)) message.quantileValues = []; - message.quantileValues.push($root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(reader, reader.uint32())); - break; - case 8: - message.flags = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a SummaryDataPoint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SummaryDataPoint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a SummaryDataPoint message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SummaryDataPoint.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) { - if (!$util.isInteger(message.startTimeUnixNano) && !(message.startTimeUnixNano && $util.isInteger(message.startTimeUnixNano.low) && $util.isInteger(message.startTimeUnixNano.high))) return "startTimeUnixNano: integer|Long expected"; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.count != null && message.hasOwnProperty("count")) { - if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) return "count: integer|Long expected"; - } - if (message.sum != null && message.hasOwnProperty("sum")) { - if (typeof message.sum !== "number") return "sum: number expected"; - } - if (message.quantileValues != null && message.hasOwnProperty("quantileValues")) { - if (!Array.isArray(message.quantileValues)) return "quantileValues: array expected"; - for (var i = 0; i < message.quantileValues.length; ++i) { - var error = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(message.quantileValues[i]); - if (error) return "quantileValues." + error; - } - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - return null; - }; - /** - * Creates a SummaryDataPoint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint} SummaryDataPoint - */ - SummaryDataPoint.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint(); - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.startTimeUnixNano != null) { - if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object$1.startTimeUnixNano)).unsigned = false; - else if (typeof object$1.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object$1.startTimeUnixNano, 10); - else if (typeof object$1.startTimeUnixNano === "number") message.startTimeUnixNano = object$1.startTimeUnixNano; - else if (typeof object$1.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object$1.startTimeUnixNano.low >>> 0, object$1.startTimeUnixNano.high >>> 0).toNumber(); - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.count != null) { - if ($util.Long) (message.count = $util.Long.fromValue(object$1.count)).unsigned = false; - else if (typeof object$1.count === "string") message.count = parseInt(object$1.count, 10); - else if (typeof object$1.count === "number") message.count = object$1.count; - else if (typeof object$1.count === "object") message.count = new $util.LongBits(object$1.count.low >>> 0, object$1.count.high >>> 0).toNumber(); - } - if (object$1.sum != null) message.sum = Number(object$1.sum); - if (object$1.quantileValues) { - if (!Array.isArray(object$1.quantileValues)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected"); - message.quantileValues = []; - for (var i = 0; i < object$1.quantileValues.length; ++i) { - if (typeof object$1.quantileValues[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected"); - message.quantileValues[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(object$1.quantileValues[i]); - } - } - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - return message; - }; - /** - * Creates a plain object from a SummaryDataPoint message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint} message SummaryDataPoint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SummaryDataPoint.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) { - object$1.quantileValues = []; - object$1.attributes = []; - } - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.startTimeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.count = options.longs === String ? "0" : 0; - object$1.sum = 0; - object$1.flags = 0; - } - if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object$1.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; - else object$1.startTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.startTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.startTimeUnixNano.low >>> 0, message.startTimeUnixNano.high >>> 0).toNumber() : message.startTimeUnixNano; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.count != null && message.hasOwnProperty("count")) if (typeof message.count === "number") object$1.count = options.longs === String ? String(message.count) : message.count; - else object$1.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; - if (message.sum != null && message.hasOwnProperty("sum")) object$1.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; - if (message.quantileValues && message.quantileValues.length) { - object$1.quantileValues = []; - for (var j = 0; j < message.quantileValues.length; ++j) object$1.quantileValues[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(message.quantileValues[j], options); - } - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - return object$1; - }; - /** - * Converts this SummaryDataPoint to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @instance - * @returns {Object.} JSON object - */ - SummaryDataPoint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for SummaryDataPoint - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SummaryDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.SummaryDataPoint"; - }; - SummaryDataPoint.ValueAtQuantile = (function() { - /** - * Properties of a ValueAtQuantile. - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @interface IValueAtQuantile - * @property {number|null} [quantile] ValueAtQuantile quantile - * @property {number|null} [value] ValueAtQuantile value - */ - /** - * Constructs a new ValueAtQuantile. - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint - * @classdesc Represents a ValueAtQuantile. - * @implements IValueAtQuantile - * @constructor - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile=} [properties] Properties to set - */ - function ValueAtQuantile(properties) { - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ValueAtQuantile quantile. - * @member {number|null|undefined} quantile - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @instance - */ - ValueAtQuantile.prototype.quantile = null; - /** - * ValueAtQuantile value. - * @member {number|null|undefined} value - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @instance - */ - ValueAtQuantile.prototype.value = null; - /** - * Creates a new ValueAtQuantile instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile instance - */ - ValueAtQuantile.create = function create(properties) { - return new ValueAtQuantile(properties); - }; - /** - * Encodes the specified ValueAtQuantile message. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile} message ValueAtQuantile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueAtQuantile.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.quantile != null && Object.hasOwnProperty.call(message, "quantile")) writer.uint32(9).double(message.quantile); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(17).double(message.value); - return writer; - }; - /** - * Encodes the specified ValueAtQuantile message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.IValueAtQuantile} message ValueAtQuantile message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueAtQuantile.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ValueAtQuantile message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueAtQuantile.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.quantile = reader.double(); - break; - case 2: - message.value = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ValueAtQuantile message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueAtQuantile.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ValueAtQuantile message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValueAtQuantile.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.quantile != null && message.hasOwnProperty("quantile")) { - if (typeof message.quantile !== "number") return "quantile: number expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - if (typeof message.value !== "number") return "value: number expected"; - } - return null; - }; - /** - * Creates a ValueAtQuantile message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} ValueAtQuantile - */ - ValueAtQuantile.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile(); - if (object$1.quantile != null) message.quantile = Number(object$1.quantile); - if (object$1.value != null) message.value = Number(object$1.value); - return message; - }; - /** - * Creates a plain object from a ValueAtQuantile message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile} message ValueAtQuantile - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValueAtQuantile.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.defaults) { - object$1.quantile = 0; - object$1.value = 0; - } - if (message.quantile != null && message.hasOwnProperty("quantile")) object$1.quantile = options.json && !isFinite(message.quantile) ? String(message.quantile) : message.quantile; - if (message.value != null && message.hasOwnProperty("value")) object$1.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object$1; - }; - /** - * Converts this ValueAtQuantile to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @instance - * @returns {Object.} JSON object - */ - ValueAtQuantile.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ValueAtQuantile - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValueAtQuantile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"; - }; - return ValueAtQuantile; - })(); - return SummaryDataPoint; - })(); - v1.Exemplar = (function() { - /** - * Properties of an Exemplar. - * @memberof opentelemetry.proto.metrics.v1 - * @interface IExemplar - * @property {Array.|null} [filteredAttributes] Exemplar filteredAttributes - * @property {number|Long|null} [timeUnixNano] Exemplar timeUnixNano - * @property {number|null} [asDouble] Exemplar asDouble - * @property {number|Long|null} [asInt] Exemplar asInt - * @property {Uint8Array|null} [spanId] Exemplar spanId - * @property {Uint8Array|null} [traceId] Exemplar traceId - */ - /** - * Constructs a new Exemplar. - * @memberof opentelemetry.proto.metrics.v1 - * @classdesc Represents an Exemplar. - * @implements IExemplar - * @constructor - * @param {opentelemetry.proto.metrics.v1.IExemplar=} [properties] Properties to set - */ - function Exemplar(properties) { - this.filteredAttributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * Exemplar filteredAttributes. - * @member {Array.} filteredAttributes - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.filteredAttributes = $util.emptyArray; - /** - * Exemplar timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.timeUnixNano = null; - /** - * Exemplar asDouble. - * @member {number|null|undefined} asDouble - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.asDouble = null; - /** - * Exemplar asInt. - * @member {number|Long|null|undefined} asInt - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.asInt = null; - /** - * Exemplar spanId. - * @member {Uint8Array|null|undefined} spanId - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.spanId = null; - /** - * Exemplar traceId. - * @member {Uint8Array|null|undefined} traceId - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Exemplar.prototype.traceId = null; - var $oneOfFields; - /** - * Exemplar value. - * @member {"asDouble"|"asInt"|undefined} value - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - */ - Object.defineProperty(Exemplar.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["asDouble", "asInt"]), - set: $util.oneOfSetter($oneOfFields) - }); - /** - * Creates a new Exemplar instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {opentelemetry.proto.metrics.v1.IExemplar=} [properties] Properties to set - * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar instance - */ - Exemplar.create = function create(properties) { - return new Exemplar(properties); - }; - /** - * Encodes the specified Exemplar message. Does not implicitly {@link opentelemetry.proto.metrics.v1.Exemplar.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {opentelemetry.proto.metrics.v1.IExemplar} message Exemplar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exemplar.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(17).fixed64(message.timeUnixNano); - if (message.asDouble != null && Object.hasOwnProperty.call(message, "asDouble")) writer.uint32(25).double(message.asDouble); - if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(34).bytes(message.spanId); - if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(42).bytes(message.traceId); - if (message.asInt != null && Object.hasOwnProperty.call(message, "asInt")) writer.uint32(49).sfixed64(message.asInt); - if (message.filteredAttributes != null && message.filteredAttributes.length) for (var i = 0; i < message.filteredAttributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.filteredAttributes[i], writer.uint32(58).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified Exemplar message, length delimited. Does not implicitly {@link opentelemetry.proto.metrics.v1.Exemplar.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {opentelemetry.proto.metrics.v1.IExemplar} message Exemplar message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Exemplar.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes an Exemplar message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exemplar.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.metrics.v1.Exemplar(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 7: - if (!(message.filteredAttributes && message.filteredAttributes.length)) message.filteredAttributes = []; - message.filteredAttributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 2: - message.timeUnixNano = reader.fixed64(); - break; - case 3: - message.asDouble = reader.double(); - break; - case 6: - message.asInt = reader.sfixed64(); - break; - case 4: - message.spanId = reader.bytes(); - break; - case 5: - message.traceId = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes an Exemplar message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Exemplar.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies an Exemplar message. - * @function verify - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Exemplar.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.filteredAttributes != null && message.hasOwnProperty("filteredAttributes")) { - if (!Array.isArray(message.filteredAttributes)) return "filteredAttributes: array expected"; - for (var i = 0; i < message.filteredAttributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.filteredAttributes[i]); - if (error) return "filteredAttributes." + error; - } - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.asDouble != null && message.hasOwnProperty("asDouble")) { - properties.value = 1; - if (typeof message.asDouble !== "number") return "asDouble: number expected"; - } - if (message.asInt != null && message.hasOwnProperty("asInt")) { - if (properties.value === 1) return "value: multiple values"; - properties.value = 1; - if (!$util.isInteger(message.asInt) && !(message.asInt && $util.isInteger(message.asInt.low) && $util.isInteger(message.asInt.high))) return "asInt: integer|Long expected"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) { - if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; - } - if (message.traceId != null && message.hasOwnProperty("traceId")) { - if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; - } - return null; - }; - /** - * Creates an Exemplar message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.metrics.v1.Exemplar} Exemplar - */ - Exemplar.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.metrics.v1.Exemplar) return object$1; - var message = new $root.opentelemetry.proto.metrics.v1.Exemplar(); - if (object$1.filteredAttributes) { - if (!Array.isArray(object$1.filteredAttributes)) throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected"); - message.filteredAttributes = []; - for (var i = 0; i < object$1.filteredAttributes.length; ++i) { - if (typeof object$1.filteredAttributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected"); - message.filteredAttributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.filteredAttributes[i]); - } - } - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.asDouble != null) message.asDouble = Number(object$1.asDouble); - if (object$1.asInt != null) { - if ($util.Long) (message.asInt = $util.Long.fromValue(object$1.asInt)).unsigned = false; - else if (typeof object$1.asInt === "string") message.asInt = parseInt(object$1.asInt, 10); - else if (typeof object$1.asInt === "number") message.asInt = object$1.asInt; - else if (typeof object$1.asInt === "object") message.asInt = new $util.LongBits(object$1.asInt.low >>> 0, object$1.asInt.high >>> 0).toNumber(); - } - if (object$1.spanId != null) { - if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); - else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; - } - if (object$1.traceId != null) { - if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); - else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; - } - return message; - }; - /** - * Creates a plain object from an Exemplar message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {opentelemetry.proto.metrics.v1.Exemplar} message Exemplar - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Exemplar.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.filteredAttributes = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - if (options.bytes === String) object$1.spanId = ""; - else { - object$1.spanId = []; - if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); - } - if (options.bytes === String) object$1.traceId = ""; - else { - object$1.traceId = []; - if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); - } - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.asDouble != null && message.hasOwnProperty("asDouble")) { - object$1.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; - if (options.oneofs) object$1.value = "asDouble"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; - if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; - if (message.asInt != null && message.hasOwnProperty("asInt")) { - if (typeof message.asInt === "number") object$1.asInt = options.longs === String ? String(message.asInt) : message.asInt; - else object$1.asInt = options.longs === String ? $util.Long.prototype.toString.call(message.asInt) : options.longs === Number ? new $util.LongBits(message.asInt.low >>> 0, message.asInt.high >>> 0).toNumber() : message.asInt; - if (options.oneofs) object$1.value = "asInt"; - } - if (message.filteredAttributes && message.filteredAttributes.length) { - object$1.filteredAttributes = []; - for (var j = 0; j < message.filteredAttributes.length; ++j) object$1.filteredAttributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.filteredAttributes[j], options); - } - return object$1; - }; - /** - * Converts this Exemplar to JSON. - * @function toJSON - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @instance - * @returns {Object.} JSON object - */ - Exemplar.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for Exemplar - * @function getTypeUrl - * @memberof opentelemetry.proto.metrics.v1.Exemplar - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Exemplar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.metrics.v1.Exemplar"; - }; - return Exemplar; - })(); - return v1; - })(); - return metrics$1; - })(); - proto.logs = (function() { - /** - * Namespace logs. - * @memberof opentelemetry.proto - * @namespace - */ - var logs = {}; - logs.v1 = (function() { - /** - * Namespace v1. - * @memberof opentelemetry.proto.logs - * @namespace - */ - var v1 = {}; - v1.LogsData = (function() { - /** - * Properties of a LogsData. - * @memberof opentelemetry.proto.logs.v1 - * @interface ILogsData - * @property {Array.|null} [resourceLogs] LogsData resourceLogs - */ - /** - * Constructs a new LogsData. - * @memberof opentelemetry.proto.logs.v1 - * @classdesc Represents a LogsData. - * @implements ILogsData - * @constructor - * @param {opentelemetry.proto.logs.v1.ILogsData=} [properties] Properties to set - */ - function LogsData(properties) { - this.resourceLogs = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * LogsData resourceLogs. - * @member {Array.} resourceLogs - * @memberof opentelemetry.proto.logs.v1.LogsData - * @instance - */ - LogsData.prototype.resourceLogs = $util.emptyArray; - /** - * Creates a new LogsData instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {opentelemetry.proto.logs.v1.ILogsData=} [properties] Properties to set - * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData instance - */ - LogsData.create = function create(properties) { - return new LogsData(properties); - }; - /** - * Encodes the specified LogsData message. Does not implicitly {@link opentelemetry.proto.logs.v1.LogsData.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {opentelemetry.proto.logs.v1.ILogsData} message LogsData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsData.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resourceLogs != null && message.resourceLogs.length) for (var i = 0; i < message.resourceLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ResourceLogs.encode(message.resourceLogs[i], writer.uint32(10).fork()).ldelim(); - return writer; - }; - /** - * Encodes the specified LogsData message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.LogsData.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {opentelemetry.proto.logs.v1.ILogsData} message LogsData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogsData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a LogsData message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsData.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.LogsData(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - if (!(message.resourceLogs && message.resourceLogs.length)) message.resourceLogs = []; - message.resourceLogs.push($root.opentelemetry.proto.logs.v1.ResourceLogs.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a LogsData message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogsData.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a LogsData message. - * @function verify - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogsData.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceLogs != null && message.hasOwnProperty("resourceLogs")) { - if (!Array.isArray(message.resourceLogs)) return "resourceLogs: array expected"; - for (var i = 0; i < message.resourceLogs.length; ++i) { - var error = $root.opentelemetry.proto.logs.v1.ResourceLogs.verify(message.resourceLogs[i]); - if (error) return "resourceLogs." + error; - } - } - return null; - }; - /** - * Creates a LogsData message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.logs.v1.LogsData} LogsData - */ - LogsData.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.logs.v1.LogsData) return object$1; - var message = new $root.opentelemetry.proto.logs.v1.LogsData(); - if (object$1.resourceLogs) { - if (!Array.isArray(object$1.resourceLogs)) throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected"); - message.resourceLogs = []; - for (var i = 0; i < object$1.resourceLogs.length; ++i) { - if (typeof object$1.resourceLogs[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected"); - message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object$1.resourceLogs[i]); - } - } - return message; - }; - /** - * Creates a plain object from a LogsData message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {opentelemetry.proto.logs.v1.LogsData} message LogsData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogsData.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.resourceLogs = []; - if (message.resourceLogs && message.resourceLogs.length) { - object$1.resourceLogs = []; - for (var j = 0; j < message.resourceLogs.length; ++j) object$1.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); - } - return object$1; - }; - /** - * Converts this LogsData to JSON. - * @function toJSON - * @memberof opentelemetry.proto.logs.v1.LogsData - * @instance - * @returns {Object.} JSON object - */ - LogsData.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for LogsData - * @function getTypeUrl - * @memberof opentelemetry.proto.logs.v1.LogsData - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogsData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.logs.v1.LogsData"; - }; - return LogsData; - })(); - v1.ResourceLogs = (function() { - /** - * Properties of a ResourceLogs. - * @memberof opentelemetry.proto.logs.v1 - * @interface IResourceLogs - * @property {opentelemetry.proto.resource.v1.IResource|null} [resource] ResourceLogs resource - * @property {Array.|null} [scopeLogs] ResourceLogs scopeLogs - * @property {string|null} [schemaUrl] ResourceLogs schemaUrl - */ - /** - * Constructs a new ResourceLogs. - * @memberof opentelemetry.proto.logs.v1 - * @classdesc Represents a ResourceLogs. - * @implements IResourceLogs - * @constructor - * @param {opentelemetry.proto.logs.v1.IResourceLogs=} [properties] Properties to set - */ - function ResourceLogs(properties) { - this.scopeLogs = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ResourceLogs resource. - * @member {opentelemetry.proto.resource.v1.IResource|null|undefined} resource - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @instance - */ - ResourceLogs.prototype.resource = null; - /** - * ResourceLogs scopeLogs. - * @member {Array.} scopeLogs - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @instance - */ - ResourceLogs.prototype.scopeLogs = $util.emptyArray; - /** - * ResourceLogs schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @instance - */ - ResourceLogs.prototype.schemaUrl = null; - /** - * Creates a new ResourceLogs instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {opentelemetry.proto.logs.v1.IResourceLogs=} [properties] Properties to set - * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs instance - */ - ResourceLogs.create = function create(properties) { - return new ResourceLogs(properties); - }; - /** - * Encodes the specified ResourceLogs message. Does not implicitly {@link opentelemetry.proto.logs.v1.ResourceLogs.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {opentelemetry.proto.logs.v1.IResourceLogs} message ResourceLogs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceLogs.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) $root.opentelemetry.proto.resource.v1.Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - if (message.scopeLogs != null && message.scopeLogs.length) for (var i = 0; i < message.scopeLogs.length; ++i) $root.opentelemetry.proto.logs.v1.ScopeLogs.encode(message.scopeLogs[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ResourceLogs message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.ResourceLogs.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {opentelemetry.proto.logs.v1.IResourceLogs} message ResourceLogs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceLogs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ResourceLogs message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceLogs.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.ResourceLogs(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.resource = $root.opentelemetry.proto.resource.v1.Resource.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.scopeLogs && message.scopeLogs.length)) message.scopeLogs = []; - message.scopeLogs.push($root.opentelemetry.proto.logs.v1.ScopeLogs.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ResourceLogs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceLogs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ResourceLogs message. - * @function verify - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceLogs.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.resource != null && message.hasOwnProperty("resource")) { - var error = $root.opentelemetry.proto.resource.v1.Resource.verify(message.resource); - if (error) return "resource." + error; - } - if (message.scopeLogs != null && message.hasOwnProperty("scopeLogs")) { - if (!Array.isArray(message.scopeLogs)) return "scopeLogs: array expected"; - for (var i = 0; i < message.scopeLogs.length; ++i) { - var error = $root.opentelemetry.proto.logs.v1.ScopeLogs.verify(message.scopeLogs[i]); - if (error) return "scopeLogs." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ResourceLogs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.logs.v1.ResourceLogs} ResourceLogs - */ - ResourceLogs.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.logs.v1.ResourceLogs) return object$1; - var message = new $root.opentelemetry.proto.logs.v1.ResourceLogs(); - if (object$1.resource != null) { - if (typeof object$1.resource !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected"); - message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object$1.resource); - } - if (object$1.scopeLogs) { - if (!Array.isArray(object$1.scopeLogs)) throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected"); - message.scopeLogs = []; - for (var i = 0; i < object$1.scopeLogs.length; ++i) { - if (typeof object$1.scopeLogs[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected"); - message.scopeLogs[i] = $root.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(object$1.scopeLogs[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ResourceLogs message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {opentelemetry.proto.logs.v1.ResourceLogs} message ResourceLogs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceLogs.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.scopeLogs = []; - if (options.defaults) { - object$1.resource = null; - object$1.schemaUrl = ""; - } - if (message.resource != null && message.hasOwnProperty("resource")) object$1.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); - if (message.scopeLogs && message.scopeLogs.length) { - object$1.scopeLogs = []; - for (var j = 0; j < message.scopeLogs.length; ++j) object$1.scopeLogs[j] = $root.opentelemetry.proto.logs.v1.ScopeLogs.toObject(message.scopeLogs[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ResourceLogs to JSON. - * @function toJSON - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @instance - * @returns {Object.} JSON object - */ - ResourceLogs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ResourceLogs - * @function getTypeUrl - * @memberof opentelemetry.proto.logs.v1.ResourceLogs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceLogs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.logs.v1.ResourceLogs"; - }; - return ResourceLogs; - })(); - v1.ScopeLogs = (function() { - /** - * Properties of a ScopeLogs. - * @memberof opentelemetry.proto.logs.v1 - * @interface IScopeLogs - * @property {opentelemetry.proto.common.v1.IInstrumentationScope|null} [scope] ScopeLogs scope - * @property {Array.|null} [logRecords] ScopeLogs logRecords - * @property {string|null} [schemaUrl] ScopeLogs schemaUrl - */ - /** - * Constructs a new ScopeLogs. - * @memberof opentelemetry.proto.logs.v1 - * @classdesc Represents a ScopeLogs. - * @implements IScopeLogs - * @constructor - * @param {opentelemetry.proto.logs.v1.IScopeLogs=} [properties] Properties to set - */ - function ScopeLogs(properties) { - this.logRecords = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * ScopeLogs scope. - * @member {opentelemetry.proto.common.v1.IInstrumentationScope|null|undefined} scope - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @instance - */ - ScopeLogs.prototype.scope = null; - /** - * ScopeLogs logRecords. - * @member {Array.} logRecords - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @instance - */ - ScopeLogs.prototype.logRecords = $util.emptyArray; - /** - * ScopeLogs schemaUrl. - * @member {string|null|undefined} schemaUrl - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @instance - */ - ScopeLogs.prototype.schemaUrl = null; - /** - * Creates a new ScopeLogs instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {opentelemetry.proto.logs.v1.IScopeLogs=} [properties] Properties to set - * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs instance - */ - ScopeLogs.create = function create(properties) { - return new ScopeLogs(properties); - }; - /** - * Encodes the specified ScopeLogs message. Does not implicitly {@link opentelemetry.proto.logs.v1.ScopeLogs.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {opentelemetry.proto.logs.v1.IScopeLogs} message ScopeLogs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeLogs.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) $root.opentelemetry.proto.common.v1.InstrumentationScope.encode(message.scope, writer.uint32(10).fork()).ldelim(); - if (message.logRecords != null && message.logRecords.length) for (var i = 0; i < message.logRecords.length; ++i) $root.opentelemetry.proto.logs.v1.LogRecord.encode(message.logRecords[i], writer.uint32(18).fork()).ldelim(); - if (message.schemaUrl != null && Object.hasOwnProperty.call(message, "schemaUrl")) writer.uint32(26).string(message.schemaUrl); - return writer; - }; - /** - * Encodes the specified ScopeLogs message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.ScopeLogs.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {opentelemetry.proto.logs.v1.IScopeLogs} message ScopeLogs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScopeLogs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a ScopeLogs message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeLogs.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.ScopeLogs(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.logRecords && message.logRecords.length)) message.logRecords = []; - message.logRecords.push($root.opentelemetry.proto.logs.v1.LogRecord.decode(reader, reader.uint32())); - break; - case 3: - message.schemaUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a ScopeLogs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScopeLogs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ScopeLogs message. - * @function verify - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScopeLogs.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.scope != null && message.hasOwnProperty("scope")) { - var error = $root.opentelemetry.proto.common.v1.InstrumentationScope.verify(message.scope); - if (error) return "scope." + error; - } - if (message.logRecords != null && message.hasOwnProperty("logRecords")) { - if (!Array.isArray(message.logRecords)) return "logRecords: array expected"; - for (var i = 0; i < message.logRecords.length; ++i) { - var error = $root.opentelemetry.proto.logs.v1.LogRecord.verify(message.logRecords[i]); - if (error) return "logRecords." + error; - } - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) { - if (!$util.isString(message.schemaUrl)) return "schemaUrl: string expected"; - } - return null; - }; - /** - * Creates a ScopeLogs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.logs.v1.ScopeLogs} ScopeLogs - */ - ScopeLogs.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.logs.v1.ScopeLogs) return object$1; - var message = new $root.opentelemetry.proto.logs.v1.ScopeLogs(); - if (object$1.scope != null) { - if (typeof object$1.scope !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected"); - message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object$1.scope); - } - if (object$1.logRecords) { - if (!Array.isArray(object$1.logRecords)) throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected"); - message.logRecords = []; - for (var i = 0; i < object$1.logRecords.length; ++i) { - if (typeof object$1.logRecords[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected"); - message.logRecords[i] = $root.opentelemetry.proto.logs.v1.LogRecord.fromObject(object$1.logRecords[i]); - } - } - if (object$1.schemaUrl != null) message.schemaUrl = String(object$1.schemaUrl); - return message; - }; - /** - * Creates a plain object from a ScopeLogs message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {opentelemetry.proto.logs.v1.ScopeLogs} message ScopeLogs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScopeLogs.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.logRecords = []; - if (options.defaults) { - object$1.scope = null; - object$1.schemaUrl = ""; - } - if (message.scope != null && message.hasOwnProperty("scope")) object$1.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); - if (message.logRecords && message.logRecords.length) { - object$1.logRecords = []; - for (var j = 0; j < message.logRecords.length; ++j) object$1.logRecords[j] = $root.opentelemetry.proto.logs.v1.LogRecord.toObject(message.logRecords[j], options); - } - if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object$1.schemaUrl = message.schemaUrl; - return object$1; - }; - /** - * Converts this ScopeLogs to JSON. - * @function toJSON - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @instance - * @returns {Object.} JSON object - */ - ScopeLogs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for ScopeLogs - * @function getTypeUrl - * @memberof opentelemetry.proto.logs.v1.ScopeLogs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScopeLogs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.logs.v1.ScopeLogs"; - }; - return ScopeLogs; - })(); - /** - * SeverityNumber enum. - * @name opentelemetry.proto.logs.v1.SeverityNumber - * @enum {number} - * @property {number} SEVERITY_NUMBER_UNSPECIFIED=0 SEVERITY_NUMBER_UNSPECIFIED value - * @property {number} SEVERITY_NUMBER_TRACE=1 SEVERITY_NUMBER_TRACE value - * @property {number} SEVERITY_NUMBER_TRACE2=2 SEVERITY_NUMBER_TRACE2 value - * @property {number} SEVERITY_NUMBER_TRACE3=3 SEVERITY_NUMBER_TRACE3 value - * @property {number} SEVERITY_NUMBER_TRACE4=4 SEVERITY_NUMBER_TRACE4 value - * @property {number} SEVERITY_NUMBER_DEBUG=5 SEVERITY_NUMBER_DEBUG value - * @property {number} SEVERITY_NUMBER_DEBUG2=6 SEVERITY_NUMBER_DEBUG2 value - * @property {number} SEVERITY_NUMBER_DEBUG3=7 SEVERITY_NUMBER_DEBUG3 value - * @property {number} SEVERITY_NUMBER_DEBUG4=8 SEVERITY_NUMBER_DEBUG4 value - * @property {number} SEVERITY_NUMBER_INFO=9 SEVERITY_NUMBER_INFO value - * @property {number} SEVERITY_NUMBER_INFO2=10 SEVERITY_NUMBER_INFO2 value - * @property {number} SEVERITY_NUMBER_INFO3=11 SEVERITY_NUMBER_INFO3 value - * @property {number} SEVERITY_NUMBER_INFO4=12 SEVERITY_NUMBER_INFO4 value - * @property {number} SEVERITY_NUMBER_WARN=13 SEVERITY_NUMBER_WARN value - * @property {number} SEVERITY_NUMBER_WARN2=14 SEVERITY_NUMBER_WARN2 value - * @property {number} SEVERITY_NUMBER_WARN3=15 SEVERITY_NUMBER_WARN3 value - * @property {number} SEVERITY_NUMBER_WARN4=16 SEVERITY_NUMBER_WARN4 value - * @property {number} SEVERITY_NUMBER_ERROR=17 SEVERITY_NUMBER_ERROR value - * @property {number} SEVERITY_NUMBER_ERROR2=18 SEVERITY_NUMBER_ERROR2 value - * @property {number} SEVERITY_NUMBER_ERROR3=19 SEVERITY_NUMBER_ERROR3 value - * @property {number} SEVERITY_NUMBER_ERROR4=20 SEVERITY_NUMBER_ERROR4 value - * @property {number} SEVERITY_NUMBER_FATAL=21 SEVERITY_NUMBER_FATAL value - * @property {number} SEVERITY_NUMBER_FATAL2=22 SEVERITY_NUMBER_FATAL2 value - * @property {number} SEVERITY_NUMBER_FATAL3=23 SEVERITY_NUMBER_FATAL3 value - * @property {number} SEVERITY_NUMBER_FATAL4=24 SEVERITY_NUMBER_FATAL4 value - */ - v1.SeverityNumber = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_NUMBER_UNSPECIFIED"] = 0; - values[valuesById[1] = "SEVERITY_NUMBER_TRACE"] = 1; - values[valuesById[2] = "SEVERITY_NUMBER_TRACE2"] = 2; - values[valuesById[3] = "SEVERITY_NUMBER_TRACE3"] = 3; - values[valuesById[4] = "SEVERITY_NUMBER_TRACE4"] = 4; - values[valuesById[5] = "SEVERITY_NUMBER_DEBUG"] = 5; - values[valuesById[6] = "SEVERITY_NUMBER_DEBUG2"] = 6; - values[valuesById[7] = "SEVERITY_NUMBER_DEBUG3"] = 7; - values[valuesById[8] = "SEVERITY_NUMBER_DEBUG4"] = 8; - values[valuesById[9] = "SEVERITY_NUMBER_INFO"] = 9; - values[valuesById[10] = "SEVERITY_NUMBER_INFO2"] = 10; - values[valuesById[11] = "SEVERITY_NUMBER_INFO3"] = 11; - values[valuesById[12] = "SEVERITY_NUMBER_INFO4"] = 12; - values[valuesById[13] = "SEVERITY_NUMBER_WARN"] = 13; - values[valuesById[14] = "SEVERITY_NUMBER_WARN2"] = 14; - values[valuesById[15] = "SEVERITY_NUMBER_WARN3"] = 15; - values[valuesById[16] = "SEVERITY_NUMBER_WARN4"] = 16; - values[valuesById[17] = "SEVERITY_NUMBER_ERROR"] = 17; - values[valuesById[18] = "SEVERITY_NUMBER_ERROR2"] = 18; - values[valuesById[19] = "SEVERITY_NUMBER_ERROR3"] = 19; - values[valuesById[20] = "SEVERITY_NUMBER_ERROR4"] = 20; - values[valuesById[21] = "SEVERITY_NUMBER_FATAL"] = 21; - values[valuesById[22] = "SEVERITY_NUMBER_FATAL2"] = 22; - values[valuesById[23] = "SEVERITY_NUMBER_FATAL3"] = 23; - values[valuesById[24] = "SEVERITY_NUMBER_FATAL4"] = 24; - return values; - })(); - /** - * LogRecordFlags enum. - * @name opentelemetry.proto.logs.v1.LogRecordFlags - * @enum {number} - * @property {number} LOG_RECORD_FLAGS_DO_NOT_USE=0 LOG_RECORD_FLAGS_DO_NOT_USE value - * @property {number} LOG_RECORD_FLAGS_TRACE_FLAGS_MASK=255 LOG_RECORD_FLAGS_TRACE_FLAGS_MASK value - */ - v1.LogRecordFlags = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LOG_RECORD_FLAGS_DO_NOT_USE"] = 0; - values[valuesById[255] = "LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"] = 255; - return values; - })(); - v1.LogRecord = (function() { - /** - * Properties of a LogRecord. - * @memberof opentelemetry.proto.logs.v1 - * @interface ILogRecord - * @property {number|Long|null} [timeUnixNano] LogRecord timeUnixNano - * @property {number|Long|null} [observedTimeUnixNano] LogRecord observedTimeUnixNano - * @property {opentelemetry.proto.logs.v1.SeverityNumber|null} [severityNumber] LogRecord severityNumber - * @property {string|null} [severityText] LogRecord severityText - * @property {opentelemetry.proto.common.v1.IAnyValue|null} [body] LogRecord body - * @property {Array.|null} [attributes] LogRecord attributes - * @property {number|null} [droppedAttributesCount] LogRecord droppedAttributesCount - * @property {number|null} [flags] LogRecord flags - * @property {Uint8Array|null} [traceId] LogRecord traceId - * @property {Uint8Array|null} [spanId] LogRecord spanId - * @property {string|null} [eventName] LogRecord eventName - */ - /** - * Constructs a new LogRecord. - * @memberof opentelemetry.proto.logs.v1 - * @classdesc Represents a LogRecord. - * @implements ILogRecord - * @constructor - * @param {opentelemetry.proto.logs.v1.ILogRecord=} [properties] Properties to set - */ - function LogRecord(properties) { - this.attributes = []; - if (properties) { - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; - } - } - /** - * LogRecord timeUnixNano. - * @member {number|Long|null|undefined} timeUnixNano - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.timeUnixNano = null; - /** - * LogRecord observedTimeUnixNano. - * @member {number|Long|null|undefined} observedTimeUnixNano - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.observedTimeUnixNano = null; - /** - * LogRecord severityNumber. - * @member {opentelemetry.proto.logs.v1.SeverityNumber|null|undefined} severityNumber - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.severityNumber = null; - /** - * LogRecord severityText. - * @member {string|null|undefined} severityText - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.severityText = null; - /** - * LogRecord body. - * @member {opentelemetry.proto.common.v1.IAnyValue|null|undefined} body - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.body = null; - /** - * LogRecord attributes. - * @member {Array.} attributes - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.attributes = $util.emptyArray; - /** - * LogRecord droppedAttributesCount. - * @member {number|null|undefined} droppedAttributesCount - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.droppedAttributesCount = null; - /** - * LogRecord flags. - * @member {number|null|undefined} flags - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.flags = null; - /** - * LogRecord traceId. - * @member {Uint8Array|null|undefined} traceId - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.traceId = null; - /** - * LogRecord spanId. - * @member {Uint8Array|null|undefined} spanId - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.spanId = null; - /** - * LogRecord eventName. - * @member {string|null|undefined} eventName - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - */ - LogRecord.prototype.eventName = null; - /** - * Creates a new LogRecord instance using the specified properties. - * @function create - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {opentelemetry.proto.logs.v1.ILogRecord=} [properties] Properties to set - * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord instance - */ - LogRecord.create = function create(properties) { - return new LogRecord(properties); - }; - /** - * Encodes the specified LogRecord message. Does not implicitly {@link opentelemetry.proto.logs.v1.LogRecord.verify|verify} messages. - * @function encode - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {opentelemetry.proto.logs.v1.ILogRecord} message LogRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogRecord.encode = function encode$2(message, writer) { - if (!writer) writer = $Writer.create(); - if (message.timeUnixNano != null && Object.hasOwnProperty.call(message, "timeUnixNano")) writer.uint32(9).fixed64(message.timeUnixNano); - if (message.severityNumber != null && Object.hasOwnProperty.call(message, "severityNumber")) writer.uint32(16).int32(message.severityNumber); - if (message.severityText != null && Object.hasOwnProperty.call(message, "severityText")) writer.uint32(26).string(message.severityText); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) $root.opentelemetry.proto.common.v1.AnyValue.encode(message.body, writer.uint32(42).fork()).ldelim(); - if (message.attributes != null && message.attributes.length) for (var i = 0; i < message.attributes.length; ++i) $root.opentelemetry.proto.common.v1.KeyValue.encode(message.attributes[i], writer.uint32(50).fork()).ldelim(); - if (message.droppedAttributesCount != null && Object.hasOwnProperty.call(message, "droppedAttributesCount")) writer.uint32(56).uint32(message.droppedAttributesCount); - if (message.flags != null && Object.hasOwnProperty.call(message, "flags")) writer.uint32(69).fixed32(message.flags); - if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) writer.uint32(74).bytes(message.traceId); - if (message.spanId != null && Object.hasOwnProperty.call(message, "spanId")) writer.uint32(82).bytes(message.spanId); - if (message.observedTimeUnixNano != null && Object.hasOwnProperty.call(message, "observedTimeUnixNano")) writer.uint32(89).fixed64(message.observedTimeUnixNano); - if (message.eventName != null && Object.hasOwnProperty.call(message, "eventName")) writer.uint32(98).string(message.eventName); - return writer; - }; - /** - * Encodes the specified LogRecord message, length delimited. Does not implicitly {@link opentelemetry.proto.logs.v1.LogRecord.verify|verify} messages. - * @function encodeDelimited - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {opentelemetry.proto.logs.v1.ILogRecord} message LogRecord message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LogRecord.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - /** - * Decodes a LogRecord message from the specified reader or buffer. - * @function decode - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogRecord.decode = function decode$2(reader, length, error) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === void 0 ? reader.len : reader.pos + length, message = new $root.opentelemetry.proto.logs.v1.LogRecord(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) break; - switch (tag >>> 3) { - case 1: - message.timeUnixNano = reader.fixed64(); - break; - case 11: - message.observedTimeUnixNano = reader.fixed64(); - break; - case 2: - message.severityNumber = reader.int32(); - break; - case 3: - message.severityText = reader.string(); - break; - case 5: - message.body = $root.opentelemetry.proto.common.v1.AnyValue.decode(reader, reader.uint32()); - break; - case 6: - if (!(message.attributes && message.attributes.length)) message.attributes = []; - message.attributes.push($root.opentelemetry.proto.common.v1.KeyValue.decode(reader, reader.uint32())); - break; - case 7: - message.droppedAttributesCount = reader.uint32(); - break; - case 8: - message.flags = reader.fixed32(); - break; - case 9: - message.traceId = reader.bytes(); - break; - case 10: - message.spanId = reader.bytes(); - break; - case 12: - message.eventName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - /** - * Decodes a LogRecord message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LogRecord.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a LogRecord message. - * @function verify - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LogRecord.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) { - if (!$util.isInteger(message.timeUnixNano) && !(message.timeUnixNano && $util.isInteger(message.timeUnixNano.low) && $util.isInteger(message.timeUnixNano.high))) return "timeUnixNano: integer|Long expected"; - } - if (message.observedTimeUnixNano != null && message.hasOwnProperty("observedTimeUnixNano")) { - if (!$util.isInteger(message.observedTimeUnixNano) && !(message.observedTimeUnixNano && $util.isInteger(message.observedTimeUnixNano.low) && $util.isInteger(message.observedTimeUnixNano.high))) return "observedTimeUnixNano: integer|Long expected"; - } - if (message.severityNumber != null && message.hasOwnProperty("severityNumber")) switch (message.severityNumber) { - default: return "severityNumber: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: break; - } - if (message.severityText != null && message.hasOwnProperty("severityText")) { - if (!$util.isString(message.severityText)) return "severityText: string expected"; - } - if (message.body != null && message.hasOwnProperty("body")) { - var error = $root.opentelemetry.proto.common.v1.AnyValue.verify(message.body); - if (error) return "body." + error; - } - if (message.attributes != null && message.hasOwnProperty("attributes")) { - if (!Array.isArray(message.attributes)) return "attributes: array expected"; - for (var i = 0; i < message.attributes.length; ++i) { - var error = $root.opentelemetry.proto.common.v1.KeyValue.verify(message.attributes[i]); - if (error) return "attributes." + error; - } - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) { - if (!$util.isInteger(message.droppedAttributesCount)) return "droppedAttributesCount: integer expected"; - } - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!$util.isInteger(message.flags)) return "flags: integer expected"; - } - if (message.traceId != null && message.hasOwnProperty("traceId")) { - if (!(message.traceId && typeof message.traceId.length === "number" || $util.isString(message.traceId))) return "traceId: buffer expected"; - } - if (message.spanId != null && message.hasOwnProperty("spanId")) { - if (!(message.spanId && typeof message.spanId.length === "number" || $util.isString(message.spanId))) return "spanId: buffer expected"; - } - if (message.eventName != null && message.hasOwnProperty("eventName")) { - if (!$util.isString(message.eventName)) return "eventName: string expected"; - } - return null; - }; - /** - * Creates a LogRecord message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {Object.} object Plain object - * @returns {opentelemetry.proto.logs.v1.LogRecord} LogRecord - */ - LogRecord.fromObject = function fromObject(object$1) { - if (object$1 instanceof $root.opentelemetry.proto.logs.v1.LogRecord) return object$1; - var message = new $root.opentelemetry.proto.logs.v1.LogRecord(); - if (object$1.timeUnixNano != null) { - if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object$1.timeUnixNano)).unsigned = false; - else if (typeof object$1.timeUnixNano === "string") message.timeUnixNano = parseInt(object$1.timeUnixNano, 10); - else if (typeof object$1.timeUnixNano === "number") message.timeUnixNano = object$1.timeUnixNano; - else if (typeof object$1.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object$1.timeUnixNano.low >>> 0, object$1.timeUnixNano.high >>> 0).toNumber(); - } - if (object$1.observedTimeUnixNano != null) { - if ($util.Long) (message.observedTimeUnixNano = $util.Long.fromValue(object$1.observedTimeUnixNano)).unsigned = false; - else if (typeof object$1.observedTimeUnixNano === "string") message.observedTimeUnixNano = parseInt(object$1.observedTimeUnixNano, 10); - else if (typeof object$1.observedTimeUnixNano === "number") message.observedTimeUnixNano = object$1.observedTimeUnixNano; - else if (typeof object$1.observedTimeUnixNano === "object") message.observedTimeUnixNano = new $util.LongBits(object$1.observedTimeUnixNano.low >>> 0, object$1.observedTimeUnixNano.high >>> 0).toNumber(); - } - switch (object$1.severityNumber) { - default: - if (typeof object$1.severityNumber === "number") { - message.severityNumber = object$1.severityNumber; - break; - } - break; - case "SEVERITY_NUMBER_UNSPECIFIED": - case 0: - message.severityNumber = 0; - break; - case "SEVERITY_NUMBER_TRACE": - case 1: - message.severityNumber = 1; - break; - case "SEVERITY_NUMBER_TRACE2": - case 2: - message.severityNumber = 2; - break; - case "SEVERITY_NUMBER_TRACE3": - case 3: - message.severityNumber = 3; - break; - case "SEVERITY_NUMBER_TRACE4": - case 4: - message.severityNumber = 4; - break; - case "SEVERITY_NUMBER_DEBUG": - case 5: - message.severityNumber = 5; - break; - case "SEVERITY_NUMBER_DEBUG2": - case 6: - message.severityNumber = 6; - break; - case "SEVERITY_NUMBER_DEBUG3": - case 7: - message.severityNumber = 7; - break; - case "SEVERITY_NUMBER_DEBUG4": - case 8: - message.severityNumber = 8; - break; - case "SEVERITY_NUMBER_INFO": - case 9: - message.severityNumber = 9; - break; - case "SEVERITY_NUMBER_INFO2": - case 10: - message.severityNumber = 10; - break; - case "SEVERITY_NUMBER_INFO3": - case 11: - message.severityNumber = 11; - break; - case "SEVERITY_NUMBER_INFO4": - case 12: - message.severityNumber = 12; - break; - case "SEVERITY_NUMBER_WARN": - case 13: - message.severityNumber = 13; - break; - case "SEVERITY_NUMBER_WARN2": - case 14: - message.severityNumber = 14; - break; - case "SEVERITY_NUMBER_WARN3": - case 15: - message.severityNumber = 15; - break; - case "SEVERITY_NUMBER_WARN4": - case 16: - message.severityNumber = 16; - break; - case "SEVERITY_NUMBER_ERROR": - case 17: - message.severityNumber = 17; - break; - case "SEVERITY_NUMBER_ERROR2": - case 18: - message.severityNumber = 18; - break; - case "SEVERITY_NUMBER_ERROR3": - case 19: - message.severityNumber = 19; - break; - case "SEVERITY_NUMBER_ERROR4": - case 20: - message.severityNumber = 20; - break; - case "SEVERITY_NUMBER_FATAL": - case 21: - message.severityNumber = 21; - break; - case "SEVERITY_NUMBER_FATAL2": - case 22: - message.severityNumber = 22; - break; - case "SEVERITY_NUMBER_FATAL3": - case 23: - message.severityNumber = 23; - break; - case "SEVERITY_NUMBER_FATAL4": - case 24: - message.severityNumber = 24; - break; - } - if (object$1.severityText != null) message.severityText = String(object$1.severityText); - if (object$1.body != null) { - if (typeof object$1.body !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected"); - message.body = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object$1.body); - } - if (object$1.attributes) { - if (!Array.isArray(object$1.attributes)) throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected"); - message.attributes = []; - for (var i = 0; i < object$1.attributes.length; ++i) { - if (typeof object$1.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected"); - message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object$1.attributes[i]); - } - } - if (object$1.droppedAttributesCount != null) message.droppedAttributesCount = object$1.droppedAttributesCount >>> 0; - if (object$1.flags != null) message.flags = object$1.flags >>> 0; - if (object$1.traceId != null) { - if (typeof object$1.traceId === "string") $util.base64.decode(object$1.traceId, message.traceId = $util.newBuffer($util.base64.length(object$1.traceId)), 0); - else if (object$1.traceId.length >= 0) message.traceId = object$1.traceId; - } - if (object$1.spanId != null) { - if (typeof object$1.spanId === "string") $util.base64.decode(object$1.spanId, message.spanId = $util.newBuffer($util.base64.length(object$1.spanId)), 0); - else if (object$1.spanId.length >= 0) message.spanId = object$1.spanId; - } - if (object$1.eventName != null) message.eventName = String(object$1.eventName); - return message; - }; - /** - * Creates a plain object from a LogRecord message. Also converts values to other types if specified. - * @function toObject - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {opentelemetry.proto.logs.v1.LogRecord} message LogRecord - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LogRecord.toObject = function toObject(message, options) { - if (!options) options = {}; - var object$1 = {}; - if (options.arrays || options.defaults) object$1.attributes = []; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.timeUnixNano = options.longs === String ? "0" : 0; - object$1.severityNumber = options.enums === String ? "SEVERITY_NUMBER_UNSPECIFIED" : 0; - object$1.severityText = ""; - object$1.body = null; - object$1.droppedAttributesCount = 0; - object$1.flags = 0; - if (options.bytes === String) object$1.traceId = ""; - else { - object$1.traceId = []; - if (options.bytes !== Array) object$1.traceId = $util.newBuffer(object$1.traceId); - } - if (options.bytes === String) object$1.spanId = ""; - else { - object$1.spanId = []; - if (options.bytes !== Array) object$1.spanId = $util.newBuffer(object$1.spanId); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object$1.observedTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else object$1.observedTimeUnixNano = options.longs === String ? "0" : 0; - object$1.eventName = ""; - } - if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object$1.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; - else object$1.timeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.timeUnixNano) : options.longs === Number ? new $util.LongBits(message.timeUnixNano.low >>> 0, message.timeUnixNano.high >>> 0).toNumber() : message.timeUnixNano; - if (message.severityNumber != null && message.hasOwnProperty("severityNumber")) object$1.severityNumber = options.enums === String ? $root.opentelemetry.proto.logs.v1.SeverityNumber[message.severityNumber] === void 0 ? message.severityNumber : $root.opentelemetry.proto.logs.v1.SeverityNumber[message.severityNumber] : message.severityNumber; - if (message.severityText != null && message.hasOwnProperty("severityText")) object$1.severityText = message.severityText; - if (message.body != null && message.hasOwnProperty("body")) object$1.body = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.body, options); - if (message.attributes && message.attributes.length) { - object$1.attributes = []; - for (var j = 0; j < message.attributes.length; ++j) object$1.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); - } - if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object$1.droppedAttributesCount = message.droppedAttributesCount; - if (message.flags != null && message.hasOwnProperty("flags")) object$1.flags = message.flags; - if (message.traceId != null && message.hasOwnProperty("traceId")) object$1.traceId = options.bytes === String ? $util.base64.encode(message.traceId, 0, message.traceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.traceId) : message.traceId; - if (message.spanId != null && message.hasOwnProperty("spanId")) object$1.spanId = options.bytes === String ? $util.base64.encode(message.spanId, 0, message.spanId.length) : options.bytes === Array ? Array.prototype.slice.call(message.spanId) : message.spanId; - if (message.observedTimeUnixNano != null && message.hasOwnProperty("observedTimeUnixNano")) if (typeof message.observedTimeUnixNano === "number") object$1.observedTimeUnixNano = options.longs === String ? String(message.observedTimeUnixNano) : message.observedTimeUnixNano; - else object$1.observedTimeUnixNano = options.longs === String ? $util.Long.prototype.toString.call(message.observedTimeUnixNano) : options.longs === Number ? new $util.LongBits(message.observedTimeUnixNano.low >>> 0, message.observedTimeUnixNano.high >>> 0).toNumber() : message.observedTimeUnixNano; - if (message.eventName != null && message.hasOwnProperty("eventName")) object$1.eventName = message.eventName; - return object$1; - }; - /** - * Converts this LogRecord to JSON. - * @function toJSON - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @instance - * @returns {Object.} JSON object - */ - LogRecord.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - /** - * Gets the default type url for LogRecord - * @function getTypeUrl - * @memberof opentelemetry.proto.logs.v1.LogRecord - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LogRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === void 0) typeUrlPrefix = "type.googleapis.com"; - return typeUrlPrefix + "/opentelemetry.proto.logs.v1.LogRecord"; - }; - return LogRecord; - })(); - return v1; - })(); - return logs; - })(); - return proto; - })(); - return opentelemetry; - })(); - module.exports = $root; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/hex-to-binary.js -var require_hex_to_binary = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hexToBinary = void 0; - function intValue(charCode) { - if (charCode >= 48 && charCode <= 57) return charCode - 48; - if (charCode >= 97 && charCode <= 102) return charCode - 87; - return charCode - 55; - } - function hexToBinary(hexStr) { - const buf = new Uint8Array(hexStr.length / 2); - let offset = 0; - for (let i = 0; i < hexStr.length; i += 2) { - const hi = intValue(hexStr.charCodeAt(i)); - const lo = intValue(hexStr.charCodeAt(i + 1)); - buf[offset++] = hi << 4 | lo; - } - return buf; - } - exports.hexToBinary = hexToBinary; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/utils.js -var require_utils$5 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getOtlpEncoder = exports.encodeAsString = exports.encodeAsLongBits = exports.toLongBits = exports.hrTimeToNanos = void 0; - const core_1 = require_src$8(); - const hex_to_binary_1 = require_hex_to_binary(); - function hrTimeToNanos(hrTime) { - const NANOSECONDS = BigInt(1e9); - return BigInt(hrTime[0]) * NANOSECONDS + BigInt(hrTime[1]); - } - exports.hrTimeToNanos = hrTimeToNanos; - function toLongBits(value) { - return { - low: Number(BigInt.asUintN(32, value)), - high: Number(BigInt.asUintN(32, value >> BigInt(32))) - }; - } - exports.toLongBits = toLongBits; - function encodeAsLongBits(hrTime) { - return toLongBits(hrTimeToNanos(hrTime)); - } - exports.encodeAsLongBits = encodeAsLongBits; - function encodeAsString(hrTime) { - return hrTimeToNanos(hrTime).toString(); - } - exports.encodeAsString = encodeAsString; - const encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : core_1.hrTimeToNanoseconds; - function identity(value) { - return value; - } - function optionalHexToBinary(str) { - if (str === void 0) return void 0; - return (0, hex_to_binary_1.hexToBinary)(str); - } - const DEFAULT_ENCODER = { - encodeHrTime: encodeAsLongBits, - encodeSpanContext: hex_to_binary_1.hexToBinary, - encodeOptionalSpanContext: optionalHexToBinary - }; - function getOtlpEncoder(options) { - if (options === void 0) return DEFAULT_ENCODER; - const useLongBits = options.useLongBits ?? true; - const useHex = options.useHex ?? false; - return { - encodeHrTime: useLongBits ? encodeAsLongBits : encodeTimestamp, - encodeSpanContext: useHex ? identity : hex_to_binary_1.hexToBinary, - encodeOptionalSpanContext: useHex ? identity : optionalHexToBinary - }; - } - exports.getOtlpEncoder = getOtlpEncoder; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/internal.js -var require_internal$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toAnyValue = exports.toKeyValue = exports.toAttributes = exports.createInstrumentationScope = exports.createResource = void 0; - function createResource(resource) { - const result = { - attributes: toAttributes(resource.attributes), - droppedAttributesCount: 0 - }; - const schemaUrl = resource.schemaUrl; - if (schemaUrl && schemaUrl !== "") result.schemaUrl = schemaUrl; - return result; - } - exports.createResource = createResource; - function createInstrumentationScope(scope) { - return { - name: scope.name, - version: scope.version - }; - } - exports.createInstrumentationScope = createInstrumentationScope; - function toAttributes(attributes) { - return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key])); - } - exports.toAttributes = toAttributes; - function toKeyValue(key, value) { - return { - key, - value: toAnyValue(value) - }; - } - exports.toKeyValue = toKeyValue; - function toAnyValue(value) { - const t = typeof value; - if (t === "string") return { stringValue: value }; - if (t === "number") { - if (!Number.isInteger(value)) return { doubleValue: value }; - return { intValue: value }; - } - if (t === "boolean") return { boolValue: value }; - if (value instanceof Uint8Array) return { bytesValue: value }; - if (Array.isArray(value)) return { arrayValue: { values: value.map(toAnyValue) } }; - if (t === "object" && value != null) return { kvlistValue: { values: Object.entries(value).map(([k, v]) => toKeyValue(k, v)) } }; - return {}; - } - exports.toAnyValue = toAnyValue; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/internal.js -var require_internal$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toLogAttributes = exports.createExportLogsServiceRequest = void 0; - const utils_1 = require_utils$5(); - const internal_1 = require_internal$3(); - function createExportLogsServiceRequest(logRecords, options) { - return { resourceLogs: logRecordsToResourceLogs(logRecords, (0, utils_1.getOtlpEncoder)(options)) }; - } - exports.createExportLogsServiceRequest = createExportLogsServiceRequest; - function createResourceMap(logRecords) { - const resourceMap = /* @__PURE__ */ new Map(); - for (const record$1 of logRecords) { - const { resource, instrumentationScope: { name, version: version$1 = "", schemaUrl = "" } } = record$1; - let ismMap = resourceMap.get(resource); - if (!ismMap) { - ismMap = /* @__PURE__ */ new Map(); - resourceMap.set(resource, ismMap); - } - const ismKey = `${name}@${version$1}:${schemaUrl}`; - let records = ismMap.get(ismKey); - if (!records) { - records = []; - ismMap.set(ismKey, records); - } - records.push(record$1); - } - return resourceMap; - } - function logRecordsToResourceLogs(logRecords, encoder) { - const resourceMap = createResourceMap(logRecords); - return Array.from(resourceMap, ([resource, ismMap]) => { - const processedResource = (0, internal_1.createResource)(resource); - return { - resource: processedResource, - scopeLogs: Array.from(ismMap, ([, scopeLogs]) => { - return { - scope: (0, internal_1.createInstrumentationScope)(scopeLogs[0].instrumentationScope), - logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)), - schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl - }; - }), - schemaUrl: processedResource.schemaUrl - }; - }); - } - function toLogRecord(log, encoder) { - return { - timeUnixNano: encoder.encodeHrTime(log.hrTime), - observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved), - severityNumber: toSeverityNumber(log.severityNumber), - severityText: log.severityText, - body: (0, internal_1.toAnyValue)(log.body), - eventName: log.eventName, - attributes: toLogAttributes(log.attributes), - droppedAttributesCount: log.droppedAttributesCount, - flags: log.spanContext?.traceFlags, - traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId), - spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId) - }; - } - function toSeverityNumber(severityNumber) { - return severityNumber; - } - function toLogAttributes(attributes) { - return Object.keys(attributes).map((key) => (0, internal_1.toKeyValue)(key, attributes[key])); - } - exports.toLogAttributes = toLogAttributes; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/logs.js -var require_logs$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufLogsSerializer = void 0; - const root = require_root(); - const internal_1 = require_internal$2(); - const logsResponseType = root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse; - const logsRequestType = root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest; - exports.ProtobufLogsSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportLogsServiceRequest)(arg); - return logsRequestType.encode(request).finish(); - }, - deserializeResponse: (arg) => { - return logsResponseType.decode(arg); - } - }; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/protobuf/index.js -var require_protobuf$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufLogsSerializer = void 0; - var logs_1 = require_logs$1(); - Object.defineProperty(exports, "ProtobufLogsSerializer", { - enumerable: true, - get: function() { - return logs_1.ProtobufLogsSerializer; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationTemporality.js -var require_AggregationTemporality = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AggregationTemporality = void 0; - (function(AggregationTemporality) { - AggregationTemporality[AggregationTemporality["DELTA"] = 0] = "DELTA"; - AggregationTemporality[AggregationTemporality["CUMULATIVE"] = 1] = "CUMULATIVE"; - })(exports.AggregationTemporality || (exports.AggregationTemporality = {})); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricData.js -var require_MetricData = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DataPointType = exports.InstrumentType = void 0; - (function(InstrumentType) { - InstrumentType["COUNTER"] = "COUNTER"; - InstrumentType["GAUGE"] = "GAUGE"; - InstrumentType["HISTOGRAM"] = "HISTOGRAM"; - InstrumentType["UP_DOWN_COUNTER"] = "UP_DOWN_COUNTER"; - InstrumentType["OBSERVABLE_COUNTER"] = "OBSERVABLE_COUNTER"; - InstrumentType["OBSERVABLE_GAUGE"] = "OBSERVABLE_GAUGE"; - InstrumentType["OBSERVABLE_UP_DOWN_COUNTER"] = "OBSERVABLE_UP_DOWN_COUNTER"; - })(exports.InstrumentType || (exports.InstrumentType = {})); - (function(DataPointType) { - /** - * A histogram data point contains a histogram statistics of collected - * values with a list of explicit bucket boundaries and statistics such - * as min, max, count, and sum of all collected values. - */ - DataPointType[DataPointType["HISTOGRAM"] = 0] = "HISTOGRAM"; - /** - * An exponential histogram data point contains a histogram statistics of - * collected values where bucket boundaries are automatically calculated - * using an exponential function, and statistics such as min, max, count, - * and sum of all collected values. - */ - DataPointType[DataPointType["EXPONENTIAL_HISTOGRAM"] = 1] = "EXPONENTIAL_HISTOGRAM"; - /** - * A gauge metric data point has only a single numeric value. - */ - DataPointType[DataPointType["GAUGE"] = 2] = "GAUGE"; - /** - * A sum metric data point has a single numeric value and a - * monotonicity-indicator. - */ - DataPointType[DataPointType["SUM"] = 3] = "SUM"; - })(exports.DataPointType || (exports.DataPointType = {})); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/utils.js -var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.equalsCaseInsensitive = exports.binarySearchUB = exports.setEquals = exports.FlatMap = exports.isPromiseAllSettledRejectionResult = exports.PromiseAllSettled = exports.callWithTimeout = exports.TimeoutError = exports.instrumentationScopeId = exports.hashAttributes = exports.isNotNullish = void 0; - function isNotNullish(item) { - return item !== void 0 && item !== null; - } - exports.isNotNullish = isNotNullish; - /** - * Converting the unordered attributes into unique identifier string. - * @param attributes user provided unordered Attributes. - */ - function hashAttributes(attributes) { - let keys = Object.keys(attributes); - if (keys.length === 0) return ""; - keys = keys.sort(); - return JSON.stringify(keys.map((key) => [key, attributes[key]])); - } - exports.hashAttributes = hashAttributes; - /** - * Converting the instrumentation scope object to a unique identifier string. - * @param instrumentationScope - */ - function instrumentationScopeId(instrumentationScope) { - return `${instrumentationScope.name}:${instrumentationScope.version ?? ""}:${instrumentationScope.schemaUrl ?? ""}`; - } - exports.instrumentationScopeId = instrumentationScopeId; - /** - * Error that is thrown on timeouts. - */ - var TimeoutError = class TimeoutError extends Error { - constructor(message) { - super(message); - Object.setPrototypeOf(this, TimeoutError.prototype); - } - }; - exports.TimeoutError = TimeoutError; - /** - * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise - * rejects, and resolves if the specified promise resolves. - * - *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. - * - * @param promise promise to use with timeout. - * @param timeout the timeout in milliseconds until the returned promise is rejected. - */ - function callWithTimeout(promise, timeout) { - let timeoutHandle; - const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { - timeoutHandle = setTimeout(function timeoutHandler() { - reject(new TimeoutError("Operation timed out.")); - }, timeout); - }); - return Promise.race([promise, timeoutPromise]).then((result) => { - clearTimeout(timeoutHandle); - return result; - }, (reason) => { - clearTimeout(timeoutHandle); - throw reason; - }); - } - exports.callWithTimeout = callWithTimeout; - /** - * Node.js v12.9 lower and browser compatible `Promise.allSettled`. - */ - async function PromiseAllSettled(promises) { - return Promise.all(promises.map(async (p) => { - try { - return { - status: "fulfilled", - value: await p - }; - } catch (e) { - return { - status: "rejected", - reason: e - }; - } - })); - } - exports.PromiseAllSettled = PromiseAllSettled; - function isPromiseAllSettledRejectionResult(it) { - return it.status === "rejected"; - } - exports.isPromiseAllSettledRejectionResult = isPromiseAllSettledRejectionResult; - /** - * Node.js v11.0 lower and browser compatible `Array.prototype.flatMap`. - */ - function FlatMap(arr, fn) { - const result = []; - arr.forEach((it) => { - result.push(...fn(it)); - }); - return result; - } - exports.FlatMap = FlatMap; - function setEquals(lhs, rhs) { - if (lhs.size !== rhs.size) return false; - for (const item of lhs) if (!rhs.has(item)) return false; - return true; - } - exports.setEquals = setEquals; - /** - * Binary search the sorted array to the find upper bound for the value. - * @param arr - * @param value - * @returns - */ - function binarySearchUB(arr, value) { - let lo = 0; - let hi = arr.length - 1; - let ret = arr.length; - while (hi >= lo) { - const mid = lo + Math.trunc((hi - lo) / 2); - if (arr[mid] < value) lo = mid + 1; - else { - ret = mid; - hi = mid - 1; - } - } - return ret; - } - exports.binarySearchUB = binarySearchUB; - function equalsCaseInsensitive(lhs, rhs) { - return lhs.toLowerCase() === rhs.toLowerCase(); - } - exports.equalsCaseInsensitive = equalsCaseInsensitive; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/types.js -var require_types$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AggregatorKind = void 0; - (function(AggregatorKind) { - AggregatorKind[AggregatorKind["DROP"] = 0] = "DROP"; - AggregatorKind[AggregatorKind["SUM"] = 1] = "SUM"; - AggregatorKind[AggregatorKind["LAST_VALUE"] = 2] = "LAST_VALUE"; - AggregatorKind[AggregatorKind["HISTOGRAM"] = 3] = "HISTOGRAM"; - AggregatorKind[AggregatorKind["EXPONENTIAL_HISTOGRAM"] = 4] = "EXPONENTIAL_HISTOGRAM"; - })(exports.AggregatorKind || (exports.AggregatorKind = {})); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Drop.js -var require_Drop = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DropAggregator = void 0; - const types_1 = require_types$1(); - /** Basic aggregator for None which keeps no recorded value. */ - var DropAggregator = class { - kind = types_1.AggregatorKind.DROP; - createAccumulation() {} - merge(_previous, _delta) {} - diff(_previous, _current) {} - toMetricData(_descriptor, _aggregationTemporality, _accumulationByAttributes, _endTime) {} - }; - exports.DropAggregator = DropAggregator; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Histogram.js -var require_Histogram = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.HistogramAggregator = exports.HistogramAccumulation = void 0; - const types_1 = require_types$1(); - const MetricData_1 = require_MetricData(); - const utils_1 = require_utils$4(); - function createNewEmptyCheckpoint(boundaries) { - const counts = boundaries.map(() => 0); - counts.push(0); - return { - buckets: { - boundaries, - counts - }, - sum: 0, - count: 0, - hasMinMax: false, - min: Infinity, - max: -Infinity - }; - } - var HistogramAccumulation = class { - startTime; - _boundaries; - _recordMinMax; - _current; - constructor(startTime, _boundaries, _recordMinMax = true, _current = createNewEmptyCheckpoint(_boundaries)) { - this.startTime = startTime; - this._boundaries = _boundaries; - this._recordMinMax = _recordMinMax; - this._current = _current; - } - record(value) { - if (Number.isNaN(value)) return; - this._current.count += 1; - this._current.sum += value; - if (this._recordMinMax) { - this._current.min = Math.min(value, this._current.min); - this._current.max = Math.max(value, this._current.max); - this._current.hasMinMax = true; - } - const idx = (0, utils_1.binarySearchUB)(this._boundaries, value); - this._current.buckets.counts[idx] += 1; - } - setStartTime(startTime) { - this.startTime = startTime; - } - toPointValue() { - return this._current; - } - }; - exports.HistogramAccumulation = HistogramAccumulation; - /** - * Basic aggregator which observes events and counts them in pre-defined buckets - * and provides the total sum and count of all observations. - */ - var HistogramAggregator = class { - _boundaries; - _recordMinMax; - kind = types_1.AggregatorKind.HISTOGRAM; - /** - * @param _boundaries sorted upper bounds of recorded values. - * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. - */ - constructor(_boundaries, _recordMinMax) { - this._boundaries = _boundaries; - this._recordMinMax = _recordMinMax; - } - createAccumulation(startTime) { - return new HistogramAccumulation(startTime, this._boundaries, this._recordMinMax); - } - /** - * Return the result of the merge of two histogram accumulations. As long as one Aggregator - * instance produces all Accumulations with constant boundaries we don't need to worry about - * merging accumulations with different boundaries. - */ - merge(previous, delta) { - const previousValue = previous.toPointValue(); - const deltaValue = delta.toPointValue(); - const previousCounts = previousValue.buckets.counts; - const deltaCounts = deltaValue.buckets.counts; - const mergedCounts = new Array(previousCounts.length); - for (let idx = 0; idx < previousCounts.length; idx++) mergedCounts[idx] = previousCounts[idx] + deltaCounts[idx]; - let min = Infinity; - let max = -Infinity; - if (this._recordMinMax) { - if (previousValue.hasMinMax && deltaValue.hasMinMax) { - min = Math.min(previousValue.min, deltaValue.min); - max = Math.max(previousValue.max, deltaValue.max); - } else if (previousValue.hasMinMax) { - min = previousValue.min; - max = previousValue.max; - } else if (deltaValue.hasMinMax) { - min = deltaValue.min; - max = deltaValue.max; - } - } - return new HistogramAccumulation(previous.startTime, previousValue.buckets.boundaries, this._recordMinMax, { - buckets: { - boundaries: previousValue.buckets.boundaries, - counts: mergedCounts - }, - count: previousValue.count + deltaValue.count, - sum: previousValue.sum + deltaValue.sum, - hasMinMax: this._recordMinMax && (previousValue.hasMinMax || deltaValue.hasMinMax), - min, - max - }); - } - /** - * Returns a new DELTA aggregation by comparing two cumulative measurements. - */ - diff(previous, current) { - const previousValue = previous.toPointValue(); - const currentValue = current.toPointValue(); - const previousCounts = previousValue.buckets.counts; - const currentCounts = currentValue.buckets.counts; - const diffedCounts = new Array(previousCounts.length); - for (let idx = 0; idx < previousCounts.length; idx++) diffedCounts[idx] = currentCounts[idx] - previousCounts[idx]; - return new HistogramAccumulation(current.startTime, previousValue.buckets.boundaries, this._recordMinMax, { - buckets: { - boundaries: previousValue.buckets.boundaries, - counts: diffedCounts - }, - count: currentValue.count - previousValue.count, - sum: currentValue.sum - previousValue.sum, - hasMinMax: false, - min: Infinity, - max: -Infinity - }); - } - toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { - return { - descriptor, - aggregationTemporality, - dataPointType: MetricData_1.DataPointType.HISTOGRAM, - dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { - const pointValue = accumulation.toPointValue(); - const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; - return { - attributes, - startTime: accumulation.startTime, - endTime, - value: { - min: pointValue.hasMinMax ? pointValue.min : void 0, - max: pointValue.hasMinMax ? pointValue.max : void 0, - sum: !allowsNegativeValues ? pointValue.sum : void 0, - buckets: pointValue.buckets, - count: pointValue.count - } - }; - }) - }; - } - }; - exports.HistogramAggregator = HistogramAggregator; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/Buckets.js -var require_Buckets = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Buckets = void 0; - var Buckets = class Buckets { - backing; - indexBase; - indexStart; - indexEnd; - /** - * The term index refers to the number of the exponential histogram bucket - * used to determine its boundaries. The lower boundary of a bucket is - * determined by base ** index and the upper boundary of a bucket is - * determined by base ** (index + 1). index values are signed to account - * for values less than or equal to 1. - * - * indexBase is the index of the 0th position in the - * backing array, i.e., backing[0] is the count - * in the bucket with index `indexBase`. - * - * indexStart is the smallest index value represented - * in the backing array. - * - * indexEnd is the largest index value represented in - * the backing array. - */ - constructor(backing = new BucketsBacking(), indexBase = 0, indexStart = 0, indexEnd = 0) { - this.backing = backing; - this.indexBase = indexBase; - this.indexStart = indexStart; - this.indexEnd = indexEnd; - } - /** - * Offset is the bucket index of the smallest entry in the counts array - * @returns {number} - */ - get offset() { - return this.indexStart; - } - /** - * Buckets is a view into the backing array. - * @returns {number} - */ - get length() { - if (this.backing.length === 0) return 0; - if (this.indexEnd === this.indexStart && this.at(0) === 0) return 0; - return this.indexEnd - this.indexStart + 1; - } - /** - * An array of counts, where count[i] carries the count - * of the bucket at index (offset+i). count[i] is the count of - * values greater than base^(offset+i) and less than or equal to - * base^(offset+i+1). - * @returns {number} The logical counts based on the backing array - */ - counts() { - return Array.from({ length: this.length }, (_, i) => this.at(i)); - } - /** - * At returns the count of the bucket at a position in the logical - * array of counts. - * @param position - * @returns {number} - */ - at(position) { - const bias = this.indexBase - this.indexStart; - if (position < bias) position += this.backing.length; - position -= bias; - return this.backing.countAt(position); - } - /** - * incrementBucket increments the backing array index by `increment` - * @param bucketIndex - * @param increment - */ - incrementBucket(bucketIndex, increment) { - this.backing.increment(bucketIndex, increment); - } - /** - * decrementBucket decrements the backing array index by `decrement` - * if decrement is greater than the current value, it's set to 0. - * @param bucketIndex - * @param decrement - */ - decrementBucket(bucketIndex, decrement) { - this.backing.decrement(bucketIndex, decrement); - } - /** - * trim removes leading and / or trailing zero buckets (which can occur - * after diffing two histos) and rotates the backing array so that the - * smallest non-zero index is in the 0th position of the backing array - */ - trim() { - for (let i = 0; i < this.length; i++) if (this.at(i) !== 0) { - this.indexStart += i; - break; - } else if (i === this.length - 1) { - this.indexStart = this.indexEnd = this.indexBase = 0; - return; - } - for (let i = this.length - 1; i >= 0; i--) if (this.at(i) !== 0) { - this.indexEnd -= this.length - i - 1; - break; - } - this._rotate(); - } - /** - * downscale first rotates, then collapses 2**`by`-to-1 buckets. - * @param by - */ - downscale(by) { - this._rotate(); - const size = 1 + this.indexEnd - this.indexStart; - const each = 1 << by; - let inpos = 0; - let outpos = 0; - for (let pos = this.indexStart; pos <= this.indexEnd;) { - let mod = pos % each; - if (mod < 0) mod += each; - for (let i = mod; i < each && inpos < size; i++) { - this._relocateBucket(outpos, inpos); - inpos++; - pos++; - } - outpos++; - } - this.indexStart >>= by; - this.indexEnd >>= by; - this.indexBase = this.indexStart; - } - /** - * Clone returns a deep copy of Buckets - * @returns {Buckets} - */ - clone() { - return new Buckets(this.backing.clone(), this.indexBase, this.indexStart, this.indexEnd); - } - /** - * _rotate shifts the backing array contents so that indexStart == - * indexBase to simplify the downscale logic. - */ - _rotate() { - const bias = this.indexBase - this.indexStart; - if (bias === 0) return; - else if (bias > 0) { - this.backing.reverse(0, this.backing.length); - this.backing.reverse(0, bias); - this.backing.reverse(bias, this.backing.length); - } else { - this.backing.reverse(0, this.backing.length); - this.backing.reverse(0, this.backing.length + bias); - } - this.indexBase = this.indexStart; - } - /** - * _relocateBucket adds the count in counts[src] to counts[dest] and - * resets count[src] to zero. - */ - _relocateBucket(dest, src) { - if (dest === src) return; - this.incrementBucket(dest, this.backing.emptyBucket(src)); - } - }; - exports.Buckets = Buckets; - /** - * BucketsBacking holds the raw buckets and some utility methods to - * manage them. - */ - var BucketsBacking = class BucketsBacking { - _counts; - constructor(_counts = [0]) { - this._counts = _counts; - } - /** - * length returns the physical size of the backing array, which - * is >= buckets.length() - */ - get length() { - return this._counts.length; - } - /** - * countAt returns the count in a specific bucket - */ - countAt(pos) { - return this._counts[pos]; - } - /** - * growTo grows a backing array and copies old entries - * into their correct new positions. - */ - growTo(newSize, oldPositiveLimit, newPositiveLimit) { - const tmp = new Array(newSize).fill(0); - tmp.splice(newPositiveLimit, this._counts.length - oldPositiveLimit, ...this._counts.slice(oldPositiveLimit)); - tmp.splice(0, oldPositiveLimit, ...this._counts.slice(0, oldPositiveLimit)); - this._counts = tmp; - } - /** - * reverse the items in the backing array in the range [from, limit). - */ - reverse(from, limit) { - const num = Math.floor((from + limit) / 2) - from; - for (let i = 0; i < num; i++) { - const tmp = this._counts[from + i]; - this._counts[from + i] = this._counts[limit - i - 1]; - this._counts[limit - i - 1] = tmp; - } - } - /** - * emptyBucket empties the count from a bucket, for - * moving into another. - */ - emptyBucket(src) { - const tmp = this._counts[src]; - this._counts[src] = 0; - return tmp; - } - /** - * increments a bucket by `increment` - */ - increment(bucketIndex, increment) { - this._counts[bucketIndex] += increment; - } - /** - * decrements a bucket by `decrement` - */ - decrement(bucketIndex, decrement) { - if (this._counts[bucketIndex] >= decrement) this._counts[bucketIndex] -= decrement; - else this._counts[bucketIndex] = 0; - } - /** - * clone returns a deep copy of BucketsBacking - */ - clone() { - return new BucketsBacking([...this._counts]); - } - }; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ieee754.js -var require_ieee754 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSignificand = exports.getNormalBase2 = exports.MIN_VALUE = exports.MAX_NORMAL_EXPONENT = exports.MIN_NORMAL_EXPONENT = exports.SIGNIFICAND_WIDTH = void 0; - /** - * The functions and constants in this file allow us to interact - * with the internal representation of an IEEE 64-bit floating point - * number. We need to work with all 64-bits, thus, care needs to be - * taken when working with Javascript's bitwise operators (<<, >>, &, - * |, etc) as they truncate operands to 32-bits. In order to work around - * this we work with the 64-bits as two 32-bit halves, perform bitwise - * operations on them independently, and combine the results (if needed). - */ - exports.SIGNIFICAND_WIDTH = 52; - /** - * EXPONENT_MASK is set to 1 for the hi 32-bits of an IEEE 754 - * floating point exponent: 0x7ff00000. - */ - const EXPONENT_MASK = 2146435072; - /** - * SIGNIFICAND_MASK is the mask for the significand portion of the hi 32-bits - * of an IEEE 754 double-precision floating-point value: 0xfffff - */ - const SIGNIFICAND_MASK = 1048575; - /** - * EXPONENT_BIAS is the exponent bias specified for encoding - * the IEEE 754 double-precision floating point exponent: 1023 - */ - const EXPONENT_BIAS = 1023; - /** - * MIN_NORMAL_EXPONENT is the minimum exponent of a normalized - * floating point: -1022. - */ - exports.MIN_NORMAL_EXPONENT = -EXPONENT_BIAS + 1; - /** - * MAX_NORMAL_EXPONENT is the maximum exponent of a normalized - * floating point: 1023. - */ - exports.MAX_NORMAL_EXPONENT = EXPONENT_BIAS; - /** - * MIN_VALUE is the smallest normal number - */ - exports.MIN_VALUE = Math.pow(2, -1022); - /** - * getNormalBase2 extracts the normalized base-2 fractional exponent. - * This returns k for the equation f x 2**k where f is - * in the range [1, 2). Note that this function is not called for - * subnormal numbers. - * @param {number} value - the value to determine normalized base-2 fractional - * exponent for - * @returns {number} the normalized base-2 exponent - */ - function getNormalBase2(value) { - const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8)); - dv.setFloat64(0, value); - return ((dv.getUint32(0) & EXPONENT_MASK) >> 20) - EXPONENT_BIAS; - } - exports.getNormalBase2 = getNormalBase2; - /** - * GetSignificand returns the 52 bit (unsigned) significand as a signed value. - * @param {number} value - the floating point number to extract the significand from - * @returns {number} The 52-bit significand - */ - function getSignificand(value) { - const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8)); - dv.setFloat64(0, value); - const hiBits = dv.getUint32(0); - const loBits = dv.getUint32(4); - return (hiBits & SIGNIFICAND_MASK) * Math.pow(2, 32) + loBits; - } - exports.getSignificand = getSignificand; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/util.js -var require_util = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.nextGreaterSquare = exports.ldexp = void 0; - /** - * Note: other languages provide this as a built in function. This is - * a naive, but functionally correct implementation. This is used sparingly, - * when creating a new mapping in a running application. - * - * ldexp returns frac × 2**exp. With the following special cases: - * ldexp(±0, exp) = ±0 - * ldexp(±Inf, exp) = ±Inf - * ldexp(NaN, exp) = NaN - * @param frac - * @param exp - * @returns {number} - */ - function ldexp(frac, exp) { - if (frac === 0 || frac === Number.POSITIVE_INFINITY || frac === Number.NEGATIVE_INFINITY || Number.isNaN(frac)) return frac; - return frac * Math.pow(2, exp); - } - exports.ldexp = ldexp; - /** - * Computes the next power of two that is greater than or equal to v. - * This implementation more efficient than, but functionally equivalent - * to Math.pow(2, Math.ceil(Math.log(x)/Math.log(2))). - * @param v - * @returns {number} - */ - function nextGreaterSquare(v) { - v--; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - v++; - return v; - } - exports.nextGreaterSquare = nextGreaterSquare; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/types.js -var require_types = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MappingError = void 0; - var MappingError = class extends Error {}; - exports.MappingError = MappingError; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/ExponentMapping.js -var require_ExponentMapping = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExponentMapping = void 0; - const ieee754 = require_ieee754(); - const util = require_util(); - const types_1 = require_types(); - /** - * ExponentMapping implements exponential mapping functions for - * scales <=0. For scales > 0 LogarithmMapping should be used. - */ - var ExponentMapping = class { - _shift; - constructor(scale) { - this._shift = -scale; - } - /** - * Maps positive floating point values to indexes corresponding to scale - * @param value - * @returns {number} index for provided value at the current scale - */ - mapToIndex(value) { - if (value < ieee754.MIN_VALUE) return this._minNormalLowerBoundaryIndex(); - return ieee754.getNormalBase2(value) + this._rightShift(ieee754.getSignificand(value) - 1, ieee754.SIGNIFICAND_WIDTH) >> this._shift; - } - /** - * Returns the lower bucket boundary for the given index for scale - * - * @param index - * @returns {number} - */ - lowerBoundary(index) { - const minIndex = this._minNormalLowerBoundaryIndex(); - if (index < minIndex) throw new types_1.MappingError(`underflow: ${index} is < minimum lower boundary: ${minIndex}`); - const maxIndex = this._maxNormalLowerBoundaryIndex(); - if (index > maxIndex) throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); - return util.ldexp(1, index << this._shift); - } - /** - * The scale used by this mapping - * @returns {number} - */ - get scale() { - if (this._shift === 0) return 0; - return -this._shift; - } - _minNormalLowerBoundaryIndex() { - let index = ieee754.MIN_NORMAL_EXPONENT >> this._shift; - if (this._shift < 2) index--; - return index; - } - _maxNormalLowerBoundaryIndex() { - return ieee754.MAX_NORMAL_EXPONENT >> this._shift; - } - _rightShift(value, shift) { - return Math.floor(value * Math.pow(2, -shift)); - } - }; - exports.ExponentMapping = ExponentMapping; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/LogarithmMapping.js -var require_LogarithmMapping = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.LogarithmMapping = void 0; - const ieee754 = require_ieee754(); - const util = require_util(); - const types_1 = require_types(); - /** - * LogarithmMapping implements exponential mapping functions for scale > 0. - * For scales <= 0 the exponent mapping should be used. - */ - var LogarithmMapping = class { - _scale; - _scaleFactor; - _inverseFactor; - constructor(scale) { - this._scale = scale; - this._scaleFactor = util.ldexp(Math.LOG2E, scale); - this._inverseFactor = util.ldexp(Math.LN2, -scale); - } - /** - * Maps positive floating point values to indexes corresponding to scale - * @param value - * @returns {number} index for provided value at the current scale - */ - mapToIndex(value) { - if (value <= ieee754.MIN_VALUE) return this._minNormalLowerBoundaryIndex() - 1; - if (ieee754.getSignificand(value) === 0) return (ieee754.getNormalBase2(value) << this._scale) - 1; - const index = Math.floor(Math.log(value) * this._scaleFactor); - const maxIndex = this._maxNormalLowerBoundaryIndex(); - if (index >= maxIndex) return maxIndex; - return index; - } - /** - * Returns the lower bucket boundary for the given index for scale - * - * @param index - * @returns {number} - */ - lowerBoundary(index) { - const maxIndex = this._maxNormalLowerBoundaryIndex(); - if (index >= maxIndex) { - if (index === maxIndex) return 2 * Math.exp((index - (1 << this._scale)) / this._scaleFactor); - throw new types_1.MappingError(`overflow: ${index} is > maximum lower boundary: ${maxIndex}`); - } - const minIndex = this._minNormalLowerBoundaryIndex(); - if (index <= minIndex) { - if (index === minIndex) return ieee754.MIN_VALUE; - else if (index === minIndex - 1) return Math.exp((index + (1 << this._scale)) / this._scaleFactor) / 2; - throw new types_1.MappingError(`overflow: ${index} is < minimum lower boundary: ${minIndex}`); - } - return Math.exp(index * this._inverseFactor); - } - /** - * The scale used by this mapping - * @returns {number} - */ - get scale() { - return this._scale; - } - _minNormalLowerBoundaryIndex() { - return ieee754.MIN_NORMAL_EXPONENT << this._scale; - } - _maxNormalLowerBoundaryIndex() { - return (ieee754.MAX_NORMAL_EXPONENT + 1 << this._scale) - 1; - } - }; - exports.LogarithmMapping = LogarithmMapping; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/exponential-histogram/mapping/getMapping.js -var require_getMapping = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMapping = void 0; - const ExponentMapping_1 = require_ExponentMapping(); - const LogarithmMapping_1 = require_LogarithmMapping(); - const types_1 = require_types(); - const MIN_SCALE = -10; - const MAX_SCALE = 20; - const PREBUILT_MAPPINGS = Array.from({ length: 31 }, (_, i) => { - if (i > 10) return new LogarithmMapping_1.LogarithmMapping(i - 10); - return new ExponentMapping_1.ExponentMapping(i - 10); - }); - /** - * getMapping returns an appropriate mapping for the given scale. For scales -10 - * to 0 the underlying type will be ExponentMapping. For scales 1 to 20 the - * underlying type will be LogarithmMapping. - * @param scale a number in the range [-10, 20] - * @returns {Mapping} - */ - function getMapping(scale) { - if (scale > MAX_SCALE || scale < MIN_SCALE) throw new types_1.MappingError(`expected scale >= ${MIN_SCALE} && <= ${MAX_SCALE}, got: ${scale}`); - return PREBUILT_MAPPINGS[scale + 10]; - } - exports.getMapping = getMapping; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/ExponentialHistogram.js -var require_ExponentialHistogram = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = void 0; - const types_1 = require_types$1(); - const MetricData_1 = require_MetricData(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const Buckets_1 = require_Buckets(); - const getMapping_1 = require_getMapping(); - const util_1 = require_util(); - var HighLow = class HighLow { - low; - high; - static combine(h1, h2) { - return new HighLow(Math.min(h1.low, h2.low), Math.max(h1.high, h2.high)); - } - constructor(low, high) { - this.low = low; - this.high = high; - } - }; - const MAX_SCALE = 20; - const DEFAULT_MAX_SIZE = 160; - const MIN_MAX_SIZE = 2; - var ExponentialHistogramAccumulation = class ExponentialHistogramAccumulation { - startTime; - _maxSize; - _recordMinMax; - _sum; - _count; - _zeroCount; - _min; - _max; - _positive; - _negative; - _mapping; - constructor(startTime, _maxSize = DEFAULT_MAX_SIZE, _recordMinMax = true, _sum = 0, _count = 0, _zeroCount = 0, _min = Number.POSITIVE_INFINITY, _max = Number.NEGATIVE_INFINITY, _positive = new Buckets_1.Buckets(), _negative = new Buckets_1.Buckets(), _mapping = (0, getMapping_1.getMapping)(MAX_SCALE)) { - this.startTime = startTime; - this._maxSize = _maxSize; - this._recordMinMax = _recordMinMax; - this._sum = _sum; - this._count = _count; - this._zeroCount = _zeroCount; - this._min = _min; - this._max = _max; - this._positive = _positive; - this._negative = _negative; - this._mapping = _mapping; - if (this._maxSize < MIN_MAX_SIZE) { - api_1.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, \ - changing to the minimum size of: ${MIN_MAX_SIZE}`); - this._maxSize = MIN_MAX_SIZE; - } - } - /** - * record updates a histogram with a single count - * @param {Number} value - */ - record(value) { - this.updateByIncrement(value, 1); - } - /** - * Sets the start time for this accumulation - * @param {HrTime} startTime - */ - setStartTime(startTime) { - this.startTime = startTime; - } - /** - * Returns the datapoint representation of this accumulation - * @param {HrTime} startTime - */ - toPointValue() { - return { - hasMinMax: this._recordMinMax, - min: this.min, - max: this.max, - sum: this.sum, - positive: { - offset: this.positive.offset, - bucketCounts: this.positive.counts() - }, - negative: { - offset: this.negative.offset, - bucketCounts: this.negative.counts() - }, - count: this.count, - scale: this.scale, - zeroCount: this.zeroCount - }; - } - /** - * @returns {Number} The sum of values recorded by this accumulation - */ - get sum() { - return this._sum; - } - /** - * @returns {Number} The minimum value recorded by this accumulation - */ - get min() { - return this._min; - } - /** - * @returns {Number} The maximum value recorded by this accumulation - */ - get max() { - return this._max; - } - /** - * @returns {Number} The count of values recorded by this accumulation - */ - get count() { - return this._count; - } - /** - * @returns {Number} The number of 0 values recorded by this accumulation - */ - get zeroCount() { - return this._zeroCount; - } - /** - * @returns {Number} The scale used by this accumulation - */ - get scale() { - if (this._count === this._zeroCount) return 0; - return this._mapping.scale; - } - /** - * positive holds the positive values - * @returns {Buckets} - */ - get positive() { - return this._positive; - } - /** - * negative holds the negative values by their absolute value - * @returns {Buckets} - */ - get negative() { - return this._negative; - } - /** - * updateByIncr supports updating a histogram with a non-negative - * increment. - * @param value - * @param increment - */ - updateByIncrement(value, increment) { - if (Number.isNaN(value)) return; - if (value > this._max) this._max = value; - if (value < this._min) this._min = value; - this._count += increment; - if (value === 0) { - this._zeroCount += increment; - return; - } - this._sum += value * increment; - if (value > 0) this._updateBuckets(this._positive, value, increment); - else this._updateBuckets(this._negative, -value, increment); - } - /** - * merge combines data from previous value into self - * @param {ExponentialHistogramAccumulation} previous - */ - merge(previous) { - if (this._count === 0) { - this._min = previous.min; - this._max = previous.max; - } else if (previous.count !== 0) { - if (previous.min < this.min) this._min = previous.min; - if (previous.max > this.max) this._max = previous.max; - } - this.startTime = previous.startTime; - this._sum += previous.sum; - this._count += previous.count; - this._zeroCount += previous.zeroCount; - const minScale = this._minScale(previous); - this._downscale(this.scale - minScale); - this._mergeBuckets(this.positive, previous, previous.positive, minScale); - this._mergeBuckets(this.negative, previous, previous.negative, minScale); - } - /** - * diff subtracts other from self - * @param {ExponentialHistogramAccumulation} other - */ - diff(other) { - this._min = Infinity; - this._max = -Infinity; - this._sum -= other.sum; - this._count -= other.count; - this._zeroCount -= other.zeroCount; - const minScale = this._minScale(other); - this._downscale(this.scale - minScale); - this._diffBuckets(this.positive, other, other.positive, minScale); - this._diffBuckets(this.negative, other, other.negative, minScale); - } - /** - * clone returns a deep copy of self - * @returns {ExponentialHistogramAccumulation} - */ - clone() { - return new ExponentialHistogramAccumulation(this.startTime, this._maxSize, this._recordMinMax, this._sum, this._count, this._zeroCount, this._min, this._max, this.positive.clone(), this.negative.clone(), this._mapping); - } - /** - * _updateBuckets maps the incoming value to a bucket index for the current - * scale. If the bucket index is outside of the range of the backing array, - * it will rescale the backing array and update the mapping for the new scale. - */ - _updateBuckets(buckets, value, increment) { - let index = this._mapping.mapToIndex(value); - let rescalingNeeded = false; - let high = 0; - let low = 0; - if (buckets.length === 0) { - buckets.indexStart = index; - buckets.indexEnd = buckets.indexStart; - buckets.indexBase = buckets.indexStart; - } else if (index < buckets.indexStart && buckets.indexEnd - index >= this._maxSize) { - rescalingNeeded = true; - low = index; - high = buckets.indexEnd; - } else if (index > buckets.indexEnd && index - buckets.indexStart >= this._maxSize) { - rescalingNeeded = true; - low = buckets.indexStart; - high = index; - } - if (rescalingNeeded) { - const change = this._changeScale(high, low); - this._downscale(change); - index = this._mapping.mapToIndex(value); - } - this._incrementIndexBy(buckets, index, increment); - } - /** - * _incrementIndexBy increments the count of the bucket specified by `index`. - * If the index is outside of the range [buckets.indexStart, buckets.indexEnd] - * the boundaries of the backing array will be adjusted and more buckets will - * be added if needed. - */ - _incrementIndexBy(buckets, index, increment) { - if (increment === 0) return; - if (buckets.length === 0) buckets.indexStart = buckets.indexEnd = buckets.indexBase = index; - if (index < buckets.indexStart) { - const span = buckets.indexEnd - index; - if (span >= buckets.backing.length) this._grow(buckets, span + 1); - buckets.indexStart = index; - } else if (index > buckets.indexEnd) { - const span = index - buckets.indexStart; - if (span >= buckets.backing.length) this._grow(buckets, span + 1); - buckets.indexEnd = index; - } - let bucketIndex = index - buckets.indexBase; - if (bucketIndex < 0) bucketIndex += buckets.backing.length; - buckets.incrementBucket(bucketIndex, increment); - } - /** - * grow resizes the backing array by doubling in size up to maxSize. - * This extends the array with a bunch of zeros and copies the - * existing counts to the same position. - */ - _grow(buckets, needed) { - const size = buckets.backing.length; - const bias = buckets.indexBase - buckets.indexStart; - const oldPositiveLimit = size - bias; - let newSize = (0, util_1.nextGreaterSquare)(needed); - if (newSize > this._maxSize) newSize = this._maxSize; - const newPositiveLimit = newSize - bias; - buckets.backing.growTo(newSize, oldPositiveLimit, newPositiveLimit); - } - /** - * _changeScale computes how much downscaling is needed by shifting the - * high and low values until they are separated by no more than size. - */ - _changeScale(high, low) { - let change = 0; - while (high - low >= this._maxSize) { - high >>= 1; - low >>= 1; - change++; - } - return change; - } - /** - * _downscale subtracts `change` from the current mapping scale. - */ - _downscale(change) { - if (change === 0) return; - if (change < 0) throw new Error(`impossible change of scale: ${this.scale}`); - const newScale = this._mapping.scale - change; - this._positive.downscale(change); - this._negative.downscale(change); - this._mapping = (0, getMapping_1.getMapping)(newScale); - } - /** - * _minScale is used by diff and merge to compute an ideal combined scale - */ - _minScale(other) { - const minScale = Math.min(this.scale, other.scale); - const highLowPos = HighLow.combine(this._highLowAtScale(this.positive, this.scale, minScale), this._highLowAtScale(other.positive, other.scale, minScale)); - const highLowNeg = HighLow.combine(this._highLowAtScale(this.negative, this.scale, minScale), this._highLowAtScale(other.negative, other.scale, minScale)); - return Math.min(minScale - this._changeScale(highLowPos.high, highLowPos.low), minScale - this._changeScale(highLowNeg.high, highLowNeg.low)); - } - /** - * _highLowAtScale is used by diff and merge to compute an ideal combined scale. - */ - _highLowAtScale(buckets, currentScale, newScale) { - if (buckets.length === 0) return new HighLow(0, -1); - const shift = currentScale - newScale; - return new HighLow(buckets.indexStart >> shift, buckets.indexEnd >> shift); - } - /** - * _mergeBuckets translates index values from another histogram and - * adds the values into the corresponding buckets of this histogram. - */ - _mergeBuckets(ours, other, theirs, scale) { - const theirOffset = theirs.offset; - const theirChange = other.scale - scale; - for (let i = 0; i < theirs.length; i++) this._incrementIndexBy(ours, theirOffset + i >> theirChange, theirs.at(i)); - } - /** - * _diffBuckets translates index values from another histogram and - * subtracts the values in the corresponding buckets of this histogram. - */ - _diffBuckets(ours, other, theirs, scale) { - const theirOffset = theirs.offset; - const theirChange = other.scale - scale; - for (let i = 0; i < theirs.length; i++) { - let bucketIndex = (theirOffset + i >> theirChange) - ours.indexBase; - if (bucketIndex < 0) bucketIndex += ours.backing.length; - ours.decrementBucket(bucketIndex, theirs.at(i)); - } - ours.trim(); - } - }; - exports.ExponentialHistogramAccumulation = ExponentialHistogramAccumulation; - /** - * Aggregator for ExponentialHistogramAccumulations - */ - var ExponentialHistogramAggregator = class { - _maxSize; - _recordMinMax; - kind = types_1.AggregatorKind.EXPONENTIAL_HISTOGRAM; - /** - * @param _maxSize Maximum number of buckets for each of the positive - * and negative ranges, exclusive of the zero-bucket. - * @param _recordMinMax If set to true, min and max will be recorded. - * Otherwise, min and max will not be recorded. - */ - constructor(_maxSize, _recordMinMax) { - this._maxSize = _maxSize; - this._recordMinMax = _recordMinMax; - } - createAccumulation(startTime) { - return new ExponentialHistogramAccumulation(startTime, this._maxSize, this._recordMinMax); - } - /** - * Return the result of the merge of two exponential histogram accumulations. - */ - merge(previous, delta) { - const result = delta.clone(); - result.merge(previous); - return result; - } - /** - * Returns a new DELTA aggregation by comparing two cumulative measurements. - */ - diff(previous, current) { - const result = current.clone(); - result.diff(previous); - return result; - } - toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { - return { - descriptor, - aggregationTemporality, - dataPointType: MetricData_1.DataPointType.EXPONENTIAL_HISTOGRAM, - dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { - const pointValue = accumulation.toPointValue(); - const allowsNegativeValues = descriptor.type === MetricData_1.InstrumentType.GAUGE || descriptor.type === MetricData_1.InstrumentType.UP_DOWN_COUNTER || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_GAUGE || descriptor.type === MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER; - return { - attributes, - startTime: accumulation.startTime, - endTime, - value: { - min: pointValue.hasMinMax ? pointValue.min : void 0, - max: pointValue.hasMinMax ? pointValue.max : void 0, - sum: !allowsNegativeValues ? pointValue.sum : void 0, - positive: { - offset: pointValue.positive.offset, - bucketCounts: pointValue.positive.bucketCounts - }, - negative: { - offset: pointValue.negative.offset, - bucketCounts: pointValue.negative.bucketCounts - }, - count: pointValue.count, - scale: pointValue.scale, - zeroCount: pointValue.zeroCount - } - }; - }) - }; - } - }; - exports.ExponentialHistogramAggregator = ExponentialHistogramAggregator; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/LastValue.js -var require_LastValue = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.LastValueAggregator = exports.LastValueAccumulation = void 0; - const types_1 = require_types$1(); - const core_1 = require_src$8(); - const MetricData_1 = require_MetricData(); - var LastValueAccumulation = class { - startTime; - _current; - sampleTime; - constructor(startTime, _current = 0, sampleTime = [0, 0]) { - this.startTime = startTime; - this._current = _current; - this.sampleTime = sampleTime; - } - record(value) { - this._current = value; - this.sampleTime = (0, core_1.millisToHrTime)(Date.now()); - } - setStartTime(startTime) { - this.startTime = startTime; - } - toPointValue() { - return this._current; - } - }; - exports.LastValueAccumulation = LastValueAccumulation; - /** Basic aggregator which calculates a LastValue from individual measurements. */ - var LastValueAggregator = class { - kind = types_1.AggregatorKind.LAST_VALUE; - createAccumulation(startTime) { - return new LastValueAccumulation(startTime); - } - /** - * Returns the result of the merge of the given accumulations. - * - * Return the newly captured (delta) accumulation for LastValueAggregator. - */ - merge(previous, delta) { - const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(delta.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? delta : previous; - return new LastValueAccumulation(previous.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); - } - /** - * Returns a new DELTA aggregation by comparing two cumulative measurements. - * - * A delta aggregation is not meaningful to LastValueAggregator, just return - * the newly captured (delta) accumulation for LastValueAggregator. - */ - diff(previous, current) { - const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(current.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? current : previous; - return new LastValueAccumulation(current.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); - } - toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { - return { - descriptor, - aggregationTemporality, - dataPointType: MetricData_1.DataPointType.GAUGE, - dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { - return { - attributes, - startTime: accumulation.startTime, - endTime, - value: accumulation.toPointValue() - }; - }) - }; - } - }; - exports.LastValueAggregator = LastValueAggregator; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/Sum.js -var require_Sum = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SumAggregator = exports.SumAccumulation = void 0; - const types_1 = require_types$1(); - const MetricData_1 = require_MetricData(); - var SumAccumulation = class { - startTime; - monotonic; - _current; - reset; - constructor(startTime, monotonic, _current = 0, reset = false) { - this.startTime = startTime; - this.monotonic = monotonic; - this._current = _current; - this.reset = reset; - } - record(value) { - if (this.monotonic && value < 0) return; - this._current += value; - } - setStartTime(startTime) { - this.startTime = startTime; - } - toPointValue() { - return this._current; - } - }; - exports.SumAccumulation = SumAccumulation; - /** Basic aggregator which calculates a Sum from individual measurements. */ - var SumAggregator = class { - monotonic; - kind = types_1.AggregatorKind.SUM; - constructor(monotonic) { - this.monotonic = monotonic; - } - createAccumulation(startTime) { - return new SumAccumulation(startTime, this.monotonic); - } - /** - * Returns the result of the merge of the given accumulations. - */ - merge(previous, delta) { - const prevPv = previous.toPointValue(); - const deltaPv = delta.toPointValue(); - if (delta.reset) return new SumAccumulation(delta.startTime, this.monotonic, deltaPv, delta.reset); - return new SumAccumulation(previous.startTime, this.monotonic, prevPv + deltaPv); - } - /** - * Returns a new DELTA aggregation by comparing two cumulative measurements. - */ - diff(previous, current) { - const prevPv = previous.toPointValue(); - const currPv = current.toPointValue(); - /** - * If the SumAggregator is a monotonic one and the previous point value is - * greater than the current one, a reset is deemed to be happened. - * Return the current point value to prevent the value from been reset. - */ - if (this.monotonic && prevPv > currPv) return new SumAccumulation(current.startTime, this.monotonic, currPv, true); - return new SumAccumulation(current.startTime, this.monotonic, currPv - prevPv); - } - toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { - return { - descriptor, - aggregationTemporality, - dataPointType: MetricData_1.DataPointType.SUM, - dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { - return { - attributes, - startTime: accumulation.startTime, - endTime, - value: accumulation.toPointValue() - }; - }), - isMonotonic: this.monotonic - }; - } - }; - exports.SumAggregator = SumAggregator; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/aggregator/index.js -var require_aggregator = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SumAggregator = exports.SumAccumulation = exports.LastValueAggregator = exports.LastValueAccumulation = exports.ExponentialHistogramAggregator = exports.ExponentialHistogramAccumulation = exports.HistogramAggregator = exports.HistogramAccumulation = exports.DropAggregator = void 0; - var Drop_1 = require_Drop(); - Object.defineProperty(exports, "DropAggregator", { - enumerable: true, - get: function() { - return Drop_1.DropAggregator; - } - }); - var Histogram_1 = require_Histogram(); - Object.defineProperty(exports, "HistogramAccumulation", { - enumerable: true, - get: function() { - return Histogram_1.HistogramAccumulation; - } - }); - Object.defineProperty(exports, "HistogramAggregator", { - enumerable: true, - get: function() { - return Histogram_1.HistogramAggregator; - } - }); - var ExponentialHistogram_1 = require_ExponentialHistogram(); - Object.defineProperty(exports, "ExponentialHistogramAccumulation", { - enumerable: true, - get: function() { - return ExponentialHistogram_1.ExponentialHistogramAccumulation; - } - }); - Object.defineProperty(exports, "ExponentialHistogramAggregator", { - enumerable: true, - get: function() { - return ExponentialHistogram_1.ExponentialHistogramAggregator; - } - }); - var LastValue_1 = require_LastValue(); - Object.defineProperty(exports, "LastValueAccumulation", { - enumerable: true, - get: function() { - return LastValue_1.LastValueAccumulation; - } - }); - Object.defineProperty(exports, "LastValueAggregator", { - enumerable: true, - get: function() { - return LastValue_1.LastValueAggregator; - } - }); - var Sum_1 = require_Sum(); - Object.defineProperty(exports, "SumAccumulation", { - enumerable: true, - get: function() { - return Sum_1.SumAccumulation; - } - }); - Object.defineProperty(exports, "SumAggregator", { - enumerable: true, - get: function() { - return Sum_1.SumAggregator; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/Aggregation.js -var require_Aggregation = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DEFAULT_AGGREGATION = exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = exports.HISTOGRAM_AGGREGATION = exports.LAST_VALUE_AGGREGATION = exports.SUM_AGGREGATION = exports.DROP_AGGREGATION = exports.DefaultAggregation = exports.ExponentialHistogramAggregation = exports.ExplicitBucketHistogramAggregation = exports.HistogramAggregation = exports.LastValueAggregation = exports.SumAggregation = exports.DropAggregation = void 0; - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const aggregator_1 = require_aggregator(); - const MetricData_1 = require_MetricData(); - /** - * The default drop aggregation. - */ - var DropAggregation = class DropAggregation { - static DEFAULT_INSTANCE = new aggregator_1.DropAggregator(); - createAggregator(_instrument) { - return DropAggregation.DEFAULT_INSTANCE; - } - }; - exports.DropAggregation = DropAggregation; - /** - * The default sum aggregation. - */ - var SumAggregation = class SumAggregation { - static MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(true); - static NON_MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(false); - createAggregator(instrument) { - switch (instrument.type) { - case MetricData_1.InstrumentType.COUNTER: - case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: - case MetricData_1.InstrumentType.HISTOGRAM: return SumAggregation.MONOTONIC_INSTANCE; - default: return SumAggregation.NON_MONOTONIC_INSTANCE; - } - } - }; - exports.SumAggregation = SumAggregation; - /** - * The default last value aggregation. - */ - var LastValueAggregation = class LastValueAggregation { - static DEFAULT_INSTANCE = new aggregator_1.LastValueAggregator(); - createAggregator(_instrument) { - return LastValueAggregation.DEFAULT_INSTANCE; - } - }; - exports.LastValueAggregation = LastValueAggregation; - /** - * The default histogram aggregation. - - */ - var HistogramAggregation = class HistogramAggregation { - static DEFAULT_INSTANCE = new aggregator_1.HistogramAggregator([ - 0, - 5, - 10, - 25, - 50, - 75, - 100, - 250, - 500, - 750, - 1e3, - 2500, - 5e3, - 7500, - 1e4 - ], true); - createAggregator(_instrument) { - return HistogramAggregation.DEFAULT_INSTANCE; - } - }; - exports.HistogramAggregation = HistogramAggregation; - /** - * The explicit bucket histogram aggregation. - */ - var ExplicitBucketHistogramAggregation = class { - _recordMinMax; - _boundaries; - /** - * @param boundaries the bucket boundaries of the histogram aggregation - * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. - */ - constructor(boundaries, _recordMinMax = true) { - this._recordMinMax = _recordMinMax; - if (boundaries == null) throw new Error("ExplicitBucketHistogramAggregation should be created with explicit boundaries, if a single bucket histogram is required, please pass an empty array"); - boundaries = boundaries.concat(); - boundaries = boundaries.sort((a, b) => a - b); - const minusInfinityIndex = boundaries.lastIndexOf(-Infinity); - let infinityIndex = boundaries.indexOf(Infinity); - if (infinityIndex === -1) infinityIndex = void 0; - this._boundaries = boundaries.slice(minusInfinityIndex + 1, infinityIndex); - } - createAggregator(_instrument) { - return new aggregator_1.HistogramAggregator(this._boundaries, this._recordMinMax); - } - }; - exports.ExplicitBucketHistogramAggregation = ExplicitBucketHistogramAggregation; - var ExponentialHistogramAggregation = class { - _maxSize; - _recordMinMax; - constructor(_maxSize = 160, _recordMinMax = true) { - this._maxSize = _maxSize; - this._recordMinMax = _recordMinMax; - } - createAggregator(_instrument) { - return new aggregator_1.ExponentialHistogramAggregator(this._maxSize, this._recordMinMax); - } - }; - exports.ExponentialHistogramAggregation = ExponentialHistogramAggregation; - /** - * The default aggregation. - */ - var DefaultAggregation = class { - _resolve(instrument) { - switch (instrument.type) { - case MetricData_1.InstrumentType.COUNTER: - case MetricData_1.InstrumentType.UP_DOWN_COUNTER: - case MetricData_1.InstrumentType.OBSERVABLE_COUNTER: - case MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: return exports.SUM_AGGREGATION; - case MetricData_1.InstrumentType.GAUGE: - case MetricData_1.InstrumentType.OBSERVABLE_GAUGE: return exports.LAST_VALUE_AGGREGATION; - case MetricData_1.InstrumentType.HISTOGRAM: - if (instrument.advice.explicitBucketBoundaries) return new ExplicitBucketHistogramAggregation(instrument.advice.explicitBucketBoundaries); - return exports.HISTOGRAM_AGGREGATION; - } - api.diag.warn(`Unable to recognize instrument type: ${instrument.type}`); - return exports.DROP_AGGREGATION; - } - createAggregator(instrument) { - return this._resolve(instrument).createAggregator(instrument); - } - }; - exports.DefaultAggregation = DefaultAggregation; - exports.DROP_AGGREGATION = new DropAggregation(); - exports.SUM_AGGREGATION = new SumAggregation(); - exports.LAST_VALUE_AGGREGATION = new LastValueAggregation(); - exports.HISTOGRAM_AGGREGATION = new HistogramAggregation(); - exports.EXPONENTIAL_HISTOGRAM_AGGREGATION = new ExponentialHistogramAggregation(); - exports.DEFAULT_AGGREGATION = new DefaultAggregation(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/AggregationOption.js -var require_AggregationOption = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.toAggregation = exports.AggregationType = void 0; - const Aggregation_1 = require_Aggregation(); - var AggregationType; - (function(AggregationType) { - AggregationType[AggregationType["DEFAULT"] = 0] = "DEFAULT"; - AggregationType[AggregationType["DROP"] = 1] = "DROP"; - AggregationType[AggregationType["SUM"] = 2] = "SUM"; - AggregationType[AggregationType["LAST_VALUE"] = 3] = "LAST_VALUE"; - AggregationType[AggregationType["EXPLICIT_BUCKET_HISTOGRAM"] = 4] = "EXPLICIT_BUCKET_HISTOGRAM"; - AggregationType[AggregationType["EXPONENTIAL_HISTOGRAM"] = 5] = "EXPONENTIAL_HISTOGRAM"; - })(AggregationType = exports.AggregationType || (exports.AggregationType = {})); - function toAggregation(option) { - switch (option.type) { - case AggregationType.DEFAULT: return Aggregation_1.DEFAULT_AGGREGATION; - case AggregationType.DROP: return Aggregation_1.DROP_AGGREGATION; - case AggregationType.SUM: return Aggregation_1.SUM_AGGREGATION; - case AggregationType.LAST_VALUE: return Aggregation_1.LAST_VALUE_AGGREGATION; - case AggregationType.EXPONENTIAL_HISTOGRAM: { - const expOption = option; - return new Aggregation_1.ExponentialHistogramAggregation(expOption.options?.maxSize, expOption.options?.recordMinMax); - } - case AggregationType.EXPLICIT_BUCKET_HISTOGRAM: { - const expOption = option; - if (expOption.options == null) return Aggregation_1.HISTOGRAM_AGGREGATION; - else return new Aggregation_1.ExplicitBucketHistogramAggregation(expOption.options?.boundaries, expOption.options?.recordMinMax); - } - default: throw new Error("Unsupported Aggregation"); - } - } - exports.toAggregation = toAggregation; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/AggregationSelector.js -var require_AggregationSelector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = exports.DEFAULT_AGGREGATION_SELECTOR = void 0; - const AggregationTemporality_1 = require_AggregationTemporality(); - const AggregationOption_1 = require_AggregationOption(); - const DEFAULT_AGGREGATION_SELECTOR = (_instrumentType) => { - return { type: AggregationOption_1.AggregationType.DEFAULT }; - }; - exports.DEFAULT_AGGREGATION_SELECTOR = DEFAULT_AGGREGATION_SELECTOR; - const DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = (_instrumentType) => AggregationTemporality_1.AggregationTemporality.CUMULATIVE; - exports.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR = DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/MetricReader.js -var require_MetricReader = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MetricReader = void 0; - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const utils_1 = require_utils$4(); - const AggregationSelector_1 = require_AggregationSelector(); - /** - * A registered reader of metrics that, when linked to a {@link MetricProducer}, offers global - * control over metrics. - */ - var MetricReader = class { - _shutdown = false; - _metricProducers; - _sdkMetricProducer; - _aggregationTemporalitySelector; - _aggregationSelector; - _cardinalitySelector; - constructor(options) { - this._aggregationSelector = options?.aggregationSelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_SELECTOR; - this._aggregationTemporalitySelector = options?.aggregationTemporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; - this._metricProducers = options?.metricProducers ?? []; - this._cardinalitySelector = options?.cardinalitySelector; - } - setMetricProducer(metricProducer) { - if (this._sdkMetricProducer) throw new Error("MetricReader can not be bound to a MeterProvider again."); - this._sdkMetricProducer = metricProducer; - this.onInitialized(); - } - selectAggregation(instrumentType) { - return this._aggregationSelector(instrumentType); - } - selectAggregationTemporality(instrumentType) { - return this._aggregationTemporalitySelector(instrumentType); - } - selectCardinalityLimit(instrumentType) { - return this._cardinalitySelector ? this._cardinalitySelector(instrumentType) : 2e3; - } - /** - * Handle once the SDK has initialized this {@link MetricReader} - * Overriding this method is optional. - */ - onInitialized() {} - async collect(options) { - if (this._sdkMetricProducer === void 0) throw new Error("MetricReader is not bound to a MetricProducer"); - if (this._shutdown) throw new Error("MetricReader is shutdown"); - const [sdkCollectionResults, ...additionalCollectionResults] = await Promise.all([this._sdkMetricProducer.collect({ timeoutMillis: options?.timeoutMillis }), ...this._metricProducers.map((producer) => producer.collect({ timeoutMillis: options?.timeoutMillis }))]); - const errors = sdkCollectionResults.errors.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result) => result.errors)); - return { - resourceMetrics: { - resource: sdkCollectionResults.resourceMetrics.resource, - scopeMetrics: sdkCollectionResults.resourceMetrics.scopeMetrics.concat((0, utils_1.FlatMap)(additionalCollectionResults, (result) => result.resourceMetrics.scopeMetrics)) - }, - errors - }; - } - async shutdown(options) { - if (this._shutdown) { - api.diag.error("Cannot call shutdown twice."); - return; - } - if (options?.timeoutMillis == null) await this.onShutdown(); - else await (0, utils_1.callWithTimeout)(this.onShutdown(), options.timeoutMillis); - this._shutdown = true; - } - async forceFlush(options) { - if (this._shutdown) { - api.diag.warn("Cannot forceFlush on already shutdown MetricReader."); - return; - } - if (options?.timeoutMillis == null) { - await this.onForceFlush(); - return; - } - await (0, utils_1.callWithTimeout)(this.onForceFlush(), options.timeoutMillis); - } - }; - exports.MetricReader = MetricReader; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/PeriodicExportingMetricReader.js -var require_PeriodicExportingMetricReader = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.PeriodicExportingMetricReader = void 0; - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$8(); - const MetricReader_1 = require_MetricReader(); - const utils_1 = require_utils$4(); - /** - * {@link MetricReader} which collects metrics based on a user-configurable time interval, and passes the metrics to - * the configured {@link PushMetricExporter} - */ - var PeriodicExportingMetricReader = class extends MetricReader_1.MetricReader { - _interval; - _exporter; - _exportInterval; - _exportTimeout; - constructor(options) { - super({ - aggregationSelector: options.exporter.selectAggregation?.bind(options.exporter), - aggregationTemporalitySelector: options.exporter.selectAggregationTemporality?.bind(options.exporter), - metricProducers: options.metricProducers - }); - if (options.exportIntervalMillis !== void 0 && options.exportIntervalMillis <= 0) throw Error("exportIntervalMillis must be greater than 0"); - if (options.exportTimeoutMillis !== void 0 && options.exportTimeoutMillis <= 0) throw Error("exportTimeoutMillis must be greater than 0"); - if (options.exportTimeoutMillis !== void 0 && options.exportIntervalMillis !== void 0 && options.exportIntervalMillis < options.exportTimeoutMillis) throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis"); - this._exportInterval = options.exportIntervalMillis ?? 6e4; - this._exportTimeout = options.exportTimeoutMillis ?? 3e4; - this._exporter = options.exporter; - } - async _runOnce() { - try { - await (0, utils_1.callWithTimeout)(this._doRun(), this._exportTimeout); - } catch (err) { - if (err instanceof utils_1.TimeoutError) { - api.diag.error("Export took longer than %s milliseconds and timed out.", this._exportTimeout); - return; - } - (0, core_1.globalErrorHandler)(err); - } - } - async _doRun() { - const { resourceMetrics, errors } = await this.collect({ timeoutMillis: this._exportTimeout }); - if (errors.length > 0) api.diag.error("PeriodicExportingMetricReader: metrics collection errors", ...errors); - if (resourceMetrics.resource.asyncAttributesPending) try { - await resourceMetrics.resource.waitForAsyncAttributes?.(); - } catch (e) { - api.diag.debug("Error while resolving async portion of resource: ", e); - (0, core_1.globalErrorHandler)(e); - } - if (resourceMetrics.scopeMetrics.length === 0) return; - const result = await core_1.internal._export(this._exporter, resourceMetrics); - if (result.code !== core_1.ExportResultCode.SUCCESS) throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${result.error})`); - } - onInitialized() { - this._interval = setInterval(() => { - this._runOnce(); - }, this._exportInterval); - (0, core_1.unrefTimer)(this._interval); - } - async onForceFlush() { - await this._runOnce(); - await this._exporter.forceFlush(); - } - async onShutdown() { - if (this._interval) clearInterval(this._interval); - await this.onForceFlush(); - await this._exporter.shutdown(); - } - }; - exports.PeriodicExportingMetricReader = PeriodicExportingMetricReader; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/InMemoryMetricExporter.js -var require_InMemoryMetricExporter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.InMemoryMetricExporter = void 0; - const core_1 = require_src$8(); - /** - * In-memory Metrics Exporter is a Push Metric Exporter - * which accumulates metrics data in the local memory and - * allows to inspect it (useful for e.g. unit tests). - */ - var InMemoryMetricExporter = class { - _shutdown = false; - _aggregationTemporality; - _metrics = []; - constructor(aggregationTemporality) { - this._aggregationTemporality = aggregationTemporality; - } - /** - * @inheritedDoc - */ - export(metrics$1, resultCallback) { - if (this._shutdown) { - setTimeout(() => resultCallback({ code: core_1.ExportResultCode.FAILED }), 0); - return; - } - this._metrics.push(metrics$1); - setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); - } - /** - * Returns all the collected resource metrics - * @returns ResourceMetrics[] - */ - getMetrics() { - return this._metrics; - } - forceFlush() { - return Promise.resolve(); - } - reset() { - this._metrics = []; - } - selectAggregationTemporality(_instrumentType) { - return this._aggregationTemporality; - } - shutdown() { - this._shutdown = true; - return Promise.resolve(); - } - }; - exports.InMemoryMetricExporter = InMemoryMetricExporter; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/export/ConsoleMetricExporter.js -var require_ConsoleMetricExporter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ConsoleMetricExporter = void 0; - const core_1 = require_src$8(); - const AggregationSelector_1 = require_AggregationSelector(); - /** - * This is an implementation of {@link PushMetricExporter} that prints metrics to the - * console. This class can be used for diagnostic purposes. - * - * NOTE: This {@link PushMetricExporter} is intended for diagnostics use only, output rendered to the console may change at any time. - */ - var ConsoleMetricExporter = class ConsoleMetricExporter { - _shutdown = false; - _temporalitySelector; - constructor(options) { - this._temporalitySelector = options?.temporalitySelector ?? AggregationSelector_1.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR; - } - export(metrics$1, resultCallback) { - if (this._shutdown) { - setImmediate(resultCallback, { code: core_1.ExportResultCode.FAILED }); - return; - } - return ConsoleMetricExporter._sendMetrics(metrics$1, resultCallback); - } - forceFlush() { - return Promise.resolve(); - } - selectAggregationTemporality(_instrumentType) { - return this._temporalitySelector(_instrumentType); - } - shutdown() { - this._shutdown = true; - return Promise.resolve(); - } - static _sendMetrics(metrics$1, done) { - for (const scopeMetrics of metrics$1.scopeMetrics) for (const metric of scopeMetrics.metrics) console.dir({ - descriptor: metric.descriptor, - dataPointType: metric.dataPointType, - dataPoints: metric.dataPoints - }, { depth: null }); - done({ code: core_1.ExportResultCode.SUCCESS }); - } - }; - exports.ConsoleMetricExporter = ConsoleMetricExporter; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js -var require_default_service_name$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = void 0; - function defaultServiceName() { - return `unknown_service:${process.argv0}`; - } - exports.defaultServiceName = defaultServiceName; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/node/index.js -var require_node$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = void 0; - var default_service_name_1 = require_default_service_name$1(); - Object.defineProperty(exports, "defaultServiceName", { - enumerable: true, - get: function() { - return default_service_name_1.defaultServiceName; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/platform/index.js -var require_platform$4 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = void 0; - var node_1 = require_node$4(); - Object.defineProperty(exports, "defaultServiceName", { - enumerable: true, - get: function() { - return node_1.defaultServiceName; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/utils.js -var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.identity = exports.isPromiseLike = void 0; - const isPromiseLike = (val) => { - return val !== null && typeof val === "object" && typeof val.then === "function"; - }; - exports.isPromiseLike = isPromiseLike; - function identity(_) { - return _; - } - exports.identity = identity; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js -var require_ResourceImpl$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$8(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const platform_1 = require_platform$4(); - const utils_1 = require_utils$3(); - var ResourceImpl = class ResourceImpl { - _rawAttributes; - _asyncAttributesPending = false; - _schemaUrl; - _memoizedAttributes; - static FromAttributeList(attributes, options) { - const res = new ResourceImpl({}, options); - res._rawAttributes = guardedRawAttributes(attributes); - res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; - return res; - } - constructor(resource, options) { - const attributes = resource.attributes ?? {}; - this._rawAttributes = Object.entries(attributes).map(([k, v]) => { - if ((0, utils_1.isPromiseLike)(v)) this._asyncAttributesPending = true; - return [k, v]; - }); - this._rawAttributes = guardedRawAttributes(this._rawAttributes); - this._schemaUrl = validateSchemaUrl(options?.schemaUrl); - } - get asyncAttributesPending() { - return this._asyncAttributesPending; - } - async waitForAsyncAttributes() { - if (!this.asyncAttributesPending) return; - for (let i = 0; i < this._rawAttributes.length; i++) { - const [k, v] = this._rawAttributes[i]; - this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; - } - this._asyncAttributesPending = false; - } - get attributes() { - if (this.asyncAttributesPending) api_1.diag.error("Accessing resource attributes before async attributes settled"); - if (this._memoizedAttributes) return this._memoizedAttributes; - const attrs = {}; - for (const [k, v] of this._rawAttributes) { - if ((0, utils_1.isPromiseLike)(v)) { - api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); - continue; - } - if (v != null) attrs[k] ??= v; - } - if (!this._asyncAttributesPending) this._memoizedAttributes = attrs; - return attrs; - } - getRawAttributes() { - return this._rawAttributes; - } - get schemaUrl() { - return this._schemaUrl; - } - merge(resource) { - if (resource == null) return this; - const mergedSchemaUrl = mergeSchemaUrl(this, resource); - const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : void 0; - return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); - } - }; - function resourceFromAttributes(attributes, options) { - return ResourceImpl.FromAttributeList(Object.entries(attributes), options); - } - exports.resourceFromAttributes = resourceFromAttributes; - function resourceFromDetectedResource(detectedResource, options) { - return new ResourceImpl(detectedResource, options); - } - exports.resourceFromDetectedResource = resourceFromDetectedResource; - function emptyResource() { - return resourceFromAttributes({}); - } - exports.emptyResource = emptyResource; - function defaultResource() { - return resourceFromAttributes({ - [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, platform_1.defaultServiceName)(), - [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], - [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], - [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] - }); - } - exports.defaultResource = defaultResource; - function guardedRawAttributes(attributes) { - return attributes.map(([k, v]) => { - if ((0, utils_1.isPromiseLike)(v)) return [k, v.catch((err) => { - api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); - })]; - return [k, v]; - }); - } - function validateSchemaUrl(schemaUrl) { - if (typeof schemaUrl === "string" || schemaUrl === void 0) return schemaUrl; - api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); - } - function mergeSchemaUrl(old, updating) { - const oldSchemaUrl = old?.schemaUrl; - const updatingSchemaUrl = updating?.schemaUrl; - const isOldEmpty = oldSchemaUrl === void 0 || oldSchemaUrl === ""; - const isUpdatingEmpty = updatingSchemaUrl === void 0 || updatingSchemaUrl === ""; - if (isOldEmpty) return updatingSchemaUrl; - if (isUpdatingEmpty) return oldSchemaUrl; - if (oldSchemaUrl === updatingSchemaUrl) return oldSchemaUrl; - api_1.diag.warn("Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.", oldSchemaUrl, updatingSchemaUrl); - } -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detect-resources.js -var require_detect_resources$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.detectResources = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const ResourceImpl_1 = require_ResourceImpl$1(); - /** - * Runs all resource detectors and returns the results merged into a single Resource. - * - * @param config Configuration for resource detection - */ - const detectResources = (config$1 = {}) => { - return (config$1.detectors || []).map((d) => { - try { - const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config$1)); - api_1.diag.debug(`${d.constructor.name} found resource.`, resource); - return resource; - } catch (e) { - api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); - return (0, ResourceImpl_1.emptyResource)(); - } - }).reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); - }; - exports.detectResources = detectResources; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js -var require_EnvDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.envDetector = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const core_1 = require_src$8(); - /** - * EnvDetector can be used to detect the presence of and create a Resource - * from the OTEL_RESOURCE_ATTRIBUTES environment variable. - */ - var EnvDetector = class { - _MAX_LENGTH = 255; - _COMMA_SEPARATOR = ","; - _LABEL_KEY_VALUE_SPLITTER = "="; - _ERROR_MESSAGE_INVALID_CHARS = "should be a ASCII string with a length greater than 0 and not exceed " + this._MAX_LENGTH + " characters."; - _ERROR_MESSAGE_INVALID_VALUE = "should be a ASCII string with a length not exceed " + this._MAX_LENGTH + " characters."; - /** - * Returns a {@link Resource} populated with attributes from the - * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async - * function to conform to the Detector interface. - * - * @param config The resource detection config - */ - detect(_config) { - const attributes = {}; - const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); - const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); - if (rawAttributes) try { - const parsedAttributes = this._parseResourceAttributes(rawAttributes); - Object.assign(attributes, parsedAttributes); - } catch (e) { - api_1.diag.debug(`EnvDetector failed: ${e.message}`); - } - if (serviceName) attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; - return { attributes }; - } - /** - * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment - * variable. - * - * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing - * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and - * paths are accepted as attribute keys. Values may be quoted or unquoted in - * general. If a value contains whitespace, =, or " characters, it must - * always be quoted. - * - * @param rawEnvAttributes The resource attributes as a comma-separated list - * of key/value pairs. - * @returns The sanitized resource attributes. - */ - _parseResourceAttributes(rawEnvAttributes) { - if (!rawEnvAttributes) return {}; - const attributes = {}; - const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); - for (const rawAttribute of rawAttributes) { - const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); - if (keyValuePair.length !== 2) continue; - let [key, value] = keyValuePair; - key = key.trim(); - value = value.trim().split(/^"|"$/).join(""); - if (!this._isValidAndNotEmpty(key)) throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); - if (!this._isValid(value)) throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); - attributes[key] = decodeURIComponent(value); - } - return attributes; - } - /** - * Determines whether the given String is a valid printable ASCII string with - * a length not exceed _MAX_LENGTH characters. - * - * @param str The String to be validated. - * @returns Whether the String is valid. - */ - _isValid(name) { - return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); - } - _isBaggageOctetString(str) { - for (let i = 0; i < str.length; i++) { - const ch = str.charCodeAt(i); - if (ch < 33 || ch === 44 || ch === 59 || ch === 92 || ch > 126) return false; - } - return true; - } - /** - * Determines whether the given String is a valid printable ASCII string with - * a length greater than 0 and not exceed _MAX_LENGTH characters. - * - * @param str The String to be validated. - * @returns Whether the String is valid and not empty. - */ - _isValidAndNotEmpty(str) { - return str.length > 0 && this._isValid(str); - } - }; - exports.envDetector = new EnvDetector(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/semconv.js -var require_semconv$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0; - /** - * The cloud account ID the resource is assigned to. - * - * @example 111111111111 - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; - /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * @example us-east-1c - * - * @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; - /** - * Name of the cloud provider. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; - /** - * The geographical region the resource is running. - * - * @example us-central1 - * @example us-east-1 - * - * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_REGION = "cloud.region"; - /** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. - * - * @example a3bf90e006b2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_ID = "container.id"; - /** - * Name of the image the container was built on. - * - * @example gcr.io/opentelemetry/operator - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; - /** - * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. - * - * @example ["v1.27.1", "3.5.7-0"] - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; - /** - * Container name used by container runtime. - * - * @example opentelemetry-autoconf - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_NAME = "container.name"; - /** - * The CPU architecture the host system is running on. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_ARCH = "host.arch"; - /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. - * - * @example fdbf79e8af94cb7f9e8df36789187052 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_ID = "host.id"; - /** - * VM image ID or host OS image ID. For Cloud, this value is from the provider. - * - * @example ami-07b06b442921831e5 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_ID = "host.image.id"; - /** - * Name of the VM image or OS install the host was instantiated from. - * - * @example infra-ami-eks-worker-node-7d4ec78312 - * @example CentOS-8-x86_64-1905 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; - /** - * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - * - * @example 0.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; - /** - * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. - * - * @example opentelemetry-test - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_NAME = "host.name"; - /** - * Type of host. For Cloud, this must be the machine type. - * - * @example n1-standard-1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_TYPE = "host.type"; - /** - * The name of the cluster. - * - * @example opentelemetry-cluster - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; - /** - * The name of the Deployment. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; - /** - * The name of the namespace that the pod is running in. - * - * @example default - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; - /** - * The name of the Pod. - * - * @example opentelemetry-pod-autoconf - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; - /** - * The operating system type. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OS_TYPE = "os.type"; - /** - * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - * - * @example 14.2.1 - * @example 18.04.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OS_VERSION = "os.version"; - /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. - * - * @example cmd/otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_COMMAND = "process.command"; - /** - * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - * - * @example ["cmd/otecol", "--config=config.yaml"] - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; - /** - * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`. - * - * @example otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; - /** - * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - * - * @example /usr/bin/cmd/otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; - /** - * The username of the user that owns the process. - * - * @example root - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_OWNER = "process.owner"; - /** - * Process identifier (PID). - * - * @example 1234 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_PID = "process.pid"; - /** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - * - * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; - /** - * The name of the runtime of this process. - * - * @example OpenJDK Runtime Environment - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; - /** - * The version of the runtime of this process, as returned by the runtime without modification. - * - * @example "14.0.2" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; - /** - * The string ID of the service instance. - * - * @example 627cc493-f310-47de-96bd-71410b7dec09 - * - * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words - * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to - * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled - * service). - * - * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC - * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of - * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and - * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. - * - * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is - * needed. Similar to what can be seen in the man page for the - * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying - * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it - * or not via another resource attribute. - * - * For applications running behind an application server (like unicorn), we do not recommend using one identifier - * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker - * thread in unicorn) to have its own instance.id. - * - * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the - * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will - * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. - * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance - * for that telemetry. This is typically the case for scraping receivers, as they know the target address and - * port. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; - /** - * A namespace for `service.name`. - * - * @example Shop - * - * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; - /** - * Additional description of the web engine (e.g. detailed version and edition information). - * - * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; - /** - * The name of the web engine. - * - * @example WildFly - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_NAME = "webengine.name"; - /** - * The version of the web engine. - * - * @example 21.0.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_WEBENGINE_VERSION = "webengine.version"; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js -var require_execAsync$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.execAsync = void 0; - const child_process$1 = __require("child_process"); - const util$1 = __require("util"); - exports.execAsync = util$1.promisify(child_process$1.exec); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js -var require_getMachineId_darwin$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const execAsync_1 = require_execAsync$1(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - try { - const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID")); - if (!idLine) return; - const parts = idLine.split("\" = \""); - if (parts.length === 2) return parts[1].slice(0, -1); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js -var require_getMachineId_linux$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const fs_1$3 = __require("fs"); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - for (const path$1 of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try { - return (await fs_1$3.promises.readFile(path$1, { encoding: "utf8" })).trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js -var require_getMachineId_bsd$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const fs_1$2 = __require("fs"); - const execAsync_1 = require_execAsync$1(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - try { - return (await fs_1$2.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - try { - return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js -var require_getMachineId_win$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const process$4 = __require("process"); - const execAsync_1 = require_execAsync$1(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; - let command = "%windir%\\System32\\REG.exe"; - if (process$4.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process$4.env) command = "%windir%\\sysnative\\cmd.exe /c " + command; - try { - const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ"); - if (parts.length === 2) return parts[1].trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js -var require_getMachineId_unsupported$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - api_1.diag.debug("could not read machine-id: unsupported platform"); - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js -var require_getMachineId$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const process$3 = __require("process"); - let getMachineIdImpl; - async function getMachineId() { - if (!getMachineIdImpl) switch (process$3.platform) { - case "darwin": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_darwin$1()))).getMachineId; - break; - case "linux": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_linux$1()))).getMachineId; - break; - case "freebsd": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_bsd$1()))).getMachineId; - break; - case "win32": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_win$1()))).getMachineId; - break; - default: - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_unsupported$1()))).getMachineId; - break; - } - return getMachineIdImpl(); - } - exports.getMachineId = getMachineId; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js -var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeType = exports.normalizeArch = void 0; - const normalizeArch = (nodeArchString) => { - switch (nodeArchString) { - case "arm": return "arm32"; - case "ppc": return "ppc32"; - case "x64": return "amd64"; - default: return nodeArchString; - } - }; - exports.normalizeArch = normalizeArch; - const normalizeType = (nodePlatform) => { - switch (nodePlatform) { - case "sunos": return "solaris"; - case "win32": return "windows"; - default: return nodePlatform; - } - }; - exports.normalizeType = normalizeType; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js -var require_HostDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hostDetector = void 0; - const semconv_1 = require_semconv$2(); - const os_1$3 = __require("os"); - const getMachineId_1 = require_getMachineId$1(); - const utils_1 = require_utils$2(); - /** - * HostDetector detects the resources related to the host current process is - * running on. Currently only non-cloud-based attributes are included. - */ - var HostDetector = class { - detect(_config) { - return { attributes: { - [semconv_1.ATTR_HOST_NAME]: (0, os_1$3.hostname)(), - [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1$3.arch)()), - [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() - } }; - } - }; - exports.hostDetector = new HostDetector(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js -var require_OSDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.osDetector = void 0; - const semconv_1 = require_semconv$2(); - const os_1$2 = __require("os"); - const utils_1 = require_utils$2(); - /** - * OSDetector detects the resources related to the operating system (OS) on - * which the process represented by this resource is running. - */ - var OSDetector = class { - detect(_config) { - return { attributes: { - [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1$2.platform)()), - [semconv_1.ATTR_OS_VERSION]: (0, os_1$2.release)() - } }; - } - }; - exports.osDetector = new OSDetector(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js -var require_ProcessDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.processDetector = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const semconv_1 = require_semconv$2(); - const os$1 = __require("os"); - /** - * ProcessDetector will be used to detect the resources related current process running - * and being instrumented from the NodeJS Process module. - */ - var ProcessDetector = class { - detect(_config) { - const attributes = { - [semconv_1.ATTR_PROCESS_PID]: process.pid, - [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, - [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, - [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ - process.argv[0], - ...process.execArgv, - ...process.argv.slice(1) - ], - [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, - [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", - [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" - }; - if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; - try { - const userInfo = os$1.userInfo(); - attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; - } catch (e) { - api_1.diag.debug(`error obtaining process owner: ${e}`); - } - return { attributes }; - } - }; - exports.processDetector = new ProcessDetector(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js -var require_ServiceInstanceIdDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = void 0; - const semconv_1 = require_semconv$2(); - const crypto_1$1 = __require("crypto"); - /** - * ServiceInstanceIdDetector detects the resources related to the service instance ID. - */ - var ServiceInstanceIdDetector = class { - detect(_config) { - return { attributes: { [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1$1.randomUUID)() } }; - } - }; - /** - * @experimental - */ - exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js -var require_node$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; - var HostDetector_1 = require_HostDetector$1(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return HostDetector_1.hostDetector; - } - }); - var OSDetector_1 = require_OSDetector$1(); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return OSDetector_1.osDetector; - } - }); - var ProcessDetector_1 = require_ProcessDetector$1(); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return ProcessDetector_1.processDetector; - } - }); - var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector$1(); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js -var require_platform$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; - var node_1 = require_node$3(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return node_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return node_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return node_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return node_1.serviceInstanceIdDetector; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js -var require_NoopDetector$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.noopDetector = exports.NoopDetector = void 0; - var NoopDetector = class { - detect() { - return { attributes: {} }; - } - }; - exports.NoopDetector = NoopDetector; - exports.noopDetector = new NoopDetector(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/index.js -var require_detectors$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = void 0; - var EnvDetector_1 = require_EnvDetector$1(); - Object.defineProperty(exports, "envDetector", { - enumerable: true, - get: function() { - return EnvDetector_1.envDetector; - } - }); - var platform_1 = require_platform$3(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return platform_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return platform_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return platform_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return platform_1.serviceInstanceIdDetector; - } - }); - var NoopDetector_1 = require_NoopDetector$1(); - Object.defineProperty(exports, "noopDetector", { - enumerable: true, - get: function() { - return NoopDetector_1.noopDetector; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/index.js -var require_src$7 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = void 0; - var detect_resources_1 = require_detect_resources$1(); - Object.defineProperty(exports, "detectResources", { - enumerable: true, - get: function() { - return detect_resources_1.detectResources; - } - }); - var detectors_1 = require_detectors$1(); - Object.defineProperty(exports, "envDetector", { - enumerable: true, - get: function() { - return detectors_1.envDetector; - } - }); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return detectors_1.hostDetector; - } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return detectors_1.osDetector; - } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return detectors_1.processDetector; - } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return detectors_1.serviceInstanceIdDetector; - } - }); - var ResourceImpl_1 = require_ResourceImpl$1(); - Object.defineProperty(exports, "resourceFromAttributes", { - enumerable: true, - get: function() { - return ResourceImpl_1.resourceFromAttributes; + exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const default_service_name_1 = require_default_service_name(); + const utils_1 = require_utils$2(); + var ResourceImpl = class ResourceImpl { + _rawAttributes; + _asyncAttributesPending = false; + _schemaUrl; + _memoizedAttributes; + static FromAttributeList(attributes, options) { + const res = new ResourceImpl({}, options); + res._rawAttributes = guardedRawAttributes(attributes); + res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; + return res; } - }); - Object.defineProperty(exports, "defaultResource", { - enumerable: true, - get: function() { - return ResourceImpl_1.defaultResource; + constructor(resource, options) { + const attributes = resource.attributes ?? {}; + this._rawAttributes = Object.entries(attributes).map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) this._asyncAttributesPending = true; + return [k, v]; + }); + this._rawAttributes = guardedRawAttributes(this._rawAttributes); + this._schemaUrl = validateSchemaUrl(options?.schemaUrl); } - }); - Object.defineProperty(exports, "emptyResource", { - enumerable: true, - get: function() { - return ResourceImpl_1.emptyResource; + get asyncAttributesPending() { + return this._asyncAttributesPending; } - }); - var platform_1 = require_platform$4(); - Object.defineProperty(exports, "defaultServiceName", { - enumerable: true, - get: function() { - return platform_1.defaultServiceName; + async waitForAsyncAttributes() { + if (!this.asyncAttributesPending) return; + for (let i = 0; i < this._rawAttributes.length; i++) { + const [k, v] = this._rawAttributes[i]; + this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; + } + this._asyncAttributesPending = false; } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/ViewRegistry.js -var require_ViewRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ViewRegistry = void 0; - var ViewRegistry = class { - _registeredViews = []; - addView(view) { - this._registeredViews.push(view); + get attributes() { + if (this.asyncAttributesPending) api_1.diag.error("Accessing resource attributes before async attributes settled"); + if (this._memoizedAttributes) return this._memoizedAttributes; + const attrs = {}; + for (const [k, v] of this._rawAttributes) { + if ((0, utils_1.isPromiseLike)(v)) { + api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); + continue; + } + if (v != null) attrs[k] ??= v; + } + if (!this._asyncAttributesPending) this._memoizedAttributes = attrs; + return attrs; } - findViews(instrument, meter) { - return this._registeredViews.filter((registeredView) => { - return this._matchInstrument(registeredView.instrumentSelector, instrument) && this._matchMeter(registeredView.meterSelector, meter); - }); + getRawAttributes() { + return this._rawAttributes; } - _matchInstrument(selector, instrument) { - return (selector.getType() === void 0 || instrument.type === selector.getType()) && selector.getNameFilter().match(instrument.name) && selector.getUnitFilter().match(instrument.unit); + get schemaUrl() { + return this._schemaUrl; } - _matchMeter(selector, meter) { - return selector.getNameFilter().match(meter.name) && (meter.version === void 0 || selector.getVersionFilter().match(meter.version)) && (meter.schemaUrl === void 0 || selector.getSchemaUrlFilter().match(meter.schemaUrl)); + merge(resource) { + if (resource == null) return this; + const mergedSchemaUrl = mergeSchemaUrl(this, resource); + const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : void 0; + return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); } }; - exports.ViewRegistry = ViewRegistry; + function resourceFromAttributes(attributes, options) { + return ResourceImpl.FromAttributeList(Object.entries(attributes), options); + } + exports.resourceFromAttributes = resourceFromAttributes; + function resourceFromDetectedResource(detectedResource, options) { + return new ResourceImpl(detectedResource, options); + } + exports.resourceFromDetectedResource = resourceFromDetectedResource; + function emptyResource() { + return resourceFromAttributes({}); + } + exports.emptyResource = emptyResource; + function defaultResource() { + return resourceFromAttributes({ + [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, default_service_name_1.defaultServiceName)(), + [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], + [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] + }); + } + exports.defaultResource = defaultResource; + function guardedRawAttributes(attributes) { + return attributes.map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) return [k, v.catch((err) => { + api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); + })]; + return [k, v]; + }); + } + function validateSchemaUrl(schemaUrl) { + if (typeof schemaUrl === "string" || schemaUrl === void 0) return schemaUrl; + api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); + } + function mergeSchemaUrl(old, updating) { + const oldSchemaUrl = old?.schemaUrl; + const updatingSchemaUrl = updating?.schemaUrl; + const isOldEmpty = oldSchemaUrl === void 0 || oldSchemaUrl === ""; + const isUpdatingEmpty = updatingSchemaUrl === void 0 || updatingSchemaUrl === ""; + if (isOldEmpty) return updatingSchemaUrl; + if (isUpdatingEmpty) return oldSchemaUrl; + if (oldSchemaUrl === updatingSchemaUrl) return oldSchemaUrl; + api_1.diag.warn("Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.", oldSchemaUrl, updatingSchemaUrl); + } })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/InstrumentDescriptor.js -var require_InstrumentDescriptor = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detect-resources.js +var require_detect_resources = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.isValidName = exports.isDescriptorCompatibleWith = exports.createInstrumentDescriptorWithView = exports.createInstrumentDescriptor = void 0; + exports.detectResources = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const utils_1 = require_utils$4(); - function createInstrumentDescriptor(name, type, options) { - if (!isValidName(name)) api_1.diag.warn(`Invalid metric name: "${name}". The metric name should be a ASCII string with a length no greater than 255 characters.`); - return { - name, - type, - description: options?.description ?? "", - unit: options?.unit ?? "", - valueType: options?.valueType ?? api_1.ValueType.DOUBLE, - advice: options?.advice ?? {} - }; - } - exports.createInstrumentDescriptor = createInstrumentDescriptor; - function createInstrumentDescriptorWithView(view, instrument) { - return { - name: view.name ?? instrument.name, - description: view.description ?? instrument.description, - type: instrument.type, - unit: instrument.unit, - valueType: instrument.valueType, - advice: instrument.advice - }; - } - exports.createInstrumentDescriptorWithView = createInstrumentDescriptorWithView; - function isDescriptorCompatibleWith(descriptor, otherDescriptor) { - return (0, utils_1.equalsCaseInsensitive)(descriptor.name, otherDescriptor.name) && descriptor.unit === otherDescriptor.unit && descriptor.type === otherDescriptor.type && descriptor.valueType === otherDescriptor.valueType; - } - exports.isDescriptorCompatibleWith = isDescriptorCompatibleWith; - const NAME_REGEXP = /^[a-z][a-z0-9_.\-/]{0,254}$/i; - function isValidName(name) { - return name.match(NAME_REGEXP) != null; - } - exports.isValidName = isValidName; + const ResourceImpl_1 = require_ResourceImpl(); + /** + * Runs all resource detectors and returns the results merged into a single Resource. + * + * @param config Configuration for resource detection + */ + const detectResources = (config = {}) => { + return (config.detectors || []).map((d) => { + try { + const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config)); + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; + } catch (e) { + api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); + return (0, ResourceImpl_1.emptyResource)(); + } + }).reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); + }; + exports.detectResources = detectResources; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/Instruments.js -var require_Instruments = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js +var require_EnvDetector = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.isObservableInstrument = exports.ObservableUpDownCounterInstrument = exports.ObservableGaugeInstrument = exports.ObservableCounterInstrument = exports.ObservableInstrument = exports.HistogramInstrument = exports.GaugeInstrument = exports.CounterInstrument = exports.UpDownCounterInstrument = exports.SyncInstrument = void 0; + exports.envDetector = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); const core_1 = require_src$8(); - var SyncInstrument = class { - _writableMetricStorage; - _descriptor; - constructor(_writableMetricStorage, _descriptor) { - this._writableMetricStorage = _writableMetricStorage; - this._descriptor = _descriptor; - } - _record(value, attributes = {}, context$1 = api_1.context.active()) { - if (typeof value !== "number") { - api_1.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${value}`); - return; + /** + * EnvDetector can be used to detect the presence of and create a Resource + * from the OTEL_RESOURCE_ATTRIBUTES environment variable. + */ + var EnvDetector = class { + _MAX_LENGTH = 255; + _COMMA_SEPARATOR = ","; + _LABEL_KEY_VALUE_SPLITTER = "="; + /** + * Returns a {@link Resource} populated with attributes from the + * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async + * function to conform to the Detector interface. + * + * @param config The resource detection config + */ + detect(_config) { + const attributes = {}; + const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); + const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); + if (rawAttributes) try { + const parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } catch (e) { + api_1.diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); } - if (this._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { - api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`); - value = Math.trunc(value); - if (!Number.isInteger(value)) return; + if (serviceName) attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; + return { attributes }; + } + /** + * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment + * variable. + * + * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the + * format "key1=value1,key2=value2". The ',' and '=' characters in keys + * and values MUST be percent-encoded. Other characters MAY be percent-encoded. + * + * Per the spec, on any error (e.g., decoding failure), the entire environment + * variable value is discarded. + * + * @param rawEnvAttributes The resource attributes as a comma-separated list + * of key/value pairs. + * @returns The parsed resource attributes. + * @throws Error if parsing fails (caller handles by discarding all attributes) + */ + _parseResourceAttributes(rawEnvAttributes) { + if (!rawEnvAttributes) return {}; + const attributes = {}; + const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR).filter((attr) => attr.trim() !== ""); + for (const rawAttribute of rawAttributes) { + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); + if (keyValuePair.length !== 2) throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`); + const [rawKey, rawValue] = keyValuePair; + const key = rawKey.trim(); + const value = rawValue.trim(); + if (key.length === 0) throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); + let decodedKey; + let decodedValue; + try { + decodedKey = decodeURIComponent(key); + decodedValue = decodeURIComponent(value); + } catch (e) { + throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`, { cause: e }); + } + if (decodedKey.length > this._MAX_LENGTH) throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); + if (decodedValue.length > this._MAX_LENGTH) throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); + attributes[decodedKey] = decodedValue; } - this._writableMetricStorage.record(value, attributes, context$1, (0, core_1.millisToHrTime)(Date.now())); + return attributes; } }; - exports.SyncInstrument = SyncInstrument; + exports.envDetector = new EnvDetector(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/semconv.js +var require_semconv$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0; + /** + * The cloud account ID the resource is assigned to. + * + * @example 111111111111 + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; + /** + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. + * + * @example us-east-1c + * + * @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; + /** + * Name of the cloud provider. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; + /** + * The geographical region the resource is running. + * + * @example us-central1 + * @example us-east-1 + * + * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CLOUD_REGION = "cloud.region"; + /** + * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. + * + * @example a3bf90e006b2 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_ID = "container.id"; + /** + * Name of the image the container was built on. + * + * @example gcr.io/opentelemetry/operator + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; + /** + * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. + * + * @example ["v1.27.1", "3.5.7-0"] + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; + /** + * Container name used by container runtime. + * + * @example opentelemetry-autoconf + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_CONTAINER_NAME = "container.name"; + /** + * The CPU architecture the host system is running on. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_ARCH = "host.arch"; + /** + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. + * + * @example fdbf79e8af94cb7f9e8df36789187052 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_ID = "host.id"; + /** + * VM image ID or host OS image ID. For Cloud, this value is from the provider. + * + * @example ami-07b06b442921831e5 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_ID = "host.image.id"; + /** + * Name of the VM image or OS install the host was instantiated from. + * + * @example infra-ami-eks-worker-node-7d4ec78312 + * @example CentOS-8-x86_64-1905 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; + /** + * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + * + * @example 0.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; + /** + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. + * + * @example opentelemetry-test + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_NAME = "host.name"; + /** + * Type of host. For Cloud, this must be the machine type. + * + * @example n1-standard-1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_HOST_TYPE = "host.type"; + /** + * The name of the cluster. + * + * @example opentelemetry-cluster + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; + /** + * The name of the Deployment. + * + * @example opentelemetry + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; + /** + * The name of the namespace that the pod is running in. + * + * @example default + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; + /** + * The name of the Pod. + * + * @example opentelemetry-pod-autoconf + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; + /** + * The operating system type. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OS_TYPE = "os.type"; + /** + * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). + * + * @example 14.2.1 + * @example 18.04.1 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OS_VERSION = "os.version"; + /** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. + * + * @example cmd/otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_COMMAND = "process.command"; + /** + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. + * + * @example ["cmd/otecol", "--config=config.yaml"] + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; + /** + * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`. + * + * @example otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + /** + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. + * + * @example /usr/bin/cmd/otelcol + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; /** - * The class implements {@link UpDownCounter} interface. + * The username of the user that owns the process. + * + * @example root + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - var UpDownCounterInstrument = class extends SyncInstrument { - /** - * Increment value of counter by the input. Inputs may be negative. - */ - add(value, attributes, ctx) { - this._record(value, attributes, ctx); - } - }; - exports.UpDownCounterInstrument = UpDownCounterInstrument; + exports.ATTR_PROCESS_OWNER = "process.owner"; /** - * The class implements {@link Counter} interface. + * Process identifier (PID). + * + * @example 1234 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - var CounterInstrument = class extends SyncInstrument { - /** - * Increment value of counter by the input. Inputs may not be negative. - */ - add(value, attributes, ctx) { - if (value < 0) { - api_1.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${value}`); - return; - } - this._record(value, attributes, ctx); - } - }; - exports.CounterInstrument = CounterInstrument; + exports.ATTR_PROCESS_PID = "process.pid"; /** - * The class implements {@link Gauge} interface. + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. + * + * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - var GaugeInstrument = class extends SyncInstrument { - /** - * Records a measurement. - */ - record(value, attributes, ctx) { - this._record(value, attributes, ctx); - } - }; - exports.GaugeInstrument = GaugeInstrument; + exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; /** - * The class implements {@link Histogram} interface. + * The name of the runtime of this process. + * + * @example OpenJDK Runtime Environment + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - var HistogramInstrument = class extends SyncInstrument { - /** - * Records a measurement. Value of the measurement must not be negative. - */ - record(value, attributes, ctx) { - if (value < 0) { - api_1.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${value}`); - return; - } - this._record(value, attributes, ctx); - } - }; - exports.HistogramInstrument = HistogramInstrument; - var ObservableInstrument = class { - _observableRegistry; - /** @internal */ - _metricStorages; - /** @internal */ - _descriptor; - constructor(descriptor, metricStorages, _observableRegistry) { - this._observableRegistry = _observableRegistry; - this._descriptor = descriptor; - this._metricStorages = metricStorages; - } - /** - * @see {Observable.addCallback} - */ - addCallback(callback) { - this._observableRegistry.addCallback(callback, this); - } - /** - * @see {Observable.removeCallback} - */ - removeCallback(callback) { - this._observableRegistry.removeCallback(callback, this); - } - }; - exports.ObservableInstrument = ObservableInstrument; - var ObservableCounterInstrument = class extends ObservableInstrument {}; - exports.ObservableCounterInstrument = ObservableCounterInstrument; - var ObservableGaugeInstrument = class extends ObservableInstrument {}; - exports.ObservableGaugeInstrument = ObservableGaugeInstrument; - var ObservableUpDownCounterInstrument = class extends ObservableInstrument {}; - exports.ObservableUpDownCounterInstrument = ObservableUpDownCounterInstrument; - function isObservableInstrument(it) { - return it instanceof ObservableInstrument; - } - exports.isObservableInstrument = isObservableInstrument; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/Meter.js -var require_Meter = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.Meter = void 0; - const InstrumentDescriptor_1 = require_InstrumentDescriptor(); - const Instruments_1 = require_Instruments(); - const MetricData_1 = require_MetricData(); + exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; /** - * This class implements the {@link IMeter} interface. + * The version of the runtime of this process, as returned by the runtime without modification. + * + * @example "14.0.2" + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - var Meter = class { - _meterSharedState; - constructor(_meterSharedState) { - this._meterSharedState = _meterSharedState; - } - /** - * Create a {@link Gauge} instrument. - */ - createGauge(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.GAUGE, options); - const storage = this._meterSharedState.registerMetricStorage(descriptor); - return new Instruments_1.GaugeInstrument(storage, descriptor); - } - /** - * Create a {@link Histogram} instrument. - */ - createHistogram(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.HISTOGRAM, options); - const storage = this._meterSharedState.registerMetricStorage(descriptor); - return new Instruments_1.HistogramInstrument(storage, descriptor); - } - /** - * Create a {@link Counter} instrument. - */ - createCounter(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.COUNTER, options); - const storage = this._meterSharedState.registerMetricStorage(descriptor); - return new Instruments_1.CounterInstrument(storage, descriptor); - } - /** - * Create a {@link UpDownCounter} instrument. - */ - createUpDownCounter(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.UP_DOWN_COUNTER, options); - const storage = this._meterSharedState.registerMetricStorage(descriptor); - return new Instruments_1.UpDownCounterInstrument(storage, descriptor); - } - /** - * Create a {@link ObservableGauge} instrument. - */ - createObservableGauge(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_GAUGE, options); - const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); - return new Instruments_1.ObservableGaugeInstrument(descriptor, storages, this._meterSharedState.observableRegistry); - } - /** - * Create a {@link ObservableCounter} instrument. - */ - createObservableCounter(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_COUNTER, options); - const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); - return new Instruments_1.ObservableCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); - } - /** - * Create a {@link ObservableUpDownCounter} instrument. - */ - createObservableUpDownCounter(name, options) { - const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER, options); - const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); - return new Instruments_1.ObservableUpDownCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); - } - /** - * @see {@link Meter.addBatchObservableCallback} - */ - addBatchObservableCallback(callback, observables) { - this._meterSharedState.observableRegistry.addBatchCallback(callback, observables); - } - /** - * @see {@link Meter.removeBatchObservableCallback} - */ - removeBatchObservableCallback(callback, observables) { - this._meterSharedState.observableRegistry.removeBatchCallback(callback, observables); - } - }; - exports.Meter = Meter; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorage.js -var require_MetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MetricStorage = void 0; - const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + /** + * The string ID of the service instance. + * + * @example 627cc493-f310-47de-96bd-71410b7dec09 + * + * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words + * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to + * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled + * service). + * + * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC + * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of + * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and + * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. + * + * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is + * needed. Similar to what can be seen in the man page for the + * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying + * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it + * or not via another resource attribute. + * + * For applications running behind an application server (like unicorn), we do not recommend using one identifier + * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker + * thread in unicorn) to have its own instance.id. + * + * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the + * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will + * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. + * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance + * for that telemetry. This is typically the case for scraping receivers, as they know the target address and + * port. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; + /** + * A namespace for `service.name`. + * + * @example Shop + * + * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; + /** + * Additional description of the web engine (e.g. detailed version and edition information). + * + * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; /** - * Internal interface. + * The name of the web engine. * - * Represents a storage from which we can collect metrics. + * @example WildFly + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - var MetricStorage = class { - _instrumentDescriptor; - constructor(_instrumentDescriptor) { - this._instrumentDescriptor = _instrumentDescriptor; - } - getInstrumentDescriptor() { - return this._instrumentDescriptor; - } - updateDescription(description) { - this._instrumentDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(this._instrumentDescriptor.name, this._instrumentDescriptor.type, { - description, - valueType: this._instrumentDescriptor.valueType, - unit: this._instrumentDescriptor.unit, - advice: this._instrumentDescriptor.advice - }); - } - }; - exports.MetricStorage = MetricStorage; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/HashMap.js -var require_HashMap = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.AttributeHashMap = exports.HashMap = void 0; - const utils_1 = require_utils$4(); - var HashMap = class { - _hash; - _valueMap = /* @__PURE__ */ new Map(); - _keyMap = /* @__PURE__ */ new Map(); - constructor(_hash) { - this._hash = _hash; - } - get(key, hashCode) { - hashCode ??= this._hash(key); - return this._valueMap.get(hashCode); - } - getOrDefault(key, defaultFactory) { - const hash = this._hash(key); - if (this._valueMap.has(hash)) return this._valueMap.get(hash); - const val = defaultFactory(); - if (!this._keyMap.has(hash)) this._keyMap.set(hash, key); - this._valueMap.set(hash, val); - return val; - } - set(key, value, hashCode) { - hashCode ??= this._hash(key); - if (!this._keyMap.has(hashCode)) this._keyMap.set(hashCode, key); - this._valueMap.set(hashCode, value); - } - has(key, hashCode) { - hashCode ??= this._hash(key); - return this._valueMap.has(hashCode); - } - *keys() { - const keyIterator = this._keyMap.entries(); - let next = keyIterator.next(); - while (next.done !== true) { - yield [next.value[1], next.value[0]]; - next = keyIterator.next(); - } - } - *entries() { - const valueIterator = this._valueMap.entries(); - let next = valueIterator.next(); - while (next.done !== true) { - yield [ - this._keyMap.get(next.value[0]), - next.value[1], - next.value[0] - ]; - next = valueIterator.next(); - } - } - get size() { - return this._valueMap.size; - } - }; - exports.HashMap = HashMap; - var AttributeHashMap = class extends HashMap { - constructor() { - super(utils_1.hashAttributes); - } - }; - exports.AttributeHashMap = AttributeHashMap; + exports.ATTR_WEBENGINE_NAME = "webengine.name"; + /** + * The version of the web engine. + * + * @example 21.0.0 + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_WEBENGINE_VERSION = "webengine.version"; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/DeltaMetricProcessor.js -var require_DeltaMetricProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js +var require_execAsync = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.DeltaMetricProcessor = void 0; - const utils_1 = require_utils$4(); - const HashMap_1 = require_HashMap(); - /** - * Internal interface. - * - * Allows synchronous collection of metrics. This processor should allow - * allocation of new aggregation cells for metrics and convert cumulative - * recording to delta data points. - */ - var DeltaMetricProcessor = class { - _aggregator; - _activeCollectionStorage = new HashMap_1.AttributeHashMap(); - _cumulativeMemoStorage = new HashMap_1.AttributeHashMap(); - _cardinalityLimit; - _overflowAttributes = { "otel.metric.overflow": true }; - _overflowHashCode; - constructor(_aggregator, aggregationCardinalityLimit) { - this._aggregator = _aggregator; - this._cardinalityLimit = (aggregationCardinalityLimit ?? 2e3) - 1; - this._overflowHashCode = (0, utils_1.hashAttributes)(this._overflowAttributes); - } - record(value, attributes, _context, collectionTime) { - let accumulation = this._activeCollectionStorage.get(attributes); - if (!accumulation) { - if (this._activeCollectionStorage.size >= this._cardinalityLimit) { - this._activeCollectionStorage.getOrDefault(this._overflowAttributes, () => this._aggregator.createAccumulation(collectionTime))?.record(value); - return; - } - accumulation = this._aggregator.createAccumulation(collectionTime); - this._activeCollectionStorage.set(attributes, accumulation); - } - accumulation?.record(value); - } - batchCumulate(measurements, collectionTime) { - Array.from(measurements.entries()).forEach(([attributes, value, hashCode]) => { - const accumulation = this._aggregator.createAccumulation(collectionTime); - accumulation?.record(value); - let delta = accumulation; - if (this._cumulativeMemoStorage.has(attributes, hashCode)) { - const previous = this._cumulativeMemoStorage.get(attributes, hashCode); - delta = this._aggregator.diff(previous, accumulation); - } else if (this._cumulativeMemoStorage.size >= this._cardinalityLimit) { - attributes = this._overflowAttributes; - hashCode = this._overflowHashCode; - if (this._cumulativeMemoStorage.has(attributes, hashCode)) { - const previous = this._cumulativeMemoStorage.get(attributes, hashCode); - delta = this._aggregator.diff(previous, accumulation); - } - } - if (this._activeCollectionStorage.has(attributes, hashCode)) { - const active = this._activeCollectionStorage.get(attributes, hashCode); - delta = this._aggregator.merge(active, delta); - } - this._cumulativeMemoStorage.set(attributes, accumulation, hashCode); - this._activeCollectionStorage.set(attributes, delta, hashCode); - }); - } - /** - * Returns a collection of delta metrics. Start time is the when first - * time event collected. - */ - collect() { - const unreportedDelta = this._activeCollectionStorage; - this._activeCollectionStorage = new HashMap_1.AttributeHashMap(); - return unreportedDelta; - } - }; - exports.DeltaMetricProcessor = DeltaMetricProcessor; + exports.execAsync = void 0; + const child_process = __require("child_process"); + const util = __require("util"); + exports.execAsync = util.promisify(child_process.exec); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/TemporalMetricProcessor.js -var require_TemporalMetricProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js +var require_getMachineId_darwin = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.TemporalMetricProcessor = void 0; - const AggregationTemporality_1 = require_AggregationTemporality(); - const HashMap_1 = require_HashMap(); - /** - * Internal interface. - * - * Provides unique reporting for each collector. Allows synchronous collection - * of metrics and reports given temporality values. - */ - var TemporalMetricProcessor = class TemporalMetricProcessor { - _aggregator; - _unreportedAccumulations = /* @__PURE__ */ new Map(); - _reportHistory = /* @__PURE__ */ new Map(); - constructor(_aggregator, collectorHandles) { - this._aggregator = _aggregator; - collectorHandles.forEach((handle) => { - this._unreportedAccumulations.set(handle, []); - }); - } - /** - * Builds the {@link MetricData} streams to report against a specific MetricCollector. - * @param collector The information of the MetricCollector. - * @param collectors The registered collectors. - * @param instrumentDescriptor The instrumentation descriptor that these metrics generated with. - * @param currentAccumulations The current accumulation of metric data from instruments. - * @param collectionTime The current collection timestamp. - * @returns The {@link MetricData} points or `null`. - */ - buildMetrics(collector, instrumentDescriptor, currentAccumulations, collectionTime) { - this._stashAccumulations(currentAccumulations); - const unreportedAccumulations = this._getMergedUnreportedAccumulations(collector); - let result = unreportedAccumulations; - let aggregationTemporality; - if (this._reportHistory.has(collector)) { - const last = this._reportHistory.get(collector); - const lastCollectionTime = last.collectionTime; - aggregationTemporality = last.aggregationTemporality; - if (aggregationTemporality === AggregationTemporality_1.AggregationTemporality.CUMULATIVE) result = TemporalMetricProcessor.merge(last.accumulations, unreportedAccumulations, this._aggregator); - else result = TemporalMetricProcessor.calibrateStartTime(last.accumulations, unreportedAccumulations, lastCollectionTime); - } else aggregationTemporality = collector.selectAggregationTemporality(instrumentDescriptor.type); - this._reportHistory.set(collector, { - accumulations: result, - collectionTime, - aggregationTemporality - }); - const accumulationRecords = AttributesMapToAccumulationRecords(result); - if (accumulationRecords.length === 0) return; - return this._aggregator.toMetricData(instrumentDescriptor, aggregationTemporality, accumulationRecords, collectionTime); - } - _stashAccumulations(currentAccumulation) { - const registeredCollectors = this._unreportedAccumulations.keys(); - for (const collector of registeredCollectors) { - let stash = this._unreportedAccumulations.get(collector); - if (stash === void 0) { - stash = []; - this._unreportedAccumulations.set(collector, stash); - } - stash.push(currentAccumulation); - } - } - _getMergedUnreportedAccumulations(collector) { - let result = new HashMap_1.AttributeHashMap(); - const unreportedList = this._unreportedAccumulations.get(collector); - this._unreportedAccumulations.set(collector, []); - if (unreportedList === void 0) return result; - for (const it of unreportedList) result = TemporalMetricProcessor.merge(result, it, this._aggregator); - return result; - } - static merge(last, current, aggregator) { - const result = last; - const iterator = current.entries(); - let next = iterator.next(); - while (next.done !== true) { - const [key, record$1, hash] = next.value; - if (last.has(key, hash)) { - const lastAccumulation = last.get(key, hash); - const accumulation = aggregator.merge(lastAccumulation, record$1); - result.set(key, accumulation, hash); - } else result.set(key, record$1, hash); - next = iterator.next(); - } - return result; - } - /** - * Calibrate the reported metric streams' startTime to lastCollectionTime. Leaves - * the new stream to be the initial observation time unchanged. - */ - static calibrateStartTime(last, current, lastCollectionTime) { - for (const [key, hash] of last.keys()) current.get(key, hash)?.setStartTime(lastCollectionTime); - return current; + exports.getMachineId = void 0; + const execAsync_1 = require_execAsync(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + try { + const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID")); + if (!idLine) return; + const parts = idLine.split("\" = \""); + if (parts.length === 2) return parts[1].slice(0, -1); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); } - }; - exports.TemporalMetricProcessor = TemporalMetricProcessor; - function AttributesMapToAccumulationRecords(map) { - return Array.from(map.entries()); } + exports.getMachineId = getMachineId; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/AsyncMetricStorage.js -var require_AsyncMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js +var require_getMachineId_linux = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.AsyncMetricStorage = void 0; - const MetricStorage_1 = require_MetricStorage(); - const DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); - const TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); - const HashMap_1 = require_HashMap(); - /** - * Internal interface. - * - * Stores and aggregates {@link MetricData} for asynchronous instruments. - */ - var AsyncMetricStorage = class extends MetricStorage_1.MetricStorage { - _attributesProcessor; - _aggregationCardinalityLimit; - _deltaMetricStorage; - _temporalMetricStorage; - constructor(_instrumentDescriptor, aggregator, _attributesProcessor, collectorHandles, _aggregationCardinalityLimit) { - super(_instrumentDescriptor); - this._attributesProcessor = _attributesProcessor; - this._aggregationCardinalityLimit = _aggregationCardinalityLimit; - this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); - this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); + exports.getMachineId = void 0; + const fs_1$1 = __require("fs"); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + for (const path of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try { + return (await fs_1$1.promises.readFile(path, { encoding: "utf8" })).trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); } - record(measurements, observationTime) { - const processed = new HashMap_1.AttributeHashMap(); - Array.from(measurements.entries()).forEach(([attributes, value]) => { - processed.set(this._attributesProcessor.process(attributes), value); - }); - this._deltaMetricStorage.batchCumulate(processed, observationTime); + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js +var require_getMachineId_bsd = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const fs_1 = __require("fs"); + const execAsync_1 = require_execAsync(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + try { + return (await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); } - /** - * Collects the metrics from this storage. The ObservableCallback is invoked - * during the collection. - * - * Note: This is a stateful operation and may reset any interval-related - * state for the MetricCollector. - */ - collect(collector, collectionTime) { - const accumulations = this._deltaMetricStorage.collect(); - return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); + try { + return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); } - }; - exports.AsyncMetricStorage = AsyncMetricStorage; + } + exports.getMachineId = getMachineId; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/RegistrationConflicts.js -var require_RegistrationConflicts = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js +var require_getMachineId_win = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.getConflictResolutionRecipe = exports.getDescriptionResolutionRecipe = exports.getTypeConflictResolutionRecipe = exports.getUnitConflictResolutionRecipe = exports.getValueTypeConflictResolutionRecipe = exports.getIncompatibilityDetails = void 0; - function getIncompatibilityDetails(existing, otherDescriptor) { - let incompatibility = ""; - if (existing.unit !== otherDescriptor.unit) incompatibility += `\t- Unit '${existing.unit}' does not match '${otherDescriptor.unit}'\n`; - if (existing.type !== otherDescriptor.type) incompatibility += `\t- Type '${existing.type}' does not match '${otherDescriptor.type}'\n`; - if (existing.valueType !== otherDescriptor.valueType) incompatibility += `\t- Value Type '${existing.valueType}' does not match '${otherDescriptor.valueType}'\n`; - if (existing.description !== otherDescriptor.description) incompatibility += `\t- Description '${existing.description}' does not match '${otherDescriptor.description}'\n`; - return incompatibility; - } - exports.getIncompatibilityDetails = getIncompatibilityDetails; - function getValueTypeConflictResolutionRecipe(existing, otherDescriptor) { - return `\t- use valueType '${existing.valueType}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; - } - exports.getValueTypeConflictResolutionRecipe = getValueTypeConflictResolutionRecipe; - function getUnitConflictResolutionRecipe(existing, otherDescriptor) { - return `\t- use unit '${existing.unit}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; - } - exports.getUnitConflictResolutionRecipe = getUnitConflictResolutionRecipe; - function getTypeConflictResolutionRecipe(existing, otherDescriptor) { - const selector = { - name: otherDescriptor.name, - type: otherDescriptor.type, - unit: otherDescriptor.unit - }; - const selectorString = JSON.stringify(selector); - return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}'`; - } - exports.getTypeConflictResolutionRecipe = getTypeConflictResolutionRecipe; - function getDescriptionResolutionRecipe(existing, otherDescriptor) { - const selector = { - name: otherDescriptor.name, - type: otherDescriptor.type, - unit: otherDescriptor.unit - }; - const selectorString = JSON.stringify(selector); - return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}' - \t- OR - create a new view with the name ${existing.name} and description '${existing.description}' and InstrumentSelector ${selectorString} - \t- OR - create a new view with the name ${otherDescriptor.name} and description '${existing.description}' and InstrumentSelector ${selectorString}`; + exports.getMachineId = void 0; + const process$2 = __require("process"); + const execAsync_1 = require_execAsync(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; + let command = "%windir%\\System32\\REG.exe"; + if (process$2.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process$2.env) command = "%windir%\\sysnative\\cmd.exe /c " + command; + try { + const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ"); + if (parts.length === 2) return parts[1].trim(); + } catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } } - exports.getDescriptionResolutionRecipe = getDescriptionResolutionRecipe; - function getConflictResolutionRecipe(existing, otherDescriptor) { - if (existing.valueType !== otherDescriptor.valueType) return getValueTypeConflictResolutionRecipe(existing, otherDescriptor); - if (existing.unit !== otherDescriptor.unit) return getUnitConflictResolutionRecipe(existing, otherDescriptor); - if (existing.type !== otherDescriptor.type) return getTypeConflictResolutionRecipe(existing, otherDescriptor); - if (existing.description !== otherDescriptor.description) return getDescriptionResolutionRecipe(existing, otherDescriptor); - return ""; + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js +var require_getMachineId_unsupported = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getMachineId = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + async function getMachineId() { + api_1.diag.debug("could not read machine-id: unsupported platform"); } - exports.getConflictResolutionRecipe = getConflictResolutionRecipe; + exports.getMachineId = getMachineId; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorageRegistry.js -var require_MetricStorageRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js +var require_getMachineId = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.MetricStorageRegistry = void 0; - const InstrumentDescriptor_1 = require_InstrumentDescriptor(); - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const RegistrationConflicts_1 = require_RegistrationConflicts(); - /** - * Internal class for storing {@link MetricStorage} - */ - var MetricStorageRegistry = class MetricStorageRegistry { - _sharedRegistry = /* @__PURE__ */ new Map(); - _perCollectorRegistry = /* @__PURE__ */ new Map(); - static create() { - return new MetricStorageRegistry(); - } - getStorages(collector) { - let storages = []; - for (const metricStorages of this._sharedRegistry.values()) storages = storages.concat(metricStorages); - const perCollectorStorages = this._perCollectorRegistry.get(collector); - if (perCollectorStorages != null) for (const metricStorages of perCollectorStorages.values()) storages = storages.concat(metricStorages); - return storages; - } - register(storage) { - this._registerStorage(storage, this._sharedRegistry); - } - registerForCollector(collector, storage) { - let storageMap = this._perCollectorRegistry.get(collector); - if (storageMap == null) { - storageMap = /* @__PURE__ */ new Map(); - this._perCollectorRegistry.set(collector, storageMap); - } - this._registerStorage(storage, storageMap); - } - findOrUpdateCompatibleStorage(expectedDescriptor) { - const storages = this._sharedRegistry.get(expectedDescriptor.name); - if (storages === void 0) return null; - return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); - } - findOrUpdateCompatibleCollectorStorage(collector, expectedDescriptor) { - const storageMap = this._perCollectorRegistry.get(collector); - if (storageMap === void 0) return null; - const storages = storageMap.get(expectedDescriptor.name); - if (storages === void 0) return null; - return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); + exports.getMachineId = void 0; + const process$1 = __require("process"); + let getMachineIdImpl; + async function getMachineId() { + if (!getMachineIdImpl) switch (process$1.platform) { + case "darwin": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_darwin()))).getMachineId; + break; + case "linux": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_linux()))).getMachineId; + break; + case "freebsd": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_bsd()))).getMachineId; + break; + case "win32": + getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_win()))).getMachineId; + break; + default: getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_unsupported()))).getMachineId; } - _registerStorage(storage, storageMap) { - const descriptor = storage.getInstrumentDescriptor(); - const storages = storageMap.get(descriptor.name); - if (storages === void 0) { - storageMap.set(descriptor.name, [storage]); - return; - } - storages.push(storage); + return getMachineIdImpl(); + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js +var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.normalizeType = exports.normalizeArch = void 0; + const normalizeArch = (nodeArchString) => { + switch (nodeArchString) { + case "arm": return "arm32"; + case "ppc": return "ppc32"; + case "x64": return "amd64"; + default: return nodeArchString; } - _findOrUpdateCompatibleStorage(expectedDescriptor, existingStorages) { - let compatibleStorage = null; - for (const existingStorage of existingStorages) { - const existingDescriptor = existingStorage.getInstrumentDescriptor(); - if ((0, InstrumentDescriptor_1.isDescriptorCompatibleWith)(existingDescriptor, expectedDescriptor)) { - if (existingDescriptor.description !== expectedDescriptor.description) { - if (expectedDescriptor.description.length > existingDescriptor.description.length) existingStorage.updateDescription(expectedDescriptor.description); - api.diag.warn("A view or instrument with the name ", expectedDescriptor.name, " has already been registered, but has a different description and is incompatible with another registered view.\n", "Details:\n", (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), "The longer description will be used.\nTo resolve the conflict:", (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); - } - compatibleStorage = existingStorage; - } else api.diag.warn("A view or instrument with the name ", expectedDescriptor.name, " has already been registered and is incompatible with another registered view.\n", "Details:\n", (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), "To resolve the conflict:\n", (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); - } - return compatibleStorage; + }; + exports.normalizeArch = normalizeArch; + const normalizeType = (nodePlatform) => { + switch (nodePlatform) { + case "sunos": return "solaris"; + case "win32": return "windows"; + default: return nodePlatform; } }; - exports.MetricStorageRegistry = MetricStorageRegistry; + exports.normalizeType = normalizeType; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MultiWritableMetricStorage.js -var require_MultiWritableMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js +var require_HostDetector = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.MultiMetricStorage = void 0; + exports.hostDetector = void 0; + const semconv_1 = require_semconv$2(); + const os_1$1 = __require("os"); + const getMachineId_1 = require_getMachineId(); + const utils_1 = require_utils$1(); /** - * Internal interface. + * HostDetector detects the resources related to the host current process is + * running on. Currently only non-cloud-based attributes are included. */ - var MultiMetricStorage = class { - _backingStorages; - constructor(_backingStorages) { - this._backingStorages = _backingStorages; - } - record(value, attributes, context$1, recordTime) { - this._backingStorages.forEach((it) => { - it.record(value, attributes, context$1, recordTime); - }); + var HostDetector = class { + detect(_config) { + return { attributes: { + [semconv_1.ATTR_HOST_NAME]: (0, os_1$1.hostname)(), + [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1$1.arch)()), + [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() + } }; } }; - exports.MultiMetricStorage = MultiMetricStorage; + exports.hostDetector = new HostDetector(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/ObservableResult.js -var require_ObservableResult = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js +var require_OSDetector = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.BatchObservableResultImpl = exports.ObservableResultImpl = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const HashMap_1 = require_HashMap(); - const Instruments_1 = require_Instruments(); + exports.osDetector = void 0; + const semconv_1 = require_semconv$2(); + const os_1 = __require("os"); + const utils_1 = require_utils$1(); /** - * The class implements {@link ObservableResult} interface. + * OSDetector detects the resources related to the operating system (OS) on + * which the process represented by this resource is running. */ - var ObservableResultImpl = class { - _instrumentName; - _valueType; - /** - * @internal - */ - _buffer = new HashMap_1.AttributeHashMap(); - constructor(_instrumentName, _valueType) { - this._instrumentName = _instrumentName; - this._valueType = _valueType; - } - /** - * Observe a measurement of the value associated with the given attributes. - */ - observe(value, attributes = {}) { - if (typeof value !== "number") { - api_1.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${value}`); - return; - } - if (this._valueType === api_1.ValueType.INT && !Number.isInteger(value)) { - api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`); - value = Math.trunc(value); - if (!Number.isInteger(value)) return; - } - this._buffer.set(attributes, value); + var OSDetector = class { + detect(_config) { + return { attributes: { + [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), + [semconv_1.ATTR_OS_VERSION]: (0, os_1.release)() + } }; } }; - exports.ObservableResultImpl = ObservableResultImpl; + exports.osDetector = new OSDetector(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js +var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.processDetector = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const semconv_1 = require_semconv$2(); + const os = __require("os"); /** - * The class implements {@link BatchObservableCallback} interface. + * ProcessDetector will be used to detect the resources related current process running + * and being instrumented from the NodeJS Process module. */ - var BatchObservableResultImpl = class { - /** - * @internal - */ - _buffer = /* @__PURE__ */ new Map(); - /** - * Observe a measurement of the value associated with the given attributes. - */ - observe(metric, value, attributes = {}) { - if (!(0, Instruments_1.isObservableInstrument)(metric)) return; - let map = this._buffer.get(metric); - if (map == null) { - map = new HashMap_1.AttributeHashMap(); - this._buffer.set(metric, map); - } - if (typeof value !== "number") { - api_1.diag.warn(`non-number value provided to metric ${metric._descriptor.name}: ${value}`); - return; - } - if (metric._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { - api_1.diag.warn(`INT value type cannot accept a floating-point value for ${metric._descriptor.name}, ignoring the fractional digits.`); - value = Math.trunc(value); - if (!Number.isInteger(value)) return; + var ProcessDetector = class { + detect(_config) { + const attributes = { + [semconv_1.ATTR_PROCESS_PID]: process.pid, + [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, + [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, + [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ + process.argv[0], + ...process.execArgv, + ...process.argv.slice(1) + ], + [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, + [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", + [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" + }; + if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; + try { + const userInfo = os.userInfo(); + attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; + } catch (e) { + api_1.diag.debug(`error obtaining process owner: ${e}`); } - map.set(attributes, value); + return { attributes }; } }; - exports.BatchObservableResultImpl = BatchObservableResultImpl; + exports.processDetector = new ProcessDetector(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/ObservableRegistry.js -var require_ObservableRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js +var require_ServiceInstanceIdDetector = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.ObservableRegistry = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const Instruments_1 = require_Instruments(); - const ObservableResult_1 = require_ObservableResult(); - const utils_1 = require_utils$4(); + exports.serviceInstanceIdDetector = void 0; + const semconv_1 = require_semconv$2(); + const crypto_1 = __require("crypto"); /** - * An internal interface for managing ObservableCallbacks. - * - * Every registered callback associated with a set of instruments are be evaluated - * exactly once during collection prior to reading data for that instrument. + * ServiceInstanceIdDetector detects the resources related to the service instance ID. */ - var ObservableRegistry = class { - _callbacks = []; - _batchCallbacks = []; - addCallback(callback, instrument) { - if (this._findCallback(callback, instrument) >= 0) return; - this._callbacks.push({ - callback, - instrument - }); + var ServiceInstanceIdDetector = class { + detect(_config) { + return { attributes: { [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)() } }; } - removeCallback(callback, instrument) { - const idx = this._findCallback(callback, instrument); - if (idx < 0) return; - this._callbacks.splice(idx, 1); + }; + /** + * @experimental + */ + exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js +var require_node$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; + var HostDetector_1 = require_HostDetector(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return HostDetector_1.hostDetector; } - addBatchCallback(callback, instruments) { - const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); - if (observableInstruments.size === 0) { - api_1.diag.error("BatchObservableCallback is not associated with valid instruments", instruments); - return; - } - if (this._findBatchCallback(callback, observableInstruments) >= 0) return; - this._batchCallbacks.push({ - callback, - instruments: observableInstruments - }); + }); + var OSDetector_1 = require_OSDetector(); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return OSDetector_1.osDetector; } - removeBatchCallback(callback, instruments) { - const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); - const idx = this._findBatchCallback(callback, observableInstruments); - if (idx < 0) return; - this._batchCallbacks.splice(idx, 1); + }); + var ProcessDetector_1 = require_ProcessDetector(); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return ProcessDetector_1.processDetector; } - /** - * @returns a promise of rejected reasons for invoking callbacks. - */ - async observe(collectionTime, timeoutMillis) { - const callbackFutures = this._observeCallbacks(collectionTime, timeoutMillis); - const batchCallbackFutures = this._observeBatchCallbacks(collectionTime, timeoutMillis); - return (await (0, utils_1.PromiseAllSettled)([...callbackFutures, ...batchCallbackFutures])).filter(utils_1.isPromiseAllSettledRejectionResult).map((it) => it.reason); + }); + var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector(); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; } - _observeCallbacks(observationTime, timeoutMillis) { - return this._callbacks.map(async ({ callback, instrument }) => { - const observableResult = new ObservableResult_1.ObservableResultImpl(instrument._descriptor.name, instrument._descriptor.valueType); - let callPromise = Promise.resolve(callback(observableResult)); - if (timeoutMillis != null) callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); - await callPromise; - instrument._metricStorages.forEach((metricStorage) => { - metricStorage.record(observableResult._buffer, observationTime); - }); - }); + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js +var require_platform$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; + var node_1 = require_node$2(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return node_1.hostDetector; } - _observeBatchCallbacks(observationTime, timeoutMillis) { - return this._batchCallbacks.map(async ({ callback, instruments }) => { - const observableResult = new ObservableResult_1.BatchObservableResultImpl(); - let callPromise = Promise.resolve(callback(observableResult)); - if (timeoutMillis != null) callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); - await callPromise; - instruments.forEach((instrument) => { - const buffer = observableResult._buffer.get(instrument); - if (buffer == null) return; - instrument._metricStorages.forEach((metricStorage) => { - metricStorage.record(buffer, observationTime); - }); - }); - }); + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return node_1.osDetector; } - _findCallback(callback, instrument) { - return this._callbacks.findIndex((record$1) => { - return record$1.callback === callback && record$1.instrument === instrument; - }); + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return node_1.processDetector; } - _findBatchCallback(callback, instruments) { - return this._batchCallbacks.findIndex((record$1) => { - return record$1.callback === callback && (0, utils_1.setEquals)(record$1.instruments, instruments); - }); + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return node_1.serviceInstanceIdDetector; } - }; - exports.ObservableRegistry = ObservableRegistry; + }); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/SyncMetricStorage.js -var require_SyncMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js +var require_NoopDetector = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.SyncMetricStorage = void 0; - const MetricStorage_1 = require_MetricStorage(); - const DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); - const TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); - /** - * Internal interface. - * - * Stores and aggregates {@link MetricData} for synchronous instruments. - */ - var SyncMetricStorage = class extends MetricStorage_1.MetricStorage { - _attributesProcessor; - _aggregationCardinalityLimit; - _deltaMetricStorage; - _temporalMetricStorage; - constructor(instrumentDescriptor, aggregator, _attributesProcessor, collectorHandles, _aggregationCardinalityLimit) { - super(instrumentDescriptor); - this._attributesProcessor = _attributesProcessor; - this._aggregationCardinalityLimit = _aggregationCardinalityLimit; - this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); - this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); - } - record(value, attributes, context$1, recordTime) { - attributes = this._attributesProcessor.process(attributes, context$1); - this._deltaMetricStorage.record(value, attributes, context$1, recordTime); - } - /** - * Collects the metrics from this storage. - * - * Note: This is a stateful operation and may reset any interval-related - * state for the MetricCollector. - */ - collect(collector, collectionTime) { - const accumulations = this._deltaMetricStorage.collect(); - return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); + exports.noopDetector = exports.NoopDetector = void 0; + var NoopDetector = class { + detect() { + return { attributes: {} }; } }; - exports.SyncMetricStorage = SyncMetricStorage; + exports.NoopDetector = NoopDetector; + exports.noopDetector = new NoopDetector(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/AttributesProcessor.js -var require_AttributesProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/index.js +var require_detectors = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.createMultiAttributesProcessor = exports.createNoopAttributesProcessor = void 0; - var NoopAttributesProcessor = class { - process(incoming, _context) { - return incoming; - } - }; - var MultiAttributesProcessor = class { - _processors; - constructor(_processors) { - this._processors = _processors; + exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = void 0; + var EnvDetector_1 = require_EnvDetector(); + Object.defineProperty(exports, "envDetector", { + enumerable: true, + get: function() { + return EnvDetector_1.envDetector; } - process(incoming, context$1) { - let filteredAttributes = incoming; - for (const processor of this._processors) filteredAttributes = processor.process(filteredAttributes, context$1); - return filteredAttributes; + }); + var platform_1 = require_platform$2(); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return platform_1.hostDetector; } - }; - var AllowListProcessor = class { - _allowedAttributeNames; - constructor(_allowedAttributeNames) { - this._allowedAttributeNames = _allowedAttributeNames; + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return platform_1.osDetector; } - process(incoming, _context) { - const filteredAttributes = {}; - Object.keys(incoming).filter((attributeName) => this._allowedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); - return filteredAttributes; + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return platform_1.processDetector; } - }; - var DenyListProcessor = class { - _deniedAttributeNames; - constructor(_deniedAttributeNames) { - this._deniedAttributeNames = _deniedAttributeNames; + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return platform_1.serviceInstanceIdDetector; } - process(incoming, _context) { - const filteredAttributes = {}; - Object.keys(incoming).filter((attributeName) => !this._deniedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); - return filteredAttributes; + }); + var NoopDetector_1 = require_NoopDetector(); + Object.defineProperty(exports, "noopDetector", { + enumerable: true, + get: function() { + return NoopDetector_1.noopDetector; } - }; - /** - * @internal - * - * Create an {@link IAttributesProcessor} that acts as a simple pass-through for attributes. - */ - function createNoopAttributesProcessor() { - return NOOP; - } - exports.createNoopAttributesProcessor = createNoopAttributesProcessor; - /** - * @internal - * - * Create an {@link IAttributesProcessor} that applies all processors from the provided list in order. - * - * @param processors Processors to apply in order. - */ - function createMultiAttributesProcessor(processors) { - return new MultiAttributesProcessor(processors); - } - exports.createMultiAttributesProcessor = createMultiAttributesProcessor; - /** - * Create an {@link IAttributesProcessor} that filters by allowed attribute names and drops any names that are not in the - * allow list. - */ - function createAllowListAttributesProcessor(attributeAllowList) { - return new AllowListProcessor(attributeAllowList); - } - exports.createAllowListAttributesProcessor = createAllowListAttributesProcessor; - /** - * Create an {@link IAttributesProcessor} that drops attributes based on the names provided in the deny list - */ - function createDenyListAttributesProcessor(attributeDenyList) { - return new DenyListProcessor(attributeDenyList); - } - exports.createDenyListAttributesProcessor = createDenyListAttributesProcessor; - const NOOP = new NoopAttributesProcessor(); + }); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterSharedState.js -var require_MeterSharedState = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/index.js +var require_src$6 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.MeterSharedState = void 0; - const InstrumentDescriptor_1 = require_InstrumentDescriptor(); - const Meter_1 = require_Meter(); - const utils_1 = require_utils$4(); - const AsyncMetricStorage_1 = require_AsyncMetricStorage(); - const MetricStorageRegistry_1 = require_MetricStorageRegistry(); - const MultiWritableMetricStorage_1 = require_MultiWritableMetricStorage(); - const ObservableRegistry_1 = require_ObservableRegistry(); - const SyncMetricStorage_1 = require_SyncMetricStorage(); - const AttributesProcessor_1 = require_AttributesProcessor(); - /** - * An internal record for shared meter provider states. - */ - var MeterSharedState = class { - _meterProviderSharedState; - _instrumentationScope; - metricStorageRegistry = new MetricStorageRegistry_1.MetricStorageRegistry(); - observableRegistry = new ObservableRegistry_1.ObservableRegistry(); - meter; - constructor(_meterProviderSharedState, _instrumentationScope) { - this._meterProviderSharedState = _meterProviderSharedState; - this._instrumentationScope = _instrumentationScope; - this.meter = new Meter_1.Meter(this); + exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = void 0; + var detect_resources_1 = require_detect_resources(); + Object.defineProperty(exports, "detectResources", { + enumerable: true, + get: function() { + return detect_resources_1.detectResources; } - registerMetricStorage(descriptor) { - const storages = this._registerMetricStorage(descriptor, SyncMetricStorage_1.SyncMetricStorage); - if (storages.length === 1) return storages[0]; - return new MultiWritableMetricStorage_1.MultiMetricStorage(storages); + }); + var detectors_1 = require_detectors(); + Object.defineProperty(exports, "envDetector", { + enumerable: true, + get: function() { + return detectors_1.envDetector; } - registerAsyncMetricStorage(descriptor) { - return this._registerMetricStorage(descriptor, AsyncMetricStorage_1.AsyncMetricStorage); + }); + Object.defineProperty(exports, "hostDetector", { + enumerable: true, + get: function() { + return detectors_1.hostDetector; } - /** - * @param collector opaque handle of {@link MetricCollector} which initiated the collection. - * @param collectionTime the HrTime at which the collection was initiated. - * @param options options for collection. - * @returns the list of metric data collected. - */ - async collect(collector, collectionTime, options) { - /** - * 1. Call all observable callbacks first. - * 2. Collect metric result for the collector. - */ - const errors = await this.observableRegistry.observe(collectionTime, options?.timeoutMillis); - const storages = this.metricStorageRegistry.getStorages(collector); - if (storages.length === 0) return null; - const metricDataList = storages.map((metricStorage) => { - return metricStorage.collect(collector, collectionTime); - }).filter(utils_1.isNotNullish); - if (metricDataList.length === 0) return { errors }; - return { - scopeMetrics: { - scope: this._instrumentationScope, - metrics: metricDataList - }, - errors - }; + }); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return detectors_1.osDetector; } - _registerMetricStorage(descriptor, MetricStorageType) { - let storages = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationScope).map((view) => { - const viewDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptorWithView)(view, descriptor); - const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleStorage(viewDescriptor); - if (compatibleStorage != null) return compatibleStorage; - const viewStorage = new MetricStorageType(viewDescriptor, view.aggregation.createAggregator(viewDescriptor), view.attributesProcessor, this._meterProviderSharedState.metricCollectors, view.aggregationCardinalityLimit); - this.metricStorageRegistry.register(viewStorage); - return viewStorage; - }); - if (storages.length === 0) { - const collectorStorages = this._meterProviderSharedState.selectAggregations(descriptor.type).map(([collector, aggregation]) => { - const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(collector, descriptor); - if (compatibleStorage != null) return compatibleStorage; - const aggregator = aggregation.createAggregator(descriptor); - const cardinalityLimit = collector.selectCardinalityLimit(descriptor.type); - const storage = new MetricStorageType(descriptor, aggregator, (0, AttributesProcessor_1.createNoopAttributesProcessor)(), [collector], cardinalityLimit); - this.metricStorageRegistry.registerForCollector(collector, storage); - return storage; - }); - storages = storages.concat(collectorStorages); - } - return storages; + }); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return detectors_1.processDetector; + } + }); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return detectors_1.serviceInstanceIdDetector; + } + }); + var ResourceImpl_1 = require_ResourceImpl(); + Object.defineProperty(exports, "resourceFromAttributes", { + enumerable: true, + get: function() { + return ResourceImpl_1.resourceFromAttributes; } - }; - exports.MeterSharedState = MeterSharedState; + }); + Object.defineProperty(exports, "defaultResource", { + enumerable: true, + get: function() { + return ResourceImpl_1.defaultResource; + } + }); + Object.defineProperty(exports, "emptyResource", { + enumerable: true, + get: function() { + return ResourceImpl_1.emptyResource; + } + }); + var default_service_name_1 = require_default_service_name(); + Object.defineProperty(exports, "defaultServiceName", { + enumerable: true, + get: function() { + return default_service_name_1.defaultServiceName; + } + }); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterProviderSharedState.js -var require_MeterProviderSharedState = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/ViewRegistry.js +var require_ViewRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.MeterProviderSharedState = void 0; - const utils_1 = require_utils$4(); - const ViewRegistry_1 = require_ViewRegistry(); - const MeterSharedState_1 = require_MeterSharedState(); - const AggregationOption_1 = require_AggregationOption(); - /** - * An internal record for shared meter provider states. - */ - var MeterProviderSharedState = class { - resource; - viewRegistry = new ViewRegistry_1.ViewRegistry(); - metricCollectors = []; - meterSharedStates = /* @__PURE__ */ new Map(); - constructor(resource) { - this.resource = resource; + exports.ViewRegistry = void 0; + var ViewRegistry = class { + _registeredViews = []; + addView(view) { + this._registeredViews.push(view); } - getMeterSharedState(instrumentationScope) { - const id = (0, utils_1.instrumentationScopeId)(instrumentationScope); - let meterSharedState = this.meterSharedStates.get(id); - if (meterSharedState == null) { - meterSharedState = new MeterSharedState_1.MeterSharedState(this, instrumentationScope); - this.meterSharedStates.set(id, meterSharedState); - } - return meterSharedState; + findViews(instrument, meter) { + return this._registeredViews.filter((registeredView) => { + return this._matchInstrument(registeredView.instrumentSelector, instrument) && this._matchMeter(registeredView.meterSelector, meter); + }); } - selectAggregations(instrumentType) { - const result = []; - for (const collector of this.metricCollectors) result.push([collector, (0, AggregationOption_1.toAggregation)(collector.selectAggregation(instrumentType))]); - return result; + _matchInstrument(selector, instrument) { + return (selector.getType() === void 0 || instrument.type === selector.getType()) && selector.getNameFilter().match(instrument.name) && selector.getUnitFilter().match(instrument.unit); + } + _matchMeter(selector, meter) { + return selector.getNameFilter().match(meter.name) && (meter.version === void 0 || selector.getVersionFilter().match(meter.version)) && (meter.schemaUrl === void 0 || selector.getSchemaUrlFilter().match(meter.schemaUrl)); } }; - exports.MeterProviderSharedState = MeterProviderSharedState; + exports.ViewRegistry = ViewRegistry; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricCollector.js -var require_MetricCollector = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/InstrumentDescriptor.js +var require_InstrumentDescriptor = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.MetricCollector = void 0; - const core_1 = require_src$8(); - /** - * An internal opaque interface that the MetricReader receives as - * MetricProducer. It acts as the storage key to the internal metric stream - * state for each MetricReader. - */ - var MetricCollector = class { - _sharedState; - _metricReader; - constructor(_sharedState, _metricReader) { - this._sharedState = _sharedState; - this._metricReader = _metricReader; + exports.isValidName = exports.isDescriptorCompatibleWith = exports.createInstrumentDescriptorWithView = exports.createInstrumentDescriptor = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const utils_1 = require_utils$3(); + function createInstrumentDescriptor(name, type, options) { + if (!isValidName(name)) api_1.diag.warn(`Invalid metric name: "${name}". The metric name should be a ASCII string with a length no greater than 255 characters.`); + return { + name, + type, + description: options?.description ?? "", + unit: options?.unit ?? "", + valueType: options?.valueType ?? api_1.ValueType.DOUBLE, + advice: options?.advice ?? {} + }; + } + exports.createInstrumentDescriptor = createInstrumentDescriptor; + function createInstrumentDescriptorWithView(view, instrument) { + return { + name: view.name ?? instrument.name, + description: view.description ?? instrument.description, + type: instrument.type, + unit: instrument.unit, + valueType: instrument.valueType, + advice: instrument.advice + }; + } + exports.createInstrumentDescriptorWithView = createInstrumentDescriptorWithView; + function isDescriptorCompatibleWith(descriptor, otherDescriptor) { + return (0, utils_1.equalsCaseInsensitive)(descriptor.name, otherDescriptor.name) && descriptor.unit === otherDescriptor.unit && descriptor.type === otherDescriptor.type && descriptor.valueType === otherDescriptor.valueType; + } + exports.isDescriptorCompatibleWith = isDescriptorCompatibleWith; + const NAME_REGEXP = /^[a-z][a-z0-9_.\-/]{0,254}$/i; + function isValidName(name) { + return NAME_REGEXP.test(name); + } + exports.isValidName = isValidName; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/Instruments.js +var require_Instruments = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isObservableInstrument = exports.ObservableUpDownCounterInstrument = exports.ObservableGaugeInstrument = exports.ObservableCounterInstrument = exports.ObservableInstrument = exports.HistogramInstrument = exports.GaugeInstrument = exports.CounterInstrument = exports.UpDownCounterInstrument = exports.SyncInstrument = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + var SyncInstrument = class { + _writableMetricStorage; + _descriptor; + constructor(writableMetricStorage, descriptor) { + this._writableMetricStorage = writableMetricStorage; + this._descriptor = descriptor; } - async collect(options) { - const collectionTime = (0, core_1.millisToHrTime)(Date.now()); - const scopeMetrics = []; - const errors = []; - const meterCollectionPromises = Array.from(this._sharedState.meterSharedStates.values()).map(async (meterSharedState) => { - const current = await meterSharedState.collect(this, collectionTime, options); - if (current?.scopeMetrics != null) scopeMetrics.push(current.scopeMetrics); - if (current?.errors != null) errors.push(...current.errors); - }); - await Promise.all(meterCollectionPromises); - return { - resourceMetrics: { - resource: this._sharedState.resource, - scopeMetrics - }, - errors - }; + _record(value, attributes = {}, context) { + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${value}`); + return; + } + if (this._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) return; + } + this._writableMetricStorage.record(value, attributes, context, Date.now()); } + }; + exports.SyncInstrument = SyncInstrument; + /** + * The class implements {@link UpDownCounter} interface. + */ + var UpDownCounterInstrument = class extends SyncInstrument { /** - * Delegates for MetricReader.forceFlush. + * Increment value of counter by the input. Inputs may be negative. */ - async forceFlush(options) { - await this._metricReader.forceFlush(options); + add(value, attributes, ctx) { + this._record(value, attributes, ctx); } + }; + exports.UpDownCounterInstrument = UpDownCounterInstrument; + /** + * The class implements {@link Counter} interface. + */ + var CounterInstrument = class extends SyncInstrument { /** - * Delegates for MetricReader.shutdown. + * Increment value of counter by the input. Inputs may not be negative. */ - async shutdown(options) { - await this._metricReader.shutdown(options); - } - selectAggregationTemporality(instrumentType) { - return this._metricReader.selectAggregationTemporality(instrumentType); - } - selectAggregation(instrumentType) { - return this._metricReader.selectAggregation(instrumentType); + add(value, attributes, ctx) { + if (value < 0) { + api_1.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${value}`); + return; + } + this._record(value, attributes, ctx); } + }; + exports.CounterInstrument = CounterInstrument; + /** + * The class implements {@link Gauge} interface. + */ + var GaugeInstrument = class extends SyncInstrument { /** - * Select the cardinality limit for the given {@link InstrumentType} for this - * collector. + * Records a measurement. */ - selectCardinalityLimit(instrumentType) { - return this._metricReader.selectCardinalityLimit?.(instrumentType) ?? 2e3; + record(value, attributes, ctx) { + this._record(value, attributes, ctx); } }; - exports.MetricCollector = MetricCollector; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/Predicate.js -var require_Predicate = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExactPredicate = exports.PatternPredicate = void 0; - const ESCAPE = /[\^$\\.+?()[\]{}|]/g; + exports.GaugeInstrument = GaugeInstrument; /** - * Wildcard pattern predicate, supports patterns like `*`, `foo*`, `*bar`. + * The class implements {@link Histogram} interface. */ - var PatternPredicate = class PatternPredicate { - _matchAll; - _regexp; - constructor(pattern) { - if (pattern === "*") { - this._matchAll = true; - this._regexp = /.*/; - } else { - this._matchAll = false; - this._regexp = new RegExp(PatternPredicate.escapePattern(pattern)); - } - } - match(str) { - if (this._matchAll) return true; - return this._regexp.test(str); - } - static escapePattern(pattern) { - return `^${pattern.replace(ESCAPE, "\\$&").replace("*", ".*")}$`; - } - static hasWildcard(pattern) { - return pattern.includes("*"); - } - }; - exports.PatternPredicate = PatternPredicate; - var ExactPredicate = class { - _matchAll; - _pattern; - constructor(pattern) { - this._matchAll = pattern === void 0; - this._pattern = pattern; - } - match(str) { - if (this._matchAll) return true; - if (str === this._pattern) return true; - return false; + var HistogramInstrument = class extends SyncInstrument { + /** + * Records a measurement. Value of the measurement must not be negative. + */ + record(value, attributes, ctx) { + if (value < 0) { + api_1.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${value}`); + return; + } + this._record(value, attributes, ctx); } }; - exports.ExactPredicate = ExactPredicate; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/InstrumentSelector.js -var require_InstrumentSelector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.InstrumentSelector = void 0; - const Predicate_1 = require_Predicate(); - var InstrumentSelector = class { - _nameFilter; - _type; - _unitFilter; - constructor(criteria) { - this._nameFilter = new Predicate_1.PatternPredicate(criteria?.name ?? "*"); - this._type = criteria?.type; - this._unitFilter = new Predicate_1.ExactPredicate(criteria?.unit); - } - getType() { - return this._type; + exports.HistogramInstrument = HistogramInstrument; + var ObservableInstrument = class { + /** @internal */ + _metricStorages; + /** @internal */ + _descriptor; + _observableRegistry; + constructor(descriptor, metricStorages, observableRegistry) { + this._descriptor = descriptor; + this._metricStorages = metricStorages; + this._observableRegistry = observableRegistry; } - getNameFilter() { - return this._nameFilter; + /** + * @see {Observable.addCallback} + */ + addCallback(callback) { + this._observableRegistry.addCallback(callback, this); } - getUnitFilter() { - return this._unitFilter; + /** + * @see {Observable.removeCallback} + */ + removeCallback(callback) { + this._observableRegistry.removeCallback(callback, this); } }; - exports.InstrumentSelector = InstrumentSelector; + exports.ObservableInstrument = ObservableInstrument; + var ObservableCounterInstrument = class extends ObservableInstrument {}; + exports.ObservableCounterInstrument = ObservableCounterInstrument; + var ObservableGaugeInstrument = class extends ObservableInstrument {}; + exports.ObservableGaugeInstrument = ObservableGaugeInstrument; + var ObservableUpDownCounterInstrument = class extends ObservableInstrument {}; + exports.ObservableUpDownCounterInstrument = ObservableUpDownCounterInstrument; + function isObservableInstrument(it) { + return it instanceof ObservableInstrument; + } + exports.isObservableInstrument = isObservableInstrument; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/MeterSelector.js -var require_MeterSelector = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/Meter.js +var require_Meter = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.MeterSelector = void 0; - const Predicate_1 = require_Predicate(); - var MeterSelector = class { - _nameFilter; - _versionFilter; - _schemaUrlFilter; - constructor(criteria) { - this._nameFilter = new Predicate_1.ExactPredicate(criteria?.name); - this._versionFilter = new Predicate_1.ExactPredicate(criteria?.version); - this._schemaUrlFilter = new Predicate_1.ExactPredicate(criteria?.schemaUrl); + exports.Meter = void 0; + const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + const Instruments_1 = require_Instruments(); + const MetricData_1 = require_MetricData(); + /** + * This class implements the {@link IMeter} interface. + */ + var Meter = class { + _meterSharedState; + constructor(meterSharedState) { + this._meterSharedState = meterSharedState; } - getNameFilter() { - return this._nameFilter; + /** + * Create a {@link Gauge} instrument. + */ + createGauge(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.GAUGE, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.GaugeInstrument(storage, descriptor); } /** - * TODO: semver filter? no spec yet. + * Create a {@link Histogram} instrument. */ - getVersionFilter() { - return this._versionFilter; + createHistogram(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.HISTOGRAM, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.HistogramInstrument(storage, descriptor); } - getSchemaUrlFilter() { - return this._schemaUrlFilter; + /** + * Create a {@link Counter} instrument. + */ + createCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.COUNTER, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.CounterInstrument(storage, descriptor); } - }; - exports.MeterSelector = MeterSelector; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/View.js -var require_View = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.View = void 0; - const Predicate_1 = require_Predicate(); - const AttributesProcessor_1 = require_AttributesProcessor(); - const InstrumentSelector_1 = require_InstrumentSelector(); - const MeterSelector_1 = require_MeterSelector(); - const AggregationOption_1 = require_AggregationOption(); - function isSelectorNotProvided(options) { - return options.instrumentName == null && options.instrumentType == null && options.instrumentUnit == null && options.meterName == null && options.meterVersion == null && options.meterSchemaUrl == null; - } - function validateViewOptions(viewOptions) { - if (isSelectorNotProvided(viewOptions)) throw new Error("Cannot create view with no selector arguments supplied"); - if (viewOptions.name != null && (viewOptions?.instrumentName == null || Predicate_1.PatternPredicate.hasWildcard(viewOptions.instrumentName))) throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter."); - } - /** - * Can be passed to a {@link MeterProvider} to select instruments and alter their metric stream. - */ - var View = class { - name; - description; - aggregation; - attributesProcessor; - instrumentSelector; - meterSelector; - aggregationCardinalityLimit; /** - * Create a new {@link View} instance. - * - * Parameters can be categorized as two types: - * Instrument selection criteria: Used to describe the instrument(s) this view will be applied to. - * Will be treated as additive (the Instrument has to meet all the provided criteria to be selected). - * - * Metric stream altering: Alter the metric stream of instruments selected by instrument selection criteria. - * - * @param viewOptions {@link ViewOptions} for altering the metric stream and instrument selection. - * @param viewOptions.name - * Alters the metric stream: - * This will be used as the name of the metrics stream. - * If not provided, the original Instrument name will be used. - * @param viewOptions.description - * Alters the metric stream: - * This will be used as the description of the metrics stream. - * If not provided, the original Instrument description will be used by default. - * @param viewOptions.attributesProcessors - * Alters the metric stream: - * If provided, the attributes will be modified as defined by the added processors. - * If not provided, all attribute keys will be used by default. - * @param viewOptions.aggregationCardinalityLimit - * Alters the metric stream: - * Sets a limit on the number of unique attribute combinations (cardinality) that can be aggregated. - * If not provided, the default limit of 2000 will be used. - * @param viewOptions.aggregation - * Alters the metric stream: - * Alters the {@link Aggregation} of the metric stream. - * @param viewOptions.instrumentName - * Instrument selection criteria: - * Original name of the Instrument(s) with wildcard support. - * @param viewOptions.instrumentType - * Instrument selection criteria: - * The original type of the Instrument(s). - * @param viewOptions.instrumentUnit - * Instrument selection criteria: - * The unit of the Instrument(s). - * @param viewOptions.meterName - * Instrument selection criteria: - * The name of the Meter. No wildcard support, name must match the meter exactly. - * @param viewOptions.meterVersion - * Instrument selection criteria: - * The version of the Meter. No wildcard support, version must match exactly. - * @param viewOptions.meterSchemaUrl - * Instrument selection criteria: - * The schema URL of the Meter. No wildcard support, schema URL must match exactly. - * - * @example - * // Create a view that changes the Instrument 'my.instrument' to use to an - * // ExplicitBucketHistogramAggregation with the boundaries [20, 30, 40] - * new View({ - * aggregation: new ExplicitBucketHistogramAggregation([20, 30, 40]), - * instrumentName: 'my.instrument' - * }) + * Create a {@link UpDownCounter} instrument. */ - constructor(viewOptions) { - validateViewOptions(viewOptions); - if (viewOptions.attributesProcessors != null) this.attributesProcessor = (0, AttributesProcessor_1.createMultiAttributesProcessor)(viewOptions.attributesProcessors); - else this.attributesProcessor = (0, AttributesProcessor_1.createNoopAttributesProcessor)(); - this.name = viewOptions.name; - this.description = viewOptions.description; - this.aggregation = (0, AggregationOption_1.toAggregation)(viewOptions.aggregation ?? { type: AggregationOption_1.AggregationType.DEFAULT }); - this.instrumentSelector = new InstrumentSelector_1.InstrumentSelector({ - name: viewOptions.instrumentName, - type: viewOptions.instrumentType, - unit: viewOptions.instrumentUnit - }); - this.meterSelector = new MeterSelector_1.MeterSelector({ - name: viewOptions.meterName, - version: viewOptions.meterVersion, - schemaUrl: viewOptions.meterSchemaUrl - }); - this.aggregationCardinalityLimit = viewOptions.aggregationCardinalityLimit; + createUpDownCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.UP_DOWN_COUNTER, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.UpDownCounterInstrument(storage, descriptor); } - }; - exports.View = View; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider.js -var require_MeterProvider = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.MeterProvider = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const resources_1 = require_src$7(); - const MeterProviderSharedState_1 = require_MeterProviderSharedState(); - const MetricCollector_1 = require_MetricCollector(); - const View_1 = require_View(); - /** - * This class implements the {@link MeterProvider} interface. - */ - var MeterProvider = class { - _sharedState; - _shutdown = false; - constructor(options) { - this._sharedState = new MeterProviderSharedState_1.MeterProviderSharedState(options?.resource ?? (0, resources_1.defaultResource)()); - if (options?.views != null && options.views.length > 0) for (const viewOption of options.views) this._sharedState.viewRegistry.addView(new View_1.View(viewOption)); - if (options?.readers != null && options.readers.length > 0) for (const metricReader of options.readers) { - const collector = new MetricCollector_1.MetricCollector(this._sharedState, metricReader); - metricReader.setMetricProducer(collector); - this._sharedState.metricCollectors.push(collector); - } + /** + * Create a {@link ObservableGauge} instrument. + */ + createObservableGauge(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_GAUGE, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableGaugeInstrument(descriptor, storages, this._meterSharedState.observableRegistry); } /** - * Get a meter with the configuration of the MeterProvider. + * Create a {@link ObservableCounter} instrument. */ - getMeter(name, version$1 = "", options = {}) { - if (this._shutdown) { - api_1.diag.warn("A shutdown MeterProvider cannot provide a Meter"); - return (0, api_1.createNoopMeter)(); - } - return this._sharedState.getMeterSharedState({ - name, - version: version$1, - schemaUrl: options.schemaUrl - }).meter; + createObservableCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_COUNTER, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); } /** - * Shut down the MeterProvider and all registered - * MetricReaders. - * - * Returns a promise which is resolved when all flushes are complete. + * Create a {@link ObservableUpDownCounter} instrument. */ - async shutdown(options) { - if (this._shutdown) { - api_1.diag.warn("shutdown may only be called once per MeterProvider"); - return; - } - this._shutdown = true; - await Promise.all(this._sharedState.metricCollectors.map((collector) => { - return collector.shutdown(options); - })); + createObservableUpDownCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, MetricData_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableUpDownCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); } /** - * Notifies all registered MetricReaders to flush any buffered data. - * - * Returns a promise which is resolved when all flushes are complete. + * @see {@link Meter.addBatchObservableCallback} */ - async forceFlush(options) { - if (this._shutdown) { - api_1.diag.warn("invalid attempt to force flush after MeterProvider shutdown"); - return; - } - await Promise.all(this._sharedState.metricCollectors.map((collector) => { - return collector.forceFlush(options); - })); + addBatchObservableCallback(callback, observables) { + this._meterSharedState.observableRegistry.addBatchCallback(callback, observables); + } + /** + * @see {@link Meter.removeBatchObservableCallback} + */ + removeBatchObservableCallback(callback, observables) { + this._meterSharedState.observableRegistry.removeBatchCallback(callback, observables); } }; - exports.MeterProvider = MeterProvider; + exports.Meter = Meter; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.1.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/index.js -var require_src$6 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorage.js +var require_MetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.TimeoutError = exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.AggregationType = exports.MeterProvider = exports.ConsoleMetricExporter = exports.InMemoryMetricExporter = exports.PeriodicExportingMetricReader = exports.MetricReader = exports.InstrumentType = exports.DataPointType = exports.AggregationTemporality = void 0; - var AggregationTemporality_1 = require_AggregationTemporality(); - Object.defineProperty(exports, "AggregationTemporality", { - enumerable: true, - get: function() { - return AggregationTemporality_1.AggregationTemporality; + exports.MetricStorage = void 0; + const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + /** + * Internal interface. + * + * Represents a storage from which we can collect metrics. + */ + var MetricStorage = class { + _instrumentDescriptor; + constructor(instrumentDescriptor) { + this._instrumentDescriptor = instrumentDescriptor; } - }); - var MetricData_1 = require_MetricData(); - Object.defineProperty(exports, "DataPointType", { - enumerable: true, - get: function() { - return MetricData_1.DataPointType; + getInstrumentDescriptor() { + return this._instrumentDescriptor; } - }); - Object.defineProperty(exports, "InstrumentType", { - enumerable: true, - get: function() { - return MetricData_1.InstrumentType; + updateDescription(description) { + this._instrumentDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(this._instrumentDescriptor.name, this._instrumentDescriptor.type, { + description, + valueType: this._instrumentDescriptor.valueType, + unit: this._instrumentDescriptor.unit, + advice: this._instrumentDescriptor.advice + }); } - }); - var MetricReader_1 = require_MetricReader(); - Object.defineProperty(exports, "MetricReader", { - enumerable: true, - get: function() { - return MetricReader_1.MetricReader; + }; + exports.MetricStorage = MetricStorage; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/HashMap.js +var require_HashMap = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AttributeHashMap = exports.HashMap = void 0; + const utils_1 = require_utils$3(); + var HashMap = class { + _valueMap = /* @__PURE__ */ new Map(); + _keyMap = /* @__PURE__ */ new Map(); + _hash; + constructor(hash) { + this._hash = hash; } - }); - var PeriodicExportingMetricReader_1 = require_PeriodicExportingMetricReader(); - Object.defineProperty(exports, "PeriodicExportingMetricReader", { - enumerable: true, - get: function() { - return PeriodicExportingMetricReader_1.PeriodicExportingMetricReader; + get(key, hashCode) { + hashCode ??= this._hash(key); + return this._valueMap.get(hashCode); } - }); - var InMemoryMetricExporter_1 = require_InMemoryMetricExporter(); - Object.defineProperty(exports, "InMemoryMetricExporter", { - enumerable: true, - get: function() { - return InMemoryMetricExporter_1.InMemoryMetricExporter; + getOrDefault(key, defaultFactory) { + const hash = this._hash(key); + if (this._valueMap.has(hash)) return this._valueMap.get(hash); + const val = defaultFactory(); + if (!this._keyMap.has(hash)) this._keyMap.set(hash, key); + this._valueMap.set(hash, val); + return val; } - }); - var ConsoleMetricExporter_1 = require_ConsoleMetricExporter(); - Object.defineProperty(exports, "ConsoleMetricExporter", { - enumerable: true, - get: function() { - return ConsoleMetricExporter_1.ConsoleMetricExporter; + set(key, value, hashCode) { + hashCode ??= this._hash(key); + if (!this._keyMap.has(hashCode)) this._keyMap.set(hashCode, key); + this._valueMap.set(hashCode, value); } - }); - var MeterProvider_1 = require_MeterProvider(); - Object.defineProperty(exports, "MeterProvider", { - enumerable: true, - get: function() { - return MeterProvider_1.MeterProvider; + has(key, hashCode) { + hashCode ??= this._hash(key); + return this._valueMap.has(hashCode); } - }); - var AggregationOption_1 = require_AggregationOption(); - Object.defineProperty(exports, "AggregationType", { - enumerable: true, - get: function() { - return AggregationOption_1.AggregationType; + *keys() { + const keyIterator = this._keyMap.entries(); + let next = keyIterator.next(); + while (next.done !== true) { + yield [next.value[1], next.value[0]]; + next = keyIterator.next(); + } } - }); - var AttributesProcessor_1 = require_AttributesProcessor(); - Object.defineProperty(exports, "createAllowListAttributesProcessor", { - enumerable: true, - get: function() { - return AttributesProcessor_1.createAllowListAttributesProcessor; + *entries() { + const valueIterator = this._valueMap.entries(); + let next = valueIterator.next(); + while (next.done !== true) { + yield [ + this._keyMap.get(next.value[0]), + next.value[1], + next.value[0] + ]; + next = valueIterator.next(); + } } - }); - Object.defineProperty(exports, "createDenyListAttributesProcessor", { - enumerable: true, - get: function() { - return AttributesProcessor_1.createDenyListAttributesProcessor; + get size() { + return this._valueMap.size; } - }); - var utils_1 = require_utils$4(); - Object.defineProperty(exports, "TimeoutError", { - enumerable: true, - get: function() { - return utils_1.TimeoutError; + }; + exports.HashMap = HashMap; + var AttributeHashMap = class extends HashMap { + constructor() { + super(utils_1.hashAttributes); } - }); + }; + exports.AttributeHashMap = AttributeHashMap; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal-types.js -var require_internal_types = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.EAggregationTemporality = void 0; - (function(EAggregationTemporality) { - EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"; - /** DELTA is an AggregationTemporality for a metric aggregator which reports - changes since last report time. Successive metrics contain aggregation of - values from continuous and non-overlapping intervals. - - The values for a DELTA metric are based only on the time interval - associated with one measurement cycle. There is no dependency on - previous measurements like is the case for CUMULATIVE metrics. - - For example, consider a system measuring the number of requests that - it receives and reports the sum of these requests every second as a - DELTA metric: - - 1. The system starts receiving at time=t_0. - 2. A request is received, the system measures 1 request. - 3. A request is received, the system measures 1 request. - 4. A request is received, the system measures 1 request. - 5. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_0 to - t_0+1 with a value of 3. - 6. A request is received, the system measures 1 request. - 7. A request is received, the system measures 1 request. - 8. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_0+1 to - t_0+2 with a value of 2. */ - EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_DELTA"] = 1] = "AGGREGATION_TEMPORALITY_DELTA"; - /** CUMULATIVE is an AggregationTemporality for a metric aggregator which - reports changes since a fixed start time. This means that current values - of a CUMULATIVE metric depend on all previous measurements since the - start time. Because of this, the sender is required to retain this state - in some form. If this state is lost or invalidated, the CUMULATIVE metric - values MUST be reset and a new fixed start time following the last - reported measurement time sent MUST be used. - - For example, consider a system measuring the number of requests that - it receives and reports the sum of these requests every second as a - CUMULATIVE metric: - - 1. The system starts receiving at time=t_0. - 2. A request is received, the system measures 1 request. - 3. A request is received, the system measures 1 request. - 4. A request is received, the system measures 1 request. - 5. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_0 to - t_0+1 with a value of 3. - 6. A request is received, the system measures 1 request. - 7. A request is received, the system measures 1 request. - 8. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_0 to - t_0+2 with a value of 5. - 9. The system experiences a fault and loses state. - 10. The system recovers and resumes receiving at time=t_1. - 11. A request is received, the system measures 1 request. - 12. The 1 second collection cycle ends. A metric is exported for the - number of requests received over the interval of time t_1 to - t_0+1 with a value of 1. - - Note: Even though, when reporting changes since last report time, using - CUMULATIVE is valid, it is not recommended. This may cause problems for - systems that do not use start_time to determine when the aggregation - value was reset (e.g. Prometheus). */ - EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"; - })(exports.EAggregationTemporality || (exports.EAggregationTemporality = {})); +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/DeltaMetricProcessor.js +var require_DeltaMetricProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DeltaMetricProcessor = void 0; + const core_1 = require_src$8(); + const utils_1 = require_utils$3(); + const HashMap_1 = require_HashMap(); + /** + * Internal interface. + * + * Allows synchronous collection of metrics. This processor should allow + * allocation of new aggregation cells for metrics and convert cumulative + * recording to delta data points. + */ + var DeltaMetricProcessor = class { + _activeCollectionStorage = new HashMap_1.AttributeHashMap(); + _cumulativeMemoStorage = new HashMap_1.AttributeHashMap(); + _cardinalityLimit; + _overflowAttributes = { "otel.metric.overflow": true }; + _overflowHashCode; + _aggregator; + constructor(aggregator, aggregationCardinalityLimit) { + this._aggregator = aggregator; + this._cardinalityLimit = (aggregationCardinalityLimit ?? 2e3) - 1; + this._overflowHashCode = (0, utils_1.hashAttributes)(this._overflowAttributes); + } + record(value, attributes, collectionTime) { + let accumulation = this._activeCollectionStorage.get(attributes); + if (!accumulation) { + const hrTime = (0, core_1.millisToHrTime)(collectionTime); + if (this._activeCollectionStorage.size >= this._cardinalityLimit) { + this._activeCollectionStorage.getOrDefault(this._overflowAttributes, () => this._aggregator.createAccumulation(hrTime))?.record(value); + return; + } + accumulation = this._aggregator.createAccumulation(hrTime); + this._activeCollectionStorage.set(attributes, accumulation); + } + accumulation?.record(value); + } + batchCumulate(measurements, collectionTime) { + for (const [originalAttributes, value, originalHashCode] of measurements.entries()) { + let attributes = originalAttributes; + let hashCode = originalHashCode; + const accumulation = this._aggregator.createAccumulation(collectionTime); + accumulation?.record(value); + let delta = accumulation; + if (this._cumulativeMemoStorage.has(attributes, hashCode)) { + const previous = this._cumulativeMemoStorage.get(attributes, hashCode); + delta = this._aggregator.diff(previous, accumulation); + } else if (this._cumulativeMemoStorage.size >= this._cardinalityLimit) { + attributes = this._overflowAttributes; + hashCode = this._overflowHashCode; + if (this._cumulativeMemoStorage.has(attributes, hashCode)) { + const previous = this._cumulativeMemoStorage.get(attributes, hashCode); + delta = this._aggregator.diff(previous, accumulation); + } + } + if (this._activeCollectionStorage.has(attributes, hashCode)) { + const active = this._activeCollectionStorage.get(attributes, hashCode); + delta = this._aggregator.merge(active, delta); + } + this._cumulativeMemoStorage.set(attributes, accumulation, hashCode); + this._activeCollectionStorage.set(attributes, delta, hashCode); + } + } + /** + * Returns a collection of delta metrics. Start time is the when first + * time event collected. + */ + collect() { + const unreportedDelta = this._activeCollectionStorage; + this._activeCollectionStorage = new HashMap_1.AttributeHashMap(); + return unreportedDelta; + } + }; + exports.DeltaMetricProcessor = DeltaMetricProcessor; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal.js -var require_internal$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/TemporalMetricProcessor.js +var require_TemporalMetricProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.createExportMetricsServiceRequest = exports.toMetric = exports.toScopeMetrics = exports.toResourceMetrics = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const sdk_metrics_1 = require_src$6(); - const internal_types_1 = require_internal_types(); - const utils_1 = require_utils$5(); - const internal_1 = require_internal$3(); - function toResourceMetrics(resourceMetrics, options) { - const encoder = (0, utils_1.getOtlpEncoder)(options); - const processedResource = (0, internal_1.createResource)(resourceMetrics.resource); - return { - resource: processedResource, - schemaUrl: processedResource.schemaUrl, - scopeMetrics: toScopeMetrics(resourceMetrics.scopeMetrics, encoder) - }; - } - exports.toResourceMetrics = toResourceMetrics; - function toScopeMetrics(scopeMetrics, encoder) { - return Array.from(scopeMetrics.map((metrics$1) => ({ - scope: (0, internal_1.createInstrumentationScope)(metrics$1.scope), - metrics: metrics$1.metrics.map((metricData) => toMetric(metricData, encoder)), - schemaUrl: metrics$1.scope.schemaUrl - }))); - } - exports.toScopeMetrics = toScopeMetrics; - function toMetric(metricData, encoder) { - const out = { - name: metricData.descriptor.name, - description: metricData.descriptor.description, - unit: metricData.descriptor.unit - }; - const aggregationTemporality = toAggregationTemporality(metricData.aggregationTemporality); - switch (metricData.dataPointType) { - case sdk_metrics_1.DataPointType.SUM: - out.sum = { - aggregationTemporality, - isMonotonic: metricData.isMonotonic, - dataPoints: toSingularDataPoints(metricData, encoder) - }; - break; - case sdk_metrics_1.DataPointType.GAUGE: - out.gauge = { dataPoints: toSingularDataPoints(metricData, encoder) }; - break; - case sdk_metrics_1.DataPointType.HISTOGRAM: - out.histogram = { - aggregationTemporality, - dataPoints: toHistogramDataPoints(metricData, encoder) - }; - break; - case sdk_metrics_1.DataPointType.EXPONENTIAL_HISTOGRAM: - out.exponentialHistogram = { - aggregationTemporality, - dataPoints: toExponentialHistogramDataPoints(metricData, encoder) - }; - break; + exports.TemporalMetricProcessor = void 0; + const AggregationTemporality_1 = require_AggregationTemporality(); + const HashMap_1 = require_HashMap(); + /** + * Internal interface. + * + * Provides unique reporting for each collector. Allows synchronous collection + * of metrics and reports given temporality values. + */ + var TemporalMetricProcessor = class TemporalMetricProcessor { + _aggregator; + _unreportedAccumulations = /* @__PURE__ */ new Map(); + _reportHistory = /* @__PURE__ */ new Map(); + constructor(aggregator, collectorHandles) { + this._aggregator = aggregator; + collectorHandles.forEach((handle) => { + this._unreportedAccumulations.set(handle, []); + }); } - return out; - } - exports.toMetric = toMetric; - function toSingularDataPoint(dataPoint, valueType, encoder) { - const out = { - attributes: (0, internal_1.toAttributes)(dataPoint.attributes), - startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), - timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) - }; - switch (valueType) { - case api_1.ValueType.INT: - out.asInt = dataPoint.value; - break; - case api_1.ValueType.DOUBLE: - out.asDouble = dataPoint.value; - break; + /** + * Builds the {@link MetricData} streams to report against a specific MetricCollector. + * @param collector The information of the MetricCollector. + * @param collectors The registered collectors. + * @param instrumentDescriptor The instrumentation descriptor that these metrics generated with. + * @param currentAccumulations The current accumulation of metric data from instruments. + * @param collectionTime The current collection timestamp. + * @returns The {@link MetricData} points or `null`. + */ + buildMetrics(collector, instrumentDescriptor, currentAccumulations, collectionTime) { + this._stashAccumulations(currentAccumulations); + const unreportedAccumulations = this._getMergedUnreportedAccumulations(collector); + let result = unreportedAccumulations; + let aggregationTemporality; + if (this._reportHistory.has(collector)) { + const last = this._reportHistory.get(collector); + const lastCollectionTime = last.collectionTime; + aggregationTemporality = last.aggregationTemporality; + if (aggregationTemporality === AggregationTemporality_1.AggregationTemporality.CUMULATIVE) result = TemporalMetricProcessor.merge(last.accumulations, unreportedAccumulations, this._aggregator); + else result = TemporalMetricProcessor.calibrateStartTime(last.accumulations, unreportedAccumulations, lastCollectionTime); + } else aggregationTemporality = collector.selectAggregationTemporality(instrumentDescriptor.type); + this._reportHistory.set(collector, { + accumulations: result, + collectionTime, + aggregationTemporality + }); + const accumulationRecords = AttributesMapToAccumulationRecords(result); + if (accumulationRecords.length === 0) return; + return this._aggregator.toMetricData(instrumentDescriptor, aggregationTemporality, accumulationRecords, collectionTime); } - return out; - } - function toSingularDataPoints(metricData, encoder) { - return metricData.dataPoints.map((dataPoint) => { - return toSingularDataPoint(dataPoint, metricData.descriptor.valueType, encoder); - }); - } - function toHistogramDataPoints(metricData, encoder) { - return metricData.dataPoints.map((dataPoint) => { - const histogram = dataPoint.value; - return { - attributes: (0, internal_1.toAttributes)(dataPoint.attributes), - bucketCounts: histogram.buckets.counts, - explicitBounds: histogram.buckets.boundaries, - count: histogram.count, - sum: histogram.sum, - min: histogram.min, - max: histogram.max, - startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), - timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) - }; - }); - } - function toExponentialHistogramDataPoints(metricData, encoder) { - return metricData.dataPoints.map((dataPoint) => { - const histogram = dataPoint.value; - return { - attributes: (0, internal_1.toAttributes)(dataPoint.attributes), - count: histogram.count, - min: histogram.min, - max: histogram.max, - sum: histogram.sum, - positive: { - offset: histogram.positive.offset, - bucketCounts: histogram.positive.bucketCounts - }, - negative: { - offset: histogram.negative.offset, - bucketCounts: histogram.negative.bucketCounts - }, - scale: histogram.scale, - zeroCount: histogram.zeroCount, - startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), - timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) - }; - }); - } - function toAggregationTemporality(temporality) { - switch (temporality) { - case sdk_metrics_1.AggregationTemporality.DELTA: return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA; - case sdk_metrics_1.AggregationTemporality.CUMULATIVE: return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE; + _stashAccumulations(currentAccumulation) { + const registeredCollectors = this._unreportedAccumulations.keys(); + for (const collector of registeredCollectors) { + let stash = this._unreportedAccumulations.get(collector); + if (stash === void 0) { + stash = []; + this._unreportedAccumulations.set(collector, stash); + } + stash.push(currentAccumulation); + } + } + _getMergedUnreportedAccumulations(collector) { + let result = new HashMap_1.AttributeHashMap(); + const unreportedList = this._unreportedAccumulations.get(collector); + this._unreportedAccumulations.set(collector, []); + if (unreportedList === void 0) return result; + for (const it of unreportedList) result = TemporalMetricProcessor.merge(result, it, this._aggregator); + return result; + } + static merge(last, current, aggregator) { + const result = last; + const iterator = current.entries(); + let next = iterator.next(); + while (next.done !== true) { + const [key, record, hash] = next.value; + if (last.has(key, hash)) { + const lastAccumulation = last.get(key, hash); + const accumulation = aggregator.merge(lastAccumulation, record); + result.set(key, accumulation, hash); + } else result.set(key, record, hash); + next = iterator.next(); + } + return result; + } + /** + * Calibrate the reported metric streams' startTime to lastCollectionTime. Leaves + * the new stream to be the initial observation time unchanged. + */ + static calibrateStartTime(last, current, lastCollectionTime) { + for (const [key, hash] of last.keys()) current.get(key, hash)?.setStartTime(lastCollectionTime); + return current; } + }; + exports.TemporalMetricProcessor = TemporalMetricProcessor; + function AttributesMapToAccumulationRecords(map) { + return Array.from(map.entries()); } - function createExportMetricsServiceRequest(resourceMetrics, options) { - return { resourceMetrics: resourceMetrics.map((metrics$1) => toResourceMetrics(metrics$1, options)) }; - } - exports.createExportMetricsServiceRequest = createExportMetricsServiceRequest; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/metrics.js -var require_metrics$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/AsyncMetricStorage.js +var require_AsyncMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufMetricsSerializer = void 0; - const root = require_root(); - const internal_1 = require_internal$1(); - const metricsResponseType = root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse; - const metricsRequestType = root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest; - exports.ProtobufMetricsSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportMetricsServiceRequest)([arg]); - return metricsRequestType.encode(request).finish(); - }, - deserializeResponse: (arg) => { - return metricsResponseType.decode(arg); + exports.AsyncMetricStorage = void 0; + const MetricStorage_1 = require_MetricStorage(); + const DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); + const TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); + const HashMap_1 = require_HashMap(); + /** + * Internal interface. + * + * Stores and aggregates {@link MetricData} for asynchronous instruments. + */ + var AsyncMetricStorage = class extends MetricStorage_1.MetricStorage { + _aggregationCardinalityLimit; + _deltaMetricStorage; + _temporalMetricStorage; + _attributesProcessor; + constructor(_instrumentDescriptor, aggregator, attributesProcessor, collectorHandles, aggregationCardinalityLimit) { + super(_instrumentDescriptor); + this._aggregationCardinalityLimit = aggregationCardinalityLimit; + this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); + this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); + this._attributesProcessor = attributesProcessor; } - }; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/index.js -var require_protobuf$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufMetricsSerializer = void 0; - var metrics_1 = require_metrics$1(); - Object.defineProperty(exports, "ProtobufMetricsSerializer", { - enumerable: true, - get: function() { - return metrics_1.ProtobufMetricsSerializer; + record(measurements, observationTime) { + if (this._attributesProcessor === void 0) { + this._deltaMetricStorage.batchCumulate(measurements, observationTime); + return; + } + const processed = new HashMap_1.AttributeHashMap(); + for (const [attributes, value] of measurements.entries()) processed.set(this._attributesProcessor.process(attributes), value); + this._deltaMetricStorage.batchCumulate(processed, observationTime); } - }); + /** + * Collects the metrics from this storage. The ObservableCallback is invoked + * during the collection. + * + * Note: This is a stateful operation and may reset any interval-related + * state for the MetricCollector. + */ + collect(collector, collectionTime) { + const accumulations = this._deltaMetricStorage.collect(); + return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); + } + }; + exports.AsyncMetricStorage = AsyncMetricStorage; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js -var require_internal = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/RegistrationConflicts.js +var require_RegistrationConflicts = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.createExportTraceServiceRequest = exports.toOtlpSpanEvent = exports.toOtlpLink = exports.sdkSpanToOtlpSpan = void 0; - const internal_1 = require_internal$3(); - const utils_1 = require_utils$5(); - function sdkSpanToOtlpSpan(span, encoder) { - const ctx = span.spanContext(); - const status = span.status; - const parentSpanId = span.parentSpanContext?.spanId ? encoder.encodeSpanContext(span.parentSpanContext?.spanId) : void 0; - return { - traceId: encoder.encodeSpanContext(ctx.traceId), - spanId: encoder.encodeSpanContext(ctx.spanId), - parentSpanId, - traceState: ctx.traceState?.serialize(), - name: span.name, - kind: span.kind == null ? 0 : span.kind + 1, - startTimeUnixNano: encoder.encodeHrTime(span.startTime), - endTimeUnixNano: encoder.encodeHrTime(span.endTime), - attributes: (0, internal_1.toAttributes)(span.attributes), - droppedAttributesCount: span.droppedAttributesCount, - events: span.events.map((event) => toOtlpSpanEvent(event, encoder)), - droppedEventsCount: span.droppedEventsCount, - status: { - code: status.code, - message: status.message - }, - links: span.links.map((link) => toOtlpLink(link, encoder)), - droppedLinksCount: span.droppedLinksCount - }; + exports.getConflictResolutionRecipe = exports.getDescriptionResolutionRecipe = exports.getTypeConflictResolutionRecipe = exports.getUnitConflictResolutionRecipe = exports.getValueTypeConflictResolutionRecipe = exports.getIncompatibilityDetails = void 0; + function getIncompatibilityDetails(existing, otherDescriptor) { + let incompatibility = ""; + if (existing.unit !== otherDescriptor.unit) incompatibility += `\t- Unit '${existing.unit}' does not match '${otherDescriptor.unit}'\n`; + if (existing.type !== otherDescriptor.type) incompatibility += `\t- Type '${existing.type}' does not match '${otherDescriptor.type}'\n`; + if (existing.valueType !== otherDescriptor.valueType) incompatibility += `\t- Value Type '${existing.valueType}' does not match '${otherDescriptor.valueType}'\n`; + if (existing.description !== otherDescriptor.description) incompatibility += `\t- Description '${existing.description}' does not match '${otherDescriptor.description}'\n`; + return incompatibility; } - exports.sdkSpanToOtlpSpan = sdkSpanToOtlpSpan; - function toOtlpLink(link, encoder) { - return { - attributes: link.attributes ? (0, internal_1.toAttributes)(link.attributes) : [], - spanId: encoder.encodeSpanContext(link.context.spanId), - traceId: encoder.encodeSpanContext(link.context.traceId), - traceState: link.context.traceState?.serialize(), - droppedAttributesCount: link.droppedAttributesCount || 0 - }; + exports.getIncompatibilityDetails = getIncompatibilityDetails; + function getValueTypeConflictResolutionRecipe(existing, otherDescriptor) { + return `\t- use valueType '${existing.valueType}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; } - exports.toOtlpLink = toOtlpLink; - function toOtlpSpanEvent(timedEvent, encoder) { - return { - attributes: timedEvent.attributes ? (0, internal_1.toAttributes)(timedEvent.attributes) : [], - name: timedEvent.name, - timeUnixNano: encoder.encodeHrTime(timedEvent.time), - droppedAttributesCount: timedEvent.droppedAttributesCount || 0 - }; + exports.getValueTypeConflictResolutionRecipe = getValueTypeConflictResolutionRecipe; + function getUnitConflictResolutionRecipe(existing, otherDescriptor) { + return `\t- use unit '${existing.unit}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; } - exports.toOtlpSpanEvent = toOtlpSpanEvent; - function createExportTraceServiceRequest(spans, options) { - return { resourceSpans: spanRecordsToResourceSpans(spans, (0, utils_1.getOtlpEncoder)(options)) }; + exports.getUnitConflictResolutionRecipe = getUnitConflictResolutionRecipe; + function getTypeConflictResolutionRecipe(existing, otherDescriptor) { + const selector = { + name: otherDescriptor.name, + type: otherDescriptor.type, + unit: otherDescriptor.unit + }; + const selectorString = JSON.stringify(selector); + return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}'`; } - exports.createExportTraceServiceRequest = createExportTraceServiceRequest; - function createResourceMap(readableSpans) { - const resourceMap = /* @__PURE__ */ new Map(); - for (const record$1 of readableSpans) { - let ilsMap = resourceMap.get(record$1.resource); - if (!ilsMap) { - ilsMap = /* @__PURE__ */ new Map(); - resourceMap.set(record$1.resource, ilsMap); - } - const instrumentationScopeKey = `${record$1.instrumentationScope.name}@${record$1.instrumentationScope.version || ""}:${record$1.instrumentationScope.schemaUrl || ""}`; - let records = ilsMap.get(instrumentationScopeKey); - if (!records) { - records = []; - ilsMap.set(instrumentationScopeKey, records); - } - records.push(record$1); - } - return resourceMap; + exports.getTypeConflictResolutionRecipe = getTypeConflictResolutionRecipe; + function getDescriptionResolutionRecipe(existing, otherDescriptor) { + const selector = { + name: otherDescriptor.name, + type: otherDescriptor.type, + unit: otherDescriptor.unit + }; + const selectorString = JSON.stringify(selector); + return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}' + \t- OR - create a new view with the name ${existing.name} and description '${existing.description}' and InstrumentSelector ${selectorString} + \t- OR - create a new view with the name ${otherDescriptor.name} and description '${existing.description}' and InstrumentSelector ${selectorString}`; } - function spanRecordsToResourceSpans(readableSpans, encoder) { - const resourceMap = createResourceMap(readableSpans); - const out = []; - const entryIterator = resourceMap.entries(); - let entry = entryIterator.next(); - while (!entry.done) { - const [resource, ilmMap] = entry.value; - const scopeResourceSpans = []; - const ilmIterator = ilmMap.values(); - let ilmEntry = ilmIterator.next(); - while (!ilmEntry.done) { - const scopeSpans = ilmEntry.value; - if (scopeSpans.length > 0) { - const spans = scopeSpans.map((readableSpan) => sdkSpanToOtlpSpan(readableSpan, encoder)); - scopeResourceSpans.push({ - scope: (0, internal_1.createInstrumentationScope)(scopeSpans[0].instrumentationScope), - spans, - schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl - }); - } - ilmEntry = ilmIterator.next(); - } - const processedResource = (0, internal_1.createResource)(resource); - const transformedSpans = { - resource: processedResource, - scopeSpans: scopeResourceSpans, - schemaUrl: processedResource.schemaUrl - }; - out.push(transformedSpans); - entry = entryIterator.next(); - } - return out; + exports.getDescriptionResolutionRecipe = getDescriptionResolutionRecipe; + function getConflictResolutionRecipe(existing, otherDescriptor) { + if (existing.valueType !== otherDescriptor.valueType) return getValueTypeConflictResolutionRecipe(existing, otherDescriptor); + if (existing.unit !== otherDescriptor.unit) return getUnitConflictResolutionRecipe(existing, otherDescriptor); + if (existing.type !== otherDescriptor.type) return getTypeConflictResolutionRecipe(existing, otherDescriptor); + if (existing.description !== otherDescriptor.description) return getDescriptionResolutionRecipe(existing, otherDescriptor); + return ""; } + exports.getConflictResolutionRecipe = getConflictResolutionRecipe; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/trace.js -var require_trace$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricStorageRegistry.js +var require_MetricStorageRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufTraceSerializer = void 0; - const root = require_root(); - const internal_1 = require_internal(); - const traceResponseType = root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse; - const traceRequestType = root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest; - exports.ProtobufTraceSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportTraceServiceRequest)(arg); - return traceRequestType.encode(request).finish(); - }, - deserializeResponse: (arg) => { - return traceResponseType.decode(arg); + exports.MetricStorageRegistry = void 0; + const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const RegistrationConflicts_1 = require_RegistrationConflicts(); + /** + * Internal class for storing {@link MetricStorage} + */ + var MetricStorageRegistry = class MetricStorageRegistry { + _sharedRegistry = /* @__PURE__ */ new Map(); + _perCollectorRegistry = /* @__PURE__ */ new Map(); + static create() { + return new MetricStorageRegistry(); + } + getStorages(collector) { + let storages = []; + for (const metricStorages of this._sharedRegistry.values()) storages = storages.concat(metricStorages); + const perCollectorStorages = this._perCollectorRegistry.get(collector); + if (perCollectorStorages != null) for (const metricStorages of perCollectorStorages.values()) storages = storages.concat(metricStorages); + return storages; + } + register(storage) { + this._registerStorage(storage, this._sharedRegistry); + } + registerForCollector(collector, storage) { + let storageMap = this._perCollectorRegistry.get(collector); + if (storageMap == null) { + storageMap = /* @__PURE__ */ new Map(); + this._perCollectorRegistry.set(collector, storageMap); + } + this._registerStorage(storage, storageMap); + } + findOrUpdateCompatibleStorage(expectedDescriptor) { + const storages = this._sharedRegistry.get(expectedDescriptor.name); + if (storages === void 0) return null; + return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); + } + findOrUpdateCompatibleCollectorStorage(collector, expectedDescriptor) { + const storageMap = this._perCollectorRegistry.get(collector); + if (storageMap === void 0) return null; + const storages = storageMap.get(expectedDescriptor.name); + if (storages === void 0) return null; + return this._findOrUpdateCompatibleStorage(expectedDescriptor, storages); + } + _registerStorage(storage, storageMap) { + const descriptor = storage.getInstrumentDescriptor(); + const storages = storageMap.get(descriptor.name); + if (storages === void 0) { + storageMap.set(descriptor.name, [storage]); + return; + } + storages.push(storage); + } + _findOrUpdateCompatibleStorage(expectedDescriptor, existingStorages) { + let compatibleStorage = null; + for (const existingStorage of existingStorages) { + const existingDescriptor = existingStorage.getInstrumentDescriptor(); + if ((0, InstrumentDescriptor_1.isDescriptorCompatibleWith)(existingDescriptor, expectedDescriptor)) { + if (existingDescriptor.description !== expectedDescriptor.description) { + if (expectedDescriptor.description.length > existingDescriptor.description.length) existingStorage.updateDescription(expectedDescriptor.description); + api.diag.warn("A view or instrument with the name ", expectedDescriptor.name, " has already been registered, but has a different description and is incompatible with another registered view.\n", "Details:\n", (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), "The longer description will be used.\nTo resolve the conflict:", (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); + } + compatibleStorage = existingStorage; + } else api.diag.warn("A view or instrument with the name ", expectedDescriptor.name, " has already been registered and is incompatible with another registered view.\n", "Details:\n", (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), "To resolve the conflict:\n", (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); + } + return compatibleStorage; } }; + exports.MetricStorageRegistry = MetricStorageRegistry; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/index.js -var require_protobuf = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MultiWritableMetricStorage.js +var require_MultiWritableMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.ProtobufTraceSerializer = void 0; - var trace_1 = require_trace$1(); - Object.defineProperty(exports, "ProtobufTraceSerializer", { - enumerable: true, - get: function() { - return trace_1.ProtobufTraceSerializer; + exports.MultiMetricStorage = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + /** + * Internal interface. + */ + var MultiMetricStorage = class { + _backingStorages; + hasAttributeProcessor; + constructor(backingStorages) { + this._backingStorages = backingStorages; + this.hasAttributeProcessor = backingStorages.some((s) => s.hasAttributeProcessor); } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/logs.js -var require_logs = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonLogsSerializer = void 0; - const internal_1 = require_internal$2(); - exports.JsonLogsSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportLogsServiceRequest)(arg, { - useHex: true, - useLongBits: false - }); - return new TextEncoder().encode(JSON.stringify(request)); - }, - deserializeResponse: (arg) => { - if (arg.length === 0) return {}; - const decoder = new TextDecoder(); - return JSON.parse(decoder.decode(arg)); + record(value, attributes, context, recordTime) { + if (this.hasAttributeProcessor && context === void 0) context = api_1.context.active(); + const storages = this._backingStorages; + for (let i = 0; i < storages.length; i++) storages[i].record(value, attributes, context, recordTime); } }; + exports.MultiMetricStorage = MultiMetricStorage; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/index.js -var require_json$2 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/ObservableResult.js +var require_ObservableResult = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonLogsSerializer = void 0; - var logs_1 = require_logs(); - Object.defineProperty(exports, "JsonLogsSerializer", { - enumerable: true, - get: function() { - return logs_1.JsonLogsSerializer; + exports.BatchObservableResultImpl = exports.ObservableResultImpl = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const HashMap_1 = require_HashMap(); + const Instruments_1 = require_Instruments(); + /** + * The class implements {@link ObservableResult} interface. + */ + var ObservableResultImpl = class { + /** + * @internal + */ + _buffer = new HashMap_1.AttributeHashMap(); + _instrumentName; + _valueType; + constructor(instrumentName, valueType) { + this._instrumentName = instrumentName; + this._valueType = valueType; } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/metrics.js -var require_metrics = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonMetricsSerializer = void 0; - const internal_1 = require_internal$1(); - exports.JsonMetricsSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportMetricsServiceRequest)([arg], { useLongBits: false }); - return new TextEncoder().encode(JSON.stringify(request)); - }, - deserializeResponse: (arg) => { - if (arg.length === 0) return {}; - const decoder = new TextDecoder(); - return JSON.parse(decoder.decode(arg)); + /** + * Observe a measurement of the value associated with the given attributes. + */ + observe(value, attributes = {}) { + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${value}`); + return; + } + if (this._valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) return; + } + this._buffer.set(attributes, value); } }; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/index.js -var require_json$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonMetricsSerializer = void 0; - var metrics_1 = require_metrics(); - Object.defineProperty(exports, "JsonMetricsSerializer", { - enumerable: true, - get: function() { - return metrics_1.JsonMetricsSerializer; + exports.ObservableResultImpl = ObservableResultImpl; + /** + * The class implements {@link BatchObservableCallback} interface. + */ + var BatchObservableResultImpl = class { + /** + * @internal + */ + _buffer = /* @__PURE__ */ new Map(); + /** + * Observe a measurement of the value associated with the given attributes. + */ + observe(metric, value, attributes = {}) { + if (!(0, Instruments_1.isObservableInstrument)(metric)) return; + let map = this._buffer.get(metric); + if (map == null) { + map = new HashMap_1.AttributeHashMap(); + this._buffer.set(metric, map); + } + if (typeof value !== "number") { + api_1.diag.warn(`non-number value provided to metric ${metric._descriptor.name}: ${value}`); + return; + } + if (metric._descriptor.valueType === api_1.ValueType.INT && !Number.isInteger(value)) { + api_1.diag.warn(`INT value type cannot accept a floating-point value for ${metric._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + if (!Number.isInteger(value)) return; + } + map.set(attributes, value); } - }); + }; + exports.BatchObservableResultImpl = BatchObservableResultImpl; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/trace.js -var require_trace = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/ObservableRegistry.js +var require_ObservableRegistry = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonTraceSerializer = void 0; - const internal_1 = require_internal(); - exports.JsonTraceSerializer = { - serializeRequest: (arg) => { - const request = (0, internal_1.createExportTraceServiceRequest)(arg, { - useHex: true, - useLongBits: false + exports.ObservableRegistry = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const Instruments_1 = require_Instruments(); + const ObservableResult_1 = require_ObservableResult(); + const utils_1 = require_utils$3(); + /** + * An internal interface for managing ObservableCallbacks. + * + * Every registered callback associated with a set of instruments are be evaluated + * exactly once during collection prior to reading data for that instrument. + */ + var ObservableRegistry = class { + _callbacks = []; + _batchCallbacks = []; + addCallback(callback, instrument) { + if (this._findCallback(callback, instrument) >= 0) return; + this._callbacks.push({ + callback, + instrument }); - return new TextEncoder().encode(JSON.stringify(request)); - }, - deserializeResponse: (arg) => { - if (arg.length === 0) return {}; - const decoder = new TextDecoder(); - return JSON.parse(decoder.decode(arg)); } - }; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/index.js -var require_json = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonTraceSerializer = void 0; - var trace_1 = require_trace(); - Object.defineProperty(exports, "JsonTraceSerializer", { - enumerable: true, - get: function() { - return trace_1.JsonTraceSerializer; + removeCallback(callback, instrument) { + const idx = this._findCallback(callback, instrument); + if (idx < 0) return; + this._callbacks.splice(idx, 1); } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/index.js -var require_src$5 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.JsonTraceSerializer = exports.JsonMetricsSerializer = exports.JsonLogsSerializer = exports.ProtobufTraceSerializer = exports.ProtobufMetricsSerializer = exports.ProtobufLogsSerializer = void 0; - var protobuf_1 = require_protobuf$2(); - Object.defineProperty(exports, "ProtobufLogsSerializer", { - enumerable: true, - get: function() { - return protobuf_1.ProtobufLogsSerializer; + addBatchCallback(callback, instruments) { + const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); + if (observableInstruments.size === 0) { + api_1.diag.error("BatchObservableCallback is not associated with valid instruments", instruments); + return; + } + if (this._findBatchCallback(callback, observableInstruments) >= 0) return; + this._batchCallbacks.push({ + callback, + instruments: observableInstruments + }); } - }); - var protobuf_2 = require_protobuf$1(); - Object.defineProperty(exports, "ProtobufMetricsSerializer", { - enumerable: true, - get: function() { - return protobuf_2.ProtobufMetricsSerializer; + removeBatchCallback(callback, instruments) { + const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); + const idx = this._findBatchCallback(callback, observableInstruments); + if (idx < 0) return; + this._batchCallbacks.splice(idx, 1); } - }); - var protobuf_3 = require_protobuf(); - Object.defineProperty(exports, "ProtobufTraceSerializer", { - enumerable: true, - get: function() { - return protobuf_3.ProtobufTraceSerializer; + /** + * @returns a promise of rejected reasons for invoking callbacks. + */ + async observe(collectionTime, timeoutMillis) { + const callbackFutures = this._observeCallbacks(collectionTime, timeoutMillis); + const batchCallbackFutures = this._observeBatchCallbacks(collectionTime, timeoutMillis); + return (await Promise.allSettled([...callbackFutures, ...batchCallbackFutures])).filter((result) => result.status === "rejected").map((result) => result.reason); } - }); - var json_1 = require_json$2(); - Object.defineProperty(exports, "JsonLogsSerializer", { - enumerable: true, - get: function() { - return json_1.JsonLogsSerializer; + _observeCallbacks(observationTime, timeoutMillis) { + return this._callbacks.map(async ({ callback, instrument }) => { + const observableResult = new ObservableResult_1.ObservableResultImpl(instrument._descriptor.name, instrument._descriptor.valueType); + let callPromise = Promise.resolve(callback(observableResult)); + if (timeoutMillis != null) callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); + await callPromise; + instrument._metricStorages.forEach((metricStorage) => { + metricStorage.record(observableResult._buffer, observationTime); + }); + }); + } + _observeBatchCallbacks(observationTime, timeoutMillis) { + return this._batchCallbacks.map(async ({ callback, instruments }) => { + const observableResult = new ObservableResult_1.BatchObservableResultImpl(); + let callPromise = Promise.resolve(callback(observableResult)); + if (timeoutMillis != null) callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); + await callPromise; + instruments.forEach((instrument) => { + const buffer = observableResult._buffer.get(instrument); + if (buffer == null) return; + instrument._metricStorages.forEach((metricStorage) => { + metricStorage.record(buffer, observationTime); + }); + }); + }); } - }); - var json_2 = require_json$1(); - Object.defineProperty(exports, "JsonMetricsSerializer", { - enumerable: true, - get: function() { - return json_2.JsonMetricsSerializer; + _findCallback(callback, instrument) { + return this._callbacks.findIndex((record) => { + return record.callback === callback && record.instrument === instrument; + }); } - }); - var json_3 = require_json(); - Object.defineProperty(exports, "JsonTraceSerializer", { - enumerable: true, - get: function() { - return json_3.JsonTraceSerializer; + _findBatchCallback(callback, instruments) { + return this._batchCallbacks.findIndex((record) => { + return record.callback === callback && (0, utils_1.setEquals)(record.instruments, instruments); + }); } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js -/** -* Parses headers from config leaving only those that have defined values -* @param partialHeaders -*/ -function validateAndNormalizeHeaders(partialHeaders) { - return () => { - const headers = {}; - Object.entries(partialHeaders?.() ?? {}).forEach(([key, value]) => { - if (typeof value !== "undefined") headers[key] = String(value); - else diag.warn(`Header "${key}" has invalid value (${value}) and will be ignored`); - }); - return headers; - }; -} -var init_util = __esmMin((() => { - init_esm$2(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js -function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) { - const requiredHeaders = { ...defaultHeaders() }; - const headers = {}; - return () => { - if (fallbackHeaders != null) Object.assign(headers, fallbackHeaders()); - if (userProvidedHeaders != null) Object.assign(headers, userProvidedHeaders()); - return Object.assign(headers, requiredHeaders); - }; -} -function validateUserProvidedUrl(url) { - if (url == null) return; - try { - const base = globalThis.location?.href; - return new URL(url, base).href; - } catch { - throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`); - } -} -/** -* @param userProvidedConfiguration Configuration options provided by the user in code. -* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. -* @param defaultConfiguration The defaults as defined by the exporter specification -*/ -function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { - return { - ...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), - headers: mergeHeaders(validateAndNormalizeHeaders(userProvidedConfiguration.headers), fallbackConfiguration.headers, defaultConfiguration.headers), - url: validateUserProvidedUrl(userProvidedConfiguration.url) ?? fallbackConfiguration.url ?? defaultConfiguration.url - }; -} -function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { - return { - ...getSharedConfigurationDefaults(), - headers: () => requiredHeaders, - url: "http://localhost:4318/" + signalResourcePath }; -} -var init_otlp_http_configuration = __esmMin((() => { - init_shared_configuration(); - init_util(); + exports.ObservableRegistry = ObservableRegistry; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-configuration.js -function httpAgentFactoryFromOptions(options) { - return async (protocol) => { - const { Agent } = await (protocol === "http:" ? import("http") : import("https")); - return new Agent(options); - }; -} -/** -* @param userProvidedConfiguration Configuration options provided by the user in code. -* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. -* @param defaultConfiguration The defaults as defined by the exporter specification -*/ -function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { - return { - ...mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), - agentFactory: userProvidedConfiguration.agentFactory ?? fallbackConfiguration.agentFactory ?? defaultConfiguration.agentFactory - }; -} -function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { - return { - ...getHttpConfigurationDefaults(requiredHeaders, signalResourcePath), - agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }) +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/SyncMetricStorage.js +var require_SyncMetricStorage = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SyncMetricStorage = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const MetricStorage_1 = require_MetricStorage(); + const DeltaMetricProcessor_1 = require_DeltaMetricProcessor(); + const TemporalMetricProcessor_1 = require_TemporalMetricProcessor(); + /** + * Internal interface. + * + * Stores and aggregates {@link MetricData} for synchronous instruments. + */ + var SyncMetricStorage = class extends MetricStorage_1.MetricStorage { + _aggregationCardinalityLimit; + _deltaMetricStorage; + _temporalMetricStorage; + _attributesProcessor; + constructor(instrumentDescriptor, aggregator, attributesProcessor, collectorHandles, aggregationCardinalityLimit) { + super(instrumentDescriptor); + this._aggregationCardinalityLimit = aggregationCardinalityLimit; + this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator, this._aggregationCardinalityLimit); + this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator, collectorHandles); + this._attributesProcessor = attributesProcessor; + this.hasAttributeProcessor = attributesProcessor !== void 0; + } + hasAttributeProcessor; + record(value, attributes, context, recordTime) { + if (this._attributesProcessor !== void 0) attributes = this._attributesProcessor.process(attributes, context ?? api_1.context.active()); + this._deltaMetricStorage.record(value, attributes, recordTime); + } + /** + * Collects the metrics from this storage. + * + * Note: This is a stateful operation and may reset any interval-related + * state for the MetricCollector. + */ + collect(collector, collectionTime) { + const accumulations = this._deltaMetricStorage.collect(); + return this._temporalMetricStorage.buildMetrics(collector, this._instrumentDescriptor, accumulations, collectionTime); + } }; -} -var init_otlp_node_http_configuration = __esmMin((() => { - init_otlp_http_configuration(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js -function isExportRetryable(statusCode) { - return [ - 429, - 502, - 503, - 504 - ].includes(statusCode); -} -function parseRetryAfterToMills(retryAfter) { - if (retryAfter == null) return; - const seconds = Number.parseInt(retryAfter, 10); - if (Number.isInteger(seconds)) return seconds > 0 ? seconds * 1e3 : -1; - const delay = new Date(retryAfter).getTime() - Date.now(); - if (delay >= 0) return delay; - return 0; -} -var init_is_export_retryable = __esmMin((() => {})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js -/** -* Sends data using http -* @param request -* @param params -* @param agent -* @param data -* @param onDone -* @param timeoutMillis -*/ -function sendWithHttp(request, params, agent, data, onDone, timeoutMillis) { - const parsedUrl = new URL(params.url); - const req = request({ - hostname: parsedUrl.hostname, - port: parsedUrl.port, - path: parsedUrl.pathname, - method: "POST", - headers: { ...params.headers() }, - agent - }, (res) => { - const responseData = []; - res.on("data", (chunk) => responseData.push(chunk)); - res.on("end", () => { - if (res.statusCode && res.statusCode < 299) onDone({ - status: "success", - data: Buffer.concat(responseData) - }); - else if (res.statusCode && isExportRetryable(res.statusCode)) onDone({ - status: "retryable", - retryInMillis: parseRetryAfterToMills(res.headers["retry-after"]) - }); - else onDone({ - status: "failure", - error: new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString()) - }); - }); - }); - req.setTimeout(timeoutMillis, () => { - req.destroy(); - onDone({ - status: "failure", - error: /* @__PURE__ */ new Error("Request Timeout") - }); - }); - req.on("error", (error) => { - onDone({ - status: "failure", - error - }); - }); - compressAndSend(req, params.compression, data, (error) => { - onDone({ - status: "failure", - error - }); - }); -} -function compressAndSend(req, compression, data, onError) { - let dataStream = readableFromUint8Array(data); - if (compression === "gzip") { - req.setHeader("Content-Encoding", "gzip"); - dataStream = dataStream.on("error", onError).pipe(zlib.createGzip()).on("error", onError); - } - dataStream.pipe(req).on("error", onError); -} -function readableFromUint8Array(buff) { - const readable = new Readable(); - readable.push(buff); - readable.push(null); - return readable; -} -var init_http_transport_utils = __esmMin((() => { - init_is_export_retryable(); - init_types(); + exports.SyncMetricStorage = SyncMetricStorage; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-exporter-transport.js -async function requestFunctionFactory(protocol) { - const { request } = await (protocol === "http:" ? import("http") : import("https")); - return request; -} -function createHttpExporterTransport(parameters) { - return new HttpExporterTransport(parameters); -} -var HttpExporterTransport; -var init_http_exporter_transport = __esmMin((() => { - init_http_transport_utils(); - HttpExporterTransport = class { - _parameters; - _utils = null; - constructor(_parameters) { - this._parameters = _parameters; +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterSharedState.js +var require_MeterSharedState = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterSharedState = void 0; + const InstrumentDescriptor_1 = require_InstrumentDescriptor(); + const Meter_1 = require_Meter(); + const AsyncMetricStorage_1 = require_AsyncMetricStorage(); + const MetricStorageRegistry_1 = require_MetricStorageRegistry(); + const MultiWritableMetricStorage_1 = require_MultiWritableMetricStorage(); + const ObservableRegistry_1 = require_ObservableRegistry(); + const SyncMetricStorage_1 = require_SyncMetricStorage(); + /** + * An internal record for shared meter provider states. + */ + var MeterSharedState = class { + metricStorageRegistry = new MetricStorageRegistry_1.MetricStorageRegistry(); + observableRegistry = new ObservableRegistry_1.ObservableRegistry(); + meter; + _meterProviderSharedState; + _instrumentationScope; + constructor(meterProviderSharedState, instrumentationScope) { + this.meter = new Meter_1.Meter(this); + this._meterProviderSharedState = meterProviderSharedState; + this._instrumentationScope = instrumentationScope; } - async send(data, timeoutMillis) { - const { agent, request } = await this._loadUtils(); - return new Promise((resolve) => { - sendWithHttp(request, this._parameters, agent, data, (result) => { - resolve(result); - }, timeoutMillis); + registerMetricStorage(descriptor) { + const storages = this._registerMetricStorage(descriptor, SyncMetricStorage_1.SyncMetricStorage); + if (storages.length === 1) return storages[0]; + return new MultiWritableMetricStorage_1.MultiMetricStorage(storages); + } + registerAsyncMetricStorage(descriptor) { + return this._registerMetricStorage(descriptor, AsyncMetricStorage_1.AsyncMetricStorage); + } + /** + * @param collector opaque handle of {@link MetricCollector} which initiated the collection. + * @param collectionTime the HrTime at which the collection was initiated. + * @param options options for collection. + * @returns the list of metric data collected. + */ + async collect(collector, collectionTime, options) { + /** + * 1. Call all observable callbacks first. + * 2. Collect metric result for the collector. + */ + const errors = await this.observableRegistry.observe(collectionTime, options?.timeoutMillis); + const storages = this.metricStorageRegistry.getStorages(collector); + if (storages.length === 0) return null; + const metricDataList = []; + storages.forEach((metricStorage) => { + const metricData = metricStorage.collect(collector, collectionTime); + if (metricData != null) metricDataList.push(metricData); }); + if (metricDataList.length === 0) return { errors }; + return { + scopeMetrics: { + scope: this._instrumentationScope, + metrics: metricDataList + }, + errors + }; } - shutdown() {} - async _loadUtils() { - let utils = this._utils; - if (utils === null) { - const protocol = new URL(this._parameters.url).protocol; - const [agent, request] = await Promise.all([this._parameters.agentFactory(protocol), requestFunctionFactory(protocol)]); - utils = this._utils = { - agent, - request - }; + _registerMetricStorage(descriptor, MetricStorageType) { + let storages = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationScope).map((view) => { + const viewDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptorWithView)(view, descriptor); + const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleStorage(viewDescriptor); + if (compatibleStorage != null) return compatibleStorage; + const viewStorage = new MetricStorageType(viewDescriptor, view.aggregation.createAggregator(viewDescriptor), view.attributesProcessor, this._meterProviderSharedState.metricCollectors, view.aggregationCardinalityLimit); + this.metricStorageRegistry.register(viewStorage); + return viewStorage; + }); + if (storages.length === 0) { + const collectorStorages = this._meterProviderSharedState.selectAggregations(descriptor.type).map(([collector, aggregation]) => { + const compatibleStorage = this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(collector, descriptor); + if (compatibleStorage != null) return compatibleStorage; + const aggregator = aggregation.createAggregator(descriptor); + const cardinalityLimit = collector.selectCardinalityLimit(descriptor.type); + const storage = new MetricStorageType(descriptor, aggregator, void 0, [collector], cardinalityLimit); + this.metricStorageRegistry.registerForCollector(collector, storage); + return storage; + }); + storages = storages.concat(collectorStorages); } - return utils; + return storages; } }; + exports.MeterSharedState = MeterSharedState; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js -/** -* Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER] -*/ -function getJitter() { - return Math.random() * (2 * JITTER) - JITTER; -} -/** -* Creates an Exporter Transport that retries on 'retryable' response. -*/ -function createRetryingTransport(options) { - return new RetryingTransport(options.transport); -} -var MAX_ATTEMPTS, INITIAL_BACKOFF, MAX_BACKOFF, BACKOFF_MULTIPLIER, JITTER, RetryingTransport; -var init_retrying_transport = __esmMin((() => { - MAX_ATTEMPTS = 5; - INITIAL_BACKOFF = 1e3; - MAX_BACKOFF = 5e3; - BACKOFF_MULTIPLIER = 1.5; - JITTER = .2; - RetryingTransport = class { - _transport; - constructor(_transport) { - this._transport = _transport; - } - retry(data, timeoutMillis, inMillis) { - return new Promise((resolve, reject) => { - setTimeout(() => { - this._transport.send(data, timeoutMillis).then(resolve, reject); - }, inMillis); - }); +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MeterProviderSharedState.js +var require_MeterProviderSharedState = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterProviderSharedState = void 0; + const utils_1 = require_utils$3(); + const ViewRegistry_1 = require_ViewRegistry(); + const MeterSharedState_1 = require_MeterSharedState(); + const AggregationOption_1 = require_AggregationOption(); + /** + * An internal record for shared meter provider states. + */ + var MeterProviderSharedState = class { + viewRegistry = new ViewRegistry_1.ViewRegistry(); + metricCollectors = []; + meterSharedStates = /* @__PURE__ */ new Map(); + resource; + constructor(resource) { + this.resource = resource; } - async send(data, timeoutMillis) { - const deadline = Date.now() + timeoutMillis; - let result = await this._transport.send(data, timeoutMillis); - let attempts = MAX_ATTEMPTS; - let nextBackoff = INITIAL_BACKOFF; - while (result.status === "retryable" && attempts > 0) { - attempts--; - const backoff = Math.max(Math.min(nextBackoff, MAX_BACKOFF) + getJitter(), 0); - nextBackoff = nextBackoff * BACKOFF_MULTIPLIER; - const retryInMillis = result.retryInMillis ?? backoff; - const remainingTimeoutMillis = deadline - Date.now(); - if (retryInMillis > remainingTimeoutMillis) return result; - result = await this.retry(data, remainingTimeoutMillis, retryInMillis); + getMeterSharedState(instrumentationScope) { + const id = (0, utils_1.instrumentationScopeId)(instrumentationScope); + let meterSharedState = this.meterSharedStates.get(id); + if (meterSharedState == null) { + meterSharedState = new MeterSharedState_1.MeterSharedState(this, instrumentationScope); + this.meterSharedStates.set(id, meterSharedState); } - return result; + return meterSharedState; } - shutdown() { - return this._transport.shutdown(); + selectAggregations(instrumentType) { + const result = []; + for (const collector of this.metricCollectors) result.push([collector, (0, AggregationOption_1.toAggregation)(collector.selectAggregation(instrumentType))]); + return result; } }; + exports.MeterProviderSharedState = MeterProviderSharedState; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-http-export-delegate.js -function createOtlpHttpExportDelegate(options, serializer) { - return createOtlpExportDelegate({ - transport: createRetryingTransport({ transport: createHttpExporterTransport(options) }), - serializer, - promiseHandler: createBoundedQueueExportPromiseHandler(options) - }, { timeout: options.timeoutMillis }); -} -var init_otlp_http_export_delegate = __esmMin((() => { - init_otlp_export_delegate(); - init_http_exporter_transport(); - init_bounded_queue_export_promise_handler(); - init_retrying_transport(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-env-configuration.js -function parseAndValidateTimeoutFromEnv(timeoutEnvVar) { - const envTimeout = process.env[timeoutEnvVar]?.trim(); - if (envTimeout != null && envTimeout !== "") { - const definedTimeout = Number(envTimeout); - if (Number.isFinite(definedTimeout) && definedTimeout > 0) return definedTimeout; - diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`); - } -} -function getTimeoutFromEnv(signalIdentifier) { - const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`); - const nonSpecificTimeout = parseAndValidateTimeoutFromEnv("OTEL_EXPORTER_OTLP_TIMEOUT"); - return specificTimeout ?? nonSpecificTimeout; -} -function parseAndValidateCompressionFromEnv(compressionEnvVar) { - const compression = process.env[compressionEnvVar]?.trim(); - if (compression === "") return; - if (compression == null || compression === "none" || compression === "gzip") return compression; - diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`); -} -function getCompressionFromEnv(signalIdentifier) { - const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`); - const nonSpecificCompression = parseAndValidateCompressionFromEnv("OTEL_EXPORTER_OTLP_COMPRESSION"); - return specificCompression ?? nonSpecificCompression; -} -function getSharedConfigurationFromEnvironment(signalIdentifier) { - return { - timeoutMillis: getTimeoutFromEnv(signalIdentifier), - compression: getCompressionFromEnv(signalIdentifier) - }; -} -var init_shared_env_configuration = __esmMin((() => { - init_esm$2(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-env-configuration.js -function getStaticHeadersFromEnv(signalIdentifier) { - const signalSpecificRawHeaders = (0, import_src$4.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`); - const nonSignalSpecificRawHeaders = (0, import_src$4.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"); - const signalSpecificHeaders = (0, import_src$4.parseKeyPairsIntoRecord)(signalSpecificRawHeaders); - const nonSignalSpecificHeaders = (0, import_src$4.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders); - if (Object.keys(signalSpecificHeaders).length === 0 && Object.keys(nonSignalSpecificHeaders).length === 0) return; - return Object.assign({}, (0, import_src$4.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders), (0, import_src$4.parseKeyPairsIntoRecord)(signalSpecificRawHeaders)); -} -function appendRootPathToUrlIfNeeded(url) { - try { - return new URL(url).toString(); - } catch { - diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`); - return; - } -} -function appendResourcePathToUrl(url, path$1) { - try { - new URL(url); - } catch { - diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`); - return; - } - if (!url.endsWith("/")) url = url + "/"; - url += path$1; - try { - new URL(url); - } catch { - diag.warn(`Configuration: Provided URL appended with '${path$1}' is not a valid URL, using 'undefined' instead of '${url}'`); - return; - } - return url; -} -function getNonSpecificUrlFromEnv(signalResourcePath) { - const envUrl = (0, import_src$4.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT"); - if (envUrl === void 0) return; - return appendResourcePathToUrl(envUrl, signalResourcePath); -} -function getSpecificUrlFromEnv(signalIdentifier) { - const envUrl = (0, import_src$4.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`); - if (envUrl === void 0) return; - return appendRootPathToUrlIfNeeded(envUrl); -} -/** -* Reads and returns configuration from the environment -* -* @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS) -* @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs) -*/ -function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) { - return { - ...getSharedConfigurationFromEnvironment(signalIdentifier), - url: getSpecificUrlFromEnv(signalIdentifier) ?? getNonSpecificUrlFromEnv(signalResourcePath), - headers: wrapStaticHeadersInFunction(getStaticHeadersFromEnv(signalIdentifier)) - }; -} -var import_src$4; -var init_otlp_node_http_env_configuration = __esmMin((() => { - import_src$4 = require_src$8(); - init_esm$2(); - init_shared_env_configuration(); - init_shared_configuration(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-node-http-options.js -function convertLegacyAgentOptions(config$1) { - if (typeof config$1.httpAgentOptions === "function") return config$1.httpAgentOptions; - let legacy = config$1.httpAgentOptions; - if (config$1.keepAlive != null) legacy = { - keepAlive: config$1.keepAlive, - ...legacy - }; - if (legacy != null) return httpAgentFactoryFromOptions(legacy); - else return; -} -/** -* @deprecated this will be removed in 2.0 -* @param config -* @param signalIdentifier -* @param signalResourcePath -* @param requiredHeaders -*/ -function convertLegacyHttpOptions(config$1, signalIdentifier, signalResourcePath, requiredHeaders) { - if (config$1.metadata) diag.warn("Metadata cannot be set when using http"); - return mergeOtlpNodeHttpConfigurationWithDefaults({ - url: config$1.url, - headers: wrapStaticHeadersInFunction(config$1.headers), - concurrencyLimit: config$1.concurrencyLimit, - timeoutMillis: config$1.timeoutMillis, - compression: config$1.compression, - agentFactory: convertLegacyAgentOptions(config$1) - }, getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath), getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath)); -} -var init_convert_legacy_node_http_options = __esmMin((() => { - init_esm$2(); - init_shared_configuration(); - init_otlp_node_http_configuration(); - init_index_node_http(); - init_otlp_node_http_env_configuration(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index-node-http.js -var index_node_http_exports = /* @__PURE__ */ __exportAll({ - convertLegacyHttpOptions: () => convertLegacyHttpOptions, - createOtlpHttpExportDelegate: () => createOtlpHttpExportDelegate, - getSharedConfigurationFromEnvironment: () => getSharedConfigurationFromEnvironment, - httpAgentFactoryFromOptions: () => httpAgentFactoryFromOptions -}); -var init_index_node_http = __esmMin((() => { - init_otlp_node_http_configuration(); - init_otlp_http_export_delegate(); - init_shared_env_configuration(); - init_convert_legacy_node_http_options(); +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/state/MetricCollector.js +var require_MetricCollector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricCollector = void 0; + const core_1 = require_src$8(); + /** + * An internal opaque interface that the MetricReader receives as + * MetricProducer. It acts as the storage key to the internal metric stream + * state for each MetricReader. + */ + var MetricCollector = class { + _sharedState; + _metricReader; + constructor(sharedState, metricReader) { + this._sharedState = sharedState; + this._metricReader = metricReader; + } + async collect(options) { + const collectionTime = (0, core_1.millisToHrTime)(Date.now()); + const scopeMetrics = []; + const errors = []; + const meterCollectionPromises = Array.from(this._sharedState.meterSharedStates.values()).map(async (meterSharedState) => { + const current = await meterSharedState.collect(this, collectionTime, options); + if (current?.scopeMetrics != null) scopeMetrics.push(current.scopeMetrics); + if (current?.errors != null) errors.push(...current.errors); + }); + await Promise.all(meterCollectionPromises); + return { + resourceMetrics: { + resource: this._sharedState.resource, + scopeMetrics + }, + errors + }; + } + /** + * Delegates for MetricReader.forceFlush. + */ + async forceFlush(options) { + await this._metricReader.forceFlush(options); + } + /** + * Delegates for MetricReader.shutdown. + */ + async shutdown(options) { + await this._metricReader.shutdown(options); + } + selectAggregationTemporality(instrumentType) { + return this._metricReader.selectAggregationTemporality(instrumentType); + } + selectAggregation(instrumentType) { + return this._metricReader.selectAggregation(instrumentType); + } + /** + * Select the cardinality limit for the given {@link InstrumentType} for this + * collector. + */ + selectCardinalityLimit(instrumentType) { + return this._metricReader.selectCardinalityLimit?.(instrumentType) ?? 2e3; + } + }; + exports.MetricCollector = MetricCollector; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPTraceExporter.js -var require_OTLPTraceExporter = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/Predicate.js +var require_Predicate = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPTraceExporter = void 0; - const otlp_exporter_base_1 = (init_esm(), __toCommonJS(esm_exports)); - const version_1 = require_version$1(); - const otlp_transformer_1 = require_src$5(); - const node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports)); + exports.ExactPredicate = exports.PatternPredicate = void 0; + const ESCAPE = /[\^$\\.+?()[\]{}|]/g; /** - * Collector Trace Exporter for Node + * Wildcard pattern predicate, supports patterns like `*`, `foo*`, `*bar`. */ - var OTLPTraceExporter = class extends otlp_exporter_base_1.OTLPExporterBase { - constructor(config$1 = {}) { - super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config$1, "TRACES", "v1/traces", { - "User-Agent": `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`, - "Content-Type": "application/json" - }), otlp_transformer_1.JsonTraceSerializer)); + var PatternPredicate = class PatternPredicate { + _matchAll; + _regexp; + constructor(pattern) { + if (pattern === "*") { + this._matchAll = true; + this._regexp = /.*/; + } else { + this._matchAll = false; + this._regexp = new RegExp(PatternPredicate.escapePattern(pattern)); + } + } + match(str) { + if (this._matchAll) return true; + return this._regexp.test(str); + } + static escapePattern(pattern) { + return `^${pattern.replace(ESCAPE, "\\$&").replace("*", ".*")}$`; + } + static hasWildcard(pattern) { + return pattern.includes("*"); } }; - exports.OTLPTraceExporter = OTLPTraceExporter; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js -var require_node$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPTraceExporter = void 0; - var OTLPTraceExporter_1 = require_OTLPTraceExporter(); - Object.defineProperty(exports, "OTLPTraceExporter", { - enumerable: true, - get: function() { - return OTLPTraceExporter_1.OTLPTraceExporter; + exports.PatternPredicate = PatternPredicate; + var ExactPredicate = class { + _matchAll; + _pattern; + constructor(pattern) { + this._matchAll = pattern === void 0; + this._pattern = pattern; } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/index.js -var require_platform$2 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPTraceExporter = void 0; - var node_1 = require_node$2(); - Object.defineProperty(exports, "OTLPTraceExporter", { - enumerable: true, - get: function() { - return node_1.OTLPTraceExporter; + match(str) { + if (this._matchAll) return true; + if (str === this._pattern) return true; + return false; } - }); + }; + exports.ExactPredicate = ExactPredicate; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js -var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/AttributesProcessor.js +var require_AttributesProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.OTLPTraceExporter = void 0; - var platform_1 = require_platform$2(); - Object.defineProperty(exports, "OTLPTraceExporter", { - enumerable: true, - get: function() { - return platform_1.OTLPTraceExporter; + exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.createMultiAttributesProcessor = exports.createNoopAttributesProcessor = void 0; + var NoopAttributesProcessor = class { + process(incoming, _context) { + return incoming; } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/default-service-name.js -var require_default_service_name = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports._clearDefaultServiceNameCache = exports.defaultServiceName = void 0; - let serviceName; + }; + var MultiAttributesProcessor = class { + _processors; + constructor(processors) { + this._processors = processors; + } + process(incoming, context) { + let filteredAttributes = incoming; + for (const processor of this._processors) filteredAttributes = processor.process(filteredAttributes, context); + return filteredAttributes; + } + }; + var AllowListProcessor = class { + _allowedAttributeNames; + constructor(allowedAttributeNames) { + this._allowedAttributeNames = new Set(allowedAttributeNames); + } + process(incoming, _context) { + const filteredAttributes = {}; + for (const attributeName in incoming) if (Object.prototype.hasOwnProperty.call(incoming, attributeName) && this._allowedAttributeNames.has(attributeName)) filteredAttributes[attributeName] = incoming[attributeName]; + return filteredAttributes; + } + }; + var DenyListProcessor = class { + _deniedAttributeNames; + constructor(deniedAttributeNames) { + this._deniedAttributeNames = new Set(deniedAttributeNames); + } + process(incoming, _context) { + const filteredAttributes = {}; + for (const attributeName in incoming) if (Object.prototype.hasOwnProperty.call(incoming, attributeName) && !this._deniedAttributeNames.has(attributeName)) filteredAttributes[attributeName] = incoming[attributeName]; + return filteredAttributes; + } + }; /** - * Returns the default service name for OpenTelemetry resources. - * In Node.js environments, returns "unknown_service:". - * In browser/edge environments, returns "unknown_service". + * @internal + * + * Create an {@link IAttributesProcessor} that acts as a simple pass-through for attributes. */ - function defaultServiceName() { - if (serviceName === void 0) try { - const argv0 = globalThis.process.argv0; - serviceName = argv0 ? `unknown_service:${argv0}` : "unknown_service"; - } catch { - serviceName = "unknown_service"; - } - return serviceName; + function createNoopAttributesProcessor() { + return NOOP; } - exports.defaultServiceName = defaultServiceName; - /** @internal For testing purposes only */ - function _clearDefaultServiceNameCache() { - serviceName = void 0; + exports.createNoopAttributesProcessor = createNoopAttributesProcessor; + /** + * @internal + * + * Create an {@link IAttributesProcessor} that applies all processors from the provided list in order. + * + * @param processors Processors to apply in order. + */ + function createMultiAttributesProcessor(processors) { + return new MultiAttributesProcessor(processors); } - exports._clearDefaultServiceNameCache = _clearDefaultServiceNameCache; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/utils.js -var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.isPromiseLike = void 0; - const isPromiseLike = (val) => { - return val !== null && typeof val === "object" && typeof val.then === "function"; - }; - exports.isPromiseLike = isPromiseLike; + exports.createMultiAttributesProcessor = createMultiAttributesProcessor; + /** + * Create an {@link IAttributesProcessor} that filters by allowed attribute names and drops any names that are not in the + * allow list. + */ + function createAllowListAttributesProcessor(attributeAllowList) { + return new AllowListProcessor(attributeAllowList); + } + exports.createAllowListAttributesProcessor = createAllowListAttributesProcessor; + /** + * Create an {@link IAttributesProcessor} that drops attributes based on the names provided in the deny list + */ + function createDenyListAttributesProcessor(attributeDenyList) { + return new DenyListProcessor(attributeDenyList); + } + exports.createDenyListAttributesProcessor = createDenyListAttributesProcessor; + const NOOP = new NoopAttributesProcessor(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js -var require_ResourceImpl = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/InstrumentSelector.js +var require_InstrumentSelector = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const default_service_name_1 = require_default_service_name(); - const utils_1 = require_utils$1(); - var ResourceImpl = class ResourceImpl { - _rawAttributes; - _asyncAttributesPending = false; - _schemaUrl; - _memoizedAttributes; - static FromAttributeList(attributes, options) { - const res = new ResourceImpl({}, options); - res._rawAttributes = guardedRawAttributes(attributes); - res._asyncAttributesPending = attributes.filter(([_, val]) => (0, utils_1.isPromiseLike)(val)).length > 0; - return res; - } - constructor(resource, options) { - const attributes = resource.attributes ?? {}; - this._rawAttributes = Object.entries(attributes).map(([k, v]) => { - if ((0, utils_1.isPromiseLike)(v)) this._asyncAttributesPending = true; - return [k, v]; - }); - this._rawAttributes = guardedRawAttributes(this._rawAttributes); - this._schemaUrl = validateSchemaUrl(options?.schemaUrl); - } - get asyncAttributesPending() { - return this._asyncAttributesPending; - } - async waitForAsyncAttributes() { - if (!this.asyncAttributesPending) return; - for (let i = 0; i < this._rawAttributes.length; i++) { - const [k, v] = this._rawAttributes[i]; - this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; - } - this._asyncAttributesPending = false; + exports.InstrumentSelector = void 0; + const Predicate_1 = require_Predicate(); + var InstrumentSelector = class { + _nameFilter; + _type; + _unitFilter; + constructor(criteria) { + this._nameFilter = new Predicate_1.PatternPredicate(criteria?.name ?? "*"); + this._type = criteria?.type; + this._unitFilter = new Predicate_1.ExactPredicate(criteria?.unit); } - get attributes() { - if (this.asyncAttributesPending) api_1.diag.error("Accessing resource attributes before async attributes settled"); - if (this._memoizedAttributes) return this._memoizedAttributes; - const attrs = {}; - for (const [k, v] of this._rawAttributes) { - if ((0, utils_1.isPromiseLike)(v)) { - api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); - continue; - } - if (v != null) attrs[k] ??= v; - } - if (!this._asyncAttributesPending) this._memoizedAttributes = attrs; - return attrs; + getType() { + return this._type; } - getRawAttributes() { - return this._rawAttributes; + getNameFilter() { + return this._nameFilter; } - get schemaUrl() { - return this._schemaUrl; + getUnitFilter() { + return this._unitFilter; } - merge(resource) { - if (resource == null) return this; - const mergedSchemaUrl = mergeSchemaUrl(this, resource); - const mergedOptions = mergedSchemaUrl ? { schemaUrl: mergedSchemaUrl } : void 0; - return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); + }; + exports.InstrumentSelector = InstrumentSelector; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/MeterSelector.js +var require_MeterSelector = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterSelector = void 0; + const Predicate_1 = require_Predicate(); + var MeterSelector = class { + _nameFilter; + _versionFilter; + _schemaUrlFilter; + constructor(criteria) { + this._nameFilter = new Predicate_1.ExactPredicate(criteria?.name); + this._versionFilter = new Predicate_1.ExactPredicate(criteria?.version); + this._schemaUrlFilter = new Predicate_1.ExactPredicate(criteria?.schemaUrl); + } + getNameFilter() { + return this._nameFilter; + } + /** + * TODO: semver filter? no spec yet. + */ + getVersionFilter() { + return this._versionFilter; + } + getSchemaUrlFilter() { + return this._schemaUrlFilter; } }; - function resourceFromAttributes(attributes, options) { - return ResourceImpl.FromAttributeList(Object.entries(attributes), options); - } - exports.resourceFromAttributes = resourceFromAttributes; - function resourceFromDetectedResource(detectedResource, options) { - return new ResourceImpl(detectedResource, options); - } - exports.resourceFromDetectedResource = resourceFromDetectedResource; - function emptyResource() { - return resourceFromAttributes({}); - } - exports.emptyResource = emptyResource; - function defaultResource() { - return resourceFromAttributes({ - [semantic_conventions_1.ATTR_SERVICE_NAME]: (0, default_service_name_1.defaultServiceName)(), - [semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_LANGUAGE], - [semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_NAME], - [semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.ATTR_TELEMETRY_SDK_VERSION] - }); - } - exports.defaultResource = defaultResource; - function guardedRawAttributes(attributes) { - return attributes.map(([k, v]) => { - if ((0, utils_1.isPromiseLike)(v)) return [k, v.catch((err) => { - api_1.diag.debug("promise rejection for resource attribute: %s - %s", k, err); - })]; - return [k, v]; - }); - } - function validateSchemaUrl(schemaUrl) { - if (typeof schemaUrl === "string" || schemaUrl === void 0) return schemaUrl; - api_1.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", schemaUrl); - } - function mergeSchemaUrl(old, updating) { - const oldSchemaUrl = old?.schemaUrl; - const updatingSchemaUrl = updating?.schemaUrl; - const isOldEmpty = oldSchemaUrl === void 0 || oldSchemaUrl === ""; - const isUpdatingEmpty = updatingSchemaUrl === void 0 || updatingSchemaUrl === ""; - if (isOldEmpty) return updatingSchemaUrl; - if (isUpdatingEmpty) return oldSchemaUrl; - if (oldSchemaUrl === updatingSchemaUrl) return oldSchemaUrl; - api_1.diag.warn("Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.", oldSchemaUrl, updatingSchemaUrl); - } + exports.MeterSelector = MeterSelector; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detect-resources.js -var require_detect_resources = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/view/View.js +var require_View = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.detectResources = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const ResourceImpl_1 = require_ResourceImpl(); + exports.View = void 0; + const Predicate_1 = require_Predicate(); + const AttributesProcessor_1 = require_AttributesProcessor(); + const InstrumentSelector_1 = require_InstrumentSelector(); + const MeterSelector_1 = require_MeterSelector(); + const AggregationOption_1 = require_AggregationOption(); + function isSelectorNotProvided(options) { + return options.instrumentName == null && options.instrumentType == null && options.instrumentUnit == null && options.meterName == null && options.meterVersion == null && options.meterSchemaUrl == null; + } + function validateViewOptions(viewOptions) { + if (isSelectorNotProvided(viewOptions)) throw new Error("Cannot create view with no selector arguments supplied"); + if (viewOptions.name != null && (viewOptions?.instrumentName == null || Predicate_1.PatternPredicate.hasWildcard(viewOptions.instrumentName))) throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter."); + } /** - * Runs all resource detectors and returns the results merged into a single Resource. - * - * @param config Configuration for resource detection + * Can be passed to a {@link MeterProvider} to select instruments and alter their metric stream. */ - const detectResources = (config$1 = {}) => { - return (config$1.detectors || []).map((d) => { - try { - const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config$1)); - api_1.diag.debug(`${d.constructor.name} found resource.`, resource); - return resource; - } catch (e) { - api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); - return (0, ResourceImpl_1.emptyResource)(); - } - }).reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); + var View = class { + name; + description; + aggregation; + attributesProcessor; + instrumentSelector; + meterSelector; + aggregationCardinalityLimit; + /** + * Create a new {@link View} instance. + * + * Parameters can be categorized as two types: + * Instrument selection criteria: Used to describe the instrument(s) this view will be applied to. + * Will be treated as additive (the Instrument has to meet all the provided criteria to be selected). + * + * Metric stream altering: Alter the metric stream of instruments selected by instrument selection criteria. + * + * @param viewOptions {@link ViewOptions} for altering the metric stream and instrument selection. + * @param viewOptions.name + * Alters the metric stream: + * This will be used as the name of the metrics stream. + * If not provided, the original Instrument name will be used. + * @param viewOptions.description + * Alters the metric stream: + * This will be used as the description of the metrics stream. + * If not provided, the original Instrument description will be used by default. + * @param viewOptions.attributesProcessors + * Alters the metric stream: + * If provided, the attributes will be modified as defined by the added processors. + * If not provided, all attribute keys will be used by default. + * @param viewOptions.aggregationCardinalityLimit + * Alters the metric stream: + * Sets a limit on the number of unique attribute combinations (cardinality) that can be aggregated. + * If not provided, the default limit of 2000 will be used. + * @param viewOptions.aggregation + * Alters the metric stream: + * Alters the {@link Aggregation} of the metric stream. + * @param viewOptions.instrumentName + * Instrument selection criteria: + * Original name of the Instrument(s) with wildcard support. + * @param viewOptions.instrumentType + * Instrument selection criteria: + * The original type of the Instrument(s). + * @param viewOptions.instrumentUnit + * Instrument selection criteria: + * The unit of the Instrument(s). + * @param viewOptions.meterName + * Instrument selection criteria: + * The name of the Meter. No wildcard support, name must match the meter exactly. + * @param viewOptions.meterVersion + * Instrument selection criteria: + * The version of the Meter. No wildcard support, version must match exactly. + * @param viewOptions.meterSchemaUrl + * Instrument selection criteria: + * The schema URL of the Meter. No wildcard support, schema URL must match exactly. + * + * @example + * // Create a view that changes the Instrument 'my.instrument' to use to an + * // ExplicitBucketHistogramAggregation with the boundaries [20, 30, 40] + * new View({ + * aggregation: new ExplicitBucketHistogramAggregation([20, 30, 40]), + * instrumentName: 'my.instrument' + * }) + */ + constructor(viewOptions) { + validateViewOptions(viewOptions); + if (viewOptions.attributesProcessors != null) this.attributesProcessor = (0, AttributesProcessor_1.createMultiAttributesProcessor)(viewOptions.attributesProcessors); + else this.attributesProcessor = (0, AttributesProcessor_1.createNoopAttributesProcessor)(); + this.name = viewOptions.name; + this.description = viewOptions.description; + this.aggregation = (0, AggregationOption_1.toAggregation)(viewOptions.aggregation ?? { type: AggregationOption_1.AggregationType.DEFAULT }); + this.instrumentSelector = new InstrumentSelector_1.InstrumentSelector({ + name: viewOptions.instrumentName, + type: viewOptions.instrumentType, + unit: viewOptions.instrumentUnit + }); + this.meterSelector = new MeterSelector_1.MeterSelector({ + name: viewOptions.meterName, + version: viewOptions.meterVersion, + schemaUrl: viewOptions.meterSchemaUrl + }); + this.aggregationCardinalityLimit = viewOptions.aggregationCardinalityLimit; + } }; - exports.detectResources = detectResources; + exports.View = View; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js -var require_EnvDetector = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/MeterProvider.js +var require_MeterProvider = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.envDetector = void 0; + exports.MeterProvider = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const core_1 = require_src$9(); + const resources_1 = require_src$6(); + const MetricReader_1 = require_MetricReader(); + const MeterProviderSharedState_1 = require_MeterProviderSharedState(); + const MetricCollector_1 = require_MetricCollector(); + const View_1 = require_View(); /** - * EnvDetector can be used to detect the presence of and create a Resource - * from the OTEL_RESOURCE_ATTRIBUTES environment variable. + * This class implements the {@link MeterProvider} interface. */ - var EnvDetector = class { - _MAX_LENGTH = 255; - _COMMA_SEPARATOR = ","; - _LABEL_KEY_VALUE_SPLITTER = "="; + var MeterProvider = class { + _sharedState; + _shutdown = false; + constructor(options) { + this._sharedState = new MeterProviderSharedState_1.MeterProviderSharedState(options?.resource ?? (0, resources_1.defaultResource)()); + if (options?.views != null && options.views.length > 0) for (const viewOption of options.views) this._sharedState.viewRegistry.addView(new View_1.View(viewOption)); + if (options?.readers != null && options.readers.length > 0) for (const metricReader of options.readers) { + const collector = new MetricCollector_1.MetricCollector(this._sharedState, metricReader); + metricReader.setMetricProducer(collector); + this._sharedState.metricCollectors.push(collector); + if (options.sdkMetricsEnabled && metricReader instanceof MetricReader_1.MetricReader) metricReader._setSelfObsMeterProvider(this); + } + } /** - * Returns a {@link Resource} populated with attributes from the - * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async - * function to conform to the Detector interface. - * - * @param config The resource detection config + * Get a meter with the configuration of the MeterProvider. */ - detect(_config) { - const attributes = {}; - const rawAttributes = (0, core_1.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"); - const serviceName = (0, core_1.getStringFromEnv)("OTEL_SERVICE_NAME"); - if (rawAttributes) try { - const parsedAttributes = this._parseResourceAttributes(rawAttributes); - Object.assign(attributes, parsedAttributes); - } catch (e) { - api_1.diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); + getMeter(name, version = "", options = {}) { + if (this._shutdown) { + api_1.diag.warn("A shutdown MeterProvider cannot provide a Meter"); + return (0, api_1.createNoopMeter)(); + } + return this._sharedState.getMeterSharedState({ + name, + version, + schemaUrl: options.schemaUrl + }).meter; + } + /** + * Shut down the MeterProvider and all registered + * MetricReaders. + * + * Returns a promise which is resolved when all flushes are complete. + */ + async shutdown(options) { + if (this._shutdown) { + api_1.diag.warn("shutdown may only be called once per MeterProvider"); + return; } - if (serviceName) attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; - return { attributes }; + this._shutdown = true; + await Promise.all(this._sharedState.metricCollectors.map((collector) => { + return collector.shutdown(options); + })); } /** - * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment - * variable. - * - * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the - * format "key1=value1,key2=value2". The ',' and '=' characters in keys - * and values MUST be percent-encoded. Other characters MAY be percent-encoded. - * - * Per the spec, on any error (e.g., decoding failure), the entire environment - * variable value is discarded. + * Notifies all registered MetricReaders to flush any buffered data. * - * @param rawEnvAttributes The resource attributes as a comma-separated list - * of key/value pairs. - * @returns The parsed resource attributes. - * @throws Error if parsing fails (caller handles by discarding all attributes) + * Returns a promise which is resolved when all flushes are complete. */ - _parseResourceAttributes(rawEnvAttributes) { - if (!rawEnvAttributes) return {}; - const attributes = {}; - const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR).filter((attr) => attr.trim() !== ""); - for (const rawAttribute of rawAttributes) { - const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); - if (keyValuePair.length !== 2) throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`); - const [rawKey, rawValue] = keyValuePair; - const key = rawKey.trim(); - const value = rawValue.trim(); - if (key.length === 0) throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); - let decodedKey; - let decodedValue; - try { - decodedKey = decodeURIComponent(key); - decodedValue = decodeURIComponent(value); - } catch (e) { - throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`); - } - if (decodedKey.length > this._MAX_LENGTH) throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); - if (decodedValue.length > this._MAX_LENGTH) throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); - attributes[decodedKey] = decodedValue; + async forceFlush(options) { + if (this._shutdown) { + api_1.diag.warn("invalid attempt to force flush after MeterProvider shutdown"); + return; } - return attributes; + await Promise.all(this._sharedState.metricCollectors.map((collector) => { + return collector.forceFlush(options); + })); } }; - exports.envDetector = new EnvDetector(); + exports.MeterProvider = MeterProvider; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/semconv.js -var require_semconv$1 = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-metrics@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-metrics/build/src/index.js +var require_src$5 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0; - /** - * The cloud account ID the resource is assigned to. - * - * @example 111111111111 - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_ACCOUNT_ID = "cloud.account.id"; - /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * @example us-east-1c - * - * @note Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; - /** - * Name of the cloud provider. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_PROVIDER = "cloud.provider"; - /** - * The geographical region the resource is running. - * - * @example us-central1 - * @example us-east-1 - * - * @note Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/), [Google Cloud regions](https://cloud.google.com/about/locations), or [Tencent Cloud regions](https://www.tencentcloud.com/document/product/213/6091). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CLOUD_REGION = "cloud.region"; - /** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. - * - * @example a3bf90e006b2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_ID = "container.id"; - /** - * Name of the image the container was built on. - * - * @example gcr.io/opentelemetry/operator - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_IMAGE_NAME = "container.image.name"; - /** - * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. - * - * @example ["v1.27.1", "3.5.7-0"] - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_IMAGE_TAGS = "container.image.tags"; - /** - * Container name used by container runtime. - * - * @example opentelemetry-autoconf - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_CONTAINER_NAME = "container.name"; - /** - * The CPU architecture the host system is running on. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_ARCH = "host.arch"; - /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. - * - * @example fdbf79e8af94cb7f9e8df36789187052 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_ID = "host.id"; - /** - * VM image ID or host OS image ID. For Cloud, this value is from the provider. - * - * @example ami-07b06b442921831e5 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_ID = "host.image.id"; - /** - * Name of the VM image or OS install the host was instantiated from. - * - * @example infra-ami-eks-worker-node-7d4ec78312 - * @example CentOS-8-x86_64-1905 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_NAME = "host.image.name"; - /** - * The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - * - * @example 0.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_IMAGE_VERSION = "host.image.version"; - /** - * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. - * - * @example opentelemetry-test - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_NAME = "host.name"; - /** - * Type of host. For Cloud, this must be the machine type. - * - * @example n1-standard-1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_HOST_TYPE = "host.type"; - /** - * The name of the cluster. - * - * @example opentelemetry-cluster - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_CLUSTER_NAME = "k8s.cluster.name"; - /** - * The name of the Deployment. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; - /** - * The name of the namespace that the pod is running in. - * - * @example default - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_NAMESPACE_NAME = "k8s.namespace.name"; - /** - * The name of the Pod. - * - * @example opentelemetry-pod-autoconf - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_K8S_POD_NAME = "k8s.pod.name"; + exports.TimeoutError = exports.createDenyListAttributesProcessor = exports.createAllowListAttributesProcessor = exports.AggregationType = exports.MeterProvider = exports.ConsoleMetricExporter = exports.InMemoryMetricExporter = exports.PeriodicExportingMetricReader = exports.MetricReader = exports.InstrumentType = exports.DataPointType = exports.AggregationTemporality = void 0; + var AggregationTemporality_1 = require_AggregationTemporality(); + Object.defineProperty(exports, "AggregationTemporality", { + enumerable: true, + get: function() { + return AggregationTemporality_1.AggregationTemporality; + } + }); + var MetricData_1 = require_MetricData(); + Object.defineProperty(exports, "DataPointType", { + enumerable: true, + get: function() { + return MetricData_1.DataPointType; + } + }); + Object.defineProperty(exports, "InstrumentType", { + enumerable: true, + get: function() { + return MetricData_1.InstrumentType; + } + }); + var MetricReader_1 = require_MetricReader(); + Object.defineProperty(exports, "MetricReader", { + enumerable: true, + get: function() { + return MetricReader_1.MetricReader; + } + }); + var PeriodicExportingMetricReader_1 = require_PeriodicExportingMetricReader(); + Object.defineProperty(exports, "PeriodicExportingMetricReader", { + enumerable: true, + get: function() { + return PeriodicExportingMetricReader_1.PeriodicExportingMetricReader; + } + }); + var InMemoryMetricExporter_1 = require_InMemoryMetricExporter(); + Object.defineProperty(exports, "InMemoryMetricExporter", { + enumerable: true, + get: function() { + return InMemoryMetricExporter_1.InMemoryMetricExporter; + } + }); + var ConsoleMetricExporter_1 = require_ConsoleMetricExporter(); + Object.defineProperty(exports, "ConsoleMetricExporter", { + enumerable: true, + get: function() { + return ConsoleMetricExporter_1.ConsoleMetricExporter; + } + }); + var MeterProvider_1 = require_MeterProvider(); + Object.defineProperty(exports, "MeterProvider", { + enumerable: true, + get: function() { + return MeterProvider_1.MeterProvider; + } + }); + var AggregationOption_1 = require_AggregationOption(); + Object.defineProperty(exports, "AggregationType", { + enumerable: true, + get: function() { + return AggregationOption_1.AggregationType; + } + }); + var AttributesProcessor_1 = require_AttributesProcessor(); + Object.defineProperty(exports, "createAllowListAttributesProcessor", { + enumerable: true, + get: function() { + return AttributesProcessor_1.createAllowListAttributesProcessor; + } + }); + Object.defineProperty(exports, "createDenyListAttributesProcessor", { + enumerable: true, + get: function() { + return AttributesProcessor_1.createDenyListAttributesProcessor; + } + }); + var utils_1 = require_utils$3(); + Object.defineProperty(exports, "TimeoutError", { + enumerable: true, + get: function() { + return utils_1.TimeoutError; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/metrics-serializer.js +var require_metrics_serializer = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serializeMetricsExportRequest = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const sdk_metrics_1 = require_src$5(); + const common_serializer_1 = require_common_serializer(); + const protobuf_size_estimator_1 = require_protobuf_size_estimator(); + const protobuf_writer_1 = require_protobuf_writer(); + /** + * Serialize a NumberDataPoint directly from SDK DataPoint + * + * Proto fields (NumberDataPoint): + * 7 attributes repeated KeyValue (wire type 2) + * 2 start_time_unix_nano fixed64 (wire type 1) + * 3 time_unix_nano fixed64 (wire type 1) + * 4 as_double double (wire type 1) + * 6 as_int sfixed64 (wire type 1) + * 5 exemplars repeated Exemplar (wire type 2) + * 8 flags uint32 (wire type 0) + */ + function serializeNumberDataPoint(writer, dataPoint, valueType) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + writer.writeTag(2, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, dataPoint.startTime); + writer.writeTag(3, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, dataPoint.endTime); + if (valueType === api_1.ValueType.INT) { + writer.writeTag(6, 1); + writer.writeSfixed64(dataPoint.value); + } else { + writer.writeTag(4, 1); + writer.writeDouble(dataPoint.value); + } + if (dataPoint.attributes) (0, common_serializer_1.writeAttributes)(writer, dataPoint.attributes, 7); + writer.finishLengthDelimited(start, writer.pos - startPos); + } + /** + * Serialize a HistogramDataPoint directly from SDK DataPoint + * + * Proto fields (HistogramDataPoint): + * 9 attributes repeated KeyValue (wire type 2) + * 2 start_time_unix_nano fixed64 (wire type 1) + * 3 time_unix_nano fixed64 (wire type 1) + * 4 count fixed64 (wire type 1) + * 5 sum optional double (wire type 1) + * 6 bucket_counts repeated fixed64 (packed, wire type 2) + * 7 explicit_bounds repeated double (packed, wire type 2) + * 8 exemplars repeated Exemplar (wire type 2) + * 10 flags uint32 (wire type 0) + * 11 min optional double (wire type 1) + * 12 max optional double (wire type 1) + */ + function serializeHistogramDataPoint(writer, dataPoint) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + const histogram = dataPoint.value; + writer.writeTag(2, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, dataPoint.startTime); + writer.writeTag(3, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, dataPoint.endTime); + writer.writeTag(4, 1); + writer.writeFixed64(histogram.count >>> 0, histogram.count / 4294967296 >>> 0); + if (histogram.sum !== void 0) { + writer.writeTag(5, 1); + writer.writeDouble(histogram.sum); + } + if (histogram.buckets.counts.length > 0) { + writer.writeTag(6, 2); + const countsStart = writer.startLengthDelimited(); + const countsStartPos = writer.pos; + for (const count of histogram.buckets.counts) writer.writeFixed64(count >>> 0, count / 4294967296 >>> 0); + writer.finishLengthDelimited(countsStart, writer.pos - countsStartPos); + } + if (histogram.buckets.boundaries.length > 0) { + writer.writeTag(7, 2); + const boundsStart = writer.startLengthDelimited(); + const boundsStartPos = writer.pos; + for (const bound of histogram.buckets.boundaries) writer.writeDouble(bound); + writer.finishLengthDelimited(boundsStart, writer.pos - boundsStartPos); + } + if (dataPoint.attributes) (0, common_serializer_1.writeAttributes)(writer, dataPoint.attributes, 9); + if (histogram.min !== void 0) { + writer.writeTag(11, 1); + writer.writeDouble(histogram.min); + } + if (histogram.max !== void 0) { + writer.writeTag(12, 1); + writer.writeDouble(histogram.max); + } + writer.finishLengthDelimited(start, writer.pos - startPos); + } + /** + * Serialize ExponentialHistogramDataPoint.Buckets + * + * Proto fields (Buckets): + * 1 offset sint32 (wire type 0, zigzag) + * 2 bucket_counts repeated uint64 (packed, wire type 2) + */ + function serializeExponentialBuckets(writer, offset, bucketCounts) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + if (offset !== 0) { + writer.writeTag(1, 0); + writer.writeSint32(offset); + } + if (bucketCounts.length > 0) { + writer.writeTag(2, 2); + const bcStart = writer.startLengthDelimited(); + const bcStartPos = writer.pos; + for (const count of bucketCounts) writer.writeVarint(count); + writer.finishLengthDelimited(bcStart, writer.pos - bcStartPos); + } + writer.finishLengthDelimited(start, writer.pos - startPos); + } + /** + * Serialize an ExponentialHistogramDataPoint directly from SDK DataPoint + * + * Proto fields (ExponentialHistogramDataPoint): + * 1 attributes repeated KeyValue (wire type 2) + * 2 start_time_unix_nano fixed64 (wire type 1) + * 3 time_unix_nano fixed64 (wire type 1) + * 4 count fixed64 (wire type 1) + * 5 sum optional double (wire type 1) + * 6 scale sint32 (wire type 0, zigzag) + * 7 zero_count fixed64 (wire type 1) + * 8 positive Buckets (wire type 2) + * 9 negative Buckets (wire type 2) + * 10 flags uint32 (wire type 0) + * 11 exemplars repeated Exemplar (wire type 2) + * 12 min optional double (wire type 1) + * 13 max optional double (wire type 1) + */ + function serializeExponentialHistogramDataPoint(writer, dataPoint) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + const histogram = dataPoint.value; + if (dataPoint.attributes) (0, common_serializer_1.writeAttributes)(writer, dataPoint.attributes, 1); + writer.writeTag(2, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, dataPoint.startTime); + writer.writeTag(3, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, dataPoint.endTime); + writer.writeTag(4, 1); + writer.writeFixed64(histogram.count >>> 0, histogram.count / 4294967296 >>> 0); + if (histogram.sum !== void 0) { + writer.writeTag(5, 1); + writer.writeDouble(histogram.sum); + } + if (histogram.scale !== 0) { + writer.writeTag(6, 0); + writer.writeSint32(histogram.scale); + } + writer.writeTag(7, 1); + writer.writeFixed64(histogram.zeroCount >>> 0, histogram.zeroCount / 4294967296 >>> 0); + writer.writeTag(8, 2); + serializeExponentialBuckets(writer, histogram.positive.offset, histogram.positive.bucketCounts); + writer.writeTag(9, 2); + serializeExponentialBuckets(writer, histogram.negative.offset, histogram.negative.bucketCounts); + if (histogram.min !== void 0) { + writer.writeTag(12, 1); + writer.writeDouble(histogram.min); + } + if (histogram.max !== void 0) { + writer.writeTag(13, 1); + writer.writeDouble(histogram.max); + } + writer.finishLengthDelimited(start, writer.pos - startPos); + } + /** + * Serialize a Metric message with its data type + * + * Proto fields (Metric): + * 1 name string (wire type 2) + * 2 description string (wire type 2) + * 3 unit string (wire type 2) + * 5 gauge Gauge (wire type 2) + * 7 sum Sum (wire type 2) + * 9 histogram Histogram (wire type 2) + * 10 exponential_histogram ExponentialHist (wire type 2) + * 11 summary Summary (wire type 2) + */ + function serializeMetric(writer, metricData) { + const metricStart = writer.startLengthDelimited(); + const metricStartPos = writer.pos; + writer.writeTag(1, 2); + writer.writeString(metricData.descriptor.name); + if (metricData.descriptor.description) { + writer.writeTag(2, 2); + writer.writeString(metricData.descriptor.description); + } + if (metricData.descriptor.unit) { + writer.writeTag(3, 2); + writer.writeString(metricData.descriptor.unit); + } + switch (metricData.dataPointType) { + case sdk_metrics_1.DataPointType.GAUGE: + writer.writeTag(5, 2); + serializeGauge(writer, metricData); + break; + case sdk_metrics_1.DataPointType.SUM: + writer.writeTag(7, 2); + serializeSum(writer, metricData); + break; + case sdk_metrics_1.DataPointType.HISTOGRAM: + writer.writeTag(9, 2); + serializeHistogramMetric(writer, metricData); + break; + case sdk_metrics_1.DataPointType.EXPONENTIAL_HISTOGRAM: + writer.writeTag(10, 2); + serializeExponentialHistogramMetric(writer, metricData); + } + writer.finishLengthDelimited(metricStart, writer.pos - metricStartPos); + } /** - * The operating system type. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Proto fields (Gauge): + * 1 data_points repeated NumberDataPoint (wire type 2) */ - exports.ATTR_OS_TYPE = "os.type"; + function serializeGauge(writer, metricData) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + for (const dataPoint of metricData.dataPoints) { + writer.writeTag(1, 2); + serializeNumberDataPoint(writer, dataPoint, metricData.descriptor.valueType); + } + writer.finishLengthDelimited(start, writer.pos - startPos); + } /** - * The version string of the operating system as defined in [Version Attributes](/docs/resource/README.md#version-attributes). - * - * @example 14.2.1 - * @example 18.04.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Proto fields (Sum): + * 1 data_points repeated NumberDataPoint (wire type 2) + * 2 aggregation_temporality AggregationTemporality (wire type 0) + * 3 is_monotonic bool (wire type 0) */ - exports.ATTR_OS_VERSION = "os.version"; + function serializeSum(writer, metricData) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + for (const dataPoint of metricData.dataPoints) { + writer.writeTag(1, 2); + serializeNumberDataPoint(writer, dataPoint, metricData.descriptor.valueType); + } + const temporality = toProtoAggregationTemporality(metricData.aggregationTemporality); + if (temporality !== 0) { + writer.writeTag(2, 0); + writer.writeVarint(temporality); + } + if (metricData.isMonotonic) { + writer.writeTag(3, 0); + writer.writeVarint(1); + } + writer.finishLengthDelimited(start, writer.pos - startPos); + } /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. - * - * @example cmd/otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Proto fields (Histogram): + * 1 data_points repeated HistogramDataPoint (wire type 2) + * 2 aggregation_temporality AggregationTemporality (wire type 0) */ - exports.ATTR_PROCESS_COMMAND = "process.command"; + function serializeHistogramMetric(writer, metricData) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + for (const dataPoint of metricData.dataPoints) { + writer.writeTag(1, 2); + serializeHistogramDataPoint(writer, dataPoint); + } + const temporality = toProtoAggregationTemporality(metricData.aggregationTemporality); + if (temporality !== 0) { + writer.writeTag(2, 0); + writer.writeVarint(temporality); + } + writer.finishLengthDelimited(start, writer.pos - startPos); + } /** - * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - * - * @example ["cmd/otecol", "--config=config.yaml"] - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Proto fields (ExponentialHistogram): + * 1 data_points repeated ExponentialHistogramDataPoint (wire type 2) + * 2 aggregation_temporality AggregationTemporality (wire type 0) */ - exports.ATTR_PROCESS_COMMAND_ARGS = "process.command_args"; + function serializeExponentialHistogramMetric(writer, metricData) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + for (const dataPoint of metricData.dataPoints) { + writer.writeTag(1, 2); + serializeExponentialHistogramDataPoint(writer, dataPoint); + } + const temporality = toProtoAggregationTemporality(metricData.aggregationTemporality); + if (temporality !== 0) { + writer.writeTag(2, 0); + writer.writeVarint(temporality); + } + writer.finishLengthDelimited(start, writer.pos - startPos); + } /** - * The name of the process executable. On Linux based systems, this **SHOULD** be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this **SHOULD** be set to the base name of `GetProcessImageFileNameW`. - * - * @example otelcol - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Serialize ScopeMetrics directly from SDK types */ - exports.ATTR_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + function serializeScopeMetrics(writer, scopeMetrics) { + const scopeStart = writer.startLengthDelimited(); + const scopeStartPos = writer.pos; + (0, common_serializer_1.writeInstrumentationScope)(writer, scopeMetrics.scope, 1); + for (const metric of scopeMetrics.metrics) { + writer.writeTag(2, 2); + serializeMetric(writer, metric); + } + if (scopeMetrics.scope.schemaUrl) { + writer.writeTag(3, 2); + writer.writeString(scopeMetrics.scope.schemaUrl); + } + writer.finishLengthDelimited(scopeStart, writer.pos - scopeStartPos); + } /** - * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - * - * @example /usr/bin/cmd/otelcol + * Serialize ResourceMetrics directly from SDK types * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Proto fields (ResourceMetrics): + * 1 resource Resource (wire type 2) + * 2 scope_metrics repeated ScopeMetrics (wire type 2) + * 3 schema_url string (wire type 2) */ - exports.ATTR_PROCESS_EXECUTABLE_PATH = "process.executable.path"; + function serializeResourceMetrics(writer, resourceMetrics) { + const start = writer.startLengthDelimited(); + const startPos = writer.pos; + (0, common_serializer_1.writeResource)(writer, resourceMetrics.resource, 1); + for (const scopeMetrics of resourceMetrics.scopeMetrics) { + writer.writeTag(2, 2); + serializeScopeMetrics(writer, scopeMetrics); + } + if (resourceMetrics.resource.schemaUrl) { + writer.writeTag(3, 2); + writer.writeString(resourceMetrics.resource.schemaUrl); + } + writer.finishLengthDelimited(start, writer.pos - startPos); + } + function toProtoAggregationTemporality(temporality) { + switch (temporality) { + case sdk_metrics_1.AggregationTemporality.DELTA: return 1; + case sdk_metrics_1.AggregationTemporality.CUMULATIVE: return 2; + default: return 0; + } + } /** - * The username of the user that owns the process. - * - * @example root - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Serialize ExportMetricsServiceRequest directly from ResourceMetrics */ - exports.ATTR_PROCESS_OWNER = "process.owner"; + function serializeMetricsExportRequest(resourceMetrics) { + const estimator = new protobuf_size_estimator_1.ProtobufSizeEstimator(); + estimator.writeTag(1, 2); + serializeResourceMetrics(estimator, resourceMetrics); + const writer = new protobuf_writer_1.ProtobufWriter(estimator.pos); + writer.writeTag(1, 2); + serializeResourceMetrics(writer, resourceMetrics); + return writer.finish(); + } + exports.serializeMetricsExportRequest = serializeMetricsExportRequest; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/response-deserializer.js +var require_response_deserializer$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.deserializeExportMetricsServiceResponse = void 0; + const protobuf_reader_1 = require_protobuf_reader(); /** - * Process identifier (PID). - * - * @example 1234 + * Parse an ExportMetricsPartialSuccess embedded message from raw bytes. * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Field map (opentelemetry/proto/collector/metrics/v1/metrics_service.proto): + * 1 rejected_data_points int64 (varint) + * 2 error_message string (length-delimited) */ - exports.ATTR_PROCESS_PID = "process.pid"; + function deserializePartialSuccess(data) { + const reader = new protobuf_reader_1.ProtobufReader(data); + const result = {}; + while (!reader.isAtEnd()) { + const { fieldNumber, wireType } = reader.readTag(); + switch (fieldNumber) { + case 1: + if (wireType === 0) result.rejectedDataPoints = reader.readVarint(); + else reader.skip(wireType); + break; + case 2: + if (wireType === 2) result.errorMessage = reader.readString(); + else reader.skip(wireType); + break; + default: reader.skip(wireType); + } + } + return result; + } /** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - * - * @example "Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0" + * Parse an ExportMetricsServiceResponse protobuf message from raw bytes. * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Field map (opentelemetry/proto/collector/metrics/v1/metrics_service.proto): + * 1 partial_success ExportMetricsPartialSuccess (length-delimited) */ - exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; + function deserializeExportMetricsServiceResponse(data) { + const reader = new protobuf_reader_1.ProtobufReader(data); + const result = {}; + while (!reader.isAtEnd()) { + const { fieldNumber, wireType } = reader.readTag(); + switch (fieldNumber) { + case 1: + if (wireType === 2) result.partialSuccess = deserializePartialSuccess(reader.readBytes()); + else reader.skip(wireType); + break; + default: reader.skip(wireType); + } + } + return result; + } + exports.deserializeExportMetricsServiceResponse = deserializeExportMetricsServiceResponse; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/metrics.js +var require_metrics$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufMetricsSerializer = void 0; + const metrics_serializer_1 = require_metrics_serializer(); + const response_deserializer_1 = require_response_deserializer$1(); + exports.ProtobufMetricsSerializer = { + serializeRequest: (arg) => { + return (0, metrics_serializer_1.serializeMetricsExportRequest)(arg); + }, + deserializeResponse: (arg) => { + return (0, response_deserializer_1.deserializeExportMetricsServiceResponse)(arg); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/protobuf/index.js +var require_protobuf$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufMetricsSerializer = void 0; + var metrics_1 = require_metrics$1(); + Object.defineProperty(exports, "ProtobufMetricsSerializer", { + enumerable: true, + get: function() { + return metrics_1.ProtobufMetricsSerializer; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/trace-serializer.js +var require_trace_serializer = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serializeTraceExportRequest = void 0; + const protobuf_writer_1 = require_protobuf_writer(); + const hex_to_binary_1 = require_hex_to_binary(); + const common_serializer_1 = require_common_serializer(); + const protobuf_size_estimator_1 = require_protobuf_size_estimator(); + const SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 256; + const SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512; + function buildSpanFlags(traceFlags, isRemote) { + let flags = traceFlags & 255 | SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK; + if (isRemote) flags |= SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK; + return flags; + } + /** + * Serialize a Span.Status message + * + * Proto fields (Status): + * 1 (reserved) + * 2 message string (length-delimited) + * 3 code StatusCode (varint) + */ + function serializeStatus(writer, status) { + const statusStart = writer.startLengthDelimited(); + const statusStartPos = writer.pos; + if (status.message) { + writer.writeTag(2, 2); + writer.writeString(status.message); + } + writer.writeTag(3, 0); + writer.writeVarint(status.code); + writer.finishLengthDelimited(statusStart, writer.pos - statusStartPos); + } + /** + * Serialize a Span.Event message + * + * Proto fields (Span.Event): + * 1 time_unix_nano fixed64 (wire type 1) + * 2 name string (wire type 2) + * 3 attributes repeated KeyValue (wire type 2) + * 4 dropped_attributes_count uint32 (wire type 0) + */ + function serializeEvent(writer, event) { + const eventStart = writer.startLengthDelimited(); + const eventStartPos = writer.pos; + writer.writeTag(1, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, event.time); + writer.writeTag(2, 2); + writer.writeString(event.name); + if (event.attributes) (0, common_serializer_1.writeAttributes)(writer, event.attributes, 3); + writer.writeTag(4, 0); + writer.writeVarint(event.droppedAttributesCount || 0); + writer.finishLengthDelimited(eventStart, writer.pos - eventStartPos); + } + /** + * Serialize a Span.Link message + * + * Proto fields (Span.Link): + * 1 trace_id bytes (wire type 2) + * 2 span_id bytes (wire type 2) + * 3 trace_state string (wire type 2) + * 4 attributes repeated KeyValue (wire type 2) + * 5 dropped_attributes_count uint32 (wire type 0) + * 6 flags fixed32 (wire type 5) + */ + function serializeLink(writer, link) { + const linkStart = writer.startLengthDelimited(); + const linkStartPos = writer.pos; + const context = link.context; + writer.writeTag(1, 2); + writer.writeBytes((0, hex_to_binary_1.hexToBinary)(context.traceId)); + writer.writeTag(2, 2); + writer.writeBytes((0, hex_to_binary_1.hexToBinary)(context.spanId)); + const linkTraceState = context.traceState?.serialize(); + if (linkTraceState) { + writer.writeTag(3, 2); + writer.writeString(linkTraceState); + } + if (link.attributes) (0, common_serializer_1.writeAttributes)(writer, link.attributes, 4); + writer.writeTag(5, 0); + writer.writeVarint(link.droppedAttributesCount || 0); + const linkFlags = buildSpanFlags(context.traceFlags, context.isRemote); + if (linkFlags) { + writer.writeTag(6, 5); + writer.writeFixed32(linkFlags); + } + writer.finishLengthDelimited(linkStart, writer.pos - linkStartPos); + } + /** + * Serialize a single Span message directly from ReadableSpan + * + * Proto fields (Span): + * 1 trace_id bytes (wire type 2) + * 2 span_id bytes (wire type 2) + * 3 trace_state string (wire type 2) + * 4 parent_span_id bytes (wire type 2) + * 5 name string (wire type 2) + * 6 kind SpanKind (wire type 0) + * 7 start_time_unix_nano fixed64 (wire type 1) + * 8 end_time_unix_nano fixed64 (wire type 1) + * 9 attributes repeated KeyValue (wire type 2) + * 10 dropped_attributes_count uint32 (wire type 0) + * 11 events repeated Event (wire type 2) + * 12 dropped_events_count uint32 (wire type 0) + * 13 links repeated Link (wire type 2) + * 14 dropped_links_count uint32 (wire type 0) + * 15 status Status (wire type 2) + * 16 flags fixed32 (wire type 5) + */ + function serializeSpan(writer, span) { + const spanStart = writer.startLengthDelimited(); + const spanStartPos = writer.pos; + const ctx = span.spanContext(); + writer.writeTag(1, 2); + writer.writeBytes((0, hex_to_binary_1.hexToBinary)(ctx.traceId)); + writer.writeTag(2, 2); + writer.writeBytes((0, hex_to_binary_1.hexToBinary)(ctx.spanId)); + const traceState = ctx.traceState?.serialize(); + if (traceState) { + writer.writeTag(3, 2); + writer.writeString(traceState); + } + if (span.parentSpanContext?.spanId) { + writer.writeTag(4, 2); + writer.writeBytes((0, hex_to_binary_1.hexToBinary)(span.parentSpanContext.spanId)); + } + writer.writeTag(5, 2); + writer.writeString(span.name); + const kind = span.kind == null ? 0 : span.kind + 1; + if (kind !== 0) { + writer.writeTag(6, 0); + writer.writeVarint(kind); + } + writer.writeTag(7, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, span.startTime); + writer.writeTag(8, 1); + (0, common_serializer_1.writeHrTimeAsFixed64)(writer, span.endTime); + if (span.attributes) (0, common_serializer_1.writeAttributes)(writer, span.attributes, 9); + writer.writeTag(10, 0); + writer.writeVarint(span.droppedAttributesCount); + for (const event of span.events) { + writer.writeTag(11, 2); + serializeEvent(writer, event); + } + writer.writeTag(12, 0); + writer.writeVarint(span.droppedEventsCount); + for (const link of span.links) { + writer.writeTag(13, 2); + serializeLink(writer, link); + } + writer.writeTag(14, 0); + writer.writeVarint(span.droppedLinksCount); + writer.writeTag(15, 2); + serializeStatus(writer, span.status); + const flags = buildSpanFlags(ctx.traceFlags, span.parentSpanContext?.isRemote); + if (flags) { + writer.writeTag(16, 5); + writer.writeFixed32(flags); + } + writer.finishLengthDelimited(spanStart, writer.pos - spanStartPos); + } + /** + * Serialize ScopeSpans directly from SDK types + */ + function serializeScopeSpans(writer, scope, spans) { + const scopeSpansStart = writer.startLengthDelimited(); + const scopeSpansStartPos = writer.pos; + (0, common_serializer_1.writeInstrumentationScope)(writer, scope, 1); + for (const span of spans) { + writer.writeTag(2, 2); + serializeSpan(writer, span); + } + if (scope.schemaUrl) { + writer.writeTag(3, 2); + writer.writeString(scope.schemaUrl); + } + writer.finishLengthDelimited(scopeSpansStart, writer.pos - scopeSpansStartPos); + } + /** + * Serialize ResourceSpans directly from SDK Resource type + */ + function serializeResourceSpans(writer, resource, scopeMap) { + const resourceSpansStart = writer.startLengthDelimited(); + const resourceSpansStartPos = writer.pos; + (0, common_serializer_1.writeResource)(writer, resource, 1); + for (const scopeSpans of scopeMap.values()) { + writer.writeTag(2, 2); + const scope = scopeSpans[0].instrumentationScope; + serializeScopeSpans(writer, scope, scopeSpans); + } + if (resource.schemaUrl) { + writer.writeTag(3, 2); + writer.writeString(resource.schemaUrl); + } + writer.finishLengthDelimited(resourceSpansStart, writer.pos - resourceSpansStartPos); + } + /** + * Group spans by resource and instrumentation scope using identity comparison + */ + function createResourceMap(spans) { + const resourceMap = /* @__PURE__ */ new Map(); + for (const span of spans) { + const resource = span.resource; + const scope = span.instrumentationScope; + let scopeMap = resourceMap.get(resource); + if (!scopeMap) { + scopeMap = /* @__PURE__ */ new Map(); + resourceMap.set(resource, scopeMap); + } + let records = scopeMap.get(scope); + if (!records) { + records = []; + scopeMap.set(scope, records); + } + records.push(span); + } + return resourceMap; + } /** - * The name of the runtime of this process. - * - * @example OpenJDK Runtime Environment - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Serialize ExportTraceServiceRequest directly from ReadableSpan[] */ - exports.ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name"; + function serializeTraceExportRequest(spans) { + const resourceMap = createResourceMap(spans); + const estimator = new protobuf_size_estimator_1.ProtobufSizeEstimator(); + for (const [resource, scopeMap] of resourceMap) { + estimator.writeTag(1, 2); + serializeResourceSpans(estimator, resource, scopeMap); + } + const writer = new protobuf_writer_1.ProtobufWriter(estimator.pos); + for (const [resource, scopeMap] of resourceMap) { + writer.writeTag(1, 2); + serializeResourceSpans(writer, resource, scopeMap); + } + return writer.finish(); + } + exports.serializeTraceExportRequest = serializeTraceExportRequest; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/response-deserializer.js +var require_response_deserializer = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.deserializeExportTraceServiceResponse = void 0; + const protobuf_reader_1 = require_protobuf_reader(); /** - * The version of the runtime of this process, as returned by the runtime without modification. - * - * @example "14.0.2" + * Parse an ExportTracePartialSuccess embedded message from raw bytes. * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Field map (opentelemetry/proto/collector/trace/v1/trace_service.proto): + * 1 rejected_spans int64 (varint) + * 2 error_message string (length-delimited) */ - exports.ATTR_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + function deserializePartialSuccess(data) { + const reader = new protobuf_reader_1.ProtobufReader(data); + const result = {}; + while (!reader.isAtEnd()) { + const { fieldNumber, wireType } = reader.readTag(); + switch (fieldNumber) { + case 1: + if (wireType === 0) result.rejectedSpans = reader.readVarint(); + else reader.skip(wireType); + break; + case 2: + if (wireType === 2) result.errorMessage = reader.readString(); + else reader.skip(wireType); + break; + default: reader.skip(wireType); + } + } + return result; + } /** - * The string ID of the service instance. - * - * @example 627cc493-f310-47de-96bd-71410b7dec09 - * - * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words - * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to - * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled - * service). - * - * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC - * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of - * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and - * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`. - * - * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is - * needed. Similar to what can be seen in the man page for the - * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying - * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it - * or not via another resource attribute. - * - * For applications running behind an application server (like unicorn), we do not recommend using one identifier - * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker - * thread in unicorn) to have its own instance.id. - * - * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the - * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will - * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated. - * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance - * for that telemetry. This is typically the case for scraping receivers, as they know the target address and - * port. + * Parse an ExportTraceServiceResponse protobuf message from raw bytes. * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Field map (opentelemetry/proto/collector/trace/v1/trace_service.proto): + * 1 partial_success ExportTracePartialSuccess (length-delimited) */ - exports.ATTR_SERVICE_INSTANCE_ID = "service.instance.id"; + function deserializeExportTraceServiceResponse(data) { + const reader = new protobuf_reader_1.ProtobufReader(data); + const result = {}; + while (!reader.isAtEnd()) { + const { fieldNumber, wireType } = reader.readTag(); + switch (fieldNumber) { + case 1: + if (wireType === 2) result.partialSuccess = deserializePartialSuccess(reader.readBytes()); + else reader.skip(wireType); + break; + default: reader.skip(wireType); + } + } + return result; + } + exports.deserializeExportTraceServiceResponse = deserializeExportTraceServiceResponse; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/trace.js +var require_trace$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufTraceSerializer = void 0; + const trace_serializer_1 = require_trace_serializer(); + const response_deserializer_1 = require_response_deserializer(); + exports.ProtobufTraceSerializer = { + serializeRequest: (arg) => { + return (0, trace_serializer_1.serializeTraceExportRequest)(arg); + }, + deserializeResponse: (arg) => { + return (0, response_deserializer_1.deserializeExportTraceServiceResponse)(arg); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/protobuf/index.js +var require_protobuf = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProtobufTraceSerializer = void 0; + var trace_1 = require_trace$1(); + Object.defineProperty(exports, "ProtobufTraceSerializer", { + enumerable: true, + get: function() { + return trace_1.ProtobufTraceSerializer; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/internal.js +var require_internal$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.toAnyValue = exports.toKeyValue = exports.toAttributes = exports.createInstrumentationScope = exports.createResource = void 0; + function createResource(resource, encoder) { + const result = { + attributes: toAttributes(resource.attributes, encoder), + droppedAttributesCount: 0 + }; + const schemaUrl = resource.schemaUrl; + if (schemaUrl && schemaUrl !== "") result.schemaUrl = schemaUrl; + return result; + } + exports.createResource = createResource; + function createInstrumentationScope(scope, encoder) { + const result = { + name: scope.name, + version: scope.version + }; + if (scope.attributes && Object.keys(scope.attributes).length > 0) { + result.attributes = toAttributes(scope.attributes, encoder); + result.droppedAttributesCount = scope.droppedAttributesCount ?? 0; + } + return result; + } + exports.createInstrumentationScope = createInstrumentationScope; + function toAttributes(attributes, encoder) { + return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key], encoder)); + } + exports.toAttributes = toAttributes; + function toKeyValue(key, value, encoder) { + return { + key, + value: toAnyValue(value, encoder) + }; + } + exports.toKeyValue = toKeyValue; + function toAnyValue(value, encoder) { + const t = typeof value; + if (t === "string") return { stringValue: value }; + if (t === "number") { + if (!Number.isInteger(value)) return { doubleValue: value }; + return { intValue: value }; + } + if (t === "boolean") return { boolValue: value }; + if (value instanceof Uint8Array) return { bytesValue: encoder.encodeUint8Array(value) }; + if (Array.isArray(value)) { + const values = new Array(value.length); + for (let i = 0; i < value.length; i++) values[i] = toAnyValue(value[i], encoder); + return { arrayValue: { values } }; + } + if (t === "object" && value != null) { + const keys = Object.keys(value); + const values = new Array(keys.length); + for (let i = 0; i < keys.length; i++) values[i] = { + key: keys[i], + value: toAnyValue(value[keys[i]], encoder) + }; + return { kvlistValue: { values } }; + } + return {}; + } + exports.toAnyValue = toAnyValue; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/internal.js +var require_internal$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createExportLogsServiceRequest = void 0; + const internal_1 = require_internal$3(); + function createExportLogsServiceRequest(logRecords, encoder) { + return { resourceLogs: logRecordsToResourceLogs(logRecords, encoder) }; + } + exports.createExportLogsServiceRequest = createExportLogsServiceRequest; + function createResourceMap(logRecords) { + const resourceMap = /* @__PURE__ */ new Map(); + for (const record of logRecords) { + const { resource, instrumentationScope } = record; + let ismMap = resourceMap.get(resource); + if (!ismMap) { + ismMap = /* @__PURE__ */ new Map(); + resourceMap.set(resource, ismMap); + } + let records = ismMap.get(instrumentationScope); + if (!records) { + records = []; + ismMap.set(instrumentationScope, records); + } + records.push(record); + } + return resourceMap; + } + function logRecordsToResourceLogs(logRecords, encoder) { + const resourceMap = createResourceMap(logRecords); + return Array.from(resourceMap, ([resource, ismMap]) => { + const processedResource = (0, internal_1.createResource)(resource, encoder); + return { + resource: processedResource, + scopeLogs: Array.from(ismMap, ([, scopeLogs]) => { + return { + scope: (0, internal_1.createInstrumentationScope)(scopeLogs[0].instrumentationScope, encoder), + logRecords: scopeLogs.map((log) => toLogRecord(log, encoder)), + schemaUrl: scopeLogs[0].instrumentationScope.schemaUrl + }; + }), + schemaUrl: processedResource.schemaUrl + }; + }); + } + function toLogRecord(log, encoder) { + return { + timeUnixNano: encoder.encodeHrTime(log.hrTime), + observedTimeUnixNano: encoder.encodeHrTime(log.hrTimeObserved), + severityNumber: toSeverityNumber(log.severityNumber), + severityText: log.severityText, + body: (0, internal_1.toAnyValue)(log.body, encoder), + eventName: log.eventName, + attributes: (0, internal_1.toAttributes)(log.attributes, encoder), + droppedAttributesCount: log.droppedAttributesCount, + flags: log.spanContext?.traceFlags, + traceId: encoder.encodeOptionalSpanContext(log.spanContext?.traceId), + spanId: encoder.encodeOptionalSpanContext(log.spanContext?.spanId) + }; + } + function toSeverityNumber(severityNumber) { + return severityNumber; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/common/utils.js +var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JSON_ENCODER = exports.PROTOBUF_ENCODER = exports.encodeAsString = exports.encodeAsLongBits = exports.toLongBits = exports.hrTimeToNanos = void 0; + const core_1 = require_src$8(); + const hex_to_binary_1 = require_hex_to_binary(); + function hrTimeToNanos(hrTime) { + const NANOSECONDS = BigInt(1e9); + return BigInt(Math.trunc(hrTime[0])) * NANOSECONDS + BigInt(Math.trunc(hrTime[1])); + } + exports.hrTimeToNanos = hrTimeToNanos; + function toLongBits(value) { + return { + low: Number(BigInt.asUintN(32, value)), + high: Number(BigInt.asUintN(32, value >> BigInt(32))) + }; + } + exports.toLongBits = toLongBits; + function encodeAsLongBits(hrTime) { + return toLongBits(hrTimeToNanos(hrTime)); + } + exports.encodeAsLongBits = encodeAsLongBits; + function encodeAsString(hrTime) { + return hrTimeToNanos(hrTime).toString(); + } + exports.encodeAsString = encodeAsString; + const encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : core_1.hrTimeToNanoseconds; + function identity(value) { + return value; + } + function optionalHexToBinary(str) { + if (str === void 0) return void 0; + return (0, hex_to_binary_1.hexToBinary)(str); + } /** - * A namespace for `service.name`. - * - * @example Shop - * - * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Encoder for protobuf format. + * Uses { high, low } timestamps and binary for span/trace IDs, leaves Uint8Array attributes as-is. */ - exports.ATTR_SERVICE_NAMESPACE = "service.namespace"; + exports.PROTOBUF_ENCODER = { + encodeHrTime: encodeAsLongBits, + encodeSpanContext: hex_to_binary_1.hexToBinary, + encodeOptionalSpanContext: optionalHexToBinary, + encodeUint8Array: identity + }; /** - * Additional description of the web engine (e.g. detailed version and edition information). - * - * @example WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - 2.2.2.Final - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Encoder for JSON format. + * Uses string timestamps, hex for span/trace IDs, and base64 for Uint8Array. */ - exports.ATTR_WEBENGINE_DESCRIPTION = "webengine.description"; + exports.JSON_ENCODER = { + encodeHrTime: encodeTimestamp, + encodeSpanContext: identity, + encodeOptionalSpanContext: identity, + encodeUint8Array: (bytes) => { + if (typeof Buffer !== "undefined") return Buffer.from(bytes).toString("base64"); + const chars = new Array(bytes.length); + for (let i = 0; i < bytes.length; i++) chars[i] = String.fromCharCode(bytes[i]); + return btoa(chars.join("")); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/logs.js +var require_logs = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonLogsSerializer = void 0; + const internal_1 = require_internal$2(); + const utils_1 = require_utils(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + exports.JsonLogsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportLogsServiceRequest)(arg, utils_1.JSON_ENCODER); + return new TextEncoder().encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) return {}; + const decoder = new TextDecoder(); + try { + return JSON.parse(decoder.decode(arg)); + } catch (err) { + api_1.diag.warn(`Failed to parse logs export response: ${err.message}. Returning empty response`); + return {}; + } + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/logs/json/index.js +var require_json$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonLogsSerializer = void 0; + var logs_1 = require_logs(); + Object.defineProperty(exports, "JsonLogsSerializer", { + enumerable: true, + get: function() { + return logs_1.JsonLogsSerializer; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal-types.js +var require_internal_types = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EAggregationTemporality = void 0; /** - * The name of the web engine. - * - * @example WildFly - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * AggregationTemporality defines how a metric aggregator reports aggregated + * values. It describes how those values relate to the time interval over + * which they are aggregated. */ - exports.ATTR_WEBENGINE_NAME = "webengine.name"; + var EAggregationTemporality; + (function(EAggregationTemporality) { + EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"; + /** DELTA is an AggregationTemporality for a metric aggregator which reports + changes since last report time. Successive metrics contain aggregation of + values from continuous and non-overlapping intervals. + + The values for a DELTA metric are based only on the time interval + associated with one measurement cycle. There is no dependency on + previous measurements like is the case for CUMULATIVE metrics. + + For example, consider a system measuring the number of requests that + it receives and reports the sum of these requests every second as a + DELTA metric: + + 1. The system starts receiving at time=t_0. + 2. A request is received, the system measures 1 request. + 3. A request is received, the system measures 1 request. + 4. A request is received, the system measures 1 request. + 5. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_0 to + t_0+1 with a value of 3. + 6. A request is received, the system measures 1 request. + 7. A request is received, the system measures 1 request. + 8. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_0+1 to + t_0+2 with a value of 2. */ + EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_DELTA"] = 1] = "AGGREGATION_TEMPORALITY_DELTA"; + /** CUMULATIVE is an AggregationTemporality for a metric aggregator which + reports changes since a fixed start time. This means that current values + of a CUMULATIVE metric depend on all previous measurements since the + start time. Because of this, the sender is required to retain this state + in some form. If this state is lost or invalidated, the CUMULATIVE metric + values MUST be reset and a new fixed start time following the last + reported measurement time sent MUST be used. + + For example, consider a system measuring the number of requests that + it receives and reports the sum of these requests every second as a + CUMULATIVE metric: + + 1. The system starts receiving at time=t_0. + 2. A request is received, the system measures 1 request. + 3. A request is received, the system measures 1 request. + 4. A request is received, the system measures 1 request. + 5. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_0 to + t_0+1 with a value of 3. + 6. A request is received, the system measures 1 request. + 7. A request is received, the system measures 1 request. + 8. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_0 to + t_0+2 with a value of 5. + 9. The system experiences a fault and loses state. + 10. The system recovers and resumes receiving at time=t_1. + 11. A request is received, the system measures 1 request. + 12. The 1 second collection cycle ends. A metric is exported for the + number of requests received over the interval of time t_1 to + t_0+1 with a value of 1. + + Note: Even though, when reporting changes since last report time, using + CUMULATIVE is valid, it is not recommended. This may cause problems for + systems that do not use start_time to determine when the aggregation + value was reset (e.g. Prometheus). */ + EAggregationTemporality[EAggregationTemporality["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"; + })(EAggregationTemporality || (exports.EAggregationTemporality = EAggregationTemporality = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/internal.js +var require_internal$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createExportMetricsServiceRequest = exports.toMetric = exports.toScopeMetrics = exports.toResourceMetrics = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const sdk_metrics_1 = require_src$5(); + const internal_types_1 = require_internal_types(); + const internal_1 = require_internal$3(); + function toResourceMetrics(resourceMetrics, encoder) { + const processedResource = (0, internal_1.createResource)(resourceMetrics.resource, encoder); + return { + resource: processedResource, + schemaUrl: processedResource.schemaUrl, + scopeMetrics: toScopeMetrics(resourceMetrics.scopeMetrics, encoder) + }; + } + exports.toResourceMetrics = toResourceMetrics; + function toScopeMetrics(scopeMetrics, encoder) { + return Array.from(scopeMetrics.map((metrics) => ({ + scope: (0, internal_1.createInstrumentationScope)(metrics.scope, encoder), + metrics: metrics.metrics.map((metricData) => toMetric(metricData, encoder)), + schemaUrl: metrics.scope.schemaUrl + }))); + } + exports.toScopeMetrics = toScopeMetrics; + function toMetric(metricData, encoder) { + const out = { + name: metricData.descriptor.name, + description: metricData.descriptor.description, + unit: metricData.descriptor.unit + }; + const aggregationTemporality = toAggregationTemporality(metricData.aggregationTemporality); + switch (metricData.dataPointType) { + case sdk_metrics_1.DataPointType.SUM: + out.sum = { + aggregationTemporality, + isMonotonic: metricData.isMonotonic, + dataPoints: toSingularDataPoints(metricData, encoder) + }; + break; + case sdk_metrics_1.DataPointType.GAUGE: + out.gauge = { dataPoints: toSingularDataPoints(metricData, encoder) }; + break; + case sdk_metrics_1.DataPointType.HISTOGRAM: + out.histogram = { + aggregationTemporality, + dataPoints: toHistogramDataPoints(metricData, encoder) + }; + break; + case sdk_metrics_1.DataPointType.EXPONENTIAL_HISTOGRAM: out.exponentialHistogram = { + aggregationTemporality, + dataPoints: toExponentialHistogramDataPoints(metricData, encoder) + }; + } + return out; + } + exports.toMetric = toMetric; + function toSingularDataPoint(dataPoint, valueType, encoder) { + const out = { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes, encoder), + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + switch (valueType) { + case api_1.ValueType.INT: + out.asInt = dataPoint.value; + break; + case api_1.ValueType.DOUBLE: out.asDouble = dataPoint.value; + } + return out; + } + function toSingularDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + return toSingularDataPoint(dataPoint, metricData.descriptor.valueType, encoder); + }); + } + function toHistogramDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + const histogram = dataPoint.value; + return { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes, encoder), + bucketCounts: histogram.buckets.counts, + explicitBounds: histogram.buckets.boundaries, + count: histogram.count, + sum: histogram.sum, + min: histogram.min, + max: histogram.max, + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + }); + } + function toExponentialHistogramDataPoints(metricData, encoder) { + return metricData.dataPoints.map((dataPoint) => { + const histogram = dataPoint.value; + return { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes, encoder), + count: histogram.count, + min: histogram.min, + max: histogram.max, + sum: histogram.sum, + positive: { + offset: histogram.positive.offset, + bucketCounts: histogram.positive.bucketCounts + }, + negative: { + offset: histogram.negative.offset, + bucketCounts: histogram.negative.bucketCounts + }, + scale: histogram.scale, + zeroCount: histogram.zeroCount, + startTimeUnixNano: encoder.encodeHrTime(dataPoint.startTime), + timeUnixNano: encoder.encodeHrTime(dataPoint.endTime) + }; + }); + } + function toAggregationTemporality(temporality) { + switch (temporality) { + case sdk_metrics_1.AggregationTemporality.DELTA: return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_DELTA; + case sdk_metrics_1.AggregationTemporality.CUMULATIVE: return internal_types_1.EAggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE; + } + } + function createExportMetricsServiceRequest(resourceMetrics, encoder) { + return { resourceMetrics: resourceMetrics.map((metrics) => toResourceMetrics(metrics, encoder)) }; + } + exports.createExportMetricsServiceRequest = createExportMetricsServiceRequest; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/metrics.js +var require_metrics = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonMetricsSerializer = void 0; + const internal_1 = require_internal$1(); + const utils_1 = require_utils(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + exports.JsonMetricsSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportMetricsServiceRequest)([arg], utils_1.JSON_ENCODER); + return new TextEncoder().encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) return {}; + const decoder = new TextDecoder(); + try { + return JSON.parse(decoder.decode(arg)); + } catch (err) { + api_1.diag.warn(`Failed to parse metrics export response: ${err.message}. Returning empty response`); + return {}; + } + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/metrics/json/index.js +var require_json$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonMetricsSerializer = void 0; + var metrics_1 = require_metrics(); + Object.defineProperty(exports, "JsonMetricsSerializer", { + enumerable: true, + get: function() { + return metrics_1.JsonMetricsSerializer; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +var require_internal = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createExportTraceServiceRequest = exports.toOtlpSpanEvent = exports.toOtlpLink = exports.sdkSpanToOtlpSpan = void 0; + const internal_1 = require_internal$3(); + const SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 256; + const SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512; /** - * The version of the web engine. - * - * @example 21.0.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + * Builds the 32-bit span flags value combining the low 8-bit W3C TraceFlags + * with the HAS_IS_REMOTE and IS_REMOTE bits according to the OTLP spec. */ - exports.ATTR_WEBENGINE_VERSION = "webengine.version"; + function buildSpanFlagsFrom(traceFlags, isRemote) { + let flags = traceFlags & 255 | SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK; + if (isRemote) flags |= SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK; + return flags; + } + function sdkSpanToOtlpSpan(span, encoder) { + const ctx = span.spanContext(); + const status = span.status; + const parentSpanId = span.parentSpanContext?.spanId ? encoder.encodeSpanContext(span.parentSpanContext?.spanId) : void 0; + return { + traceId: encoder.encodeSpanContext(ctx.traceId), + spanId: encoder.encodeSpanContext(ctx.spanId), + parentSpanId, + traceState: ctx.traceState?.serialize(), + name: span.name, + kind: span.kind == null ? 0 : span.kind + 1, + startTimeUnixNano: encoder.encodeHrTime(span.startTime), + endTimeUnixNano: encoder.encodeHrTime(span.endTime), + attributes: (0, internal_1.toAttributes)(span.attributes, encoder), + droppedAttributesCount: span.droppedAttributesCount, + events: span.events.map((event) => toOtlpSpanEvent(event, encoder)), + droppedEventsCount: span.droppedEventsCount, + status: { + code: status.code, + message: status.message + }, + links: span.links.map((link) => toOtlpLink(link, encoder)), + droppedLinksCount: span.droppedLinksCount, + flags: buildSpanFlagsFrom(ctx.traceFlags, span.parentSpanContext?.isRemote) + }; + } + exports.sdkSpanToOtlpSpan = sdkSpanToOtlpSpan; + function toOtlpLink(link, encoder) { + return { + attributes: link.attributes ? (0, internal_1.toAttributes)(link.attributes, encoder) : [], + spanId: encoder.encodeSpanContext(link.context.spanId), + traceId: encoder.encodeSpanContext(link.context.traceId), + traceState: link.context.traceState?.serialize(), + droppedAttributesCount: link.droppedAttributesCount || 0, + flags: buildSpanFlagsFrom(link.context.traceFlags, link.context.isRemote) + }; + } + exports.toOtlpLink = toOtlpLink; + function toOtlpSpanEvent(timedEvent, encoder) { + return { + attributes: timedEvent.attributes ? (0, internal_1.toAttributes)(timedEvent.attributes, encoder) : [], + name: timedEvent.name, + timeUnixNano: encoder.encodeHrTime(timedEvent.time), + droppedAttributesCount: timedEvent.droppedAttributesCount || 0 + }; + } + exports.toOtlpSpanEvent = toOtlpSpanEvent; + function createExportTraceServiceRequest(spans, encoder) { + return { resourceSpans: spanRecordsToResourceSpans(spans, encoder) }; + } + exports.createExportTraceServiceRequest = createExportTraceServiceRequest; + function createResourceMap(readableSpans) { + const resourceMap = /* @__PURE__ */ new Map(); + for (const record of readableSpans) { + let ilsMap = resourceMap.get(record.resource); + if (!ilsMap) { + ilsMap = /* @__PURE__ */ new Map(); + resourceMap.set(record.resource, ilsMap); + } + const instrumentationScopeKey = `${record.instrumentationScope.name}@${record.instrumentationScope.version || ""}:${record.instrumentationScope.schemaUrl || ""}`; + let records = ilsMap.get(instrumentationScopeKey); + if (!records) { + records = []; + ilsMap.set(instrumentationScopeKey, records); + } + records.push(record); + } + return resourceMap; + } + function spanRecordsToResourceSpans(readableSpans, encoder) { + const resourceMap = createResourceMap(readableSpans); + const out = []; + const entryIterator = resourceMap.entries(); + let entry = entryIterator.next(); + while (!entry.done) { + const [resource, ilmMap] = entry.value; + const scopeResourceSpans = []; + const ilmIterator = ilmMap.values(); + let ilmEntry = ilmIterator.next(); + while (!ilmEntry.done) { + const scopeSpans = ilmEntry.value; + if (scopeSpans.length > 0) { + const spans = scopeSpans.map((readableSpan) => sdkSpanToOtlpSpan(readableSpan, encoder)); + scopeResourceSpans.push({ + scope: (0, internal_1.createInstrumentationScope)(scopeSpans[0].instrumentationScope, encoder), + spans, + schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl + }); + } + ilmEntry = ilmIterator.next(); + } + const processedResource = (0, internal_1.createResource)(resource, encoder); + const transformedSpans = { + resource: processedResource, + scopeSpans: scopeResourceSpans, + schemaUrl: processedResource.schemaUrl + }; + out.push(transformedSpans); + entry = entryIterator.next(); + } + return out; + } })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/execAsync.js -var require_execAsync = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/trace.js +var require_trace = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.execAsync = void 0; - const child_process = __require("child_process"); - const util = __require("util"); - exports.execAsync = util.promisify(child_process.exec); + exports.JsonTraceSerializer = void 0; + const internal_1 = require_internal(); + const utils_1 = require_utils(); + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + exports.JsonTraceSerializer = { + serializeRequest: (arg) => { + const request = (0, internal_1.createExportTraceServiceRequest)(arg, utils_1.JSON_ENCODER); + return new TextEncoder().encode(JSON.stringify(request)); + }, + deserializeResponse: (arg) => { + if (arg.length === 0) return {}; + const decoder = new TextDecoder(); + try { + return JSON.parse(decoder.decode(arg)); + } catch (err) { + api_1.diag.warn(`Failed to parse trace export response: ${err.message}. Returning empty response`); + return {}; + } + } + }; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-darwin.js -var require_getMachineId_darwin = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/trace/json/index.js +var require_json = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const execAsync_1 = require_execAsync(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - try { - const idLine = (await (0, execAsync_1.execAsync)("ioreg -rd1 -c \"IOPlatformExpertDevice\"")).stdout.split("\n").find((line) => line.includes("IOPlatformUUID")); - if (!idLine) return; - const parts = idLine.split("\" = \""); - if (parts.length === 2) return parts[1].slice(0, -1); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); + exports.JsonTraceSerializer = void 0; + var trace_1 = require_trace(); + Object.defineProperty(exports, "JsonTraceSerializer", { + enumerable: true, + get: function() { + return trace_1.JsonTraceSerializer; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/src/index.js +var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JsonTraceSerializer = exports.JsonMetricsSerializer = exports.JsonLogsSerializer = exports.ProtobufTraceSerializer = exports.ProtobufMetricsSerializer = exports.ProtobufLogsSerializer = exports.LogsExporterMetricsHelper = exports.TraceExporterMetricsHelper = exports.MetricsExporterMetricsHelper = void 0; + var metrics_1 = require_metrics$2(); + Object.defineProperty(exports, "MetricsExporterMetricsHelper", { + enumerable: true, + get: function() { + return metrics_1.MetricsExporterMetricsHelper; + } + }); + var trace_1 = require_trace$2(); + Object.defineProperty(exports, "TraceExporterMetricsHelper", { + enumerable: true, + get: function() { + return trace_1.TraceExporterMetricsHelper; + } + }); + var logs_1 = require_logs$3(); + Object.defineProperty(exports, "LogsExporterMetricsHelper", { + enumerable: true, + get: function() { + return logs_1.LogsExporterMetricsHelper; + } + }); + var protobuf_1 = require_protobuf$2(); + Object.defineProperty(exports, "ProtobufLogsSerializer", { + enumerable: true, + get: function() { + return protobuf_1.ProtobufLogsSerializer; + } + }); + var protobuf_2 = require_protobuf$1(); + Object.defineProperty(exports, "ProtobufMetricsSerializer", { + enumerable: true, + get: function() { + return protobuf_2.ProtobufMetricsSerializer; + } + }); + var protobuf_3 = require_protobuf(); + Object.defineProperty(exports, "ProtobufTraceSerializer", { + enumerable: true, + get: function() { + return protobuf_3.ProtobufTraceSerializer; + } + }); + var json_1 = require_json$2(); + Object.defineProperty(exports, "JsonLogsSerializer", { + enumerable: true, + get: function() { + return json_1.JsonLogsSerializer; + } + }); + var json_2 = require_json$1(); + Object.defineProperty(exports, "JsonMetricsSerializer", { + enumerable: true, + get: function() { + return json_2.JsonMetricsSerializer; + } + }); + var json_3 = require_json(); + Object.defineProperty(exports, "JsonTraceSerializer", { + enumerable: true, + get: function() { + return json_3.JsonTraceSerializer; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js +/** +* Parses headers from config leaving only those that have defined values +* @param partialHeaders +*/ +function validateAndNormalizeHeaders(partialHeaders) { + const headers = {}; + Object.entries(partialHeaders ?? {}).forEach(([key, value]) => { + if (typeof value !== "undefined") headers[key] = String(value); + else diag.warn(`Header "${key}" has invalid value (${value}) and will be ignored`); + }); + return headers; +} +var init_util = __esmMin((() => { + init_esm$2(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js +function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) { + return async () => { + const requiredHeaders = { ...await defaultHeaders() }; + const headers = {}; + if (fallbackHeaders != null) Object.assign(headers, await fallbackHeaders()); + if (userProvidedHeaders != null) Object.assign(headers, validateAndNormalizeHeaders(await userProvidedHeaders())); + return Object.assign(headers, requiredHeaders); + }; +} +function validateUserProvidedUrl(url) { + if (url == null) return; + try { + const base = globalThis.location?.href; + return new URL(url, base).href; + } catch { + throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`); + } +} +/** +* @param userProvidedConfiguration Configuration options provided by the user in code. +* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. +* @param defaultConfiguration The defaults as defined by the exporter specification +*/ +function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + ...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), + headers: mergeHeaders(userProvidedConfiguration.headers, fallbackConfiguration.headers, defaultConfiguration.headers), + url: validateUserProvidedUrl(userProvidedConfiguration.url) ?? fallbackConfiguration.url ?? defaultConfiguration.url + }; +} +function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { + return { + ...getSharedConfigurationDefaults(), + headers: async () => requiredHeaders, + url: "http://localhost:4318/" + signalResourcePath + }; +} +var init_otlp_http_configuration = __esmMin((() => { + init_shared_configuration(); + init_util(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-configuration.js +function httpAgentFactoryFromOptions(options) { + return async (protocol) => { + const isInsecure = protocol === "http:"; + const { Agent } = await (isInsecure ? import("http") : import("https")); + if (isInsecure) { + const { ca, cert, key, ...insecureOptions } = options; + return new Agent(insecureOptions); } + return new Agent(options); + }; +} +/** +* @param userProvidedConfiguration Configuration options provided by the user in code. +* @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option. +* @param defaultConfiguration The defaults as defined by the exporter specification +*/ +function mergeOtlpNodeHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + ...mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration), + agentFactory: userProvidedConfiguration.agentFactory ?? fallbackConfiguration.agentFactory ?? defaultConfiguration.agentFactory, + userAgent: userProvidedConfiguration.userAgent + }; +} +function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) { + return { + ...getHttpConfigurationDefaults(requiredHeaders, signalResourcePath), + agentFactory: httpAgentFactoryFromOptions({ keepAlive: true }) + }; +} +var init_otlp_node_http_configuration = __esmMin((() => { + init_otlp_http_configuration(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js +function isExportHTTPErrorRetryable(statusCode) { + return statusCode === 429 || statusCode === 502 || statusCode === 503 || statusCode === 504; +} +function parseRetryAfterToMills(retryAfter) { + if (retryAfter == null) return; + const seconds = Number.parseInt(retryAfter, 10); + if (Number.isInteger(seconds)) return seconds > 0 ? seconds * 1e3 : -1; + const delay = new Date(retryAfter).getTime() - Date.now(); + if (delay >= 0) return delay; + return 0; +} +var init_is_export_retryable = __esmMin((() => {})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js +/** +* Sends data using http +* @param request +* @param url +* @param headers +* @param compression +* @param userAgent +* @param agent +* @param data +* @param timeoutMillis +*/ +function sendWithHttp(request, url, headers, compression, userAgent, agent, data, timeoutMillis) { + return new Promise((resolve) => { + const parsedUrl = new URL(url); + if (userAgent) headers["User-Agent"] = `${userAgent} ${DEFAULT_USER_AGENT}`; + else headers["User-Agent"] = DEFAULT_USER_AGENT; + const req = request(parsedUrl, { + method: "POST", + headers, + agent + }, (res) => { + const responseData = []; + let responseSize = 0; + res.on("data", (chunk) => { + responseSize += chunk.length; + if (responseSize > 4194304) { + resolve({ + status: "failure", + error: /* @__PURE__ */ new Error(`OTLP export response body exceeded size limit of ${MAX_RESPONSE_BODY_SIZE} bytes`) + }); + res.destroy(); + return; + } + responseData.push(chunk); + }); + res.on("end", () => { + if (res.statusCode && res.statusCode <= 299) resolve({ + status: "success", + data: Buffer.concat(responseData) + }); + else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) resolve({ + status: "retryable", + retryInMillis: parseRetryAfterToMills(res.headers["retry-after"]) + }); + else resolve({ + status: "failure", + error: new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString()) + }); + }); + res.on("error", (error) => { + if (res.statusCode && res.statusCode <= 299) resolve({ status: "success" }); + else if (res.statusCode && isExportHTTPErrorRetryable(res.statusCode)) resolve({ + status: "retryable", + error, + retryInMillis: parseRetryAfterToMills(res.headers["retry-after"]) + }); + else resolve({ + status: "failure", + error + }); + }); + }); + req.setTimeout(timeoutMillis, () => { + req.destroy(); + resolve({ + status: "retryable", + error: /* @__PURE__ */ new Error("Request timed out") + }); + }); + req.on("error", (error) => { + if (isHttpTransportNetworkErrorRetryable(error)) resolve({ + status: "retryable", + error + }); + else resolve({ + status: "failure", + error + }); + }); + compressAndSend(req, compression, data, (error) => { + resolve({ + status: "failure", + error + }); + }); + }); +} +function compressAndSend(req, compression, data, onError) { + let dataStream = readableFromUint8Array(data); + if (compression === "gzip") { + req.setHeader("Content-Encoding", "gzip"); + dataStream = dataStream.on("error", onError).pipe(zlib.createGzip()).on("error", onError); } - exports.getMachineId = getMachineId; + dataStream.pipe(req).on("error", onError); +} +function readableFromUint8Array(buff) { + const readable = new Readable(); + readable.push(buff); + readable.push(null); + return readable; +} +function isHttpTransportNetworkErrorRetryable(error) { + const RETRYABLE_NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([ + "ECONNRESET", + "ECONNREFUSED", + "EPIPE", + "ETIMEDOUT", + "EAI_AGAIN", + "ENOTFOUND", + "ENETUNREACH", + "EHOSTUNREACH" + ]); + if ("code" in error && typeof error.code === "string") return RETRYABLE_NETWORK_ERROR_CODES.has(error.code); + return false; +} +var DEFAULT_USER_AGENT, MAX_RESPONSE_BODY_SIZE; +var init_http_transport_utils = __esmMin((() => { + init_is_export_retryable(); + init_types(); + init_version(); + DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION}`; + MAX_RESPONSE_BODY_SIZE = 4194304; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-linux.js -var require_getMachineId_linux = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const fs_1$1 = __require("fs"); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - for (const path$1 of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) try { - return (await fs_1$1.promises.readFile(path$1, { encoding: "utf8" })).trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-exporter-transport.js +async function requestFunctionFactory(protocol) { + const { request } = await (protocol === "http:" ? import("http") : import("https")); + return request; +} +function createHttpExporterTransport(parameters) { + return new HttpExporterTransport(parameters); +} +var HttpExporterTransport; +var init_http_exporter_transport = __esmMin((() => { + init_http_transport_utils(); + HttpExporterTransport = class { + _utils = null; + _parameters; + constructor(parameters) { + this._parameters = parameters; } - } - exports.getMachineId = getMachineId; + async send(data, timeoutMillis) { + const { agent, request } = await this._loadUtils(); + const headers = await this._parameters.headers(); + return sendWithHttp(request, this._parameters.url, headers, this._parameters.compression, this._parameters.userAgent, agent, data, timeoutMillis); + } + shutdown() {} + async _loadUtils() { + let utils = this._utils; + if (utils === null) { + const protocol = new URL(this._parameters.url).protocol; + const [agent, request] = await Promise.all([this._parameters.agentFactory(protocol), requestFunctionFactory(protocol)]); + utils = this._utils = { + agent, + request + }; + } + return utils; + } + }; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-bsd.js -var require_getMachineId_bsd = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const fs_1 = __require("fs"); - const execAsync_1 = require_execAsync(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - try { - return (await fs_1.promises.readFile("/etc/hostid", { encoding: "utf8" })).trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js +/** +* Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER] +*/ +function getJitter() { + return Math.random() * (2 * JITTER) - JITTER; +} +/** +* Creates an Exporter Transport that retries on 'retryable' response. +*/ +function createRetryingTransport(options) { + return new RetryingTransport(options.transport); +} +var MAX_ATTEMPTS, INITIAL_BACKOFF, MAX_BACKOFF, BACKOFF_MULTIPLIER, JITTER, RetryingTransport; +var init_retrying_transport = __esmMin((() => { + init_esm$2(); + MAX_ATTEMPTS = 5; + INITIAL_BACKOFF = 1e3; + MAX_BACKOFF = 5e3; + BACKOFF_MULTIPLIER = 1.5; + JITTER = .2; + RetryingTransport = class { + _transport; + constructor(transport) { + this._transport = transport; } - try { - return (await (0, execAsync_1.execAsync)("kenv -q smbios.system.uuid")).stdout.trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); + retry(data, timeoutMillis, inMillis) { + return new Promise((resolve, reject) => { + setTimeout(() => { + this._transport.send(data, timeoutMillis).then(resolve, reject); + }, inMillis); + }); } - } - exports.getMachineId = getMachineId; + async send(data, timeoutMillis) { + let attempts = MAX_ATTEMPTS; + let nextBackoff = INITIAL_BACKOFF; + const deadline = Date.now() + timeoutMillis; + let result = await this._transport.send(data, timeoutMillis); + while (result.status === "retryable" && attempts > 0) { + attempts--; + const backoff = Math.max(Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF), 0); + nextBackoff = nextBackoff * BACKOFF_MULTIPLIER; + const retryInMillis = result.retryInMillis ?? backoff; + const remainingTimeoutMillis = deadline - Date.now(); + if (retryInMillis > remainingTimeoutMillis) { + diag.info(`Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(remainingTimeoutMillis)}ms, not retrying further.`); + return result; + } + diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`); + result = await this.retry(data, remainingTimeoutMillis, retryInMillis); + } + if (result.status === "success") diag.verbose(`Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`); + else if (result.status === "retryable") diag.info(`Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`); + else diag.info(`Export failed with non-retryable error: ${result.error}`); + return result; + } + shutdown() { + return this._transport.shutdown(); + } + }; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-win.js -var require_getMachineId_win = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const process$2 = __require("process"); - const execAsync_1 = require_execAsync(); - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - const args = "QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid"; - let command = "%windir%\\System32\\REG.exe"; - if (process$2.arch === "ia32" && "PROCESSOR_ARCHITEW6432" in process$2.env) command = "%windir%\\sysnative\\cmd.exe /c " + command; - try { - const parts = (await (0, execAsync_1.execAsync)(`${command} ${args}`)).stdout.split("REG_SZ"); - if (parts.length === 2) return parts[1].trim(); - } catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-http-export-delegate.js +function createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, url, meterProvider) { + return new ExporterMetrics({ + componentType: metricsComponentType, + metricsHelper: exporterMetricsHelper, + url, + meterProvider, + responseAttributesFromError: (error) => { + if (!error) return { [ATTR_HTTP_RESPONSE_STATUS_CODE]: 200 }; + if (!(error instanceof OTLPExporterError)) return {}; + return { [ATTR_HTTP_RESPONSE_STATUS_CODE]: error.code }; } - } - exports.getMachineId = getMachineId; + }); +} +function createOtlpHttpExportDelegate(options, serializer, metricsComponentType, exporterMetricsHelper, meterProvider) { + return createOtlpExportDelegate({ + transport: createRetryingTransport({ transport: createHttpExporterTransport(options) }), + serializer, + promiseHandler: createBoundedQueueExportPromiseHandler(options), + metrics: createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, options.url, meterProvider) + }, { timeout: options.timeoutMillis }); +} +var init_otlp_http_export_delegate = __esmMin((() => { + init_otlp_export_delegate(); + init_http_exporter_transport(); + init_bounded_queue_export_promise_handler(); + init_retrying_transport(); + init_types(); + init_semconv(); + init_ExporterMetrics(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId-unsupported.js -var require_getMachineId_unsupported = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - async function getMachineId() { - api_1.diag.debug("could not read machine-id: unsupported platform"); +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-env-configuration.js +function parseAndValidateTimeoutFromEnv(timeoutEnvVar) { + const envTimeout = (0, import_src$4.getNumberFromEnv)(timeoutEnvVar); + if (envTimeout != null) { + if (Number.isFinite(envTimeout) && envTimeout > 0) return envTimeout; + diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`); } - exports.getMachineId = getMachineId; +} +function getTimeoutFromEnv(signalIdentifier) { + const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`); + const nonSpecificTimeout = parseAndValidateTimeoutFromEnv("OTEL_EXPORTER_OTLP_TIMEOUT"); + return specificTimeout ?? nonSpecificTimeout; +} +function parseAndValidateCompressionFromEnv(compressionEnvVar) { + const compression = (0, import_src$4.getStringFromEnv)(compressionEnvVar)?.trim(); + if (compression == null || compression === "none" || compression === "gzip") return compression; + diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`); +} +function getCompressionFromEnv(signalIdentifier) { + const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`); + const nonSpecificCompression = parseAndValidateCompressionFromEnv("OTEL_EXPORTER_OTLP_COMPRESSION"); + return specificCompression ?? nonSpecificCompression; +} +function getSharedConfigurationFromEnvironment(signalIdentifier) { + return { + timeoutMillis: getTimeoutFromEnv(signalIdentifier), + compression: getCompressionFromEnv(signalIdentifier) + }; +} +var import_src$4; +var init_shared_env_configuration = __esmMin((() => { + import_src$4 = require_src$8(); + init_esm$2(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/machine-id/getMachineId.js -var require_getMachineId = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMachineId = void 0; - const process$1 = __require("process"); - let getMachineIdImpl; - async function getMachineId() { - if (!getMachineIdImpl) switch (process$1.platform) { - case "darwin": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_darwin()))).getMachineId; - break; - case "linux": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_linux()))).getMachineId; - break; - case "freebsd": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_bsd()))).getMachineId; - break; - case "win32": - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_win()))).getMachineId; - break; - default: - getMachineIdImpl = (await Promise.resolve().then(() => /* @__PURE__ */ __toESM(require_getMachineId_unsupported()))).getMachineId; - break; - } - return getMachineIdImpl(); +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-env-configuration.js +function getStaticHeadersFromEnv(signalIdentifier) { + const signalSpecificRawHeaders = (0, import_src$3.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`); + const nonSignalSpecificRawHeaders = (0, import_src$3.getStringFromEnv)("OTEL_EXPORTER_OTLP_HEADERS"); + const signalSpecificHeaders = (0, import_src$3.parseKeyPairsIntoRecord)(signalSpecificRawHeaders); + const nonSignalSpecificHeaders = (0, import_src$3.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders); + if (Object.keys(signalSpecificHeaders).length === 0 && Object.keys(nonSignalSpecificHeaders).length === 0) return; + return Object.assign({}, (0, import_src$3.parseKeyPairsIntoRecord)(nonSignalSpecificRawHeaders), (0, import_src$3.parseKeyPairsIntoRecord)(signalSpecificRawHeaders)); +} +function appendRootPathToUrlIfNeeded(url) { + try { + return new URL(url).toString(); + } catch { + diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`); + return; } - exports.getMachineId = getMachineId; +} +function appendResourcePathToUrl(url, path) { + try { + new URL(url); + } catch { + diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`); + return; + } + if (!url.endsWith("/")) url = url + "/"; + url += path; + try { + new URL(url); + } catch { + diag.warn(`Configuration: Provided URL appended with '${path}' is not a valid URL, using 'undefined' instead of '${url}'`); + return; + } + return url; +} +function getNonSpecificUrlFromEnv(signalResourcePath) { + const envUrl = (0, import_src$3.getStringFromEnv)("OTEL_EXPORTER_OTLP_ENDPOINT"); + if (envUrl === void 0) return; + return appendResourcePathToUrl(envUrl, signalResourcePath); +} +function getSpecificUrlFromEnv(signalIdentifier) { + const envUrl = (0, import_src$3.getStringFromEnv)(`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`); + if (envUrl === void 0) return; + return appendRootPathToUrlIfNeeded(envUrl); +} +function readFileFromEnv(signalSpecificEnvVar, nonSignalSpecificEnvVar, warningMessage) { + const signalSpecificPath = (0, import_src$3.getStringFromEnv)(signalSpecificEnvVar); + const nonSignalSpecificPath = (0, import_src$3.getStringFromEnv)(nonSignalSpecificEnvVar); + const filePath = signalSpecificPath ?? nonSignalSpecificPath; + if (filePath != null) try { + return fs.readFileSync(path.resolve(process.cwd(), filePath)); + } catch { + diag.warn(warningMessage); + return; + } + else return; +} +function getClientCertificateFromEnv(signalIdentifier) { + return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_CERTIFICATE`, "OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE", "Failed to read client certificate chain file"); +} +function getClientKeyFromEnv(signalIdentifier) { + return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CLIENT_KEY`, "OTEL_EXPORTER_OTLP_CLIENT_KEY", "Failed to read client certificate private key file"); +} +function getRootCertificateFromEnv(signalIdentifier) { + return readFileFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_CERTIFICATE`, "OTEL_EXPORTER_OTLP_CERTIFICATE", "Failed to read root certificate file"); +} +/** +* Reads and returns configuration from the environment +* +* @param signalIdentifier all caps part in environment variables that identifies the signal (e.g.: METRICS, TRACES, LOGS) +* @param signalResourcePath signal resource path to append if necessary (e.g.: v1/metrics, v1/traces, v1/logs) +*/ +function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) { + return { + ...getSharedConfigurationFromEnvironment(signalIdentifier), + url: getSpecificUrlFromEnv(signalIdentifier) ?? getNonSpecificUrlFromEnv(signalResourcePath), + headers: wrapStaticHeadersInFunction(getStaticHeadersFromEnv(signalIdentifier)), + agentFactory: httpAgentFactoryFromOptions({ + keepAlive: true, + ca: getRootCertificateFromEnv(signalIdentifier), + cert: getClientCertificateFromEnv(signalIdentifier), + key: getClientKeyFromEnv(signalIdentifier) + }) + }; +} +var import_src$3; +var init_otlp_node_http_env_configuration = __esmMin((() => { + import_src$3 = require_src$8(); + init_esm$2(); + init_shared_env_configuration(); + init_shared_configuration(); + init_otlp_node_http_configuration(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/utils.js -var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.normalizeType = exports.normalizeArch = void 0; - const normalizeArch = (nodeArchString) => { - switch (nodeArchString) { - case "arm": return "arm32"; - case "ppc": return "ppc32"; - case "x64": return "amd64"; - default: return nodeArchString; - } - }; - exports.normalizeArch = normalizeArch; - const normalizeType = (nodePlatform) => { - switch (nodePlatform) { - case "sunos": return "solaris"; - case "win32": return "windows"; - default: return nodePlatform; - } - }; - exports.normalizeType = normalizeType; +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-http-options.js +function convertLegacyHeaders(config) { + if (typeof config.headers === "function") return config.headers; + return wrapStaticHeadersInFunction(config.headers); +} +var init_convert_legacy_http_options = __esmMin((() => { + init_shared_configuration(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/HostDetector.js -var require_HostDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hostDetector = void 0; - const semconv_1 = require_semconv$1(); - const os_1$1 = __require("os"); - const getMachineId_1 = require_getMachineId(); - const utils_1 = require_utils(); - /** - * HostDetector detects the resources related to the host current process is - * running on. Currently only non-cloud-based attributes are included. - */ - var HostDetector = class { - detect(_config) { - return { attributes: { - [semconv_1.ATTR_HOST_NAME]: (0, os_1$1.hostname)(), - [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1$1.arch)()), - [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)() - } }; - } +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-node-http-options.js +function convertLegacyAgentOptions(config) { + if (typeof config.httpAgentOptions === "function") return config.httpAgentOptions; + let legacy = config.httpAgentOptions; + if (config.keepAlive != null) legacy = { + keepAlive: config.keepAlive, + ...legacy }; - exports.hostDetector = new HostDetector(); + if (legacy != null) return httpAgentFactoryFromOptions(legacy); + else return; +} +/** +* @deprecated this will be removed in 2.0 +* @param config +* @param signalIdentifier +* @param signalResourcePath +* @param requiredHeaders +*/ +function convertLegacyHttpOptions(config, signalIdentifier, signalResourcePath, requiredHeaders) { + if (config.metadata) diag.warn("Metadata cannot be set when using http"); + return mergeOtlpNodeHttpConfigurationWithDefaults({ + url: config.url, + headers: convertLegacyHeaders(config), + concurrencyLimit: config.concurrencyLimit, + timeoutMillis: config.timeoutMillis, + compression: config.compression, + agentFactory: convertLegacyAgentOptions(config), + userAgent: config.userAgent + }, getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath), getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath)); +} +var init_convert_legacy_node_http_options = __esmMin((() => { + init_esm$2(); + init_otlp_node_http_configuration(); + init_index_node_http(); + init_otlp_node_http_env_configuration(); + init_convert_legacy_http_options(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/OSDetector.js -var require_OSDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.osDetector = void 0; - const semconv_1 = require_semconv$1(); - const os_1 = __require("os"); - const utils_1 = require_utils(); - /** - * OSDetector detects the resources related to the operating system (OS) on - * which the process represented by this resource is running. - */ - var OSDetector = class { - detect(_config) { - return { attributes: { - [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), - [semconv_1.ATTR_OS_VERSION]: (0, os_1.release)() - } }; - } - }; - exports.osDetector = new OSDetector(); +//#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/index-node-http.js +var index_node_http_exports = /* @__PURE__ */ __exportAll({ + convertLegacyHttpOptions: () => convertLegacyHttpOptions, + createOtlpHttpExportDelegate: () => createOtlpHttpExportDelegate, + createOtlpHttpExporterMetrics: () => createOtlpHttpExporterMetrics, + getSharedConfigurationFromEnvironment: () => getSharedConfigurationFromEnvironment, + httpAgentFactoryFromOptions: () => httpAgentFactoryFromOptions +}); +var init_index_node_http = __esmMin((() => { + init_otlp_node_http_configuration(); + init_otlp_http_export_delegate(); + init_shared_env_configuration(); + init_convert_legacy_node_http_options(); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ProcessDetector.js -var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/semconv.js +var require_semconv$1 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.processDetector = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const semconv_1 = require_semconv$1(); - const os = __require("os"); + exports.OTEL_COMPONENT_TYPE_VALUE_OTLP_HTTP_SPAN_EXPORTER = void 0; /** - * ProcessDetector will be used to detect the resources related current process running - * and being instrumented from the NodeJS Process module. + * Enum value "otlp_http_span_exporter" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}. + * + * OTLP span exporter over HTTP with protobuf serialization + * + * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - var ProcessDetector = class { - detect(_config) { - const attributes = { - [semconv_1.ATTR_PROCESS_PID]: process.pid, - [semconv_1.ATTR_PROCESS_EXECUTABLE_NAME]: process.title, - [semconv_1.ATTR_PROCESS_EXECUTABLE_PATH]: process.execPath, - [semconv_1.ATTR_PROCESS_COMMAND_ARGS]: [ - process.argv[0], - ...process.execArgv, - ...process.argv.slice(1) - ], - [semconv_1.ATTR_PROCESS_RUNTIME_VERSION]: process.versions.node, - [semconv_1.ATTR_PROCESS_RUNTIME_NAME]: "nodejs", - [semconv_1.ATTR_PROCESS_RUNTIME_DESCRIPTION]: "Node.js" - }; - if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1]; - try { - const userInfo = os.userInfo(); - attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username; - } catch (e) { - api_1.diag.debug(`error obtaining process owner: ${e}`); - } - return { attributes }; - } - }; - exports.processDetector = new ProcessDetector(); + exports.OTEL_COMPONENT_TYPE_VALUE_OTLP_HTTP_SPAN_EXPORTER = "otlp_http_span_exporter"; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/ServiceInstanceIdDetector.js -var require_ServiceInstanceIdDetector = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPTraceExporter.js +var require_OTLPTraceExporter = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = void 0; + exports.OTLPTraceExporter = void 0; + const otlp_exporter_base_1 = (init_esm(), __toCommonJS(esm_exports)); + const otlp_transformer_1 = require_src$4(); + const node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports)); const semconv_1 = require_semconv$1(); - const crypto_1 = __require("crypto"); /** - * ServiceInstanceIdDetector detects the resources related to the service instance ID. + * Collector Trace Exporter for Node */ - var ServiceInstanceIdDetector = class { - detect(_config) { - return { attributes: { [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)() } }; + var OTLPTraceExporter = class extends otlp_exporter_base_1.OTLPExporterBase { + constructor(config = {}) { + super((0, node_http_1.createOtlpHttpExportDelegate)((0, node_http_1.convertLegacyHttpOptions)(config, "TRACES", "v1/traces", { "Content-Type": "application/json" }), otlp_transformer_1.JsonTraceSerializer, semconv_1.OTEL_COMPONENT_TYPE_VALUE_OTLP_HTTP_SPAN_EXPORTER, otlp_transformer_1.TraceExporterMetricsHelper, config.selfObsMeterProvider)); } }; - /** - * @experimental - */ - exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); + exports.OTLPTraceExporter = OTLPTraceExporter; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/node/index.js +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; - var HostDetector_1 = require_HostDetector(); - Object.defineProperty(exports, "hostDetector", { + exports.OTLPTraceExporter = void 0; + var OTLPTraceExporter_1 = require_OTLPTraceExporter(); + Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function() { - return HostDetector_1.hostDetector; + return OTLPTraceExporter_1.OTLPTraceExporter; } }); - var OSDetector_1 = require_OSDetector(); - Object.defineProperty(exports, "osDetector", { +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/index.js +var require_platform$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + var node_1 = require_node$1(); + Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function() { - return OSDetector_1.osDetector; + return node_1.OTLPTraceExporter; } }); - var ProcessDetector_1 = require_ProcessDetector(); - Object.defineProperty(exports, "processDetector", { +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js +var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + var platform_1 = require_platform$1(); + Object.defineProperty(exports, "OTLPTraceExporter", { enumerable: true, get: function() { - return ProcessDetector_1.processDetector; + return platform_1.OTLPTraceExporter; } }); - var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector(); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/enums.js +var require_enums = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ExceptionEventName = void 0; + exports.ExceptionEventName = "exception"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/inspect.js +var require_inspect = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.formatInspect = exports.settledResourceAttributes = exports.inspectCustom = void 0; + /** + * Well-known symbol used by Node.js `util.inspect` (and `console.*`) to + * render an object via a custom representation. Defined as a global Symbol + * so it works without importing from `node:util`, keeping this module safe + * for browser builds (where the symbol is simply never looked up). + */ + exports.inspectCustom = Symbol.for("nodejs.util.inspect.custom"); + /** + * Collect a Resource's settled attributes without touching the + * `attributes` getter, which emits diag.error/debug entries when async + * attribute detectors are still pending. Promise-like (unsettled) + * entries are silently skipped so logging a Span/Tracer/Provider during + * startup doesn't recurse through the diag pipeline. + */ + function settledResourceAttributes(resource) { + const attrs = {}; + for (const [k, v] of resource.getRawAttributes()) { + if (typeof v?.then === "function") continue; + if (v != null) attrs[k] ??= v; + } + return attrs; + } + exports.settledResourceAttributes = settledResourceAttributes; + /** + * Build a class-tagged inspect representation. Returns a stub like + * `[ClassName]` once the recursion budget is exhausted, otherwise returns + * `ClassName ` so nested fields keep proper coloring, + * indentation, and depth handling. In environments that don't supply an + * `inspect` callback (e.g. browsers), falls back to returning the raw + * payload object. + */ + function formatInspect(className, payload, depth, options, inspect) { + if (typeof depth === "number" && depth < 0) { + const tag = `[${className}]`; + return options?.stylize ? options.stylize(tag, "special") : tag; + } + if (typeof inspect !== "function" || !options) return payload; + return `${className} ${inspect(payload, { + ...options, + depth: options.depth == null ? options.depth : options.depth - 1 + })}`; + } + exports.formatInspect = formatInspect; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/Span.js +var require_Span = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SpanImpl = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const enums_1 = require_enums(); + const inspect_1 = require_inspect(); + /** + * This class represents a span. + */ + var SpanImpl = class { + _spanContext; + kind; + parentSpanContext; + attributes = {}; + links = []; + events = []; + startTime; + resource; + instrumentationScope; + _droppedAttributesCount = 0; + _droppedEventsCount = 0; + _droppedLinksCount = 0; + _attributesCount = 0; + name; + status = { code: api_1.SpanStatusCode.UNSET }; + endTime = [0, 0]; + _ended = false; + _duration = [-1, -1]; + _spanProcessor; + _spanLimits; + _attributeValueLengthLimit; + _recordEndMetrics; + _performanceStartTime; + _performanceOffset; + _startTimeProvided; + /** + * Constructs a new SpanImpl instance. + */ + constructor(opts) { + const now = Date.now(); + this._spanContext = opts.spanContext; + this._performanceStartTime = core_1.otperformance.now(); + this._performanceOffset = now - (this._performanceStartTime + core_1.otperformance.timeOrigin); + this._startTimeProvided = opts.startTime != null; + this._spanLimits = opts.spanLimits; + this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit ?? 0; + this._spanProcessor = opts.spanProcessor; + this.name = opts.name; + this.parentSpanContext = opts.parentSpanContext; + this.kind = opts.kind; + if (opts.links) for (const link of opts.links) this.addLink(link); + this.startTime = this._getTime(opts.startTime ?? now); + this.resource = opts.resource; + this.instrumentationScope = opts.scope; + this._recordEndMetrics = opts.recordEndMetrics; + if (opts.attributes != null) this.setAttributes(opts.attributes); + this._spanProcessor.onStart(this, opts.context); } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/platform/index.js -var require_platform$1 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; - var node_1 = require_node$1(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return node_1.hostDetector; + spanContext() { + return this._spanContext; } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return node_1.osDetector; + setAttribute(key, value) { + if (value == null || this._isSpanEnded()) return this; + if (key.length === 0) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + return this; + } + if (!(0, core_1.isAttributeValue)(value)) { + api_1.diag.warn(`Invalid attribute value set for key: ${key}`); + return this; + } + const { attributeCountLimit } = this._spanLimits; + const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key); + if (attributeCountLimit !== void 0 && this._attributesCount >= attributeCountLimit && isNewKey) { + this._droppedAttributesCount++; + return this; + } + this.attributes[key] = this._truncateToSize(value); + if (isNewKey) this._attributesCount++; + return this; } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return node_1.processDetector; + setAttributes(attributes) { + for (const key in attributes) if (Object.prototype.hasOwnProperty.call(attributes, key)) this.setAttribute(key, attributes[key]); + return this; } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return node_1.serviceInstanceIdDetector; + /** + * + * @param name Span Name + * @param [attributesOrStartTime] Span attributes or start time + * if type is {@type TimeInput} and 3rd param is undefined + * @param [timeStamp] Specified time stamp for the event + */ + addEvent(name, attributesOrStartTime, timeStamp) { + if (this._isSpanEnded()) return this; + const { eventCountLimit } = this._spanLimits; + if (eventCountLimit === 0) { + api_1.diag.warn("No events allowed."); + this._droppedEventsCount++; + return this; + } + if (eventCountLimit !== void 0 && this.events.length >= eventCountLimit) { + if (this._droppedEventsCount === 0) api_1.diag.debug("Dropping extra events."); + this.events.shift(); + this._droppedEventsCount++; + } + if ((0, core_1.isTimeInput)(attributesOrStartTime)) { + if (!(0, core_1.isTimeInput)(timeStamp)) timeStamp = attributesOrStartTime; + attributesOrStartTime = void 0; + } + const sanitized = (0, core_1.sanitizeAttributes)(attributesOrStartTime); + const { attributePerEventCountLimit } = this._spanLimits; + const attributes = {}; + let droppedAttributesCount = 0; + let eventAttributesCount = 0; + for (const attr in sanitized) { + if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) continue; + const attrVal = sanitized[attr]; + if (attributePerEventCountLimit !== void 0 && eventAttributesCount >= attributePerEventCountLimit) { + droppedAttributesCount++; + continue; + } + attributes[attr] = this._truncateToSize(attrVal); + eventAttributesCount++; + } + this.events.push({ + name, + attributes, + time: this._getTime(timeStamp), + droppedAttributesCount + }); + return this; } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/NoopDetector.js -var require_NoopDetector = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.noopDetector = exports.NoopDetector = void 0; - var NoopDetector = class { - detect() { - return { attributes: {} }; + addLink(link) { + if (this._isSpanEnded()) return this; + const { linkCountLimit } = this._spanLimits; + if (linkCountLimit === 0) { + this._droppedLinksCount++; + return this; + } + if (linkCountLimit !== void 0 && this.links.length >= linkCountLimit) { + if (this._droppedLinksCount === 0) api_1.diag.debug("Dropping extra links."); + this.links.shift(); + this._droppedLinksCount++; + } + const { attributePerLinkCountLimit } = this._spanLimits; + const sanitized = (0, core_1.sanitizeAttributes)(link.attributes); + const attributes = {}; + let droppedAttributesCount = 0; + let linkAttributesCount = 0; + for (const attr in sanitized) { + if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) continue; + const attrVal = sanitized[attr]; + if (attributePerLinkCountLimit !== void 0 && linkAttributesCount >= attributePerLinkCountLimit) { + droppedAttributesCount++; + continue; + } + attributes[attr] = this._truncateToSize(attrVal); + linkAttributesCount++; + } + const processedLink = { context: link.context }; + if (linkAttributesCount > 0) processedLink.attributes = attributes; + if (droppedAttributesCount > 0) processedLink.droppedAttributesCount = droppedAttributesCount; + this.links.push(processedLink); + return this; } - }; - exports.NoopDetector = NoopDetector; - exports.noopDetector = new NoopDetector(); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/index.js -var require_detectors = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = void 0; - var EnvDetector_1 = require_EnvDetector(); - Object.defineProperty(exports, "envDetector", { - enumerable: true, - get: function() { - return EnvDetector_1.envDetector; + addLinks(links) { + for (const link of links) this.addLink(link); + return this; } - }); - var platform_1 = require_platform$1(); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return platform_1.hostDetector; + setStatus(status) { + if (this._isSpanEnded()) return this; + if (status.code === api_1.SpanStatusCode.UNSET) return this; + if (this.status.code === api_1.SpanStatusCode.OK) return this; + const newStatus = { code: status.code }; + if (status.code === api_1.SpanStatusCode.ERROR) { + if (typeof status.message === "string") newStatus.message = status.message; + else if (status.message != null) api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); + } + this.status = newStatus; + return this; } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return platform_1.osDetector; + updateName(name) { + if (this._isSpanEnded()) return this; + this.name = name; + return this; } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return platform_1.processDetector; + end(endTime) { + if (this._isSpanEnded()) { + api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); + return; + } + this.endTime = this._getTime(endTime); + this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); + if (this._duration[0] < 0) { + api_1.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.", this.startTime, this.endTime); + this.endTime = this.startTime.slice(); + this._duration = [0, 0]; + } + if (this._droppedEventsCount > 0) api_1.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`); + if (this._droppedLinksCount > 0) api_1.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`); + if (this._spanProcessor.onEnding) this._spanProcessor.onEnding(this); + this._recordEndMetrics?.(); + this._ended = true; + this._spanProcessor.onEnd(this); } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return platform_1.serviceInstanceIdDetector; + _getTime(inp) { + if (typeof inp === "number" && inp <= core_1.otperformance.now()) return (0, core_1.hrTime)(inp + this._performanceOffset); + if (typeof inp === "number") return (0, core_1.millisToHrTime)(inp); + if (inp instanceof Date) return (0, core_1.millisToHrTime)(inp.getTime()); + if ((0, core_1.isTimeInputHrTime)(inp)) return inp; + if (this._startTimeProvided) return (0, core_1.millisToHrTime)(Date.now()); + const msDuration = core_1.otperformance.now() - this._performanceStartTime; + return (0, core_1.addHrTimes)(this.startTime, (0, core_1.millisToHrTime)(msDuration)); } - }); - var NoopDetector_1 = require_NoopDetector(); - Object.defineProperty(exports, "noopDetector", { - enumerable: true, - get: function() { - return NoopDetector_1.noopDetector; + isRecording() { + return this._ended === false; } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/index.js -var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = void 0; - var detect_resources_1 = require_detect_resources(); - Object.defineProperty(exports, "detectResources", { - enumerable: true, - get: function() { - return detect_resources_1.detectResources; + recordException(exception, time) { + const attributes = {}; + if (typeof exception === "string") attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception; + else if (exception) { + if (exception.code) attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.code.toString(); + else if (exception.name) attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.name; + if (exception.message) attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception.message; + if (exception.stack) attributes[semantic_conventions_1.ATTR_EXCEPTION_STACKTRACE] = exception.stack; + } + if (attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] || attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE]) this.addEvent(enums_1.ExceptionEventName, attributes, time); + else api_1.diag.warn(`Failed to record an exception ${exception}`); } - }); - var detectors_1 = require_detectors(); - Object.defineProperty(exports, "envDetector", { - enumerable: true, - get: function() { - return detectors_1.envDetector; + get duration() { + return this._duration; } - }); - Object.defineProperty(exports, "hostDetector", { - enumerable: true, - get: function() { - return detectors_1.hostDetector; + get ended() { + return this._ended; } - }); - Object.defineProperty(exports, "osDetector", { - enumerable: true, - get: function() { - return detectors_1.osDetector; + get droppedAttributesCount() { + return this._droppedAttributesCount; } - }); - Object.defineProperty(exports, "processDetector", { - enumerable: true, - get: function() { - return detectors_1.processDetector; + get droppedEventsCount() { + return this._droppedEventsCount; } - }); - Object.defineProperty(exports, "serviceInstanceIdDetector", { - enumerable: true, - get: function() { - return detectors_1.serviceInstanceIdDetector; + get droppedLinksCount() { + return this._droppedLinksCount; } - }); - var ResourceImpl_1 = require_ResourceImpl(); - Object.defineProperty(exports, "resourceFromAttributes", { - enumerable: true, - get: function() { - return ResourceImpl_1.resourceFromAttributes; + _isSpanEnded() { + if (this._ended) { + const error = /* @__PURE__ */ new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); + api_1.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, error); + } + return this._ended; } - }); - Object.defineProperty(exports, "defaultResource", { - enumerable: true, - get: function() { - return ResourceImpl_1.defaultResource; + _truncateToLimitUtil(value, limit) { + if (value.length <= limit) return value; + return value.substring(0, limit); } - }); - Object.defineProperty(exports, "emptyResource", { - enumerable: true, - get: function() { - return ResourceImpl_1.emptyResource; + /** + * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then + * return string with truncated to {@code attributeValueLengthLimit} characters + * + * If the given attribute value is array of strings then + * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters + * + * Otherwise return same Attribute {@code value} + * + * @param value Attribute value + * @returns truncated attribute value if required, otherwise same value + */ + _truncateToSize(value) { + const limit = this._attributeValueLengthLimit; + if (limit <= 0) { + api_1.diag.warn(`Attribute value limit must be positive, got ${limit}`); + return value; + } + if (typeof value === "string") return this._truncateToLimitUtil(value, limit); + if (Array.isArray(value)) return value.map((val) => typeof val === "string" ? this._truncateToLimitUtil(val, limit) : val); + return value; } - }); - var default_service_name_1 = require_default_service_name(); - Object.defineProperty(exports, "defaultServiceName", { - enumerable: true, - get: function() { - return default_service_name_1.defaultServiceName; + [inspect_1.inspectCustom](depth, options, inspect) { + const payload = { + name: this.name, + kind: this.kind, + spanContext: this._spanContext, + parentSpanContext: this.parentSpanContext, + status: this.status, + startTime: this.startTime, + endTime: this.endTime, + duration: this._duration, + ended: this._ended, + attributes: this.attributes, + events: this.events, + links: this.links, + droppedAttributesCount: this._droppedAttributesCount, + droppedEventsCount: this._droppedEventsCount, + droppedLinksCount: this._droppedLinksCount, + instrumentationScope: this.instrumentationScope, + resource: { attributes: (0, inspect_1.settledResourceAttributes)(this.resource) } + }; + return (0, inspect_1.formatInspect)("SpanImpl", payload, depth, options, inspect); } - }); + }; + exports.SpanImpl = SpanImpl; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/enums.js -var require_enums = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/Sampler.js +var require_Sampler = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.ExceptionEventName = void 0; - exports.ExceptionEventName = "exception"; + exports.SamplingDecision = void 0; + /** + * A sampling decision that determines how a {@link Span} will be recorded + * and collected. + */ + var SamplingDecision; + (function(SamplingDecision) { + /** + * `Span.isRecording() === false`, span will not be recorded and all events + * and attributes will be dropped. + */ + SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; + /** + * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} + * MUST NOT be set. + */ + SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; + /** + * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} + * MUST be set. + */ + SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; + })(SamplingDecision || (exports.SamplingDecision = SamplingDecision = {})); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Span.js -var require_Span = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/semconv.js +var require_semconv = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.SpanImpl = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); - const enums_1 = require_enums(); + exports.OTEL_COMPONENT_TYPE_VALUE_SIMPLE_SPAN_PROCESSOR = exports.OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR = exports.METRIC_OTEL_SDK_SPAN_STARTED = exports.METRIC_OTEL_SDK_SPAN_LIVE = exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE = exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY = exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED = exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = exports.ATTR_OTEL_COMPONENT_TYPE = exports.ATTR_OTEL_COMPONENT_NAME = void 0; /** - * This class represents a span. + * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance. + * + * @example otlp_grpc_span_exporter/0 + * @example custom-name + * + * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts. + * E.g. implementations **MUST NOT** use UUIDs as values for this attribute. + * + * Implementations **MAY** achieve these goals by following a `/` pattern, e.g. `batching_span_processor/0`. + * Hereby `otel.component.type` refers to the corresponding attribute value of the component. + * + * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed. + * For example, `` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an + * instance of the given component type is started. + * + * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0` + * as `otel.component.name`, the second one `batching_span_processor/1` and so on. + * These values will therefore be reused in the case of an application restart. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. */ - var SpanImpl = class { - _spanContext; - kind; - parentSpanContext; - attributes = {}; - links = []; - events = []; - startTime; - resource; + exports.ATTR_OTEL_COMPONENT_NAME = "otel.component.name"; + /** + * A name identifying the type of the OpenTelemetry component. + * + * @example batching_span_processor + * @example com.example.MySpanExporter + * + * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type. + * E.g. for Java the fully qualified classname **SHOULD** be used in this case. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OTEL_COMPONENT_TYPE = "otel.component.type"; + /** + * Determines whether the span has a parent span, and if so, [whether it is a remote parent](https://opentelemetry.io/docs/specs/otel/trace/api/#isremote) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = "otel.span.parent.origin"; + /** + * The result value of the sampler for this span + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = "otel.span.sampling_result"; + /** + * The number of spans for which the processing has finished, either successful or failed. + * + * @note For successful processing, `error.type` **MUST NOT** be set. For failed processing, `error.type` **MUST** contain the failure cause. + * For the SDK Simple and Batching Span Processor a span is considered to be processed already when it has been submitted to the exporter, not when the corresponding export call has finished. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED = "otel.sdk.processor.span.processed"; + /** + * The maximum number of spans the queue of a given instance of an SDK span processor can hold. + * + * @note Only applies to span processors which use a queue, e.g. the SDK Batching Span Processor. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY = "otel.sdk.processor.span.queue.capacity"; + /** + * The number of spans in the queue of a given instance of an SDK span processor. + * + * @note Only applies to span processors which use a queue, e.g. the SDK Batching Span Processor. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE = "otel.sdk.processor.span.queue.size"; + /** + * The number of created spans with `recording=true` for which the end operation has not been called yet. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.METRIC_OTEL_SDK_SPAN_LIVE = "otel.sdk.span.live"; + /** + * The number of created spans. + * + * @note Implementations **MUST** record this metric for all spans, even for non-recording ones. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.METRIC_OTEL_SDK_SPAN_STARTED = "otel.sdk.span.started"; + /** + * Enum value "batching_span_processor" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}. + * + * The builtin SDK batching span processor + * + * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR = "batching_span_processor"; + /** + * Enum value "simple_span_processor" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}. + * + * The builtin SDK simple span processor + * + * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ + exports.OTEL_COMPONENT_TYPE_VALUE_SIMPLE_SPAN_PROCESSOR = "simple_span_processor"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/TracerMetrics.js +var require_TracerMetrics = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TracerMetrics = void 0; + const Sampler_1 = require_Sampler(); + const semconv_1 = require_semconv(); + /** + * Generates `otel.sdk.span.*` metrics. + * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics + */ + var TracerMetrics = class { + startedSpans; + liveSpans; + constructor(meter) { + this.startedSpans = meter.createCounter(semconv_1.METRIC_OTEL_SDK_SPAN_STARTED, { + unit: "{span}", + description: "The number of created spans." + }); + this.liveSpans = meter.createUpDownCounter(semconv_1.METRIC_OTEL_SDK_SPAN_LIVE, { + unit: "{span}", + description: "The number of currently live spans." + }); + } + startSpan(parentSpanCtx, samplingDecision) { + const samplingDecisionStr = samplingDecisionToString(samplingDecision); + this.startedSpans.add(1, { + [semconv_1.ATTR_OTEL_SPAN_PARENT_ORIGIN]: parentOrigin(parentSpanCtx), + [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr + }); + if (samplingDecision === Sampler_1.SamplingDecision.NOT_RECORD) return () => {}; + const liveSpanAttributes = { [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr }; + this.liveSpans.add(1, liveSpanAttributes); + return () => { + this.liveSpans.add(-1, liveSpanAttributes); + }; + } + }; + exports.TracerMetrics = TracerMetrics; + function parentOrigin(parentSpanContext) { + if (!parentSpanContext) return "none"; + if (parentSpanContext.isRemote) return "remote"; + return "local"; + } + function samplingDecisionToString(decision) { + switch (decision) { + case Sampler_1.SamplingDecision.RECORD_AND_SAMPLED: return "RECORD_AND_SAMPLE"; + case Sampler_1.SamplingDecision.RECORD: return "RECORD_ONLY"; + case Sampler_1.SamplingDecision.NOT_RECORD: return "DROP"; + } + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/version.js +var require_version = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "2.10.0"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/Tracer.js +var require_Tracer = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Tracer = void 0; + const api = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + const Span_1 = require_Span(); + const TracerMetrics_1 = require_TracerMetrics(); + const version_1 = require_version(); + const inspect_1 = require_inspect(); + /** + * This class represents a basic tracer. + */ + var Tracer = class { + _sampler; + _spanLimits; + _idGenerator; instrumentationScope; - _droppedAttributesCount = 0; - _droppedEventsCount = 0; - _droppedLinksCount = 0; - _attributesCount = 0; - name; - status = { code: api_1.SpanStatusCode.UNSET }; - endTime = [0, 0]; - _ended = false; - _duration = [-1, -1]; + _resource; _spanProcessor; - _spanLimits; - _attributeValueLengthLimit; - _recordEndMetrics; - _performanceStartTime; - _performanceOffset; - _startTimeProvided; + _tracerMetrics; /** - * Constructs a new SpanImpl instance. + * Constructs a new Tracer instance. */ - constructor(opts) { - const now = Date.now(); - this._spanContext = opts.spanContext; - this._performanceStartTime = core_1.otperformance.now(); - this._performanceOffset = now - (this._performanceStartTime + core_1.otperformance.timeOrigin); - this._startTimeProvided = opts.startTime != null; - this._spanLimits = opts.spanLimits; - this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit ?? 0; - this._spanProcessor = opts.spanProcessor; - this.name = opts.name; - this.parentSpanContext = opts.parentSpanContext; - this.kind = opts.kind; - if (opts.links) for (const link of opts.links) this.addLink(link); - this.startTime = this._getTime(opts.startTime ?? now); - this.resource = opts.resource; - this.instrumentationScope = opts.scope; - this._recordEndMetrics = opts.recordEndMetrics; - if (opts.attributes != null) this.setAttributes(opts.attributes); - this._spanProcessor.onStart(this, opts.context); - } - spanContext() { - return this._spanContext; - } - setAttribute(key, value) { - if (value == null || this._isSpanEnded()) return this; - if (key.length === 0) { - api_1.diag.warn(`Invalid attribute key: ${key}`); - return this; - } - if (!(0, core_1.isAttributeValue)(value)) { - api_1.diag.warn(`Invalid attribute value set for key: ${key}`); - return this; - } - const { attributeCountLimit } = this._spanLimits; - const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key); - if (attributeCountLimit !== void 0 && this._attributesCount >= attributeCountLimit && isNewKey) { - this._droppedAttributesCount++; - return this; - } - this.attributes[key] = this._truncateToSize(value); - if (isNewKey) this._attributesCount++; - return this; - } - setAttributes(attributes) { - for (const key in attributes) if (Object.prototype.hasOwnProperty.call(attributes, key)) this.setAttribute(key, attributes[key]); - return this; + constructor(instrumentationScope, options) { + this.instrumentationScope = instrumentationScope; + this._sampler = options.sampler; + this._spanLimits = options.spanLimits; + this._resource = options.resource; + this._idGenerator = options.idGenerator; + this._spanProcessor = options.spanProcessor; + const meter = options.meterProvider.getMeter("@opentelemetry/sdk-trace", version_1.VERSION); + this._tracerMetrics = new TracerMetrics_1.TracerMetrics(meter); } /** - * - * @param name Span Name - * @param [attributesOrStartTime] Span attributes or start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [timeStamp] Specified time stamp for the event + * Starts a new Span or returns the default NoopSpan based on the sampling + * decision. */ - addEvent(name, attributesOrStartTime, timeStamp) { - if (this._isSpanEnded()) return this; - const { eventCountLimit } = this._spanLimits; - if (eventCountLimit === 0) { - api_1.diag.warn("No events allowed."); - this._droppedEventsCount++; - return this; - } - if (eventCountLimit !== void 0 && this.events.length >= eventCountLimit) { - if (this._droppedEventsCount === 0) api_1.diag.debug("Dropping extra events."); - this.events.shift(); - this._droppedEventsCount++; + startSpan(name, options = {}, context = api.context.active()) { + if (options.root) context = api.trace.deleteSpan(context); + const parentSpan = api.trace.getSpan(context); + if ((0, core_1.isTracingSuppressed)(context)) { + api.diag.debug("Instrumentation suppressed, returning Noop Span"); + return api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); } - if ((0, core_1.isTimeInput)(attributesOrStartTime)) { - if (!(0, core_1.isTimeInput)(timeStamp)) timeStamp = attributesOrStartTime; - attributesOrStartTime = void 0; + const parentSpanContext = parentSpan?.spanContext(); + const spanId = this._idGenerator.generateSpanId(); + let validParentSpanContext; + let traceId; + let traceState; + if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) traceId = this._idGenerator.generateTraceId(); + else { + traceId = parentSpanContext.traceId; + traceState = parentSpanContext.traceState; + validParentSpanContext = parentSpanContext; } - const sanitized = (0, core_1.sanitizeAttributes)(attributesOrStartTime); - const { attributePerEventCountLimit } = this._spanLimits; - const attributes = {}; - let droppedAttributesCount = 0; - let eventAttributesCount = 0; - for (const attr in sanitized) { - if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) continue; - const attrVal = sanitized[attr]; - if (attributePerEventCountLimit !== void 0 && eventAttributesCount >= attributePerEventCountLimit) { - droppedAttributesCount++; - continue; - } - attributes[attr] = this._truncateToSize(attrVal); - eventAttributesCount++; + const spanKind = options.kind ?? api.SpanKind.INTERNAL; + const links = (options.links ?? []).map((link) => { + return { + context: link.context, + attributes: (0, core_1.sanitizeAttributes)(link.attributes) + }; + }); + const attributes = (0, core_1.sanitizeAttributes)(options.attributes); + const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); + const recordEndMetrics = this._tracerMetrics.startSpan(parentSpanContext, samplingResult.decision); + traceState = samplingResult.traceState ?? traceState; + const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE; + const spanContext = { + traceId, + spanId, + traceFlags, + traceState + }; + if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { + api.diag.debug("Recording is off, propagating context in a non-recording span"); + return api.trace.wrapSpanContext(spanContext); } - this.events.push({ + const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); + return new Span_1.SpanImpl({ + resource: this._resource, + scope: this.instrumentationScope, + context, + spanContext, name, - attributes, - time: this._getTime(timeStamp), - droppedAttributesCount + kind: spanKind, + links, + parentSpanContext: validParentSpanContext, + attributes: initAttributes, + startTime: options.startTime, + spanProcessor: this._spanProcessor, + spanLimits: this._spanLimits, + recordEndMetrics }); - return this; - } - addLink(link) { - if (this._isSpanEnded()) return this; - const { linkCountLimit } = this._spanLimits; - if (linkCountLimit === 0) { - this._droppedLinksCount++; - return this; - } - if (linkCountLimit !== void 0 && this.links.length >= linkCountLimit) { - if (this._droppedLinksCount === 0) api_1.diag.debug("Dropping extra links."); - this.links.shift(); - this._droppedLinksCount++; - } - const { attributePerLinkCountLimit } = this._spanLimits; - const sanitized = (0, core_1.sanitizeAttributes)(link.attributes); - const attributes = {}; - let droppedAttributesCount = 0; - let linkAttributesCount = 0; - for (const attr in sanitized) { - if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) continue; - const attrVal = sanitized[attr]; - if (attributePerLinkCountLimit !== void 0 && linkAttributesCount >= attributePerLinkCountLimit) { - droppedAttributesCount++; - continue; - } - attributes[attr] = this._truncateToSize(attrVal); - linkAttributesCount++; - } - const processedLink = { context: link.context }; - if (linkAttributesCount > 0) processedLink.attributes = attributes; - if (droppedAttributesCount > 0) processedLink.droppedAttributesCount = droppedAttributesCount; - this.links.push(processedLink); - return this; - } - addLinks(links) { - for (const link of links) this.addLink(link); - return this; - } - setStatus(status) { - if (this._isSpanEnded()) return this; - if (status.code === api_1.SpanStatusCode.UNSET) return this; - if (this.status.code === api_1.SpanStatusCode.OK) return this; - const newStatus = { code: status.code }; - if (status.code === api_1.SpanStatusCode.ERROR) { - if (typeof status.message === "string") newStatus.message = status.message; - else if (status.message != null) api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); - } - this.status = newStatus; - return this; - } - updateName(name) { - if (this._isSpanEnded()) return this; - this.name = name; - return this; - } - end(endTime) { - if (this._isSpanEnded()) { - api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); - return; - } - this.endTime = this._getTime(endTime); - this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); - if (this._duration[0] < 0) { - api_1.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.", this.startTime, this.endTime); - this.endTime = this.startTime.slice(); - this._duration = [0, 0]; - } - if (this._droppedEventsCount > 0) api_1.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`); - if (this._droppedLinksCount > 0) api_1.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`); - if (this._spanProcessor.onEnding) this._spanProcessor.onEnding(this); - this._recordEndMetrics?.(); - this._ended = true; - this._spanProcessor.onEnd(this); - } - _getTime(inp) { - if (typeof inp === "number" && inp <= core_1.otperformance.now()) return (0, core_1.hrTime)(inp + this._performanceOffset); - if (typeof inp === "number") return (0, core_1.millisToHrTime)(inp); - if (inp instanceof Date) return (0, core_1.millisToHrTime)(inp.getTime()); - if ((0, core_1.isTimeInputHrTime)(inp)) return inp; - if (this._startTimeProvided) return (0, core_1.millisToHrTime)(Date.now()); - const msDuration = core_1.otperformance.now() - this._performanceStartTime; - return (0, core_1.addHrTimes)(this.startTime, (0, core_1.millisToHrTime)(msDuration)); } - isRecording() { - return this._ended === false; - } - recordException(exception, time$2) { - const attributes = {}; - if (typeof exception === "string") attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception; - else if (exception) { - if (exception.code) attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.code.toString(); - else if (exception.name) attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.name; - if (exception.message) attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception.message; - if (exception.stack) attributes[semantic_conventions_1.ATTR_EXCEPTION_STACKTRACE] = exception.stack; + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) return; + else if (arguments.length === 2) fn = arg2; + else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } else { + opts = arg2; + ctx = arg3; + fn = arg4; } - if (attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] || attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE]) this.addEvent(enums_1.ExceptionEventName, attributes, time$2); - else api_1.diag.warn(`Failed to record an exception ${exception}`); - } - get duration() { - return this._duration; + const parentContext = ctx ?? api.context.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = api.trace.setSpan(parentContext, span); + return api.context.with(contextWithSpanSet, fn, void 0, span); } - get ended() { - return this._ended; + [inspect_1.inspectCustom](depth, options, inspect) { + const payload = { + instrumentationScope: this.instrumentationScope, + resource: { attributes: (0, inspect_1.settledResourceAttributes)(this._resource) }, + spanLimits: this._spanLimits + }; + return (0, inspect_1.formatInspect)("Tracer", payload, depth, options, inspect); } - get droppedAttributesCount() { - return this._droppedAttributesCount; + }; + exports.Tracer = Tracer; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/MultiSpanProcessor.js +var require_MultiSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MultiSpanProcessor = void 0; + const core_1 = require_src$8(); + /** + * Implementation of the {@link SpanProcessor} that simply forwards all + * received events to a list of {@link SpanProcessor}s. + */ + var MultiSpanProcessor = class { + _spanProcessors; + constructor(spanProcessors) { + this._spanProcessors = spanProcessors; } - get droppedEventsCount() { - return this._droppedEventsCount; + forceFlush() { + const promises = []; + for (const spanProcessor of this._spanProcessors) promises.push(spanProcessor.forceFlush()); + return new Promise((resolve) => { + Promise.all(promises).then(() => { + resolve(); + }).catch((error) => { + (0, core_1.globalErrorHandler)(error || /* @__PURE__ */ new Error("MultiSpanProcessor: forceFlush failed")); + resolve(); + }); + }); } - get droppedLinksCount() { - return this._droppedLinksCount; + onStart(span, context) { + for (const spanProcessor of this._spanProcessors) spanProcessor.onStart(span, context); } - _isSpanEnded() { - if (this._ended) { - const error = /* @__PURE__ */ new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); - api_1.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, error); - } - return this._ended; + onEnding(span) { + for (const spanProcessor of this._spanProcessors) if (spanProcessor.onEnding) spanProcessor.onEnding(span); } - _truncateToLimitUtil(value, limit) { - if (value.length <= limit) return value; - return value.substring(0, limit); + onEnd(span) { + for (const spanProcessor of this._spanProcessors) spanProcessor.onEnd(span); } - /** - * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then - * return string with truncated to {@code attributeValueLengthLimit} characters - * - * If the given attribute value is array of strings then - * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters - * - * Otherwise return same Attribute {@code value} - * - * @param value Attribute value - * @returns truncated attribute value if required, otherwise same value - */ - _truncateToSize(value) { - const limit = this._attributeValueLengthLimit; - if (limit <= 0) { - api_1.diag.warn(`Attribute value limit must be positive, got ${limit}`); - return value; - } - if (typeof value === "string") return this._truncateToLimitUtil(value, limit); - if (Array.isArray(value)) return value.map((val) => typeof val === "string" ? this._truncateToLimitUtil(val, limit) : val); - return value; + shutdown() { + const promises = []; + for (const spanProcessor of this._spanProcessors) promises.push(spanProcessor.shutdown()); + return new Promise((resolve, reject) => { + Promise.all(promises).then(() => { + resolve(); + }, reject); + }); } }; - exports.SpanImpl = SpanImpl; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Sampler.js -var require_Sampler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.SamplingDecision = void 0; - (function(SamplingDecision$1) { - /** - * `Span.isRecording() === false`, span will not be recorded and all events - * and attributes will be dropped. - */ - SamplingDecision$1[SamplingDecision$1["NOT_RECORD"] = 0] = "NOT_RECORD"; - /** - * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} - * MUST NOT be set. - */ - SamplingDecision$1[SamplingDecision$1["RECORD"] = 1] = "RECORD"; - /** - * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} - * MUST be set. - */ - SamplingDecision$1[SamplingDecision$1["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; - })(exports.SamplingDecision || (exports.SamplingDecision = {})); + exports.MultiSpanProcessor = MultiSpanProcessor; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOffSampler.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/sampler/AlwaysOffSampler.js var require_AlwaysOffSampler = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AlwaysOffSampler = void 0; @@ -44080,7 +28678,7 @@ var require_AlwaysOffSampler = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOnSampler.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/sampler/AlwaysOnSampler.js var require_AlwaysOnSampler = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AlwaysOnSampler = void 0; @@ -44093,226 +28691,130 @@ var require_AlwaysOnSampler = /* @__PURE__ */ __commonJSMin(((exports) => { toString() { return "AlwaysOnSampler"; } - }; - exports.AlwaysOnSampler = AlwaysOnSampler; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/ParentBasedSampler.js -var require_ParentBasedSampler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.ParentBasedSampler = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const AlwaysOffSampler_1 = require_AlwaysOffSampler(); - const AlwaysOnSampler_1 = require_AlwaysOnSampler(); - /** - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ - var ParentBasedSampler = class { - _root; - _remoteParentSampled; - _remoteParentNotSampled; - _localParentSampled; - _localParentNotSampled; - constructor(config$1) { - this._root = config$1.root; - if (!this._root) { - (0, core_1.globalErrorHandler)(/* @__PURE__ */ new Error("ParentBasedSampler must have a root sampler configured")); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = config$1.remoteParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = config$1.remoteParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = config$1.localParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = config$1.localParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context$1, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context$1); - if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) return this._root.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) return this._remoteParentSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - return this._remoteParentNotSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) return this._localParentSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - return this._localParentNotSampled.shouldSample(context$1, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } - }; - exports.ParentBasedSampler = ParentBasedSampler; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/TraceIdRatioBasedSampler.js -var require_TraceIdRatioBasedSampler = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TraceIdRatioBasedSampler = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const Sampler_1 = require_Sampler(); - /** Sampler that samples a given fraction of traces based of trace id deterministically. */ - var TraceIdRatioBasedSampler = class { - _ratio; - _upperBound; - constructor(ratio = 0) { - this._ratio = this._normalize(ratio); - this._upperBound = Math.floor(this._ratio * 4294967295); - } - shouldSample(context$1, traceId) { - return { decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED : Sampler_1.SamplingDecision.NOT_RECORD }; - } - toString() { - return `TraceIdRatioBased{${this._ratio}}`; - } - _normalize(ratio) { - if (typeof ratio !== "number" || isNaN(ratio)) return 0; - return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; - } - _accumulate(traceId) { - let accumulation = 0; - for (let i = 0; i < 32; i += 8) { - let part = 0; - for (let j = 0; j < 8; j++) { - const c = traceId.charCodeAt(i + j); - const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87; - part = part << 4 | v; - } - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } - }; - exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/config.js -var require_config = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; - const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const AlwaysOffSampler_1 = require_AlwaysOffSampler(); - const AlwaysOnSampler_1 = require_AlwaysOnSampler(); - const ParentBasedSampler_1 = require_ParentBasedSampler(); - const TraceIdRatioBasedSampler_1 = require_TraceIdRatioBasedSampler(); - var TracesSamplerValues; - (function(TracesSamplerValues) { - TracesSamplerValues["AlwaysOff"] = "always_off"; - TracesSamplerValues["AlwaysOn"] = "always_on"; - TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; - TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; - TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; - TracesSamplerValues["TraceIdRatio"] = "traceidratio"; - })(TracesSamplerValues || (TracesSamplerValues = {})); - const DEFAULT_RATIO = 1; - /** - * Load default configuration. For fields with primitive values, any user-provided - * value will override the corresponding default value. For fields with - * non-primitive values (like `spanLimits`), the user-provided value will be - * used to extend the default value. - */ - function loadDefaultConfig() { - return { - sampler: buildSamplerFromEnv(), - forceFlushTimeoutMillis: 3e4, - generalLimits: { - attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, - attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? 128 - }, - spanLimits: { - attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, - attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? 128, - linkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT") ?? 128, - eventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT") ?? 128, - attributePerEventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT") ?? 128, - attributePerLinkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT") ?? 128 - } - }; - } - exports.loadDefaultConfig = loadDefaultConfig; - /** - * Based on environment, builds a sampler, complies with specification. - */ - function buildSamplerFromEnv() { - const sampler = (0, core_1.getStringFromEnv)("OTEL_TRACES_SAMPLER") ?? TracesSamplerValues.ParentBasedAlwaysOn; - switch (sampler) { - case TracesSamplerValues.AlwaysOn: return new AlwaysOnSampler_1.AlwaysOnSampler(); - case TracesSamplerValues.AlwaysOff: return new AlwaysOffSampler_1.AlwaysOffSampler(); - case TracesSamplerValues.ParentBasedAlwaysOn: return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOnSampler_1.AlwaysOnSampler() }); - case TracesSamplerValues.ParentBasedAlwaysOff: return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOffSampler_1.AlwaysOffSampler() }); - case TracesSamplerValues.TraceIdRatio: return new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()); - case TracesSamplerValues.ParentBasedTraceIdRatio: return new ParentBasedSampler_1.ParentBasedSampler({ root: new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()) }); - default: - api_1.diag.error(`OTEL_TRACES_SAMPLER value "${sampler}" invalid, defaulting to "${TracesSamplerValues.ParentBasedAlwaysOn}".`); - return new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOnSampler_1.AlwaysOnSampler() }); - } - } - exports.buildSamplerFromEnv = buildSamplerFromEnv; - function getSamplerProbabilityFromEnv() { - const probability = (0, core_1.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG"); - if (probability == null) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - if (probability < 0 || probability > 1) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - return probability; - } + }; + exports.AlwaysOnSampler = AlwaysOnSampler; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/utility.js -var require_utility = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/sampler/ParentBasedSampler.js +var require_ParentBasedSampler = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.reconfigureLimits = exports.mergeConfig = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = void 0; - const config_1 = require_config(); - const core_1 = require_src$9(); - exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; - exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; - /** - * Function to merge Default configuration (as specified in './config') with - * user provided configurations. - */ - function mergeConfig(userConfig) { - const perInstanceDefaults = { sampler: (0, config_1.buildSamplerFromEnv)() }; - const DEFAULT_CONFIG = (0, config_1.loadDefaultConfig)(); - const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig); - target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); - target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); - return target; - } - exports.mergeConfig = mergeConfig; + exports.ParentBasedSampler = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + const AlwaysOffSampler_1 = require_AlwaysOffSampler(); + const AlwaysOnSampler_1 = require_AlwaysOnSampler(); /** - * When general limits are provided and model specific limits are not, - * configures the model specific limits by using the values from the general ones. - * @param userConfig User provided tracer configuration + * A composite sampler that either respects the parent span's sampling decision + * or delegates to `delegateSampler` for root spans. */ - function reconfigureLimits(userConfig) { - const spanLimits = Object.assign({}, userConfig.spanLimits); - /** - * Reassign span attribute count limit to use first non null value defined by user or use default value - */ - spanLimits.attributeCountLimit = userConfig.spanLimits?.attributeCountLimit ?? userConfig.generalLimits?.attributeCountLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT; - /** - * Reassign span attribute value length limit to use first non null value defined by user or use default value - */ - spanLimits.attributeValueLengthLimit = userConfig.spanLimits?.attributeValueLengthLimit ?? userConfig.generalLimits?.attributeValueLengthLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; - return Object.assign({}, userConfig, { spanLimits }); - } - exports.reconfigureLimits = reconfigureLimits; + var ParentBasedSampler = class { + _root; + _remoteParentSampled; + _remoteParentNotSampled; + _localParentSampled; + _localParentNotSampled; + constructor(config) { + this._root = config.root; + if (!this._root) { + (0, core_1.globalErrorHandler)(/* @__PURE__ */ new Error("ParentBasedSampler must have a root sampler configured")); + this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); + } + this._remoteParentSampled = config.remoteParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); + this._remoteParentNotSampled = config.remoteParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); + this._localParentSampled = config.localParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); + this._localParentNotSampled = config.localParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); + } + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const parentContext = api_1.trace.getSpanContext(context); + if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + if (parentContext.isRemote) { + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + } + toString() { + return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + } + }; + exports.ParentBasedSampler = ParentBasedSampler; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/export/SpanProcessorMetrics.js +var require_SpanProcessorMetrics = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SpanProcessorMetrics = void 0; + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const semconv_1 = require_semconv(); + const componentCounter = /* @__PURE__ */ new Map(); + var SpanProcessorMetrics = class { + processedSpans; + queueSize; + queueSizeCallback; + standardAttrs; + droppedAttrs; + constructor(componentType, meter, queueConfig) { + const counter = componentCounter.get(componentType) ?? 0; + componentCounter.set(componentType, counter + 1); + this.standardAttrs = { + [semconv_1.ATTR_OTEL_COMPONENT_TYPE]: componentType, + [semconv_1.ATTR_OTEL_COMPONENT_NAME]: `${componentType}/${counter}` + }; + this.droppedAttrs = { + ...this.standardAttrs, + [semantic_conventions_1.ATTR_ERROR_TYPE]: "queue_full" + }; + this.processedSpans = meter.createCounter(semconv_1.METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED, { + unit: "{span}", + description: "The number of spans for which the processing has finished, either successful or failed." + }); + if (queueConfig) { + const { capacity, getQueueSize } = queueConfig; + meter.createUpDownCounter(semconv_1.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY, { + unit: "{span}", + description: "The maximum number of spans the queue of a given instance of an SDK span processor can hold." + }).add(capacity, this.standardAttrs); + this.queueSize = meter.createObservableUpDownCounter(semconv_1.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE, { + unit: "{span}", + description: "The number of spans in the queue of a given instance of an SDK span processor." + }); + this.queueSizeCallback = (result) => result.observe(getQueueSize(), this.standardAttrs); + this.queueSize.addCallback(this.queueSizeCallback); + } + } + dropSpans(count) { + this.processedSpans.add(count, this.droppedAttrs); + } + finishSpans(count, error) { + if (!error) { + this.processedSpans.add(count, this.standardAttrs); + return; + } + const attrs = { + ...this.standardAttrs, + [semantic_conventions_1.ATTR_ERROR_TYPE]: error.name + }; + this.processedSpans.add(count, attrs); + } + shutdown() { + if (this.queueSize && this.queueSizeCallback) this.queueSize.removeCallback(this.queueSizeCallback); + } + }; + exports.SpanProcessorMetrics = SpanProcessorMetrics; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/BatchSpanProcessorBase.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/export/BatchSpanProcessorBase.js var require_BatchSpanProcessorBase = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchSpanProcessorBase = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); + const core_1 = require_src$8(); + const SpanProcessorMetrics_1 = require_SpanProcessorMetrics(); + const semconv_1 = require_semconv(); /** * Implementation of the {@link SpanProcessor} that batches spans exported by * the SDK then pushes them to the exporter pipeline. @@ -44323,22 +28825,28 @@ var require_BatchSpanProcessorBase = /* @__PURE__ */ __commonJSMin(((exports) => _scheduledDelayMillis; _exportTimeoutMillis; _exporter; + _metrics; _isExporting = false; _finishedSpans = []; _timer; _shutdownOnce; _droppedSpansCount = 0; - constructor(exporter, config$1) { - this._exporter = exporter; - this._maxExportBatchSize = typeof config$1?.maxExportBatchSize === "number" ? config$1.maxExportBatchSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE") ?? 512; - this._maxQueueSize = typeof config$1?.maxQueueSize === "number" ? config$1.maxQueueSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE") ?? 2048; - this._scheduledDelayMillis = typeof config$1?.scheduledDelayMillis === "number" ? config$1.scheduledDelayMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY") ?? 5e3; - this._exportTimeoutMillis = typeof config$1?.exportTimeoutMillis === "number" ? config$1.exportTimeoutMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT") ?? 3e4; + constructor(options) { + this._exporter = options.exporter; + this._maxExportBatchSize = options.maxExportBatchSize ?? 512; + this._maxQueueSize = options.maxQueueSize ?? 2048; + this._scheduledDelayMillis = options.scheduledDelayMillis ?? 5e3; + this._exportTimeoutMillis = options.exportTimeoutMillis ?? 3e4; this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); if (this._maxExportBatchSize > this._maxQueueSize) { api_1.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"); this._maxExportBatchSize = this._maxQueueSize; } + const meter = options.selfObsMeterProvider ? options.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace") : (0, api_1.createNoopMeter)(); + this._metrics = new SpanProcessorMetrics_1.SpanProcessorMetrics(semconv_1.OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR, meter, { + capacity: this._maxQueueSize, + getQueueSize: () => this._finishedSpans.length + }); } forceFlush() { if (this._shutdownOnce.isCalled) return this._shutdownOnce.promise; @@ -44359,6 +28867,7 @@ var require_BatchSpanProcessorBase = /* @__PURE__ */ __commonJSMin(((exports) => }).then(() => { return this._flushAll(); }).then(() => { + this._metrics.shutdown(); return this._exporter.shutdown(); }); } @@ -44367,6 +28876,7 @@ var require_BatchSpanProcessorBase = /* @__PURE__ */ __commonJSMin(((exports) => if (this._finishedSpans.length >= this._maxQueueSize) { if (this._droppedSpansCount === 0) api_1.diag.debug("maxQueueSize reached, dropping spans"); this._droppedSpansCount++; + this._metrics.dropSpans(1); return; } if (this._droppedSpansCount > 0) { @@ -44406,6 +28916,7 @@ var require_BatchSpanProcessorBase = /* @__PURE__ */ __commonJSMin(((exports) => } else spans = this._finishedSpans.splice(0, this._maxExportBatchSize); const doExport = () => this._exporter.export(spans, (result) => { clearTimeout(timer); + this._metrics.finishSpans(spans.length, result.error); if (result.code === core_1.ExportResultCode.SUCCESS) resolve(); else reject(result.error ?? /* @__PURE__ */ new Error("BatchSpanProcessor: span export failed")); }); @@ -44423,441 +28934,185 @@ var require_BatchSpanProcessorBase = /* @__PURE__ */ __commonJSMin(((exports) => reject(err); }); }); - }); - } - _maybeStartTimer() { - if (this._isExporting) return; - const flush = () => { - this._isExporting = true; - this._flushOneBatch().finally(() => { - this._isExporting = false; - if (this._finishedSpans.length > 0) { - this._clearTimer(); - this._maybeStartTimer(); - } - }).catch((e) => { - this._isExporting = false; - (0, core_1.globalErrorHandler)(e); - }); - }; - if (this._finishedSpans.length >= this._maxExportBatchSize) return flush(); - if (this._timer !== void 0) return; - this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); - if (typeof this._timer !== "number") this._timer.unref(); - } - _clearTimer() { - if (this._timer !== void 0) { - clearTimeout(this._timer); - this._timer = void 0; - } - } - }; - exports.BatchSpanProcessorBase = BatchSpanProcessorBase; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/export/BatchSpanProcessor.js -var require_BatchSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.BatchSpanProcessor = void 0; - const BatchSpanProcessorBase_1 = require_BatchSpanProcessorBase(); - var BatchSpanProcessor = class extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { - onShutdown() {} - }; - exports.BatchSpanProcessor = BatchSpanProcessor; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/RandomIdGenerator.js -var require_RandomIdGenerator = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RandomIdGenerator = void 0; - const SPAN_ID_BYTES = 8; - const TRACE_ID_BYTES = 16; - var RandomIdGenerator = class { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - generateSpanId = getIdGenerator(SPAN_ID_BYTES); - }; - exports.RandomIdGenerator = RandomIdGenerator; - const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); - function getIdGenerator(bytes) { - return function generateId() { - for (let i = 0; i < bytes / 4; i++) SHARED_BUFFER.writeUInt32BE(Math.random() * 2 ** 32 >>> 0, i * 4); - for (let i = 0; i < bytes; i++) if (SHARED_BUFFER[i] > 0) break; - else if (i === bytes - 1) SHARED_BUFFER[bytes - 1] = 1; - return SHARED_BUFFER.toString("hex", 0, bytes); - }; - } -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/index.js -var require_node = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; - var BatchSpanProcessor_1 = require_BatchSpanProcessor(); - Object.defineProperty(exports, "BatchSpanProcessor", { - enumerable: true, - get: function() { - return BatchSpanProcessor_1.BatchSpanProcessor; - } - }); - var RandomIdGenerator_1 = require_RandomIdGenerator(); - Object.defineProperty(exports, "RandomIdGenerator", { - enumerable: true, - get: function() { - return RandomIdGenerator_1.RandomIdGenerator; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/platform/index.js -var require_platform = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; - var node_1 = require_node(); - Object.defineProperty(exports, "BatchSpanProcessor", { - enumerable: true, - get: function() { - return node_1.BatchSpanProcessor; - } - }); - Object.defineProperty(exports, "RandomIdGenerator", { - enumerable: true, - get: function() { - return node_1.RandomIdGenerator; - } - }); -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/semconv.js -var require_semconv = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.METRIC_OTEL_SDK_SPAN_STARTED = exports.METRIC_OTEL_SDK_SPAN_LIVE = exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = void 0; - /** - * Determines whether the span has a parent span, and if so, [whether it is a remote parent](https://opentelemetry.io/docs/specs/otel/trace/api/#isremote) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = "otel.span.parent.origin"; - /** - * The result value of the sampler for this span - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = "otel.span.sampling_result"; - /** - * The number of created spans with `recording=true` for which the end operation has not been called yet. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.METRIC_OTEL_SDK_SPAN_LIVE = "otel.sdk.span.live"; - /** - * The number of created spans. - * - * @note Implementations **MUST** record this metric for all spans, even for non-recording ones. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ - exports.METRIC_OTEL_SDK_SPAN_STARTED = "otel.sdk.span.started"; -})); - -//#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/TracerMetrics.js -var require_TracerMetrics = /* @__PURE__ */ __commonJSMin(((exports) => { - Object.defineProperty(exports, "__esModule", { value: true }); - exports.TracerMetrics = void 0; - const Sampler_1 = require_Sampler(); - const semconv_1 = require_semconv(); - /** - * Generates `otel.sdk.span.*` metrics. - * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics - */ - var TracerMetrics = class { - startedSpans; - liveSpans; - constructor(meter) { - this.startedSpans = meter.createCounter(semconv_1.METRIC_OTEL_SDK_SPAN_STARTED, { - unit: "{span}", - description: "The number of created spans." - }); - this.liveSpans = meter.createUpDownCounter(semconv_1.METRIC_OTEL_SDK_SPAN_LIVE, { - unit: "{span}", - description: "The number of currently live spans." - }); - } - startSpan(parentSpanCtx, samplingDecision) { - const samplingDecisionStr = samplingDecisionToString(samplingDecision); - this.startedSpans.add(1, { - [semconv_1.ATTR_OTEL_SPAN_PARENT_ORIGIN]: parentOrigin(parentSpanCtx), - [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr - }); - if (samplingDecision === Sampler_1.SamplingDecision.NOT_RECORD) return () => {}; - const liveSpanAttributes = { [semconv_1.ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr }; - this.liveSpans.add(1, liveSpanAttributes); - return () => { - this.liveSpans.add(-1, liveSpanAttributes); + }); + } + _maybeStartTimer() { + if (this._isExporting) return; + const flush = () => { + this._isExporting = true; + this._flushOneBatch().finally(() => { + this._isExporting = false; + if (this._finishedSpans.length > 0) { + this._clearTimer(); + this._maybeStartTimer(); + } + }).catch((e) => { + this._isExporting = false; + (0, core_1.globalErrorHandler)(e); + }); }; + if (this._finishedSpans.length >= this._maxExportBatchSize) return flush(); + if (this._timer !== void 0) return; + this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); + if (typeof this._timer !== "number") this._timer.unref(); } - }; - exports.TracerMetrics = TracerMetrics; - function parentOrigin(parentSpanContext) { - if (!parentSpanContext) return "none"; - if (parentSpanContext.isRemote) return "remote"; - return "local"; - } - function samplingDecisionToString(decision) { - switch (decision) { - case Sampler_1.SamplingDecision.RECORD_AND_SAMPLED: return "RECORD_AND_SAMPLE"; - case Sampler_1.SamplingDecision.RECORD: return "RECORD_ONLY"; - case Sampler_1.SamplingDecision.NOT_RECORD: return "DROP"; + _clearTimer() { + if (this._timer !== void 0) { + clearTimeout(this._timer); + this._timer = void 0; + } } - } + }; + exports.BatchSpanProcessorBase = BatchSpanProcessorBase; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/version.js -var require_version = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/platform/node/export/BatchSpanProcessor.js +var require_BatchSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.VERSION = void 0; - exports.VERSION = "2.7.1"; + exports.BatchSpanProcessor = void 0; + const BatchSpanProcessorBase_1 = require_BatchSpanProcessorBase(); + var BatchSpanProcessor = class extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { + onShutdown() {} + }; + exports.BatchSpanProcessor = BatchSpanProcessor; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/Tracer.js -var require_Tracer = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/platform/node/RandomIdGenerator.js +var require_RandomIdGenerator = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.Tracer = void 0; - const api = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); - const Span_1 = require_Span(); - const utility_1 = require_utility(); - const platform_1 = require_platform(); - const TracerMetrics_1 = require_TracerMetrics(); - const version_1 = require_version(); - /** - * This class represents a basic tracer. - */ - var Tracer = class { - _sampler; - _generalLimits; - _spanLimits; - _idGenerator; - instrumentationScope; - _resource; - _spanProcessor; - _tracerMetrics; + exports.RandomIdGenerator = void 0; + const SPAN_ID_BYTES = 8; + const TRACE_ID_BYTES = 16; + var RandomIdGenerator = class { /** - * Constructs a new Tracer instance. + * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex + * characters corresponding to 128 bits. */ - constructor(instrumentationScope, config$1, resource, spanProcessor) { - const localConfig = (0, utility_1.mergeConfig)(config$1); - this._sampler = localConfig.sampler; - this._generalLimits = localConfig.generalLimits; - this._spanLimits = localConfig.spanLimits; - this._idGenerator = config$1.idGenerator || new platform_1.RandomIdGenerator(); - this._resource = resource; - this._spanProcessor = spanProcessor; - this.instrumentationScope = instrumentationScope; - const meter = localConfig.meterProvider ? localConfig.meterProvider.getMeter("@opentelemetry/sdk-trace", version_1.VERSION) : api.createNoopMeter(); - this._tracerMetrics = new TracerMetrics_1.TracerMetrics(meter); - } + generateTraceId = getIdGenerator(TRACE_ID_BYTES); /** - * Starts a new Span or returns the default NoopSpan based on the sampling - * decision. + * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex + * characters corresponding to 64 bits. */ - startSpan(name, options = {}, context$1 = api.context.active()) { - if (options.root) context$1 = api.trace.deleteSpan(context$1); - const parentSpan = api.trace.getSpan(context$1); - if ((0, core_1.isTracingSuppressed)(context$1)) { - api.diag.debug("Instrumentation suppressed, returning Noop Span"); - return api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); - } - const parentSpanContext = parentSpan?.spanContext(); - const spanId = this._idGenerator.generateSpanId(); - let validParentSpanContext; - let traceId; - let traceState; - if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) traceId = this._idGenerator.generateTraceId(); - else { - traceId = parentSpanContext.traceId; - traceState = parentSpanContext.traceState; - validParentSpanContext = parentSpanContext; - } - const spanKind = options.kind ?? api.SpanKind.INTERNAL; - const links = (options.links ?? []).map((link) => { - return { - context: link.context, - attributes: (0, core_1.sanitizeAttributes)(link.attributes) - }; - }); - const attributes = (0, core_1.sanitizeAttributes)(options.attributes); - const samplingResult = this._sampler.shouldSample(context$1, traceId, name, spanKind, attributes, links); - const recordEndMetrics = this._tracerMetrics.startSpan(parentSpanContext, samplingResult.decision); - traceState = samplingResult.traceState ?? traceState; - const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE; - const spanContext = { - traceId, - spanId, - traceFlags, - traceState - }; - if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { - api.diag.debug("Recording is off, propagating context in a non-recording span"); - return api.trace.wrapSpanContext(spanContext); - } - const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); - return new Span_1.SpanImpl({ - resource: this._resource, - scope: this.instrumentationScope, - context: context$1, - spanContext, - name, - kind: spanKind, - links, - parentSpanContext: validParentSpanContext, - attributes: initAttributes, - startTime: options.startTime, - spanProcessor: this._spanProcessor, - spanLimits: this._spanLimits, - recordEndMetrics - }); - } - startActiveSpan(name, arg2, arg3, arg4) { - let opts; - let ctx; - let fn; - if (arguments.length < 2) return; - else if (arguments.length === 2) fn = arg2; - else if (arguments.length === 3) { - opts = arg2; - fn = arg3; - } else { - opts = arg2; - ctx = arg3; - fn = arg4; - } - const parentContext = ctx ?? api.context.active(); - const span = this.startSpan(name, opts, parentContext); - const contextWithSpanSet = api.trace.setSpan(parentContext, span); - return api.context.with(contextWithSpanSet, fn, void 0, span); - } - /** Returns the active {@link GeneralLimits}. */ - getGeneralLimits() { - return this._generalLimits; - } - /** Returns the active {@link SpanLimits}. */ - getSpanLimits() { - return this._spanLimits; - } + generateSpanId = getIdGenerator(SPAN_ID_BYTES); }; - exports.Tracer = Tracer; + exports.RandomIdGenerator = RandomIdGenerator; + const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); + function getIdGenerator(bytes) { + return function generateId() { + for (let i = 0; i < bytes / 4; i++) SHARED_BUFFER.writeUInt32BE(Math.random() * 2 ** 32 >>> 0, i * 4); + for (let i = 0; i < bytes; i++) if (SHARED_BUFFER[i] > 0) break; + else if (i === bytes - 1) SHARED_BUFFER[bytes - 1] = 1; + return SHARED_BUFFER.toString("hex", 0, bytes); + }; + } })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/MultiSpanProcessor.js -var require_MultiSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/platform/node/index.js +var require_node = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.MultiSpanProcessor = void 0; - const core_1 = require_src$9(); - /** - * Implementation of the {@link SpanProcessor} that simply forwards all - * received events to a list of {@link SpanProcessor}s. - */ - var MultiSpanProcessor = class { - _spanProcessors; - constructor(spanProcessors) { - this._spanProcessors = spanProcessors; - } - forceFlush() { - const promises = []; - for (const spanProcessor of this._spanProcessors) promises.push(spanProcessor.forceFlush()); - return new Promise((resolve) => { - Promise.all(promises).then(() => { - resolve(); - }).catch((error) => { - (0, core_1.globalErrorHandler)(error || /* @__PURE__ */ new Error("MultiSpanProcessor: forceFlush failed")); - resolve(); - }); - }); - } - onStart(span, context$1) { - for (const spanProcessor of this._spanProcessors) spanProcessor.onStart(span, context$1); + exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; + var BatchSpanProcessor_1 = require_BatchSpanProcessor(); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return BatchSpanProcessor_1.BatchSpanProcessor; } - onEnding(span) { - for (const spanProcessor of this._spanProcessors) if (spanProcessor.onEnding) spanProcessor.onEnding(span); + }); + var RandomIdGenerator_1 = require_RandomIdGenerator(); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return RandomIdGenerator_1.RandomIdGenerator; } - onEnd(span) { - for (const spanProcessor of this._spanProcessors) spanProcessor.onEnd(span); + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/platform/index.js +var require_platform = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; + var node_1 = require_node(); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return node_1.BatchSpanProcessor; } - shutdown() { - const promises = []; - for (const spanProcessor of this._spanProcessors) promises.push(spanProcessor.shutdown()); - return new Promise((resolve, reject) => { - Promise.all(promises).then(() => { - resolve(); - }, reject); - }); + }); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return node_1.RandomIdGenerator; } - }; - exports.MultiSpanProcessor = MultiSpanProcessor; + }); })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider.js -var require_BasicTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/TracerProvider.js +var require_TracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.BasicTracerProvider = exports.ForceFlushState = void 0; - const core_1 = require_src$9(); - const resources_1 = require_src$3(); + exports.TracerProvider = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const resources_1 = require_src$6(); const Tracer_1 = require_Tracer(); - const config_1 = require_config(); const MultiSpanProcessor_1 = require_MultiSpanProcessor(); - const utility_1 = require_utility(); + const ParentBasedSampler_1 = require_ParentBasedSampler(); + const AlwaysOnSampler_1 = require_AlwaysOnSampler(); + const platform_1 = require_platform(); + const inspect_1 = require_inspect(); var ForceFlushState; (function(ForceFlushState) { ForceFlushState[ForceFlushState["resolved"] = 0] = "resolved"; ForceFlushState[ForceFlushState["timeout"] = 1] = "timeout"; ForceFlushState[ForceFlushState["error"] = 2] = "error"; ForceFlushState[ForceFlushState["unresolved"] = 3] = "unresolved"; - })(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); + })(ForceFlushState || (ForceFlushState = {})); /** * This class represents a basic tracer provider which platform libraries can extend */ - var BasicTracerProvider = class { - _config; - _tracers = /* @__PURE__ */ new Map(); + var TracerProvider = class { _resource; _activeSpanProcessor; - constructor(config$1 = {}) { - const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config$1)); - this._resource = mergedConfig.resource ?? (0, resources_1.defaultResource)(); - this._config = Object.assign({}, mergedConfig, { resource: this._resource }); - const spanProcessors = []; - if (config$1.spanProcessors?.length) spanProcessors.push(...config$1.spanProcessors); + _forceFlushTimeoutMillis; + _tracerOptions; + _tracers = /* @__PURE__ */ new Map(); + constructor(options = {}) { + this._forceFlushTimeoutMillis = options.forceFlushTimeoutMillis ?? 3e4; + this._resource = options.resource ?? (0, resources_1.defaultResource)(); + const spanProcessors = options.spanProcessors ?? []; this._activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(spanProcessors); + this._tracerOptions = { + resource: this._resource, + sampler: options.sampler ?? new ParentBasedSampler_1.ParentBasedSampler({ root: new AlwaysOnSampler_1.AlwaysOnSampler() }), + spanLimits: { + attributeCountLimit: options.spanLimits?.attributeCountLimit ?? 128, + attributeValueLengthLimit: options.spanLimits?.attributeValueLengthLimit ?? Infinity, + eventCountLimit: options.spanLimits?.eventCountLimit ?? 128, + linkCountLimit: options.spanLimits?.linkCountLimit ?? 128, + attributePerEventCountLimit: options.spanLimits?.attributePerEventCountLimit ?? 128, + attributePerLinkCountLimit: options.spanLimits?.attributePerLinkCountLimit ?? 128 + }, + idGenerator: options.idGenerator || new platform_1.RandomIdGenerator(), + spanProcessor: this._activeSpanProcessor, + meterProvider: options.meterProvider ?? { getMeter() { + return (0, api_1.createNoopMeter)(); + } } + }; } - getTracer(name, version$1, options) { - const key = `${name}@${version$1 || ""}:${options?.schemaUrl || ""}`; + getTracer(name, version, options) { + const key = `${name}@${version || ""}:${options?.schemaUrl || ""}`; if (!this._tracers.has(key)) this._tracers.set(key, new Tracer_1.Tracer({ name, - version: version$1, + version, schemaUrl: options?.schemaUrl - }, this._config, this._resource, this._activeSpanProcessor)); + }, this._tracerOptions)); return this._tracers.get(key); } forceFlush() { - const timeout = this._config.forceFlushTimeoutMillis; + const timeout = this._forceFlushTimeoutMillis; const promises = this._activeSpanProcessor["_spanProcessors"].map((spanProcessor) => { return new Promise((resolve) => { let state; @@ -44889,16 +29144,25 @@ var require_BasicTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { shutdown() { return this._activeSpanProcessor.shutdown(); } + [inspect_1.inspectCustom](depth, options, inspect) { + const processors = this._activeSpanProcessor["_spanProcessors"]; + const payload = { + resource: { attributes: (0, inspect_1.settledResourceAttributes)(this._resource) }, + tracers: Array.from(this._tracers.keys()), + spanProcessors: processors.map((p) => p.constructor?.name ?? "SpanProcessor") + }; + return (0, inspect_1.formatInspect)("TracerProvider", payload, depth, options, inspect); + } }; - exports.BasicTracerProvider = BasicTracerProvider; + exports.TracerProvider = TracerProvider; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/ConsoleSpanExporter.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/export/ConsoleSpanExporter.js var require_ConsoleSpanExporter = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.ConsoleSpanExporter = void 0; - const core_1 = require_src$9(); + const core_1 = require_src$8(); /** * This is implementation of {@link SpanExporter} that prints spans to the * console. This class can be used for diagnostic purposes. @@ -44963,11 +29227,11 @@ var require_ConsoleSpanExporter = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/InMemorySpanExporter.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/export/InMemorySpanExporter.js var require_InMemorySpanExporter = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.InMemorySpanExporter = void 0; - const core_1 = require_src$9(); + const core_1 = require_src$8(); /** * This class can be used for testing purposes. It stores the exported spans * in a list in memory that can be retrieved using the `getFinishedSpans()` @@ -45010,12 +29274,14 @@ var require_InMemorySpanExporter = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/SimpleSpanProcessor.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/export/SimpleSpanProcessor.js var require_SimpleSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.SimpleSpanProcessor = void 0; const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); + const core_1 = require_src$8(); + const SpanProcessorMetrics_1 = require_SpanProcessorMetrics(); + const semconv_1 = require_semconv(); /** * An implementation of the {@link SpanProcessor} that converts the {@link Span} * to {@link ReadableSpan} and passes it to the configured exporter. @@ -45026,34 +29292,52 @@ var require_SimpleSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { */ var SimpleSpanProcessor = class { _exporter; + _metrics; _shutdownOnce; _pendingExports; - constructor(exporter) { - this._exporter = exporter; + constructor(options) { + this._exporter = options.exporter; this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); this._pendingExports = /* @__PURE__ */ new Set(); + const meter = options.selfObsMeterProvider ? options.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace") : (0, api_1.createNoopMeter)(); + this._metrics = new SpanProcessorMetrics_1.SpanProcessorMetrics(semconv_1.OTEL_COMPONENT_TYPE_VALUE_SIMPLE_SPAN_PROCESSOR, meter); } async forceFlush() { - await Promise.all(Array.from(this._pendingExports)); + let pendingExportError; + let pendingExportRejected = false; + try { + await Promise.all(Array.from(this._pendingExports)); + } catch (err) { + pendingExportError = err; + pendingExportRejected = true; + } if (this._exporter.forceFlush) await this._exporter.forceFlush(); + if (pendingExportRejected) throw pendingExportError; } onStart(_span, _parentContext) {} onEnd(span) { if (this._shutdownOnce.isCalled) return; if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) return; - const pendingExport = this._doExport(span).catch((err) => (0, core_1.globalErrorHandler)(err)); + const pendingExport = this._doExport(span); this._pendingExports.add(pendingExport); - pendingExport.finally(() => this._pendingExports.delete(pendingExport)); + pendingExport.then(() => { + this._pendingExports.delete(pendingExport); + }, (err) => { + (0, core_1.globalErrorHandler)(err); + this._pendingExports.delete(pendingExport); + }); } async _doExport(span) { if (span.resource.asyncAttributesPending) await span.resource.waitForAsyncAttributes?.(); const result = await core_1.internal._export(this._exporter, [span]); + this._metrics.finishSpans(1, result.error); if (result.code !== core_1.ExportResultCode.SUCCESS) throw result.error ?? /* @__PURE__ */ new Error(`SimpleSpanProcessor: span export failed (status ${result})`); } shutdown() { return this._shutdownOnce.call(); } _shutdown() { + this._metrics.shutdown(); return this._exporter.shutdown(); } }; @@ -45061,7 +29345,7 @@ var require_SimpleSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/NoopSpanProcessor.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/export/NoopSpanProcessor.js var require_NoopSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.NoopSpanProcessor = void 0; @@ -45080,15 +29364,87 @@ var require_NoopSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/index.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/sampler/AlwaysRecordSampler.js +var require_AlwaysRecordSampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.createAlwaysRecordSampler = void 0; + const Sampler_1 = require_Sampler(); + /** + * Creates a sampler that wraps a delegate and upgrades NOT_RECORD decisions to + * RECORD, ensuring all spans are recorded without affecting the sampling rate. + */ + function createAlwaysRecordSampler(delegate) { + if (!delegate) throw new Error("createAlwaysRecordSampler requires a delegate sampler"); + return { + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const result = delegate.shouldSample(context, traceId, spanName, spanKind, attributes, links); + if (result.decision === Sampler_1.SamplingDecision.NOT_RECORD) return { + decision: Sampler_1.SamplingDecision.RECORD, + attributes: result.attributes, + traceState: result.traceState + }; + return result; + }, + toString() { + return `AlwaysRecordSampler{${delegate.toString()}}`; + } + }; + } + exports.createAlwaysRecordSampler = createAlwaysRecordSampler; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/sampler/TraceIdRatioBasedSampler.js +var require_TraceIdRatioBasedSampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceIdRatioBasedSampler = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const Sampler_1 = require_Sampler(); + /** Sampler that samples a given fraction of traces based of trace id deterministically. */ + var TraceIdRatioBasedSampler = class { + _ratio; + _upperBound; + constructor(ratio = 0) { + this._ratio = this._normalize(ratio); + this._upperBound = this._ratio === 1 ? 4294967296 : Math.floor(this._ratio * 4294967295); + } + shouldSample(context, traceId) { + return { decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED : Sampler_1.SamplingDecision.NOT_RECORD }; + } + toString() { + return `TraceIdRatioBased{${this._ratio}}`; + } + _normalize(ratio) { + if (typeof ratio !== "number" || isNaN(ratio)) return 0; + return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; + } + _accumulate(traceId) { + let accumulation = 0; + for (let i = 0; i < 32; i += 8) { + let part = 0; + for (let j = 0; j < 8; j++) { + const c = traceId.charCodeAt(i + j); + const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87; + part = part << 4 | v; + } + accumulation = (accumulation ^ part) >>> 0; + } + return accumulation; + } + }; + exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/src/index.js var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); - exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.BasicTracerProvider = void 0; - var BasicTracerProvider_1 = require_BasicTracerProvider(); - Object.defineProperty(exports, "BasicTracerProvider", { + exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.createAlwaysRecordSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.TracerProvider = void 0; + var TracerProvider_1 = require_TracerProvider(); + Object.defineProperty(exports, "TracerProvider", { enumerable: true, get: function() { - return BasicTracerProvider_1.BasicTracerProvider; + return TracerProvider_1.TracerProvider; } }); var platform_1 = require_platform(); @@ -45146,6 +29502,13 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports) => { return AlwaysOnSampler_1.AlwaysOnSampler; } }); + var AlwaysRecordSampler_1 = require_AlwaysRecordSampler(); + Object.defineProperty(exports, "createAlwaysRecordSampler", { + enumerable: true, + get: function() { + return AlwaysRecordSampler_1.createAlwaysRecordSampler; + } + }); var ParentBasedSampler_1 = require_ParentBasedSampler(); Object.defineProperty(exports, "ParentBasedSampler", { enumerable: true, @@ -45170,10 +29533,271 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@langfuse+otel@5.4.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.7.1_@opentelemetry+api@1._ekes344w3htofsunm64fqkhuni/node_modules/@langfuse/otel/dist/index.mjs -var import_src$1 = require_src$9(); -var import_src$2 = require_src$4(); -var import_src$3 = require_src$2(); +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/config.js +var require_config = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$8(); + const sdk_trace_1 = require_src$2(); + var TracesSamplerValues; + (function(TracesSamplerValues) { + TracesSamplerValues["AlwaysOff"] = "always_off"; + TracesSamplerValues["AlwaysOn"] = "always_on"; + TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; + TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; + TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; + TracesSamplerValues["TraceIdRatio"] = "traceidratio"; + })(TracesSamplerValues || (TracesSamplerValues = {})); + const DEFAULT_RATIO = 1; + /** + * Load default configuration. For fields with primitive values, any user-provided + * value will override the corresponding default value. For fields with + * non-primitive values (like `spanLimits`), the user-provided value will be + * used to extend the default value. + */ + function loadDefaultConfig() { + return { + sampler: buildSamplerFromEnv(), + forceFlushTimeoutMillis: 3e4, + generalLimits: { + attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, + attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? 128 + }, + spanLimits: { + attributeValueLengthLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity, + attributeCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? 128, + linkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT") ?? 128, + eventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT") ?? 128, + attributePerEventCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT") ?? 128, + attributePerLinkCountLimit: (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT") ?? 128 + } + }; + } + exports.loadDefaultConfig = loadDefaultConfig; + /** + * Based on environment, builds a sampler, complies with specification. + */ + function buildSamplerFromEnv() { + const sampler = (0, core_1.getStringFromEnv)("OTEL_TRACES_SAMPLER") ?? TracesSamplerValues.ParentBasedAlwaysOn; + switch (sampler) { + case TracesSamplerValues.AlwaysOn: return new sdk_trace_1.AlwaysOnSampler(); + case TracesSamplerValues.AlwaysOff: return new sdk_trace_1.AlwaysOffSampler(); + case TracesSamplerValues.ParentBasedAlwaysOn: return new sdk_trace_1.ParentBasedSampler({ root: new sdk_trace_1.AlwaysOnSampler() }); + case TracesSamplerValues.ParentBasedAlwaysOff: return new sdk_trace_1.ParentBasedSampler({ root: new sdk_trace_1.AlwaysOffSampler() }); + case TracesSamplerValues.TraceIdRatio: return new sdk_trace_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()); + case TracesSamplerValues.ParentBasedTraceIdRatio: return new sdk_trace_1.ParentBasedSampler({ root: new sdk_trace_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()) }); + default: + api_1.diag.error(`OTEL_TRACES_SAMPLER value "${sampler}" invalid, defaulting to "${TracesSamplerValues.ParentBasedAlwaysOn}".`); + return new sdk_trace_1.ParentBasedSampler({ root: new sdk_trace_1.AlwaysOnSampler() }); + } + } + exports.buildSamplerFromEnv = buildSamplerFromEnv; + function getSamplerProbabilityFromEnv() { + const probability = (0, core_1.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG"); + if (probability == null) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + if (probability < 0 || probability > 1) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + return probability; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/utility.js +var require_utility = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.reconfigureLimits = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = void 0; + const core_1 = require_src$8(); + exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; + exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; + /** + * When general limits are provided and model specific limits are not, + * configures the model specific limits by using the values from the general ones. + * @param userConfig User provided tracer configuration + */ + function reconfigureLimits(userConfig) { + const spanLimits = Object.assign({}, userConfig.spanLimits); + /** + * Reassign span attribute count limit to use first non null value defined by user or use default value + */ + spanLimits.attributeCountLimit = userConfig.spanLimits?.attributeCountLimit ?? userConfig.generalLimits?.attributeCountLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT; + /** + * Reassign span attribute value length limit to use first non null value defined by user or use default value + */ + spanLimits.attributeValueLengthLimit = userConfig.spanLimits?.attributeValueLengthLimit ?? userConfig.generalLimits?.attributeValueLengthLimit ?? (0, core_1.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? (0, core_1.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; + return Object.assign({}, userConfig, { spanLimits }); + } + exports.reconfigureLimits = reconfigureLimits; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider-shim.js +var require_BasicTracerProvider_shim = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BasicTracerProvider = void 0; + const core_1 = require_src$8(); + const config_1 = require_config(); + const utility_1 = require_utility(); + const sdk_trace_1 = require_src$2(); + /** + * A TracerProvider implementation that reads configuration defaults from + * OTEL_* environment variables per + * https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ + */ + var BasicTracerProvider = class extends sdk_trace_1.TracerProvider { + constructor(config = {}) { + const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config)); + delete mergedConfig.generalLimits; + super(mergedConfig); + } + }; + exports.BasicTracerProvider = BasicTracerProvider; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/BatchSpanProcessor-shim.js +var require_BatchSpanProcessor_shim = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BatchSpanProcessor = void 0; + const core_1 = require_src$8(); + const sdk_trace_1 = require_src$2(); + /** + * A BatchSpanProcessor that applies `OTEL_*` environment variable fallbacks per + * https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ + */ + var BatchSpanProcessor = class extends sdk_trace_1.BatchSpanProcessor { + constructor(exporter, config) { + if (!config) config = {}; + for (const [configName, envName] of [ + ["maxExportBatchSize", "OTEL_BSP_MAX_EXPORT_BATCH_SIZE"], + ["maxQueueSize", "OTEL_BSP_MAX_QUEUE_SIZE"], + ["scheduledDelayMillis", "OTEL_BSP_SCHEDULE_DELAY"], + ["exportTimeoutMillis", "OTEL_BSP_EXPORT_TIMEOUT"] + ]) if (config[configName] === void 0) { + const envFallback = (0, core_1.getNumberFromEnv)(envName); + if (envFallback !== void 0) config[configName] = envFallback; + } + super({ + exporter, + ...config + }); + } + }; + exports.BatchSpanProcessor = BatchSpanProcessor; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/SimpleSpanProcessor-shim.js +var require_SimpleSpanProcessor_shim = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SimpleSpanProcessor = void 0; + const sdk_trace_1 = require_src$2(); + /** + * A SimpleSpanProcessor with the old constructor call signature that + * takes just a single exporter argument. This version does not support + * the additional options that the SimpleSpanProcessor in sdk-trace does. + */ + var SimpleSpanProcessor = class extends sdk_trace_1.SimpleSpanProcessor { + constructor(exporter) { + super({ exporter }); + } + }; + exports.SimpleSpanProcessor = SimpleSpanProcessor; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/index-shim.js +var require_index_shim = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.InMemorySpanExporter = exports.RandomIdGenerator = exports.ConsoleSpanExporter = exports.SimpleSpanProcessor = exports.BatchSpanProcessor = exports.BasicTracerProvider = void 0; + var BasicTracerProvider_shim_1 = require_BasicTracerProvider_shim(); + Object.defineProperty(exports, "BasicTracerProvider", { + enumerable: true, + get: function() { + return BasicTracerProvider_shim_1.BasicTracerProvider; + } + }); + var BatchSpanProcessor_shim_1 = require_BatchSpanProcessor_shim(); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return BatchSpanProcessor_shim_1.BatchSpanProcessor; + } + }); + var SimpleSpanProcessor_shim_1 = require_SimpleSpanProcessor_shim(); + Object.defineProperty(exports, "SimpleSpanProcessor", { + enumerable: true, + get: function() { + return SimpleSpanProcessor_shim_1.SimpleSpanProcessor; + } + }); + var sdk_trace_1 = require_src$2(); + Object.defineProperty(exports, "ConsoleSpanExporter", { + enumerable: true, + get: function() { + return sdk_trace_1.ConsoleSpanExporter; + } + }); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return sdk_trace_1.RandomIdGenerator; + } + }); + Object.defineProperty(exports, "InMemorySpanExporter", { + enumerable: true, + get: function() { + return sdk_trace_1.InMemorySpanExporter; + } + }); + Object.defineProperty(exports, "NoopSpanProcessor", { + enumerable: true, + get: function() { + return sdk_trace_1.NoopSpanProcessor; + } + }); + Object.defineProperty(exports, "AlwaysOffSampler", { + enumerable: true, + get: function() { + return sdk_trace_1.AlwaysOffSampler; + } + }); + Object.defineProperty(exports, "AlwaysOnSampler", { + enumerable: true, + get: function() { + return sdk_trace_1.AlwaysOnSampler; + } + }); + Object.defineProperty(exports, "ParentBasedSampler", { + enumerable: true, + get: function() { + return sdk_trace_1.ParentBasedSampler; + } + }); + Object.defineProperty(exports, "TraceIdRatioBasedSampler", { + enumerable: true, + get: function() { + return sdk_trace_1.TraceIdRatioBasedSampler; + } + }); + Object.defineProperty(exports, "SamplingDecision", { + enumerable: true, + get: function() { + return sdk_trace_1.SamplingDecision; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@langfuse+otel@5.4.1_@opentelemetry+api@1.9.1_@opentelemetry+core@2.10.0_@opentelemetry+api@1_rdxguxaswzcnxq2vsrqtnwr2qu/node_modules/@langfuse/otel/dist/index.mjs +var import_src$1 = require_src$8(); +var import_src$2 = require_src$3(); +var import_index_shim = require_index_shim(); var MediaService = class { constructor(params) { this.pendingMediaUploads = /* @__PURE__ */ new Set(); @@ -45186,7 +29810,7 @@ var MediaService = class { await Promise.all(Array.from(this.pendingMediaUploads)); } async process(span) { - var _a$3; + var _a; const mediaAttributes = [ LangfuseOtelSpanAttributes.OBSERVATION_INPUT, LangfuseOtelSpanAttributes.TRACE_INPUT, @@ -45204,7 +29828,7 @@ var MediaService = class { continue; } let mediaReplacedValue = value; - const foundMedia = [...new Set((_a$3 = value.match(/data:[^;]+;base64,[A-Za-z0-9+/]+=*/g)) != null ? _a$3 : [])]; + const foundMedia = [...new Set((_a = value.match(/data:[^;]+;base64,[A-Za-z0-9+/]+=*/g)) != null ? _a : [])]; if (foundMedia.length === 0) continue; for (const mediaDataUri of foundMedia) { const media = new LangfuseMedia({ @@ -45418,9 +30042,9 @@ var LangfuseSpanProcessor = class { constructor(params) { this.pendingEndedSpans = /* @__PURE__ */ new Set(); this.spanExportExpectationById = /* @__PURE__ */ new Map(); - var _a$3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m; + var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m; const logger = getGlobalLogger(); - const publicKey = (_a$3 = params == null ? void 0 : params.publicKey) != null ? _a$3 : getEnv("LANGFUSE_PUBLIC_KEY"); + const publicKey = (_a = params == null ? void 0 : params.publicKey) != null ? _a : getEnv("LANGFUSE_PUBLIC_KEY"); const secretKey = (_b = params == null ? void 0 : params.secretKey) != null ? _b : getEnv("LANGFUSE_SECRET_KEY"); const baseUrl = (_e = (_d = (_c = params == null ? void 0 : params.baseUrl) != null ? _c : getEnv("LANGFUSE_BASE_URL")) != null ? _d : getEnv("LANGFUSE_BASEURL")) != null ? _e : "https://cloud.langfuse.com"; if (!(params == null ? void 0 : params.exporter) && !publicKey) logger.warn("No exporter configured and no public key provided in constructor or as LANGFUSE_PUBLIC_KEY env var. Span exports will fail."); @@ -45440,7 +30064,7 @@ var LangfuseSpanProcessor = class { }, timeoutMillis: timeoutSeconds * 1e3 }); - this.processor = (params == null ? void 0 : params.exportMode) === "immediate" ? new import_src$3.SimpleSpanProcessor(exporter) : new import_src$3.BatchSpanProcessor(exporter, { + this.processor = (params == null ? void 0 : params.exportMode) === "immediate" ? new import_index_shim.SimpleSpanProcessor(exporter) : new import_index_shim.BatchSpanProcessor(exporter, { maxExportBatchSize: flushAt ? Number(flushAt) : void 0, scheduledDelayMillis: flushIntervalSeconds ? Number(flushIntervalSeconds) * 1e3 : void 0 }); @@ -45545,7 +30169,7 @@ var LangfuseSpanProcessor = class { return this.processor.shutdown(); } async processEndedSpan(span) { - var _a$3, _b; + var _a, _b; try { if (this.shouldExportSpan({ otelSpan: span }) === false) { this.logger.debug("Dropped span due to shouldExportSpan filter.", { @@ -45568,7 +30192,7 @@ ${JSON.stringify({ name: span.name, traceId: span.spanContext().traceId, spanId: span.spanContext().spanId, - parentSpanId: (_b = (_a$3 = span.parentSpanContext) == null ? void 0 : _a$3.spanId) != null ? _b : null, + parentSpanId: (_b = (_a = span.parentSpanContext) == null ? void 0 : _a.spanId) != null ? _b : null, attributes: span.attributes, startTime: new Date((0, import_src$1.hrTimeToMilliseconds)(span.startTime)), endTime: new Date((0, import_src$1.hrTimeToMilliseconds)(span.endTime)), @@ -45581,10 +30205,10 @@ ${JSON.stringify({ this.processor.onEnd(span); } markAppRootCandidate(span, parentContext) { - var _a$3; + var _a; const traceId = span.spanContext().traceId; const spanId = span.spanContext().spanId; - const parentSpanId = (_a$3 = span.parentSpanContext) == null ? void 0 : _a$3.spanId; + const parentSpanId = (_a = span.parentSpanContext) == null ? void 0 : _a.spanId; const expectedExportedAtStart = this.isExpectedExportedAtStart(span); const propagatedClaim = getLangfuseTraceIdFromBaggage(parentContext); const isParentExpectedExported = parentSpanId !== void 0 ? this.spanExportExpectationById.get(parentSpanId) === true : false; @@ -45627,7 +30251,7 @@ ${JSON.stringify({ }; //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js +//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js var require_AbstractAsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AbstractAsyncHooksContextManager = void 0; @@ -45646,15 +30270,15 @@ var require_AbstractAsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((e * @param target a function or event emitter. When target or one of its callbacks is called, * the provided context will be used as the active context for the duration of the call. */ - bind(context$1, target) { - if (target instanceof events_1.EventEmitter) return this._bindEventEmitter(context$1, target); - if (typeof target === "function") return this._bindFunction(context$1, target); + bind(context, target) { + if (target instanceof events_1.EventEmitter) return this._bindEventEmitter(context, target); + if (typeof target === "function") return this._bindFunction(context, target); return target; } - _bindFunction(context$1, target) { + _bindFunction(context, target) { const manager = this; const contextWrapper = function(...args) { - return manager.with(context$1, () => target.apply(this, args)); + return manager.with(context, () => target.apply(this, args)); }; Object.defineProperty(contextWrapper, "length", { enumerable: false, @@ -45675,12 +30299,12 @@ var require_AbstractAsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((e * @param context the context we want to bind * @param ee EventEmitter an instance of EventEmitter to patch */ - _bindEventEmitter(context$1, ee) { + _bindEventEmitter(context, ee) { if (this._getPatchMap(ee) !== void 0) return ee; this._createPatchMap(ee); ADD_LISTENER_METHODS.forEach((methodName) => { if (ee[methodName] === void 0) return; - ee[methodName] = this._patchAddListener(ee, ee[methodName], context$1); + ee[methodName] = this._patchAddListener(ee, ee[methodName], context); }); if (typeof ee.removeListener === "function") ee.removeListener = this._patchRemoveListener(ee, ee.removeListener); if (typeof ee.off === "function") ee.off = this._patchRemoveListener(ee, ee.off); @@ -45726,7 +30350,7 @@ var require_AbstractAsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((e * @param original reference to the patched method * @param [context] context to propagate when calling listeners */ - _patchAddListener(ee, original, context$1) { + _patchAddListener(ee, original, context) { const contextManager = this; return function(event, listener) { /** @@ -45745,7 +30369,7 @@ var require_AbstractAsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((e listeners = /* @__PURE__ */ new WeakMap(); map[event] = listeners; } - const patchedListener = contextManager.bind(context$1, listener); + const patchedListener = contextManager.bind(context, listener); listeners.set(listener, patchedListener); /** * See comment at the start of this function for the explanation of this property. @@ -45773,7 +30397,7 @@ var require_AbstractAsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((e })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncHooksContextManager.js +//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncHooksContextManager.js var require_AsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AsyncHooksContextManager = void 0; @@ -45800,8 +30424,8 @@ var require_AsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) active() { return this._stack[this._stack.length - 1] ?? api_1.ROOT_CONTEXT; } - with(context$1, fn, thisArg, ...args) { - this._enterContext(context$1); + with(context, fn, thisArg, ...args) { + this._enterContext(context); try { return fn.call(thisArg, ...args); } finally { @@ -45826,8 +30450,8 @@ var require_AsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) */ _init(uid, type) { if (type === "TIMERWRAP") return; - const context$1 = this._stack[this._stack.length - 1]; - if (context$1 !== void 0) this._contexts.set(uid, context$1); + const context = this._stack[this._stack.length - 1]; + if (context !== void 0) this._contexts.set(uid, context); } /** * Destroy hook will be called when a given context is no longer used so we can @@ -45842,8 +30466,8 @@ var require_AsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) * @param uid uid of the async context */ _before(uid) { - const context$1 = this._contexts.get(uid); - if (context$1 !== void 0) this._enterContext(context$1); + const context = this._contexts.get(uid); + if (context !== void 0) this._enterContext(context); } /** * After hook is called just after completing the execution of a async context. @@ -45854,8 +30478,8 @@ var require_AsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) /** * Set the given context as active */ - _enterContext(context$1) { - this._stack.push(context$1); + _enterContext(context) { + this._stack.push(context); } /** * Remove the context at the root of the stack @@ -45868,7 +30492,7 @@ var require_AsyncHooksContextManager = /* @__PURE__ */ __commonJSMin(((exports) })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js +//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js var require_AsyncLocalStorageContextManager = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AsyncLocalStorageContextManager = void 0; @@ -45884,9 +30508,9 @@ var require_AsyncLocalStorageContextManager = /* @__PURE__ */ __commonJSMin(((ex active() { return this._asyncLocalStorage.getStore() ?? api_1.ROOT_CONTEXT; } - with(context$1, fn, thisArg, ...args) { + with(context, fn, thisArg, ...args) { const cb = thisArg == null ? fn : fn.bind(thisArg); - return this._asyncLocalStorage.run(context$1, cb, ...args); + return this._asyncLocalStorage.run(context, cb, ...args); } enable() { return this; @@ -45900,7 +30524,7 @@ var require_AsyncLocalStorageContextManager = /* @__PURE__ */ __commonJSMin(((ex })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/index.js +//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/context-async-hooks/build/src/index.js var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.AsyncLocalStorageContextManager = exports.AsyncHooksContextManager = void 0; @@ -45921,14 +30545,14 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports) => { })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-node/build/src/NodeTracerProvider.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-node/build/src/NodeTracerProvider.js var require_NodeTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeTracerProvider = void 0; const context_async_hooks_1 = require_src$1(); - const sdk_trace_base_1 = require_src$2(); + const sdk_trace_base_1 = require_index_shim(); const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); - const core_1 = require_src$9(); + const core_1 = require_src$8(); function setupContextManager(contextManager) { if (contextManager === null) return; if (contextManager === void 0) { @@ -45956,8 +30580,8 @@ var require_NodeTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { * @param config Configuration object for SDK registration */ var NodeTracerProvider = class extends sdk_trace_base_1.BasicTracerProvider { - constructor(config$1 = {}) { - super(config$1); + constructor(config = {}) { + super(config); } /** * Register this TracerProvider for use with the OpenTelemetry API. @@ -45966,17 +30590,17 @@ var require_NodeTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { * * @param config Configuration object for SDK registration */ - register(config$1 = {}) { + register(config = {}) { api_1.trace.setGlobalTracerProvider(this); - setupContextManager(config$1.contextManager); - setupPropagator(config$1.propagator); + setupContextManager(config.contextManager); + setupPropagator(config.propagator); } }; exports.NodeTracerProvider = NodeTracerProvider; })); //#endregion -//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-node/build/src/index.js +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-node/build/src/index.js var require_src = /* @__PURE__ */ __commonJSMin(((exports) => { Object.defineProperty(exports, "__esModule", { value: true }); exports.TraceIdRatioBasedSampler = exports.SimpleSpanProcessor = exports.SamplingDecision = exports.RandomIdGenerator = exports.ParentBasedSampler = exports.NoopSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.BatchSpanProcessor = exports.BasicTracerProvider = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NodeTracerProvider = void 0; @@ -45987,7 +30611,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => { return NodeTracerProvider_1.NodeTracerProvider; } }); - var sdk_trace_base_1 = require_src$2(); + var sdk_trace_base_1 = require_index_shim(); Object.defineProperty(exports, "AlwaysOffSampler", { enumerable: true, get: function() { @@ -46078,12 +30702,12 @@ var import_src = require_src(); * is far faster than one request per span — important for the hook's timeout * budget. `shutdown()` below calls `forceFlush()` before the process exits. */ -function setupInstrumentation(config$1) { +function setupInstrumentation(config) { const spanProcessor = new LangfuseSpanProcessor({ - publicKey: config$1.public_key, - secretKey: config$1.secret_key, - baseUrl: config$1.base_url, - environment: config$1.environment, + publicKey: config.public_key, + secretKey: config.secret_key, + baseUrl: config.base_url, + environment: config.environment, exportMode: "batched", shouldExportSpan: () => true }); @@ -46106,12 +30730,12 @@ function createTraceAttributes({ input, output } = {}) { return Object.fromEntries(Object.entries(attributes).filter(([_, v]) => v != null)); } function createObservationAttributes(type, attributes) { - const { metadata, input, output, level, statusMessage, version: version$1, completionStartTime, model, modelParameters, usageDetails, costDetails, prompt } = attributes; + const { metadata, input, output, level, statusMessage, version, completionStartTime, model, modelParameters, usageDetails, costDetails, prompt } = attributes; let otelAttributes = { [LangfuseOtelSpanAttributes.OBSERVATION_TYPE]: type, [LangfuseOtelSpanAttributes.OBSERVATION_LEVEL]: level, [LangfuseOtelSpanAttributes.OBSERVATION_STATUS_MESSAGE]: statusMessage, - [LangfuseOtelSpanAttributes.VERSION]: version$1, + [LangfuseOtelSpanAttributes.VERSION]: version, [LangfuseOtelSpanAttributes.OBSERVATION_INPUT]: _serialize(input), [LangfuseOtelSpanAttributes.OBSERVATION_OUTPUT]: _serialize(output), [LangfuseOtelSpanAttributes.OBSERVATION_MODEL]: model, @@ -46491,7 +31115,7 @@ function createParentContext(parentSpanContext) { return trace.setSpanContext(context.active(), parentSpanContext); } function startObservation(name, attributes, options) { - var _a$3; + var _a; const { asType = "span", ...observationOptions } = options || {}; const otelSpan = createOtelSpan({ name, @@ -46533,9 +31157,8 @@ function startObservation(name, attributes, options) { case "event": return new LangfuseEvent({ otelSpan, attributes, - timestamp: (_a$3 = observationOptions == null ? void 0 : observationOptions.startTime) != null ? _a$3 : /* @__PURE__ */ new Date() + timestamp: (_a = observationOptions == null ? void 0 : observationOptions.startTime) != null ? _a : /* @__PURE__ */ new Date() }); - case "span": default: return new LangfuseSpan({ otelSpan, attributes @@ -46548,10 +31171,10 @@ async function createTraceId(seed) { const hashBuffer = await crypto.subtle.digest("SHA-256", data); return uint8ArrayToHex(new Uint8Array(hashBuffer)).slice(0, 32); } - return uint8ArrayToHex(crypto.getRandomValues(new Uint8Array(16))); + return uint8ArrayToHex(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16))); } -function uint8ArrayToHex(array$1) { - return Array.from(array$1).map((b) => b.toString(16).padStart(2, "0")).join(""); +function uint8ArrayToHex(array) { + return Array.from(array).map((b) => b.toString(16).padStart(2, "0")).join(""); } //#endregion @@ -46900,7 +31523,7 @@ function parseSession(lines) { */ async function loadUploadedTurnIds(rolloutFile) { try { - const data = await fs.readFile(`${rolloutFile}.langfuse`, "utf-8"); + const data = await fs$1.readFile(`${rolloutFile}.langfuse`, "utf-8"); return new Set(data.split("\n").filter(Boolean)); } catch (error) { if (error.code === "ENOENT") return /* @__PURE__ */ new Set(); @@ -46909,7 +31532,7 @@ async function loadUploadedTurnIds(rolloutFile) { } async function markTurnUploaded(rolloutFile, turnId) { try { - await fs.appendFile(`${rolloutFile}.langfuse`, `${turnId}\n`, "utf-8"); + await fs$1.appendFile(`${rolloutFile}.langfuse`, `${turnId}\n`, "utf-8"); } catch {} } @@ -46917,7 +31540,7 @@ async function markTurnUploaded(rolloutFile, turnId) { //#region src/trace.ts init_esm$2(); async function loadSession(file) { - const data = await fs.readFile(file, "utf-8"); + const data = await fs$1.readFile(file, "utf-8"); const lines = []; for (const raw of data.split("\n")) { const trimmed = raw.trim(); @@ -46937,16 +31560,16 @@ async function loadSession(file) { */ async function findSubagentRollout(parentFile, threadId) { const suffix = `-${threadId}.jsonl`; - const root = path.resolve(path.dirname(parentFile), "../../.."); + const root = path$1.resolve(path$1.dirname(parentFile), "../../.."); async function walk(dir) { let entries; try { - entries = await fs.readdir(dir, { withFileTypes: true }); + entries = await fs$1.readdir(dir, { withFileTypes: true }); } catch { return; } for (const entry of entries) { - const full = path.join(dir, entry.name); + const full = path$1.join(dir, entry.name); if (entry.isDirectory()) { const found = await walk(full); if (found) return found; @@ -46973,18 +31596,19 @@ const SEED_PARENT_SPAN_ID = "0123456789abcdef"; * thread exists. Returns `undefined` (auto-generated ids) when no seed is set * or derivation fails — the hook must never block an upload. */ -async function seededTraceParent(config$1, sessionMeta, turnNumber) { - if (!config$1.trace_seed) return void 0; +async function seededTraceParent(config, sessionMeta, turnNumber) { + if (!config.trace_seed) return void 0; try { + const seed = sessionMeta.isSubagentThread ? `${config.trace_seed}:${sessionMeta.sessionId}:${turnNumber}` : `${config.trace_seed}:${turnNumber}`; return { - traceId: await createTraceId(sessionMeta.isSubagentThread ? `${config$1.trace_seed}:${sessionMeta.sessionId}:${turnNumber}` : `${config$1.trace_seed}:${turnNumber}`), + traceId: await createTraceId(seed), spanId: SEED_PARENT_SPAN_ID, traceFlags: TraceFlags.SAMPLED, isRemote: true }; } catch (error) { debugLog("failed to derive seeded trace id; falling back to auto-generated:", error); - if (config$1.fail_on_error) throw error; + if (config.fail_on_error) throw error; return; } } @@ -46994,12 +31618,12 @@ function isTokenCount(value) { /** Send Codex's inclusive counts using Langfuse's strict OpenAI usage schema. */ function toUsageDetails(usage) { if (!usage) return void 0; - const { input_tokens: input, output_tokens: output, total_tokens: total, cached_input_tokens: cached$1, reasoning_output_tokens: reasoning } = usage; + const { input_tokens: input, output_tokens: output, total_tokens: total, cached_input_tokens: cached, reasoning_output_tokens: reasoning } = usage; if (!isTokenCount(input) || !isTokenCount(output) || !isTokenCount(total) || total !== input + output) { debugLog("dropping usage: missing or inconsistent token counts", usage); return; } - if (cached$1 !== void 0 && (!isTokenCount(cached$1) || cached$1 > input) || reasoning !== void 0 && (!isTokenCount(reasoning) || reasoning > output)) { + if (cached !== void 0 && (!isTokenCount(cached) || cached > input) || reasoning !== void 0 && (!isTokenCount(reasoning) || reasoning > output)) { debugLog("dropping usage: implausible cached/reasoning details", usage); return; } @@ -47007,7 +31631,7 @@ function toUsageDetails(usage) { prompt_tokens: input, completion_tokens: output, total_tokens: total, - ...cached$1 !== void 0 ? { prompt_tokens_details: { cached_tokens: cached$1 } } : {}, + ...cached !== void 0 ? { prompt_tokens_details: { cached_tokens: cached } } : {}, ...reasoning !== void 0 ? { completion_tokens_details: { reasoning_tokens: reasoning } } : {} }; } @@ -47015,8 +31639,8 @@ function toUsageDetails(usage) { function makeClip(maxChars) { function clip(value) { if (typeof value !== "string") return value; - const { text, meta: meta$2 } = truncate(value, maxChars); - return meta$2 ? `${text}\n…[truncated ${meta$2.originalLength - text.length} chars]` : text; + const { text, meta } = truncate(value, maxChars); + return meta ? `${text}\n…[truncated ${meta.originalLength - text.length} chars]` : text; } return clip; } @@ -47125,7 +31749,7 @@ function emitToolCall(tc, parent, clip, fallbackEnd) { */ async function convertRollout(rolloutFile, options) { const { sessionMeta, turns } = parseSession(await loadSession(rolloutFile)); - debugLog(`parsed ${turns.length} turn(s) from ${path.basename(rolloutFile)}`); + debugLog(`parsed ${turns.length} turn(s) from ${path$1.basename(rolloutFile)}`); if (options.parentObservation) { for (const turn of turns) await emitTurn(turn, sessionMeta, { config: options.config, @@ -47181,14 +31805,14 @@ async function runHook() { } catch (error) { return; } - const config$1 = await getConfig(); - setDebug(config$1.debug); - failOnError = config$1.fail_on_error; - if (!config$1.enabled) { + const config = await getConfig(); + setDebug(config.debug); + failOnError = config.fail_on_error; + if (!config.enabled) { debugLog("tracing disabled (set TRACE_TO_LANGFUSE=true to enable)"); return; } - if (!config$1.public_key || !config$1.secret_key) { + if (!config.public_key || !config.secret_key) { debugLog("missing LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY; skipping"); return; } @@ -47196,18 +31820,18 @@ async function runHook() { debugLog("hook payload missing transcript_path; skipping"); return; } - const instrumentation = setupInstrumentation(config$1); + const instrumentation = setupInstrumentation(config); try { - await convertRollout(hookInput.transcript_path, { config: config$1 }); + await convertRollout(hookInput.transcript_path, { config }); } catch (error) { debugLog("failed to convert rollout:", error); - if (config$1.fail_on_error) throw error; + if (config.fail_on_error) throw error; } finally { try { await instrumentation.shutdown(); } catch (error) { debugLog("error during flush/shutdown:", error); - if (config$1.fail_on_error) throw error; + if (config.fail_on_error) throw error; } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f55caa8..154feb4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: '@langfuse/otel': specifier: ^5.4.1 - version: 5.4.1(@opentelemetry/api@1.9.1)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1))(@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1)) + version: 5.4.1(@opentelemetry/api@1.9.1)(@opentelemetry/core@2.10.0(@opentelemetry/api@1.9.1))(@opentelemetry/exporter-trace-otlp-http@0.221.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.10.0(@opentelemetry/api@1.9.1)) '@langfuse/tracing': specifier: ^5.4.1 version: 5.4.1(@opentelemetry/api@1.9.1) @@ -18,17 +18,17 @@ importers: specifier: ^1.9.0 version: 1.9.1 '@opentelemetry/core': - specifier: ^2.0.1 - version: 2.7.1(@opentelemetry/api@1.9.1) + specifier: ^2.10.0 + version: 2.10.0(@opentelemetry/api@1.9.1) '@opentelemetry/exporter-trace-otlp-http': - specifier: ^0.205.0 - version: 0.205.0(@opentelemetry/api@1.9.1) + specifier: ^0.221.0 + version: 0.221.0(@opentelemetry/api@1.9.1) '@opentelemetry/sdk-trace-base': - specifier: ^2.0.1 - version: 2.7.1(@opentelemetry/api@1.9.1) + specifier: ^2.10.0 + version: 2.10.0(@opentelemetry/api@1.9.1) '@opentelemetry/sdk-trace-node': - specifier: ^2.0.1 - version: 2.7.1(@opentelemetry/api@1.9.1) + specifier: ^2.10.0 + version: 2.10.0(@opentelemetry/api@1.9.1) zod: specifier: ^4.1.13 version: 4.4.3 @@ -40,38 +40,17 @@ importers: specifier: ^3.9.4 version: 3.9.4 tsdown: - specifier: ^0.18.0 - version: 0.18.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(typescript@5.9.3) + specifier: ^0.22.14 + version: 0.22.14(typescript@5.9.3)(unrun@0.2.39) typescript: specifier: ^5.7.2 version: 5.9.3 vitest: - specifier: ^4.0.0 - version: 4.1.8(@opentelemetry/api@1.9.1)(@types/node@22.19.19)(vite@8.0.16(@types/node@22.19.19)) + specifier: ^4.1.11 + version: 4.1.11(@opentelemetry/api@1.9.1)(@types/node@22.19.19)(vite@8.0.16(@types/node@22.19.19)) packages: - '@babel/generator@7.29.7': - resolution: {integrity: sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.29.7': - resolution: {integrity: sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.29.7': - resolution: {integrity: sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.29.7': - resolution: {integrity: sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/types@7.29.7': - resolution: {integrity: sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==} - engines: {node: '>=6.9.0'} - '@emnapi/core@1.10.0': resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} @@ -81,19 +60,9 @@ packages: '@emnapi/wasi-threads@1.2.1': resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} - '@jridgewell/gen-mapping@0.3.13': - resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} - - '@jridgewell/resolve-uri@3.1.2': - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} - engines: {node: '>=6.0.0'} - '@jridgewell/sourcemap-codec@1.5.5': resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - '@jridgewell/trace-mapping@0.3.31': - resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} - '@langfuse/core@5.4.1': resolution: {integrity: sha512-TjaRTr9fGqaWuyYKFSezKxN4DWAaK/lq//hRMw8rQKFkZUs6vTgUODxqZTFTR6np5VnLVw+eZLlnHROPKbXqdg==} peerDependencies: @@ -114,154 +83,106 @@ packages: peerDependencies: '@opentelemetry/api': ^1.9.0 - '@napi-rs/wasm-runtime@1.1.4': - resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==} - peerDependencies: - '@emnapi/core': ^1.7.1 - '@emnapi/runtime': ^1.7.1 - '@napi-rs/wasm-runtime@1.1.6': resolution: {integrity: sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==} peerDependencies: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 - '@opentelemetry/api-logs@0.205.0': - resolution: {integrity: sha512-wBlPk1nFB37Hsm+3Qy73yQSobVn28F4isnWIBvKpd5IUH/eat8bwcL02H9yzmHyyPmukeccSl2mbN5sDQZYnPg==} + '@opentelemetry/api-logs@0.221.0': + resolution: {integrity: sha512-OlanaW1vv7ufTqQ3/fPLI4arGt5ZoM+P8abOMki6uEYnpRazepSWDwDnnw+la7kE26SHVC18//SMccrDvLKOXQ==} engines: {node: '>=8.0.0'} '@opentelemetry/api@1.9.1': resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==} engines: {node: '>=8.0.0'} - '@opentelemetry/context-async-hooks@2.7.1': - resolution: {integrity: sha512-OPFBYuXEn1E4ja3Y6eeA7O+ZnLBNcXTV5Cgsn1VaqBZ6hC5FnpZPLBNme1LJY8ZtF4aOujPKFoeWN4ik487KuQ==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.10.0' - - '@opentelemetry/core@2.1.0': - resolution: {integrity: sha512-RMEtHsxJs/GiHHxYT58IY57UXAQTuUnZVco6ymDEqTNlJKTimM4qPUPVe8InNFyBjhHBEAx4k3Q8LtNayBsbUQ==} + '@opentelemetry/context-async-hooks@2.10.0': + resolution: {integrity: sha512-bvyMcgLEkozzSzpEEEo1OMoeQ97bxj6Qs2uN3mPrSdDvObMI1myffD/BPqcLlzZO9//d1SqQA/WPw7Cz2AiqhA==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': '>=1.0.0 <1.10.0' - '@opentelemetry/core@2.7.1': - resolution: {integrity: sha512-QAqIj32AtK6+pEVNG7EOVxHdE06RP+FM5qpiEJ4RtDcFIqKUZHYhl7/7UY5efhwmwNAg7j8QbJVBLxMerc0+gw==} + '@opentelemetry/core@2.10.0': + resolution: {integrity: sha512-/wNZ8twnEQQA4HoHu22+vcsdru6pWPWxW+7w+FlxT6Id7PE/WIbZmVKkte+PF72e0F2dnImFeHD2syyE1Mw6MQ==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': '>=1.0.0 <1.10.0' - '@opentelemetry/exporter-trace-otlp-http@0.205.0': - resolution: {integrity: sha512-vr2bwwPCSc9u7rbKc74jR+DXFvyMFQo9o5zs+H/fgbK672Whw/1izUKVf+xfWOdJOvuwTnfWxy+VAY+4TSo74Q==} + '@opentelemetry/exporter-trace-otlp-http@0.221.0': + resolution: {integrity: sha512-AySXiKoC+meiWm6zdVj5T2LnPDZuatveBby1cMOeQteIWsYXAUxs8Sru13G2pVSPrUXz6vF+og7QVBX6GdC/oQ==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': ^1.3.0 - '@opentelemetry/otlp-exporter-base@0.205.0': - resolution: {integrity: sha512-2MN0C1IiKyo34M6NZzD6P9Nv9Dfuz3OJ3rkZwzFmF6xzjDfqqCTatc9v1EpNfaP55iDOCLHFyYNCgs61FFgtUQ==} + '@opentelemetry/otlp-exporter-base@0.221.0': + resolution: {integrity: sha512-UFPIq80OH3Ns/oPFHRj14d4DTOxUo+MUFU8hUiCq5jTqFhdeJnfVSANHT+xp92409cA+oxzvlZCe6NM1wvCuBA==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': ^1.3.0 - '@opentelemetry/otlp-transformer@0.205.0': - resolution: {integrity: sha512-KmObgqPtk9k/XTlWPJHdMbGCylRAmMJNXIRh6VYJmvlRDMfe+DonH41G7eenG8t4FXn3fxOGh14o/WiMRR6vPg==} + '@opentelemetry/otlp-transformer@0.221.0': + resolution: {integrity: sha512-lg6lkOU08Az23jVcn/0Els9HP+V8PnR4Km6p0KgpTggS0n/WuhnmY64rSh83Of9iR9nD+dpWr6adlcX8KzAwjg==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': ^1.3.0 - '@opentelemetry/resources@2.1.0': - resolution: {integrity: sha512-1CJjf3LCvoefUOgegxi8h6r4B/wLSzInyhGP2UmIBYNlo4Qk5CZ73e1eEyWmfXvFtm1ybkmfb2DqWvspsYLrWw==} - engines: {node: ^18.19.0 || >=20.6.0} - peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.10.0' - - '@opentelemetry/resources@2.7.1': - resolution: {integrity: sha512-DeT6KKolmC4e/dRQvMQ/RwlnzhaqeiFOXY5ngoOPJ07GgVVKxZOg9EcrNZb5aTzUn+iCrJldAgOfQm1O/QfPAQ==} + '@opentelemetry/resources@2.10.0': + resolution: {integrity: sha512-q6MMm2zhggzsHVNbabYwut+a6nbuQQe3URUoxaojM/8K1IBfwwPzvxIjNi2/lI1TFe+fMHMW9MWhrtDLEXEnkA==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': '>=1.3.0 <1.10.0' - '@opentelemetry/sdk-logs@0.205.0': - resolution: {integrity: sha512-nyqhNQ6eEzPWQU60Nc7+A5LIq8fz3UeIzdEVBQYefB4+msJZ2vuVtRuk9KxPMw1uHoHDtYEwkr2Ct0iG29jU8w==} + '@opentelemetry/sdk-logs@0.221.0': + resolution: {integrity: sha512-FaDcazjyMp7TZZZAsqbo4IkovP0UegoCu0EBkiNt+qCqvUf7FPAsfcrZ3+ZEkKgXZ/jHafop+JoGPDk3A0SmLg==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': '>=1.4.0 <1.10.0' - '@opentelemetry/sdk-metrics@2.1.0': - resolution: {integrity: sha512-J9QX459mzqHLL9Y6FZ4wQPRZG4TOpMCyPOh6mkr/humxE1W2S3Bvf4i75yiMW9uyed2Kf5rxmLhTm/UK8vNkAw==} + '@opentelemetry/sdk-metrics@2.10.0': + resolution: {integrity: sha512-t6r1VSvXNtSDnPXU1FbZeetJb7yyovHmgu0wRSoftxtE0g2rSNhQZQUy69sRUCL+iioJpX8SN/S6wq6ZtvLySQ==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': '>=1.9.0 <1.10.0' - '@opentelemetry/sdk-trace-base@2.1.0': - resolution: {integrity: sha512-uTX9FBlVQm4S2gVQO1sb5qyBLq/FPjbp+tmGoxu4tIgtYGmBYB44+KX/725RFDe30yBSaA9Ml9fqphe1hbUyLQ==} + '@opentelemetry/sdk-trace-base@2.10.0': + resolution: {integrity: sha512-GuYQQT7QD2EeO8lcZLRQzcbOyhqAzL+6WWTKTU9mSUBYBazkEDl+VrQcXQhbB08OWM9anD1aHleVadzulpOaUQ==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': '>=1.3.0 <1.10.0' - '@opentelemetry/sdk-trace-base@2.7.1': - resolution: {integrity: sha512-NAYIlsF8MPUsKqJMiDQJTMPOmlbawC1Iz/omMLygZ1C9am8fTKYjTaI+OZM+WTY3t3Glo0wnOg/6/pac6RGPPw==} + '@opentelemetry/sdk-trace-node@2.10.0': + resolution: {integrity: sha512-GZK/G6oZyBLGlH1pUgeDch7D91KoHd2uotUGIkWCPi9GI5T9X0p4L7nNAMDR1BQjkRYoDqo+ddfVx9t5Uhys+Q==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: - '@opentelemetry/api': '>=1.3.0 <1.10.0' + '@opentelemetry/api': '>=1.0.0 <1.10.0' - '@opentelemetry/sdk-trace-node@2.7.1': - resolution: {integrity: sha512-pCpQxU68lV+I9s9svqMyVu5iHdDDUnqUpSxqwyCU8A9ejEsSnMPCbearwsUO4yk08ZJzAIUCFuReMdVQvHrdvg==} + '@opentelemetry/sdk-trace@2.10.0': + resolution: {integrity: sha512-MfQGq3GRmTh5fM/y+OjaO0vj6+luCB1XO2gfXCalKCfgKw0eHL++sm75DNweC6ohlp+aFvACqeE0fYayqdRaoQ==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: - '@opentelemetry/api': '>=1.0.0 <1.10.0' + '@opentelemetry/api': '>=1.3.0 <1.10.0' '@opentelemetry/semantic-conventions@1.41.1': resolution: {integrity: sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==} engines: {node: '>=14'} - '@oxc-project/types@0.103.0': - resolution: {integrity: sha512-bkiYX5kaXWwUessFRSoXFkGIQTmc6dLGdxuRTrC+h8PSnIdZyuXHHlLAeTmOue5Br/a0/a7dHH0Gca6eXn9MKg==} - '@oxc-project/types@0.127.0': resolution: {integrity: sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==} '@oxc-project/types@0.133.0': resolution: {integrity: sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==} - '@protobufjs/aspromise@1.1.2': - resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} - - '@protobufjs/base64@1.1.2': - resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==} - - '@protobufjs/codegen@2.0.5': - resolution: {integrity: sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==} - - '@protobufjs/eventemitter@1.1.1': - resolution: {integrity: sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==} - - '@protobufjs/fetch@1.1.1': - resolution: {integrity: sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==} - - '@protobufjs/float@1.0.2': - resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==} - - '@protobufjs/inquire@1.1.2': - resolution: {integrity: sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==} - - '@protobufjs/path@1.1.2': - resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==} - - '@protobufjs/pool@1.1.0': - resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==} - - '@protobufjs/utf8@1.1.1': - resolution: {integrity: sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==} + '@oxc-project/types@0.147.0': + resolution: {integrity: sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==} '@quansync/fs@1.0.0': resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} - '@rolldown/binding-android-arm64@1.0.0-beta.57': - resolution: {integrity: sha512-GoOVDy8bjw9z1K30Oo803nSzXJS/vWhFijFsW3kzvZCO8IZwFnNa6pGctmbbJstKl3Fv6UBwyjJQN6msejW0IQ==} + '@rolldown/binding-android-arm-eabi@1.2.6': + resolution: {integrity: sha512-b+jTcARdTiFLI6jB4a5XjTm0RWd6KcRfQj/I2356fxUZemiho9zQLxo0RtCuMDAyKcLo6cEltkgbQp6d1+sjjQ==} engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] + cpu: [arm] os: [android] '@rolldown/binding-android-arm64@1.0.0-rc.17': @@ -276,11 +197,11 @@ packages: cpu: [arm64] os: [android] - '@rolldown/binding-darwin-arm64@1.0.0-beta.57': - resolution: {integrity: sha512-9c4FOhRGpl+PX7zBK5p17c5efpF9aSpTPgyigv57hXf5NjQUaJOOiejPLAtFiKNBIfm5Uu6yFkvLKzOafNvlTw==} + '@rolldown/binding-android-arm64@1.2.6': + resolution: {integrity: sha512-lkWU8ZJaRk9q3CIEY1Tc7vIFALp3Xw5NfGJo2hQg5oIqNgxWi1zI+IiDEK3r70BF5Dzol1tcXsnzsRc8NLhG+Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] - os: [darwin] + os: [android] '@rolldown/binding-darwin-arm64@1.0.0-rc.17': resolution: {integrity: sha512-4ksWc9n0mhlZpZ9PMZgTGjeOPRu8MB1Z3Tz0Mo02eWfWCHMW1zN82Qz/pL/rC+yQa+8ZnutMF0JjJe7PjwasYw==} @@ -294,10 +215,10 @@ packages: cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-x64@1.0.0-beta.57': - resolution: {integrity: sha512-6RsB8Qy4LnGqNGJJC/8uWeLWGOvbRL/KG5aJ8XXpSEupg/KQtlBEiFaYU/Ma5Usj1s+bt3ItkqZYAI50kSplBA==} + '@rolldown/binding-darwin-arm64@1.2.6': + resolution: {integrity: sha512-dgR56NYnvAszm7Ob1B2/Vn0e8bUQYZH2UjVaMMtMVOCKFSfjhfLmuA/9+O+F+ajUdG6B/bSssrKW6JJYASa8jA==} engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] + cpu: [arm64] os: [darwin] '@rolldown/binding-darwin-x64@1.0.0-rc.17': @@ -312,11 +233,11 @@ packages: cpu: [x64] os: [darwin] - '@rolldown/binding-freebsd-x64@1.0.0-beta.57': - resolution: {integrity: sha512-uA9kG7+MYkHTbqwv67Tx+5GV5YcKd33HCJIi0311iYBd25yuwyIqvJfBdt1VVB8tdOlyTb9cPAgfCki8nhwTQg==} + '@rolldown/binding-darwin-x64@1.2.6': + resolution: {integrity: sha512-vpVxFvUCFioJqug7OTvqptkc4yb8UX0AwfDmJpaR/0sWz+BUmqSVAf7c8JkUgnN8YLspb4a/N6NhTyMAmdyQ7Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] - os: [freebsd] + os: [darwin] '@rolldown/binding-freebsd-x64@1.0.0-rc.17': resolution: {integrity: sha512-hwnz3nw9dbJ05EDO/PvcjaaewqqDy7Y1rn1UO81l8iIK1GjenME75dl16ajbvSSMfv66WXSRCYKIqfgq2KCfxw==} @@ -330,11 +251,11 @@ packages: cpu: [x64] os: [freebsd] - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.57': - resolution: {integrity: sha512-3KkS0cHsllT2T+Te+VZMKHNw6FPQihYsQh+8J4jkzwgvAQpbsbXmrqhkw3YU/QGRrD8qgcOvBr6z5y6Jid+rmw==} + '@rolldown/binding-freebsd-x64@1.2.6': + resolution: {integrity: sha512-h1wG6Y6K3JlRswxsI64qQJqBAy4vrLuHgRbc8CZMGSWTOFRY6ghMApM1NKzB2I0n5xV1fjkE18SuVl2QpLeNpA==} engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm] - os: [linux] + cpu: [x64] + os: [freebsd] '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17': resolution: {integrity: sha512-IS+W7epTcwANmFSQFrS1SivEXHtl1JtuQA9wlxrZTcNi6mx+FDOYrakGevvvTwgj2JvWiK8B29/qD9BELZPyXQ==} @@ -348,10 +269,10 @@ packages: cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.57': - resolution: {integrity: sha512-A3/wu1RgsHhqP3rVH2+sM81bpk+Qd2XaHTl8LtX5/1LNR7QVBFBCpAoiXwjTdGnI5cMdBVi7Z1pi52euW760Fw==} + '@rolldown/binding-linux-arm-gnueabihf@1.2.6': + resolution: {integrity: sha512-tbCiqub0q2MVWJKgF5PoAlNWCtQydiOYSLIkd8sByqK/6MMYLJRcSXSYodqYtd0O+Fw7QaVmKKlS4oL94YRZ0w==} engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] + cpu: [arm] os: [linux] '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17': @@ -366,8 +287,8 @@ packages: cpu: [arm64] os: [linux] - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.57': - resolution: {integrity: sha512-d0kIVezTQtazpyWjiJIn5to8JlwfKITDqwsFv0Xc6s31N16CD2PC/Pl2OtKgS7n8WLOJbfqgIp5ixYzTAxCqMg==} + '@rolldown/binding-linux-arm64-gnu@1.2.6': + resolution: {integrity: sha512-oxK9+baEBPhZG5HB4URY+uU04zJWeZlH6Tb9rB5DK4DF9XR1uXNLXt5Q5ZsugTKayNCNLhkcwz/ye74hRI98dg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] @@ -384,6 +305,12 @@ packages: cpu: [arm64] os: [linux] + '@rolldown/binding-linux-arm64-musl@1.2.6': + resolution: {integrity: sha512-muWCk27FVBEZtv0MsK8gnfSmgczA8KQ0uRVJbTABKhkRfQc38aUrcb7fhi3BNiyseFmgcRsoMfQsSNJ+DbZdSw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': resolution: {integrity: sha512-4EII1iNGRUN5WwGbF/kOh/EIkoDN9HsupgLQoXfY+D1oyJm7/F4t5PYU5n8SWZgG0FEwakyM8pGgwcBYruGTlA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -396,6 +323,12 @@ packages: cpu: [ppc64] os: [linux] + '@rolldown/binding-linux-ppc64-gnu@1.2.6': + resolution: {integrity: sha512-eWDoSfU7Co2qj3vgB3Dt4lj1mG6CoWbcJQkRMP3XJplyCMtuaq3LHvPFjS9QIPvMGWVadJC04Xiy0IdcVPtnwQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': resolution: {integrity: sha512-AH8oq3XqQo4IibpVXvPeLDI5pzkpYn0WiZAfT05kFzoJ6tQNzwRdDYQ45M8I/gslbodRZwW8uxLhbSBbkv96rA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -408,10 +341,10 @@ packages: cpu: [s390x] os: [linux] - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.57': - resolution: {integrity: sha512-E199LPijo98yrLjPCmETx8EF43sZf9t3guSrLee/ej1rCCc3zDVTR4xFfN9BRAapGVl7/8hYqbbiQPTkv73kUg==} + '@rolldown/binding-linux-s390x-gnu@1.2.6': + resolution: {integrity: sha512-2bWNjRSIayvupRKxXUY2tWG9fYdoUlTqWywHRvE8Eq3GvuQ+f2HeIkve697fIt+IQs/PV8yFsdWuhp1aJ1PdnA==} engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] + cpu: [s390x] os: [linux] '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': @@ -426,8 +359,8 @@ packages: cpu: [x64] os: [linux] - '@rolldown/binding-linux-x64-musl@1.0.0-beta.57': - resolution: {integrity: sha512-++EQDpk/UJ33kY/BNsh7A7/P1sr/jbMuQ8cE554ZIy+tCUWCivo9zfyjDUoiMdnxqX6HLJEqqGnbGQOvzm2OMQ==} + '@rolldown/binding-linux-x64-gnu@1.2.6': + resolution: {integrity: sha512-KekI0gS0wLxe1UBSQSjenBVwou/JkcQPDzBPICGZjxUv9k3RteHDPBQaiOicZUFKRIH2wKEimGwVpnJsbPzu7w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] @@ -444,11 +377,11 @@ packages: cpu: [x64] os: [linux] - '@rolldown/binding-openharmony-arm64@1.0.0-beta.57': - resolution: {integrity: sha512-voDEBcNqxbUv/GeXKFtxXVWA+H45P/8Dec4Ii/SbyJyGvCqV1j+nNHfnFUIiRQ2Q40DwPe/djvgYBs9PpETiMA==} + '@rolldown/binding-linux-x64-musl@1.2.6': + resolution: {integrity: sha512-TvtPnfVr+HtyGiDmPK4VWmlNm7QhNNAcK5Q9A7aOXsI8545yCyaoMaicXrFZ72JzeYjaUVk7yT243zT0jzjFKQ==} engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [openharmony] + cpu: [x64] + os: [linux] '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': resolution: {integrity: sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA==} @@ -462,10 +395,11 @@ packages: cpu: [arm64] os: [openharmony] - '@rolldown/binding-wasm32-wasi@1.0.0-beta.57': - resolution: {integrity: sha512-bRhcF7NLlCnpkzLVlVhrDEd0KH22VbTPkPTbMjlYvqhSmarxNIq5vtlQS8qmV7LkPKHrNLWyJW/V/sOyFba26Q==} - engines: {node: '>=14.0.0'} - cpu: [wasm32] + '@rolldown/binding-openharmony-arm64@1.2.6': + resolution: {integrity: sha512-iOo0VEay2XFhaCcH0sps5XIimkSuOnNaZrf6+ZkoSOQBJPKNU48RkmJv0/lSpipexu5P+ouFgafe5IGr/DiQfg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] '@rolldown/binding-wasm32-wasi@1.0.0-rc.17': resolution: {integrity: sha512-LEXei6vo0E5wTGwpkJ4KoT3OZJRnglwldt5ziLzOlc6qqb55z4tWNq2A+PFqCJuvWWdP53CVhG1Z9NtToDPJrA==} @@ -477,12 +411,6 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [wasm32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.57': - resolution: {integrity: sha512-rnDVGRks2FQ2hgJ2g15pHtfxqkGFGjJQUDWzYznEkE8Ra2+Vag9OffxdbJMZqBWXHVM0iS4dv8qSiEn7bO+n1Q==} - engines: {node: ^20.19.0 || >=22.12.0} - cpu: [arm64] - os: [win32] - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.17': resolution: {integrity: sha512-gUmyzBl3SPMa6hrqFUth9sVfcLBlYsbMzBx5PlexMroZStgzGqlZ26pYG89rBb45Mnia+oil6YAIFeEWGWhoZA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -495,10 +423,10 @@ packages: cpu: [arm64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.57': - resolution: {integrity: sha512-OqIUyNid1M4xTj6VRXp/Lht/qIP8fo25QyAZlCP+p6D2ATCEhyW4ZIFLnC9zAGN/HMbXoCzvwfa8Jjg/8J4YEg==} + '@rolldown/binding-win32-arm64-msvc@1.2.6': + resolution: {integrity: sha512-y5NTmmasMS455JlOCO4ZM9krIchv3Mvm1crL1iUPGOPgEzSkves9n0SdC5Sjz6+qWDFhd8/JpfWMH8NSWNHe+A==} engines: {node: ^20.19.0 || >=22.12.0} - cpu: [x64] + cpu: [arm64] os: [win32] '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': @@ -513,8 +441,11 @@ packages: cpu: [x64] os: [win32] - '@rolldown/pluginutils@1.0.0-beta.57': - resolution: {integrity: sha512-aQNelgx14tGA+n2tNSa9x6/jeoCL9fkDeCei7nOKnHx0fEFRRMu5ReiITo+zZD5TzWDGGRjbSYCs93IfRIyTuQ==} + '@rolldown/binding-win32-x64-msvc@1.2.6': + resolution: {integrity: sha512-np8iZSLfXlAD4kWhiyq/u0Yt8oZDtRQ8lGhQaCXo2rl37KNjeU0GjJuwr4P3oeZ++ROfofsKNBqR5LTO8aXyWQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] '@rolldown/pluginutils@1.0.0-rc.17': resolution: {integrity: sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==} @@ -525,9 +456,6 @@ packages: '@standard-schema/spec@1.1.0': resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} - '@tybys/wasm-util@0.10.2': - resolution: {integrity: sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==} - '@tybys/wasm-util@0.10.3': resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} @@ -543,11 +471,11 @@ packages: '@types/node@22.19.19': resolution: {integrity: sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==} - '@vitest/expect@4.1.8': - resolution: {integrity: sha512-h3nDO677RDLEGlBxyQ5CW8RlMThSKSRLUePLOx09gNIWRL40edgA1GCZSZgf1W55MFAG6/Sw14KeaAnqv0NKdQ==} + '@vitest/expect@4.1.11': + resolution: {integrity: sha512-VX2x5vNJXET47KAFzwERI+KRMtTTCSWTfSMKsW7JsUsXV4psq++e3DvZpuTDOpHcxytiDs6p2nhVb2tVDiiUYw==} - '@vitest/mocker@4.1.8': - resolution: {integrity: sha512-LEiN/xe4OSIbKe9HQIp5OC24agGD9J5CnmMgsLohVVoOPWL9a2sBoR6VBx43jQZb7Kr1l4RCuyCJzcAa0+dojw==} + '@vitest/mocker@4.1.11': + resolution: {integrity: sha512-2XJVD55d1o5AZous5CCGKS74g/riOj9odEt2bQpCVZeblHyHdnMeFl4jl0XjU21stf4mbjUkew2eXQZt65g5CQ==} peerDependencies: msw: ^2.4.9 vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -557,20 +485,143 @@ packages: vite: optional: true - '@vitest/pretty-format@4.1.8': - resolution: {integrity: sha512-9GasEBxpZ1VYIpqHf/0+YGg121uSNwCKOJqIrTwWP/TB7DmFCiaBpNl3aPZzoLWfWkuqhbH8vJIVobZkvdo2cA==} + '@vitest/pretty-format@4.1.11': + resolution: {integrity: sha512-yiZzPbGTS9Sr/JpFl8zHrcIkAofNbFV6k21vIgQN/cY/oxZeXhJv5sc/MBJ5jFKWmWs+oJHw0UXLZjmf931+Vw==} + + '@vitest/runner@4.1.11': + resolution: {integrity: sha512-LztvUgdwMNJMIkj3hQnnxiC2Xy1zNxq928W/xhjCLaNCzqTZOudjwbQf6v9IntZGPw132i2Lq2rgTRZHD3JHNw==} + + '@vitest/snapshot@4.1.11': + resolution: {integrity: sha512-pN7ikn1ON7h8ee4gIAp4AzyK+zBtJPzVbqOgu5LCEh4VaJVbPQcgYQYJIMGQPXVeJJq1fnfazis7a5pFNPahog==} + + '@vitest/spy@4.1.11': + resolution: {integrity: sha512-apNa/prQy2qCeywhnixOHPRCgGNhvg7T4Dapfl1GahLp/R+uhBm5cPyFoNVyqsNd2h1nJxL6BqqdIjiABL60YA==} - '@vitest/runner@4.1.8': - resolution: {integrity: sha512-EmVxeBAfMJvycdjd6Hm+RbFBbA9fKvo0Kx37hNpBYoYeavH3RNsBXWDooR1mgD52dCrxIIuP7UotpfiwOikvcg==} + '@vitest/utils@4.1.11': + resolution: {integrity: sha512-zTCVGpyFsGWBhllOyKlTw/vnr6D9qxsfSDyfbyZmTyjHw5N/VuvzHpHoQjm2ZJzn4RJgx5w4r7V0er69CmLgPQ==} - '@vitest/snapshot@4.1.8': - resolution: {integrity: sha512-acfZboRmAIf05DEKcBQy33VXojFJjtUdLyo7oOmV9kebb2xdU01UknNiPuPZoJZQyO7DF0gZdTGTpeAzET9QPQ==} + '@yuku-codegen/binding-android-arm64@0.8.7': + resolution: {integrity: sha512-C/0zV5IhgVdYhGJTwrY0v8dknxlhiKwtVJkMUaexu9/QvRmzlV4vfU3hZlUSgqc2BxQHntL1mCVbDq8j0FRFDw==} + cpu: [arm64] + os: [android] - '@vitest/spy@4.1.8': - resolution: {integrity: sha512-6EevtBp6OZOPF7bmz36HrGMeP3txgVSrgebWxHOafDXGkhIzfXK14f8KF6MuFfgXXUeHxmpD3BQxkV00/3s5mA==} + '@yuku-codegen/binding-darwin-arm64@0.8.7': + resolution: {integrity: sha512-/u+REDMI4a0/lsJXTM4c53/w31OGZLOReZIyg62uhgLs0kc8NHsj/nOcxTdlQjq5gi0zhdkccD9LaLTXcdzPvw==} + cpu: [arm64] + os: [darwin] - '@vitest/utils@4.1.8': - resolution: {integrity: sha512-uOJamYALNhfJ6iolExyQM40yIQwDqYnkKtQ5VCiSe17E33H0aQ/u+1GlRuz4LZBk6Mm3sg90G9hEbmEt37C1Zg==} + '@yuku-codegen/binding-darwin-x64@0.8.7': + resolution: {integrity: sha512-sMMzFOwCo4WXR+/6zIBThOocSC50iIIZZdfiIDbaLvj0Ax/rWt/iavyfEAqajyvzydLyCqR/ZItdLWSRlu1umw==} + cpu: [x64] + os: [darwin] + + '@yuku-codegen/binding-freebsd-x64@0.8.7': + resolution: {integrity: sha512-MpdpKXix9P+Y1rKgjvcNeNtGjXeL1CmttNhYINrWls8kRpm4xM/oBGTmn6w7to8lAlwj5jm8q03dQPl5mRv4Qw==} + cpu: [x64] + os: [freebsd] + + '@yuku-codegen/binding-linux-arm-gnu@0.8.7': + resolution: {integrity: sha512-rr1srFLlPAmC1vtxfc9C1YLDe3iH09YjfSeeIidBqKhzx1MATjOAq4mjlRUOnhr/L27MotWIYOFKwVsd5JZFOg==} + cpu: [arm] + os: [linux] + + '@yuku-codegen/binding-linux-arm-musl@0.8.7': + resolution: {integrity: sha512-eAufXh8qBRpiSO6ueaMDL+yyoXIGLhpUce72YbcACtZU2qhExwBIJyEtQf5kH2Ki0X2aqkSjSfog4OPtKXan3Q==} + cpu: [arm] + os: [linux] + + '@yuku-codegen/binding-linux-arm64-gnu@0.8.7': + resolution: {integrity: sha512-gw4w6wPoHObBrdIC4duVWLmJOvpdE25j5D7yrM5mACNlK4klRz/lv8hK+ssQk9EJHBgZjSaqZIJVFgqNYbfv7A==} + cpu: [arm64] + os: [linux] + + '@yuku-codegen/binding-linux-arm64-musl@0.8.7': + resolution: {integrity: sha512-L68N6Y4XkqcIaKo3Ra88JEvBEH4AHff44A4INcrxeVWZ8CZtu2tCpfVxe3hR8qQQMcvBSQlDn24KpkCKEhVvfA==} + cpu: [arm64] + os: [linux] + + '@yuku-codegen/binding-linux-x64-gnu@0.8.7': + resolution: {integrity: sha512-dzyAbltJmf3Cqlb8HcFuYIf5Yn0fl1vTr3XJ9HiVNNvOlhqPSArOqtw9vI1p6/VTXTjrMLXlU+s+/kNHiIy/Cw==} + cpu: [x64] + os: [linux] + + '@yuku-codegen/binding-linux-x64-musl@0.8.7': + resolution: {integrity: sha512-Otw4MH3404q0Bbvl+YTdW9aoUV5vXmUw8260bWvt1XlaoIX/ceSgI4ygheRDMfBPoHt6FDayQaO9OLVUZAgkFA==} + cpu: [x64] + os: [linux] + + '@yuku-codegen/binding-win32-arm64@0.8.7': + resolution: {integrity: sha512-qo/jyrzryiBuKEsFiuWaBCBe3tRMynQ0qFWFgOEjcCMQeZfBm+wKiVEUEFXXLc7bh8YezguAWp0Mtnhq4ARNyA==} + cpu: [arm64] + os: [win32] + + '@yuku-codegen/binding-win32-x64@0.8.7': + resolution: {integrity: sha512-D5lDsVDx6m00E6bWySlWdH72Ca4TPSaphDqB6QjU6MpuNLIJqoGoatYyq2rOmBE8Zv/kunot/o58KGL03P3eiA==} + cpu: [x64] + os: [win32] + + '@yuku-parser/binding-android-arm64@0.8.7': + resolution: {integrity: sha512-eGKYiUDX7Y0V7tDTmg+JTVnXnjMqfXXsorZ+EDf5kxwchQ3Or1HS14MzI2fw+jFhHR85fCWt+mtX33Yao73hIQ==} + cpu: [arm64] + os: [android] + + '@yuku-parser/binding-darwin-arm64@0.8.7': + resolution: {integrity: sha512-Re0RHelKLnjEURulY2/KxW+Ngb8zuNA4BRZuMwgGQNzVumT6u4U2N2hc01oeYVNVof0i7GrXE4UCNBgbpRRnjQ==} + cpu: [arm64] + os: [darwin] + + '@yuku-parser/binding-darwin-x64@0.8.7': + resolution: {integrity: sha512-Hn8DROtQkjlA1ACbPgj4a7eP9IuVOI504oiTwpkWPbpaDWD9KdmnVYCqW+1LfenNK/g7O9NhWGpXEdaCNX7lIA==} + cpu: [x64] + os: [darwin] + + '@yuku-parser/binding-freebsd-x64@0.8.7': + resolution: {integrity: sha512-bAP2OV8wRuzplX/jYxv9+vvqQT8JxyNphI8fLfXGL054Xs+4/J5u33cIm3y4rxY8rdoLmmdiJs2Tq7r7lrDRfA==} + cpu: [x64] + os: [freebsd] + + '@yuku-parser/binding-linux-arm-gnu@0.8.7': + resolution: {integrity: sha512-kTYwJQQgmZeAWdDIWabiReIZMpmfLueIj1tCmjStUtFGhR1Z0qwxonKVfUC4N7h/VhGGzLZ//7O1kgt1QKqgCg==} + cpu: [arm] + os: [linux] + + '@yuku-parser/binding-linux-arm-musl@0.8.7': + resolution: {integrity: sha512-uL4jE8HPT2BLlxAXyD10LqgPuXa9eDa0BKpCdSANmzIJghq/2eZo3/gQNtaxPZMupWoxjYzSad9IXrwu7aYPXQ==} + cpu: [arm] + os: [linux] + + '@yuku-parser/binding-linux-arm64-gnu@0.8.7': + resolution: {integrity: sha512-3gVN4pWSKZmXiNX7cU164dR9MPvesCHnlH6nPfpK+yQsCuYphjKKplcb4SnZBrhiqmXbgb2HR0c2TS0IZUPhgA==} + cpu: [arm64] + os: [linux] + + '@yuku-parser/binding-linux-arm64-musl@0.8.7': + resolution: {integrity: sha512-S0mwfEjoLpxzXeZw802Wa4RaELsQiPtWqG6INcy8j4GtvNFtl4LCX3eGO1XLn9pyLAISLzTRyU3zUCBUPin8lg==} + cpu: [arm64] + os: [linux] + + '@yuku-parser/binding-linux-x64-gnu@0.8.7': + resolution: {integrity: sha512-lnbWdPmerE5D1uH1G4IEZKnPzCrWCStRGrtgpSIe1RibAo5bZIjDbbbPYXmMHCEh4F+x/JaJpElh26a3r+BPbg==} + cpu: [x64] + os: [linux] + + '@yuku-parser/binding-linux-x64-musl@0.8.7': + resolution: {integrity: sha512-769uwndMvMzUvATWbAcEvyLHKA+DzhHSCl/obBUrRdYfRo26yxui6S8y3z7uJ+Naup7UKrDxrpK7OnQkxkl9KQ==} + cpu: [x64] + os: [linux] + + '@yuku-parser/binding-win32-arm64@0.8.7': + resolution: {integrity: sha512-mEB/9PlaAkisJ6KWGz0zvywXoU6+80dTlR2LwS7s/jcXXoU6fm2+sitBZXtqu3+Q4DcDgPxM45uWMCzPs0TSRw==} + cpu: [arm64] + os: [win32] + + '@yuku-parser/binding-win32-x64@0.8.7': + resolution: {integrity: sha512-8vNB2DP0ou61nGb8tc/qfi41gfyDXz1MHr2zqL3nR+cJ6CEbiuWV/l/a/vv151gCgiZLLAyGkQGENpozdg716w==} + cpu: [x64] + os: [win32] + + '@yuku-toolchain/types@0.8.7': + resolution: {integrity: sha512-2Z53dNxAJL6UvFoIrDZvYf3zlO8s4VJK4O2hhaB4mXVwwpX/7ajtss3cmfqKvamlNLWyt9FSWs4eoYdlbxpnHA==} ansis@4.3.1: resolution: {integrity: sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==} @@ -580,17 +631,10 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} - ast-kit@2.2.0: - resolution: {integrity: sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw==} + cac@7.0.0: + resolution: {integrity: sha512-tixWYgm5ZoOD+3g6UTea91eow5z6AAHaho3g0V9CNSNb45gM8SmflpAc+GRd1InC4AqN/07Unrgp56Y94N9hJQ==} engines: {node: '>=20.19.0'} - birpc@4.0.0: - resolution: {integrity: sha512-LShSxJP0KTmd101b6DRyGBj57LZxSDYWKitQNW/mi8GRMvZb078Uf9+pveax1DrVL89vm7mWe+TovdI/UDOuPw==} - - cac@6.7.14: - resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} - engines: {node: '>=8'} - chai@6.2.2: resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} engines: {node: '>=18'} @@ -605,9 +649,9 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} - dts-resolver@2.1.3: - resolution: {integrity: sha512-bihc7jPC90VrosXNzK0LTE2cuLP6jr0Ro8jk+kMugHReJVLIpHz/xadeq3MhuwyO4TD4OA3L1Q8pBBFRc08Tsw==} - engines: {node: '>=20.19.0'} + dts-resolver@3.0.0: + resolution: {integrity: sha512-1T1f+z+4tl9XD+m+0HBgWoL/nm0bOIffyWaUuUSBlFg/86IWvfx+wjNaO/ybU0AJzG9/Mi5hBUgGV6zCmWEN7Q==} + engines: {node: ^22.18.0 || >=24.0.0} peerDependencies: oxc-resolver: '>=11.0.0' peerDependenciesMeta: @@ -642,20 +686,16 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] - get-tsconfig@4.14.0: - resolution: {integrity: sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==} + get-tsconfig@5.0.0-beta.5: + resolution: {integrity: sha512-/6gFNr0N04nob252sTQxyFLi3eKFRqIg1I87YcqAMT1i6SQrSF6KujUEQrtrjMV0H/eejTCltLdDSTEMzHbnsQ==} + engines: {node: '>=20.20.0'} hookable@6.1.1: resolution: {integrity: sha512-U9LYDy1CwhMCnprUfeAZWZGByVbhd54hwepegYTK7Pi5NvqEj63ifz5z+xukznehT7i6NIZRu89Ay1AZmRsLEQ==} - import-without-cache@0.2.5: - resolution: {integrity: sha512-B6Lc2s6yApwnD2/pMzFh/d5AVjdsDXjgkeJ766FmFuJELIGHNycKRj+l3A39yZPM4CchqNCB4RITEAYB1KUM6A==} - engines: {node: '>=20.19.0'} - - jsesc@3.1.0: - resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} - engines: {node: '>=6'} - hasBin: true + import-without-cache@0.4.0: + resolution: {integrity: sha512-NkJQA7oZ4YHQhd2+H3BoRFKF3d/XNsiKpHZCQEMH9pDX27hQQLsTyOocyRgaIVtf8gHX3Nt3LPkR4e5EdtPAGQ==} + engines: {node: ^22.18.0 || >=24.0.0} lightningcss-android-arm64@1.32.0: resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} @@ -727,9 +767,6 @@ packages: resolution: {integrity: sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==} engines: {node: '>= 12.0.0'} - long@5.3.2: - resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==} - magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -741,6 +778,10 @@ packages: obug@2.1.1: resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} + obug@2.1.4: + resolution: {integrity: sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==} + engines: {node: '>=12.20.0'} + pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} @@ -751,6 +792,10 @@ packages: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} + picomatch@4.0.7: + resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==} + engines: {node: '>=12'} + postcss@8.5.16: resolution: {integrity: sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==} engines: {node: ^10 || ^12 || >=14} @@ -760,40 +805,31 @@ packages: engines: {node: '>=14'} hasBin: true - protobufjs@7.6.2: - resolution: {integrity: sha512-N9EiLovGEQOJSPF26Ij7qUGvahfEnq0eeYZ02aigIedkmz1qZSwjnP9SBITHJuF/6MYbIW4HDN8zdYjsjqJKXQ==} - engines: {node: '>=12.0.0'} - quansync@1.0.0: resolution: {integrity: sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA==} resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - rolldown-plugin-dts@0.20.0: - resolution: {integrity: sha512-cLAY1kN2ilTYMfZcFlGWbXnu6Nb+8uwUBsi+Mjbh4uIx7IN8uMOmJ7RxrrRgPsO4H7eSz3E+JwGoL1gyugiyUA==} - engines: {node: '>=20.19.0'} + rolldown-plugin-dts@0.27.14: + resolution: {integrity: sha512-ZvuDDwoIpRK9RPxDXratCpklFO9QZZWndf/sd0VBFb4LEj0jj07UcHK9OCh7V4XiFz2Z89ziyBC2K6tJiDjrbw==} + engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: - '@ts-macro/tsc': ^0.3.6 - '@typescript/native-preview': '>=7.0.0-dev.20250601.1' - rolldown: ^1.0.0-beta.57 - typescript: ^5.0.0 - vue-tsc: ~3.2.0 + '@typescript/native-preview': '*' + '@volar/typescript': ~2.4.0 + rolldown: ^1.0.0 + typescript: ^5.0.0 || ^6.0.0 || ~7.0.0 + vue-tsc: ~3.2.0 || ~3.3.0 peerDependenciesMeta: - '@ts-macro/tsc': - optional: true '@typescript/native-preview': optional: true + '@volar/typescript': + optional: true typescript: optional: true vue-tsc: optional: true - rolldown@1.0.0-beta.57: - resolution: {integrity: sha512-lMMxcNN71GMsSko8RyeTaFoATHkCh4IWU7pYF73ziMYjhHZWfVesC6GQ+iaJCvZmVjvgSks9Ks1aaqEkBd8udg==} - engines: {node: ^20.19.0 || >=22.12.0} - hasBin: true - rolldown@1.0.0-rc.17: resolution: {integrity: sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -804,9 +840,9 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - semver@7.8.1: - resolution: {integrity: sha512-rkVq3IXh+4FDGch+KwzX3aV9W3kO54GyEgpvBzSyctDA6Xtd7RJQV1xmXbeQp5v7+VzLOfVqiutSE6GICgPFvg==} - engines: {node: '>=10'} + rolldown@1.2.6: + resolution: {integrity: sha512-vMM4q3aixf46GiF1Kok8jDPFsEpXgFWGjUHXNkNHNm+Y2adXAG2dbX91jkti3i0ZRsOlcmbuzAz1poObSHCmUA==} + engines: {node: ^20.19.0 || >=22.12.0} hasBin: true siginfo@2.0.0: @@ -841,30 +877,39 @@ packages: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true - tsdown@0.18.4: - resolution: {integrity: sha512-J/tRS6hsZTkvqmt4+xdELUCkQYDuUCXgBv0fw3ImV09WPGbEKfsPD65E+WUjSu3E7Z6tji9XZ1iWs8rbGqB/ZA==} - engines: {node: '>=20.19.0'} + tsdown@0.22.14: + resolution: {integrity: sha512-ule7Y+fsAN2iZbLDoo7C4KYljFJNJJ+fLshyn+9gozeTspVersWHxwdGB+Dm2hzA38s6muFnUTl0jK3vJm9ifQ==} + engines: {node: ^22.18.0 || >=24.11.0} hasBin: true peerDependencies: '@arethetypeswrong/core': ^0.18.1 + '@tsdown/css': 0.22.14 + '@tsdown/exe': 0.22.14 '@vitejs/devtools': '*' - publint: ^0.3.0 - typescript: ^5.0.0 - unplugin-lightningcss: ^0.4.0 + publint: ^0.3.8 + tsx: '*' + typescript: ^5.0.0 || ^6.0.0 || ^7.0.0 unplugin-unused: ^0.5.0 + unrun: '*' peerDependenciesMeta: '@arethetypeswrong/core': optional: true + '@tsdown/css': + optional: true + '@tsdown/exe': + optional: true '@vitejs/devtools': optional: true publint: optional: true - typescript: + tsx: optional: true - unplugin-lightningcss: + typescript: optional: true unplugin-unused: optional: true + unrun: + optional: true tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -890,6 +935,10 @@ packages: synckit: optional: true + verkit@0.3.2: + resolution: {integrity: sha512-zj/ob3UsvJGN0whEAKFp53REA5X66hvffVqoCtVQAakJKnKlH+/PcOfMoFwIG/o4rElqLv/ycAFlx8ZlXUorCg==} + engines: {node: '>=18.12.0'} + vite@8.0.16: resolution: {integrity: sha512-h9bXPmJichP5fLmVQo3PyaGSDE2n3aPuomeAlVRm0JLmt4rY6zmPKd59HYI4LNW8oTK7tlTsuC7l/m7awx9Jcw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -933,20 +982,20 @@ packages: yaml: optional: true - vitest@4.1.8: - resolution: {integrity: sha512-flY6ScbCIt9HThs+C5HS7jvGOB560DJtk/Z15IQROTA6zEy49Nh8T/dofWTQL+n3vswqn87sbJNiuqw1SDp5Ig==} + vitest@4.1.11: + resolution: {integrity: sha512-fhACrNXUidIbGSBr5FlbuBkO7VWC1ZyLl0DO4CU2DrQoAPxX84Ysxs+HeGQpii5lZWV1Q4gBZTTu49mF+A6Edw==} engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@opentelemetry/api': ^1.9.0 '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0 - '@vitest/browser-playwright': 4.1.8 - '@vitest/browser-preview': 4.1.8 - '@vitest/browser-webdriverio': 4.1.8 - '@vitest/coverage-istanbul': 4.1.8 - '@vitest/coverage-v8': 4.1.8 - '@vitest/ui': 4.1.8 + '@vitest/browser-playwright': 4.1.11 + '@vitest/browser-preview': 4.1.11 + '@vitest/browser-webdriverio': 4.1.11 + '@vitest/coverage-istanbul': 4.1.11 + '@vitest/coverage-v8': 4.1.11 + '@vitest/ui': 4.1.11 happy-dom: '*' jsdom: '*' vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -979,31 +1028,19 @@ packages: engines: {node: '>=8'} hasBin: true - zod@4.4.3: - resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + yuku-ast@0.8.7: + resolution: {integrity: sha512-h6+4bDfyootiMB9vckk5uKo5r5j0GHrkr17FQTDNfEsFT3DWlN9uu1HJwQwc64pgmLCI945fWM3lbTIqxjT3GQ==} -snapshots: + yuku-codegen@0.8.7: + resolution: {integrity: sha512-adwDZSh8oVDzhE6Du9PwVWxcOxeV0e2EVhUuMKWfhSY4wkrDq9eqixlxFF3l/XGUV1E7UFzhpz9393MUumkyNw==} - '@babel/generator@7.29.7': - dependencies: - '@babel/parser': 7.29.7 - '@babel/types': 7.29.7 - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - jsesc: 3.1.0 + yuku-parser@0.8.7: + resolution: {integrity: sha512-vRD9nwt4L3aYpxNqeSC4WqLv58xrXef0Ong1Mc45CTXTIpvLafx7JO05sczmQZwdLEZvywrLOGdNC5+Rp5N1BQ==} - '@babel/helper-string-parser@7.29.7': {} - - '@babel/helper-validator-identifier@7.29.7': {} - - '@babel/parser@7.29.7': - dependencies: - '@babel/types': 7.29.7 + zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} - '@babel/types@7.29.7': - dependencies: - '@babel/helper-string-parser': 7.29.7 - '@babel/helper-validator-identifier': 7.29.7 +snapshots: '@emnapi/core@1.10.0': dependencies: @@ -1021,44 +1058,25 @@ snapshots: tslib: 2.8.1 optional: true - '@jridgewell/gen-mapping@0.3.13': - dependencies: - '@jridgewell/sourcemap-codec': 1.5.5 - '@jridgewell/trace-mapping': 0.3.31 - - '@jridgewell/resolve-uri@3.1.2': {} - '@jridgewell/sourcemap-codec@1.5.5': {} - '@jridgewell/trace-mapping@0.3.31': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.5 - '@langfuse/core@5.4.1(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@langfuse/otel@5.4.1(@opentelemetry/api@1.9.1)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1))(@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1))': + '@langfuse/otel@5.4.1(@opentelemetry/api@1.9.1)(@opentelemetry/core@2.10.0(@opentelemetry/api@1.9.1))(@opentelemetry/exporter-trace-otlp-http@0.221.0(@opentelemetry/api@1.9.1))(@opentelemetry/sdk-trace-base@2.10.0(@opentelemetry/api@1.9.1))': dependencies: '@langfuse/core': 5.4.1(@opentelemetry/api@1.9.1) '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/exporter-trace-otlp-http': 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/exporter-trace-otlp-http': 0.221.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/api@1.9.1) '@langfuse/tracing@5.4.1(@opentelemetry/api@1.9.1)': dependencies: '@langfuse/core': 5.4.1(@opentelemetry/api@1.9.1) '@opentelemetry/api': 1.9.1 - '@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': - dependencies: - '@emnapi/core': 1.10.0 - '@emnapi/runtime': 1.10.0 - '@tybys/wasm-util': 0.10.2 - optional: true - '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': dependencies: '@emnapi/core': 1.10.0 @@ -1066,133 +1084,100 @@ snapshots: '@tybys/wasm-util': 0.10.3 optional: true - '@opentelemetry/api-logs@0.205.0': + '@opentelemetry/api-logs@0.221.0': dependencies: '@opentelemetry/api': 1.9.1 '@opentelemetry/api@1.9.1': {} - '@opentelemetry/context-async-hooks@2.7.1(@opentelemetry/api@1.9.1)': + '@opentelemetry/context-async-hooks@2.10.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/core@2.1.0(@opentelemetry/api@1.9.1)': + '@opentelemetry/core@2.10.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 '@opentelemetry/semantic-conventions': 1.41.1 - '@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.1)': + '@opentelemetry/exporter-trace-otlp-http@0.221.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/semantic-conventions': 1.41.1 + '@opentelemetry/otlp-exporter-base': 0.221.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.221.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace': 2.10.0(@opentelemetry/api@1.9.1) - '@opentelemetry/exporter-trace-otlp-http@0.205.0(@opentelemetry/api@1.9.1)': + '@opentelemetry/otlp-exporter-base@0.221.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/otlp-exporter-base': 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/otlp-transformer': 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.221.0(@opentelemetry/api@1.9.1) - '@opentelemetry/otlp-exporter-base@0.205.0(@opentelemetry/api@1.9.1)': + '@opentelemetry/otlp-transformer@0.221.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/otlp-transformer': 0.205.0(@opentelemetry/api@1.9.1) - - '@opentelemetry/otlp-transformer@0.205.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/api-logs': 0.205.0 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-logs': 0.205.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-metrics': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': 2.1.0(@opentelemetry/api@1.9.1) - protobufjs: 7.6.2 - - '@opentelemetry/resources@2.1.0(@opentelemetry/api@1.9.1)': + '@opentelemetry/api-logs': 0.221.0 + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-logs': 0.221.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-metrics': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace': 2.10.0(@opentelemetry/api@1.9.1) + + '@opentelemetry/resources@2.10.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) '@opentelemetry/semantic-conventions': 1.41.1 - '@opentelemetry/resources@2.7.1(@opentelemetry/api@1.9.1)': + '@opentelemetry/sdk-logs@0.221.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/api-logs': 0.221.0 + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.10.0(@opentelemetry/api@1.9.1) '@opentelemetry/semantic-conventions': 1.41.1 - '@opentelemetry/sdk-logs@0.205.0(@opentelemetry/api@1.9.1)': - dependencies: - '@opentelemetry/api': 1.9.1 - '@opentelemetry/api-logs': 0.205.0 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) - - '@opentelemetry/sdk-metrics@2.1.0(@opentelemetry/api@1.9.1)': + '@opentelemetry/sdk-metrics@2.10.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.10.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base@2.1.0(@opentelemetry/api@1.9.1)': + '@opentelemetry/sdk-trace-base@2.10.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace': 2.10.0(@opentelemetry/api@1.9.1) '@opentelemetry/semantic-conventions': 1.41.1 - '@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.1)': + '@opentelemetry/sdk-trace-node@2.10.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/resources': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/semantic-conventions': 1.41.1 + '@opentelemetry/context-async-hooks': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.10.0(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-node@2.7.1(@opentelemetry/api@1.9.1)': + '@opentelemetry/sdk-trace@2.10.0(@opentelemetry/api@1.9.1)': dependencies: '@opentelemetry/api': 1.9.1 - '@opentelemetry/context-async-hooks': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) - '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.10.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 '@opentelemetry/semantic-conventions@1.41.1': {} - '@oxc-project/types@0.103.0': {} - - '@oxc-project/types@0.127.0': {} + '@oxc-project/types@0.127.0': + optional: true '@oxc-project/types@0.133.0': {} - '@protobufjs/aspromise@1.1.2': {} - - '@protobufjs/base64@1.1.2': {} - - '@protobufjs/codegen@2.0.5': {} - - '@protobufjs/eventemitter@1.1.1': {} - - '@protobufjs/fetch@1.1.1': - dependencies: - '@protobufjs/aspromise': 1.1.2 - - '@protobufjs/float@1.0.2': {} - - '@protobufjs/inquire@1.1.2': {} - - '@protobufjs/path@1.1.2': {} - - '@protobufjs/pool@1.1.0': {} - - '@protobufjs/utf8@1.1.1': {} + '@oxc-project/types@0.147.0': {} '@quansync/fs@1.0.0': dependencies: quansync: 1.0.0 - '@rolldown/binding-android-arm64@1.0.0-beta.57': + '@rolldown/binding-android-arm-eabi@1.2.6': optional: true '@rolldown/binding-android-arm64@1.0.0-rc.17': @@ -1201,7 +1186,7 @@ snapshots: '@rolldown/binding-android-arm64@1.0.3': optional: true - '@rolldown/binding-darwin-arm64@1.0.0-beta.57': + '@rolldown/binding-android-arm64@1.2.6': optional: true '@rolldown/binding-darwin-arm64@1.0.0-rc.17': @@ -1210,7 +1195,7 @@ snapshots: '@rolldown/binding-darwin-arm64@1.0.3': optional: true - '@rolldown/binding-darwin-x64@1.0.0-beta.57': + '@rolldown/binding-darwin-arm64@1.2.6': optional: true '@rolldown/binding-darwin-x64@1.0.0-rc.17': @@ -1219,7 +1204,7 @@ snapshots: '@rolldown/binding-darwin-x64@1.0.3': optional: true - '@rolldown/binding-freebsd-x64@1.0.0-beta.57': + '@rolldown/binding-darwin-x64@1.2.6': optional: true '@rolldown/binding-freebsd-x64@1.0.0-rc.17': @@ -1228,7 +1213,7 @@ snapshots: '@rolldown/binding-freebsd-x64@1.0.3': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.57': + '@rolldown/binding-freebsd-x64@1.2.6': optional: true '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17': @@ -1237,7 +1222,7 @@ snapshots: '@rolldown/binding-linux-arm-gnueabihf@1.0.3': optional: true - '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.57': + '@rolldown/binding-linux-arm-gnueabihf@1.2.6': optional: true '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17': @@ -1246,7 +1231,7 @@ snapshots: '@rolldown/binding-linux-arm64-gnu@1.0.3': optional: true - '@rolldown/binding-linux-arm64-musl@1.0.0-beta.57': + '@rolldown/binding-linux-arm64-gnu@1.2.6': optional: true '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': @@ -1255,19 +1240,25 @@ snapshots: '@rolldown/binding-linux-arm64-musl@1.0.3': optional: true + '@rolldown/binding-linux-arm64-musl@1.2.6': + optional: true + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': optional: true '@rolldown/binding-linux-ppc64-gnu@1.0.3': optional: true + '@rolldown/binding-linux-ppc64-gnu@1.2.6': + optional: true + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': optional: true '@rolldown/binding-linux-s390x-gnu@1.0.3': optional: true - '@rolldown/binding-linux-x64-gnu@1.0.0-beta.57': + '@rolldown/binding-linux-s390x-gnu@1.2.6': optional: true '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': @@ -1276,7 +1267,7 @@ snapshots: '@rolldown/binding-linux-x64-gnu@1.0.3': optional: true - '@rolldown/binding-linux-x64-musl@1.0.0-beta.57': + '@rolldown/binding-linux-x64-gnu@1.2.6': optional: true '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': @@ -1285,7 +1276,7 @@ snapshots: '@rolldown/binding-linux-x64-musl@1.0.3': optional: true - '@rolldown/binding-openharmony-arm64@1.0.0-beta.57': + '@rolldown/binding-linux-x64-musl@1.2.6': optional: true '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': @@ -1294,19 +1285,14 @@ snapshots: '@rolldown/binding-openharmony-arm64@1.0.3': optional: true - '@rolldown/binding-wasm32-wasi@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': - dependencies: - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' + '@rolldown/binding-openharmony-arm64@1.2.6': optional: true '@rolldown/binding-wasm32-wasi@1.0.0-rc.17': dependencies: '@emnapi/core': 1.10.0 '@emnapi/runtime': 1.10.0 - '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) optional: true '@rolldown/binding-wasm32-wasi@1.0.3': @@ -1316,16 +1302,13 @@ snapshots: '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.57': - optional: true - '@rolldown/binding-win32-arm64-msvc@1.0.0-rc.17': optional: true '@rolldown/binding-win32-arm64-msvc@1.0.3': optional: true - '@rolldown/binding-win32-x64-msvc@1.0.0-beta.57': + '@rolldown/binding-win32-arm64-msvc@1.2.6': optional: true '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': @@ -1334,19 +1317,16 @@ snapshots: '@rolldown/binding-win32-x64-msvc@1.0.3': optional: true - '@rolldown/pluginutils@1.0.0-beta.57': {} + '@rolldown/binding-win32-x64-msvc@1.2.6': + optional: true - '@rolldown/pluginutils@1.0.0-rc.17': {} + '@rolldown/pluginutils@1.0.0-rc.17': + optional: true '@rolldown/pluginutils@1.0.1': {} '@standard-schema/spec@1.1.0': {} - '@tybys/wasm-util@0.10.2': - dependencies: - tslib: 2.8.1 - optional: true - '@tybys/wasm-util@0.10.3': dependencies: tslib: 2.8.1 @@ -1365,59 +1345,126 @@ snapshots: dependencies: undici-types: 6.21.0 - '@vitest/expect@4.1.8': + '@vitest/expect@4.1.11': dependencies: '@standard-schema/spec': 1.1.0 '@types/chai': 5.2.3 - '@vitest/spy': 4.1.8 - '@vitest/utils': 4.1.8 + '@vitest/spy': 4.1.11 + '@vitest/utils': 4.1.11 chai: 6.2.2 tinyrainbow: 3.1.0 - '@vitest/mocker@4.1.8(vite@8.0.16(@types/node@22.19.19))': + '@vitest/mocker@4.1.11(vite@8.0.16(@types/node@22.19.19))': dependencies: - '@vitest/spy': 4.1.8 + '@vitest/spy': 4.1.11 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: vite: 8.0.16(@types/node@22.19.19) - '@vitest/pretty-format@4.1.8': + '@vitest/pretty-format@4.1.11': dependencies: tinyrainbow: 3.1.0 - '@vitest/runner@4.1.8': + '@vitest/runner@4.1.11': dependencies: - '@vitest/utils': 4.1.8 + '@vitest/utils': 4.1.11 pathe: 2.0.3 - '@vitest/snapshot@4.1.8': + '@vitest/snapshot@4.1.11': dependencies: - '@vitest/pretty-format': 4.1.8 - '@vitest/utils': 4.1.8 + '@vitest/pretty-format': 4.1.11 + '@vitest/utils': 4.1.11 magic-string: 0.30.21 pathe: 2.0.3 - '@vitest/spy@4.1.8': {} + '@vitest/spy@4.1.11': {} - '@vitest/utils@4.1.8': + '@vitest/utils@4.1.11': dependencies: - '@vitest/pretty-format': 4.1.8 + '@vitest/pretty-format': 4.1.11 convert-source-map: 2.0.0 tinyrainbow: 3.1.0 - ansis@4.3.1: {} + '@yuku-codegen/binding-android-arm64@0.8.7': + optional: true - assertion-error@2.0.1: {} + '@yuku-codegen/binding-darwin-arm64@0.8.7': + optional: true - ast-kit@2.2.0: - dependencies: - '@babel/parser': 7.29.7 - pathe: 2.0.3 + '@yuku-codegen/binding-darwin-x64@0.8.7': + optional: true - birpc@4.0.0: {} + '@yuku-codegen/binding-freebsd-x64@0.8.7': + optional: true - cac@6.7.14: {} + '@yuku-codegen/binding-linux-arm-gnu@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-arm-musl@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-arm64-gnu@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-arm64-musl@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-x64-gnu@0.8.7': + optional: true + + '@yuku-codegen/binding-linux-x64-musl@0.8.7': + optional: true + + '@yuku-codegen/binding-win32-arm64@0.8.7': + optional: true + + '@yuku-codegen/binding-win32-x64@0.8.7': + optional: true + + '@yuku-parser/binding-android-arm64@0.8.7': + optional: true + + '@yuku-parser/binding-darwin-arm64@0.8.7': + optional: true + + '@yuku-parser/binding-darwin-x64@0.8.7': + optional: true + + '@yuku-parser/binding-freebsd-x64@0.8.7': + optional: true + + '@yuku-parser/binding-linux-arm-gnu@0.8.7': + optional: true + + '@yuku-parser/binding-linux-arm-musl@0.8.7': + optional: true + + '@yuku-parser/binding-linux-arm64-gnu@0.8.7': + optional: true + + '@yuku-parser/binding-linux-arm64-musl@0.8.7': + optional: true + + '@yuku-parser/binding-linux-x64-gnu@0.8.7': + optional: true + + '@yuku-parser/binding-linux-x64-musl@0.8.7': + optional: true + + '@yuku-parser/binding-win32-arm64@0.8.7': + optional: true + + '@yuku-parser/binding-win32-x64@0.8.7': + optional: true + + '@yuku-toolchain/types@0.8.7': {} + + ansis@4.3.1: {} + + assertion-error@2.0.1: {} + + cac@7.0.0: {} chai@6.2.2: {} @@ -1427,7 +1474,7 @@ snapshots: detect-libc@2.1.2: {} - dts-resolver@2.1.3: {} + dts-resolver@3.0.0: {} empathic@2.0.1: {} @@ -1439,22 +1486,20 @@ snapshots: expect-type@1.3.0: {} - fdir@6.5.0(picomatch@4.0.4): + fdir@6.5.0(picomatch@4.0.7): optionalDependencies: - picomatch: 4.0.4 + picomatch: 4.0.7 fsevents@2.3.3: optional: true - get-tsconfig@4.14.0: + get-tsconfig@5.0.0-beta.5: dependencies: resolve-pkg-maps: 1.0.0 hookable@6.1.1: {} - import-without-cache@0.2.5: {} - - jsesc@3.1.0: {} + import-without-cache@0.4.0: {} lightningcss-android-arm64@1.32.0: optional: true @@ -1505,8 +1550,6 @@ snapshots: lightningcss-win32-arm64-msvc: 1.32.0 lightningcss-win32-x64-msvc: 1.32.0 - long@5.3.2: {} - magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -1515,12 +1558,16 @@ snapshots: obug@2.1.1: {} + obug@2.1.4: {} + pathe@2.0.3: {} picocolors@1.1.1: {} picomatch@4.0.4: {} + picomatch@4.0.7: {} + postcss@8.5.16: dependencies: nanoid: 3.3.15 @@ -1529,63 +1576,24 @@ snapshots: prettier@3.9.4: {} - protobufjs@7.6.2: - dependencies: - '@protobufjs/aspromise': 1.1.2 - '@protobufjs/base64': 1.1.2 - '@protobufjs/codegen': 2.0.5 - '@protobufjs/eventemitter': 1.1.1 - '@protobufjs/fetch': 1.1.1 - '@protobufjs/float': 1.0.2 - '@protobufjs/inquire': 1.1.2 - '@protobufjs/path': 1.1.2 - '@protobufjs/pool': 1.1.0 - '@protobufjs/utf8': 1.1.1 - '@types/node': 22.19.19 - long: 5.3.2 - quansync@1.0.0: {} resolve-pkg-maps@1.0.0: {} - rolldown-plugin-dts@0.20.0(rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0))(typescript@5.9.3): + rolldown-plugin-dts@0.27.14(rolldown@1.2.6)(typescript@5.9.3): dependencies: - '@babel/generator': 7.29.7 - '@babel/parser': 7.29.7 - '@babel/types': 7.29.7 - ast-kit: 2.2.0 - birpc: 4.0.0 - dts-resolver: 2.1.3 - get-tsconfig: 4.14.0 - obug: 2.1.1 - rolldown: 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + dts-resolver: 3.0.0 + get-tsconfig: 5.0.0-beta.5 + obug: 2.1.4 + rolldown: 1.2.6 + yuku-ast: 0.8.7 + yuku-codegen: 0.8.7 + yuku-parser: 0.8.7 optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: - oxc-resolver - rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): - dependencies: - '@oxc-project/types': 0.103.0 - '@rolldown/pluginutils': 1.0.0-beta.57 - optionalDependencies: - '@rolldown/binding-android-arm64': 1.0.0-beta.57 - '@rolldown/binding-darwin-arm64': 1.0.0-beta.57 - '@rolldown/binding-darwin-x64': 1.0.0-beta.57 - '@rolldown/binding-freebsd-x64': 1.0.0-beta.57 - '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.57 - '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.57 - '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.57 - '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.57 - '@rolldown/binding-linux-x64-musl': 1.0.0-beta.57 - '@rolldown/binding-openharmony-arm64': 1.0.0-beta.57 - '@rolldown/binding-wasm32-wasi': 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.57 - '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.57 - transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - rolldown@1.0.0-rc.17: dependencies: '@oxc-project/types': 0.127.0 @@ -1606,6 +1614,7 @@ snapshots: '@rolldown/binding-wasm32-wasi': 1.0.0-rc.17 '@rolldown/binding-win32-arm64-msvc': 1.0.0-rc.17 '@rolldown/binding-win32-x64-msvc': 1.0.0-rc.17 + optional: true rolldown@1.0.3: dependencies: @@ -1628,7 +1637,26 @@ snapshots: '@rolldown/binding-win32-arm64-msvc': 1.0.3 '@rolldown/binding-win32-x64-msvc': 1.0.3 - semver@7.8.1: {} + rolldown@1.2.6: + dependencies: + '@oxc-project/types': 0.147.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm-eabi': 1.2.6 + '@rolldown/binding-android-arm64': 1.2.6 + '@rolldown/binding-darwin-arm64': 1.2.6 + '@rolldown/binding-darwin-x64': 1.2.6 + '@rolldown/binding-freebsd-x64': 1.2.6 + '@rolldown/binding-linux-arm-gnueabihf': 1.2.6 + '@rolldown/binding-linux-arm64-gnu': 1.2.6 + '@rolldown/binding-linux-arm64-musl': 1.2.6 + '@rolldown/binding-linux-ppc64-gnu': 1.2.6 + '@rolldown/binding-linux-s390x-gnu': 1.2.6 + '@rolldown/binding-linux-x64-gnu': 1.2.6 + '@rolldown/binding-linux-x64-musl': 1.2.6 + '@rolldown/binding-openharmony-arm64': 1.2.6 + '@rolldown/binding-win32-arm64-msvc': 1.2.6 + '@rolldown/binding-win32-x64-msvc': 1.2.6 siginfo@2.0.0: {} @@ -1644,40 +1672,37 @@ snapshots: tinyglobby@0.2.17: dependencies: - fdir: 6.5.0(picomatch@4.0.4) - picomatch: 4.0.4 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 tinyrainbow@3.1.0: {} tree-kill@1.2.2: {} - tsdown@0.18.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(typescript@5.9.3): + tsdown@0.22.14(typescript@5.9.3)(unrun@0.2.39): dependencies: ansis: 4.3.1 - cac: 6.7.14 + cac: 7.0.0 defu: 6.1.7 empathic: 2.0.1 hookable: 6.1.1 - import-without-cache: 0.2.5 - obug: 2.1.1 - picomatch: 4.0.4 - rolldown: 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) - rolldown-plugin-dts: 0.20.0(rolldown@1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0))(typescript@5.9.3) - semver: 7.8.1 + import-without-cache: 0.4.0 + obug: 2.1.4 + picomatch: 4.0.7 + rolldown: 1.2.6 + rolldown-plugin-dts: 0.27.14(rolldown@1.2.6)(typescript@5.9.3) tinyexec: 1.2.4 tinyglobby: 0.2.17 tree-kill: 1.2.2 unconfig-core: 7.5.0 - unrun: 0.2.39 + verkit: 0.3.2 optionalDependencies: typescript: 5.9.3 + unrun: 0.2.39 transitivePeerDependencies: - - '@emnapi/core' - - '@emnapi/runtime' - - '@ts-macro/tsc' - '@typescript/native-preview' + - '@volar/typescript' - oxc-resolver - - synckit - vue-tsc tslib@2.8.1: @@ -1695,6 +1720,9 @@ snapshots: unrun@0.2.39: dependencies: rolldown: 1.0.0-rc.17 + optional: true + + verkit@0.3.2: {} vite@8.0.16(@types/node@22.19.19): dependencies: @@ -1707,15 +1735,15 @@ snapshots: '@types/node': 22.19.19 fsevents: 2.3.3 - vitest@4.1.8(@opentelemetry/api@1.9.1)(@types/node@22.19.19)(vite@8.0.16(@types/node@22.19.19)): + vitest@4.1.11(@opentelemetry/api@1.9.1)(@types/node@22.19.19)(vite@8.0.16(@types/node@22.19.19)): dependencies: - '@vitest/expect': 4.1.8 - '@vitest/mocker': 4.1.8(vite@8.0.16(@types/node@22.19.19)) - '@vitest/pretty-format': 4.1.8 - '@vitest/runner': 4.1.8 - '@vitest/snapshot': 4.1.8 - '@vitest/spy': 4.1.8 - '@vitest/utils': 4.1.8 + '@vitest/expect': 4.1.11 + '@vitest/mocker': 4.1.11(vite@8.0.16(@types/node@22.19.19)) + '@vitest/pretty-format': 4.1.11 + '@vitest/runner': 4.1.11 + '@vitest/snapshot': 4.1.11 + '@vitest/spy': 4.1.11 + '@vitest/utils': 4.1.11 es-module-lexer: 2.1.0 expect-type: 1.3.0 magic-string: 0.30.21 @@ -1740,4 +1768,43 @@ snapshots: siginfo: 2.0.0 stackback: 0.0.2 + yuku-ast@0.8.7: + dependencies: + '@yuku-toolchain/types': 0.8.7 + + yuku-codegen@0.8.7: + dependencies: + '@yuku-toolchain/types': 0.8.7 + optionalDependencies: + '@yuku-codegen/binding-android-arm64': 0.8.7 + '@yuku-codegen/binding-darwin-arm64': 0.8.7 + '@yuku-codegen/binding-darwin-x64': 0.8.7 + '@yuku-codegen/binding-freebsd-x64': 0.8.7 + '@yuku-codegen/binding-linux-arm-gnu': 0.8.7 + '@yuku-codegen/binding-linux-arm-musl': 0.8.7 + '@yuku-codegen/binding-linux-arm64-gnu': 0.8.7 + '@yuku-codegen/binding-linux-arm64-musl': 0.8.7 + '@yuku-codegen/binding-linux-x64-gnu': 0.8.7 + '@yuku-codegen/binding-linux-x64-musl': 0.8.7 + '@yuku-codegen/binding-win32-arm64': 0.8.7 + '@yuku-codegen/binding-win32-x64': 0.8.7 + + yuku-parser@0.8.7: + dependencies: + '@yuku-toolchain/types': 0.8.7 + yuku-ast: 0.8.7 + optionalDependencies: + '@yuku-parser/binding-android-arm64': 0.8.7 + '@yuku-parser/binding-darwin-arm64': 0.8.7 + '@yuku-parser/binding-darwin-x64': 0.8.7 + '@yuku-parser/binding-freebsd-x64': 0.8.7 + '@yuku-parser/binding-linux-arm-gnu': 0.8.7 + '@yuku-parser/binding-linux-arm-musl': 0.8.7 + '@yuku-parser/binding-linux-arm64-gnu': 0.8.7 + '@yuku-parser/binding-linux-arm64-musl': 0.8.7 + '@yuku-parser/binding-linux-x64-gnu': 0.8.7 + '@yuku-parser/binding-linux-x64-musl': 0.8.7 + '@yuku-parser/binding-win32-arm64': 0.8.7 + '@yuku-parser/binding-win32-x64': 0.8.7 + zod@4.4.3: {}