@synnaxlabs/alamos 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +18 -0
- package/LICENSE +4 -0
- package/dist/dev/index.d.ts +2 -0
- package/dist/dev.cjs +15232 -0
- package/dist/dev.cjs.map +1 -0
- package/dist/dev.js +15232 -0
- package/dist/dev.js.map +1 -0
- package/dist/environment.d.ts +18 -0
- package/dist/external.d.ts +3 -0
- package/dist/index.cjs +26 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/instrumentation-0b5118e7.cjs +945 -0
- package/dist/instrumentation-0b5118e7.cjs.map +1 -0
- package/dist/instrumentation-2edee102.js +946 -0
- package/dist/instrumentation-2edee102.js.map +1 -0
- package/dist/instrumentation-LKYcTUHj.js +946 -0
- package/dist/instrumentation-LKYcTUHj.js.map +1 -0
- package/dist/instrumentation-suDg2eHN.cjs +945 -0
- package/dist/instrumentation-suDg2eHN.cjs.map +1 -0
- package/dist/instrumentation.d.ts +20 -0
- package/dist/log.d.ts +35 -0
- package/dist/meta.d.ts +11 -0
- package/dist/trace.d.ts +103 -0
- package/dist/trace.spec.d.ts +1 -0
- package/package.json +61 -0
- package/src/dev/index.ts +43 -0
- package/src/environment.ts +33 -0
- package/src/external.ts +12 -0
- package/src/index.ts +11 -0
- package/src/instrumentation.ts +51 -0
- package/src/log.ts +104 -0
- package/src/meta.ts +41 -0
- package/src/trace.spec.ts +38 -0
- package/src/trace.ts +188 -0
- package/tsconfig.json +11 -0
- package/tsconfig.vite.json +4 -0
- package/vite.config.ts +26 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation-0b5118e7.cjs","sources":["../src/meta.ts","../src/log.ts","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/version.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/internal/semver.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/diag/types.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/api/diag.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/baggage/utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/context/context.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/api/context.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/trace/status.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/context-api.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/api/propagation.js","../../../node_modules/.pnpm/@opentelemetry+api@1.6.0/node_modules/@opentelemetry/api/build/esm/propagation-api.js","../src/environment.ts","../src/trace.ts","../src/instrumentation.ts"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nexport class Meta {\n private readonly _noop: boolean = false;\n readonly key: string;\n readonly path: string;\n readonly serviceName: string;\n\n constructor(\n key: string,\n path: string,\n serviceName: string = \"\",\n noop: boolean = false,\n ) {\n this.key = key;\n this.path = path;\n this.serviceName = serviceName;\n this._noop = noop;\n }\n\n child(key: string): Meta {\n return new Meta(key, this.extendPath(key), this.serviceName);\n }\n\n extendPath(key: string): string {\n return `${this.path}.${key}`;\n }\n\n get noop(): boolean {\n return this._noop;\n }\n\n static readonly NOOP = new Meta(\"\", \"\", \"\");\n}\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type UnknownRecord } from \"@synnaxlabs/x\";\n\nimport { Meta } from \"@/meta\";\n\nexport const LOG_LEVELS = [\"debug\", \"info\", \"warn\", \"error\"] as const;\nexport type LogLevel = (typeof LOG_LEVELS)[number];\n\nexport interface LogLevelFilterProps {\n key: string;\n path: string;\n level: LogLevel;\n}\n\n/**\n * LogLevelFilter is a function that returns true if the log at the given\n * level should be emitted.\n */\nexport type LogLevelFilter = (props: LogLevelFilterProps) => boolean;\n\nexport const logThresholdFilter = (thresh: LogLevel): LogLevelFilter => {\n const threshIdx = LOG_LEVELS.indexOf(thresh);\n return ({ level }) => LOG_LEVELS.indexOf(level) >= threshIdx;\n};\n\nexport interface LogLevelKeyFilterProps {\n include?: string[];\n exclude?: string[];\n}\nexport const logLevelKeyFiler = (props: LogLevelKeyFilterProps): LogLevelFilter => {\n const { include, exclude } = props;\n return ({ key }) => {\n if (include != null && !include.includes(key)) return false;\n if (exclude != null && exclude.includes(key)) return false;\n return true;\n };\n};\n\nexport interface LoggerProps {\n filters?: LogLevelFilter[];\n}\n\nexport class Logger {\n meta: Meta = Meta.NOOP;\n filters: LogLevelFilter[];\n\n constructor(p: LoggerProps = {}) {\n const { filters = [] } = p;\n this.filters = filters;\n }\n\n private filter(level: LogLevel): boolean {\n return (\n !this.meta.noop &&\n this.filters.every((f) =>\n f({\n key: this.meta.key,\n path: this.meta.path,\n level,\n }),\n )\n );\n }\n\n child(meta: Meta): Logger {\n const l = new Logger({ filters: this.filters });\n l.meta = meta;\n return l;\n }\n\n debug(msg: string, kv?: UnknownRecord): void {\n if (!this.filter(\"debug\")) return;\n if (kv == null) console.log(\"%cDEBUG\", \"color: #8c00f0;\", this.meta.path, msg);\n else console.log(\"%cDEBUG\", \"color: #8c00f0;\", this.meta.path, msg, kv);\n }\n\n info(msg: string, kv?: UnknownRecord): void {\n if (!this.filter(\"info\")) return;\n if (kv == null) console.log(\"%cINFO\", \"color: #005eff;\", this.meta.path, msg);\n else console.log(\"%cINFO\", \"color: #005eff;\", this.meta.path, msg, kv);\n }\n\n warn(msg: string, kv?: UnknownRecord): void {\n if (!this.filter(\"warn\")) return;\n if (kv == null) console.warn(\"WARN\", this.meta.path, msg);\n else console.warn(\"WARN\", this.meta.path, msg, kv);\n }\n\n error(msg: string, kv?: UnknownRecord): void {\n if (!this.filter(\"error\")) return;\n if (kv == null) console.error(\"ERROR\", this.meta.path, msg);\n else console.error(\"ERROR\", this.meta.path, msg, kv);\n }\n\n static readonly NOOP = new Logger();\n}\n","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Updates to this file should also be replicated to @opentelemetry/core too.\n/**\n * - globalThis (New standard)\n * - self (Will return the current window instance for supported browsers)\n * - window (fallback for older browser implementations)\n * - global (NodeJS implementation)\n * - <object> (When all else fails)\n */\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef\nexport var _globalThis = typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? global\n : {};\n//# sourceMappingURL=globalThis.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// this is autogenerated file, see scripts/version-update.js\nexport var VERSION = '1.6.0';\n//# sourceMappingURL=version.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { VERSION } from '../version';\nvar re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - 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\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(ownVersion) {\n var acceptedVersions = new Set([ownVersion]);\n var rejectedVersions = new Set();\n var myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return function () { return false; };\n }\n var ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n var globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n var globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - 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\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport var isCompatible = _makeCompatibilityCheck(VERSION);\n//# sourceMappingURL=semver.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { _globalThis } from '../platform';\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\nvar major = VERSION.split('.')[0];\nvar GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\"opentelemetry.js.api.\" + major);\nvar _global = _globalThis;\nexport function registerGlobal(type, instance, diag, allowOverride) {\n var _a;\n if (allowOverride === void 0) { allowOverride = false; }\n var api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n var err = new Error(\"@opentelemetry/api: Attempted duplicate registration of API: \" + type);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n var err = new Error(\"@opentelemetry/api: Registration of version v\" + api.version + \" for \" + type + \" does not match previously registered API v\" + VERSION);\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(\"@opentelemetry/api: Registered a global for \" + type + \" v\" + VERSION + \".\");\n return true;\n}\nexport function getGlobal(type) {\n var _a, _b;\n var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexport function unregisterGlobal(type, diag) {\n diag.debug(\"@opentelemetry/api: Unregistering a global for \" + type + \" v\" + VERSION + \".\");\n var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\n//# sourceMappingURL=global-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { getGlobal } from '../internal/global-utils';\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nvar DiagComponentLogger = /** @class */ (function () {\n function DiagComponentLogger(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n DiagComponentLogger.prototype.debug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('debug', this._namespace, args);\n };\n DiagComponentLogger.prototype.error = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('error', this._namespace, args);\n };\n DiagComponentLogger.prototype.info = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('info', this._namespace, args);\n };\n DiagComponentLogger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('warn', this._namespace, args);\n };\n DiagComponentLogger.prototype.verbose = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('verbose', this._namespace, args);\n };\n return DiagComponentLogger;\n}());\nexport { DiagComponentLogger };\nfunction logProxy(funcName, namespace, args) {\n var logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n args.unshift(namespace);\n return logger[funcName].apply(logger, __spreadArray([], __read(args), false));\n}\n//# sourceMappingURL=ComponentLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nexport var DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel || (DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DiagLogLevel } from '../types';\nexport function createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n }\n else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n var theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n//# sourceMappingURL=logLevelLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport { DiagLogLevel, } from '../diag/types';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nvar API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nvar DiagAPI = /** @class */ (function () {\n /**\n * Private internal constructor\n * @private\n */\n function DiagAPI() {\n function _logProxy(funcName) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName].apply(logger, __spreadArray([], __read(args), false));\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n var self = this;\n // DiagAPI specific functions\n var setLogger = function (logger, optionsOrLogLevel) {\n var _a, _b, _c;\n if (optionsOrLogLevel === void 0) { optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }; }\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n var oldLogger = getGlobal('diag');\n var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';\n oldLogger.warn(\"Current logger will be overwritten from \" + stack);\n newLogger.warn(\"Current logger will overwrite one already registered from \" + stack);\n }\n return registerGlobal('diag', newLogger, self, true);\n };\n self.setLogger = setLogger;\n self.disable = function () {\n unregisterGlobal(API_NAME, self);\n };\n self.createComponentLogger = function (options) {\n return new DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n /** Get the singleton instance of the DiagAPI API */\n DiagAPI.instance = function () {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n };\n return DiagAPI;\n}());\nexport { DiagAPI };\n//# sourceMappingURL=diag.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar BaggageImpl = /** @class */ (function () {\n function BaggageImpl(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n BaggageImpl.prototype.getEntry = function (key) {\n var entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n };\n BaggageImpl.prototype.getAllEntries = function () {\n return Array.from(this._entries.entries()).map(function (_a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return [k, v];\n });\n };\n BaggageImpl.prototype.setEntry = function (key, entry) {\n var newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n };\n BaggageImpl.prototype.removeEntry = function (key) {\n var newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n };\n BaggageImpl.prototype.removeEntries = function () {\n var e_1, _a;\n var keys = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n keys[_i] = arguments[_i];\n }\n var newBaggage = new BaggageImpl(this._entries);\n try {\n for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {\n var key = keys_1_1.value;\n newBaggage._entries.delete(key);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return newBaggage;\n };\n BaggageImpl.prototype.clear = function () {\n return new BaggageImpl();\n };\n return BaggageImpl;\n}());\nexport { BaggageImpl };\n//# sourceMappingURL=baggage-impl.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nvar diag = DiagAPI.instance();\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(entries) {\n if (entries === void 0) { entries = {}; }\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nexport function baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(\"Cannot create baggage metadata from unknown type: \" + typeof str);\n str = '';\n }\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString: function () {\n return str;\n },\n };\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/** Get a key to uniquely identify a context value */\nexport function createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nvar BaseContext = /** @class */ (function () {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n function BaseContext(parentContext) {\n // for minification\n var self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = function (key) { return self._currentContext.get(key); };\n self.setValue = function (key, value) {\n var context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = function (key) {\n var context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n return BaseContext;\n}());\n/** The root context is used as the default parent context when there is no active context */\nexport var ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport var defaultTextMapGetter = {\n get: function (carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys: function (carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\nexport var defaultTextMapSetter = {\n set: function (carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { ROOT_CONTEXT } from './context';\nvar NoopContextManager = /** @class */ (function () {\n function NoopContextManager() {\n }\n NoopContextManager.prototype.active = function () {\n return ROOT_CONTEXT;\n };\n NoopContextManager.prototype.with = function (_context, fn, thisArg) {\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return fn.call.apply(fn, __spreadArray([thisArg], __read(args), false));\n };\n NoopContextManager.prototype.bind = function (_context, target) {\n return target;\n };\n NoopContextManager.prototype.enable = function () {\n return this;\n };\n NoopContextManager.prototype.disable = function () {\n return this;\n };\n return NoopContextManager;\n}());\nexport { NoopContextManager };\n//# sourceMappingURL=NoopContextManager.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'context';\nvar NOOP_CONTEXT_MANAGER = new NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n */\nvar ContextAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function ContextAPI() {\n }\n /** Get the singleton instance of the Context API */\n ContextAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n };\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n ContextAPI.prototype.setGlobalContextManager = function (contextManager) {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n };\n /**\n * Get the currently active context\n */\n ContextAPI.prototype.active = function () {\n return this._getContextManager().active();\n };\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n ContextAPI.prototype.with = function (context, fn, thisArg) {\n var _a;\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return (_a = this._getContextManager()).with.apply(_a, __spreadArray([context, fn, thisArg], __read(args), false));\n };\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n ContextAPI.prototype.bind = function (context, target) {\n return this._getContextManager().bind(context, target);\n };\n ContextAPI.prototype._getContextManager = function () {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n };\n /** Disable and remove the global context manager */\n ContextAPI.prototype.disable = function () {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n return ContextAPI;\n}());\nexport { ContextAPI };\n//# sourceMappingURL=context.js.map","/**\n * An enumeration of status codes.\n */\nexport var SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode || (SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { ContextAPI } from './api/context';\n/** Entrypoint for context API */\nexport var context = ContextAPI.getInstance();\n//# sourceMappingURL=context-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nvar NoopTextMapPropagator = /** @class */ (function () {\n function NoopTextMapPropagator() {\n }\n /** Noop inject function does nothing */\n NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { };\n /** Noop extract function does nothing and returns the input context */\n NoopTextMapPropagator.prototype.extract = function (context, _carrier) {\n return context;\n };\n NoopTextMapPropagator.prototype.fields = function () {\n return [];\n };\n return NoopTextMapPropagator;\n}());\nexport { NoopTextMapPropagator };\n//# sourceMappingURL=NoopTextMapPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\n/**\n * Baggage key\n */\nvar BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage() {\n return getBaggage(ContextAPI.getInstance().active());\n}\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\n//# sourceMappingURL=context-helpers.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';\nimport { getBaggage, getActiveBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'propagation';\nvar NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n */\nvar PropagationAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function PropagationAPI() {\n this.createBaggage = createBaggage;\n this.getBaggage = getBaggage;\n this.getActiveBaggage = getActiveBaggage;\n this.setBaggage = setBaggage;\n this.deleteBaggage = deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n PropagationAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n };\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n PropagationAPI.prototype.setGlobalPropagator = function (propagator) {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n };\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n PropagationAPI.prototype.inject = function (context, carrier, setter) {\n if (setter === void 0) { setter = defaultTextMapSetter; }\n return this._getGlobalPropagator().inject(context, carrier, setter);\n };\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n PropagationAPI.prototype.extract = function (context, carrier, getter) {\n if (getter === void 0) { getter = defaultTextMapGetter; }\n return this._getGlobalPropagator().extract(context, carrier, getter);\n };\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n PropagationAPI.prototype.fields = function () {\n return this._getGlobalPropagator().fields();\n };\n /** Remove the global propagator */\n PropagationAPI.prototype.disable = function () {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n PropagationAPI.prototype._getGlobalPropagator = function () {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n };\n return PropagationAPI;\n}());\nexport { PropagationAPI };\n//# sourceMappingURL=propagation.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { PropagationAPI } from './api/propagation';\n/** Entrypoint for propagation API */\nexport var propagation = PropagationAPI.getInstance();\n//# sourceMappingURL=propagation-api.js.map","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\n/** A list of valid environments */\nexport const ENVIRONMENTS = [\"bench\", \"debug\", \"prod\"] as const;\n\n/**\n * Defines the environment in whcih instrumentation in running. Traces can\n * be constrained to run only in certain environments.\n */\nexport type Environment = (typeof ENVIRONMENTS)[number];\n\n/**\n * Takes an environment and returns true if it is valid for use i.e.\n * 'should this trace be executed?\n */\nexport type EnvironmentFilter = (env: Environment) => boolean;\n\n/**\n * @param treshold\n * @returns An environnment filter that returns true if the environment is greater\n * than or equal to the given threshold.\n */\nexport const envThresholdFilter =\n (treshold: Environment): EnvironmentFilter =>\n (env: Environment) =>\n ENVIRONMENTS.indexOf(env) >= ENVIRONMENTS.indexOf(treshold);\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n type Span as OtelSpan,\n type Tracer as OtelTracer,\n context,\n SpanStatusCode,\n propagation,\n type AttributeValue,\n} from \"@opentelemetry/api\";\n\nimport {\n type Environment,\n type EnvironmentFilter,\n envThresholdFilter,\n} from \"@/environment\";\nimport { Meta } from \"@/meta\";\n\n/** Carrier is an entitty that can carry trace metadata across process bounds */\nexport type Carrier = Record<string, string>;\n\n/** Function that executes under the given span */\nexport type SpanF = (span: Span) => unknown;\n\n/**\n * Tracer wraps an opentelemetry tracer to provide an opinionated intreface\n * for tracing within the Synnax stack.\n */\nexport class Tracer {\n private meta: Meta = Meta.NOOP;\n private readonly tracer: OtelTracer;\n private readonly filter: EnvironmentFilter;\n\n constructor(\n tracer?: OtelTracer,\n filter: EnvironmentFilter = envThresholdFilter(\"debug\"),\n ) {\n this.tracer = tracer as OtelTracer;\n this.filter = filter;\n }\n\n child(meta: Meta): Tracer {\n const t = new Tracer(this.tracer, this.filter);\n t.meta = meta;\n return t;\n }\n\n /**\n * Starts a new span in the debug environment. If a span already exists in the\n * current context, it will be used as the parent span.\n *\n * @param key - The name of the span.\n * @param f - The function to run under the span.\n * @returns A span that tracks program execution. If the Tracer's environment\n * rejects the 'debug' environment or the Tracer is noop, a NoopSpan is returned.\n */\n debug<F extends SpanF>(key: string, f: F): ReturnType<F> {\n return this.trace(key, \"debug\", f);\n }\n\n /**\n * Starts a new span in the bench environment. If a span already exists in the\n * current context, it will be used as the parent span.\n *\n * @param key - The name of the span.\n * @param f - The function to run under the span.\n * @returns A span that tracks program execution. If the Tracer's environment\n * rejects the 'bench' environment or the Tracer is noop, a NoopSpan is returned.\n */\n bench<F extends SpanF>(key: string, f: F): ReturnType<F> {\n return this.trace(key, \"bench\", f);\n }\n\n /**\n * Starts a new span in the prod environment. If a span already exists in the\n * current context, it will be used as the parent span.\n *\n * @param key - The name of the span.\n * @param f - The function to run under the span.\n * @returns A span that tracks program execution. If the Tracer's environment\n * rejects the 'prod' environment or the Tracer is noop, a NoopSpan is returned.\n */\n prod<F extends SpanF>(key: string, f: F): ReturnType<F> {\n return this.trace(key, \"prod\", f);\n }\n\n /**\n * Stars a new span with the given key and environment. If a span already\n * exists in the current context, it will be used as the parent span.\n *\n * @param key - The name of the span.\n * @param env - The environment to run the span under.\n * @param f - The function to run under the span.\n * @returns A span that tracks program execution. If the Tracer's environment\n * rejects the provided span or the Tracer is noop, a NoopSpan is returned.\n */\n trace<F extends SpanF>(key: string, env: Environment, f: F): ReturnType<F> {\n if (this.meta.noop || !this.filter(env))\n return f(new NoopSpan(key)) as ReturnType<F>;\n return this.tracer.startActiveSpan(key, (otelSpan) => {\n const span = new _Span(key, otelSpan);\n const result = f(span);\n otelSpan.end();\n return result as ReturnType<F>;\n });\n }\n\n /**\n * Injects metadata about the current trace into the provided carrier. This\n * metadata can be paresed on teh other side of a network or IPC request to\n * allow the trace to proapgate across services.\n *\n * @param carrier - The carrier to inject the metadata into.\n */\n propagate(carrier: Carrier): void {\n if (this.meta.noop) return;\n const ctx = context.active();\n propagation.inject(ctx, carrier, {\n set: (carrier, key, value) => {\n carrier[key] = value;\n },\n });\n }\n\n /** Tracer implementation that does nothing */\n static readonly NOOP = new Tracer();\n}\n\n/** A span in a trace that can be used to track function execution */\nexport interface Span {\n /**\n * The key identifying the span. This is the name of the key\n * passed into the tracing method combined with the path of the\n * instrumentation that started the span. For example, take the\n * instrumentation titled 'synnax' and call to trace with 'test.\n * The span key would be 'synnax.test'.\n */\n key: string;\n /**\n * If the error is not null, records the error in the span and sets\n * its status to error.\n */\n recordError: (error?: Error | null) => void;\n /**\n * Sets the given key-value pair as an attribute on the span.\n */\n set: (key: string, value: AttributeValue) => void;\n}\n\nexport class _Span implements Span {\n key: string;\n private readonly otel: OtelSpan;\n\n constructor(key: string, span: OtelSpan) {\n this.key = key;\n this.otel = span;\n }\n\n set(key: string, value: AttributeValue): void {\n this.otel.setAttribute(key, value);\n }\n\n recordError(error?: Error | null): void {\n if (error == null) return;\n this.otel.recordException(error);\n this.otel.setStatus({ code: SpanStatusCode.ERROR });\n }\n}\n\n/** Span implementation that does nothing */\nexport class NoopSpan implements Span {\n key: string;\n\n constructor(key: string) {\n this.key = key;\n }\n\n set(key: string, value: AttributeValue): void {}\n\n recordError(_?: Error | null): void {}\n}\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { Logger } from \"@/log\";\nimport { Meta } from \"@/meta\";\nimport { Tracer } from \"@/trace\";\n\nexport interface InstrumentationOptions {\n key?: string;\n serviceName?: string;\n logger?: Logger;\n tracer?: Tracer;\n noop?: boolean;\n __meta?: Meta;\n}\n\nexport class Instrumentation {\n private readonly meta: Meta;\n readonly T: Tracer;\n readonly L: Logger;\n\n constructor({\n key = \"\",\n serviceName = \"\",\n logger = Logger.NOOP,\n tracer = Tracer.NOOP,\n noop = false,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n __meta,\n }: InstrumentationOptions) {\n this.meta = __meta ?? new Meta(key, key, serviceName, noop);\n this.T = tracer.child(this.meta);\n this.L = logger.child(this.meta);\n }\n\n child(key: string): Instrumentation {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const __meta = this.meta.child(key);\n return new Instrumentation({ __meta, tracer: this.T, logger: this.L });\n }\n\n static readonly NOOP = new Instrumentation({ noop: true });\n}\n\nexport const NOOP = Instrumentation.NOOP;\n"],"names":["isCompatible","__read","this","__spreadArray","DiagComponentLogger","DiagLogLevel","API_NAME","DiagAPI","self","BaggageImpl","BaseContext","context","NoopContextManager","ContextAPI","SpanStatusCode","NoopTextMapPropagator","PropagationAPI","carrier"],"mappings":";;;;;;;AASO,MAAM,QAAN,MAAM,MAAK;AAAA,EAMhB,YACE,KACA,MACA,cAAsB,IACtB,OAAgB,OAChB;AAVe,iCAAiB;AACzB;AACA;AACA;AAQP,SAAK,MAAM;AACX,SAAK,OAAO;AACZ,SAAK,cAAc;AACnB,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,MAAM,KAAmB;AAChB,WAAA,IAAI,MAAK,KAAK,KAAK,WAAW,GAAG,GAAG,KAAK,WAAW;AAAA,EAC7D;AAAA,EAEA,WAAW,KAAqB;AAC9B,WAAO,GAAG,KAAK,IAAI,IAAI,GAAG;AAAA,EAC5B;AAAA,EAEA,IAAI,OAAgB;AAClB,WAAO,KAAK;AAAA,EACd;AAGF;AADE,cA9BW,OA8BK,QAAO,IAAI,MAAK,IAAI,IAAI,EAAE;AA9BrC,IAAM,OAAN;ACIA,MAAM,aAAa,CAAC,SAAS,QAAQ,QAAQ,OAAO;AAe9C,MAAA,qBAAqB,CAAC,WAAqC;AAChE,QAAA,YAAY,WAAW,QAAQ,MAAM;AAC3C,SAAO,CAAC,EAAE,YAAY,WAAW,QAAQ,KAAK,KAAK;AACrD;AAMa,MAAA,mBAAmB,CAAC,UAAkD;AAC3E,QAAA,EAAE,SAAS,QAAY,IAAA;AACtB,SAAA,CAAC,EAAE,UAAU;AAClB,QAAI,WAAW,QAAQ,CAAC,QAAQ,SAAS,GAAG;AAAU,aAAA;AACtD,QAAI,WAAW,QAAQ,QAAQ,SAAS,GAAG;AAAU,aAAA;AAC9C,WAAA;AAAA,EAAA;AAEX;AAM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