diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json new file mode 100644 index 0000000..6d9a2e1 --- /dev/null +++ b/.agents/plugins/marketplace.json @@ -0,0 +1,12 @@ +{ + "name": "traceroot-codex-plugin", + "interface": { "displayName": "TraceRoot" }, + "plugins": [ + { + "name": "tracing", + "source": { "source": "local", "path": "./plugins/tracing" }, + "policy": { "installation": "AVAILABLE", "authentication": "ON_INSTALL" }, + "category": "Coding" + } + ] +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e9d96d4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# The committed bundle is a generated artifact (Codex runs it directly — there is +# no build step on install). Keep it tracked, but treat it as generated: collapse +# it in PR diffs and exclude it from GitHub language stats. +plugins/tracing/dist/index.mjs linguist-generated=true -diff + +# Lockfile and license text are not human-reviewed line-by-line — collapse them in +# diffs and keep them out of language stats so the reviewable diff is real code. +pnpm-lock.yaml linguist-generated=true -diff +LICENSE linguist-generated=true -diff diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..49c67ff --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + ci: + name: Typecheck, test, lint:dist + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Typecheck + run: pnpm run typecheck + + - name: Test + run: pnpm test + + - name: Lint dist + run: pnpm run lint:dist diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f14f3f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +node_modules +*.log +.DS_Store +.superpowers/ +.env +.env.* +coverage/ +.idea/ +.vscode/ +*.tgz + +# NOTE: plugins/tracing/dist/ is intentionally committed (Codex runs the bundle +# directly — no build step on install). Do not ignore it. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..602a850 --- /dev/null +++ b/LICENSE @@ -0,0 +1,184 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship made available under + the License, as indicated by a copyright notice that is included in + or attached to the work (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other transformations + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean, as submitted to the Licensor for inclusion + in the Work by the copyright owner or by an individual or Legal Entity + authorized to submit on behalf of the copyright owner. For the purposes + of this definition, "submitted" means any form of electronic, verbal, + or written communication sent to the Licensor or its representatives, + including but not limited to communication on electronic mailing lists, + source code control systems, and issue tracking systems that are managed + by, or on behalf of, the Licensor for the purpose of developing and + discussing the Work, but excluding communication that is conspicuously + marked or designated in writing by the copyright owner as "Not a + Contribution." + + "Contributor" shall mean Licensor and any Legal Entity on behalf of + whom a Contribution has been received by the Licensor and included + within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by the combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a cross-claim + or counterclaim in a lawsuit) alleging that the Work or any other + Contribution embodied within the Work constitutes patent infringement, + then any patent licenses granted to You under this License for that + Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works + a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, You must include a readable copy of the attribution + notices contained within such NOTICE file, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as a supplement to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own license statement for Your modifications and + may provide additional grant of rights to use, reproduce, modify, + prepare Derivative Works of, convert to other media types, publicly + display, publicly perform, sublicense, and distribute the Work and + such Derivative Works in Source or Object form. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or reproducing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or exemplary damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or all other + commercial damages or losses), even if such Contributor has been + advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may offer only + conditions that are inconsistent with the terms of this License, + only on Your own behalf and on behalf of Your Licensee, and only if + You agree to indemnify, defend, and hold each Contributor harmless + for any liability incurred by, or claims asserted against, such + Contributor by reason of your accepting any such warranty or + additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2024 TraceRoot + + 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. diff --git a/README.md b/README.md index 3878ce2..fbfd0b6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,55 @@ # traceroot-codex-plugin -TraceRoot Observability Plugin for OpenAI Codex. +Trace OpenAI Codex sessions to [TraceRoot](https://traceroot.ai). Every query becomes **one live trace** — agent turn, model calls, tool calls, file edits, and any subagents it spawns — streamed as the agent works and linked to your git repo. No daemon; tracing never blocks Codex. -> 🚧 Work in progress — placeholder README. Implementation coming soon. +## Install + +```bash +codex plugin marketplace add traceroot-ai/traceroot-codex-plugin +``` + +Enable it in `~/.codex/config.toml`: + +```toml +plugin_hooks = true + +[plugins."tracing@traceroot-codex-plugin"] +enabled = true +``` + +## Configure + +Add `~/.codex/traceroot.json` — that's all that's required: + +```json +{ + "enabled": true, + "api_key": "your-key-from-app.traceroot.ai" +} +``` + +Get your API key at [app.traceroot.ai](https://app.traceroot.ai). (The plugin runs as a Codex hook, which doesn't reliably inherit your shell environment, so the config file is preferred over environment variables.) + +
+Optional settings + +Resolved highest-precedence first: env vars → project `.codex/traceroot.json` → global `~/.codex/traceroot.json` → defaults. + +| JSON key | Env var | Default | Notes | +|----------|---------|---------|-------| +| `enabled` | `TRACE_TO_TRACEROOT` | `false` | Turn tracing on (an API key must also be set). | +| `api_key` | `TRACEROOT_API_KEY` | — | Required. | +| `host_url` | `TRACEROOT_HOST_URL` | `https://app.traceroot.ai` | Point at a self-hosted instance. | +| `max_chars` | `TRACEROOT_CODEX_MAX_CHARS` | `20000` | Truncate long span attributes. | +| `debug` | `TRACEROOT_CODEX_DEBUG` | `false` | Log to stderr. | +| `fail_on_error` | `TRACEROOT_CODEX_FAIL_ON_ERROR` | `false` | Off by default — tracing never blocks a Codex turn. | + +
+ +## Privacy + +Only what appears in your traces is sent to your TraceRoot host: prompts, tool inputs/outputs (which can include commands and file contents), model and token info, and git repo/branch. If your tools handle secrets, their inputs/outputs are part of the trace. + +## License + +Apache License 2.0 — see [LICENSE](LICENSE). diff --git a/package.json b/package.json new file mode 100644 index 0000000..137a587 --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "traceroot-codex-plugin", + "version": "0.1.0", + "description": "Trace OpenAI Codex sessions to TraceRoot", + "license": "Apache-2.0", + "type": "module", + "private": true, + "scripts": { + "build": "tsdown --config plugins/tracing/tsdown.config.ts", + "test": "vitest run", + "test:watch": "vitest", + "typecheck": "tsc --noEmit", + "lint:dist": "pnpm run build && git diff --exit-code -- plugins/tracing/dist/index.mjs" + }, + "dependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/core": "^2.0.1", + "@opentelemetry/exporter-trace-otlp-proto": "^0.205.0", + "@opentelemetry/resources": "^2.0.1", + "@opentelemetry/sdk-trace-base": "^2.0.1", + "@opentelemetry/sdk-trace-node": "^2.0.1", + "@opentelemetry/semantic-conventions": "^1.28.0" + }, + "devDependencies": { + "@types/node": "^22.10.0", + "tsdown": "^0.18.0", + "typescript": "^5.7.2", + "vitest": "^4.0.0" + }, + "engines": { "node": ">=22" }, + "packageManager": "pnpm@10.14.0" +} diff --git a/plugins/tracing/.codex-plugin/plugin.json b/plugins/tracing/.codex-plugin/plugin.json new file mode 100644 index 0000000..03357f1 --- /dev/null +++ b/plugins/tracing/.codex-plugin/plugin.json @@ -0,0 +1,22 @@ +{ + "name": "tracing", + "version": "0.1.0", + "description": "Trace OpenAI Codex sessions to TraceRoot.", + "author": { "name": "TraceRoot", "email": "support@traceroot.ai", "url": "https://traceroot.ai" }, + "homepage": "https://github.com/traceroot-ai/traceroot-codex-plugin#readme", + "repository": "https://github.com/traceroot-ai/traceroot-codex-plugin", + "license": "Apache-2.0", + "keywords": ["codex", "hooks", "traceroot", "observability", "tracing"], + "hooks": "./hooks/hooks.json", + "interface": { + "displayName": "Tracing", + "shortDescription": "Trace Codex sessions to TraceRoot", + "longDescription": "Streams each Codex query to TraceRoot as one live trace — agent turns, model calls, tool executions (incl. file edits), token usage, and spawned subagents nested in the same trace, linked to your git repo. Stateless hooks, no daemon, fail-open.", + "developerName": "TraceRoot", + "category": "Coding", + "capabilities": ["Read"], + "websiteURL": "https://traceroot.ai", + "brandColor": "#5B8DEF", + "screenshots": [] + } +} diff --git a/plugins/tracing/dist/index.mjs b/plugins/tracing/dist/index.mjs new file mode 100644 index 0000000..be14d93 --- /dev/null +++ b/plugins/tracing/dist/index.mjs @@ -0,0 +1,32524 @@ +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 zlib from "zlib"; +import { Readable } from "stream"; +import { createHash, randomBytes } from "node:crypto"; +import { execFile } from "node:child_process"; +import { promisify } from "node:util"; + +//#region rolldown:runtime +var __create = Object.create; +var __defProp = 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) => { + let target = {}; + for (var name in all) { + __defProp(target, name, { + get: all[name], + enumerable: true + }); + } + if (symbols) { + __defProp(target, Symbol.toStringTag, { value: "Module" }); + } + return target; +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { + key = keys[i]; + if (!__hasOwnProp.call(to, key) && key !== except) { + __defProp(to, key, { + get: ((k) => from[k]).bind(null, key), + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + } + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); +var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __require = /* @__PURE__ */ createRequire(import.meta.url); + +//#endregion +//#region src/config.ts +async function readJson(file) { + try { + return JSON.parse(await fs.readFile(file, "utf-8")); + } catch { + return {}; + } +} +function envFirst(...keys) { + for (const k of keys) { + const v = process.env[k]; + if (v !== void 0 && v !== "") return v; + } +} +async function getConfig(cwd = process.cwd()) { + const codexHome = process.env.CODEX_HOME ?? path.join(os$2.homedir(), ".codex"); + const globalJson = await readJson(path.join(codexHome, "traceroot.json")); + const projectJson = await readJson(path.join(cwd, ".codex", "traceroot.json")); + const j = { + ...globalJson, + ...projectJson + }; + const truthy = (v) => v === true || v === "true" || v === "1"; + const enabledFlag = envFirst("TRACE_TO_TRACEROOT") ?? (j.enabled !== void 0 ? String(j.enabled) : void 0); + const apiKey = envFirst("TRACEROOT_CODEX_API_KEY", "TRACEROOT_API_KEY") ?? globalJson.api_key; + const config = { + apiKey, + hostUrl: envFirst("TRACEROOT_CODEX_HOST_URL", "TRACEROOT_HOST_URL") ?? globalJson.host_url ?? "https://app.traceroot.ai", + environment: envFirst("TRACEROOT_ENVIRONMENT") ?? j.environment, + userId: envFirst("TRACEROOT_CODEX_USER_ID") ?? j.user_id, + maxChars: ((n) => Number.isFinite(n) ? n : 2e4)(Number(envFirst("TRACEROOT_CODEX_MAX_CHARS") ?? j.max_chars ?? 2e4)), + debug: truthy(envFirst("TRACEROOT_CODEX_DEBUG") ?? j.debug), + failOnError: truthy(envFirst("TRACEROOT_CODEX_FAIL_ON_ERROR") ?? j.fail_on_error), + enabled: false + }; + config.enabled = truthy(enabledFlag) && Boolean(apiKey); + return config; +} + +//#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 +var OTLPExporterBase; +var init_OTLPExporterBase = __esmMin((() => { + OTLPExporterBase = class { + _delegate; + constructor(_delegate) { + this._delegate = _delegate; + } + /** + * Export items. + * @param items + * @param resultCallback + */ + export(items, resultCallback) { + this._delegate.export(items, resultCallback); + } + forceFlush() { + return this._delegate.forceFlush(); + } + shutdown() { + return this._delegate.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/types.js +var OTLPExporterError; +var init_types$1 = __esmMin((() => { + OTLPExporterError = class extends Error { + code; + name = "OTLPExporterError"; + data; + constructor(message, code, data) { + super(message); + this.data = data; + this.code = code; + } + }; +})); + +//#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 +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; +} +/** +* @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 mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) { + return { + timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ?? fallbackConfiguration.timeoutMillis ?? defaultConfiguration.timeoutMillis), + concurrencyLimit: userProvidedConfiguration.concurrencyLimit ?? fallbackConfiguration.concurrencyLimit ?? defaultConfiguration.concurrencyLimit, + compression: userProvidedConfiguration.compression ?? fallbackConfiguration.compression ?? defaultConfiguration.compression + }; +} +function getSharedConfigurationDefaults() { + return { + timeoutMillis: 1e4, + concurrencyLimit: 30, + compression: "none" + }; +} +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 +var CompressionAlgorithm; +var init_legacy_node_configuration = __esmMin((() => { + ; + (function(CompressionAlgorithm$1) { + CompressionAlgorithm$1["NONE"] = "none"; + CompressionAlgorithm$1["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 +/** +* Promise queue for keeping track of export promises. Finished promises will be auto-dequeued. +* Allows for awaiting all promises in the queue. +*/ +function createBoundedQueueExportPromiseHandler(options) { + return new BoundedQueueExportPromiseHandler(options.concurrencyLimit); +} +var BoundedQueueExportPromiseHandler; +var init_bounded_queue_export_promise_handler = __esmMin((() => { + BoundedQueueExportPromiseHandler = class { + _concurrencyLimit; + _sendingPromises = []; + /** + * @param concurrencyLimit maximum promises allowed in a queue at the same time. + */ + constructor(concurrencyLimit) { + this._concurrencyLimit = concurrencyLimit; + } + pushPromise(promise) { + if (this.hasReachedLimit()) throw new Error("Concurrency Limit reached"); + this._sendingPromises.push(promise); + const popPromise = () => { + const index = this._sendingPromises.indexOf(promise); + this._sendingPromises.splice(index, 1); + }; + promise.then(popPromise, popPromise); + } + hasReachedLimit() { + return this._sendingPromises.length >= this._concurrencyLimit; + } + async awaitAll() { + await Promise.all(this._sendingPromises); + } + }; +})); + +//#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"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js +/** +* Create a function to test an API version to see if it is compatible with the provided ownVersion. +* +* The returned function has the following semantics: +* - Exact match is always compatible +* - Major versions must match exactly +* - 1.x package cannot use global 2.x package +* - 2.x package cannot use global 1.x package +* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API +* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects +* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 +* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor +* - Patch and build tag differences are not considered at this time +* +* @param ownVersion version which should be checked against +*/ +function _makeCompatibilityCheck(ownVersion) { + const acceptedVersions = new Set([ownVersion]); + const rejectedVersions = /* @__PURE__ */ new Set(); + const myVersionMatch = ownVersion.match(re); + if (!myVersionMatch) return () => false; + const ownVersionParsed = { + major: +myVersionMatch[1], + minor: +myVersionMatch[2], + patch: +myVersionMatch[3], + prerelease: myVersionMatch[4] + }; + if (ownVersionParsed.prerelease != null) return function isExactmatch(globalVersion) { + return globalVersion === ownVersion; + }; + function _reject(v) { + rejectedVersions.add(v); + return false; + } + function _accept(v) { + acceptedVersions.add(v); + return true; + } + return function isCompatible$1(globalVersion) { + if (acceptedVersions.has(globalVersion)) return true; + if (rejectedVersions.has(globalVersion)) return false; + const globalVersionMatch = globalVersion.match(re); + if (!globalVersionMatch) return _reject(globalVersion); + const globalVersionParsed = { + major: +globalVersionMatch[1], + minor: +globalVersionMatch[2], + patch: +globalVersionMatch[3], + prerelease: globalVersionMatch[4] + }; + if (globalVersionParsed.prerelease != null) return _reject(globalVersion); + if (ownVersionParsed.major !== globalVersionParsed.major) return _reject(globalVersion); + if (ownVersionParsed.major === 0) { + if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) return _accept(globalVersion); + return _reject(globalVersion); + } + if (ownVersionParsed.minor <= globalVersionParsed.minor) return _accept(globalVersion); + return _reject(globalVersion); + }; +} +var re, isCompatible; +var init_semver = __esmMin((() => { + init_version(); + re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; + isCompatible = _makeCompatibilityCheck(VERSION); +})); + +//#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; + const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { version: VERSION }; + if (!allowOverride && api[type]) { + const err = /* @__PURE__ */ new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`); + diag$2.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); + return false; + } + api[type] = instance; + diag$2.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`); + return true; +} +function getGlobal(type) { + 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}.`); + 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_semver(); + major = VERSION.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 : {}; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js +function logProxy(funcName, namespace, args) { + const logger = getGlobal("diag"); + if (!logger) return; + return logger[funcName](namespace, ...args); +} +var DiagComponentLogger; +var init_ComponentLogger = __esmMin((() => { + init_global_utils(); + DiagComponentLogger = class { + constructor(props) { + this._namespace = props.namespace || "DiagComponentLogger"; + } + debug(...args) { + return logProxy("debug", this._namespace, args); + } + error(...args) { + return logProxy("error", this._namespace, args); + } + info(...args) { + return logProxy("info", this._namespace, args); + } + warn(...args) { + return logProxy("warn", this._namespace, args); + } + verbose(...args) { + return logProxy("verbose", this._namespace, args); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js +var DiagLogLevel; +var init_types = __esmMin((() => { + ; + (function(DiagLogLevel$1) { + /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ + DiagLogLevel$1[DiagLogLevel$1["NONE"] = 0] = "NONE"; + /** Identifies an error scenario */ + DiagLogLevel$1[DiagLogLevel$1["ERROR"] = 30] = "ERROR"; + /** Identifies a warning scenario */ + DiagLogLevel$1[DiagLogLevel$1["WARN"] = 50] = "WARN"; + /** General informational log message */ + DiagLogLevel$1[DiagLogLevel$1["INFO"] = 60] = "INFO"; + /** General debug log message */ + DiagLogLevel$1[DiagLogLevel$1["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"; + /** Used to set the logging level to include all logging */ + DiagLogLevel$1[DiagLogLevel$1["ALL"] = 9999] = "ALL"; + })(DiagLogLevel || (DiagLogLevel = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js +function createLogLevelDiagLogger(maxLevel, logger) { + if (maxLevel < DiagLogLevel.NONE) maxLevel = DiagLogLevel.NONE; + else if (maxLevel > DiagLogLevel.ALL) maxLevel = DiagLogLevel.ALL; + logger = logger || {}; + function _filterFunc(funcName, theLevel) { + const theFunc = logger[funcName]; + if (typeof theFunc === "function" && maxLevel >= theLevel) return theFunc.bind(logger); + return function() {}; + } + return { + error: _filterFunc("error", DiagLogLevel.ERROR), + warn: _filterFunc("warn", DiagLogLevel.WARN), + info: _filterFunc("info", DiagLogLevel.INFO), + debug: _filterFunc("debug", DiagLogLevel.DEBUG), + verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE) + }; +} +var init_logLevelLogger = __esmMin((() => { + init_types(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js +var API_NAME$4, DiagAPI; +var init_diag = __esmMin((() => { + init_ComponentLogger(); + init_logLevelLogger(); + init_types(); + init_global_utils(); + API_NAME$4 = "diag"; + DiagAPI = class DiagAPI { + /** Get the singleton instance of the DiagAPI API */ + static instance() { + if (!this._instance) this._instance = new DiagAPI(); + return this._instance; + } + /** + * Private internal constructor + * @private + */ + constructor() { + function _logProxy(funcName) { + return function(...args) { + const logger = getGlobal("diag"); + if (!logger) return; + return logger[funcName](...args); + }; + } + const self$1 = this; + const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => { + var _a, _b, _c; + if (logger === self$1) { + 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 = err.stack) !== null && _a !== void 0 ? _a : err.message); + return false; + } + if (typeof optionsOrLogLevel === "number") optionsOrLogLevel = { logLevel: optionsOrLogLevel }; + const oldLogger = getGlobal("diag"); + const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger); + if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) { + const stack = (_c = (/* @__PURE__ */ new Error()).stack) !== null && _c !== void 0 ? _c : ""; + 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); + }; + self$1.setLogger = setLogger; + self$1.disable = () => { + unregisterGlobal(API_NAME$4, self$1); + }; + self$1.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"); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js +var BaggageImpl; +var init_baggage_impl = __esmMin((() => { + BaggageImpl = class BaggageImpl { + constructor(entries) { + this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map(); + } + getEntry(key) { + const entry = this._entries.get(key); + if (!entry) return; + return Object.assign({}, entry); + } + getAllEntries() { + return Array.from(this._entries.entries()); + } + setEntry(key, entry) { + const newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.set(key, entry); + return newBaggage; + } + removeEntry(key) { + const newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.delete(key); + return newBaggage; + } + removeEntries(...keys) { + const newBaggage = new BaggageImpl(this._entries); + for (const key of keys) newBaggage._entries.delete(key); + return newBaggage; + } + clear() { + return new BaggageImpl(); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js +var baggageEntryMetadataSymbol; +var init_symbol = __esmMin((() => { + baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata"); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/utils.js +/** +* Create a new Baggage with optional entries +* +* @param entries An array of baggage entries the new baggage should contain +*/ +function createBaggage(entries = {}) { + return new BaggageImpl(new Map(Object.entries(entries))); +} +/** +* Create a serializable BaggageEntryMetadata object from a string. +* +* @param str string metadata. Format is currently not defined by the spec and has no special meaning. +* +* @since 1.0.0 +*/ +function baggageEntryMetadataFromString(str$1) { + if (typeof str$1 !== "string") { + diag$1.error(`Cannot create baggage metadata from unknown type: ${typeof str$1}`); + str$1 = ""; + } + return { + __TYPE__: baggageEntryMetadataSymbol, + toString() { + return str$1; + } + }; +} +var diag$1; +var init_utils$2 = __esmMin((() => { + init_diag(); + init_baggage_impl(); + init_symbol(); + diag$1 = DiagAPI.instance(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js +/** +* Get a key to uniquely identify a context value +* +* @since 1.0.0 +*/ +function createContextKey(description) { + return Symbol.for(description); +} +var BaseContext, ROOT_CONTEXT; +var init_context$1 = __esmMin((() => { + BaseContext = class BaseContext { + /** + * Construct a new context which inherits values from an optional parent context. + * + * @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; + }; + self$1.deleteValue = (key) => { + const context$1 = new BaseContext(self$1._currentContext); + context$1._currentContext.delete(key); + return context$1; + }; + } + }; + ROOT_CONTEXT = new BaseContext(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js +var consoleMap, _originalConsoleMethods, DiagConsoleLogger; +var init_consoleLogger = __esmMin((() => { + consoleMap = [ + { + n: "error", + c: "error" + }, + { + n: "warn", + c: "warn" + }, + { + n: "info", + c: "info" + }, + { + n: "debug", + c: "debug" + }, + { + n: "verbose", + c: "trace" + } + ]; + _originalConsoleMethods = {}; + if (typeof console !== "undefined") { + for (const key of [ + "error", + "warn", + "info", + "debug", + "trace", + "log" + ]) if (typeof console[key] === "function") _originalConsoleMethods[key] = console[key]; + } + DiagConsoleLogger = class { + constructor() { + function _consoleFunc(funcName) { + return function(...args) { + let theFunc = _originalConsoleMethods[funcName]; + if (typeof theFunc !== "function") theFunc = _originalConsoleMethods["log"]; + if (typeof theFunc !== "function" && console) { + theFunc = console[funcName]; + if (typeof theFunc !== "function") theFunc = console.log; + } + if (typeof theFunc === "function") return theFunc.apply(console, args); + }; + } + for (let i = 0; i < consoleMap.length; i++) this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js +/** +* Create a no-op Meter +* +* @since 1.3.0 +*/ +function createNoopMeter() { + return NOOP_METER; +} +var NoopMeter, NoopMetric, NoopCounterMetric, NoopUpDownCounterMetric, NoopGaugeMetric, NoopHistogramMetric, NoopObservableMetric, NoopObservableCounterMetric, NoopObservableGaugeMetric, NoopObservableUpDownCounterMetric, NOOP_METER, NOOP_COUNTER_METRIC, NOOP_GAUGE_METRIC, NOOP_HISTOGRAM_METRIC, NOOP_UP_DOWN_COUNTER_METRIC, NOOP_OBSERVABLE_COUNTER_METRIC, NOOP_OBSERVABLE_GAUGE_METRIC, NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; +var init_NoopMeter = __esmMin((() => { + NoopMeter = class { + constructor() {} + /** + * @see {@link Meter.createGauge} + */ + createGauge(_name, _options) { + return NOOP_GAUGE_METRIC; + } + /** + * @see {@link Meter.createHistogram} + */ + createHistogram(_name, _options) { + return NOOP_HISTOGRAM_METRIC; + } + /** + * @see {@link Meter.createCounter} + */ + createCounter(_name, _options) { + return NOOP_COUNTER_METRIC; + } + /** + * @see {@link Meter.createUpDownCounter} + */ + createUpDownCounter(_name, _options) { + return NOOP_UP_DOWN_COUNTER_METRIC; + } + /** + * @see {@link Meter.createObservableGauge} + */ + createObservableGauge(_name, _options) { + return NOOP_OBSERVABLE_GAUGE_METRIC; + } + /** + * @see {@link Meter.createObservableCounter} + */ + createObservableCounter(_name, _options) { + return NOOP_OBSERVABLE_COUNTER_METRIC; + } + /** + * @see {@link Meter.createObservableUpDownCounter} + */ + createObservableUpDownCounter(_name, _options) { + return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; + } + /** + * @see {@link Meter.addBatchObservableCallback} + */ + addBatchObservableCallback(_callback, _observables) {} + /** + * @see {@link Meter.removeBatchObservableCallback} + */ + removeBatchObservableCallback(_callback) {} + }; + NoopMetric = class {}; + NoopCounterMetric = class extends NoopMetric { + add(_value, _attributes) {} + }; + NoopUpDownCounterMetric = class extends NoopMetric { + add(_value, _attributes) {} + }; + NoopGaugeMetric = class extends NoopMetric { + record(_value, _attributes) {} + }; + NoopHistogramMetric = class extends NoopMetric { + record(_value, _attributes) {} + }; + NoopObservableMetric = class { + addCallback(_callback) {} + removeCallback(_callback) {} + }; + NoopObservableCounterMetric = class extends NoopObservableMetric {}; + NoopObservableGaugeMetric = class extends NoopObservableMetric {}; + NoopObservableUpDownCounterMetric = class extends NoopObservableMetric {}; + NOOP_METER = new NoopMeter(); + NOOP_COUNTER_METRIC = new NoopCounterMetric(); + NOOP_GAUGE_METRIC = new NoopGaugeMetric(); + NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric(); + NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric(); + NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric(); + NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric(); + NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/Metric.js +var ValueType; +var init_Metric = __esmMin((() => { + ; + (function(ValueType$1) { + ValueType$1[ValueType$1["INT"] = 0] = "INT"; + ValueType$1[ValueType$1["DOUBLE"] = 1] = "DOUBLE"; + })(ValueType || (ValueType = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js +var defaultTextMapGetter, defaultTextMapSetter; +var init_TextMapPropagator = __esmMin((() => { + defaultTextMapGetter = { + get(carrier, key) { + if (carrier == null) return; + return carrier[key]; + }, + keys(carrier) { + if (carrier == null) return []; + return Object.keys(carrier); + } + }; + defaultTextMapSetter = { set(carrier, key, value) { + if (carrier == null) return; + carrier[key] = value; + } }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js +var NoopContextManager; +var init_NoopContextManager = __esmMin((() => { + init_context$1(); + NoopContextManager = class { + active() { + return ROOT_CONTEXT; + } + with(_context, fn, thisArg, ...args) { + return fn.call(thisArg, ...args); + } + bind(_context, target) { + return target; + } + enable() { + return this; + } + disable() { + return this; + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/context.js +var API_NAME$3, NOOP_CONTEXT_MANAGER, ContextAPI; +var init_context = __esmMin((() => { + init_NoopContextManager(); + init_global_utils(); + init_diag(); + API_NAME$3 = "context"; + NOOP_CONTEXT_MANAGER = new NoopContextManager(); + ContextAPI = class ContextAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() {} + /** Get the singleton instance of the Context API */ + static getInstance() { + if (!this._instance) this._instance = new ContextAPI(); + return this._instance; + } + /** + * Set the current context manager. + * + * @returns true if the context manager was successfully registered, else false + */ + setGlobalContextManager(contextManager) { + return registerGlobal(API_NAME$3, contextManager, DiagAPI.instance()); + } + /** + * Get the currently active context + */ + active() { + return this._getContextManager().active(); + } + /** + * Execute a function with an active context + * + * @param context context to be active during function execution + * @param fn function to execute in a context + * @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); + } + /** + * Bind a context to a target function or event emitter + * + * @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); + } + _getContextManager() { + return getGlobal(API_NAME$3) || NOOP_CONTEXT_MANAGER; + } + /** Disable and remove the global context manager */ + disable() { + this._getContextManager().disable(); + unregisterGlobal(API_NAME$3, DiagAPI.instance()); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js +var TraceFlags; +var init_trace_flags = __esmMin((() => { + ; + (function(TraceFlags$1) { + /** Represents no flag set. */ + TraceFlags$1[TraceFlags$1["NONE"] = 0] = "NONE"; + /** Bit to represent whether trace is sampled in trace flags. */ + TraceFlags$1[TraceFlags$1["SAMPLED"] = 1] = "SAMPLED"; + })(TraceFlags || (TraceFlags = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js +var INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT; +var init_invalid_span_constants = __esmMin((() => { + init_trace_flags(); + INVALID_SPANID = "0000000000000000"; + INVALID_TRACEID = "00000000000000000000000000000000"; + INVALID_SPAN_CONTEXT = { + traceId: INVALID_TRACEID, + spanId: INVALID_SPANID, + traceFlags: TraceFlags.NONE + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js +var NonRecordingSpan; +var init_NonRecordingSpan = __esmMin((() => { + init_invalid_span_constants(); + NonRecordingSpan = class { + constructor(spanContext = INVALID_SPAN_CONTEXT) { + this._spanContext = spanContext; + } + spanContext() { + return this._spanContext; + } + setAttribute(_key, _value) { + return this; + } + setAttributes(_attributes) { + return this; + } + addEvent(_name, _attributes) { + return this; + } + addLink(_link) { + return this; + } + addLinks(_links) { + return this; + } + setStatus(_status) { + return this; + } + updateName(_name) { + return this; + } + end(_endTime) {} + isRecording() { + return false; + } + recordException(_exception, _time) {} + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js +/** +* Return the span if one exists +* +* @param context context to get span from +*/ +function getSpan(context$1) { + return context$1.getValue(SPAN_KEY) || void 0; +} +/** +* Gets the span from the current context, if one exists. +*/ +function getActiveSpan() { + return getSpan(ContextAPI.getInstance().active()); +} +/** +* Set the span on a context +* +* @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); +} +/** +* Remove current span stored in the context +* +* @param context context to delete span from +*/ +function deleteSpan(context$1) { + return context$1.deleteValue(SPAN_KEY); +} +/** +* Wrap span context in a NoopSpan and set as span in a new +* context +* +* @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)); +} +/** +* Get the span context of the span if it exists. +* +* @param context context to get values from +*/ +function getSpanContext(context$1) { + var _a; + return (_a = getSpan(context$1)) === null || _a === void 0 ? void 0 : _a.spanContext(); +} +var SPAN_KEY; +var init_context_utils = __esmMin((() => { + init_context$1(); + init_NonRecordingSpan(); + init_context(); + SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN"); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js +function isValidHex(id, length) { + if (typeof id !== "string" || id.length !== length) return false; + let r = 0; + for (let i = 0; i < id.length; i += 4) r += (isHex[id.charCodeAt(i)] | 0) + (isHex[id.charCodeAt(i + 1)] | 0) + (isHex[id.charCodeAt(i + 2)] | 0) + (isHex[id.charCodeAt(i + 3)] | 0); + return r === length; +} +/** +* @since 1.0.0 +*/ +function isValidTraceId(traceId) { + return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID; +} +/** +* @since 1.0.0 +*/ +function isValidSpanId(spanId) { + return isValidHex(spanId, 16) && spanId !== INVALID_SPANID; +} +/** +* Returns true if this {@link SpanContext} is valid. +* @return true if this {@link SpanContext} is valid. +* +* @since 1.0.0 +*/ +function isSpanContextValid(spanContext) { + return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId); +} +/** +* Wrap the given {@link SpanContext} in a new non-recording {@link Span} +* +* @param spanContext span context to be wrapped +* @returns a new non-recording {@link Span} with the provided context +*/ +function wrapSpanContext(spanContext) { + return new NonRecordingSpan(spanContext); +} +var isHex; +var init_spancontext_utils = __esmMin((() => { + init_invalid_span_constants(); + init_NonRecordingSpan(); + isHex = new Uint8Array([ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1 + ]); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js +function isSpanContext(spanContext) { + return spanContext !== null && typeof spanContext === "object" && "spanId" in spanContext && typeof spanContext["spanId"] === "string" && "traceId" in spanContext && typeof spanContext["traceId"] === "string" && "traceFlags" in spanContext && typeof spanContext["traceFlags"] === "number"; +} +var contextApi, NoopTracer; +var init_NoopTracer = __esmMin((() => { + init_context(); + init_context_utils(); + init_NonRecordingSpan(); + init_spancontext_utils(); + contextApi = ContextAPI.getInstance(); + NoopTracer = class { + startSpan(name, options, context$1 = contextApi.active()) { + if (Boolean(options === null || options === void 0 ? void 0 : options.root)) return new NonRecordingSpan(); + const parentFromContext = context$1 && getSpanContext(context$1); + if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) return new NonRecordingSpan(parentFromContext); + else return new NonRecordingSpan(); + } + 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 !== null && ctx !== void 0 ? ctx : contextApi.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = setSpan(parentContext, span); + return contextApi.with(contextWithSpanSet, fn, void 0, span); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js +var NOOP_TRACER, ProxyTracer; +var init_ProxyTracer = __esmMin((() => { + init_NoopTracer(); + NOOP_TRACER = new NoopTracer(); + ProxyTracer = class { + constructor(provider, name, version, options) { + this._provider = provider; + this.name = name; + this.version = version; + this.options = options; + } + startSpan(name, options, context$1) { + return this._getTracer().startSpan(name, options, context$1); + } + startActiveSpan(_name, _options, _context, _fn) { + const tracer = this._getTracer(); + return Reflect.apply(tracer.startActiveSpan, tracer, arguments); + } + /** + * Try to get a tracer from the proxy tracer provider. + * If the proxy tracer provider has no delegate, return a noop tracer. + */ + _getTracer() { + if (this._delegate) return this._delegate; + const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); + if (!tracer) return NOOP_TRACER; + this._delegate = tracer; + return this._delegate; + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js +var NoopTracerProvider; +var init_NoopTracerProvider = __esmMin((() => { + init_NoopTracer(); + NoopTracerProvider = class { + getTracer(_name, _version, _options) { + return new NoopTracer(); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js +var NOOP_TRACER_PROVIDER, ProxyTracerProvider; +var init_ProxyTracerProvider = __esmMin((() => { + init_ProxyTracer(); + init_NoopTracerProvider(); + NOOP_TRACER_PROVIDER = new NoopTracerProvider(); + ProxyTracerProvider = class { + /** + * Get a {@link ProxyTracer} + */ + 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; + return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER; + } + /** + * Set the delegate tracer provider + */ + setDelegate(delegate) { + this._delegate = delegate; + } + getDelegateTracer(name, version, options) { + var _a; + return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js +var SamplingDecision; +var init_SamplingResult = __esmMin((() => { + ; + (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"; + })(SamplingDecision || (SamplingDecision = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js +var SpanKind; +var init_span_kind = __esmMin((() => { + ; + (function(SpanKind$1) { + /** Default value. Indicates that the span is used internally. */ + SpanKind$1[SpanKind$1["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"; + /** + * Indicates that the span covers the client-side wrapper around an RPC or + * other remote request. + */ + SpanKind$1[SpanKind$1["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"; + /** + * 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 = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/status.js +var SpanStatusCode; +var init_status = __esmMin((() => { + ; + (function(SpanStatusCode$1) { + /** + * The default status. + */ + SpanStatusCode$1[SpanStatusCode$1["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"; + /** + * The operation contains an error. + */ + SpanStatusCode$1[SpanStatusCode$1["ERROR"] = 2] = "ERROR"; + })(SpanStatusCode || (SpanStatusCode = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js +/** +* 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 +*/ +function validateKey(key) { + return VALID_KEY_REGEX.test(key); +} +/** +* Value is opaque string up to 256 characters printable ASCII RFC0020 +* characters (i.e., the range 0x20 to 0x7E) except comma , and =. +*/ +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 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_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js +var MAX_TRACE_STATE_ITEMS, MAX_TRACE_STATE_LEN, LIST_MEMBERS_SEPARATOR, LIST_MEMBER_KEY_VALUE_SPLITTER, TraceStateImpl; +var init_tracestate_impl = __esmMin((() => { + init_tracestate_validators(); + MAX_TRACE_STATE_ITEMS = 32; + MAX_TRACE_STATE_LEN = 512; + LIST_MEMBERS_SEPARATOR = ","; + LIST_MEMBER_KEY_VALUE_SPLITTER = "="; + TraceStateImpl = class TraceStateImpl { + constructor(rawTraceState) { + this._internalState = /* @__PURE__ */ new Map(); + 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 Array.from(this._internalState.keys()).reduceRight((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).reduceRight((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 (validateKey(key) && 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 TraceStateImpl(); + traceState._internalState = new Map(this._internalState); + return traceState; + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js +/** +* @since 1.1.0 +*/ +function createTraceState(rawTraceState) { + return new TraceStateImpl(rawTraceState); +} +var init_utils$1 = __esmMin((() => { + init_tracestate_impl(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js +var context; +var init_context_api = __esmMin((() => { + init_context(); + context = ContextAPI.getInstance(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag-api.js +var diag; +var init_diag_api = __esmMin((() => { + init_diag(); + diag = DiagAPI.instance(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js +var NoopMeterProvider, NOOP_METER_PROVIDER; +var init_NoopMeterProvider = __esmMin((() => { + init_NoopMeter(); + NoopMeterProvider = class { + getMeter(_name, _version, _options) { + return NOOP_METER; + } + }; + NOOP_METER_PROVIDER = new NoopMeterProvider(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/metrics.js +var API_NAME$2, MetricsAPI; +var init_metrics = __esmMin((() => { + init_NoopMeterProvider(); + init_global_utils(); + init_diag(); + API_NAME$2 = "metrics"; + MetricsAPI = class MetricsAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() {} + /** Get the singleton instance of the Metrics API */ + static getInstance() { + if (!this._instance) this._instance = new MetricsAPI(); + return this._instance; + } + /** + * Set the current global meter provider. + * Returns true if the meter provider was successfully registered, else false. + */ + setGlobalMeterProvider(provider) { + return registerGlobal(API_NAME$2, provider, DiagAPI.instance()); + } + /** + * Returns the global meter provider. + */ + getMeterProvider() { + return getGlobal(API_NAME$2) || NOOP_METER_PROVIDER; + } + /** + * Returns a meter from the global meter provider. + */ + getMeter(name, version, options) { + return this.getMeterProvider().getMeter(name, version, options); + } + /** Remove the global meter provider */ + disable() { + unregisterGlobal(API_NAME$2, DiagAPI.instance()); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics-api.js +var metrics; +var init_metrics_api = __esmMin((() => { + init_metrics(); + metrics = MetricsAPI.getInstance(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js +var NoopTextMapPropagator; +var init_NoopTextMapPropagator = __esmMin((() => { + NoopTextMapPropagator = class { + /** 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; + } + fields() { + return []; + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js +/** +* Retrieve the current baggage from the given context +* +* @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; +} +/** +* Retrieve the current baggage from the active/current context +* +* @returns {Baggage} Extracted baggage from the context +*/ +function getActiveBaggage() { + return getBaggage(ContextAPI.getInstance().active()); +} +/** +* Store a baggage in the given context +* +* @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); +} +/** +* 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); +} +var BAGGAGE_KEY; +var init_context_helpers = __esmMin((() => { + init_context(); + init_context$1(); + BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key"); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/propagation.js +var API_NAME$1, NOOP_TEXT_MAP_PROPAGATOR, PropagationAPI; +var init_propagation = __esmMin((() => { + init_global_utils(); + init_NoopTextMapPropagator(); + init_TextMapPropagator(); + init_context_helpers(); + init_utils$2(); + init_diag(); + API_NAME$1 = "propagation"; + NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator(); + PropagationAPI = class PropagationAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { + this.createBaggage = createBaggage; + this.getBaggage = getBaggage; + this.getActiveBaggage = getActiveBaggage; + this.setBaggage = setBaggage; + this.deleteBaggage = deleteBaggage; + } + /** Get the singleton instance of the Propagator API */ + static getInstance() { + if (!this._instance) this._instance = new PropagationAPI(); + return this._instance; + } + /** + * Set the current propagator. + * + * @returns true if the propagator was successfully registered, else false + */ + setGlobalPropagator(propagator) { + return registerGlobal(API_NAME$1, propagator, DiagAPI.instance()); + } + /** + * Inject context into a carrier to be propagated inter-process + * + * @param context Context carrying tracing data to inject + * @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); + } + /** + * Extract context from a carrier + * + * @param context Context which the newly created context will inherit from + * @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); + } + /** + * Return a list of all fields which may be used by the propagator. + */ + fields() { + return this._getGlobalPropagator().fields(); + } + /** Remove the global propagator */ + disable() { + unregisterGlobal(API_NAME$1, DiagAPI.instance()); + } + _getGlobalPropagator() { + return getGlobal(API_NAME$1) || NOOP_TEXT_MAP_PROPAGATOR; + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation-api.js +var propagation; +var init_propagation_api = __esmMin((() => { + init_propagation(); + propagation = PropagationAPI.getInstance(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js +var API_NAME, TraceAPI; +var init_trace$1 = __esmMin((() => { + init_global_utils(); + init_ProxyTracerProvider(); + init_spancontext_utils(); + init_context_utils(); + init_diag(); + API_NAME = "trace"; + TraceAPI = class TraceAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { + this._proxyTracerProvider = new ProxyTracerProvider(); + this.wrapSpanContext = wrapSpanContext; + this.isSpanContextValid = isSpanContextValid; + this.deleteSpan = deleteSpan; + this.getSpan = getSpan; + this.getActiveSpan = getActiveSpan; + this.getSpanContext = getSpanContext; + this.setSpan = setSpan; + this.setSpanContext = setSpanContext; + } + /** Get the singleton instance of the Trace API */ + static getInstance() { + if (!this._instance) this._instance = new TraceAPI(); + return this._instance; + } + /** + * Set the current global tracer. + * + * @returns true if the tracer provider was successfully registered, else false + */ + setGlobalTracerProvider(provider) { + const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance()); + if (success) this._proxyTracerProvider.setDelegate(provider); + return success; + } + /** + * Returns the global tracer provider. + */ + getTracerProvider() { + return getGlobal(API_NAME) || this._proxyTracerProvider; + } + /** + * Returns a tracer from the global tracer provider. + */ + getTracer(name, version) { + return this.getTracerProvider().getTracer(name, version); + } + /** Remove the global tracer provider */ + disable() { + unregisterGlobal(API_NAME, DiagAPI.instance()); + this._proxyTracerProvider = new ProxyTracerProvider(); + } + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js +var trace; +var init_trace_api = __esmMin((() => { + init_trace$1(); + trace = TraceAPI.getInstance(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/index.js +var esm_exports$2 = /* @__PURE__ */ __exportAll({ + DiagConsoleLogger: () => DiagConsoleLogger, + DiagLogLevel: () => DiagLogLevel, + INVALID_SPANID: () => INVALID_SPANID, + INVALID_SPAN_CONTEXT: () => INVALID_SPAN_CONTEXT, + INVALID_TRACEID: () => INVALID_TRACEID, + ProxyTracer: () => ProxyTracer, + ProxyTracerProvider: () => ProxyTracerProvider, + ROOT_CONTEXT: () => ROOT_CONTEXT, + SamplingDecision: () => SamplingDecision, + SpanKind: () => SpanKind, + SpanStatusCode: () => SpanStatusCode, + TraceFlags: () => TraceFlags, + ValueType: () => ValueType, + baggageEntryMetadataFromString: () => baggageEntryMetadataFromString, + context: () => context, + createContextKey: () => createContextKey, + createNoopMeter: () => createNoopMeter, + createTraceState: () => createTraceState, + default: () => esm_default, + defaultTextMapGetter: () => defaultTextMapGetter, + defaultTextMapSetter: () => defaultTextMapSetter, + diag: () => diag, + isSpanContextValid: () => isSpanContextValid, + isValidSpanId: () => isValidSpanId, + isValidTraceId: () => isValidTraceId, + metrics: () => metrics, + propagation: () => propagation, + trace: () => trace +}); +var esm_default; +var init_esm$2 = __esmMin((() => { + init_utils$2(); + init_context$1(); + init_consoleLogger(); + init_types(); + init_NoopMeter(); + init_Metric(); + init_TextMapPropagator(); + init_ProxyTracer(); + init_ProxyTracerProvider(); + init_SamplingResult(); + init_span_kind(); + init_status(); + init_trace_flags(); + init_utils$1(); + init_spancontext_utils(); + init_invalid_span_constants(); + init_context_api(); + init_diag_api(); + init_metrics_api(); + init_propagation_api(); + init_trace_api(); + esm_default = { + context, + diag, + metrics, + propagation, + trace + }; +})); + +//#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$1 = /* @__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; +})); + +//#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$1 = /* @__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; +})); + +//#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$7 = /* @__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$1(); + 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; +})); + +//#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$1 = /* @__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(); + /** + * 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]; + } + }; + 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$1 = /* @__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.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$1 = /* @__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; + } +})); + +//#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$1 = /* @__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)); + } + /** + * 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. + */ + 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; + } +})); + +//#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$1 = /* @__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)(); + /** + * Set the global error handler + * @param {ErrorHandler} handler + */ + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + /** + * Return the global error handler + * @param {Exception} ex + */ + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +})); + +//#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$1 = /* @__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"); + /** + * 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$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.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$1.inspect)(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`); + return false; + } + } + 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; +})); + +//#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$1 = /* @__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; +})); + +//#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) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.otperformance = void 0; + const perf_hooks_1 = __require("perf_hooks"); + exports.otperformance = perf_hooks_1.performance; +})); + +//#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$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "2.1.0"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js +/** +* Creates a const map from the given values +* @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__ */ +function createConstMap(values) { + let res = {}; + const len = values.length; + for (let lp = 0; lp < len; lp++) { + const val = values[lp]; + if (val) res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val; + } + return res; +} +var init_utils = __esmMin((() => {})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js +var TMP_AWS_LAMBDA_INVOKED_ARN, TMP_DB_SYSTEM, TMP_DB_CONNECTION_STRING, TMP_DB_USER, TMP_DB_JDBC_DRIVER_CLASSNAME, TMP_DB_NAME, TMP_DB_STATEMENT, TMP_DB_OPERATION, TMP_DB_MSSQL_INSTANCE_NAME, TMP_DB_CASSANDRA_KEYSPACE, TMP_DB_CASSANDRA_PAGE_SIZE, TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, TMP_DB_CASSANDRA_TABLE, TMP_DB_CASSANDRA_IDEMPOTENCE, TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, TMP_DB_CASSANDRA_COORDINATOR_ID, TMP_DB_CASSANDRA_COORDINATOR_DC, TMP_DB_HBASE_NAMESPACE, TMP_DB_REDIS_DATABASE_INDEX, TMP_DB_MONGODB_COLLECTION, TMP_DB_SQL_TABLE, TMP_EXCEPTION_TYPE, TMP_EXCEPTION_MESSAGE, TMP_EXCEPTION_STACKTRACE, TMP_EXCEPTION_ESCAPED, TMP_FAAS_TRIGGER, TMP_FAAS_EXECUTION, TMP_FAAS_DOCUMENT_COLLECTION, TMP_FAAS_DOCUMENT_OPERATION, TMP_FAAS_DOCUMENT_TIME, TMP_FAAS_DOCUMENT_NAME, TMP_FAAS_TIME, TMP_FAAS_CRON, TMP_FAAS_COLDSTART, TMP_FAAS_INVOKED_NAME, TMP_FAAS_INVOKED_PROVIDER, TMP_FAAS_INVOKED_REGION, TMP_NET_TRANSPORT, TMP_NET_PEER_IP, TMP_NET_PEER_PORT, TMP_NET_PEER_NAME, TMP_NET_HOST_IP, TMP_NET_HOST_PORT, TMP_NET_HOST_NAME, TMP_NET_HOST_CONNECTION_TYPE, TMP_NET_HOST_CONNECTION_SUBTYPE, TMP_NET_HOST_CARRIER_NAME, TMP_NET_HOST_CARRIER_MCC, TMP_NET_HOST_CARRIER_MNC, TMP_NET_HOST_CARRIER_ICC, TMP_PEER_SERVICE, TMP_ENDUSER_ID, TMP_ENDUSER_ROLE, TMP_ENDUSER_SCOPE, TMP_THREAD_ID, TMP_THREAD_NAME, TMP_CODE_FUNCTION, TMP_CODE_NAMESPACE, TMP_CODE_FILEPATH, TMP_CODE_LINENO, TMP_HTTP_METHOD, TMP_HTTP_URL, TMP_HTTP_TARGET, TMP_HTTP_HOST, TMP_HTTP_SCHEME, TMP_HTTP_STATUS_CODE, TMP_HTTP_FLAVOR, TMP_HTTP_USER_AGENT, TMP_HTTP_REQUEST_CONTENT_LENGTH, TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, TMP_HTTP_RESPONSE_CONTENT_LENGTH, TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, TMP_HTTP_SERVER_NAME, TMP_HTTP_ROUTE, TMP_HTTP_CLIENT_IP, TMP_AWS_DYNAMODB_TABLE_NAMES, TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, TMP_AWS_DYNAMODB_CONSISTENT_READ, TMP_AWS_DYNAMODB_PROJECTION, TMP_AWS_DYNAMODB_LIMIT, TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, TMP_AWS_DYNAMODB_INDEX_NAME, TMP_AWS_DYNAMODB_SELECT, TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, TMP_AWS_DYNAMODB_TABLE_COUNT, TMP_AWS_DYNAMODB_SCAN_FORWARD, TMP_AWS_DYNAMODB_SEGMENT, TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, TMP_AWS_DYNAMODB_COUNT, TMP_AWS_DYNAMODB_SCANNED_COUNT, TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, TMP_MESSAGING_SYSTEM, TMP_MESSAGING_DESTINATION, TMP_MESSAGING_DESTINATION_KIND, TMP_MESSAGING_TEMP_DESTINATION, TMP_MESSAGING_PROTOCOL, TMP_MESSAGING_PROTOCOL_VERSION, TMP_MESSAGING_URL, TMP_MESSAGING_MESSAGE_ID, TMP_MESSAGING_CONVERSATION_ID, TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, TMP_MESSAGING_OPERATION, TMP_MESSAGING_CONSUMER_ID, TMP_MESSAGING_RABBITMQ_ROUTING_KEY, TMP_MESSAGING_KAFKA_MESSAGE_KEY, TMP_MESSAGING_KAFKA_CONSUMER_GROUP, TMP_MESSAGING_KAFKA_CLIENT_ID, TMP_MESSAGING_KAFKA_PARTITION, TMP_MESSAGING_KAFKA_TOMBSTONE, TMP_RPC_SYSTEM, TMP_RPC_SERVICE, TMP_RPC_METHOD, TMP_RPC_GRPC_STATUS_CODE, TMP_RPC_JSONRPC_VERSION, TMP_RPC_JSONRPC_REQUEST_ID, TMP_RPC_JSONRPC_ERROR_CODE, TMP_RPC_JSONRPC_ERROR_MESSAGE, TMP_MESSAGE_TYPE, TMP_MESSAGE_ID, TMP_MESSAGE_COMPRESSED_SIZE, TMP_MESSAGE_UNCOMPRESSED_SIZE, SEMATTRS_AWS_LAMBDA_INVOKED_ARN, SEMATTRS_DB_SYSTEM, SEMATTRS_DB_CONNECTION_STRING, SEMATTRS_DB_USER, SEMATTRS_DB_JDBC_DRIVER_CLASSNAME, SEMATTRS_DB_NAME, SEMATTRS_DB_STATEMENT, SEMATTRS_DB_OPERATION, SEMATTRS_DB_MSSQL_INSTANCE_NAME, SEMATTRS_DB_CASSANDRA_KEYSPACE, SEMATTRS_DB_CASSANDRA_PAGE_SIZE, SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL, SEMATTRS_DB_CASSANDRA_TABLE, SEMATTRS_DB_CASSANDRA_IDEMPOTENCE, SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, SEMATTRS_DB_CASSANDRA_COORDINATOR_ID, SEMATTRS_DB_CASSANDRA_COORDINATOR_DC, SEMATTRS_DB_HBASE_NAMESPACE, SEMATTRS_DB_REDIS_DATABASE_INDEX, SEMATTRS_DB_MONGODB_COLLECTION, SEMATTRS_DB_SQL_TABLE, SEMATTRS_EXCEPTION_TYPE, SEMATTRS_EXCEPTION_MESSAGE, SEMATTRS_EXCEPTION_STACKTRACE, SEMATTRS_EXCEPTION_ESCAPED, SEMATTRS_FAAS_TRIGGER, SEMATTRS_FAAS_EXECUTION, SEMATTRS_FAAS_DOCUMENT_COLLECTION, SEMATTRS_FAAS_DOCUMENT_OPERATION, SEMATTRS_FAAS_DOCUMENT_TIME, SEMATTRS_FAAS_DOCUMENT_NAME, SEMATTRS_FAAS_TIME, SEMATTRS_FAAS_CRON, SEMATTRS_FAAS_COLDSTART, SEMATTRS_FAAS_INVOKED_NAME, SEMATTRS_FAAS_INVOKED_PROVIDER, SEMATTRS_FAAS_INVOKED_REGION, SEMATTRS_NET_TRANSPORT, SEMATTRS_NET_PEER_IP, SEMATTRS_NET_PEER_PORT, SEMATTRS_NET_PEER_NAME, SEMATTRS_NET_HOST_IP, SEMATTRS_NET_HOST_PORT, SEMATTRS_NET_HOST_NAME, SEMATTRS_NET_HOST_CONNECTION_TYPE, SEMATTRS_NET_HOST_CONNECTION_SUBTYPE, SEMATTRS_NET_HOST_CARRIER_NAME, SEMATTRS_NET_HOST_CARRIER_MCC, SEMATTRS_NET_HOST_CARRIER_MNC, SEMATTRS_NET_HOST_CARRIER_ICC, SEMATTRS_PEER_SERVICE, SEMATTRS_ENDUSER_ID, SEMATTRS_ENDUSER_ROLE, SEMATTRS_ENDUSER_SCOPE, SEMATTRS_THREAD_ID, SEMATTRS_THREAD_NAME, SEMATTRS_CODE_FUNCTION, SEMATTRS_CODE_NAMESPACE, SEMATTRS_CODE_FILEPATH, SEMATTRS_CODE_LINENO, SEMATTRS_HTTP_METHOD, SEMATTRS_HTTP_URL, SEMATTRS_HTTP_TARGET, SEMATTRS_HTTP_HOST, SEMATTRS_HTTP_SCHEME, SEMATTRS_HTTP_STATUS_CODE, SEMATTRS_HTTP_FLAVOR, SEMATTRS_HTTP_USER_AGENT, SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH, SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH, SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, SEMATTRS_HTTP_SERVER_NAME, SEMATTRS_HTTP_ROUTE, SEMATTRS_HTTP_CLIENT_IP, SEMATTRS_AWS_DYNAMODB_TABLE_NAMES, SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY, SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ, SEMATTRS_AWS_DYNAMODB_PROJECTION, SEMATTRS_AWS_DYNAMODB_LIMIT, SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET, SEMATTRS_AWS_DYNAMODB_INDEX_NAME, SEMATTRS_AWS_DYNAMODB_SELECT, SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, SEMATTRS_AWS_DYNAMODB_TABLE_COUNT, SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD, SEMATTRS_AWS_DYNAMODB_SEGMENT, SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS, SEMATTRS_AWS_DYNAMODB_COUNT, SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT, SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, SEMATTRS_MESSAGING_SYSTEM, SEMATTRS_MESSAGING_DESTINATION, SEMATTRS_MESSAGING_DESTINATION_KIND, SEMATTRS_MESSAGING_TEMP_DESTINATION, SEMATTRS_MESSAGING_PROTOCOL, SEMATTRS_MESSAGING_PROTOCOL_VERSION, SEMATTRS_MESSAGING_URL, SEMATTRS_MESSAGING_MESSAGE_ID, SEMATTRS_MESSAGING_CONVERSATION_ID, SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, SEMATTRS_MESSAGING_OPERATION, SEMATTRS_MESSAGING_CONSUMER_ID, SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY, SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY, SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP, SEMATTRS_MESSAGING_KAFKA_CLIENT_ID, SEMATTRS_MESSAGING_KAFKA_PARTITION, SEMATTRS_MESSAGING_KAFKA_TOMBSTONE, SEMATTRS_RPC_SYSTEM, SEMATTRS_RPC_SERVICE, SEMATTRS_RPC_METHOD, SEMATTRS_RPC_GRPC_STATUS_CODE, SEMATTRS_RPC_JSONRPC_VERSION, SEMATTRS_RPC_JSONRPC_REQUEST_ID, SEMATTRS_RPC_JSONRPC_ERROR_CODE, SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE, SEMATTRS_MESSAGE_TYPE, SEMATTRS_MESSAGE_ID, SEMATTRS_MESSAGE_COMPRESSED_SIZE, SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE, SemanticAttributes, TMP_DBSYSTEMVALUES_OTHER_SQL, TMP_DBSYSTEMVALUES_MSSQL, TMP_DBSYSTEMVALUES_MYSQL, TMP_DBSYSTEMVALUES_ORACLE, TMP_DBSYSTEMVALUES_DB2, TMP_DBSYSTEMVALUES_POSTGRESQL, TMP_DBSYSTEMVALUES_REDSHIFT, TMP_DBSYSTEMVALUES_HIVE, TMP_DBSYSTEMVALUES_CLOUDSCAPE, TMP_DBSYSTEMVALUES_HSQLDB, TMP_DBSYSTEMVALUES_PROGRESS, TMP_DBSYSTEMVALUES_MAXDB, TMP_DBSYSTEMVALUES_HANADB, TMP_DBSYSTEMVALUES_INGRES, TMP_DBSYSTEMVALUES_FIRSTSQL, TMP_DBSYSTEMVALUES_EDB, TMP_DBSYSTEMVALUES_CACHE, TMP_DBSYSTEMVALUES_ADABAS, TMP_DBSYSTEMVALUES_FIREBIRD, TMP_DBSYSTEMVALUES_DERBY, TMP_DBSYSTEMVALUES_FILEMAKER, TMP_DBSYSTEMVALUES_INFORMIX, TMP_DBSYSTEMVALUES_INSTANTDB, TMP_DBSYSTEMVALUES_INTERBASE, TMP_DBSYSTEMVALUES_MARIADB, TMP_DBSYSTEMVALUES_NETEZZA, TMP_DBSYSTEMVALUES_PERVASIVE, TMP_DBSYSTEMVALUES_POINTBASE, TMP_DBSYSTEMVALUES_SQLITE, TMP_DBSYSTEMVALUES_SYBASE, TMP_DBSYSTEMVALUES_TERADATA, TMP_DBSYSTEMVALUES_VERTICA, TMP_DBSYSTEMVALUES_H2, TMP_DBSYSTEMVALUES_COLDFUSION, TMP_DBSYSTEMVALUES_CASSANDRA, TMP_DBSYSTEMVALUES_HBASE, TMP_DBSYSTEMVALUES_MONGODB, TMP_DBSYSTEMVALUES_REDIS, TMP_DBSYSTEMVALUES_COUCHBASE, TMP_DBSYSTEMVALUES_COUCHDB, TMP_DBSYSTEMVALUES_COSMOSDB, TMP_DBSYSTEMVALUES_DYNAMODB, TMP_DBSYSTEMVALUES_NEO4J, TMP_DBSYSTEMVALUES_GEODE, TMP_DBSYSTEMVALUES_ELASTICSEARCH, TMP_DBSYSTEMVALUES_MEMCACHED, TMP_DBSYSTEMVALUES_COCKROACHDB, DBSYSTEMVALUES_OTHER_SQL, DBSYSTEMVALUES_MSSQL, DBSYSTEMVALUES_MYSQL, DBSYSTEMVALUES_ORACLE, DBSYSTEMVALUES_DB2, DBSYSTEMVALUES_POSTGRESQL, DBSYSTEMVALUES_REDSHIFT, DBSYSTEMVALUES_HIVE, DBSYSTEMVALUES_CLOUDSCAPE, DBSYSTEMVALUES_HSQLDB, DBSYSTEMVALUES_PROGRESS, DBSYSTEMVALUES_MAXDB, DBSYSTEMVALUES_HANADB, DBSYSTEMVALUES_INGRES, DBSYSTEMVALUES_FIRSTSQL, DBSYSTEMVALUES_EDB, DBSYSTEMVALUES_CACHE, DBSYSTEMVALUES_ADABAS, DBSYSTEMVALUES_FIREBIRD, DBSYSTEMVALUES_DERBY, DBSYSTEMVALUES_FILEMAKER, DBSYSTEMVALUES_INFORMIX, DBSYSTEMVALUES_INSTANTDB, DBSYSTEMVALUES_INTERBASE, DBSYSTEMVALUES_MARIADB, DBSYSTEMVALUES_NETEZZA, DBSYSTEMVALUES_PERVASIVE, DBSYSTEMVALUES_POINTBASE, DBSYSTEMVALUES_SQLITE, DBSYSTEMVALUES_SYBASE, DBSYSTEMVALUES_TERADATA, DBSYSTEMVALUES_VERTICA, DBSYSTEMVALUES_H2, DBSYSTEMVALUES_COLDFUSION, DBSYSTEMVALUES_CASSANDRA, DBSYSTEMVALUES_HBASE, DBSYSTEMVALUES_MONGODB, DBSYSTEMVALUES_REDIS, DBSYSTEMVALUES_COUCHBASE, DBSYSTEMVALUES_COUCHDB, DBSYSTEMVALUES_COSMOSDB, DBSYSTEMVALUES_DYNAMODB, DBSYSTEMVALUES_NEO4J, DBSYSTEMVALUES_GEODE, DBSYSTEMVALUES_ELASTICSEARCH, DBSYSTEMVALUES_MEMCACHED, DBSYSTEMVALUES_COCKROACHDB, DbSystemValues, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, DBCASSANDRACONSISTENCYLEVELVALUES_ALL, DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, DBCASSANDRACONSISTENCYLEVELVALUES_ONE, DBCASSANDRACONSISTENCYLEVELVALUES_TWO, DBCASSANDRACONSISTENCYLEVELVALUES_THREE, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, DBCASSANDRACONSISTENCYLEVELVALUES_ANY, DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL, DbCassandraConsistencyLevelValues, TMP_FAASTRIGGERVALUES_DATASOURCE, TMP_FAASTRIGGERVALUES_HTTP, TMP_FAASTRIGGERVALUES_PUBSUB, TMP_FAASTRIGGERVALUES_TIMER, TMP_FAASTRIGGERVALUES_OTHER, FAASTRIGGERVALUES_DATASOURCE, FAASTRIGGERVALUES_HTTP, FAASTRIGGERVALUES_PUBSUB, FAASTRIGGERVALUES_TIMER, FAASTRIGGERVALUES_OTHER, FaasTriggerValues, TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, TMP_FAASDOCUMENTOPERATIONVALUES_DELETE, FAASDOCUMENTOPERATIONVALUES_INSERT, FAASDOCUMENTOPERATIONVALUES_EDIT, FAASDOCUMENTOPERATIONVALUES_DELETE, FaasDocumentOperationValues, TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, TMP_FAASINVOKEDPROVIDERVALUES_AWS, TMP_FAASINVOKEDPROVIDERVALUES_AZURE, TMP_FAASINVOKEDPROVIDERVALUES_GCP, FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, FAASINVOKEDPROVIDERVALUES_AWS, FAASINVOKEDPROVIDERVALUES_AZURE, FAASINVOKEDPROVIDERVALUES_GCP, FaasInvokedProviderValues, TMP_NETTRANSPORTVALUES_IP_TCP, TMP_NETTRANSPORTVALUES_IP_UDP, TMP_NETTRANSPORTVALUES_IP, TMP_NETTRANSPORTVALUES_UNIX, TMP_NETTRANSPORTVALUES_PIPE, TMP_NETTRANSPORTVALUES_INPROC, TMP_NETTRANSPORTVALUES_OTHER, NETTRANSPORTVALUES_IP_TCP, NETTRANSPORTVALUES_IP_UDP, NETTRANSPORTVALUES_IP, NETTRANSPORTVALUES_UNIX, NETTRANSPORTVALUES_PIPE, NETTRANSPORTVALUES_INPROC, NETTRANSPORTVALUES_OTHER, NetTransportValues, TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, NETHOSTCONNECTIONTYPEVALUES_WIFI, NETHOSTCONNECTIONTYPEVALUES_WIRED, NETHOSTCONNECTIONTYPEVALUES_CELL, NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, NetHostConnectionTypeValues, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, NETHOSTCONNECTIONSUBTYPEVALUES_LTE, NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, NETHOSTCONNECTIONSUBTYPEVALUES_GSM, NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, NETHOSTCONNECTIONSUBTYPEVALUES_NR, NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, NetHostConnectionSubtypeValues, TMP_HTTPFLAVORVALUES_HTTP_1_0, TMP_HTTPFLAVORVALUES_HTTP_1_1, TMP_HTTPFLAVORVALUES_HTTP_2_0, TMP_HTTPFLAVORVALUES_SPDY, TMP_HTTPFLAVORVALUES_QUIC, HTTPFLAVORVALUES_HTTP_1_0, HTTPFLAVORVALUES_HTTP_1_1, HTTPFLAVORVALUES_HTTP_2_0, HTTPFLAVORVALUES_SPDY, HTTPFLAVORVALUES_QUIC, HttpFlavorValues, TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC, MESSAGINGDESTINATIONKINDVALUES_QUEUE, MESSAGINGDESTINATIONKINDVALUES_TOPIC, MessagingDestinationKindValues, TMP_MESSAGINGOPERATIONVALUES_RECEIVE, TMP_MESSAGINGOPERATIONVALUES_PROCESS, MESSAGINGOPERATIONVALUES_RECEIVE, MESSAGINGOPERATIONVALUES_PROCESS, MessagingOperationValues, TMP_RPCGRPCSTATUSCODEVALUES_OK, TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, RPCGRPCSTATUSCODEVALUES_OK, RPCGRPCSTATUSCODEVALUES_CANCELLED, RPCGRPCSTATUSCODEVALUES_UNKNOWN, RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, RPCGRPCSTATUSCODEVALUES_NOT_FOUND, RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, RPCGRPCSTATUSCODEVALUES_ABORTED, RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, RPCGRPCSTATUSCODEVALUES_INTERNAL, RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, RPCGRPCSTATUSCODEVALUES_DATA_LOSS, RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED, RpcGrpcStatusCodeValues, TMP_MESSAGETYPEVALUES_SENT, TMP_MESSAGETYPEVALUES_RECEIVED, MESSAGETYPEVALUES_SENT, MESSAGETYPEVALUES_RECEIVED, MessageTypeValues; +var init_SemanticAttributes = __esmMin((() => { + init_utils(); + TMP_AWS_LAMBDA_INVOKED_ARN = "aws.lambda.invoked_arn"; + TMP_DB_SYSTEM = "db.system"; + TMP_DB_CONNECTION_STRING = "db.connection_string"; + TMP_DB_USER = "db.user"; + TMP_DB_JDBC_DRIVER_CLASSNAME = "db.jdbc.driver_classname"; + TMP_DB_NAME = "db.name"; + TMP_DB_STATEMENT = "db.statement"; + TMP_DB_OPERATION = "db.operation"; + TMP_DB_MSSQL_INSTANCE_NAME = "db.mssql.instance_name"; + TMP_DB_CASSANDRA_KEYSPACE = "db.cassandra.keyspace"; + TMP_DB_CASSANDRA_PAGE_SIZE = "db.cassandra.page_size"; + TMP_DB_CASSANDRA_CONSISTENCY_LEVEL = "db.cassandra.consistency_level"; + TMP_DB_CASSANDRA_TABLE = "db.cassandra.table"; + TMP_DB_CASSANDRA_IDEMPOTENCE = "db.cassandra.idempotence"; + TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = "db.cassandra.speculative_execution_count"; + TMP_DB_CASSANDRA_COORDINATOR_ID = "db.cassandra.coordinator.id"; + TMP_DB_CASSANDRA_COORDINATOR_DC = "db.cassandra.coordinator.dc"; + TMP_DB_HBASE_NAMESPACE = "db.hbase.namespace"; + TMP_DB_REDIS_DATABASE_INDEX = "db.redis.database_index"; + TMP_DB_MONGODB_COLLECTION = "db.mongodb.collection"; + TMP_DB_SQL_TABLE = "db.sql.table"; + TMP_EXCEPTION_TYPE = "exception.type"; + TMP_EXCEPTION_MESSAGE = "exception.message"; + TMP_EXCEPTION_STACKTRACE = "exception.stacktrace"; + TMP_EXCEPTION_ESCAPED = "exception.escaped"; + TMP_FAAS_TRIGGER = "faas.trigger"; + TMP_FAAS_EXECUTION = "faas.execution"; + TMP_FAAS_DOCUMENT_COLLECTION = "faas.document.collection"; + TMP_FAAS_DOCUMENT_OPERATION = "faas.document.operation"; + TMP_FAAS_DOCUMENT_TIME = "faas.document.time"; + TMP_FAAS_DOCUMENT_NAME = "faas.document.name"; + TMP_FAAS_TIME = "faas.time"; + TMP_FAAS_CRON = "faas.cron"; + TMP_FAAS_COLDSTART = "faas.coldstart"; + TMP_FAAS_INVOKED_NAME = "faas.invoked_name"; + TMP_FAAS_INVOKED_PROVIDER = "faas.invoked_provider"; + TMP_FAAS_INVOKED_REGION = "faas.invoked_region"; + TMP_NET_TRANSPORT = "net.transport"; + TMP_NET_PEER_IP = "net.peer.ip"; + TMP_NET_PEER_PORT = "net.peer.port"; + TMP_NET_PEER_NAME = "net.peer.name"; + TMP_NET_HOST_IP = "net.host.ip"; + TMP_NET_HOST_PORT = "net.host.port"; + TMP_NET_HOST_NAME = "net.host.name"; + TMP_NET_HOST_CONNECTION_TYPE = "net.host.connection.type"; + TMP_NET_HOST_CONNECTION_SUBTYPE = "net.host.connection.subtype"; + TMP_NET_HOST_CARRIER_NAME = "net.host.carrier.name"; + TMP_NET_HOST_CARRIER_MCC = "net.host.carrier.mcc"; + TMP_NET_HOST_CARRIER_MNC = "net.host.carrier.mnc"; + TMP_NET_HOST_CARRIER_ICC = "net.host.carrier.icc"; + TMP_PEER_SERVICE = "peer.service"; + TMP_ENDUSER_ID = "enduser.id"; + TMP_ENDUSER_ROLE = "enduser.role"; + TMP_ENDUSER_SCOPE = "enduser.scope"; + TMP_THREAD_ID = "thread.id"; + TMP_THREAD_NAME = "thread.name"; + TMP_CODE_FUNCTION = "code.function"; + TMP_CODE_NAMESPACE = "code.namespace"; + TMP_CODE_FILEPATH = "code.filepath"; + TMP_CODE_LINENO = "code.lineno"; + TMP_HTTP_METHOD = "http.method"; + TMP_HTTP_URL = "http.url"; + TMP_HTTP_TARGET = "http.target"; + TMP_HTTP_HOST = "http.host"; + TMP_HTTP_SCHEME = "http.scheme"; + TMP_HTTP_STATUS_CODE = "http.status_code"; + TMP_HTTP_FLAVOR = "http.flavor"; + TMP_HTTP_USER_AGENT = "http.user_agent"; + TMP_HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length"; + TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = "http.request_content_length_uncompressed"; + TMP_HTTP_RESPONSE_CONTENT_LENGTH = "http.response_content_length"; + TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = "http.response_content_length_uncompressed"; + TMP_HTTP_SERVER_NAME = "http.server_name"; + TMP_HTTP_ROUTE = "http.route"; + TMP_HTTP_CLIENT_IP = "http.client_ip"; + TMP_AWS_DYNAMODB_TABLE_NAMES = "aws.dynamodb.table_names"; + TMP_AWS_DYNAMODB_CONSUMED_CAPACITY = "aws.dynamodb.consumed_capacity"; + TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = "aws.dynamodb.item_collection_metrics"; + TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = "aws.dynamodb.provisioned_read_capacity"; + TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = "aws.dynamodb.provisioned_write_capacity"; + TMP_AWS_DYNAMODB_CONSISTENT_READ = "aws.dynamodb.consistent_read"; + TMP_AWS_DYNAMODB_PROJECTION = "aws.dynamodb.projection"; + TMP_AWS_DYNAMODB_LIMIT = "aws.dynamodb.limit"; + TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET = "aws.dynamodb.attributes_to_get"; + TMP_AWS_DYNAMODB_INDEX_NAME = "aws.dynamodb.index_name"; + TMP_AWS_DYNAMODB_SELECT = "aws.dynamodb.select"; + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = "aws.dynamodb.global_secondary_indexes"; + TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = "aws.dynamodb.local_secondary_indexes"; + TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = "aws.dynamodb.exclusive_start_table"; + TMP_AWS_DYNAMODB_TABLE_COUNT = "aws.dynamodb.table_count"; + TMP_AWS_DYNAMODB_SCAN_FORWARD = "aws.dynamodb.scan_forward"; + TMP_AWS_DYNAMODB_SEGMENT = "aws.dynamodb.segment"; + TMP_AWS_DYNAMODB_TOTAL_SEGMENTS = "aws.dynamodb.total_segments"; + TMP_AWS_DYNAMODB_COUNT = "aws.dynamodb.count"; + TMP_AWS_DYNAMODB_SCANNED_COUNT = "aws.dynamodb.scanned_count"; + TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = "aws.dynamodb.attribute_definitions"; + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = "aws.dynamodb.global_secondary_index_updates"; + TMP_MESSAGING_SYSTEM = "messaging.system"; + TMP_MESSAGING_DESTINATION = "messaging.destination"; + TMP_MESSAGING_DESTINATION_KIND = "messaging.destination_kind"; + TMP_MESSAGING_TEMP_DESTINATION = "messaging.temp_destination"; + TMP_MESSAGING_PROTOCOL = "messaging.protocol"; + TMP_MESSAGING_PROTOCOL_VERSION = "messaging.protocol_version"; + TMP_MESSAGING_URL = "messaging.url"; + TMP_MESSAGING_MESSAGE_ID = "messaging.message_id"; + TMP_MESSAGING_CONVERSATION_ID = "messaging.conversation_id"; + TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = "messaging.message_payload_size_bytes"; + TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = "messaging.message_payload_compressed_size_bytes"; + TMP_MESSAGING_OPERATION = "messaging.operation"; + TMP_MESSAGING_CONSUMER_ID = "messaging.consumer_id"; + TMP_MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key"; + TMP_MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message_key"; + TMP_MESSAGING_KAFKA_CONSUMER_GROUP = "messaging.kafka.consumer_group"; + TMP_MESSAGING_KAFKA_CLIENT_ID = "messaging.kafka.client_id"; + TMP_MESSAGING_KAFKA_PARTITION = "messaging.kafka.partition"; + TMP_MESSAGING_KAFKA_TOMBSTONE = "messaging.kafka.tombstone"; + TMP_RPC_SYSTEM = "rpc.system"; + TMP_RPC_SERVICE = "rpc.service"; + TMP_RPC_METHOD = "rpc.method"; + TMP_RPC_GRPC_STATUS_CODE = "rpc.grpc.status_code"; + TMP_RPC_JSONRPC_VERSION = "rpc.jsonrpc.version"; + TMP_RPC_JSONRPC_REQUEST_ID = "rpc.jsonrpc.request_id"; + TMP_RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code"; + TMP_RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message"; + TMP_MESSAGE_TYPE = "message.type"; + TMP_MESSAGE_ID = "message.id"; + TMP_MESSAGE_COMPRESSED_SIZE = "message.compressed_size"; + TMP_MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size"; + SEMATTRS_AWS_LAMBDA_INVOKED_ARN = TMP_AWS_LAMBDA_INVOKED_ARN; + SEMATTRS_DB_SYSTEM = TMP_DB_SYSTEM; + SEMATTRS_DB_CONNECTION_STRING = TMP_DB_CONNECTION_STRING; + SEMATTRS_DB_USER = TMP_DB_USER; + SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = TMP_DB_JDBC_DRIVER_CLASSNAME; + SEMATTRS_DB_NAME = TMP_DB_NAME; + SEMATTRS_DB_STATEMENT = TMP_DB_STATEMENT; + SEMATTRS_DB_OPERATION = TMP_DB_OPERATION; + SEMATTRS_DB_MSSQL_INSTANCE_NAME = TMP_DB_MSSQL_INSTANCE_NAME; + SEMATTRS_DB_CASSANDRA_KEYSPACE = TMP_DB_CASSANDRA_KEYSPACE; + SEMATTRS_DB_CASSANDRA_PAGE_SIZE = TMP_DB_CASSANDRA_PAGE_SIZE; + SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = TMP_DB_CASSANDRA_CONSISTENCY_LEVEL; + SEMATTRS_DB_CASSANDRA_TABLE = TMP_DB_CASSANDRA_TABLE; + SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = TMP_DB_CASSANDRA_IDEMPOTENCE; + SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT; + SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = TMP_DB_CASSANDRA_COORDINATOR_ID; + SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = TMP_DB_CASSANDRA_COORDINATOR_DC; + SEMATTRS_DB_HBASE_NAMESPACE = TMP_DB_HBASE_NAMESPACE; + SEMATTRS_DB_REDIS_DATABASE_INDEX = TMP_DB_REDIS_DATABASE_INDEX; + SEMATTRS_DB_MONGODB_COLLECTION = TMP_DB_MONGODB_COLLECTION; + SEMATTRS_DB_SQL_TABLE = TMP_DB_SQL_TABLE; + SEMATTRS_EXCEPTION_TYPE = TMP_EXCEPTION_TYPE; + SEMATTRS_EXCEPTION_MESSAGE = TMP_EXCEPTION_MESSAGE; + SEMATTRS_EXCEPTION_STACKTRACE = TMP_EXCEPTION_STACKTRACE; + SEMATTRS_EXCEPTION_ESCAPED = TMP_EXCEPTION_ESCAPED; + SEMATTRS_FAAS_TRIGGER = TMP_FAAS_TRIGGER; + SEMATTRS_FAAS_EXECUTION = TMP_FAAS_EXECUTION; + SEMATTRS_FAAS_DOCUMENT_COLLECTION = TMP_FAAS_DOCUMENT_COLLECTION; + SEMATTRS_FAAS_DOCUMENT_OPERATION = TMP_FAAS_DOCUMENT_OPERATION; + SEMATTRS_FAAS_DOCUMENT_TIME = TMP_FAAS_DOCUMENT_TIME; + SEMATTRS_FAAS_DOCUMENT_NAME = TMP_FAAS_DOCUMENT_NAME; + SEMATTRS_FAAS_TIME = TMP_FAAS_TIME; + SEMATTRS_FAAS_CRON = TMP_FAAS_CRON; + SEMATTRS_FAAS_COLDSTART = TMP_FAAS_COLDSTART; + SEMATTRS_FAAS_INVOKED_NAME = TMP_FAAS_INVOKED_NAME; + SEMATTRS_FAAS_INVOKED_PROVIDER = TMP_FAAS_INVOKED_PROVIDER; + SEMATTRS_FAAS_INVOKED_REGION = TMP_FAAS_INVOKED_REGION; + SEMATTRS_NET_TRANSPORT = TMP_NET_TRANSPORT; + SEMATTRS_NET_PEER_IP = TMP_NET_PEER_IP; + SEMATTRS_NET_PEER_PORT = TMP_NET_PEER_PORT; + SEMATTRS_NET_PEER_NAME = TMP_NET_PEER_NAME; + SEMATTRS_NET_HOST_IP = TMP_NET_HOST_IP; + SEMATTRS_NET_HOST_PORT = TMP_NET_HOST_PORT; + SEMATTRS_NET_HOST_NAME = TMP_NET_HOST_NAME; + SEMATTRS_NET_HOST_CONNECTION_TYPE = TMP_NET_HOST_CONNECTION_TYPE; + SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = TMP_NET_HOST_CONNECTION_SUBTYPE; + SEMATTRS_NET_HOST_CARRIER_NAME = TMP_NET_HOST_CARRIER_NAME; + SEMATTRS_NET_HOST_CARRIER_MCC = TMP_NET_HOST_CARRIER_MCC; + SEMATTRS_NET_HOST_CARRIER_MNC = TMP_NET_HOST_CARRIER_MNC; + SEMATTRS_NET_HOST_CARRIER_ICC = TMP_NET_HOST_CARRIER_ICC; + SEMATTRS_PEER_SERVICE = TMP_PEER_SERVICE; + SEMATTRS_ENDUSER_ID = TMP_ENDUSER_ID; + SEMATTRS_ENDUSER_ROLE = TMP_ENDUSER_ROLE; + SEMATTRS_ENDUSER_SCOPE = TMP_ENDUSER_SCOPE; + SEMATTRS_THREAD_ID = TMP_THREAD_ID; + SEMATTRS_THREAD_NAME = TMP_THREAD_NAME; + SEMATTRS_CODE_FUNCTION = TMP_CODE_FUNCTION; + SEMATTRS_CODE_NAMESPACE = TMP_CODE_NAMESPACE; + SEMATTRS_CODE_FILEPATH = TMP_CODE_FILEPATH; + SEMATTRS_CODE_LINENO = TMP_CODE_LINENO; + SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD; + SEMATTRS_HTTP_URL = TMP_HTTP_URL; + SEMATTRS_HTTP_TARGET = TMP_HTTP_TARGET; + SEMATTRS_HTTP_HOST = TMP_HTTP_HOST; + SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME; + SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE; + SEMATTRS_HTTP_FLAVOR = TMP_HTTP_FLAVOR; + SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT; + SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = TMP_HTTP_REQUEST_CONTENT_LENGTH; + SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED; + SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH; + SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED; + SEMATTRS_HTTP_SERVER_NAME = TMP_HTTP_SERVER_NAME; + SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE; + SEMATTRS_HTTP_CLIENT_IP = TMP_HTTP_CLIENT_IP; + SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = TMP_AWS_DYNAMODB_TABLE_NAMES; + SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = TMP_AWS_DYNAMODB_CONSUMED_CAPACITY; + SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS; + SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY; + SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY; + SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = TMP_AWS_DYNAMODB_CONSISTENT_READ; + SEMATTRS_AWS_DYNAMODB_PROJECTION = TMP_AWS_DYNAMODB_PROJECTION; + SEMATTRS_AWS_DYNAMODB_LIMIT = TMP_AWS_DYNAMODB_LIMIT; + SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET; + SEMATTRS_AWS_DYNAMODB_INDEX_NAME = TMP_AWS_DYNAMODB_INDEX_NAME; + SEMATTRS_AWS_DYNAMODB_SELECT = TMP_AWS_DYNAMODB_SELECT; + SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES; + SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES; + SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE; + SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = TMP_AWS_DYNAMODB_TABLE_COUNT; + SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = TMP_AWS_DYNAMODB_SCAN_FORWARD; + SEMATTRS_AWS_DYNAMODB_SEGMENT = TMP_AWS_DYNAMODB_SEGMENT; + SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = TMP_AWS_DYNAMODB_TOTAL_SEGMENTS; + SEMATTRS_AWS_DYNAMODB_COUNT = TMP_AWS_DYNAMODB_COUNT; + SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = TMP_AWS_DYNAMODB_SCANNED_COUNT; + SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS; + SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES; + SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM; + SEMATTRS_MESSAGING_DESTINATION = TMP_MESSAGING_DESTINATION; + SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND; + SEMATTRS_MESSAGING_TEMP_DESTINATION = TMP_MESSAGING_TEMP_DESTINATION; + SEMATTRS_MESSAGING_PROTOCOL = TMP_MESSAGING_PROTOCOL; + SEMATTRS_MESSAGING_PROTOCOL_VERSION = TMP_MESSAGING_PROTOCOL_VERSION; + SEMATTRS_MESSAGING_URL = TMP_MESSAGING_URL; + SEMATTRS_MESSAGING_MESSAGE_ID = TMP_MESSAGING_MESSAGE_ID; + SEMATTRS_MESSAGING_CONVERSATION_ID = TMP_MESSAGING_CONVERSATION_ID; + SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; + SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES; + SEMATTRS_MESSAGING_OPERATION = TMP_MESSAGING_OPERATION; + SEMATTRS_MESSAGING_CONSUMER_ID = TMP_MESSAGING_CONSUMER_ID; + SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = TMP_MESSAGING_RABBITMQ_ROUTING_KEY; + SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = TMP_MESSAGING_KAFKA_MESSAGE_KEY; + SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = TMP_MESSAGING_KAFKA_CONSUMER_GROUP; + SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = TMP_MESSAGING_KAFKA_CLIENT_ID; + SEMATTRS_MESSAGING_KAFKA_PARTITION = TMP_MESSAGING_KAFKA_PARTITION; + SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = TMP_MESSAGING_KAFKA_TOMBSTONE; + SEMATTRS_RPC_SYSTEM = TMP_RPC_SYSTEM; + SEMATTRS_RPC_SERVICE = TMP_RPC_SERVICE; + SEMATTRS_RPC_METHOD = TMP_RPC_METHOD; + SEMATTRS_RPC_GRPC_STATUS_CODE = TMP_RPC_GRPC_STATUS_CODE; + SEMATTRS_RPC_JSONRPC_VERSION = TMP_RPC_JSONRPC_VERSION; + SEMATTRS_RPC_JSONRPC_REQUEST_ID = TMP_RPC_JSONRPC_REQUEST_ID; + SEMATTRS_RPC_JSONRPC_ERROR_CODE = TMP_RPC_JSONRPC_ERROR_CODE; + SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = TMP_RPC_JSONRPC_ERROR_MESSAGE; + SEMATTRS_MESSAGE_TYPE = TMP_MESSAGE_TYPE; + 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([ + TMP_AWS_LAMBDA_INVOKED_ARN, + TMP_DB_SYSTEM, + TMP_DB_CONNECTION_STRING, + TMP_DB_USER, + TMP_DB_JDBC_DRIVER_CLASSNAME, + TMP_DB_NAME, + TMP_DB_STATEMENT, + TMP_DB_OPERATION, + TMP_DB_MSSQL_INSTANCE_NAME, + TMP_DB_CASSANDRA_KEYSPACE, + TMP_DB_CASSANDRA_PAGE_SIZE, + TMP_DB_CASSANDRA_CONSISTENCY_LEVEL, + TMP_DB_CASSANDRA_TABLE, + TMP_DB_CASSANDRA_IDEMPOTENCE, + TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, + TMP_DB_CASSANDRA_COORDINATOR_ID, + TMP_DB_CASSANDRA_COORDINATOR_DC, + TMP_DB_HBASE_NAMESPACE, + TMP_DB_REDIS_DATABASE_INDEX, + TMP_DB_MONGODB_COLLECTION, + TMP_DB_SQL_TABLE, + TMP_EXCEPTION_TYPE, + TMP_EXCEPTION_MESSAGE, + TMP_EXCEPTION_STACKTRACE, + TMP_EXCEPTION_ESCAPED, + TMP_FAAS_TRIGGER, + TMP_FAAS_EXECUTION, + TMP_FAAS_DOCUMENT_COLLECTION, + TMP_FAAS_DOCUMENT_OPERATION, + TMP_FAAS_DOCUMENT_TIME, + TMP_FAAS_DOCUMENT_NAME, + TMP_FAAS_TIME, + TMP_FAAS_CRON, + TMP_FAAS_COLDSTART, + TMP_FAAS_INVOKED_NAME, + TMP_FAAS_INVOKED_PROVIDER, + TMP_FAAS_INVOKED_REGION, + TMP_NET_TRANSPORT, + TMP_NET_PEER_IP, + TMP_NET_PEER_PORT, + TMP_NET_PEER_NAME, + TMP_NET_HOST_IP, + TMP_NET_HOST_PORT, + TMP_NET_HOST_NAME, + TMP_NET_HOST_CONNECTION_TYPE, + TMP_NET_HOST_CONNECTION_SUBTYPE, + TMP_NET_HOST_CARRIER_NAME, + TMP_NET_HOST_CARRIER_MCC, + TMP_NET_HOST_CARRIER_MNC, + TMP_NET_HOST_CARRIER_ICC, + TMP_PEER_SERVICE, + TMP_ENDUSER_ID, + TMP_ENDUSER_ROLE, + TMP_ENDUSER_SCOPE, + TMP_THREAD_ID, + TMP_THREAD_NAME, + TMP_CODE_FUNCTION, + TMP_CODE_NAMESPACE, + TMP_CODE_FILEPATH, + TMP_CODE_LINENO, + TMP_HTTP_METHOD, + TMP_HTTP_URL, + TMP_HTTP_TARGET, + TMP_HTTP_HOST, + TMP_HTTP_SCHEME, + TMP_HTTP_STATUS_CODE, + TMP_HTTP_FLAVOR, + TMP_HTTP_USER_AGENT, + TMP_HTTP_REQUEST_CONTENT_LENGTH, + TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_RESPONSE_CONTENT_LENGTH, + TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, + TMP_HTTP_SERVER_NAME, + TMP_HTTP_ROUTE, + TMP_HTTP_CLIENT_IP, + TMP_AWS_DYNAMODB_TABLE_NAMES, + TMP_AWS_DYNAMODB_CONSUMED_CAPACITY, + TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, + TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, + TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, + TMP_AWS_DYNAMODB_CONSISTENT_READ, + TMP_AWS_DYNAMODB_PROJECTION, + TMP_AWS_DYNAMODB_LIMIT, + TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET, + TMP_AWS_DYNAMODB_INDEX_NAME, + TMP_AWS_DYNAMODB_SELECT, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, + TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, + TMP_AWS_DYNAMODB_TABLE_COUNT, + TMP_AWS_DYNAMODB_SCAN_FORWARD, + TMP_AWS_DYNAMODB_SEGMENT, + TMP_AWS_DYNAMODB_TOTAL_SEGMENTS, + TMP_AWS_DYNAMODB_COUNT, + TMP_AWS_DYNAMODB_SCANNED_COUNT, + TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, + TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, + TMP_MESSAGING_SYSTEM, + TMP_MESSAGING_DESTINATION, + TMP_MESSAGING_DESTINATION_KIND, + TMP_MESSAGING_TEMP_DESTINATION, + TMP_MESSAGING_PROTOCOL, + TMP_MESSAGING_PROTOCOL_VERSION, + TMP_MESSAGING_URL, + TMP_MESSAGING_MESSAGE_ID, + TMP_MESSAGING_CONVERSATION_ID, + TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, + TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, + TMP_MESSAGING_OPERATION, + TMP_MESSAGING_CONSUMER_ID, + TMP_MESSAGING_RABBITMQ_ROUTING_KEY, + TMP_MESSAGING_KAFKA_MESSAGE_KEY, + TMP_MESSAGING_KAFKA_CONSUMER_GROUP, + TMP_MESSAGING_KAFKA_CLIENT_ID, + TMP_MESSAGING_KAFKA_PARTITION, + TMP_MESSAGING_KAFKA_TOMBSTONE, + TMP_RPC_SYSTEM, + TMP_RPC_SERVICE, + TMP_RPC_METHOD, + TMP_RPC_GRPC_STATUS_CODE, + TMP_RPC_JSONRPC_VERSION, + TMP_RPC_JSONRPC_REQUEST_ID, + TMP_RPC_JSONRPC_ERROR_CODE, + TMP_RPC_JSONRPC_ERROR_MESSAGE, + TMP_MESSAGE_TYPE, + TMP_MESSAGE_ID, + TMP_MESSAGE_COMPRESSED_SIZE, + TMP_MESSAGE_UNCOMPRESSED_SIZE + ]); + TMP_DBSYSTEMVALUES_OTHER_SQL = "other_sql"; + TMP_DBSYSTEMVALUES_MSSQL = "mssql"; + TMP_DBSYSTEMVALUES_MYSQL = "mysql"; + TMP_DBSYSTEMVALUES_ORACLE = "oracle"; + TMP_DBSYSTEMVALUES_DB2 = "db2"; + TMP_DBSYSTEMVALUES_POSTGRESQL = "postgresql"; + TMP_DBSYSTEMVALUES_REDSHIFT = "redshift"; + TMP_DBSYSTEMVALUES_HIVE = "hive"; + TMP_DBSYSTEMVALUES_CLOUDSCAPE = "cloudscape"; + TMP_DBSYSTEMVALUES_HSQLDB = "hsqldb"; + TMP_DBSYSTEMVALUES_PROGRESS = "progress"; + TMP_DBSYSTEMVALUES_MAXDB = "maxdb"; + TMP_DBSYSTEMVALUES_HANADB = "hanadb"; + TMP_DBSYSTEMVALUES_INGRES = "ingres"; + TMP_DBSYSTEMVALUES_FIRSTSQL = "firstsql"; + TMP_DBSYSTEMVALUES_EDB = "edb"; + TMP_DBSYSTEMVALUES_CACHE = "cache"; + TMP_DBSYSTEMVALUES_ADABAS = "adabas"; + TMP_DBSYSTEMVALUES_FIREBIRD = "firebird"; + TMP_DBSYSTEMVALUES_DERBY = "derby"; + TMP_DBSYSTEMVALUES_FILEMAKER = "filemaker"; + TMP_DBSYSTEMVALUES_INFORMIX = "informix"; + TMP_DBSYSTEMVALUES_INSTANTDB = "instantdb"; + TMP_DBSYSTEMVALUES_INTERBASE = "interbase"; + TMP_DBSYSTEMVALUES_MARIADB = "mariadb"; + TMP_DBSYSTEMVALUES_NETEZZA = "netezza"; + TMP_DBSYSTEMVALUES_PERVASIVE = "pervasive"; + TMP_DBSYSTEMVALUES_POINTBASE = "pointbase"; + TMP_DBSYSTEMVALUES_SQLITE = "sqlite"; + TMP_DBSYSTEMVALUES_SYBASE = "sybase"; + TMP_DBSYSTEMVALUES_TERADATA = "teradata"; + TMP_DBSYSTEMVALUES_VERTICA = "vertica"; + TMP_DBSYSTEMVALUES_H2 = "h2"; + TMP_DBSYSTEMVALUES_COLDFUSION = "coldfusion"; + TMP_DBSYSTEMVALUES_CASSANDRA = "cassandra"; + TMP_DBSYSTEMVALUES_HBASE = "hbase"; + TMP_DBSYSTEMVALUES_MONGODB = "mongodb"; + TMP_DBSYSTEMVALUES_REDIS = "redis"; + TMP_DBSYSTEMVALUES_COUCHBASE = "couchbase"; + TMP_DBSYSTEMVALUES_COUCHDB = "couchdb"; + TMP_DBSYSTEMVALUES_COSMOSDB = "cosmosdb"; + TMP_DBSYSTEMVALUES_DYNAMODB = "dynamodb"; + TMP_DBSYSTEMVALUES_NEO4J = "neo4j"; + TMP_DBSYSTEMVALUES_GEODE = "geode"; + TMP_DBSYSTEMVALUES_ELASTICSEARCH = "elasticsearch"; + TMP_DBSYSTEMVALUES_MEMCACHED = "memcached"; + TMP_DBSYSTEMVALUES_COCKROACHDB = "cockroachdb"; + DBSYSTEMVALUES_OTHER_SQL = TMP_DBSYSTEMVALUES_OTHER_SQL; + DBSYSTEMVALUES_MSSQL = TMP_DBSYSTEMVALUES_MSSQL; + DBSYSTEMVALUES_MYSQL = TMP_DBSYSTEMVALUES_MYSQL; + DBSYSTEMVALUES_ORACLE = TMP_DBSYSTEMVALUES_ORACLE; + DBSYSTEMVALUES_DB2 = TMP_DBSYSTEMVALUES_DB2; + DBSYSTEMVALUES_POSTGRESQL = TMP_DBSYSTEMVALUES_POSTGRESQL; + DBSYSTEMVALUES_REDSHIFT = TMP_DBSYSTEMVALUES_REDSHIFT; + DBSYSTEMVALUES_HIVE = TMP_DBSYSTEMVALUES_HIVE; + DBSYSTEMVALUES_CLOUDSCAPE = TMP_DBSYSTEMVALUES_CLOUDSCAPE; + DBSYSTEMVALUES_HSQLDB = TMP_DBSYSTEMVALUES_HSQLDB; + DBSYSTEMVALUES_PROGRESS = TMP_DBSYSTEMVALUES_PROGRESS; + DBSYSTEMVALUES_MAXDB = TMP_DBSYSTEMVALUES_MAXDB; + DBSYSTEMVALUES_HANADB = TMP_DBSYSTEMVALUES_HANADB; + DBSYSTEMVALUES_INGRES = TMP_DBSYSTEMVALUES_INGRES; + DBSYSTEMVALUES_FIRSTSQL = TMP_DBSYSTEMVALUES_FIRSTSQL; + DBSYSTEMVALUES_EDB = TMP_DBSYSTEMVALUES_EDB; + DBSYSTEMVALUES_CACHE = TMP_DBSYSTEMVALUES_CACHE; + DBSYSTEMVALUES_ADABAS = TMP_DBSYSTEMVALUES_ADABAS; + DBSYSTEMVALUES_FIREBIRD = TMP_DBSYSTEMVALUES_FIREBIRD; + DBSYSTEMVALUES_DERBY = TMP_DBSYSTEMVALUES_DERBY; + DBSYSTEMVALUES_FILEMAKER = TMP_DBSYSTEMVALUES_FILEMAKER; + DBSYSTEMVALUES_INFORMIX = TMP_DBSYSTEMVALUES_INFORMIX; + DBSYSTEMVALUES_INSTANTDB = TMP_DBSYSTEMVALUES_INSTANTDB; + DBSYSTEMVALUES_INTERBASE = TMP_DBSYSTEMVALUES_INTERBASE; + DBSYSTEMVALUES_MARIADB = TMP_DBSYSTEMVALUES_MARIADB; + DBSYSTEMVALUES_NETEZZA = TMP_DBSYSTEMVALUES_NETEZZA; + DBSYSTEMVALUES_PERVASIVE = TMP_DBSYSTEMVALUES_PERVASIVE; + DBSYSTEMVALUES_POINTBASE = TMP_DBSYSTEMVALUES_POINTBASE; + DBSYSTEMVALUES_SQLITE = TMP_DBSYSTEMVALUES_SQLITE; + DBSYSTEMVALUES_SYBASE = TMP_DBSYSTEMVALUES_SYBASE; + DBSYSTEMVALUES_TERADATA = TMP_DBSYSTEMVALUES_TERADATA; + DBSYSTEMVALUES_VERTICA = TMP_DBSYSTEMVALUES_VERTICA; + DBSYSTEMVALUES_H2 = TMP_DBSYSTEMVALUES_H2; + DBSYSTEMVALUES_COLDFUSION = TMP_DBSYSTEMVALUES_COLDFUSION; + DBSYSTEMVALUES_CASSANDRA = TMP_DBSYSTEMVALUES_CASSANDRA; + DBSYSTEMVALUES_HBASE = TMP_DBSYSTEMVALUES_HBASE; + DBSYSTEMVALUES_MONGODB = TMP_DBSYSTEMVALUES_MONGODB; + DBSYSTEMVALUES_REDIS = TMP_DBSYSTEMVALUES_REDIS; + DBSYSTEMVALUES_COUCHBASE = TMP_DBSYSTEMVALUES_COUCHBASE; + DBSYSTEMVALUES_COUCHDB = TMP_DBSYSTEMVALUES_COUCHDB; + DBSYSTEMVALUES_COSMOSDB = TMP_DBSYSTEMVALUES_COSMOSDB; + DBSYSTEMVALUES_DYNAMODB = TMP_DBSYSTEMVALUES_DYNAMODB; + DBSYSTEMVALUES_NEO4J = TMP_DBSYSTEMVALUES_NEO4J; + DBSYSTEMVALUES_GEODE = TMP_DBSYSTEMVALUES_GEODE; + DBSYSTEMVALUES_ELASTICSEARCH = TMP_DBSYSTEMVALUES_ELASTICSEARCH; + DBSYSTEMVALUES_MEMCACHED = TMP_DBSYSTEMVALUES_MEMCACHED; + DBSYSTEMVALUES_COCKROACHDB = TMP_DBSYSTEMVALUES_COCKROACHDB; + DbSystemValues = /* @__PURE__ */ createConstMap([ + TMP_DBSYSTEMVALUES_OTHER_SQL, + TMP_DBSYSTEMVALUES_MSSQL, + TMP_DBSYSTEMVALUES_MYSQL, + TMP_DBSYSTEMVALUES_ORACLE, + TMP_DBSYSTEMVALUES_DB2, + TMP_DBSYSTEMVALUES_POSTGRESQL, + TMP_DBSYSTEMVALUES_REDSHIFT, + TMP_DBSYSTEMVALUES_HIVE, + TMP_DBSYSTEMVALUES_CLOUDSCAPE, + TMP_DBSYSTEMVALUES_HSQLDB, + TMP_DBSYSTEMVALUES_PROGRESS, + TMP_DBSYSTEMVALUES_MAXDB, + TMP_DBSYSTEMVALUES_HANADB, + TMP_DBSYSTEMVALUES_INGRES, + TMP_DBSYSTEMVALUES_FIRSTSQL, + TMP_DBSYSTEMVALUES_EDB, + TMP_DBSYSTEMVALUES_CACHE, + TMP_DBSYSTEMVALUES_ADABAS, + TMP_DBSYSTEMVALUES_FIREBIRD, + TMP_DBSYSTEMVALUES_DERBY, + TMP_DBSYSTEMVALUES_FILEMAKER, + TMP_DBSYSTEMVALUES_INFORMIX, + TMP_DBSYSTEMVALUES_INSTANTDB, + TMP_DBSYSTEMVALUES_INTERBASE, + TMP_DBSYSTEMVALUES_MARIADB, + TMP_DBSYSTEMVALUES_NETEZZA, + TMP_DBSYSTEMVALUES_PERVASIVE, + TMP_DBSYSTEMVALUES_POINTBASE, + TMP_DBSYSTEMVALUES_SQLITE, + TMP_DBSYSTEMVALUES_SYBASE, + TMP_DBSYSTEMVALUES_TERADATA, + TMP_DBSYSTEMVALUES_VERTICA, + TMP_DBSYSTEMVALUES_H2, + TMP_DBSYSTEMVALUES_COLDFUSION, + TMP_DBSYSTEMVALUES_CASSANDRA, + TMP_DBSYSTEMVALUES_HBASE, + TMP_DBSYSTEMVALUES_MONGODB, + TMP_DBSYSTEMVALUES_REDIS, + TMP_DBSYSTEMVALUES_COUCHBASE, + TMP_DBSYSTEMVALUES_COUCHDB, + TMP_DBSYSTEMVALUES_COSMOSDB, + TMP_DBSYSTEMVALUES_DYNAMODB, + TMP_DBSYSTEMVALUES_NEO4J, + TMP_DBSYSTEMVALUES_GEODE, + TMP_DBSYSTEMVALUES_ELASTICSEARCH, + TMP_DBSYSTEMVALUES_MEMCACHED, + TMP_DBSYSTEMVALUES_COCKROACHDB + ]); + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL = "all"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = "each_quorum"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = "quorum"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = "local_quorum"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE = "one"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO = "two"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE = "three"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = "local_one"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY = "any"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = "serial"; + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = "local_serial"; + DBCASSANDRACONSISTENCYLEVELVALUES_ALL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL; + DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM; + DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM; + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM; + DBCASSANDRACONSISTENCYLEVELVALUES_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE; + DBCASSANDRACONSISTENCYLEVELVALUES_TWO = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO; + DBCASSANDRACONSISTENCYLEVELVALUES_THREE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE; + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE; + DBCASSANDRACONSISTENCYLEVELVALUES_ANY = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY; + DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL; + DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL; + DbCassandraConsistencyLevelValues = /* @__PURE__ */ createConstMap([ + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, + TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL + ]); + TMP_FAASTRIGGERVALUES_DATASOURCE = "datasource"; + TMP_FAASTRIGGERVALUES_HTTP = "http"; + TMP_FAASTRIGGERVALUES_PUBSUB = "pubsub"; + TMP_FAASTRIGGERVALUES_TIMER = "timer"; + TMP_FAASTRIGGERVALUES_OTHER = "other"; + FAASTRIGGERVALUES_DATASOURCE = TMP_FAASTRIGGERVALUES_DATASOURCE; + FAASTRIGGERVALUES_HTTP = TMP_FAASTRIGGERVALUES_HTTP; + FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; + FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; + FAASTRIGGERVALUES_OTHER = TMP_FAASTRIGGERVALUES_OTHER; + FaasTriggerValues = /* @__PURE__ */ createConstMap([ + TMP_FAASTRIGGERVALUES_DATASOURCE, + TMP_FAASTRIGGERVALUES_HTTP, + TMP_FAASTRIGGERVALUES_PUBSUB, + TMP_FAASTRIGGERVALUES_TIMER, + TMP_FAASTRIGGERVALUES_OTHER + ]); + TMP_FAASDOCUMENTOPERATIONVALUES_INSERT = "insert"; + TMP_FAASDOCUMENTOPERATIONVALUES_EDIT = "edit"; + TMP_FAASDOCUMENTOPERATIONVALUES_DELETE = "delete"; + FAASDOCUMENTOPERATIONVALUES_INSERT = TMP_FAASDOCUMENTOPERATIONVALUES_INSERT; + FAASDOCUMENTOPERATIONVALUES_EDIT = TMP_FAASDOCUMENTOPERATIONVALUES_EDIT; + FAASDOCUMENTOPERATIONVALUES_DELETE = TMP_FAASDOCUMENTOPERATIONVALUES_DELETE; + FaasDocumentOperationValues = /* @__PURE__ */ createConstMap([ + TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, + TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, + TMP_FAASDOCUMENTOPERATIONVALUES_DELETE + ]); + TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = "alibaba_cloud"; + TMP_FAASINVOKEDPROVIDERVALUES_AWS = "aws"; + TMP_FAASINVOKEDPROVIDERVALUES_AZURE = "azure"; + TMP_FAASINVOKEDPROVIDERVALUES_GCP = "gcp"; + FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD; + FAASINVOKEDPROVIDERVALUES_AWS = TMP_FAASINVOKEDPROVIDERVALUES_AWS; + FAASINVOKEDPROVIDERVALUES_AZURE = TMP_FAASINVOKEDPROVIDERVALUES_AZURE; + FAASINVOKEDPROVIDERVALUES_GCP = TMP_FAASINVOKEDPROVIDERVALUES_GCP; + FaasInvokedProviderValues = /* @__PURE__ */ createConstMap([ + TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_FAASINVOKEDPROVIDERVALUES_AWS, + TMP_FAASINVOKEDPROVIDERVALUES_AZURE, + TMP_FAASINVOKEDPROVIDERVALUES_GCP + ]); + TMP_NETTRANSPORTVALUES_IP_TCP = "ip_tcp"; + TMP_NETTRANSPORTVALUES_IP_UDP = "ip_udp"; + TMP_NETTRANSPORTVALUES_IP = "ip"; + TMP_NETTRANSPORTVALUES_UNIX = "unix"; + TMP_NETTRANSPORTVALUES_PIPE = "pipe"; + TMP_NETTRANSPORTVALUES_INPROC = "inproc"; + TMP_NETTRANSPORTVALUES_OTHER = "other"; + NETTRANSPORTVALUES_IP_TCP = TMP_NETTRANSPORTVALUES_IP_TCP; + NETTRANSPORTVALUES_IP_UDP = TMP_NETTRANSPORTVALUES_IP_UDP; + NETTRANSPORTVALUES_IP = TMP_NETTRANSPORTVALUES_IP; + NETTRANSPORTVALUES_UNIX = TMP_NETTRANSPORTVALUES_UNIX; + NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; + NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; + NETTRANSPORTVALUES_OTHER = TMP_NETTRANSPORTVALUES_OTHER; + NetTransportValues = /* @__PURE__ */ createConstMap([ + TMP_NETTRANSPORTVALUES_IP_TCP, + TMP_NETTRANSPORTVALUES_IP_UDP, + TMP_NETTRANSPORTVALUES_IP, + TMP_NETTRANSPORTVALUES_UNIX, + TMP_NETTRANSPORTVALUES_PIPE, + TMP_NETTRANSPORTVALUES_INPROC, + TMP_NETTRANSPORTVALUES_OTHER + ]); + TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI = "wifi"; + TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED = "wired"; + TMP_NETHOSTCONNECTIONTYPEVALUES_CELL = "cell"; + TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = "unavailable"; + TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = "unknown"; + NETHOSTCONNECTIONTYPEVALUES_WIFI = TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI; + NETHOSTCONNECTIONTYPEVALUES_WIRED = TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED; + NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; + NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; + NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN; + NetHostConnectionTypeValues = /* @__PURE__ */ createConstMap([ + TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, + TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, + TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, + TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN + ]); + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = "gprs"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = "edge"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = "umts"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = "cdma"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = "evdo_0"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = "evdo_a"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = "cdma2000_1xrtt"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = "hsdpa"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = "hsupa"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = "hspa"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = "iden"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = "evdo_b"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE = "lte"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = "ehrpd"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = "hspap"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM = "gsm"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = "td_scdma"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = "iwlan"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR = "nr"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = "nrnsa"; + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = "lte_ca"; + NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS; + NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE; + NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS; + NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA; + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0; + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A; + NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT; + NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA; + NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA; + NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA; + NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN; + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B; + NETHOSTCONNECTIONSUBTYPEVALUES_LTE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE; + NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD; + NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP; + NETHOSTCONNECTIONSUBTYPEVALUES_GSM = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM; + NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA; + NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN; + NETHOSTCONNECTIONSUBTYPEVALUES_NR = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR; + NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA; + NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA; + NetHostConnectionSubtypeValues = /* @__PURE__ */ createConstMap([ + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, + TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA + ]); + TMP_HTTPFLAVORVALUES_HTTP_1_0 = "1.0"; + TMP_HTTPFLAVORVALUES_HTTP_1_1 = "1.1"; + TMP_HTTPFLAVORVALUES_HTTP_2_0 = "2.0"; + TMP_HTTPFLAVORVALUES_SPDY = "SPDY"; + TMP_HTTPFLAVORVALUES_QUIC = "QUIC"; + HTTPFLAVORVALUES_HTTP_1_0 = TMP_HTTPFLAVORVALUES_HTTP_1_0; + HTTPFLAVORVALUES_HTTP_1_1 = TMP_HTTPFLAVORVALUES_HTTP_1_1; + HTTPFLAVORVALUES_HTTP_2_0 = TMP_HTTPFLAVORVALUES_HTTP_2_0; + HTTPFLAVORVALUES_SPDY = TMP_HTTPFLAVORVALUES_SPDY; + HTTPFLAVORVALUES_QUIC = TMP_HTTPFLAVORVALUES_QUIC; + HttpFlavorValues = { + HTTP_1_0: TMP_HTTPFLAVORVALUES_HTTP_1_0, + HTTP_1_1: TMP_HTTPFLAVORVALUES_HTTP_1_1, + HTTP_2_0: TMP_HTTPFLAVORVALUES_HTTP_2_0, + SPDY: TMP_HTTPFLAVORVALUES_SPDY, + QUIC: TMP_HTTPFLAVORVALUES_QUIC + }; + TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE = "queue"; + TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC = "topic"; + MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; + MESSAGINGDESTINATIONKINDVALUES_TOPIC = 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]); + TMP_RPCGRPCSTATUSCODEVALUES_OK = 0; + TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED = 1; + TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN = 2; + TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = 3; + TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = 4; + TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND = 5; + TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = 6; + TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = 7; + TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = 8; + TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = 9; + TMP_RPCGRPCSTATUSCODEVALUES_ABORTED = 10; + TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = 11; + TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = 12; + TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL = 13; + TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = 14; + TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS = 15; + TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = 16; + RPCGRPCSTATUSCODEVALUES_OK = TMP_RPCGRPCSTATUSCODEVALUES_OK; + RPCGRPCSTATUSCODEVALUES_CANCELLED = TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED; + RPCGRPCSTATUSCODEVALUES_UNKNOWN = TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN; + RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT; + RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED; + RPCGRPCSTATUSCODEVALUES_NOT_FOUND = TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND; + RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS; + RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED; + RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED; + RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION; + RPCGRPCSTATUSCODEVALUES_ABORTED = TMP_RPCGRPCSTATUSCODEVALUES_ABORTED; + RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE; + RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED; + RPCGRPCSTATUSCODEVALUES_INTERNAL = TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL; + RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE; + RPCGRPCSTATUSCODEVALUES_DATA_LOSS = TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS; + RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED; + RpcGrpcStatusCodeValues = { + OK: TMP_RPCGRPCSTATUSCODEVALUES_OK, + CANCELLED: TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED, + UNKNOWN: TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN, + INVALID_ARGUMENT: TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT, + DEADLINE_EXCEEDED: TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED, + NOT_FOUND: TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND, + ALREADY_EXISTS: TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS, + PERMISSION_DENIED: TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED, + RESOURCE_EXHAUSTED: TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED, + FAILED_PRECONDITION: TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION, + ABORTED: TMP_RPCGRPCSTATUSCODEVALUES_ABORTED, + OUT_OF_RANGE: TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE, + UNIMPLEMENTED: TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED, + INTERNAL: TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL, + UNAVAILABLE: TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE, + DATA_LOSS: TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS, + UNAUTHENTICATED: TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED + }; + TMP_MESSAGETYPEVALUES_SENT = "SENT"; + TMP_MESSAGETYPEVALUES_RECEIVED = "RECEIVED"; + MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; + MESSAGETYPEVALUES_RECEIVED = TMP_MESSAGETYPEVALUES_RECEIVED; + MessageTypeValues = /* @__PURE__ */ createConstMap([TMP_MESSAGETYPEVALUES_SENT, TMP_MESSAGETYPEVALUES_RECEIVED]); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js +var init_trace = __esmMin((() => { + init_SemanticAttributes(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js +var TMP_CLOUD_PROVIDER, TMP_CLOUD_ACCOUNT_ID, TMP_CLOUD_REGION, TMP_CLOUD_AVAILABILITY_ZONE, TMP_CLOUD_PLATFORM, TMP_AWS_ECS_CONTAINER_ARN, TMP_AWS_ECS_CLUSTER_ARN, TMP_AWS_ECS_LAUNCHTYPE, TMP_AWS_ECS_TASK_ARN, TMP_AWS_ECS_TASK_FAMILY, TMP_AWS_ECS_TASK_REVISION, TMP_AWS_EKS_CLUSTER_ARN, TMP_AWS_LOG_GROUP_NAMES, TMP_AWS_LOG_GROUP_ARNS, TMP_AWS_LOG_STREAM_NAMES, TMP_AWS_LOG_STREAM_ARNS, TMP_CONTAINER_NAME, TMP_CONTAINER_ID, TMP_CONTAINER_RUNTIME, TMP_CONTAINER_IMAGE_NAME, TMP_CONTAINER_IMAGE_TAG, TMP_DEPLOYMENT_ENVIRONMENT, TMP_DEVICE_ID, TMP_DEVICE_MODEL_IDENTIFIER, TMP_DEVICE_MODEL_NAME, TMP_FAAS_NAME, TMP_FAAS_ID, TMP_FAAS_VERSION, TMP_FAAS_INSTANCE, TMP_FAAS_MAX_MEMORY, TMP_HOST_ID, TMP_HOST_NAME, TMP_HOST_TYPE, TMP_HOST_ARCH, TMP_HOST_IMAGE_NAME, TMP_HOST_IMAGE_ID, TMP_HOST_IMAGE_VERSION, TMP_K8S_CLUSTER_NAME, TMP_K8S_NODE_NAME, TMP_K8S_NODE_UID, TMP_K8S_NAMESPACE_NAME, TMP_K8S_POD_UID, TMP_K8S_POD_NAME, TMP_K8S_CONTAINER_NAME, TMP_K8S_REPLICASET_UID, TMP_K8S_REPLICASET_NAME, TMP_K8S_DEPLOYMENT_UID, TMP_K8S_DEPLOYMENT_NAME, TMP_K8S_STATEFULSET_UID, TMP_K8S_STATEFULSET_NAME, TMP_K8S_DAEMONSET_UID, TMP_K8S_DAEMONSET_NAME, TMP_K8S_JOB_UID, TMP_K8S_JOB_NAME, TMP_K8S_CRONJOB_UID, TMP_K8S_CRONJOB_NAME, TMP_OS_TYPE, TMP_OS_DESCRIPTION, TMP_OS_NAME, TMP_OS_VERSION, TMP_PROCESS_PID, TMP_PROCESS_EXECUTABLE_NAME, TMP_PROCESS_EXECUTABLE_PATH, TMP_PROCESS_COMMAND, TMP_PROCESS_COMMAND_LINE, TMP_PROCESS_COMMAND_ARGS, TMP_PROCESS_OWNER, TMP_PROCESS_RUNTIME_NAME, TMP_PROCESS_RUNTIME_VERSION, TMP_PROCESS_RUNTIME_DESCRIPTION, TMP_SERVICE_NAME, TMP_SERVICE_NAMESPACE, TMP_SERVICE_INSTANCE_ID, TMP_SERVICE_VERSION, TMP_TELEMETRY_SDK_NAME, TMP_TELEMETRY_SDK_LANGUAGE, TMP_TELEMETRY_SDK_VERSION, TMP_TELEMETRY_AUTO_VERSION, TMP_WEBENGINE_NAME, TMP_WEBENGINE_VERSION, TMP_WEBENGINE_DESCRIPTION, SEMRESATTRS_CLOUD_PROVIDER, SEMRESATTRS_CLOUD_ACCOUNT_ID, SEMRESATTRS_CLOUD_REGION, SEMRESATTRS_CLOUD_AVAILABILITY_ZONE, SEMRESATTRS_CLOUD_PLATFORM, SEMRESATTRS_AWS_ECS_CONTAINER_ARN, SEMRESATTRS_AWS_ECS_CLUSTER_ARN, SEMRESATTRS_AWS_ECS_LAUNCHTYPE, SEMRESATTRS_AWS_ECS_TASK_ARN, SEMRESATTRS_AWS_ECS_TASK_FAMILY, SEMRESATTRS_AWS_ECS_TASK_REVISION, SEMRESATTRS_AWS_EKS_CLUSTER_ARN, SEMRESATTRS_AWS_LOG_GROUP_NAMES, SEMRESATTRS_AWS_LOG_GROUP_ARNS, SEMRESATTRS_AWS_LOG_STREAM_NAMES, SEMRESATTRS_AWS_LOG_STREAM_ARNS, SEMRESATTRS_CONTAINER_NAME, SEMRESATTRS_CONTAINER_ID, SEMRESATTRS_CONTAINER_RUNTIME, SEMRESATTRS_CONTAINER_IMAGE_NAME, SEMRESATTRS_CONTAINER_IMAGE_TAG, SEMRESATTRS_DEPLOYMENT_ENVIRONMENT, SEMRESATTRS_DEVICE_ID, SEMRESATTRS_DEVICE_MODEL_IDENTIFIER, SEMRESATTRS_DEVICE_MODEL_NAME, SEMRESATTRS_FAAS_NAME, SEMRESATTRS_FAAS_ID, SEMRESATTRS_FAAS_VERSION, SEMRESATTRS_FAAS_INSTANCE, SEMRESATTRS_FAAS_MAX_MEMORY, SEMRESATTRS_HOST_ID, SEMRESATTRS_HOST_NAME, SEMRESATTRS_HOST_TYPE, SEMRESATTRS_HOST_ARCH, SEMRESATTRS_HOST_IMAGE_NAME, SEMRESATTRS_HOST_IMAGE_ID, SEMRESATTRS_HOST_IMAGE_VERSION, SEMRESATTRS_K8S_CLUSTER_NAME, SEMRESATTRS_K8S_NODE_NAME, SEMRESATTRS_K8S_NODE_UID, SEMRESATTRS_K8S_NAMESPACE_NAME, SEMRESATTRS_K8S_POD_UID, SEMRESATTRS_K8S_POD_NAME, SEMRESATTRS_K8S_CONTAINER_NAME, SEMRESATTRS_K8S_REPLICASET_UID, SEMRESATTRS_K8S_REPLICASET_NAME, SEMRESATTRS_K8S_DEPLOYMENT_UID, SEMRESATTRS_K8S_DEPLOYMENT_NAME, SEMRESATTRS_K8S_STATEFULSET_UID, SEMRESATTRS_K8S_STATEFULSET_NAME, SEMRESATTRS_K8S_DAEMONSET_UID, SEMRESATTRS_K8S_DAEMONSET_NAME, SEMRESATTRS_K8S_JOB_UID, SEMRESATTRS_K8S_JOB_NAME, SEMRESATTRS_K8S_CRONJOB_UID, SEMRESATTRS_K8S_CRONJOB_NAME, SEMRESATTRS_OS_TYPE, SEMRESATTRS_OS_DESCRIPTION, SEMRESATTRS_OS_NAME, SEMRESATTRS_OS_VERSION, SEMRESATTRS_PROCESS_PID, SEMRESATTRS_PROCESS_EXECUTABLE_NAME, SEMRESATTRS_PROCESS_EXECUTABLE_PATH, SEMRESATTRS_PROCESS_COMMAND, SEMRESATTRS_PROCESS_COMMAND_LINE, SEMRESATTRS_PROCESS_COMMAND_ARGS, SEMRESATTRS_PROCESS_OWNER, SEMRESATTRS_PROCESS_RUNTIME_NAME, SEMRESATTRS_PROCESS_RUNTIME_VERSION, SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION, SEMRESATTRS_SERVICE_NAME, SEMRESATTRS_SERVICE_NAMESPACE, SEMRESATTRS_SERVICE_INSTANCE_ID, SEMRESATTRS_SERVICE_VERSION, SEMRESATTRS_TELEMETRY_SDK_NAME, SEMRESATTRS_TELEMETRY_SDK_LANGUAGE, SEMRESATTRS_TELEMETRY_SDK_VERSION, SEMRESATTRS_TELEMETRY_AUTO_VERSION, SEMRESATTRS_WEBENGINE_NAME, SEMRESATTRS_WEBENGINE_VERSION, SEMRESATTRS_WEBENGINE_DESCRIPTION, SemanticResourceAttributes, TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, TMP_CLOUDPROVIDERVALUES_AWS, TMP_CLOUDPROVIDERVALUES_AZURE, TMP_CLOUDPROVIDERVALUES_GCP, CLOUDPROVIDERVALUES_ALIBABA_CLOUD, CLOUDPROVIDERVALUES_AWS, CLOUDPROVIDERVALUES_AZURE, CLOUDPROVIDERVALUES_GCP, CloudProviderValues, TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, TMP_CLOUDPLATFORMVALUES_AWS_EC2, TMP_CLOUDPLATFORMVALUES_AWS_ECS, TMP_CLOUDPLATFORMVALUES_AWS_EKS, TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, TMP_CLOUDPLATFORMVALUES_AZURE_VM, TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, TMP_CLOUDPLATFORMVALUES_AZURE_AKS, TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE, CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, CLOUDPLATFORMVALUES_AWS_EC2, CLOUDPLATFORMVALUES_AWS_ECS, CLOUDPLATFORMVALUES_AWS_EKS, CLOUDPLATFORMVALUES_AWS_LAMBDA, CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, CLOUDPLATFORMVALUES_AZURE_VM, CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, CLOUDPLATFORMVALUES_AZURE_AKS, CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, CLOUDPLATFORMVALUES_GCP_APP_ENGINE, CloudPlatformValues, TMP_AWSECSLAUNCHTYPEVALUES_EC2, TMP_AWSECSLAUNCHTYPEVALUES_FARGATE, AWSECSLAUNCHTYPEVALUES_EC2, AWSECSLAUNCHTYPEVALUES_FARGATE, AwsEcsLaunchtypeValues, TMP_HOSTARCHVALUES_AMD64, TMP_HOSTARCHVALUES_ARM32, TMP_HOSTARCHVALUES_ARM64, TMP_HOSTARCHVALUES_IA64, TMP_HOSTARCHVALUES_PPC32, TMP_HOSTARCHVALUES_PPC64, TMP_HOSTARCHVALUES_X86, HOSTARCHVALUES_AMD64, HOSTARCHVALUES_ARM32, HOSTARCHVALUES_ARM64, HOSTARCHVALUES_IA64, HOSTARCHVALUES_PPC32, HOSTARCHVALUES_PPC64, HOSTARCHVALUES_X86, HostArchValues, TMP_OSTYPEVALUES_WINDOWS, TMP_OSTYPEVALUES_LINUX, TMP_OSTYPEVALUES_DARWIN, TMP_OSTYPEVALUES_FREEBSD, TMP_OSTYPEVALUES_NETBSD, TMP_OSTYPEVALUES_OPENBSD, TMP_OSTYPEVALUES_DRAGONFLYBSD, TMP_OSTYPEVALUES_HPUX, TMP_OSTYPEVALUES_AIX, TMP_OSTYPEVALUES_SOLARIS, TMP_OSTYPEVALUES_Z_OS, OSTYPEVALUES_WINDOWS, OSTYPEVALUES_LINUX, OSTYPEVALUES_DARWIN, OSTYPEVALUES_FREEBSD, OSTYPEVALUES_NETBSD, OSTYPEVALUES_OPENBSD, OSTYPEVALUES_DRAGONFLYBSD, OSTYPEVALUES_HPUX, OSTYPEVALUES_AIX, OSTYPEVALUES_SOLARIS, OSTYPEVALUES_Z_OS, OsTypeValues, TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, TMP_TELEMETRYSDKLANGUAGEVALUES_GO, TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS, TELEMETRYSDKLANGUAGEVALUES_CPP, TELEMETRYSDKLANGUAGEVALUES_DOTNET, TELEMETRYSDKLANGUAGEVALUES_ERLANG, TELEMETRYSDKLANGUAGEVALUES_GO, TELEMETRYSDKLANGUAGEVALUES_JAVA, TELEMETRYSDKLANGUAGEVALUES_NODEJS, TELEMETRYSDKLANGUAGEVALUES_PHP, TELEMETRYSDKLANGUAGEVALUES_PYTHON, TELEMETRYSDKLANGUAGEVALUES_RUBY, TELEMETRYSDKLANGUAGEVALUES_WEBJS, TelemetrySdkLanguageValues; +var init_SemanticResourceAttributes = __esmMin((() => { + init_utils(); + TMP_CLOUD_PROVIDER = "cloud.provider"; + TMP_CLOUD_ACCOUNT_ID = "cloud.account.id"; + TMP_CLOUD_REGION = "cloud.region"; + TMP_CLOUD_AVAILABILITY_ZONE = "cloud.availability_zone"; + TMP_CLOUD_PLATFORM = "cloud.platform"; + TMP_AWS_ECS_CONTAINER_ARN = "aws.ecs.container.arn"; + TMP_AWS_ECS_CLUSTER_ARN = "aws.ecs.cluster.arn"; + TMP_AWS_ECS_LAUNCHTYPE = "aws.ecs.launchtype"; + TMP_AWS_ECS_TASK_ARN = "aws.ecs.task.arn"; + TMP_AWS_ECS_TASK_FAMILY = "aws.ecs.task.family"; + TMP_AWS_ECS_TASK_REVISION = "aws.ecs.task.revision"; + TMP_AWS_EKS_CLUSTER_ARN = "aws.eks.cluster.arn"; + TMP_AWS_LOG_GROUP_NAMES = "aws.log.group.names"; + TMP_AWS_LOG_GROUP_ARNS = "aws.log.group.arns"; + TMP_AWS_LOG_STREAM_NAMES = "aws.log.stream.names"; + TMP_AWS_LOG_STREAM_ARNS = "aws.log.stream.arns"; + TMP_CONTAINER_NAME = "container.name"; + TMP_CONTAINER_ID = "container.id"; + TMP_CONTAINER_RUNTIME = "container.runtime"; + TMP_CONTAINER_IMAGE_NAME = "container.image.name"; + TMP_CONTAINER_IMAGE_TAG = "container.image.tag"; + TMP_DEPLOYMENT_ENVIRONMENT = "deployment.environment"; + TMP_DEVICE_ID = "device.id"; + TMP_DEVICE_MODEL_IDENTIFIER = "device.model.identifier"; + TMP_DEVICE_MODEL_NAME = "device.model.name"; + TMP_FAAS_NAME = "faas.name"; + TMP_FAAS_ID = "faas.id"; + TMP_FAAS_VERSION = "faas.version"; + TMP_FAAS_INSTANCE = "faas.instance"; + TMP_FAAS_MAX_MEMORY = "faas.max_memory"; + TMP_HOST_ID = "host.id"; + TMP_HOST_NAME = "host.name"; + TMP_HOST_TYPE = "host.type"; + TMP_HOST_ARCH = "host.arch"; + TMP_HOST_IMAGE_NAME = "host.image.name"; + TMP_HOST_IMAGE_ID = "host.image.id"; + TMP_HOST_IMAGE_VERSION = "host.image.version"; + TMP_K8S_CLUSTER_NAME = "k8s.cluster.name"; + TMP_K8S_NODE_NAME = "k8s.node.name"; + TMP_K8S_NODE_UID = "k8s.node.uid"; + TMP_K8S_NAMESPACE_NAME = "k8s.namespace.name"; + TMP_K8S_POD_UID = "k8s.pod.uid"; + TMP_K8S_POD_NAME = "k8s.pod.name"; + TMP_K8S_CONTAINER_NAME = "k8s.container.name"; + TMP_K8S_REPLICASET_UID = "k8s.replicaset.uid"; + TMP_K8S_REPLICASET_NAME = "k8s.replicaset.name"; + TMP_K8S_DEPLOYMENT_UID = "k8s.deployment.uid"; + TMP_K8S_DEPLOYMENT_NAME = "k8s.deployment.name"; + TMP_K8S_STATEFULSET_UID = "k8s.statefulset.uid"; + TMP_K8S_STATEFULSET_NAME = "k8s.statefulset.name"; + TMP_K8S_DAEMONSET_UID = "k8s.daemonset.uid"; + TMP_K8S_DAEMONSET_NAME = "k8s.daemonset.name"; + TMP_K8S_JOB_UID = "k8s.job.uid"; + TMP_K8S_JOB_NAME = "k8s.job.name"; + TMP_K8S_CRONJOB_UID = "k8s.cronjob.uid"; + TMP_K8S_CRONJOB_NAME = "k8s.cronjob.name"; + TMP_OS_TYPE = "os.type"; + TMP_OS_DESCRIPTION = "os.description"; + TMP_OS_NAME = "os.name"; + TMP_OS_VERSION = "os.version"; + TMP_PROCESS_PID = "process.pid"; + TMP_PROCESS_EXECUTABLE_NAME = "process.executable.name"; + TMP_PROCESS_EXECUTABLE_PATH = "process.executable.path"; + TMP_PROCESS_COMMAND = "process.command"; + TMP_PROCESS_COMMAND_LINE = "process.command_line"; + TMP_PROCESS_COMMAND_ARGS = "process.command_args"; + TMP_PROCESS_OWNER = "process.owner"; + TMP_PROCESS_RUNTIME_NAME = "process.runtime.name"; + TMP_PROCESS_RUNTIME_VERSION = "process.runtime.version"; + TMP_PROCESS_RUNTIME_DESCRIPTION = "process.runtime.description"; + TMP_SERVICE_NAME = "service.name"; + TMP_SERVICE_NAMESPACE = "service.namespace"; + TMP_SERVICE_INSTANCE_ID = "service.instance.id"; + TMP_SERVICE_VERSION = "service.version"; + TMP_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; + TMP_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; + TMP_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; + TMP_TELEMETRY_AUTO_VERSION = "telemetry.auto.version"; + TMP_WEBENGINE_NAME = "webengine.name"; + TMP_WEBENGINE_VERSION = "webengine.version"; + TMP_WEBENGINE_DESCRIPTION = "webengine.description"; + SEMRESATTRS_CLOUD_PROVIDER = TMP_CLOUD_PROVIDER; + SEMRESATTRS_CLOUD_ACCOUNT_ID = TMP_CLOUD_ACCOUNT_ID; + SEMRESATTRS_CLOUD_REGION = TMP_CLOUD_REGION; + SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = TMP_CLOUD_AVAILABILITY_ZONE; + SEMRESATTRS_CLOUD_PLATFORM = TMP_CLOUD_PLATFORM; + SEMRESATTRS_AWS_ECS_CONTAINER_ARN = TMP_AWS_ECS_CONTAINER_ARN; + SEMRESATTRS_AWS_ECS_CLUSTER_ARN = TMP_AWS_ECS_CLUSTER_ARN; + SEMRESATTRS_AWS_ECS_LAUNCHTYPE = TMP_AWS_ECS_LAUNCHTYPE; + SEMRESATTRS_AWS_ECS_TASK_ARN = TMP_AWS_ECS_TASK_ARN; + SEMRESATTRS_AWS_ECS_TASK_FAMILY = TMP_AWS_ECS_TASK_FAMILY; + SEMRESATTRS_AWS_ECS_TASK_REVISION = TMP_AWS_ECS_TASK_REVISION; + SEMRESATTRS_AWS_EKS_CLUSTER_ARN = TMP_AWS_EKS_CLUSTER_ARN; + SEMRESATTRS_AWS_LOG_GROUP_NAMES = TMP_AWS_LOG_GROUP_NAMES; + SEMRESATTRS_AWS_LOG_GROUP_ARNS = TMP_AWS_LOG_GROUP_ARNS; + SEMRESATTRS_AWS_LOG_STREAM_NAMES = TMP_AWS_LOG_STREAM_NAMES; + SEMRESATTRS_AWS_LOG_STREAM_ARNS = TMP_AWS_LOG_STREAM_ARNS; + SEMRESATTRS_CONTAINER_NAME = TMP_CONTAINER_NAME; + SEMRESATTRS_CONTAINER_ID = TMP_CONTAINER_ID; + SEMRESATTRS_CONTAINER_RUNTIME = TMP_CONTAINER_RUNTIME; + SEMRESATTRS_CONTAINER_IMAGE_NAME = TMP_CONTAINER_IMAGE_NAME; + SEMRESATTRS_CONTAINER_IMAGE_TAG = TMP_CONTAINER_IMAGE_TAG; + SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = TMP_DEPLOYMENT_ENVIRONMENT; + SEMRESATTRS_DEVICE_ID = TMP_DEVICE_ID; + SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = TMP_DEVICE_MODEL_IDENTIFIER; + SEMRESATTRS_DEVICE_MODEL_NAME = TMP_DEVICE_MODEL_NAME; + SEMRESATTRS_FAAS_NAME = TMP_FAAS_NAME; + SEMRESATTRS_FAAS_ID = TMP_FAAS_ID; + SEMRESATTRS_FAAS_VERSION = TMP_FAAS_VERSION; + SEMRESATTRS_FAAS_INSTANCE = TMP_FAAS_INSTANCE; + SEMRESATTRS_FAAS_MAX_MEMORY = TMP_FAAS_MAX_MEMORY; + SEMRESATTRS_HOST_ID = TMP_HOST_ID; + SEMRESATTRS_HOST_NAME = TMP_HOST_NAME; + SEMRESATTRS_HOST_TYPE = TMP_HOST_TYPE; + SEMRESATTRS_HOST_ARCH = TMP_HOST_ARCH; + SEMRESATTRS_HOST_IMAGE_NAME = TMP_HOST_IMAGE_NAME; + SEMRESATTRS_HOST_IMAGE_ID = TMP_HOST_IMAGE_ID; + SEMRESATTRS_HOST_IMAGE_VERSION = TMP_HOST_IMAGE_VERSION; + SEMRESATTRS_K8S_CLUSTER_NAME = TMP_K8S_CLUSTER_NAME; + SEMRESATTRS_K8S_NODE_NAME = TMP_K8S_NODE_NAME; + SEMRESATTRS_K8S_NODE_UID = TMP_K8S_NODE_UID; + SEMRESATTRS_K8S_NAMESPACE_NAME = TMP_K8S_NAMESPACE_NAME; + SEMRESATTRS_K8S_POD_UID = TMP_K8S_POD_UID; + SEMRESATTRS_K8S_POD_NAME = TMP_K8S_POD_NAME; + SEMRESATTRS_K8S_CONTAINER_NAME = TMP_K8S_CONTAINER_NAME; + SEMRESATTRS_K8S_REPLICASET_UID = TMP_K8S_REPLICASET_UID; + SEMRESATTRS_K8S_REPLICASET_NAME = TMP_K8S_REPLICASET_NAME; + SEMRESATTRS_K8S_DEPLOYMENT_UID = TMP_K8S_DEPLOYMENT_UID; + SEMRESATTRS_K8S_DEPLOYMENT_NAME = TMP_K8S_DEPLOYMENT_NAME; + SEMRESATTRS_K8S_STATEFULSET_UID = TMP_K8S_STATEFULSET_UID; + SEMRESATTRS_K8S_STATEFULSET_NAME = TMP_K8S_STATEFULSET_NAME; + SEMRESATTRS_K8S_DAEMONSET_UID = TMP_K8S_DAEMONSET_UID; + SEMRESATTRS_K8S_DAEMONSET_NAME = TMP_K8S_DAEMONSET_NAME; + SEMRESATTRS_K8S_JOB_UID = TMP_K8S_JOB_UID; + SEMRESATTRS_K8S_JOB_NAME = TMP_K8S_JOB_NAME; + SEMRESATTRS_K8S_CRONJOB_UID = TMP_K8S_CRONJOB_UID; + SEMRESATTRS_K8S_CRONJOB_NAME = TMP_K8S_CRONJOB_NAME; + SEMRESATTRS_OS_TYPE = TMP_OS_TYPE; + SEMRESATTRS_OS_DESCRIPTION = TMP_OS_DESCRIPTION; + SEMRESATTRS_OS_NAME = TMP_OS_NAME; + SEMRESATTRS_OS_VERSION = TMP_OS_VERSION; + SEMRESATTRS_PROCESS_PID = TMP_PROCESS_PID; + SEMRESATTRS_PROCESS_EXECUTABLE_NAME = TMP_PROCESS_EXECUTABLE_NAME; + SEMRESATTRS_PROCESS_EXECUTABLE_PATH = TMP_PROCESS_EXECUTABLE_PATH; + SEMRESATTRS_PROCESS_COMMAND = TMP_PROCESS_COMMAND; + SEMRESATTRS_PROCESS_COMMAND_LINE = TMP_PROCESS_COMMAND_LINE; + SEMRESATTRS_PROCESS_COMMAND_ARGS = TMP_PROCESS_COMMAND_ARGS; + SEMRESATTRS_PROCESS_OWNER = TMP_PROCESS_OWNER; + SEMRESATTRS_PROCESS_RUNTIME_NAME = TMP_PROCESS_RUNTIME_NAME; + SEMRESATTRS_PROCESS_RUNTIME_VERSION = TMP_PROCESS_RUNTIME_VERSION; + SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = TMP_PROCESS_RUNTIME_DESCRIPTION; + SEMRESATTRS_SERVICE_NAME = TMP_SERVICE_NAME; + SEMRESATTRS_SERVICE_NAMESPACE = TMP_SERVICE_NAMESPACE; + SEMRESATTRS_SERVICE_INSTANCE_ID = TMP_SERVICE_INSTANCE_ID; + SEMRESATTRS_SERVICE_VERSION = TMP_SERVICE_VERSION; + SEMRESATTRS_TELEMETRY_SDK_NAME = TMP_TELEMETRY_SDK_NAME; + SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = TMP_TELEMETRY_SDK_LANGUAGE; + SEMRESATTRS_TELEMETRY_SDK_VERSION = TMP_TELEMETRY_SDK_VERSION; + SEMRESATTRS_TELEMETRY_AUTO_VERSION = TMP_TELEMETRY_AUTO_VERSION; + SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; + SEMRESATTRS_WEBENGINE_VERSION = TMP_WEBENGINE_VERSION; + SEMRESATTRS_WEBENGINE_DESCRIPTION = TMP_WEBENGINE_DESCRIPTION; + SemanticResourceAttributes = /* @__PURE__ */ createConstMap([ + TMP_CLOUD_PROVIDER, + TMP_CLOUD_ACCOUNT_ID, + TMP_CLOUD_REGION, + TMP_CLOUD_AVAILABILITY_ZONE, + TMP_CLOUD_PLATFORM, + TMP_AWS_ECS_CONTAINER_ARN, + TMP_AWS_ECS_CLUSTER_ARN, + TMP_AWS_ECS_LAUNCHTYPE, + TMP_AWS_ECS_TASK_ARN, + TMP_AWS_ECS_TASK_FAMILY, + TMP_AWS_ECS_TASK_REVISION, + TMP_AWS_EKS_CLUSTER_ARN, + TMP_AWS_LOG_GROUP_NAMES, + TMP_AWS_LOG_GROUP_ARNS, + TMP_AWS_LOG_STREAM_NAMES, + TMP_AWS_LOG_STREAM_ARNS, + TMP_CONTAINER_NAME, + TMP_CONTAINER_ID, + TMP_CONTAINER_RUNTIME, + TMP_CONTAINER_IMAGE_NAME, + TMP_CONTAINER_IMAGE_TAG, + TMP_DEPLOYMENT_ENVIRONMENT, + TMP_DEVICE_ID, + TMP_DEVICE_MODEL_IDENTIFIER, + TMP_DEVICE_MODEL_NAME, + TMP_FAAS_NAME, + TMP_FAAS_ID, + TMP_FAAS_VERSION, + TMP_FAAS_INSTANCE, + TMP_FAAS_MAX_MEMORY, + TMP_HOST_ID, + TMP_HOST_NAME, + TMP_HOST_TYPE, + TMP_HOST_ARCH, + TMP_HOST_IMAGE_NAME, + TMP_HOST_IMAGE_ID, + TMP_HOST_IMAGE_VERSION, + TMP_K8S_CLUSTER_NAME, + TMP_K8S_NODE_NAME, + TMP_K8S_NODE_UID, + TMP_K8S_NAMESPACE_NAME, + TMP_K8S_POD_UID, + TMP_K8S_POD_NAME, + TMP_K8S_CONTAINER_NAME, + TMP_K8S_REPLICASET_UID, + TMP_K8S_REPLICASET_NAME, + TMP_K8S_DEPLOYMENT_UID, + TMP_K8S_DEPLOYMENT_NAME, + TMP_K8S_STATEFULSET_UID, + TMP_K8S_STATEFULSET_NAME, + TMP_K8S_DAEMONSET_UID, + TMP_K8S_DAEMONSET_NAME, + TMP_K8S_JOB_UID, + TMP_K8S_JOB_NAME, + TMP_K8S_CRONJOB_UID, + TMP_K8S_CRONJOB_NAME, + TMP_OS_TYPE, + TMP_OS_DESCRIPTION, + TMP_OS_NAME, + TMP_OS_VERSION, + TMP_PROCESS_PID, + TMP_PROCESS_EXECUTABLE_NAME, + TMP_PROCESS_EXECUTABLE_PATH, + TMP_PROCESS_COMMAND, + TMP_PROCESS_COMMAND_LINE, + TMP_PROCESS_COMMAND_ARGS, + TMP_PROCESS_OWNER, + TMP_PROCESS_RUNTIME_NAME, + TMP_PROCESS_RUNTIME_VERSION, + TMP_PROCESS_RUNTIME_DESCRIPTION, + TMP_SERVICE_NAME, + TMP_SERVICE_NAMESPACE, + TMP_SERVICE_INSTANCE_ID, + TMP_SERVICE_VERSION, + TMP_TELEMETRY_SDK_NAME, + TMP_TELEMETRY_SDK_LANGUAGE, + TMP_TELEMETRY_SDK_VERSION, + TMP_TELEMETRY_AUTO_VERSION, + TMP_WEBENGINE_NAME, + TMP_WEBENGINE_VERSION, + TMP_WEBENGINE_DESCRIPTION + ]); + TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD = "alibaba_cloud"; + TMP_CLOUDPROVIDERVALUES_AWS = "aws"; + TMP_CLOUDPROVIDERVALUES_AZURE = "azure"; + TMP_CLOUDPROVIDERVALUES_GCP = "gcp"; + CLOUDPROVIDERVALUES_ALIBABA_CLOUD = TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD; + CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; + CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; + CLOUDPROVIDERVALUES_GCP = TMP_CLOUDPROVIDERVALUES_GCP; + CloudProviderValues = /* @__PURE__ */ createConstMap([ + TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, + TMP_CLOUDPROVIDERVALUES_AWS, + TMP_CLOUDPROVIDERVALUES_AZURE, + TMP_CLOUDPROVIDERVALUES_GCP + ]); + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"; + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = "alibaba_cloud_fc"; + TMP_CLOUDPLATFORMVALUES_AWS_EC2 = "aws_ec2"; + TMP_CLOUDPLATFORMVALUES_AWS_ECS = "aws_ecs"; + TMP_CLOUDPLATFORMVALUES_AWS_EKS = "aws_eks"; + TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA = "aws_lambda"; + TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"; + TMP_CLOUDPLATFORMVALUES_AZURE_VM = "azure_vm"; + TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = "azure_container_instances"; + TMP_CLOUDPLATFORMVALUES_AZURE_AKS = "azure_aks"; + TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = "azure_functions"; + TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = "azure_app_service"; + TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = "gcp_compute_engine"; + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = "gcp_cloud_run"; + TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine"; + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions"; + TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE = "gcp_app_engine"; + CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS; + CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC; + CLOUDPLATFORMVALUES_AWS_EC2 = TMP_CLOUDPLATFORMVALUES_AWS_EC2; + CLOUDPLATFORMVALUES_AWS_ECS = TMP_CLOUDPLATFORMVALUES_AWS_ECS; + CLOUDPLATFORMVALUES_AWS_EKS = TMP_CLOUDPLATFORMVALUES_AWS_EKS; + CLOUDPLATFORMVALUES_AWS_LAMBDA = TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA; + CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK; + CLOUDPLATFORMVALUES_AZURE_VM = TMP_CLOUDPLATFORMVALUES_AZURE_VM; + CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES; + CLOUDPLATFORMVALUES_AZURE_AKS = TMP_CLOUDPLATFORMVALUES_AZURE_AKS; + CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS; + CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE; + CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE; + CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN; + 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([ + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, + TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, + TMP_CLOUDPLATFORMVALUES_AWS_EC2, + TMP_CLOUDPLATFORMVALUES_AWS_ECS, + TMP_CLOUDPLATFORMVALUES_AWS_EKS, + TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA, + TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, + TMP_CLOUDPLATFORMVALUES_AZURE_VM, + TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, + TMP_CLOUDPLATFORMVALUES_AZURE_AKS, + TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, + TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, + TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE, + TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, + TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE + ]); + TMP_AWSECSLAUNCHTYPEVALUES_EC2 = "ec2"; + TMP_AWSECSLAUNCHTYPEVALUES_FARGATE = "fargate"; + AWSECSLAUNCHTYPEVALUES_EC2 = TMP_AWSECSLAUNCHTYPEVALUES_EC2; + AWSECSLAUNCHTYPEVALUES_FARGATE = TMP_AWSECSLAUNCHTYPEVALUES_FARGATE; + AwsEcsLaunchtypeValues = /* @__PURE__ */ createConstMap([TMP_AWSECSLAUNCHTYPEVALUES_EC2, TMP_AWSECSLAUNCHTYPEVALUES_FARGATE]); + TMP_HOSTARCHVALUES_AMD64 = "amd64"; + TMP_HOSTARCHVALUES_ARM32 = "arm32"; + TMP_HOSTARCHVALUES_ARM64 = "arm64"; + TMP_HOSTARCHVALUES_IA64 = "ia64"; + TMP_HOSTARCHVALUES_PPC32 = "ppc32"; + TMP_HOSTARCHVALUES_PPC64 = "ppc64"; + TMP_HOSTARCHVALUES_X86 = "x86"; + HOSTARCHVALUES_AMD64 = TMP_HOSTARCHVALUES_AMD64; + HOSTARCHVALUES_ARM32 = TMP_HOSTARCHVALUES_ARM32; + HOSTARCHVALUES_ARM64 = TMP_HOSTARCHVALUES_ARM64; + HOSTARCHVALUES_IA64 = TMP_HOSTARCHVALUES_IA64; + HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; + HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; + HOSTARCHVALUES_X86 = TMP_HOSTARCHVALUES_X86; + HostArchValues = /* @__PURE__ */ createConstMap([ + TMP_HOSTARCHVALUES_AMD64, + TMP_HOSTARCHVALUES_ARM32, + TMP_HOSTARCHVALUES_ARM64, + TMP_HOSTARCHVALUES_IA64, + TMP_HOSTARCHVALUES_PPC32, + TMP_HOSTARCHVALUES_PPC64, + TMP_HOSTARCHVALUES_X86 + ]); + TMP_OSTYPEVALUES_WINDOWS = "windows"; + TMP_OSTYPEVALUES_LINUX = "linux"; + TMP_OSTYPEVALUES_DARWIN = "darwin"; + TMP_OSTYPEVALUES_FREEBSD = "freebsd"; + TMP_OSTYPEVALUES_NETBSD = "netbsd"; + TMP_OSTYPEVALUES_OPENBSD = "openbsd"; + TMP_OSTYPEVALUES_DRAGONFLYBSD = "dragonflybsd"; + TMP_OSTYPEVALUES_HPUX = "hpux"; + TMP_OSTYPEVALUES_AIX = "aix"; + TMP_OSTYPEVALUES_SOLARIS = "solaris"; + TMP_OSTYPEVALUES_Z_OS = "z_os"; + OSTYPEVALUES_WINDOWS = TMP_OSTYPEVALUES_WINDOWS; + OSTYPEVALUES_LINUX = TMP_OSTYPEVALUES_LINUX; + OSTYPEVALUES_DARWIN = TMP_OSTYPEVALUES_DARWIN; + OSTYPEVALUES_FREEBSD = TMP_OSTYPEVALUES_FREEBSD; + OSTYPEVALUES_NETBSD = TMP_OSTYPEVALUES_NETBSD; + OSTYPEVALUES_OPENBSD = TMP_OSTYPEVALUES_OPENBSD; + OSTYPEVALUES_DRAGONFLYBSD = TMP_OSTYPEVALUES_DRAGONFLYBSD; + OSTYPEVALUES_HPUX = TMP_OSTYPEVALUES_HPUX; + OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; + OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; + OSTYPEVALUES_Z_OS = TMP_OSTYPEVALUES_Z_OS; + OsTypeValues = /* @__PURE__ */ createConstMap([ + TMP_OSTYPEVALUES_WINDOWS, + TMP_OSTYPEVALUES_LINUX, + TMP_OSTYPEVALUES_DARWIN, + TMP_OSTYPEVALUES_FREEBSD, + TMP_OSTYPEVALUES_NETBSD, + TMP_OSTYPEVALUES_OPENBSD, + TMP_OSTYPEVALUES_DRAGONFLYBSD, + TMP_OSTYPEVALUES_HPUX, + TMP_OSTYPEVALUES_AIX, + TMP_OSTYPEVALUES_SOLARIS, + TMP_OSTYPEVALUES_Z_OS + ]); + TMP_TELEMETRYSDKLANGUAGEVALUES_CPP = "cpp"; + TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET = "dotnet"; + TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG = "erlang"; + TMP_TELEMETRYSDKLANGUAGEVALUES_GO = "go"; + TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA = "java"; + TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS = "nodejs"; + TMP_TELEMETRYSDKLANGUAGEVALUES_PHP = "php"; + TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON = "python"; + TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY = "ruby"; + TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS = "webjs"; + TELEMETRYSDKLANGUAGEVALUES_CPP = TMP_TELEMETRYSDKLANGUAGEVALUES_CPP; + TELEMETRYSDKLANGUAGEVALUES_DOTNET = TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET; + TELEMETRYSDKLANGUAGEVALUES_ERLANG = TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG; + TELEMETRYSDKLANGUAGEVALUES_GO = TMP_TELEMETRYSDKLANGUAGEVALUES_GO; + TELEMETRYSDKLANGUAGEVALUES_JAVA = TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA; + TELEMETRYSDKLANGUAGEVALUES_NODEJS = TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS; + TELEMETRYSDKLANGUAGEVALUES_PHP = TMP_TELEMETRYSDKLANGUAGEVALUES_PHP; + TELEMETRYSDKLANGUAGEVALUES_PYTHON = TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON; + TELEMETRYSDKLANGUAGEVALUES_RUBY = TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY; + TELEMETRYSDKLANGUAGEVALUES_WEBJS = TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS; + TelemetrySdkLanguageValues = /* @__PURE__ */ createConstMap([ + TMP_TELEMETRYSDKLANGUAGEVALUES_CPP, + TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET, + TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG, + TMP_TELEMETRYSDKLANGUAGEVALUES_GO, + TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA, + TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS, + TMP_TELEMETRYSDKLANGUAGEVALUES_PHP, + TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON, + TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY, + TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS + ]); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js +var init_resource = __esmMin((() => { + init_SemanticResourceAttributes(); +})); + +//#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 init_stable_attributes = __esmMin((() => { + ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = "aspnetcore.diagnostics.exception.result"; + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled"; + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped"; + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; + ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = "aspnetcore.diagnostics.handler.type"; + ATTR_ASPNETCORE_RATE_LIMITING_POLICY = "aspnetcore.rate_limiting.policy"; + ATTR_ASPNETCORE_RATE_LIMITING_RESULT = "aspnetcore.rate_limiting.result"; + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; + ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = "aspnetcore.request.is_unhandled"; + ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = "aspnetcore.routing.is_fallback"; + ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = "aspnetcore.routing.match_status"; + ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; + ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success"; + ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = "aspnetcore.user.is_authenticated"; + ATTR_CLIENT_ADDRESS = "client.address"; + ATTR_CLIENT_PORT = "client.port"; + ATTR_CODE_COLUMN_NUMBER = "code.column.number"; + ATTR_CODE_FILE_PATH = "code.file.path"; + ATTR_CODE_FUNCTION_NAME = "code.function.name"; + ATTR_CODE_LINE_NUMBER = "code.line.number"; + ATTR_CODE_STACKTRACE = "code.stacktrace"; + ATTR_DB_COLLECTION_NAME = "db.collection.name"; + ATTR_DB_NAMESPACE = "db.namespace"; + ATTR_DB_OPERATION_BATCH_SIZE = "db.operation.batch.size"; + ATTR_DB_OPERATION_NAME = "db.operation.name"; + ATTR_DB_QUERY_SUMMARY = "db.query.summary"; + ATTR_DB_QUERY_TEXT = "db.query.text"; + ATTR_DB_RESPONSE_STATUS_CODE = "db.response.status_code"; + ATTR_DB_STORED_PROCEDURE_NAME = "db.stored_procedure.name"; + ATTR_DB_SYSTEM_NAME = "db.system.name"; + DB_SYSTEM_NAME_VALUE_MARIADB = "mariadb"; + DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = "microsoft.sql_server"; + DB_SYSTEM_NAME_VALUE_MYSQL = "mysql"; + DB_SYSTEM_NAME_VALUE_POSTGRESQL = "postgresql"; + ATTR_DEPLOYMENT_ENVIRONMENT_NAME = "deployment.environment.name"; + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT = "development"; + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION = "production"; + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING = "staging"; + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST = "test"; + ATTR_DOTNET_GC_HEAP_GENERATION = "dotnet.gc.heap.generation"; + DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = "gen0"; + DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = "gen1"; + 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"; + ERROR_TYPE_VALUE_OTHER = "_OTHER"; + ATTR_EXCEPTION_ESCAPED = "exception.escaped"; + ATTR_EXCEPTION_MESSAGE = "exception.message"; + ATTR_EXCEPTION_STACKTRACE = "exception.stacktrace"; + ATTR_EXCEPTION_TYPE = "exception.type"; + ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`; + ATTR_HTTP_REQUEST_METHOD = "http.request.method"; + HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER"; + HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; + HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE"; + HTTP_REQUEST_METHOD_VALUE_GET = "GET"; + HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD"; + HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; + HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH"; + HTTP_REQUEST_METHOD_VALUE_POST = "POST"; + HTTP_REQUEST_METHOD_VALUE_PUT = "PUT"; + HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE"; + 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_ROUTE = "http.route"; + ATTR_JVM_GC_ACTION = "jvm.gc.action"; + ATTR_JVM_GC_NAME = "jvm.gc.name"; + ATTR_JVM_MEMORY_POOL_NAME = "jvm.memory.pool.name"; + ATTR_JVM_MEMORY_TYPE = "jvm.memory.type"; + JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; + JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap"; + ATTR_JVM_THREAD_DAEMON = "jvm.thread.daemon"; + ATTR_JVM_THREAD_STATE = "jvm.thread.state"; + JVM_THREAD_STATE_VALUE_BLOCKED = "blocked"; + JVM_THREAD_STATE_VALUE_NEW = "new"; + JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable"; + JVM_THREAD_STATE_VALUE_TERMINATED = "terminated"; + JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting"; + JVM_THREAD_STATE_VALUE_WAITING = "waiting"; + ATTR_NETWORK_LOCAL_ADDRESS = "network.local.address"; + ATTR_NETWORK_LOCAL_PORT = "network.local.port"; + ATTR_NETWORK_PEER_ADDRESS = "network.peer.address"; + ATTR_NETWORK_PEER_PORT = "network.peer.port"; + ATTR_NETWORK_PROTOCOL_NAME = "network.protocol.name"; + ATTR_NETWORK_PROTOCOL_VERSION = "network.protocol.version"; + ATTR_NETWORK_TRANSPORT = "network.transport"; + NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; + NETWORK_TRANSPORT_VALUE_QUIC = "quic"; + NETWORK_TRANSPORT_VALUE_TCP = "tcp"; + NETWORK_TRANSPORT_VALUE_UDP = "udp"; + NETWORK_TRANSPORT_VALUE_UNIX = "unix"; + ATTR_NETWORK_TYPE = "network.type"; + NETWORK_TYPE_VALUE_IPV4 = "ipv4"; + NETWORK_TYPE_VALUE_IPV6 = "ipv6"; + ATTR_OTEL_EVENT_NAME = "otel.event.name"; + ATTR_OTEL_SCOPE_NAME = "otel.scope.name"; + ATTR_OTEL_SCOPE_VERSION = "otel.scope.version"; + ATTR_OTEL_STATUS_CODE = "otel.status_code"; + 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_SERVICE_INSTANCE_ID = "service.instance.id"; + ATTR_SERVICE_NAME = "service.name"; + ATTR_SERVICE_NAMESPACE = "service.namespace"; + ATTR_SERVICE_VERSION = "service.version"; + ATTR_SIGNALR_CONNECTION_STATUS = "signalr.connection.status"; + SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown"; + SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; + SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; + ATTR_SIGNALR_TRANSPORT = "signalr.transport"; + SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling"; + SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; + SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets"; + ATTR_TELEMETRY_DISTRO_NAME = "telemetry.distro.name"; + ATTR_TELEMETRY_DISTRO_VERSION = "telemetry.distro.version"; + ATTR_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; + TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; + TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; + TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; + TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; + TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; + TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; + TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; + TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; + TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; + TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; + TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; + TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; + ATTR_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; + ATTR_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; + ATTR_URL_FRAGMENT = "url.fragment"; + ATTR_URL_FULL = "url.full"; + ATTR_URL_PATH = "url.path"; + ATTR_URL_QUERY = "url.query"; + ATTR_URL_SCHEME = "url.scheme"; + ATTR_USER_AGENT_ORIGINAL = "user_agent.original"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js +var METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS, METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES, METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS, METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE, METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION, METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS, METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS, METRIC_DB_CLIENT_OPERATION_DURATION, METRIC_DOTNET_ASSEMBLY_COUNT, METRIC_DOTNET_EXCEPTIONS, METRIC_DOTNET_GC_COLLECTIONS, METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED, METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE, METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE, METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE, METRIC_DOTNET_GC_PAUSE_TIME, METRIC_DOTNET_JIT_COMPILATION_TIME, METRIC_DOTNET_JIT_COMPILED_IL_SIZE, METRIC_DOTNET_JIT_COMPILED_METHODS, METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS, METRIC_DOTNET_PROCESS_CPU_COUNT, METRIC_DOTNET_PROCESS_CPU_TIME, METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET, METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH, METRIC_DOTNET_THREAD_POOL_THREAD_COUNT, METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT, METRIC_DOTNET_TIMER_COUNT, METRIC_HTTP_CLIENT_REQUEST_DURATION, METRIC_HTTP_SERVER_REQUEST_DURATION, METRIC_JVM_CLASS_COUNT, METRIC_JVM_CLASS_LOADED, METRIC_JVM_CLASS_UNLOADED, METRIC_JVM_CPU_COUNT, METRIC_JVM_CPU_RECENT_UTILIZATION, METRIC_JVM_CPU_TIME, METRIC_JVM_GC_DURATION, METRIC_JVM_MEMORY_COMMITTED, METRIC_JVM_MEMORY_LIMIT, METRIC_JVM_MEMORY_USED, METRIC_JVM_MEMORY_USED_AFTER_LAST_GC, METRIC_JVM_THREAD_COUNT, METRIC_KESTREL_ACTIVE_CONNECTIONS, METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES, METRIC_KESTREL_CONNECTION_DURATION, METRIC_KESTREL_QUEUED_CONNECTIONS, METRIC_KESTREL_QUEUED_REQUESTS, METRIC_KESTREL_REJECTED_CONNECTIONS, METRIC_KESTREL_TLS_HANDSHAKE_DURATION, METRIC_KESTREL_UPGRADED_CONNECTIONS, METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS, METRIC_SIGNALR_SERVER_CONNECTION_DURATION; +var init_stable_metrics = __esmMin((() => { + METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = "aspnetcore.diagnostics.exceptions"; + METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = "aspnetcore.rate_limiting.active_request_leases"; + METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = "aspnetcore.rate_limiting.queued_requests"; + METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = "aspnetcore.rate_limiting.request.time_in_queue"; + METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = "aspnetcore.rate_limiting.request_lease.duration"; + METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = "aspnetcore.rate_limiting.requests"; + METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = "aspnetcore.routing.match_attempts"; + METRIC_DB_CLIENT_OPERATION_DURATION = "db.client.operation.duration"; + METRIC_DOTNET_ASSEMBLY_COUNT = "dotnet.assembly.count"; + METRIC_DOTNET_EXCEPTIONS = "dotnet.exceptions"; + METRIC_DOTNET_GC_COLLECTIONS = "dotnet.gc.collections"; + METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED = "dotnet.gc.heap.total_allocated"; + METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE = "dotnet.gc.last_collection.heap.fragmentation.size"; + METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE = "dotnet.gc.last_collection.heap.size"; + METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE = "dotnet.gc.last_collection.memory.committed_size"; + METRIC_DOTNET_GC_PAUSE_TIME = "dotnet.gc.pause.time"; + METRIC_DOTNET_JIT_COMPILATION_TIME = "dotnet.jit.compilation.time"; + METRIC_DOTNET_JIT_COMPILED_IL_SIZE = "dotnet.jit.compiled_il.size"; + METRIC_DOTNET_JIT_COMPILED_METHODS = "dotnet.jit.compiled_methods"; + METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS = "dotnet.monitor.lock_contentions"; + METRIC_DOTNET_PROCESS_CPU_COUNT = "dotnet.process.cpu.count"; + METRIC_DOTNET_PROCESS_CPU_TIME = "dotnet.process.cpu.time"; + METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET = "dotnet.process.memory.working_set"; + METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH = "dotnet.thread_pool.queue.length"; + METRIC_DOTNET_THREAD_POOL_THREAD_COUNT = "dotnet.thread_pool.thread.count"; + METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT = "dotnet.thread_pool.work_item.count"; + METRIC_DOTNET_TIMER_COUNT = "dotnet.timer.count"; + METRIC_HTTP_CLIENT_REQUEST_DURATION = "http.client.request.duration"; + METRIC_HTTP_SERVER_REQUEST_DURATION = "http.server.request.duration"; + METRIC_JVM_CLASS_COUNT = "jvm.class.count"; + METRIC_JVM_CLASS_LOADED = "jvm.class.loaded"; + METRIC_JVM_CLASS_UNLOADED = "jvm.class.unloaded"; + METRIC_JVM_CPU_COUNT = "jvm.cpu.count"; + METRIC_JVM_CPU_RECENT_UTILIZATION = "jvm.cpu.recent_utilization"; + METRIC_JVM_CPU_TIME = "jvm.cpu.time"; + METRIC_JVM_GC_DURATION = "jvm.gc.duration"; + METRIC_JVM_MEMORY_COMMITTED = "jvm.memory.committed"; + METRIC_JVM_MEMORY_LIMIT = "jvm.memory.limit"; + METRIC_JVM_MEMORY_USED = "jvm.memory.used"; + METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = "jvm.memory.used_after_last_gc"; + METRIC_JVM_THREAD_COUNT = "jvm.thread.count"; + METRIC_KESTREL_ACTIVE_CONNECTIONS = "kestrel.active_connections"; + METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = "kestrel.active_tls_handshakes"; + METRIC_KESTREL_CONNECTION_DURATION = "kestrel.connection.duration"; + METRIC_KESTREL_QUEUED_CONNECTIONS = "kestrel.queued_connections"; + METRIC_KESTREL_QUEUED_REQUESTS = "kestrel.queued_requests"; + METRIC_KESTREL_REJECTED_CONNECTIONS = "kestrel.rejected_connections"; + METRIC_KESTREL_TLS_HANDSHAKE_DURATION = "kestrel.tls_handshake.duration"; + METRIC_KESTREL_UPGRADED_CONNECTIONS = "kestrel.upgraded_connections"; + METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = "signalr.server.active_connections"; + METRIC_SIGNALR_SERVER_CONNECTION_DURATION = "signalr.server.connection.duration"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +var EVENT_EXCEPTION; +var init_stable_events = __esmMin((() => { + EVENT_EXCEPTION = "exception"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.41.1/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +var esm_exports$1 = /* @__PURE__ */ __exportAll({ + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED, + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED, + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED, + ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED: () => ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED, + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED, + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER, + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER, + ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED: () => ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED, + ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE: () => ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE, + ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS: () => ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS, + ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT: () => ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT, + ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE: () => ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE, + ATTR_ASPNETCORE_RATE_LIMITING_POLICY: () => ATTR_ASPNETCORE_RATE_LIMITING_POLICY, + ATTR_ASPNETCORE_RATE_LIMITING_RESULT: () => ATTR_ASPNETCORE_RATE_LIMITING_RESULT, + ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED: () => ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED, + ATTR_ASPNETCORE_ROUTING_IS_FALLBACK: () => ATTR_ASPNETCORE_ROUTING_IS_FALLBACK, + ATTR_ASPNETCORE_ROUTING_MATCH_STATUS: () => ATTR_ASPNETCORE_ROUTING_MATCH_STATUS, + ATTR_ASPNETCORE_USER_IS_AUTHENTICATED: () => ATTR_ASPNETCORE_USER_IS_AUTHENTICATED, + ATTR_CLIENT_ADDRESS: () => ATTR_CLIENT_ADDRESS, + ATTR_CLIENT_PORT: () => ATTR_CLIENT_PORT, + ATTR_CODE_COLUMN_NUMBER: () => ATTR_CODE_COLUMN_NUMBER, + ATTR_CODE_FILE_PATH: () => ATTR_CODE_FILE_PATH, + ATTR_CODE_FUNCTION_NAME: () => ATTR_CODE_FUNCTION_NAME, + ATTR_CODE_LINE_NUMBER: () => ATTR_CODE_LINE_NUMBER, + ATTR_CODE_STACKTRACE: () => ATTR_CODE_STACKTRACE, + ATTR_DB_COLLECTION_NAME: () => ATTR_DB_COLLECTION_NAME, + ATTR_DB_NAMESPACE: () => ATTR_DB_NAMESPACE, + ATTR_DB_OPERATION_BATCH_SIZE: () => ATTR_DB_OPERATION_BATCH_SIZE, + ATTR_DB_OPERATION_NAME: () => ATTR_DB_OPERATION_NAME, + ATTR_DB_QUERY_SUMMARY: () => ATTR_DB_QUERY_SUMMARY, + ATTR_DB_QUERY_TEXT: () => ATTR_DB_QUERY_TEXT, + ATTR_DB_RESPONSE_STATUS_CODE: () => ATTR_DB_RESPONSE_STATUS_CODE, + ATTR_DB_STORED_PROCEDURE_NAME: () => ATTR_DB_STORED_PROCEDURE_NAME, + 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_EXCEPTION_ESCAPED: () => ATTR_EXCEPTION_ESCAPED, + ATTR_EXCEPTION_MESSAGE: () => ATTR_EXCEPTION_MESSAGE, + ATTR_EXCEPTION_STACKTRACE: () => ATTR_EXCEPTION_STACKTRACE, + ATTR_EXCEPTION_TYPE: () => ATTR_EXCEPTION_TYPE, + ATTR_HTTP_REQUEST_HEADER: () => ATTR_HTTP_REQUEST_HEADER, + ATTR_HTTP_REQUEST_METHOD: () => ATTR_HTTP_REQUEST_METHOD, + 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_ROUTE: () => ATTR_HTTP_ROUTE, + ATTR_JVM_GC_ACTION: () => ATTR_JVM_GC_ACTION, + ATTR_JVM_GC_NAME: () => ATTR_JVM_GC_NAME, + ATTR_JVM_MEMORY_POOL_NAME: () => ATTR_JVM_MEMORY_POOL_NAME, + ATTR_JVM_MEMORY_TYPE: () => ATTR_JVM_MEMORY_TYPE, + ATTR_JVM_THREAD_DAEMON: () => ATTR_JVM_THREAD_DAEMON, + ATTR_JVM_THREAD_STATE: () => ATTR_JVM_THREAD_STATE, + ATTR_NETWORK_LOCAL_ADDRESS: () => ATTR_NETWORK_LOCAL_ADDRESS, + ATTR_NETWORK_LOCAL_PORT: () => ATTR_NETWORK_LOCAL_PORT, + ATTR_NETWORK_PEER_ADDRESS: () => ATTR_NETWORK_PEER_ADDRESS, + ATTR_NETWORK_PEER_PORT: () => ATTR_NETWORK_PEER_PORT, + ATTR_NETWORK_PROTOCOL_NAME: () => ATTR_NETWORK_PROTOCOL_NAME, + ATTR_NETWORK_PROTOCOL_VERSION: () => ATTR_NETWORK_PROTOCOL_VERSION, + ATTR_NETWORK_TRANSPORT: () => ATTR_NETWORK_TRANSPORT, + ATTR_NETWORK_TYPE: () => ATTR_NETWORK_TYPE, + ATTR_OTEL_EVENT_NAME: () => ATTR_OTEL_EVENT_NAME, + ATTR_OTEL_SCOPE_NAME: () => ATTR_OTEL_SCOPE_NAME, + 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_SERVICE_INSTANCE_ID: () => ATTR_SERVICE_INSTANCE_ID, + ATTR_SERVICE_NAME: () => ATTR_SERVICE_NAME, + ATTR_SERVICE_NAMESPACE: () => ATTR_SERVICE_NAMESPACE, + ATTR_SERVICE_VERSION: () => ATTR_SERVICE_VERSION, + ATTR_SIGNALR_CONNECTION_STATUS: () => ATTR_SIGNALR_CONNECTION_STATUS, + ATTR_SIGNALR_TRANSPORT: () => ATTR_SIGNALR_TRANSPORT, + ATTR_TELEMETRY_DISTRO_NAME: () => ATTR_TELEMETRY_DISTRO_NAME, + ATTR_TELEMETRY_DISTRO_VERSION: () => ATTR_TELEMETRY_DISTRO_VERSION, + ATTR_TELEMETRY_SDK_LANGUAGE: () => ATTR_TELEMETRY_SDK_LANGUAGE, + ATTR_TELEMETRY_SDK_NAME: () => ATTR_TELEMETRY_SDK_NAME, + ATTR_TELEMETRY_SDK_VERSION: () => ATTR_TELEMETRY_SDK_VERSION, + ATTR_URL_FRAGMENT: () => ATTR_URL_FRAGMENT, + ATTR_URL_FULL: () => ATTR_URL_FULL, + ATTR_URL_PATH: () => ATTR_URL_PATH, + 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_FARGATE: () => AWSECSLAUNCHTYPEVALUES_FARGATE, + AwsEcsLaunchtypeValues: () => AwsEcsLaunchtypeValues, + CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS: () => CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS, + CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC: () => CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC, + CLOUDPLATFORMVALUES_AWS_EC2: () => CLOUDPLATFORMVALUES_AWS_EC2, + CLOUDPLATFORMVALUES_AWS_ECS: () => CLOUDPLATFORMVALUES_AWS_ECS, + CLOUDPLATFORMVALUES_AWS_EKS: () => CLOUDPLATFORMVALUES_AWS_EKS, + CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK: () => CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK, + CLOUDPLATFORMVALUES_AWS_LAMBDA: () => CLOUDPLATFORMVALUES_AWS_LAMBDA, + CLOUDPLATFORMVALUES_AZURE_AKS: () => CLOUDPLATFORMVALUES_AZURE_AKS, + CLOUDPLATFORMVALUES_AZURE_APP_SERVICE: () => CLOUDPLATFORMVALUES_AZURE_APP_SERVICE, + CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES: () => CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES, + CLOUDPLATFORMVALUES_AZURE_FUNCTIONS: () => CLOUDPLATFORMVALUES_AZURE_FUNCTIONS, + CLOUDPLATFORMVALUES_AZURE_VM: () => CLOUDPLATFORMVALUES_AZURE_VM, + CLOUDPLATFORMVALUES_GCP_APP_ENGINE: () => CLOUDPLATFORMVALUES_GCP_APP_ENGINE, + CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS: () => CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS, + CLOUDPLATFORMVALUES_GCP_CLOUD_RUN: () => CLOUDPLATFORMVALUES_GCP_CLOUD_RUN, + 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_AZURE: () => CLOUDPROVIDERVALUES_AZURE, + CLOUDPROVIDERVALUES_GCP: () => CLOUDPROVIDERVALUES_GCP, + CloudPlatformValues: () => CloudPlatformValues, + CloudProviderValues: () => CloudProviderValues, + DBCASSANDRACONSISTENCYLEVELVALUES_ALL: () => DBCASSANDRACONSISTENCYLEVELVALUES_ALL, + DBCASSANDRACONSISTENCYLEVELVALUES_ANY: () => DBCASSANDRACONSISTENCYLEVELVALUES_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_QUORUM: () => DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM, + DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL: () => DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL, + DBCASSANDRACONSISTENCYLEVELVALUES_THREE: () => DBCASSANDRACONSISTENCYLEVELVALUES_THREE, + DBCASSANDRACONSISTENCYLEVELVALUES_TWO: () => DBCASSANDRACONSISTENCYLEVELVALUES_TWO, + DBSYSTEMVALUES_ADABAS: () => DBSYSTEMVALUES_ADABAS, + DBSYSTEMVALUES_CACHE: () => DBSYSTEMVALUES_CACHE, + DBSYSTEMVALUES_CASSANDRA: () => DBSYSTEMVALUES_CASSANDRA, + DBSYSTEMVALUES_CLOUDSCAPE: () => DBSYSTEMVALUES_CLOUDSCAPE, + DBSYSTEMVALUES_COCKROACHDB: () => DBSYSTEMVALUES_COCKROACHDB, + DBSYSTEMVALUES_COLDFUSION: () => DBSYSTEMVALUES_COLDFUSION, + DBSYSTEMVALUES_COSMOSDB: () => DBSYSTEMVALUES_COSMOSDB, + DBSYSTEMVALUES_COUCHBASE: () => DBSYSTEMVALUES_COUCHBASE, + DBSYSTEMVALUES_COUCHDB: () => DBSYSTEMVALUES_COUCHDB, + DBSYSTEMVALUES_DB2: () => DBSYSTEMVALUES_DB2, + DBSYSTEMVALUES_DERBY: () => DBSYSTEMVALUES_DERBY, + DBSYSTEMVALUES_DYNAMODB: () => DBSYSTEMVALUES_DYNAMODB, + DBSYSTEMVALUES_EDB: () => DBSYSTEMVALUES_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_HANADB: () => DBSYSTEMVALUES_HANADB, + DBSYSTEMVALUES_HBASE: () => DBSYSTEMVALUES_HBASE, + DBSYSTEMVALUES_HIVE: () => DBSYSTEMVALUES_HIVE, + DBSYSTEMVALUES_HSQLDB: () => DBSYSTEMVALUES_HSQLDB, + DBSYSTEMVALUES_INFORMIX: () => DBSYSTEMVALUES_INFORMIX, + DBSYSTEMVALUES_INGRES: () => DBSYSTEMVALUES_INGRES, + DBSYSTEMVALUES_INSTANTDB: () => DBSYSTEMVALUES_INSTANTDB, + DBSYSTEMVALUES_INTERBASE: () => DBSYSTEMVALUES_INTERBASE, + DBSYSTEMVALUES_MARIADB: () => DBSYSTEMVALUES_MARIADB, + DBSYSTEMVALUES_MAXDB: () => DBSYSTEMVALUES_MAXDB, + DBSYSTEMVALUES_MEMCACHED: () => DBSYSTEMVALUES_MEMCACHED, + DBSYSTEMVALUES_MONGODB: () => DBSYSTEMVALUES_MONGODB, + DBSYSTEMVALUES_MSSQL: () => DBSYSTEMVALUES_MSSQL, + DBSYSTEMVALUES_MYSQL: () => DBSYSTEMVALUES_MYSQL, + DBSYSTEMVALUES_NEO4J: () => DBSYSTEMVALUES_NEO4J, + DBSYSTEMVALUES_NETEZZA: () => DBSYSTEMVALUES_NETEZZA, + DBSYSTEMVALUES_ORACLE: () => DBSYSTEMVALUES_ORACLE, + DBSYSTEMVALUES_OTHER_SQL: () => DBSYSTEMVALUES_OTHER_SQL, + DBSYSTEMVALUES_PERVASIVE: () => DBSYSTEMVALUES_PERVASIVE, + DBSYSTEMVALUES_POINTBASE: () => DBSYSTEMVALUES_POINTBASE, + DBSYSTEMVALUES_POSTGRESQL: () => DBSYSTEMVALUES_POSTGRESQL, + DBSYSTEMVALUES_PROGRESS: () => DBSYSTEMVALUES_PROGRESS, + DBSYSTEMVALUES_REDIS: () => DBSYSTEMVALUES_REDIS, + DBSYSTEMVALUES_REDSHIFT: () => DBSYSTEMVALUES_REDSHIFT, + DBSYSTEMVALUES_SQLITE: () => DBSYSTEMVALUES_SQLITE, + DBSYSTEMVALUES_SYBASE: () => DBSYSTEMVALUES_SYBASE, + DBSYSTEMVALUES_TERADATA: () => DBSYSTEMVALUES_TERADATA, + DBSYSTEMVALUES_VERTICA: () => DBSYSTEMVALUES_VERTICA, + DB_SYSTEM_NAME_VALUE_MARIADB: () => DB_SYSTEM_NAME_VALUE_MARIADB, + DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER: () => DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER, + DB_SYSTEM_NAME_VALUE_MYSQL: () => DB_SYSTEM_NAME_VALUE_MYSQL, + DB_SYSTEM_NAME_VALUE_POSTGRESQL: () => DB_SYSTEM_NAME_VALUE_POSTGRESQL, + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT, + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION, + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING, + DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST: () => DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST, + 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, + DbCassandraConsistencyLevelValues: () => DbCassandraConsistencyLevelValues, + DbSystemValues: () => DbSystemValues, + ERROR_TYPE_VALUE_OTHER: () => ERROR_TYPE_VALUE_OTHER, + EVENT_EXCEPTION: () => EVENT_EXCEPTION, + FAASDOCUMENTOPERATIONVALUES_DELETE: () => FAASDOCUMENTOPERATIONVALUES_DELETE, + FAASDOCUMENTOPERATIONVALUES_EDIT: () => FAASDOCUMENTOPERATIONVALUES_EDIT, + FAASDOCUMENTOPERATIONVALUES_INSERT: () => FAASDOCUMENTOPERATIONVALUES_INSERT, + FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD: () => FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, + FAASINVOKEDPROVIDERVALUES_AWS: () => FAASINVOKEDPROVIDERVALUES_AWS, + FAASINVOKEDPROVIDERVALUES_AZURE: () => FAASINVOKEDPROVIDERVALUES_AZURE, + FAASINVOKEDPROVIDERVALUES_GCP: () => FAASINVOKEDPROVIDERVALUES_GCP, + FAASTRIGGERVALUES_DATASOURCE: () => FAASTRIGGERVALUES_DATASOURCE, + FAASTRIGGERVALUES_HTTP: () => FAASTRIGGERVALUES_HTTP, + FAASTRIGGERVALUES_OTHER: () => FAASTRIGGERVALUES_OTHER, + FAASTRIGGERVALUES_PUBSUB: () => FAASTRIGGERVALUES_PUBSUB, + FAASTRIGGERVALUES_TIMER: () => FAASTRIGGERVALUES_TIMER, + FaasDocumentOperationValues: () => FaasDocumentOperationValues, + FaasInvokedProviderValues: () => FaasInvokedProviderValues, + FaasTriggerValues: () => FaasTriggerValues, + HOSTARCHVALUES_AMD64: () => HOSTARCHVALUES_AMD64, + HOSTARCHVALUES_ARM32: () => HOSTARCHVALUES_ARM32, + HOSTARCHVALUES_ARM64: () => HOSTARCHVALUES_ARM64, + 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, + 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_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_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_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, + JVM_THREAD_STATE_VALUE_WAITING: () => JVM_THREAD_STATE_VALUE_WAITING, + MESSAGETYPEVALUES_RECEIVED: () => MESSAGETYPEVALUES_RECEIVED, + MESSAGETYPEVALUES_SENT: () => MESSAGETYPEVALUES_SENT, + MESSAGINGDESTINATIONKINDVALUES_QUEUE: () => MESSAGINGDESTINATIONKINDVALUES_QUEUE, + MESSAGINGDESTINATIONKINDVALUES_TOPIC: () => MESSAGINGDESTINATIONKINDVALUES_TOPIC, + MESSAGINGOPERATIONVALUES_PROCESS: () => MESSAGINGOPERATIONVALUES_PROCESS, + MESSAGINGOPERATIONVALUES_RECEIVE: () => MESSAGINGOPERATIONVALUES_RECEIVE, + METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS: () => METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS, + METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES: () => METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES, + METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS: () => METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS, + METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS, + METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION, + METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE: () => METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE, + METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS: () => METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS, + METRIC_DB_CLIENT_OPERATION_DURATION: () => METRIC_DB_CLIENT_OPERATION_DURATION, + METRIC_DOTNET_ASSEMBLY_COUNT: () => METRIC_DOTNET_ASSEMBLY_COUNT, + METRIC_DOTNET_EXCEPTIONS: () => METRIC_DOTNET_EXCEPTIONS, + METRIC_DOTNET_GC_COLLECTIONS: () => METRIC_DOTNET_GC_COLLECTIONS, + METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED: () => METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED, + METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE, + METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE, + METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE: () => METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE, + METRIC_DOTNET_GC_PAUSE_TIME: () => METRIC_DOTNET_GC_PAUSE_TIME, + METRIC_DOTNET_JIT_COMPILATION_TIME: () => METRIC_DOTNET_JIT_COMPILATION_TIME, + METRIC_DOTNET_JIT_COMPILED_IL_SIZE: () => METRIC_DOTNET_JIT_COMPILED_IL_SIZE, + METRIC_DOTNET_JIT_COMPILED_METHODS: () => METRIC_DOTNET_JIT_COMPILED_METHODS, + METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS: () => METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS, + METRIC_DOTNET_PROCESS_CPU_COUNT: () => METRIC_DOTNET_PROCESS_CPU_COUNT, + METRIC_DOTNET_PROCESS_CPU_TIME: () => METRIC_DOTNET_PROCESS_CPU_TIME, + METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET: () => METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET, + METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH: () => METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH, + METRIC_DOTNET_THREAD_POOL_THREAD_COUNT: () => METRIC_DOTNET_THREAD_POOL_THREAD_COUNT, + METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT: () => METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT, + METRIC_DOTNET_TIMER_COUNT: () => METRIC_DOTNET_TIMER_COUNT, + METRIC_HTTP_CLIENT_REQUEST_DURATION: () => METRIC_HTTP_CLIENT_REQUEST_DURATION, + METRIC_HTTP_SERVER_REQUEST_DURATION: () => METRIC_HTTP_SERVER_REQUEST_DURATION, + METRIC_JVM_CLASS_COUNT: () => METRIC_JVM_CLASS_COUNT, + METRIC_JVM_CLASS_LOADED: () => METRIC_JVM_CLASS_LOADED, + METRIC_JVM_CLASS_UNLOADED: () => METRIC_JVM_CLASS_UNLOADED, + METRIC_JVM_CPU_COUNT: () => METRIC_JVM_CPU_COUNT, + METRIC_JVM_CPU_RECENT_UTILIZATION: () => METRIC_JVM_CPU_RECENT_UTILIZATION, + METRIC_JVM_CPU_TIME: () => METRIC_JVM_CPU_TIME, + METRIC_JVM_GC_DURATION: () => METRIC_JVM_GC_DURATION, + METRIC_JVM_MEMORY_COMMITTED: () => METRIC_JVM_MEMORY_COMMITTED, + METRIC_JVM_MEMORY_LIMIT: () => METRIC_JVM_MEMORY_LIMIT, + METRIC_JVM_MEMORY_USED: () => METRIC_JVM_MEMORY_USED, + METRIC_JVM_MEMORY_USED_AFTER_LAST_GC: () => METRIC_JVM_MEMORY_USED_AFTER_LAST_GC, + METRIC_JVM_THREAD_COUNT: () => METRIC_JVM_THREAD_COUNT, + METRIC_KESTREL_ACTIVE_CONNECTIONS: () => METRIC_KESTREL_ACTIVE_CONNECTIONS, + METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES: () => METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES, + METRIC_KESTREL_CONNECTION_DURATION: () => METRIC_KESTREL_CONNECTION_DURATION, + METRIC_KESTREL_QUEUED_CONNECTIONS: () => METRIC_KESTREL_QUEUED_CONNECTIONS, + METRIC_KESTREL_QUEUED_REQUESTS: () => METRIC_KESTREL_QUEUED_REQUESTS, + METRIC_KESTREL_REJECTED_CONNECTIONS: () => METRIC_KESTREL_REJECTED_CONNECTIONS, + METRIC_KESTREL_TLS_HANDSHAKE_DURATION: () => METRIC_KESTREL_TLS_HANDSHAKE_DURATION, + METRIC_KESTREL_UPGRADED_CONNECTIONS: () => METRIC_KESTREL_UPGRADED_CONNECTIONS, + METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS: () => METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS, + METRIC_SIGNALR_SERVER_CONNECTION_DURATION: () => METRIC_SIGNALR_SERVER_CONNECTION_DURATION, + MessageTypeValues: () => MessageTypeValues, + MessagingDestinationKindValues: () => MessagingDestinationKindValues, + MessagingOperationValues: () => MessagingOperationValues, + NETHOSTCONNECTIONSUBTYPEVALUES_CDMA: () => NETHOSTCONNECTIONSUBTYPEVALUES_CDMA, + NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT: () => NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT, + NETHOSTCONNECTIONSUBTYPEVALUES_EDGE: () => NETHOSTCONNECTIONSUBTYPEVALUES_EDGE, + NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD: () => NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD, + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0, + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A, + NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B: () => NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B, + NETHOSTCONNECTIONSUBTYPEVALUES_GPRS: () => NETHOSTCONNECTIONSUBTYPEVALUES_GPRS, + NETHOSTCONNECTIONSUBTYPEVALUES_GSM: () => NETHOSTCONNECTIONSUBTYPEVALUES_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_CA: () => NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA, + NETHOSTCONNECTIONSUBTYPEVALUES_NR: () => NETHOSTCONNECTIONSUBTYPEVALUES_NR, + NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA: () => NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA, + NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA: () => NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA, + NETHOSTCONNECTIONSUBTYPEVALUES_UMTS: () => NETHOSTCONNECTIONSUBTYPEVALUES_UMTS, + NETHOSTCONNECTIONTYPEVALUES_CELL: () => NETHOSTCONNECTIONTYPEVALUES_CELL, + NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE: () => NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, + NETHOSTCONNECTIONTYPEVALUES_UNKNOWN: () => NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, + NETHOSTCONNECTIONTYPEVALUES_WIFI: () => NETHOSTCONNECTIONTYPEVALUES_WIFI, + NETHOSTCONNECTIONTYPEVALUES_WIRED: () => NETHOSTCONNECTIONTYPEVALUES_WIRED, + NETTRANSPORTVALUES_INPROC: () => NETTRANSPORTVALUES_INPROC, + NETTRANSPORTVALUES_IP: () => NETTRANSPORTVALUES_IP, + NETTRANSPORTVALUES_IP_TCP: () => NETTRANSPORTVALUES_IP_TCP, + NETTRANSPORTVALUES_IP_UDP: () => NETTRANSPORTVALUES_IP_UDP, + NETTRANSPORTVALUES_OTHER: () => NETTRANSPORTVALUES_OTHER, + NETTRANSPORTVALUES_PIPE: () => NETTRANSPORTVALUES_PIPE, + 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_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_DARWIN: () => OSTYPEVALUES_DARWIN, + OSTYPEVALUES_DRAGONFLYBSD: () => OSTYPEVALUES_DRAGONFLYBSD, + OSTYPEVALUES_FREEBSD: () => OSTYPEVALUES_FREEBSD, + OSTYPEVALUES_HPUX: () => OSTYPEVALUES_HPUX, + OSTYPEVALUES_LINUX: () => OSTYPEVALUES_LINUX, + OSTYPEVALUES_NETBSD: () => OSTYPEVALUES_NETBSD, + OSTYPEVALUES_OPENBSD: () => OSTYPEVALUES_OPENBSD, + OSTYPEVALUES_SOLARIS: () => OSTYPEVALUES_SOLARIS, + 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, + 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: () => RpcGrpcStatusCodeValues, + SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET: () => SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET, + SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: () => SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS, + SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ: () => SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ, + SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY, + SEMATTRS_AWS_DYNAMODB_COUNT: () => SEMATTRS_AWS_DYNAMODB_COUNT, + SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE: () => SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE, + SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: () => SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES, + SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: () => SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES, + SEMATTRS_AWS_DYNAMODB_INDEX_NAME: () => SEMATTRS_AWS_DYNAMODB_INDEX_NAME, + SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS: () => SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS, + SEMATTRS_AWS_DYNAMODB_LIMIT: () => SEMATTRS_AWS_DYNAMODB_LIMIT, + SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: () => SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES, + SEMATTRS_AWS_DYNAMODB_PROJECTION: () => SEMATTRS_AWS_DYNAMODB_PROJECTION, + SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY, + SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: () => SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY, + SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT: () => SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT, + SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD: () => SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD, + SEMATTRS_AWS_DYNAMODB_SEGMENT: () => SEMATTRS_AWS_DYNAMODB_SEGMENT, + SEMATTRS_AWS_DYNAMODB_SELECT: () => SEMATTRS_AWS_DYNAMODB_SELECT, + SEMATTRS_AWS_DYNAMODB_TABLE_COUNT: () => SEMATTRS_AWS_DYNAMODB_TABLE_COUNT, + SEMATTRS_AWS_DYNAMODB_TABLE_NAMES: () => SEMATTRS_AWS_DYNAMODB_TABLE_NAMES, + SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS: () => SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS, + SEMATTRS_AWS_LAMBDA_INVOKED_ARN: () => SEMATTRS_AWS_LAMBDA_INVOKED_ARN, + SEMATTRS_CODE_FILEPATH: () => SEMATTRS_CODE_FILEPATH, + SEMATTRS_CODE_FUNCTION: () => SEMATTRS_CODE_FUNCTION, + SEMATTRS_CODE_LINENO: () => SEMATTRS_CODE_LINENO, + SEMATTRS_CODE_NAMESPACE: () => SEMATTRS_CODE_NAMESPACE, + SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL: () => SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL, + SEMATTRS_DB_CASSANDRA_COORDINATOR_DC: () => SEMATTRS_DB_CASSANDRA_COORDINATOR_DC, + SEMATTRS_DB_CASSANDRA_COORDINATOR_ID: () => SEMATTRS_DB_CASSANDRA_COORDINATOR_ID, + SEMATTRS_DB_CASSANDRA_IDEMPOTENCE: () => SEMATTRS_DB_CASSANDRA_IDEMPOTENCE, + SEMATTRS_DB_CASSANDRA_KEYSPACE: () => SEMATTRS_DB_CASSANDRA_KEYSPACE, + SEMATTRS_DB_CASSANDRA_PAGE_SIZE: () => SEMATTRS_DB_CASSANDRA_PAGE_SIZE, + SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: () => SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT, + SEMATTRS_DB_CASSANDRA_TABLE: () => SEMATTRS_DB_CASSANDRA_TABLE, + SEMATTRS_DB_CONNECTION_STRING: () => SEMATTRS_DB_CONNECTION_STRING, + SEMATTRS_DB_HBASE_NAMESPACE: () => SEMATTRS_DB_HBASE_NAMESPACE, + SEMATTRS_DB_JDBC_DRIVER_CLASSNAME: () => SEMATTRS_DB_JDBC_DRIVER_CLASSNAME, + SEMATTRS_DB_MONGODB_COLLECTION: () => SEMATTRS_DB_MONGODB_COLLECTION, + SEMATTRS_DB_MSSQL_INSTANCE_NAME: () => SEMATTRS_DB_MSSQL_INSTANCE_NAME, + SEMATTRS_DB_NAME: () => SEMATTRS_DB_NAME, + SEMATTRS_DB_OPERATION: () => SEMATTRS_DB_OPERATION, + SEMATTRS_DB_REDIS_DATABASE_INDEX: () => SEMATTRS_DB_REDIS_DATABASE_INDEX, + SEMATTRS_DB_SQL_TABLE: () => SEMATTRS_DB_SQL_TABLE, + SEMATTRS_DB_STATEMENT: () => SEMATTRS_DB_STATEMENT, + SEMATTRS_DB_SYSTEM: () => SEMATTRS_DB_SYSTEM, + SEMATTRS_DB_USER: () => SEMATTRS_DB_USER, + SEMATTRS_ENDUSER_ID: () => SEMATTRS_ENDUSER_ID, + SEMATTRS_ENDUSER_ROLE: () => SEMATTRS_ENDUSER_ROLE, + SEMATTRS_ENDUSER_SCOPE: () => SEMATTRS_ENDUSER_SCOPE, + SEMATTRS_EXCEPTION_ESCAPED: () => SEMATTRS_EXCEPTION_ESCAPED, + SEMATTRS_EXCEPTION_MESSAGE: () => SEMATTRS_EXCEPTION_MESSAGE, + SEMATTRS_EXCEPTION_STACKTRACE: () => SEMATTRS_EXCEPTION_STACKTRACE, + SEMATTRS_EXCEPTION_TYPE: () => SEMATTRS_EXCEPTION_TYPE, + SEMATTRS_FAAS_COLDSTART: () => SEMATTRS_FAAS_COLDSTART, + SEMATTRS_FAAS_CRON: () => SEMATTRS_FAAS_CRON, + SEMATTRS_FAAS_DOCUMENT_COLLECTION: () => SEMATTRS_FAAS_DOCUMENT_COLLECTION, + SEMATTRS_FAAS_DOCUMENT_NAME: () => SEMATTRS_FAAS_DOCUMENT_NAME, + SEMATTRS_FAAS_DOCUMENT_OPERATION: () => SEMATTRS_FAAS_DOCUMENT_OPERATION, + SEMATTRS_FAAS_DOCUMENT_TIME: () => SEMATTRS_FAAS_DOCUMENT_TIME, + SEMATTRS_FAAS_EXECUTION: () => SEMATTRS_FAAS_EXECUTION, + SEMATTRS_FAAS_INVOKED_NAME: () => SEMATTRS_FAAS_INVOKED_NAME, + SEMATTRS_FAAS_INVOKED_PROVIDER: () => SEMATTRS_FAAS_INVOKED_PROVIDER, + SEMATTRS_FAAS_INVOKED_REGION: () => SEMATTRS_FAAS_INVOKED_REGION, + SEMATTRS_FAAS_TIME: () => SEMATTRS_FAAS_TIME, + SEMATTRS_FAAS_TRIGGER: () => SEMATTRS_FAAS_TRIGGER, + SEMATTRS_HTTP_CLIENT_IP: () => SEMATTRS_HTTP_CLIENT_IP, + SEMATTRS_HTTP_FLAVOR: () => SEMATTRS_HTTP_FLAVOR, + SEMATTRS_HTTP_HOST: () => SEMATTRS_HTTP_HOST, + SEMATTRS_HTTP_METHOD: () => SEMATTRS_HTTP_METHOD, + SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH: () => SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH, + SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: () => SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED, + SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH: () => SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH, + SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: () => SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, + SEMATTRS_HTTP_ROUTE: () => SEMATTRS_HTTP_ROUTE, + SEMATTRS_HTTP_SCHEME: () => SEMATTRS_HTTP_SCHEME, + SEMATTRS_HTTP_SERVER_NAME: () => SEMATTRS_HTTP_SERVER_NAME, + SEMATTRS_HTTP_STATUS_CODE: () => SEMATTRS_HTTP_STATUS_CODE, + SEMATTRS_HTTP_TARGET: () => SEMATTRS_HTTP_TARGET, + SEMATTRS_HTTP_URL: () => SEMATTRS_HTTP_URL, + SEMATTRS_HTTP_USER_AGENT: () => SEMATTRS_HTTP_USER_AGENT, + SEMATTRS_MESSAGE_COMPRESSED_SIZE: () => SEMATTRS_MESSAGE_COMPRESSED_SIZE, + SEMATTRS_MESSAGE_ID: () => SEMATTRS_MESSAGE_ID, + SEMATTRS_MESSAGE_TYPE: () => SEMATTRS_MESSAGE_TYPE, + SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE: () => SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE, + SEMATTRS_MESSAGING_CONSUMER_ID: () => SEMATTRS_MESSAGING_CONSUMER_ID, + SEMATTRS_MESSAGING_CONVERSATION_ID: () => SEMATTRS_MESSAGING_CONVERSATION_ID, + SEMATTRS_MESSAGING_DESTINATION: () => SEMATTRS_MESSAGING_DESTINATION, + SEMATTRS_MESSAGING_DESTINATION_KIND: () => SEMATTRS_MESSAGING_DESTINATION_KIND, + SEMATTRS_MESSAGING_KAFKA_CLIENT_ID: () => SEMATTRS_MESSAGING_KAFKA_CLIENT_ID, + SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP: () => SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP, + SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY: () => SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY, + SEMATTRS_MESSAGING_KAFKA_PARTITION: () => SEMATTRS_MESSAGING_KAFKA_PARTITION, + SEMATTRS_MESSAGING_KAFKA_TOMBSTONE: () => SEMATTRS_MESSAGING_KAFKA_TOMBSTONE, + SEMATTRS_MESSAGING_MESSAGE_ID: () => SEMATTRS_MESSAGING_MESSAGE_ID, + SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: () => SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, + SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: () => SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, + SEMATTRS_MESSAGING_OPERATION: () => SEMATTRS_MESSAGING_OPERATION, + SEMATTRS_MESSAGING_PROTOCOL: () => SEMATTRS_MESSAGING_PROTOCOL, + SEMATTRS_MESSAGING_PROTOCOL_VERSION: () => SEMATTRS_MESSAGING_PROTOCOL_VERSION, + SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY: () => SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY, + SEMATTRS_MESSAGING_SYSTEM: () => SEMATTRS_MESSAGING_SYSTEM, + SEMATTRS_MESSAGING_TEMP_DESTINATION: () => SEMATTRS_MESSAGING_TEMP_DESTINATION, + SEMATTRS_MESSAGING_URL: () => SEMATTRS_MESSAGING_URL, + SEMATTRS_NET_HOST_CARRIER_ICC: () => SEMATTRS_NET_HOST_CARRIER_ICC, + SEMATTRS_NET_HOST_CARRIER_MCC: () => SEMATTRS_NET_HOST_CARRIER_MCC, + SEMATTRS_NET_HOST_CARRIER_MNC: () => SEMATTRS_NET_HOST_CARRIER_MNC, + SEMATTRS_NET_HOST_CARRIER_NAME: () => SEMATTRS_NET_HOST_CARRIER_NAME, + SEMATTRS_NET_HOST_CONNECTION_SUBTYPE: () => SEMATTRS_NET_HOST_CONNECTION_SUBTYPE, + SEMATTRS_NET_HOST_CONNECTION_TYPE: () => SEMATTRS_NET_HOST_CONNECTION_TYPE, + SEMATTRS_NET_HOST_IP: () => SEMATTRS_NET_HOST_IP, + SEMATTRS_NET_HOST_NAME: () => SEMATTRS_NET_HOST_NAME, + SEMATTRS_NET_HOST_PORT: () => SEMATTRS_NET_HOST_PORT, + SEMATTRS_NET_PEER_IP: () => SEMATTRS_NET_PEER_IP, + SEMATTRS_NET_PEER_NAME: () => SEMATTRS_NET_PEER_NAME, + SEMATTRS_NET_PEER_PORT: () => SEMATTRS_NET_PEER_PORT, + SEMATTRS_NET_TRANSPORT: () => SEMATTRS_NET_TRANSPORT, + SEMATTRS_PEER_SERVICE: () => SEMATTRS_PEER_SERVICE, + SEMATTRS_RPC_GRPC_STATUS_CODE: () => SEMATTRS_RPC_GRPC_STATUS_CODE, + SEMATTRS_RPC_JSONRPC_ERROR_CODE: () => SEMATTRS_RPC_JSONRPC_ERROR_CODE, + SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE: () => SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE, + SEMATTRS_RPC_JSONRPC_REQUEST_ID: () => SEMATTRS_RPC_JSONRPC_REQUEST_ID, + SEMATTRS_RPC_JSONRPC_VERSION: () => SEMATTRS_RPC_JSONRPC_VERSION, + SEMATTRS_RPC_METHOD: () => SEMATTRS_RPC_METHOD, + SEMATTRS_RPC_SERVICE: () => SEMATTRS_RPC_SERVICE, + SEMATTRS_RPC_SYSTEM: () => SEMATTRS_RPC_SYSTEM, + SEMATTRS_THREAD_ID: () => SEMATTRS_THREAD_ID, + SEMATTRS_THREAD_NAME: () => SEMATTRS_THREAD_NAME, + SEMRESATTRS_AWS_ECS_CLUSTER_ARN: () => SEMRESATTRS_AWS_ECS_CLUSTER_ARN, + SEMRESATTRS_AWS_ECS_CONTAINER_ARN: () => SEMRESATTRS_AWS_ECS_CONTAINER_ARN, + SEMRESATTRS_AWS_ECS_LAUNCHTYPE: () => SEMRESATTRS_AWS_ECS_LAUNCHTYPE, + SEMRESATTRS_AWS_ECS_TASK_ARN: () => SEMRESATTRS_AWS_ECS_TASK_ARN, + SEMRESATTRS_AWS_ECS_TASK_FAMILY: () => SEMRESATTRS_AWS_ECS_TASK_FAMILY, + SEMRESATTRS_AWS_ECS_TASK_REVISION: () => SEMRESATTRS_AWS_ECS_TASK_REVISION, + SEMRESATTRS_AWS_EKS_CLUSTER_ARN: () => SEMRESATTRS_AWS_EKS_CLUSTER_ARN, + SEMRESATTRS_AWS_LOG_GROUP_ARNS: () => SEMRESATTRS_AWS_LOG_GROUP_ARNS, + SEMRESATTRS_AWS_LOG_GROUP_NAMES: () => SEMRESATTRS_AWS_LOG_GROUP_NAMES, + SEMRESATTRS_AWS_LOG_STREAM_ARNS: () => SEMRESATTRS_AWS_LOG_STREAM_ARNS, + SEMRESATTRS_AWS_LOG_STREAM_NAMES: () => SEMRESATTRS_AWS_LOG_STREAM_NAMES, + SEMRESATTRS_CLOUD_ACCOUNT_ID: () => SEMRESATTRS_CLOUD_ACCOUNT_ID, + SEMRESATTRS_CLOUD_AVAILABILITY_ZONE: () => SEMRESATTRS_CLOUD_AVAILABILITY_ZONE, + SEMRESATTRS_CLOUD_PLATFORM: () => SEMRESATTRS_CLOUD_PLATFORM, + SEMRESATTRS_CLOUD_PROVIDER: () => SEMRESATTRS_CLOUD_PROVIDER, + SEMRESATTRS_CLOUD_REGION: () => SEMRESATTRS_CLOUD_REGION, + SEMRESATTRS_CONTAINER_ID: () => SEMRESATTRS_CONTAINER_ID, + SEMRESATTRS_CONTAINER_IMAGE_NAME: () => SEMRESATTRS_CONTAINER_IMAGE_NAME, + SEMRESATTRS_CONTAINER_IMAGE_TAG: () => SEMRESATTRS_CONTAINER_IMAGE_TAG, + SEMRESATTRS_CONTAINER_NAME: () => SEMRESATTRS_CONTAINER_NAME, + SEMRESATTRS_CONTAINER_RUNTIME: () => SEMRESATTRS_CONTAINER_RUNTIME, + SEMRESATTRS_DEPLOYMENT_ENVIRONMENT: () => SEMRESATTRS_DEPLOYMENT_ENVIRONMENT, + SEMRESATTRS_DEVICE_ID: () => SEMRESATTRS_DEVICE_ID, + SEMRESATTRS_DEVICE_MODEL_IDENTIFIER: () => SEMRESATTRS_DEVICE_MODEL_IDENTIFIER, + SEMRESATTRS_DEVICE_MODEL_NAME: () => SEMRESATTRS_DEVICE_MODEL_NAME, + SEMRESATTRS_FAAS_ID: () => SEMRESATTRS_FAAS_ID, + SEMRESATTRS_FAAS_INSTANCE: () => SEMRESATTRS_FAAS_INSTANCE, + SEMRESATTRS_FAAS_MAX_MEMORY: () => SEMRESATTRS_FAAS_MAX_MEMORY, + SEMRESATTRS_FAAS_NAME: () => SEMRESATTRS_FAAS_NAME, + SEMRESATTRS_FAAS_VERSION: () => SEMRESATTRS_FAAS_VERSION, + SEMRESATTRS_HOST_ARCH: () => SEMRESATTRS_HOST_ARCH, + SEMRESATTRS_HOST_ID: () => SEMRESATTRS_HOST_ID, + SEMRESATTRS_HOST_IMAGE_ID: () => SEMRESATTRS_HOST_IMAGE_ID, + SEMRESATTRS_HOST_IMAGE_NAME: () => SEMRESATTRS_HOST_IMAGE_NAME, + SEMRESATTRS_HOST_IMAGE_VERSION: () => SEMRESATTRS_HOST_IMAGE_VERSION, + SEMRESATTRS_HOST_NAME: () => SEMRESATTRS_HOST_NAME, + SEMRESATTRS_HOST_TYPE: () => SEMRESATTRS_HOST_TYPE, + SEMRESATTRS_K8S_CLUSTER_NAME: () => SEMRESATTRS_K8S_CLUSTER_NAME, + SEMRESATTRS_K8S_CONTAINER_NAME: () => SEMRESATTRS_K8S_CONTAINER_NAME, + SEMRESATTRS_K8S_CRONJOB_NAME: () => SEMRESATTRS_K8S_CRONJOB_NAME, + SEMRESATTRS_K8S_CRONJOB_UID: () => SEMRESATTRS_K8S_CRONJOB_UID, + SEMRESATTRS_K8S_DAEMONSET_NAME: () => SEMRESATTRS_K8S_DAEMONSET_NAME, + SEMRESATTRS_K8S_DAEMONSET_UID: () => SEMRESATTRS_K8S_DAEMONSET_UID, + SEMRESATTRS_K8S_DEPLOYMENT_NAME: () => SEMRESATTRS_K8S_DEPLOYMENT_NAME, + SEMRESATTRS_K8S_DEPLOYMENT_UID: () => SEMRESATTRS_K8S_DEPLOYMENT_UID, + SEMRESATTRS_K8S_JOB_NAME: () => SEMRESATTRS_K8S_JOB_NAME, + SEMRESATTRS_K8S_JOB_UID: () => SEMRESATTRS_K8S_JOB_UID, + SEMRESATTRS_K8S_NAMESPACE_NAME: () => SEMRESATTRS_K8S_NAMESPACE_NAME, + SEMRESATTRS_K8S_NODE_NAME: () => SEMRESATTRS_K8S_NODE_NAME, + SEMRESATTRS_K8S_NODE_UID: () => SEMRESATTRS_K8S_NODE_UID, + SEMRESATTRS_K8S_POD_NAME: () => SEMRESATTRS_K8S_POD_NAME, + SEMRESATTRS_K8S_POD_UID: () => SEMRESATTRS_K8S_POD_UID, + SEMRESATTRS_K8S_REPLICASET_NAME: () => SEMRESATTRS_K8S_REPLICASET_NAME, + SEMRESATTRS_K8S_REPLICASET_UID: () => SEMRESATTRS_K8S_REPLICASET_UID, + SEMRESATTRS_K8S_STATEFULSET_NAME: () => SEMRESATTRS_K8S_STATEFULSET_NAME, + SEMRESATTRS_K8S_STATEFULSET_UID: () => SEMRESATTRS_K8S_STATEFULSET_UID, + SEMRESATTRS_OS_DESCRIPTION: () => SEMRESATTRS_OS_DESCRIPTION, + SEMRESATTRS_OS_NAME: () => SEMRESATTRS_OS_NAME, + SEMRESATTRS_OS_TYPE: () => SEMRESATTRS_OS_TYPE, + SEMRESATTRS_OS_VERSION: () => SEMRESATTRS_OS_VERSION, + SEMRESATTRS_PROCESS_COMMAND: () => SEMRESATTRS_PROCESS_COMMAND, + SEMRESATTRS_PROCESS_COMMAND_ARGS: () => SEMRESATTRS_PROCESS_COMMAND_ARGS, + SEMRESATTRS_PROCESS_COMMAND_LINE: () => SEMRESATTRS_PROCESS_COMMAND_LINE, + SEMRESATTRS_PROCESS_EXECUTABLE_NAME: () => SEMRESATTRS_PROCESS_EXECUTABLE_NAME, + SEMRESATTRS_PROCESS_EXECUTABLE_PATH: () => SEMRESATTRS_PROCESS_EXECUTABLE_PATH, + SEMRESATTRS_PROCESS_OWNER: () => SEMRESATTRS_PROCESS_OWNER, + SEMRESATTRS_PROCESS_PID: () => SEMRESATTRS_PROCESS_PID, + SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION: () => SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION, + SEMRESATTRS_PROCESS_RUNTIME_NAME: () => SEMRESATTRS_PROCESS_RUNTIME_NAME, + SEMRESATTRS_PROCESS_RUNTIME_VERSION: () => SEMRESATTRS_PROCESS_RUNTIME_VERSION, + SEMRESATTRS_SERVICE_INSTANCE_ID: () => SEMRESATTRS_SERVICE_INSTANCE_ID, + SEMRESATTRS_SERVICE_NAME: () => SEMRESATTRS_SERVICE_NAME, + SEMRESATTRS_SERVICE_NAMESPACE: () => SEMRESATTRS_SERVICE_NAMESPACE, + SEMRESATTRS_SERVICE_VERSION: () => SEMRESATTRS_SERVICE_VERSION, + SEMRESATTRS_TELEMETRY_AUTO_VERSION: () => SEMRESATTRS_TELEMETRY_AUTO_VERSION, + SEMRESATTRS_TELEMETRY_SDK_LANGUAGE: () => SEMRESATTRS_TELEMETRY_SDK_LANGUAGE, + SEMRESATTRS_TELEMETRY_SDK_NAME: () => SEMRESATTRS_TELEMETRY_SDK_NAME, + SEMRESATTRS_TELEMETRY_SDK_VERSION: () => SEMRESATTRS_TELEMETRY_SDK_VERSION, + SEMRESATTRS_WEBENGINE_DESCRIPTION: () => SEMRESATTRS_WEBENGINE_DESCRIPTION, + SEMRESATTRS_WEBENGINE_NAME: () => SEMRESATTRS_WEBENGINE_NAME, + SEMRESATTRS_WEBENGINE_VERSION: () => SEMRESATTRS_WEBENGINE_VERSION, + SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN: () => SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN, + SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE: () => SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE, + SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT: () => SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT, + SIGNALR_TRANSPORT_VALUE_LONG_POLLING: () => SIGNALR_TRANSPORT_VALUE_LONG_POLLING, + SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS: () => SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS, + SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS: () => SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS, + SemanticAttributes: () => SemanticAttributes, + SemanticResourceAttributes: () => SemanticResourceAttributes, + TELEMETRYSDKLANGUAGEVALUES_CPP: () => TELEMETRYSDKLANGUAGEVALUES_CPP, + TELEMETRYSDKLANGUAGEVALUES_DOTNET: () => TELEMETRYSDKLANGUAGEVALUES_DOTNET, + TELEMETRYSDKLANGUAGEVALUES_ERLANG: () => TELEMETRYSDKLANGUAGEVALUES_ERLANG, + TELEMETRYSDKLANGUAGEVALUES_GO: () => TELEMETRYSDKLANGUAGEVALUES_GO, + TELEMETRYSDKLANGUAGEVALUES_JAVA: () => TELEMETRYSDKLANGUAGEVALUES_JAVA, + TELEMETRYSDKLANGUAGEVALUES_NODEJS: () => TELEMETRYSDKLANGUAGEVALUES_NODEJS, + TELEMETRYSDKLANGUAGEVALUES_PHP: () => TELEMETRYSDKLANGUAGEVALUES_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_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_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_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, + TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT: () => TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT, + TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS: () => TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, + TelemetrySdkLanguageValues: () => TelemetrySdkLanguageValues +}); +var init_esm$1 = __esmMin((() => { + init_trace(); + init_resource(); + init_stable_attributes(); + init_stable_metrics(); + init_stable_events(); +})); + +//#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$4 = /* @__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"; +})); + +//#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$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SDK_INFO = void 0; + const version_1 = require_version$3(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const semconv_1 = require_semconv$4(); + /** 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 + }; +})); + +//#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$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.unrefTimer = void 0; + function unrefTimer(timer) { + timer.unref(); + } + exports.unrefTimer = unrefTimer; +})); + +//#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$6 = /* @__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$1(); + Object.defineProperty(exports, "getStringFromEnv", { + enumerable: true, + get: function() { + return environment_1.getStringFromEnv; + } + }); + Object.defineProperty(exports, "getBooleanFromEnv", { + enumerable: true, + get: function() { + return environment_1.getBooleanFromEnv; + } + }); + Object.defineProperty(exports, "getNumberFromEnv", { + 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$1(); + 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$1(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return sdk_info_1.SDK_INFO; + } + }); + var timer_util_1 = require_timer_util$1(); + Object.defineProperty(exports, "unrefTimer", { + enumerable: true, + get: function() { + return timer_util_1.unrefTimer; + } + }); +})); + +//#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$6 = /* @__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$6(); + 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; + } + }); +})); + +//#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$1 = /* @__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(); + const NANOSECOND_DIGITS = 9; + const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, 6); + const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + /** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ + 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; + } + exports.getTimeOrigin = getTimeOrigin; + /** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ + function hrTime(performanceNow) { + return addHrTimes(millisToHrTime(getTimeOrigin()), millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now())); + } + exports.hrTime = hrTime; + /** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ + function timeInputToHrTime(time) { + if (isTimeInputHrTime(time)) return time; + else if (typeof time === "number") if (time < getTimeOrigin()) 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; + /** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ + 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]; + } + exports.hrTimeDuration = hrTimeDuration; + /** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ + function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + return (/* @__PURE__ */ new Date(time[0] * 1e3)).toISOString().replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + /** + * Convert hrTime to nanoseconds. + * @param time + */ + function hrTimeToNanoseconds(time) { + return time[0] * SECOND_TO_NANOSECONDS + time[1]; + } + exports.hrTimeToNanoseconds = hrTimeToNanoseconds; + /** + * Convert hrTime to milliseconds. + * @param time + */ + function hrTimeToMilliseconds(time) { + return time[0] * 1e3 + time[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + /** + * Convert hrTime to microseconds. + * @param time + */ + function hrTimeToMicroseconds(time) { + return time[0] * 1e6 + time[1] / 1e3; + } + exports.hrTimeToMicroseconds = hrTimeToMicroseconds; + /** + * check if time is HrTime + * @param value + */ + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + /** + * check if input value is a correct types.TimeInput + * @param value + */ + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + /** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ + 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; + } + return out; + } + 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$1 = /* @__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 = {})); +})); + +//#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$1 = /* @__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 = {}) { + this._propagators = config.propagators ?? []; + this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), []))); + } + /** + * 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}`); + } + } + /** + * 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". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + 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(); + } + }; + exports.CompositePropagator = CompositePropagator; +})); + +//#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$1 = /* @__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 = /,|=/; + /** + * 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 + */ + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + 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 =. + */ + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +})); + +//#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$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TraceState = void 0; + const validators_1 = require_validators$1(); + 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.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$1 = /* @__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(); + 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.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$1 = /* @__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) { + return context$1.setValue(RPC_METADATA_KEY, meta); + } + 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; +})); + +//#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$1 = /* @__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; + /** + * 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 + */ + 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; + /** + * 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`. + */ + 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); + } +})); + +//#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$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.merge = void 0; + const lodash_merge_1 = require_lodash_merge$1(); + 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; + } + /** + * 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 + */ + 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 to check if object has been already reference + * @param obj + * @param key + * @param objects + */ + 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; + } +})); + +//#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$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.callWithTimeout = exports.TimeoutError = void 0; + /** + * 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; +})); + +//#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$1 = /* @__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); + } + exports.urlMatches = urlMatches; + /** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ + 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$1 = /* @__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); + } + }; + exports.Deferred = Deferred; +})); + +//#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$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BindOnceFuture = void 0; + const promise_1 = require_promise$1(); + /** + * 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; +})); + +//#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$1 = /* @__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 + }; + /** + * 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; +})); + +//#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$1 = /* @__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(); + /** + * @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._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$9 = /* @__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$1(); + Object.defineProperty(exports, "W3CBaggagePropagator", { + enumerable: true, + get: function() { + return W3CBaggagePropagator_1.W3CBaggagePropagator; + } + }); + var anchored_clock_1 = require_anchored_clock$1(); + Object.defineProperty(exports, "AnchoredClock", { + enumerable: true, + get: function() { + return anchored_clock_1.AnchoredClock; + } + }); + var attributes_1 = require_attributes$1(); + Object.defineProperty(exports, "isAttributeValue", { + enumerable: true, + get: function() { + return attributes_1.isAttributeValue; + } + }); + Object.defineProperty(exports, "sanitizeAttributes", { + enumerable: true, + get: function() { + return attributes_1.sanitizeAttributes; + } + }); + var global_error_handler_1 = require_global_error_handler$1(); + Object.defineProperty(exports, "globalErrorHandler", { + enumerable: true, + get: function() { + return global_error_handler_1.globalErrorHandler; + } + }); + Object.defineProperty(exports, "setGlobalErrorHandler", { + enumerable: true, + get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } + }); + var logging_error_handler_1 = require_logging_error_handler$1(); + Object.defineProperty(exports, "loggingErrorHandler", { + enumerable: true, + get: function() { + return logging_error_handler_1.loggingErrorHandler; + } + }); + var time_1 = require_time$1(); + Object.defineProperty(exports, "addHrTimes", { + enumerable: true, + get: function() { + return time_1.addHrTimes; + } + }); + Object.defineProperty(exports, "getTimeOrigin", { + enumerable: true, + get: function() { + return time_1.getTimeOrigin; + } + }); + Object.defineProperty(exports, "hrTime", { + enumerable: true, + get: function() { + return time_1.hrTime; + } + }); + Object.defineProperty(exports, "hrTimeDuration", { + enumerable: true, + get: function() { + return time_1.hrTimeDuration; + } + }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToMicroseconds; + } + }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToMilliseconds; + } + }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToNanoseconds; + } + }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { + enumerable: true, + get: function() { + return time_1.hrTimeToTimeStamp; + } + }); + Object.defineProperty(exports, "isTimeInput", { + enumerable: true, + get: function() { + return time_1.isTimeInput; + } + }); + Object.defineProperty(exports, "isTimeInputHrTime", { + enumerable: true, + get: function() { + return time_1.isTimeInputHrTime; + } + }); + Object.defineProperty(exports, "millisToHrTime", { + enumerable: true, + get: function() { + return time_1.millisToHrTime; + } + }); + Object.defineProperty(exports, "timeInputToHrTime", { + enumerable: true, + get: function() { + return time_1.timeInputToHrTime; + } + }); + var ExportResult_1 = require_ExportResult$1(); + Object.defineProperty(exports, "ExportResultCode", { + enumerable: true, + get: function() { + return ExportResult_1.ExportResultCode; + } + }); + var utils_1 = require_utils$7(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { + enumerable: true, + get: function() { + return utils_1.parseKeyPairsIntoRecord; + } + }); + var platform_1 = require_platform$6(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return platform_1.SDK_INFO; + } + }); + 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$1(); + Object.defineProperty(exports, "CompositePropagator", { + enumerable: true, + get: function() { + return composite_1.CompositePropagator; + } + }); + var W3CTraceContextPropagator_1 = require_W3CTraceContextPropagator$1(); + 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$1(); + 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$1(); + 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$1(); + Object.defineProperty(exports, "TraceState", { + enumerable: true, + get: function() { + return TraceState_1.TraceState; + } + }); + var merge_1 = require_merge$1(); + Object.defineProperty(exports, "merge", { + enumerable: true, + get: function() { + return merge_1.merge; + } + }); + var timeout_1 = require_timeout$1(); + Object.defineProperty(exports, "TimeoutError", { + enumerable: true, + get: function() { + return timeout_1.TimeoutError; + } + }); + Object.defineProperty(exports, "callWithTimeout", { + enumerable: true, + get: function() { + return timeout_1.callWithTimeout; + } + }); + var url_1 = require_url$1(); + Object.defineProperty(exports, "isUrlIgnored", { + enumerable: true, + get: function() { + return url_1.isUrlIgnored; + } + }); + Object.defineProperty(exports, "urlMatches", { + enumerable: true, + get: function() { + return url_1.urlMatches; + } + }); + var callback_1 = require_callback$1(); + Object.defineProperty(exports, "BindOnceFuture", { + enumerable: true, + get: function() { + return callback_1.BindOnceFuture; + } + }); + var configuration_1 = require_configuration$1(); + Object.defineProperty(exports, "diagLogLevelFromString", { + enumerable: true, + get: function() { + return configuration_1.diagLogLevelFromString; + } + }); + const exporter_1 = require_exporter$1(); + 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$4, OTLPExportDelegate; +var init_otlp_export_delegate = __esmMin((() => { + import_src$4 = require_src$9(); + init_types$1(); + 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$4.ExportResultCode.FAILED, + error: /* @__PURE__ */ new Error("Concurrent export limit reached") + }); + return; + } + const serializedRequest = this._serializer.serializeRequest(internalRepresentation); + if (serializedRequest == null) { + resultCallback({ + code: import_src$4.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$4.ExportResultCode.SUCCESS }); + return; + } else if (response.status === "failure" && response.error) { + resultCallback({ + code: import_src$4.ExportResultCode.FAILED, + error: response.error + }); + return; + } else if (response.status === "retryable") resultCallback({ + code: import_src$4.ExportResultCode.FAILED, + error: new OTLPExporterError("Export failed with retryable status") + }); + else resultCallback({ + code: import_src$4.ExportResultCode.FAILED, + error: new OTLPExporterError("Export failed with unknown error") + }); + }, (reason) => resultCallback({ + code: import_src$4.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$1(); + init_shared_configuration(); + init_legacy_node_configuration(); + init_otlp_network_export_delegate(); +})); + +//#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} + */ + /** + * 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 + */ + 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) => { + /** + * A minimal base64 implementation for number arrays. + * @memberof util + * @namespace + */ + var base64 = exports; + /** + * Calculates the byte length of a base64 encoded string. + * @param {string} string Base64 encoded string + * @returns {number} Byte length + */ + base64.length = function length(string) { + var p = string.length; + if (!p) return 0; + var n = 0; + while (--p % 4 > 1 && string.charAt(p) === "=") ++n; + return Math.ceil(string.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(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(string, buffer, offset) { + var start = offset; + var j = 0, t; + for (var i = 0; i < string.length;) { + var c = string.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; + }; + /** + * 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 + */ + base64.test = function test(string) { + return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string); + }; +})); + +//#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; + /** + * Constructs a new event emitter instance. + * @classdesc A minimal event emitter. + * @memberof util + * @constructor + */ + function EventEmitter() { + /** + * Registered listeners. + * @type {Object.} + * @private + */ + this._listeners = Object.create(null); + } + /** + * Event listener as used by {@link util.EventEmitter}. + * @typedef EventEmitterListener + * @type {function} + * @param {...*} args Arguments + * @returns {undefined} + */ + /** + * Registers an event listener. + * @param {string} evt Event name + * @param {EventEmitterListener} fn Listener + * @param {*} [ctx] Listener context + * @returns {this} `this` + */ + EventEmitter.prototype.on = function on(evt, fn, ctx) { + (this._listeners[evt] || (this._listeners[evt] = [])).push({ + fn, + ctx: ctx || this + }); + return this; + }; + /** + * 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` + */ + 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; + }; + /** + * Emits an event by calling its listeners with the specified arguments. + * @param {string} evt Event name + * @param {...*} args Arguments + * @returns {this} `this` + */ + 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; + }; +})); + +//#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; + } + function readUintBE(buf, pos) { + return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@protobufjs+utf8@1.1.1/node_modules/@protobufjs/utf8/index.js +var require_utf8 = /* @__PURE__ */ __commonJSMin(((exports) => { + /** + * A minimal UTF8 implementation for number arrays. + * @memberof util + * @namespace + */ + 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) { + var len = 0, c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ((c & 64512) === 55296 && (string.charCodeAt(i + 1) & 64512) === 56320) { + ++i; + len += 4; + } else len += 3; + } + 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$1 = ""; + for (var i = start; i < end;) { + var t = buffer[i++]; + if (t <= 127) str$1 += String.fromCharCode(t); + else if (t >= 192 && t < 224) { + var c2 = (t & 31) << 6 | buffer[i++] & 63; + str$1 += 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$1 += 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$1 += replacementChar; + else { + t2 -= 65536; + str$1 += String.fromCharCode(55296 + (t2 >> 10)); + str$1 += String.fromCharCode(56320 + (t2 & 1023)); + } + } + } + return str$1; + }; + /** + * 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, buffer, offset) { + var start = offset, c1, c2; + for (var i = 0; i < string.length; ++i) { + c1 = string.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.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; + } + } + return offset - start; + }; +})); + +//#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.4/node_modules/protobufjs/src/util/longbits.js +var require_longbits = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = LongBits; + var util = require_minimal$1(); + /** + * 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 + */ + function LongBits(lo, hi) { + /** + * Low bits. + * @type {number} + */ + this.lo = lo >>> 0; + /** + * High bits. + * @type {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; + } + } + 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); + } + 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; + }; + /** + * Calculates the length of this longbits when encoded as a varint. + * @returns {number} Length + */ + 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; + }; +})); + +//#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; + } + 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; + } + /** + * 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; + } + /** + * @function + * @param {*} value number + * @returns {number} + * @inner + */ + function ctz32(value) { + var c = Math.clz32(value & -value); + return value ? 31 - c : c; + } + /** + * 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 + */ + 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; + } + } + /** + * 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 + */ + 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); + } + /** + * 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 + */ + function fromBits(lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + } + /** + * 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 + */ + function fromString(str$1, unsigned, radix) { + if (str$1.length === 0) throw Error("empty string"); + if (typeof unsigned === "number") { + radix = unsigned; + unsigned = false; + } else unsigned = !!unsigned; + if (str$1 === "NaN" || str$1 === "Infinity" || str$1 === "+Infinity" || str$1 === "-Infinity") return unsigned ? UZERO : ZERO; + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError("radix"); + var p; + if ((p = str$1.indexOf("-")) > 0) throw Error("interior hyphen"); + else if (p === 0) return fromString(str$1.substring(1), unsigned, radix).neg(); + var radixToPower = fromNumber(pow_dbl(radix, 8)); + var result = ZERO; + for (var i = 0; i < str$1.length; i += 8) { + var size = Math.min(8, str$1.length - i), value = parseInt(str$1.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; + } + /** + * 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 + */ + Long.fromString = fromString; + /** + * @function + * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val + * @param {boolean=} unsigned + * @returns {!Long} + * @inner + */ + 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); + } + /** + * 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} + */ + Long.fromValue = fromValue; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_16_DBL = 65536; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_24_DBL = 1 << 24; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + /** + * @type {number} + * @const + * @inner + */ + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + /** + * @type {!Long} + * @const + * @inner + */ + var TWO_PWR_24 = fromInt(TWO_PWR_24_DBL); + /** + * @type {!Long} + * @inner + */ + var ZERO = fromInt(0); + /** + * Signed zero. + * @type {!Long} + */ + Long.ZERO = ZERO; + /** + * @type {!Long} + * @inner + */ + var UZERO = fromInt(0, true); + /** + * Unsigned zero. + * @type {!Long} + */ + Long.UZERO = UZERO; + /** + * @type {!Long} + * @inner + */ + var ONE = fromInt(1); + /** + * Signed one. + * @type {!Long} + */ + Long.ONE = ONE; + /** + * @type {!Long} + * @inner + */ + var UONE = fromInt(1, true); + /** + * Unsigned one. + * @type {!Long} + */ + Long.UONE = UONE; + /** + * @type {!Long} + * @inner + */ + var NEG_ONE = fromInt(-1); + /** + * Signed negative one. + * @type {!Long} + */ + Long.NEG_ONE = NEG_ONE; + /** + * @type {!Long} + * @inner + */ + var MAX_VALUE = fromBits(-1, 2147483647, false); + /** + * Maximum signed value. + * @type {!Long} + */ + Long.MAX_VALUE = MAX_VALUE; + /** + * @type {!Long} + * @inner + */ + 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); + }; + /** + * Negates this Long's value. This is an alias of {@link Long#negate}. + * @function + * @returns {!Long} Negated Long + */ + LongPrototype.neg = LongPrototype.negate; + /** + * Returns the sum of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} addend Addend + * @returns {!Long} Sum + */ + 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); + }; + /** + * Returns the difference of this and the specified Long. + * @this {!Long} + * @param {!Long|number|bigint|string} subtrahend Subtrahend + * @returns {!Long} Difference + */ + LongPrototype.subtract = function subtract(subtrahend) { + if (!isLong(subtrahend)) subtrahend = fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** + * 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 + */ + 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); + }; + /** + * Converts the Long to its big integer representation. + * @this {!Long} + * @returns {bigint} + */ + LongPrototype.toBigInt = function toBigInt() { + var lowBigInt = BigInt(this.low >>> 0); + return BigInt(this.unsigned ? this.high >>> 0 : this.high) << BigInt(32) | lowBigInt; + }; + } + _exports.default = Long; + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/protobufjs@7.6.4/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.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; + }; + /** + * 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 + */ + util.isObject = function isObject(value) { + return value && typeof value === "object"; + }; + /** + * 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` + */ + util.isset = util.isSet = function isSet(obj, prop) { + var value = obj[prop]; + if (value != null && Object.hasOwnProperty.call(obj, prop)) return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0; + return false; + }; + /** + * 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} + */ + 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; + } + })(); + 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); + }; + /** + * 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 + */ + /** + * 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; + } + })(); + /** + * 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; + }; + /** + * 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 + */ + 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)); + }; + /** + * 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]]; + } + 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 + }); + }; + /** + * Converts the first character of a string to lower case. + * @param {string} str String to convert + * @returns {string} Converted string + */ + util.lcFirst = function lcFirst(str$1) { + return str$1.charAt(0).toLowerCase() + str$1.substring(1); + }; + /** + * 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 + } + }); + 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} + */ + /** + * A OneOf getter as returned by {@link util.oneOfGetter}. + * @typedef OneOfGetter + * @type {function} + * @returns {string|undefined} Set field name, if any + */ + /** + * Builds a getter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfGetter} Unbound getter + */ + 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]; + }; + }; + /** + * A OneOf setter as returned by {@link util.oneOfSetter}. + * @typedef OneOfSetter + * @type {function} + * @param {string|undefined} value Field name + * @returns {undefined} + */ + /** + * Builds a setter for a oneof's present field name. + * @param {string[]} fieldNames Field names + * @returns {OneOfSetter} Unbound setter + */ + 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]]; + }; + }; + /** + * Default conversion options used for {@link Message#toJSON} implementations. + * + * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely: + * + * - 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 + * + * @type {IConversionOptions} + * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json + */ + 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; + } + 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); + }; + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/protobufjs@7.6.4/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; + /** + * 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 + */ + 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; + /** + * Value to write. + * @type {*} + */ + 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; + } + 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; + } + 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; + } + return this; + }; + /** + * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. + * @returns {Writer} `this` + */ + 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; + } + 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; + } + return buf; + }; + Writer._configure = function(BufferWriter_) { + BufferWriter = BufferWriter_; + Writer.create = create(); + BufferWriter._configure(); + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/protobufjs@7.6.4/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(); + /** + * Constructs a new buffer writer instance. + * @classdesc Wire format writer using node buffers. + * @extends Writer + * @constructor + */ + function BufferWriter() { + Writer.call(this); + } + BufferWriter._configure = function() { + /** + * Allocates a buffer of the specified size. + * @function + * @param {number} size Buffer size + * @returns {Buffer} Buffer + */ + 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; + }; + /** + * Finishes the write operation. + * @name BufferWriter#finish + * @function + * @returns {Buffer} Finished buffer + */ + BufferWriter._configure(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/protobufjs@7.6.4/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); + } + /** + * 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 + */ + function Reader(buffer) { + /** + * Read buffer. + * @type {Uint8Array} + */ + this.buf = buffer; + /** + * Read buffer position. + * @type {number} + */ + this.pos = 0; + /** + * Read buffer length. + * @type {number} + */ + 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; + } + 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; + } + 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; + } + /* 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); + } + 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); + } + 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); + } + }); + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/protobufjs@7.6.4/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.4/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; + /** + * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}. + * + * 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 + */ + 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; + } + 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; + } + }; + /** + * 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(); + } + return this; + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/protobufjs@7.6.4/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.4/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.4/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 */ + /** + * Reconfigures the library according to the environment. + * @returns {undefined} + */ + function configure() { + protobuf.util._configure(); + protobuf.Writer._configure(protobuf.BufferWriter); + protobuf.Reader._configure(protobuf.BufferReader); + } + configure(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/protobufjs@7.6.4/node_modules/protobufjs/minimal.js +var require_minimal = /* @__PURE__ */ __commonJSMin(((exports, module) => { + module.exports = require_index_minimal(); +})); + +//#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) => { + 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(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(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) { + if (object instanceof $root.opentelemetry.proto.common.v1.AnyValue) return object; + var message = new $root.opentelemetry.proto.common.v1.AnyValue(); + if (object.stringValue != null) message.stringValue = String(object.stringValue); + if (object.boolValue != null) message.boolValue = Boolean(object.boolValue); + if (object.intValue != null) { + if ($util.Long) (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false; + else if (typeof object.intValue === "string") message.intValue = parseInt(object.intValue, 10); + else if (typeof object.intValue === "number") message.intValue = object.intValue; + else if (typeof object.intValue === "object") message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber(); + } + if (object.doubleValue != null) message.doubleValue = Number(object.doubleValue); + if (object.arrayValue != null) { + if (typeof object.arrayValue !== "object") throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected"); + message.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.fromObject(object.arrayValue); + } + if (object.kvlistValue != null) { + if (typeof object.kvlistValue !== "object") throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected"); + message.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.fromObject(object.kvlistValue); + } + if (object.bytesValue != null) { + if (typeof object.bytesValue === "string") $util.base64.decode(object.bytesValue, message.bytesValue = $util.newBuffer($util.base64.length(object.bytesValue)), 0); + else if (object.bytesValue.length >= 0) message.bytesValue = object.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 = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) object.value = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) object.value = "boolValue"; + } + if (message.intValue != null && message.hasOwnProperty("intValue")) { + if (typeof message.intValue === "number") object.intValue = options.longs === String ? String(message.intValue) : message.intValue; + else object.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.value = "intValue"; + } + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) { + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (options.oneofs) object.value = "doubleValue"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object.arrayValue = $root.opentelemetry.proto.common.v1.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) object.value = "arrayValue"; + } + if (message.kvlistValue != null && message.hasOwnProperty("kvlistValue")) { + object.kvlistValue = $root.opentelemetry.proto.common.v1.KeyValueList.toObject(message.kvlistValue, options); + if (options.oneofs) object.value = "kvlistValue"; + } + if (message.bytesValue != null && message.hasOwnProperty("bytesValue")) { + object.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.value = "bytesValue"; + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.common.v1.ArrayValue) return object; + var message = new $root.opentelemetry.proto.common.v1.ArrayValue(); + if (object.values) { + if (!Array.isArray(object.values)) throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected"); + message.values[i] = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object.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 = {}; + if (options.arrays || options.defaults) object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) object.values[j] = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.values[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.common.v1.KeyValueList) return object; + var message = new $root.opentelemetry.proto.common.v1.KeyValueList(); + if (object.values) { + if (!Array.isArray(object.values)) throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected"); + message.values[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.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 = {}; + if (options.arrays || options.defaults) object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) object.values[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.values[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.common.v1.KeyValue) return object; + var message = new $root.opentelemetry.proto.common.v1.KeyValue(); + if (object.key != null) message.key = String(object.key); + if (object.value != null) { + if (typeof object.value !== "object") throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected"); + message.value = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object.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 = {}; + if (options.defaults) { + object.key = ""; + object.value = null; + } + if (message.key != null && message.hasOwnProperty("key")) object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) object.value = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.value, options); + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.common.v1.InstrumentationScope) return object; + var message = new $root.opentelemetry.proto.common.v1.InstrumentationScope(); + if (object.name != null) message.name = String(object.name); + if (object.version != null) message.version = String(object.version); + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.attributes[i]); + } + } + if (object.droppedAttributesCount != null) message.droppedAttributesCount = object.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 = {}; + if (options.arrays || options.defaults) object.attributes = []; + if (options.defaults) { + object.name = ""; + object.version = ""; + object.droppedAttributesCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) object.version = message.version; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object.droppedAttributesCount = message.droppedAttributesCount; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.common.v1.EntityRef) return object; + var message = new $root.opentelemetry.proto.common.v1.EntityRef(); + if (object.schemaUrl != null) message.schemaUrl = String(object.schemaUrl); + if (object.type != null) message.type = String(object.type); + if (object.idKeys) { + if (!Array.isArray(object.idKeys)) throw TypeError(".opentelemetry.proto.common.v1.EntityRef.idKeys: array expected"); + message.idKeys = []; + for (var i = 0; i < object.idKeys.length; ++i) message.idKeys[i] = String(object.idKeys[i]); + } + if (object.descriptionKeys) { + if (!Array.isArray(object.descriptionKeys)) throw TypeError(".opentelemetry.proto.common.v1.EntityRef.descriptionKeys: array expected"); + message.descriptionKeys = []; + for (var i = 0; i < object.descriptionKeys.length; ++i) message.descriptionKeys[i] = String(object.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 = {}; + if (options.arrays || options.defaults) { + object.idKeys = []; + object.descriptionKeys = []; + } + if (options.defaults) { + object.schemaUrl = ""; + object.type = ""; + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object.schemaUrl = message.schemaUrl; + if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; + if (message.idKeys && message.idKeys.length) { + object.idKeys = []; + for (var j = 0; j < message.idKeys.length; ++j) object.idKeys[j] = message.idKeys[j]; + } + if (message.descriptionKeys && message.descriptionKeys.length) { + object.descriptionKeys = []; + for (var j = 0; j < message.descriptionKeys.length; ++j) object.descriptionKeys[j] = message.descriptionKeys[j]; + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.resource.v1.Resource) return object; + var message = new $root.opentelemetry.proto.resource.v1.Resource(); + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.attributes[i]); + } + } + if (object.droppedAttributesCount != null) message.droppedAttributesCount = object.droppedAttributesCount >>> 0; + if (object.entityRefs) { + if (!Array.isArray(object.entityRefs)) throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: array expected"); + message.entityRefs = []; + for (var i = 0; i < object.entityRefs.length; ++i) { + if (typeof object.entityRefs[i] !== "object") throw TypeError(".opentelemetry.proto.resource.v1.Resource.entityRefs: object expected"); + message.entityRefs[i] = $root.opentelemetry.proto.common.v1.EntityRef.fromObject(object.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 = {}; + if (options.arrays || options.defaults) { + object.attributes = []; + object.entityRefs = []; + } + if (options.defaults) object.droppedAttributesCount = 0; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object.droppedAttributesCount = message.droppedAttributesCount; + if (message.entityRefs && message.entityRefs.length) { + object.entityRefs = []; + for (var j = 0; j < message.entityRefs.length; ++j) object.entityRefs[j] = $root.opentelemetry.proto.common.v1.EntityRef.toObject(message.entityRefs[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.trace.v1.TracesData) return object; + var message = new $root.opentelemetry.proto.trace.v1.TracesData(); + if (object.resourceSpans) { + if (!Array.isArray(object.resourceSpans)) throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected"); + message.resourceSpans = []; + for (var i = 0; i < object.resourceSpans.length; ++i) { + if (typeof object.resourceSpans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected"); + message.resourceSpans[i] = $root.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(object.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 = {}; + if (options.arrays || options.defaults) object.resourceSpans = []; + if (message.resourceSpans && message.resourceSpans.length) { + object.resourceSpans = []; + for (var j = 0; j < message.resourceSpans.length; ++j) object.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.trace.v1.ResourceSpans) return object; + var message = new $root.opentelemetry.proto.trace.v1.ResourceSpans(); + if (object.resource != null) { + if (typeof object.resource !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object.resource); + } + if (object.scopeSpans) { + if (!Array.isArray(object.scopeSpans)) throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected"); + message.scopeSpans = []; + for (var i = 0; i < object.scopeSpans.length; ++i) { + if (typeof object.scopeSpans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected"); + message.scopeSpans[i] = $root.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(object.scopeSpans[i]); + } + } + if (object.schemaUrl != null) message.schemaUrl = String(object.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 = {}; + if (options.arrays || options.defaults) object.scopeSpans = []; + if (options.defaults) { + object.resource = null; + object.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) object.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeSpans && message.scopeSpans.length) { + object.scopeSpans = []; + for (var j = 0; j < message.scopeSpans.length; ++j) object.scopeSpans[j] = $root.opentelemetry.proto.trace.v1.ScopeSpans.toObject(message.scopeSpans[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object.schemaUrl = message.schemaUrl; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.trace.v1.ScopeSpans) return object; + var message = new $root.opentelemetry.proto.trace.v1.ScopeSpans(); + if (object.scope != null) { + if (typeof object.scope !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object.scope); + } + if (object.spans) { + if (!Array.isArray(object.spans)) throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected"); + message.spans = []; + for (var i = 0; i < object.spans.length; ++i) { + if (typeof object.spans[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected"); + message.spans[i] = $root.opentelemetry.proto.trace.v1.Span.fromObject(object.spans[i]); + } + } + if (object.schemaUrl != null) message.schemaUrl = String(object.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 = {}; + if (options.arrays || options.defaults) object.spans = []; + if (options.defaults) { + object.scope = null; + object.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) object.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.spans && message.spans.length) { + object.spans = []; + for (var j = 0; j < message.spans.length; ++j) object.spans[j] = $root.opentelemetry.proto.trace.v1.Span.toObject(message.spans[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object.schemaUrl = message.schemaUrl; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.trace.v1.Span) return object; + var message = new $root.opentelemetry.proto.trace.v1.Span(); + if (object.traceId != null) { + if (typeof object.traceId === "string") $util.base64.decode(object.traceId, message.traceId = $util.newBuffer($util.base64.length(object.traceId)), 0); + else if (object.traceId.length >= 0) message.traceId = object.traceId; + } + if (object.spanId != null) { + if (typeof object.spanId === "string") $util.base64.decode(object.spanId, message.spanId = $util.newBuffer($util.base64.length(object.spanId)), 0); + else if (object.spanId.length >= 0) message.spanId = object.spanId; + } + if (object.traceState != null) message.traceState = String(object.traceState); + if (object.parentSpanId != null) { + if (typeof object.parentSpanId === "string") $util.base64.decode(object.parentSpanId, message.parentSpanId = $util.newBuffer($util.base64.length(object.parentSpanId)), 0); + else if (object.parentSpanId.length >= 0) message.parentSpanId = object.parentSpanId; + } + if (object.flags != null) message.flags = object.flags >>> 0; + if (object.name != null) message.name = String(object.name); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.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.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object.startTimeUnixNano)).unsigned = false; + else if (typeof object.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object.startTimeUnixNano, 10); + else if (typeof object.startTimeUnixNano === "number") message.startTimeUnixNano = object.startTimeUnixNano; + else if (typeof object.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object.startTimeUnixNano.low >>> 0, object.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object.endTimeUnixNano != null) { + if ($util.Long) (message.endTimeUnixNano = $util.Long.fromValue(object.endTimeUnixNano)).unsigned = false; + else if (typeof object.endTimeUnixNano === "string") message.endTimeUnixNano = parseInt(object.endTimeUnixNano, 10); + else if (typeof object.endTimeUnixNano === "number") message.endTimeUnixNano = object.endTimeUnixNano; + else if (typeof object.endTimeUnixNano === "object") message.endTimeUnixNano = new $util.LongBits(object.endTimeUnixNano.low >>> 0, object.endTimeUnixNano.high >>> 0).toNumber(); + } + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.attributes[i]); + } + } + if (object.droppedAttributesCount != null) message.droppedAttributesCount = object.droppedAttributesCount >>> 0; + if (object.events) { + if (!Array.isArray(object.events)) throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) { + if (typeof object.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.events[i]); + } + } + if (object.droppedEventsCount != null) message.droppedEventsCount = object.droppedEventsCount >>> 0; + if (object.links) { + if (!Array.isArray(object.links)) throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected"); + message.links = []; + for (var i = 0; i < object.links.length; ++i) { + if (typeof object.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.links[i]); + } + } + if (object.droppedLinksCount != null) message.droppedLinksCount = object.droppedLinksCount >>> 0; + if (object.status != null) { + if (typeof object.status !== "object") throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected"); + message.status = $root.opentelemetry.proto.trace.v1.Status.fromObject(object.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 = {}; + if (options.arrays || options.defaults) { + object.attributes = []; + object.events = []; + object.links = []; + } + if (options.defaults) { + if (options.bytes === String) object.traceId = ""; + else { + object.traceId = []; + if (options.bytes !== Array) object.traceId = $util.newBuffer(object.traceId); + } + if (options.bytes === String) object.spanId = ""; + else { + object.spanId = []; + if (options.bytes !== Array) object.spanId = $util.newBuffer(object.spanId); + } + object.traceState = ""; + if (options.bytes === String) object.parentSpanId = ""; + else { + object.parentSpanId = []; + if (options.bytes !== Array) object.parentSpanId = $util.newBuffer(object.parentSpanId); + } + object.name = ""; + object.kind = options.enums === String ? "SPAN_KIND_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.endTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.endTimeUnixNano = options.longs === String ? "0" : 0; + object.droppedAttributesCount = 0; + object.droppedEventsCount = 0; + object.droppedLinksCount = 0; + object.status = null; + object.flags = 0; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) object.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.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.traceState = message.traceState; + if (message.parentSpanId != null && message.hasOwnProperty("parentSpanId")) object.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.name = message.name; + if (message.kind != null && message.hasOwnProperty("kind")) object.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.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object.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.endTimeUnixNano = options.longs === String ? String(message.endTimeUnixNano) : message.endTimeUnixNano; + else object.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.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object.droppedAttributesCount = message.droppedAttributesCount; + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) object.events[j] = $root.opentelemetry.proto.trace.v1.Span.Event.toObject(message.events[j], options); + } + if (message.droppedEventsCount != null && message.hasOwnProperty("droppedEventsCount")) object.droppedEventsCount = message.droppedEventsCount; + if (message.links && message.links.length) { + object.links = []; + for (var j = 0; j < message.links.length; ++j) object.links[j] = $root.opentelemetry.proto.trace.v1.Span.Link.toObject(message.links[j], options); + } + if (message.droppedLinksCount != null && message.hasOwnProperty("droppedLinksCount")) object.droppedLinksCount = message.droppedLinksCount; + if (message.status != null && message.hasOwnProperty("status")) object.status = $root.opentelemetry.proto.trace.v1.Status.toObject(message.status, options); + if (message.flags != null && message.hasOwnProperty("flags")) object.flags = message.flags; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.trace.v1.Span.Event) return object; + var message = new $root.opentelemetry.proto.trace.v1.Span.Event(); + if (object.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object.timeUnixNano)).unsigned = false; + else if (typeof object.timeUnixNano === "string") message.timeUnixNano = parseInt(object.timeUnixNano, 10); + else if (typeof object.timeUnixNano === "number") message.timeUnixNano = object.timeUnixNano; + else if (typeof object.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object.timeUnixNano.low >>> 0, object.timeUnixNano.high >>> 0).toNumber(); + } + if (object.name != null) message.name = String(object.name); + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.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.attributes[i]); + } + } + if (object.droppedAttributesCount != null) message.droppedAttributesCount = object.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 = {}; + if (options.arrays || options.defaults) object.attributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.timeUnixNano = options.longs === String ? "0" : 0; + object.name = ""; + object.droppedAttributesCount = 0; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object.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.name = message.name; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object.droppedAttributesCount = message.droppedAttributesCount; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.trace.v1.Span.Link) return object; + var message = new $root.opentelemetry.proto.trace.v1.Span.Link(); + if (object.traceId != null) { + if (typeof object.traceId === "string") $util.base64.decode(object.traceId, message.traceId = $util.newBuffer($util.base64.length(object.traceId)), 0); + else if (object.traceId.length >= 0) message.traceId = object.traceId; + } + if (object.spanId != null) { + if (typeof object.spanId === "string") $util.base64.decode(object.spanId, message.spanId = $util.newBuffer($util.base64.length(object.spanId)), 0); + else if (object.spanId.length >= 0) message.spanId = object.spanId; + } + if (object.traceState != null) message.traceState = String(object.traceState); + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.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.attributes[i]); + } + } + if (object.droppedAttributesCount != null) message.droppedAttributesCount = object.droppedAttributesCount >>> 0; + if (object.flags != null) message.flags = object.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 = {}; + if (options.arrays || options.defaults) object.attributes = []; + if (options.defaults) { + if (options.bytes === String) object.traceId = ""; + else { + object.traceId = []; + if (options.bytes !== Array) object.traceId = $util.newBuffer(object.traceId); + } + if (options.bytes === String) object.spanId = ""; + else { + object.spanId = []; + if (options.bytes !== Array) object.spanId = $util.newBuffer(object.spanId); + } + object.traceState = ""; + object.droppedAttributesCount = 0; + object.flags = 0; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) object.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.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.traceState = message.traceState; + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object.droppedAttributesCount = message.droppedAttributesCount; + if (message.flags != null && message.hasOwnProperty("flags")) object.flags = message.flags; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.trace.v1.Status) return object; + var message = new $root.opentelemetry.proto.trace.v1.Status(); + if (object.message != null) message.message = String(object.message); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.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 = {}; + if (options.defaults) { + object.message = ""; + object.code = options.enums === String ? "STATUS_CODE_UNSET" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) object.message = message.message; + if (message.code != null && message.hasOwnProperty("code")) object.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; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest) return object; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest(); + if (object.resourceSpans) { + if (!Array.isArray(object.resourceSpans)) throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected"); + message.resourceSpans = []; + for (var i = 0; i < object.resourceSpans.length; ++i) { + if (typeof object.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.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 = {}; + if (options.arrays || options.defaults) object.resourceSpans = []; + if (message.resourceSpans && message.resourceSpans.length) { + object.resourceSpans = []; + for (var j = 0; j < message.resourceSpans.length; ++j) object.resourceSpans[j] = $root.opentelemetry.proto.trace.v1.ResourceSpans.toObject(message.resourceSpans[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse) return object; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse(); + if (object.partialSuccess != null) { + if (typeof object.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(object.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 = {}; + if (options.defaults) object.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object.partialSuccess = $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(message.partialSuccess, options); + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess) return object; + var message = new $root.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess(); + if (object.rejectedSpans != null) { + if ($util.Long) (message.rejectedSpans = $util.Long.fromValue(object.rejectedSpans)).unsigned = false; + else if (typeof object.rejectedSpans === "string") message.rejectedSpans = parseInt(object.rejectedSpans, 10); + else if (typeof object.rejectedSpans === "number") message.rejectedSpans = object.rejectedSpans; + else if (typeof object.rejectedSpans === "object") message.rejectedSpans = new $util.LongBits(object.rejectedSpans.low >>> 0, object.rejectedSpans.high >>> 0).toNumber(); + } + if (object.errorMessage != null) message.errorMessage = String(object.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 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rejectedSpans = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.rejectedSpans = options.longs === String ? "0" : 0; + object.errorMessage = ""; + } + if (message.rejectedSpans != null && message.hasOwnProperty("rejectedSpans")) if (typeof message.rejectedSpans === "number") object.rejectedSpans = options.longs === String ? String(message.rejectedSpans) : message.rejectedSpans; + else object.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.errorMessage = message.errorMessage; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest) return object; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest(); + if (object.resourceMetrics) { + if (!Array.isArray(object.resourceMetrics)) throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected"); + message.resourceMetrics = []; + for (var i = 0; i < object.resourceMetrics.length; ++i) { + if (typeof object.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.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 = {}; + if (options.arrays || options.defaults) object.resourceMetrics = []; + if (message.resourceMetrics && message.resourceMetrics.length) { + object.resourceMetrics = []; + for (var j = 0; j < message.resourceMetrics.length; ++j) object.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse) return object; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse(); + if (object.partialSuccess != null) { + if (typeof object.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(object.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 = {}; + if (options.defaults) object.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object.partialSuccess = $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(message.partialSuccess, options); + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess) return object; + var message = new $root.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess(); + if (object.rejectedDataPoints != null) { + if ($util.Long) (message.rejectedDataPoints = $util.Long.fromValue(object.rejectedDataPoints)).unsigned = false; + else if (typeof object.rejectedDataPoints === "string") message.rejectedDataPoints = parseInt(object.rejectedDataPoints, 10); + else if (typeof object.rejectedDataPoints === "number") message.rejectedDataPoints = object.rejectedDataPoints; + else if (typeof object.rejectedDataPoints === "object") message.rejectedDataPoints = new $util.LongBits(object.rejectedDataPoints.low >>> 0, object.rejectedDataPoints.high >>> 0).toNumber(); + } + if (object.errorMessage != null) message.errorMessage = String(object.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 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rejectedDataPoints = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.rejectedDataPoints = options.longs === String ? "0" : 0; + object.errorMessage = ""; + } + if (message.rejectedDataPoints != null && message.hasOwnProperty("rejectedDataPoints")) if (typeof message.rejectedDataPoints === "number") object.rejectedDataPoints = options.longs === String ? String(message.rejectedDataPoints) : message.rejectedDataPoints; + else object.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.errorMessage = message.errorMessage; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest) return object; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest(); + if (object.resourceLogs) { + if (!Array.isArray(object.resourceLogs)) throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected"); + message.resourceLogs = []; + for (var i = 0; i < object.resourceLogs.length; ++i) { + if (typeof object.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.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 = {}; + if (options.arrays || options.defaults) object.resourceLogs = []; + if (message.resourceLogs && message.resourceLogs.length) { + object.resourceLogs = []; + for (var j = 0; j < message.resourceLogs.length; ++j) object.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse) return object; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse(); + if (object.partialSuccess != null) { + if (typeof object.partialSuccess !== "object") throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected"); + message.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(object.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 = {}; + if (options.defaults) object.partialSuccess = null; + if (message.partialSuccess != null && message.hasOwnProperty("partialSuccess")) object.partialSuccess = $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(message.partialSuccess, options); + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess) return object; + var message = new $root.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess(); + if (object.rejectedLogRecords != null) { + if ($util.Long) (message.rejectedLogRecords = $util.Long.fromValue(object.rejectedLogRecords)).unsigned = false; + else if (typeof object.rejectedLogRecords === "string") message.rejectedLogRecords = parseInt(object.rejectedLogRecords, 10); + else if (typeof object.rejectedLogRecords === "number") message.rejectedLogRecords = object.rejectedLogRecords; + else if (typeof object.rejectedLogRecords === "object") message.rejectedLogRecords = new $util.LongBits(object.rejectedLogRecords.low >>> 0, object.rejectedLogRecords.high >>> 0).toNumber(); + } + if (object.errorMessage != null) message.errorMessage = String(object.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 = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.rejectedLogRecords = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.rejectedLogRecords = options.longs === String ? "0" : 0; + object.errorMessage = ""; + } + if (message.rejectedLogRecords != null && message.hasOwnProperty("rejectedLogRecords")) if (typeof message.rejectedLogRecords === "number") object.rejectedLogRecords = options.longs === String ? String(message.rejectedLogRecords) : message.rejectedLogRecords; + else object.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.errorMessage = message.errorMessage; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.MetricsData) return object; + var message = new $root.opentelemetry.proto.metrics.v1.MetricsData(); + if (object.resourceMetrics) { + if (!Array.isArray(object.resourceMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected"); + message.resourceMetrics = []; + for (var i = 0; i < object.resourceMetrics.length; ++i) { + if (typeof object.resourceMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected"); + message.resourceMetrics[i] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(object.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 = {}; + if (options.arrays || options.defaults) object.resourceMetrics = []; + if (message.resourceMetrics && message.resourceMetrics.length) { + object.resourceMetrics = []; + for (var j = 0; j < message.resourceMetrics.length; ++j) object.resourceMetrics[j] = $root.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(message.resourceMetrics[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.ResourceMetrics) return object; + var message = new $root.opentelemetry.proto.metrics.v1.ResourceMetrics(); + if (object.resource != null) { + if (typeof object.resource !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object.resource); + } + if (object.scopeMetrics) { + if (!Array.isArray(object.scopeMetrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected"); + message.scopeMetrics = []; + for (var i = 0; i < object.scopeMetrics.length; ++i) { + if (typeof object.scopeMetrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected"); + message.scopeMetrics[i] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(object.scopeMetrics[i]); + } + } + if (object.schemaUrl != null) message.schemaUrl = String(object.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 = {}; + if (options.arrays || options.defaults) object.scopeMetrics = []; + if (options.defaults) { + object.resource = null; + object.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) object.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeMetrics && message.scopeMetrics.length) { + object.scopeMetrics = []; + for (var j = 0; j < message.scopeMetrics.length; ++j) object.scopeMetrics[j] = $root.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(message.scopeMetrics[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object.schemaUrl = message.schemaUrl; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.ScopeMetrics) return object; + var message = new $root.opentelemetry.proto.metrics.v1.ScopeMetrics(); + if (object.scope != null) { + if (typeof object.scope !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object.scope); + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected"); + message.metrics[i] = $root.opentelemetry.proto.metrics.v1.Metric.fromObject(object.metrics[i]); + } + } + if (object.schemaUrl != null) message.schemaUrl = String(object.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 = {}; + if (options.arrays || options.defaults) object.metrics = []; + if (options.defaults) { + object.scope = null; + object.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) object.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) object.metrics[j] = $root.opentelemetry.proto.metrics.v1.Metric.toObject(message.metrics[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object.schemaUrl = message.schemaUrl; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.Metric) return object; + var message = new $root.opentelemetry.proto.metrics.v1.Metric(); + if (object.name != null) message.name = String(object.name); + if (object.description != null) message.description = String(object.description); + if (object.unit != null) message.unit = String(object.unit); + if (object.gauge != null) { + if (typeof object.gauge !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected"); + message.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.fromObject(object.gauge); + } + if (object.sum != null) { + if (typeof object.sum !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected"); + message.sum = $root.opentelemetry.proto.metrics.v1.Sum.fromObject(object.sum); + } + if (object.histogram != null) { + if (typeof object.histogram !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected"); + message.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.fromObject(object.histogram); + } + if (object.exponentialHistogram != null) { + if (typeof object.exponentialHistogram !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected"); + message.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(object.exponentialHistogram); + } + if (object.summary != null) { + if (typeof object.summary !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected"); + message.summary = $root.opentelemetry.proto.metrics.v1.Summary.fromObject(object.summary); + } + if (object.metadata) { + if (!Array.isArray(object.metadata)) throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: array expected"); + message.metadata = []; + for (var i = 0; i < object.metadata.length; ++i) { + if (typeof object.metadata[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Metric.metadata: object expected"); + message.metadata[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.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 = {}; + if (options.arrays || options.defaults) object.metadata = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.unit = ""; + } + if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; + if (message.unit != null && message.hasOwnProperty("unit")) object.unit = message.unit; + if (message.gauge != null && message.hasOwnProperty("gauge")) { + object.gauge = $root.opentelemetry.proto.metrics.v1.Gauge.toObject(message.gauge, options); + if (options.oneofs) object.data = "gauge"; + } + if (message.sum != null && message.hasOwnProperty("sum")) { + object.sum = $root.opentelemetry.proto.metrics.v1.Sum.toObject(message.sum, options); + if (options.oneofs) object.data = "sum"; + } + if (message.histogram != null && message.hasOwnProperty("histogram")) { + object.histogram = $root.opentelemetry.proto.metrics.v1.Histogram.toObject(message.histogram, options); + if (options.oneofs) object.data = "histogram"; + } + if (message.exponentialHistogram != null && message.hasOwnProperty("exponentialHistogram")) { + object.exponentialHistogram = $root.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(message.exponentialHistogram, options); + if (options.oneofs) object.data = "exponentialHistogram"; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + object.summary = $root.opentelemetry.proto.metrics.v1.Summary.toObject(message.summary, options); + if (options.oneofs) object.data = "summary"; + } + if (message.metadata && message.metadata.length) { + object.metadata = []; + for (var j = 0; j < message.metadata.length; ++j) object.metadata[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.metadata[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.Gauge) return object; + var message = new $root.opentelemetry.proto.metrics.v1.Gauge(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object.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 = {}; + if (options.arrays || options.defaults) object.dataPoints = []; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.Sum) return object; + var message = new $root.opentelemetry.proto.metrics.v1.Sum(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(object.dataPoints[i]); + } + } + switch (object.aggregationTemporality) { + default: + if (typeof object.aggregationTemporality === "number") { + message.aggregationTemporality = object.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.isMonotonic != null) message.isMonotonic = Boolean(object.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 = {}; + if (options.arrays || options.defaults) object.dataPoints = []; + if (options.defaults) { + object.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + object.isMonotonic = false; + } + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object.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.isMonotonic = message.isMonotonic; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.Histogram) return object; + var message = new $root.opentelemetry.proto.metrics.v1.Histogram(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(object.dataPoints[i]); + } + } + switch (object.aggregationTemporality) { + default: + if (typeof object.aggregationTemporality === "number") { + message.aggregationTemporality = object.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 = {}; + if (options.arrays || options.defaults) object.dataPoints = []; + if (options.defaults) object.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object.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; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogram) return object; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogram(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(object.dataPoints[i]); + } + } + switch (object.aggregationTemporality) { + default: + if (typeof object.aggregationTemporality === "number") { + message.aggregationTemporality = object.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 = {}; + if (options.arrays || options.defaults) object.dataPoints = []; + if (options.defaults) object.aggregationTemporality = options.enums === String ? "AGGREGATION_TEMPORALITY_UNSPECIFIED" : 0; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(message.dataPoints[j], options); + } + if (message.aggregationTemporality != null && message.hasOwnProperty("aggregationTemporality")) object.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; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.Summary) return object; + var message = new $root.opentelemetry.proto.metrics.v1.Summary(); + if (object.dataPoints) { + if (!Array.isArray(object.dataPoints)) throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected"); + message.dataPoints = []; + for (var i = 0; i < object.dataPoints.length; ++i) { + if (typeof object.dataPoints[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected"); + message.dataPoints[i] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(object.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 = {}; + if (options.arrays || options.defaults) object.dataPoints = []; + if (message.dataPoints && message.dataPoints.length) { + object.dataPoints = []; + for (var j = 0; j < message.dataPoints.length; ++j) object.dataPoints[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(message.dataPoints[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.NumberDataPoint) return object; + var message = new $root.opentelemetry.proto.metrics.v1.NumberDataPoint(); + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.attributes[i]); + } + } + if (object.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object.startTimeUnixNano)).unsigned = false; + else if (typeof object.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object.startTimeUnixNano, 10); + else if (typeof object.startTimeUnixNano === "number") message.startTimeUnixNano = object.startTimeUnixNano; + else if (typeof object.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object.startTimeUnixNano.low >>> 0, object.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object.timeUnixNano)).unsigned = false; + else if (typeof object.timeUnixNano === "string") message.timeUnixNano = parseInt(object.timeUnixNano, 10); + else if (typeof object.timeUnixNano === "number") message.timeUnixNano = object.timeUnixNano; + else if (typeof object.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object.timeUnixNano.low >>> 0, object.timeUnixNano.high >>> 0).toNumber(); + } + if (object.asDouble != null) message.asDouble = Number(object.asDouble); + if (object.asInt != null) { + if ($util.Long) (message.asInt = $util.Long.fromValue(object.asInt)).unsigned = false; + else if (typeof object.asInt === "string") message.asInt = parseInt(object.asInt, 10); + else if (typeof object.asInt === "number") message.asInt = object.asInt; + else if (typeof object.asInt === "object") message.asInt = new $util.LongBits(object.asInt.low >>> 0, object.asInt.high >>> 0).toNumber(); + } + if (object.exemplars) { + if (!Array.isArray(object.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0; i < object.exemplars.length; ++i) { + if (typeof object.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object.exemplars[i]); + } + } + if (object.flags != null) message.flags = object.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 = {}; + if (options.arrays || options.defaults) { + object.exemplars = []; + object.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.timeUnixNano = options.longs === String ? "0" : 0; + object.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object.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.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object.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.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; + if (options.oneofs) object.value = "asDouble"; + } + if (message.exemplars && message.exemplars.length) { + object.exemplars = []; + for (var j = 0; j < message.exemplars.length; ++j) object.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.asInt = options.longs === String ? String(message.asInt) : message.asInt; + else object.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.value = "asInt"; + } + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) object.flags = message.flags; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.HistogramDataPoint) return object; + var message = new $root.opentelemetry.proto.metrics.v1.HistogramDataPoint(); + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.attributes[i]); + } + } + if (object.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object.startTimeUnixNano)).unsigned = false; + else if (typeof object.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object.startTimeUnixNano, 10); + else if (typeof object.startTimeUnixNano === "number") message.startTimeUnixNano = object.startTimeUnixNano; + else if (typeof object.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object.startTimeUnixNano.low >>> 0, object.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object.timeUnixNano)).unsigned = false; + else if (typeof object.timeUnixNano === "string") message.timeUnixNano = parseInt(object.timeUnixNano, 10); + else if (typeof object.timeUnixNano === "number") message.timeUnixNano = object.timeUnixNano; + else if (typeof object.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object.timeUnixNano.low >>> 0, object.timeUnixNano.high >>> 0).toNumber(); + } + if (object.count != null) { + if ($util.Long) (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") message.count = object.count; + else if (typeof object.count === "object") message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + } + if (object.sum != null) message.sum = Number(object.sum); + if (object.bucketCounts) { + if (!Array.isArray(object.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected"); + message.bucketCounts = []; + for (var i = 0; i < object.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object.bucketCounts[i])).unsigned = false; + else if (typeof object.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object.bucketCounts[i], 10); + else if (typeof object.bucketCounts[i] === "number") message.bucketCounts[i] = object.bucketCounts[i]; + else if (typeof object.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object.bucketCounts[i].low >>> 0, object.bucketCounts[i].high >>> 0).toNumber(); + } + if (object.explicitBounds) { + if (!Array.isArray(object.explicitBounds)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected"); + message.explicitBounds = []; + for (var i = 0; i < object.explicitBounds.length; ++i) message.explicitBounds[i] = Number(object.explicitBounds[i]); + } + if (object.exemplars) { + if (!Array.isArray(object.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0; i < object.exemplars.length; ++i) { + if (typeof object.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object.exemplars[i]); + } + } + if (object.flags != null) message.flags = object.flags >>> 0; + if (object.min != null) message.min = Number(object.min); + if (object.max != null) message.max = Number(object.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 = {}; + if (options.arrays || options.defaults) { + object.bucketCounts = []; + object.explicitBounds = []; + object.exemplars = []; + object.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.count = options.longs === String ? "0" : 0; + object.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object.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.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object.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.count = options.longs === String ? String(message.count) : message.count; + else object.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.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (options.oneofs) object._sum = "sum"; + } + if (message.bucketCounts && message.bucketCounts.length) { + object.bucketCounts = []; + for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; + else object.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.explicitBounds = []; + for (var j = 0; j < message.explicitBounds.length; ++j) object.explicitBounds[j] = options.json && !isFinite(message.explicitBounds[j]) ? String(message.explicitBounds[j]) : message.explicitBounds[j]; + } + if (message.exemplars && message.exemplars.length) { + object.exemplars = []; + for (var j = 0; j < message.exemplars.length; ++j) object.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); + } + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) object.flags = message.flags; + if (message.min != null && message.hasOwnProperty("min")) { + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (options.oneofs) object._min = "min"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (options.oneofs) object._max = "max"; + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint) return object; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint(); + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.attributes[i]); + } + } + if (object.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object.startTimeUnixNano)).unsigned = false; + else if (typeof object.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object.startTimeUnixNano, 10); + else if (typeof object.startTimeUnixNano === "number") message.startTimeUnixNano = object.startTimeUnixNano; + else if (typeof object.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object.startTimeUnixNano.low >>> 0, object.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object.timeUnixNano)).unsigned = false; + else if (typeof object.timeUnixNano === "string") message.timeUnixNano = parseInt(object.timeUnixNano, 10); + else if (typeof object.timeUnixNano === "number") message.timeUnixNano = object.timeUnixNano; + else if (typeof object.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object.timeUnixNano.low >>> 0, object.timeUnixNano.high >>> 0).toNumber(); + } + if (object.count != null) { + if ($util.Long) (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") message.count = object.count; + else if (typeof object.count === "object") message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + } + if (object.sum != null) message.sum = Number(object.sum); + if (object.scale != null) message.scale = object.scale | 0; + if (object.zeroCount != null) { + if ($util.Long) (message.zeroCount = $util.Long.fromValue(object.zeroCount)).unsigned = false; + else if (typeof object.zeroCount === "string") message.zeroCount = parseInt(object.zeroCount, 10); + else if (typeof object.zeroCount === "number") message.zeroCount = object.zeroCount; + else if (typeof object.zeroCount === "object") message.zeroCount = new $util.LongBits(object.zeroCount.low >>> 0, object.zeroCount.high >>> 0).toNumber(); + } + if (object.positive != null) { + if (typeof object.positive !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected"); + message.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object.positive); + } + if (object.negative != null) { + if (typeof object.negative !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected"); + message.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(object.negative); + } + if (object.flags != null) message.flags = object.flags >>> 0; + if (object.exemplars) { + if (!Array.isArray(object.exemplars)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected"); + message.exemplars = []; + for (var i = 0; i < object.exemplars.length; ++i) { + if (typeof object.exemplars[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected"); + message.exemplars[i] = $root.opentelemetry.proto.metrics.v1.Exemplar.fromObject(object.exemplars[i]); + } + } + if (object.min != null) message.min = Number(object.min); + if (object.max != null) message.max = Number(object.max); + if (object.zeroThreshold != null) message.zeroThreshold = Number(object.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 = {}; + if (options.arrays || options.defaults) { + object.attributes = []; + object.exemplars = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.count = options.longs === String ? "0" : 0; + object.scale = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.zeroCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.zeroCount = options.longs === String ? "0" : 0; + object.positive = null; + object.negative = null; + object.flags = 0; + object.zeroThreshold = 0; + } + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.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.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object.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.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object.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.count = options.longs === String ? String(message.count) : message.count; + else object.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.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (options.oneofs) object._sum = "sum"; + } + if (message.scale != null && message.hasOwnProperty("scale")) object.scale = message.scale; + if (message.zeroCount != null && message.hasOwnProperty("zeroCount")) if (typeof message.zeroCount === "number") object.zeroCount = options.longs === String ? String(message.zeroCount) : message.zeroCount; + else object.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.positive = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.positive, options); + if (message.negative != null && message.hasOwnProperty("negative")) object.negative = $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(message.negative, options); + if (message.flags != null && message.hasOwnProperty("flags")) object.flags = message.flags; + if (message.exemplars && message.exemplars.length) { + object.exemplars = []; + for (var j = 0; j < message.exemplars.length; ++j) object.exemplars[j] = $root.opentelemetry.proto.metrics.v1.Exemplar.toObject(message.exemplars[j], options); + } + if (message.min != null && message.hasOwnProperty("min")) { + object.min = options.json && !isFinite(message.min) ? String(message.min) : message.min; + if (options.oneofs) object._min = "min"; + } + if (message.max != null && message.hasOwnProperty("max")) { + object.max = options.json && !isFinite(message.max) ? String(message.max) : message.max; + if (options.oneofs) object._max = "max"; + } + if (message.zeroThreshold != null && message.hasOwnProperty("zeroThreshold")) object.zeroThreshold = options.json && !isFinite(message.zeroThreshold) ? String(message.zeroThreshold) : message.zeroThreshold; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets) return object; + var message = new $root.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets(); + if (object.offset != null) message.offset = object.offset | 0; + if (object.bucketCounts) { + if (!Array.isArray(object.bucketCounts)) throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected"); + message.bucketCounts = []; + for (var i = 0; i < object.bucketCounts.length; ++i) if ($util.Long) (message.bucketCounts[i] = $util.Long.fromValue(object.bucketCounts[i])).unsigned = true; + else if (typeof object.bucketCounts[i] === "string") message.bucketCounts[i] = parseInt(object.bucketCounts[i], 10); + else if (typeof object.bucketCounts[i] === "number") message.bucketCounts[i] = object.bucketCounts[i]; + else if (typeof object.bucketCounts[i] === "object") message.bucketCounts[i] = new $util.LongBits(object.bucketCounts[i].low >>> 0, object.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 = {}; + if (options.arrays || options.defaults) object.bucketCounts = []; + if (options.defaults) object.offset = 0; + if (message.offset != null && message.hasOwnProperty("offset")) object.offset = message.offset; + if (message.bucketCounts && message.bucketCounts.length) { + object.bucketCounts = []; + for (var j = 0; j < message.bucketCounts.length; ++j) if (typeof message.bucketCounts[j] === "number") object.bucketCounts[j] = options.longs === String ? String(message.bucketCounts[j]) : message.bucketCounts[j]; + else object.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; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint) return object; + var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint(); + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.attributes[i]); + } + } + if (object.startTimeUnixNano != null) { + if ($util.Long) (message.startTimeUnixNano = $util.Long.fromValue(object.startTimeUnixNano)).unsigned = false; + else if (typeof object.startTimeUnixNano === "string") message.startTimeUnixNano = parseInt(object.startTimeUnixNano, 10); + else if (typeof object.startTimeUnixNano === "number") message.startTimeUnixNano = object.startTimeUnixNano; + else if (typeof object.startTimeUnixNano === "object") message.startTimeUnixNano = new $util.LongBits(object.startTimeUnixNano.low >>> 0, object.startTimeUnixNano.high >>> 0).toNumber(); + } + if (object.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object.timeUnixNano)).unsigned = false; + else if (typeof object.timeUnixNano === "string") message.timeUnixNano = parseInt(object.timeUnixNano, 10); + else if (typeof object.timeUnixNano === "number") message.timeUnixNano = object.timeUnixNano; + else if (typeof object.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object.timeUnixNano.low >>> 0, object.timeUnixNano.high >>> 0).toNumber(); + } + if (object.count != null) { + if ($util.Long) (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") message.count = object.count; + else if (typeof object.count === "object") message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + } + if (object.sum != null) message.sum = Number(object.sum); + if (object.quantileValues) { + if (!Array.isArray(object.quantileValues)) throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected"); + message.quantileValues = []; + for (var i = 0; i < object.quantileValues.length; ++i) { + if (typeof object.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.quantileValues[i]); + } + } + if (object.flags != null) message.flags = object.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 = {}; + if (options.arrays || options.defaults) { + object.quantileValues = []; + object.attributes = []; + } + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.startTimeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.timeUnixNano = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.count = options.longs === String ? "0" : 0; + object.sum = 0; + object.flags = 0; + } + if (message.startTimeUnixNano != null && message.hasOwnProperty("startTimeUnixNano")) if (typeof message.startTimeUnixNano === "number") object.startTimeUnixNano = options.longs === String ? String(message.startTimeUnixNano) : message.startTimeUnixNano; + else object.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.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object.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.count = options.longs === String ? String(message.count) : message.count; + else object.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.sum = options.json && !isFinite(message.sum) ? String(message.sum) : message.sum; + if (message.quantileValues && message.quantileValues.length) { + object.quantileValues = []; + for (var j = 0; j < message.quantileValues.length; ++j) object.quantileValues[j] = $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(message.quantileValues[j], options); + } + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.flags != null && message.hasOwnProperty("flags")) object.flags = message.flags; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile) return object; + var message = new $root.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile(); + if (object.quantile != null) message.quantile = Number(object.quantile); + if (object.value != null) message.value = Number(object.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 = {}; + if (options.defaults) { + object.quantile = 0; + object.value = 0; + } + if (message.quantile != null && message.hasOwnProperty("quantile")) object.quantile = options.json && !isFinite(message.quantile) ? String(message.quantile) : message.quantile; + if (message.value != null && message.hasOwnProperty("value")) object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.metrics.v1.Exemplar) return object; + var message = new $root.opentelemetry.proto.metrics.v1.Exemplar(); + if (object.filteredAttributes) { + if (!Array.isArray(object.filteredAttributes)) throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected"); + message.filteredAttributes = []; + for (var i = 0; i < object.filteredAttributes.length; ++i) { + if (typeof object.filteredAttributes[i] !== "object") throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected"); + message.filteredAttributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.filteredAttributes[i]); + } + } + if (object.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object.timeUnixNano)).unsigned = false; + else if (typeof object.timeUnixNano === "string") message.timeUnixNano = parseInt(object.timeUnixNano, 10); + else if (typeof object.timeUnixNano === "number") message.timeUnixNano = object.timeUnixNano; + else if (typeof object.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object.timeUnixNano.low >>> 0, object.timeUnixNano.high >>> 0).toNumber(); + } + if (object.asDouble != null) message.asDouble = Number(object.asDouble); + if (object.asInt != null) { + if ($util.Long) (message.asInt = $util.Long.fromValue(object.asInt)).unsigned = false; + else if (typeof object.asInt === "string") message.asInt = parseInt(object.asInt, 10); + else if (typeof object.asInt === "number") message.asInt = object.asInt; + else if (typeof object.asInt === "object") message.asInt = new $util.LongBits(object.asInt.low >>> 0, object.asInt.high >>> 0).toNumber(); + } + if (object.spanId != null) { + if (typeof object.spanId === "string") $util.base64.decode(object.spanId, message.spanId = $util.newBuffer($util.base64.length(object.spanId)), 0); + else if (object.spanId.length >= 0) message.spanId = object.spanId; + } + if (object.traceId != null) { + if (typeof object.traceId === "string") $util.base64.decode(object.traceId, message.traceId = $util.newBuffer($util.base64.length(object.traceId)), 0); + else if (object.traceId.length >= 0) message.traceId = object.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 = {}; + if (options.arrays || options.defaults) object.filteredAttributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.timeUnixNano = options.longs === String ? "0" : 0; + if (options.bytes === String) object.spanId = ""; + else { + object.spanId = []; + if (options.bytes !== Array) object.spanId = $util.newBuffer(object.spanId); + } + if (options.bytes === String) object.traceId = ""; + else { + object.traceId = []; + if (options.bytes !== Array) object.traceId = $util.newBuffer(object.traceId); + } + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object.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.asDouble = options.json && !isFinite(message.asDouble) ? String(message.asDouble) : message.asDouble; + if (options.oneofs) object.value = "asDouble"; + } + if (message.spanId != null && message.hasOwnProperty("spanId")) object.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.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.asInt = options.longs === String ? String(message.asInt) : message.asInt; + else object.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.value = "asInt"; + } + if (message.filteredAttributes && message.filteredAttributes.length) { + object.filteredAttributes = []; + for (var j = 0; j < message.filteredAttributes.length; ++j) object.filteredAttributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.filteredAttributes[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.logs.v1.LogsData) return object; + var message = new $root.opentelemetry.proto.logs.v1.LogsData(); + if (object.resourceLogs) { + if (!Array.isArray(object.resourceLogs)) throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected"); + message.resourceLogs = []; + for (var i = 0; i < object.resourceLogs.length; ++i) { + if (typeof object.resourceLogs[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected"); + message.resourceLogs[i] = $root.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(object.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 = {}; + if (options.arrays || options.defaults) object.resourceLogs = []; + if (message.resourceLogs && message.resourceLogs.length) { + object.resourceLogs = []; + for (var j = 0; j < message.resourceLogs.length; ++j) object.resourceLogs[j] = $root.opentelemetry.proto.logs.v1.ResourceLogs.toObject(message.resourceLogs[j], options); + } + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.logs.v1.ResourceLogs) return object; + var message = new $root.opentelemetry.proto.logs.v1.ResourceLogs(); + if (object.resource != null) { + if (typeof object.resource !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected"); + message.resource = $root.opentelemetry.proto.resource.v1.Resource.fromObject(object.resource); + } + if (object.scopeLogs) { + if (!Array.isArray(object.scopeLogs)) throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected"); + message.scopeLogs = []; + for (var i = 0; i < object.scopeLogs.length; ++i) { + if (typeof object.scopeLogs[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected"); + message.scopeLogs[i] = $root.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(object.scopeLogs[i]); + } + } + if (object.schemaUrl != null) message.schemaUrl = String(object.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 = {}; + if (options.arrays || options.defaults) object.scopeLogs = []; + if (options.defaults) { + object.resource = null; + object.schemaUrl = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) object.resource = $root.opentelemetry.proto.resource.v1.Resource.toObject(message.resource, options); + if (message.scopeLogs && message.scopeLogs.length) { + object.scopeLogs = []; + for (var j = 0; j < message.scopeLogs.length; ++j) object.scopeLogs[j] = $root.opentelemetry.proto.logs.v1.ScopeLogs.toObject(message.scopeLogs[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object.schemaUrl = message.schemaUrl; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.logs.v1.ScopeLogs) return object; + var message = new $root.opentelemetry.proto.logs.v1.ScopeLogs(); + if (object.scope != null) { + if (typeof object.scope !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected"); + message.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(object.scope); + } + if (object.logRecords) { + if (!Array.isArray(object.logRecords)) throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected"); + message.logRecords = []; + for (var i = 0; i < object.logRecords.length; ++i) { + if (typeof object.logRecords[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected"); + message.logRecords[i] = $root.opentelemetry.proto.logs.v1.LogRecord.fromObject(object.logRecords[i]); + } + } + if (object.schemaUrl != null) message.schemaUrl = String(object.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 = {}; + if (options.arrays || options.defaults) object.logRecords = []; + if (options.defaults) { + object.scope = null; + object.schemaUrl = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) object.scope = $root.opentelemetry.proto.common.v1.InstrumentationScope.toObject(message.scope, options); + if (message.logRecords && message.logRecords.length) { + object.logRecords = []; + for (var j = 0; j < message.logRecords.length; ++j) object.logRecords[j] = $root.opentelemetry.proto.logs.v1.LogRecord.toObject(message.logRecords[j], options); + } + if (message.schemaUrl != null && message.hasOwnProperty("schemaUrl")) object.schemaUrl = message.schemaUrl; + return object; + }; + /** + * 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(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(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) { + if (object instanceof $root.opentelemetry.proto.logs.v1.LogRecord) return object; + var message = new $root.opentelemetry.proto.logs.v1.LogRecord(); + if (object.timeUnixNano != null) { + if ($util.Long) (message.timeUnixNano = $util.Long.fromValue(object.timeUnixNano)).unsigned = false; + else if (typeof object.timeUnixNano === "string") message.timeUnixNano = parseInt(object.timeUnixNano, 10); + else if (typeof object.timeUnixNano === "number") message.timeUnixNano = object.timeUnixNano; + else if (typeof object.timeUnixNano === "object") message.timeUnixNano = new $util.LongBits(object.timeUnixNano.low >>> 0, object.timeUnixNano.high >>> 0).toNumber(); + } + if (object.observedTimeUnixNano != null) { + if ($util.Long) (message.observedTimeUnixNano = $util.Long.fromValue(object.observedTimeUnixNano)).unsigned = false; + else if (typeof object.observedTimeUnixNano === "string") message.observedTimeUnixNano = parseInt(object.observedTimeUnixNano, 10); + else if (typeof object.observedTimeUnixNano === "number") message.observedTimeUnixNano = object.observedTimeUnixNano; + else if (typeof object.observedTimeUnixNano === "object") message.observedTimeUnixNano = new $util.LongBits(object.observedTimeUnixNano.low >>> 0, object.observedTimeUnixNano.high >>> 0).toNumber(); + } + switch (object.severityNumber) { + default: + if (typeof object.severityNumber === "number") { + message.severityNumber = object.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.severityText != null) message.severityText = String(object.severityText); + if (object.body != null) { + if (typeof object.body !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected"); + message.body = $root.opentelemetry.proto.common.v1.AnyValue.fromObject(object.body); + } + if (object.attributes) { + if (!Array.isArray(object.attributes)) throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected"); + message.attributes = []; + for (var i = 0; i < object.attributes.length; ++i) { + if (typeof object.attributes[i] !== "object") throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected"); + message.attributes[i] = $root.opentelemetry.proto.common.v1.KeyValue.fromObject(object.attributes[i]); + } + } + if (object.droppedAttributesCount != null) message.droppedAttributesCount = object.droppedAttributesCount >>> 0; + if (object.flags != null) message.flags = object.flags >>> 0; + if (object.traceId != null) { + if (typeof object.traceId === "string") $util.base64.decode(object.traceId, message.traceId = $util.newBuffer($util.base64.length(object.traceId)), 0); + else if (object.traceId.length >= 0) message.traceId = object.traceId; + } + if (object.spanId != null) { + if (typeof object.spanId === "string") $util.base64.decode(object.spanId, message.spanId = $util.newBuffer($util.base64.length(object.spanId)), 0); + else if (object.spanId.length >= 0) message.spanId = object.spanId; + } + if (object.eventName != null) message.eventName = String(object.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 = {}; + if (options.arrays || options.defaults) object.attributes = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.timeUnixNano = options.longs === String ? "0" : 0; + object.severityNumber = options.enums === String ? "SEVERITY_NUMBER_UNSPECIFIED" : 0; + object.severityText = ""; + object.body = null; + object.droppedAttributesCount = 0; + object.flags = 0; + if (options.bytes === String) object.traceId = ""; + else { + object.traceId = []; + if (options.bytes !== Array) object.traceId = $util.newBuffer(object.traceId); + } + if (options.bytes === String) object.spanId = ""; + else { + object.spanId = []; + if (options.bytes !== Array) object.spanId = $util.newBuffer(object.spanId); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.observedTimeUnixNano = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else object.observedTimeUnixNano = options.longs === String ? "0" : 0; + object.eventName = ""; + } + if (message.timeUnixNano != null && message.hasOwnProperty("timeUnixNano")) if (typeof message.timeUnixNano === "number") object.timeUnixNano = options.longs === String ? String(message.timeUnixNano) : message.timeUnixNano; + else object.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.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.severityText = message.severityText; + if (message.body != null && message.hasOwnProperty("body")) object.body = $root.opentelemetry.proto.common.v1.AnyValue.toObject(message.body, options); + if (message.attributes && message.attributes.length) { + object.attributes = []; + for (var j = 0; j < message.attributes.length; ++j) object.attributes[j] = $root.opentelemetry.proto.common.v1.KeyValue.toObject(message.attributes[j], options); + } + if (message.droppedAttributesCount != null && message.hasOwnProperty("droppedAttributesCount")) object.droppedAttributesCount = message.droppedAttributesCount; + if (message.flags != null && message.hasOwnProperty("flags")) object.flags = message.flags; + if (message.traceId != null && message.hasOwnProperty("traceId")) object.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.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.observedTimeUnixNano = options.longs === String ? String(message.observedTimeUnixNano) : message.observedTimeUnixNano; + else object.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.eventName = message.eventName; + return object; + }; + /** + * 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$6 = /* @__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$9(); + 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$1) { + if (str$1 === void 0) return void 0; + return (0, hex_to_binary_1.hexToBinary)(str$1); + } + 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$6(); + 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 of logRecords) { + const { resource, instrumentationScope: { name, version = "", schemaUrl = "" } } = record; + let ismMap = resourceMap.get(resource); + if (!ismMap) { + ismMap = /* @__PURE__ */ new Map(); + resourceMap.set(resource, ismMap); + } + const ismKey = `${name}@${version}:${schemaUrl}`; + let records = ismMap.get(ismKey); + if (!records) { + records = []; + ismMap.set(ismKey, 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); + 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$5 = /* @__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$5(); + 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$9(); + 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$5(); + 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$9(); + const MetricReader_1 = require_MetricReader(); + const utils_1 = require_utils$5(); + /** + * {@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$9(); + /** + * 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$9(); + 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$5 = /* @__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$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defaultServiceName = void 0; + var node_1 = require_node$5(); + 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$4 = /* @__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$9(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const platform_1 = require_platform$5(); + const utils_1 = require_utils$4(); + 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 = {}) => { + 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+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$9(); + /** + * 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$1) { + for (let i = 0; i < str$1.length; i++) { + const ch = str$1.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$1) { + return str$1.length > 0 && this._isValid(str$1); + } + }; + 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$3 = /* @__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$3 = /* @__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$3(); + const os_1$3 = __require("os"); + const getMachineId_1 = require_getMachineId$1(); + const utils_1 = require_utils$3(); + /** + * 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$3(); + const os_1$2 = __require("os"); + const utils_1 = require_utils$3(); + /** + * 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$3(); + 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$3(); + 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$4 = /* @__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$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; + var node_1 = require_node$4(); + 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$4(); + 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$8 = /* @__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; + } + }); + 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 platform_1 = require_platform$5(); + Object.defineProperty(exports, "defaultServiceName", { + enumerable: true, + get: function() { + return platform_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/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); + } + findViews(instrument, meter) { + return this._registeredViews.filter((registeredView) => { + return this._matchInstrument(registeredView.instrumentSelector, instrument) && this._matchMeter(registeredView.meterSelector, meter); + }); + } + _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.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/InstrumentDescriptor.js +var require_InstrumentDescriptor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + 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$5(); + 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; +})); + +//#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) => { + 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)); + const core_1 = require_src$9(); + 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; + } + 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$1, (0, core_1.millisToHrTime)(Date.now())); + } + }; + exports.SyncInstrument = SyncInstrument; + /** + * The class implements {@link UpDownCounter} interface. + */ + 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; + /** + * The class implements {@link Counter} interface. + */ + 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; + /** + * The class implements {@link Gauge} interface. + */ + var GaugeInstrument = class extends SyncInstrument { + /** + * Records a measurement. + */ + record(value, attributes, ctx) { + this._record(value, attributes, ctx); + } + }; + exports.GaugeInstrument = GaugeInstrument; + /** + * The class implements {@link Histogram} interface. + */ + 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(); + /** + * This class implements the {@link IMeter} interface. + */ + 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(); + /** + * Internal interface. + * + * Represents a storage from which we can collect metrics. + */ + 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$5(); + 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; +})); + +//#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) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DeltaMetricProcessor = void 0; + const utils_1 = require_utils$5(); + 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; +})); + +//#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) => { + 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, 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()); + } +})); + +//#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) => { + 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); + } + 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); + } + /** + * 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+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) => { + 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.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+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) => { + 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); + } + _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+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) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MultiMetricStorage = void 0; + /** + * Internal interface. + */ + 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); + }); + } + }; + exports.MultiMetricStorage = MultiMetricStorage; +})); + +//#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) => { + 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(); + /** + * The class implements {@link ObservableResult} interface. + */ + 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); + } + }; + 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+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) => { + 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$5(); + /** + * 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 + }); + } + removeCallback(callback, instrument) { + const idx = this._findCallback(callback, instrument); + if (idx < 0) return; + this._callbacks.splice(idx, 1); + } + 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 + }); + } + 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); + } + /** + * @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); + } + _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); + }); + }); + }); + } + _findCallback(callback, instrument) { + return this._callbacks.findIndex((record) => { + return record.callback === callback && record.instrument === instrument; + }); + } + _findBatchCallback(callback, instruments) { + return this._batchCallbacks.findIndex((record) => { + return record.callback === callback && (0, utils_1.setEquals)(record.instruments, instruments); + }); + } + }; + 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) => { + 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.SyncMetricStorage = SyncMetricStorage; +})); + +//#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) => { + 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; + } + process(incoming, context$1) { + let filteredAttributes = incoming; + for (const processor of this._processors) filteredAttributes = processor.process(filteredAttributes, context$1); + return filteredAttributes; + } + }; + var AllowListProcessor = class { + _allowedAttributeNames; + constructor(_allowedAttributeNames) { + this._allowedAttributeNames = _allowedAttributeNames; + } + process(incoming, _context) { + const filteredAttributes = {}; + Object.keys(incoming).filter((attributeName) => this._allowedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); + return filteredAttributes; + } + }; + var DenyListProcessor = class { + _deniedAttributeNames; + constructor(_deniedAttributeNames) { + this._deniedAttributeNames = _deniedAttributeNames; + } + process(incoming, _context) { + const filteredAttributes = {}; + Object.keys(incoming).filter((attributeName) => !this._deniedAttributeNames.includes(attributeName)).forEach((attributeName) => filteredAttributes[attributeName] = incoming[attributeName]); + return filteredAttributes; + } + }; + /** + * @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) => { + 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$5(); + 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); + } + 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.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 + }; + } + _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; + } + }; + exports.MeterSharedState = MeterSharedState; +})); + +//#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) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MeterProviderSharedState = void 0; + const utils_1 = require_utils$5(); + 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; + } + 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; + } + 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+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) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MetricCollector = void 0; + const core_1 = require_src$9(); + /** + * 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+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; + /** + * Wildcard pattern predicate, supports patterns like `*`, `foo*`, `*bar`. + */ + 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$1) { + if (this._matchAll) return true; + return this._regexp.test(str$1); + } + 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$1) { + if (this._matchAll) return true; + if (str$1 === this._pattern) return true; + return false; + } + }; + 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; + } + getNameFilter() { + return this._nameFilter; + } + getUnitFilter() { + return this._unitFilter; + } + }; + exports.InstrumentSelector = InstrumentSelector; +})); + +//#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) => { + 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; + } + }; + 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' + * }) + */ + 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.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$8(); + 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); + } + } + /** + * Get a meter with the configuration of the MeterProvider. + */ + 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; + } + this._shutdown = true; + await Promise.all(this._sharedState.metricCollectors.map((collector) => { + return collector.shutdown(options); + })); + } + /** + * Notifies all registered MetricReaders to flush any buffered data. + * + * Returns a promise which is resolved when all flushes are complete. + */ + 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); + })); + } + }; + exports.MeterProvider = MeterProvider; +})); + +//#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$7 = /* @__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; + } + }); + 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$5(); + Object.defineProperty(exports, "TimeoutError", { + enumerable: true, + get: function() { + return utils_1.TimeoutError; + } + }); +})); + +//#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 = {})); +})); + +//#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) => { + 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$7(); + const internal_types_1 = require_internal_types(); + const utils_1 = require_utils$6(); + 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; + } + 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; + } + 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; + } + } + 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) => { + 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); + } + }; +})); + +//#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; + } + }); +})); + +//#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) => { + 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$6(); + 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.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.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.toOtlpSpanEvent = toOtlpSpanEvent; + function createExportTraceServiceRequest(spans, options) { + return { resourceSpans: spanRecordsToResourceSpans(spans, (0, utils_1.getOtlpEncoder)(options)) }; + } + 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), + 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; + } +})); + +//#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) => { + 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); + } + }; +})); + +//#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) => { + 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.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)); + } + }; +})); + +//#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) => { + 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.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)); + } + }; +})); + +//#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; + } + }); +})); + +//#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) => { + 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 + }); + 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; + } + }); +})); + +//#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$6 = /* @__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; + } + }); + 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+exporter-trace-otlp-proto@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-proto/build/src/version.js +var require_version$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "0.205.0"; +})); + +//#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(); +})); + +//#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 }) + }; +} +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$1(); +})); + +//#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; + } + async send(data, timeoutMillis) { + const { agent, request } = await this._loadUtils(); + return new Promise((resolve) => { + sendWithHttp(request, this._parameters, agent, data, (result) => { + resolve(result); + }, 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+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); + }); + } + 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); + } + return result; + } + shutdown() { + return 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-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$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; + } +} +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$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); +} +/** +* 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$3; +var init_otlp_node_http_env_configuration = __esmMin((() => { + import_src$3 = require_src$9(); + 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) { + if (typeof config.httpAgentOptions === "function") return config.httpAgentOptions; + let legacy = config.httpAgentOptions; + if (config.keepAlive != null) legacy = { + keepAlive: config.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, signalIdentifier, signalResourcePath, requiredHeaders) { + if (config.metadata) diag.warn("Metadata cannot be set when using http"); + return mergeOtlpNodeHttpConfigurationWithDefaults({ + url: config.url, + headers: wrapStaticHeadersInFunction(config.headers), + concurrencyLimit: config.concurrencyLimit, + timeoutMillis: config.timeoutMillis, + compression: config.compression, + agentFactory: convertLegacyAgentOptions(config) + }, 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(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-proto@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-proto/build/src/platform/node/OTLPTraceExporter.js +var require_OTLPTraceExporter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + const otlp_exporter_base_1 = (init_esm(), __toCommonJS(esm_exports)); + const otlp_transformer_1 = require_src$6(); + const version_1 = require_version$2(); + const node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports)); + /** + * Collector Trace Exporter for Node with protobuf + */ + 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", { + "User-Agent": `OTel-OTLP-Exporter-JavaScript/${version_1.VERSION}`, + "Content-Type": "application/x-protobuf" + }), otlp_transformer_1.ProtobufTraceSerializer)); + } + }; + exports.OTLPTraceExporter = OTLPTraceExporter; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-proto@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-proto/build/src/platform/node/index.js +var require_node$3 = /* @__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; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-proto@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-proto/build/src/platform/index.js +var require_platform$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + var node_1 = require_node$3(); + Object.defineProperty(exports, "OTLPTraceExporter", { + enumerable: true, + get: function() { + return node_1.OTLPTraceExporter; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-proto@0.205.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-proto/build/src/index.js +var require_src$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OTLPTraceExporter = void 0; + var platform_1 = require_platform$3(); + Object.defineProperty(exports, "OTLPTraceExporter", { + enumerable: true, + get: function() { + return platform_1.OTLPTraceExporter; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/baggage/utils.js +var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + 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(); + 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) { + if (!entry) return; + const metadataSeparatorIndex = entry.indexOf(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); + const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex); + const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); + if (separatorIndex <= 0) return; + const rawKey = keyPairPart.substring(0, separatorIndex).trim(); + const rawValue = keyPairPart.substring(separatorIndex + 1).trim(); + if (!rawKey || !rawValue) return; + let key; + let value; + try { + key = decodeURIComponent(rawKey); + value = decodeURIComponent(rawValue); + } catch { + return; + } + let metadata; + if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) { + const metadataString = entry.substring(metadataSeparatorIndex + 1); + metadata = (0, api_1.baggageEntryMetadataFromString)(metadataString); + } + return { + key, + value, + metadata + }; + } + 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 + */ + 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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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$2(); + /** + * 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); + if (!headerValue) return context$1; + const 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$1; + return api_1.propagation.setBaggage(context$1, api_1.propagation.createBaggage(baggage)); + } + fields() { + return [constants_1.BAGGAGE_HEADER]; + } + }; + exports.W3CBaggagePropagator = W3CBaggagePropagator; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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; + /** + * 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.AnchoredClock = AnchoredClock; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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)); + function sanitizeAttributes(attributes) { + const out = {}; + if (typeof attributes !== "object" || attributes == null) return out; + for (const key in attributes) { + if (!Object.prototype.hasOwnProperty.call(attributes, key)) continue; + if (!isAttributeKey(key)) { + api_1.diag.warn(`Invalid attribute key: ${key}`); + continue; + } + const val = attributes[key]; + 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 !== ""; + } + exports.isAttributeKey = isAttributeKey; + function isAttributeValue(val) { + if (val == null) return true; + if (Array.isArray(val)) return isHomogeneousAttributeValueArray(val); + return isValidPrimitiveAttributeValueType(typeof val); + } + exports.isAttributeValue = isAttributeValue; + function isHomogeneousAttributeValueArray(arr) { + let type; + for (const element of arr) { + if (element == null) continue; + const elementType = typeof element; + if (elementType === type) continue; + if (!type) { + if (isValidPrimitiveAttributeValueType(elementType)) { + type = elementType; + continue; + } + return false; + } + return false; + } + return true; + } + function isValidPrimitiveAttributeValueType(valType) { + switch (valType) { + case "number": + case "boolean": + case "string": return true; + } + return false; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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)); + /** + * 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)); + } + /** + * 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. + */ + 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; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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().loggingErrorHandler)(); + /** + * Set the global error handler + * @param {ErrorHandler} handler + */ + function setGlobalErrorHandler(handler) { + delegateHandler = handler; + } + exports.setGlobalErrorHandler = setGlobalErrorHandler; + /** + * Return the global error handler + * @param {Exception} ex + */ + function globalErrorHandler(ex) { + try { + delegateHandler(ex); + } catch {} + } + exports.globalErrorHandler = globalErrorHandler; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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 = __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.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; + } + } + 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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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; + /** + * @deprecated Use globalThis directly instead. + */ + exports._globalThis = globalThis; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/version.js +var require_version$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "2.8.0"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/semconv.js +var require_semconv$2 = /* @__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"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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$1(); + const semantic_conventions_1 = (init_esm$1(), __toCommonJS(esm_exports$1)); + const semconv_1 = require_semconv$2(); + /** 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 + }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/node/index.js +var require_node$2 = /* @__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(); + Object.defineProperty(exports, "getStringFromEnv", { + enumerable: true, + get: function() { + return environment_1.getStringFromEnv; + } + }); + Object.defineProperty(exports, "getBooleanFromEnv", { + enumerable: true, + get: function() { + return environment_1.getBooleanFromEnv; + } + }); + Object.defineProperty(exports, "getNumberFromEnv", { + 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 sdk_info_1 = require_sdk_info(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return sdk_info_1.SDK_INFO; + } + }); + /** + * @deprecated Use performance directly. + */ + exports.otperformance = performance; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/platform/index.js +var require_platform$2 = /* @__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$2(); + 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, "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; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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.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$2(); + const NANOSECOND_DIGITS = 9; + const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, 6); + const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); + /** + * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]). + * @param epochMillis + */ + function millisToHrTime(epochMillis) { + const epochSeconds = epochMillis / 1e3; + return [Math.trunc(epochSeconds), Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS)]; + } + exports.millisToHrTime = millisToHrTime; + /** + * @deprecated Use `performance.timeOrigin` directly. + */ + function getTimeOrigin() { + return platform_1.otperformance.timeOrigin; + } + exports.getTimeOrigin = getTimeOrigin; + /** + * Returns an hrtime calculated via performance component. + * @param performanceNow + */ + function hrTime(performanceNow) { + return addHrTimes(millisToHrTime(platform_1.otperformance.timeOrigin), millisToHrTime(typeof performanceNow === "number" ? performanceNow : platform_1.otperformance.now())); + } + exports.hrTime = hrTime; + /** + * + * Converts a TimeInput to an HrTime, defaults to _hrtime(). + * @param time + */ + function timeInputToHrTime(time) { + if (isTimeInputHrTime(time)) return time; + else if (typeof time === "number") if (time < platform_1.otperformance.timeOrigin) 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; + /** + * Returns a duration of two hrTime. + * @param startTime + * @param endTime + */ + 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]; + } + exports.hrTimeDuration = hrTimeDuration; + /** + * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" + * @param time + */ + function hrTimeToTimeStamp(time) { + const precision = NANOSECOND_DIGITS; + const tmp = `${"0".repeat(precision)}${time[1]}Z`; + const nanoString = tmp.substring(tmp.length - precision - 1); + return (/* @__PURE__ */ new Date(time[0] * 1e3)).toISOString().replace("000Z", nanoString); + } + exports.hrTimeToTimeStamp = hrTimeToTimeStamp; + /** + * Convert hrTime to nanoseconds. + * @param time + */ + 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) { + return time[0] * 1e3 + time[1] / 1e6; + } + exports.hrTimeToMilliseconds = hrTimeToMilliseconds; + /** + * Convert hrTime to seconds. + * @param time + */ + function hrTimeToSeconds(time) { + return time[0] + time[1] / SECOND_TO_NANOSECONDS; + } + exports.hrTimeToSeconds = hrTimeToSeconds; + /** + * check if time is HrTime + * @param value + */ + function isTimeInputHrTime(value) { + return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number"; + } + exports.isTimeInputHrTime = isTimeInputHrTime; + /** + * check if input value is a correct types.TimeInput + * @param value + */ + function isTimeInput(value) { + return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date; + } + exports.isTimeInput = isTimeInput; + /** + * Given 2 HrTime formatted times, return their sum as an HrTime. + */ + 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; + } + return out; + } + exports.addHrTimes = addHrTimes; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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; + /** + * @deprecated please copy this code to your implementation instead, this function will be removed in the next major version of this package. + * @param timer + */ + function unrefTimer(timer) { + if (typeof timer !== "number") timer.unref(); + } + exports.unrefTimer = unrefTimer; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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 = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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)); + /** 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 = {}) { + this._propagators = config.propagators ?? []; + const fields = /* @__PURE__ */ new Set(); + for (const propagator of this._propagators) { + const propagatorFields = typeof propagator.fields === "function" ? propagator.fields() : []; + for (const field of propagatorFields) fields.add(field); + } + this._fields = Array.from(fields); + } + /** + * 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}`); + } + } + /** + * 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". + * + * @param context Context to add values to + * @param carrier Carrier from which to extract context + */ + 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(); + } + }; + exports.CompositePropagator = CompositePropagator; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; + const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; + /** + * 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 + */ + function validateKey(key) { + return VALID_KEY_REGEX.test(key); + } + 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 =. + */ + function validateValue(value) { + return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value); + } + exports.validateValue = validateValue; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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(); + 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 { + _length; + _rawTraceState; + _internalState; + constructor(rawTraceState) { + this._rawTraceState = typeof rawTraceState === "string" ? rawTraceState : ""; + this._length = this._rawTraceState.length; + } + set(key, value) { + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) return this; + const currState = this._getState(); + const currValue = currState.get(key); + let newLength = this._length; + if (typeof currValue === "string") newLength += value.length - currValue.length; + else newLength += key.length + value.length + (currState.size > 0 ? 2 : 1); + if (newLength > MAX_TRACE_STATE_LEN) return this; + const newState = new Map(currState); + newState.delete(key); + newState.set(key, value); + return this._fromState(newState, newLength); + } + unset(key) { + const currState = this._getState(); + const currValue = currState.get(key); + if (typeof currValue !== "string") return this; + let newLength = this._length - (key.length + currValue.length + 1); + if (currState.size > 1) newLength = newLength - 1; + const newState = new Map(currState); + newState.delete(key); + return this._fromState(newState, newLength); + } + get(key) { + return this._getState().get(key); + } + serialize() { + let serialized = ""; + let index = 0; + for (const entry of this._getState()) { + if (index > 0) serialized = LIST_MEMBERS_SEPARATOR + serialized; + serialized = `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized; + index++; + } + return serialized; + } + _getState() { + if (this._internalState) return this._internalState; + const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR); + const vendorEntries = /* @__PURE__ */ new Map(); + let currentLength = 0; + for (const member of vendorMembers) { + const m = member.trim(); + const idx = m.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); + if (idx === -1) continue; + const key = m.slice(0, idx); + const value = m.slice(idx + 1); + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) continue; + const futureLength = currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0); + if (futureLength > MAX_TRACE_STATE_LEN) continue; + vendorEntries.set(key, value); + currentLength = futureLength; + if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) break; + } + this._length = currentLength; + this._internalState = new Map(Array.from(vendorEntries.entries()).reverse()); + return this._internalState; + } + _fromState(state, length) { + const traceState = Object.create(TraceState.prototype); + traceState._internalState = state; + traceState._length = length; + return traceState; + } + }; + exports.TraceState = TraceState; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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(); + 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.W3CTraceContextPropagator = W3CTraceContextPropagator; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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"); + (function(RPCType) { + RPCType["HTTP"] = "http"; + })(exports.RPCType || (exports.RPCType = {})); + function setRPCMetadata(context$1, meta) { + return context$1.setValue(RPC_METADATA_KEY, meta); + } + 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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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; + /** + * 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; + /** + * 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 + */ + 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; + /** + * 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`. + */ + 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); + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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(); + 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; + } + /** + * 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 + */ + 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]; + if (key === "__proto__" || key === "constructor" || key === "prototype") continue; + 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); + } + result[key] = mergeTwoObjects(result[key], twoValue, level, objects); + } + } + } + } else result = two; + return result; + } + /** + * Function to check if object has been already reference + * @param obj + * @param key + * @param objects + */ + 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; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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; + /** + * 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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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); + } + exports.urlMatches = urlMatches; + /** + * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} + * @param url + * @param ignoredUrls + */ + 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.8.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); + } + }; + exports.Deferred = Deferred; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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(); + /** + * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. + */ + var BindOnceFuture = class { + _isCalled = false; + _deferred = new promise_1.Deferred(); + _callback; + _that; + 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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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)); + 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 + }; + /** + * 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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.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(); + /** + * @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, resolve); + }); + }); + } + exports._export = _export; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+core@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/src/index.js +var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + 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(); + Object.defineProperty(exports, "AnchoredClock", { + enumerable: true, + get: function() { + return anchored_clock_1.AnchoredClock; + } + }); + var attributes_1 = require_attributes(); + Object.defineProperty(exports, "isAttributeValue", { + enumerable: true, + get: function() { + return attributes_1.isAttributeValue; + } + }); + Object.defineProperty(exports, "sanitizeAttributes", { + enumerable: true, + get: function() { + return attributes_1.sanitizeAttributes; + } + }); + var global_error_handler_1 = require_global_error_handler(); + Object.defineProperty(exports, "globalErrorHandler", { + enumerable: true, + get: function() { + return global_error_handler_1.globalErrorHandler; + } + }); + Object.defineProperty(exports, "setGlobalErrorHandler", { + enumerable: true, + get: function() { + return global_error_handler_1.setGlobalErrorHandler; + } + }); + 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(); + Object.defineProperty(exports, "addHrTimes", { + enumerable: true, + get: function() { + return time_1.addHrTimes; + } + }); + Object.defineProperty(exports, "getTimeOrigin", { + enumerable: true, + get: function() { + return time_1.getTimeOrigin; + } + }); + Object.defineProperty(exports, "hrTime", { + enumerable: true, + get: function() { + return time_1.hrTime; + } + }); + Object.defineProperty(exports, "hrTimeDuration", { + enumerable: true, + get: function() { + return time_1.hrTimeDuration; + } + }); + Object.defineProperty(exports, "hrTimeToMicroseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToMicroseconds; + } + }); + Object.defineProperty(exports, "hrTimeToMilliseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToMilliseconds; + } + }); + Object.defineProperty(exports, "hrTimeToNanoseconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToNanoseconds; + } + }); + Object.defineProperty(exports, "hrTimeToSeconds", { + enumerable: true, + get: function() { + return time_1.hrTimeToSeconds; + } + }); + Object.defineProperty(exports, "hrTimeToTimeStamp", { + enumerable: true, + get: function() { + return time_1.hrTimeToTimeStamp; + } + }); + Object.defineProperty(exports, "isTimeInput", { + enumerable: true, + get: function() { + return time_1.isTimeInput; + } + }); + Object.defineProperty(exports, "isTimeInputHrTime", { + enumerable: true, + get: function() { + return time_1.isTimeInputHrTime; + } + }); + Object.defineProperty(exports, "millisToHrTime", { + enumerable: true, + get: function() { + return time_1.millisToHrTime; + } + }); + Object.defineProperty(exports, "timeInputToHrTime", { + enumerable: true, + get: function() { + return time_1.timeInputToHrTime; + } + }); + 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(); + Object.defineProperty(exports, "ExportResultCode", { + enumerable: true, + get: function() { + return ExportResult_1.ExportResultCode; + } + }); + var utils_1 = require_utils$2(); + Object.defineProperty(exports, "parseKeyPairsIntoRecord", { + enumerable: true, + get: function() { + return utils_1.parseKeyPairsIntoRecord; + } + }); + var platform_1 = require_platform$2(); + Object.defineProperty(exports, "SDK_INFO", { + enumerable: true, + get: function() { + return platform_1.SDK_INFO; + } + }); + 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; + } + }); + 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; + } + }); + var merge_1 = require_merge(); + Object.defineProperty(exports, "merge", { + enumerable: true, + get: function() { + return merge_1.merge; + } + }); + var timeout_1 = require_timeout(); + Object.defineProperty(exports, "TimeoutError", { + enumerable: true, + get: function() { + return timeout_1.TimeoutError; + } + }); + Object.defineProperty(exports, "callWithTimeout", { + enumerable: true, + get: function() { + return timeout_1.callWithTimeout; + } + }); + var url_1 = require_url(); + Object.defineProperty(exports, "isUrlIgnored", { + enumerable: true, + get: function() { + return url_1.isUrlIgnored; + } + }); + Object.defineProperty(exports, "urlMatches", { + enumerable: true, + get: function() { + return url_1.urlMatches; + } + }); + var callback_1 = require_callback(); + Object.defineProperty(exports, "BindOnceFuture", { + enumerable: true, + get: function() { + return callback_1.BindOnceFuture; + } + }); + var configuration_1 = require_configuration(); + Object.defineProperty(exports, "diagLogLevelFromString", { + enumerable: true, + get: function() { + return configuration_1.diagLogLevelFromString; + } + }); + const exporter_1 = require_exporter(); + exports.internal = { _export: exporter_1._export }; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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; + /** + * Returns the default service name for OpenTelemetry resources. + * In Node.js environments, returns "unknown_service:". + * In browser/edge environments, returns "unknown_service". + */ + 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; + } + exports._clearDefaultServiceNameCache = _clearDefaultServiceNameCache; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.0_@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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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 }); + 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$4(); + 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; + } + 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, 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+resources@2.8.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.detectResources = void 0; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + 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+resources@2.8.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.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$4(); + /** + * 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 (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; + } + return attributes; + } + }; + exports.envDetector = new EnvDetector(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/semconv.js +var require_semconv$1 = /* @__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.8.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.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+resources@2.8.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.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.getMachineId = getMachineId; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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.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}`); + } + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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}`); + } + 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.8.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.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.getMachineId = getMachineId; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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.getMachineId = getMachineId; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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.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(); + } + exports.getMachineId = getMachineId; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.0_@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; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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.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)() + } }; + } + }; + exports.hostDetector = new HostDetector(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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.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(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.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$1(); + const os = __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.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.8.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.serviceInstanceIdDetector = void 0; + const semconv_1 = require_semconv$1(); + const crypto_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.randomUUID)() } }; + } + }; + /** + * @experimental + */ + exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/src/detectors/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", { + enumerable: true, + get: function() { + return HostDetector_1.hostDetector; + } + }); + var OSDetector_1 = require_OSDetector(); + Object.defineProperty(exports, "osDetector", { + enumerable: true, + get: function() { + return OSDetector_1.osDetector; + } + }); + var ProcessDetector_1 = require_ProcessDetector(); + Object.defineProperty(exports, "processDetector", { + enumerable: true, + get: function() { + return ProcessDetector_1.processDetector; + } + }); + var ServiceInstanceIdDetector_1 = require_ServiceInstanceIdDetector(); + Object.defineProperty(exports, "serviceInstanceIdDetector", { + enumerable: true, + get: function() { + return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.0_@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; + } + }); + 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.8.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.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.8.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.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; + } + }); + var platform_1 = require_platform$1(); + 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(); + Object.defineProperty(exports, "noopDetector", { + enumerable: true, + get: function() { + return NoopDetector_1.noopDetector; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+resources@2.8.0_@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; + } + }); + var detectors_1 = require_detectors(); + 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(); + Object.defineProperty(exports, "resourceFromAttributes", { + enumerable: true, + get: function() { + return ResourceImpl_1.resourceFromAttributes; + } + }); + 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-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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$4(); + 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); + } + 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; + } + /** + * + * @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; + } + 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) { + 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}`); + } + get duration() { + return this._duration; + } + get ended() { + return this._ended; + } + get droppedAttributesCount() { + return this._droppedAttributesCount; + } + get droppedEventsCount() { + return this._droppedEventsCount; + } + get droppedLinksCount() { + return this._droppedLinksCount; + } + _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; + } + _truncateToLimitUtil(value, limit) { + if (value.length <= limit) return value; + return value.substring(0, limit); + } + /** + * 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; + } + [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.8.0_@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 = {})); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOffSampler.js +var require_AlwaysOffSampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AlwaysOffSampler = void 0; + const Sampler_1 = require_Sampler(); + /** Sampler that samples no traces. */ + var AlwaysOffSampler = class { + shouldSample() { + return { decision: Sampler_1.SamplingDecision.NOT_RECORD }; + } + toString() { + return "AlwaysOffSampler"; + } + }; + exports.AlwaysOffSampler = AlwaysOffSampler; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/sampler/AlwaysOnSampler.js +var require_AlwaysOnSampler = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AlwaysOnSampler = void 0; + const Sampler_1 = require_Sampler(); + /** Sampler that samples all traces. */ + var AlwaysOnSampler = class { + shouldSample() { + return { decision: Sampler_1.SamplingDecision.RECORD_AND_SAMPLED }; + } + toString() { + return "AlwaysOnSampler"; + } + }; + exports.AlwaysOnSampler = AlwaysOnSampler; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@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$4(); + 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) { + 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$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.8.0_@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.8.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$4(); + 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; + } +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.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.mergeConfig = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = void 0; + const config_1 = require_config(); + const core_1 = require_src$4(); + 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; + /** + * 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.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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$4(); + /** + * Implementation of the {@link SpanProcessor} that batches spans exported by + * the SDK then pushes them to the exporter pipeline. + */ + var BatchSpanProcessorBase = class { + _maxExportBatchSize; + _maxQueueSize; + _scheduledDelayMillis; + _exportTimeoutMillis; + _exporter; + _isExporting = false; + _finishedSpans = []; + _timer; + _shutdownOnce; + _droppedSpansCount = 0; + constructor(exporter, config) { + this._exporter = exporter; + this._maxExportBatchSize = typeof config?.maxExportBatchSize === "number" ? config.maxExportBatchSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE") ?? 512; + this._maxQueueSize = typeof config?.maxQueueSize === "number" ? config.maxQueueSize : (0, core_1.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE") ?? 2048; + this._scheduledDelayMillis = typeof config?.scheduledDelayMillis === "number" ? config.scheduledDelayMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY") ?? 5e3; + this._exportTimeoutMillis = typeof config?.exportTimeoutMillis === "number" ? config.exportTimeoutMillis : (0, core_1.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT") ?? 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; + } + } + forceFlush() { + if (this._shutdownOnce.isCalled) return this._shutdownOnce.promise; + return this._flushAll(); + } + onStart(_span, _parentContext) {} + onEnd(span) { + if (this._shutdownOnce.isCalled) return; + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) return; + this._addToBuffer(span); + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return Promise.resolve().then(() => { + return this.onShutdown(); + }).then(() => { + return this._flushAll(); + }).then(() => { + return this._exporter.shutdown(); + }); + } + /** Add a span in the buffer. */ + _addToBuffer(span) { + if (this._finishedSpans.length >= this._maxQueueSize) { + if (this._droppedSpansCount === 0) api_1.diag.debug("maxQueueSize reached, dropping spans"); + this._droppedSpansCount++; + return; + } + if (this._droppedSpansCount > 0) { + api_1.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`); + this._droppedSpansCount = 0; + } + this._finishedSpans.push(span); + this._maybeStartTimer(); + } + /** + * Send all spans to the exporter respecting the batch size limit + * This function is used only on forceFlush or shutdown, + * for all other cases _flush should be used + * */ + _flushAll() { + return new Promise((resolve, reject) => { + const promises = []; + const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); + for (let i = 0, j = count; i < j; i++) promises.push(this._flushOneBatch()); + Promise.all(promises).then(() => { + resolve(); + }).catch(reject); + }); + } + _flushOneBatch() { + this._clearTimer(); + if (this._finishedSpans.length === 0) return Promise.resolve(); + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + reject(/* @__PURE__ */ new Error("Timeout")); + }, this._exportTimeoutMillis); + api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { + let spans; + if (this._finishedSpans.length <= this._maxExportBatchSize) { + spans = this._finishedSpans; + this._finishedSpans = []; + } else spans = this._finishedSpans.splice(0, this._maxExportBatchSize); + const doExport = () => this._exporter.export(spans, (result) => { + clearTimeout(timer); + if (result.code === core_1.ExportResultCode.SUCCESS) resolve(); + else reject(result.error ?? /* @__PURE__ */ new Error("BatchSpanProcessor: span export failed")); + }); + let pendingResources = null; + for (let i = 0, len = spans.length; i < len; i++) { + const span = spans[i]; + if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) { + pendingResources ??= []; + pendingResources.push(span.resource.waitForAsyncAttributes()); + } + } + if (pendingResources === null) doExport(); + else Promise.all(pendingResources).then(doExport, (err) => { + (0, core_1.globalErrorHandler)(err); + 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.8.0_@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.8.0_@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.8.0_@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.8.0_@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.8.0_@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.8.0_@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); + }; + } + }; + 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-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/version.js +var require_version = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.VERSION = void 0; + exports.VERSION = "2.8.0"; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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$4(); + 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(); + const inspect_1 = require_inspect(); + /** + * This class represents a basic tracer. + */ + var Tracer = class { + _sampler; + _generalLimits; + _spanLimits; + _idGenerator; + instrumentationScope; + _resource; + _spanProcessor; + _tracerMetrics; + /** + * Constructs a new Tracer instance. + */ + constructor(instrumentationScope, config, resource, spanProcessor) { + const localConfig = (0, utility_1.mergeConfig)(config); + this._sampler = localConfig.sampler; + this._generalLimits = localConfig.generalLimits; + this._spanLimits = localConfig.spanLimits; + this._idGenerator = config.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); + } + /** + * Starts a new Span or returns the default NoopSpan based on the sampling + * decision. + */ + 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; + } + [inspect_1.inspectCustom](depth, options, inspect) { + const payload = { + instrumentationScope: this.instrumentationScope, + resource: { attributes: (0, inspect_1.settledResourceAttributes)(this._resource) }, + spanLimits: this._spanLimits, + generalLimits: this._generalLimits + }; + return (0, inspect_1.formatInspect)("Tracer", payload, depth, options, inspect); + } + }; + exports.Tracer = Tracer; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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$4(); + /** + * 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); + } + onEnding(span) { + for (const spanProcessor of this._spanProcessors) if (spanProcessor.onEnding) spanProcessor.onEnding(span); + } + onEnd(span) { + for (const spanProcessor of this._spanProcessors) spanProcessor.onEnd(span); + } + 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.MultiSpanProcessor = MultiSpanProcessor; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider.js +var require_BasicTracerProvider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BasicTracerProvider = exports.ForceFlushState = void 0; + const core_1 = require_src$4(); + const resources_1 = require_src$3(); + const Tracer_1 = require_Tracer(); + const config_1 = require_config(); + const MultiSpanProcessor_1 = require_MultiSpanProcessor(); + const utility_1 = require_utility(); + 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 = {})); + /** + * This class represents a basic tracer provider which platform libraries can extend + */ + var BasicTracerProvider = class { + _config; + _tracers = /* @__PURE__ */ new Map(); + _resource; + _activeSpanProcessor; + constructor(config = {}) { + const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config)); + this._resource = mergedConfig.resource ?? (0, resources_1.defaultResource)(); + this._config = Object.assign({}, mergedConfig, { resource: this._resource }); + const spanProcessors = []; + if (config.spanProcessors?.length) spanProcessors.push(...config.spanProcessors); + this._activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(spanProcessors); + } + 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, + schemaUrl: options?.schemaUrl + }, this._config, this._resource, this._activeSpanProcessor)); + return this._tracers.get(key); + } + forceFlush() { + const timeout = this._config.forceFlushTimeoutMillis; + const promises = this._activeSpanProcessor["_spanProcessors"].map((spanProcessor) => { + return new Promise((resolve) => { + let state; + const timeoutInterval = setTimeout(() => { + resolve(/* @__PURE__ */ new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); + state = ForceFlushState.timeout; + }, timeout); + spanProcessor.forceFlush().then(() => { + clearTimeout(timeoutInterval); + if (state !== ForceFlushState.timeout) { + state = ForceFlushState.resolved; + resolve(state); + } + }).catch((error) => { + clearTimeout(timeoutInterval); + state = ForceFlushState.error; + resolve(error); + }); + }); + }); + return new Promise((resolve, reject) => { + Promise.all(promises).then((results) => { + const errors = results.filter((result) => result !== ForceFlushState.resolved); + if (errors.length > 0) reject(errors); + else resolve(); + }).catch((error) => reject([error])); + }); + } + 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)("BasicTracerProvider", payload, depth, options, inspect); + } + }; + exports.BasicTracerProvider = BasicTracerProvider; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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$4(); + /** + * This is implementation of {@link SpanExporter} that prints spans to the + * console. This class can be used for diagnostic purposes. + * + * NOTE: This {@link SpanExporter} is intended for diagnostics use only, output rendered to the console may change at any time. + */ + var ConsoleSpanExporter = class { + /** + * Export spans. + * @param spans + * @param resultCallback + */ + export(spans, resultCallback) { + return this._sendSpans(spans, resultCallback); + } + /** + * Shutdown the exporter. + */ + shutdown() { + this._sendSpans([]); + return this.forceFlush(); + } + /** + * Exports any pending spans in exporter + */ + forceFlush() { + return Promise.resolve(); + } + /** + * converts span info into more readable format + * @param span + */ + _exportInfo(span) { + return { + resource: { attributes: span.resource.attributes }, + instrumentationScope: span.instrumentationScope, + traceId: span.spanContext().traceId, + parentSpanContext: span.parentSpanContext, + traceState: span.spanContext().traceState?.serialize(), + name: span.name, + id: span.spanContext().spanId, + kind: span.kind, + timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), + duration: (0, core_1.hrTimeToMicroseconds)(span.duration), + attributes: span.attributes, + status: span.status, + events: span.events, + links: span.links + }; + } + /** + * Showing spans in console + * @param spans + * @param done + */ + _sendSpans(spans, done) { + for (const span of spans) console.dir(this._exportInfo(span), { depth: 3 }); + if (done) return done({ code: core_1.ExportResultCode.SUCCESS }); + } + }; + exports.ConsoleSpanExporter = ConsoleSpanExporter; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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$4(); + /** + * 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()` + * method. + */ + var InMemorySpanExporter = class { + _finishedSpans = []; + /** + * Indicates if the exporter has been "shutdown." + * When false, exported spans will not be stored in-memory. + */ + _stopped = false; + export(spans, resultCallback) { + if (this._stopped) return resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: /* @__PURE__ */ new Error("Exporter has been stopped") + }); + this._finishedSpans.push(...spans); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + shutdown() { + this._stopped = true; + this._finishedSpans = []; + return this.forceFlush(); + } + /** + * Exports any pending spans in the exporter + */ + forceFlush() { + return Promise.resolve(); + } + reset() { + this._finishedSpans = []; + } + getFinishedSpans() { + return this._finishedSpans; + } + }; + exports.InMemorySpanExporter = InMemorySpanExporter; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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$4(); + /** + * An implementation of the {@link SpanProcessor} that converts the {@link Span} + * to {@link ReadableSpan} and passes it to the configured exporter. + * + * Only spans that are sampled are converted. + * + * NOTE: This {@link SpanProcessor} exports every ended span individually instead of batching spans together, which causes significant performance overhead with most exporters. For production use, please consider using the {@link BatchSpanProcessor} instead. + */ + var SimpleSpanProcessor = class { + _exporter; + _shutdownOnce; + _pendingExports; + constructor(exporter) { + this._exporter = exporter; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + this._pendingExports = /* @__PURE__ */ new Set(); + } + async forceFlush() { + await Promise.all(Array.from(this._pendingExports)); + if (this._exporter.forceFlush) await this._exporter.forceFlush(); + } + 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)); + this._pendingExports.add(pendingExport); + pendingExport.finally(() => 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]); + 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() { + return this._exporter.shutdown(); + } + }; + exports.SimpleSpanProcessor = SimpleSpanProcessor; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/src/export/NoopSpanProcessor.js +var require_NoopSpanProcessor = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NoopSpanProcessor = void 0; + /** No-op implementation of SpanProcessor */ + var NoopSpanProcessor = class { + onStart(_span, _context) {} + onEnd(_span) {} + shutdown() { + return Promise.resolve(); + } + forceFlush() { + return Promise.resolve(); + } + }; + exports.NoopSpanProcessor = NoopSpanProcessor; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.8.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/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", { + enumerable: true, + get: function() { + return BasicTracerProvider_1.BasicTracerProvider; + } + }); + var platform_1 = require_platform(); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return platform_1.BatchSpanProcessor; + } + }); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return platform_1.RandomIdGenerator; + } + }); + var ConsoleSpanExporter_1 = require_ConsoleSpanExporter(); + Object.defineProperty(exports, "ConsoleSpanExporter", { + enumerable: true, + get: function() { + return ConsoleSpanExporter_1.ConsoleSpanExporter; + } + }); + var InMemorySpanExporter_1 = require_InMemorySpanExporter(); + Object.defineProperty(exports, "InMemorySpanExporter", { + enumerable: true, + get: function() { + return InMemorySpanExporter_1.InMemorySpanExporter; + } + }); + var SimpleSpanProcessor_1 = require_SimpleSpanProcessor(); + Object.defineProperty(exports, "SimpleSpanProcessor", { + enumerable: true, + get: function() { + return SimpleSpanProcessor_1.SimpleSpanProcessor; + } + }); + var NoopSpanProcessor_1 = require_NoopSpanProcessor(); + Object.defineProperty(exports, "NoopSpanProcessor", { + enumerable: true, + get: function() { + return NoopSpanProcessor_1.NoopSpanProcessor; + } + }); + var AlwaysOffSampler_1 = require_AlwaysOffSampler(); + Object.defineProperty(exports, "AlwaysOffSampler", { + enumerable: true, + get: function() { + return AlwaysOffSampler_1.AlwaysOffSampler; + } + }); + var AlwaysOnSampler_1 = require_AlwaysOnSampler(); + Object.defineProperty(exports, "AlwaysOnSampler", { + enumerable: true, + get: function() { + return AlwaysOnSampler_1.AlwaysOnSampler; + } + }); + var ParentBasedSampler_1 = require_ParentBasedSampler(); + Object.defineProperty(exports, "ParentBasedSampler", { + enumerable: true, + get: function() { + return ParentBasedSampler_1.ParentBasedSampler; + } + }); + var TraceIdRatioBasedSampler_1 = require_TraceIdRatioBasedSampler(); + Object.defineProperty(exports, "TraceIdRatioBasedSampler", { + enumerable: true, + get: function() { + return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; + } + }); + var Sampler_1 = require_Sampler(); + Object.defineProperty(exports, "SamplingDecision", { + enumerable: true, + get: function() { + return Sampler_1.SamplingDecision; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.8.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; + const events_1 = __require("events"); + const ADD_LISTENER_METHODS = [ + "addListener", + "on", + "once", + "prependListener", + "prependOnceListener" + ]; + var AbstractAsyncHooksContextManager = class { + /** + * Binds a the certain context or the active one to the target function and then returns the target + * @param context A context (span) to be bind to target + * @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); + return target; + } + _bindFunction(context$1, target) { + const manager = this; + const contextWrapper = function(...args) { + return manager.with(context$1, () => target.apply(this, args)); + }; + Object.defineProperty(contextWrapper, "length", { + enumerable: false, + configurable: true, + writable: false, + value: target.length + }); + /** + * It isn't possible to tell Typescript that contextWrapper is the same as T + * so we forced to cast as any here. + */ + return contextWrapper; + } + /** + * By default, EventEmitter call their callback with their context, which we do + * not want, instead we will bind a specific context to all callbacks that + * go through it. + * @param context the context we want to bind + * @param ee EventEmitter an instance of EventEmitter to patch + */ + _bindEventEmitter(context$1, 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); + }); + if (typeof ee.removeListener === "function") ee.removeListener = this._patchRemoveListener(ee, ee.removeListener); + if (typeof ee.off === "function") ee.off = this._patchRemoveListener(ee, ee.off); + if (typeof ee.removeAllListeners === "function") ee.removeAllListeners = this._patchRemoveAllListeners(ee, ee.removeAllListeners); + return ee; + } + /** + * Patch methods that remove a given listener so that we match the "patched" + * version of that listener (the one that propagate context). + * @param ee EventEmitter instance + * @param original reference to the patched method + */ + _patchRemoveListener(ee, original) { + const contextManager = this; + return function(event, listener) { + const events = contextManager._getPatchMap(ee)?.[event]; + if (events === void 0) return original.call(this, event, listener); + const patchedListener = events.get(listener); + return original.call(this, event, patchedListener || listener); + }; + } + /** + * Patch methods that remove all listeners so we remove our + * internal references for a given event. + * @param ee EventEmitter instance + * @param original reference to the patched method + */ + _patchRemoveAllListeners(ee, original) { + const contextManager = this; + return function(event) { + const map = contextManager._getPatchMap(ee); + if (map !== void 0) { + if (arguments.length === 0) contextManager._createPatchMap(ee); + else if (map[event] !== void 0) delete map[event]; + } + return original.apply(this, arguments); + }; + } + /** + * Patch methods on an event emitter instance that can add listeners so we + * can force them to propagate a given context. + * @param ee EventEmitter instance + * @param original reference to the patched method + * @param [context] context to propagate when calling listeners + */ + _patchAddListener(ee, original, context$1) { + const contextManager = this; + return function(event, listener) { + /** + * This check is required to prevent double-wrapping the listener. + * The implementation for ee.once wraps the listener and calls ee.on. + * Without this check, we would wrap that wrapped listener. + * This causes an issue because ee.removeListener depends on the onceWrapper + * to properly remove the listener. If we wrap their wrapper, we break + * that detection. + */ + if (contextManager._wrapped) return original.call(this, event, listener); + let map = contextManager._getPatchMap(ee); + if (map === void 0) map = contextManager._createPatchMap(ee); + let listeners = map[event]; + if (listeners === void 0) { + listeners = /* @__PURE__ */ new WeakMap(); + map[event] = listeners; + } + const patchedListener = contextManager.bind(context$1, listener); + listeners.set(listener, patchedListener); + /** + * See comment at the start of this function for the explanation of this property. + */ + contextManager._wrapped = true; + try { + return original.call(this, event, patchedListener); + } finally { + contextManager._wrapped = false; + } + }; + } + _createPatchMap(ee) { + const map = Object.create(null); + ee[this._kOtListeners] = map; + return map; + } + _getPatchMap(ee) { + return ee[this._kOtListeners]; + } + _kOtListeners = Symbol("OtListeners"); + _wrapped = false; + }; + exports.AbstractAsyncHooksContextManager = AbstractAsyncHooksContextManager; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.8.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; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const asyncHooks = __require("async_hooks"); + const AbstractAsyncHooksContextManager_1 = require_AbstractAsyncHooksContextManager(); + /** + * @deprecated Use AsyncLocalStorageContextManager instead. + */ + var AsyncHooksContextManager = class extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { + _asyncHook; + _contexts = /* @__PURE__ */ new Map(); + _stack = []; + constructor() { + super(); + this._asyncHook = asyncHooks.createHook({ + init: this._init.bind(this), + before: this._before.bind(this), + after: this._after.bind(this), + destroy: this._destroy.bind(this), + promiseResolve: this._destroy.bind(this) + }); + } + active() { + return this._stack[this._stack.length - 1] ?? api_1.ROOT_CONTEXT; + } + with(context$1, fn, thisArg, ...args) { + this._enterContext(context$1); + try { + return fn.call(thisArg, ...args); + } finally { + this._exitContext(); + } + } + enable() { + this._asyncHook.enable(); + return this; + } + disable() { + this._asyncHook.disable(); + this._contexts.clear(); + this._stack = []; + return this; + } + /** + * Init hook will be called when userland create a async context, setting the + * context as the current one if it exist. + * @param uid id of the async context + * @param type the resource type + */ + _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); + } + /** + * Destroy hook will be called when a given context is no longer used so we can + * remove its attached context. + * @param uid uid of the async context + */ + _destroy(uid) { + this._contexts.delete(uid); + } + /** + * Before hook is called just before executing a async context. + * @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); + } + /** + * After hook is called just after completing the execution of a async context. + */ + _after() { + this._exitContext(); + } + /** + * Set the given context as active + */ + _enterContext(context$1) { + this._stack.push(context$1); + } + /** + * Remove the context at the root of the stack + */ + _exitContext() { + this._stack.pop(); + } + }; + exports.AsyncHooksContextManager = AsyncHooksContextManager; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.8.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; + const api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const async_hooks_1 = __require("async_hooks"); + const AbstractAsyncHooksContextManager_1 = require_AbstractAsyncHooksContextManager(); + var AsyncLocalStorageContextManager = class extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { + _asyncLocalStorage; + constructor() { + super(); + this._asyncLocalStorage = new async_hooks_1.AsyncLocalStorage(); + } + active() { + return this._asyncLocalStorage.getStore() ?? api_1.ROOT_CONTEXT; + } + with(context$1, fn, thisArg, ...args) { + const cb = thisArg == null ? fn : fn.bind(thisArg); + return this._asyncLocalStorage.run(context$1, cb, ...args); + } + enable() { + return this; + } + disable() { + this._asyncLocalStorage.disable(); + return this; + } + }; + exports.AsyncLocalStorageContextManager = AsyncLocalStorageContextManager; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+context-async-hooks@2.8.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; + var AsyncHooksContextManager_1 = require_AsyncHooksContextManager(); + Object.defineProperty(exports, "AsyncHooksContextManager", { + enumerable: true, + get: function() { + return AsyncHooksContextManager_1.AsyncHooksContextManager; + } + }); + var AsyncLocalStorageContextManager_1 = require_AsyncLocalStorageContextManager(); + Object.defineProperty(exports, "AsyncLocalStorageContextManager", { + enumerable: true, + get: function() { + return AsyncLocalStorageContextManager_1.AsyncLocalStorageContextManager; + } + }); +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.8.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 api_1 = (init_esm$2(), __toCommonJS(esm_exports$2)); + const core_1 = require_src$4(); + function setupContextManager(contextManager) { + if (contextManager === null) return; + if (contextManager === void 0) { + const defaultContextManager = new context_async_hooks_1.AsyncLocalStorageContextManager(); + defaultContextManager.enable(); + api_1.context.setGlobalContextManager(defaultContextManager); + return; + } + contextManager.enable(); + api_1.context.setGlobalContextManager(contextManager); + } + function setupPropagator(propagator) { + if (propagator === null) return; + if (propagator === void 0) { + api_1.propagation.setGlobalPropagator(new core_1.CompositePropagator({ propagators: [new core_1.W3CTraceContextPropagator(), new core_1.W3CBaggagePropagator()] })); + return; + } + api_1.propagation.setGlobalPropagator(propagator); + } + /** + * Register this TracerProvider for use with the OpenTelemetry API. + * Undefined values may be replaced with defaults, and + * null values will be skipped. + * + * @param config Configuration object for SDK registration + */ + var NodeTracerProvider = class extends sdk_trace_base_1.BasicTracerProvider { + constructor(config = {}) { + super(config); + } + /** + * Register this TracerProvider for use with the OpenTelemetry API. + * Undefined values may be replaced with defaults, and + * null values will be skipped. + * + * @param config Configuration object for SDK registration + */ + register(config = {}) { + api_1.trace.setGlobalTracerProvider(this); + setupContextManager(config.contextManager); + setupPropagator(config.propagator); + } + }; + exports.NodeTracerProvider = NodeTracerProvider; +})); + +//#endregion +//#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-node@2.8.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; + var NodeTracerProvider_1 = require_NodeTracerProvider(); + Object.defineProperty(exports, "NodeTracerProvider", { + enumerable: true, + get: function() { + return NodeTracerProvider_1.NodeTracerProvider; + } + }); + var sdk_trace_base_1 = require_src$2(); + Object.defineProperty(exports, "AlwaysOffSampler", { + enumerable: true, + get: function() { + return sdk_trace_base_1.AlwaysOffSampler; + } + }); + Object.defineProperty(exports, "AlwaysOnSampler", { + enumerable: true, + get: function() { + return sdk_trace_base_1.AlwaysOnSampler; + } + }); + Object.defineProperty(exports, "BasicTracerProvider", { + enumerable: true, + get: function() { + return sdk_trace_base_1.BasicTracerProvider; + } + }); + Object.defineProperty(exports, "BatchSpanProcessor", { + enumerable: true, + get: function() { + return sdk_trace_base_1.BatchSpanProcessor; + } + }); + Object.defineProperty(exports, "ConsoleSpanExporter", { + enumerable: true, + get: function() { + return sdk_trace_base_1.ConsoleSpanExporter; + } + }); + Object.defineProperty(exports, "InMemorySpanExporter", { + enumerable: true, + get: function() { + return sdk_trace_base_1.InMemorySpanExporter; + } + }); + Object.defineProperty(exports, "NoopSpanProcessor", { + enumerable: true, + get: function() { + return sdk_trace_base_1.NoopSpanProcessor; + } + }); + Object.defineProperty(exports, "ParentBasedSampler", { + enumerable: true, + get: function() { + return sdk_trace_base_1.ParentBasedSampler; + } + }); + Object.defineProperty(exports, "RandomIdGenerator", { + enumerable: true, + get: function() { + return sdk_trace_base_1.RandomIdGenerator; + } + }); + Object.defineProperty(exports, "SamplingDecision", { + enumerable: true, + get: function() { + return sdk_trace_base_1.SamplingDecision; + } + }); + Object.defineProperty(exports, "SimpleSpanProcessor", { + enumerable: true, + get: function() { + return sdk_trace_base_1.SimpleSpanProcessor; + } + }); + Object.defineProperty(exports, "TraceIdRatioBasedSampler", { + enumerable: true, + get: function() { + return sdk_trace_base_1.TraceIdRatioBasedSampler; + } + }); +})); + +//#endregion +//#region src/ids.ts +var import_src$2 = require_src(); +var import_src$1 = require_src$2(); +var import_src = require_src$5(); +function hashHex(input, bytes) { + return createHash("sha256").update(input).digest("hex").slice(0, bytes * 2); +} +/** 16-byte (32 hex) trace id, deterministic per (session, turn). */ +function makeTraceId(sessionId, turnId) { + const id = hashHex(`traceroot:codex:trace:${sessionId}:${turnId}`, 16); + return id === "0".repeat(32) ? "0".repeat(31) + "1" : id; +} +/** 8-byte (16 hex) span id, deterministic per seed. */ +function makeSpanId(seed) { + const id = hashHex(`traceroot:codex:span:${seed}`, 8); + return id === "0".repeat(16) ? "0".repeat(15) + "1" : id; +} +/** +* OTEL IdGenerator that returns a primed id for the very next call, then +* falls back to random. We prime it immediately before tracer.startSpan() so +* the new span gets our deterministic id (startSpan consumes the generator +* synchronously). Root spans consume both trace+span id; child spans inherit +* the trace id from the parent context and consume only the span id. +*/ +var PrimedIdGenerator = class { + nextTraceId; + nextSpanId; + generateTraceId() { + const v = this.nextTraceId ?? randomBytes(16).toString("hex"); + this.nextTraceId = void 0; + return v; + } + generateSpanId() { + const v = this.nextSpanId ?? randomBytes(8).toString("hex"); + this.nextSpanId = void 0; + return v; + } +}; + +//#endregion +//#region src/sdk.ts +const SDK_NAME = "traceroot-codex-plugin"; +const SDK_VERSION = "0.1.0"; + +//#endregion +//#region src/exporter.ts +function buildTracingWith(processor, idGen) { + const provider = new import_src$2.NodeTracerProvider({ + idGenerator: idGen, + spanProcessors: [processor] + }); + return { + tracer: provider.getTracer(SDK_NAME, SDK_VERSION), + idGen, + shutdown: async () => { + await provider.forceFlush(); + await provider.shutdown(); + } + }; +} +function buildTracing(config) { + return buildTracingWith(new import_src$1.BatchSpanProcessor(new import_src.OTLPTraceExporter({ + url: `${config.hostUrl}/api/v1/public/traces`, + headers: { + Authorization: `Bearer ${config.apiKey ?? ""}`, + "x-traceroot-sdk-name": SDK_NAME, + "x-traceroot-sdk-version": SDK_VERSION + }, + compression: "gzip" + }), { + maxQueueSize: 4096, + maxExportBatchSize: 1024, + scheduledDelayMillis: 3e4 + }), new PrimedIdGenerator()); +} + +//#endregion +//#region src/git.ts +const run = promisify(execFile); +function normalizeRepo(remote) { + const m = remote.trim().match(/(?:github\.com[:/])([^/]+\/[^/]+?)(?:\.git)?$/i); + return m ? m[1] : void 0; +} +async function getGitContext(cwd) { + const out = {}; + try { + const { stdout } = await run("git", [ + "remote", + "get-url", + "origin" + ], { cwd }); + out.repo = normalizeRepo(stdout); + } catch {} + try { + const { stdout } = await run("git", ["rev-parse", "HEAD"], { cwd }); + const ref = stdout.trim(); + if (/^[0-9a-f]{40}$/.test(ref)) out.ref = ref; + } catch {} + return out; +} + +//#endregion +//#region src/util.ts +let DEBUG = false; +function setDebug(b) { + DEBUG = b; +} +function debugLog(...args) { + if (DEBUG) console.error("[traceroot-codex]", ...args); +} +async function readStdin() { + const chunks = []; + for await (const c of process.stdin) chunks.push(c); + const raw = Buffer.concat(chunks).toString("utf-8").trim(); + return JSON.parse(raw || "{}"); +} +function truncate(s, max) { + if (s.length <= max) return s; + return `${s.slice(0, max)}…[truncated ${s.length - max} chars]`; +} + +//#endregion +//#region src/sidecar.ts +const suffix = ".traceroot"; +async function loadEmittedSpanIds(rolloutFile) { + try { + const data = await fs.readFile(`${rolloutFile}${suffix}`, "utf-8"); + return new Set(data.split("\n").filter(Boolean)); + } catch (error) { + if (error.code !== "ENOENT") debugLog("sidecar read failed; assuming empty:", error); + return /* @__PURE__ */ new Set(); + } +} +async function markSpanEmitted(rolloutFile, spanId) { + try { + await fs.appendFile(`${rolloutFile}${suffix}`, `${spanId}\n`, "utf-8"); + } catch {} +} + +//#endregion +//#region src/tokens.ts +/** +* Map Codex `last_token_usage` to the backend's flat token attribute keys. +* Codex `input_tokens` is GROSS (includes cached); the backend subtracts +* cache_read to derive the uncached input bucket, so we pass it straight +* through. Codex exposes no cache-write concept, so that key is omitted. +*/ +function mapUsage(u) { + const out = {}; + if (!u) return out; + if (typeof u.input_tokens === "number") out["llm.token_count.prompt"] = u.input_tokens; + if (typeof u.output_tokens === "number") out["llm.token_count.completion"] = u.output_tokens; + if (typeof u.cached_input_tokens === "number") out["llm.token_count.prompt_details.cache_read"] = u.cached_input_tokens; + if (typeof u.reasoning_output_tokens === "number") out["llm.token_count.completion_details.reasoning"] = u.reasoning_output_tokens; + return out; +} + +//#endregion +//#region src/spans.ts +init_esm$2(); +const str = (v, max) => truncate(typeof v === "string" ? v : JSON.stringify(v ?? ""), max); +function commonTrace(attrs, sessionMeta, ctx) { + attrs["traceroot.sdk.name"] = SDK_NAME; + attrs["traceroot.sdk.version"] = SDK_VERSION; + attrs["traceroot.trace.session_id"] = sessionMeta.sessionId; + if (ctx.userId) attrs["traceroot.trace.user_id"] = ctx.userId; + if (ctx.environment) attrs["traceroot.environment"] = ctx.environment; +} +function planTurnSpans(sessionMeta, turn, ctx, opts) { + if (!turn.turnId) return []; + const seed = opts?.seedPrefix ?? ""; + const traceId = opts?.traceId ?? makeTraceId(sessionMeta.sessionId, turn.turnId); + const rootId = makeSpanId(seed + turn.turnId + ":root"); + const rootParentSpanId = opts?.rootParentSpanId !== void 0 ? opts.rootParentSpanId : null; + const out = []; + const rootAttrs = { "traceroot.span.type": "AGENT" }; + commonTrace(rootAttrs, sessionMeta, ctx); + if (turn.userInput) rootAttrs["traceroot.span.input"] = str(turn.userInput, ctx.maxChars); + if (turn.finalOutput) rootAttrs["traceroot.span.output"] = str(turn.finalOutput, ctx.maxChars); + rootAttrs["traceroot.span.metadata"] = JSON.stringify(pruneUndefined({ + "codex.turn_id": turn.turnId, + "codex.thread_id": sessionMeta.sessionId, + "codex.model": turn.model, + "codex.model_provider": sessionMeta.modelProvider, + "codex.cli_version": sessionMeta.cliVersion, + "codex.tool_call_count": turn.steps.reduce((n, s) => n + s.toolCalls.length, 0) + })); + if (ctx.git?.repo) rootAttrs["traceroot.git.repo"] = ctx.git.repo; + if (ctx.git?.ref) rootAttrs["traceroot.git.ref"] = ctx.git.ref; + out.push({ + spanId: rootId, + parentSpanId: rootParentSpanId, + traceId, + kind: "AGENT", + name: "Codex Turn", + startTime: turn.startTime, + endTime: turn.endTime, + attributes: rootAttrs, + complete: rootParentSpanId === null ? true : turn.completed + }); + let prevToolResults; + for (const step of turn.steps) { + const stepId = makeSpanId(seed + turn.turnId + ":step:" + step.index); + const input = step.index === 0 ? turn.userInput : prevToolResults; + out.push(planStepSpan(sessionMeta, turn, step, stepId, rootId, traceId, ctx, input)); + for (const tc of step.toolCalls) out.push(planToolSpan(sessionMeta, tc, seed, stepId, traceId, ctx)); + if (step.toolCalls.length) prevToolResults = str(step.toolCalls.map((tc) => ({ + name: tc.name, + output: tc.output + })), ctx.maxChars); + } + return out; +} +function pruneUndefined(o) { + const r = {}; + for (const [k, v] of Object.entries(o)) if (v !== void 0 && v !== null) r[k] = v; + return r; +} +/** LLM-step output: text + reasoning + the tool calls the model requested. */ +function buildStepOutput(step, max) { + const o = {}; + if (step.text) o.content = step.text; + if (step.reasoning) o.reasoning = step.reasoning; + if (step.toolCalls.length) o.tool_calls = step.toolCalls.map((tc) => ({ + name: tc.name, + args: tc.args + })); + if (Object.keys(o).length === 0) return void 0; + return truncate(JSON.stringify(o), max); +} +function planStepSpan(sessionMeta, turn, step, spanId, parentSpanId, traceId, ctx, input) { + const attrs = { "traceroot.span.type": "LLM" }; + commonTrace(attrs, sessionMeta, ctx); + if (turn.model) attrs["traceroot.llm.model"] = turn.model; + if (input) attrs["traceroot.span.input"] = truncate(input, ctx.maxChars); + const output = buildStepOutput(step, ctx.maxChars); + if (output) attrs["traceroot.span.output"] = output; + attrs["traceroot.span.metadata"] = JSON.stringify({ "codex.step_index": step.index }); + Object.assign(attrs, mapUsage(step.usage)); + return { + spanId, + parentSpanId, + traceId, + kind: "LLM", + name: turn.model ?? "model", + startTime: step.startTime, + endTime: step.endTime, + attributes: attrs, + complete: Boolean(step.usage) + }; +} +function planToolSpan(sessionMeta, tc, seed, parentSpanId, traceId, ctx) { + const attrs = { "traceroot.span.type": "TOOL" }; + commonTrace(attrs, sessionMeta, ctx); + attrs["traceroot.span.input"] = str(tc.args, ctx.maxChars); + if (tc.output !== void 0) attrs["traceroot.span.output"] = str(tc.output, ctx.maxChars); + const meta = {}; + if (tc.kind !== void 0) meta["tool_kind"] = tc.kind; + if (tc.status !== void 0) meta["status"] = tc.status; + if (tc.exitCode !== void 0) meta["exit_code"] = tc.exitCode; + if (tc.error !== void 0) meta["error"] = tc.error; + if (Object.keys(meta).length > 0) attrs["traceroot.span.metadata"] = JSON.stringify(meta); + return { + spanId: makeSpanId(seed + tc.callId), + parentSpanId, + traceId, + kind: "TOOL", + name: tc.name, + startTime: tc.startTime, + endTime: tc.endTime ?? tc.startTime, + attributes: attrs, + complete: tc.endTime !== void 0 + }; +} +const KIND = { + AGENT: SpanKind.INTERNAL, + LLM: SpanKind.CLIENT, + TOOL: SpanKind.INTERNAL +}; +function emitSpan(tracing, s) { + let ctx = ROOT_CONTEXT; + if (s.parentSpanId) { + const parent = { + traceId: s.traceId, + spanId: s.parentSpanId, + traceFlags: TraceFlags.SAMPLED, + isRemote: false + }; + ctx = trace.setSpanContext(ROOT_CONTEXT, parent); + } else tracing.idGen.nextTraceId = s.traceId; + tracing.idGen.nextSpanId = s.spanId; + tracing.tracer.startSpan(s.name, { + startTime: s.startTime, + kind: KIND[s.kind], + attributes: s.attributes + }, ctx).end(s.endTime); +} + +//#endregion +//#region src/subagents.ts +/** +* Walk the Codex sessions directory for a rollout file named +* `rollout--.jsonl`. Returns the first match or undefined. +* Fail-soft: returns undefined on any fs error. +* +* To bound cost we scan only the newest ~3 day-directories under +* sessions/YYYY/MM/DD rather than the full tree. +*/ +async function locateSubagentRollout(threadId, codexHome) { + try { + const home = codexHome ?? process.env["CODEX_HOME"] ?? path.join(os$2.homedir(), ".codex"); + const dayDirs = await collectRecentDayDirs(path.join(home, "sessions"), 3); + for (const dayDir of dayDirs) { + const entries = await fs.readdir(dayDir).catch(() => []); + for (const name of entries) if (name.endsWith(`-${threadId}.jsonl`)) return path.join(dayDir, name); + } + return; + } catch { + return; + } +} +/** Return up to `max` most-recent day-level dirs under sessionsRoot/YYYY/MM/DD. */ +async function collectRecentDayDirs(sessionsRoot, max) { + const result = []; + let years; + try { + years = (await fs.readdir(sessionsRoot)).sort().reverse(); + } catch { + return result; + } + for (const year of years) { + const yearDir = path.join(sessionsRoot, year); + let months; + try { + months = (await fs.readdir(yearDir)).sort().reverse(); + } catch { + continue; + } + for (const month of months) { + const monthDir = path.join(yearDir, month); + let days; + try { + days = (await fs.readdir(monthDir)).sort().reverse(); + } catch { + continue; + } + for (const day of days) { + result.push(path.join(monthDir, day)); + if (result.length >= max) return result; + } + } + } + return result; +} + +//#endregion +//#region src/transcript.ts +async function readRollout(file) { + const raw = await fs.readFile(file, "utf-8"); + const lines = []; + for (const ln of raw.split("\n")) { + const trimmed = ln.trim(); + if (!trimmed) continue; + try { + lines.push(JSON.parse(trimmed)); + } catch {} + } + return lines; +} +const ms = (ts) => Date.parse(ts); +function toolKindFromEndEvent(eventType) { + if (eventType === "exec_command_end") return "exec"; + if (eventType === "patch_apply_end") return "patch"; + if (eventType === "mcp_tool_call_end") return "mcp"; + if (eventType === "collab_agent_spawn_end") return "spawn"; + if (eventType === "custom_tool_call_end") return "custom"; + if (eventType === "web_search_end" || eventType === "tool_search_call_end") return "search"; + return "unknown"; +} +function extractToolError(p) { + if (p.error != null || p.codex_error_info != null) return JSON.stringify(p.error ?? p.codex_error_info); + const parts = [p.stdout, p.stderr].filter(Boolean); + if (parts.length) return parts.join("\n"); + if (p.aggregated_output != null) return p.aggregated_output; + if (typeof p.exit_code === "number") return `Exit code: ${p.exit_code}`; +} +function reasoningText(p) { + const parts = []; + for (const s of p.summary ?? []) if (s?.text) parts.push(s.text); + if (typeof p.content === "string") parts.push(p.content); + return parts.length ? parts.join("\n") : void 0; +} +function messageText(content) { + if (!Array.isArray(content)) return void 0; + const parts = content.filter((c) => typeof c?.text === "string").map((c) => c.text); + return parts.length ? parts.join("") : void 0; +} +/** Codex's spawn_agent tool returns {"agent_id":"","nickname":"..."}. */ +function parseSpawnAgentId(output) { + let obj = output; + if (typeof output === "string") try { + obj = JSON.parse(output); + } catch { + return; + } + const id = obj?.agent_id; + return typeof id === "string" && id ? id : void 0; +} +function parseRollout(lines) { + let sessionMeta = { sessionId: "" }; + const turns = []; + let turn; + let step; + const toolsByCallId = /* @__PURE__ */ new Map(); + const spawnAgentCallIds = /* @__PURE__ */ new Set(); + const ensureStep = (t, at) => { + if (!step) { + step = { + index: t.steps.length, + startTime: at, + endTime: at, + toolCalls: [], + reasoning: void 0, + text: void 0 + }; + t.steps.push(step); + } + return step; + }; + for (const line of lines) { + const at = ms(line.timestamp); + if (line.type === "session_meta") { + sessionMeta = { + sessionId: line.payload.id, + cwd: line.payload.cwd, + cliVersion: line.payload.cli_version, + modelProvider: line.payload.model_provider ?? void 0, + threadSource: line.payload.thread_source, + parentThreadId: line.payload.parent_thread_id + }; + continue; + } + if (line.type === "turn_context") { + const p = line.payload; + if (turn && p.model) turn.model = p.model; + continue; + } + if (line.type === "event_msg") { + const p = line.payload; + switch (p.type) { + case "task_started": + turn = { + turnId: p.turn_id ?? void 0, + startTime: at, + endTime: at, + steps: [], + subagents: [], + completed: false, + aborted: false + }; + step = void 0; + toolsByCallId.clear(); + spawnAgentCallIds.clear(); + turns.push(turn); + break; + case "user_message": + if (turn && typeof p.message === "string") turn.userInput = p.message; + break; + case "token_count": + if (turn && p.info?.last_token_usage) { + const s = ensureStep(turn, at); + s.usage = p.info.last_token_usage; + s.endTime = at; + step = void 0; + } + break; + case "task_complete": + if (turn) { + turn.completed = true; + turn.endTime = at; + const lastText = [...turn.steps].reverse().find((s) => s.text)?.text; + turn.finalOutput = p.last_agent_message ?? lastText ?? void 0; + } + break; + default: + if (turn && typeof p.new_thread_id === "string") { + const ref = { threadId: p.new_thread_id }; + if (typeof p.call_id === "string") ref.spawnCallId = p.call_id; + (turn.subagents ??= []).push(ref); + } + if (turn && p.type.endsWith("_end") && typeof p.call_id === "string") { + const tc = toolsByCallId.get(p.call_id); + if (tc) { + tc.kind = toolKindFromEndEvent(p.type); + if (typeof p.status === "string") tc.status = p.status; + if (typeof p.exit_code === "number") tc.exitCode = p.exit_code; + if (!tc.endTime) tc.endTime = at; + if (tc.output === void 0) tc.output = p.aggregated_output ?? p.stdout; + if (p.status === "failed" || p.status === "declined") tc.error = extractToolError(p); + } + } + } + continue; + } + if (line.type === "response_item" && turn) { + const p = line.payload; + if (p.type === "function_call_output" || p.type === "custom_tool_call_output") { + const tc = toolsByCallId.get(p.call_id); + if (tc) { + tc.endTime = at; + tc.output = p.output; + } + if (turn && spawnAgentCallIds.has(p.call_id)) { + const threadId = parseSpawnAgentId(p.output); + if (threadId) (turn.subagents ??= []).push({ + threadId, + spawnCallId: p.call_id + }); + } + continue; + } + const s = ensureStep(turn, at); + if (p.type === "reasoning") s.reasoning = reasoningText(p); + else if (p.type === "message") { + if (p.role !== "developer" && p.role !== "user") s.text = messageText(p.content); + } else if (p.type === "function_call") { + let args = p.arguments; + try { + args = JSON.parse(p.arguments); + } catch {} + const tc = { + callId: p.call_id, + name: p.name, + args, + startTime: at + }; + s.toolCalls.push(tc); + toolsByCallId.set(p.call_id, tc); + if (p.name === "spawn_agent") spawnAgentCallIds.add(p.call_id); + } else if (p.type === "custom_tool_call") { + let args = p.input; + try { + args = JSON.parse(p.input); + } catch {} + const tc = { + callId: p.call_id, + name: p.name, + args, + startTime: at + }; + s.toolCalls.push(tc); + toolsByCallId.set(p.call_id, tc); + } + continue; + } + } + return { + sessionMeta, + turns + }; +} + +//#endregion +//#region src/emit.ts +const STACK_GUARD = 32; +/** Emit all complete, not-yet-seen spans for `turn` and recurse into its subagents. */ +async function emitTurnTree(sessionMeta, turn, ctx, opts, visited, depth, tracing, already, emittedIds, findSubagent) { + let n = 0; + for (const span of planTurnSpans(sessionMeta, turn, ctx, opts)) { + if (!span.complete) continue; + const isTraceRoot = span.parentSpanId === null; + if (already.has(span.spanId) && !isTraceRoot) continue; + emitSpan(tracing, span); + emittedIds.push(span.spanId); + already.add(span.spanId); + n++; + } + if (depth >= STACK_GUARD) { + debugLog(`subagent recursion hit STACK_GUARD at depth ${depth}; stopping`); + return n; + } + const parentSeed = opts.seedPrefix ?? ""; + const traceId = opts.traceId ?? makeTraceId(sessionMeta.sessionId, turn.turnId ?? ""); + for (const sub of turn.subagents ?? []) { + if (!sub.spawnCallId) continue; + if (visited.has(sub.threadId)) continue; + visited.add(sub.threadId); + try { + const childPath = await findSubagent(sub.threadId); + debugLog(`subagent ${sub.threadId} spawnCall=${sub.spawnCallId}: childPath=${childPath ?? "NOT FOUND"}`); + if (!childPath) continue; + const child = parseRollout(await readRollout(childPath)); + debugLog(`subagent ${sub.threadId}: parsed ${child.turns.length} turn(s), session=${child.sessionMeta.sessionId}`); + const childOpts = { + traceId, + rootParentSpanId: makeSpanId(parentSeed + sub.spawnCallId), + seedPrefix: sub.threadId + ":" + }; + for (const childTurn of child.turns) n += await emitTurnTree(child.sessionMeta, childTurn, ctx, childOpts, visited, depth + 1, tracing, already, emittedIds, findSubagent); + } catch (err) { + debugLog(`subagent ${sub.threadId} resolve/read/parse failed; skipping: ${String(err)}`); + continue; + } + } + return n; +} +async function dispatch(hook, config, deps) { + const transcript = hook.transcript_path; + if (!transcript) { + debugLog("no transcript_path; skipping"); + return { emitted: 0 }; + } + const buildTracingFn = deps?.buildTracing ?? buildTracing; + const getGit = deps?.getGit ?? getGitContext; + const findSubagentFn = deps?.findSubagent ?? locateSubagentRollout; + const { sessionMeta, turns } = parseRollout(await readRollout(transcript)); + if (sessionMeta.threadSource === "subagent" || sessionMeta.parentThreadId) { + debugLog(`subagent session ${sessionMeta.sessionId}; skipping standalone emit (nested under parent)`); + return { emitted: 0 }; + } + const git = await getGit(sessionMeta.cwd ?? hook.cwd ?? process.cwd()).catch(() => ({})); + const ctx = { + environment: config.environment, + userId: config.userId, + git, + maxChars: config.maxChars + }; + const already = await loadEmittedSpanIds(transcript); + const tracing = buildTracingFn(config); + let emitted = 0; + const emittedIds = []; + const visited = /* @__PURE__ */ new Set(); + try { + for (const turn of turns) emitted += await emitTurnTree(sessionMeta, turn, ctx, {}, visited, 0, tracing, already, emittedIds, findSubagentFn); + } finally { + await tracing.shutdown(); + } + for (const id of emittedIds) await markSpanEmitted(transcript, id); + debugLog(`emitted ${emitted} spans`); + return { emitted }; +} + +//#endregion +//#region src/index.ts +async function runHook() { + let hook; + try { + hook = await readStdin(); + } catch { + return; + } + const config = await getConfig(hook.cwd); + setDebug(config.debug); + if (!config.enabled) { + debugLog("tracing disabled (set TRACE_TO_TRACEROOT=true and TRACEROOT_API_KEY)"); + return; + } + if (!hook.transcript_path) { + debugLog("hook payload missing transcript_path; skipping"); + return; + } + try { + await dispatch(hook, config); + } catch (error) { + debugLog("dispatch failed:", error); + if (config.failOnError) { + process.exitCode = 1; + throw error; + } + } +} +runHook().catch((error) => { + if (process.env.TRACEROOT_CODEX_DEBUG === "true") console.error("[traceroot-codex] fatal:", error); + if (process.env.TRACEROOT_CODEX_FAIL_ON_ERROR === "true") process.exitCode = 1; +}); + +//#endregion +export { runHook }; \ No newline at end of file diff --git a/plugins/tracing/hooks/hooks.json b/plugins/tracing/hooks/hooks.json new file mode 100644 index 0000000..40df7a2 --- /dev/null +++ b/plugins/tracing/hooks/hooks.json @@ -0,0 +1,13 @@ +{ + "hooks": { + "PostToolUse": [ + { "hooks": [ { "type": "command", "command": "node \"${CODEX_HOME:-$HOME/.codex}/plugins/cache/traceroot-codex-plugin/tracing/0.1.0/dist/index.mjs\"", "timeout": 30, "statusMessage": "Streaming Codex trace to TraceRoot" } ] } + ], + "Stop": [ + { "hooks": [ { "type": "command", "command": "node \"${CODEX_HOME:-$HOME/.codex}/plugins/cache/traceroot-codex-plugin/tracing/0.1.0/dist/index.mjs\"", "timeout": 30, "statusMessage": "Finalizing Codex trace to TraceRoot" } ] } + ], + "SubagentStop": [ + { "hooks": [ { "type": "command", "command": "node \"${CODEX_HOME:-$HOME/.codex}/plugins/cache/traceroot-codex-plugin/tracing/0.1.0/dist/index.mjs\"", "timeout": 30, "statusMessage": "Streaming Codex subagent trace to TraceRoot" } ] } + ] + } +} diff --git a/plugins/tracing/src/config.ts b/plugins/tracing/src/config.ts new file mode 100644 index 0000000..8aa9b54 --- /dev/null +++ b/plugins/tracing/src/config.ts @@ -0,0 +1,67 @@ +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; + +export type Config = { + enabled: boolean; + apiKey?: string; + hostUrl: string; + environment?: string; + userId?: string; + maxChars: number; + debug: boolean; + failOnError: boolean; +}; + +async function readJson(file: string): Promise> { + try { + return JSON.parse(await fs.readFile(file, "utf-8")) as Record; + } catch { + return {}; + } +} + +function envFirst(...keys: string[]): string | undefined { + for (const k of keys) { + const v = process.env[k]; + if (v !== undefined && v !== "") return v; + } + return undefined; +} + +export async function getConfig(cwd: string = process.cwd()): Promise { + // Resolve CODEX_HOME at call time (not module load) so it always reflects the + // current env and is isolatable in tests. + const codexHome = process.env.CODEX_HOME ?? path.join(os.homedir(), ".codex"); + const globalJson = await readJson(path.join(codexHome, "traceroot.json")); + const projectJson = await readJson(path.join(cwd, ".codex", "traceroot.json")); + const j = { ...globalJson, ...projectJson }; + + const truthy = (v: unknown) => v === true || v === "true" || v === "1"; + + const enabledFlag = + envFirst("TRACE_TO_TRACEROOT") ?? (j.enabled !== undefined ? String(j.enabled) : undefined); + // Credential + upload destination come ONLY from env or the GLOBAL config + // (~/.codex/traceroot.json) — never the project-local .codex/traceroot.json. + // A checked-in project config that could set host_url/api_key would let a + // malicious repo redirect authenticated uploads (your env/global key) to an + // attacker endpoint. Project-local config may still set non-sensitive fields. + const apiKey = + envFirst("TRACEROOT_CODEX_API_KEY", "TRACEROOT_API_KEY") ?? (globalJson.api_key as string | undefined); + + const config: Config = { + apiKey, + hostUrl: + envFirst("TRACEROOT_CODEX_HOST_URL", "TRACEROOT_HOST_URL") ?? + (globalJson.host_url as string | undefined) ?? + "https://app.traceroot.ai", + environment: envFirst("TRACEROOT_ENVIRONMENT") ?? (j.environment as string | undefined), + userId: envFirst("TRACEROOT_CODEX_USER_ID") ?? (j.user_id as string | undefined), + maxChars: (n => Number.isFinite(n) ? n : 20000)(Number(envFirst("TRACEROOT_CODEX_MAX_CHARS") ?? j.max_chars ?? 20000)), + debug: truthy(envFirst("TRACEROOT_CODEX_DEBUG") ?? j.debug), + failOnError: truthy(envFirst("TRACEROOT_CODEX_FAIL_ON_ERROR") ?? j.fail_on_error), + enabled: false, + }; + config.enabled = truthy(enabledFlag) && Boolean(apiKey); + return config; +} diff --git a/plugins/tracing/src/emit.ts b/plugins/tracing/src/emit.ts new file mode 100644 index 0000000..e0c94cd --- /dev/null +++ b/plugins/tracing/src/emit.ts @@ -0,0 +1,154 @@ +import type { Config } from "./config.js"; +import { buildTracing as defaultBuildTracing, type Tracing } from "./exporter.js"; +import { getGitContext } from "./git.js"; +import { makeSpanId, makeTraceId } from "./ids.js"; +import { loadEmittedSpanIds, markSpanEmitted } from "./sidecar.js"; +import { emitSpan, planTurnSpans, type EmitCtx, type PlanOpts } from "./spans.js"; +import { locateSubagentRollout } from "./subagents.js"; +import { parseRollout, readRollout } from "./transcript.js"; +import type { HookInput, SessionMeta, Turn } from "./types.js"; +import { debugLog } from "./util.js"; + +// Paranoia guard only; the visited-set is the real recursion bound. +const STACK_GUARD = 32; + +export type Deps = { + buildTracing: (c: Config) => Tracing; + getGit: (cwd: string) => Promise<{ repo?: string; ref?: string }>; + /** + * Resolve a subagent's child rollout path by thread id. + * SHOULD be fail-soft (return undefined rather than throw), but dispatch does + * NOT assume it — the per-subagent resolve/read/parse is wrapped in try/catch. + */ + findSubagent: (threadId: string) => Promise; +}; + +/** Emit all complete, not-yet-seen spans for `turn` and recurse into its subagents. */ +async function emitTurnTree( + sessionMeta: SessionMeta, + turn: Turn, + ctx: EmitCtx, + opts: PlanOpts, + visited: Set, + depth: number, + tracing: Tracing, + already: Set, + emittedIds: string[], + findSubagent: Deps["findSubagent"], +): Promise { + let n = 0; + + for (const span of planTurnSpans(sessionMeta, turn, ctx, opts)) { + if (!span.complete) continue; + // The trace root (AGENT, no parent) is re-emitted on every hook so the trace + // is named "Codex Turn" from the first span (not the first LLM step's model + // name) and its end-time/output refine as the turn progresses (backend keeps + // the latest version of a span id). All other spans dedup via the sidecar. + const isTraceRoot = span.parentSpanId === null; + if (already.has(span.spanId) && !isTraceRoot) continue; + emitSpan(tracing, span); + emittedIds.push(span.spanId); + already.add(span.spanId); + n++; + } + + if (depth >= STACK_GUARD) { + debugLog(`subagent recursion hit STACK_GUARD at depth ${depth}; stopping`); + return n; + } + + // Determine the traceId and seed prefix that were used for this turn. + const parentSeed = opts.seedPrefix ?? ""; + const traceId = opts.traceId ?? makeTraceId(sessionMeta.sessionId, turn.turnId ?? ""); + + for (const sub of turn.subagents ?? []) { + if (!sub.spawnCallId) continue; + if (visited.has(sub.threadId)) continue; // cycle/diamond guard + // Mark BEFORE the try so a failing/cyclic thread is never retried this dispatch. + visited.add(sub.threadId); + + // Fail-open: a throwing resolver/read/parse must NEVER propagate out of dispatch + // (that would leave already-emitted parent spans un-marked → re-emit churn next hook). + // On any error we log and skip to the next subagent. + try { + const childPath = await findSubagent(sub.threadId); + debugLog(`subagent ${sub.threadId} spawnCall=${sub.spawnCallId}: childPath=${childPath ?? "NOT FOUND"}`); + if (!childPath) continue; // child rollout not on disk yet — try again next hook + + const childLines = await readRollout(childPath); + const child = parseRollout(childLines); + debugLog(`subagent ${sub.threadId}: parsed ${child.turns.length} turn(s), session=${child.sessionMeta.sessionId}`); + + const childOpts: PlanOpts = { + traceId, // SAME trace as parent + rootParentSpanId: makeSpanId(parentSeed + sub.spawnCallId), // nest under spawn TOOL span + seedPrefix: sub.threadId + ":", // unique, stable child span ids + }; + + for (const childTurn of child.turns) { + n += await emitTurnTree( + child.sessionMeta, childTurn, ctx, childOpts, visited, depth + 1, + tracing, already, emittedIds, findSubagent, + ); + } + } catch (err) { + debugLog(`subagent ${sub.threadId} resolve/read/parse failed; skipping: ${String(err)}`); + continue; + } + } + + return n; +} + +export async function dispatch( + hook: HookInput, config: Config, deps?: Partial, +): Promise<{ emitted: number }> { + const transcript = hook.transcript_path; + if (!transcript) { debugLog("no transcript_path; skipping"); return { emitted: 0 }; } + + const buildTracingFn = deps?.buildTracing ?? defaultBuildTracing; + const getGit = deps?.getGit ?? getGitContext; + const findSubagentFn = deps?.findSubagent ?? locateSubagentRollout; + + const lines = await readRollout(transcript); + const { sessionMeta, turns } = parseRollout(lines); + + // A subagent session is emitted NESTED under its parent's trace (via the + // parent's spawn_agent tool). Codex fires PostToolUse/Stop on the subagent + // session itself too; emitting here would duplicate it as a redundant + // standalone trace — skip, the parent owns it. (Note: the SubagentStop hook + // carries transcript_path = the PARENT session, so it does NOT hit this guard; + // it usefully re-walks the parent to nest the just-finished subagent live.) + if (sessionMeta.threadSource === "subagent" || sessionMeta.parentThreadId) { + debugLog(`subagent session ${sessionMeta.sessionId}; skipping standalone emit (nested under parent)`); + return { emitted: 0 }; + } + + const cwd = sessionMeta.cwd ?? hook.cwd ?? process.cwd(); + const git = await getGit(cwd).catch(() => ({})); + const ctx: EmitCtx = { environment: config.environment, userId: config.userId, git, maxChars: config.maxChars }; + + const already = await loadEmittedSpanIds(transcript); + const tracing = buildTracingFn(config); + let emitted = 0; + const emittedIds: string[] = []; + + // One visited set per dispatch so a thread referenced from multiple turns is emitted once. + const visited = new Set(); + + try { + for (const turn of turns) { + emitted += await emitTurnTree( + sessionMeta, turn, ctx, {}, visited, 0, + tracing, already, emittedIds, findSubagentFn, + ); + } + } finally { + await tracing.shutdown(); + } + for (const id of emittedIds) { + await markSpanEmitted(transcript, id); + } + debugLog(`emitted ${emitted} spans`); + return { emitted }; +} diff --git a/plugins/tracing/src/exporter.ts b/plugins/tracing/src/exporter.ts new file mode 100644 index 0000000..39f67dc --- /dev/null +++ b/plugins/tracing/src/exporter.ts @@ -0,0 +1,51 @@ +import type { Tracer } from "@opentelemetry/api"; +// Protobuf exporter (Content-Type: application/x-protobuf). The TraceRoot ingest +// endpoint /api/v1/public/traces accepts OTLP protobuf ONLY (it 415s JSON), and +// the traceroot-ts SDK uses this same proto exporter — keep them aligned. +import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto"; +import { + type SpanProcessor, BatchSpanProcessor, +} from "@opentelemetry/sdk-trace-base"; +import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node"; +import type { Config } from "./config.js"; +import { PrimedIdGenerator } from "./ids.js"; +import { SDK_NAME, SDK_VERSION } from "./sdk.js"; + +export type Tracing = { tracer: Tracer; idGen: PrimedIdGenerator; shutdown: () => Promise }; + +export function buildTracingWith(processor: SpanProcessor, idGen: PrimedIdGenerator): Tracing { + const provider = new NodeTracerProvider({ idGenerator: idGen, spanProcessors: [processor] }); + return { + tracer: provider.getTracer(SDK_NAME, SDK_VERSION), + idGen, + // Both needed: forceFlush drains pending spans, shutdown awaits in-flight + // OTLP HTTP delivery so this short-lived process delivers spans before exit. + shutdown: async () => { + await provider.forceFlush(); + await provider.shutdown(); + }, + }; +} + +export function buildTracing(config: Config): Tracing { + const exporter = new OTLPTraceExporter({ + url: `${config.hostUrl}/api/v1/public/traces`, + headers: { + Authorization: `Bearer ${config.apiKey ?? ""}`, + "x-traceroot-sdk-name": SDK_NAME, + "x-traceroot-sdk-version": SDK_VERSION, + }, + compression: "gzip" as never, + }); + // Batch (not Simple): a hook invocation can complete many spans at once (a turn + // with many tools, or a subagent's whole subtree). Simple sends one HTTP POST + // per span, and a burst loses the tail before this short-lived process exits. + // Batch coalesces them into few large OTLP POSTs that forceFlush ships reliably. + // Liveness is unchanged: each hook invocation still flushes its spans on shutdown. + const processor = new BatchSpanProcessor(exporter, { + maxQueueSize: 4096, + maxExportBatchSize: 1024, + scheduledDelayMillis: 30000, // won't auto-fire in a short hook; we forceFlush on shutdown + }); + return buildTracingWith(processor, new PrimedIdGenerator()); +} diff --git a/plugins/tracing/src/git.ts b/plugins/tracing/src/git.ts new file mode 100644 index 0000000..81e3526 --- /dev/null +++ b/plugins/tracing/src/git.ts @@ -0,0 +1,27 @@ +import { execFile } from "node:child_process"; +import { promisify } from "node:util"; + +const run = promisify(execFile); + +export function normalizeRepo(remote: string): string | undefined { + const m = remote.trim().match(/(?:github\.com[:/])([^/]+\/[^/]+?)(?:\.git)?$/i); + return m ? m[1] : undefined; +} + +export async function getGitContext(cwd: string): Promise<{ repo?: string; ref?: string }> { + const out: { repo?: string; ref?: string } = {}; + try { + const { stdout } = await run("git", ["remote", "get-url", "origin"], { cwd }); + out.repo = normalizeRepo(stdout); + } catch { + // no remote + } + try { + const { stdout } = await run("git", ["rev-parse", "HEAD"], { cwd }); + const ref = stdout.trim(); + if (/^[0-9a-f]{40}$/.test(ref)) out.ref = ref; + } catch { + // not a git repo + } + return out; +} diff --git a/plugins/tracing/src/ids.ts b/plugins/tracing/src/ids.ts new file mode 100644 index 0000000..5d0477d --- /dev/null +++ b/plugins/tracing/src/ids.ts @@ -0,0 +1,41 @@ +import { createHash, randomBytes } from "node:crypto"; + +function hashHex(input: string, bytes: number): string { + return createHash("sha256").update(input).digest("hex").slice(0, bytes * 2); +} + +/** 16-byte (32 hex) trace id, deterministic per (session, turn). */ +export function makeTraceId(sessionId: string, turnId: string): string { + const id = hashHex(`traceroot:codex:trace:${sessionId}:${turnId}`, 16); + return id === "0".repeat(32) ? "0".repeat(31) + "1" : id; +} + +/** 8-byte (16 hex) span id, deterministic per seed. */ +export function makeSpanId(seed: string): string { + const id = hashHex(`traceroot:codex:span:${seed}`, 8); + return id === "0".repeat(16) ? "0".repeat(15) + "1" : id; +} + +/** + * OTEL IdGenerator that returns a primed id for the very next call, then + * falls back to random. We prime it immediately before tracer.startSpan() so + * the new span gets our deterministic id (startSpan consumes the generator + * synchronously). Root spans consume both trace+span id; child spans inherit + * the trace id from the parent context and consume only the span id. + */ +export class PrimedIdGenerator { + nextTraceId?: string; + nextSpanId?: string; + + generateTraceId(): string { + const v = this.nextTraceId ?? randomBytes(16).toString("hex"); + this.nextTraceId = undefined; + return v; + } + + generateSpanId(): string { + const v = this.nextSpanId ?? randomBytes(8).toString("hex"); + this.nextSpanId = undefined; + return v; + } +} diff --git a/plugins/tracing/src/index.ts b/plugins/tracing/src/index.ts new file mode 100644 index 0000000..63a69e4 --- /dev/null +++ b/plugins/tracing/src/index.ts @@ -0,0 +1,47 @@ +import { getConfig } from "./config.js"; +import { dispatch } from "./emit.js"; +import type { HookInput } from "./types.js"; +import { debugLog, readStdin, setDebug } from "./util.js"; + +export async function runHook(): Promise { + let hook: HookInput; + try { + hook = await readStdin(); + } catch { + return; // no/invalid stdin — nothing to do + } + + const config = await getConfig(hook.cwd); + setDebug(config.debug); + + if (!config.enabled) { + debugLog("tracing disabled (set TRACE_TO_TRACEROOT=true and TRACEROOT_API_KEY)"); + return; + } + if (!hook.transcript_path) { + debugLog("hook payload missing transcript_path; skipping"); + return; + } + + try { + await dispatch(hook, config); + } catch (error) { + debugLog("dispatch failed:", error); + // Honor the RESOLVED config (env OR JSON), not just env vars — set the exit + // code here where config is known, then re-throw. The module-level handler + // below is only a last resort for errors that escape before config resolves. + if (config.failOnError) { + process.exitCode = 1; + throw error; + } + } +} + +// Self-invoke when executed as the bundled hook entry. By the time runHook +// rejects it has already applied resolved-config behavior (debug log + exit +// code); this is the backstop for the rare error thrown before getConfig — only +// env vars are available then. +runHook().catch((error) => { + if (process.env.TRACEROOT_CODEX_DEBUG === "true") console.error("[traceroot-codex] fatal:", error); + if (process.env.TRACEROOT_CODEX_FAIL_ON_ERROR === "true") process.exitCode = 1; +}); diff --git a/plugins/tracing/src/sdk.ts b/plugins/tracing/src/sdk.ts new file mode 100644 index 0000000..6cfbc25 --- /dev/null +++ b/plugins/tracing/src/sdk.ts @@ -0,0 +1,5 @@ +// Single source for the plugin's SDK identity. Used for the OTLP scope + +// request headers (exporter) and the traceroot.sdk.* span attributes (spans). +// Keep SDK_VERSION in sync with .codex-plugin/plugin.json + package.json. +export const SDK_NAME = "traceroot-codex-plugin"; +export const SDK_VERSION = "0.1.0"; diff --git a/plugins/tracing/src/sidecar.ts b/plugins/tracing/src/sidecar.ts new file mode 100644 index 0000000..670602e --- /dev/null +++ b/plugins/tracing/src/sidecar.ts @@ -0,0 +1,28 @@ +import * as fs from "node:fs/promises"; +import { debugLog } from "./util.js"; + +const suffix = ".traceroot"; + +export async function loadEmittedSpanIds(rolloutFile: string): Promise> { + try { + const data = await fs.readFile(`${rolloutFile}${suffix}`, "utf-8"); + return new Set(data.split("\n").filter(Boolean)); + } catch (error) { + // Fail-open: ENOENT is the normal first-run case; any other read failure + // (e.g. permissions) should also degrade to "nothing emitted yet" rather + // than abort emission. Duplicate emits are idempotent (deterministic ids + + // backend upsert), so proceeding is strictly safer than dropping the trace. + if ((error as NodeJS.ErrnoException).code !== "ENOENT") { + debugLog("sidecar read failed; assuming empty:", error); + } + return new Set(); + } +} + +export async function markSpanEmitted(rolloutFile: string, spanId: string): Promise { + try { + await fs.appendFile(`${rolloutFile}${suffix}`, `${spanId}\n`, "utf-8"); + } catch { + // Best-effort: a failed write only risks a duplicate emit next time. + } +} diff --git a/plugins/tracing/src/spans.ts b/plugins/tracing/src/spans.ts new file mode 100644 index 0000000..453e645 --- /dev/null +++ b/plugins/tracing/src/spans.ts @@ -0,0 +1,174 @@ +import { ROOT_CONTEXT, type SpanContext, SpanKind, TraceFlags, trace } from "@opentelemetry/api"; +import type { Tracing } from "./exporter.js"; +import { makeSpanId, makeTraceId } from "./ids.js"; +import { SDK_NAME, SDK_VERSION } from "./sdk.js"; +import { mapUsage } from "./tokens.js"; +import type { ModelStep, SessionMeta, ToolCall, Turn } from "./types.js"; +import { truncate } from "./util.js"; + +export type EmitCtx = { + environment?: string; + userId?: string; + git?: { repo?: string; ref?: string }; + maxChars: number; +}; + +export type EmittableSpan = { + spanId: string; + parentSpanId: string | null; + traceId: string; + kind: "AGENT" | "LLM" | "TOOL"; + name: string; + startTime: number; + endTime: number; + attributes: Record; + complete: boolean; +}; + +const str = (v: unknown, max: number): string => + truncate(typeof v === "string" ? v : JSON.stringify(v ?? ""), max); + +function commonTrace(attrs: Record, sessionMeta: SessionMeta, ctx: EmitCtx): void { + attrs["traceroot.sdk.name"] = SDK_NAME; + attrs["traceroot.sdk.version"] = SDK_VERSION; + // Child subagent spans intentionally carry the CHILD session id here (sessionMeta is + // the child's own SessionMeta). The trace still groups correctly because the backend + // keys a trace's session off the ROOT (parent) span, not the children. A future + // `overrideSessionId` field on PlanOpts would be the clean way to force the parent's + // session id onto child spans if grouping ever needs it — not implemented now. + attrs["traceroot.trace.session_id"] = sessionMeta.sessionId; + if (ctx.userId) attrs["traceroot.trace.user_id"] = ctx.userId; + if (ctx.environment) attrs["traceroot.environment"] = ctx.environment; +} + +export type PlanOpts = { + traceId?: string; + rootParentSpanId?: string | null; + seedPrefix?: string; +}; + +export function planTurnSpans(sessionMeta: SessionMeta, turn: Turn, ctx: EmitCtx, opts?: PlanOpts): EmittableSpan[] { + if (!turn.turnId) return []; + // When opts is undefined, seed="" so every id is byte-identical to the pre-opts baseline. + const seed = opts?.seedPrefix ?? ""; + const traceId = opts?.traceId ?? makeTraceId(sessionMeta.sessionId, turn.turnId); + const rootId = makeSpanId(seed + turn.turnId + ":root"); + const rootParentSpanId = opts?.rootParentSpanId !== undefined ? opts.rootParentSpanId : null; + const out: EmittableSpan[] = []; + + // Root AGENT span (trace-level attrs live here). + const rootAttrs: Record = { "traceroot.span.type": "AGENT" }; + commonTrace(rootAttrs, sessionMeta, ctx); + if (turn.userInput) rootAttrs["traceroot.span.input"] = str(turn.userInput, ctx.maxChars); + if (turn.finalOutput) rootAttrs["traceroot.span.output"] = str(turn.finalOutput, ctx.maxChars); + rootAttrs["traceroot.span.metadata"] = JSON.stringify(pruneUndefined({ + "codex.turn_id": turn.turnId, + "codex.thread_id": sessionMeta.sessionId, + "codex.model": turn.model, + "codex.model_provider": sessionMeta.modelProvider, + "codex.cli_version": sessionMeta.cliVersion, + "codex.tool_call_count": turn.steps.reduce((n, s) => n + s.toolCalls.length, 0), + })); + if (ctx.git?.repo) rootAttrs["traceroot.git.repo"] = ctx.git.repo; + if (ctx.git?.ref) rootAttrs["traceroot.git.ref"] = ctx.git.ref; + out.push({ + spanId: rootId, parentSpanId: rootParentSpanId, traceId, kind: "AGENT", + name: "Codex Turn", startTime: turn.startTime, endTime: turn.endTime, + attributes: rootAttrs, + // The trace root (no parent) is emittable immediately so the trace is named + // "Codex Turn" from the first live hook; emit.ts re-emits it to refine + // end/output. Subagent roots stay gated on completion. + complete: rootParentSpanId === null ? true : turn.completed, + }); + + // LLM-step input is the user prompt (first step) or the prior step's tool + // results fed back to the model (continuation steps) — like the conversation + // the model actually saw. + let prevToolResults: string | undefined; + for (const step of turn.steps) { + const stepId = makeSpanId(seed + turn.turnId + ":step:" + step.index); + const input = step.index === 0 ? turn.userInput : prevToolResults; + out.push(planStepSpan(sessionMeta, turn, step, stepId, rootId, traceId, ctx, input)); + for (const tc of step.toolCalls) out.push(planToolSpan(sessionMeta, tc, seed, stepId, traceId, ctx)); + if (step.toolCalls.length) { + prevToolResults = str(step.toolCalls.map((tc) => ({ name: tc.name, output: tc.output })), ctx.maxChars); + } + } + return out; +} + +function pruneUndefined(o: Record): Record { + const r: Record = {}; + for (const [k, v] of Object.entries(o)) if (v !== undefined && v !== null) r[k] = v; + return r; +} + +/** LLM-step output: text + reasoning + the tool calls the model requested. */ +function buildStepOutput(step: ModelStep, max: number): string | undefined { + const o: Record = {}; + if (step.text) o.content = step.text; + if (step.reasoning) o.reasoning = step.reasoning; + if (step.toolCalls.length) o.tool_calls = step.toolCalls.map((tc) => ({ name: tc.name, args: tc.args })); + if (Object.keys(o).length === 0) return undefined; + return truncate(JSON.stringify(o), max); +} + +function planStepSpan( + sessionMeta: SessionMeta, turn: Turn, step: ModelStep, + spanId: string, parentSpanId: string, traceId: string, ctx: EmitCtx, input: string | undefined, +): EmittableSpan { + const attrs: Record = { "traceroot.span.type": "LLM" }; + commonTrace(attrs, sessionMeta, ctx); + if (turn.model) attrs["traceroot.llm.model"] = turn.model; + if (input) attrs["traceroot.span.input"] = truncate(input, ctx.maxChars); + const output = buildStepOutput(step, ctx.maxChars); + if (output) attrs["traceroot.span.output"] = output; + attrs["traceroot.span.metadata"] = JSON.stringify({ "codex.step_index": step.index }); + Object.assign(attrs, mapUsage(step.usage)); + return { + spanId, parentSpanId, traceId, kind: "LLM", + name: turn.model ?? "model", startTime: step.startTime, endTime: step.endTime, + attributes: attrs, complete: Boolean(step.usage), + }; +} + +function planToolSpan( + sessionMeta: SessionMeta, tc: ToolCall, seed: string, parentSpanId: string, traceId: string, ctx: EmitCtx, +): EmittableSpan { + const attrs: Record = { "traceroot.span.type": "TOOL" }; + commonTrace(attrs, sessionMeta, ctx); + attrs["traceroot.span.input"] = str(tc.args, ctx.maxChars); + if (tc.output !== undefined) attrs["traceroot.span.output"] = str(tc.output, ctx.maxChars); + const meta: Record = {}; + if (tc.kind !== undefined) meta["tool_kind"] = tc.kind; + if (tc.status !== undefined) meta["status"] = tc.status; + if (tc.exitCode !== undefined) meta["exit_code"] = tc.exitCode; + if (tc.error !== undefined) meta["error"] = tc.error; + if (Object.keys(meta).length > 0) attrs["traceroot.span.metadata"] = JSON.stringify(meta); + return { + spanId: makeSpanId(seed + tc.callId), parentSpanId, traceId, kind: "TOOL", + name: tc.name, startTime: tc.startTime, endTime: tc.endTime ?? tc.startTime, + attributes: attrs, complete: tc.endTime !== undefined, + }; +} + +const KIND: Record = { + AGENT: SpanKind.INTERNAL, LLM: SpanKind.CLIENT, TOOL: SpanKind.INTERNAL, +}; + +export function emitSpan(tracing: Tracing, s: EmittableSpan): void { + let ctx = ROOT_CONTEXT; + if (s.parentSpanId) { + const parent: SpanContext = { + traceId: s.traceId, spanId: s.parentSpanId, traceFlags: TraceFlags.SAMPLED, isRemote: false, + }; + ctx = trace.setSpanContext(ROOT_CONTEXT, parent); + } else { + tracing.idGen.nextTraceId = s.traceId; + } + tracing.idGen.nextSpanId = s.spanId; + const span = tracing.tracer.startSpan( + s.name, { startTime: s.startTime, kind: KIND[s.kind], attributes: s.attributes }, ctx, + ); + span.end(s.endTime); +} diff --git a/plugins/tracing/src/subagents.ts b/plugins/tracing/src/subagents.ts new file mode 100644 index 0000000..67c561e --- /dev/null +++ b/plugins/tracing/src/subagents.ts @@ -0,0 +1,75 @@ +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; + +/** + * Walk the Codex sessions directory for a rollout file named + * `rollout--.jsonl`. Returns the first match or undefined. + * Fail-soft: returns undefined on any fs error. + * + * To bound cost we scan only the newest ~3 day-directories under + * sessions/YYYY/MM/DD rather than the full tree. + */ +export async function locateSubagentRollout( + threadId: string, + codexHome?: string, +): Promise { + try { + const home = codexHome ?? process.env["CODEX_HOME"] ?? path.join(os.homedir(), ".codex"); + const sessionsRoot = path.join(home, "sessions"); + + // Collect candidate day-directories: sessions/YYYY/MM/DD + const dayDirs = await collectRecentDayDirs(sessionsRoot, 3); + + for (const dayDir of dayDirs) { + const entries = await fs.readdir(dayDir).catch(() => [] as string[]); + for (const name of entries) { + if (name.endsWith(`-${threadId}.jsonl`)) { + return path.join(dayDir, name); + } + } + } + return undefined; + } catch { + return undefined; + } +} + +/** Return up to `max` most-recent day-level dirs under sessionsRoot/YYYY/MM/DD. */ +async function collectRecentDayDirs(sessionsRoot: string, max: number): Promise { + const result: string[] = []; + + let years: string[]; + try { + years = (await fs.readdir(sessionsRoot)).sort().reverse(); + } catch { + return result; + } + + for (const year of years) { + const yearDir = path.join(sessionsRoot, year); + let months: string[]; + try { + months = (await fs.readdir(yearDir)).sort().reverse(); + } catch { + continue; + } + + for (const month of months) { + const monthDir = path.join(yearDir, month); + let days: string[]; + try { + days = (await fs.readdir(monthDir)).sort().reverse(); + } catch { + continue; + } + + for (const day of days) { + result.push(path.join(monthDir, day)); + if (result.length >= max) return result; + } + } + } + + return result; +} diff --git a/plugins/tracing/src/tokens.ts b/plugins/tracing/src/tokens.ts new file mode 100644 index 0000000..2fb6eb3 --- /dev/null +++ b/plugins/tracing/src/tokens.ts @@ -0,0 +1,19 @@ +import type { TokenUsage } from "./types.js"; + +/** + * Map Codex `last_token_usage` to the backend's flat token attribute keys. + * Codex `input_tokens` is GROSS (includes cached); the backend subtracts + * cache_read to derive the uncached input bucket, so we pass it straight + * through. Codex exposes no cache-write concept, so that key is omitted. + */ +export function mapUsage(u: TokenUsage | undefined): Record { + const out: Record = {}; + if (!u) return out; + if (typeof u.input_tokens === "number") out["llm.token_count.prompt"] = u.input_tokens; + if (typeof u.output_tokens === "number") out["llm.token_count.completion"] = u.output_tokens; + if (typeof u.cached_input_tokens === "number") + out["llm.token_count.prompt_details.cache_read"] = u.cached_input_tokens; + if (typeof u.reasoning_output_tokens === "number") + out["llm.token_count.completion_details.reasoning"] = u.reasoning_output_tokens; + return out; +} diff --git a/plugins/tracing/src/transcript.ts b/plugins/tracing/src/transcript.ts new file mode 100644 index 0000000..d22287d --- /dev/null +++ b/plugins/tracing/src/transcript.ts @@ -0,0 +1,204 @@ +import * as fs from "node:fs/promises"; +import type { + EventMsgPayload, ModelStep, ResponseItem, RolloutLine, SessionMeta, SubagentRef, ToolCall, Turn, TurnContextPayload, +} from "./types.js"; + +export async function readRollout(file: string): Promise { + const raw = await fs.readFile(file, "utf-8"); + const lines: RolloutLine[] = []; + for (const ln of raw.split("\n")) { + const trimmed = ln.trim(); + if (!trimmed) continue; + try { + lines.push(JSON.parse(trimmed) as RolloutLine); + } catch { + // skip malformed line, keep going + } + } + return lines; +} + +const ms = (ts: string): number => Date.parse(ts); + +function toolKindFromEndEvent(eventType: string): string { + if (eventType === "exec_command_end") return "exec"; + if (eventType === "patch_apply_end") return "patch"; + if (eventType === "mcp_tool_call_end") return "mcp"; + if (eventType === "collab_agent_spawn_end") return "spawn"; + if (eventType === "custom_tool_call_end") return "custom"; + if (eventType === "web_search_end" || eventType === "tool_search_call_end") return "search"; + return "unknown"; +} + +function extractToolError(p: EventMsgPayload): string | undefined { + if (p.error != null || p.codex_error_info != null) { + return JSON.stringify(p.error ?? p.codex_error_info); + } + const parts = ([p.stdout, p.stderr] as Array).filter(Boolean) as string[]; + if (parts.length) return parts.join("\n"); + if (p.aggregated_output != null) return p.aggregated_output; + if (typeof p.exit_code === "number") return `Exit code: ${p.exit_code}`; + return undefined; +} + +function reasoningText(p: { summary?: unknown[]; content?: unknown }): string | undefined { + const parts: string[] = []; + for (const s of (p.summary ?? []) as Array<{ text?: string }>) if (s?.text) parts.push(s.text); + if (typeof p.content === "string") parts.push(p.content); + return parts.length ? parts.join("\n") : undefined; +} + +function messageText(content: unknown): string | undefined { + if (!Array.isArray(content)) return undefined; + const parts = (content as Array<{ text?: string }>) + .filter((c) => typeof c?.text === "string") + .map((c) => c.text as string); + return parts.length ? parts.join("") : undefined; +} + +/** Codex's spawn_agent tool returns {"agent_id":"","nickname":"..."}. */ +function parseSpawnAgentId(output: unknown): string | undefined { + let obj: unknown = output; + if (typeof output === "string") { + try { obj = JSON.parse(output); } catch { return undefined; } + } + const id = (obj as { agent_id?: unknown } | null)?.agent_id; + return typeof id === "string" && id ? id : undefined; +} + +export function parseRollout(lines: RolloutLine[]): { sessionMeta: SessionMeta; turns: Turn[] } { + let sessionMeta: SessionMeta = { sessionId: "" }; + const turns: Turn[] = []; + let turn: Turn | undefined; + let step: ModelStep | undefined; + const toolsByCallId = new Map(); + // call_ids of spawn_agent tool calls, so we can read the child thread id from + // the matching function_call_output ({"agent_id": "..."}). + const spawnAgentCallIds = new Set(); + + const ensureStep = (t: Turn, at: number): ModelStep => { + if (!step) { + step = { index: t.steps.length, startTime: at, endTime: at, toolCalls: [], reasoning: undefined, text: undefined }; + t.steps.push(step); + } + return step; + }; + + for (const line of lines) { + const at = ms(line.timestamp); + if (line.type === "session_meta") { + sessionMeta = { + sessionId: (line.payload as { id: string }).id, + cwd: (line.payload as { cwd?: string }).cwd, + cliVersion: (line.payload as { cli_version?: string }).cli_version, + modelProvider: (line.payload as { model_provider?: string }).model_provider ?? undefined, + threadSource: (line.payload as { thread_source?: string }).thread_source, + parentThreadId: (line.payload as { parent_thread_id?: string }).parent_thread_id, + }; + continue; + } + + if (line.type === "turn_context") { + const p = line.payload as TurnContextPayload; + if (turn && p.model) turn.model = p.model; + continue; + } + + if (line.type === "event_msg") { + const p = line.payload as EventMsgPayload; + switch (p.type) { + case "task_started": + turn = { + turnId: p.turn_id ?? undefined, startTime: at, endTime: at, + steps: [], subagents: [], completed: false, aborted: false, + }; + step = undefined; + toolsByCallId.clear(); + spawnAgentCallIds.clear(); + turns.push(turn); + break; + case "user_message": + if (turn && typeof p.message === "string") turn.userInput = p.message; + break; + case "token_count": + if (turn && p.info?.last_token_usage) { + const s = ensureStep(turn, at); + s.usage = p.info.last_token_usage; + s.endTime = at; + step = undefined; // close current step + } + break; + case "task_complete": + if (turn) { + turn.completed = true; + turn.endTime = at; + const lastText = [...turn.steps].reverse().find((s) => s.text)?.text; + turn.finalOutput = (p.last_agent_message ?? lastText) ?? undefined; + } + break; + default: + if (turn && typeof p.new_thread_id === "string") { + const ref: SubagentRef = { threadId: p.new_thread_id }; + if (typeof p.call_id === "string") ref.spawnCallId = p.call_id; + (turn.subagents ??= []).push(ref); + } + if (turn && p.type.endsWith("_end") && typeof p.call_id === "string") { + const tc = toolsByCallId.get(p.call_id); + if (tc) { + tc.kind = toolKindFromEndEvent(p.type); + if (typeof p.status === "string") tc.status = p.status; + if (typeof p.exit_code === "number") tc.exitCode = p.exit_code; + if (!tc.endTime) tc.endTime = at; + if (tc.output === undefined) tc.output = p.aggregated_output ?? p.stdout; + if (p.status === "failed" || p.status === "declined") tc.error = extractToolError(p); + } + } + } + continue; + } + + if (line.type === "response_item" && turn) { + const p = line.payload as ResponseItem; + if (p.type === "function_call_output" || p.type === "custom_tool_call_output") { + // Tool output can arrive after token_count closed the step; never open a new + // step for it — just attach to the toolCall recorded in its original step. + const tc = toolsByCallId.get(p.call_id); + if (tc) { tc.endTime = at; tc.output = p.output; } + // spawn_agent's output carries the child thread id: {"agent_id":"...."}. + // Record it (with the spawn tool's call_id) so the subagent's spans nest + // under this spawn_agent TOOL span, in the same trace. + if (turn && spawnAgentCallIds.has(p.call_id)) { + const threadId = parseSpawnAgentId(p.output); + if (threadId) (turn.subagents ??= []).push({ threadId, spawnCallId: p.call_id }); + } + continue; + } + const s = ensureStep(turn, at); + if (p.type === "reasoning") { + s.reasoning = reasoningText(p); + } else if (p.type === "message") { + if (p.role !== "developer" && p.role !== "user") s.text = messageText(p.content); + } else if (p.type === "function_call") { + let args: unknown = p.arguments; + try { args = JSON.parse(p.arguments); } catch { /* keep string */ } + const tc: ToolCall = { callId: p.call_id, name: p.name, args, startTime: at }; + s.toolCalls.push(tc); + toolsByCallId.set(p.call_id, tc); + // Codex multi-agent v1: spawn_agent launches a subagent; its child thread + // id arrives in the matching function_call_output. + if (p.name === "spawn_agent") spawnAgentCallIds.add(p.call_id); + } else if (p.type === "custom_tool_call") { + // Codex emits some tools (e.g. apply_patch) as custom_tool_call with the + // payload in `input` (often non-JSON text, e.g. a patch). Treat it as a tool. + let args: unknown = p.input; + try { args = JSON.parse(p.input); } catch { /* keep raw string */ } + const tc: ToolCall = { callId: p.call_id, name: p.name, args, startTime: at }; + s.toolCalls.push(tc); + toolsByCallId.set(p.call_id, tc); + } + continue; + } + } + + return { sessionMeta, turns }; +} diff --git a/plugins/tracing/src/types.ts b/plugins/tracing/src/types.ts new file mode 100644 index 0000000..df9b9be --- /dev/null +++ b/plugins/tracing/src/types.ts @@ -0,0 +1,133 @@ +// ---- Hook payload (stdin) ---- +export type HookInput = { + session_id?: string; + turn_id?: string | null; + transcript_path?: string; + hook_event_name?: string; + cwd?: string; +}; + +// ---- Rollout JSONL records ---- +export type SessionMetaPayload = { + id: string; + cwd?: string; + cli_version?: string; + model_provider?: string | null; + base_instructions?: { text: string } | null; + [key: string]: unknown; +}; + +export type MessageContentPart = { type: string; text?: string; [key: string]: unknown }; +export type ResponseItemMessage = { type: "message"; role: string; content: MessageContentPart[] }; +export type ResponseItemFunctionCall = { type: "function_call"; name: string; call_id: string; arguments: string }; +export type ResponseItemFunctionCallOutput = { type: "function_call_output"; call_id: string; output: unknown }; +export type ResponseItemCustomToolCall = { type: "custom_tool_call"; call_id: string; name: string; input: string }; +export type ResponseItemCustomToolCallOutput = { type: "custom_tool_call_output"; call_id: string; output: unknown }; +export type ResponseItemReasoning = { + type: "reasoning"; + summary?: unknown[]; + content?: unknown[] | string | null; + encrypted_content?: string | null; +}; +export type ResponseItemOther = { type: string; [key: string]: unknown }; +// NOTE: ResponseItem is a proper discriminated union of ONLY the literal-discriminant +// members so `if (p.type === "...")` narrows cleanly. ResponseItemOther is intentionally +// excluded (its `type: string` poisons narrowing). Unknown/other response_item types are +// still handled at runtime: the `as ResponseItem` cast + non-matching if-chain ignores them. +export type ResponseItem = + | ResponseItemMessage + | ResponseItemFunctionCall + | ResponseItemFunctionCallOutput + | ResponseItemCustomToolCall + | ResponseItemCustomToolCallOutput + | ResponseItemReasoning; + +export type TurnContextPayload = { turn_id?: string; cwd?: string; model?: string; [key: string]: unknown }; + +export type TokenUsage = { + input_tokens?: number; + output_tokens?: number; + total_tokens?: number; + cached_input_tokens?: number; + reasoning_output_tokens?: number; +}; + +export type EventMsgPayload = { + type: string; + turn_id?: string | null; + call_id?: string; + message?: string; + new_thread_id?: string | null; + started_at?: number; + completed_at?: number; + last_agent_message?: string | null; + info?: { total_token_usage?: TokenUsage; last_token_usage?: TokenUsage; model_context_window?: number } | null; + // *_end event fields + status?: string; + exit_code?: number; + stdout?: string; + stderr?: string; + aggregated_output?: string; + error?: unknown; + codex_error_info?: unknown; + [key: string]: unknown; +}; + +export type RolloutLine = + | { timestamp: string; type: "session_meta"; payload: SessionMetaPayload } + | { timestamp: string; type: "response_item"; payload: ResponseItem } + | { timestamp: string; type: "turn_context"; payload: TurnContextPayload } + | { timestamp: string; type: "event_msg"; payload: EventMsgPayload } + | { timestamp: string; type: string; payload: Record }; + +// ---- Parsed model ---- +export type ToolCall = { + callId: string; + name: string; + args: unknown; + startTime: number; + endTime?: number; + output?: unknown; + error?: string; + // enriched from *_end event_msg + kind?: string; + status?: string; + exitCode?: number; +}; + +export type ModelStep = { + index: number; + startTime: number; + endTime: number; + reasoning?: string; + text?: string; + toolCalls: ToolCall[]; + usage?: TokenUsage; +}; + +export type SubagentRef = { threadId: string; spawnCallId?: string }; + +export type Turn = { + turnId?: string; + startTime: number; + endTime: number; + model?: string; + userInput?: string; + finalOutput?: string; + steps: ModelStep[]; + /** Subagent spawns captured from spawn_agent / collab_agent_spawn_end. */ + subagents?: SubagentRef[]; + completed: boolean; + aborted: boolean; +}; + +export type SessionMeta = { + sessionId: string; + cwd?: string; + cliVersion?: string; + modelProvider?: string; + // "user" for a top-level session, "subagent" for a spawned child. A subagent + // session is emitted nested under its parent's trace, NOT as a standalone trace. + threadSource?: string; + parentThreadId?: string; +}; diff --git a/plugins/tracing/src/util.ts b/plugins/tracing/src/util.ts new file mode 100644 index 0000000..a495b3f --- /dev/null +++ b/plugins/tracing/src/util.ts @@ -0,0 +1,17 @@ +let DEBUG = false; +export function setDebug(b: boolean): void { DEBUG = b; } +export function debugLog(...args: unknown[]): void { + if (DEBUG) console.error("[traceroot-codex]", ...args); +} + +export async function readStdin(): Promise { + const chunks: Buffer[] = []; + for await (const c of process.stdin) chunks.push(c as Buffer); + const raw = Buffer.concat(chunks).toString("utf-8").trim(); + return JSON.parse(raw || "{}") as T; +} + +export function truncate(s: string, max: number): string { + if (s.length <= max) return s; + return `${s.slice(0, max)}…[truncated ${s.length - max} chars]`; +} diff --git a/plugins/tracing/test/config.test.ts b/plugins/tracing/test/config.test.ts new file mode 100644 index 0000000..469682c --- /dev/null +++ b/plugins/tracing/test/config.test.ts @@ -0,0 +1,79 @@ +import * as fs from "node:fs"; +import * as os from "node:os"; +import * as path from "node:path"; +import { afterEach, beforeEach, describe, expect, it } from "vitest"; +import { getConfig } from "../src/config.js"; + +const saved = { ...process.env }; +let tmpHome: string; +beforeEach(() => { + for (const k of Object.keys(process.env)) if (k.startsWith("TRACE")) delete process.env[k]; + // Isolate from the real ~/.codex/traceroot.json so the test doesn't read the + // developer's actual global config. + tmpHome = fs.mkdtempSync(path.join(os.tmpdir(), "tr-codexhome-")); + process.env.CODEX_HOME = tmpHome; +}); +afterEach(() => { + process.env = { ...saved }; + if (tmpHome) fs.rmSync(tmpHome, { recursive: true, force: true }); +}); + +describe("getConfig", () => { + it("disabled by default without keys", async () => { + const c = await getConfig(); + expect(c.enabled).toBe(false); + expect(c.hostUrl).toBe("https://app.traceroot.ai"); + expect(c.maxChars).toBe(20000); + }); + + it("enabled when TRACE_TO_TRACEROOT=true and key present", async () => { + process.env.TRACE_TO_TRACEROOT = "true"; + process.env.TRACEROOT_API_KEY = "tr-abc"; + const c = await getConfig(); + expect(c.enabled).toBe(true); + expect(c.apiKey).toBe("tr-abc"); + }); + + it("TRACEROOT_CODEX_* overrides plain TRACEROOT_*", async () => { + process.env.TRACE_TO_TRACEROOT = "true"; + process.env.TRACEROOT_API_KEY = "plain"; + process.env.TRACEROOT_CODEX_API_KEY = "codex"; + const c = await getConfig(); + expect(c.apiKey).toBe("codex"); + }); + + it("ignores host_url and api_key from project-local config (exfil guard)", async () => { + process.env.TRACE_TO_TRACEROOT = "true"; + // Global config provides the real key; host defaults. + fs.writeFileSync(path.join(tmpHome, "traceroot.json"), JSON.stringify({ api_key: "global-key" })); + // A malicious checked-in project config tries to redirect uploads + swap key. + const proj = fs.mkdtempSync(path.join(os.tmpdir(), "tr-proj-")); + fs.mkdirSync(path.join(proj, ".codex")); + fs.writeFileSync( + path.join(proj, ".codex", "traceroot.json"), + JSON.stringify({ host_url: "https://evil.example", api_key: "evil-key" }), + ); + try { + const c = await getConfig(proj); + expect(c.hostUrl).toBe("https://app.traceroot.ai"); // NOT the project's host + expect(c.apiKey).toBe("global-key"); // NOT the project's key + } finally { + fs.rmSync(proj, { recursive: true, force: true }); + } + }); + + it("still honors non-sensitive project-local config (environment)", async () => { + const proj = fs.mkdtempSync(path.join(os.tmpdir(), "tr-proj-")); + fs.mkdirSync(path.join(proj, ".codex")); + fs.writeFileSync( + path.join(proj, ".codex", "traceroot.json"), + JSON.stringify({ environment: "staging" }), + ); + try { + const c = await getConfig(proj); + expect(c.environment).toBe("staging"); + } finally { + fs.rmSync(proj, { recursive: true, force: true }); + } + }); +}); diff --git a/plugins/tracing/test/emit-subagent.test.ts b/plugins/tracing/test/emit-subagent.test.ts new file mode 100644 index 0000000..81e8572 --- /dev/null +++ b/plugins/tracing/test/emit-subagent.test.ts @@ -0,0 +1,178 @@ +/** + * Subagent tracing emission tests. + * These tests inject findSubagent so they never touch the real ~/.codex. + */ +import { InMemorySpanExporter, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base"; +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; +import { afterEach, describe, expect, it } from "vitest"; +import { buildTracingWith } from "../src/exporter.js"; +import { PrimedIdGenerator } from "../src/ids.js"; +import { makeSpanId, makeTraceId } from "../src/ids.js"; +import { dispatch } from "../src/emit.js"; +import type { Config } from "../src/config.js"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const fixturesDir = path.join(here, "fixtures"); + +const config: Config = { + enabled: true, apiKey: "tr-x", hostUrl: "http://x", maxChars: 20000, debug: false, failOnError: true, +}; + +let tmpDir: string; +afterEach(async () => { if (tmpDir) await fs.rm(tmpDir, { recursive: true, force: true }); }); + +/** Copy a fixture file to a fresh temp dir and return the temp path. */ +async function copyFixture(name: string): Promise { + tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-sa-")); + const dst = path.join(tmpDir, name); + await fs.copyFile(path.join(fixturesDir, name), dst); + return dst; +} + +/** Build a no-op-shutdown buildTracing that keeps spans in `mem`. */ +function makeTracingDeps(mem: InMemorySpanExporter) { + return { + buildTracing: () => ({ + ...buildTracingWith(new SimpleSpanProcessor(mem), new PrimedIdGenerator()), + shutdown: async () => {}, + }), + getGit: async () => ({}), + }; +} + +// ---- helpers to derive expected span ids ---- +const parentTraceId = makeTraceId("parent-sess", "parent-turn-1"); +const parentRootId = makeSpanId("parent-turn-1:root"); +const parentStepId = makeSpanId("parent-turn-1:step:0"); +const spawnToolId = makeSpanId("spawn-1"); // seed="" + callId="spawn-1" + +const childSeed = "child-thread-1:"; +const childRootId = makeSpanId(childSeed + "child-turn-1:root"); +const childStepId = makeSpanId(childSeed + "child-turn-1:step:0"); +const childExecId = makeSpanId(childSeed + "child-exec-1"); + +describe("dispatch with subagent", () => { + it("1. emits spans from both parent and child, all sharing one traceId", async () => { + const transcript = await copyFixture("rollout-with-subagent.jsonl"); + const childPath = path.join(fixturesDir, "rollout-child-thread-1.jsonl"); + const mem = new InMemorySpanExporter(); + + const r = await dispatch({ transcript_path: transcript }, config, { + ...makeTracingDeps(mem), + findSubagent: async (id) => id === "child-thread-1" ? childPath : undefined, + }); + + // 3 parent + 3 child = 6 spans total + expect(r.emitted).toBe(6); + const spans = mem.getFinishedSpans(); + expect(spans).toHaveLength(6); + + // All spans share the parent traceId + const allTraceIds = spans.map((s) => s.spanContext().traceId); + expect(allTraceIds.every((id) => id === parentTraceId)).toBe(true); + }); + + it("2. child root AGENT span is nested under the parent spawn TOOL span", async () => { + const transcript = await copyFixture("rollout-with-subagent.jsonl"); + const childPath = path.join(fixturesDir, "rollout-child-thread-1.jsonl"); + const mem = new InMemorySpanExporter(); + + await dispatch({ transcript_path: transcript }, config, { + ...makeTracingDeps(mem), + findSubagent: async (id) => id === "child-thread-1" ? childPath : undefined, + }); + + const spans = mem.getFinishedSpans(); + const childRoot = spans.find((s) => s.spanContext().spanId === childRootId); + expect(childRoot).toBeDefined(); + // parentSpanId of the child root = the spawn TOOL span id + expect(childRoot!.parentSpanContext?.spanId).toBe(spawnToolId); + }); + + it("3. child tool span (exec_command) exists in the same trace", async () => { + const transcript = await copyFixture("rollout-with-subagent.jsonl"); + const childPath = path.join(fixturesDir, "rollout-child-thread-1.jsonl"); + const mem = new InMemorySpanExporter(); + + await dispatch({ transcript_path: transcript }, config, { + ...makeTracingDeps(mem), + findSubagent: async (id) => id === "child-thread-1" ? childPath : undefined, + }); + + const spans = mem.getFinishedSpans(); + const childExec = spans.find((s) => s.spanContext().spanId === childExecId); + expect(childExec).toBeDefined(); + expect(childExec!.name).toBe("exec_command"); + expect(childExec!.spanContext().traceId).toBe(parentTraceId); + }); + + it("4. idempotency: second dispatch re-emits only the trace root", async () => { + const transcript = await copyFixture("rollout-with-subagent.jsonl"); + const childPath = path.join(fixturesDir, "rollout-child-thread-1.jsonl"); + const mem = new InMemorySpanExporter(); + const deps = { + ...makeTracingDeps(mem), + findSubagent: async (id: string) => id === "child-thread-1" ? childPath : undefined, + }; + + const r1 = await dispatch({ transcript_path: transcript }, config, deps); + expect(r1.emitted).toBe(6); + + const r2 = await dispatch({ transcript_path: transcript }, config, deps); + // Only the trace root re-emits (for live naming/refresh); every other span — + // including all subagent spans — dedups via the sidecar. + expect(r2.emitted).toBe(1); + }); + + it("5. cycle guard: child that re-spawns an already-visited thread terminates without duplicates", async () => { + // rollout-with-subagent spawns "child-thread-1" + // rollout-child-spawner (used for child-thread-1) itself spawns "child-thread-1" back → cycle + const transcript = await copyFixture("rollout-with-subagent.jsonl"); + const spawnerPath = path.join(fixturesDir, "rollout-child-spawner.jsonl"); + const mem = new InMemorySpanExporter(); + + // findSubagent returns the spawner child for any id — so the self-reference + // from child-spawner also resolves, but visited-set prevents re-entering. + const calls: string[] = []; + const r = await dispatch({ transcript_path: transcript }, config, { + ...makeTracingDeps(mem), + findSubagent: async (id) => { calls.push(id); return spawnerPath; }, + }); + + // Dispatch must complete (not loop) + expect(r.emitted).toBeGreaterThan(0); + + // "child-thread-1" must only be requested once (visited-set skips the second occurrence) + const childCalls = calls.filter((id) => id === "child-thread-1"); + expect(childCalls).toHaveLength(1); + + // Each span id must appear exactly once in the emitted set + const spanIds = mem.getFinishedSpans().map((s) => s.spanContext().spanId); + const uniqueIds = new Set(spanIds); + expect(spanIds).toHaveLength(uniqueIds.size); + }); + + it("6. fail-soft: a throwing findSubagent does not propagate; parent spans still emit", async () => { + const transcript = await copyFixture("rollout-with-subagent.jsonl"); + const mem = new InMemorySpanExporter(); + + // Resolver throws — dispatch must NOT propagate; parent spans must still flush. + const r = await dispatch({ transcript_path: transcript }, config, { + ...makeTracingDeps(mem), + findSubagent: async () => { throw new Error("resolver boom"); }, + }); + + // Only the 3 parent spans emitted (child resolution failed fail-soft). + expect(r.emitted).toBe(3); + const spans = mem.getFinishedSpans(); + const ids = spans.map((s) => s.spanContext().spanId); + expect(ids).toContain(parentRootId); + expect(ids).toContain(parentStepId); + expect(ids).toContain(spawnToolId); + // No child spans were emitted. + expect(ids).not.toContain(childRootId); + }); +}); diff --git a/plugins/tracing/test/emit.test.ts b/plugins/tracing/test/emit.test.ts new file mode 100644 index 0000000..13799e3 --- /dev/null +++ b/plugins/tracing/test/emit.test.ts @@ -0,0 +1,107 @@ +import { InMemorySpanExporter, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base"; +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; +import { afterEach, describe, expect, it } from "vitest"; +import { buildTracingWith } from "../src/exporter.js"; +import { PrimedIdGenerator } from "../src/ids.js"; +import { dispatch } from "../src/emit.js"; +import type { Config } from "../src/config.js"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const config: Config = { + enabled: true, apiKey: "tr-x", hostUrl: "http://x", maxChars: 20000, debug: false, failOnError: true, +}; + +let dir: string; +afterEach(async () => { if (dir) await fs.rm(dir, { recursive: true, force: true }); }); + +async function copyFixture(): Promise { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-emit-")); + const dst = path.join(dir, "rollout.jsonl"); + await fs.copyFile(path.join(here, "fixtures", "rollout-basic.jsonl"), dst); + return dst; +} + +describe("dispatch", () => { + it("emits AGENT+LLM+TOOL once, and is idempotent on a second run", async () => { + const transcript = await copyFixture(); + const mem = new InMemorySpanExporter(); + // dispatch() calls tracing.shutdown() internally, and provider.shutdown() + // clears InMemorySpanExporter. Override shutdown with a no-op so the + // exporter retains the spans for assertions (SimpleSpanProcessor already + // exported them on span.end()). + const deps = { + buildTracing: () => ({ + ...buildTracingWith(new SimpleSpanProcessor(mem), new PrimedIdGenerator()), + shutdown: async () => {}, + }), + getGit: async () => ({ repo: "traceroot-ai/traceroot", ref: "a".repeat(40) }), + }; + + const r1 = await dispatch({ transcript_path: transcript }, config, deps); + expect(r1.emitted).toBe(3); + expect(mem.getFinishedSpans()).toHaveLength(3); + + const r2 = await dispatch({ transcript_path: transcript }, config, deps); + // The trace root re-emits every dispatch (so the trace stays named "Codex + // Turn" with a refreshed end/output); the LLM+TOOL spans dedup via sidecar. + expect(r2.emitted).toBe(1); + }); + + it("live: trace root + completed tool/llm emit before the turn closes; root refreshes on completion", async () => { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-live-")); + const transcript = path.join(dir, "rollout.jsonl"); + await fs.copyFile(path.join(here, "fixtures", "rollout-inprogress.jsonl"), transcript); + + const mem = new InMemorySpanExporter(); + // no-op shutdown so the InMemory exporter keeps spans across dispatch() calls + // (dispatch calls provider.shutdown() internally, which would clear it). + const deps = { + buildTracing: () => ({ + ...buildTracingWith(new SimpleSpanProcessor(mem), new PrimedIdGenerator()), + shutdown: async () => {}, + }), + getGit: async () => ({}), + }; + + const r1 = await dispatch({ transcript_path: transcript }, config, deps); + // Trace root (named "Codex Turn") emits immediately for live naming, plus the + // already-complete LLM step and its TOOL — before the turn closes. + expect(r1.emitted).toBe(3); + expect(mem.getFinishedSpans().map((s) => s.attributes["traceroot.span.type"]).sort()) + .toEqual(["AGENT", "LLM", "TOOL"]); + + // Now the turn completes: append task_complete and re-run. The root re-emits + // (refreshed end + finalOutput); LLM/TOOL already emitted (sidecar dedup). + await fs.appendFile(transcript, + '{"timestamp":"2026-06-23T23:21:36.100Z","type":"event_msg","payload":{"type":"task_complete","turn_id":"turn-1","last_agent_message":"done","completed_at":1782256896}}\n'); + const r2 = await dispatch({ transcript_path: transcript }, config, deps); + expect(r2.emitted).toBe(1); // the AGENT root re-emitted + }); + + it("skips standalone emission for a subagent session (it nests under its parent)", async () => { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-sub-")); + const transcript = path.join(dir, "rollout.jsonl"); + // A subagent session: session_meta marks thread_source=subagent + parent_thread_id. + const lines = [ + '{"timestamp":"2026-06-30T00:00:00.000Z","type":"session_meta","payload":{"id":"child-1","thread_source":"subagent","parent_thread_id":"parent-1"}}', + '{"timestamp":"2026-06-30T00:00:01.000Z","type":"event_msg","payload":{"type":"task_started","turn_id":"ct1"}}', + '{"timestamp":"2026-06-30T00:00:02.000Z","type":"turn_context","payload":{"turn_id":"ct1","model":"gpt-5.5"}}', + '{"timestamp":"2026-06-30T00:00:03.000Z","type":"response_item","payload":{"type":"function_call","call_id":"x1","name":"exec_command","arguments":"{}"}}', + '{"timestamp":"2026-06-30T00:00:04.000Z","type":"response_item","payload":{"type":"function_call_output","call_id":"x1","output":"ok"}}', + '{"timestamp":"2026-06-30T00:00:05.000Z","type":"event_msg","payload":{"type":"token_count","info":{"last_token_usage":{"input_tokens":10,"output_tokens":1}}}}', + '{"timestamp":"2026-06-30T00:00:06.000Z","type":"event_msg","payload":{"type":"task_complete","turn_id":"ct1"}}', + ].join("\n"); + await fs.writeFile(transcript, lines); + const mem = new InMemorySpanExporter(); + const deps = { + buildTracing: () => ({ ...buildTracingWith(new SimpleSpanProcessor(mem), new PrimedIdGenerator()), shutdown: async () => {} }), + getGit: async () => ({}), + }; + const r = await dispatch({ transcript_path: transcript }, config, deps); + expect(r.emitted).toBe(0); // suppressed — parent owns the nesting + expect(mem.getFinishedSpans()).toHaveLength(0); + }); +}); diff --git a/plugins/tracing/test/exporter.test.ts b/plugins/tracing/test/exporter.test.ts new file mode 100644 index 0000000..50e8e11 --- /dev/null +++ b/plugins/tracing/test/exporter.test.ts @@ -0,0 +1,39 @@ +import { InMemorySpanExporter, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base"; +import { describe, expect, it } from "vitest"; +import { PrimedIdGenerator } from "../src/ids.js"; +import { buildTracingWith } from "../src/exporter.js"; + +describe("buildTracingWith", () => { + it("produces a tracer whose spans reach the processor's exporter", async () => { + const mem = new InMemorySpanExporter(); + const idGen = new PrimedIdGenerator(); + const { tracer, shutdown } = buildTracingWith(new SimpleSpanProcessor(mem), idGen); + + const span = tracer.startSpan("hello"); + span.end(); + + // With SimpleSpanProcessor the span is in the exporter right after end(); + // assert before shutdown() (shutdown clears InMemorySpanExporter's buffer). + const spans = mem.getFinishedSpans(); + expect(spans).toHaveLength(1); + expect(spans[0]!.name).toBe("hello"); + + await shutdown(); + }); + + it("uses primed deterministic ids", async () => { + const mem = new InMemorySpanExporter(); + const idGen = new PrimedIdGenerator(); + const { tracer, shutdown } = buildTracingWith(new SimpleSpanProcessor(mem), idGen); + + idGen.nextTraceId = "a".repeat(32); + idGen.nextSpanId = "b".repeat(16); + tracer.startSpan("root").end(); + + const s = mem.getFinishedSpans()[0]!; + expect(s.spanContext().traceId).toBe("a".repeat(32)); + expect(s.spanContext().spanId).toBe("b".repeat(16)); + + await shutdown(); + }); +}); diff --git a/plugins/tracing/test/fixtures/rollout-basic.jsonl b/plugins/tracing/test/fixtures/rollout-basic.jsonl new file mode 100644 index 0000000..d18e0e8 --- /dev/null +++ b/plugins/tracing/test/fixtures/rollout-basic.jsonl @@ -0,0 +1,10 @@ +{"timestamp":"2026-06-23T23:21:32.926Z","type":"session_meta","payload":{"id":"sess-abc","cwd":"/repo","cli_version":"0.140.0","model_provider":"openai"}} +{"timestamp":"2026-06-23T23:21:32.930Z","type":"event_msg","payload":{"type":"task_started","turn_id":"turn-1","started_at":1782256892}} +{"timestamp":"2026-06-23T23:21:33.000Z","type":"turn_context","payload":{"turn_id":"turn-1","cwd":"/repo","model":"gpt-5.5"}} +{"timestamp":"2026-06-23T23:21:33.100Z","type":"event_msg","payload":{"type":"user_message","message":"list the files"}} +{"timestamp":"2026-06-23T23:21:34.000Z","type":"response_item","payload":{"type":"reasoning","summary":[{"type":"summary_text","text":"I'll run ls."}]}} +{"timestamp":"2026-06-23T23:21:34.500Z","type":"response_item","payload":{"type":"function_call","name":"exec_command","call_id":"call-1","arguments":"{\"cmd\":\"ls\"}"}} +{"timestamp":"2026-06-23T23:21:35.000Z","type":"response_item","payload":{"type":"function_call_output","call_id":"call-1","output":"a.txt\nb.txt"}} +{"timestamp":"2026-06-23T23:21:36.000Z","type":"response_item","payload":{"type":"message","role":"assistant","content":[{"type":"output_text","text":"There are two files: a.txt and b.txt."}]}} +{"timestamp":"2026-06-23T23:21:36.050Z","type":"event_msg","payload":{"type":"token_count","info":{"last_token_usage":{"input_tokens":1200,"cached_input_tokens":1000,"output_tokens":40,"reasoning_output_tokens":10,"total_tokens":1240}}}} +{"timestamp":"2026-06-23T23:21:36.100Z","type":"event_msg","payload":{"type":"task_complete","turn_id":"turn-1","last_agent_message":"There are two files: a.txt and b.txt.","completed_at":1782256896}} diff --git a/plugins/tracing/test/fixtures/rollout-child-spawner.jsonl b/plugins/tracing/test/fixtures/rollout-child-spawner.jsonl new file mode 100644 index 0000000..debbc5d --- /dev/null +++ b/plugins/tracing/test/fixtures/rollout-child-spawner.jsonl @@ -0,0 +1,11 @@ +{"timestamp":"2026-06-30T00:01:00.000Z","type":"session_meta","payload":{"id":"child-spawner-sess","cwd":"/repo","cli_version":"0.140.0","model_provider":"openai"}} +{"timestamp":"2026-06-30T00:01:01.000Z","type":"event_msg","payload":{"type":"task_started","turn_id":"cs-turn-1","started_at":1782294061}} +{"timestamp":"2026-06-30T00:01:01.500Z","type":"turn_context","payload":{"turn_id":"cs-turn-1","model":"gpt-5.5"}} +{"timestamp":"2026-06-30T00:01:02.000Z","type":"event_msg","payload":{"type":"user_message","message":"do a task and re-spawn"}} +{"timestamp":"2026-06-30T00:01:03.000Z","type":"response_item","payload":{"type":"function_call","name":"spawn_agent","call_id":"cs-spawn-1","arguments":"{\"prompt\":\"cycle back\"}"}} +{"timestamp":"2026-06-30T00:01:04.000Z","type":"event_msg","payload":{"type":"collab_agent_spawn_end","call_id":"cs-spawn-1","new_thread_id":"child-thread-1","status":"completed"}} +{"timestamp":"2026-06-30T00:01:05.000Z","type":"response_item","payload":{"type":"function_call","name":"exec_command","call_id":"cs-exec-1","arguments":"{\"cmd\":\"ls\"}"}} +{"timestamp":"2026-06-30T00:01:06.000Z","type":"event_msg","payload":{"type":"exec_command_end","call_id":"cs-exec-1","status":"completed","exit_code":0,"stdout":"file.txt"}} +{"timestamp":"2026-06-30T00:01:07.000Z","type":"response_item","payload":{"type":"message","role":"assistant","content":[{"type":"output_text","text":"Done, cycled."}]}} +{"timestamp":"2026-06-30T00:01:08.000Z","type":"event_msg","payload":{"type":"token_count","info":{"last_token_usage":{"input_tokens":300,"output_tokens":25,"total_tokens":325}}}} +{"timestamp":"2026-06-30T00:01:09.000Z","type":"event_msg","payload":{"type":"task_complete","turn_id":"cs-turn-1","last_agent_message":"Done, cycled.","completed_at":1782294069}} diff --git a/plugins/tracing/test/fixtures/rollout-child-thread-1.jsonl b/plugins/tracing/test/fixtures/rollout-child-thread-1.jsonl new file mode 100644 index 0000000..9ad04dd --- /dev/null +++ b/plugins/tracing/test/fixtures/rollout-child-thread-1.jsonl @@ -0,0 +1,9 @@ +{"timestamp":"2026-06-30T00:00:10.000Z","type":"session_meta","payload":{"id":"child-sess","cwd":"/repo","cli_version":"0.140.0","model_provider":"openai"}} +{"timestamp":"2026-06-30T00:00:11.000Z","type":"event_msg","payload":{"type":"task_started","turn_id":"child-turn-1","started_at":1782294011}} +{"timestamp":"2026-06-30T00:00:11.500Z","type":"turn_context","payload":{"turn_id":"child-turn-1","model":"gpt-5.5"}} +{"timestamp":"2026-06-30T00:00:12.000Z","type":"event_msg","payload":{"type":"user_message","message":"do a task"}} +{"timestamp":"2026-06-30T00:00:13.000Z","type":"response_item","payload":{"type":"function_call","name":"exec_command","call_id":"child-exec-1","arguments":"{\"cmd\":\"ls\"}"}} +{"timestamp":"2026-06-30T00:00:14.000Z","type":"event_msg","payload":{"type":"exec_command_end","call_id":"child-exec-1","status":"completed","exit_code":0,"stdout":"file.txt"}} +{"timestamp":"2026-06-30T00:00:15.000Z","type":"response_item","payload":{"type":"message","role":"assistant","content":[{"type":"output_text","text":"Done."}]}} +{"timestamp":"2026-06-30T00:00:16.000Z","type":"event_msg","payload":{"type":"token_count","info":{"last_token_usage":{"input_tokens":200,"output_tokens":20,"total_tokens":220}}}} +{"timestamp":"2026-06-30T00:00:17.000Z","type":"event_msg","payload":{"type":"task_complete","turn_id":"child-turn-1","last_agent_message":"Done.","completed_at":1782294017}} diff --git a/plugins/tracing/test/fixtures/rollout-inprogress.jsonl b/plugins/tracing/test/fixtures/rollout-inprogress.jsonl new file mode 100644 index 0000000..e139a10 --- /dev/null +++ b/plugins/tracing/test/fixtures/rollout-inprogress.jsonl @@ -0,0 +1,9 @@ +{"timestamp":"2026-06-23T23:21:32.926Z","type":"session_meta","payload":{"id":"sess-abc","cwd":"/repo","cli_version":"0.140.0","model_provider":"openai"}} +{"timestamp":"2026-06-23T23:21:32.930Z","type":"event_msg","payload":{"type":"task_started","turn_id":"turn-1","started_at":1782256892}} +{"timestamp":"2026-06-23T23:21:33.000Z","type":"turn_context","payload":{"turn_id":"turn-1","cwd":"/repo","model":"gpt-5.5"}} +{"timestamp":"2026-06-23T23:21:33.100Z","type":"event_msg","payload":{"type":"user_message","message":"list the files"}} +{"timestamp":"2026-06-23T23:21:34.000Z","type":"response_item","payload":{"type":"reasoning","summary":[{"type":"summary_text","text":"I'll run ls."}]}} +{"timestamp":"2026-06-23T23:21:34.500Z","type":"response_item","payload":{"type":"function_call","name":"exec_command","call_id":"call-1","arguments":"{\"cmd\":\"ls\"}"}} +{"timestamp":"2026-06-23T23:21:35.000Z","type":"response_item","payload":{"type":"function_call_output","call_id":"call-1","output":"a.txt\nb.txt"}} +{"timestamp":"2026-06-23T23:21:36.000Z","type":"response_item","payload":{"type":"message","role":"assistant","content":[{"type":"output_text","text":"There are two files: a.txt and b.txt."}]}} +{"timestamp":"2026-06-23T23:21:36.050Z","type":"event_msg","payload":{"type":"token_count","info":{"last_token_usage":{"input_tokens":1200,"cached_input_tokens":1000,"output_tokens":40,"reasoning_output_tokens":10,"total_tokens":1240}}}} diff --git a/plugins/tracing/test/fixtures/rollout-tool-detail.jsonl b/plugins/tracing/test/fixtures/rollout-tool-detail.jsonl new file mode 100644 index 0000000..3050f07 --- /dev/null +++ b/plugins/tracing/test/fixtures/rollout-tool-detail.jsonl @@ -0,0 +1,11 @@ +{"timestamp":"2026-06-29T10:00:00.000Z","type":"session_meta","payload":{"id":"sess-tool-detail","cwd":"/repo","cli_version":"0.140.0"}} +{"timestamp":"2026-06-29T10:00:01.000Z","type":"event_msg","payload":{"type":"task_started","turn_id":"turn-td"}} +{"timestamp":"2026-06-29T10:00:02.000Z","type":"turn_context","payload":{"turn_id":"turn-td","model":"gpt-5.5"}} +{"timestamp":"2026-06-29T10:00:03.000Z","type":"event_msg","payload":{"type":"user_message","message":"run two commands"}} +{"timestamp":"2026-06-29T10:00:04.000Z","type":"response_item","payload":{"type":"function_call","name":"exec","call_id":"call-ok","arguments":"{\"cmd\":\"echo ok\"}"}} +{"timestamp":"2026-06-29T10:00:05.000Z","type":"event_msg","payload":{"type":"exec_command_end","call_id":"call-ok","status":"completed","exit_code":0,"stdout":"ok"}} +{"timestamp":"2026-06-29T10:00:06.000Z","type":"response_item","payload":{"type":"function_call","name":"exec","call_id":"call-fail","arguments":"{\"cmd\":\"false\"}"}} +{"timestamp":"2026-06-29T10:00:07.000Z","type":"event_msg","payload":{"type":"exec_command_end","call_id":"call-fail","status":"failed","exit_code":1,"stderr":"boom"}} +{"timestamp":"2026-06-29T10:00:08.000Z","type":"response_item","payload":{"type":"message","role":"assistant","content":[{"type":"output_text","text":"Done."}]}} +{"timestamp":"2026-06-29T10:00:09.000Z","type":"event_msg","payload":{"type":"token_count","info":{"last_token_usage":{"input_tokens":100,"output_tokens":10}}}} +{"timestamp":"2026-06-29T10:00:10.000Z","type":"event_msg","payload":{"type":"task_complete","turn_id":"turn-td","last_agent_message":"Done."}} diff --git a/plugins/tracing/test/fixtures/rollout-with-subagent.jsonl b/plugins/tracing/test/fixtures/rollout-with-subagent.jsonl new file mode 100644 index 0000000..e37f135 --- /dev/null +++ b/plugins/tracing/test/fixtures/rollout-with-subagent.jsonl @@ -0,0 +1,9 @@ +{"timestamp":"2026-06-30T00:00:00.000Z","type":"session_meta","payload":{"id":"parent-sess","cwd":"/repo","cli_version":"0.140.0","model_provider":"openai"}} +{"timestamp":"2026-06-30T00:00:01.000Z","type":"event_msg","payload":{"type":"task_started","turn_id":"parent-turn-1","started_at":1782294001}} +{"timestamp":"2026-06-30T00:00:01.500Z","type":"turn_context","payload":{"turn_id":"parent-turn-1","model":"gpt-5.5"}} +{"timestamp":"2026-06-30T00:00:02.000Z","type":"event_msg","payload":{"type":"user_message","message":"spawn a subagent"}} +{"timestamp":"2026-06-30T00:00:03.000Z","type":"response_item","payload":{"type":"function_call","name":"spawn_agent","call_id":"spawn-1","arguments":"{\"prompt\":\"do a task\"}"}} +{"timestamp":"2026-06-30T00:00:04.000Z","type":"event_msg","payload":{"type":"collab_agent_spawn_end","call_id":"spawn-1","new_thread_id":"child-thread-1","status":"completed"}} +{"timestamp":"2026-06-30T00:00:05.000Z","type":"response_item","payload":{"type":"message","role":"assistant","content":[{"type":"output_text","text":"Subagent finished."}]}} +{"timestamp":"2026-06-30T00:00:06.000Z","type":"event_msg","payload":{"type":"token_count","info":{"last_token_usage":{"input_tokens":500,"output_tokens":30,"total_tokens":530}}}} +{"timestamp":"2026-06-30T00:00:07.000Z","type":"event_msg","payload":{"type":"task_complete","turn_id":"parent-turn-1","last_agent_message":"Subagent finished.","completed_at":1782294007}} diff --git a/plugins/tracing/test/git.test.ts b/plugins/tracing/test/git.test.ts new file mode 100644 index 0000000..d0474c7 --- /dev/null +++ b/plugins/tracing/test/git.test.ts @@ -0,0 +1,36 @@ +import { execFileSync } from "node:child_process"; +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import { afterEach, describe, expect, it } from "vitest"; +import { getGitContext, normalizeRepo } from "../src/git.js"; + +let dir: string; +afterEach(async () => { if (dir) await fs.rm(dir, { recursive: true, force: true }); }); + +describe("normalizeRepo", () => { + it("normalizes ssh and https remotes to owner/repo", () => { + expect(normalizeRepo("git@github.com:traceroot-ai/traceroot.git")).toBe("traceroot-ai/traceroot"); + expect(normalizeRepo("https://github.com/traceroot-ai/traceroot.git")).toBe("traceroot-ai/traceroot"); + }); + it("returns undefined for junk", () => { + expect(normalizeRepo("not-a-url")).toBeUndefined(); + }); +}); + +describe("getGitContext", () => { + it("reads repo + ref from a real git dir", async () => { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-git-")); + execFileSync("git", ["init", "-q"], { cwd: dir }); + execFileSync("git", ["remote", "add", "origin", "https://github.com/traceroot-ai/traceroot.git"], { cwd: dir }); + execFileSync("git", ["-c", "user.email=t@t", "-c", "user.name=t", "commit", "--allow-empty", "-q", "-m", "x"], { cwd: dir }); + const ctx = await getGitContext(dir); + expect(ctx.repo).toBe("traceroot-ai/traceroot"); + expect(ctx.ref).toMatch(/^[0-9a-f]{40}$/); + }); + + it("returns empty for a non-git dir", async () => { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-nogit-")); + expect(await getGitContext(dir)).toEqual({}); + }); +}); diff --git a/plugins/tracing/test/ids.test.ts b/plugins/tracing/test/ids.test.ts new file mode 100644 index 0000000..94b17ea --- /dev/null +++ b/plugins/tracing/test/ids.test.ts @@ -0,0 +1,29 @@ +import { describe, expect, it } from "vitest"; +import { PrimedIdGenerator, makeSpanId, makeTraceId } from "../src/ids.js"; + +describe("ids", () => { + it("trace id is 32 hex chars and deterministic", () => { + const a = makeTraceId("sess", "turn"); + expect(a).toMatch(/^[0-9a-f]{32}$/); + expect(a).toBe(makeTraceId("sess", "turn")); + expect(a).not.toBe(makeTraceId("sess", "turn2")); + }); + + it("span id is 16 hex chars, deterministic, never all-zero", () => { + const a = makeSpanId("call_1"); + expect(a).toMatch(/^[0-9a-f]{16}$/); + expect(a).toBe(makeSpanId("call_1")); + expect(a).not.toBe(makeSpanId("call_2")); + }); + + it("PrimedIdGenerator returns primed values then falls back to random", () => { + const g = new PrimedIdGenerator(); + g.nextTraceId = "a".repeat(32); + g.nextSpanId = "b".repeat(16); + expect(g.generateTraceId()).toBe("a".repeat(32)); + expect(g.generateSpanId()).toBe("b".repeat(16)); + // After consumption, returns fresh random ids of valid length. + expect(g.generateTraceId()).toMatch(/^[0-9a-f]{32}$/); + expect(g.generateSpanId()).toMatch(/^[0-9a-f]{16}$/); + }); +}); diff --git a/plugins/tracing/test/index.test.ts b/plugins/tracing/test/index.test.ts new file mode 100644 index 0000000..edbfccf --- /dev/null +++ b/plugins/tracing/test/index.test.ts @@ -0,0 +1,99 @@ +import { beforeEach, describe, expect, it, vi } from "vitest"; +import type { Config } from "../src/config.js"; + +// Hoisted mocks with benign DISABLED defaults so the module-load self-invoke +// (`runHook().catch(...)` at the bottom of src/index.ts) lands on the +// !enabled early-return path and never produces an unhandled rejection. +const mocks = vi.hoisted(() => ({ + readStdinMock: vi.fn(async () => ({}) as Record), + getConfigMock: vi.fn(async () => ({ enabled: false, debug: false, failOnError: false }) as Config), + dispatchMock: vi.fn(async () => ({ emitted: 0 })), +})); + +vi.mock("../src/util.js", async (orig) => { + const actual = await orig(); + return { ...actual, readStdin: mocks.readStdinMock }; +}); +vi.mock("../src/config.js", () => ({ getConfig: mocks.getConfigMock })); +vi.mock("../src/emit.js", () => ({ dispatch: mocks.dispatchMock })); + +// Import once. The self-invoke runs here with the disabled defaults above. +const { runHook } = await import("../src/index.js"); + +const baseConfig: Config = { + enabled: false, + hostUrl: "https://app.traceroot.ai", + maxChars: 20000, + debug: false, + failOnError: false, +}; +const disabledConfig: Config = { ...baseConfig, enabled: false }; +const enabledConfig: Config = { ...baseConfig, enabled: true }; + +beforeEach(() => { + // Reset call history AND implementations, then restore benign defaults so + // each case starts from a known disabled state with no cross-test bleed. + mocks.readStdinMock.mockReset().mockResolvedValue({}); + mocks.getConfigMock.mockReset().mockResolvedValue(disabledConfig); + mocks.dispatchMock.mockReset().mockResolvedValue({ emitted: 0 }); +}); + +describe("runHook", () => { + it("returns without throwing when disabled", async () => { + await expect(runHook()).resolves.toBeUndefined(); + }); + + it("does NOT call dispatch when tracing is disabled", async () => { + mocks.getConfigMock.mockResolvedValue(disabledConfig); + await runHook(); + expect(mocks.dispatchMock).not.toHaveBeenCalled(); + }); + + it("calls dispatch once when enabled and transcript_path is present", async () => { + mocks.readStdinMock.mockResolvedValue({ transcript_path: "/x/rollout.jsonl" }); + mocks.getConfigMock.mockResolvedValue(enabledConfig); + await runHook(); + expect(mocks.dispatchMock).toHaveBeenCalledTimes(1); + }); + + it("does NOT call dispatch when enabled but transcript_path is missing", async () => { + mocks.readStdinMock.mockResolvedValue({}); + mocks.getConfigMock.mockResolvedValue(enabledConfig); + await runHook(); + expect(mocks.dispatchMock).not.toHaveBeenCalled(); + }); + + // GLOBAL CONSTRAINT: fail-open. A dispatch error must never escape runHook + // (it would otherwise break the Codex turn). + it("swallows dispatch errors when failOnError is false (fail-open)", async () => { + mocks.readStdinMock.mockResolvedValue({ transcript_path: "/x/rollout.jsonl" }); + mocks.getConfigMock.mockResolvedValue({ ...enabledConfig, failOnError: false }); + mocks.dispatchMock.mockRejectedValue(new Error("boom")); + await expect(runHook()).resolves.toBeUndefined(); + expect(mocks.dispatchMock).toHaveBeenCalledTimes(1); + }); + + it("re-throws dispatch errors when failOnError is true", async () => { + mocks.readStdinMock.mockResolvedValue({ transcript_path: "/x/rollout.jsonl" }); + mocks.getConfigMock.mockResolvedValue({ ...enabledConfig, failOnError: true }); + mocks.dispatchMock.mockRejectedValue(new Error("boom")); + await expect(runHook()).rejects.toThrow("boom"); + }); + + // failOnError resolved from JSON config (not an env var) must still set the + // exit code — the fix is that runHook honors resolved config directly rather + // than the module-level handler re-deriving it from process.env. + it("sets process.exitCode=1 from resolved config, not just env vars", async () => { + const prev = process.exitCode; + process.exitCode = 0; + try { + mocks.readStdinMock.mockResolvedValue({ transcript_path: "/x/rollout.jsonl" }); + mocks.getConfigMock.mockResolvedValue({ ...enabledConfig, failOnError: true }); + mocks.dispatchMock.mockRejectedValue(new Error("boom")); + await expect(runHook()).rejects.toThrow("boom"); + expect(process.exitCode).toBe(1); + } finally { + process.exitCode = prev; + } + }); +}); diff --git a/plugins/tracing/test/manifest.test.ts b/plugins/tracing/test/manifest.test.ts new file mode 100644 index 0000000..488a949 --- /dev/null +++ b/plugins/tracing/test/manifest.test.ts @@ -0,0 +1,24 @@ +import * as fs from "node:fs/promises"; +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; +import { describe, expect, it } from "vitest"; + +const root = path.join(path.dirname(fileURLToPath(import.meta.url)), ".."); + +describe("plugin manifest", () => { + it("plugin.json references hooks file and has name/version", async () => { + const m = JSON.parse(await fs.readFile(path.join(root, ".codex-plugin", "plugin.json"), "utf-8")); + expect(m.name).toBe("tracing"); + expect(m.version).toBe("0.1.0"); + expect(m.hooks).toBe("./hooks/hooks.json"); + }); + + it("hooks.json registers PostToolUse, Stop, SubagentStop pointing at dist bundle", async () => { + const h = JSON.parse(await fs.readFile(path.join(root, "hooks", "hooks.json"), "utf-8")); + for (const ev of ["PostToolUse", "Stop", "SubagentStop"]) { + expect(h.hooks[ev]).toBeDefined(); + const cmd = h.hooks[ev][0].hooks[0].command; + expect(cmd).toContain("dist/index.mjs"); + } + }); +}); diff --git a/plugins/tracing/test/sidecar.test.ts b/plugins/tracing/test/sidecar.test.ts new file mode 100644 index 0000000..16668f3 --- /dev/null +++ b/plugins/tracing/test/sidecar.test.ts @@ -0,0 +1,38 @@ +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import { afterEach, describe, expect, it } from "vitest"; +import { loadEmittedSpanIds, markSpanEmitted } from "../src/sidecar.js"; + +let dir: string; +afterEach(async () => { if (dir) await fs.rm(dir, { recursive: true, force: true }); }); + +describe("sidecar", () => { + it("returns empty set when no sidecar file", async () => { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-")); + const f = path.join(dir, "rollout.jsonl"); + expect((await loadEmittedSpanIds(f)).size).toBe(0); + }); + + it("round-trips emitted ids", async () => { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-")); + const f = path.join(dir, "rollout.jsonl"); + await markSpanEmitted(f, "span-a"); + await markSpanEmitted(f, "span-b"); + const ids = await loadEmittedSpanIds(f); + expect(ids.has("span-a")).toBe(true); + expect(ids.has("span-b")).toBe(true); + expect(ids.size).toBe(2); + }); + + it("fails open (empty set) on a non-ENOENT read error", async () => { + dir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-")); + const f = path.join(dir, "rollout.jsonl"); + // Make the sidecar path a directory so readFile throws EISDIR (not ENOENT). + // The whole plugin is fail-open: an unreadable sidecar must degrade to + // "nothing emitted yet", never abort emission. + await fs.mkdir(`${f}.traceroot`); + const ids = await loadEmittedSpanIds(f); + expect(ids.size).toBe(0); + }); +}); diff --git a/plugins/tracing/test/smoke.test.ts b/plugins/tracing/test/smoke.test.ts new file mode 100644 index 0000000..a754849 --- /dev/null +++ b/plugins/tracing/test/smoke.test.ts @@ -0,0 +1,8 @@ +import { describe, expect, it } from "vitest"; +import { runHook } from "../src/index.js"; + +describe("scaffold", () => { + it("exports runHook", () => { + expect(typeof runHook).toBe("function"); + }); +}); diff --git a/plugins/tracing/test/spans-opts.test.ts b/plugins/tracing/test/spans-opts.test.ts new file mode 100644 index 0000000..920c72f --- /dev/null +++ b/plugins/tracing/test/spans-opts.test.ts @@ -0,0 +1,90 @@ +/** + * Tests for planTurnSpans with PlanOpts — proves the behavior-preserving refactor + * (opts=undefined gives byte-identical ids) and the subagent-under-parent embedding. + */ +import { describe, expect, it } from "vitest"; +import { planTurnSpans } from "../src/spans.js"; +import { makeSpanId, makeTraceId } from "../src/ids.js"; +import type { SessionMeta, Turn } from "../src/types.js"; + +const sessionMeta: SessionMeta = { sessionId: "sess-opts" }; +const turn: Turn = { + turnId: "opts-turn-1", startTime: 2000, endTime: 5000, model: "gpt-5.5", + userInput: "hello", finalOutput: "world", completed: true, aborted: false, + steps: [{ + index: 0, startTime: 2500, endTime: 4000, + text: "world", + usage: { input_tokens: 100, output_tokens: 20 }, + toolCalls: [{ callId: "tc-1", name: "exec", args: {}, startTime: 2600, endTime: 3800, output: "ok" }], + }], +}; +const ctx = { maxChars: 20000 }; + +describe("planTurnSpans — opts=undefined is byte-identical to no-opts baseline", () => { + it("ids match when opts is undefined vs not passed", () => { + const withoutOpts = planTurnSpans(sessionMeta, turn, ctx); + const withUndefined = planTurnSpans(sessionMeta, turn, ctx, undefined); + // Every span id and traceId must be identical + expect(withUndefined.map((s) => s.spanId)).toEqual(withoutOpts.map((s) => s.spanId)); + expect(withUndefined.map((s) => s.traceId)).toEqual(withoutOpts.map((s) => s.traceId)); + expect(withUndefined.map((s) => s.parentSpanId)).toEqual(withoutOpts.map((s) => s.parentSpanId)); + }); + + it("root uses makeTraceId(sessionId, turnId) when no opts", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx); + const expected = makeTraceId("sess-opts", "opts-turn-1"); + expect(spans.every((s) => s.traceId === expected)).toBe(true); + }); + + it("root spanId equals makeSpanId(turnId+:root) when no opts", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx); + const root = spans.find((s) => s.kind === "AGENT")!; + expect(root.spanId).toBe(makeSpanId("opts-turn-1:root")); + expect(root.parentSpanId).toBeNull(); + }); + + it("tool spanId equals makeSpanId(callId) when no opts", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx); + const tool = spans.find((s) => s.kind === "TOOL")!; + expect(tool.spanId).toBe(makeSpanId("tc-1")); + }); +}); + +describe("planTurnSpans — opts inject traceId, rootParentSpanId, seedPrefix", () => { + const injectedTraceId = "a".repeat(32); + const injectedParent = "b".repeat(16); + const seed = "child-thread-x:"; + const opts = { traceId: injectedTraceId, rootParentSpanId: injectedParent, seedPrefix: seed }; + + it("all spans share the injected traceId", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx, opts); + expect(spans.every((s) => s.traceId === injectedTraceId)).toBe(true); + }); + + it("root span uses the injected parentSpanId", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx, opts); + const root = spans.find((s) => s.kind === "AGENT")!; + expect(root.parentSpanId).toBe(injectedParent); + }); + + it("root spanId is prefixed with seedPrefix", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx, opts); + const root = spans.find((s) => s.kind === "AGENT")!; + expect(root.spanId).toBe(makeSpanId(seed + "opts-turn-1:root")); + // must differ from the un-prefixed version + expect(root.spanId).not.toBe(makeSpanId("opts-turn-1:root")); + }); + + it("tool spanId is prefixed with seedPrefix", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx, opts); + const tool = spans.find((s) => s.kind === "TOOL")!; + expect(tool.spanId).toBe(makeSpanId(seed + "tc-1")); + expect(tool.spanId).not.toBe(makeSpanId("tc-1")); + }); + + it("rootParentSpanId=null keeps root parentSpanId null", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx, { rootParentSpanId: null }); + const root = spans.find((s) => s.kind === "AGENT")!; + expect(root.parentSpanId).toBeNull(); + }); +}); diff --git a/plugins/tracing/test/spans.test.ts b/plugins/tracing/test/spans.test.ts new file mode 100644 index 0000000..f875e33 --- /dev/null +++ b/plugins/tracing/test/spans.test.ts @@ -0,0 +1,127 @@ +import { describe, expect, it } from "vitest"; +import { planTurnSpans } from "../src/spans.js"; +import { makeSpanId, makeTraceId } from "../src/ids.js"; +import type { SessionMeta, ToolCall, Turn } from "../src/types.js"; + +const sessionMeta: SessionMeta = { sessionId: "sess-abc" }; +const turn: Turn = { + turnId: "turn-1", startTime: 1000, endTime: 4000, model: "gpt-5.5", + userInput: "list the files", finalOutput: "two files", completed: true, aborted: false, + steps: [{ + index: 0, startTime: 1500, endTime: 3200, + text: "two files", reasoning: "ls", + usage: { input_tokens: 1200, cached_input_tokens: 1000, output_tokens: 40, reasoning_output_tokens: 10 }, + toolCalls: [{ callId: "call-1", name: "exec_command", args: { cmd: "ls" }, startTime: 1800, endTime: 2600, output: "a.txt" }], + }], +}; +const ctx = { environment: "production", git: { repo: "traceroot-ai/traceroot", ref: "a".repeat(40) }, maxChars: 20000 }; + +describe("planTurnSpans", () => { + const spans = planTurnSpans(sessionMeta, turn, ctx); + const byKind = (k: string) => spans.filter((s) => s.kind === k); + + it("emits AGENT + LLM + TOOL with the right tree", () => { + const traceId = makeTraceId("sess-abc", "turn-1"); + expect(spans.every((s) => s.traceId === traceId)).toBe(true); + + const root = byKind("AGENT")[0]!; + expect(root.spanId).toBe(makeSpanId("turn-1:root")); + expect(root.parentSpanId).toBeNull(); + + const llm = byKind("LLM")[0]!; + expect(llm.parentSpanId).toBe(root.spanId); + expect(llm.spanId).toBe(makeSpanId("turn-1:step:0")); + + const tool = byKind("TOOL")[0]!; + expect(tool.parentSpanId).toBe(llm.spanId); + expect(tool.spanId).toBe(makeSpanId("call-1")); + }); + + it("LLM span carries model + token attrs so the backend can cost it", () => { + const llm = byKind("LLM")[0]!; + expect(llm.attributes["traceroot.span.type"]).toBe("LLM"); + expect(llm.attributes["traceroot.llm.model"]).toBe("gpt-5.5"); + expect(llm.attributes["llm.token_count.prompt"]).toBe(1200); + expect(llm.attributes["llm.token_count.completion"]).toBe(40); + expect(llm.attributes["llm.token_count.prompt_details.cache_read"]).toBe(1000); + }); + + it("LLM span carries input + rich output (content/reasoning/tool_calls), never empty", () => { + const llm = byKind("LLM")[0]!; + // first step input = the user prompt + expect(llm.attributes["traceroot.span.input"]).toBe("list the files"); + const output = JSON.parse(String(llm.attributes["traceroot.span.output"])); + expect(output.content).toBe("two files"); + expect(output.reasoning).toBe("ls"); + expect(output.tool_calls).toEqual([{ name: "exec_command", args: { cmd: "ls" } }]); + expect(JSON.parse(String(llm.attributes["traceroot.span.metadata"]))["codex.step_index"]).toBe(0); + }); + + it("root carries session id + git on root, session id on every span", () => { + const root = byKind("AGENT")[0]!; + expect(root.attributes["traceroot.trace.session_id"]).toBe("sess-abc"); + expect(root.attributes["traceroot.git.repo"]).toBe("traceroot-ai/traceroot"); + expect(root.attributes["traceroot.span.input"]).toBe("list the files"); + expect(spans.every((s) => s.attributes["traceroot.trace.session_id"] === "sess-abc")).toBe(true); + }); + + it("tool span carries name + io + type", () => { + const tool = byKind("TOOL")[0]!; + expect(tool.name).toBe("exec_command"); + expect(tool.attributes["traceroot.span.type"]).toBe("TOOL"); + expect(String(tool.attributes["traceroot.span.output"])).toContain("a.txt"); + expect(tool.complete).toBe(true); + }); +}); + +describe("planToolSpan enriched metadata", () => { + it("emits traceroot.span.metadata with tool_kind, status, exit_code and error for a failed tool call", () => { + const enrichedTurn: Turn = { + ...turn, + steps: [{ + ...turn.steps[0]!, + toolCalls: [{ + callId: "call-fail", + name: "exec", + args: { cmd: "false" }, + startTime: 1800, + endTime: 2000, + kind: "exec", + status: "failed", + exitCode: 1, + error: "boom", + } satisfies ToolCall], + }], + }; + const spans = planTurnSpans(sessionMeta, enrichedTurn, ctx); + const tool = spans.find((s) => s.kind === "TOOL")!; + expect(tool).toBeDefined(); + const rawMeta = tool.attributes["traceroot.span.metadata"]; + expect(rawMeta).toBeDefined(); + const meta = JSON.parse(rawMeta as string) as Record; + expect(meta["tool_kind"]).toBe("exec"); + expect(meta["status"]).toBe("failed"); + expect(meta["exit_code"]).toBe(1); + expect(String(meta["error"])).toContain("boom"); + }); +}); + +import { InMemorySpanExporter, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base"; +import { PrimedIdGenerator } from "../src/ids.js"; +import { buildTracingWith } from "../src/exporter.js"; +import { emitSpan } from "../src/spans.js"; + +describe("emitSpan", () => { + it("emits a child whose parentSpanId matches the planned parent, before the parent exists", async () => { + const mem = new InMemorySpanExporter(); + const tracing = buildTracingWith(new SimpleSpanProcessor(mem), new PrimedIdGenerator()); + const spans = planTurnSpans(sessionMeta, turn, ctx); + const tool = spans.find((s) => s.kind === "TOOL")!; + emitSpan(tracing, tool); // child emitted with no parent span object in-process + const got = mem.getFinishedSpans()[0]!; // read before shutdown clears the exporter + expect(got.spanContext().spanId).toBe(tool.spanId); + expect(got.spanContext().traceId).toBe(tool.traceId); + expect(got.parentSpanContext?.spanId).toBe(tool.parentSpanId); + await tracing.shutdown(); + }); +}); diff --git a/plugins/tracing/test/subagents.test.ts b/plugins/tracing/test/subagents.test.ts new file mode 100644 index 0000000..1e5886c --- /dev/null +++ b/plugins/tracing/test/subagents.test.ts @@ -0,0 +1,59 @@ +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import { afterEach, describe, expect, it } from "vitest"; +import { locateSubagentRollout } from "../src/subagents.js"; + +let tmpDir: string; +afterEach(async () => { + if (tmpDir) await fs.rm(tmpDir, { recursive: true, force: true }); +}); + +async function makeTmpCodexHome(): Promise { + tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "tr-subagents-")); + return tmpDir; +} + +describe("locateSubagentRollout", () => { + it("returns the rollout path when the file exists under sessions/YYYY/MM/DD/", async () => { + const home = await makeTmpCodexHome(); + const dayDir = path.join(home, "sessions", "2026", "06", "30"); + await fs.mkdir(dayDir, { recursive: true }); + const filePath = path.join(dayDir, "rollout-1782294000000-child-thread-1.jsonl"); + await fs.writeFile(filePath, ""); + + const result = await locateSubagentRollout("child-thread-1", home); + expect(result).toBe(filePath); + }); + + it("returns undefined when no matching file exists", async () => { + const home = await makeTmpCodexHome(); + const dayDir = path.join(home, "sessions", "2026", "06", "30"); + await fs.mkdir(dayDir, { recursive: true }); + await fs.writeFile(path.join(dayDir, "rollout-1782294000000-other-thread.jsonl"), ""); + + const result = await locateSubagentRollout("child-thread-1", home); + expect(result).toBeUndefined(); + }); + + it("returns undefined and does not throw when the sessions directory does not exist", async () => { + const home = await makeTmpCodexHome(); + // No sessions/ directory created + const result = await locateSubagentRollout("any-thread", home); + expect(result).toBeUndefined(); + }); + + it("finds a file in a nested day directory among multiple day dirs", async () => { + const home = await makeTmpCodexHome(); + // Create two day dirs — target in the newer one + const olderDir = path.join(home, "sessions", "2026", "06", "28"); + const newerDir = path.join(home, "sessions", "2026", "06", "30"); + await fs.mkdir(olderDir, { recursive: true }); + await fs.mkdir(newerDir, { recursive: true }); + const targetPath = path.join(newerDir, "rollout-1782294001-target-thread.jsonl"); + await fs.writeFile(targetPath, ""); + + const result = await locateSubagentRollout("target-thread", home); + expect(result).toBe(targetPath); + }); +}); diff --git a/plugins/tracing/test/tokens.test.ts b/plugins/tracing/test/tokens.test.ts new file mode 100644 index 0000000..96c22d0 --- /dev/null +++ b/plugins/tracing/test/tokens.test.ts @@ -0,0 +1,24 @@ +import { describe, expect, it } from "vitest"; +import { mapUsage } from "../src/tokens.js"; + +describe("mapUsage", () => { + it("maps Codex usage to backend token keys (gross input incl. cache)", () => { + const out = mapUsage({ + input_tokens: 15142, + cached_input_tokens: 11136, + output_tokens: 357, + reasoning_output_tokens: 139, + total_tokens: 15499, + }); + expect(out).toEqual({ + "llm.token_count.prompt": 15142, + "llm.token_count.completion": 357, + "llm.token_count.prompt_details.cache_read": 11136, + "llm.token_count.completion_details.reasoning": 139, + }); + }); + + it("returns empty object for undefined usage", () => { + expect(mapUsage(undefined)).toEqual({}); + }); +}); diff --git a/plugins/tracing/test/transcript.test.ts b/plugins/tracing/test/transcript.test.ts new file mode 100644 index 0000000..698119b --- /dev/null +++ b/plugins/tracing/test/transcript.test.ts @@ -0,0 +1,155 @@ +import * as path from "node:path"; +import { fileURLToPath } from "node:url"; +import { describe, expect, it } from "vitest"; +import { parseRollout, readRollout } from "../src/transcript.js"; +import type { RolloutLine } from "../src/types.js"; + +const here = path.dirname(fileURLToPath(import.meta.url)); +const fixture = path.join(here, "fixtures", "rollout-basic.jsonl"); +const toolDetailFixture = path.join(here, "fixtures", "rollout-tool-detail.jsonl"); + +const ts = (sec: number): string => new Date(sec * 1000).toISOString(); + +describe("parseRollout", () => { + it("reconstructs one completed turn with a tool call and usage", async () => { + const lines = await readRollout(fixture); + const { sessionMeta, turns } = parseRollout(lines); + + expect(sessionMeta.sessionId).toBe("sess-abc"); + expect(turns).toHaveLength(1); + + const t = turns[0]!; + expect(t.turnId).toBe("turn-1"); + expect(t.model).toBe("gpt-5.5"); + expect(t.userInput).toBe("list the files"); + expect(t.completed).toBe(true); + expect(t.finalOutput).toContain("two files"); + expect(t.steps).toHaveLength(1); + + const step = t.steps[0]!; + expect(step.usage?.input_tokens).toBe(1200); + expect(step.text).toContain("two files"); + expect(step.reasoning).toContain("ls"); + expect(step.toolCalls).toHaveLength(1); + + const tc = step.toolCalls[0]!; + expect(tc.name).toBe("exec_command"); + expect(tc.callId).toBe("call-1"); + expect(tc.output).toContain("a.txt"); + expect(tc.endTime).toBeGreaterThan(tc.startTime); + }); + + it("does not throw and leaves text undefined when message content is missing", () => { + const lines: RolloutLine[] = [ + { timestamp: ts(100), type: "session_meta", payload: { id: "sess-1" } }, + { timestamp: ts(101), type: "event_msg", payload: { type: "task_started", turn_id: "turn-1" } }, + { timestamp: ts(102), type: "response_item", payload: { type: "message", role: "assistant" } as never }, + { timestamp: ts(103), type: "event_msg", payload: { type: "token_count", info: { last_token_usage: { input_tokens: 5 } } } }, + { timestamp: ts(104), type: "event_msg", payload: { type: "task_complete", turn_id: "turn-1" } }, + ]; + + const { turns } = parseRollout(lines); + expect(turns).toHaveLength(1); + const t = turns[0]!; + expect(t.steps).toHaveLength(1); + expect(t.steps[0]!.text).toBeUndefined(); + }); + + it("enriches tool calls from *_end event_msg events", async () => { + const lines = await readRollout(toolDetailFixture); + const { turns } = parseRollout(lines); + expect(turns).toHaveLength(1); + const t = turns[0]!; + expect(t.steps).toHaveLength(1); + const toolCalls = t.steps[0]!.toolCalls; + expect(toolCalls).toHaveLength(2); + + // (a) successful exec + const tcOk = toolCalls.find((tc) => tc.callId === "call-ok")!; + expect(tcOk).toBeDefined(); + expect((tcOk as { kind?: string }).kind).toBe("exec"); + expect((tcOk as { status?: string }).status).toBe("completed"); + expect((tcOk as { exitCode?: number }).exitCode).toBe(0); + expect(tcOk.endTime).toBeTruthy(); + expect(tcOk.error).toBeUndefined(); + + // (b) failed exec + const tcFail = toolCalls.find((tc) => tc.callId === "call-fail")!; + expect(tcFail).toBeDefined(); + expect((tcFail as { kind?: string }).kind).toBe("exec"); + expect((tcFail as { status?: string }).status).toBe("failed"); + expect((tcFail as { exitCode?: number }).exitCode).toBe(1); + expect(tcFail.endTime).toBeTruthy(); + expect(tcFail.error).toContain("boom"); + }); + + it("attaches function_call_output arriving after token_count without spawning an empty step", () => { + const lines: RolloutLine[] = [ + { timestamp: ts(200), type: "session_meta", payload: { id: "sess-2" } }, + { timestamp: ts(201), type: "event_msg", payload: { type: "task_started", turn_id: "turn-1" } }, + { timestamp: ts(202), type: "response_item", payload: { type: "function_call", name: "exec", call_id: "c1", arguments: "{}" } }, + // token_count closes the step BEFORE the tool output arrives (real Codex ordering) + { timestamp: ts(203), type: "event_msg", payload: { type: "token_count", info: { last_token_usage: { input_tokens: 7 } } } }, + { timestamp: ts(204), type: "response_item", payload: { type: "function_call_output", call_id: "c1", output: "done" } }, + { timestamp: ts(205), type: "event_msg", payload: { type: "task_complete", turn_id: "turn-1" } }, + ]; + + const { turns } = parseRollout(lines); + expect(turns).toHaveLength(1); + const t = turns[0]!; + // Only the one step holding the function_call — no empty step from the late output. + expect(t.steps).toHaveLength(1); + const tc = t.steps[0]!.toolCalls[0]!; + expect(tc.callId).toBe("c1"); + expect(tc.output).toBe("done"); + expect(tc.endTime).toBeGreaterThan(tc.startTime); + }); +}); + +describe("parseRollout custom_tool_call (apply_patch)", () => { + it("captures apply_patch (custom_tool_call) as a tool with patch enrichment", () => { + const patch = "*** Begin Patch\n*** Update File: calc.py\n@@\n- return a-b\n+ return a+b\n*** End Patch\n"; + const lines: RolloutLine[] = [ + { timestamp: ts(0), type: "session_meta", payload: { id: "s1" } }, + { timestamp: ts(1), type: "event_msg", payload: { type: "task_started", turn_id: "t1" } }, + { timestamp: ts(2), type: "turn_context", payload: { turn_id: "t1", model: "gpt-5.5" } }, + { timestamp: ts(3), type: "event_msg", payload: { type: "user_message", message: "fix the bug" } }, + { timestamp: ts(4), type: "response_item", payload: { type: "custom_tool_call", call_id: "p1", name: "apply_patch", input: patch } }, + { timestamp: ts(5), type: "response_item", payload: { type: "custom_tool_call_output", call_id: "p1", output: "Success. Updated calc.py" } }, + { timestamp: ts(6), type: "event_msg", payload: { type: "patch_apply_end", call_id: "p1", status: "completed", success: true } }, + { timestamp: ts(7), type: "event_msg", payload: { type: "token_count", info: { last_token_usage: { input_tokens: 100, output_tokens: 10 } } } }, + { timestamp: ts(8), type: "event_msg", payload: { type: "task_complete", turn_id: "t1" } }, + ]; + const { turns } = parseRollout(lines); + const tools = turns[0]!.steps.flatMap((s) => s.toolCalls); + expect(tools).toHaveLength(1); + const tc = tools[0]!; + expect(tc.name).toBe("apply_patch"); + expect(tc.args).toBe(patch); // non-JSON input kept as raw string + expect(tc.output).toBe("Success. Updated calc.py"); + expect(tc.kind).toBe("patch"); // enriched from patch_apply_end + expect(tc.status).toBe("completed"); + expect(tc.endTime).toBeGreaterThan(tc.startTime); + }); +}); + +describe("parseRollout spawn_agent (Codex multi-agent v1)", () => { + it("records a subagent ref from spawn_agent + its function_call_output agent_id", () => { + const lines: RolloutLine[] = [ + { timestamp: ts(0), type: "session_meta", payload: { id: "parent" } }, + { timestamp: ts(1), type: "event_msg", payload: { type: "task_started", turn_id: "t1" } }, + { timestamp: ts(2), type: "turn_context", payload: { turn_id: "t1", model: "gpt-5.5" } }, + { timestamp: ts(3), type: "response_item", payload: { type: "function_call", call_id: "spawn1", name: "spawn_agent", arguments: "{\"agent_type\":\"worker\",\"message\":\"do x\"}" } }, + { timestamp: ts(4), type: "response_item", payload: { type: "function_call_output", call_id: "spawn1", output: "{\"agent_id\":\"child-thread-9\",\"nickname\":\"Ada\"}" } }, + { timestamp: ts(5), type: "event_msg", payload: { type: "token_count", info: { last_token_usage: { input_tokens: 50, output_tokens: 5 } } } }, + { timestamp: ts(6), type: "event_msg", payload: { type: "task_complete", turn_id: "t1" } }, + ]; + const { turns } = parseRollout(lines); + const turn = turns[0]!; + // spawn_agent is still a TOOL call (so it gets its own span)... + const spawnTool = turn.steps.flatMap((s) => s.toolCalls).find((t) => t.name === "spawn_agent"); + expect(spawnTool?.callId).toBe("spawn1"); + // ...and the subagent ref links the child thread to the spawn tool's call id. + expect(turn.subagents).toEqual([{ threadId: "child-thread-9", spawnCallId: "spawn1" }]); + }); +}); diff --git a/plugins/tracing/test/types.test.ts b/plugins/tracing/test/types.test.ts new file mode 100644 index 0000000..450d273 --- /dev/null +++ b/plugins/tracing/test/types.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from "vitest"; +import type { RolloutLine, Turn } from "../src/types.js"; + +describe("types", () => { + it("RolloutLine discriminates on type", () => { + const line: RolloutLine = { + timestamp: "2026-06-23T23:21:32.926Z", + type: "session_meta", + payload: { id: "sess-1" }, + }; + expect(line.type).toBe("session_meta"); + }); + + it("Turn carries steps and subagent ids", () => { + const t: Turn = { + startTime: 0, endTime: 1, steps: [], + completed: true, aborted: false, + }; + expect(t.steps).toHaveLength(0); + }); +}); diff --git a/plugins/tracing/tsdown.config.ts b/plugins/tracing/tsdown.config.ts new file mode 100644 index 0000000..25fae9d --- /dev/null +++ b/plugins/tracing/tsdown.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from "tsdown"; + +export default defineConfig({ + entry: ["src/index.ts"], + outDir: "dist", + format: ["esm"], + platform: "node", + target: "node22", + outExtensions: () => ({ js: ".mjs" }), + noExternal: [/^@opentelemetry\//], + dts: false, + clean: true, + minify: false, + outputOptions: { inlineDynamicImports: true }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..140bcb5 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1694 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@opentelemetry/api': + specifier: ^1.9.0 + version: 1.9.1 + '@opentelemetry/core': + specifier: ^2.0.1 + version: 2.8.0(@opentelemetry/api@1.9.1) + '@opentelemetry/exporter-trace-otlp-proto': + specifier: ^0.205.0 + version: 0.205.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': + specifier: ^2.0.1 + version: 2.8.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': + specifier: ^2.0.1 + version: 2.8.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-node': + specifier: ^2.0.1 + version: 2.8.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': + specifier: ^1.28.0 + version: 1.41.1 + devDependencies: + '@types/node': + specifier: ^22.10.0 + version: 22.20.0 + tsdown: + specifier: ^0.18.0 + version: 0.18.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)(typescript@5.9.3) + typescript: + specifier: ^5.7.2 + version: 5.9.3 + vitest: + specifier: ^4.0.0 + version: 4.1.9(@opentelemetry/api@1.9.1)(@types/node@22.20.0)(vite@8.1.0(@types/node@22.20.0)) + +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==} + + '@emnapi/core@1.11.1': + resolution: {integrity: sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==} + + '@emnapi/runtime@1.10.0': + resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} + + '@emnapi/runtime@1.11.1': + resolution: {integrity: sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==} + + '@emnapi/wasi-threads@1.2.1': + resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} + + '@emnapi/wasi-threads@1.2.2': + resolution: {integrity: sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==} + + '@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==} + + '@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==} + 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.8.0': + resolution: {integrity: sha512-/3FIraneMcng67SUJCxvyInk/oxzwsxyadufk0wwfOBLf5wqtAGX4MoQASwSbndBPeARzBryUM9Azr5kHIdWLw==} + 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==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/core@2.8.0': + resolution: {integrity: sha512-hd1Lfh8p545nNz+jq1Ejfz+Mn1hyLuxYn1YzTfFNrxr8urEWMNQLPf1Th8kjOH+HxwawCrtgBp8JpBUR4ZSgww==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/exporter-trace-otlp-proto@0.205.0': + resolution: {integrity: sha512-bGtFzqiENO2GpJk988mOBMe0MfeNpTQjbLm/LBijas6VRyEDQarUzdBHpFlu89A25k1+BCntdWGsWTa9Ai4FyA==} + 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==} + 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==} + 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.8.0': + resolution: {integrity: sha512-qmXQ27ilDbUK/vGMqwL8D4/rhn76C+sherM4wTbjlfknR8Nvfc/hCxjRJPhkzZzUsPiNg16SA31NxMabwttRjg==} + 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==} + 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==} + 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==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + + '@opentelemetry/sdk-trace-base@2.8.0': + resolution: {integrity: sha512-mhU4jp+vW0mGbFRd+GeXHvmfA4aDqWjBjLC3pE5XMpLs0IE2ryYb019Ts2AQrOq67gaTF25D91+fgvEHDZEnuQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.3.0 <1.10.0' + + '@opentelemetry/sdk-trace-node@2.8.0': + resolution: {integrity: sha512-nZt9OGufioAc3AfoLTqA9bsAeaMJAictYDdI2VcNQ+PmT+3rfKjAZDZvgPfd8VPX0O5Bw1hdQF6kDK8VSpZiWg==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.0.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.137.0': + resolution: {integrity: sha512-WT+Gb24i8hmvo85AIv2oEYouEXkRlKAlT9WaCa3TfLgNCN+GhrJOGZuIlMouAh38Qe4QOx26eUOVsq70qXrywA==} + + '@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/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==} + + '@quansync/fs@1.0.0': + resolution: {integrity: sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ==} + + '@rolldown/binding-android-arm64@1.0.0-beta.57': + resolution: {integrity: sha512-GoOVDy8bjw9z1K30Oo803nSzXJS/vWhFijFsW3kzvZCO8IZwFnNa6pGctmbbJstKl3Fv6UBwyjJQN6msejW0IQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-android-arm64@1.0.0-rc.17': + resolution: {integrity: sha512-s70pVGhw4zqGeFnXWvAzJDlvxhlRollagdCCKRgOsgUOH3N1l0LIxf83AtGzmb5SiVM4Hjl5HyarMRfdfj3DaQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-android-arm64@1.1.3': + resolution: {integrity: sha512-DT6Z3PhvioeHMvxo+xHc3KtqggrI7CCTXCmC2h/5zUlp5jVitv7XEy+9q5/7v8IolhlioawpMo8Kg0EEBy7J0g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-beta.57': + resolution: {integrity: sha512-9c4FOhRGpl+PX7zBK5p17c5efpF9aSpTPgyigv57hXf5NjQUaJOOiejPLAtFiKNBIfm5Uu6yFkvLKzOafNvlTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-arm64@1.0.0-rc.17': + resolution: {integrity: sha512-4ksWc9n0mhlZpZ9PMZgTGjeOPRu8MB1Z3Tz0Mo02eWfWCHMW1zN82Qz/pL/rC+yQa+8ZnutMF0JjJe7PjwasYw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-arm64@1.1.3': + resolution: {integrity: sha512-0NwgwsjM7LrsuVnXMK3koTpagBNOhloc/BNjKqZjv4V5zI5r13qx69uVhRx+o5Z0yy4Hzq+lpy7TAgUG/ocvrw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-beta.57': + resolution: {integrity: sha512-6RsB8Qy4LnGqNGJJC/8uWeLWGOvbRL/KG5aJ8XXpSEupg/KQtlBEiFaYU/Ma5Usj1s+bt3ItkqZYAI50kSplBA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-rc.17': + resolution: {integrity: sha512-SUSDOI6WwUVNcWxd02QEBjLdY1VPHvlEkw6T/8nYG322iYWCTxRb1vzk4E+mWWYehTp7ERibq54LSJGjmouOsw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.1.3': + resolution: {integrity: sha512-YtiBp4disu6V560loT6PjMdiRaWmVvDNrUunAalbiFx2ggeJwxdAsgZMcoGP17uyAsTwAj5V1niksxlHnVQ1Sw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-beta.57': + resolution: {integrity: sha512-uA9kG7+MYkHTbqwv67Tx+5GV5YcKd33HCJIi0311iYBd25yuwyIqvJfBdt1VVB8tdOlyTb9cPAgfCki8nhwTQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-freebsd-x64@1.0.0-rc.17': + resolution: {integrity: sha512-hwnz3nw9dbJ05EDO/PvcjaaewqqDy7Y1rn1UO81l8iIK1GjenME75dl16ajbvSSMfv66WXSRCYKIqfgq2KCfxw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-freebsd-x64@1.1.3': + resolution: {integrity: sha512-yD3EkEdXk2LypPxnf/kSZHirarsI8gcPzc62SukhR9VJTyvV+F9Q/GxWNuCojc7sXyuVC4DxRGhdDK4X8VSsbw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.57': + resolution: {integrity: sha512-3KkS0cHsllT2T+Te+VZMKHNw6FPQihYsQh+8J4jkzwgvAQpbsbXmrqhkw3YU/QGRrD8qgcOvBr6z5y6Jid+rmw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17': + resolution: {integrity: sha512-IS+W7epTcwANmFSQFrS1SivEXHtl1JtuQA9wlxrZTcNi6mx+FDOYrakGevvvTwgj2JvWiK8B29/qD9BELZPyXQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm-gnueabihf@1.1.3': + resolution: {integrity: sha512-c+8vieQbsD7HNAHKIA34w0GJ9FedFFuJGD+7E6vz7Q3uqAIugL5p45fhlsj4UaAsHpcmlqugBWMhA0/j7o0sIg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.57': + resolution: {integrity: sha512-A3/wu1RgsHhqP3rVH2+sM81bpk+Qd2XaHTl8LtX5/1LNR7QVBFBCpAoiXwjTdGnI5cMdBVi7Z1pi52euW760Fw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17': + resolution: {integrity: sha512-e6usGaHKW5BMNZOymS1UcEYGowQMWcgZ71Z17Sl/h2+ZziNJ1a9n3Zvcz6LdRyIW5572wBCTH/Z+bKuZouGk9Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.1.3': + resolution: {integrity: sha512-50jD0uUwLvur7Zz9LHz17kaAdTPjn5wN93hEgjvmYFRZwiR7ZJYovTd5ipyWJDAnXKvZ+wgc+/Ika6dwSF5OcA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.57': + resolution: {integrity: sha512-d0kIVezTQtazpyWjiJIn5to8JlwfKITDqwsFv0Xc6s31N16CD2PC/Pl2OtKgS7n8WLOJbfqgIp5ixYzTAxCqMg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': + resolution: {integrity: sha512-b/CgbwAJpmrRLp02RPfhbudf5tZnN9nsPWK82znefso832etkem8H7FSZwxrOI9djcdTP7U6YfNhbRnh7djErg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.1.3': + resolution: {integrity: sha512-BO9+oPL8K9poZJBfYPsXNtYjPE5uM3qeehT3aFcW4LITOl+iSqhp0abzjR2nWBUNjIZeKXjAEWBZ64WjNoHd6w==} + 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} + cpu: [ppc64] + os: [linux] + + '@rolldown/binding-linux-ppc64-gnu@1.1.3': + resolution: {integrity: sha512-f3VpLB1vQ0Eo6ecr/6cekLnvYMFF4YBFoVGkfkvPLq1bAkbAwHYQPZKoAmG6OJyTcxxoC+AvezGx/S1obNC0Mw==} + 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} + cpu: [s390x] + os: [linux] + + '@rolldown/binding-linux-s390x-gnu@1.1.3': + resolution: {integrity: sha512-AmurZ26Pqx/RI9N1gzEOCklkKXl927yjfXWUUS0O7Puh8ARM/Ob8qfrD3qnWksScdw6cSrW5PSHE9DyLu7+PtA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.57': + resolution: {integrity: sha512-E199LPijo98yrLjPCmETx8EF43sZf9t3guSrLee/ej1rCCc3zDVTR4xFfN9BRAapGVl7/8hYqbbiQPTkv73kUg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': + resolution: {integrity: sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-gnu@1.1.3': + resolution: {integrity: sha512-JJpqs8bRGITDOdbkNKnlojzBabbOHrqjSvDr0IVsZObE1lBcPjxItUEY9eWIDbxaJ3cGrXPWGfGkIxFijg/URg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.57': + resolution: {integrity: sha512-++EQDpk/UJ33kY/BNsh7A7/P1sr/jbMuQ8cE554ZIy+tCUWCivo9zfyjDUoiMdnxqX6HLJEqqGnbGQOvzm2OMQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': + resolution: {integrity: sha512-0phclDw1spsL7dUB37sIARuis2tAgomCJXAHZlpt8PXZ4Ba0dRP1e+66lsRqrfhISeN9bEGNjQs+T/Fbd7oYGw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.1.3': + resolution: {integrity: sha512-rSJcdjPxzA/by/6/rYs+v+bXU7UjvnbUWz8MJb6kh6+knqB1dCrtHg0uu7C/4haqJvqdkYHQ5IGn+tCH9GLW/g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.57': + resolution: {integrity: sha512-voDEBcNqxbUv/GeXKFtxXVWA+H45P/8Dec4Ii/SbyJyGvCqV1j+nNHfnFUIiRQ2Q40DwPe/djvgYBs9PpETiMA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': + resolution: {integrity: sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-openharmony-arm64@1.1.3': + resolution: {integrity: sha512-hQ3/PYkDJICgevvyNcVrihVeqq7k1Pp3VZ9lY+dauAYUJKO+auqApvANhvR1An9BhmqYKvW2Mu1F9u4DXSMLxQ==} + engines: {node: ^20.19.0 || >=22.12.0} + 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-wasm32-wasi@1.0.0-rc.17': + resolution: {integrity: sha512-LEXei6vo0E5wTGwpkJ4KoT3OZJRnglwldt5ziLzOlc6qqb55z4tWNq2A+PFqCJuvWWdP53CVhG1Z9NtToDPJrA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [wasm32] + + '@rolldown/binding-wasm32-wasi@1.1.3': + resolution: {integrity: sha512-Elcv/BtML9lXrV6JuKITc/grN2kYV9gjsQpW8Jfw4ioK0TOkjBjye0nnyqQNy9STNaI20lXNaQBRrD5gSgR0Yg==} + 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} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-arm64-msvc@1.1.3': + resolution: {integrity: sha512-2DrEfhluH9yhiaFApmsjsjwrSYbNcY1oFTzYSP1a535jDbV98zCFanA/96TBUd0iDFcxGmw9QRExwGCXz3U+/g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.57': + resolution: {integrity: sha512-OqIUyNid1M4xTj6VRXp/Lht/qIP8fo25QyAZlCP+p6D2ATCEhyW4ZIFLnC9zAGN/HMbXoCzvwfa8Jjg/8J4YEg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': + resolution: {integrity: sha512-3hkiolcUAvPB9FLb3UZdfjVVNWherN1f/skkGWJP/fgSQhYUZpSIRr0/I8ZK9TkF3F7kxvJAk0+IcKvPHk9qQg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.1.3': + resolution: {integrity: sha512-OL4OMk7UPXOeVGGd3qo5zJyPIljf4AFgk5QAkPPS+OoLuOOozhuaQGC18MxVTnw/06q93gShAJzlwnSCY9YtqA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0-beta.57': + resolution: {integrity: sha512-aQNelgx14tGA+n2tNSa9x6/jeoCL9fkDeCei7nOKnHx0fEFRRMu5ReiITo+zZD5TzWDGGRjbSYCs93IfRIyTuQ==} + + '@rolldown/pluginutils@1.0.0-rc.17': + resolution: {integrity: sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==} + + '@rolldown/pluginutils@1.0.1': + resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==} + + '@standard-schema/spec@1.1.0': + resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==} + + '@tybys/wasm-util@0.10.3': + resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==} + + '@types/chai@5.2.3': + resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + + '@types/estree@1.0.9': + resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==} + + '@types/node@22.20.0': + resolution: {integrity: sha512-QWlFW2wf3nTjC13/DqRnBpR4ZO36VJH/JVBkA/vcnmbTBNQIlnObqyqZE1tUR7+Ni23Lda8R1BxMfbXRpCUx5g==} + + '@vitest/expect@4.1.9': + resolution: {integrity: sha512-vl/rYsUKcBr3SnQn166+XR5ZQcgMx3DQhFWdfli/cWpLnLUmbxZvyrJZotLFUryib+LtArYMSTJ5RbQ57ZqrlA==} + + '@vitest/mocker@4.1.9': + resolution: {integrity: sha512-EVkXzBjrPGM+cK8/ANWgBrkUCfJfb38/EfTSO8h7pWvKkyPkpWxvR7BkD2MyItMF62C97zAEoqdpUixwR/e+Rw==} + peerDependencies: + msw: ^2.4.9 + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@4.1.9': + resolution: {integrity: sha512-s0iufns3iIFitdgm+YR7g1whCAaGtXz459VS9/PqyKDEEFgYIhsHOQmXgIgDuYCt7DeQmiZT0Qe2OA2p4ZPu5A==} + + '@vitest/runner@4.1.9': + resolution: {integrity: sha512-KXLMDtc7oe70+3mJfGrPUWPesswH+3sTxAMAMl8DG7I8IUQT4XW718dY5ID3vPUcmlu27CcKfY4P3h3I29SLJg==} + + '@vitest/snapshot@4.1.9': + resolution: {integrity: sha512-Jc7RKGNBo8Z28WYIm0Niej4xdSPByRf6mU58VpHQkd6Zh05rlnA+twjbK5HyeIGHxrzsc3mJgS43uM0CZKzaIA==} + + '@vitest/spy@4.1.9': + resolution: {integrity: sha512-fHpsS6mIi+PiEW+vcRVOMkX1oSaPKne3VOclSFICPcGOmfKgXPU5iAah+wcNcj2xPrCCmfq99IDGf+EojhhvhA==} + + '@vitest/utils@4.1.9': + resolution: {integrity: sha512-A51o8ymO5PpqlWNnBP9ZHPXDIpuMtTLlGSjN7la4US+LJzoUMyhwjA5QXlm39JexgwHKW4Xjs8Z2d3dLCXOeuA==} + + ansis@4.3.1: + resolution: {integrity: sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==} + engines: {node: '>=14'} + + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + + ast-kit@2.2.0: + resolution: {integrity: sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw==} + 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'} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + defu@6.1.7: + resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + dts-resolver@2.1.3: + resolution: {integrity: sha512-bihc7jPC90VrosXNzK0LTE2cuLP6jr0Ro8jk+kMugHReJVLIpHz/xadeq3MhuwyO4TD4OA3L1Q8pBBFRc08Tsw==} + engines: {node: '>=20.19.0'} + peerDependencies: + oxc-resolver: '>=11.0.0' + peerDependenciesMeta: + oxc-resolver: + optional: true + + empathic@2.0.1: + resolution: {integrity: sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==} + engines: {node: '>=14'} + + es-module-lexer@2.2.0: + resolution: {integrity: sha512-3lGxdTXCLfe1MYfTz1y2ksAAUM4NAOP6rPEjxGJVKO7TZ5+tvHCaQWGpC4Y3IXvW3ece0Cz1cIP4FWBxOnGCTQ==} + + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + expect-type@1.4.0: + resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} + engines: {node: '>=12.0.0'} + + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + get-tsconfig@4.14.0: + resolution: {integrity: sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==} + + 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 + + lightningcss-android-arm64@1.32.0: + resolution: {integrity: sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [android] + + lightningcss-darwin-arm64@1.32.0: + resolution: {integrity: sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [darwin] + + lightningcss-darwin-x64@1.32.0: + resolution: {integrity: sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [darwin] + + lightningcss-freebsd-x64@1.32.0: + resolution: {integrity: sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [freebsd] + + lightningcss-linux-arm-gnueabihf@1.32.0: + resolution: {integrity: sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==} + engines: {node: '>= 12.0.0'} + cpu: [arm] + os: [linux] + + lightningcss-linux-arm64-gnu@1.32.0: + resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-arm64-musl@1.32.0: + resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [linux] + + lightningcss-linux-x64-gnu@1.32.0: + resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-linux-x64-musl@1.32.0: + resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [linux] + + lightningcss-win32-arm64-msvc@1.32.0: + resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} + engines: {node: '>= 12.0.0'} + cpu: [arm64] + os: [win32] + + lightningcss-win32-x64-msvc@1.32.0: + resolution: {integrity: sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==} + engines: {node: '>= 12.0.0'} + cpu: [x64] + os: [win32] + + lightningcss@1.32.0: + 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==} + + nanoid@3.3.15: + resolution: {integrity: sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + obug@2.1.3: + resolution: {integrity: sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==} + engines: {node: '>=12.20.0'} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@4.0.4: + resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} + engines: {node: '>=12'} + + postcss@8.5.16: + resolution: {integrity: sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==} + engines: {node: ^10 || ^12 || >=14} + + protobufjs@7.6.4: + resolution: {integrity: sha512-RJJPTTpvFfHcWLkIa2JFWK4XvtSzS0yEWDmunqHXli1h3JlkbcQZXDZdcWxv+JK3Xsl5/UFDPZ0iGm7DAengYw==} + 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'} + 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 + peerDependenciesMeta: + '@ts-macro/tsc': + optional: true + '@typescript/native-preview': + 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} + hasBin: true + + rolldown@1.1.3: + resolution: {integrity: sha512-1F1eEtUBtFvcGm1HQ9TiUIUHPQG7mSAODrhIzjxoUEFuo8OcbrGLiVLkevNgj84TE4lnHvnumwFjhJO5Eu135g==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + + semver@7.8.5: + resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} + engines: {node: '>=10'} + hasBin: true + + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@4.1.0: + resolution: {integrity: sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==} + + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + + tinyexec@1.2.4: + resolution: {integrity: sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==} + engines: {node: '>=18'} + + tinyglobby@0.2.17: + resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==} + engines: {node: '>=12.0.0'} + + tinyrainbow@3.1.0: + resolution: {integrity: sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==} + engines: {node: '>=14.0.0'} + + tree-kill@1.2.2: + 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'} + hasBin: true + peerDependencies: + '@arethetypeswrong/core': ^0.18.1 + '@vitejs/devtools': '*' + publint: ^0.3.0 + typescript: ^5.0.0 + unplugin-lightningcss: ^0.4.0 + unplugin-unused: ^0.5.0 + peerDependenciesMeta: + '@arethetypeswrong/core': + optional: true + '@vitejs/devtools': + optional: true + publint: + optional: true + typescript: + optional: true + unplugin-lightningcss: + optional: true + unplugin-unused: + optional: true + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + + unconfig-core@7.5.0: + resolution: {integrity: sha512-Su3FauozOGP44ZmKdHy2oE6LPjk51M/TRRjHv2HNCWiDvfvCoxC2lno6jevMA91MYAdCdwP05QnWdWpSbncX/w==} + + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + + unrun@0.2.39: + resolution: {integrity: sha512-h9FxYVpztY/wwq+bauLOh6Y3CWu2IVeRLq5lxzneBiIU9Tn86OGp9xiQrGhnYspAmg5dzdY0Cc8+Y70kuTARCg==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + synckit: ^0.11.11 + peerDependenciesMeta: + synckit: + optional: true + + vite@8.1.0: + resolution: {integrity: sha512-BuJcQK/56NQTWDGn4ABea3q4SSBdNPWwNZKTkkUpcMPnLoquSYH8llRtSUIgoL1KSCpHt5eghLShn50mH36y7Q==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + '@vitejs/devtools': ^0.3.0 + esbuild: ^0.27.0 || ^0.28.0 + jiti: '>=1.21.0' + less: ^4.0.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + '@vitejs/devtools': + optional: true + esbuild: + optional: true + jiti: + optional: true + less: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@4.1.9: + resolution: {integrity: sha512-nE3/LEyc0z87uHYLZebqCUOaJr2hdtuPp7BQ4BosVFnfltxgAvMG08NyrSGlPpOUWvR27c5flSmYFTNr78L9GQ==} + 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.9 + '@vitest/browser-preview': 4.1.9 + '@vitest/browser-webdriverio': 4.1.9 + '@vitest/coverage-istanbul': 4.1.9 + '@vitest/coverage-v8': 4.1.9 + '@vitest/ui': 4.1.9 + happy-dom: '*' + jsdom: '*' + vite: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@opentelemetry/api': + optional: true + '@types/node': + optional: true + '@vitest/browser-playwright': + optional: true + '@vitest/browser-preview': + optional: true + '@vitest/browser-webdriverio': + optional: true + '@vitest/coverage-istanbul': + optional: true + '@vitest/coverage-v8': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + +snapshots: + + '@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 + + '@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 + + '@babel/types@7.29.7': + dependencies: + '@babel/helper-string-parser': 7.29.7 + '@babel/helper-validator-identifier': 7.29.7 + + '@emnapi/core@1.10.0': + dependencies: + '@emnapi/wasi-threads': 1.2.1 + tslib: 2.8.1 + optional: true + + '@emnapi/core@1.11.1': + dependencies: + '@emnapi/wasi-threads': 1.2.2 + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.10.0': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/runtime@1.11.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.2.1': + dependencies: + tslib: 2.8.1 + optional: true + + '@emnapi/wasi-threads@1.2.2': + dependencies: + 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 + + '@napi-rs/wasm-runtime@1.1.6(@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.3 + optional: true + + '@napi-rs/wasm-runtime@1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1)': + dependencies: + '@emnapi/core': 1.11.1 + '@emnapi/runtime': 1.11.1 + '@tybys/wasm-util': 0.10.3 + optional: true + + '@opentelemetry/api-logs@0.205.0': + dependencies: + '@opentelemetry/api': 1.9.1 + + '@opentelemetry/api@1.9.1': {} + + '@opentelemetry/context-async-hooks@2.8.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + + '@opentelemetry/core@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/core@2.8.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/exporter-trace-otlp-proto@0.205.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/otlp-exporter-base@0.205.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.4 + + '@opentelemetry/resources@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/resources@2.8.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.8.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)': + 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/sdk-trace-base@2.1.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/semantic-conventions': 1.41.1 + + '@opentelemetry/sdk-trace-base@2.8.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.8.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.8.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + + '@opentelemetry/sdk-trace-node@2.8.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/context-async-hooks': 2.8.0(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.8.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.8.0(@opentelemetry/api@1.9.1) + + '@opentelemetry/semantic-conventions@1.41.1': {} + + '@oxc-project/types@0.103.0': {} + + '@oxc-project/types@0.127.0': {} + + '@oxc-project/types@0.137.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/path@1.1.2': {} + + '@protobufjs/pool@1.1.0': {} + + '@protobufjs/utf8@1.1.1': {} + + '@quansync/fs@1.0.0': + dependencies: + quansync: 1.0.0 + + '@rolldown/binding-android-arm64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-android-arm64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-android-arm64@1.1.3': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-darwin-arm64@1.1.3': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-darwin-x64@1.1.3': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-freebsd-x64@1.1.3': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.1.3': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.1.3': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.1.3': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.1.3': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.1.3': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.1.3': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.57': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': + optional: true + + '@rolldown/binding-linux-x64-musl@1.1.3': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.57': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': + optional: true + + '@rolldown/binding-openharmony-arm64@1.1.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.6(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + 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.6(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + optional: true + + '@rolldown/binding-wasm32-wasi@1.1.3': + dependencies: + '@emnapi/core': 1.11.1 + '@emnapi/runtime': 1.11.1 + '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.1)(@emnapi/runtime@1.11.1) + 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.1.3': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.57': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.1.3': + optional: true + + '@rolldown/pluginutils@1.0.0-beta.57': {} + + '@rolldown/pluginutils@1.0.0-rc.17': {} + + '@rolldown/pluginutils@1.0.1': {} + + '@standard-schema/spec@1.1.0': {} + + '@tybys/wasm-util@0.10.3': + dependencies: + tslib: 2.8.1 + optional: true + + '@types/chai@5.2.3': + dependencies: + '@types/deep-eql': 4.0.2 + assertion-error: 2.0.1 + + '@types/deep-eql@4.0.2': {} + + '@types/estree@1.0.9': {} + + '@types/node@22.20.0': + dependencies: + undici-types: 6.21.0 + + '@vitest/expect@4.1.9': + dependencies: + '@standard-schema/spec': 1.1.0 + '@types/chai': 5.2.3 + '@vitest/spy': 4.1.9 + '@vitest/utils': 4.1.9 + chai: 6.2.2 + tinyrainbow: 3.1.0 + + '@vitest/mocker@4.1.9(vite@8.1.0(@types/node@22.20.0))': + dependencies: + '@vitest/spy': 4.1.9 + estree-walker: 3.0.3 + magic-string: 0.30.21 + optionalDependencies: + vite: 8.1.0(@types/node@22.20.0) + + '@vitest/pretty-format@4.1.9': + dependencies: + tinyrainbow: 3.1.0 + + '@vitest/runner@4.1.9': + dependencies: + '@vitest/utils': 4.1.9 + pathe: 2.0.3 + + '@vitest/snapshot@4.1.9': + dependencies: + '@vitest/pretty-format': 4.1.9 + '@vitest/utils': 4.1.9 + magic-string: 0.30.21 + pathe: 2.0.3 + + '@vitest/spy@4.1.9': {} + + '@vitest/utils@4.1.9': + dependencies: + '@vitest/pretty-format': 4.1.9 + convert-source-map: 2.0.0 + tinyrainbow: 3.1.0 + + ansis@4.3.1: {} + + assertion-error@2.0.1: {} + + ast-kit@2.2.0: + dependencies: + '@babel/parser': 7.29.7 + pathe: 2.0.3 + + birpc@4.0.0: {} + + cac@6.7.14: {} + + chai@6.2.2: {} + + convert-source-map@2.0.0: {} + + defu@6.1.7: {} + + detect-libc@2.1.2: {} + + dts-resolver@2.1.3: {} + + empathic@2.0.1: {} + + es-module-lexer@2.2.0: {} + + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.9 + + expect-type@1.4.0: {} + + fdir@6.5.0(picomatch@4.0.4): + optionalDependencies: + picomatch: 4.0.4 + + fsevents@2.3.3: + optional: true + + get-tsconfig@4.14.0: + dependencies: + resolve-pkg-maps: 1.0.0 + + hookable@6.1.1: {} + + import-without-cache@0.2.5: {} + + jsesc@3.1.0: {} + + lightningcss-android-arm64@1.32.0: + optional: true + + lightningcss-darwin-arm64@1.32.0: + optional: true + + lightningcss-darwin-x64@1.32.0: + optional: true + + lightningcss-freebsd-x64@1.32.0: + optional: true + + lightningcss-linux-arm-gnueabihf@1.32.0: + optional: true + + lightningcss-linux-arm64-gnu@1.32.0: + optional: true + + lightningcss-linux-arm64-musl@1.32.0: + optional: true + + lightningcss-linux-x64-gnu@1.32.0: + optional: true + + lightningcss-linux-x64-musl@1.32.0: + optional: true + + lightningcss-win32-arm64-msvc@1.32.0: + optional: true + + lightningcss-win32-x64-msvc@1.32.0: + optional: true + + lightningcss@1.32.0: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + lightningcss-android-arm64: 1.32.0 + lightningcss-darwin-arm64: 1.32.0 + lightningcss-darwin-x64: 1.32.0 + lightningcss-freebsd-x64: 1.32.0 + lightningcss-linux-arm-gnueabihf: 1.32.0 + lightningcss-linux-arm64-gnu: 1.32.0 + lightningcss-linux-arm64-musl: 1.32.0 + lightningcss-linux-x64-gnu: 1.32.0 + lightningcss-linux-x64-musl: 1.32.0 + 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 + + nanoid@3.3.15: {} + + obug@2.1.3: {} + + pathe@2.0.3: {} + + picocolors@1.1.1: {} + + picomatch@4.0.4: {} + + postcss@8.5.16: + dependencies: + nanoid: 3.3.15 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + protobufjs@7.6.4: + 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/path': 1.1.2 + '@protobufjs/pool': 1.1.0 + '@protobufjs/utf8': 1.1.1 + '@types/node': 22.20.0 + 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): + 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.3 + rolldown: 1.0.0-beta.57(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + 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 + '@rolldown/pluginutils': 1.0.0-rc.17 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-rc.17 + '@rolldown/binding-darwin-arm64': 1.0.0-rc.17 + '@rolldown/binding-darwin-x64': 1.0.0-rc.17 + '@rolldown/binding-freebsd-x64': 1.0.0-rc.17 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-rc.17 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-rc.17 + '@rolldown/binding-linux-arm64-musl': 1.0.0-rc.17 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0-rc.17 + '@rolldown/binding-linux-s390x-gnu': 1.0.0-rc.17 + '@rolldown/binding-linux-x64-gnu': 1.0.0-rc.17 + '@rolldown/binding-linux-x64-musl': 1.0.0-rc.17 + '@rolldown/binding-openharmony-arm64': 1.0.0-rc.17 + '@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 + + rolldown@1.1.3: + dependencies: + '@oxc-project/types': 0.137.0 + '@rolldown/pluginutils': 1.0.1 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.1.3 + '@rolldown/binding-darwin-arm64': 1.1.3 + '@rolldown/binding-darwin-x64': 1.1.3 + '@rolldown/binding-freebsd-x64': 1.1.3 + '@rolldown/binding-linux-arm-gnueabihf': 1.1.3 + '@rolldown/binding-linux-arm64-gnu': 1.1.3 + '@rolldown/binding-linux-arm64-musl': 1.1.3 + '@rolldown/binding-linux-ppc64-gnu': 1.1.3 + '@rolldown/binding-linux-s390x-gnu': 1.1.3 + '@rolldown/binding-linux-x64-gnu': 1.1.3 + '@rolldown/binding-linux-x64-musl': 1.1.3 + '@rolldown/binding-openharmony-arm64': 1.1.3 + '@rolldown/binding-wasm32-wasi': 1.1.3 + '@rolldown/binding-win32-arm64-msvc': 1.1.3 + '@rolldown/binding-win32-x64-msvc': 1.1.3 + + semver@7.8.5: {} + + siginfo@2.0.0: {} + + source-map-js@1.2.1: {} + + stackback@0.0.2: {} + + std-env@4.1.0: {} + + tinybench@2.9.0: {} + + tinyexec@1.2.4: {} + + tinyglobby@0.2.17: + dependencies: + fdir: 6.5.0(picomatch@4.0.4) + picomatch: 4.0.4 + + 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): + dependencies: + ansis: 4.3.1 + cac: 6.7.14 + defu: 6.1.7 + empathic: 2.0.1 + hookable: 6.1.1 + import-without-cache: 0.2.5 + obug: 2.1.3 + 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.5 + tinyexec: 1.2.4 + tinyglobby: 0.2.17 + tree-kill: 1.2.2 + unconfig-core: 7.5.0 + unrun: 0.2.39 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + - '@ts-macro/tsc' + - '@typescript/native-preview' + - oxc-resolver + - synckit + - vue-tsc + + tslib@2.8.1: + optional: true + + typescript@5.9.3: {} + + unconfig-core@7.5.0: + dependencies: + '@quansync/fs': 1.0.0 + quansync: 1.0.0 + + undici-types@6.21.0: {} + + unrun@0.2.39: + dependencies: + rolldown: 1.0.0-rc.17 + + vite@8.1.0(@types/node@22.20.0): + dependencies: + lightningcss: 1.32.0 + picomatch: 4.0.4 + postcss: 8.5.16 + rolldown: 1.1.3 + tinyglobby: 0.2.17 + optionalDependencies: + '@types/node': 22.20.0 + fsevents: 2.3.3 + + vitest@4.1.9(@opentelemetry/api@1.9.1)(@types/node@22.20.0)(vite@8.1.0(@types/node@22.20.0)): + dependencies: + '@vitest/expect': 4.1.9 + '@vitest/mocker': 4.1.9(vite@8.1.0(@types/node@22.20.0)) + '@vitest/pretty-format': 4.1.9 + '@vitest/runner': 4.1.9 + '@vitest/snapshot': 4.1.9 + '@vitest/spy': 4.1.9 + '@vitest/utils': 4.1.9 + es-module-lexer: 2.2.0 + expect-type: 1.4.0 + magic-string: 0.30.21 + obug: 2.1.3 + pathe: 2.0.3 + picomatch: 4.0.4 + std-env: 4.1.0 + tinybench: 2.9.0 + tinyexec: 1.2.4 + tinyglobby: 0.2.17 + tinyrainbow: 3.1.0 + vite: 8.1.0(@types/node@22.20.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@opentelemetry/api': 1.9.1 + '@types/node': 22.20.0 + transitivePeerDependencies: + - msw + + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..ccbac80 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - "." diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..440561e --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "lib": ["ES2023"], + "strict": true, + "noUncheckedIndexedAccess": true, + "esModuleInterop": true, + "skipLibCheck": true, + "types": ["node"], + "outDir": "dist", + "noEmit": true + }, + "include": ["plugins/tracing/src", "plugins/tracing/test"], + "exclude": ["node_modules", "**/dist"] +} diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..f805304 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { include: ["plugins/tracing/test/**/*.test.ts"], environment: "node" }, +});