diff --git a/.agents/skills/verify-dist/SKILL.md b/.agents/skills/verify-dist/SKILL.md index 76d36df..e26d870 100644 --- a/.agents/skills/verify-dist/SKILL.md +++ b/.agents/skills/verify-dist/SKILL.md @@ -6,7 +6,9 @@ argument-hint: [--check | --fix] # Verify Dist Skill -`action-release` ships a bundled `dist/index.js` built by `ncc`. The `verify-dist` CI workflow (`.github/workflows/verify-dist.yml`) fails any PR where the committed bundle does not match the source. This skill keeps them in sync locally. +`action-release` ships a bundle in `dist/` built by `ncc`. The `verify-dist` CI workflow (`.github/workflows/verify-dist.yml`) fails any PR where the committed bundle does not match the source. This skill keeps them in sync locally. + +`dist/` is a directory, not a single file. Alongside `dist/index.js`, `ncc` emits code-split chunks (`dist/319.index.js` and friends) for every dynamic `import()` in a dependency. `@opentelemetry/resources` loads its per-platform `getMachineId` that way, so the chunks arrive with `@sentry/node`. `index.js` loads them at runtime with a relative `require`, so they must sit next to it and must all be committed. ## When to invoke @@ -24,10 +26,11 @@ Report whether `dist/` is in sync with the current source tree. Do not modify an yarn install --frozen-lockfile yarn build git diff --ignore-space-at-eol --stat dist/ +git ls-files --others --exclude-standard dist/ # new chunks show up here, not in git diff ``` -- If the diff is empty → `dist/` is in sync. Done. -- If the diff is non-empty → report the changed files and line counts, then ask the user whether to switch to `--fix`. +- If both commands print nothing → `dist/` is in sync. Done. +- If either prints something → report the changed files and line counts, then ask the user whether to switch to `--fix`. ### `--fix` @@ -70,9 +73,10 @@ CI does **not** run pre-commit. CI's `prepare-docker` job rejects PRs where `act ## Notes - The CI check runs `git diff --ignore-space-at-eol dist/` — whitespace-only diffs pass, anything else fails. Match that locally. +- CI also fails on untracked files in `dist/` via `git ls-files --others --exclude-standard dist/`. `git diff` alone never reports a brand-new chunk, so a missing chunk would otherwise pass CI and only break at runtime on whichever platform needs it. - `yarn build` shells out to `ncc build src/main.ts -e @sentry/cli`. `@sentry/cli` is deliberately excluded from the bundle because it ships its own native binaries at runtime. - The bundle diff can be large even for small source changes (minifier + bundler reshuffles). That is expected; just verify the intended symbols are present. -- Never hand-edit `dist/index.js`. Always regenerate. +- Never hand-edit `dist/index.js` or any chunk. Always regenerate. ## Related files diff --git a/.github/workflows/verify-dist.yml b/.github/workflows/verify-dist.yml index b379b36..e3c686a 100644 --- a/.github/workflows/verify-dist.yml +++ b/.github/workflows/verify-dist.yml @@ -38,8 +38,17 @@ jobs: - name: Compare expected and actual dist run: | if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then - echo "Detected uncommitted changes after build. Did you forget to commit `dist/index.js`?" + echo 'Detected uncommitted changes after build. Did you forget to commit dist/?' echo "Diff:" - git diff + git diff dist/ + exit 1 + fi + # ncc emits code-split chunks (e.g. dist/319.index.js) next to index.js + # whenever a dependency uses a dynamic import. A new chunk shows up as an + # untracked file, which `git diff` does not report, so check for it too. + untracked="$(git ls-files --others --exclude-standard dist/)" + if [ -n "$untracked" ]; then + echo 'Detected untracked files in dist/ after build. Did you forget to commit them?' + echo "$untracked" exit 1 fi diff --git a/action.yml b/action.yml index 3b5886d..5861d3a 100644 --- a/action.yml +++ b/action.yml @@ -167,7 +167,7 @@ runs: INPUT_WORKING_DIRECTORY: ${{ inputs.working_directory }} INPUT_DISABLE_TELEMETRY: ${{ inputs.disable_telemetry }} INPUT_DISABLE_SAFE_DIRECTORY: ${{ inputs.disable_safe_directory }} - uses: docker://ghcr.io/getsentry/action-release-image:ab-fix-js-yaml-transitive + uses: docker://ghcr.io/getsentry/action-release-image:ab-bump-sentry-node-v10 # For actions running on macos or windows runners, we use a composite # action approach which allows us to install the arch specific sentry-cli diff --git a/dist/319.index.js b/dist/319.index.js new file mode 100644 index 0000000..94e4e14 --- /dev/null +++ b/dist/319.index.js @@ -0,0 +1,37 @@ +"use strict"; +exports.id = 319; +exports.ids = [319]; +exports.modules = { + +/***/ 8319: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getMachineId = void 0; +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +const fs_1 = __webpack_require__(57147); +const api_1 = __webpack_require__(65163); +async function getMachineId() { + const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id']; + for (const path of paths) { + try { + const result = await fs_1.promises.readFile(path, { encoding: 'utf8' }); + return result.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + } + return undefined; +} +exports.getMachineId = getMachineId; +//# sourceMappingURL=getMachineId-linux.js.map + +/***/ }) + +}; +; \ No newline at end of file diff --git a/dist/605.index.js b/dist/605.index.js new file mode 100644 index 0000000..f16f5b6 --- /dev/null +++ b/dist/605.index.js @@ -0,0 +1,59 @@ +"use strict"; +exports.id = 605; +exports.ids = [605]; +exports.modules = { + +/***/ 70055: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.execAsync = void 0; +const child_process = __webpack_require__(32081); +const util = __webpack_require__(73837); +exports.execAsync = util.promisify(child_process.exec); +//# sourceMappingURL=execAsync.js.map + +/***/ }), + +/***/ 82605: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getMachineId = void 0; +const fs_1 = __webpack_require__(57147); +const execAsync_1 = __webpack_require__(70055); +const api_1 = __webpack_require__(65163); +async function getMachineId() { + try { + const result = await fs_1.promises.readFile('/etc/hostid', { encoding: 'utf8' }); + return result.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + try { + const result = await (0, execAsync_1.execAsync)('kenv -q smbios.system.uuid'); + return result.stdout.trim(); + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return undefined; +} +exports.getMachineId = getMachineId; +//# sourceMappingURL=getMachineId-bsd.js.map + +/***/ }) + +}; +; \ No newline at end of file diff --git a/dist/685.index.js b/dist/685.index.js new file mode 100644 index 0000000..7f7b5f6 --- /dev/null +++ b/dist/685.index.js @@ -0,0 +1,60 @@ +"use strict"; +exports.id = 685; +exports.ids = [685]; +exports.modules = { + +/***/ 70055: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.execAsync = void 0; +const child_process = __webpack_require__(32081); +const util = __webpack_require__(73837); +exports.execAsync = util.promisify(child_process.exec); +//# sourceMappingURL=execAsync.js.map + +/***/ }), + +/***/ 32685: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getMachineId = void 0; +const execAsync_1 = __webpack_require__(70055); +const api_1 = __webpack_require__(65163); +async function getMachineId() { + try { + const result = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"'); + const idLine = result.stdout + .split('\n') + .find(line => line.includes('IOPlatformUUID')); + if (!idLine) { + return undefined; + } + 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}`); + } + return undefined; +} +exports.getMachineId = getMachineId; +//# sourceMappingURL=getMachineId-darwin.js.map + +/***/ }) + +}; +; \ No newline at end of file diff --git a/dist/83.index.js b/dist/83.index.js new file mode 100644 index 0000000..ecf0f5a --- /dev/null +++ b/dist/83.index.js @@ -0,0 +1,27 @@ +"use strict"; +exports.id = 83; +exports.ids = [83]; +exports.modules = { + +/***/ 56083: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getMachineId = void 0; +const api_1 = __webpack_require__(65163); +async function getMachineId() { + api_1.diag.debug('could not read machine-id: unsupported platform'); + return undefined; +} +exports.getMachineId = getMachineId; +//# sourceMappingURL=getMachineId-unsupported.js.map + +/***/ }) + +}; +; \ No newline at end of file diff --git a/dist/937.index.js b/dist/937.index.js new file mode 100644 index 0000000..abb46c8 --- /dev/null +++ b/dist/937.index.js @@ -0,0 +1,60 @@ +"use strict"; +exports.id = 937; +exports.ids = [937]; +exports.modules = { + +/***/ 70055: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.execAsync = void 0; +const child_process = __webpack_require__(32081); +const util = __webpack_require__(73837); +exports.execAsync = util.promisify(child_process.exec); +//# sourceMappingURL=execAsync.js.map + +/***/ }), + +/***/ 29937: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getMachineId = void 0; +const process = __webpack_require__(77282); +const execAsync_1 = __webpack_require__(70055); +const api_1 = __webpack_require__(65163); +async function getMachineId() { + const args = 'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid'; + let command = '%windir%\\System32\\REG.exe'; + if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) { + command = '%windir%\\sysnative\\cmd.exe /c ' + command; + } + try { + const result = await (0, execAsync_1.execAsync)(`${command} ${args}`); + const parts = result.stdout.split('REG_SZ'); + if (parts.length === 2) { + return parts[1].trim(); + } + } + catch (e) { + api_1.diag.debug(`error reading machine id: ${e}`); + } + return undefined; +} +exports.getMachineId = getMachineId; +//# sourceMappingURL=getMachineId-win.js.map + +/***/ }) + +}; +; \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 7163ae6..8ee241f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3454,26 +3454,25 @@ function copyFile(srcFile, destFile, force) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_LOGGER = exports.NoopLogger = void 0; +exports.createNoopLogger = exports.NOOP_LOGGER = exports.NoopLogger = void 0; class NoopLogger { emit(_logRecord) { } + enabled() { + return false; + } } exports.NoopLogger = NoopLogger; exports.NOOP_LOGGER = new NoopLogger(); +/** + * Create a no-op Logger + */ +function createNoopLogger() { + return exports.NOOP_LOGGER; +} +exports.createNoopLogger = createNoopLogger; //# sourceMappingURL=NoopLogger.js.map /***/ }), @@ -3485,18 +3484,7 @@ exports.NOOP_LOGGER = new NoopLogger(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NOOP_LOGGER_PROVIDER = exports.NoopLoggerProvider = void 0; @@ -3519,25 +3507,14 @@ exports.NOOP_LOGGER_PROVIDER = new NoopLoggerProvider(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ProxyLogger = void 0; const NoopLogger_1 = __nccwpck_require__(81771); class ProxyLogger { - constructor(_provider, name, version, options) { - this._provider = _provider; + constructor(provider, name, version, options) { + this._provider = provider; this.name = name; this.version = version; this.options = options; @@ -3550,6 +3527,9 @@ class ProxyLogger { emit(logRecord) { this._getLogger().emit(logRecord); } + enabled(options) { + return this._getLogger().enabled(options); + } /** * Try to get a logger from the proxy logger provider. * If the proxy logger provider has no delegate, return a noop logger. @@ -3558,7 +3538,7 @@ class ProxyLogger { if (this._delegate) { return this._delegate; } - const logger = this._provider.getDelegateLogger(this.name, this.version, this.options); + const logger = this._provider._getDelegateLogger(this.name, this.version, this.options); if (!logger) { return NoopLogger_1.NOOP_LOGGER; } @@ -3578,18 +3558,7 @@ exports.ProxyLogger = ProxyLogger; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ProxyLoggerProvider = void 0; @@ -3598,19 +3567,28 @@ const ProxyLogger_1 = __nccwpck_require__(59538); class ProxyLoggerProvider { getLogger(name, version, options) { var _a; - return ((_a = this.getDelegateLogger(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyLogger_1.ProxyLogger(this, name, version, options)); + return ((_a = this._getDelegateLogger(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyLogger_1.ProxyLogger(this, name, version, options)); } - getDelegate() { + /** + * Get the delegate logger provider. + * Used by tests only. + * @internal + */ + _getDelegate() { var _a; return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; } /** * Set the delegate logger provider + * @internal */ - setDelegate(delegate) { + _setDelegate(delegate) { this._delegate = delegate; } - getDelegateLogger(name, version, options) { + /** + * @internal + */ + _getDelegateLogger(name, version, options) { var _a; return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getLogger(name, version, options); } @@ -3627,18 +3605,7 @@ exports.ProxyLoggerProvider = ProxyLoggerProvider; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LogsAPI = void 0; @@ -3660,7 +3627,7 @@ class LogsAPI { return this.getLoggerProvider(); } global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY] = (0, global_utils_1.makeGetter)(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER); - this._proxyLoggerProvider.setDelegate(provider); + this._proxyLoggerProvider._setDelegate(provider); return provider; } /** @@ -3673,9 +3640,17 @@ class LogsAPI { return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider); } /** - * Returns a logger from the global logger provider. + * Returns a Logger, creating one if one with the given name, version, + * schemaUrl, and attributes is not already created. * - * @returns Logger + * Getting a Logger may be expensive, especially when `attributes` are + * provided. Reuse Logger instances where possible instead of calling + * `getLogger()` on hot paths. + * + * @param name The name of the logger or instrumentation library. + * @param version The version of the logger or instrumentation library. + * @param options The options of the logger or instrumentation library. + * @returns {@link Logger} */ getLogger(name, version, options) { return this.getLoggerProvider().getLogger(name, version, options); @@ -3698,33 +3673,14 @@ exports.LogsAPI = LogsAPI; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.logs = exports.ProxyLoggerProvider = exports.ProxyLogger = exports.NoopLoggerProvider = exports.NOOP_LOGGER_PROVIDER = exports.NoopLogger = exports.NOOP_LOGGER = exports.SeverityNumber = void 0; +exports.logs = exports.createNoopLogger = exports.SeverityNumber = void 0; var LogRecord_1 = __nccwpck_require__(57440); Object.defineProperty(exports, "SeverityNumber", ({ enumerable: true, get: function () { return LogRecord_1.SeverityNumber; } })); var NoopLogger_1 = __nccwpck_require__(81771); -Object.defineProperty(exports, "NOOP_LOGGER", ({ enumerable: true, get: function () { return NoopLogger_1.NOOP_LOGGER; } })); -Object.defineProperty(exports, "NoopLogger", ({ enumerable: true, get: function () { return NoopLogger_1.NoopLogger; } })); -var NoopLoggerProvider_1 = __nccwpck_require__(13070); -Object.defineProperty(exports, "NOOP_LOGGER_PROVIDER", ({ enumerable: true, get: function () { return NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; } })); -Object.defineProperty(exports, "NoopLoggerProvider", ({ enumerable: true, get: function () { return NoopLoggerProvider_1.NoopLoggerProvider; } })); -var ProxyLogger_1 = __nccwpck_require__(59538); -Object.defineProperty(exports, "ProxyLogger", ({ enumerable: true, get: function () { return ProxyLogger_1.ProxyLogger; } })); -var ProxyLoggerProvider_1 = __nccwpck_require__(66927); -Object.defineProperty(exports, "ProxyLoggerProvider", ({ enumerable: true, get: function () { return ProxyLoggerProvider_1.ProxyLoggerProvider; } })); +Object.defineProperty(exports, "createNoopLogger", ({ enumerable: true, get: function () { return NoopLogger_1.createNoopLogger; } })); const logs_1 = __nccwpck_require__(93091); exports.logs = logs_1.LogsAPI.getInstance(); //# sourceMappingURL=index.js.map @@ -3732,30 +3688,18 @@ exports.logs = logs_1.LogsAPI.getInstance(); /***/ }), /***/ 39295: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_LOGS_API_KEY = void 0; -const platform_1 = __nccwpck_require__(40909); exports.GLOBAL_LOGS_API_KEY = Symbol.for('io.opentelemetry.js.api.logs'); -exports._global = platform_1._globalThis; +exports._global = globalThis; /** * Make a function which accepts a version integer and returns the instance of an API if the version * is compatible, or a fallback version (usually NOOP) if it is not. @@ -3780,91 +3724,6 @@ exports.API_BACKWARDS_COMPATIBILITY_VERSION = 1; /***/ }), -/***/ 40909: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -var node_1 = __nccwpck_require__(64460); -Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 20459: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 64460: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -var globalThis_1 = __nccwpck_require__(20459); -Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - /***/ 57440: /***/ ((__unused_webpack_module, exports) => { @@ -3872,18 +3731,7 @@ Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SeverityNumber = void 0; @@ -3926,18 +3774,7 @@ var SeverityNumber; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ContextAPI = void 0; @@ -3948,6 +3785,8 @@ const API_NAME = 'context'; const NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager(); /** * Singleton object which represents the entry point to the OpenTelemetry Context API + * + * @since 1.0.0 */ class ContextAPI { /** Empty private constructor prevents end users from constructing a new instance of the API */ @@ -4014,18 +3853,7 @@ exports.ContextAPI = ContextAPI; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiagAPI = void 0; @@ -4037,8 +3865,17 @@ const API_NAME = 'diag'; /** * Singleton object which represents the entry point to the OpenTelemetry internal * diagnostic API + * + * @since 1.0.0 */ 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 @@ -4094,13 +3931,6 @@ class DiagAPI { self.warn = _logProxy('warn'); self.error = _logProxy('error'); } - /** Get the singleton instance of the DiagAPI API */ - static instance() { - if (!this._instance) { - this._instance = new DiagAPI(); - } - return this._instance; - } } exports.DiagAPI = DiagAPI; //# sourceMappingURL=diag.js.map @@ -4114,18 +3944,7 @@ exports.DiagAPI = DiagAPI; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MetricsAPI = void 0; @@ -4182,18 +4001,7 @@ exports.MetricsAPI = MetricsAPI; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PropagationAPI = void 0; @@ -4207,6 +4015,8 @@ const API_NAME = 'propagation'; const NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator(); /** * Singleton object which represents the entry point to the OpenTelemetry Propagation API + * + * @since 1.0.0 */ class PropagationAPI { /** Empty private constructor prevents end users from constructing a new instance of the API */ @@ -4278,18 +4088,7 @@ exports.PropagationAPI = PropagationAPI; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceAPI = void 0; @@ -4301,6 +4100,8 @@ const diag_1 = __nccwpck_require__(11877); const API_NAME = 'trace'; /** * Singleton object which represents the entry point to the OpenTelemetry Tracing API + * + * @since 1.0.0 */ class TraceAPI { /** Empty private constructor prevents end users from constructing a new instance of the API */ @@ -4364,18 +4165,7 @@ exports.TraceAPI = TraceAPI; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.deleteBaggage = exports.setBaggage = exports.getActiveBaggage = exports.getBaggage = void 0; @@ -4434,18 +4224,7 @@ exports.deleteBaggage = deleteBaggage; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BaggageImpl = void 0; @@ -4461,7 +4240,7 @@ class BaggageImpl { return Object.assign({}, entry); } getAllEntries() { - return Array.from(this._entries.entries()).map(([k, v]) => [k, v]); + return Array.from(this._entries.entries()); } setEntry(key, entry) { const newBaggage = new BaggageImpl(this._entries); @@ -4496,18 +4275,7 @@ exports.BaggageImpl = BaggageImpl; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.baggageEntryMetadataSymbol = void 0; @@ -4526,18 +4294,7 @@ exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata'); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.baggageEntryMetadataFromString = exports.createBaggage = void 0; @@ -4559,6 +4316,7 @@ exports.createBaggage = createBaggage; * * @param str string metadata. Format is currently not defined by the spec and has no special meaning. * + * @since 1.0.0 */ function baggageEntryMetadataFromString(str) { if (typeof str !== 'string') { @@ -4584,25 +4342,17 @@ exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.context = void 0; // Split module-level variable definition into separate files to allow // tree-shaking on each api instance. const context_1 = __nccwpck_require__(57171); -/** Entrypoint for context API */ +/** + * Entrypoint for context API + * @since 1.0.0 + */ exports.context = context_1.ContextAPI.getInstance(); //# sourceMappingURL=context-api.js.map @@ -4615,18 +4365,7 @@ exports.context = context_1.ContextAPI.getInstance(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NoopContextManager = void 0; @@ -4660,22 +4399,15 @@ exports.NoopContextManager = NoopContextManager; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ROOT_CONTEXT = exports.createContextKey = void 0; -/** Get a key to uniquely identify a context value */ +/** + * Get a key to uniquely identify a context value + * + * @since 1.0.0 + */ function createContextKey(description) { // The specification states that for the same input, multiple calls should // return different keys. Due to the nature of the JS dependency management @@ -4709,7 +4441,11 @@ class BaseContext { }; } } -/** The root context is used as the default parent context when there is no active context */ +/** + * The root context is used as the default parent context when there is no active context + * + * @since 1.0.0 + */ exports.ROOT_CONTEXT = new BaseContext(); //# sourceMappingURL=context.js.map @@ -4722,18 +4458,7 @@ exports.ROOT_CONTEXT = new BaseContext(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.diag = void 0; @@ -4745,6 +4470,8 @@ const diag_1 = __nccwpck_require__(11877); * Defines Diagnostic handler used for internal diagnostic logging operations. * The default provides a Noop DiagLogger implementation which may be changed via the * diag.setLogger(logger: DiagLogger) function. + * + * @since 1.0.0 */ exports.diag = diag_1.DiagAPI.instance(); //# sourceMappingURL=diag-api.js.map @@ -4758,18 +4485,7 @@ exports.diag = diag_1.DiagAPI.instance(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiagComponentLogger = void 0; @@ -4810,8 +4526,7 @@ function logProxy(funcName, namespace, args) { if (!logger) { return; } - args.unshift(namespace); - return logger[funcName](...args); + return logger[funcName](namespace, ...args); } //# sourceMappingURL=ComponentLogger.js.map @@ -4824,21 +4539,10 @@ function logProxy(funcName, namespace, args) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagConsoleLogger = void 0; +exports.DiagConsoleLogger = exports._originalConsoleMethods = void 0; const consoleMap = [ { n: 'error', c: 'error' }, { n: 'warn', c: 'warn' }, @@ -4846,28 +4550,55 @@ const consoleMap = [ { n: 'debug', c: 'debug' }, { n: 'verbose', c: 'trace' }, ]; +// Save original console methods at module load time, before any instrumentation +// can wrap them. This ensures DiagConsoleLogger calls the unwrapped originals. +// Exported for testing only — not part of the public API. +exports._originalConsoleMethods = {}; +if (typeof console !== 'undefined') { + const keys = [ + 'error', + 'warn', + 'info', + 'debug', + 'trace', + 'log', + ]; + for (const key of keys) { + // eslint-disable-next-line no-console + if (typeof console[key] === 'function') { + // eslint-disable-next-line no-console + exports._originalConsoleMethods[key] = console[key]; + } + } +} /** * A simple Immutable Console based diagnostic logger which will output any messages to the Console. * If you want to limit the amount of logging to a specific level or lower use the * {@link createLogLevelDiagLogger} + * + * @since 1.0.0 */ class DiagConsoleLogger { constructor() { function _consoleFunc(funcName) { return function (...args) { - if (console) { - // Some environments only expose the console when the F12 developer console is open + // Prefer original (pre-instrumentation) methods saved at module load time. + let theFunc = exports._originalConsoleMethods[funcName]; + // Some environments only expose the console when the F12 developer console is open + if (typeof theFunc !== 'function') { + theFunc = exports._originalConsoleMethods['log']; + } + // Fall back in case console was not available at module load time but became available later. + if (typeof theFunc !== 'function' && console) { // eslint-disable-next-line no-console - let theFunc = console[funcName]; + theFunc = console[funcName]; if (typeof theFunc !== 'function') { - // Not all environments support all functions // eslint-disable-next-line no-console theFunc = console.log; } - // One last final check - if (typeof theFunc === 'function') { - return theFunc.apply(console, args); - } + } + if (typeof theFunc === 'function') { + return theFunc.apply(console, args); } }; } @@ -4888,18 +4619,7 @@ exports.DiagConsoleLogger = DiagConsoleLogger; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createLogLevelDiagLogger = void 0; @@ -4940,18 +4660,7 @@ exports.createLogLevelDiagLogger = createLogLevelDiagLogger; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiagLogLevel = void 0; @@ -4991,18 +4700,7 @@ var DiagLogLevel; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.trace = exports.propagation = exports.metrics = exports.diag = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.TraceFlags = exports.SpanStatusCode = exports.SpanKind = exports.SamplingDecision = exports.ProxyTracerProvider = exports.ProxyTracer = exports.defaultTextMapSetter = exports.defaultTextMapGetter = exports.ValueType = exports.createNoopMeter = exports.DiagLogLevel = exports.DiagConsoleLogger = exports.ROOT_CONTEXT = exports.createContextKey = exports.baggageEntryMetadataFromString = void 0; @@ -5028,6 +4726,7 @@ Object.defineProperty(exports, "defaultTextMapGetter", ({ enumerable: true, get: Object.defineProperty(exports, "defaultTextMapSetter", ({ enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapSetter; } })); var ProxyTracer_1 = __nccwpck_require__(43503); Object.defineProperty(exports, "ProxyTracer", ({ enumerable: true, get: function () { return ProxyTracer_1.ProxyTracer; } })); +// TODO: Remove ProxyTracerProvider export in the next major version. var ProxyTracerProvider_1 = __nccwpck_require__(2285); Object.defineProperty(exports, "ProxyTracerProvider", ({ enumerable: true, get: function () { return ProxyTracerProvider_1.ProxyTracerProvider; } })); var SamplingResult_1 = __nccwpck_require__(33209); @@ -5079,27 +4778,23 @@ exports["default"] = { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0; -const platform_1 = __nccwpck_require__(99957); const version_1 = __nccwpck_require__(98996); const semver_1 = __nccwpck_require__(81522); const major = version_1.VERSION.split('.')[0]; const GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`); -const _global = platform_1._globalThis; +const _global = (typeof globalThis === 'object' + ? globalThis + : typeof self === 'object' + ? self + : typeof window === 'object' + ? window + : typeof global === 'object' + ? global + : {}); function registerGlobal(type, instance, diag, allowOverride = false) { var _a; const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { @@ -5150,18 +4845,7 @@ exports.unregisterGlobal = unregisterGlobal; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isCompatible = exports._makeCompatibilityCheck = void 0; @@ -5279,25 +4963,18 @@ exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.metrics = void 0; // Split module-level variable definition into separate files to allow // tree-shaking on each api instance. const metrics_1 = __nccwpck_require__(17696); -/** Entrypoint for metrics API */ +/** + * Entrypoint for metrics API + * + * @since 1.3.0 + */ exports.metrics = metrics_1.MetricsAPI.getInstance(); //# sourceMappingURL=metrics-api.js.map @@ -5310,22 +4987,15 @@ exports.metrics = metrics_1.MetricsAPI.getInstance(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ValueType = void 0; -/** The Type of value. It describes how the data is reported. */ +/** + * The Type of value. It describes how the data is reported. + * + * @since 1.3.0 + */ var ValueType; (function (ValueType) { ValueType[ValueType["INT"] = 0] = "INT"; @@ -5342,18 +5012,7 @@ var ValueType; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_GAUGE_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopGaugeMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0; @@ -5460,6 +5119,8 @@ exports.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric(); exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric(); /** * Create a no-op Meter + * + * @since 1.3.0 */ function createNoopMeter() { return exports.NOOP_METER; @@ -5476,18 +5137,7 @@ exports.createNoopMeter = createNoopMeter; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; @@ -5507,107 +5157,6 @@ exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); /***/ }), -/***/ 99957: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(87200), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 89406: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 87200: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(89406), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - /***/ 17591: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -5615,25 +5164,18 @@ __exportStar(__nccwpck_require__(89406), exports); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.propagation = void 0; // Split module-level variable definition into separate files to allow // tree-shaking on each api instance. const propagation_1 = __nccwpck_require__(89909); -/** Entrypoint for propagation API */ +/** + * Entrypoint for propagation API + * + * @since 1.0.0 + */ exports.propagation = propagation_1.PropagationAPI.getInstance(); //# sourceMappingURL=propagation-api.js.map @@ -5646,18 +5188,7 @@ exports.propagation = propagation_1.PropagationAPI.getInstance(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NoopTextMapPropagator = void 0; @@ -5687,21 +5218,13 @@ exports.NoopTextMapPropagator = NoopTextMapPropagator; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0; +/** + * @since 1.0.0 + */ exports.defaultTextMapGetter = { get(carrier, key) { if (carrier == null) { @@ -5716,6 +5239,9 @@ exports.defaultTextMapGetter = { return Object.keys(carrier); }, }; +/** + * @since 1.0.0 + */ exports.defaultTextMapSetter = { set(carrier, key, value) { if (carrier == null) { @@ -5735,25 +5261,18 @@ exports.defaultTextMapSetter = { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.trace = void 0; // Split module-level variable definition into separate files to allow // tree-shaking on each api instance. const trace_1 = __nccwpck_require__(81539); -/** Entrypoint for trace API */ +/** + * Entrypoint for trace API + * + * @since 1.0.0 + */ exports.trace = trace_1.TraceAPI.getInstance(); //# sourceMappingURL=trace-api.js.map @@ -5766,18 +5285,7 @@ exports.trace = trace_1.TraceAPI.getInstance(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NonRecordingSpan = void 0; @@ -5788,8 +5296,8 @@ const invalid_span_constants_1 = __nccwpck_require__(91760); * propagation. */ class NonRecordingSpan { - constructor(_spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) { - this._spanContext = _spanContext; + constructor(spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) { + this._spanContext = spanContext; } // Returns a SpanContext. spanContext() { @@ -5842,18 +5350,7 @@ exports.NonRecordingSpan = NonRecordingSpan; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NoopTracer = void 0; @@ -5908,9 +5405,13 @@ class NoopTracer { } exports.NoopTracer = NoopTracer; function isSpanContext(spanContext) { - return (typeof spanContext === 'object' && + 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'); } //# sourceMappingURL=NoopTracer.js.map @@ -5924,18 +5425,7 @@ function isSpanContext(spanContext) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NoopTracerProvider = void 0; @@ -5963,18 +5453,7 @@ exports.NoopTracerProvider = NoopTracerProvider; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ProxyTracer = void 0; @@ -5982,10 +5461,12 @@ const NoopTracer_1 = __nccwpck_require__(17606); const NOOP_TRACER = new NoopTracer_1.NoopTracer(); /** * Proxy tracer provided by the proxy tracer provider + * + * @since 1.0.0 */ class ProxyTracer { - constructor(_provider, name, version, options) { - this._provider = _provider; + constructor(provider, name, version, options) { + this._provider = provider; this.name = name; this.version = version; this.options = options; @@ -6025,18 +5506,7 @@ exports.ProxyTracer = ProxyTracer; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ProxyTracerProvider = void 0; @@ -6050,6 +5520,9 @@ const NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider(); * When a delegate is set, traces are provided from the delegate. * When a delegate is set after tracers have already been provided, * all tracers already provided will use the provided delegate implementation. + * + * @deprecated This will be removed in the next major version. + * @since 1.0.0 */ class ProxyTracerProvider { /** @@ -6086,18 +5559,7 @@ exports.ProxyTracerProvider = ProxyTracerProvider; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SamplingDecision = void 0; @@ -6105,6 +5567,8 @@ exports.SamplingDecision = void 0; * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead. * A sampling decision that determines how a {@link Span} will be recorded * and collected. + * + * @since 1.0.0 */ var SamplingDecision; (function (SamplingDecision) { @@ -6135,18 +5599,7 @@ var SamplingDecision; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getActiveSpan = exports.getSpan = void 0; @@ -6224,18 +5677,7 @@ exports.getSpanContext = getSpanContext; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceStateImpl = void 0; @@ -6278,20 +5720,21 @@ class TraceStateImpl { return this._internalState.get(key); } serialize() { - return this._keys() - .reduce((agg, key) => { + return (Array.from(this._internalState.keys()) + // Use reduceRight() because keys are stored in reverse insertion order. + .reduceRight((agg, key) => { agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); return agg; }, []) - .join(LIST_MEMBERS_SEPARATOR); + .join(LIST_MEMBERS_SEPARATOR)); } _parse(rawTraceState) { if (rawTraceState.length > MAX_TRACE_STATE_LEN) return; this._internalState = rawTraceState .split(LIST_MEMBERS_SEPARATOR) - .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { + // Use reduceRight() so new keys (.set(...)) will be placed at the beginning + .reduceRight((agg, part) => { const listMember = part.trim(); // Optional Whitespace (OWS) handling const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); if (i !== -1) { @@ -6313,6 +5756,7 @@ class TraceStateImpl { .slice(0, MAX_TRACE_STATE_ITEMS)); } } + // @ts-expect-error TS6133 Accessed in tests only. _keys() { return Array.from(this._internalState.keys()).reverse(); } @@ -6334,18 +5778,7 @@ exports.TraceStateImpl = TraceStateImpl; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateValue = exports.validateKey = void 0; @@ -6387,22 +5820,14 @@ exports.validateValue = validateValue; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createTraceState = void 0; const tracestate_impl_1 = __nccwpck_require__(62110); +/** + * @since 1.1.0 + */ function createTraceState(rawTraceState) { return new tracestate_impl_1.TraceStateImpl(rawTraceState); } @@ -6418,24 +5843,22 @@ exports.createTraceState = createTraceState; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; const trace_flags_1 = __nccwpck_require__(26905); +/** + * @since 1.0.0 + */ exports.INVALID_SPANID = '0000000000000000'; +/** + * @since 1.0.0 + */ exports.INVALID_TRACEID = '00000000000000000000000000000000'; +/** + * @since 1.0.0 + */ exports.INVALID_SPAN_CONTEXT = { traceId: exports.INVALID_TRACEID, spanId: exports.INVALID_SPANID, @@ -6450,22 +5873,14 @@ exports.INVALID_SPAN_CONTEXT = { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanKind = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SpanKind = void 0; +/** + * @since 1.0.0 */ var SpanKind; (function (SpanKind) { @@ -6507,34 +5922,51 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ const invalid_span_constants_1 = __nccwpck_require__(91760); const NonRecordingSpan_1 = __nccwpck_require__(81462); -const VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; -const VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; +// Valid characters (0-9, a-f, A-F) are marked as 1. +const 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, +]); +function isValidHex(id, length) { + // As of 1.9.0 the id was allowed to be a non-string value, + // even though it was not possible in the types. + 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 VALID_TRACEID_REGEX.test(traceId) && traceId !== invalid_span_constants_1.INVALID_TRACEID; + return isValidHex(traceId, 32) && traceId !== invalid_span_constants_1.INVALID_TRACEID; } exports.isValidTraceId = isValidTraceId; +/** + * @since 1.0.0 + */ function isValidSpanId(spanId) { - return VALID_SPANID_REGEX.test(spanId) && spanId !== invalid_span_constants_1.INVALID_SPANID; + return isValidHex(spanId, 16) && spanId !== invalid_span_constants_1.INVALID_SPANID; } exports.isValidSpanId = isValidSpanId; /** * 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)); @@ -6559,10 +5991,16 @@ exports.wrapSpanContext = wrapSpanContext; "use strict"; +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SpanStatusCode = void 0; /** * An enumeration of status codes. + * + * @since 1.0.0 */ var SpanStatusCode; (function (SpanStatusCode) { @@ -6593,18 +6031,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceFlags = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 + */ +/** + * @since 1.0.0 */ var TraceFlags; (function (TraceFlags) { @@ -6624,427 +6054,16 @@ var TraceFlags; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VERSION = void 0; // this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.9.0'; +exports.VERSION = '1.9.1'; //# sourceMappingURL=version.js.map /***/ }), -/***/ 85788: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AbstractAsyncHooksContextManager = void 0; -const events_1 = __nccwpck_require__(82361); -const ADD_LISTENER_METHODS = [ - 'addListener', - 'on', - 'once', - 'prependListener', - 'prependOnceListener', -]; -class AbstractAsyncHooksContextManager { - constructor() { - this._kOtListeners = Symbol('OtListeners'); - this._wrapped = false; - } - /** - * 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, target) { - if (target instanceof events_1.EventEmitter) { - return this._bindEventEmitter(context, target); - } - if (typeof target === 'function') { - return this._bindFunction(context, target); - } - return target; - } - _bindFunction(context, target) { - const manager = this; - const contextWrapper = function (...args) { - return manager.with(context, () => 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. - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - 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, ee) { - const map = this._getPatchMap(ee); - if (map !== undefined) - return ee; - this._createPatchMap(ee); - // patch methods that add a listener to propagate context - ADD_LISTENER_METHODS.forEach(methodName => { - if (ee[methodName] === undefined) - return; - ee[methodName] = this._patchAddListener(ee, ee[methodName], context); - }); - // patch methods that remove a listener - if (typeof ee.removeListener === 'function') { - ee.removeListener = this._patchRemoveListener(ee, ee.removeListener); - } - if (typeof ee.off === 'function') { - ee.off = this._patchRemoveListener(ee, ee.off); - } - // patch method that remove all listeners - 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) { - var _a; - const events = (_a = contextManager._getPatchMap(ee)) === null || _a === void 0 ? void 0 : _a[event]; - if (events === undefined) { - 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 !== undefined) { - if (arguments.length === 0) { - contextManager._createPatchMap(ee); - } - else if (map[event] !== undefined) { - 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) { - 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 === undefined) { - map = contextManager._createPatchMap(ee); - } - let listeners = map[event]; - if (listeners === undefined) { - listeners = new WeakMap(); - map[event] = listeners; - } - const patchedListener = contextManager.bind(context, listener); - // store a weak reference of the user listener to ours - 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); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ee[this._kOtListeners] = map; - return map; - } - _getPatchMap(ee) { - return ee[this._kOtListeners]; - } -} -exports.AbstractAsyncHooksContextManager = AbstractAsyncHooksContextManager; -//# sourceMappingURL=AbstractAsyncHooksContextManager.js.map - -/***/ }), - -/***/ 14096: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AsyncHooksContextManager = void 0; -const api_1 = __nccwpck_require__(65163); -const asyncHooks = __nccwpck_require__(50852); -const AbstractAsyncHooksContextManager_1 = __nccwpck_require__(85788); -class AsyncHooksContextManager extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { - constructor() { - super(); - this._contexts = new Map(); - this._stack = []; - 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() { - var _a; - return (_a = this._stack[this._stack.length - 1]) !== null && _a !== void 0 ? _a : api_1.ROOT_CONTEXT; - } - with(context, fn, thisArg, ...args) { - this._enterContext(context); - 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) { - // ignore TIMERWRAP as they combine timers with same timeout which can lead to - // false context propagation. TIMERWRAP has been removed in node 11 - // every timer has it's own `Timeout` resource anyway which is used to propagate - // context. - if (type === 'TIMERWRAP') - return; - const context = this._stack[this._stack.length - 1]; - if (context !== undefined) { - this._contexts.set(uid, context); - } - } - /** - * 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 = this._contexts.get(uid); - if (context !== undefined) { - this._enterContext(context); - } - } - /** - * After hook is called just after completing the execution of a async context. - */ - _after() { - this._exitContext(); - } - /** - * Set the given context as active - */ - _enterContext(context) { - this._stack.push(context); - } - /** - * Remove the context at the root of the stack - */ - _exitContext() { - this._stack.pop(); - } -} -exports.AsyncHooksContextManager = AsyncHooksContextManager; -//# sourceMappingURL=AsyncHooksContextManager.js.map - -/***/ }), - -/***/ 20551: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AsyncLocalStorageContextManager = void 0; -const api_1 = __nccwpck_require__(65163); -const async_hooks_1 = __nccwpck_require__(50852); -const AbstractAsyncHooksContextManager_1 = __nccwpck_require__(85788); -class AsyncLocalStorageContextManager extends AbstractAsyncHooksContextManager_1.AbstractAsyncHooksContextManager { - constructor() { - super(); - this._asyncLocalStorage = new async_hooks_1.AsyncLocalStorage(); - } - active() { - var _a; - return (_a = this._asyncLocalStorage.getStore()) !== null && _a !== void 0 ? _a : api_1.ROOT_CONTEXT; - } - with(context, fn, thisArg, ...args) { - const cb = thisArg == null ? fn : fn.bind(thisArg); - return this._asyncLocalStorage.run(context, cb, ...args); - } - enable() { - return this; - } - disable() { - this._asyncLocalStorage.disable(); - return this; - } -} -exports.AsyncLocalStorageContextManager = AsyncLocalStorageContextManager; -//# sourceMappingURL=AsyncLocalStorageContextManager.js.map - -/***/ }), - -/***/ 81616: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AsyncLocalStorageContextManager = exports.AsyncHooksContextManager = void 0; -var AsyncHooksContextManager_1 = __nccwpck_require__(14096); -Object.defineProperty(exports, "AsyncHooksContextManager", ({ enumerable: true, get: function () { return AsyncHooksContextManager_1.AsyncHooksContextManager; } })); -var AsyncLocalStorageContextManager_1 = __nccwpck_require__(20551); -Object.defineProperty(exports, "AsyncLocalStorageContextManager", ({ enumerable: true, get: function () { return AsyncLocalStorageContextManager_1.AsyncLocalStorageContextManager; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - /***/ 67959: /***/ ((__unused_webpack_module, exports) => { @@ -7052,18 +6071,7 @@ Object.defineProperty(exports, "AsyncLocalStorageContextManager", ({ enumerable: /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExportResultCode = void 0; @@ -7071,7 +6079,7 @@ var ExportResultCode; (function (ExportResultCode) { ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; -})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); +})(ExportResultCode || (exports.ExportResultCode = ExportResultCode = {})); //# sourceMappingURL=ExportResult.js.map /***/ }), @@ -7083,18 +6091,7 @@ var ExportResultCode; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ 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; @@ -7120,18 +6117,7 @@ exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.W3CBaggagePropagator = void 0; @@ -7162,27 +6148,21 @@ class W3CBaggagePropagator { } extract(context, carrier, getter) { const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); - const baggageString = Array.isArray(headerValue) - ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) - : headerValue; - if (!baggageString) - return context; - const baggage = {}; - if (baggageString.length === 0) { + if (!headerValue) { return context; } - const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); - pairs.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; + 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); } - }); - if (Object.entries(baggage).length === 0) { + } + else { + [count] = (0, utils_1.parseBaggageHeaderString)(headerValue, baggage, count, totalSize); + } + if (count === 0) { return context; } return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); @@ -7202,22 +6182,7 @@ exports.W3CBaggagePropagator = W3CBaggagePropagator; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ +exports.parseKeyPairsIntoRecord = exports.parseBaggageHeaderString = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; const api_1 = __nccwpck_require__(65163); const constants_1 = __nccwpck_require__(36178); function serializeKeyPairs(keyPairs) { @@ -7240,42 +6205,84 @@ function getKeyPairs(baggage) { } 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) + 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 key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim()); - const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim()); + 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 (valueProps.length > 0) { - metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); + 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) { + // Comma separator is counted for every accepted entry after the first + 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) { - if (typeof value !== 'string' || value.length === 0) - return {}; - return value - .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) - .map(entry => { - return parsePairKeyValue(entry); - }) - .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) - .reduce((headers, keyPair) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - headers[keyPair.key] = keyPair.value; - return headers; - }, {}); + const result = {}; + if (typeof value === 'string' && value.length > 0) { + value.split(constants_1.BAGGAGE_ITEMS_SEPARATOR).forEach(entry => { + const keyPair = parsePairKeyValue(entry); + if (keyPair !== undefined && keyPair.value.length > 0) { + result[keyPair.key] = keyPair.value; + } + }); + } + return result; } exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; //# sourceMappingURL=utils.js.map @@ -7289,18 +6296,7 @@ exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AnchoredClock = void 0; @@ -7322,6 +6318,9 @@ exports.AnchoredClock = void 0; * https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/AnchoredClock.java */ class AnchoredClock { + _monotonicClock; + _epochMillis; + _performanceMillis; /** * Create a new AnchoredClock anchored to the current time returned by systemClock. * @@ -7354,18 +6353,7 @@ exports.AnchoredClock = AnchoredClock; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; @@ -7375,11 +6363,15 @@ function sanitizeAttributes(attributes) { if (typeof attributes !== 'object' || attributes == null) { return out; } - for (const [key, val] of Object.entries(attributes)) { + 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; @@ -7395,7 +6387,7 @@ function sanitizeAttributes(attributes) { } exports.sanitizeAttributes = sanitizeAttributes; function isAttributeKey(key) { - return typeof key === 'string' && key.length > 0; + return typeof key === 'string' && key !== ''; } exports.isAttributeKey = isAttributeKey; function isAttributeValue(val) { @@ -7405,7 +6397,7 @@ function isAttributeValue(val) { if (Array.isArray(val)) { return isHomogeneousAttributeValueArray(val); } - return isValidPrimitiveAttributeValue(val); + return isValidPrimitiveAttributeValueType(typeof val); } exports.isAttributeValue = isAttributeValue; function isHomogeneousAttributeValueArray(arr) { @@ -7414,23 +6406,24 @@ function isHomogeneousAttributeValueArray(arr) { // null/undefined elements are allowed if (element == null) continue; + const elementType = typeof element; + if (elementType === type) { + continue; + } if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; + if (isValidPrimitiveAttributeValueType(elementType)) { + type = elementType; continue; } // encountered an invalid primitive return false; } - if (typeof element === type) { - continue; - } return false; } return true; } -function isValidPrimitiveAttributeValue(val) { - switch (typeof val) { +function isValidPrimitiveAttributeValueType(valType) { + switch (valType) { case 'number': case 'boolean': case 'string': @@ -7449,18 +6442,7 @@ function isValidPrimitiveAttributeValue(val) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; @@ -7483,59 +6465,29 @@ function globalErrorHandler(ex) { try { delegateHandler(ex); } - catch (_a) { } // eslint-disable-line no-empty + catch { } // eslint-disable-line no-empty } exports.globalErrorHandler = globalErrorHandler; //# sourceMappingURL=global-error-handler.js.map /***/ }), -/***/ 54986: +/***/ 46128: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBinary = void 0; -function intValue(charCode) { - // 0-9 - if (charCode >= 48 && charCode <= 57) { - return charCode - 48; - } - // a-f - if (charCode >= 97 && charCode <= 102) { - return charCode - 87; - } - // A-F - 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; -//# sourceMappingURL=hex-to-binary.js.map +exports._globalThis = void 0; +/** + * @deprecated Use globalThis directly instead. + */ +exports._globalThis = globalThis; +//# sourceMappingURL=globalThis.js.map /***/ }), @@ -7546,18 +6498,7 @@ exports.hexToBinary = hexToBinary; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.loggingErrorHandler = void 0; @@ -7616,21 +6557,10 @@ function flattenException(ex) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ 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; +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 = __nccwpck_require__(6730); const NANOSECOND_DIGITS = 9; const NANOSECOND_DIGITS_IN_MILLIS = 6; @@ -7649,13 +6579,11 @@ function millisToHrTime(epochMillis) { return [seconds, nanos]; } exports.millisToHrTime = millisToHrTime; +/** + * @deprecated Use `performance.timeOrigin` directly. + */ 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; + return platform_1.otperformance.timeOrigin; } exports.getTimeOrigin = getTimeOrigin; /** @@ -7663,7 +6591,7 @@ exports.getTimeOrigin = getTimeOrigin; * @param performanceNow */ function hrTime(performanceNow) { - const timeOrigin = millisToHrTime(getTimeOrigin()); + const timeOrigin = millisToHrTime(platform_1.otperformance.timeOrigin); const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); return addHrTimes(timeOrigin, now); } @@ -7679,8 +6607,22 @@ function timeInputToHrTime(time) { return time; } else if (typeof time === 'number') { - // Must be a performance.now() if it's smaller than process start time. - if (time < getTimeOrigin()) { + // Distinguish between a relative performance.now() value and an absolute + // epoch-millisecond timestamp. + // + // performance.timeOrigin uses a monotonic clock that may be slightly ahead + // of Date.now() due to clock adjustments (see MDN docs). This means a + // real epoch-ms value (e.g. Date.now()) can land just below + // performance.timeOrigin, causing it to be misclassified as a relative + // performance.now() reading and doubled when timeOrigin is added. + // + // A genuine performance.now() value represents elapsed time since the + // document/process started, so it is bounded by system uptime. No real + // system has been running long enough for performance.now() to reach half + // the current epoch time (~1994 in ms terms). We therefore treat any value + // below half of performance.timeOrigin as a relative performance.now() + // reading, and everything else as an absolute epoch-millisecond timestamp. + if (time < platform_1.otperformance.timeOrigin / 2) { return hrTime(time); } else { @@ -7733,6 +6675,14 @@ 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 @@ -7742,13 +6692,13 @@ function hrTimeToMilliseconds(time) { } exports.hrTimeToMilliseconds = hrTimeToMilliseconds; /** - * Convert hrTime to microseconds. + * Convert hrTime to seconds. * @param time */ -function hrTimeToMicroseconds(time) { - return time[0] * 1e6 + time[1] / 1e3; +function hrTimeToSeconds(time) { + return time[0] + time[1] / SECOND_TO_NANOSECONDS; } -exports.hrTimeToMicroseconds = hrTimeToMicroseconds; +exports.hrTimeToSeconds = hrTimeToSeconds; /** * check if time is HrTime * @param value @@ -7787,6 +6737,31 @@ exports.addHrTimes = addHrTimes; /***/ }), +/***/ 32289: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +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; +//# sourceMappingURL=timer-util.js.map + +/***/ }), + /***/ 89736: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -7794,28 +6769,16 @@ exports.addHrTimes = addHrTimes; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = 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.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = 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.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; -exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; +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 = __nccwpck_require__(61476); Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); var anchored_clock_1 = __nccwpck_require__(54848); Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); var attributes_1 = __nccwpck_require__(82807); -Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); 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 = __nccwpck_require__(69246); @@ -7831,31 +6794,26 @@ Object.defineProperty(exports, "hrTimeDuration", ({ enumerable: true, get: funct 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 hex_to_binary_1 = __nccwpck_require__(54986); -Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); +var timer_util_1 = __nccwpck_require__(32289); +Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); var ExportResult_1 = __nccwpck_require__(67959); Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); -const utils_1 = __nccwpck_require__(49884); -exports.baggageUtils = { - getKeyPairs: utils_1.getKeyPairs, - serializeKeyPairs: utils_1.serializeKeyPairs, - parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, - parsePairKeyValue: utils_1.parsePairKeyValue, -}; +var utils_1 = __nccwpck_require__(49884); +Object.defineProperty(exports, "parseKeyPairsIntoRecord", ({ enumerable: true, get: function () { return utils_1.parseKeyPairsIntoRecord; } })); var platform_1 = __nccwpck_require__(6730); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); 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, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); +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 = __nccwpck_require__(57785); Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); var W3CTraceContextPropagator_1 = __nccwpck_require__(61463); @@ -7868,43 +6826,24 @@ Object.defineProperty(exports, "RPCType", ({ enumerable: true, get: function () 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 AlwaysOffSampler_1 = __nccwpck_require__(16478); -Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); -var AlwaysOnSampler_1 = __nccwpck_require__(88317); -Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); -var ParentBasedSampler_1 = __nccwpck_require__(15136); -Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); -var TraceIdRatioBasedSampler_1 = __nccwpck_require__(69326); -Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); var suppress_tracing_1 = __nccwpck_require__(54463); 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 = __nccwpck_require__(1914); Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); -var environment_1 = __nccwpck_require__(7238); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); -Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); var merge_1 = __nccwpck_require__(65387); Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); -var sampling_1 = __nccwpck_require__(28289); -Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); var timeout_1 = __nccwpck_require__(48400); 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 = __nccwpck_require__(90839); 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 wrap_1 = __nccwpck_require__(67226); -Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); var callback_1 = __nccwpck_require__(12408); Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); -var version_1 = __nccwpck_require__(55687); -Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); +var configuration_1 = __nccwpck_require__(28002); +Object.defineProperty(exports, "diagLogLevelFromString", ({ enumerable: true, get: function () { return configuration_1.diagLogLevelFromString; } })); const exporter_1 = __nccwpck_require__(87795); exports.internal = { _export: exporter_1._export, @@ -7920,18 +6859,7 @@ exports.internal = { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports._export = void 0; @@ -7945,9 +6873,7 @@ function _export(exporter, arg) { return new Promise(resolve => { // prevent downstream exporter calls from generating spans api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { - exporter.export(arg, (result) => { - resolve(result); - }); + exporter.export(arg, resolve); }); }); } @@ -7963,18 +6889,7 @@ exports._export = _export; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateValue = exports.validateKey = void 0; @@ -8015,101 +6930,23 @@ exports.validateValue = validateValue; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; +exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 node_1 = __nccwpck_require__(9340); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); 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, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); 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; } })); //# sourceMappingURL=index.js.map /***/ }), -/***/ 25476: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = void 0; -const SPAN_ID_BYTES = 8; -const TRACE_ID_BYTES = 16; -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - */ -class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.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++) { - // unsigned right shift drops decimal part of the number - // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE - SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); - } - // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated - 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); - }; -} -//# sourceMappingURL=RandomIdGenerator.js.map - -/***/ }), - /***/ 76494: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -8117,98 +6954,99 @@ function getIdGenerator(bytes) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEnvWithoutDefaults = exports.getEnv = void 0; -const environment_1 = __nccwpck_require__(7238); +exports.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0; +const api_1 = __nccwpck_require__(65163); +const util_1 = __nccwpck_require__(73837); /** - * Gets the environment variables + * 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 getEnv() { - const processEnv = (0, environment_1.parseEnvironment)(process.env); - return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); +function getNumberFromEnv(key) { + const raw = process.env[key]; + if (raw == null || raw.trim() === '') { + return undefined; + } + 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 undefined; + } + return value; } -exports.getEnv = getEnv; -function getEnvWithoutDefaults() { - return (0, environment_1.parseEnvironment)(process.env); +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 undefined; + } + return raw; } -exports.getEnvWithoutDefaults = getEnvWithoutDefaults; +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 === '') { + // NOTE: falling back to `false` instead of `undefined` as required by the specification. + // If you have a use-case that requires `undefined`, consider using `getStringFromEnv()` and applying the necessary + // normalizations in the consuming code. + 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; //# sourceMappingURL=environment.js.map /***/ }), -/***/ 57196: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 75004: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBase64 = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const hex_to_binary_1 = __nccwpck_require__(54986); -function hexToBase64(hexStr) { - return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); -} -exports.hexToBase64 = hexToBase64; -//# sourceMappingURL=hex-to-base64.js.map - -/***/ }), - /***/ 9340: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -8216,65 +7054,24 @@ exports.hexToBase64 = hexToBase64; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; +exports.otperformance = exports.SDK_INFO = exports._globalThis = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = void 0; var environment_1 = __nccwpck_require__(76494); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); -var globalThis_1 = __nccwpck_require__(57196); +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 = __nccwpck_require__(46128); Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); -var hex_to_base64_1 = __nccwpck_require__(75004); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); -var RandomIdGenerator_1 = __nccwpck_require__(25476); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); -var performance_1 = __nccwpck_require__(39338); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); var sdk_info_1 = __nccwpck_require__(10265); Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); -var timer_util_1 = __nccwpck_require__(51027); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 39338: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. +/** + * @deprecated Use performance directly. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.otperformance = void 0; -const perf_hooks_1 = __nccwpck_require__(4074); -exports.otperformance = perf_hooks_1.performance; -//# sourceMappingURL=performance.js.map +exports.otperformance = performance; +//# sourceMappingURL=index.js.map /***/ }), @@ -8285,64 +7082,24 @@ exports.otperformance = perf_hooks_1.performance; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SDK_INFO = void 0; const version_1 = __nccwpck_require__(55687); const semantic_conventions_1 = __nccwpck_require__(67275); +const semconv_1 = __nccwpck_require__(90729); /** Constants describing the SDK in use */ exports.SDK_INFO = { - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, + [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, }; //# sourceMappingURL=sdk-info.js.map /***/ }), -/***/ 51027: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -function unrefTimer(timer) { - timer.unref(); -} -exports.unrefTimer = unrefTimer; -//# sourceMappingURL=timer-util.js.map - -/***/ }), - /***/ 57785: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -8350,36 +7107,31 @@ exports.unrefTimer = unrefTimer; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CompositePropagator = void 0; const api_1 = __nccwpck_require__(65163); /** Combines multiple propagators into a single propagator. */ class CompositePropagator { + _propagators; + _fields; /** * Construct a composite propagator from a list of propagators. * * @param [config] Configuration object for composite propagator */ constructor(config = {}) { - var _a; - this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; - this._fields = Array.from(new Set(this._propagators + this._propagators = config.propagators ?? []; + const fields = new Set(); + for (const propagator of this._propagators) { // older propagators may not have fields function, null check to be sure - .map(p => (typeof p.fields === 'function' ? p.fields() : [])) - .reduce((x, y) => x.concat(y), []))); + 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. @@ -8430,6 +7182,34 @@ exports.CompositePropagator = CompositePropagator; /***/ }), +/***/ 90729: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ATTR_PROCESS_RUNTIME_NAME = void 0; +/* + * This file contains a copy of unstable semantic convention definitions + * used by this package. + * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv + */ +/** + * 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'; +//# sourceMappingURL=semconv.js.map + +/***/ }), + /***/ 1914: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -8437,18 +7217,7 @@ exports.CompositePropagator = CompositePropagator; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceState = void 0; @@ -8467,71 +7236,121 @@ const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; * beginning of the list. */ class TraceState { + _length; + _rawTraceState; + _internalState; constructor(rawTraceState) { - this._internalState = new Map(); - if (rawTraceState) - this._parse(rawTraceState); + this._rawTraceState = + typeof rawTraceState === 'string' ? rawTraceState : ''; + this._length = this._rawTraceState.length; } set(key, value) { - // TODO: Benchmark the different approaches(map vs list) and - // use the faster one. - const traceState = this._clone(); - if (traceState._internalState.has(key)) { - traceState._internalState.delete(key); + if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) { + return this; } - traceState._internalState.set(key, value); - return traceState; + const currState = this._getState(); + const currValue = currState.get(key); + // Get the new length depending if we already have a value or not + // - for existing keys we add the difference between the length of the values + // - for new keys is the key & value lenght plus + // - +1 for the key/value splitter + // - +1 for the separator if there are other keys + 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 traceState = this._clone(); - traceState._internalState.delete(key); - return traceState; + const currState = this._getState(); + const currValue = currState.get(key); + // No need to create a new instance if the key does not exist + if (typeof currValue !== 'string') { + return this; + } + // Get the new length depending if we already have a value or not + // - for existing keys we substract key and value length plus + // - +1 for the key/value splitter + // - +1 for the separator if there are other keys + let newLength = this._length - (key.length + currValue.length + 1); + if (currState.size > 1) { + // remove separator from length if there's no key or only one. + newLength = newLength - 1; + } + const newState = new Map(currState); + newState.delete(key); + return this._fromState(newState, newLength); } get(key) { - return this._internalState.get(key); + const currState = this._getState(); + return currState.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() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { - const listMember = part.trim(); // Optional Whitespace (OWS) handling - 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); - } - else { - // TODO: Consider to add warning log - } + // Maps put new entries at the end. We prepend the seralized entry + // to get the right order according to the spec (updated members go 1st) + let serialized = ''; + let index = 0; + for (const entry of this._getState()) { + if (index > 0) { + serialized = LIST_MEMBERS_SEPARATOR + serialized; } - return agg; - }, new Map()); - // Because of the reverse() requirement, trunc must be done after map is created - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { - this._internalState = new Map(Array.from(this._internalState.entries()) - .reverse() // Use reverse same as original tracestate parse chain - .slice(0, MAX_TRACE_STATE_ITEMS)); + serialized = + `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized; + index++; } + return serialized; } - _keys() { - return Array.from(this._internalState.keys()).reverse(); + _getState() { + if (this._internalState) { + return this._internalState; + } + // Not parsed yet, lets do it + const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR); + // This Map will have the order reversed + const vendorEntries = 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; + } + // Skip if adding the new member exceeds the length + const futureLength = currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0); + if (futureLength > MAX_TRACE_STATE_LEN) { + continue; + } + // All good, add it + vendorEntries.set(key, value); + currentLength = futureLength; + // Check if we reached the max items + if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) { + break; + } + } + // Now we set the length & the Map in the right order + this._length = currentLength; + this._internalState = new Map(Array.from(vendorEntries.entries()).reverse()); + return this._internalState; } - _clone() { - const traceState = new TraceState(); - traceState._internalState = new Map(this._internalState); + _fromState(state, length) { + const traceState = Object.create(TraceState.prototype); + traceState._internalState = state; + traceState._length = length; return traceState; } } @@ -8547,18 +7366,7 @@ exports.TraceState = TraceState; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; @@ -8658,18 +7466,7 @@ exports.W3CTraceContextPropagator = W3CTraceContextPropagator; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; @@ -8678,7 +7475,7 @@ const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context var RPCType; (function (RPCType) { RPCType["HTTP"] = "http"; -})(RPCType = exports.RPCType || (exports.RPCType = {})); +})(RPCType || (exports.RPCType = RPCType = {})); function setRPCMetadata(context, meta) { return context.setValue(RPC_METADATA_KEY, meta); } @@ -8695,226 +7492,6 @@ exports.getRPCMetadata = getRPCMetadata; /***/ }), -/***/ 16478: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOffSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples no traces. - */ -class AlwaysOffSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return 'AlwaysOffSampler'; - } -} -exports.AlwaysOffSampler = AlwaysOffSampler; -//# sourceMappingURL=AlwaysOffSampler.js.map - -/***/ }), - -/***/ 88317: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOnSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples all traces. - */ -class AlwaysOnSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, - }; - } - toString() { - return 'AlwaysOnSampler'; - } -} -exports.AlwaysOnSampler = AlwaysOnSampler; -//# sourceMappingURL=AlwaysOnSampler.js.map - -/***/ }), - -/***/ 15136: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ParentBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -const global_error_handler_1 = __nccwpck_require__(69246); -const AlwaysOffSampler_1 = __nccwpck_require__(16478); -const AlwaysOnSampler_1 = __nccwpck_require__(88317); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ -class ParentBasedSampler { - constructor(config) { - var _a, _b, _c, _d; - this._root = config.root; - if (!this._root) { - (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context); - if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { - return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } -} -exports.ParentBasedSampler = ParentBasedSampler; -//# sourceMappingURL=ParentBasedSampler.js.map - -/***/ }), - -/***/ 69326: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceIdRatioBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples a given fraction of traces based of trace id deterministically. - */ -class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); - } - shouldSample(context, traceId) { - return { - decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound - ? api_1.SamplingDecision.RECORD_AND_SAMPLED - : api_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 < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } -} -exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -//# sourceMappingURL=TraceIdRatioBasedSampler.js.map - -/***/ }), - /***/ 54463: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -8922,18 +7499,7 @@ exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; @@ -8962,18 +7528,7 @@ exports.isTracingSuppressed = isTracingSuppressed; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BindOnceFuture = void 0; @@ -8982,11 +7537,13 @@ const promise_1 = __nccwpck_require__(28329); * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. */ class BindOnceFuture { - constructor(_callback, _that) { - this._callback = _callback; - this._that = _that; - this._isCalled = false; - this._deferred = new promise_1.Deferred(); + _isCalled = false; + _deferred = new promise_1.Deferred(); + _callback; + _that; + constructor(callback, that) { + this._callback = callback; + this._that = that; } get isCalled() { return this._isCalled; @@ -9012,212 +7569,18 @@ exports.BindOnceFuture = BindOnceFuture; /***/ }), -/***/ 7238: +/***/ 28002: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.diagLogLevelFromString = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; const api_1 = __nccwpck_require__(65163); -const sampling_1 = __nccwpck_require__(28289); -const DEFAULT_LIST_SEPARATOR = ','; -/** - * Environment interface to define all names - */ -const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; -function isEnvVarABoolean(key) { - return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_NUMBERS_KEYS = [ - 'OTEL_BSP_EXPORT_TIMEOUT', - 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BSP_MAX_QUEUE_SIZE', - 'OTEL_BSP_SCHEDULE_DELAY', - 'OTEL_BLRP_EXPORT_TIMEOUT', - 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BLRP_MAX_QUEUE_SIZE', - 'OTEL_BLRP_SCHEDULE_DELAY', - 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_LINK_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', - 'OTEL_EXPORTER_OTLP_TIMEOUT', - 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', - 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', - 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', - 'OTEL_EXPORTER_JAEGER_AGENT_PORT', -]; -function isEnvVarANumber(key) { - return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_LISTS_KEYS = [ - 'OTEL_NO_PATCH_MODULES', - 'OTEL_PROPAGATORS', - 'OTEL_SEMCONV_STABILITY_OPT_IN', -]; -function isEnvVarAList(key) { - return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; -} -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; -exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; -/** - * Default environment variables - */ -exports.DEFAULT_ENVIRONMENT = { - OTEL_SDK_DISABLED: false, - CONTAINER_NAME: '', - ECS_CONTAINER_METADATA_URI_V4: '', - ECS_CONTAINER_METADATA_URI: '', - HOSTNAME: '', - KUBERNETES_SERVICE_HOST: '', - NAMESPACE: '', - OTEL_BSP_EXPORT_TIMEOUT: 30000, - OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BSP_MAX_QUEUE_SIZE: 2048, - OTEL_BSP_SCHEDULE_DELAY: 5000, - OTEL_BLRP_EXPORT_TIMEOUT: 30000, - OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BLRP_MAX_QUEUE_SIZE: 2048, - OTEL_BLRP_SCHEDULE_DELAY: 5000, - OTEL_EXPORTER_JAEGER_AGENT_HOST: '', - OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, - OTEL_EXPORTER_JAEGER_ENDPOINT: '', - OTEL_EXPORTER_JAEGER_PASSWORD: '', - OTEL_EXPORTER_JAEGER_USER: '', - OTEL_EXPORTER_OTLP_ENDPOINT: '', - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_HEADERS: '', - OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', - OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', - OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', - OTEL_EXPORTER_OTLP_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, - OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', - OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, - OTEL_NO_PATCH_MODULES: [], - OTEL_PROPAGATORS: ['tracecontext', 'baggage'], - OTEL_RESOURCE_ATTRIBUTES: '', - OTEL_SERVICE_NAME: '', - OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_EVENT_COUNT_LIMIT: 128, - OTEL_SPAN_LINK_COUNT_LIMIT: 128, - OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, - OTEL_TRACES_EXPORTER: '', - OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, - OTEL_TRACES_SAMPLER_ARG: '', - OTEL_LOGS_EXPORTER: '', - OTEL_EXPORTER_OTLP_INSECURE: '', - OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', - OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', - OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', - OTEL_EXPORTER_OTLP_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_COMPRESSION: '', - OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', - OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', - OTEL_SEMCONV_STABILITY_OPT_IN: [], -}; -/** - * @param key - * @param environment - * @param values - */ -function parseBoolean(key, environment, values) { - if (typeof values[key] === 'undefined') { - return; - } - const value = String(values[key]); - // support case-insensitive "true" - environment[key] = value.toLowerCase() === 'true'; -} -/** - * Parses a variable as number with number validation - * @param name - * @param environment - * @param values - * @param min - * @param max - */ -function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { - if (typeof values[name] !== 'undefined') { - const value = Number(values[name]); - if (!isNaN(value)) { - if (value < min) { - environment[name] = min; - } - else if (value > max) { - environment[name] = max; - } - else { - environment[name] = value; - } - } - } -} -/** - * Parses list-like strings from input into output. - * @param name - * @param environment - * @param values - * @param separator - */ -function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { - const givenValue = input[name]; - if (typeof givenValue === 'string') { - output[name] = givenValue.split(separator).map(v => v.trim()); - } -} -// The support string -> DiagLogLevel mappings const logLevelMap = { ALL: api_1.DiagLogLevel.ALL, VERBOSE: api_1.DiagLogLevel.VERBOSE, @@ -9228,54 +7591,23 @@ const logLevelMap = { NONE: api_1.DiagLogLevel.NONE, }; /** - * Environmentally sets log level if valid log level string is provided - * @param key - * @param environment - * @param values + * 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 setLogLevelFromEnv(key, environment, values) { - const value = values[key]; - if (typeof value === 'string') { - const theLevel = logLevelMap[value.toUpperCase()]; - if (theLevel != null) { - environment[key] = theLevel; - } +function diagLogLevelFromString(value) { + if (value == null) { + // don't fall back to default - no value set has different semantics for ús than an incorrect value (do not set vs. fall back to default) + return undefined; } -} -/** - * Parses environment values - * @param values - */ -function parseEnvironment(values) { - const environment = {}; - for (const env in exports.DEFAULT_ENVIRONMENT) { - const key = env; - switch (key) { - case 'OTEL_LOG_LEVEL': - setLogLevelFromEnv(key, environment, values); - break; - default: - if (isEnvVarABoolean(key)) { - parseBoolean(key, environment, values); - } - else if (isEnvVarANumber(key)) { - parseNumber(key, environment, values); - } - else if (isEnvVarAList(key)) { - parseStringList(key, environment, values); - } - else { - const value = values[key]; - if (typeof value !== 'undefined' && value !== null) { - environment[key] = String(value); - } - } - } + 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 environment; + return resolvedLogLevel; } -exports.parseEnvironment = parseEnvironment; -//# sourceMappingURL=environment.js.map +exports.diagLogLevelFromString = diagLogLevelFromString; +//# sourceMappingURL=configuration.js.map /***/ }), @@ -9286,18 +7618,7 @@ exports.parseEnvironment = parseEnvironment; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isPlainObject = void 0; @@ -9312,24 +7633,11 @@ const undefinedTag = '[object Undefined]'; const funcProto = Function.prototype; const funcToString = funcProto.toString; const objectCtorString = funcToString.call(Object); -const getPrototype = overArg(Object.getPrototypeOf, Object); +const getPrototypeOf = Object.getPrototypeOf; const objectProto = Object.prototype; const hasOwnProperty = objectProto.hasOwnProperty; const symToStringTag = Symbol ? Symbol.toStringTag : undefined; const nativeObjectToString = objectProto.toString; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function (arg) { - return func(transform(arg)); - }; -} /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. @@ -9362,7 +7670,7 @@ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { return false; } - const proto = getPrototype(value); + const proto = getPrototypeOf(value); if (proto === null) { return true; } @@ -9428,7 +7736,7 @@ function getRawTag(value) { value[symToStringTag] = undefined; unmasked = true; } - catch (e) { + catch { // silence } const result = nativeObjectToString.call(value); @@ -9463,18 +7771,7 @@ function objectToString(value) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.merge = void 0; @@ -9528,6 +7825,11 @@ function mergeTwoObjects(one, two, level = 0, objects) { 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]); } } @@ -9541,6 +7843,11 @@ function mergeTwoObjects(one, two, level = 0, objects) { 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') { @@ -9632,22 +7939,14 @@ function shouldMerge(one, two) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Deferred = void 0; class Deferred { + _promise; + _resolve; + _reject; constructor() { this._promise = new Promise((resolve, reject) => { this._resolve = resolve; @@ -9669,41 +7968,6 @@ exports.Deferred = Deferred; /***/ }), -/***/ 28289: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TracesSamplerValues = void 0; -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 = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); -//# sourceMappingURL=sampling.js.map - -/***/ }), - /***/ 48400: /***/ ((__unused_webpack_module, exports) => { @@ -9711,18 +7975,7 @@ var TracesSamplerValues; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.callWithTimeout = exports.TimeoutError = void 0; @@ -9776,18 +8029,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isUrlIgnored = exports.urlMatches = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ function urlMatches(url, urlToMatch) { if (typeof urlToMatch === 'string') { @@ -9819,43 +8061,6 @@ exports.isUrlIgnored = isUrlIgnored; /***/ }), -/***/ 67226: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWrapped = void 0; -/** - * Checks if certain function has been already wrapped - * @param func - */ -function isWrapped(func) { - return (typeof func === 'function' && - typeof func.__original === 'function' && - typeof func.__unwrap === 'function' && - func.__wrapped === true); -} -exports.isWrapped = isWrapped; -//# sourceMappingURL=wrap.js.map - -/***/ }), - /***/ 55687: /***/ ((__unused_webpack_module, exports) => { @@ -9863,29927 +8068,12 @@ exports.isWrapped = isWrapped; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VERSION = void 0; // this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.30.0'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 4197: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AmqplibInstrumentation = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const types_1 = __nccwpck_require__(19540); -const utils_1 = __nccwpck_require__(65281); -/** @knipignore */ -const version_1 = __nccwpck_require__(73704); -const supportedVersions = ['>=0.5.5 <1']; -class AmqplibInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, types_1.DEFAULT_CONFIG), config)); - } - setConfig(config = {}) { - super.setConfig(Object.assign(Object.assign({}, types_1.DEFAULT_CONFIG), config)); - } - init() { - const channelModelModuleFile = new instrumentation_1.InstrumentationNodeModuleFile('amqplib/lib/channel_model.js', supportedVersions, this.patchChannelModel.bind(this), this.unpatchChannelModel.bind(this)); - const callbackModelModuleFile = new instrumentation_1.InstrumentationNodeModuleFile('amqplib/lib/callback_model.js', supportedVersions, this.patchChannelModel.bind(this), this.unpatchChannelModel.bind(this)); - const connectModuleFile = new instrumentation_1.InstrumentationNodeModuleFile('amqplib/lib/connect.js', supportedVersions, this.patchConnect.bind(this), this.unpatchConnect.bind(this)); - const module = new instrumentation_1.InstrumentationNodeModuleDefinition('amqplib', supportedVersions, undefined, undefined, [channelModelModuleFile, connectModuleFile, callbackModelModuleFile]); - return module; - } - patchConnect(moduleExports) { - moduleExports = this.unpatchConnect(moduleExports); - if (!(0, instrumentation_1.isWrapped)(moduleExports.connect)) { - this._wrap(moduleExports, 'connect', this.getConnectPatch.bind(this)); - } - return moduleExports; - } - unpatchConnect(moduleExports) { - if ((0, instrumentation_1.isWrapped)(moduleExports.connect)) { - this._unwrap(moduleExports, 'connect'); - } - return moduleExports; - } - patchChannelModel(moduleExports, moduleVersion) { - if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.publish)) { - this._wrap(moduleExports.Channel.prototype, 'publish', this.getPublishPatch.bind(this, moduleVersion)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.consume)) { - this._wrap(moduleExports.Channel.prototype, 'consume', this.getConsumePatch.bind(this, moduleVersion)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.ack)) { - this._wrap(moduleExports.Channel.prototype, 'ack', this.getAckPatch.bind(this, false, types_1.EndOperation.Ack)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.nack)) { - this._wrap(moduleExports.Channel.prototype, 'nack', this.getAckPatch.bind(this, true, types_1.EndOperation.Nack)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.reject)) { - this._wrap(moduleExports.Channel.prototype, 'reject', this.getAckPatch.bind(this, true, types_1.EndOperation.Reject)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.ackAll)) { - this._wrap(moduleExports.Channel.prototype, 'ackAll', this.getAckAllPatch.bind(this, false, types_1.EndOperation.AckAll)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.nackAll)) { - this._wrap(moduleExports.Channel.prototype, 'nackAll', this.getAckAllPatch.bind(this, true, types_1.EndOperation.NackAll)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.emit)) { - this._wrap(moduleExports.Channel.prototype, 'emit', this.getChannelEmitPatch.bind(this)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.ConfirmChannel.prototype.publish)) { - this._wrap(moduleExports.ConfirmChannel.prototype, 'publish', this.getConfirmedPublishPatch.bind(this, moduleVersion)); - } - return moduleExports; - } - unpatchChannelModel(moduleExports) { - if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.publish)) { - this._unwrap(moduleExports.Channel.prototype, 'publish'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.consume)) { - this._unwrap(moduleExports.Channel.prototype, 'consume'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.ack)) { - this._unwrap(moduleExports.Channel.prototype, 'ack'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.nack)) { - this._unwrap(moduleExports.Channel.prototype, 'nack'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.reject)) { - this._unwrap(moduleExports.Channel.prototype, 'reject'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.ackAll)) { - this._unwrap(moduleExports.Channel.prototype, 'ackAll'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.nackAll)) { - this._unwrap(moduleExports.Channel.prototype, 'nackAll'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.Channel.prototype.emit)) { - this._unwrap(moduleExports.Channel.prototype, 'emit'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.ConfirmChannel.prototype.publish)) { - this._unwrap(moduleExports.ConfirmChannel.prototype, 'publish'); - } - return moduleExports; - } - getConnectPatch(original) { - return function patchedConnect(url, socketOptions, openCallback) { - return original.call(this, url, socketOptions, function (err, conn) { - if (err == null) { - const urlAttributes = (0, utils_1.getConnectionAttributesFromUrl)(url); - // the type of conn in @types/amqplib is amqp.Connection, but in practice the library send the - // `serverProperties` on the `conn` and not in a property `connection`. - // I don't have capacity to debug it currently but it should probably be fixed in @types or - // in the package itself - // currently setting as any to calm typescript - const serverAttributes = (0, utils_1.getConnectionAttributesFromServer)(conn); - conn[utils_1.CONNECTION_ATTRIBUTES] = Object.assign(Object.assign({}, urlAttributes), serverAttributes); - } - openCallback.apply(this, arguments); - }); - }; - } - getChannelEmitPatch(original) { - const self = this; - return function emit(eventName) { - if (eventName === 'close') { - self.endAllSpansOnChannel(this, true, types_1.EndOperation.ChannelClosed, undefined); - const activeTimer = this[utils_1.CHANNEL_CONSUME_TIMEOUT_TIMER]; - if (activeTimer) { - clearInterval(activeTimer); - } - this[utils_1.CHANNEL_CONSUME_TIMEOUT_TIMER] = undefined; - } - else if (eventName === 'error') { - self.endAllSpansOnChannel(this, true, types_1.EndOperation.ChannelError, undefined); - } - return original.apply(this, arguments); - }; - } - getAckAllPatch(isRejected, endOperation, original) { - const self = this; - return function ackAll(requeueOrEmpty) { - self.endAllSpansOnChannel(this, isRejected, endOperation, requeueOrEmpty); - return original.apply(this, arguments); - }; - } - getAckPatch(isRejected, endOperation, original) { - const self = this; - return function ack(message, allUpToOrRequeue, requeue) { - var _a; - const channel = this; - // we use this patch in reject function as well, but it has different signature - const requeueResolved = endOperation === types_1.EndOperation.Reject ? allUpToOrRequeue : requeue; - const spansNotEnded = (_a = channel[utils_1.CHANNEL_SPANS_NOT_ENDED]) !== null && _a !== void 0 ? _a : []; - const msgIndex = spansNotEnded.findIndex(msgDetails => msgDetails.msg === message); - if (msgIndex < 0) { - // should not happen in happy flow - // but possible if user is calling the api function ack twice with same message - self.endConsumerSpan(message, isRejected, endOperation, requeueResolved); - } - else if (endOperation !== types_1.EndOperation.Reject && allUpToOrRequeue) { - for (let i = 0; i <= msgIndex; i++) { - self.endConsumerSpan(spansNotEnded[i].msg, isRejected, endOperation, requeueResolved); - } - spansNotEnded.splice(0, msgIndex + 1); - } - else { - self.endConsumerSpan(message, isRejected, endOperation, requeueResolved); - spansNotEnded.splice(msgIndex, 1); - } - return original.apply(this, arguments); - }; - } - getConsumePatch(moduleVersion, original) { - const self = this; - return function consume(queue, onMessage, options) { - const channel = this; - if (!Object.prototype.hasOwnProperty.call(channel, utils_1.CHANNEL_SPANS_NOT_ENDED)) { - const { consumeTimeoutMs } = self.getConfig(); - if (consumeTimeoutMs) { - const timer = setInterval(() => { - self.checkConsumeTimeoutOnChannel(channel); - }, consumeTimeoutMs); - timer.unref(); - channel[utils_1.CHANNEL_CONSUME_TIMEOUT_TIMER] = timer; - } - channel[utils_1.CHANNEL_SPANS_NOT_ENDED] = []; - } - const patchedOnMessage = function (msg) { - var _a, _b, _c, _d, _e; - // msg is expected to be null for signaling consumer cancel notification - // https://www.rabbitmq.com/consumer-cancel.html - // in this case, we do not start a span, as this is not a real message. - if (!msg) { - return onMessage.call(this, msg); - } - const headers = (_a = msg.properties.headers) !== null && _a !== void 0 ? _a : {}; - let parentContext = api_1.propagation.extract(api_1.ROOT_CONTEXT, headers); - const exchange = (_b = msg.fields) === null || _b === void 0 ? void 0 : _b.exchange; - let links; - if (self._config.useLinksForConsume) { - const parentSpanContext = parentContext - ? (_c = api_1.trace.getSpan(parentContext)) === null || _c === void 0 ? void 0 : _c.spanContext() - : undefined; - parentContext = undefined; - if (parentSpanContext) { - links = [ - { - context: parentSpanContext, - }, - ]; - } - } - const span = self.tracer.startSpan(`${queue} process`, { - kind: api_1.SpanKind.CONSUMER, - attributes: Object.assign(Object.assign({}, (_d = channel === null || channel === void 0 ? void 0 : channel.connection) === null || _d === void 0 ? void 0 : _d[utils_1.CONNECTION_ATTRIBUTES]), { [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: exchange, [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_TOPIC, [semantic_conventions_1.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]: (_e = msg.fields) === null || _e === void 0 ? void 0 : _e.routingKey, [semantic_conventions_1.SEMATTRS_MESSAGING_OPERATION]: semantic_conventions_1.MESSAGINGOPERATIONVALUES_PROCESS, [semantic_conventions_1.SEMATTRS_MESSAGING_MESSAGE_ID]: msg === null || msg === void 0 ? void 0 : msg.properties.messageId, [semantic_conventions_1.SEMATTRS_MESSAGING_CONVERSATION_ID]: msg === null || msg === void 0 ? void 0 : msg.properties.correlationId }), - links, - }, parentContext); - const { consumeHook } = self.getConfig(); - if (consumeHook) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => consumeHook(span, { moduleVersion, msg }), e => { - if (e) { - api_1.diag.error('amqplib instrumentation: consumerHook error', e); - } - }, true); - } - if (!(options === null || options === void 0 ? void 0 : options.noAck)) { - // store the message on the channel so we can close the span on ackAll etc - channel[utils_1.CHANNEL_SPANS_NOT_ENDED].push({ - msg, - timeOfConsume: (0, core_1.hrTime)(), - }); - // store the span on the message, so we can end it when user call 'ack' on it - msg[utils_1.MESSAGE_STORED_SPAN] = span; - } - const setContext = parentContext - ? parentContext - : api_1.ROOT_CONTEXT; - api_1.context.with(api_1.trace.setSpan(setContext, span), () => { - onMessage.call(this, msg); - }); - if (options === null || options === void 0 ? void 0 : options.noAck) { - self.callConsumeEndHook(span, msg, false, types_1.EndOperation.AutoAck); - span.end(); - } - }; - arguments[1] = patchedOnMessage; - return original.apply(this, arguments); - }; - } - getConfirmedPublishPatch(moduleVersion, original) { - const self = this; - return function confirmedPublish(exchange, routingKey, content, options, callback) { - const channel = this; - const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options); - const { publishHook } = self.getConfig(); - if (publishHook) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => publishHook(span, { - moduleVersion, - exchange, - routingKey, - content, - options: modifiedOptions, - isConfirmChannel: true, - }), e => { - if (e) { - api_1.diag.error('amqplib instrumentation: publishHook error', e); - } - }, true); - } - const patchedOnConfirm = function (err, ok) { - try { - callback === null || callback === void 0 ? void 0 : callback.call(this, err, ok); - } - finally { - const { publishConfirmHook } = self.getConfig(); - if (publishConfirmHook) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => publishConfirmHook(span, { - moduleVersion, - exchange, - routingKey, - content, - options, - isConfirmChannel: true, - confirmError: err, - }), e => { - if (e) { - api_1.diag.error('amqplib instrumentation: publishConfirmHook error', e); - } - }, true); - } - if (err) { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: "message confirmation has been nack'ed", - }); - } - span.end(); - } - }; - // calling confirm channel publish function is storing the message in queue and registering the callback for broker confirm. - // span ends in the patched callback. - const markedContext = (0, utils_1.markConfirmChannelTracing)(api_1.context.active()); - const argumentsCopy = [...arguments]; - argumentsCopy[3] = modifiedOptions; - argumentsCopy[4] = api_1.context.bind((0, utils_1.unmarkConfirmChannelTracing)(api_1.trace.setSpan(markedContext, span)), patchedOnConfirm); - return api_1.context.with(markedContext, original.bind(this, ...argumentsCopy)); - }; - } - getPublishPatch(moduleVersion, original) { - const self = this; - return function publish(exchange, routingKey, content, options) { - if ((0, utils_1.isConfirmChannelTracing)(api_1.context.active())) { - // work already done - return original.apply(this, arguments); - } - else { - const channel = this; - const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options); - const { publishHook } = self.getConfig(); - if (publishHook) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => publishHook(span, { - moduleVersion, - exchange, - routingKey, - content, - options: modifiedOptions, - isConfirmChannel: false, - }), e => { - if (e) { - api_1.diag.error('amqplib instrumentation: publishHook error', e); - } - }, true); - } - // calling normal channel publish function is only storing the message in queue. - // it does not send it and waits for an ack, so the span duration is expected to be very short. - const argumentsCopy = [...arguments]; - argumentsCopy[3] = modifiedOptions; - const originalRes = original.apply(this, argumentsCopy); - span.end(); - return originalRes; - } - }; - } - createPublishSpan(self, exchange, routingKey, channel, options) { - var _a; - const normalizedExchange = (0, utils_1.normalizeExchange)(exchange); - const span = self.tracer.startSpan(`publish ${normalizedExchange}`, { - kind: api_1.SpanKind.PRODUCER, - attributes: Object.assign(Object.assign({}, channel.connection[utils_1.CONNECTION_ATTRIBUTES]), { [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: exchange, [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION_KIND]: semantic_conventions_1.MESSAGINGDESTINATIONKINDVALUES_TOPIC, [semantic_conventions_1.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey, [semantic_conventions_1.SEMATTRS_MESSAGING_MESSAGE_ID]: options === null || options === void 0 ? void 0 : options.messageId, [semantic_conventions_1.SEMATTRS_MESSAGING_CONVERSATION_ID]: options === null || options === void 0 ? void 0 : options.correlationId }), - }); - const modifiedOptions = options !== null && options !== void 0 ? options : {}; - modifiedOptions.headers = (_a = modifiedOptions.headers) !== null && _a !== void 0 ? _a : {}; - api_1.propagation.inject(api_1.trace.setSpan(api_1.context.active(), span), modifiedOptions.headers); - return { span, modifiedOptions }; - } - endConsumerSpan(message, isRejected, operation, requeue) { - const storedSpan = message[utils_1.MESSAGE_STORED_SPAN]; - if (!storedSpan) - return; - if (isRejected !== false) { - storedSpan.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: operation !== types_1.EndOperation.ChannelClosed && - operation !== types_1.EndOperation.ChannelError - ? `${operation} called on message${requeue === true - ? ' with requeue' - : requeue === false - ? ' without requeue' - : ''}` - : operation, - }); - } - this.callConsumeEndHook(storedSpan, message, isRejected, operation); - storedSpan.end(); - message[utils_1.MESSAGE_STORED_SPAN] = undefined; - } - endAllSpansOnChannel(channel, isRejected, operation, requeue) { - var _a; - const spansNotEnded = (_a = channel[utils_1.CHANNEL_SPANS_NOT_ENDED]) !== null && _a !== void 0 ? _a : []; - spansNotEnded.forEach(msgDetails => { - this.endConsumerSpan(msgDetails.msg, isRejected, operation, requeue); - }); - channel[utils_1.CHANNEL_SPANS_NOT_ENDED] = []; - } - callConsumeEndHook(span, msg, rejected, endOperation) { - const { consumeEndHook } = this.getConfig(); - if (!consumeEndHook) - return; - (0, instrumentation_1.safeExecuteInTheMiddle)(() => consumeEndHook(span, { msg, rejected, endOperation }), e => { - if (e) { - api_1.diag.error('amqplib instrumentation: consumerEndHook error', e); - } - }, true); - } - checkConsumeTimeoutOnChannel(channel) { - var _a; - const currentTime = (0, core_1.hrTime)(); - const spansNotEnded = (_a = channel[utils_1.CHANNEL_SPANS_NOT_ENDED]) !== null && _a !== void 0 ? _a : []; - let i; - const { consumeTimeoutMs } = this.getConfig(); - for (i = 0; i < spansNotEnded.length; i++) { - const currMessage = spansNotEnded[i]; - const timeFromConsume = (0, core_1.hrTimeDuration)(currMessage.timeOfConsume, currentTime); - if ((0, core_1.hrTimeToMilliseconds)(timeFromConsume) < consumeTimeoutMs) { - break; - } - this.endConsumerSpan(currMessage.msg, null, types_1.EndOperation.InstrumentationTimeout, true); - } - spansNotEnded.splice(0, i); - } -} -exports.AmqplibInstrumentation = AmqplibInstrumentation; -//# sourceMappingURL=amqplib.js.map - -/***/ }), - -/***/ 46524: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__exportStar(__nccwpck_require__(4197), exports); -__exportStar(__nccwpck_require__(19540), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 19540: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_CONFIG = exports.EndOperation = void 0; -var EndOperation; -(function (EndOperation) { - EndOperation["AutoAck"] = "auto ack"; - EndOperation["Ack"] = "ack"; - EndOperation["AckAll"] = "ackAll"; - EndOperation["Reject"] = "reject"; - EndOperation["Nack"] = "nack"; - EndOperation["NackAll"] = "nackAll"; - EndOperation["ChannelClosed"] = "channel closed"; - EndOperation["ChannelError"] = "channel error"; - EndOperation["InstrumentationTimeout"] = "instrumentation timeout"; -})(EndOperation = exports.EndOperation || (exports.EndOperation = {})); -exports.DEFAULT_CONFIG = { - consumeTimeoutMs: 1000 * 60, - useLinksForConsume: false, -}; -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 65281: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isConfirmChannelTracing = exports.unmarkConfirmChannelTracing = exports.markConfirmChannelTracing = exports.getConnectionAttributesFromUrl = exports.getConnectionAttributesFromServer = exports.normalizeExchange = exports.CONNECTION_ATTRIBUTES = exports.CHANNEL_CONSUME_TIMEOUT_TIMER = exports.CHANNEL_SPANS_NOT_ENDED = exports.MESSAGE_STORED_SPAN = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const semantic_conventions_1 = __nccwpck_require__(67275); -exports.MESSAGE_STORED_SPAN = Symbol('opentelemetry.amqplib.message.stored-span'); -exports.CHANNEL_SPANS_NOT_ENDED = Symbol('opentelemetry.amqplib.channel.spans-not-ended'); -exports.CHANNEL_CONSUME_TIMEOUT_TIMER = Symbol('opentelemetry.amqplib.channel.consumer-timeout-timer'); -exports.CONNECTION_ATTRIBUTES = Symbol('opentelemetry.amqplib.connection.attributes'); -const IS_CONFIRM_CHANNEL_CONTEXT_KEY = (0, api_1.createContextKey)('opentelemetry.amqplib.channel.is-confirm-channel'); -const normalizeExchange = (exchangeName) => exchangeName !== '' ? exchangeName : ''; -exports.normalizeExchange = normalizeExchange; -const censorPassword = (url) => { - return url.replace(/:[^:@/]*@/, ':***@'); -}; -const getPort = (portFromUrl, resolvedProtocol) => { - // we are using the resolved protocol which is upper case - // this code mimic the behavior of the amqplib which is used to set connection params - return portFromUrl || (resolvedProtocol === 'AMQP' ? 5672 : 5671); -}; -const getProtocol = (protocolFromUrl) => { - const resolvedProtocol = protocolFromUrl || 'amqp'; - // the substring removed the ':' part of the protocol ('amqp:' -> 'amqp') - const noEndingColon = resolvedProtocol.endsWith(':') - ? resolvedProtocol.substring(0, resolvedProtocol.length - 1) - : resolvedProtocol; - // upper cases to match spec - return noEndingColon.toUpperCase(); -}; -const getHostname = (hostnameFromUrl) => { - // if user supplies empty hostname, it gets forwarded to 'net' package which default it to localhost. - // https://nodejs.org/docs/latest-v12.x/api/net.html#net_socket_connect_options_connectlistener - return hostnameFromUrl || 'localhost'; -}; -const extractConnectionAttributeOrLog = (url, attributeKey, attributeValue, nameForLog) => { - if (attributeValue) { - return { [attributeKey]: attributeValue }; - } - else { - api_1.diag.error(`amqplib instrumentation: could not extract connection attribute ${nameForLog} from user supplied url`, { - url, - }); - return {}; - } -}; -const getConnectionAttributesFromServer = (conn) => { - var _a, _b; - const product = (_b = (_a = conn.serverProperties.product) === null || _a === void 0 ? void 0 : _a.toLowerCase) === null || _b === void 0 ? void 0 : _b.call(_a); - if (product) { - return { - [semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: product, - }; - } - else { - return {}; - } -}; -exports.getConnectionAttributesFromServer = getConnectionAttributesFromServer; -const getConnectionAttributesFromUrl = (url) => { - const attributes = { - [semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL_VERSION]: '0.9.1', // this is the only protocol supported by the instrumented library - }; - url = url || 'amqp://localhost'; - if (typeof url === 'object') { - const connectOptions = url; - const protocol = getProtocol(connectOptions === null || connectOptions === void 0 ? void 0 : connectOptions.protocol); - Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL, protocol, 'protocol'))); - const hostname = getHostname(connectOptions === null || connectOptions === void 0 ? void 0 : connectOptions.hostname); - Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_NET_PEER_NAME, hostname, 'hostname'))); - const port = getPort(connectOptions.port, protocol); - Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(url, semantic_conventions_1.SEMATTRS_NET_PEER_PORT, port, 'port'))); - } - else { - const censoredUrl = censorPassword(url); - attributes[semantic_conventions_1.SEMATTRS_MESSAGING_URL] = censoredUrl; - try { - const urlParts = new URL(censoredUrl); - const protocol = getProtocol(urlParts.protocol); - Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_MESSAGING_PROTOCOL, protocol, 'protocol'))); - const hostname = getHostname(urlParts.hostname); - Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_NET_PEER_NAME, hostname, 'hostname'))); - const port = getPort(urlParts.port ? parseInt(urlParts.port) : undefined, protocol); - Object.assign(attributes, Object.assign({}, extractConnectionAttributeOrLog(censoredUrl, semantic_conventions_1.SEMATTRS_NET_PEER_PORT, port, 'port'))); - } - catch (err) { - api_1.diag.error('amqplib instrumentation: error while extracting connection details from connection url', { - censoredUrl, - err, - }); - } - } - return attributes; -}; -exports.getConnectionAttributesFromUrl = getConnectionAttributesFromUrl; -const markConfirmChannelTracing = (context) => { - return context.setValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY, true); -}; -exports.markConfirmChannelTracing = markConfirmChannelTracing; -const unmarkConfirmChannelTracing = (context) => { - return context.deleteValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY); -}; -exports.unmarkConfirmChannelTracing = unmarkConfirmChannelTracing; -const isConfirmChannelTracing = (context) => { - return context.getValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY) === true; -}; -exports.isConfirmChannelTracing = isConfirmChannelTracing; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 73704: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.46.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-amqplib'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 42436: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConnectNames = exports.ConnectTypes = exports.AttributeNames = void 0; -var AttributeNames; -(function (AttributeNames) { - AttributeNames["CONNECT_TYPE"] = "connect.type"; - AttributeNames["CONNECT_NAME"] = "connect.name"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -var ConnectTypes; -(function (ConnectTypes) { - ConnectTypes["MIDDLEWARE"] = "middleware"; - ConnectTypes["REQUEST_HANDLER"] = "request_handler"; -})(ConnectTypes = exports.ConnectTypes || (exports.ConnectTypes = {})); -var ConnectNames; -(function (ConnectNames) { - ConnectNames["MIDDLEWARE"] = "middleware"; - ConnectNames["REQUEST_HANDLER"] = "request handler"; -})(ConnectNames = exports.ConnectNames || (exports.ConnectNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 20575: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(42436), exports); -__exportStar(__nccwpck_require__(71119), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 71119: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConnectInstrumentation = exports.ANONYMOUS_NAME = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const AttributeNames_1 = __nccwpck_require__(42436); -/** @knipignore */ -const version_1 = __nccwpck_require__(88729); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const utils_1 = __nccwpck_require__(33885); -exports.ANONYMOUS_NAME = 'anonymous'; -/** Connect instrumentation for OpenTelemetry */ -class ConnectInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('connect', ['>=3.0.0 <4'], moduleExports => { - return this._patchConstructor(moduleExports); - }), - ]; - } - _patchApp(patchedApp) { - if (!(0, instrumentation_1.isWrapped)(patchedApp.use)) { - this._wrap(patchedApp, 'use', this._patchUse.bind(this)); - } - if (!(0, instrumentation_1.isWrapped)(patchedApp.handle)) { - this._wrap(patchedApp, 'handle', this._patchHandle.bind(this)); - } - } - _patchConstructor(original) { - const instrumentation = this; - return function (...args) { - const app = original.apply(this, args); - instrumentation._patchApp(app); - return app; - }; - } - _patchNext(next, finishSpan) { - return function nextFunction(err) { - const result = next.apply(this, [err]); - finishSpan(); - return result; - }; - } - _startSpan(routeName, middleWare) { - let connectType; - let connectName; - let connectTypeName; - if (routeName) { - connectType = AttributeNames_1.ConnectTypes.REQUEST_HANDLER; - connectTypeName = AttributeNames_1.ConnectNames.REQUEST_HANDLER; - connectName = routeName; - } - else { - connectType = AttributeNames_1.ConnectTypes.MIDDLEWARE; - connectTypeName = AttributeNames_1.ConnectNames.MIDDLEWARE; - connectName = middleWare.name || exports.ANONYMOUS_NAME; - } - const spanName = `${connectTypeName} - ${connectName}`; - const options = { - attributes: { - [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: routeName.length > 0 ? routeName : '/', - [AttributeNames_1.AttributeNames.CONNECT_TYPE]: connectType, - [AttributeNames_1.AttributeNames.CONNECT_NAME]: connectName, - }, - }; - return this.tracer.startSpan(spanName, options); - } - _patchMiddleware(routeName, middleWare) { - const instrumentation = this; - const isErrorMiddleware = middleWare.length === 4; - function patchedMiddleware() { - if (!instrumentation.isEnabled()) { - return middleWare.apply(this, arguments); - } - const [reqArgIdx, resArgIdx, nextArgIdx] = isErrorMiddleware - ? [1, 2, 3] - : [0, 1, 2]; - const req = arguments[reqArgIdx]; - const res = arguments[resArgIdx]; - const next = arguments[nextArgIdx]; - (0, utils_1.replaceCurrentStackRoute)(req, routeName); - const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); - if (routeName && (rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { - rpcMetadata.route = (0, utils_1.generateRoute)(req); - } - let spanName = ''; - if (routeName) { - spanName = `request handler - ${routeName}`; - } - else { - spanName = `middleware - ${middleWare.name || exports.ANONYMOUS_NAME}`; - } - const span = instrumentation._startSpan(routeName, middleWare); - instrumentation._diag.debug('start span', spanName); - let spanFinished = false; - function finishSpan() { - if (!spanFinished) { - spanFinished = true; - instrumentation._diag.debug(`finishing span ${span.name}`); - span.end(); - } - else { - instrumentation._diag.debug(`span ${span.name} - already finished`); - } - res.removeListener('close', finishSpan); - } - res.addListener('close', finishSpan); - arguments[nextArgIdx] = instrumentation._patchNext(next, finishSpan); - return middleWare.apply(this, arguments); - } - Object.defineProperty(patchedMiddleware, 'length', { - value: middleWare.length, - writable: false, - configurable: true, - }); - return patchedMiddleware; - } - _patchUse(original) { - const instrumentation = this; - return function (...args) { - const middleWare = args[args.length - 1]; - const routeName = (args[args.length - 2] || ''); - args[args.length - 1] = instrumentation._patchMiddleware(routeName, middleWare); - return original.apply(this, args); - }; - } - _patchHandle(original) { - const instrumentation = this; - return function () { - const [reqIdx, outIdx] = [0, 2]; - const req = arguments[reqIdx]; - const out = arguments[outIdx]; - const completeStack = (0, utils_1.addNewStackLayer)(req); - if (typeof out === 'function') { - arguments[outIdx] = instrumentation._patchOut(out, completeStack); - } - return original.apply(this, arguments); - }; - } - _patchOut(out, completeStack) { - return function nextFunction(...args) { - completeStack(); - return Reflect.apply(out, this, args); - }; - } -} -exports.ConnectInstrumentation = ConnectInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 44750: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._LAYERS_STORE_PROPERTY = void 0; -exports._LAYERS_STORE_PROPERTY = Symbol('opentelemetry.instrumentation-connect.request-route-stack'); -//# sourceMappingURL=internal-types.js.map - -/***/ }), - -/***/ 33885: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.generateRoute = exports.replaceCurrentStackRoute = exports.addNewStackLayer = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const internal_types_1 = __nccwpck_require__(44750); -const addNewStackLayer = (request) => { - if (Array.isArray(request[internal_types_1._LAYERS_STORE_PROPERTY]) === false) { - Object.defineProperty(request, internal_types_1._LAYERS_STORE_PROPERTY, { - enumerable: false, - value: [], - }); - } - request[internal_types_1._LAYERS_STORE_PROPERTY].push('/'); - const stackLength = request[internal_types_1._LAYERS_STORE_PROPERTY].length; - return () => { - if (stackLength === request[internal_types_1._LAYERS_STORE_PROPERTY].length) { - request[internal_types_1._LAYERS_STORE_PROPERTY].pop(); - } - else { - api_1.diag.warn('Connect: Trying to pop the stack multiple time'); - } - }; -}; -exports.addNewStackLayer = addNewStackLayer; -const replaceCurrentStackRoute = (request, newRoute) => { - if (newRoute) { - request[internal_types_1._LAYERS_STORE_PROPERTY].splice(-1, 1, newRoute); - } -}; -exports.replaceCurrentStackRoute = replaceCurrentStackRoute; -// generate route from existing stack on request object. -// splash between stack layer will be deduped -// ["/first/", "/second", "/third/"] => /first/second/third/ -const generateRoute = (request) => { - return request[internal_types_1._LAYERS_STORE_PROPERTY].reduce((acc, sub) => acc.replace(/\/+$/, '') + sub); -}; -exports.generateRoute = generateRoute; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 88729: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.43.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-connect'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 20698: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(70808), exports); -__exportStar(__nccwpck_require__(86726), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 86726: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DataloaderInstrumentation = void 0; -const instrumentation_1 = __nccwpck_require__(65584); -const api_1 = __nccwpck_require__(65163); -/** @knipignore */ -const version_1 = __nccwpck_require__(68218); -const MODULE_NAME = 'dataloader'; -class DataloaderInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition(MODULE_NAME, ['>=2.0.0 <3'], dataloader => { - this._patchLoad(dataloader.prototype); - this._patchLoadMany(dataloader.prototype); - return this._getPatchedConstructor(dataloader); - }, dataloader => { - if ((0, instrumentation_1.isWrapped)(dataloader.prototype.load)) { - this._unwrap(dataloader.prototype, 'load'); - } - if ((0, instrumentation_1.isWrapped)(dataloader.prototype.loadMany)) { - this._unwrap(dataloader.prototype, 'loadMany'); - } - }), - ]; - } - shouldCreateSpans() { - const config = this.getConfig(); - const hasParentSpan = api_1.trace.getSpan(api_1.context.active()) !== undefined; - return hasParentSpan || !config.requireParentSpan; - } - getSpanName(dataloader, operation) { - const dataloaderName = dataloader.name; - if (dataloaderName === undefined || dataloaderName === null) { - return `${MODULE_NAME}.${operation}`; - } - return `${MODULE_NAME}.${operation} ${dataloaderName}`; - } - _getPatchedConstructor(constructor) { - const prototype = constructor.prototype; - const instrumentation = this; - function PatchedDataloader(...args) { - const inst = new constructor(...args); - if (!instrumentation.isEnabled()) { - return inst; - } - if ((0, instrumentation_1.isWrapped)(inst._batchLoadFn)) { - instrumentation._unwrap(inst, '_batchLoadFn'); - } - instrumentation._wrap(inst, '_batchLoadFn', original => { - return function patchedBatchLoadFn(...args) { - var _a; - if (!instrumentation.isEnabled() || - !instrumentation.shouldCreateSpans()) { - return original.call(this, ...args); - } - const parent = api_1.context.active(); - const span = instrumentation.tracer.startSpan(instrumentation.getSpanName(inst, 'batch'), { links: (_a = this._batch) === null || _a === void 0 ? void 0 : _a.spanLinks }, parent); - return api_1.context.with(api_1.trace.setSpan(parent, span), () => { - return original.apply(this, args) - .then(value => { - span.end(); - return value; - }) - .catch(err => { - span.recordException(err); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - span.end(); - throw err; - }); - }); - }; - }); - return inst; - } - PatchedDataloader.prototype = prototype; - return PatchedDataloader; - } - _patchLoad(proto) { - if ((0, instrumentation_1.isWrapped)(proto.load)) { - this._unwrap(proto, 'load'); - } - this._wrap(proto, 'load', this._getPatchedLoad.bind(this)); - } - _getPatchedLoad(original) { - const instrumentation = this; - return function patchedLoad(...args) { - if (!instrumentation.shouldCreateSpans()) { - return original.call(this, ...args); - } - const parent = api_1.context.active(); - const span = instrumentation.tracer.startSpan(instrumentation.getSpanName(this, 'load'), { kind: api_1.SpanKind.CLIENT }, parent); - return api_1.context.with(api_1.trace.setSpan(parent, span), () => { - const result = original - .call(this, ...args) - .then(value => { - span.end(); - return value; - }) - .catch(err => { - span.recordException(err); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - span.end(); - throw err; - }); - const loader = this; - if (loader._batch) { - if (!loader._batch.spanLinks) { - loader._batch.spanLinks = []; - } - loader._batch.spanLinks.push({ context: span.spanContext() }); - } - return result; - }); - }; - } - _patchLoadMany(proto) { - if ((0, instrumentation_1.isWrapped)(proto.loadMany)) { - this._unwrap(proto, 'loadMany'); - } - this._wrap(proto, 'loadMany', this._getPatchedLoadMany.bind(this)); - } - _getPatchedLoadMany(original) { - const instrumentation = this; - return function patchedLoadMany(...args) { - if (!instrumentation.shouldCreateSpans()) { - return original.call(this, ...args); - } - const parent = api_1.context.active(); - const span = instrumentation.tracer.startSpan(instrumentation.getSpanName(this, 'loadMany'), { kind: api_1.SpanKind.CLIENT }, parent); - return api_1.context.with(api_1.trace.setSpan(parent, span), () => { - // .loadMany never rejects, as errors from internal .load - // calls are caught by dataloader lib - return original.call(this, ...args).then(value => { - span.end(); - return value; - }); - }); - }; - } -} -exports.DataloaderInstrumentation = DataloaderInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 70808: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 68218: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.16.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-dataloader'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 96060: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AttributeNames = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var AttributeNames; -(function (AttributeNames) { - AttributeNames["EXPRESS_TYPE"] = "express.type"; - AttributeNames["EXPRESS_NAME"] = "express.name"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 90148: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExpressLayerType = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var ExpressLayerType; -(function (ExpressLayerType) { - ExpressLayerType["ROUTER"] = "router"; - ExpressLayerType["MIDDLEWARE"] = "middleware"; - ExpressLayerType["REQUEST_HANDLER"] = "request_handler"; -})(ExpressLayerType = exports.ExpressLayerType || (exports.ExpressLayerType = {})); -//# sourceMappingURL=ExpressLayerType.js.map - -/***/ }), - -/***/ 82267: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(70756), exports); -__exportStar(__nccwpck_require__(90148), exports); -__exportStar(__nccwpck_require__(96060), exports); -__exportStar(__nccwpck_require__(68719), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 70756: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExpressInstrumentation = void 0; -const core_1 = __nccwpck_require__(89736); -const api_1 = __nccwpck_require__(65163); -const ExpressLayerType_1 = __nccwpck_require__(90148); -const AttributeNames_1 = __nccwpck_require__(96060); -const utils_1 = __nccwpck_require__(45279); -/** @knipignore */ -const version_1 = __nccwpck_require__(60647); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const internal_types_1 = __nccwpck_require__(80406); -/** Express instrumentation for OpenTelemetry */ -class ExpressInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('express', ['>=4.0.0 <5'], moduleExports => { - const routerProto = moduleExports.Router; - // patch express.Router.route - if ((0, instrumentation_1.isWrapped)(routerProto.route)) { - this._unwrap(routerProto, 'route'); - } - this._wrap(routerProto, 'route', this._getRoutePatch()); - // patch express.Router.use - if ((0, instrumentation_1.isWrapped)(routerProto.use)) { - this._unwrap(routerProto, 'use'); - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this._wrap(routerProto, 'use', this._getRouterUsePatch()); - // patch express.Application.use - if ((0, instrumentation_1.isWrapped)(moduleExports.application.use)) { - this._unwrap(moduleExports.application, 'use'); - } - this._wrap(moduleExports.application, 'use', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this._getAppUsePatch()); - return moduleExports; - }, moduleExports => { - if (moduleExports === undefined) - return; - const routerProto = moduleExports.Router; - this._unwrap(routerProto, 'route'); - this._unwrap(routerProto, 'use'); - this._unwrap(moduleExports.application, 'use'); - }), - ]; - } - /** - * Get the patch for Router.route function - */ - _getRoutePatch() { - const instrumentation = this; - return function (original) { - return function route_trace(...args) { - const route = original.apply(this, args); - const layer = this.stack[this.stack.length - 1]; - instrumentation._applyPatch(layer, (0, utils_1.getLayerPath)(args)); - return route; - }; - }; - } - /** - * Get the patch for Router.use function - */ - _getRouterUsePatch() { - const instrumentation = this; - return function (original) { - return function use(...args) { - const route = original.apply(this, args); - const layer = this.stack[this.stack.length - 1]; - instrumentation._applyPatch(layer, (0, utils_1.getLayerPath)(args)); - return route; - }; - }; - } - /** - * Get the patch for Application.use function - */ - _getAppUsePatch() { - const instrumentation = this; - return function (original) { - return function use(...args) { - const route = original.apply(this, args); - const layer = this._router.stack[this._router.stack.length - 1]; - instrumentation._applyPatch(layer, (0, utils_1.getLayerPath)(args)); - return route; - }; - }; - } - /** Patch each express layer to create span and propagate context */ - _applyPatch(layer, layerPath) { - const instrumentation = this; - // avoid patching multiple times the same layer - if (layer[internal_types_1.kLayerPatched] === true) - return; - layer[internal_types_1.kLayerPatched] = true; - this._wrap(layer, 'handle', original => { - // TODO: instrument error handlers - if (original.length === 4) - return original; - const patched = function (req, res) { - (0, utils_1.storeLayerPath)(req, layerPath); - const route = req[internal_types_1._LAYERS_STORE_PROPERTY] - .filter(path => path !== '/' && path !== '/*') - .join('') - // remove duplicate slashes to normalize route - .replace(/\/{2,}/g, '/'); - const attributes = { - [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: route.length > 0 ? route : '/', - }; - const metadata = (0, utils_1.getLayerMetadata)(route, layer, layerPath); - const type = metadata.attributes[AttributeNames_1.AttributeNames.EXPRESS_TYPE]; - const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); - if ((rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { - rpcMetadata.route = route || '/'; - } - // verify against the config if the layer should be ignored - if ((0, utils_1.isLayerIgnored)(metadata.name, type, instrumentation.getConfig())) { - if (type === ExpressLayerType_1.ExpressLayerType.MIDDLEWARE) { - req[internal_types_1._LAYERS_STORE_PROPERTY].pop(); - } - return original.apply(this, arguments); - } - if (api_1.trace.getSpan(api_1.context.active()) === undefined) { - return original.apply(this, arguments); - } - const spanName = instrumentation._getSpanName({ - request: req, - layerType: type, - route, - }, metadata.name); - const span = instrumentation.tracer.startSpan(spanName, { - attributes: Object.assign(attributes, metadata.attributes), - }); - const { requestHook } = instrumentation.getConfig(); - if (requestHook) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => requestHook(span, { - request: req, - layerType: type, - route, - }), e => { - if (e) { - api_1.diag.error('express instrumentation: request hook failed', e); - } - }, true); - } - let spanHasEnded = false; - if (metadata.attributes[AttributeNames_1.AttributeNames.EXPRESS_TYPE] !== - ExpressLayerType_1.ExpressLayerType.MIDDLEWARE) { - span.end(); - spanHasEnded = true; - } - // listener for response.on('finish') - const onResponseFinish = () => { - if (spanHasEnded === false) { - spanHasEnded = true; - span.end(); - } - }; - // verify we have a callback - const args = Array.from(arguments); - const callbackIdx = args.findIndex(arg => typeof arg === 'function'); - if (callbackIdx >= 0) { - arguments[callbackIdx] = function () { - var _a; - // express considers anything but an empty value, "route" or "router" - // passed to its callback to be an error - const maybeError = arguments[0]; - const isError = ![undefined, null, 'route', 'router'].includes(maybeError); - if (!spanHasEnded && isError) { - const [error, message] = (0, utils_1.asErrorAndMessage)(maybeError); - span.recordException(error); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message, - }); - } - if (spanHasEnded === false) { - spanHasEnded = true; - (_a = req.res) === null || _a === void 0 ? void 0 : _a.removeListener('finish', onResponseFinish); - span.end(); - } - if (!(req.route && isError)) { - req[internal_types_1._LAYERS_STORE_PROPERTY].pop(); - } - const callback = args[callbackIdx]; - return callback.apply(this, arguments); - }; - } - try { - return original.apply(this, arguments); - } - catch (anyError) { - const [error, message] = (0, utils_1.asErrorAndMessage)(anyError); - span.recordException(error); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message, - }); - throw anyError; - } - finally { - /** - * At this point if the callback wasn't called, that means either the - * layer is asynchronous (so it will call the callback later on) or that - * the layer directly end the http response, so we'll hook into the "finish" - * event to handle the later case. - */ - if (!spanHasEnded) { - res.once('finish', onResponseFinish); - } - } - }; - // `handle` isn't just a regular function in some cases. It also contains - // some properties holding metadata and state so we need to proxy them - // through through patched function - // ref: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1950 - // Also some apps/libs do their own patching before OTEL and have these properties - // in the proptotype. So we use a `for...in` loop to get own properties and also - // any enumerable prop in the prototype chain - // ref: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2271 - for (const key in original) { - Object.defineProperty(patched, key, { - get() { - return original[key]; - }, - set(value) { - original[key] = value; - }, - }); - } - return patched; - }); - } - _getSpanName(info, defaultName) { - var _a; - const { spanNameHook } = this.getConfig(); - if (!(spanNameHook instanceof Function)) { - return defaultName; - } - try { - return (_a = spanNameHook(info, defaultName)) !== null && _a !== void 0 ? _a : defaultName; - } - catch (err) { - api_1.diag.error('express instrumentation: error calling span name rewrite hook', err); - return defaultName; - } - } -} -exports.ExpressInstrumentation = ExpressInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 80406: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._LAYERS_STORE_PROPERTY = exports.kLayerPatched = void 0; -/** - * This symbol is used to mark express layer as being already instrumented - * since its possible to use a given layer multiple times (ex: middlewares) - */ -exports.kLayerPatched = Symbol('express-layer-patched'); -/** - * This const define where on the `request` object the Instrumentation will mount the - * current stack of express layer. - * - * It is necessary because express doesn't store the different layers - * (ie: middleware, router etc) that it called to get to the current layer. - * Given that, the only way to know the route of a given layer is to - * store the path of where each previous layer has been mounted. - * - * ex: bodyParser > auth middleware > /users router > get /:id - * in this case the stack would be: ["/users", "/:id"] - * - * ex2: bodyParser > /api router > /v1 router > /users router > get /:id - * stack: ["/api", "/v1", "/users", ":id"] - * - */ -exports._LAYERS_STORE_PROPERTY = '__ot_middlewares'; -//# sourceMappingURL=internal-types.js.map - -/***/ }), - -/***/ 68719: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 45279: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getLayerPath = exports.asErrorAndMessage = exports.isLayerIgnored = exports.getLayerMetadata = exports.getRouterPath = exports.storeLayerPath = void 0; -const ExpressLayerType_1 = __nccwpck_require__(90148); -const AttributeNames_1 = __nccwpck_require__(96060); -const internal_types_1 = __nccwpck_require__(80406); -/** - * Store layers path in the request to be able to construct route later - * @param request The request where - * @param [value] the value to push into the array - */ -const storeLayerPath = (request, value) => { - if (Array.isArray(request[internal_types_1._LAYERS_STORE_PROPERTY]) === false) { - Object.defineProperty(request, internal_types_1._LAYERS_STORE_PROPERTY, { - enumerable: false, - value: [], - }); - } - if (value === undefined) - return; - request[internal_types_1._LAYERS_STORE_PROPERTY].push(value); -}; -exports.storeLayerPath = storeLayerPath; -/** - * Recursively search the router path from layer stack - * @param path The path to reconstruct - * @param layer The layer to reconstruct from - * @returns The reconstructed path - */ -const getRouterPath = (path, layer) => { - var _a, _b, _c, _d; - const stackLayer = (_b = (_a = layer.handle) === null || _a === void 0 ? void 0 : _a.stack) === null || _b === void 0 ? void 0 : _b[0]; - if ((_c = stackLayer === null || stackLayer === void 0 ? void 0 : stackLayer.route) === null || _c === void 0 ? void 0 : _c.path) { - return `${path}${stackLayer.route.path}`; - } - if ((_d = stackLayer === null || stackLayer === void 0 ? void 0 : stackLayer.handle) === null || _d === void 0 ? void 0 : _d.stack) { - return (0, exports.getRouterPath)(path, stackLayer); - } - return path; -}; -exports.getRouterPath = getRouterPath; -/** - * Parse express layer context to retrieve a name and attributes. - * @param route The route of the layer - * @param layer Express layer - * @param [layerPath] if present, the path on which the layer has been mounted - */ -const getLayerMetadata = (route, layer, layerPath) => { - var _a; - if (layer.name === 'router') { - const maybeRouterPath = (0, exports.getRouterPath)('', layer); - const extractedRouterPath = maybeRouterPath - ? maybeRouterPath - : layerPath || route || '/'; - return { - attributes: { - [AttributeNames_1.AttributeNames.EXPRESS_NAME]: extractedRouterPath, - [AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.ROUTER, - }, - name: `router - ${extractedRouterPath}`, - }; - } - else if (layer.name === 'bound dispatch') { - return { - attributes: { - [AttributeNames_1.AttributeNames.EXPRESS_NAME]: (_a = (route || layerPath)) !== null && _a !== void 0 ? _a : 'request handler', - [AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.REQUEST_HANDLER, - }, - name: `request handler${layer.path ? ` - ${route || layerPath}` : ''}`, - }; - } - else { - return { - attributes: { - [AttributeNames_1.AttributeNames.EXPRESS_NAME]: layer.name, - [AttributeNames_1.AttributeNames.EXPRESS_TYPE]: ExpressLayerType_1.ExpressLayerType.MIDDLEWARE, - }, - name: `middleware - ${layer.name}`, - }; - } -}; -exports.getLayerMetadata = getLayerMetadata; -/** - * Check whether the given obj match pattern - * @param constant e.g URL of request - * @param obj obj to inspect - * @param pattern Match pattern - */ -const satisfiesPattern = (constant, pattern) => { - if (typeof pattern === 'string') { - return pattern === constant; - } - else if (pattern instanceof RegExp) { - return pattern.test(constant); - } - else if (typeof pattern === 'function') { - return pattern(constant); - } - else { - throw new TypeError('Pattern is in unsupported datatype'); - } -}; -/** - * Check whether the given request is ignored by configuration - * It will not re-throw exceptions from `list` provided by the client - * @param constant e.g URL of request - * @param [list] List of ignore patterns - * @param [onException] callback for doing something when an exception has - * occurred - */ -const isLayerIgnored = (name, type, config) => { - var _a; - if (Array.isArray(config === null || config === void 0 ? void 0 : config.ignoreLayersType) && - ((_a = config === null || config === void 0 ? void 0 : config.ignoreLayersType) === null || _a === void 0 ? void 0 : _a.includes(type))) { - return true; - } - if (Array.isArray(config === null || config === void 0 ? void 0 : config.ignoreLayers) === false) - return false; - try { - for (const pattern of config.ignoreLayers) { - if (satisfiesPattern(name, pattern)) { - return true; - } - } - } - catch (e) { - /* catch block*/ - } - return false; -}; -exports.isLayerIgnored = isLayerIgnored; -/** - * Converts a user-provided error value into an error and error message pair - * - * @param error - User-provided error value - * @returns Both an Error or string representation of the value and an error message - */ -const asErrorAndMessage = (error) => error instanceof Error - ? [error, error.message] - : [String(error), String(error)]; -exports.asErrorAndMessage = asErrorAndMessage; -/** - * Extracts the layer path from the route arguments - * - * @param args - Arguments of the route - * @returns The layer path - */ -const getLayerPath = (args) => { - const firstArg = args[0]; - if (Array.isArray(firstArg)) { - return firstArg.map(arg => extractLayerPathSegment(arg) || '').join(','); - } - return extractLayerPathSegment(firstArg); -}; -exports.getLayerPath = getLayerPath; -const extractLayerPathSegment = (arg) => { - if (typeof arg === 'string') { - return arg; - } - if (arg instanceof RegExp || typeof arg === 'number') { - return arg.toString(); - } - return; -}; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 60647: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.47.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-express'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 52458: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hooksNamesToWrap = exports.spanRequestSymbol = void 0; -exports.spanRequestSymbol = Symbol('opentelemetry.instrumentation.fastify.request_active_span'); -// The instrumentation creates a span for invocations of lifecycle hook handlers -// that take `(request, reply, ...[, done])` arguments. Currently this is all -// lifecycle hooks except `onRequestAbort`. -// https://fastify.dev/docs/latest/Reference/Hooks -exports.hooksNamesToWrap = new Set([ - 'onTimeout', - 'onRequest', - 'preParsing', - 'preValidation', - 'preSerialization', - 'preHandler', - 'onSend', - 'onResponse', - 'onError', -]); -//# sourceMappingURL=constants.js.map - -/***/ }), - -/***/ 90845: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FastifyNames = exports.FastifyTypes = exports.AttributeNames = void 0; -var AttributeNames; -(function (AttributeNames) { - AttributeNames["FASTIFY_NAME"] = "fastify.name"; - AttributeNames["FASTIFY_TYPE"] = "fastify.type"; - AttributeNames["HOOK_NAME"] = "hook.name"; - AttributeNames["PLUGIN_NAME"] = "plugin.name"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -var FastifyTypes; -(function (FastifyTypes) { - FastifyTypes["MIDDLEWARE"] = "middleware"; - FastifyTypes["REQUEST_HANDLER"] = "request_handler"; -})(FastifyTypes = exports.FastifyTypes || (exports.FastifyTypes = {})); -var FastifyNames; -(function (FastifyNames) { - FastifyNames["MIDDLEWARE"] = "middleware"; - FastifyNames["REQUEST_HANDLER"] = "request handler"; -})(FastifyNames = exports.FastifyNames || (exports.FastifyNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 62344: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(90845), exports); -__exportStar(__nccwpck_require__(32963), exports); -__exportStar(__nccwpck_require__(13332), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 13332: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FastifyInstrumentation = exports.ANONYMOUS_NAME = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const constants_1 = __nccwpck_require__(52458); -const AttributeNames_1 = __nccwpck_require__(90845); -const utils_1 = __nccwpck_require__(62574); -/** @knipignore */ -const version_1 = __nccwpck_require__(44842); -exports.ANONYMOUS_NAME = 'anonymous'; -/** Fastify instrumentation for OpenTelemetry */ -class FastifyInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('fastify', ['>=3.0.0 <6'], moduleExports => { - return this._patchConstructor(moduleExports); - }), - ]; - } - _hookOnRequest() { - const instrumentation = this; - return function onRequest(request, reply, done) { - if (!instrumentation.isEnabled()) { - return done(); - } - instrumentation._wrap(reply, 'send', instrumentation._patchSend()); - const anyRequest = request; - const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); - const routeName = anyRequest.routeOptions - ? anyRequest.routeOptions.url // since fastify@4.10.0 - : request.routerPath; - if (routeName && (rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { - rpcMetadata.route = routeName; - } - done(); - }; - } - _wrapHandler(pluginName, hookName, original, syncFunctionWithDone) { - const instrumentation = this; - this._diag.debug('Patching fastify route.handler function'); - return function (...args) { - if (!instrumentation.isEnabled()) { - return original.apply(this, args); - } - const name = original.name || pluginName || exports.ANONYMOUS_NAME; - const spanName = `${AttributeNames_1.FastifyNames.MIDDLEWARE} - ${name}`; - const reply = args[1]; - const span = (0, utils_1.startSpan)(reply, instrumentation.tracer, spanName, { - [AttributeNames_1.AttributeNames.FASTIFY_TYPE]: AttributeNames_1.FastifyTypes.MIDDLEWARE, - [AttributeNames_1.AttributeNames.PLUGIN_NAME]: pluginName, - [AttributeNames_1.AttributeNames.HOOK_NAME]: hookName, - }); - const origDone = syncFunctionWithDone && - args[args.length - 1]; - if (origDone) { - args[args.length - 1] = function (...doneArgs) { - (0, utils_1.endSpan)(reply); - origDone.apply(this, doneArgs); - }; - } - return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return (0, utils_1.safeExecuteInTheMiddleMaybePromise)(() => { - return original.apply(this, args); - }, err => { - if (err instanceof Error) { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - span.recordException(err); - } - // async hooks should end the span as soon as the promise is resolved - if (!syncFunctionWithDone) { - (0, utils_1.endSpan)(reply); - } - }); - }); - }; - } - _wrapAddHook() { - const instrumentation = this; - this._diag.debug('Patching fastify server.addHook function'); - return function (original) { - return function wrappedAddHook(...args) { - const name = args[0]; - const handler = args[1]; - const pluginName = this.pluginName; - if (!constants_1.hooksNamesToWrap.has(name)) { - return original.apply(this, args); - } - const syncFunctionWithDone = typeof args[args.length - 1] === 'function' && - handler.constructor.name !== 'AsyncFunction'; - return original.apply(this, [ - name, - instrumentation._wrapHandler(pluginName, name, handler, syncFunctionWithDone), - ]); - }; - }; - } - _patchConstructor(moduleExports) { - const instrumentation = this; - function fastify(...args) { - const app = moduleExports.fastify.apply(this, args); - app.addHook('onRequest', instrumentation._hookOnRequest()); - app.addHook('preHandler', instrumentation._hookPreHandler()); - instrumentation._wrap(app, 'addHook', instrumentation._wrapAddHook()); - return app; - } - if (moduleExports.errorCodes !== undefined) { - fastify.errorCodes = moduleExports.errorCodes; - } - fastify.fastify = fastify; - fastify.default = fastify; - return fastify; - } - _patchSend() { - const instrumentation = this; - this._diag.debug('Patching fastify reply.send function'); - return function patchSend(original) { - return function send(...args) { - const maybeError = args[0]; - if (!instrumentation.isEnabled()) { - return original.apply(this, args); - } - return (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - return original.apply(this, args); - }, err => { - if (!err && maybeError instanceof Error) { - err = maybeError; - } - (0, utils_1.endSpan)(this, err); - }); - }; - }; - } - _hookPreHandler() { - const instrumentation = this; - this._diag.debug('Patching fastify preHandler function'); - return function preHandler(request, reply, done) { - var _a, _b; - if (!instrumentation.isEnabled()) { - return done(); - } - const anyRequest = request; - const handler = ((_a = anyRequest.routeOptions) === null || _a === void 0 ? void 0 : _a.handler) || ((_b = anyRequest.context) === null || _b === void 0 ? void 0 : _b.handler); - const handlerName = (handler === null || handler === void 0 ? void 0 : handler.name.startsWith('bound ')) - ? handler.name.substring(6) - : handler === null || handler === void 0 ? void 0 : handler.name; - const spanName = `${AttributeNames_1.FastifyNames.REQUEST_HANDLER} - ${handlerName || this.pluginName || exports.ANONYMOUS_NAME}`; - const spanAttributes = { - [AttributeNames_1.AttributeNames.PLUGIN_NAME]: this.pluginName, - [AttributeNames_1.AttributeNames.FASTIFY_TYPE]: AttributeNames_1.FastifyTypes.REQUEST_HANDLER, - [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: anyRequest.routeOptions - ? anyRequest.routeOptions.url // since fastify@4.10.0 - : request.routerPath, - }; - if (handlerName) { - spanAttributes[AttributeNames_1.AttributeNames.FASTIFY_NAME] = handlerName; - } - const span = (0, utils_1.startSpan)(reply, instrumentation.tracer, spanName, spanAttributes); - const { requestHook } = instrumentation.getConfig(); - if (requestHook) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => requestHook(span, { request }), e => { - if (e) { - instrumentation._diag.error('request hook failed', e); - } - }, true); - } - return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - done(); - }); - }; - } -} -exports.FastifyInstrumentation = FastifyInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 32963: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 62574: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.safeExecuteInTheMiddleMaybePromise = exports.endSpan = exports.startSpan = void 0; -const api_1 = __nccwpck_require__(65163); -const constants_1 = __nccwpck_require__(52458); -/** - * Starts Span - * @param reply - reply function - * @param tracer - tracer - * @param spanName - span name - * @param spanAttributes - span attributes - */ -function startSpan(reply, tracer, spanName, spanAttributes = {}) { - const span = tracer.startSpan(spanName, { attributes: spanAttributes }); - const spans = reply[constants_1.spanRequestSymbol] || []; - spans.push(span); - // eslint-disable-next-line @typescript-eslint/no-floating-promises - Object.defineProperty(reply, constants_1.spanRequestSymbol, { - enumerable: false, - configurable: true, - value: spans, - }); - return span; -} -exports.startSpan = startSpan; -/** - * Ends span - * @param reply - reply function - * @param err - error - */ -function endSpan(reply, err) { - const spans = reply[constants_1.spanRequestSymbol] || []; - // there is no active span, or it has already ended - if (!spans.length) { - return; - } - spans.forEach(span => { - if (err) { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - span.recordException(err); - } - span.end(); - }); - delete reply[constants_1.spanRequestSymbol]; -} -exports.endSpan = endSpan; -function safeExecuteInTheMiddleMaybePromise(execute, onFinish, preventThrowingError) { - let error; - let result = undefined; - try { - result = execute(); - if (isPromise(result)) { - result.then(res => onFinish(undefined, res), err => onFinish(err)); - } - } - catch (e) { - error = e; - } - finally { - if (!isPromise(result)) { - onFinish(error, result); - if (error && !preventThrowingError) { - // eslint-disable-next-line no-unsafe-finally - throw error; - } - } - // eslint-disable-next-line no-unsafe-finally - return result; - } -} -exports.safeExecuteInTheMiddleMaybePromise = safeExecuteInTheMiddleMaybePromise; -function isPromise(val) { - var _a; - return ((typeof val === 'object' && - val && - typeof ((_a = Object.getOwnPropertyDescriptor(val, 'then')) === null || _a === void 0 ? void 0 : _a.value) === - 'function') || - false); -} -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 44842: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.44.1'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-fastify'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 9571: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SYNC_FUNCTIONS = exports.CALLBACK_FUNCTIONS = exports.PROMISE_FUNCTIONS = void 0; -exports.PROMISE_FUNCTIONS = [ - 'access', - 'appendFile', - 'chmod', - 'chown', - 'copyFile', - 'cp', - 'lchown', - 'link', - 'lstat', - 'lutimes', - 'mkdir', - 'mkdtemp', - 'open', - 'opendir', - 'readdir', - 'readFile', - 'readlink', - 'realpath', - 'rename', - 'rm', - 'rmdir', - 'stat', - 'symlink', - 'truncate', - 'unlink', - 'utimes', - 'writeFile', - // 'lchmod', // only implemented on macOS -]; -exports.CALLBACK_FUNCTIONS = [ - 'access', - 'appendFile', - 'chmod', - 'chown', - 'copyFile', - 'cp', - 'exists', - 'lchown', - 'link', - 'lstat', - 'lutimes', - 'mkdir', - 'mkdtemp', - 'open', - 'opendir', - 'readdir', - 'readFile', - 'readlink', - 'realpath', - 'realpath.native', - 'rename', - 'rm', - 'rmdir', - 'stat', - 'symlink', - 'truncate', - 'unlink', - 'utimes', - 'writeFile', - // 'close', // functions on file descriptor - // 'fchmod', // functions on file descriptor - // 'fchown', // functions on file descriptor - // 'fdatasync', // functions on file descriptor - // 'fstat', // functions on file descriptor - // 'fsync', // functions on file descriptor - // 'ftruncate', // functions on file descriptor - // 'futimes', // functions on file descriptor - // 'lchmod', // only implemented on macOS - // 'read', // functions on file descriptor - // 'readv', // functions on file descriptor - // 'write', // functions on file descriptor - // 'writev', // functions on file descriptor -]; -exports.SYNC_FUNCTIONS = [ - 'accessSync', - 'appendFileSync', - 'chmodSync', - 'chownSync', - 'copyFileSync', - 'cpSync', - 'existsSync', - 'lchownSync', - 'linkSync', - 'lstatSync', - 'lutimesSync', - 'mkdirSync', - 'mkdtempSync', - 'opendirSync', - 'openSync', - 'readdirSync', - 'readFileSync', - 'readlinkSync', - 'realpathSync', - 'realpathSync.native', - 'renameSync', - 'rmdirSync', - 'rmSync', - 'statSync', - 'symlinkSync', - 'truncateSync', - 'unlinkSync', - 'utimesSync', - 'writeFileSync', - // 'closeSync', // functions on file descriptor - // 'fchmodSync', // functions on file descriptor - // 'fchownSync', // functions on file descriptor - // 'fdatasyncSync', // functions on file descriptor - // 'fstatSync', // functions on file descriptor - // 'fsyncSync', // functions on file descriptor - // 'ftruncateSync', // functions on file descriptor - // 'futimesSync', // functions on file descriptor - // 'lchmodSync', // only implemented on macOS - // 'readSync', // functions on file descriptor - // 'readvSync', // functions on file descriptor - // 'writeSync', // functions on file descriptor - // 'writevSync', // functions on file descriptor -]; -//# sourceMappingURL=constants.js.map - -/***/ }), - -/***/ 99833: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(36462), exports); -__exportStar(__nccwpck_require__(79846), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 36462: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FsInstrumentation = void 0; -const api = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const instrumentation_1 = __nccwpck_require__(65584); -/** @knipignore */ -const version_1 = __nccwpck_require__(67586); -const constants_1 = __nccwpck_require__(9571); -const util_1 = __nccwpck_require__(73837); -const utils_1 = __nccwpck_require__(38488); -/** - * This is important for 2-level functions like `realpath.native` to retain the 2nd-level - * when patching the 1st-level. - */ -function patchedFunctionWithOriginalProperties(patchedFunction, original) { - return Object.assign(patchedFunction, original); -} -class FsInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('fs', ['*'], (fs) => { - for (const fName of constants_1.SYNC_FUNCTIONS) { - const { objectToPatch, functionNameToPatch } = (0, utils_1.indexFs)(fs, fName); - if ((0, instrumentation_1.isWrapped)(objectToPatch[functionNameToPatch])) { - this._unwrap(objectToPatch, functionNameToPatch); - } - this._wrap(objectToPatch, functionNameToPatch, this._patchSyncFunction.bind(this, fName)); - } - for (const fName of constants_1.CALLBACK_FUNCTIONS) { - const { objectToPatch, functionNameToPatch } = (0, utils_1.indexFs)(fs, fName); - if ((0, instrumentation_1.isWrapped)(objectToPatch[functionNameToPatch])) { - this._unwrap(objectToPatch, functionNameToPatch); - } - if (fName === 'exists') { - // handling separately because of the inconsistent cb style: - // `exists` doesn't have error as the first argument, but the result - this._wrap(objectToPatch, functionNameToPatch, this._patchExistsCallbackFunction.bind(this, fName)); - continue; - } - this._wrap(objectToPatch, functionNameToPatch, this._patchCallbackFunction.bind(this, fName)); - } - for (const fName of constants_1.PROMISE_FUNCTIONS) { - if ((0, instrumentation_1.isWrapped)(fs.promises[fName])) { - this._unwrap(fs.promises, fName); - } - this._wrap(fs.promises, fName, this._patchPromiseFunction.bind(this, fName)); - } - return fs; - }, (fs) => { - if (fs === undefined) - return; - for (const fName of constants_1.SYNC_FUNCTIONS) { - const { objectToPatch, functionNameToPatch } = (0, utils_1.indexFs)(fs, fName); - if ((0, instrumentation_1.isWrapped)(objectToPatch[functionNameToPatch])) { - this._unwrap(objectToPatch, functionNameToPatch); - } - } - for (const fName of constants_1.CALLBACK_FUNCTIONS) { - const { objectToPatch, functionNameToPatch } = (0, utils_1.indexFs)(fs, fName); - if ((0, instrumentation_1.isWrapped)(objectToPatch[functionNameToPatch])) { - this._unwrap(objectToPatch, functionNameToPatch); - } - } - for (const fName of constants_1.PROMISE_FUNCTIONS) { - if ((0, instrumentation_1.isWrapped)(fs.promises[fName])) { - this._unwrap(fs.promises, fName); - } - } - }), - new instrumentation_1.InstrumentationNodeModuleDefinition('fs/promises', ['*'], (fsPromises) => { - for (const fName of constants_1.PROMISE_FUNCTIONS) { - if ((0, instrumentation_1.isWrapped)(fsPromises[fName])) { - this._unwrap(fsPromises, fName); - } - this._wrap(fsPromises, fName, this._patchPromiseFunction.bind(this, fName)); - } - return fsPromises; - }, (fsPromises) => { - if (fsPromises === undefined) - return; - for (const fName of constants_1.PROMISE_FUNCTIONS) { - if ((0, instrumentation_1.isWrapped)(fsPromises[fName])) { - this._unwrap(fsPromises, fName); - } - } - }), - ]; - } - _patchSyncFunction(functionName, original) { - const instrumentation = this; - const patchedFunction = function (...args) { - const activeContext = api.context.active(); - if (!instrumentation._shouldTrace(activeContext)) { - return original.apply(this, args); - } - if (instrumentation._runCreateHook(functionName, { - args: args, - }) === false) { - return api.context.with((0, core_1.suppressTracing)(activeContext), original, this, ...args); - } - const span = instrumentation.tracer.startSpan(`fs ${functionName}`); - try { - // Suppress tracing for internal fs calls - const res = api.context.with((0, core_1.suppressTracing)(api.trace.setSpan(activeContext, span)), original, this, ...args); - instrumentation._runEndHook(functionName, { args: args, span }); - return res; - } - catch (error) { - span.recordException(error); - span.setStatus({ - message: error.message, - code: api.SpanStatusCode.ERROR, - }); - instrumentation._runEndHook(functionName, { args: args, span, error }); - throw error; - } - finally { - span.end(); - } - }; - return patchedFunctionWithOriginalProperties(patchedFunction, original); - } - _patchCallbackFunction(functionName, original) { - const instrumentation = this; - const patchedFunction = function (...args) { - const activeContext = api.context.active(); - if (!instrumentation._shouldTrace(activeContext)) { - return original.apply(this, args); - } - if (instrumentation._runCreateHook(functionName, { - args: args, - }) === false) { - return api.context.with((0, core_1.suppressTracing)(activeContext), original, this, ...args); - } - const lastIdx = args.length - 1; - const cb = args[lastIdx]; - if (typeof cb === 'function') { - const span = instrumentation.tracer.startSpan(`fs ${functionName}`); - // Return to the context active during the call in the callback - args[lastIdx] = api.context.bind(activeContext, function (error) { - if (error) { - span.recordException(error); - span.setStatus({ - message: error.message, - code: api.SpanStatusCode.ERROR, - }); - } - instrumentation._runEndHook(functionName, { - args: args, - span, - error, - }); - span.end(); - return cb.apply(this, arguments); - }); - try { - // Suppress tracing for internal fs calls - return api.context.with((0, core_1.suppressTracing)(api.trace.setSpan(activeContext, span)), original, this, ...args); - } - catch (error) { - span.recordException(error); - span.setStatus({ - message: error.message, - code: api.SpanStatusCode.ERROR, - }); - instrumentation._runEndHook(functionName, { - args: args, - span, - error, - }); - span.end(); - throw error; - } - } - else { - // TODO: what to do if we are pretty sure it's going to throw - return original.apply(this, args); - } - }; - return patchedFunctionWithOriginalProperties(patchedFunction, original); - } - _patchExistsCallbackFunction(functionName, original) { - const instrumentation = this; - const patchedFunction = function (...args) { - const activeContext = api.context.active(); - if (!instrumentation._shouldTrace(activeContext)) { - return original.apply(this, args); - } - if (instrumentation._runCreateHook(functionName, { - args: args, - }) === false) { - return api.context.with((0, core_1.suppressTracing)(activeContext), original, this, ...args); - } - const lastIdx = args.length - 1; - const cb = args[lastIdx]; - if (typeof cb === 'function') { - const span = instrumentation.tracer.startSpan(`fs ${functionName}`); - // Return to the context active during the call in the callback - args[lastIdx] = api.context.bind(activeContext, function () { - // `exists` never calls the callback with an error - instrumentation._runEndHook(functionName, { - args: args, - span, - }); - span.end(); - return cb.apply(this, arguments); - }); - try { - // Suppress tracing for internal fs calls - return api.context.with((0, core_1.suppressTracing)(api.trace.setSpan(activeContext, span)), original, this, ...args); - } - catch (error) { - span.recordException(error); - span.setStatus({ - message: error.message, - code: api.SpanStatusCode.ERROR, - }); - instrumentation._runEndHook(functionName, { - args: args, - span, - error, - }); - span.end(); - throw error; - } - } - else { - return original.apply(this, args); - } - }; - const functionWithOriginalProperties = patchedFunctionWithOriginalProperties(patchedFunction, original); - // `exists` has a custom promisify function because of the inconsistent signature - // replicating that on the patched function - const promisified = function (path) { - return new Promise(resolve => functionWithOriginalProperties(path, resolve)); - }; - Object.defineProperty(promisified, 'name', { value: functionName }); - Object.defineProperty(functionWithOriginalProperties, util_1.promisify.custom, { - value: promisified, - }); - return functionWithOriginalProperties; - } - _patchPromiseFunction(functionName, original) { - const instrumentation = this; - const patchedFunction = async function (...args) { - const activeContext = api.context.active(); - if (!instrumentation._shouldTrace(activeContext)) { - return original.apply(this, args); - } - if (instrumentation._runCreateHook(functionName, { - args: args, - }) === false) { - return api.context.with((0, core_1.suppressTracing)(activeContext), original, this, ...args); - } - const span = instrumentation.tracer.startSpan(`fs ${functionName}`); - try { - // Suppress tracing for internal fs calls - const res = await api.context.with((0, core_1.suppressTracing)(api.trace.setSpan(activeContext, span)), original, this, ...args); - instrumentation._runEndHook(functionName, { args: args, span }); - return res; - } - catch (error) { - span.recordException(error); - span.setStatus({ - message: error.message, - code: api.SpanStatusCode.ERROR, - }); - instrumentation._runEndHook(functionName, { args: args, span, error }); - throw error; - } - finally { - span.end(); - } - }; - return patchedFunctionWithOriginalProperties(patchedFunction, original); - } - _runCreateHook(...args) { - const { createHook } = this.getConfig(); - if (typeof createHook === 'function') { - try { - return createHook(...args); - } - catch (e) { - this._diag.error('caught createHook error', e); - } - } - return true; - } - _runEndHook(...args) { - const { endHook } = this.getConfig(); - if (typeof endHook === 'function') { - try { - endHook(...args); - } - catch (e) { - this._diag.error('caught endHook error', e); - } - } - } - _shouldTrace(context) { - if ((0, core_1.isTracingSuppressed)(context)) { - // Performance optimization. Avoid creating additional contexts and spans - // if we already know that the tracing is being suppressed. - return false; - } - const { requireParentSpan } = this.getConfig(); - if (requireParentSpan) { - const parentSpan = api.trace.getSpan(context); - if (parentSpan == null) { - return false; - } - } - return true; - } -} -exports.FsInstrumentation = FsInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 79846: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 38488: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.indexFs = exports.splitTwoLevels = void 0; -function splitTwoLevels(functionName) { - const memberParts = functionName.split('.'); - if (memberParts.length > 1) { - if (memberParts.length !== 2) - throw Error(`Invalid member function name ${functionName}`); - return memberParts; - } - else { - return [functionName]; - } -} -exports.splitTwoLevels = splitTwoLevels; -function indexFs(fs, member) { - if (!member) - throw new Error(JSON.stringify({ member })); - const splitResult = splitTwoLevels(member); - const [functionName1, functionName2] = splitResult; - if (functionName2) { - return { - objectToPatch: fs[functionName1], - functionNameToPatch: functionName2, - }; - } - else { - return { - objectToPatch: fs, - functionNameToPatch: functionName1, - }; - } -} -exports.indexFs = indexFs; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 67586: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.19.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-fs'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 36933: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(58964), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 58964: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GenericPoolInstrumentation = void 0; -const api = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -/** @knipignore */ -const version_1 = __nccwpck_require__(95531); -const MODULE_NAME = 'generic-pool'; -class GenericPoolInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - // only used for v2 - v2.3) - this._isDisabled = false; - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition(MODULE_NAME, ['>=3.0.0 <4'], moduleExports => { - const Pool = moduleExports.Pool; - if ((0, instrumentation_1.isWrapped)(Pool.prototype.acquire)) { - this._unwrap(Pool.prototype, 'acquire'); - } - this._wrap(Pool.prototype, 'acquire', this._acquirePatcher.bind(this)); - return moduleExports; - }, moduleExports => { - const Pool = moduleExports.Pool; - this._unwrap(Pool.prototype, 'acquire'); - return moduleExports; - }), - new instrumentation_1.InstrumentationNodeModuleDefinition(MODULE_NAME, ['>=2.4.0 <3'], moduleExports => { - const Pool = moduleExports.Pool; - if ((0, instrumentation_1.isWrapped)(Pool.prototype.acquire)) { - this._unwrap(Pool.prototype, 'acquire'); - } - this._wrap(Pool.prototype, 'acquire', this._acquireWithCallbacksPatcher.bind(this)); - return moduleExports; - }, moduleExports => { - const Pool = moduleExports.Pool; - this._unwrap(Pool.prototype, 'acquire'); - return moduleExports; - }), - new instrumentation_1.InstrumentationNodeModuleDefinition(MODULE_NAME, ['>=2.0.0 <2.4'], moduleExports => { - this._isDisabled = false; - if ((0, instrumentation_1.isWrapped)(moduleExports.Pool)) { - this._unwrap(moduleExports, 'Pool'); - } - this._wrap(moduleExports, 'Pool', this._poolWrapper.bind(this)); - return moduleExports; - }, moduleExports => { - // since the object is created on the fly every time, we need to use - // a boolean switch here to disable the instrumentation - this._isDisabled = true; - return moduleExports; - }), - ]; - } - _acquirePatcher(original) { - const instrumentation = this; - return function wrapped_acquire(...args) { - const parent = api.context.active(); - const span = instrumentation.tracer.startSpan('generic-pool.acquire', {}, parent); - return api.context.with(api.trace.setSpan(parent, span), () => { - return original.call(this, ...args).then(value => { - span.end(); - return value; - }, err => { - span.recordException(err); - span.end(); - throw err; - }); - }); - }; - } - _poolWrapper(original) { - const instrumentation = this; - return function wrapped_pool() { - const pool = original.apply(this, arguments); - instrumentation._wrap(pool, 'acquire', instrumentation._acquireWithCallbacksPatcher.bind(instrumentation)); - return pool; - }; - } - _acquireWithCallbacksPatcher(original) { - const instrumentation = this; - return function wrapped_acquire(cb, priority) { - // only used for v2 - v2.3 - if (instrumentation._isDisabled) { - return original.call(this, cb, priority); - } - const parent = api.context.active(); - const span = instrumentation.tracer.startSpan('generic-pool.acquire', {}, parent); - return api.context.with(api.trace.setSpan(parent, span), () => { - original.call(this, (err, client) => { - span.end(); - // Not checking whether cb is a function because - // the original code doesn't do that either. - if (cb) { - return cb(err, client); - } - }, priority); - }); - }; - } -} -exports.GenericPoolInstrumentation = GenericPoolInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 95531: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.43.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-generic-pool'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 876: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanNames = exports.TokenKind = exports.AllowedOperationTypes = void 0; -var AllowedOperationTypes; -(function (AllowedOperationTypes) { - AllowedOperationTypes["QUERY"] = "query"; - AllowedOperationTypes["MUTATION"] = "mutation"; - AllowedOperationTypes["SUBSCRIPTION"] = "subscription"; -})(AllowedOperationTypes = exports.AllowedOperationTypes || (exports.AllowedOperationTypes = {})); -var TokenKind; -(function (TokenKind) { - TokenKind["SOF"] = ""; - TokenKind["EOF"] = ""; - TokenKind["BANG"] = "!"; - TokenKind["DOLLAR"] = "$"; - TokenKind["AMP"] = "&"; - TokenKind["PAREN_L"] = "("; - TokenKind["PAREN_R"] = ")"; - TokenKind["SPREAD"] = "..."; - TokenKind["COLON"] = ":"; - TokenKind["EQUALS"] = "="; - TokenKind["AT"] = "@"; - TokenKind["BRACKET_L"] = "["; - TokenKind["BRACKET_R"] = "]"; - TokenKind["BRACE_L"] = "{"; - TokenKind["PIPE"] = "|"; - TokenKind["BRACE_R"] = "}"; - TokenKind["NAME"] = "Name"; - TokenKind["INT"] = "Int"; - TokenKind["FLOAT"] = "Float"; - TokenKind["STRING"] = "String"; - TokenKind["BLOCK_STRING"] = "BlockString"; - TokenKind["COMMENT"] = "Comment"; -})(TokenKind = exports.TokenKind || (exports.TokenKind = {})); -var SpanNames; -(function (SpanNames) { - SpanNames["EXECUTE"] = "graphql.execute"; - SpanNames["PARSE"] = "graphql.parse"; - SpanNames["RESOLVE"] = "graphql.resolve"; - SpanNames["VALIDATE"] = "graphql.validate"; - SpanNames["SCHEMA_VALIDATE"] = "graphql.validateSchema"; - SpanNames["SCHEMA_PARSE"] = "graphql.parseSchema"; -})(SpanNames = exports.SpanNames || (exports.SpanNames = {})); -//# sourceMappingURL=enum.js.map - -/***/ }), - -/***/ 34455: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AttributeNames = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var AttributeNames; -(function (AttributeNames) { - AttributeNames["SOURCE"] = "graphql.source"; - AttributeNames["FIELD_NAME"] = "graphql.field.name"; - AttributeNames["FIELD_PATH"] = "graphql.field.path"; - AttributeNames["FIELD_TYPE"] = "graphql.field.type"; - AttributeNames["OPERATION_TYPE"] = "graphql.operation.type"; - AttributeNames["OPERATION_NAME"] = "graphql.operation.name"; - AttributeNames["VARIABLES"] = "graphql.variables."; - AttributeNames["ERROR_VALIDATION_NAME"] = "graphql.validation.error"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 96794: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(83962), exports); -__exportStar(__nccwpck_require__(37380), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 83962: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GraphQLInstrumentation = void 0; -const api_1 = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -const enum_1 = __nccwpck_require__(876); -const AttributeNames_1 = __nccwpck_require__(34455); -const symbols_1 = __nccwpck_require__(13573); -const internal_types_1 = __nccwpck_require__(68440); -const utils_1 = __nccwpck_require__(18627); -/** @knipignore */ -const version_1 = __nccwpck_require__(43945); -const DEFAULT_CONFIG = { - mergeItems: false, - depth: -1, - allowValues: false, - ignoreResolveSpans: false, -}; -const supportedVersions = ['>=14.0.0 <17']; -class GraphQLInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); - } - setConfig(config = {}) { - super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); - } - init() { - const module = new instrumentation_1.InstrumentationNodeModuleDefinition('graphql', supportedVersions); - module.files.push(this._addPatchingExecute()); - module.files.push(this._addPatchingParser()); - module.files.push(this._addPatchingValidate()); - return module; - } - _addPatchingExecute() { - return new instrumentation_1.InstrumentationNodeModuleFile('graphql/execution/execute.js', supportedVersions, - // cannot make it work with appropriate type as execute function has 2 - //types and/cannot import function but only types - (moduleExports) => { - if ((0, instrumentation_1.isWrapped)(moduleExports.execute)) { - this._unwrap(moduleExports, 'execute'); - } - this._wrap(moduleExports, 'execute', this._patchExecute(moduleExports.defaultFieldResolver)); - return moduleExports; - }, moduleExports => { - if (moduleExports) { - this._unwrap(moduleExports, 'execute'); - } - }); - } - _addPatchingParser() { - return new instrumentation_1.InstrumentationNodeModuleFile('graphql/language/parser.js', supportedVersions, (moduleExports) => { - if ((0, instrumentation_1.isWrapped)(moduleExports.parse)) { - this._unwrap(moduleExports, 'parse'); - } - this._wrap(moduleExports, 'parse', this._patchParse()); - return moduleExports; - }, (moduleExports) => { - if (moduleExports) { - this._unwrap(moduleExports, 'parse'); - } - }); - } - _addPatchingValidate() { - return new instrumentation_1.InstrumentationNodeModuleFile('graphql/validation/validate.js', supportedVersions, moduleExports => { - if ((0, instrumentation_1.isWrapped)(moduleExports.validate)) { - this._unwrap(moduleExports, 'validate'); - } - this._wrap(moduleExports, 'validate', this._patchValidate()); - return moduleExports; - }, moduleExports => { - if (moduleExports) { - this._unwrap(moduleExports, 'validate'); - } - }); - } - _patchExecute(defaultFieldResolved) { - const instrumentation = this; - return function execute(original) { - return function patchExecute() { - let processedArgs; - // case when apollo server is used for example - if (arguments.length >= 2) { - const args = arguments; - processedArgs = instrumentation._wrapExecuteArgs(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], defaultFieldResolved); - } - else { - const args = arguments[0]; - processedArgs = instrumentation._wrapExecuteArgs(args.schema, args.document, args.rootValue, args.contextValue, args.variableValues, args.operationName, args.fieldResolver, args.typeResolver, defaultFieldResolved); - } - const operation = (0, utils_1.getOperation)(processedArgs.document, processedArgs.operationName); - const span = instrumentation._createExecuteSpan(operation, processedArgs); - processedArgs.contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL] = { - source: processedArgs.document - ? processedArgs.document || - processedArgs.document[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL] - : undefined, - span, - fields: {}, - }; - return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - return original.apply(this, [ - processedArgs, - ]); - }, (err, result) => { - instrumentation._handleExecutionResult(span, err, result); - }); - }); - }; - }; - } - _handleExecutionResult(span, err, result) { - const config = this.getConfig(); - if (result === undefined || err) { - (0, utils_1.endSpan)(span, err); - return; - } - if ((0, utils_1.isPromise)(result)) { - result.then(resultData => { - if (typeof config.responseHook !== 'function') { - (0, utils_1.endSpan)(span); - return; - } - this._executeResponseHook(span, resultData); - }, error => { - (0, utils_1.endSpan)(span, error); - }); - } - else { - if (typeof config.responseHook !== 'function') { - (0, utils_1.endSpan)(span); - return; - } - this._executeResponseHook(span, result); - } - } - _executeResponseHook(span, result) { - const { responseHook } = this.getConfig(); - if (!responseHook) { - return; - } - (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - responseHook(span, result); - }, err => { - if (err) { - this._diag.error('Error running response hook', err); - } - (0, utils_1.endSpan)(span, undefined); - }, true); - } - _patchParse() { - const instrumentation = this; - return function parse(original) { - return function patchParse(source, options) { - return instrumentation._parse(this, original, source, options); - }; - }; - } - _patchValidate() { - const instrumentation = this; - return function validate(original) { - return function patchValidate(schema, documentAST, rules, options, typeInfo) { - return instrumentation._validate(this, original, schema, documentAST, rules, typeInfo, options); - }; - }; - } - _parse(obj, original, source, options) { - const config = this.getConfig(); - const span = this.tracer.startSpan(enum_1.SpanNames.PARSE); - return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - return original.call(obj, source, options); - }, (err, result) => { - if (result) { - const operation = (0, utils_1.getOperation)(result); - if (!operation) { - span.updateName(enum_1.SpanNames.SCHEMA_PARSE); - } - else if (result.loc) { - (0, utils_1.addSpanSource)(span, result.loc, config.allowValues); - } - } - (0, utils_1.endSpan)(span, err); - }); - }); - } - _validate(obj, original, schema, documentAST, rules, typeInfo, options) { - const span = this.tracer.startSpan(enum_1.SpanNames.VALIDATE, {}); - return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - return original.call(obj, schema, documentAST, rules, options, typeInfo); - }, (err, errors) => { - if (!documentAST.loc) { - span.updateName(enum_1.SpanNames.SCHEMA_VALIDATE); - } - if (errors && errors.length) { - span.recordException({ - name: AttributeNames_1.AttributeNames.ERROR_VALIDATION_NAME, - message: JSON.stringify(errors), - }); - } - (0, utils_1.endSpan)(span, err); - }); - }); - } - _createExecuteSpan(operation, processedArgs) { - var _a; - const config = this.getConfig(); - const span = this.tracer.startSpan(enum_1.SpanNames.EXECUTE, {}); - if (operation) { - const { operation: operationType, name: nameNode } = operation; - span.setAttribute(AttributeNames_1.AttributeNames.OPERATION_TYPE, operationType); - const operationName = nameNode === null || nameNode === void 0 ? void 0 : nameNode.value; - // https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/instrumentation/graphql/ - // > The span name MUST be of the format provided that graphql.operation.type and graphql.operation.name are available. - // > If graphql.operation.name is not available, the span SHOULD be named . - if (operationName) { - span.setAttribute(AttributeNames_1.AttributeNames.OPERATION_NAME, operationName); - span.updateName(`${operationType} ${operationName}`); - } - else { - span.updateName(operationType); - } - } - else { - let operationName = ' '; - if (processedArgs.operationName) { - operationName = ` "${processedArgs.operationName}" `; - } - operationName = internal_types_1.OPERATION_NOT_SUPPORTED.replace('$operationName$', operationName); - span.setAttribute(AttributeNames_1.AttributeNames.OPERATION_NAME, operationName); - } - if ((_a = processedArgs.document) === null || _a === void 0 ? void 0 : _a.loc) { - (0, utils_1.addSpanSource)(span, processedArgs.document.loc, config.allowValues); - } - if (processedArgs.variableValues && config.allowValues) { - (0, utils_1.addInputVariableAttributes)(span, processedArgs.variableValues); - } - return span; - } - _wrapExecuteArgs(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver, defaultFieldResolved) { - if (!contextValue) { - contextValue = {}; - } - if (contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL] || - this.getConfig().ignoreResolveSpans) { - return { - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - fieldResolver, - typeResolver, - }; - } - const isUsingDefaultResolver = fieldResolver == null; - // follows graphql implementation here: - // https://github.com/graphql/graphql-js/blob/0b7daed9811731362c71900e12e5ea0d1ecc7f1f/src/execution/execute.ts#L494 - const fieldResolverForExecute = fieldResolver !== null && fieldResolver !== void 0 ? fieldResolver : defaultFieldResolved; - fieldResolver = (0, utils_1.wrapFieldResolver)(this.tracer, () => this.getConfig(), fieldResolverForExecute, isUsingDefaultResolver); - if (schema) { - (0, utils_1.wrapFields)(schema.getQueryType(), this.tracer, () => this.getConfig()); - (0, utils_1.wrapFields)(schema.getMutationType(), this.tracer, () => this.getConfig()); - } - return { - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - fieldResolver, - typeResolver, - }; - } -} -exports.GraphQLInstrumentation = GraphQLInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 68440: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OPERATION_NOT_SUPPORTED = void 0; -const symbols_1 = __nccwpck_require__(13573); -exports.OPERATION_NOT_SUPPORTED = 'Operation$operationName$not' + ' supported'; -//# sourceMappingURL=internal-types.js.map - -/***/ }), - -/***/ 13573: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OTEL_GRAPHQL_DATA_SYMBOL = exports.OTEL_PATCHED_SYMBOL = void 0; -exports.OTEL_PATCHED_SYMBOL = Symbol.for('opentelemetry.patched'); -exports.OTEL_GRAPHQL_DATA_SYMBOL = Symbol.for('opentelemetry.graphql_data'); -//# sourceMappingURL=symbols.js.map - -/***/ }), - -/***/ 37380: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 18627: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.wrapFieldResolver = exports.wrapFields = exports.getSourceFromLocation = exports.getOperation = exports.endSpan = exports.addSpanSource = exports.addInputVariableAttributes = exports.isPromise = void 0; -const api = __nccwpck_require__(65163); -const enum_1 = __nccwpck_require__(876); -const AttributeNames_1 = __nccwpck_require__(34455); -const symbols_1 = __nccwpck_require__(13573); -const OPERATION_VALUES = Object.values(enum_1.AllowedOperationTypes); -// https://github.com/graphql/graphql-js/blob/main/src/jsutils/isPromise.ts -const isPromise = (value) => { - return typeof (value === null || value === void 0 ? void 0 : value.then) === 'function'; -}; -exports.isPromise = isPromise; -// https://github.com/graphql/graphql-js/blob/main/src/jsutils/isObjectLike.ts -const isObjectLike = (value) => { - return typeof value == 'object' && value !== null; -}; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function addInputVariableAttribute(span, key, variable) { - if (Array.isArray(variable)) { - variable.forEach((value, idx) => { - addInputVariableAttribute(span, `${key}.${idx}`, value); - }); - } - else if (variable instanceof Object) { - Object.entries(variable).forEach(([nestedKey, value]) => { - addInputVariableAttribute(span, `${key}.${nestedKey}`, value); - }); - } - else { - span.setAttribute(`${AttributeNames_1.AttributeNames.VARIABLES}${String(key)}`, variable); - } -} -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function addInputVariableAttributes(span, variableValues) { - Object.entries(variableValues).forEach(([key, value]) => { - addInputVariableAttribute(span, key, value); - }); -} -exports.addInputVariableAttributes = addInputVariableAttributes; -function addSpanSource(span, loc, allowValues, start, end) { - const source = getSourceFromLocation(loc, allowValues, start, end); - span.setAttribute(AttributeNames_1.AttributeNames.SOURCE, source); -} -exports.addSpanSource = addSpanSource; -function createFieldIfNotExists(tracer, getConfig, contextValue, info, path) { - let field = getField(contextValue, path); - let spanAdded = false; - if (!field) { - spanAdded = true; - const parent = getParentField(contextValue, path); - field = { - parent, - span: createResolverSpan(tracer, getConfig, contextValue, info, path, parent.span), - error: null, - }; - addField(contextValue, path, field); - } - return { spanAdded, field }; -} -function createResolverSpan(tracer, getConfig, contextValue, info, path, parentSpan) { - var _a, _b; - const attributes = { - [AttributeNames_1.AttributeNames.FIELD_NAME]: info.fieldName, - [AttributeNames_1.AttributeNames.FIELD_PATH]: path.join('.'), - [AttributeNames_1.AttributeNames.FIELD_TYPE]: info.returnType.toString(), - }; - const span = tracer.startSpan(`${enum_1.SpanNames.RESOLVE} ${attributes[AttributeNames_1.AttributeNames.FIELD_PATH]}`, { - attributes, - }, parentSpan ? api.trace.setSpan(api.context.active(), parentSpan) : undefined); - const document = contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].source; - const fieldNode = info.fieldNodes.find(fieldNode => fieldNode.kind === 'Field'); - if (fieldNode) { - addSpanSource(span, document.loc, getConfig().allowValues, (_a = fieldNode.loc) === null || _a === void 0 ? void 0 : _a.start, (_b = fieldNode.loc) === null || _b === void 0 ? void 0 : _b.end); - } - return span; -} -function endSpan(span, error) { - if (error) { - span.recordException(error); - } - span.end(); -} -exports.endSpan = endSpan; -function getOperation(document, operationName) { - if (!document || !Array.isArray(document.definitions)) { - return undefined; - } - if (operationName) { - return document.definitions - .filter(definition => { var _a; return OPERATION_VALUES.indexOf((_a = definition) === null || _a === void 0 ? void 0 : _a.operation) !== -1; }) - .find(definition => { var _a, _b; return operationName === ((_b = (_a = definition) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.value); }); - } - else { - return document.definitions.find(definition => { var _a; return OPERATION_VALUES.indexOf((_a = definition) === null || _a === void 0 ? void 0 : _a.operation) !== -1; }); - } -} -exports.getOperation = getOperation; -function addField(contextValue, path, field) { - return (contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join('.')] = - field); -} -function getField(contextValue, path) { - return contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join('.')]; -} -function getParentField(contextValue, path) { - for (let i = path.length - 1; i > 0; i--) { - const field = getField(contextValue, path.slice(0, i)); - if (field) { - return field; - } - } - return { - span: contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].span, - }; -} -function pathToArray(mergeItems, path) { - const flattened = []; - let curr = path; - while (curr) { - let key = curr.key; - if (mergeItems && typeof key === 'number') { - key = '*'; - } - flattened.push(String(key)); - curr = curr.prev; - } - return flattened.reverse(); -} -function repeatBreak(i) { - return repeatChar('\n', i); -} -function repeatSpace(i) { - return repeatChar(' ', i); -} -function repeatChar(char, to) { - let text = ''; - for (let i = 0; i < to; i++) { - text += char; - } - return text; -} -const KindsToBeRemoved = [ - enum_1.TokenKind.FLOAT, - enum_1.TokenKind.STRING, - enum_1.TokenKind.INT, - enum_1.TokenKind.BLOCK_STRING, -]; -function getSourceFromLocation(loc, allowValues = false, inputStart, inputEnd) { - var _a, _b; - let source = ''; - if (loc === null || loc === void 0 ? void 0 : loc.startToken) { - const start = typeof inputStart === 'number' ? inputStart : loc.start; - const end = typeof inputEnd === 'number' ? inputEnd : loc.end; - let next = loc.startToken.next; - let previousLine = 1; - while (next) { - if (next.start < start) { - next = next.next; - previousLine = next === null || next === void 0 ? void 0 : next.line; - continue; - } - if (next.end > end) { - next = next.next; - previousLine = next === null || next === void 0 ? void 0 : next.line; - continue; - } - let value = next.value || next.kind; - let space = ''; - if (!allowValues && KindsToBeRemoved.indexOf(next.kind) >= 0) { - // value = repeatChar('*', value.length); - value = '*'; - } - if (next.kind === enum_1.TokenKind.STRING) { - value = `"${value}"`; - } - if (next.kind === enum_1.TokenKind.EOF) { - value = ''; - } - if (next.line > previousLine) { - source += repeatBreak(next.line - previousLine); - previousLine = next.line; - space = repeatSpace(next.column - 1); - } - else { - if (next.line === ((_a = next.prev) === null || _a === void 0 ? void 0 : _a.line)) { - space = repeatSpace(next.start - (((_b = next.prev) === null || _b === void 0 ? void 0 : _b.end) || 0)); - } - } - source += space + value; - if (next) { - next = next.next; - } - } - } - return source; -} -exports.getSourceFromLocation = getSourceFromLocation; -function wrapFields(type, tracer, getConfig) { - if (!type || - typeof type.getFields !== 'function' || - type[symbols_1.OTEL_PATCHED_SYMBOL]) { - return; - } - const fields = type.getFields(); - type[symbols_1.OTEL_PATCHED_SYMBOL] = true; - Object.keys(fields).forEach(key => { - const field = fields[key]; - if (!field) { - return; - } - if (field.resolve) { - field.resolve = wrapFieldResolver(tracer, getConfig, field.resolve); - } - if (field.type) { - let unwrappedType = field.type; - while (unwrappedType.ofType) { - unwrappedType = unwrappedType.ofType; - } - wrapFields(unwrappedType, tracer, getConfig); - } - }); -} -exports.wrapFields = wrapFields; -const handleResolveSpanError = (resolveSpan, err, shouldEndSpan) => { - if (!shouldEndSpan) { - return; - } - resolveSpan.recordException(err); - resolveSpan.setStatus({ - code: api.SpanStatusCode.ERROR, - message: err.message, - }); - resolveSpan.end(); -}; -const handleResolveSpanSuccess = (resolveSpan, shouldEndSpan) => { - if (!shouldEndSpan) { - return; - } - resolveSpan.end(); -}; -function wrapFieldResolver(tracer, getConfig, fieldResolver, isDefaultResolver = false) { - if (wrappedFieldResolver[symbols_1.OTEL_PATCHED_SYMBOL] || - typeof fieldResolver !== 'function') { - return fieldResolver; - } - function wrappedFieldResolver(source, args, contextValue, info) { - if (!fieldResolver) { - return undefined; - } - const config = getConfig(); - // follows what graphql is doing to decide if this is a trivial resolver - // for which we don't need to create a resolve span - if (config.ignoreTrivialResolveSpans && - isDefaultResolver && - (isObjectLike(source) || typeof source === 'function')) { - const property = source[info.fieldName]; - // a function execution is not trivial and should be recorder. - // property which is not a function is just a value and we don't want a "resolve" span for it - if (typeof property !== 'function') { - return fieldResolver.call(this, source, args, contextValue, info); - } - } - if (!contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL]) { - return fieldResolver.call(this, source, args, contextValue, info); - } - const path = pathToArray(config.mergeItems, info && info.path); - const depth = path.filter((item) => typeof item === 'string').length; - let field; - let shouldEndSpan = false; - if (config.depth >= 0 && config.depth < depth) { - field = getParentField(contextValue, path); - } - else { - const newField = createFieldIfNotExists(tracer, getConfig, contextValue, info, path); - field = newField.field; - shouldEndSpan = newField.spanAdded; - } - return api.context.with(api.trace.setSpan(api.context.active(), field.span), () => { - try { - const res = fieldResolver.call(this, source, args, contextValue, info); - if ((0, exports.isPromise)(res)) { - return res.then((r) => { - handleResolveSpanSuccess(field.span, shouldEndSpan); - return r; - }, (err) => { - handleResolveSpanError(field.span, err, shouldEndSpan); - throw err; - }); - } - else { - handleResolveSpanSuccess(field.span, shouldEndSpan); - return res; - } - } - catch (err) { - handleResolveSpanError(field.span, err, shouldEndSpan); - throw err; - } - }); - } - wrappedFieldResolver[symbols_1.OTEL_PATCHED_SYMBOL] = true; - return wrappedFieldResolver; -} -exports.wrapFieldResolver = wrapFieldResolver; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 43945: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.47.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-graphql'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 72357: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AttributeNames = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var AttributeNames; -(function (AttributeNames) { - AttributeNames["HAPI_TYPE"] = "hapi.type"; - AttributeNames["PLUGIN_NAME"] = "hapi.plugin.name"; - AttributeNames["EXT_TYPE"] = "server.ext.type"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 25435: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(60254), exports); -__exportStar(__nccwpck_require__(72357), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 60254: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HapiInstrumentation = void 0; -const api = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const instrumentation_1 = __nccwpck_require__(65584); -/** @knipignore */ -const version_1 = __nccwpck_require__(82796); -const internal_types_1 = __nccwpck_require__(62498); -const utils_1 = __nccwpck_require__(84417); -/** Hapi instrumentation for OpenTelemetry */ -class HapiInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return new instrumentation_1.InstrumentationNodeModuleDefinition(internal_types_1.HapiComponentName, ['>=17.0.0 <22'], (module) => { - const moduleExports = module[Symbol.toStringTag] === 'Module' ? module.default : module; - if (!(0, instrumentation_1.isWrapped)(moduleExports.server)) { - this._wrap(moduleExports, 'server', this._getServerPatch.bind(this)); - } - if (!(0, instrumentation_1.isWrapped)(moduleExports.Server)) { - this._wrap(moduleExports, 'Server', this._getServerPatch.bind(this)); - } - return moduleExports; - }, (module) => { - const moduleExports = module[Symbol.toStringTag] === 'Module' ? module.default : module; - this._massUnwrap([moduleExports], ['server', 'Server']); - }); - } - /** - * Patches the Hapi.server and Hapi.Server functions in order to instrument - * the server.route, server.ext, and server.register functions via calls to the - * @function _getServerRoutePatch, @function _getServerExtPatch, and - * @function _getServerRegisterPatch functions - * @param original - the original Hapi Server creation function - */ - _getServerPatch(original) { - const instrumentation = this; - const self = this; - return function server(opts) { - const newServer = original.apply(this, [opts]); - self._wrap(newServer, 'route', originalRouter => { - return instrumentation._getServerRoutePatch.bind(instrumentation)(originalRouter); - }); - // Casting as any is necessary here due to multiple overloads on the Hapi.ext - // function, which requires supporting a variety of different parameters - // as extension inputs - self._wrap(newServer, 'ext', originalExtHandler => { - return instrumentation._getServerExtPatch.bind(instrumentation)( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - originalExtHandler); - }); - // Casting as any is necessary here due to multiple overloads on the Hapi.Server.register - // function, which requires supporting a variety of different types of Plugin inputs - self._wrap(newServer, 'register', - // eslint-disable-next-line @typescript-eslint/no-explicit-any - instrumentation._getServerRegisterPatch.bind(instrumentation)); - return newServer; - }; - } - /** - * Patches the plugin register function used by the Hapi Server. This function - * goes through each plugin that is being registered and adds instrumentation - * via a call to the @function _wrapRegisterHandler function. - * @param {RegisterFunction} original - the original register function which - * registers each plugin on the server - */ - _getServerRegisterPatch(original) { - const instrumentation = this; - return function register(pluginInput, options) { - if (Array.isArray(pluginInput)) { - for (const pluginObj of pluginInput) { - const plugin = (0, utils_1.getPluginFromInput)(pluginObj); - instrumentation._wrapRegisterHandler(plugin); - } - } - else { - const plugin = (0, utils_1.getPluginFromInput)(pluginInput); - instrumentation._wrapRegisterHandler(plugin); - } - return original.apply(this, [pluginInput, options]); - }; - } - /** - * Patches the Server.ext function which adds extension methods to the specified - * point along the request lifecycle. This function accepts the full range of - * accepted input into the standard Hapi `server.ext` function. For each extension, - * it adds instrumentation to the handler via a call to the @function _wrapExtMethods - * function. - * @param original - the original ext function which adds the extension method to the server - * @param {string} [pluginName] - if present, represents the name of the plugin responsible - * for adding this server extension. Else, signifies that the extension was added directly - */ - _getServerExtPatch(original, pluginName) { - const instrumentation = this; - return function ext(...args) { - if (Array.isArray(args[0])) { - const eventsList = args[0]; - for (let i = 0; i < eventsList.length; i++) { - const eventObj = eventsList[i]; - if ((0, utils_1.isLifecycleExtType)(eventObj.type)) { - const lifecycleEventObj = eventObj; - const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, eventObj.type, pluginName); - lifecycleEventObj.method = handler; - eventsList[i] = lifecycleEventObj; - } - } - return original.apply(this, args); - } - else if ((0, utils_1.isDirectExtInput)(args)) { - const extInput = args; - const method = extInput[1]; - const handler = instrumentation._wrapExtMethods(method, extInput[0], pluginName); - return original.apply(this, [extInput[0], handler, extInput[2]]); - } - else if ((0, utils_1.isLifecycleExtEventObj)(args[0])) { - const lifecycleEventObj = args[0]; - const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, lifecycleEventObj.type, pluginName); - lifecycleEventObj.method = handler; - return original.call(this, lifecycleEventObj); - } - return original.apply(this, args); - }; - } - /** - * Patches the Server.route function. This function accepts either one or an array - * of Hapi.ServerRoute objects and adds instrumentation on each route via a call to - * the @function _wrapRouteHandler function. - * @param {HapiServerRouteInputMethod} original - the original route function which adds - * the route to the server - * @param {string} [pluginName] - if present, represents the name of the plugin responsible - * for adding this server route. Else, signifies that the route was added directly - */ - _getServerRoutePatch(original, pluginName) { - const instrumentation = this; - return function route(route) { - if (Array.isArray(route)) { - for (let i = 0; i < route.length; i++) { - const newRoute = instrumentation._wrapRouteHandler.call(instrumentation, route[i], pluginName); - route[i] = newRoute; - } - } - else { - route = instrumentation._wrapRouteHandler.call(instrumentation, route, pluginName); - } - return original.apply(this, [route]); - }; - } - /** - * Wraps newly registered plugins to add instrumentation to the plugin's clone of - * the original server. Specifically, wraps the server.route and server.ext functions - * via calls to @function _getServerRoutePatch and @function _getServerExtPatch - * @param {Hapi.Plugin} plugin - the new plugin which is being instrumented - */ - _wrapRegisterHandler(plugin) { - const instrumentation = this; - const pluginName = (0, utils_1.getPluginName)(plugin); - const oldRegister = plugin.register; - const self = this; - const newRegisterHandler = function (server, options) { - self._wrap(server, 'route', original => { - return instrumentation._getServerRoutePatch.bind(instrumentation)(original, pluginName); - }); - // Casting as any is necessary here due to multiple overloads on the Hapi.ext - // function, which requires supporting a variety of different parameters - // as extension inputs - self._wrap(server, 'ext', originalExtHandler => { - return instrumentation._getServerExtPatch.bind(instrumentation)( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - originalExtHandler, pluginName); - }); - return oldRegister.call(this, server, options); - }; - plugin.register = newRegisterHandler; - } - /** - * Wraps request extension methods to add instrumentation to each new extension handler. - * Patches each individual extension in order to create the - * span and propagate context. It does not create spans when there is no parent span. - * @param {PatchableExtMethod | PatchableExtMethod[]} method - the request extension - * handler which is being instrumented - * @param {Hapi.ServerRequestExtType} extPoint - the point in the Hapi request lifecycle - * which this extension targets - * @param {string} [pluginName] - if present, represents the name of the plugin responsible - * for adding this server route. Else, signifies that the route was added directly - */ - _wrapExtMethods(method, extPoint, pluginName) { - const instrumentation = this; - if (method instanceof Array) { - for (let i = 0; i < method.length; i++) { - method[i] = instrumentation._wrapExtMethods(method[i], extPoint); - } - return method; - } - else if ((0, utils_1.isPatchableExtMethod)(method)) { - if (method[internal_types_1.handlerPatched] === true) - return method; - method[internal_types_1.handlerPatched] = true; - const newHandler = async function (...params) { - if (api.trace.getSpan(api.context.active()) === undefined) { - return await method.apply(this, params); - } - const metadata = (0, utils_1.getExtMetadata)(extPoint, pluginName); - const span = instrumentation.tracer.startSpan(metadata.name, { - attributes: metadata.attributes, - }); - try { - return await api.context.with(api.trace.setSpan(api.context.active(), span), method, undefined, ...params); - } - catch (err) { - span.recordException(err); - span.setStatus({ - code: api.SpanStatusCode.ERROR, - message: err.message, - }); - throw err; - } - finally { - span.end(); - } - }; - return newHandler; - } - return method; - } - /** - * Patches each individual route handler method in order to create the - * span and propagate context. It does not create spans when there is no parent span. - * @param {PatchableServerRoute} route - the route handler which is being instrumented - * @param {string} [pluginName] - if present, represents the name of the plugin responsible - * for adding this server route. Else, signifies that the route was added directly - */ - _wrapRouteHandler(route, pluginName) { - var _a; - const instrumentation = this; - if (route[internal_types_1.handlerPatched] === true) - return route; - route[internal_types_1.handlerPatched] = true; - const wrapHandler = oldHandler => { - return async function (...params) { - if (api.trace.getSpan(api.context.active()) === undefined) { - return await oldHandler.call(this, ...params); - } - const rpcMetadata = (0, core_1.getRPCMetadata)(api.context.active()); - if ((rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP) { - rpcMetadata.route = route.path; - } - const metadata = (0, utils_1.getRouteMetadata)(route, pluginName); - const span = instrumentation.tracer.startSpan(metadata.name, { - attributes: metadata.attributes, - }); - try { - return await api.context.with(api.trace.setSpan(api.context.active(), span), () => oldHandler.call(this, ...params)); - } - catch (err) { - span.recordException(err); - span.setStatus({ - code: api.SpanStatusCode.ERROR, - message: err.message, - }); - throw err; - } - finally { - span.end(); - } - }; - }; - if (typeof route.handler === 'function') { - route.handler = wrapHandler(route.handler); - } - else if (typeof route.options === 'function') { - const oldOptions = route.options; - route.options = function (server) { - const options = oldOptions(server); - if (typeof options.handler === 'function') { - options.handler = wrapHandler(options.handler); - } - return options; - }; - } - else if (typeof ((_a = route.options) === null || _a === void 0 ? void 0 : _a.handler) === 'function') { - route.options.handler = wrapHandler(route.options.handler); - } - return route; - } -} -exports.HapiInstrumentation = HapiInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 62498: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HapiLifecycleMethodNames = exports.HapiLayerType = exports.handlerPatched = exports.HapiComponentName = void 0; -exports.HapiComponentName = '@hapi/hapi'; -/** - * This symbol is used to mark a Hapi route handler or server extension handler as - * already patched, since its possible to use these handlers multiple times - * i.e. when allowing multiple versions of one plugin, or when registering a plugin - * multiple times on different servers. - */ -exports.handlerPatched = Symbol('hapi-handler-patched'); -exports.HapiLayerType = { - ROUTER: 'router', - PLUGIN: 'plugin', - EXT: 'server.ext', -}; -exports.HapiLifecycleMethodNames = new Set([ - 'onPreAuth', - 'onCredentials', - 'onPostAuth', - 'onPreHandler', - 'onPostHandler', - 'onPreResponse', - 'onRequest', -]); -//# sourceMappingURL=internal-types.js.map - -/***/ }), - -/***/ 84417: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getPluginFromInput = exports.getExtMetadata = exports.getRouteMetadata = exports.isPatchableExtMethod = exports.isDirectExtInput = exports.isLifecycleExtEventObj = exports.isLifecycleExtType = exports.getPluginName = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const internal_types_1 = __nccwpck_require__(62498); -const AttributeNames_1 = __nccwpck_require__(72357); -function getPluginName(plugin) { - if (plugin.name) { - return plugin.name; - } - else { - return plugin.pkg.name; - } -} -exports.getPluginName = getPluginName; -const isLifecycleExtType = (variableToCheck) => { - return (typeof variableToCheck === 'string' && - internal_types_1.HapiLifecycleMethodNames.has(variableToCheck)); -}; -exports.isLifecycleExtType = isLifecycleExtType; -const isLifecycleExtEventObj = (variableToCheck) => { - var _a; - const event = (_a = variableToCheck) === null || _a === void 0 ? void 0 : _a.type; - return event !== undefined && (0, exports.isLifecycleExtType)(event); -}; -exports.isLifecycleExtEventObj = isLifecycleExtEventObj; -const isDirectExtInput = (variableToCheck) => { - return (Array.isArray(variableToCheck) && - variableToCheck.length <= 3 && - (0, exports.isLifecycleExtType)(variableToCheck[0]) && - typeof variableToCheck[1] === 'function'); -}; -exports.isDirectExtInput = isDirectExtInput; -const isPatchableExtMethod = (variableToCheck) => { - return !Array.isArray(variableToCheck); -}; -exports.isPatchableExtMethod = isPatchableExtMethod; -const getRouteMetadata = (route, pluginName) => { - if (pluginName) { - return { - attributes: { - [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: route.path, - [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: route.method, - [AttributeNames_1.AttributeNames.HAPI_TYPE]: internal_types_1.HapiLayerType.PLUGIN, - [AttributeNames_1.AttributeNames.PLUGIN_NAME]: pluginName, - }, - name: `${pluginName}: route - ${route.path}`, - }; - } - return { - attributes: { - [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: route.path, - [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: route.method, - [AttributeNames_1.AttributeNames.HAPI_TYPE]: internal_types_1.HapiLayerType.ROUTER, - }, - name: `route - ${route.path}`, - }; -}; -exports.getRouteMetadata = getRouteMetadata; -const getExtMetadata = (extPoint, pluginName) => { - if (pluginName) { - return { - attributes: { - [AttributeNames_1.AttributeNames.EXT_TYPE]: extPoint, - [AttributeNames_1.AttributeNames.HAPI_TYPE]: internal_types_1.HapiLayerType.EXT, - [AttributeNames_1.AttributeNames.PLUGIN_NAME]: pluginName, - }, - name: `${pluginName}: ext - ${extPoint}`, - }; - } - return { - attributes: { - [AttributeNames_1.AttributeNames.EXT_TYPE]: extPoint, - [AttributeNames_1.AttributeNames.HAPI_TYPE]: internal_types_1.HapiLayerType.EXT, - }, - name: `ext - ${extPoint}`, - }; -}; -exports.getExtMetadata = getExtMetadata; -const getPluginFromInput = (pluginObj) => { - if ('plugin' in pluginObj) { - if ('plugin' in pluginObj.plugin) { - return pluginObj.plugin.plugin; - } - return pluginObj.plugin; - } - return pluginObj; -}; -exports.getPluginFromInput = getPluginFromInput; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 82796: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.45.1'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-hapi'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 66169: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AttributeNames = void 0; -/** - * https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md - */ -var AttributeNames; -(function (AttributeNames) { - AttributeNames["HTTP_ERROR_NAME"] = "http.error_name"; - AttributeNames["HTTP_ERROR_MESSAGE"] = "http.error_message"; - AttributeNames["HTTP_STATUS_TEXT"] = "http.status_text"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 57719: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpInstrumentation = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(37890); -const semver = __nccwpck_require__(50326); -const url = __nccwpck_require__(57310); -const version_1 = __nccwpck_require__(14963); -const instrumentation_1 = __nccwpck_require__(65584); -const core_2 = __nccwpck_require__(37890); -const events_1 = __nccwpck_require__(82361); -const semantic_conventions_1 = __nccwpck_require__(67275); -const utils_1 = __nccwpck_require__(82095); -/** - * `node:http` and `node:https` instrumentation for OpenTelemetry - */ -class HttpInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super('@opentelemetry/instrumentation-http', version_1.VERSION, config); - /** keep track on spans not ended */ - this._spanNotEnded = new WeakSet(); - this._semconvStability = 2 /* OLD */; - this._headerCapture = this._createHeaderCapture(); - for (const entry of (0, core_2.getEnv)().OTEL_SEMCONV_STABILITY_OPT_IN) { - if (entry.toLowerCase() === 'http/dup') { - // http/dup takes highest precedence. If it is found, there is no need to read the rest of the list - this._semconvStability = 3 /* DUPLICATE */; - break; - } - else if (entry.toLowerCase() === 'http') { - this._semconvStability = 1 /* STABLE */; - } - } - } - _updateMetricInstruments() { - this._oldHttpServerDurationHistogram = this.meter.createHistogram('http.server.duration', { - description: 'Measures the duration of inbound HTTP requests.', - unit: 'ms', - valueType: api_1.ValueType.DOUBLE, - }); - this._oldHttpClientDurationHistogram = this.meter.createHistogram('http.client.duration', { - description: 'Measures the duration of outbound HTTP requests.', - unit: 'ms', - valueType: api_1.ValueType.DOUBLE, - }); - this._stableHttpServerDurationHistogram = this.meter.createHistogram(semantic_conventions_1.METRIC_HTTP_SERVER_REQUEST_DURATION, { - description: 'Duration of HTTP server requests.', - unit: 's', - valueType: api_1.ValueType.DOUBLE, - advice: { - explicitBucketBoundaries: [ - 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, - 7.5, 10, - ], - }, - }); - this._stableHttpClientDurationHistogram = this.meter.createHistogram(semantic_conventions_1.METRIC_HTTP_CLIENT_REQUEST_DURATION, { - description: 'Duration of HTTP client requests.', - unit: 's', - valueType: api_1.ValueType.DOUBLE, - advice: { - explicitBucketBoundaries: [ - 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, - 7.5, 10, - ], - }, - }); - } - _recordServerDuration(durationMs, oldAttributes, stableAttributes) { - if ((this._semconvStability & 2 /* OLD */) === - 2 /* OLD */) { - // old histogram is counted in MS - this._oldHttpServerDurationHistogram.record(durationMs, oldAttributes); - } - if ((this._semconvStability & 1 /* STABLE */) === - 1 /* STABLE */) { - // stable histogram is counted in S - this._stableHttpServerDurationHistogram.record(durationMs / 1000, stableAttributes); - } - } - _recordClientDuration(durationMs, oldAttributes, stableAttributes) { - if ((this._semconvStability & 2 /* OLD */) === - 2 /* OLD */) { - // old histogram is counted in MS - this._oldHttpClientDurationHistogram.record(durationMs, oldAttributes); - } - if ((this._semconvStability & 1 /* STABLE */) === - 1 /* STABLE */) { - // stable histogram is counted in S - this._stableHttpClientDurationHistogram.record(durationMs / 1000, stableAttributes); - } - } - setConfig(config = {}) { - super.setConfig(config); - this._headerCapture = this._createHeaderCapture(); - } - init() { - return [this._getHttpsInstrumentation(), this._getHttpInstrumentation()]; - } - _getHttpInstrumentation() { - return new instrumentation_1.InstrumentationNodeModuleDefinition('http', ['*'], (moduleExports) => { - const isESM = moduleExports[Symbol.toStringTag] === 'Module'; - if (!this.getConfig().disableOutgoingRequestInstrumentation) { - const patchedRequest = this._wrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction('http')); - const patchedGet = this._wrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest)); - if (isESM) { - // To handle `import http from 'http'`, which returns the default - // export, we need to set `module.default.*`. - moduleExports.default.request = patchedRequest; - moduleExports.default.get = patchedGet; - } - } - if (!this.getConfig().disableIncomingRequestInstrumentation) { - this._wrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction('http')); - } - return moduleExports; - }, (moduleExports) => { - if (moduleExports === undefined) - return; - if (!this.getConfig().disableOutgoingRequestInstrumentation) { - this._unwrap(moduleExports, 'request'); - this._unwrap(moduleExports, 'get'); - } - if (!this.getConfig().disableIncomingRequestInstrumentation) { - this._unwrap(moduleExports.Server.prototype, 'emit'); - } - }); - } - _getHttpsInstrumentation() { - return new instrumentation_1.InstrumentationNodeModuleDefinition('https', ['*'], (moduleExports) => { - const isESM = moduleExports[Symbol.toStringTag] === 'Module'; - if (!this.getConfig().disableOutgoingRequestInstrumentation) { - const patchedRequest = this._wrap(moduleExports, 'request', this._getPatchHttpsOutgoingRequestFunction('https')); - const patchedGet = this._wrap(moduleExports, 'get', this._getPatchHttpsOutgoingGetFunction(patchedRequest)); - if (isESM) { - // To handle `import https from 'https'`, which returns the default - // export, we need to set `module.default.*`. - moduleExports.default.request = patchedRequest; - moduleExports.default.get = patchedGet; - } - } - if (!this.getConfig().disableIncomingRequestInstrumentation) { - this._wrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction('https')); - } - return moduleExports; - }, (moduleExports) => { - if (moduleExports === undefined) - return; - if (!this.getConfig().disableOutgoingRequestInstrumentation) { - this._unwrap(moduleExports, 'request'); - this._unwrap(moduleExports, 'get'); - } - if (!this.getConfig().disableIncomingRequestInstrumentation) { - this._unwrap(moduleExports.Server.prototype, 'emit'); - } - }); - } - /** - * Creates spans for incoming requests, restoring spans' context if applied. - */ - _getPatchIncomingRequestFunction(component) { - return (original) => { - return this._incomingRequestFunction(component, original); - }; - } - /** - * Creates spans for outgoing requests, sending spans' context for distributed - * tracing. - */ - _getPatchOutgoingRequestFunction(component) { - return (original) => { - return this._outgoingRequestFunction(component, original); - }; - } - _getPatchOutgoingGetFunction(clientRequest) { - return (_original) => { - // Re-implement http.get. This needs to be done (instead of using - // getPatchOutgoingRequestFunction to patch it) because we need to - // set the trace context header before the returned http.ClientRequest is - // ended. The Node.js docs state that the only differences between - // request and get are that (1) get defaults to the HTTP GET method and - // (2) the returned request object is ended immediately. The former is - // already true (at least in supported Node versions up to v10), so we - // simply follow the latter. Ref: - // https://nodejs.org/dist/latest/docs/api/http.html#http_http_get_options_callback - // https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/instrumentations/instrumentation-http.ts#L198 - return function outgoingGetRequest(options, ...args) { - const req = clientRequest(options, ...args); - req.end(); - return req; - }; - }; - } - /** Patches HTTPS outgoing requests */ - _getPatchHttpsOutgoingRequestFunction(component) { - return (original) => { - const instrumentation = this; - return function httpsOutgoingRequest( - // eslint-disable-next-line node/no-unsupported-features/node-builtins - options, ...args) { - var _a; - // Makes sure options will have default HTTPS parameters - if (component === 'https' && - typeof options === 'object' && - ((_a = options === null || options === void 0 ? void 0 : options.constructor) === null || _a === void 0 ? void 0 : _a.name) !== 'URL') { - options = Object.assign({}, options); - instrumentation._setDefaultOptions(options); - } - return instrumentation._getPatchOutgoingRequestFunction(component)(original)(options, ...args); - }; - }; - } - _setDefaultOptions(options) { - options.protocol = options.protocol || 'https:'; - options.port = options.port || 443; - } - /** Patches HTTPS outgoing get requests */ - _getPatchHttpsOutgoingGetFunction(clientRequest) { - return (original) => { - const instrumentation = this; - return function httpsOutgoingRequest( - // eslint-disable-next-line node/no-unsupported-features/node-builtins - options, ...args) { - return instrumentation._getPatchOutgoingGetFunction(clientRequest)(original)(options, ...args); - }; - }; - } - /** - * Attach event listeners to a client request to end span and add span attributes. - * - * @param request The original request object. - * @param span representing the current operation - * @param startTime representing the start time of the request to calculate duration in Metric - * @param oldMetricAttributes metric attributes for old semantic conventions - * @param stableMetricAttributes metric attributes for new semantic conventions - */ - _traceClientRequest(request, span, startTime, oldMetricAttributes, stableMetricAttributes) { - if (this.getConfig().requestHook) { - this._callRequestHook(span, request); - } - /** - * Determines if the request has errored or the response has ended/errored. - */ - let responseFinished = false; - /* - * User 'response' event listeners can be added before our listener, - * force our listener to be the first, so response emitter is bound - * before any user listeners are added to it. - */ - request.prependListener('response', (response) => { - this._diag.debug('outgoingRequest on response()'); - if (request.listenerCount('response') <= 1) { - response.resume(); - } - const responseAttributes = (0, utils_1.getOutgoingRequestAttributesOnResponse)(response, this._semconvStability); - span.setAttributes(responseAttributes); - oldMetricAttributes = Object.assign(oldMetricAttributes, (0, utils_1.getOutgoingRequestMetricAttributesOnResponse)(responseAttributes)); - if (this.getConfig().responseHook) { - this._callResponseHook(span, response); - } - this._headerCapture.client.captureRequestHeaders(span, header => request.getHeader(header)); - this._headerCapture.client.captureResponseHeaders(span, header => response.headers[header]); - api_1.context.bind(api_1.context.active(), response); - const endHandler = () => { - this._diag.debug('outgoingRequest on end()'); - if (responseFinished) { - return; - } - responseFinished = true; - let status; - if (response.aborted && !response.complete) { - status = { code: api_1.SpanStatusCode.ERROR }; - } - else { - // behaves same for new and old semconv - status = { - code: (0, utils_1.parseResponseStatus)(api_1.SpanKind.CLIENT, response.statusCode), - }; - } - span.setStatus(status); - if (this.getConfig().applyCustomAttributesOnSpan) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => this.getConfig().applyCustomAttributesOnSpan(span, request, response), () => { }, true); - } - this._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); - }; - response.on('end', endHandler); - // See https://github.com/open-telemetry/opentelemetry-js/pull/3625#issuecomment-1475673533 - if (semver.lt(process.version, '16.0.0')) { - response.on('close', endHandler); - } - response.on(events_1.errorMonitor, (error) => { - this._diag.debug('outgoingRequest on error()', error); - if (responseFinished) { - return; - } - responseFinished = true; - (0, utils_1.setSpanWithError)(span, error, this._semconvStability); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: error.message, - }); - this._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); - }); - }); - request.on('close', () => { - this._diag.debug('outgoingRequest on request close()'); - if (request.aborted || responseFinished) { - return; - } - responseFinished = true; - this._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); - }); - request.on(events_1.errorMonitor, (error) => { - this._diag.debug('outgoingRequest on request error()', error); - if (responseFinished) { - return; - } - responseFinished = true; - (0, utils_1.setSpanWithError)(span, error, this._semconvStability); - this._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); - }); - this._diag.debug('http.ClientRequest return request'); - return request; - } - _incomingRequestFunction(component, original) { - const instrumentation = this; - return function incomingRequest(event, ...args) { - // Only traces request events - if (event !== 'request') { - return original.apply(this, [event, ...args]); - } - const request = args[0]; - const response = args[1]; - const method = request.method || 'GET'; - instrumentation._diag.debug(`${component} instrumentation incomingRequest`); - if ((0, instrumentation_1.safeExecuteInTheMiddle)(() => { var _a, _b; return (_b = (_a = instrumentation.getConfig()).ignoreIncomingRequestHook) === null || _b === void 0 ? void 0 : _b.call(_a, request); }, (e) => { - if (e != null) { - instrumentation._diag.error('caught ignoreIncomingRequestHook error: ', e); - } - }, true)) { - return api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { - api_1.context.bind(api_1.context.active(), request); - api_1.context.bind(api_1.context.active(), response); - return original.apply(this, [event, ...args]); - }); - } - const headers = request.headers; - const spanAttributes = (0, utils_1.getIncomingRequestAttributes)(request, { - component: component, - serverName: instrumentation.getConfig().serverName, - hookAttributes: instrumentation._callStartSpanHook(request, instrumentation.getConfig().startIncomingSpanHook), - semconvStability: instrumentation._semconvStability, - }, instrumentation._diag); - const spanOptions = { - kind: api_1.SpanKind.SERVER, - attributes: spanAttributes, - }; - const startTime = (0, core_1.hrTime)(); - const oldMetricAttributes = (0, utils_1.getIncomingRequestMetricAttributes)(spanAttributes); - // request method and url.scheme are both required span attributes - const stableMetricAttributes = { - [semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: spanAttributes[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD], - [semantic_conventions_1.ATTR_URL_SCHEME]: spanAttributes[semantic_conventions_1.ATTR_URL_SCHEME], - }; - // recommended if and only if one was sent, same as span recommendation - if (spanAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]) { - stableMetricAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION] = - spanAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]; - } - const ctx = api_1.propagation.extract(api_1.ROOT_CONTEXT, headers); - const span = instrumentation._startHttpSpan(method, spanOptions, ctx); - const rpcMetadata = { - type: core_2.RPCType.HTTP, - span, - }; - return api_1.context.with((0, core_2.setRPCMetadata)(api_1.trace.setSpan(ctx, span), rpcMetadata), () => { - api_1.context.bind(api_1.context.active(), request); - api_1.context.bind(api_1.context.active(), response); - if (instrumentation.getConfig().requestHook) { - instrumentation._callRequestHook(span, request); - } - if (instrumentation.getConfig().responseHook) { - instrumentation._callResponseHook(span, response); - } - instrumentation._headerCapture.server.captureRequestHeaders(span, header => request.headers[header]); - // After 'error', no further events other than 'close' should be emitted. - let hasError = false; - response.on('close', () => { - if (hasError) { - return; - } - instrumentation._onServerResponseFinish(request, response, span, oldMetricAttributes, stableMetricAttributes, startTime); - }); - response.on(events_1.errorMonitor, (err) => { - hasError = true; - instrumentation._onServerResponseError(span, oldMetricAttributes, stableMetricAttributes, startTime, err); - }); - return (0, instrumentation_1.safeExecuteInTheMiddle)(() => original.apply(this, [event, ...args]), error => { - if (error) { - (0, utils_1.setSpanWithError)(span, error, instrumentation._semconvStability); - instrumentation._closeHttpSpan(span, api_1.SpanKind.SERVER, startTime, oldMetricAttributes, stableMetricAttributes); - throw error; - } - }); - }); - }; - } - _outgoingRequestFunction(component, original) { - const instrumentation = this; - return function outgoingRequest(options, ...args) { - if (!(0, utils_1.isValidOptionsType)(options)) { - return original.apply(this, [options, ...args]); - } - const extraOptions = typeof args[0] === 'object' && - (typeof options === 'string' || options instanceof url.URL) - ? args.shift() - : undefined; - const { method, invalidUrl, optionsParsed } = (0, utils_1.getRequestInfo)(instrumentation._diag, options, extraOptions); - /** - * Node 8's https module directly call the http one so to avoid creating - * 2 span for the same request we need to check that the protocol is correct - * See: https://github.com/nodejs/node/blob/v8.17.0/lib/https.js#L245 - */ - if (component === 'http' && - semver.lt(process.version, '9.0.0') && - optionsParsed.protocol === 'https:') { - return original.apply(this, [optionsParsed, ...args]); - } - if ((0, instrumentation_1.safeExecuteInTheMiddle)(() => { - var _a, _b; - return (_b = (_a = instrumentation - .getConfig()).ignoreOutgoingRequestHook) === null || _b === void 0 ? void 0 : _b.call(_a, optionsParsed); - }, (e) => { - if (e != null) { - instrumentation._diag.error('caught ignoreOutgoingRequestHook error: ', e); - } - }, true)) { - return original.apply(this, [optionsParsed, ...args]); - } - const { hostname, port } = (0, utils_1.extractHostnameAndPort)(optionsParsed); - const attributes = (0, utils_1.getOutgoingRequestAttributes)(optionsParsed, { - component, - port, - hostname, - hookAttributes: instrumentation._callStartSpanHook(optionsParsed, instrumentation.getConfig().startOutgoingSpanHook), - }, instrumentation._semconvStability); - const startTime = (0, core_1.hrTime)(); - const oldMetricAttributes = (0, utils_1.getOutgoingRequestMetricAttributes)(attributes); - // request method, server address, and server port are both required span attributes - const stableMetricAttributes = { - [semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: attributes[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD], - [semantic_conventions_1.ATTR_SERVER_ADDRESS]: attributes[semantic_conventions_1.ATTR_SERVER_ADDRESS], - [semantic_conventions_1.ATTR_SERVER_PORT]: attributes[semantic_conventions_1.ATTR_SERVER_PORT], - }; - // required if and only if one was sent, same as span requirement - if (attributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]) { - stableMetricAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE] = - attributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]; - } - // recommended if and only if one was sent, same as span recommendation - if (attributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]) { - stableMetricAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION] = - attributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]; - } - const spanOptions = { - kind: api_1.SpanKind.CLIENT, - attributes, - }; - const span = instrumentation._startHttpSpan(method, spanOptions); - const parentContext = api_1.context.active(); - const requestContext = api_1.trace.setSpan(parentContext, span); - if (!optionsParsed.headers) { - optionsParsed.headers = {}; - } - else { - // Make a copy of the headers object to avoid mutating an object the - // caller might have a reference to. - optionsParsed.headers = Object.assign({}, optionsParsed.headers); - } - api_1.propagation.inject(requestContext, optionsParsed.headers); - return api_1.context.with(requestContext, () => { - /* - * The response callback is registered before ClientRequest is bound, - * thus it is needed to bind it before the function call. - */ - const cb = args[args.length - 1]; - if (typeof cb === 'function') { - args[args.length - 1] = api_1.context.bind(parentContext, cb); - } - const request = (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - if (invalidUrl) { - // we know that the url is invalid, there's no point in injecting context as it will fail validation. - // Passing in what the user provided will give the user an error that matches what they'd see without - // the instrumentation. - return original.apply(this, [options, ...args]); - } - else { - return original.apply(this, [optionsParsed, ...args]); - } - }, error => { - if (error) { - (0, utils_1.setSpanWithError)(span, error, instrumentation._semconvStability); - instrumentation._closeHttpSpan(span, api_1.SpanKind.CLIENT, startTime, oldMetricAttributes, stableMetricAttributes); - throw error; - } - }); - instrumentation._diag.debug(`${component} instrumentation outgoingRequest`); - api_1.context.bind(parentContext, request); - return instrumentation._traceClientRequest(request, span, startTime, oldMetricAttributes, stableMetricAttributes); - }); - }; - } - _onServerResponseFinish(request, response, span, oldMetricAttributes, stableMetricAttributes, startTime) { - const attributes = (0, utils_1.getIncomingRequestAttributesOnResponse)(request, response, this._semconvStability); - oldMetricAttributes = Object.assign(oldMetricAttributes, (0, utils_1.getIncomingRequestMetricAttributesOnResponse)(attributes)); - stableMetricAttributes = Object.assign(stableMetricAttributes, (0, utils_1.getIncomingStableRequestMetricAttributesOnResponse)(attributes)); - this._headerCapture.server.captureResponseHeaders(span, header => response.getHeader(header)); - span.setAttributes(attributes).setStatus({ - code: (0, utils_1.parseResponseStatus)(api_1.SpanKind.SERVER, response.statusCode), - }); - const route = attributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE]; - if (route) { - span.updateName(`${request.method || 'GET'} ${route}`); - } - if (this.getConfig().applyCustomAttributesOnSpan) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => this.getConfig().applyCustomAttributesOnSpan(span, request, response), () => { }, true); - } - this._closeHttpSpan(span, api_1.SpanKind.SERVER, startTime, oldMetricAttributes, stableMetricAttributes); - } - _onServerResponseError(span, oldMetricAttributes, stableMetricAttributes, startTime, error) { - (0, utils_1.setSpanWithError)(span, error, this._semconvStability); - // TODO get error attributes for metrics - this._closeHttpSpan(span, api_1.SpanKind.SERVER, startTime, oldMetricAttributes, stableMetricAttributes); - } - _startHttpSpan(name, options, ctx = api_1.context.active()) { - /* - * If a parent is required but not present, we use a `NoopSpan` to still - * propagate context without recording it. - */ - const requireParent = options.kind === api_1.SpanKind.CLIENT - ? this.getConfig().requireParentforOutgoingSpans - : this.getConfig().requireParentforIncomingSpans; - let span; - const currentSpan = api_1.trace.getSpan(ctx); - if (requireParent === true && currentSpan === undefined) { - span = api_1.trace.wrapSpanContext(api_1.INVALID_SPAN_CONTEXT); - } - else if (requireParent === true && (currentSpan === null || currentSpan === void 0 ? void 0 : currentSpan.spanContext().isRemote)) { - span = currentSpan; - } - else { - span = this.tracer.startSpan(name, options, ctx); - } - this._spanNotEnded.add(span); - return span; - } - _closeHttpSpan(span, spanKind, startTime, oldMetricAttributes, stableMetricAttributes) { - if (!this._spanNotEnded.has(span)) { - return; - } - span.end(); - this._spanNotEnded.delete(span); - // Record metrics - const duration = (0, core_1.hrTimeToMilliseconds)((0, core_1.hrTimeDuration)(startTime, (0, core_1.hrTime)())); - if (spanKind === api_1.SpanKind.SERVER) { - this._recordServerDuration(duration, oldMetricAttributes, stableMetricAttributes); - } - else if (spanKind === api_1.SpanKind.CLIENT) { - this._recordClientDuration(duration, oldMetricAttributes, stableMetricAttributes); - } - } - _callResponseHook(span, response) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => this.getConfig().responseHook(span, response), () => { }, true); - } - _callRequestHook(span, request) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => this.getConfig().requestHook(span, request), () => { }, true); - } - _callStartSpanHook(request, hookFunc) { - if (typeof hookFunc === 'function') { - return (0, instrumentation_1.safeExecuteInTheMiddle)(() => hookFunc(request), () => { }, true); - } - } - _createHeaderCapture() { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; - const config = this.getConfig(); - return { - client: { - captureRequestHeaders: (0, utils_1.headerCapture)('request', (_c = (_b = (_a = config.headersToSpanAttributes) === null || _a === void 0 ? void 0 : _a.client) === null || _b === void 0 ? void 0 : _b.requestHeaders) !== null && _c !== void 0 ? _c : []), - captureResponseHeaders: (0, utils_1.headerCapture)('response', (_f = (_e = (_d = config.headersToSpanAttributes) === null || _d === void 0 ? void 0 : _d.client) === null || _e === void 0 ? void 0 : _e.responseHeaders) !== null && _f !== void 0 ? _f : []), - }, - server: { - captureRequestHeaders: (0, utils_1.headerCapture)('request', (_j = (_h = (_g = config.headersToSpanAttributes) === null || _g === void 0 ? void 0 : _g.server) === null || _h === void 0 ? void 0 : _h.requestHeaders) !== null && _j !== void 0 ? _j : []), - captureResponseHeaders: (0, utils_1.headerCapture)('response', (_m = (_l = (_k = config.headersToSpanAttributes) === null || _k === void 0 ? void 0 : _k.server) === null || _l === void 0 ? void 0 : _l.responseHeaders) !== null && _m !== void 0 ? _m : []), - }, - }; - } -} -exports.HttpInstrumentation = HttpInstrumentation; -//# sourceMappingURL=http.js.map - -/***/ }), - -/***/ 50611: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HttpInstrumentation = void 0; -var http_1 = __nccwpck_require__(57719); -Object.defineProperty(exports, "HttpInstrumentation", ({ enumerable: true, get: function () { return http_1.HttpInstrumentation; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 82095: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.headerCapture = exports.getIncomingStableRequestMetricAttributesOnResponse = exports.getIncomingRequestMetricAttributesOnResponse = exports.getIncomingRequestAttributesOnResponse = exports.getIncomingRequestMetricAttributes = exports.getIncomingRequestAttributes = exports.getRemoteClientAddress = exports.getOutgoingRequestMetricAttributesOnResponse = exports.getOutgoingRequestAttributesOnResponse = exports.setAttributesFromHttpKind = exports.getOutgoingRequestMetricAttributes = exports.getOutgoingRequestAttributes = exports.extractHostnameAndPort = exports.isValidOptionsType = exports.getRequestInfo = exports.isCompressed = exports.setResponseContentLengthAttribute = exports.setRequestContentLengthAttribute = exports.setSpanWithError = exports.satisfiesPattern = exports.parseResponseStatus = exports.getAbsoluteUrl = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const semantic_conventions_1 = __nccwpck_require__(67275); -const core_1 = __nccwpck_require__(37890); -const url = __nccwpck_require__(57310); -const AttributeNames_1 = __nccwpck_require__(66169); -const forwardedParse = __nccwpck_require__(37289); -/** - * Get an absolute url - */ -const getAbsoluteUrl = (requestUrl, headers, fallbackProtocol = 'http:') => { - const reqUrlObject = requestUrl || {}; - const protocol = reqUrlObject.protocol || fallbackProtocol; - const port = (reqUrlObject.port || '').toString(); - const path = reqUrlObject.path || '/'; - let host = reqUrlObject.host || reqUrlObject.hostname || headers.host || 'localhost'; - // if there is no port in host and there is a port - // it should be displayed if it's not 80 and 443 (default ports) - if (host.indexOf(':') === -1 && - port && - port !== '80' && - port !== '443') { - host += `:${port}`; - } - return `${protocol}//${host}${path}`; -}; -exports.getAbsoluteUrl = getAbsoluteUrl; -/** - * Parse status code from HTTP response. [More details](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md#status) - */ -const parseResponseStatus = (kind, statusCode) => { - const upperBound = kind === api_1.SpanKind.CLIENT ? 400 : 500; - // 1xx, 2xx, 3xx are OK on client and server - // 4xx is OK on server - if (statusCode && statusCode >= 100 && statusCode < upperBound) { - return api_1.SpanStatusCode.UNSET; - } - // All other codes are error - return api_1.SpanStatusCode.ERROR; -}; -exports.parseResponseStatus = parseResponseStatus; -/** - * Check whether the given obj match pattern - * @param constant e.g URL of request - * @param pattern Match pattern - */ -const satisfiesPattern = (constant, pattern) => { - if (typeof pattern === 'string') { - return pattern === constant; - } - else if (pattern instanceof RegExp) { - return pattern.test(constant); - } - else if (typeof pattern === 'function') { - return pattern(constant); - } - else { - throw new TypeError('Pattern is in unsupported datatype'); - } -}; -exports.satisfiesPattern = satisfiesPattern; -/** - * Sets the span with the error passed in params - * @param {Span} span the span that need to be set - * @param {Error} error error that will be set to span - * @param {SemconvStability} semconvStability determines which semconv version to use - */ -const setSpanWithError = (span, error, semconvStability) => { - const message = error.message; - if ((semconvStability & 2 /* OLD */) === 2 /* OLD */) { - span.setAttribute(AttributeNames_1.AttributeNames.HTTP_ERROR_NAME, error.name); - span.setAttribute(AttributeNames_1.AttributeNames.HTTP_ERROR_MESSAGE, message); - } - if ((semconvStability & 1 /* STABLE */) === - 1 /* STABLE */) { - span.setAttribute(semantic_conventions_1.ATTR_ERROR_TYPE, error.name); - } - span.setStatus({ code: api_1.SpanStatusCode.ERROR, message }); - span.recordException(error); -}; -exports.setSpanWithError = setSpanWithError; -/** - * Adds attributes for request content-length and content-encoding HTTP headers - * @param { IncomingMessage } Request object whose headers will be analyzed - * @param { Attributes } Attributes object to be modified - */ -const setRequestContentLengthAttribute = (request, attributes) => { - const length = getContentLength(request.headers); - if (length === null) - return; - if ((0, exports.isCompressed)(request.headers)) { - attributes[semantic_conventions_1.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH] = length; - } - else { - attributes[semantic_conventions_1.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED] = length; - } -}; -exports.setRequestContentLengthAttribute = setRequestContentLengthAttribute; -/** - * Adds attributes for response content-length and content-encoding HTTP headers - * @param { IncomingMessage } Response object whose headers will be analyzed - * @param { Attributes } Attributes object to be modified - * - * @deprecated this is for an older version of semconv. It is retained for compatibility using OTEL_SEMCONV_STABILITY_OPT_IN - */ -const setResponseContentLengthAttribute = (response, attributes) => { - const length = getContentLength(response.headers); - if (length === null) - return; - if ((0, exports.isCompressed)(response.headers)) { - attributes[semantic_conventions_1.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH] = length; - } - else { - attributes[semantic_conventions_1.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED] = length; - } -}; -exports.setResponseContentLengthAttribute = setResponseContentLengthAttribute; -function getContentLength(headers) { - const contentLengthHeader = headers['content-length']; - if (contentLengthHeader === undefined) - return null; - const contentLength = parseInt(contentLengthHeader, 10); - if (isNaN(contentLength)) - return null; - return contentLength; -} -const isCompressed = (headers) => { - const encoding = headers['content-encoding']; - return !!encoding && encoding !== 'identity'; -}; -exports.isCompressed = isCompressed; -/** - * Mimics Node.js conversion of URL strings to RequestOptions expected by - * `http.request` and `https.request` APIs. - * - * See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437 - * - * @param stringUrl - * @throws TypeError if the URL is not valid. - */ -function stringUrlToHttpOptions(stringUrl) { - // This is heavily inspired by Node.js handling of the same situation, trying - // to follow it as closely as possible while keeping in mind that we only - // deal with string URLs, not URL objects. - const { hostname, pathname, port, username, password, search, protocol, hash, href, origin, host, } = new URL(stringUrl); - const options = { - protocol: protocol, - hostname: hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname, - hash: hash, - search: search, - pathname: pathname, - path: `${pathname || ''}${search || ''}`, - href: href, - origin: origin, - host: host, - }; - if (port !== '') { - options.port = Number(port); - } - if (username || password) { - options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(password)}`; - } - return options; -} -/** - * Makes sure options is an url object - * return an object with default value and parsed options - * @param logger component logger - * @param options original options for the request - * @param [extraOptions] additional options for the request - */ -const getRequestInfo = (logger, options, extraOptions) => { - let pathname; - let origin; - let optionsParsed; - let invalidUrl = false; - if (typeof options === 'string') { - try { - const convertedOptions = stringUrlToHttpOptions(options); - optionsParsed = convertedOptions; - pathname = convertedOptions.pathname || '/'; - } - catch (e) { - invalidUrl = true; - logger.verbose('Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:', e); - // for backward compatibility with how url.parse() behaved. - optionsParsed = { - path: options, - }; - pathname = optionsParsed.path || '/'; - } - origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`; - if (extraOptions !== undefined) { - Object.assign(optionsParsed, extraOptions); - } - } - else if (options instanceof url.URL) { - optionsParsed = { - protocol: options.protocol, - hostname: typeof options.hostname === 'string' && options.hostname.startsWith('[') - ? options.hostname.slice(1, -1) - : options.hostname, - path: `${options.pathname || ''}${options.search || ''}`, - }; - if (options.port !== '') { - optionsParsed.port = Number(options.port); - } - if (options.username || options.password) { - optionsParsed.auth = `${options.username}:${options.password}`; - } - pathname = options.pathname; - origin = options.origin; - if (extraOptions !== undefined) { - Object.assign(optionsParsed, extraOptions); - } - } - else { - optionsParsed = Object.assign({ protocol: options.host ? 'http:' : undefined }, options); - const hostname = optionsParsed.host || - (optionsParsed.port != null - ? `${optionsParsed.hostname}${optionsParsed.port}` - : optionsParsed.hostname); - origin = `${optionsParsed.protocol || 'http:'}//${hostname}`; - pathname = options.pathname; - if (!pathname && optionsParsed.path) { - try { - const parsedUrl = new URL(optionsParsed.path, origin); - pathname = parsedUrl.pathname || '/'; - } - catch (e) { - pathname = '/'; - } - } - } - // some packages return method in lowercase.. - // ensure upperCase for consistency - const method = optionsParsed.method - ? optionsParsed.method.toUpperCase() - : 'GET'; - return { origin, pathname, method, optionsParsed, invalidUrl }; -}; -exports.getRequestInfo = getRequestInfo; -/** - * Makes sure options is of type string or object - * @param options for the request - */ -const isValidOptionsType = (options) => { - if (!options) { - return false; - } - const type = typeof options; - return type === 'string' || (type === 'object' && !Array.isArray(options)); -}; -exports.isValidOptionsType = isValidOptionsType; -const extractHostnameAndPort = (requestOptions) => { - var _a; - if (requestOptions.hostname && requestOptions.port) { - return { hostname: requestOptions.hostname, port: requestOptions.port }; - } - const matches = ((_a = requestOptions.host) === null || _a === void 0 ? void 0 : _a.match(/^([^:/ ]+)(:\d{1,5})?/)) || null; - const hostname = requestOptions.hostname || (matches === null ? 'localhost' : matches[1]); - let port = requestOptions.port; - if (!port) { - if (matches && matches[2]) { - // remove the leading ":". The extracted port would be something like ":8080" - port = matches[2].substring(1); - } - else { - port = requestOptions.protocol === 'https:' ? '443' : '80'; - } - } - return { hostname, port }; -}; -exports.extractHostnameAndPort = extractHostnameAndPort; -/** - * Returns outgoing request attributes scoped to the options passed to the request - * @param {ParsedRequestOptions} requestOptions the same options used to make the request - * @param {{ component: string, hostname: string, hookAttributes?: Attributes }} options used to pass data needed to create attributes - * @param {SemconvStability} semconvStability determines which semconv version to use - */ -const getOutgoingRequestAttributes = (requestOptions, options, semconvStability) => { - var _a, _b; - const hostname = options.hostname; - const port = options.port; - const method = (_a = requestOptions.method) !== null && _a !== void 0 ? _a : 'GET'; - const normalizedMethod = normalizeMethod(method); - const headers = requestOptions.headers || {}; - const userAgent = headers['user-agent']; - const urlFull = (0, exports.getAbsoluteUrl)(requestOptions, headers, `${options.component}:`); - const oldAttributes = { - [semantic_conventions_1.SEMATTRS_HTTP_URL]: urlFull, - [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: method, - [semantic_conventions_1.SEMATTRS_HTTP_TARGET]: requestOptions.path || '/', - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: hostname, - [semantic_conventions_1.SEMATTRS_HTTP_HOST]: (_b = headers.host) !== null && _b !== void 0 ? _b : `${hostname}:${port}`, - }; - const newAttributes = { - // Required attributes - [semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: normalizedMethod, - [semantic_conventions_1.ATTR_SERVER_ADDRESS]: hostname, - [semantic_conventions_1.ATTR_SERVER_PORT]: Number(port), - [semantic_conventions_1.ATTR_URL_FULL]: urlFull, - // leaving out protocol version, it is not yet negotiated - // leaving out protocol name, it is only required when protocol version is set - // retries and redirects not supported - // Opt-in attributes left off for now - }; - // conditionally required if request method required case normalization - if (method !== normalizedMethod) { - newAttributes[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD_ORIGINAL] = method; - } - if (userAgent !== undefined) { - oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_USER_AGENT] = userAgent; - } - switch (semconvStability) { - case 1 /* STABLE */: - return Object.assign(newAttributes, options.hookAttributes); - case 2 /* OLD */: - return Object.assign(oldAttributes, options.hookAttributes); - } - return Object.assign(oldAttributes, newAttributes, options.hookAttributes); -}; -exports.getOutgoingRequestAttributes = getOutgoingRequestAttributes; -/** - * Returns outgoing request Metric attributes scoped to the request data - * @param {Attributes} spanAttributes the span attributes - */ -const getOutgoingRequestMetricAttributes = (spanAttributes) => { - const metricAttributes = {}; - metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_METHOD] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_METHOD]; - metricAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_NAME] = - spanAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_NAME]; - //TODO: http.url attribute, it should substitute any parameters to avoid high cardinality. - return metricAttributes; -}; -exports.getOutgoingRequestMetricAttributes = getOutgoingRequestMetricAttributes; -/** - * Returns attributes related to the kind of HTTP protocol used - * @param {string} [kind] Kind of HTTP protocol used: "1.0", "1.1", "2", "SPDY" or "QUIC". - */ -const setAttributesFromHttpKind = (kind, attributes) => { - if (kind) { - attributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR] = kind; - if (kind.toUpperCase() !== 'QUIC') { - attributes[semantic_conventions_1.SEMATTRS_NET_TRANSPORT] = semantic_conventions_1.NETTRANSPORTVALUES_IP_TCP; - } - else { - attributes[semantic_conventions_1.SEMATTRS_NET_TRANSPORT] = semantic_conventions_1.NETTRANSPORTVALUES_IP_UDP; - } - } -}; -exports.setAttributesFromHttpKind = setAttributesFromHttpKind; -/** - * Returns outgoing request attributes scoped to the response data - * @param {IncomingMessage} response the response object - * @param {SemconvStability} semconvStability determines which semconv version to use - */ -const getOutgoingRequestAttributesOnResponse = (response, semconvStability) => { - const { statusCode, statusMessage, httpVersion, socket } = response; - const oldAttributes = {}; - const stableAttributes = {}; - if (statusCode != null) { - stableAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE] = statusCode; - } - if (socket) { - const { remoteAddress, remotePort } = socket; - oldAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_IP] = remoteAddress; - oldAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_PORT] = remotePort; - // Recommended - stableAttributes[semantic_conventions_1.ATTR_NETWORK_PEER_ADDRESS] = remoteAddress; - stableAttributes[semantic_conventions_1.ATTR_NETWORK_PEER_PORT] = remotePort; - stableAttributes[semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION] = response.httpVersion; - } - (0, exports.setResponseContentLengthAttribute)(response, oldAttributes); - if (statusCode) { - oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE] = statusCode; - oldAttributes[AttributeNames_1.AttributeNames.HTTP_STATUS_TEXT] = (statusMessage || '').toUpperCase(); - } - (0, exports.setAttributesFromHttpKind)(httpVersion, oldAttributes); - switch (semconvStability) { - case 1 /* STABLE */: - return stableAttributes; - case 2 /* OLD */: - return oldAttributes; - } - return Object.assign(oldAttributes, stableAttributes); -}; -exports.getOutgoingRequestAttributesOnResponse = getOutgoingRequestAttributesOnResponse; -/** - * Returns outgoing request Metric attributes scoped to the response data - * @param {Attributes} spanAttributes the span attributes - */ -const getOutgoingRequestMetricAttributesOnResponse = (spanAttributes) => { - const metricAttributes = {}; - metricAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_PORT] = - spanAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_PORT]; - metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE] = - spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE]; - metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR]; - return metricAttributes; -}; -exports.getOutgoingRequestMetricAttributesOnResponse = getOutgoingRequestMetricAttributesOnResponse; -function parseHostHeader(hostHeader, proto) { - const parts = hostHeader.split(':'); - // no semicolon implies ipv4 dotted syntax or host name without port - // x.x.x.x - // example.com - if (parts.length === 1) { - if (proto === 'http') { - return { host: parts[0], port: '80' }; - } - if (proto === 'https') { - return { host: parts[0], port: '443' }; - } - return { host: parts[0] }; - } - // single semicolon implies ipv4 dotted syntax or host name with port - // x.x.x.x:yyyy - // example.com:yyyy - if (parts.length === 2) { - return { - host: parts[0], - port: parts[1], - }; - } - // more than 2 parts implies ipv6 syntax with multiple colons - // [x:x:x:x:x:x:x:x] - // [x:x:x:x:x:x:x:x]:yyyy - if (parts[0].startsWith('[')) { - if (parts[parts.length - 1].endsWith(']')) { - if (proto === 'http') { - return { host: hostHeader, port: '80' }; - } - if (proto === 'https') { - return { host: hostHeader, port: '443' }; - } - } - else if (parts[parts.length - 2].endsWith(']')) { - return { - host: parts.slice(0, -1).join(':'), - port: parts[parts.length - 1], - }; - } - } - // if nothing above matches just return the host header - return { host: hostHeader }; -} -/** - * Get server.address and port according to http semconv 1.27 - * https://github.com/open-telemetry/semantic-conventions/blob/bf0a2c1134f206f034408b201dbec37960ed60ec/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes - */ -function getServerAddress(request, component) { - const forwardedHeader = request.headers['forwarded']; - if (forwardedHeader) { - for (const entry of parseForwardedHeader(forwardedHeader)) { - if (entry.host) { - return parseHostHeader(entry.host, entry.proto); - } - } - } - const xForwardedHost = request.headers['x-forwarded-host']; - if (typeof xForwardedHost === 'string') { - if (typeof request.headers['x-forwarded-proto'] === 'string') { - return parseHostHeader(xForwardedHost, request.headers['x-forwarded-proto']); - } - if (Array.isArray(request.headers['x-forwarded-proto'])) { - return parseHostHeader(xForwardedHost, request.headers['x-forwarded-proto'][0]); - } - return parseHostHeader(xForwardedHost); - } - else if (Array.isArray(xForwardedHost) && - typeof xForwardedHost[0] === 'string' && - xForwardedHost[0].length > 0) { - if (typeof request.headers['x-forwarded-proto'] === 'string') { - return parseHostHeader(xForwardedHost[0], request.headers['x-forwarded-proto']); - } - if (Array.isArray(request.headers['x-forwarded-proto'])) { - return parseHostHeader(xForwardedHost[0], request.headers['x-forwarded-proto'][0]); - } - return parseHostHeader(xForwardedHost[0]); - } - const host = request.headers['host']; - if (typeof host === 'string' && host.length > 0) { - return parseHostHeader(host, component); - } - return null; -} -/** - * Get server.address and port according to http semconv 1.27 - * https://github.com/open-telemetry/semantic-conventions/blob/bf0a2c1134f206f034408b201dbec37960ed60ec/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes - */ -function getRemoteClientAddress(request) { - const forwardedHeader = request.headers['forwarded']; - if (forwardedHeader) { - for (const entry of parseForwardedHeader(forwardedHeader)) { - if (entry.for) { - return entry.for; - } - } - } - const xForwardedFor = request.headers['x-forwarded-for']; - if (typeof xForwardedFor === 'string') { - return xForwardedFor; - } - else if (Array.isArray(xForwardedFor)) { - return xForwardedFor[0]; - } - const remote = request.socket.remoteAddress; - if (remote) { - return remote; - } - return null; -} -exports.getRemoteClientAddress = getRemoteClientAddress; -function getInfoFromIncomingMessage(component, request, logger) { - var _a, _b; - try { - if (request.headers.host) { - return new URL((_a = request.url) !== null && _a !== void 0 ? _a : '/', `${component}://${request.headers.host}`); - } - else { - const unsafeParsedUrl = new URL((_b = request.url) !== null && _b !== void 0 ? _b : '/', - // using localhost as a workaround to still use the URL constructor for parsing - `${component}://localhost`); - // since we use localhost as a workaround, ensure we hide the rest of the properties to avoid - // our workaround leaking though. - return { - pathname: unsafeParsedUrl.pathname, - search: unsafeParsedUrl.search, - toString: function () { - // we cannot use the result of unsafeParsedUrl.toString as it's potentially wrong. - return unsafeParsedUrl.pathname + unsafeParsedUrl.search; - }, - }; - } - } - catch (e) { - // something is wrong, use undefined - this *should* never happen, logging - // for troubleshooting in case it does happen. - logger.verbose('Unable to get URL from request', e); - return {}; - } -} -/** - * Returns incoming request attributes scoped to the request data - * @param {IncomingMessage} request the request object - * @param {{ component: string, serverName?: string, hookAttributes?: Attributes }} options used to pass data needed to create attributes - * @param {SemconvStability} semconvStability determines which semconv version to use - */ -const getIncomingRequestAttributes = (request, options, logger) => { - const headers = request.headers; - const userAgent = headers['user-agent']; - const ips = headers['x-forwarded-for']; - const httpVersion = request.httpVersion; - const host = headers.host; - const hostname = (host === null || host === void 0 ? void 0 : host.replace(/^(.*)(:[0-9]{1,5})/, '$1')) || 'localhost'; - const method = request.method; - const normalizedMethod = normalizeMethod(method); - const serverAddress = getServerAddress(request, options.component); - const serverName = options.serverName; - const remoteClientAddress = getRemoteClientAddress(request); - const newAttributes = { - [semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD]: normalizedMethod, - [semantic_conventions_1.ATTR_URL_SCHEME]: options.component, - [semantic_conventions_1.ATTR_SERVER_ADDRESS]: serverAddress === null || serverAddress === void 0 ? void 0 : serverAddress.host, - [semantic_conventions_1.ATTR_NETWORK_PEER_ADDRESS]: request.socket.remoteAddress, - [semantic_conventions_1.ATTR_NETWORK_PEER_PORT]: request.socket.remotePort, - [semantic_conventions_1.ATTR_NETWORK_PROTOCOL_VERSION]: request.httpVersion, - [semantic_conventions_1.ATTR_USER_AGENT_ORIGINAL]: userAgent, - }; - const parsedUrl = getInfoFromIncomingMessage(options.component, request, logger); - if ((parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.pathname) != null) { - newAttributes[semantic_conventions_1.ATTR_URL_PATH] = parsedUrl.pathname; - } - if (remoteClientAddress != null) { - newAttributes[semantic_conventions_1.ATTR_CLIENT_ADDRESS] = remoteClientAddress; - } - if ((serverAddress === null || serverAddress === void 0 ? void 0 : serverAddress.port) != null) { - newAttributes[semantic_conventions_1.ATTR_SERVER_PORT] = Number(serverAddress.port); - } - // conditionally required if request method required case normalization - if (method !== normalizedMethod) { - newAttributes[semantic_conventions_1.ATTR_HTTP_REQUEST_METHOD_ORIGINAL] = method; - } - const oldAttributes = { - [semantic_conventions_1.SEMATTRS_HTTP_URL]: parsedUrl.toString(), - [semantic_conventions_1.SEMATTRS_HTTP_HOST]: host, - [semantic_conventions_1.SEMATTRS_NET_HOST_NAME]: hostname, - [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: method, - [semantic_conventions_1.SEMATTRS_HTTP_SCHEME]: options.component, - }; - if (typeof ips === 'string') { - oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_CLIENT_IP] = ips.split(',')[0]; - } - if (typeof serverName === 'string') { - oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_SERVER_NAME] = serverName; - } - if (parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.pathname) { - oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_TARGET] = - (parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.pathname) + (parsedUrl === null || parsedUrl === void 0 ? void 0 : parsedUrl.search) || '/'; - } - if (userAgent !== undefined) { - oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_USER_AGENT] = userAgent; - } - (0, exports.setRequestContentLengthAttribute)(request, oldAttributes); - (0, exports.setAttributesFromHttpKind)(httpVersion, oldAttributes); - switch (options.semconvStability) { - case 1 /* STABLE */: - return Object.assign(newAttributes, options.hookAttributes); - case 2 /* OLD */: - return Object.assign(oldAttributes, options.hookAttributes); - } - return Object.assign(oldAttributes, newAttributes, options.hookAttributes); -}; -exports.getIncomingRequestAttributes = getIncomingRequestAttributes; -/** - * Returns incoming request Metric attributes scoped to the request data - * @param {Attributes} spanAttributes the span attributes - * @param {{ component: string }} options used to pass data needed to create attributes - */ -const getIncomingRequestMetricAttributes = (spanAttributes) => { - const metricAttributes = {}; - metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_SCHEME] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_SCHEME]; - metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_METHOD] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_METHOD]; - metricAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_NAME] = - spanAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_NAME]; - metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_FLAVOR]; - //TODO: http.target attribute, it should substitute any parameters to avoid high cardinality. - return metricAttributes; -}; -exports.getIncomingRequestMetricAttributes = getIncomingRequestMetricAttributes; -/** - * Returns incoming request attributes scoped to the response data - * @param {(ServerResponse & { socket: Socket; })} response the response object - */ -const getIncomingRequestAttributesOnResponse = (request, response, semconvStability) => { - // take socket from the request, - // since it may be detached from the response object in keep-alive mode - const { socket } = request; - const { statusCode, statusMessage } = response; - const newAttributes = { - [semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]: statusCode, - }; - const rpcMetadata = (0, core_1.getRPCMetadata)(api_1.context.active()); - const oldAttributes = {}; - if (socket) { - const { localAddress, localPort, remoteAddress, remotePort } = socket; - oldAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_IP] = localAddress; - oldAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_PORT] = localPort; - oldAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_IP] = remoteAddress; - oldAttributes[semantic_conventions_1.SEMATTRS_NET_PEER_PORT] = remotePort; - } - oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE] = statusCode; - oldAttributes[AttributeNames_1.AttributeNames.HTTP_STATUS_TEXT] = (statusMessage || '').toUpperCase(); - if ((rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP && rpcMetadata.route !== undefined) { - oldAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE] = rpcMetadata.route; - newAttributes[semantic_conventions_1.ATTR_HTTP_ROUTE] = rpcMetadata.route; - } - switch (semconvStability) { - case 1 /* STABLE */: - return newAttributes; - case 2 /* OLD */: - return oldAttributes; - } - return Object.assign(oldAttributes, newAttributes); -}; -exports.getIncomingRequestAttributesOnResponse = getIncomingRequestAttributesOnResponse; -/** - * Returns incoming request Metric attributes scoped to the request data - * @param {Attributes} spanAttributes the span attributes - */ -const getIncomingRequestMetricAttributesOnResponse = (spanAttributes) => { - const metricAttributes = {}; - metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE] = - spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_STATUS_CODE]; - metricAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_PORT] = - spanAttributes[semantic_conventions_1.SEMATTRS_NET_HOST_PORT]; - if (spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE] !== undefined) { - metricAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE]; - } - return metricAttributes; -}; -exports.getIncomingRequestMetricAttributesOnResponse = getIncomingRequestMetricAttributesOnResponse; -const getIncomingStableRequestMetricAttributesOnResponse = (spanAttributes) => { - const metricAttributes = {}; - if (spanAttributes[semantic_conventions_1.ATTR_HTTP_ROUTE] !== undefined) { - metricAttributes[semantic_conventions_1.ATTR_HTTP_ROUTE] = spanAttributes[semantic_conventions_1.SEMATTRS_HTTP_ROUTE]; - } - // required if and only if one was sent, same as span requirement - if (spanAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]) { - metricAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE] = - spanAttributes[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]; - } - return metricAttributes; -}; -exports.getIncomingStableRequestMetricAttributesOnResponse = getIncomingStableRequestMetricAttributesOnResponse; -function headerCapture(type, headers) { - const normalizedHeaders = new Map(); - for (let i = 0, len = headers.length; i < len; i++) { - const capturedHeader = headers[i].toLowerCase(); - normalizedHeaders.set(capturedHeader, capturedHeader.replace(/-/g, '_')); - } - return (span, getHeader) => { - for (const capturedHeader of normalizedHeaders.keys()) { - const value = getHeader(capturedHeader); - if (value === undefined) { - continue; - } - const normalizedHeader = normalizedHeaders.get(capturedHeader); - const key = `http.${type}.header.${normalizedHeader}`; - if (typeof value === 'string') { - span.setAttribute(key, [value]); - } - else if (Array.isArray(value)) { - span.setAttribute(key, value); - } - else { - span.setAttribute(key, [value]); - } - } - }; -} -exports.headerCapture = headerCapture; -const KNOWN_METHODS = new Set([ - // methods from https://www.rfc-editor.org/rfc/rfc9110.html#name-methods - 'GET', - 'HEAD', - 'POST', - 'PUT', - 'DELETE', - 'CONNECT', - 'OPTIONS', - 'TRACE', - // PATCH from https://www.rfc-editor.org/rfc/rfc5789.html - 'PATCH', -]); -function normalizeMethod(method) { - if (method == null) { - return 'GET'; - } - const upper = method.toUpperCase(); - if (KNOWN_METHODS.has(upper)) { - return upper; - } - return '_OTHER'; -} -function parseForwardedHeader(header) { - try { - return forwardedParse(header); - } - catch (_a) { - return []; - } -} -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 14963: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '0.57.1'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 77319: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExportResultCode = void 0; -var ExportResultCode; -(function (ExportResultCode) { - ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; -})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); -//# sourceMappingURL=ExportResult.js.map - -/***/ }), - -/***/ 63661: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = ','; -// Name of the http header used to propagate the baggage -exports.BAGGAGE_HEADER = 'baggage'; -// Maximum number of name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; -// Maximum number of bytes per a single name-value pair allowed by w3c spec -exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; -// Maximum total length of all name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; -//# sourceMappingURL=constants.js.map - -/***/ }), - -/***/ 74208: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CBaggagePropagator = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(94367); -const constants_1 = __nccwpck_require__(63661); -const utils_1 = __nccwpck_require__(407); -/** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ - */ -class W3CBaggagePropagator { - inject(context, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context); - if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) - return; - const keyPairs = (0, utils_1.getKeyPairs)(baggage) - .filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }) - .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); - if (headerValue.length > 0) { - setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - } - extract(context, 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; - const baggage = {}; - if (baggageString.length === 0) { - return context; - } - const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); - pairs.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; - } - return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; - } -} -exports.W3CBaggagePropagator = W3CBaggagePropagator; -//# sourceMappingURL=W3CBaggagePropagator.js.map - -/***/ }), - -/***/ 407: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const constants_1 = __nccwpck_require__(63661); -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)}`; - // include opaque metadata if provided - // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation - if (value.metadata !== undefined) { - 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) { - if (typeof value !== 'string' || value.length === 0) - return {}; - return value - .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) - .map(entry => { - return parsePairKeyValue(entry); - }) - .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) - .reduce((headers, keyPair) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - headers[keyPair.key] = keyPair.value; - return headers; - }, {}); -} -exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 83539: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 - */ -class AnchoredClock { - /** - * 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; -//# sourceMappingURL=anchored-clock.js.map - -/***/ }), - -/***/ 65038: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; -const api_1 = __nccwpck_require__(65163); -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) { - // null/undefined elements are allowed - if (element == null) - continue; - if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; - continue; - } - // encountered an invalid primitive - 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; -} -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 22961: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; -const logging_error_handler_1 = __nccwpck_require__(35014); -/** The global error handler delegate */ -let delegateHandler = (0, 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 (_a) { } // eslint-disable-line no-empty -} -exports.globalErrorHandler = globalErrorHandler; -//# sourceMappingURL=global-error-handler.js.map - -/***/ }), - -/***/ 2859: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBinary = void 0; -function intValue(charCode) { - // 0-9 - if (charCode >= 48 && charCode <= 57) { - return charCode - 48; - } - // a-f - if (charCode >= 97 && charCode <= 102) { - return charCode - 87; - } - // A-F - 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; -//# sourceMappingURL=hex-to-binary.js.map - -/***/ }), - -/***/ 35014: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loggingErrorHandler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * 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; -} -//# sourceMappingURL=logging-error-handler.js.map - -/***/ }), - -/***/ 56567: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = __nccwpck_require__(49955); -const NANOSECOND_DIGITS = 9; -const NANOSECOND_DIGITS_IN_MILLIS = 6; -const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); -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 / 1000; - // Decimals only. - const seconds = Math.trunc(epochSeconds); - // Round sub-nanosecond accuracy to nanosecond. - const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); - return [seconds, nanos]; -} -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) { - const timeOrigin = millisToHrTime(getTimeOrigin()); - const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); - return addHrTimes(timeOrigin, now); -} -exports.hrTime = hrTime; -/** - * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time - */ -function timeInputToHrTime(time) { - // process.hrtime - if (isTimeInputHrTime(time)) { - return time; - } - else if (typeof time === 'number') { - // Must be a performance.now() if it's smaller than process start time. - if (time < getTimeOrigin()) { - return hrTime(time); - } - else { - // epoch milliseconds or performance.timeOrigin - 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]; - // overflow - if (nanos < 0) { - seconds -= 1; - // negate - 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); - const date = new Date(time[0] * 1000).toISOString(); - return date.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]]; - // Nanoseconds - if (out[1] >= SECOND_TO_NANOSECONDS) { - out[1] -= SECOND_TO_NANOSECONDS; - out[0] += 1; - } - return out; -} -exports.addHrTimes = addHrTimes; -//# sourceMappingURL=time.js.map - -/***/ }), - -/***/ 37890: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = 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.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = 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.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; -exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; -var W3CBaggagePropagator_1 = __nccwpck_require__(74208); -Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); -var anchored_clock_1 = __nccwpck_require__(83539); -Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); -var attributes_1 = __nccwpck_require__(65038); -Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); -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 = __nccwpck_require__(22961); -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 = __nccwpck_require__(35014); -Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); -var time_1 = __nccwpck_require__(56567); -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 hex_to_binary_1 = __nccwpck_require__(2859); -Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); -var ExportResult_1 = __nccwpck_require__(77319); -Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); -const utils_1 = __nccwpck_require__(407); -exports.baggageUtils = { - getKeyPairs: utils_1.getKeyPairs, - serializeKeyPairs: utils_1.serializeKeyPairs, - parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, - parsePairKeyValue: utils_1.parsePairKeyValue, -}; -var platform_1 = __nccwpck_require__(49955); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); -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, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); -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 = __nccwpck_require__(25512); -Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); -var W3CTraceContextPropagator_1 = __nccwpck_require__(3449); -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 = __nccwpck_require__(79681); -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 AlwaysOffSampler_1 = __nccwpck_require__(49184); -Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); -var AlwaysOnSampler_1 = __nccwpck_require__(48801); -Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); -var ParentBasedSampler_1 = __nccwpck_require__(44874); -Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); -var TraceIdRatioBasedSampler_1 = __nccwpck_require__(76417); -Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); -var suppress_tracing_1 = __nccwpck_require__(94367); -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 = __nccwpck_require__(19666); -Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); -var environment_1 = __nccwpck_require__(40789); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); -Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); -var merge_1 = __nccwpck_require__(97258); -Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); -var sampling_1 = __nccwpck_require__(87472); -Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); -var timeout_1 = __nccwpck_require__(69537); -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 = __nccwpck_require__(35641); -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 wrap_1 = __nccwpck_require__(2246); -Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); -var callback_1 = __nccwpck_require__(17917); -Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); -var version_1 = __nccwpck_require__(167); -Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); -const exporter_1 = __nccwpck_require__(80850); -exports.internal = { - _export: exporter_1._export, -}; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 80850: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._export = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(94367); -/** - * @internal - * Shared functionality used by Exporters while exporting data, including suppression of Traces. - */ -function _export(exporter, arg) { - return new Promise(resolve => { - // prevent downstream exporter calls from generating spans - api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { - exporter.export(arg, (result) => { - resolve(result); - }); - }); - }); -} -exports._export = _export; -//# sourceMappingURL=exporter.js.map - -/***/ }), - -/***/ 61370: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = 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; -//# sourceMappingURL=validators.js.map - -/***/ }), - -/***/ 49955: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var node_1 = __nccwpck_require__(61189); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); -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, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 9845: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = void 0; -const SPAN_ID_BYTES = 8; -const TRACE_ID_BYTES = 16; -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - */ -class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.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++) { - // unsigned right shift drops decimal part of the number - // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE - SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); - } - // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated - 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); - }; -} -//# sourceMappingURL=RandomIdGenerator.js.map - -/***/ }), - -/***/ 28246: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEnvWithoutDefaults = exports.getEnv = void 0; -const environment_1 = __nccwpck_require__(40789); -/** - * Gets the environment variables - */ -function getEnv() { - const processEnv = (0, environment_1.parseEnvironment)(process.env); - return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); -} -exports.getEnv = getEnv; -function getEnvWithoutDefaults() { - return (0, environment_1.parseEnvironment)(process.env); -} -exports.getEnvWithoutDefaults = getEnvWithoutDefaults; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 13829: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 77507: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBase64 = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const hex_to_binary_1 = __nccwpck_require__(2859); -function hexToBase64(hexStr) { - return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); -} -exports.hexToBase64 = hexToBase64; -//# sourceMappingURL=hex-to-base64.js.map - -/***/ }), - -/***/ 61189: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; -var environment_1 = __nccwpck_require__(28246); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); -var globalThis_1 = __nccwpck_require__(13829); -Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); -var hex_to_base64_1 = __nccwpck_require__(77507); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); -var RandomIdGenerator_1 = __nccwpck_require__(9845); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); -var performance_1 = __nccwpck_require__(65065); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); -var sdk_info_1 = __nccwpck_require__(21740); -Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); -var timer_util_1 = __nccwpck_require__(2689); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 65065: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.otperformance = void 0; -const perf_hooks_1 = __nccwpck_require__(4074); -exports.otperformance = perf_hooks_1.performance; -//# sourceMappingURL=performance.js.map - -/***/ }), - -/***/ 21740: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SDK_INFO = void 0; -const version_1 = __nccwpck_require__(167); -const semantic_conventions_1 = __nccwpck_require__(67275); -/** Constants describing the SDK in use */ -exports.SDK_INFO = { - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, -}; -//# sourceMappingURL=sdk-info.js.map - -/***/ }), - -/***/ 2689: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -function unrefTimer(timer) { - timer.unref(); -} -exports.unrefTimer = unrefTimer; -//# sourceMappingURL=timer-util.js.map - -/***/ }), - -/***/ 25512: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompositePropagator = void 0; -const api_1 = __nccwpck_require__(65163); -/** Combines multiple propagators into a single propagator. */ -class CompositePropagator { - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ - constructor(config = {}) { - var _a; - this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; - this._fields = Array.from(new Set(this._propagators - // older propagators may not have fields function, null check to be sure - .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, carrier, setter) { - for (const propagator of this._propagators) { - try { - propagator.inject(context, 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, 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); - } - fields() { - // return a new array so our fields cannot be modified - return this._fields.slice(); - } -} -exports.CompositePropagator = CompositePropagator; -//# sourceMappingURL=composite.js.map - -/***/ }), - -/***/ 19666: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceState = void 0; -const validators_1 = __nccwpck_require__(61370); -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. - */ -class TraceState { - constructor(rawTraceState) { - this._internalState = new Map(); - if (rawTraceState) - this._parse(rawTraceState); - } - set(key, value) { - // TODO: Benchmark the different approaches(map vs list) and - // use the faster one. - 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() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { - const listMember = part.trim(); // Optional Whitespace (OWS) handling - 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); - } - else { - // TODO: Consider to add warning log - } - } - return agg; - }, new Map()); - // Because of the reverse() requirement, trunc must be done after map is created - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { - this._internalState = new Map(Array.from(this._internalState.entries()) - .reverse() // Use reverse same as original tracestate parse chain - .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; -//# sourceMappingURL=TraceState.js.map - -/***/ }), - -/***/ 3449: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(94367); -const TraceState_1 = __nccwpck_require__(19666); -exports.TRACE_PARENT_HEADER = 'traceparent'; -exports.TRACE_STATE_HEADER = 'tracestate'; -const VERSION = '00'; -const VERSION_PART = '(?!ff)[\\da-f]{2}'; -const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; -const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; -const FLAGS_PART = '[\\da-f]{2}'; -const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\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; - // According to the specification the implementation should be compatible - // with future versions. If there are more parts, we only reject it if it's using version 00 - // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent - 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/ - */ -class W3CTraceContextPropagator { - inject(context, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context); - if (!spanContext || - (0, suppress_tracing_1.isTracingSuppressed)(context) || - !(0, api_1.isSpanContextValid)(spanContext)) - return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) { - setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } - } - extract(context, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) - return context; - const traceParent = Array.isArray(traceParentHeader) - ? traceParentHeader[0] - : traceParentHeader; - if (typeof traceParent !== 'string') - return context; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) - return context; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - // If more than one `tracestate` header is found, we merge them into a - // single header. - const state = Array.isArray(traceStateHeader) - ? traceStateHeader.join(',') - : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); - } - return api_1.trace.setSpanContext(context, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; - } -} -exports.W3CTraceContextPropagator = W3CTraceContextPropagator; -//# sourceMappingURL=W3CTraceContextPropagator.js.map - -/***/ }), - -/***/ 79681: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; -const api_1 = __nccwpck_require__(65163); -const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); -var RPCType; -(function (RPCType) { - RPCType["HTTP"] = "http"; -})(RPCType = exports.RPCType || (exports.RPCType = {})); -function setRPCMetadata(context, meta) { - return context.setValue(RPC_METADATA_KEY, meta); -} -exports.setRPCMetadata = setRPCMetadata; -function deleteRPCMetadata(context) { - return context.deleteValue(RPC_METADATA_KEY); -} -exports.deleteRPCMetadata = deleteRPCMetadata; -function getRPCMetadata(context) { - return context.getValue(RPC_METADATA_KEY); -} -exports.getRPCMetadata = getRPCMetadata; -//# sourceMappingURL=rpc-metadata.js.map - -/***/ }), - -/***/ 49184: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOffSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples no traces. - */ -class AlwaysOffSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return 'AlwaysOffSampler'; - } -} -exports.AlwaysOffSampler = AlwaysOffSampler; -//# sourceMappingURL=AlwaysOffSampler.js.map - -/***/ }), - -/***/ 48801: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOnSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples all traces. - */ -class AlwaysOnSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, - }; - } - toString() { - return 'AlwaysOnSampler'; - } -} -exports.AlwaysOnSampler = AlwaysOnSampler; -//# sourceMappingURL=AlwaysOnSampler.js.map - -/***/ }), - -/***/ 44874: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ParentBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -const global_error_handler_1 = __nccwpck_require__(22961); -const AlwaysOffSampler_1 = __nccwpck_require__(49184); -const AlwaysOnSampler_1 = __nccwpck_require__(48801); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ -class ParentBasedSampler { - constructor(config) { - var _a, _b, _c, _d; - this._root = config.root; - if (!this._root) { - (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context); - if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { - return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } -} -exports.ParentBasedSampler = ParentBasedSampler; -//# sourceMappingURL=ParentBasedSampler.js.map - -/***/ }), - -/***/ 76417: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceIdRatioBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples a given fraction of traces based of trace id deterministically. - */ -class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); - } - shouldSample(context, traceId) { - return { - decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound - ? api_1.SamplingDecision.RECORD_AND_SAMPLED - : api_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 < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } -} -exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -//# sourceMappingURL=TraceIdRatioBasedSampler.js.map - -/***/ }), - -/***/ 94367: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; -const api_1 = __nccwpck_require__(65163); -const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); -function suppressTracing(context) { - return context.setValue(SUPPRESS_TRACING_KEY, true); -} -exports.suppressTracing = suppressTracing; -function unsuppressTracing(context) { - return context.deleteValue(SUPPRESS_TRACING_KEY); -} -exports.unsuppressTracing = unsuppressTracing; -function isTracingSuppressed(context) { - return context.getValue(SUPPRESS_TRACING_KEY) === true; -} -exports.isTracingSuppressed = isTracingSuppressed; -//# sourceMappingURL=suppress-tracing.js.map - -/***/ }), - -/***/ 17917: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BindOnceFuture = void 0; -const promise_1 = __nccwpck_require__(32139); -/** - * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. - */ -class BindOnceFuture { - constructor(_callback, _that) { - this._callback = _callback; - this._that = _that; - this._isCalled = false; - this._deferred = new promise_1.Deferred(); - } - 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; -//# sourceMappingURL=callback.js.map - -/***/ }), - -/***/ 40789: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; -const api_1 = __nccwpck_require__(65163); -const sampling_1 = __nccwpck_require__(87472); -const DEFAULT_LIST_SEPARATOR = ','; -/** - * Environment interface to define all names - */ -const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; -function isEnvVarABoolean(key) { - return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_NUMBERS_KEYS = [ - 'OTEL_BSP_EXPORT_TIMEOUT', - 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BSP_MAX_QUEUE_SIZE', - 'OTEL_BSP_SCHEDULE_DELAY', - 'OTEL_BLRP_EXPORT_TIMEOUT', - 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BLRP_MAX_QUEUE_SIZE', - 'OTEL_BLRP_SCHEDULE_DELAY', - 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_LINK_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', - 'OTEL_EXPORTER_OTLP_TIMEOUT', - 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', - 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', - 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', - 'OTEL_EXPORTER_JAEGER_AGENT_PORT', -]; -function isEnvVarANumber(key) { - return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_LISTS_KEYS = [ - 'OTEL_NO_PATCH_MODULES', - 'OTEL_PROPAGATORS', - 'OTEL_SEMCONV_STABILITY_OPT_IN', -]; -function isEnvVarAList(key) { - return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; -} -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; -exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; -/** - * Default environment variables - */ -exports.DEFAULT_ENVIRONMENT = { - OTEL_SDK_DISABLED: false, - CONTAINER_NAME: '', - ECS_CONTAINER_METADATA_URI_V4: '', - ECS_CONTAINER_METADATA_URI: '', - HOSTNAME: '', - KUBERNETES_SERVICE_HOST: '', - NAMESPACE: '', - OTEL_BSP_EXPORT_TIMEOUT: 30000, - OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BSP_MAX_QUEUE_SIZE: 2048, - OTEL_BSP_SCHEDULE_DELAY: 5000, - OTEL_BLRP_EXPORT_TIMEOUT: 30000, - OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BLRP_MAX_QUEUE_SIZE: 2048, - OTEL_BLRP_SCHEDULE_DELAY: 5000, - OTEL_EXPORTER_JAEGER_AGENT_HOST: '', - OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, - OTEL_EXPORTER_JAEGER_ENDPOINT: '', - OTEL_EXPORTER_JAEGER_PASSWORD: '', - OTEL_EXPORTER_JAEGER_USER: '', - OTEL_EXPORTER_OTLP_ENDPOINT: '', - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_HEADERS: '', - OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', - OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', - OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', - OTEL_EXPORTER_OTLP_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, - OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', - OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, - OTEL_NO_PATCH_MODULES: [], - OTEL_PROPAGATORS: ['tracecontext', 'baggage'], - OTEL_RESOURCE_ATTRIBUTES: '', - OTEL_SERVICE_NAME: '', - OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_EVENT_COUNT_LIMIT: 128, - OTEL_SPAN_LINK_COUNT_LIMIT: 128, - OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, - OTEL_TRACES_EXPORTER: '', - OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, - OTEL_TRACES_SAMPLER_ARG: '', - OTEL_LOGS_EXPORTER: '', - OTEL_EXPORTER_OTLP_INSECURE: '', - OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', - OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', - OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', - OTEL_EXPORTER_OTLP_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_COMPRESSION: '', - OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', - OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', - OTEL_SEMCONV_STABILITY_OPT_IN: [], -}; -/** - * @param key - * @param environment - * @param values - */ -function parseBoolean(key, environment, values) { - if (typeof values[key] === 'undefined') { - return; - } - const value = String(values[key]); - // support case-insensitive "true" - environment[key] = value.toLowerCase() === 'true'; -} -/** - * Parses a variable as number with number validation - * @param name - * @param environment - * @param values - * @param min - * @param max - */ -function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { - if (typeof values[name] !== 'undefined') { - const value = Number(values[name]); - if (!isNaN(value)) { - if (value < min) { - environment[name] = min; - } - else if (value > max) { - environment[name] = max; - } - else { - environment[name] = value; - } - } - } -} -/** - * Parses list-like strings from input into output. - * @param name - * @param environment - * @param values - * @param separator - */ -function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { - const givenValue = input[name]; - if (typeof givenValue === 'string') { - output[name] = givenValue.split(separator).map(v => v.trim()); - } -} -// The support string -> DiagLogLevel mappings -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, -}; -/** - * Environmentally sets log level if valid log level string is provided - * @param key - * @param environment - * @param values - */ -function setLogLevelFromEnv(key, environment, values) { - const value = values[key]; - if (typeof value === 'string') { - const theLevel = logLevelMap[value.toUpperCase()]; - if (theLevel != null) { - environment[key] = theLevel; - } - } -} -/** - * Parses environment values - * @param values - */ -function parseEnvironment(values) { - const environment = {}; - for (const env in exports.DEFAULT_ENVIRONMENT) { - const key = env; - switch (key) { - case 'OTEL_LOG_LEVEL': - setLogLevelFromEnv(key, environment, values); - break; - default: - if (isEnvVarABoolean(key)) { - parseBoolean(key, environment, values); - } - else if (isEnvVarANumber(key)) { - parseNumber(key, environment, values); - } - else if (isEnvVarAList(key)) { - parseStringList(key, environment, values); - } - else { - const value = values[key]; - if (typeof value !== 'undefined' && value !== null) { - environment[key] = String(value); - } - } - } - } - return environment; -} -exports.parseEnvironment = parseEnvironment; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 86886: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPlainObject = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/** - * 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 funcProto = Function.prototype; -const funcToString = funcProto.toString; -const objectCtorString = funcToString.call(Object); -const getPrototype = overArg(Object.getPrototypeOf, Object); -const objectProto = Object.prototype; -const hasOwnProperty = objectProto.hasOwnProperty; -const symToStringTag = Symbol ? Symbol.toStringTag : undefined; -const nativeObjectToString = objectProto.toString; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function (arg) { - return func(transform(arg)); - }; -} -/** - * 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 = getPrototype(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 === undefined ? 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] = undefined; - unmasked = true; - } - catch (e) { - // silence - } - 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); -} -//# sourceMappingURL=lodash.merge.js.map - -/***/ }), - -/***/ 97258: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.merge = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -const lodash_merge_1 = __nccwpck_require__(86886); -const MAX_LEVEL = 20; -/** - * Merges objects together - * @param args - objects / values to be merged - */ -function merge(...args) { - let result = args.shift(); - const objects = 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 undefined; - } - 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] = takeValue(twoValue); - 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; -} -//# sourceMappingURL=merge.js.map - -/***/ }), - -/***/ 32139: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Deferred = void 0; -class Deferred { - 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; -//# sourceMappingURL=promise.js.map - -/***/ }), - -/***/ 87472: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TracesSamplerValues = void 0; -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 = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); -//# sourceMappingURL=sampling.js.map - -/***/ }), - -/***/ 69537: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.callWithTimeout = exports.TimeoutError = void 0; -/** - * Error that is thrown on timeouts. - */ -class TimeoutError extends Error { - constructor(message) { - super(message); - // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: - // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - 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; -//# sourceMappingURL=timeout.js.map - -/***/ }), - -/***/ 35641: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isUrlIgnored = exports.urlMatches = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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; -//# sourceMappingURL=url.js.map - -/***/ }), - -/***/ 2246: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWrapped = void 0; -/** - * Checks if certain function has been already wrapped - * @param func - */ -function isWrapped(func) { - return (typeof func === 'function' && - typeof func.__original === 'function' && - typeof func.__unwrap === 'function' && - func.__wrapped === true); -} -exports.isWrapped = isWrapped; -//# sourceMappingURL=wrap.js.map - -/***/ }), - -/***/ 167: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.30.1'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 12445: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const ANY = Symbol('SemVer ANY') -// hoisted class for cyclic dependency -class Comparator { - static get ANY () { - return ANY - } - - constructor (comp, options) { - options = parseOptions(options) - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - comp = comp.trim().split(/\s+/).join(' ') - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) - } - - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) - - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } - } - - toString () { - return this.value - } - - test (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY || version === ANY) { - return true - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - return cmp(version, this.operator, this.semver, this.options) - } - - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } - - options = parseOptions(options) - - // Special cases where nothing can possibly be lower - if (options.includePrerelease && - (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { - return false - } - if (!options.includePrerelease && - (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { - return false - } - - // Same direction increasing (> or >=) - if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { - return true - } - // Same direction decreasing (< or <=) - if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { - return true - } - // same SemVer and both sides are inclusive (<= or >=) - if ( - (this.semver.version === comp.semver.version) && - this.operator.includes('=') && comp.operator.includes('=')) { - return true - } - // opposite directions less than - if (cmp(this.semver, '<', comp.semver, options) && - this.operator.startsWith('>') && comp.operator.startsWith('<')) { - return true - } - // opposite directions greater than - if (cmp(this.semver, '>', comp.semver, options) && - this.operator.startsWith('<') && comp.operator.startsWith('>')) { - return true - } - return false - } -} - -module.exports = Comparator - -const parseOptions = __nccwpck_require__(81667) -const { safeRe: re, t } = __nccwpck_require__(99011) -const cmp = __nccwpck_require__(81949) -const debug = __nccwpck_require__(11897) -const SemVer = __nccwpck_require__(84367) -const Range = __nccwpck_require__(51563) - - -/***/ }), - -/***/ 51563: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SPACE_CHARACTERS = /\s+/g - -// hoisted class for cyclic dependency -class Range { - constructor (range, options) { - options = parseOptions(options) - - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value - this.set = [[range]] - this.formatted = undefined - return this - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First reduce all whitespace as much as possible so we do not have to rely - // on potentially slow regexes like \s*. This is then stored and used for - // future error messages as well. - this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') - - // First, split on || - this.set = this.raw - .split('||') - // map the range to a 2d array of comparators - .map(r => this.parseRange(r.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) - - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`) - } - - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0] - this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) { - this.set = [first] - } else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c] - break - } - } - } - } - - this.formatted = undefined - } - - get range () { - if (this.formatted === undefined) { - this.formatted = '' - for (let i = 0; i < this.set.length; i++) { - if (i > 0) { - this.formatted += '||' - } - const comps = this.set[i] - for (let k = 0; k < comps.length; k++) { - if (k > 0) { - this.formatted += ' ' - } - this.formatted += comps[k].toString().trim() - } - } - } - return this.formatted - } - - format () { - return this.range - } - - toString () { - return this.range - } - - parseRange (range) { - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = - (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | - (this.options.loose && FLAG_LOOSE) - const memoKey = memoOpts + ':' + range - const cached = cache.get(memoKey) - if (cached) { - return cached - } - - const loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - debug('tilde trim', range) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - debug('caret trim', range) - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - let rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - - if (loose) { - // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter(comp => { - debug('loose invalid filter', comp, this.options) - return !!comp.match(re[t.COMPARATORLOOSE]) - }) - } - debug('range list', rangeList) - - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const rangeMap = new Map() - const comparators = rangeList.map(comp => new Comparator(comp, this.options)) - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp] - } - rangeMap.set(comp.value, comp) - } - if (rangeMap.size > 1 && rangeMap.has('')) { - rangeMap.delete('') - } - - const result = [...rangeMap.values()] - cache.set(memoKey, result) - return result - } - - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } - - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false - } -} - -module.exports = Range - -const LRU = __nccwpck_require__(82933) -const cache = new LRU() - -const parseOptions = __nccwpck_require__(81667) -const Comparator = __nccwpck_require__(12445) -const debug = __nccwpck_require__(11897) -const SemVer = __nccwpck_require__(84367) -const { - safeRe: re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace, -} = __nccwpck_require__(99011) -const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(34468) - -const isNullSet = c => c.value === '<0.0.0-0' -const isAny = c => c.value === '' - -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() - - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) - - testComparator = remainingComparators.pop() - } - - return result -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -// ~0.0.1 --> >=0.0.1 <0.1.0-0 -const replaceTildes = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceTilde(c, options)) - .join(' ') -} - -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -// ^0.0.1 --> >=0.0.1 <0.0.2-0 -// ^0.1.0 --> >=0.1.0 <0.2.0-0 -const replaceCarets = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceCaret(c, options)) - .join(' ') -} - -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } - - debug('caret return', ret) - return ret - }) -} - -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp - .split(/\s+/) - .map((c) => replaceXRange(c, options)) - .join(' ') -} - -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - if (gtlt === '<') { - pr = '-0' - } - - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp - .trim() - .replace(re[t.STAR], '') -} - -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp - .trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -// TODO build? -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr) => { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? '-0' : ''}` - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` - } else if (fpr) { - from = `>=${from}` - } else { - from = `>=${from}${incPr ? '-0' : ''}` - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0` - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0` - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}` - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0` - } else { - to = `<=${to}` - } - - return `${from} ${to}`.trim() -} - -const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === Comparator.ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} - - -/***/ }), - -/***/ 84367: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const debug = __nccwpck_require__(11897) -const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(34468) -const { safeRe: re, t } = __nccwpck_require__(99011) - -const parseOptions = __nccwpck_require__(81667) -const { compareIdentifiers } = __nccwpck_require__(70974) -class SemVer { - constructor (version, options) { - options = parseOptions(options) - - if (version instanceof SemVer) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease - - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() - } - - format () { - this.version = `${this.major}.${this.minor}.${this.patch}` - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}` - } - return this.version - } - - toString () { - return this.version - } - - compare (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer(other, this.options) - } - - if (other.version === this.version) { - return 0 - } - - return this.compareMain(other) || this.comparePre(other) - } - - compareMain (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) - } - - comparePre (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - let i = 0 - do { - const a = this.prerelease[i] - const b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - compareBuild (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - let i = 0 - do { - const a = this.build[i] - const b = other.build[i] - debug('build compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier, identifierBase) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier, identifierBase) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier, identifierBase) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier, identifierBase) - this.inc('pre', identifier, identifierBase) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier, identifierBase) - } - this.inc('pre', identifier, identifierBase) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': { - const base = Number(identifierBase) ? 1 : 0 - - if (!identifier && identifierBase === false) { - throw new Error('invalid increment argument: identifier is empty') - } - - if (this.prerelease.length === 0) { - this.prerelease = [base] - } else { - let i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - if (identifier === this.prerelease.join('.') && identifierBase === false) { - throw new Error('invalid increment argument: identifier already exists') - } - this.prerelease.push(base) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - let prerelease = [identifier, base] - if (identifierBase === false) { - prerelease = [identifier] - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease - } - } else { - this.prerelease = prerelease - } - } - break - } - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.raw = this.format() - if (this.build.length) { - this.raw += `+${this.build.join('.')}` - } - return this - } -} - -module.exports = SemVer - - -/***/ }), - -/***/ 51829: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(28985) -const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -module.exports = clean - - -/***/ }), - -/***/ 81949: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const eq = __nccwpck_require__(34164) -const neq = __nccwpck_require__(4394) -const gt = __nccwpck_require__(69819) -const gte = __nccwpck_require__(38583) -const lt = __nccwpck_require__(69329) -const lte = __nccwpck_require__(46141) - -const cmp = (a, op, b, loose) => { - switch (op) { - case '===': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a === b - - case '!==': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError(`Invalid operator: ${op}`) - } -} -module.exports = cmp - - -/***/ }), - -/***/ 26321: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const parse = __nccwpck_require__(28985) -const { safeRe: re, t } = __nccwpck_require__(99011) - -const coerce = (version, options) => { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - options = options || {} - - let match = null - if (!options.rtl) { - match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] - let next - while ((next = coerceRtlRegex.exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - coerceRtlRegex.lastIndex = -1 - } - - if (match === null) { - return null - } - - const major = match[2] - const minor = match[3] || '0' - const patch = match[4] || '0' - const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' - const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' - - return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) -} -module.exports = coerce - - -/***/ }), - -/***/ 12205: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose) - const versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} -module.exports = compareBuild - - -/***/ }), - -/***/ 81597: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(46982) -const compareLoose = (a, b) => compare(a, b, true) -module.exports = compareLoose - - -/***/ }), - -/***/ 46982: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)) - -module.exports = compare - - -/***/ }), - -/***/ 6514: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(28985) - -const diff = (version1, version2) => { - const v1 = parse(version1, null, true) - const v2 = parse(version2, null, true) - const comparison = v1.compare(v2) - - if (comparison === 0) { - return null - } - - const v1Higher = comparison > 0 - const highVersion = v1Higher ? v1 : v2 - const lowVersion = v1Higher ? v2 : v1 - const highHasPre = !!highVersion.prerelease.length - const lowHasPre = !!lowVersion.prerelease.length - - if (lowHasPre && !highHasPre) { - // Going from prerelease -> no prerelease requires some special casing - - // If the low version has only a major, then it will always be a major - // Some examples: - // 1.0.0-1 -> 1.0.0 - // 1.0.0-1 -> 1.1.1 - // 1.0.0-1 -> 2.0.0 - if (!lowVersion.patch && !lowVersion.minor) { - return 'major' - } - - // Otherwise it can be determined by checking the high version - - if (highVersion.patch) { - // anything higher than a patch bump would result in the wrong version - return 'patch' - } - - if (highVersion.minor) { - // anything higher than a minor bump would result in the wrong version - return 'minor' - } - - // bumping major/minor/patch all have same result - return 'major' - } - - // add the `pre` prefix if we are going to a prerelease version - const prefix = highHasPre ? 'pre' : '' - - if (v1.major !== v2.major) { - return prefix + 'major' - } - - if (v1.minor !== v2.minor) { - return prefix + 'minor' - } - - if (v1.patch !== v2.patch) { - return prefix + 'patch' - } - - // high and low are preleases - return 'prerelease' -} - -module.exports = diff - - -/***/ }), - -/***/ 34164: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(46982) -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq - - -/***/ }), - -/***/ 69819: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(46982) -const gt = (a, b, loose) => compare(a, b, loose) > 0 -module.exports = gt - - -/***/ }), - -/***/ 38583: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(46982) -const gte = (a, b, loose) => compare(a, b, loose) >= 0 -module.exports = gte - - -/***/ }), - -/***/ 5310: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) - -const inc = (version, release, options, identifier, identifierBase) => { - if (typeof (options) === 'string') { - identifierBase = identifier - identifier = options - options = undefined - } - - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier, identifierBase).version - } catch (er) { - return null - } -} -module.exports = inc - - -/***/ }), - -/***/ 69329: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(46982) -const lt = (a, b, loose) => compare(a, b, loose) < 0 -module.exports = lt - - -/***/ }), - -/***/ 46141: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(46982) -const lte = (a, b, loose) => compare(a, b, loose) <= 0 -module.exports = lte - - -/***/ }), - -/***/ 58615: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const major = (a, loose) => new SemVer(a, loose).major -module.exports = major - - -/***/ }), - -/***/ 10034: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor - - -/***/ }), - -/***/ 4394: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(46982) -const neq = (a, b, loose) => compare(a, b, loose) !== 0 -module.exports = neq - - -/***/ }), - -/***/ 28985: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const parse = (version, options, throwErrors = false) => { - if (version instanceof SemVer) { - return version - } - try { - return new SemVer(version, options) - } catch (er) { - if (!throwErrors) { - return null - } - throw er - } -} - -module.exports = parse - - -/***/ }), - -/***/ 69881: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch - - -/***/ }), - -/***/ 69091: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(28985) -const prerelease = (version, options) => { - const parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -module.exports = prerelease - - -/***/ }), - -/***/ 44954: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(46982) -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare - - -/***/ }), - -/***/ 85917: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compareBuild = __nccwpck_require__(12205) -const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) -module.exports = rsort - - -/***/ }), - -/***/ 31014: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(51563) -const satisfies = (version, range, options) => { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} -module.exports = satisfies - - -/***/ }), - -/***/ 36737: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compareBuild = __nccwpck_require__(12205) -const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) -module.exports = sort - - -/***/ }), - -/***/ 58879: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(28985) -const valid = (version, options) => { - const v = parse(version, options) - return v ? v.version : null -} -module.exports = valid - - -/***/ }), - -/***/ 50326: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// just pre-load all the stuff that index.js lazily exports -const internalRe = __nccwpck_require__(99011) -const constants = __nccwpck_require__(34468) -const SemVer = __nccwpck_require__(84367) -const identifiers = __nccwpck_require__(70974) -const parse = __nccwpck_require__(28985) -const valid = __nccwpck_require__(58879) -const clean = __nccwpck_require__(51829) -const inc = __nccwpck_require__(5310) -const diff = __nccwpck_require__(6514) -const major = __nccwpck_require__(58615) -const minor = __nccwpck_require__(10034) -const patch = __nccwpck_require__(69881) -const prerelease = __nccwpck_require__(69091) -const compare = __nccwpck_require__(46982) -const rcompare = __nccwpck_require__(44954) -const compareLoose = __nccwpck_require__(81597) -const compareBuild = __nccwpck_require__(12205) -const sort = __nccwpck_require__(36737) -const rsort = __nccwpck_require__(85917) -const gt = __nccwpck_require__(69819) -const lt = __nccwpck_require__(69329) -const eq = __nccwpck_require__(34164) -const neq = __nccwpck_require__(4394) -const gte = __nccwpck_require__(38583) -const lte = __nccwpck_require__(46141) -const cmp = __nccwpck_require__(81949) -const coerce = __nccwpck_require__(26321) -const Comparator = __nccwpck_require__(12445) -const Range = __nccwpck_require__(51563) -const satisfies = __nccwpck_require__(31014) -const toComparators = __nccwpck_require__(75257) -const maxSatisfying = __nccwpck_require__(70647) -const minSatisfying = __nccwpck_require__(87404) -const minVersion = __nccwpck_require__(12336) -const validRange = __nccwpck_require__(13657) -const outside = __nccwpck_require__(67573) -const gtr = __nccwpck_require__(78962) -const ltr = __nccwpck_require__(60088) -const intersects = __nccwpck_require__(35690) -const simplifyRange = __nccwpck_require__(22321) -const subset = __nccwpck_require__(36464) -module.exports = { - parse, - valid, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers, -} - - -/***/ }), - -/***/ 34468: -/***/ ((module) => { - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0' - -const MAX_LENGTH = 256 -const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16 - -// Max safe length for a build identifier. The max length minus 6 characters for -// the shortest version with a build 0.0.0+BUILD. -const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 - -const RELEASE_TYPES = [ - 'major', - 'premajor', - 'minor', - 'preminor', - 'patch', - 'prepatch', - 'prerelease', -] - -module.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 0b001, - FLAG_LOOSE: 0b010, -} - - -/***/ }), - -/***/ 11897: -/***/ ((module) => { - -const debug = ( - typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) -) ? (...args) => console.error('SEMVER', ...args) - : () => {} - -module.exports = debug - - -/***/ }), - -/***/ 70974: -/***/ ((module) => { - -const numeric = /^[0-9]+$/ -const compareIdentifiers = (a, b) => { - const anum = numeric.test(a) - const bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) - -module.exports = { - compareIdentifiers, - rcompareIdentifiers, -} - - -/***/ }), - -/***/ 82933: -/***/ ((module) => { - -class LRUCache { - constructor () { - this.max = 1000 - this.map = new Map() - } - - get (key) { - const value = this.map.get(key) - if (value === undefined) { - return undefined - } else { - // Remove the key from the map and add it to the end - this.map.delete(key) - this.map.set(key, value) - return value - } - } - - delete (key) { - return this.map.delete(key) - } - - set (key, value) { - const deleted = this.delete(key) - - if (!deleted && value !== undefined) { - // If cache is full, delete the least recently used item - if (this.map.size >= this.max) { - const firstKey = this.map.keys().next().value - this.delete(firstKey) - } - - this.map.set(key, value) - } - - return this - } -} - -module.exports = LRUCache - - -/***/ }), - -/***/ 81667: -/***/ ((module) => { - -// parse out just the options we care about -const looseOption = Object.freeze({ loose: true }) -const emptyOpts = Object.freeze({ }) -const parseOptions = options => { - if (!options) { - return emptyOpts - } - - if (typeof options !== 'object') { - return looseOption - } - - return options -} -module.exports = parseOptions - - -/***/ }), - -/***/ 99011: -/***/ ((module, exports, __nccwpck_require__) => { - -const { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH, -} = __nccwpck_require__(34468) -const debug = __nccwpck_require__(11897) -exports = module.exports = {} - -// The actual regexps go on exports.re -const re = exports.re = [] -const safeRe = exports.safeRe = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 - -const LETTERDASHNUMBER = '[a-zA-Z0-9-]' - -// Replace some greedy regex tokens to prevent regex dos issues. These regex are -// used internally via the safeRe object since all inputs in this library get -// normalized first to trim and collapse all extra whitespace. The original -// regexes are exported for userland consumption and lower level usage. A -// future breaking change could export the safer regex only with a note that -// all input should have extra whitespace removed. -const safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] - -const makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value - .split(`${token}*`).join(`${token}{0,${max}}`) - .split(`${token}+`).join(`${token}{1,${max}}`) - } - return value -} - -const createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value) - const index = R++ - debug(name, index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, isGlobal ? 'g' : undefined) - safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '\\d+') - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) - -// ## Main Version -// Three dot-separated numeric identifiers. - -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`) - -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`) - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) - -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`) - -createToken('FULL', `^${src[t.FULLPLAIN]}$`) - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`) - -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) - -createToken('GTLT', '((?:<|>)?=?)') - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) - -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCEPLAIN', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) -createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) -createToken('COERCEFULL', src[t.COERCEPLAIN] + - `(?:${src[t.PRERELEASE]})?` + - `(?:${src[t.BUILD]})?` + - `(?:$|[^\\d])`) -createToken('COERCERTL', src[t.COERCE], true) -createToken('COERCERTLFULL', src[t.COERCEFULL], true) - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -createToken('LONETILDE', '(?:~>?)') - -createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) -exports.tildeTrimReplace = '$1~' - -createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) -createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -createToken('LONECARET', '(?:\\^)') - -createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) -exports.caretTrimReplace = '$1^' - -createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) -createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) -createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] -}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) -exports.comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$`) - -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`) - -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*') -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') - - -/***/ }), - -/***/ 78962: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// Determine if version is greater than all the versions possible in the range. -const outside = __nccwpck_require__(67573) -const gtr = (version, range, options) => outside(version, range, '>', options) -module.exports = gtr - - -/***/ }), - -/***/ 35690: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(51563) -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2, options) -} -module.exports = intersects - - -/***/ }), - -/***/ 60088: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const outside = __nccwpck_require__(67573) -// Determine if version is less than all the versions possible in the range -const ltr = (version, range, options) => outside(version, range, '<', options) -module.exports = ltr - - -/***/ }), - -/***/ 70647: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const Range = __nccwpck_require__(51563) - -const maxSatisfying = (versions, range, options) => { - let max = null - let maxSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} -module.exports = maxSatisfying - - -/***/ }), - -/***/ 87404: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const Range = __nccwpck_require__(51563) -const minSatisfying = (versions, range, options) => { - let min = null - let minSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} -module.exports = minSatisfying - - -/***/ }), - -/***/ 12336: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const Range = __nccwpck_require__(51563) -const gt = __nccwpck_require__(69819) - -const minVersion = (range, loose) => { - range = new Range(range, loose) - - let minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let setMin = null - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!setMin || gt(compver, setMin)) { - setMin = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`) - } - }) - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin - } - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} -module.exports = minVersion - - -/***/ }), - -/***/ 67573: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(84367) -const Comparator = __nccwpck_require__(12445) -const { ANY } = Comparator -const Range = __nccwpck_require__(51563) -const satisfies = __nccwpck_require__(31014) -const gt = __nccwpck_require__(69819) -const lt = __nccwpck_require__(69329) -const lte = __nccwpck_require__(46141) -const gte = __nccwpck_require__(38583) - -const outside = (version, range, hilo, options) => { - version = new SemVer(version, options) - range = new Range(range, options) - - let gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisfies the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let high = null - let low = null - - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -module.exports = outside - - -/***/ }), - -/***/ 22321: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// given a set of versions and a range, create a "simplified" range -// that includes the same versions that the original range does -// If the original range is shorter than the simplified one, return that. -const satisfies = __nccwpck_require__(31014) -const compare = __nccwpck_require__(46982) -module.exports = (versions, range, options) => { - const set = [] - let first = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!first) { - first = version - } - } else { - if (prev) { - set.push([first, prev]) - } - prev = null - first = null - } - } - if (first) { - set.push([first, null]) - } - - const ranges = [] - for (const [min, max] of set) { - if (min === max) { - ranges.push(min) - } else if (!max && min === v[0]) { - ranges.push('*') - } else if (!max) { - ranges.push(`>=${min}`) - } else if (min === v[0]) { - ranges.push(`<=${max}`) - } else { - ranges.push(`${min} - ${max}`) - } - } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range -} - - -/***/ }), - -/***/ 36464: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(51563) -const Comparator = __nccwpck_require__(12445) -const { ANY } = Comparator -const satisfies = __nccwpck_require__(31014) -const compare = __nccwpck_require__(46982) - -// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: -// - Every simple range `r1, r2, ...` is a null set, OR -// - Every simple range `r1, r2, ...` which is not a null set is a subset of -// some `R1, R2, ...` -// -// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: -// - If c is only the ANY comparator -// - If C is only the ANY comparator, return true -// - Else if in prerelease mode, return false -// - else replace c with `[>=0.0.0]` -// - If C is only the ANY comparator -// - if in prerelease mode, return true -// - else replace C with `[>=0.0.0]` -// - Let EQ be the set of = comparators in c -// - If EQ is more than one, return true (null set) -// - Let GT be the highest > or >= comparator in c -// - Let LT be the lowest < or <= comparator in c -// - If GT and LT, and GT.semver > LT.semver, return true (null set) -// - If any C is a = range, and GT or LT are set, return false -// - If EQ -// - If GT, and EQ does not satisfy GT, return true (null set) -// - If LT, and EQ does not satisfy LT, return true (null set) -// - If EQ satisfies every C, return true -// - Else return false -// - If GT -// - If GT.semver is lower than any > or >= comp in C, return false -// - If GT is >=, and GT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the GT.semver tuple, return false -// - If LT -// - If LT.semver is greater than any < or <= comp in C, return false -// - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the LT.semver tuple, return false -// - Else return true - -const subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true - } - - sub = new Range(sub, options) - dom = new Range(dom, options) - let sawNonNull = false - - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options) - sawNonNull = sawNonNull || isSub !== null - if (isSub) { - continue OUTER - } - } - // the null set is a subset of everything, but null simple ranges in - // a complex range should be ignored. so if we saw a non-null range, - // then we know this isn't a subset, but if EVERY simple range was null, - // then it is a subset. - if (sawNonNull) { - return false - } - } - return true -} - -const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] -const minimumVersion = [new Comparator('>=0.0.0')] - -const simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true - } - - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease - } else { - sub = minimumVersion - } - } - - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true - } else { - dom = minimumVersion - } - } - - const eqSet = new Set() - let gt, lt - for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') { - gt = higherGT(gt, c, options) - } else if (c.operator === '<' || c.operator === '<=') { - lt = lowerLT(lt, c, options) - } else { - eqSet.add(c.semver) - } - } - - if (eqSet.size > 1) { - return null - } - - let gtltComp - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) { - return null - } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { - return null - } - } - - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null - } - - if (lt && !satisfies(eq, String(lt), options)) { - return null - } - - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false - } - } - - return true - } - - let higher, lower - let hasDomLT, hasDomGT - // if the subset has a prerelease, we need a comparator in the superset - // with the same tuple and a prerelease, or it's not a subset - let needDomLTPre = lt && - !options.includePrerelease && - lt.semver.prerelease.length ? lt.semver : false - let needDomGTPre = gt && - !options.includePrerelease && - gt.semver.prerelease.length ? gt.semver : false - // exception: <1.2.3-0 is the same as <1.2.3 - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && - lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false - } - - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' - hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomGTPre.major && - c.semver.minor === needDomGTPre.minor && - c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false - } - } - if (c.operator === '>' || c.operator === '>=') { - higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) { - return false - } - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { - return false - } - } - if (lt) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomLTPre.major && - c.semver.minor === needDomLTPre.minor && - c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false - } - } - if (c.operator === '<' || c.operator === '<=') { - lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) { - return false - } - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { - return false - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false - } - } - - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false - } - - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false - } - - // we needed a prerelease range in a specific tuple, but didn't get one - // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, - // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { - return false - } - - return true -} - -// >=1.2.3 is lower than >1.2.3 -const higherGT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp > 0 ? a - : comp < 0 ? b - : b.operator === '>' && a.operator === '>=' ? b - : a -} - -// <=1.2.3 is higher than <1.2.3 -const lowerLT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp < 0 ? a - : comp > 0 ? b - : b.operator === '<' && a.operator === '<=' ? b - : a -} - -module.exports = subset - - -/***/ }), - -/***/ 75257: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(51563) - -// Mostly just for testing and legacy API reasons -const toComparators = (range, options) => - new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) - -module.exports = toComparators - - -/***/ }), - -/***/ 13657: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(51563) -const validRange = (range, options) => { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} -module.exports = validRange - - -/***/ }), - -/***/ 45038: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(50795), exports); -__exportStar(__nccwpck_require__(51636), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 50795: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.IORedisInstrumentation = void 0; -const api_1 = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const instrumentation_2 = __nccwpck_require__(65584); -const utils_1 = __nccwpck_require__(80681); -const redis_common_1 = __nccwpck_require__(3194); -/** @knipignore */ -const version_1 = __nccwpck_require__(99183); -const DEFAULT_CONFIG = { - requireParentSpan: true, -}; -class IORedisInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); - } - setConfig(config = {}) { - super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('ioredis', ['>=2.0.0 <6'], (module, moduleVersion) => { - const moduleExports = module[Symbol.toStringTag] === 'Module' - ? module.default // ESM - : module; // CommonJS - if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.sendCommand)) { - this._unwrap(moduleExports.prototype, 'sendCommand'); - } - this._wrap(moduleExports.prototype, 'sendCommand', this._patchSendCommand(moduleVersion)); - if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.connect)) { - this._unwrap(moduleExports.prototype, 'connect'); - } - this._wrap(moduleExports.prototype, 'connect', this._patchConnection()); - return module; - }, module => { - if (module === undefined) - return; - const moduleExports = module[Symbol.toStringTag] === 'Module' - ? module.default // ESM - : module; // CommonJS - this._unwrap(moduleExports.prototype, 'sendCommand'); - this._unwrap(moduleExports.prototype, 'connect'); - }), - ]; - } - /** - * Patch send command internal to trace requests - */ - _patchSendCommand(moduleVersion) { - return (original) => { - return this._traceSendCommand(original, moduleVersion); - }; - } - _patchConnection() { - return (original) => { - return this._traceConnection(original); - }; - } - _traceSendCommand(original, moduleVersion) { - const instrumentation = this; - return function (cmd) { - if (arguments.length < 1 || typeof cmd !== 'object') { - return original.apply(this, arguments); - } - const config = instrumentation.getConfig(); - const dbStatementSerializer = config.dbStatementSerializer || redis_common_1.defaultDbStatementSerializer; - const hasNoParentSpan = api_1.trace.getSpan(api_1.context.active()) === undefined; - if (config.requireParentSpan === true && hasNoParentSpan) { - return original.apply(this, arguments); - } - const span = instrumentation.tracer.startSpan(cmd.name, { - kind: api_1.SpanKind.CLIENT, - attributes: { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS, - [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: dbStatementSerializer(cmd.name, cmd.args), - }, - }); - const { requestHook } = config; - if (requestHook) { - (0, instrumentation_2.safeExecuteInTheMiddle)(() => requestHook(span, { - moduleVersion, - cmdName: cmd.name, - cmdArgs: cmd.args, - }), e => { - if (e) { - api_1.diag.error('ioredis instrumentation: request hook failed', e); - } - }, true); - } - const { host, port } = this.options; - span.setAttributes({ - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: port, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: `redis://${host}:${port}`, - }); - try { - const result = original.apply(this, arguments); - const origResolve = cmd.resolve; - /* eslint-disable @typescript-eslint/no-explicit-any */ - cmd.resolve = function (result) { - (0, instrumentation_2.safeExecuteInTheMiddle)(() => { var _a; return (_a = config.responseHook) === null || _a === void 0 ? void 0 : _a.call(config, span, cmd.name, cmd.args, result); }, e => { - if (e) { - api_1.diag.error('ioredis instrumentation: response hook failed', e); - } - }, true); - (0, utils_1.endSpan)(span, null); - origResolve(result); - }; - const origReject = cmd.reject; - cmd.reject = function (err) { - (0, utils_1.endSpan)(span, err); - origReject(err); - }; - return result; - } - catch (error) { - (0, utils_1.endSpan)(span, error); - throw error; - } - }; - } - _traceConnection(original) { - const instrumentation = this; - return function () { - const hasNoParentSpan = api_1.trace.getSpan(api_1.context.active()) === undefined; - if (instrumentation.getConfig().requireParentSpan === true && - hasNoParentSpan) { - return original.apply(this, arguments); - } - const span = instrumentation.tracer.startSpan('connect', { - kind: api_1.SpanKind.CLIENT, - attributes: { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS, - [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: 'connect', - }, - }); - const { host, port } = this.options; - span.setAttributes({ - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: port, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: `redis://${host}:${port}`, - }); - try { - const client = original.apply(this, arguments); - (0, utils_1.endSpan)(span, null); - return client; - } - catch (error) { - (0, utils_1.endSpan)(span, error); - throw error; - } - }; - } -} -exports.IORedisInstrumentation = IORedisInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 51636: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 80681: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.endSpan = void 0; -const api_1 = __nccwpck_require__(65163); -const endSpan = (span, err) => { - if (err) { - span.recordException(err); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - } - span.end(); -}; -exports.endSpan = endSpan; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 99183: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.47.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-ioredis'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 82331: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors, Aspecto - * - * 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(61675), exports); -__exportStar(__nccwpck_require__(97810), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 61675: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors, Aspecto - * - * 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.KafkaJsInstrumentation = void 0; -const api_1 = __nccwpck_require__(65163); -const semantic_conventions_1 = __nccwpck_require__(67275); -/** @knipignore */ -const version_1 = __nccwpck_require__(58887); -const propagator_1 = __nccwpck_require__(11863); -const instrumentation_1 = __nccwpck_require__(65584); -class KafkaJsInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - const unpatch = (moduleExports) => { - var _a, _b; - if ((0, instrumentation_1.isWrapped)((_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Kafka) === null || _a === void 0 ? void 0 : _a.prototype.producer)) { - this._unwrap(moduleExports.Kafka.prototype, 'producer'); - } - if ((0, instrumentation_1.isWrapped)((_b = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Kafka) === null || _b === void 0 ? void 0 : _b.prototype.consumer)) { - this._unwrap(moduleExports.Kafka.prototype, 'consumer'); - } - }; - const module = new instrumentation_1.InstrumentationNodeModuleDefinition('kafkajs', ['>=0.1.0 <3'], (moduleExports) => { - var _a, _b; - unpatch(moduleExports); - this._wrap((_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Kafka) === null || _a === void 0 ? void 0 : _a.prototype, 'producer', this._getProducerPatch()); - this._wrap((_b = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.Kafka) === null || _b === void 0 ? void 0 : _b.prototype, 'consumer', this._getConsumerPatch()); - return moduleExports; - }, unpatch); - return module; - } - _getConsumerPatch() { - const instrumentation = this; - return (original) => { - return function consumer(...args) { - const newConsumer = original.apply(this, args); - if ((0, instrumentation_1.isWrapped)(newConsumer.run)) { - instrumentation._unwrap(newConsumer, 'run'); - } - instrumentation._wrap(newConsumer, 'run', instrumentation._getConsumerRunPatch()); - return newConsumer; - }; - }; - } - _getProducerPatch() { - const instrumentation = this; - return (original) => { - return function consumer(...args) { - const newProducer = original.apply(this, args); - if ((0, instrumentation_1.isWrapped)(newProducer.sendBatch)) { - instrumentation._unwrap(newProducer, 'sendBatch'); - } - instrumentation._wrap(newProducer, 'sendBatch', instrumentation._getProducerSendBatchPatch()); - if ((0, instrumentation_1.isWrapped)(newProducer.send)) { - instrumentation._unwrap(newProducer, 'send'); - } - instrumentation._wrap(newProducer, 'send', instrumentation._getProducerSendPatch()); - return newProducer; - }; - }; - } - _getConsumerRunPatch() { - const instrumentation = this; - return (original) => { - return function run(...args) { - const config = args[0]; - if (config === null || config === void 0 ? void 0 : config.eachMessage) { - if ((0, instrumentation_1.isWrapped)(config.eachMessage)) { - instrumentation._unwrap(config, 'eachMessage'); - } - instrumentation._wrap(config, 'eachMessage', instrumentation._getConsumerEachMessagePatch()); - } - if (config === null || config === void 0 ? void 0 : config.eachBatch) { - if ((0, instrumentation_1.isWrapped)(config.eachBatch)) { - instrumentation._unwrap(config, 'eachBatch'); - } - instrumentation._wrap(config, 'eachBatch', instrumentation._getConsumerEachBatchPatch()); - } - return original.call(this, config); - }; - }; - } - _getConsumerEachMessagePatch() { - const instrumentation = this; - return (original) => { - return function eachMessage(...args) { - const payload = args[0]; - const propagatedContext = api_1.propagation.extract(api_1.ROOT_CONTEXT, payload.message.headers, propagator_1.bufferTextMapGetter); - const span = instrumentation._startConsumerSpan(payload.topic, payload.message, semantic_conventions_1.MESSAGINGOPERATIONVALUES_PROCESS, propagatedContext); - const eachMessagePromise = api_1.context.with(api_1.trace.setSpan(propagatedContext, span), () => { - return original.apply(this, args); - }); - return instrumentation._endSpansOnPromise([span], eachMessagePromise); - }; - }; - } - _getConsumerEachBatchPatch() { - return (original) => { - const instrumentation = this; - return function eachBatch(...args) { - const payload = args[0]; - // https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#topic-with-multiple-consumers - const receivingSpan = instrumentation._startConsumerSpan(payload.batch.topic, undefined, semantic_conventions_1.MESSAGINGOPERATIONVALUES_RECEIVE, api_1.ROOT_CONTEXT); - return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), receivingSpan), () => { - const spans = payload.batch.messages.map((message) => { - var _a; - const propagatedContext = api_1.propagation.extract(api_1.ROOT_CONTEXT, message.headers, propagator_1.bufferTextMapGetter); - const spanContext = (_a = api_1.trace - .getSpan(propagatedContext)) === null || _a === void 0 ? void 0 : _a.spanContext(); - let origSpanLink; - if (spanContext) { - origSpanLink = { - context: spanContext, - }; - } - return instrumentation._startConsumerSpan(payload.batch.topic, message, semantic_conventions_1.MESSAGINGOPERATIONVALUES_PROCESS, undefined, origSpanLink); - }); - const batchMessagePromise = original.apply(this, args); - spans.unshift(receivingSpan); - return instrumentation._endSpansOnPromise(spans, batchMessagePromise); - }); - }; - }; - } - _getProducerSendBatchPatch() { - const instrumentation = this; - return (original) => { - return function sendBatch(...args) { - const batch = args[0]; - const messages = batch.topicMessages || []; - const spans = messages - .map(topicMessage => topicMessage.messages.map(message => instrumentation._startProducerSpan(topicMessage.topic, message))) - .reduce((acc, val) => acc.concat(val), []); - const origSendResult = original.apply(this, args); - return instrumentation._endSpansOnPromise(spans, origSendResult); - }; - }; - } - _getProducerSendPatch() { - const instrumentation = this; - return (original) => { - return function send(...args) { - const record = args[0]; - const spans = record.messages.map(message => { - return instrumentation._startProducerSpan(record.topic, message); - }); - const origSendResult = original.apply(this, args); - return instrumentation._endSpansOnPromise(spans, origSendResult); - }; - }; - } - _endSpansOnPromise(spans, sendPromise) { - return Promise.resolve(sendPromise) - .catch(reason => { - let errorMessage; - if (typeof reason === 'string') - errorMessage = reason; - else if (typeof reason === 'object' && - Object.prototype.hasOwnProperty.call(reason, 'message')) - errorMessage = reason.message; - spans.forEach(span => span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: errorMessage, - })); - throw reason; - }) - .finally(() => { - spans.forEach(span => span.end()); - }); - } - _startConsumerSpan(topic, message, operation, context, link) { - const span = this.tracer.startSpan(topic, { - kind: api_1.SpanKind.CONSUMER, - attributes: { - [semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: 'kafka', - [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: topic, - [semantic_conventions_1.SEMATTRS_MESSAGING_OPERATION]: operation, - }, - links: link ? [link] : [], - }, context); - const { consumerHook } = this.getConfig(); - if (consumerHook && message) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => consumerHook(span, { topic, message }), e => { - if (e) - this._diag.error('consumerHook error', e); - }, true); - } - return span; - } - _startProducerSpan(topic, message) { - var _a; - const span = this.tracer.startSpan(topic, { - kind: api_1.SpanKind.PRODUCER, - attributes: { - [semantic_conventions_1.SEMATTRS_MESSAGING_SYSTEM]: 'kafka', - [semantic_conventions_1.SEMATTRS_MESSAGING_DESTINATION]: topic, - }, - }); - message.headers = (_a = message.headers) !== null && _a !== void 0 ? _a : {}; - api_1.propagation.inject(api_1.trace.setSpan(api_1.context.active(), span), message.headers); - const { producerHook } = this.getConfig(); - if (producerHook) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => producerHook(span, { topic, message }), e => { - if (e) - this._diag.error('producerHook error', e); - }, true); - } - return span; - } -} -exports.KafkaJsInstrumentation = KafkaJsInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 11863: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.bufferTextMapGetter = void 0; -/* -same as open telemetry's `defaultTextMapGetter`, -but also handle case where header is buffer, -adding toString() to make sure string is returned -*/ -exports.bufferTextMapGetter = { - get(carrier, key) { - var _a; - if (!carrier) { - return undefined; - } - const keys = Object.keys(carrier); - for (const carrierKey of keys) { - if (carrierKey === key || carrierKey.toLowerCase() === key) { - return (_a = carrier[carrierKey]) === null || _a === void 0 ? void 0 : _a.toString(); - } - } - return undefined; - }, - keys(carrier) { - return carrier ? Object.keys(carrier) : []; - }, -}; -//# sourceMappingURL=propagator.js.map - -/***/ }), - -/***/ 97810: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 58887: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.7.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-kafkajs'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 79507: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SUPPORTED_VERSIONS = exports.MODULE_NAME = void 0; -exports.MODULE_NAME = 'knex'; -exports.SUPPORTED_VERSIONS = [ - // use "lib/execution" for runner.js, "lib" for client.js as basepath, latest tested 0.95.6 - '>=0.22.0 <4', - // use "lib" as basepath - '>=0.10.0 <0.18.0', - '>=0.19.0 <0.22.0', - // use "src" as basepath - '>=0.18.0 <0.19.0', -]; -//# sourceMappingURL=constants.js.map - -/***/ }), - -/***/ 12083: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(28661), exports); -__exportStar(__nccwpck_require__(58437), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 28661: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.KnexInstrumentation = void 0; -const api = __nccwpck_require__(65163); -/** @knipignore */ -const version_1 = __nccwpck_require__(59922); -const constants = __nccwpck_require__(79507); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const utils = __nccwpck_require__(19556); -const contextSymbol = Symbol('opentelemetry.instrumentation-knex.context'); -const DEFAULT_CONFIG = { - maxQueryLength: 1022, - requireParentSpan: false, -}; -class KnexInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); - } - setConfig(config = {}) { - super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); - } - init() { - const module = new instrumentation_1.InstrumentationNodeModuleDefinition(constants.MODULE_NAME, constants.SUPPORTED_VERSIONS); - module.files.push(this.getClientNodeModuleFileInstrumentation('src'), this.getClientNodeModuleFileInstrumentation('lib'), this.getRunnerNodeModuleFileInstrumentation('src'), this.getRunnerNodeModuleFileInstrumentation('lib'), this.getRunnerNodeModuleFileInstrumentation('lib/execution')); - return module; - } - getRunnerNodeModuleFileInstrumentation(basePath) { - return new instrumentation_1.InstrumentationNodeModuleFile(`knex/${basePath}/runner.js`, constants.SUPPORTED_VERSIONS, (Runner, moduleVersion) => { - this.ensureWrapped(Runner.prototype, 'query', this.createQueryWrapper(moduleVersion)); - return Runner; - }, (Runner, moduleVersion) => { - this._unwrap(Runner.prototype, 'query'); - return Runner; - }); - } - getClientNodeModuleFileInstrumentation(basePath) { - return new instrumentation_1.InstrumentationNodeModuleFile(`knex/${basePath}/client.js`, constants.SUPPORTED_VERSIONS, (Client) => { - this.ensureWrapped(Client.prototype, 'queryBuilder', this.storeContext.bind(this)); - this.ensureWrapped(Client.prototype, 'schemaBuilder', this.storeContext.bind(this)); - this.ensureWrapped(Client.prototype, 'raw', this.storeContext.bind(this)); - return Client; - }, (Client) => { - this._unwrap(Client.prototype, 'queryBuilder'); - this._unwrap(Client.prototype, 'schemaBuilder'); - this._unwrap(Client.prototype, 'raw'); - return Client; - }); - } - createQueryWrapper(moduleVersion) { - const instrumentation = this; - return function wrapQuery(original) { - return function wrapped_logging_method(query) { - var _a, _b, _c, _d, _e, _f; - const config = this.client.config; - const table = utils.extractTableName(this.builder); - // `method` actually refers to the knex API method - Not exactly "operation" - // in the spec sense, but matches most of the time. - const operation = query === null || query === void 0 ? void 0 : query.method; - const name = ((_a = config === null || config === void 0 ? void 0 : config.connection) === null || _a === void 0 ? void 0 : _a.filename) || ((_b = config === null || config === void 0 ? void 0 : config.connection) === null || _b === void 0 ? void 0 : _b.database); - const { maxQueryLength } = instrumentation.getConfig(); - const attributes = { - 'knex.version': moduleVersion, - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: utils.mapSystem(config.client), - [semantic_conventions_1.SEMATTRS_DB_SQL_TABLE]: table, - [semantic_conventions_1.SEMATTRS_DB_OPERATION]: operation, - [semantic_conventions_1.SEMATTRS_DB_USER]: (_c = config === null || config === void 0 ? void 0 : config.connection) === null || _c === void 0 ? void 0 : _c.user, - [semantic_conventions_1.SEMATTRS_DB_NAME]: name, - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: (_d = config === null || config === void 0 ? void 0 : config.connection) === null || _d === void 0 ? void 0 : _d.host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: (_e = config === null || config === void 0 ? void 0 : config.connection) === null || _e === void 0 ? void 0 : _e.port, - [semantic_conventions_1.SEMATTRS_NET_TRANSPORT]: ((_f = config === null || config === void 0 ? void 0 : config.connection) === null || _f === void 0 ? void 0 : _f.filename) === ':memory:' ? 'inproc' : undefined, - }; - if (maxQueryLength) { - // filters both undefined and 0 - attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = utils.limitLength(query === null || query === void 0 ? void 0 : query.sql, maxQueryLength); - } - const parentContext = this.builder[contextSymbol] || api.context.active(); - const parentSpan = api.trace.getSpan(parentContext); - const hasActiveParent = parentSpan && api.trace.isSpanContextValid(parentSpan.spanContext()); - if (instrumentation._config.requireParentSpan && !hasActiveParent) { - return original.bind(this)(...arguments); - } - const span = instrumentation.tracer.startSpan(utils.getName(name, operation, table), { - kind: api.SpanKind.CLIENT, - attributes, - }, parentContext); - const spanContext = api.trace.setSpan(api.context.active(), span); - return api.context - .with(spanContext, original, this, ...arguments) - .then((result) => { - span.end(); - return result; - }) - .catch((err) => { - // knex adds full query with all the binding values to the message, - // we want to undo that without changing the original error - const formatter = utils.getFormatter(this); - const fullQuery = formatter(query.sql, query.bindings || []); - const message = err.message.replace(fullQuery + ' - ', ''); - const clonedError = utils.cloneErrorWithNewMessage(err, message); - span.recordException(clonedError); - span.setStatus({ code: api.SpanStatusCode.ERROR, message }); - span.end(); - throw err; - }); - }; - }; - } - storeContext(original) { - return function wrapped_logging_method() { - const builder = original.apply(this, arguments); - // Builder is a custom promise type and when awaited it fails to propagate context. - // We store the parent context at the moment of initiating the builder - // otherwise we'd have nothing to attach the span as a child for in `query`. - Object.defineProperty(builder, contextSymbol, { - value: api.context.active(), - }); - return builder; - }; - } - ensureWrapped(obj, methodName, wrapper) { - if ((0, instrumentation_1.isWrapped)(obj[methodName])) { - this._unwrap(obj, methodName); - } - this._wrap(obj, methodName, wrapper); - } -} -exports.KnexInstrumentation = KnexInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 58437: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 19556: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.extractTableName = exports.limitLength = exports.getName = exports.mapSystem = exports.cloneErrorWithNewMessage = exports.getFormatter = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const getFormatter = (runner) => { - if (runner) { - if (runner.client) { - if (runner.client._formatQuery) { - return runner.client._formatQuery.bind(runner.client); - } - else if (runner.client.SqlString) { - return runner.client.SqlString.format.bind(runner.client.SqlString); - } - } - if (runner.builder) { - return runner.builder.toString.bind(runner.builder); - } - } - return () => ''; -}; -exports.getFormatter = getFormatter; -const cloneErrorWithNewMessage = (err, message) => { - if (err && err instanceof Error) { - const clonedError = new err.constructor(message); - clonedError.code = err.code; - clonedError.stack = err.stack; - clonedError.errno = err.errno; - return clonedError; - } - return err; -}; -exports.cloneErrorWithNewMessage = cloneErrorWithNewMessage; -const systemMap = new Map([ - ['sqlite3', semantic_conventions_1.DBSYSTEMVALUES_SQLITE], - ['pg', semantic_conventions_1.DBSYSTEMVALUES_POSTGRESQL], -]); -const mapSystem = (knexSystem) => { - return systemMap.get(knexSystem) || knexSystem; -}; -exports.mapSystem = mapSystem; -const getName = (db, operation, table) => { - if (operation) { - if (table) { - return `${operation} ${db}.${table}`; - } - return `${operation} ${db}`; - } - return db; -}; -exports.getName = getName; -const limitLength = (str, maxLength) => { - if (typeof str === 'string' && - typeof maxLength === 'number' && - 0 < maxLength && - maxLength < str.length) { - return str.substring(0, maxLength) + '..'; - } - return str; -}; -exports.limitLength = limitLength; -const extractTableName = (builder) => { - var _a; - const table = (_a = builder === null || builder === void 0 ? void 0 : builder._single) === null || _a === void 0 ? void 0 : _a.table; - if (typeof table === 'object') { - return (0, exports.extractTableName)(table); - } - return table; -}; -exports.extractTableName = extractTableName; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 59922: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.44.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-knex'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 8364: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AttributeNames = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var AttributeNames; -(function (AttributeNames) { - AttributeNames["KOA_TYPE"] = "koa.type"; - AttributeNames["KOA_NAME"] = "koa.name"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 68168: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(200), exports); -__exportStar(__nccwpck_require__(4993), exports); -__exportStar(__nccwpck_require__(8364), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 200: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.KoaInstrumentation = void 0; -const api = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -const types_1 = __nccwpck_require__(4993); -/** @knipignore */ -const version_1 = __nccwpck_require__(74757); -const utils_1 = __nccwpck_require__(26619); -const core_1 = __nccwpck_require__(89736); -const internal_types_1 = __nccwpck_require__(8207); -/** Koa instrumentation for OpenTelemetry */ -class KoaInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return new instrumentation_1.InstrumentationNodeModuleDefinition('koa', ['>=2.0.0 <3'], (module) => { - const moduleExports = module[Symbol.toStringTag] === 'Module' - ? module.default // ESM - : module; // CommonJS - if (moduleExports == null) { - return moduleExports; - } - if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.use)) { - this._unwrap(moduleExports.prototype, 'use'); - } - this._wrap(moduleExports.prototype, 'use', this._getKoaUsePatch.bind(this)); - return module; - }, (module) => { - const moduleExports = module[Symbol.toStringTag] === 'Module' - ? module.default // ESM - : module; // CommonJS - if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.use)) { - this._unwrap(moduleExports.prototype, 'use'); - } - }); - } - /** - * Patches the Koa.use function in order to instrument each original - * middleware layer which is introduced - * @param {KoaMiddleware} middleware - the original middleware function - */ - _getKoaUsePatch(original) { - const plugin = this; - return function use(middlewareFunction) { - let patchedFunction; - if (middlewareFunction.router) { - patchedFunction = plugin._patchRouterDispatch(middlewareFunction); - } - else { - patchedFunction = plugin._patchLayer(middlewareFunction, false); - } - return original.apply(this, [patchedFunction]); - }; - } - /** - * Patches the dispatch function used by @koa/router. This function - * goes through each routed middleware and adds instrumentation via a call - * to the @function _patchLayer function. - * @param {KoaMiddleware} dispatchLayer - the original dispatch function which dispatches - * routed middleware - */ - _patchRouterDispatch(dispatchLayer) { - var _a; - api.diag.debug('Patching @koa/router dispatch'); - const router = dispatchLayer.router; - const routesStack = (_a = router === null || router === void 0 ? void 0 : router.stack) !== null && _a !== void 0 ? _a : []; - for (const pathLayer of routesStack) { - const path = pathLayer.path; - const pathStack = pathLayer.stack; - for (let j = 0; j < pathStack.length; j++) { - const routedMiddleware = pathStack[j]; - pathStack[j] = this._patchLayer(routedMiddleware, true, path); - } - } - return dispatchLayer; - } - /** - * Patches each individual @param middlewareLayer function in order to create the - * span and propagate context. It does not create spans when there is no parent span. - * @param {KoaMiddleware} middlewareLayer - the original middleware function. - * @param {boolean} isRouter - tracks whether the original middleware function - * was dispatched by the router originally - * @param {string?} layerPath - if present, provides additional data from the - * router about the routed path which the middleware is attached to - */ - _patchLayer(middlewareLayer, isRouter, layerPath) { - const layerType = isRouter ? types_1.KoaLayerType.ROUTER : types_1.KoaLayerType.MIDDLEWARE; - // Skip patching layer if its ignored in the config - if (middlewareLayer[internal_types_1.kLayerPatched] === true || - (0, utils_1.isLayerIgnored)(layerType, this.getConfig())) - return middlewareLayer; - if (middlewareLayer.constructor.name === 'GeneratorFunction' || - middlewareLayer.constructor.name === 'AsyncGeneratorFunction') { - api.diag.debug('ignoring generator-based Koa middleware layer'); - return middlewareLayer; - } - middlewareLayer[internal_types_1.kLayerPatched] = true; - api.diag.debug('patching Koa middleware layer'); - return async (context, next) => { - const parent = api.trace.getSpan(api.context.active()); - if (parent === undefined) { - return middlewareLayer(context, next); - } - const metadata = (0, utils_1.getMiddlewareMetadata)(context, middlewareLayer, isRouter, layerPath); - const span = this.tracer.startSpan(metadata.name, { - attributes: metadata.attributes, - }); - const rpcMetadata = (0, core_1.getRPCMetadata)(api.context.active()); - if ((rpcMetadata === null || rpcMetadata === void 0 ? void 0 : rpcMetadata.type) === core_1.RPCType.HTTP && context._matchedRoute) { - rpcMetadata.route = context._matchedRoute.toString(); - } - const { requestHook } = this.getConfig(); - if (requestHook) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => requestHook(span, { - context, - middlewareLayer, - layerType, - }), e => { - if (e) { - api.diag.error('koa instrumentation: request hook failed', e); - } - }, true); - } - const newContext = api.trace.setSpan(api.context.active(), span); - return api.context.with(newContext, async () => { - try { - return await middlewareLayer(context, next); - } - catch (err) { - span.recordException(err); - throw err; - } - finally { - span.end(); - } - }); - }; - } -} -exports.KoaInstrumentation = KoaInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 8207: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.kLayerPatched = void 0; -/** - * This symbol is used to mark a Koa layer as being already instrumented - * since its possible to use a given layer multiple times (ex: middlewares) - */ -exports.kLayerPatched = Symbol('koa-layer-patched'); -//# sourceMappingURL=internal-types.js.map - -/***/ }), - -/***/ 4993: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.KoaLayerType = void 0; -var KoaLayerType; -(function (KoaLayerType) { - KoaLayerType["ROUTER"] = "router"; - KoaLayerType["MIDDLEWARE"] = "middleware"; -})(KoaLayerType = exports.KoaLayerType || (exports.KoaLayerType = {})); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 26619: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isLayerIgnored = exports.getMiddlewareMetadata = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const types_1 = __nccwpck_require__(4993); -const AttributeNames_1 = __nccwpck_require__(8364); -const semantic_conventions_1 = __nccwpck_require__(67275); -const getMiddlewareMetadata = (context, layer, isRouter, layerPath) => { - var _a; - if (isRouter) { - return { - attributes: { - [AttributeNames_1.AttributeNames.KOA_NAME]: layerPath === null || layerPath === void 0 ? void 0 : layerPath.toString(), - [AttributeNames_1.AttributeNames.KOA_TYPE]: types_1.KoaLayerType.ROUTER, - [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: layerPath === null || layerPath === void 0 ? void 0 : layerPath.toString(), - }, - name: context._matchedRouteName || `router - ${layerPath}`, - }; - } - else { - return { - attributes: { - [AttributeNames_1.AttributeNames.KOA_NAME]: (_a = layer.name) !== null && _a !== void 0 ? _a : 'middleware', - [AttributeNames_1.AttributeNames.KOA_TYPE]: types_1.KoaLayerType.MIDDLEWARE, - }, - name: `middleware - ${layer.name}`, - }; - } -}; -exports.getMiddlewareMetadata = getMiddlewareMetadata; -/** - * Check whether the given request is ignored by configuration - * @param [list] List of ignore patterns - * @param [onException] callback for doing something when an exception has - * occurred - */ -const isLayerIgnored = (type, config) => { - var _a; - return !!(Array.isArray(config === null || config === void 0 ? void 0 : config.ignoreLayersType) && - ((_a = config === null || config === void 0 ? void 0 : config.ignoreLayersType) === null || _a === void 0 ? void 0 : _a.includes(type))); -}; -exports.isLayerIgnored = isLayerIgnored; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 74757: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.47.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-koa'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 7362: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(78588), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 78588: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LruMemoizerInstrumentation = void 0; -const api_1 = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -/** @knipignore */ -const version_1 = __nccwpck_require__(11528); -class LruMemoizerInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('lru-memoizer', ['>=1.3 <3'], moduleExports => { - // moduleExports is a function which receives an options object, - // and returns a "memoizer" function upon invocation. - // We want to patch this "memoizer's" internal function - const asyncMemoizer = function () { - // This following function is invoked every time the user wants to get a (possible) memoized value - // We replace it with another function in which we bind the current context to the last argument (callback) - const origMemoizer = moduleExports.apply(this, arguments); - return function () { - const modifiedArguments = [...arguments]; - // last argument is the callback - const origCallback = modifiedArguments.pop(); - const callbackWithContext = typeof origCallback === 'function' - ? api_1.context.bind(api_1.context.active(), origCallback) - : origCallback; - modifiedArguments.push(callbackWithContext); - return origMemoizer.apply(this, modifiedArguments); - }; - }; - // sync function preserves context, but we still need to export it - // as the lru-memoizer package does - asyncMemoizer.sync = moduleExports.sync; - return asyncMemoizer; - }, undefined // no need to disable as this instrumentation does not create any spans - ), - ]; - } -} -exports.LruMemoizerInstrumentation = LruMemoizerInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 11528: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.44.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-lru-memoizer'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 25625: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(45373), exports); -__exportStar(__nccwpck_require__(68969), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 45373: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MongoDBInstrumentation = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const internal_types_1 = __nccwpck_require__(55807); -/** @knipignore */ -const version_1 = __nccwpck_require__(39617); -/** mongodb instrumentation plugin for OpenTelemetry */ -class MongoDBInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - _updateMetricInstruments() { - this._connectionsUsage = this.meter.createUpDownCounter('db.client.connections.usage', { - description: 'The number of connections that are currently in state described by the state attribute.', - unit: '{connection}', - }); - } - init() { - const { v3PatchConnection: v3PatchConnection, v3UnpatchConnection: v3UnpatchConnection, } = this._getV3ConnectionPatches(); - const { v4PatchConnect, v4UnpatchConnect } = this._getV4ConnectPatches(); - const { v4PatchConnectionCallback, v4PatchConnectionPromise, v4UnpatchConnection, } = this._getV4ConnectionPatches(); - const { v4PatchConnectionPool, v4UnpatchConnectionPool } = this._getV4ConnectionPoolPatches(); - const { v4PatchSessions, v4UnpatchSessions } = this._getV4SessionsPatches(); - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('mongodb', ['>=3.3.0 <4'], undefined, undefined, [ - new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/core/wireprotocol/index.js', ['>=3.3.0 <4'], v3PatchConnection, v3UnpatchConnection), - ]), - new instrumentation_1.InstrumentationNodeModuleDefinition('mongodb', ['>=4.0.0 <7'], undefined, undefined, [ - new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/cmap/connection.js', ['>=4.0.0 <6.4'], v4PatchConnectionCallback, v4UnpatchConnection), - new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/cmap/connection.js', ['>=6.4.0 <7'], v4PatchConnectionPromise, v4UnpatchConnection), - new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/cmap/connection_pool.js', ['>=4.0.0 <6.4'], v4PatchConnectionPool, v4UnpatchConnectionPool), - new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/cmap/connect.js', ['>=4.0.0 <7'], v4PatchConnect, v4UnpatchConnect), - new instrumentation_1.InstrumentationNodeModuleFile('mongodb/lib/sessions.js', ['>=4.0.0 <7'], v4PatchSessions, v4UnpatchSessions), - ]), - ]; - } - _getV3ConnectionPatches() { - return { - v3PatchConnection: (moduleExports) => { - // patch insert operation - if ((0, instrumentation_1.isWrapped)(moduleExports.insert)) { - this._unwrap(moduleExports, 'insert'); - } - this._wrap(moduleExports, 'insert', this._getV3PatchOperation('insert')); - // patch remove operation - if ((0, instrumentation_1.isWrapped)(moduleExports.remove)) { - this._unwrap(moduleExports, 'remove'); - } - this._wrap(moduleExports, 'remove', this._getV3PatchOperation('remove')); - // patch update operation - if ((0, instrumentation_1.isWrapped)(moduleExports.update)) { - this._unwrap(moduleExports, 'update'); - } - this._wrap(moduleExports, 'update', this._getV3PatchOperation('update')); - // patch other command - if ((0, instrumentation_1.isWrapped)(moduleExports.command)) { - this._unwrap(moduleExports, 'command'); - } - this._wrap(moduleExports, 'command', this._getV3PatchCommand()); - // patch query - if ((0, instrumentation_1.isWrapped)(moduleExports.query)) { - this._unwrap(moduleExports, 'query'); - } - this._wrap(moduleExports, 'query', this._getV3PatchFind()); - // patch get more operation on cursor - if ((0, instrumentation_1.isWrapped)(moduleExports.getMore)) { - this._unwrap(moduleExports, 'getMore'); - } - this._wrap(moduleExports, 'getMore', this._getV3PatchCursor()); - return moduleExports; - }, - v3UnpatchConnection: (moduleExports) => { - if (moduleExports === undefined) - return; - this._unwrap(moduleExports, 'insert'); - this._unwrap(moduleExports, 'remove'); - this._unwrap(moduleExports, 'update'); - this._unwrap(moduleExports, 'command'); - this._unwrap(moduleExports, 'query'); - this._unwrap(moduleExports, 'getMore'); - }, - }; - } - _getV4SessionsPatches() { - return { - v4PatchSessions: (moduleExports) => { - if ((0, instrumentation_1.isWrapped)(moduleExports.acquire)) { - this._unwrap(moduleExports, 'acquire'); - } - this._wrap(moduleExports.ServerSessionPool.prototype, 'acquire', this._getV4AcquireCommand()); - if ((0, instrumentation_1.isWrapped)(moduleExports.release)) { - this._unwrap(moduleExports, 'release'); - } - this._wrap(moduleExports.ServerSessionPool.prototype, 'release', this._getV4ReleaseCommand()); - return moduleExports; - }, - v4UnpatchSessions: (moduleExports) => { - if (moduleExports === undefined) - return; - if ((0, instrumentation_1.isWrapped)(moduleExports.acquire)) { - this._unwrap(moduleExports, 'acquire'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.release)) { - this._unwrap(moduleExports, 'release'); - } - }, - }; - } - _getV4AcquireCommand() { - const instrumentation = this; - return (original) => { - return function patchAcquire() { - const nSessionsBeforeAcquire = this.sessions.length; - const session = original.call(this); - const nSessionsAfterAcquire = this.sessions.length; - if (nSessionsBeforeAcquire === nSessionsAfterAcquire) { - //no session in the pool. a new session was created and used - instrumentation._connectionsUsage.add(1, { - state: 'used', - 'pool.name': instrumentation._poolName, - }); - } - else if (nSessionsBeforeAcquire - 1 === nSessionsAfterAcquire) { - //a session was already in the pool. remove it from the pool and use it. - instrumentation._connectionsUsage.add(-1, { - state: 'idle', - 'pool.name': instrumentation._poolName, - }); - instrumentation._connectionsUsage.add(1, { - state: 'used', - 'pool.name': instrumentation._poolName, - }); - } - return session; - }; - }; - } - _getV4ReleaseCommand() { - const instrumentation = this; - return (original) => { - return function patchRelease(session) { - const cmdPromise = original.call(this, session); - instrumentation._connectionsUsage.add(-1, { - state: 'used', - 'pool.name': instrumentation._poolName, - }); - instrumentation._connectionsUsage.add(1, { - state: 'idle', - 'pool.name': instrumentation._poolName, - }); - return cmdPromise; - }; - }; - } - _getV4ConnectionPoolPatches() { - return { - v4PatchConnectionPool: (moduleExports) => { - const poolPrototype = moduleExports.ConnectionPool.prototype; - if ((0, instrumentation_1.isWrapped)(poolPrototype.checkOut)) { - this._unwrap(poolPrototype, 'checkOut'); - } - this._wrap(poolPrototype, 'checkOut', this._getV4ConnectionPoolCheckOut()); - return moduleExports; - }, - v4UnpatchConnectionPool: (moduleExports) => { - if (moduleExports === undefined) - return; - this._unwrap(moduleExports.ConnectionPool.prototype, 'checkOut'); - }, - }; - } - _getV4ConnectPatches() { - return { - v4PatchConnect: (moduleExports) => { - if ((0, instrumentation_1.isWrapped)(moduleExports.connect)) { - this._unwrap(moduleExports, 'connect'); - } - this._wrap(moduleExports, 'connect', this._getV4ConnectCommand()); - return moduleExports; - }, - v4UnpatchConnect: (moduleExports) => { - if (moduleExports === undefined) - return; - this._unwrap(moduleExports, 'connect'); - }, - }; - } - // This patch will become unnecessary once - // https://jira.mongodb.org/browse/NODE-5639 is done. - _getV4ConnectionPoolCheckOut() { - return (original) => { - return function patchedCheckout(callback) { - const patchedCallback = api_1.context.bind(api_1.context.active(), callback); - return original.call(this, patchedCallback); - }; - }; - } - _getV4ConnectCommand() { - const instrumentation = this; - return (original) => { - return function patchedConnect(options, callback) { - // from v6.4 `connect` method only accepts an options param and returns a promise - // with the connection - if (original.length === 1) { - const result = original.call(this, options); - if (result && typeof result.then === 'function') { - result.then(() => instrumentation.setPoolName(options), - // this handler is set to pass the lint rules - () => undefined); - } - return result; - } - // Earlier versions expects a callback param and return void - const patchedCallback = function (err, conn) { - if (err || !conn) { - callback(err, conn); - return; - } - instrumentation.setPoolName(options); - callback(err, conn); - }; - return original.call(this, options, patchedCallback); - }; - }; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - _getV4ConnectionPatches() { - return { - v4PatchConnectionCallback: (moduleExports) => { - // patch insert operation - if ((0, instrumentation_1.isWrapped)(moduleExports.Connection.prototype.command)) { - this._unwrap(moduleExports.Connection.prototype, 'command'); - } - this._wrap(moduleExports.Connection.prototype, 'command', this._getV4PatchCommandCallback()); - return moduleExports; - }, - v4PatchConnectionPromise: (moduleExports) => { - // patch insert operation - if ((0, instrumentation_1.isWrapped)(moduleExports.Connection.prototype.command)) { - this._unwrap(moduleExports.Connection.prototype, 'command'); - } - this._wrap(moduleExports.Connection.prototype, 'command', this._getV4PatchCommandPromise()); - return moduleExports; - }, - v4UnpatchConnection: (moduleExports) => { - if (moduleExports === undefined) - return; - this._unwrap(moduleExports.Connection.prototype, 'command'); - }, - }; - } - /** Creates spans for common operations */ - _getV3PatchOperation(operationName) { - const instrumentation = this; - return (original) => { - return function patchedServerCommand(server, ns, ops, options, callback) { - const currentSpan = api_1.trace.getSpan(api_1.context.active()); - const resultHandler = typeof options === 'function' ? options : callback; - if (!currentSpan || - typeof resultHandler !== 'function' || - typeof ops !== 'object') { - if (typeof options === 'function') { - return original.call(this, server, ns, ops, options); - } - else { - return original.call(this, server, ns, ops, options, callback); - } - } - const span = instrumentation.tracer.startSpan(`mongodb.${operationName}`, { - kind: api_1.SpanKind.CLIENT, - }); - instrumentation._populateV3Attributes(span, ns, server, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - ops[0], operationName); - const patchedCallback = instrumentation._patchEnd(span, resultHandler); - // handle when options is the callback to send the correct number of args - if (typeof options === 'function') { - return original.call(this, server, ns, ops, patchedCallback); - } - else { - return original.call(this, server, ns, ops, options, patchedCallback); - } - }; - }; - } - /** Creates spans for command operation */ - _getV3PatchCommand() { - const instrumentation = this; - return (original) => { - return function patchedServerCommand(server, ns, cmd, options, callback) { - const currentSpan = api_1.trace.getSpan(api_1.context.active()); - const resultHandler = typeof options === 'function' ? options : callback; - if (!currentSpan || - typeof resultHandler !== 'function' || - typeof cmd !== 'object') { - if (typeof options === 'function') { - return original.call(this, server, ns, cmd, options); - } - else { - return original.call(this, server, ns, cmd, options, callback); - } - } - const commandType = MongoDBInstrumentation._getCommandType(cmd); - const type = commandType === internal_types_1.MongodbCommandType.UNKNOWN ? 'command' : commandType; - const span = instrumentation.tracer.startSpan(`mongodb.${type}`, { - kind: api_1.SpanKind.CLIENT, - }); - const operation = commandType === internal_types_1.MongodbCommandType.UNKNOWN ? undefined : commandType; - instrumentation._populateV3Attributes(span, ns, server, cmd, operation); - const patchedCallback = instrumentation._patchEnd(span, resultHandler); - // handle when options is the callback to send the correct number of args - if (typeof options === 'function') { - return original.call(this, server, ns, cmd, patchedCallback); - } - else { - return original.call(this, server, ns, cmd, options, patchedCallback); - } - }; - }; - } - /** Creates spans for command operation */ - _getV4PatchCommandCallback() { - const instrumentation = this; - return (original) => { - return function patchedV4ServerCommand(ns, cmd, options, callback) { - const currentSpan = api_1.trace.getSpan(api_1.context.active()); - const resultHandler = callback; - const commandType = Object.keys(cmd)[0]; - if (typeof resultHandler !== 'function' || - typeof cmd !== 'object' || - cmd.ismaster || - cmd.hello) { - return original.call(this, ns, cmd, options, callback); - } - let span = undefined; - if (currentSpan) { - span = instrumentation.tracer.startSpan(`mongodb.${commandType}`, { - kind: api_1.SpanKind.CLIENT, - }); - instrumentation._populateV4Attributes(span, this, ns, cmd, commandType); - } - const patchedCallback = instrumentation._patchEnd(span, resultHandler, this.id, commandType); - return original.call(this, ns, cmd, options, patchedCallback); - }; - }; - } - _getV4PatchCommandPromise() { - const instrumentation = this; - return (original) => { - return function patchedV4ServerCommand(...args) { - const [ns, cmd] = args; - const currentSpan = api_1.trace.getSpan(api_1.context.active()); - const commandType = Object.keys(cmd)[0]; - const resultHandler = () => undefined; - if (typeof cmd !== 'object' || cmd.ismaster || cmd.hello) { - return original.apply(this, args); - } - let span = undefined; - if (currentSpan) { - span = instrumentation.tracer.startSpan(`mongodb.${commandType}`, { - kind: api_1.SpanKind.CLIENT, - }); - instrumentation._populateV4Attributes(span, this, ns, cmd, commandType); - } - const patchedCallback = instrumentation._patchEnd(span, resultHandler, this.id, commandType); - const result = original.apply(this, args); - result.then((res) => patchedCallback(null, res), (err) => patchedCallback(err)); - return result; - }; - }; - } - /** Creates spans for find operation */ - _getV3PatchFind() { - const instrumentation = this; - return (original) => { - return function patchedServerCommand(server, ns, cmd, cursorState, options, callback) { - const currentSpan = api_1.trace.getSpan(api_1.context.active()); - const resultHandler = typeof options === 'function' ? options : callback; - if (!currentSpan || - typeof resultHandler !== 'function' || - typeof cmd !== 'object') { - if (typeof options === 'function') { - return original.call(this, server, ns, cmd, cursorState, options); - } - else { - return original.call(this, server, ns, cmd, cursorState, options, callback); - } - } - const span = instrumentation.tracer.startSpan('mongodb.find', { - kind: api_1.SpanKind.CLIENT, - }); - instrumentation._populateV3Attributes(span, ns, server, cmd, 'find'); - const patchedCallback = instrumentation._patchEnd(span, resultHandler); - // handle when options is the callback to send the correct number of args - if (typeof options === 'function') { - return original.call(this, server, ns, cmd, cursorState, patchedCallback); - } - else { - return original.call(this, server, ns, cmd, cursorState, options, patchedCallback); - } - }; - }; - } - /** Creates spans for find operation */ - _getV3PatchCursor() { - const instrumentation = this; - return (original) => { - return function patchedServerCommand(server, ns, cursorState, batchSize, options, callback) { - const currentSpan = api_1.trace.getSpan(api_1.context.active()); - const resultHandler = typeof options === 'function' ? options : callback; - if (!currentSpan || typeof resultHandler !== 'function') { - if (typeof options === 'function') { - return original.call(this, server, ns, cursorState, batchSize, options); - } - else { - return original.call(this, server, ns, cursorState, batchSize, options, callback); - } - } - const span = instrumentation.tracer.startSpan('mongodb.getMore', { - kind: api_1.SpanKind.CLIENT, - }); - instrumentation._populateV3Attributes(span, ns, server, cursorState.cmd, 'getMore'); - const patchedCallback = instrumentation._patchEnd(span, resultHandler); - // handle when options is the callback to send the correct number of args - if (typeof options === 'function') { - return original.call(this, server, ns, cursorState, batchSize, patchedCallback); - } - else { - return original.call(this, server, ns, cursorState, batchSize, options, patchedCallback); - } - }; - }; - } - /** - * Get the mongodb command type from the object. - * @param command Internal mongodb command object - */ - static _getCommandType(command) { - if (command.createIndexes !== undefined) { - return internal_types_1.MongodbCommandType.CREATE_INDEXES; - } - else if (command.findandmodify !== undefined) { - return internal_types_1.MongodbCommandType.FIND_AND_MODIFY; - } - else if (command.ismaster !== undefined) { - return internal_types_1.MongodbCommandType.IS_MASTER; - } - else if (command.count !== undefined) { - return internal_types_1.MongodbCommandType.COUNT; - } - else if (command.aggregate !== undefined) { - return internal_types_1.MongodbCommandType.AGGREGATE; - } - else { - return internal_types_1.MongodbCommandType.UNKNOWN; - } - } - /** - * Populate span's attributes by fetching related metadata from the context - * @param span span to add attributes to - * @param connectionCtx mongodb internal connection context - * @param ns mongodb namespace - * @param command mongodb internal representation of a command - */ - _populateV4Attributes(span, connectionCtx, ns, command, operation) { - let host, port; - if (connectionCtx) { - const hostParts = typeof connectionCtx.address === 'string' - ? connectionCtx.address.split(':') - : ''; - if (hostParts.length === 2) { - host = hostParts[0]; - port = hostParts[1]; - } - } - // capture parameters within the query as well if enhancedDatabaseReporting is enabled. - let commandObj; - if ((command === null || command === void 0 ? void 0 : command.documents) && command.documents[0]) { - commandObj = command.documents[0]; - } - else if (command === null || command === void 0 ? void 0 : command.cursors) { - commandObj = command.cursors; - } - else { - commandObj = command; - } - this._addAllSpanAttributes(span, ns.db, ns.collection, host, port, commandObj, operation); - } - /** - * Populate span's attributes by fetching related metadata from the context - * @param span span to add attributes to - * @param ns mongodb namespace - * @param topology mongodb internal representation of the network topology - * @param command mongodb internal representation of a command - */ - _populateV3Attributes(span, ns, topology, command, operation) { - var _a, _b, _c, _d, _e, _f, _g, _h; - // add network attributes to determine the remote server - let host; - let port; - if (topology && topology.s) { - host = (_b = (_a = topology.s.options) === null || _a === void 0 ? void 0 : _a.host) !== null && _b !== void 0 ? _b : topology.s.host; - port = (_e = ((_d = (_c = topology.s.options) === null || _c === void 0 ? void 0 : _c.port) !== null && _d !== void 0 ? _d : topology.s.port)) === null || _e === void 0 ? void 0 : _e.toString(); - if (host == null || port == null) { - const address = (_f = topology.description) === null || _f === void 0 ? void 0 : _f.address; - if (address) { - const addressSegments = address.split(':'); - host = addressSegments[0]; - port = addressSegments[1]; - } - } - } - // The namespace is a combination of the database name and the name of the - // collection or index, like so: [database-name].[collection-or-index-name]. - // It could be a string or an instance of MongoDBNamespace, as such we - // always coerce to a string to extract db and collection. - const [dbName, dbCollection] = ns.toString().split('.'); - // capture parameters within the query as well if enhancedDatabaseReporting is enabled. - const commandObj = (_h = (_g = command === null || command === void 0 ? void 0 : command.query) !== null && _g !== void 0 ? _g : command === null || command === void 0 ? void 0 : command.q) !== null && _h !== void 0 ? _h : command; - this._addAllSpanAttributes(span, dbName, dbCollection, host, port, commandObj, operation); - } - _addAllSpanAttributes(span, dbName, dbCollection, host, port, commandObj, operation) { - // add database related attributes - span.setAttributes({ - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_MONGODB, - [semantic_conventions_1.SEMATTRS_DB_NAME]: dbName, - [semantic_conventions_1.SEMATTRS_DB_MONGODB_COLLECTION]: dbCollection, - [semantic_conventions_1.SEMATTRS_DB_OPERATION]: operation, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: `mongodb://${host}:${port}/${dbName}`, - }); - if (host && port) { - span.setAttribute(semantic_conventions_1.SEMATTRS_NET_PEER_NAME, host); - const portNumber = parseInt(port, 10); - if (!isNaN(portNumber)) { - span.setAttribute(semantic_conventions_1.SEMATTRS_NET_PEER_PORT, portNumber); - } - } - if (!commandObj) - return; - const { dbStatementSerializer: configDbStatementSerializer } = this.getConfig(); - const dbStatementSerializer = typeof configDbStatementSerializer === 'function' - ? configDbStatementSerializer - : this._defaultDbStatementSerializer.bind(this); - (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - const query = dbStatementSerializer(commandObj); - span.setAttribute(semantic_conventions_1.SEMATTRS_DB_STATEMENT, query); - }, err => { - if (err) { - this._diag.error('Error running dbStatementSerializer hook', err); - } - }, true); - } - _defaultDbStatementSerializer(commandObj) { - const { enhancedDatabaseReporting } = this.getConfig(); - const resultObj = enhancedDatabaseReporting - ? commandObj - : this._scrubStatement(commandObj); - return JSON.stringify(resultObj); - } - _scrubStatement(value) { - if (Array.isArray(value)) { - return value.map(element => this._scrubStatement(element)); - } - if (typeof value === 'object' && value !== null) { - return Object.fromEntries(Object.entries(value).map(([key, element]) => [ - key, - this._scrubStatement(element), - ])); - } - // A value like string or number, possible contains PII, scrub it - return '?'; - } - /** - * Triggers the response hook in case it is defined. - * @param span The span to add the results to. - * @param result The command result - */ - _handleExecutionResult(span, result) { - const { responseHook } = this.getConfig(); - if (typeof responseHook === 'function') { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - responseHook(span, { data: result }); - }, err => { - if (err) { - this._diag.error('Error running response hook', err); - } - }, true); - } - } - /** - * Ends a created span. - * @param span The created span to end. - * @param resultHandler A callback function. - * @param connectionId: The connection ID of the Command response. - */ - _patchEnd(span, resultHandler, connectionId, commandType) { - // mongodb is using "tick" when calling a callback, this way the context - // in final callback (resultHandler) is lost - const activeContext = api_1.context.active(); - const instrumentation = this; - return function patchedEnd(...args) { - const error = args[0]; - if (span) { - if (error instanceof Error) { - span === null || span === void 0 ? void 0 : span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: error.message, - }); - } - else { - const result = args[1]; - instrumentation._handleExecutionResult(span, result); - } - span.end(); - } - return api_1.context.with(activeContext, () => { - if (commandType === 'endSessions') { - instrumentation._connectionsUsage.add(-1, { - state: 'idle', - 'pool.name': instrumentation._poolName, - }); - } - return resultHandler.apply(this, args); - }); - }; - } - setPoolName(options) { - var _a, _b; - const host = (_a = options.hostAddress) === null || _a === void 0 ? void 0 : _a.host; - const port = (_b = options.hostAddress) === null || _b === void 0 ? void 0 : _b.port; - const database = options.dbName; - const poolName = `mongodb://${host}:${port}/${database}`; - this._poolName = poolName; - } -} -exports.MongoDBInstrumentation = MongoDBInstrumentation; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 55807: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MongodbCommandType = void 0; -var MongodbCommandType; -(function (MongodbCommandType) { - MongodbCommandType["CREATE_INDEXES"] = "createIndexes"; - MongodbCommandType["FIND_AND_MODIFY"] = "findAndModify"; - MongodbCommandType["IS_MASTER"] = "isMaster"; - MongodbCommandType["COUNT"] = "count"; - MongodbCommandType["AGGREGATE"] = "aggregate"; - MongodbCommandType["UNKNOWN"] = "unknown"; -})(MongodbCommandType = exports.MongodbCommandType || (exports.MongodbCommandType = {})); -//# sourceMappingURL=internal-types.js.map - -/***/ }), - -/***/ 68969: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MongodbCommandType = void 0; -var MongodbCommandType; -(function (MongodbCommandType) { - MongodbCommandType["CREATE_INDEXES"] = "createIndexes"; - MongodbCommandType["FIND_AND_MODIFY"] = "findAndModify"; - MongodbCommandType["IS_MASTER"] = "isMaster"; - MongodbCommandType["COUNT"] = "count"; - MongodbCommandType["UNKNOWN"] = "unknown"; -})(MongodbCommandType = exports.MongodbCommandType || (exports.MongodbCommandType = {})); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 39617: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.51.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-mongodb'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 17168: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__exportStar(__nccwpck_require__(12531), exports); -__exportStar(__nccwpck_require__(2734), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 12531: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MongooseInstrumentation = exports._STORED_PARENT_SPAN = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const utils_1 = __nccwpck_require__(82856); -const instrumentation_1 = __nccwpck_require__(65584); -/** @knipignore */ -const version_1 = __nccwpck_require__(942); -const semantic_conventions_1 = __nccwpck_require__(67275); -const contextCaptureFunctionsCommon = [ - 'deleteOne', - 'deleteMany', - 'find', - 'findOne', - 'estimatedDocumentCount', - 'countDocuments', - 'distinct', - 'where', - '$where', - 'findOneAndUpdate', - 'findOneAndDelete', - 'findOneAndReplace', -]; -const contextCaptureFunctions6 = [ - 'remove', - 'count', - 'findOneAndRemove', - ...contextCaptureFunctionsCommon, -]; -const contextCaptureFunctions7 = [ - 'count', - 'findOneAndRemove', - ...contextCaptureFunctionsCommon, -]; -const contextCaptureFunctions8 = [...contextCaptureFunctionsCommon]; -function getContextCaptureFunctions(moduleVersion) { - /* istanbul ignore next */ - if (!moduleVersion) { - return contextCaptureFunctionsCommon; - } - else if (moduleVersion.startsWith('6.') || moduleVersion.startsWith('5.')) { - return contextCaptureFunctions6; - } - else if (moduleVersion.startsWith('7.')) { - return contextCaptureFunctions7; - } - else { - return contextCaptureFunctions8; - } -} -function instrumentRemove(moduleVersion) { - return ((moduleVersion && - (moduleVersion.startsWith('5.') || moduleVersion.startsWith('6.'))) || - false); -} -// when mongoose functions are called, we store the original call context -// and then set it as the parent for the spans created by Query/Aggregate exec() -// calls. this bypass the unlinked spans issue on thenables await operations. -exports._STORED_PARENT_SPAN = Symbol('stored-parent-span'); -class MongooseInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - const module = new instrumentation_1.InstrumentationNodeModuleDefinition('mongoose', ['>=5.9.7 <9'], this.patch.bind(this), this.unpatch.bind(this)); - return module; - } - patch(moduleExports, moduleVersion) { - this._wrap(moduleExports.Model.prototype, 'save', this.patchOnModelMethods('save', moduleVersion)); - // mongoose applies this code on module require: - // Model.prototype.$save = Model.prototype.save; - // which captures the save function before it is patched. - // so we need to apply the same logic after instrumenting the save function. - moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save; - if (instrumentRemove(moduleVersion)) { - this._wrap(moduleExports.Model.prototype, 'remove', this.patchOnModelMethods('remove', moduleVersion)); - } - this._wrap(moduleExports.Query.prototype, 'exec', this.patchQueryExec(moduleVersion)); - this._wrap(moduleExports.Aggregate.prototype, 'exec', this.patchAggregateExec(moduleVersion)); - const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion); - contextCaptureFunctions.forEach((funcName) => { - this._wrap(moduleExports.Query.prototype, funcName, this.patchAndCaptureSpanContext(funcName)); - }); - this._wrap(moduleExports.Model, 'aggregate', this.patchModelAggregate()); - return moduleExports; - } - unpatch(moduleExports, moduleVersion) { - const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion); - this._unwrap(moduleExports.Model.prototype, 'save'); - // revert the patch for $save which we applied by aliasing it to patched `save` - moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save; - if (instrumentRemove(moduleVersion)) { - this._unwrap(moduleExports.Model.prototype, 'remove'); - } - this._unwrap(moduleExports.Query.prototype, 'exec'); - this._unwrap(moduleExports.Aggregate.prototype, 'exec'); - contextCaptureFunctions.forEach((funcName) => { - this._unwrap(moduleExports.Query.prototype, funcName); - }); - this._unwrap(moduleExports.Model, 'aggregate'); - } - patchAggregateExec(moduleVersion) { - const self = this; - return (originalAggregate) => { - return function exec(callback) { - var _a; - if (self.getConfig().requireParentSpan && - api_1.trace.getSpan(api_1.context.active()) === undefined) { - return originalAggregate.apply(this, arguments); - } - const parentSpan = this[exports._STORED_PARENT_SPAN]; - const attributes = {}; - const { dbStatementSerializer } = self.getConfig(); - if (dbStatementSerializer) { - attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = dbStatementSerializer('aggregate', { - options: this.options, - aggregatePipeline: this._pipeline, - }); - } - const span = self._startSpan(this._model.collection, (_a = this._model) === null || _a === void 0 ? void 0 : _a.modelName, 'aggregate', attributes, parentSpan); - return self._handleResponse(span, originalAggregate, this, arguments, callback, moduleVersion); - }; - }; - } - patchQueryExec(moduleVersion) { - const self = this; - return (originalExec) => { - return function exec(callback) { - if (self.getConfig().requireParentSpan && - api_1.trace.getSpan(api_1.context.active()) === undefined) { - return originalExec.apply(this, arguments); - } - const parentSpan = this[exports._STORED_PARENT_SPAN]; - const attributes = {}; - const { dbStatementSerializer } = self.getConfig(); - if (dbStatementSerializer) { - attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = dbStatementSerializer(this.op, { - condition: this._conditions, - updates: this._update, - options: this.options, - fields: this._fields, - }); - } - const span = self._startSpan(this.mongooseCollection, this.model.modelName, this.op, attributes, parentSpan); - return self._handleResponse(span, originalExec, this, arguments, callback, moduleVersion); - }; - }; - } - patchOnModelMethods(op, moduleVersion) { - const self = this; - return (originalOnModelFunction) => { - return function method(options, callback) { - if (self.getConfig().requireParentSpan && - api_1.trace.getSpan(api_1.context.active()) === undefined) { - return originalOnModelFunction.apply(this, arguments); - } - const serializePayload = { document: this }; - if (options && !(options instanceof Function)) { - serializePayload.options = options; - } - const attributes = {}; - const { dbStatementSerializer } = self.getConfig(); - if (dbStatementSerializer) { - attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = dbStatementSerializer(op, serializePayload); - } - const span = self._startSpan(this.constructor.collection, this.constructor.modelName, op, attributes); - if (options instanceof Function) { - callback = options; - options = undefined; - } - return self._handleResponse(span, originalOnModelFunction, this, arguments, callback, moduleVersion); - }; - }; - } - // we want to capture the otel span on the object which is calling exec. - // in the special case of aggregate, we need have no function to path - // on the Aggregate object to capture the context on, so we patch - // the aggregate of Model, and set the context on the Aggregate object - patchModelAggregate() { - const self = this; - return (original) => { - return function captureSpanContext() { - const currentSpan = api_1.trace.getSpan(api_1.context.active()); - const aggregate = self._callOriginalFunction(() => original.apply(this, arguments)); - if (aggregate) - aggregate[exports._STORED_PARENT_SPAN] = currentSpan; - return aggregate; - }; - }; - } - patchAndCaptureSpanContext(funcName) { - const self = this; - return (original) => { - return function captureSpanContext() { - this[exports._STORED_PARENT_SPAN] = api_1.trace.getSpan(api_1.context.active()); - return self._callOriginalFunction(() => original.apply(this, arguments)); - }; - }; - } - _startSpan(collection, modelName, operation, attributes, parentSpan) { - return this.tracer.startSpan(`mongoose.${modelName}.${operation}`, { - kind: api_1.SpanKind.CLIENT, - attributes: Object.assign(Object.assign(Object.assign({}, attributes), (0, utils_1.getAttributesFromCollection)(collection)), { [semantic_conventions_1.SEMATTRS_DB_OPERATION]: operation, [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: 'mongoose' }), - }, parentSpan ? api_1.trace.setSpan(api_1.context.active(), parentSpan) : undefined); - } - _handleResponse(span, exec, originalThis, args, callback, moduleVersion = undefined) { - const self = this; - if (callback instanceof Function) { - return self._callOriginalFunction(() => (0, utils_1.handleCallbackResponse)(callback, exec, originalThis, span, args, self.getConfig().responseHook, moduleVersion)); - } - else { - const response = self._callOriginalFunction(() => exec.apply(originalThis, args)); - return (0, utils_1.handlePromiseResponse)(response, span, self.getConfig().responseHook, moduleVersion); - } - } - _callOriginalFunction(originalFunction) { - if (this.getConfig().suppressInternalInstrumentation) { - return api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), originalFunction); - } - else { - return originalFunction(); - } - } -} -exports.MongooseInstrumentation = MongooseInstrumentation; -//# sourceMappingURL=mongoose.js.map - -/***/ }), - -/***/ 2734: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 82856: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.handleCallbackResponse = exports.handlePromiseResponse = exports.getAttributesFromCollection = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -function getAttributesFromCollection(collection) { - return { - [semantic_conventions_1.SEMATTRS_DB_MONGODB_COLLECTION]: collection.name, - [semantic_conventions_1.SEMATTRS_DB_NAME]: collection.conn.name, - [semantic_conventions_1.SEMATTRS_DB_USER]: collection.conn.user, - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: collection.conn.host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: collection.conn.port, - }; -} -exports.getAttributesFromCollection = getAttributesFromCollection; -function setErrorStatus(span, error = {}) { - span.recordException(error); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: `${error.message} ${error.code ? `\nMongoose Error Code: ${error.code}` : ''}`, - }); -} -function applyResponseHook(span, response, responseHook, moduleVersion = undefined) { - if (!responseHook) { - return; - } - (0, instrumentation_1.safeExecuteInTheMiddle)(() => responseHook(span, { moduleVersion, response }), e => { - if (e) { - api_1.diag.error('mongoose instrumentation: responseHook error', e); - } - }, true); -} -function handlePromiseResponse(execResponse, span, responseHook, moduleVersion = undefined) { - if (!(execResponse instanceof Promise)) { - applyResponseHook(span, execResponse, responseHook, moduleVersion); - span.end(); - return execResponse; - } - return execResponse - .then(response => { - applyResponseHook(span, response, responseHook, moduleVersion); - return response; - }) - .catch(err => { - setErrorStatus(span, err); - throw err; - }) - .finally(() => span.end()); -} -exports.handlePromiseResponse = handlePromiseResponse; -function handleCallbackResponse(callback, exec, originalThis, span, args, responseHook, moduleVersion = undefined) { - let callbackArgumentIndex = 0; - if (args.length === 2) { - callbackArgumentIndex = 1; - } - args[callbackArgumentIndex] = (err, response) => { - err - ? setErrorStatus(span, err) - : applyResponseHook(span, response, responseHook, moduleVersion); - span.end(); - return callback(err, response); - }; - return exec.apply(originalThis, args); -} -exports.handleCallbackResponse = handleCallbackResponse; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 942: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.46.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-mongoose'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 68110: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AttributeNames = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -// Mysql specific attributes not covered by semantic conventions -var AttributeNames; -(function (AttributeNames) { - AttributeNames["MYSQL_VALUES"] = "db.mysql.values"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 80144: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(82407), exports); -__exportStar(__nccwpck_require__(92101), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 82407: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MySQLInstrumentation = void 0; -const api_1 = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const AttributeNames_1 = __nccwpck_require__(68110); -const utils_1 = __nccwpck_require__(55621); -/** @knipignore */ -const version_1 = __nccwpck_require__(58592); -class MySQLInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - this._setMetricInstruments(); - } - setMeterProvider(meterProvider) { - super.setMeterProvider(meterProvider); - this._setMetricInstruments(); - } - _setMetricInstruments() { - this._connectionsUsage = this.meter.createUpDownCounter('db.client.connections.usage', //TODO:: use semantic convention - { - description: 'The number of connections that are currently in state described by the state attribute.', - unit: '{connection}', - }); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('mysql', ['>=2.0.0 <3'], (moduleExports) => { - if ((0, instrumentation_1.isWrapped)(moduleExports.createConnection)) { - this._unwrap(moduleExports, 'createConnection'); - } - this._wrap(moduleExports, 'createConnection', this._patchCreateConnection()); - if ((0, instrumentation_1.isWrapped)(moduleExports.createPool)) { - this._unwrap(moduleExports, 'createPool'); - } - this._wrap(moduleExports, 'createPool', this._patchCreatePool()); - if ((0, instrumentation_1.isWrapped)(moduleExports.createPoolCluster)) { - this._unwrap(moduleExports, 'createPoolCluster'); - } - this._wrap(moduleExports, 'createPoolCluster', this._patchCreatePoolCluster()); - return moduleExports; - }, (moduleExports) => { - if (moduleExports === undefined) - return; - this._unwrap(moduleExports, 'createConnection'); - this._unwrap(moduleExports, 'createPool'); - this._unwrap(moduleExports, 'createPoolCluster'); - }), - ]; - } - // global export function - _patchCreateConnection() { - return (originalCreateConnection) => { - const thisPlugin = this; - return function createConnection(_connectionUri) { - const originalResult = originalCreateConnection(...arguments); - // This is unwrapped on next call after unpatch - thisPlugin._wrap(originalResult, 'query', thisPlugin._patchQuery(originalResult)); - return originalResult; - }; - }; - } - // global export function - _patchCreatePool() { - return (originalCreatePool) => { - const thisPlugin = this; - return function createPool(_config) { - const pool = originalCreatePool(...arguments); - thisPlugin._wrap(pool, 'query', thisPlugin._patchQuery(pool)); - thisPlugin._wrap(pool, 'getConnection', thisPlugin._patchGetConnection(pool)); - thisPlugin._wrap(pool, 'end', thisPlugin._patchPoolEnd(pool)); - thisPlugin._setPoolcallbacks(pool, thisPlugin, ''); - return pool; - }; - }; - } - _patchPoolEnd(pool) { - return (originalPoolEnd) => { - const thisPlugin = this; - return function end(callback) { - const nAll = pool._allConnections.length; - const nFree = pool._freeConnections.length; - const nUsed = nAll - nFree; - const poolName = (0, utils_1.getPoolName)(pool); - thisPlugin._connectionsUsage.add(-nUsed, { - state: 'used', - name: poolName, - }); - thisPlugin._connectionsUsage.add(-nFree, { - state: 'idle', - name: poolName, - }); - originalPoolEnd.apply(pool, arguments); - }; - }; - } - // global export function - _patchCreatePoolCluster() { - return (originalCreatePoolCluster) => { - const thisPlugin = this; - return function createPool(_config) { - const cluster = originalCreatePoolCluster(...arguments); - // This is unwrapped on next call after unpatch - thisPlugin._wrap(cluster, 'getConnection', thisPlugin._patchGetConnection(cluster)); - thisPlugin._wrap(cluster, 'add', thisPlugin._patchAdd(cluster)); - return cluster; - }; - }; - } - _patchAdd(cluster) { - return (originalAdd) => { - const thisPlugin = this; - return function add(id, config) { - // Unwrap if unpatch has been called - if (!thisPlugin['_enabled']) { - thisPlugin._unwrap(cluster, 'add'); - return originalAdd.apply(cluster, arguments); - } - originalAdd.apply(cluster, arguments); - const nodes = cluster['_nodes']; - if (nodes) { - const nodeId = typeof id === 'object' - ? 'CLUSTER::' + cluster._lastId - : String(id); - const pool = nodes[nodeId].pool; - thisPlugin._setPoolcallbacks(pool, thisPlugin, id); - } - }; - }; - } - // method on cluster or pool - _patchGetConnection(pool) { - return (originalGetConnection) => { - const thisPlugin = this; - return function getConnection(arg1, arg2, arg3) { - // Unwrap if unpatch has been called - if (!thisPlugin['_enabled']) { - thisPlugin._unwrap(pool, 'getConnection'); - return originalGetConnection.apply(pool, arguments); - } - if (arguments.length === 1 && typeof arg1 === 'function') { - const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg1); - return originalGetConnection.call(pool, patchFn); - } - if (arguments.length === 2 && typeof arg2 === 'function') { - const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg2); - return originalGetConnection.call(pool, arg1, patchFn); - } - if (arguments.length === 3 && typeof arg3 === 'function') { - const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg3); - return originalGetConnection.call(pool, arg1, arg2, patchFn); - } - return originalGetConnection.apply(pool, arguments); - }; - }; - } - _getConnectionCallbackPatchFn(cb) { - const thisPlugin = this; - const activeContext = api_1.context.active(); - return function (err, connection) { - if (connection) { - // this is the callback passed into a query - // no need to unwrap - if (!(0, instrumentation_1.isWrapped)(connection.query)) { - thisPlugin._wrap(connection, 'query', thisPlugin._patchQuery(connection)); - } - } - if (typeof cb === 'function') { - api_1.context.with(activeContext, cb, this, err, connection); - } - }; - } - _patchQuery(connection) { - return (originalQuery) => { - const thisPlugin = this; - return function query(query, _valuesOrCallback, _callback) { - if (!thisPlugin['_enabled']) { - thisPlugin._unwrap(connection, 'query'); - return originalQuery.apply(connection, arguments); - } - const span = thisPlugin.tracer.startSpan((0, utils_1.getSpanName)(query), { - kind: api_1.SpanKind.CLIENT, - attributes: Object.assign(Object.assign({}, MySQLInstrumentation.COMMON_ATTRIBUTES), (0, utils_1.getConnectionAttributes)(connection.config)), - }); - span.setAttribute(semantic_conventions_1.SEMATTRS_DB_STATEMENT, (0, utils_1.getDbStatement)(query)); - if (thisPlugin.getConfig().enhancedDatabaseReporting) { - let values; - if (Array.isArray(_valuesOrCallback)) { - values = _valuesOrCallback; - } - else if (arguments[2]) { - values = [_valuesOrCallback]; - } - span.setAttribute(AttributeNames_1.AttributeNames.MYSQL_VALUES, (0, utils_1.getDbValues)(query, values)); - } - const cbIndex = Array.from(arguments).findIndex(arg => typeof arg === 'function'); - const parentContext = api_1.context.active(); - if (cbIndex === -1) { - const streamableQuery = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return originalQuery.apply(connection, arguments); - }); - api_1.context.bind(parentContext, streamableQuery); - return streamableQuery - .on('error', err => span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - })) - .on('end', () => { - span.end(); - }); - } - else { - thisPlugin._wrap(arguments, cbIndex, thisPlugin._patchCallbackQuery(span, parentContext)); - return api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return originalQuery.apply(connection, arguments); - }); - } - }; - }; - } - _patchCallbackQuery(span, parentContext) { - return (originalCallback) => { - return function (err, results, fields) { - if (err) { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - } - span.end(); - return api_1.context.with(parentContext, () => originalCallback(...arguments)); - }; - }; - } - _setPoolcallbacks(pool, thisPlugin, id) { - //TODO:: use semantic convention - const poolName = id || (0, utils_1.getPoolName)(pool); - pool.on('connection', connection => { - thisPlugin._connectionsUsage.add(1, { - state: 'idle', - name: poolName, - }); - }); - pool.on('acquire', connection => { - thisPlugin._connectionsUsage.add(-1, { - state: 'idle', - name: poolName, - }); - thisPlugin._connectionsUsage.add(1, { - state: 'used', - name: poolName, - }); - }); - pool.on('release', connection => { - thisPlugin._connectionsUsage.add(-1, { - state: 'used', - name: poolName, - }); - thisPlugin._connectionsUsage.add(1, { - state: 'idle', - name: poolName, - }); - }); - } -} -exports.MySQLInstrumentation = MySQLInstrumentation; -MySQLInstrumentation.COMMON_ATTRIBUTES = { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_MYSQL, -}; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 92101: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 55621: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getPoolName = exports.arrayStringifyHelper = exports.getSpanName = exports.getDbValues = exports.getDbStatement = exports.getConnectionAttributes = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -/** - * Get an Attributes map from a mysql connection config object - * - * @param config ConnectionConfig - */ -function getConnectionAttributes(config) { - const { host, port, database, user } = getConfig(config); - const portNumber = parseInt(port, 10); - if (!isNaN(portNumber)) { - return { - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: portNumber, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getJDBCString(host, port, database), - [semantic_conventions_1.SEMATTRS_DB_NAME]: database, - [semantic_conventions_1.SEMATTRS_DB_USER]: user, - }; - } - return { - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getJDBCString(host, port, database), - [semantic_conventions_1.SEMATTRS_DB_NAME]: database, - [semantic_conventions_1.SEMATTRS_DB_USER]: user, - }; -} -exports.getConnectionAttributes = getConnectionAttributes; -function getConfig(config) { - const { host, port, database, user } = (config && config.connectionConfig) || config || {}; - return { host, port, database, user }; -} -function getJDBCString(host, port, database) { - let jdbcString = `jdbc:mysql://${host || 'localhost'}`; - if (typeof port === 'number') { - jdbcString += `:${port}`; - } - if (typeof database === 'string') { - jdbcString += `/${database}`; - } - return jdbcString; -} -/** - * @returns the database statement being executed. - */ -function getDbStatement(query) { - if (typeof query === 'string') { - return query; - } - else { - return query.sql; - } -} -exports.getDbStatement = getDbStatement; -function getDbValues(query, values) { - if (typeof query === 'string') { - return arrayStringifyHelper(values); - } - else { - // According to https://github.com/mysqljs/mysql#performing-queries - // The values argument will override the values in the option object. - return arrayStringifyHelper(values || query.values); - } -} -exports.getDbValues = getDbValues; -/** - * The span name SHOULD be set to a low cardinality value - * representing the statement executed on the database. - * - * @returns SQL statement without variable arguments or SQL verb - */ -function getSpanName(query) { - const rawQuery = typeof query === 'object' ? query.sql : query; - // Extract the SQL verb - const firstSpace = rawQuery === null || rawQuery === void 0 ? void 0 : rawQuery.indexOf(' '); - if (typeof firstSpace === 'number' && firstSpace !== -1) { - return rawQuery === null || rawQuery === void 0 ? void 0 : rawQuery.substring(0, firstSpace); - } - return rawQuery; -} -exports.getSpanName = getSpanName; -function arrayStringifyHelper(arr) { - if (arr) - return `[${arr.toString()}]`; - return ''; -} -exports.arrayStringifyHelper = arrayStringifyHelper; -function getPoolName(pool) { - const c = pool.config.connectionConfig; - let poolName = ''; - poolName += c.host ? `host: '${c.host}', ` : ''; - poolName += c.port ? `port: ${c.port}, ` : ''; - poolName += c.database ? `database: '${c.database}', ` : ''; - poolName += c.user ? `user: '${c.user}'` : ''; - if (!c.user) { - poolName = poolName.substring(0, poolName.length - 2); //omit last comma - } - return poolName.trim(); -} -exports.getPoolName = getPoolName; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 58592: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.45.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-mysql'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 79651: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(48126), exports); -__exportStar(__nccwpck_require__(97119), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 48126: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MySQL2Instrumentation = void 0; -const api = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const sql_common_1 = __nccwpck_require__(58156); -const utils_1 = __nccwpck_require__(66655); -/** @knipignore */ -const version_1 = __nccwpck_require__(51750); -class MySQL2Instrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition('mysql2', ['>=1.4.2 <4'], (moduleExports) => { - const ConnectionPrototype = (0, utils_1.getConnectionPrototypeToInstrument)(moduleExports.Connection); - if ((0, instrumentation_1.isWrapped)(ConnectionPrototype.query)) { - this._unwrap(ConnectionPrototype, 'query'); - } - this._wrap(ConnectionPrototype, 'query', this._patchQuery(moduleExports.format, false)); - if ((0, instrumentation_1.isWrapped)(ConnectionPrototype.execute)) { - this._unwrap(ConnectionPrototype, 'execute'); - } - this._wrap(ConnectionPrototype, 'execute', this._patchQuery(moduleExports.format, true)); - return moduleExports; - }, (moduleExports) => { - if (moduleExports === undefined) - return; - const ConnectionPrototype = moduleExports.Connection.prototype; - this._unwrap(ConnectionPrototype, 'query'); - this._unwrap(ConnectionPrototype, 'execute'); - }), - ]; - } - _patchQuery(format, isPrepared) { - return (originalQuery) => { - const thisPlugin = this; - return function query(query, _valuesOrCallback, _callback) { - let values; - if (Array.isArray(_valuesOrCallback)) { - values = _valuesOrCallback; - } - else if (arguments[2]) { - values = [_valuesOrCallback]; - } - const span = thisPlugin.tracer.startSpan((0, utils_1.getSpanName)(query), { - kind: api.SpanKind.CLIENT, - attributes: Object.assign(Object.assign(Object.assign({}, MySQL2Instrumentation.COMMON_ATTRIBUTES), (0, utils_1.getConnectionAttributes)(this.config)), { [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: (0, utils_1.getDbStatement)(query, format, values) }), - }); - if (!isPrepared && - thisPlugin.getConfig().addSqlCommenterCommentToQueries) { - arguments[0] = query = - typeof query === 'string' - ? (0, sql_common_1.addSqlCommenterComment)(span, query) - : Object.assign(query, { - sql: (0, sql_common_1.addSqlCommenterComment)(span, query.sql), - }); - } - const endSpan = (0, utils_1.once)((err, results) => { - if (err) { - span.setStatus({ - code: api.SpanStatusCode.ERROR, - message: err.message, - }); - } - else { - const { responseHook } = thisPlugin.getConfig(); - if (typeof responseHook === 'function') { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - responseHook(span, { - queryResults: results, - }); - }, err => { - if (err) { - thisPlugin._diag.warn('Failed executing responseHook', err); - } - }, true); - } - } - span.end(); - }); - if (arguments.length === 1) { - if (typeof query.onResult === 'function') { - thisPlugin._wrap(query, 'onResult', thisPlugin._patchCallbackQuery(endSpan)); - } - const streamableQuery = originalQuery.apply(this, arguments); - // `end` in mysql behaves similarly to `result` in mysql2. - streamableQuery - .once('error', err => { - endSpan(err); - }) - .once('result', results => { - endSpan(undefined, results); - }); - return streamableQuery; - } - if (typeof arguments[1] === 'function') { - thisPlugin._wrap(arguments, 1, thisPlugin._patchCallbackQuery(endSpan)); - } - else if (typeof arguments[2] === 'function') { - thisPlugin._wrap(arguments, 2, thisPlugin._patchCallbackQuery(endSpan)); - } - return originalQuery.apply(this, arguments); - }; - }; - } - _patchCallbackQuery(endSpan) { - return (originalCallback) => { - return function (err, results, fields) { - endSpan(err, results); - return originalCallback(...arguments); - }; - }; - } -} -exports.MySQL2Instrumentation = MySQL2Instrumentation; -MySQL2Instrumentation.COMMON_ATTRIBUTES = { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_MYSQL, -}; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 97119: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 66655: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getConnectionPrototypeToInstrument = exports.once = exports.getSpanName = exports.getDbStatement = exports.getConnectionAttributes = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -/** - * Get an Attributes map from a mysql connection config object - * - * @param config ConnectionConfig - */ -function getConnectionAttributes(config) { - const { host, port, database, user } = getConfig(config); - const portNumber = parseInt(port, 10); - if (!isNaN(portNumber)) { - return { - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: portNumber, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getJDBCString(host, port, database), - [semantic_conventions_1.SEMATTRS_DB_NAME]: database, - [semantic_conventions_1.SEMATTRS_DB_USER]: user, - }; - } - return { - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: host, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getJDBCString(host, port, database), - [semantic_conventions_1.SEMATTRS_DB_NAME]: database, - [semantic_conventions_1.SEMATTRS_DB_USER]: user, - }; -} -exports.getConnectionAttributes = getConnectionAttributes; -function getConfig(config) { - const { host, port, database, user } = (config && config.connectionConfig) || config || {}; - return { host, port, database, user }; -} -function getJDBCString(host, port, database) { - let jdbcString = `jdbc:mysql://${host || 'localhost'}`; - if (typeof port === 'number') { - jdbcString += `:${port}`; - } - if (typeof database === 'string') { - jdbcString += `/${database}`; - } - return jdbcString; -} -/** - * Conjures up the value for the db.statement attribute by formatting a SQL query. - * - * @returns the database statement being executed. - */ -function getDbStatement(query, format, values) { - if (typeof query === 'string') { - return values ? format(query, values) : query; - } - else { - // According to https://github.com/mysqljs/mysql#performing-queries - // The values argument will override the values in the option object. - return values || query.values - ? format(query.sql, values || query.values) - : query.sql; - } -} -exports.getDbStatement = getDbStatement; -/** - * The span name SHOULD be set to a low cardinality value - * representing the statement executed on the database. - * - * @returns SQL statement without variable arguments or SQL verb - */ -function getSpanName(query) { - const rawQuery = typeof query === 'object' ? query.sql : query; - // Extract the SQL verb - const firstSpace = rawQuery === null || rawQuery === void 0 ? void 0 : rawQuery.indexOf(' '); - if (typeof firstSpace === 'number' && firstSpace !== -1) { - return rawQuery === null || rawQuery === void 0 ? void 0 : rawQuery.substring(0, firstSpace); - } - return rawQuery; -} -exports.getSpanName = getSpanName; -const once = (fn) => { - let called = false; - return (...args) => { - if (called) - return; - called = true; - return fn(...args); - }; -}; -exports.once = once; -function getConnectionPrototypeToInstrument(connection) { - const connectionPrototype = connection.prototype; - const basePrototype = Object.getPrototypeOf(connectionPrototype); - // mysql2@3.11.5 included a refactoring, where most code was moved out of the `Connection` class and into a shared base - // so we need to instrument that instead, see https://github.com/sidorares/node-mysql2/pull/3081 - // This checks if the functions we're instrumenting are there on the base - we cannot use the presence of a base - // prototype since EventEmitter is the base for mysql2@<=3.11.4 - if (typeof (basePrototype === null || basePrototype === void 0 ? void 0 : basePrototype.query) === 'function' && - typeof (basePrototype === null || basePrototype === void 0 ? void 0 : basePrototype.execute) === 'function') { - return basePrototype; - } - // otherwise instrument the connection directly. - return connectionPrototype; -} -exports.getConnectionPrototypeToInstrument = getConnectionPrototypeToInstrument; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 51750: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.45.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-mysql2'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 1290: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AttributeNames = void 0; -var AttributeNames; -(function (AttributeNames) { - AttributeNames["VERSION"] = "nestjs.version"; - AttributeNames["TYPE"] = "nestjs.type"; - AttributeNames["MODULE"] = "nestjs.module"; - AttributeNames["CONTROLLER"] = "nestjs.controller"; - AttributeNames["CALLBACK"] = "nestjs.callback"; - AttributeNames["PIPES"] = "nestjs.pipes"; - AttributeNames["INTERCEPTORS"] = "nestjs.interceptors"; - AttributeNames["GUARDS"] = "nestjs.guards"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 6179: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NestType = void 0; -var NestType; -(function (NestType) { - NestType["APP_CREATION"] = "app_creation"; - NestType["REQUEST_CONTEXT"] = "request_context"; - NestType["REQUEST_HANDLER"] = "handler"; -})(NestType = exports.NestType || (exports.NestType = {})); -//# sourceMappingURL=NestType.js.map - -/***/ }), - -/***/ 65843: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NestType = exports.AttributeNames = void 0; -var AttributeNames_1 = __nccwpck_require__(1290); -Object.defineProperty(exports, "AttributeNames", ({ enumerable: true, get: function () { return AttributeNames_1.AttributeNames; } })); -var NestType_1 = __nccwpck_require__(6179); -Object.defineProperty(exports, "NestType", ({ enumerable: true, get: function () { return NestType_1.NestType; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 81551: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(57590), exports); -__exportStar(__nccwpck_require__(1290), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 57590: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NestInstrumentation = void 0; -const api = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -/** @knipignore */ -const version_1 = __nccwpck_require__(73365); -const semantic_conventions_1 = __nccwpck_require__(67275); -const enums_1 = __nccwpck_require__(65843); -const supportedVersions = ['>=4.0.0 <11']; -class NestInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - const module = new instrumentation_1.InstrumentationNodeModuleDefinition(NestInstrumentation.COMPONENT, supportedVersions); - module.files.push(this.getNestFactoryFileInstrumentation(supportedVersions), this.getRouterExecutionContextFileInstrumentation(supportedVersions)); - return module; - } - getNestFactoryFileInstrumentation(versions) { - return new instrumentation_1.InstrumentationNodeModuleFile('@nestjs/core/nest-factory.js', versions, (NestFactoryStatic, moduleVersion) => { - this.ensureWrapped(NestFactoryStatic.NestFactoryStatic.prototype, 'create', createWrapNestFactoryCreate(this.tracer, moduleVersion)); - return NestFactoryStatic; - }, (NestFactoryStatic) => { - this._unwrap(NestFactoryStatic.NestFactoryStatic.prototype, 'create'); - }); - } - getRouterExecutionContextFileInstrumentation(versions) { - return new instrumentation_1.InstrumentationNodeModuleFile('@nestjs/core/router/router-execution-context.js', versions, (RouterExecutionContext, moduleVersion) => { - this.ensureWrapped(RouterExecutionContext.RouterExecutionContext.prototype, 'create', createWrapCreateHandler(this.tracer, moduleVersion)); - return RouterExecutionContext; - }, (RouterExecutionContext) => { - this._unwrap(RouterExecutionContext.RouterExecutionContext.prototype, 'create'); - }); - } - ensureWrapped(obj, methodName, wrapper) { - if ((0, instrumentation_1.isWrapped)(obj[methodName])) { - this._unwrap(obj, methodName); - } - this._wrap(obj, methodName, wrapper); - } -} -exports.NestInstrumentation = NestInstrumentation; -NestInstrumentation.COMPONENT = '@nestjs/core'; -NestInstrumentation.COMMON_ATTRIBUTES = { - component: NestInstrumentation.COMPONENT, -}; -function createWrapNestFactoryCreate(tracer, moduleVersion) { - return function wrapCreate(original) { - return function createWithTrace(nestModule - /* serverOrOptions */ - ) { - const span = tracer.startSpan('Create Nest App', { - attributes: Object.assign(Object.assign({}, NestInstrumentation.COMMON_ATTRIBUTES), { [enums_1.AttributeNames.TYPE]: enums_1.NestType.APP_CREATION, [enums_1.AttributeNames.VERSION]: moduleVersion, [enums_1.AttributeNames.MODULE]: nestModule.name }), - }); - const spanContext = api.trace.setSpan(api.context.active(), span); - return api.context.with(spanContext, async () => { - try { - return await original.apply(this, arguments); - } - catch (e) { - throw addError(span, e); - } - finally { - span.end(); - } - }); - }; - }; -} -function createWrapCreateHandler(tracer, moduleVersion) { - return function wrapCreateHandler(original) { - return function createHandlerWithTrace(instance, callback) { - arguments[1] = createWrapHandler(tracer, moduleVersion, callback); - const handler = original.apply(this, arguments); - const callbackName = callback.name; - const instanceName = instance.constructor && instance.constructor.name - ? instance.constructor.name - : 'UnnamedInstance'; - const spanName = callbackName - ? `${instanceName}.${callbackName}` - : instanceName; - return function (req, res, next) { - var _a, _b; - const span = tracer.startSpan(spanName, { - attributes: Object.assign(Object.assign({}, NestInstrumentation.COMMON_ATTRIBUTES), { [enums_1.AttributeNames.VERSION]: moduleVersion, [enums_1.AttributeNames.TYPE]: enums_1.NestType.REQUEST_CONTEXT, [semantic_conventions_1.SEMATTRS_HTTP_METHOD]: req.method, [semantic_conventions_1.SEMATTRS_HTTP_URL]: req.originalUrl || req.url, [semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: ((_a = req.route) === null || _a === void 0 ? void 0 : _a.path) || ((_b = req.routeOptions) === null || _b === void 0 ? void 0 : _b.url) || req.routerPath, [enums_1.AttributeNames.CONTROLLER]: instanceName, [enums_1.AttributeNames.CALLBACK]: callbackName }), - }); - const spanContext = api.trace.setSpan(api.context.active(), span); - return api.context.with(spanContext, async () => { - try { - return await handler.apply(this, arguments); - } - catch (e) { - throw addError(span, e); - } - finally { - span.end(); - } - }); - }; - }; - }; -} -function createWrapHandler(tracer, moduleVersion, handler) { - const spanName = handler.name || 'anonymous nest handler'; - const options = { - attributes: Object.assign(Object.assign({}, NestInstrumentation.COMMON_ATTRIBUTES), { [enums_1.AttributeNames.VERSION]: moduleVersion, [enums_1.AttributeNames.TYPE]: enums_1.NestType.REQUEST_HANDLER, [enums_1.AttributeNames.CALLBACK]: handler.name }), - }; - const wrappedHandler = function () { - const span = tracer.startSpan(spanName, options); - const spanContext = api.trace.setSpan(api.context.active(), span); - return api.context.with(spanContext, async () => { - try { - return await handler.apply(this, arguments); - } - catch (e) { - throw addError(span, e); - } - finally { - span.end(); - } - }); - }; - if (handler.name) { - Object.defineProperty(wrappedHandler, 'name', { value: handler.name }); - } - // Get the current metadata and set onto the wrapper to ensure other decorators ( ie: NestJS EventPattern / RolesGuard ) - // won't be affected by the use of this instrumentation - Reflect.getMetadataKeys(handler).forEach(metadataKey => { - Reflect.defineMetadata(metadataKey, Reflect.getMetadata(metadataKey, handler), wrappedHandler); - }); - return wrappedHandler; -} -const addError = (span, error) => { - span.recordException(error); - span.setStatus({ code: api.SpanStatusCode.ERROR, message: error.message }); - return error; -}; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 73365: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.44.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-nestjs-core'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 31692: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AttributeNames = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -// Postgresql specific attributes not covered by semantic conventions -var AttributeNames; -(function (AttributeNames) { - AttributeNames["PG_VALUES"] = "db.postgresql.values"; - AttributeNames["PG_PLAN"] = "db.postgresql.plan"; - AttributeNames["IDLE_TIMEOUT_MILLIS"] = "db.postgresql.idle.timeout.millis"; - AttributeNames["MAX_CLIENT"] = "db.postgresql.max.client"; -})(AttributeNames = exports.AttributeNames || (exports.AttributeNames = {})); -//# sourceMappingURL=AttributeNames.js.map - -/***/ }), - -/***/ 40104: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanNames = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -// Contains span names produced by instrumentation -var SpanNames; -(function (SpanNames) { - SpanNames["QUERY_PREFIX"] = "pg.query"; - SpanNames["CONNECT"] = "pg.connect"; - SpanNames["POOL_CONNECT"] = "pg-pool.connect"; -})(SpanNames = exports.SpanNames || (exports.SpanNames = {})); -//# sourceMappingURL=SpanNames.js.map - -/***/ }), - -/***/ 31758: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(33800), exports); -__exportStar(__nccwpck_require__(23808), exports); -__exportStar(__nccwpck_require__(31692), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 33800: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PgInstrumentation = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const instrumentation_1 = __nccwpck_require__(65584); -const api_1 = __nccwpck_require__(65163); -const internal_types_1 = __nccwpck_require__(62205); -const utils = __nccwpck_require__(95782); -const sql_common_1 = __nccwpck_require__(58156); -/** @knipignore */ -const version_1 = __nccwpck_require__(20331); -const SpanNames_1 = __nccwpck_require__(40104); -const core_1 = __nccwpck_require__(89736); -const semantic_conventions_1 = __nccwpck_require__(32736); -const incubating_1 = __nccwpck_require__(65849); -class PgInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - // Pool events connect, acquire, release and remove can be called - // multiple times without changing the values of total, idle and waiting - // connections. The _connectionsCounter is used to keep track of latest - // values and only update the metrics _connectionsCount and _connectionPendingRequests - // when the value change. - this._connectionsCounter = { - used: 0, - idle: 0, - pending: 0, - }; - } - _updateMetricInstruments() { - this._operationDuration = this.meter.createHistogram(incubating_1.METRIC_DB_CLIENT_OPERATION_DURATION, { - description: 'Duration of database client operations.', - unit: 's', - valueType: api_1.ValueType.DOUBLE, - advice: { - explicitBucketBoundaries: [ - 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10, - ], - }, - }); - this._connectionsCounter = { - idle: 0, - pending: 0, - used: 0, - }; - this._connectionsCount = this.meter.createUpDownCounter(incubating_1.METRIC_DB_CLIENT_CONNECTION_COUNT, { - description: 'The number of connections that are currently in state described by the state attribute.', - unit: '{connection}', - }); - this._connectionPendingRequests = this.meter.createUpDownCounter(incubating_1.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS, { - description: 'The number of current pending requests for an open connection.', - unit: '{connection}', - }); - } - init() { - const modulePG = new instrumentation_1.InstrumentationNodeModuleDefinition('pg', ['>=8.0.3 <9'], (module) => { - const moduleExports = module[Symbol.toStringTag] === 'Module' - ? module.default // ESM - : module; // CommonJS - if ((0, instrumentation_1.isWrapped)(moduleExports.Client.prototype.query)) { - this._unwrap(moduleExports.Client.prototype, 'query'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports.Client.prototype.connect)) { - this._unwrap(moduleExports.Client.prototype, 'connect'); - } - this._wrap(moduleExports.Client.prototype, 'query', this._getClientQueryPatch()); - this._wrap(moduleExports.Client.prototype, 'connect', this._getClientConnectPatch()); - return module; - }, (module) => { - const moduleExports = module[Symbol.toStringTag] === 'Module' - ? module.default // ESM - : module; // CommonJS - if ((0, instrumentation_1.isWrapped)(moduleExports.Client.prototype.query)) { - this._unwrap(moduleExports.Client.prototype, 'query'); - } - }); - const modulePGPool = new instrumentation_1.InstrumentationNodeModuleDefinition('pg-pool', ['>=2.0.0 <4'], (moduleExports) => { - if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.connect)) { - this._unwrap(moduleExports.prototype, 'connect'); - } - this._wrap(moduleExports.prototype, 'connect', this._getPoolConnectPatch()); - return moduleExports; - }, (moduleExports) => { - if ((0, instrumentation_1.isWrapped)(moduleExports.prototype.connect)) { - this._unwrap(moduleExports.prototype, 'connect'); - } - }); - return [modulePG, modulePGPool]; - } - _getClientConnectPatch() { - const plugin = this; - return (original) => { - return function connect(callback) { - if (utils.shouldSkipInstrumentation(plugin.getConfig())) { - return original.call(this, callback); - } - const span = plugin.tracer.startSpan(SpanNames_1.SpanNames.CONNECT, { - kind: api_1.SpanKind.CLIENT, - attributes: utils.getSemanticAttributesFromConnection(this), - }); - if (callback) { - const parentSpan = api_1.trace.getSpan(api_1.context.active()); - callback = utils.patchClientConnectCallback(span, callback); - if (parentSpan) { - callback = api_1.context.bind(api_1.context.active(), callback); - } - } - const connectResult = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return original.call(this, callback); - }); - return handleConnectResult(span, connectResult); - }; - }; - } - recordOperationDuration(attributes, startTime) { - const metricsAttributes = {}; - const keysToCopy = [ - semantic_conventions_1.SEMATTRS_DB_SYSTEM, - incubating_1.ATTR_DB_NAMESPACE, - semantic_conventions_1.ATTR_ERROR_TYPE, - semantic_conventions_1.ATTR_SERVER_PORT, - semantic_conventions_1.ATTR_SERVER_ADDRESS, - incubating_1.ATTR_DB_OPERATION_NAME, - ]; - keysToCopy.forEach(key => { - if (key in attributes) { - metricsAttributes[key] = attributes[key]; - } - }); - const durationSeconds = (0, core_1.hrTimeToMilliseconds)((0, core_1.hrTimeDuration)(startTime, (0, core_1.hrTime)())) / 1000; - this._operationDuration.record(durationSeconds, metricsAttributes); - } - _getClientQueryPatch() { - const plugin = this; - return (original) => { - this._diag.debug('Patching pg.Client.prototype.query'); - return function query(...args) { - if (utils.shouldSkipInstrumentation(plugin.getConfig())) { - return original.apply(this, args); - } - const startTime = (0, core_1.hrTime)(); - // client.query(text, cb?), client.query(text, values, cb?), and - // client.query(configObj, cb?) are all valid signatures. We construct - // a queryConfig obj from all (valid) signatures to build the span in a - // unified way. We verify that we at least have query text, and code - // defensively when dealing with `queryConfig` after that (to handle all - // the other invalid cases, like a non-array for values being provided). - // The type casts here reflect only what we've actually validated. - const arg0 = args[0]; - const firstArgIsString = typeof arg0 === 'string'; - const firstArgIsQueryObjectWithText = utils.isObjectWithTextString(arg0); - // TODO: remove the `as ...` casts below when the TS version is upgraded. - // Newer TS versions will use the result of firstArgIsQueryObjectWithText - // to properly narrow arg0, but TS 4.3.5 does not. - const queryConfig = firstArgIsString - ? { - text: arg0, - values: Array.isArray(args[1]) ? args[1] : undefined, - } - : firstArgIsQueryObjectWithText - ? arg0 - : undefined; - const attributes = { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_POSTGRESQL, - [incubating_1.ATTR_DB_NAMESPACE]: this.database, - [semantic_conventions_1.ATTR_SERVER_PORT]: this.connectionParameters.port, - [semantic_conventions_1.ATTR_SERVER_ADDRESS]: this.connectionParameters.host, - }; - if (queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.text) { - attributes[incubating_1.ATTR_DB_OPERATION_NAME] = - utils.parseNormalizedOperationName(queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.text); - } - const recordDuration = () => { - plugin.recordOperationDuration(attributes, startTime); - }; - const instrumentationConfig = plugin.getConfig(); - const span = utils.handleConfigQuery.call(this, plugin.tracer, instrumentationConfig, queryConfig); - // Modify query text w/ a tracing comment before invoking original for - // tracing, but only if args[0] has one of our expected shapes. - if (instrumentationConfig.addSqlCommenterCommentToQueries) { - if (firstArgIsString) { - args[0] = (0, sql_common_1.addSqlCommenterComment)(span, arg0); - } - else if (firstArgIsQueryObjectWithText && !('name' in arg0)) { - // In the case of a query object, we need to ensure there's no name field - // as this indicates a prepared query, where the comment would remain the same - // for every invocation and contain an outdated trace context. - args[0] = Object.assign(Object.assign({}, arg0), { text: (0, sql_common_1.addSqlCommenterComment)(span, arg0.text) }); - } - } - // Bind callback (if any) to parent span (if any) - if (args.length > 0) { - const parentSpan = api_1.trace.getSpan(api_1.context.active()); - if (typeof args[args.length - 1] === 'function') { - // Patch ParameterQuery callback - args[args.length - 1] = utils.patchCallback(instrumentationConfig, span, args[args.length - 1], // nb: not type safe. - attributes, recordDuration); - // If a parent span exists, bind the callback - if (parentSpan) { - args[args.length - 1] = api_1.context.bind(api_1.context.active(), args[args.length - 1]); - } - } - else if (typeof (queryConfig === null || queryConfig === void 0 ? void 0 : queryConfig.callback) === 'function') { - // Patch ConfigQuery callback - let callback = utils.patchCallback(plugin.getConfig(), span, queryConfig.callback, // nb: not type safe. - attributes, recordDuration); - // If a parent span existed, bind the callback - if (parentSpan) { - callback = api_1.context.bind(api_1.context.active(), callback); - } - args[0].callback = callback; - } - } - const { requestHook } = instrumentationConfig; - if (typeof requestHook === 'function' && queryConfig) { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - // pick keys to expose explicitly, so we're not leaking pg package - // internals that are subject to change - const { database, host, port, user } = this.connectionParameters; - const connection = { database, host, port, user }; - requestHook(span, { - connection, - query: { - text: queryConfig.text, - // nb: if `client.query` is called with illegal arguments - // (e.g., if `queryConfig.values` is passed explicitly, but a - // non-array is given), then the type casts will be wrong. But - // we leave it up to the queryHook to handle that, and we - // catch and swallow any errors it throws. The other options - // are all worse. E.g., we could leave `queryConfig.values` - // and `queryConfig.name` as `unknown`, but then the hook body - // would be forced to validate (or cast) them before using - // them, which seems incredibly cumbersome given that these - // casts will be correct 99.9% of the time -- and pg.query - // will immediately throw during development in the other .1% - // of cases. Alternatively, we could simply skip calling the - // hook when `values` or `name` don't have the expected type, - // but that would add unnecessary validation overhead to every - // hook invocation and possibly be even more confusing/unexpected. - values: queryConfig.values, - name: queryConfig.name, - }, - }); - }, err => { - if (err) { - plugin._diag.error('Error running query hook', err); - } - }, true); - } - let result; - try { - result = original.apply(this, args); - } - catch (e) { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: utils.getErrorMessage(e), - }); - span.end(); - throw e; - } - // Bind promise to parent span and end the span - if (result instanceof Promise) { - return result - .then((result) => { - // Return a pass-along promise which ends the span and then goes to user's orig resolvers - return new Promise(resolve => { - utils.handleExecutionResult(plugin.getConfig(), span, result); - recordDuration(); - span.end(); - resolve(result); - }); - }) - .catch((error) => { - return new Promise((_, reject) => { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: error.message, - }); - recordDuration(); - span.end(); - reject(error); - }); - }); - } - // else returns void - return result; // void - }; - }; - } - _setPoolConnectEventListeners(pgPool) { - if (pgPool[internal_types_1.EVENT_LISTENERS_SET]) - return; - const poolName = utils.getPoolName(pgPool.options); - pgPool.on('connect', () => { - this._connectionsCounter = utils.updateCounter(poolName, pgPool, this._connectionsCount, this._connectionPendingRequests, this._connectionsCounter); - }); - pgPool.on('acquire', () => { - this._connectionsCounter = utils.updateCounter(poolName, pgPool, this._connectionsCount, this._connectionPendingRequests, this._connectionsCounter); - }); - pgPool.on('remove', () => { - this._connectionsCounter = utils.updateCounter(poolName, pgPool, this._connectionsCount, this._connectionPendingRequests, this._connectionsCounter); - }); - pgPool.on('release', () => { - this._connectionsCounter = utils.updateCounter(poolName, pgPool, this._connectionsCount, this._connectionPendingRequests, this._connectionsCounter); - }); - pgPool[internal_types_1.EVENT_LISTENERS_SET] = true; - } - _getPoolConnectPatch() { - const plugin = this; - return (originalConnect) => { - return function connect(callback) { - if (utils.shouldSkipInstrumentation(plugin.getConfig())) { - return originalConnect.call(this, callback); - } - // setup span - const span = plugin.tracer.startSpan(SpanNames_1.SpanNames.POOL_CONNECT, { - kind: api_1.SpanKind.CLIENT, - attributes: utils.getSemanticAttributesFromPool(this.options), - }); - plugin._setPoolConnectEventListeners(this); - if (callback) { - const parentSpan = api_1.trace.getSpan(api_1.context.active()); - callback = utils.patchCallbackPGPool(span, callback); - // If a parent span exists, bind the callback - if (parentSpan) { - callback = api_1.context.bind(api_1.context.active(), callback); - } - } - const connectResult = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return originalConnect.call(this, callback); - }); - return handleConnectResult(span, connectResult); - }; - }; - } -} -exports.PgInstrumentation = PgInstrumentation; -function handleConnectResult(span, connectResult) { - if (!(connectResult instanceof Promise)) { - return connectResult; - } - const connectResultPromise = connectResult; - return api_1.context.bind(api_1.context.active(), connectResultPromise - .then(result => { - span.end(); - return result; - }) - .catch((error) => { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: utils.getErrorMessage(error), - }); - span.end(); - return Promise.reject(error); - })); -} -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 62205: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EVENT_LISTENERS_SET = void 0; -exports.EVENT_LISTENERS_SET = Symbol('opentelemetry.instrumentation.pg.eventListenersSet'); -//# sourceMappingURL=internal-types.js.map - -/***/ }), - -/***/ 23808: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 95782: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isObjectWithTextString = exports.getErrorMessage = exports.patchClientConnectCallback = exports.patchCallbackPGPool = exports.updateCounter = exports.getPoolName = exports.patchCallback = exports.handleExecutionResult = exports.handleConfigQuery = exports.shouldSkipInstrumentation = exports.getSemanticAttributesFromPool = exports.getSemanticAttributesFromConnection = exports.getConnectionString = exports.parseNormalizedOperationName = exports.getQuerySpanName = void 0; -const api_1 = __nccwpck_require__(65163); -const AttributeNames_1 = __nccwpck_require__(31692); -const semantic_conventions_1 = __nccwpck_require__(32736); -const incubating_1 = __nccwpck_require__(65849); -const instrumentation_1 = __nccwpck_require__(65584); -const SpanNames_1 = __nccwpck_require__(40104); -/** - * Helper function to get a low cardinality span name from whatever info we have - * about the query. - * - * This is tricky, because we don't have most of the information (table name, - * operation name, etc) the spec recommends using to build a low-cardinality - * value w/o parsing. So, we use db.name and assume that, if the query's a named - * prepared statement, those `name` values will be low cardinality. If we don't - * have a named prepared statement, we try to parse an operation (despite the - * spec's warnings). - * - * @params dbName The name of the db against which this query is being issued, - * which could be missing if no db name was given at the time that the - * connection was established. - * @params queryConfig Information we have about the query being issued, typed - * to reflect only the validation we've actually done on the args to - * `client.query()`. This will be undefined if `client.query()` was called - * with invalid arguments. - */ -function getQuerySpanName(dbName, queryConfig) { - // NB: when the query config is invalid, we omit the dbName too, so that - // someone (or some tool) reading the span name doesn't misinterpret the - // dbName as being a prepared statement or sql commit name. - if (!queryConfig) - return SpanNames_1.SpanNames.QUERY_PREFIX; - // Either the name of a prepared statement; or an attempted parse - // of the SQL command, normalized to uppercase; or unknown. - const command = typeof queryConfig.name === 'string' && queryConfig.name - ? queryConfig.name - : parseNormalizedOperationName(queryConfig.text); - return `${SpanNames_1.SpanNames.QUERY_PREFIX}:${command}${dbName ? ` ${dbName}` : ''}`; -} -exports.getQuerySpanName = getQuerySpanName; -function parseNormalizedOperationName(queryText) { - const indexOfFirstSpace = queryText.indexOf(' '); - let sqlCommand = indexOfFirstSpace === -1 - ? queryText - : queryText.slice(0, indexOfFirstSpace); - sqlCommand = sqlCommand.toUpperCase(); - // Handle query text being "COMMIT;", which has an extra semicolon before the space. - return sqlCommand.endsWith(';') ? sqlCommand.slice(0, -1) : sqlCommand; -} -exports.parseNormalizedOperationName = parseNormalizedOperationName; -function getConnectionString(params) { - const host = params.host || 'localhost'; - const port = params.port || 5432; - const database = params.database || ''; - return `postgresql://${host}:${port}/${database}`; -} -exports.getConnectionString = getConnectionString; -function getPort(port) { - // Port may be NaN as parseInt() is used on the value, passing null will result in NaN being parsed. - // https://github.com/brianc/node-postgres/blob/2a8efbee09a284be12748ed3962bc9b816965e36/packages/pg/lib/connection-parameters.js#L66 - if (Number.isInteger(port)) { - return port; - } - // Unable to find the default used in pg code, so falling back to 'undefined'. - return undefined; -} -function getSemanticAttributesFromConnection(params) { - return { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_POSTGRESQL, - [semantic_conventions_1.SEMATTRS_DB_NAME]: params.database, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getConnectionString(params), - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: params.host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: getPort(params.port), - [semantic_conventions_1.SEMATTRS_DB_USER]: params.user, - }; -} -exports.getSemanticAttributesFromConnection = getSemanticAttributesFromConnection; -function getSemanticAttributesFromPool(params) { - return { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_POSTGRESQL, - [semantic_conventions_1.SEMATTRS_DB_NAME]: params.database, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: getConnectionString(params), - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: params.host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: getPort(params.port), - [semantic_conventions_1.SEMATTRS_DB_USER]: params.user, - [AttributeNames_1.AttributeNames.IDLE_TIMEOUT_MILLIS]: params.idleTimeoutMillis, - [AttributeNames_1.AttributeNames.MAX_CLIENT]: params.maxClient, - }; -} -exports.getSemanticAttributesFromPool = getSemanticAttributesFromPool; -function shouldSkipInstrumentation(instrumentationConfig) { - return (instrumentationConfig.requireParentSpan === true && - api_1.trace.getSpan(api_1.context.active()) === undefined); -} -exports.shouldSkipInstrumentation = shouldSkipInstrumentation; -// Create a span from our normalized queryConfig object, -// or return a basic span if no queryConfig was given/could be created. -function handleConfigQuery(tracer, instrumentationConfig, queryConfig) { - // Create child span. - const { connectionParameters } = this; - const dbName = connectionParameters.database; - const spanName = getQuerySpanName(dbName, queryConfig); - const span = tracer.startSpan(spanName, { - kind: api_1.SpanKind.CLIENT, - attributes: getSemanticAttributesFromConnection(connectionParameters), - }); - if (!queryConfig) { - return span; - } - // Set attributes - if (queryConfig.text) { - span.setAttribute(semantic_conventions_1.SEMATTRS_DB_STATEMENT, queryConfig.text); - } - if (instrumentationConfig.enhancedDatabaseReporting && - Array.isArray(queryConfig.values)) { - try { - const convertedValues = queryConfig.values.map(value => { - if (value == null) { - return 'null'; - } - else if (value instanceof Buffer) { - return value.toString(); - } - else if (typeof value === 'object') { - if (typeof value.toPostgres === 'function') { - return value.toPostgres(); - } - return JSON.stringify(value); - } - else { - //string, number - return value.toString(); - } - }); - span.setAttribute(AttributeNames_1.AttributeNames.PG_VALUES, convertedValues); - } - catch (e) { - api_1.diag.error('failed to stringify ', queryConfig.values, e); - } - } - // Set plan name attribute, if present - if (typeof queryConfig.name === 'string') { - span.setAttribute(AttributeNames_1.AttributeNames.PG_PLAN, queryConfig.name); - } - return span; -} -exports.handleConfigQuery = handleConfigQuery; -function handleExecutionResult(config, span, pgResult) { - if (typeof config.responseHook === 'function') { - (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - config.responseHook(span, { - data: pgResult, - }); - }, err => { - if (err) { - api_1.diag.error('Error running response hook', err); - } - }, true); - } -} -exports.handleExecutionResult = handleExecutionResult; -function patchCallback(instrumentationConfig, span, cb, attributes, recordDuration) { - return function patchedCallback(err, res) { - if (err) { - if (Object.prototype.hasOwnProperty.call(err, 'code')) { - attributes[semantic_conventions_1.ATTR_ERROR_TYPE] = err['code']; - } - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - } - else { - handleExecutionResult(instrumentationConfig, span, res); - } - recordDuration(); - span.end(); - cb.call(this, err, res); - }; -} -exports.patchCallback = patchCallback; -function getPoolName(pool) { - let poolName = ''; - poolName += ((pool === null || pool === void 0 ? void 0 : pool.host) ? `${pool.host}` : 'unknown_host') + ':'; - poolName += ((pool === null || pool === void 0 ? void 0 : pool.port) ? `${pool.port}` : 'unknown_port') + '/'; - poolName += (pool === null || pool === void 0 ? void 0 : pool.database) ? `${pool.database}` : 'unknown_database'; - return poolName.trim(); -} -exports.getPoolName = getPoolName; -function updateCounter(poolName, pool, connectionCount, connectionPendingRequests, latestCounter) { - const all = pool.totalCount; - const pending = pool.waitingCount; - const idle = pool.idleCount; - const used = all - idle; - connectionCount.add(used - latestCounter.used, { - [incubating_1.ATTR_DB_CLIENT_CONNECTION_STATE]: incubating_1.DB_CLIENT_CONNECTION_STATE_VALUE_USED, - [incubating_1.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName, - }); - connectionCount.add(idle - latestCounter.idle, { - [incubating_1.ATTR_DB_CLIENT_CONNECTION_STATE]: incubating_1.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE, - [incubating_1.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName, - }); - connectionPendingRequests.add(pending - latestCounter.pending, { - [incubating_1.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName, - }); - return { used: used, idle: idle, pending: pending }; -} -exports.updateCounter = updateCounter; -function patchCallbackPGPool(span, cb) { - return function patchedCallback(err, res, done) { - if (err) { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - } - span.end(); - cb.call(this, err, res, done); - }; -} -exports.patchCallbackPGPool = patchCallbackPGPool; -function patchClientConnectCallback(span, cb) { - return function patchedClientConnectCallback(err) { - if (err) { - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: err.message, - }); - } - span.end(); - cb.apply(this, arguments); - }; -} -exports.patchClientConnectCallback = patchClientConnectCallback; -/** - * Attempt to get a message string from a thrown value, while being quite - * defensive, to recognize the fact that, in JS, any kind of value (even - * primitives) can be thrown. - */ -function getErrorMessage(e) { - return typeof e === 'object' && e !== null && 'message' in e - ? String(e.message) - : undefined; -} -exports.getErrorMessage = getErrorMessage; -function isObjectWithTextString(it) { - var _a; - return (typeof it === 'object' && - typeof ((_a = it) === null || _a === void 0 ? void 0 : _a.text) === 'string'); -} -exports.isObjectWithTextString = isObjectWithTextString; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 20331: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.50.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-pg'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 86219: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ATTR_AWS_REQUEST_ID = exports.ATTR_AWS_LOG_STREAM_NAMES = exports.ATTR_AWS_LOG_STREAM_ARNS = exports.ATTR_AWS_LOG_GROUP_NAMES = exports.ATTR_AWS_LOG_GROUP_ARNS = exports.ATTR_AWS_LAMBDA_INVOKED_ARN = exports.ATTR_AWS_EKS_CLUSTER_ARN = exports.ATTR_AWS_ECS_TASK_REVISION = exports.ATTR_AWS_ECS_TASK_FAMILY = exports.ATTR_AWS_ECS_TASK_ARN = exports.AWS_ECS_LAUNCHTYPE_VALUE_FARGATE = exports.AWS_ECS_LAUNCHTYPE_VALUE_EC2 = exports.ATTR_AWS_ECS_LAUNCHTYPE = exports.ATTR_AWS_ECS_CONTAINER_ARN = exports.ATTR_AWS_ECS_CLUSTER_ARN = exports.ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS = exports.ATTR_AWS_DYNAMODB_TABLE_NAMES = exports.ATTR_AWS_DYNAMODB_TABLE_COUNT = exports.ATTR_AWS_DYNAMODB_SELECT = exports.ATTR_AWS_DYNAMODB_SEGMENT = exports.ATTR_AWS_DYNAMODB_SCANNED_COUNT = exports.ATTR_AWS_DYNAMODB_SCAN_FORWARD = exports.ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = exports.ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = exports.ATTR_AWS_DYNAMODB_PROJECTION = exports.ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = exports.ATTR_AWS_DYNAMODB_LIMIT = exports.ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = exports.ATTR_AWS_DYNAMODB_INDEX_NAME = exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = exports.ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = exports.ATTR_AWS_DYNAMODB_COUNT = exports.ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY = exports.ATTR_AWS_DYNAMODB_CONSISTENT_READ = exports.ATTR_AWS_DYNAMODB_ATTRIBUTES_TO_GET = exports.ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = exports.ATTR_ARTIFACT_VERSION = exports.ATTR_ARTIFACT_PURL = exports.ATTR_ARTIFACT_HASH = exports.ATTR_ARTIFACT_FILENAME = exports.ATTR_ARTIFACT_ATTESTATION_ID = exports.ATTR_ARTIFACT_ATTESTATION_HASH = exports.ATTR_ARTIFACT_ATTESTATION_FILENAME = exports.ANDROID_STATE_VALUE_FOREGROUND = exports.ANDROID_STATE_VALUE_CREATED = exports.ANDROID_STATE_VALUE_BACKGROUND = exports.ATTR_ANDROID_STATE = exports.ATTR_ANDROID_OS_API_LEVEL = exports.ATTR_AWS_ECS_TASK_ID = void 0; -exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_EKS = exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_CVM = exports.CLOUD_PLATFORM_VALUE_IBM_CLOUD_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_GCP_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE = exports.CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE = exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN = exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS = exports.CLOUD_PLATFORM_VALUE_GCP_BARE_METAL_SOLUTION = exports.CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE = exports.CLOUD_PLATFORM_VALUE_AZURE_VM = exports.CLOUD_PLATFORM_VALUE_AZURE_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS = exports.CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_INSTANCES = exports.CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_APPS = exports.CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE = exports.CLOUD_PLATFORM_VALUE_AZURE_AKS = exports.CLOUD_PLATFORM_VALUE_AWS_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_AWS_LAMBDA = exports.CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK = exports.CLOUD_PLATFORM_VALUE_AWS_EKS = exports.CLOUD_PLATFORM_VALUE_AWS_ECS = exports.CLOUD_PLATFORM_VALUE_AWS_EC2 = exports.CLOUD_PLATFORM_VALUE_AWS_APP_RUNNER = exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_OPENSHIFT = exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_FC = exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS = exports.ATTR_CLOUD_PLATFORM = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = exports.CICD_PIPELINE_TASK_TYPE_VALUE_TEST = exports.CICD_PIPELINE_TASK_TYPE_VALUE_DEPLOY = exports.CICD_PIPELINE_TASK_TYPE_VALUE_BUILD = exports.ATTR_CICD_PIPELINE_TASK_TYPE = exports.ATTR_CICD_PIPELINE_TASK_RUN_URL_FULL = exports.ATTR_CICD_PIPELINE_TASK_RUN_ID = exports.ATTR_CICD_PIPELINE_TASK_NAME = exports.ATTR_CICD_PIPELINE_RUN_ID = exports.ATTR_CICD_PIPELINE_NAME = exports.ATTR_BROWSER_PLATFORM = exports.ATTR_BROWSER_MOBILE = exports.ATTR_BROWSER_LANGUAGE = exports.ATTR_BROWSER_BRANDS = exports.ATTR_AZ_SERVICE_REQUEST_ID = exports.ATTR_AWS_S3_UPLOAD_ID = exports.ATTR_AWS_S3_PART_NUMBER = exports.ATTR_AWS_S3_KEY = exports.ATTR_AWS_S3_DELETE = exports.ATTR_AWS_S3_COPY_SOURCE = exports.ATTR_AWS_S3_BUCKET = void 0; -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ANY = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ALL = exports.ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL = exports.CPU_MODE_VALUE_USER = exports.CPU_MODE_VALUE_SYSTEM = exports.CPU_MODE_VALUE_STEAL = exports.CPU_MODE_VALUE_NICE = exports.CPU_MODE_VALUE_KERNEL = exports.CPU_MODE_VALUE_IOWAIT = exports.CPU_MODE_VALUE_INTERRUPT = exports.CPU_MODE_VALUE_IDLE = exports.ATTR_CPU_MODE = exports.ATTR_CONTAINER_RUNTIME = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_LABELS = exports.ATTR_CONTAINER_LABEL = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_REPO_DIGESTS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_IMAGE_ID = exports.ATTR_CONTAINER_ID = exports.CONTAINER_CPU_STATE_VALUE_USER = exports.CONTAINER_CPU_STATE_VALUE_SYSTEM = exports.CONTAINER_CPU_STATE_VALUE_KERNEL = exports.ATTR_CONTAINER_CPU_STATE = exports.ATTR_CONTAINER_COMMAND_LINE = exports.ATTR_CONTAINER_COMMAND_ARGS = exports.ATTR_CONTAINER_COMMAND = exports.ATTR_CODE_STACKTRACE = exports.ATTR_CODE_NAMESPACE = exports.ATTR_CODE_LINENO = exports.ATTR_CODE_FUNCTION = exports.ATTR_CODE_FILEPATH = exports.ATTR_CODE_COLUMN = exports.ATTR_CLOUDEVENTS_EVENT_TYPE = exports.ATTR_CLOUDEVENTS_EVENT_SUBJECT = exports.ATTR_CLOUDEVENTS_EVENT_SPEC_VERSION = exports.ATTR_CLOUDEVENTS_EVENT_SOURCE = exports.ATTR_CLOUDEVENTS_EVENT_ID = exports.ATTR_CLOUD_RESOURCE_ID = exports.ATTR_CLOUD_REGION = exports.CLOUD_PROVIDER_VALUE_TENCENT_CLOUD = exports.CLOUD_PROVIDER_VALUE_IBM_CLOUD = exports.CLOUD_PROVIDER_VALUE_HEROKU = exports.CLOUD_PROVIDER_VALUE_GCP = exports.CLOUD_PROVIDER_VALUE_AZURE = exports.CLOUD_PROVIDER_VALUE_AWS = exports.CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = exports.ATTR_CLOUD_PROVIDER = exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_SCF = void 0; -exports.ATTR_DB_COSMOSDB_SUB_STATUS_CODE = exports.ATTR_DB_COSMOSDB_STATUS_CODE = exports.ATTR_DB_COSMOSDB_REQUEST_CONTENT_LENGTH = exports.ATTR_DB_COSMOSDB_REQUEST_CHARGE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_UPSERT = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_REPLACE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_READ_FEED = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_READ = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY_PLAN = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_PATCH = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_INVALID = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD_FEED = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE_JAVASCRIPT = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_DELETE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_CREATE = exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = exports.ATTR_DB_COSMOSDB_OPERATION_TYPE = exports.ATTR_DB_COSMOSDB_CONTAINER = exports.DB_COSMOSDB_CONNECTION_MODE_VALUE_GATEWAY = exports.DB_COSMOSDB_CONNECTION_MODE_VALUE_DIRECT = exports.ATTR_DB_COSMOSDB_CONNECTION_MODE = exports.ATTR_DB_COSMOSDB_CLIENT_ID = exports.ATTR_DB_CONNECTION_STRING = exports.ATTR_DB_COLLECTION_NAME = exports.DB_CLIENT_CONNECTIONS_STATE_VALUE_USED = exports.DB_CLIENT_CONNECTIONS_STATE_VALUE_IDLE = exports.ATTR_DB_CLIENT_CONNECTIONS_STATE = exports.ATTR_DB_CLIENT_CONNECTIONS_POOL_NAME = exports.DB_CLIENT_CONNECTION_STATE_VALUE_USED = exports.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE = exports.ATTR_DB_CLIENT_CONNECTION_STATE = exports.ATTR_DB_CLIENT_CONNECTION_POOL_NAME = exports.ATTR_DB_CASSANDRA_TABLE = exports.ATTR_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = exports.ATTR_DB_CASSANDRA_PAGE_SIZE = exports.ATTR_DB_CASSANDRA_IDEMPOTENCE = exports.ATTR_DB_CASSANDRA_COORDINATOR_ID = exports.ATTR_DB_CASSANDRA_COORDINATOR_DC = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_TWO = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_THREE = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_SERIAL = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_QUORUM = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ONE = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_SERIAL = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_QUORUM = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_ONE = exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_EACH_QUORUM = void 0; -exports.DB_SYSTEM_VALUE_MAXDB = exports.DB_SYSTEM_VALUE_MARIADB = exports.DB_SYSTEM_VALUE_INTERSYSTEMS_CACHE = exports.DB_SYSTEM_VALUE_INTERBASE = exports.DB_SYSTEM_VALUE_INSTANTDB = exports.DB_SYSTEM_VALUE_INGRES = exports.DB_SYSTEM_VALUE_INFORMIX = exports.DB_SYSTEM_VALUE_INFLUXDB = exports.DB_SYSTEM_VALUE_HSQLDB = exports.DB_SYSTEM_VALUE_HIVE = exports.DB_SYSTEM_VALUE_HBASE = exports.DB_SYSTEM_VALUE_HANADB = exports.DB_SYSTEM_VALUE_H2 = exports.DB_SYSTEM_VALUE_GEODE = exports.DB_SYSTEM_VALUE_FIRSTSQL = exports.DB_SYSTEM_VALUE_FIREBIRD = exports.DB_SYSTEM_VALUE_FILEMAKER = exports.DB_SYSTEM_VALUE_ELASTICSEARCH = exports.DB_SYSTEM_VALUE_EDB = exports.DB_SYSTEM_VALUE_DYNAMODB = exports.DB_SYSTEM_VALUE_DERBY = exports.DB_SYSTEM_VALUE_DB2 = exports.DB_SYSTEM_VALUE_COUCHDB = exports.DB_SYSTEM_VALUE_COUCHBASE = exports.DB_SYSTEM_VALUE_COSMOSDB = exports.DB_SYSTEM_VALUE_COLDFUSION = exports.DB_SYSTEM_VALUE_COCKROACHDB = exports.DB_SYSTEM_VALUE_CLOUDSCAPE = exports.DB_SYSTEM_VALUE_CLICKHOUSE = exports.DB_SYSTEM_VALUE_CASSANDRA = exports.DB_SYSTEM_VALUE_CACHE = exports.DB_SYSTEM_VALUE_ADABAS = exports.ATTR_DB_SYSTEM = exports.ATTR_DB_STATEMENT = exports.ATTR_DB_SQL_TABLE = exports.ATTR_DB_REDIS_DATABASE_INDEX = exports.ATTR_DB_QUERY_TEXT = exports.ATTR_DB_QUERY_PARAMETER = exports.ATTR_DB_OPERATION_NAME = exports.ATTR_DB_OPERATION_BATCH_SIZE = exports.ATTR_DB_OPERATION = exports.ATTR_DB_NAMESPACE = exports.ATTR_DB_NAME = exports.ATTR_DB_MSSQL_INSTANCE_NAME = exports.ATTR_DB_MONGODB_COLLECTION = exports.ATTR_DB_JDBC_DRIVER_CLASSNAME = exports.ATTR_DB_INSTANCE_ID = exports.ATTR_DB_ELASTICSEARCH_PATH_PARTS = exports.ATTR_DB_ELASTICSEARCH_NODE_NAME = exports.ATTR_DB_ELASTICSEARCH_CLUSTER_NAME = void 0; -exports.FAAS_DOCUMENT_OPERATION_VALUE_DELETE = exports.ATTR_FAAS_DOCUMENT_OPERATION = exports.ATTR_FAAS_DOCUMENT_NAME = exports.ATTR_FAAS_DOCUMENT_COLLECTION = exports.ATTR_FAAS_CRON = exports.ATTR_FAAS_COLDSTART = exports.ATTR_EVENT_NAME = exports.ATTR_ENDUSER_SCOPE = exports.ATTR_ENDUSER_ROLE = exports.ATTR_ENDUSER_ID = exports.ATTR_DNS_QUESTION_NAME = exports.DISK_IO_DIRECTION_VALUE_WRITE = exports.DISK_IO_DIRECTION_VALUE_READ = exports.ATTR_DISK_IO_DIRECTION = exports.ATTR_DEVICE_MODEL_NAME = exports.ATTR_DEVICE_MODEL_IDENTIFIER = exports.ATTR_DEVICE_MANUFACTURER = exports.ATTR_DEVICE_ID = exports.ATTR_DESTINATION_PORT = exports.ATTR_DESTINATION_ADDRESS = exports.DEPLOYMENT_STATUS_VALUE_SUCCEEDED = exports.DEPLOYMENT_STATUS_VALUE_FAILED = exports.ATTR_DEPLOYMENT_STATUS = exports.ATTR_DEPLOYMENT_NAME = exports.ATTR_DEPLOYMENT_ID = exports.ATTR_DEPLOYMENT_ENVIRONMENT_NAME = exports.ATTR_DEPLOYMENT_ENVIRONMENT = exports.ATTR_DB_USER = exports.DB_SYSTEM_VALUE_VERTICA = exports.DB_SYSTEM_VALUE_TRINO = exports.DB_SYSTEM_VALUE_TERADATA = exports.DB_SYSTEM_VALUE_SYBASE = exports.DB_SYSTEM_VALUE_SQLITE = exports.DB_SYSTEM_VALUE_SPANNER = exports.DB_SYSTEM_VALUE_REDSHIFT = exports.DB_SYSTEM_VALUE_REDIS = exports.DB_SYSTEM_VALUE_PROGRESS = exports.DB_SYSTEM_VALUE_POSTGRESQL = exports.DB_SYSTEM_VALUE_POINTBASE = exports.DB_SYSTEM_VALUE_PERVASIVE = exports.DB_SYSTEM_VALUE_OTHER_SQL = exports.DB_SYSTEM_VALUE_ORACLE = exports.DB_SYSTEM_VALUE_OPENSEARCH = exports.DB_SYSTEM_VALUE_NETEZZA = exports.DB_SYSTEM_VALUE_NEO4J = exports.DB_SYSTEM_VALUE_MYSQL = exports.DB_SYSTEM_VALUE_MSSQLCOMPACT = exports.DB_SYSTEM_VALUE_MSSQL = exports.DB_SYSTEM_VALUE_MONGODB = exports.DB_SYSTEM_VALUE_MEMCACHED = void 0; -exports.ATTR_GEN_AI_RESPONSE_FINISH_REASONS = exports.ATTR_GEN_AI_REQUEST_TOP_P = exports.ATTR_GEN_AI_REQUEST_TOP_K = exports.ATTR_GEN_AI_REQUEST_TEMPERATURE = exports.ATTR_GEN_AI_REQUEST_STOP_SEQUENCES = exports.ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY = exports.ATTR_GEN_AI_REQUEST_MODEL = exports.ATTR_GEN_AI_REQUEST_MAX_TOKENS = exports.ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY = exports.ATTR_GEN_AI_PROMPT = exports.GEN_AI_OPERATION_NAME_VALUE_TEXT_COMPLETION = exports.GEN_AI_OPERATION_NAME_VALUE_CHAT = exports.ATTR_GEN_AI_OPERATION_NAME = exports.ATTR_GEN_AI_COMPLETION = exports.ATTR_GCP_GCE_INSTANCE_NAME = exports.ATTR_GCP_GCE_INSTANCE_HOSTNAME = exports.ATTR_GCP_CLOUD_RUN_JOB_TASK_INDEX = exports.ATTR_GCP_CLOUD_RUN_JOB_EXECUTION = exports.ATTR_GCP_CLIENT_SERVICE = exports.ATTR_FILE_SIZE = exports.ATTR_FILE_PATH = exports.ATTR_FILE_NAME = exports.ATTR_FILE_EXTENSION = exports.ATTR_FILE_DIRECTORY = exports.ATTR_FEATURE_FLAG_VARIANT = exports.ATTR_FEATURE_FLAG_PROVIDER_NAME = exports.ATTR_FEATURE_FLAG_KEY = exports.ATTR_FAAS_VERSION = exports.FAAS_TRIGGER_VALUE_TIMER = exports.FAAS_TRIGGER_VALUE_PUBSUB = exports.FAAS_TRIGGER_VALUE_OTHER = exports.FAAS_TRIGGER_VALUE_HTTP = exports.FAAS_TRIGGER_VALUE_DATASOURCE = exports.ATTR_FAAS_TRIGGER = exports.ATTR_FAAS_TIME = exports.ATTR_FAAS_NAME = exports.ATTR_FAAS_MAX_MEMORY = exports.ATTR_FAAS_INVOKED_REGION = exports.FAAS_INVOKED_PROVIDER_VALUE_TENCENT_CLOUD = exports.FAAS_INVOKED_PROVIDER_VALUE_GCP = exports.FAAS_INVOKED_PROVIDER_VALUE_AZURE = exports.FAAS_INVOKED_PROVIDER_VALUE_AWS = exports.FAAS_INVOKED_PROVIDER_VALUE_ALIBABA_CLOUD = exports.ATTR_FAAS_INVOKED_PROVIDER = exports.ATTR_FAAS_INVOKED_NAME = exports.ATTR_FAAS_INVOCATION_ID = exports.ATTR_FAAS_INSTANCE = exports.ATTR_FAAS_DOCUMENT_TIME = exports.FAAS_DOCUMENT_OPERATION_VALUE_INSERT = exports.FAAS_DOCUMENT_OPERATION_VALUE_EDIT = void 0; -exports.ATTR_HTTP_CLIENT_IP = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_MAC = exports.ATTR_HOST_IP = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_CPU_VENDOR_ID = exports.ATTR_HOST_CPU_STEPPING = exports.ATTR_HOST_CPU_MODEL_NAME = exports.ATTR_HOST_CPU_MODEL_ID = exports.ATTR_HOST_CPU_FAMILY = exports.ATTR_HOST_CPU_CACHE_L2_SIZE = exports.HOST_ARCH_VALUE_X86 = exports.HOST_ARCH_VALUE_S390X = exports.HOST_ARCH_VALUE_PPC64 = exports.HOST_ARCH_VALUE_PPC32 = exports.HOST_ARCH_VALUE_IA64 = exports.HOST_ARCH_VALUE_ARM64 = exports.HOST_ARCH_VALUE_ARM32 = exports.HOST_ARCH_VALUE_AMD64 = exports.ATTR_HOST_ARCH = exports.ATTR_HEROKU_RELEASE_CREATION_TIMESTAMP = exports.ATTR_HEROKU_RELEASE_COMMIT = exports.ATTR_HEROKU_APP_ID = exports.GRAPHQL_OPERATION_TYPE_VALUE_SUBSCRIPTION = exports.GRAPHQL_OPERATION_TYPE_VALUE_QUERY = exports.GRAPHQL_OPERATION_TYPE_VALUE_MUTATION = exports.ATTR_GRAPHQL_OPERATION_TYPE = exports.ATTR_GRAPHQL_OPERATION_NAME = exports.ATTR_GRAPHQL_DOCUMENT = exports.GO_MEMORY_TYPE_VALUE_STACK = exports.GO_MEMORY_TYPE_VALUE_OTHER = exports.ATTR_GO_MEMORY_TYPE = exports.ATTR_GEN_AI_USAGE_PROMPT_TOKENS = exports.ATTR_GEN_AI_USAGE_OUTPUT_TOKENS = exports.ATTR_GEN_AI_USAGE_INPUT_TOKENS = exports.ATTR_GEN_AI_USAGE_COMPLETION_TOKENS = exports.GEN_AI_TOKEN_TYPE_VALUE_COMPLETION = exports.GEN_AI_TOKEN_TYPE_VALUE_INPUT = exports.ATTR_GEN_AI_TOKEN_TYPE = exports.GEN_AI_SYSTEM_VALUE_VERTEX_AI = exports.GEN_AI_SYSTEM_VALUE_OPENAI = exports.GEN_AI_SYSTEM_VALUE_COHERE = exports.GEN_AI_SYSTEM_VALUE_ANTHROPIC = exports.ATTR_GEN_AI_SYSTEM = exports.ATTR_GEN_AI_RESPONSE_MODEL = exports.ATTR_GEN_AI_RESPONSE_ID = void 0; -exports.ATTR_K8S_POD_ANNOTATION = exports.ATTR_K8S_NODE_UID = exports.ATTR_K8S_NODE_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_JOB_UID = exports.ATTR_K8S_JOB_NAME = exports.ATTR_K8S_DEPLOYMENT_UID = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_DAEMONSET_UID = exports.ATTR_K8S_DAEMONSET_NAME = exports.ATTR_K8S_CRONJOB_UID = exports.ATTR_K8S_CRONJOB_NAME = exports.ATTR_K8S_CONTAINER_STATUS_LAST_TERMINATED_REASON = exports.ATTR_K8S_CONTAINER_RESTART_COUNT = exports.ATTR_K8S_CONTAINER_NAME = exports.ATTR_K8S_CLUSTER_UID = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_JVM_BUFFER_POOL_NAME = exports.IOS_STATE_VALUE_TERMINATE = exports.IOS_STATE_VALUE_INACTIVE = exports.IOS_STATE_VALUE_FOREGROUND = exports.IOS_STATE_VALUE_BACKGROUND = exports.IOS_STATE_VALUE_ACTIVE = exports.ATTR_IOS_STATE = exports.ATTR_HTTP_USER_AGENT = exports.ATTR_HTTP_URL = exports.ATTR_HTTP_TARGET = exports.ATTR_HTTP_STATUS_CODE = exports.ATTR_HTTP_SERVER_NAME = exports.ATTR_HTTP_SCHEME = exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH = exports.ATTR_HTTP_RESPONSE_SIZE = exports.ATTR_HTTP_RESPONSE_BODY_SIZE = exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH = exports.ATTR_HTTP_REQUEST_SIZE = exports.ATTR_HTTP_REQUEST_BODY_SIZE = exports.ATTR_HTTP_METHOD = exports.ATTR_HTTP_HOST = exports.HTTP_FLAVOR_VALUE_SPDY = exports.HTTP_FLAVOR_VALUE_QUIC = exports.HTTP_FLAVOR_VALUE_HTTP_3_0 = exports.HTTP_FLAVOR_VALUE_HTTP_2_0 = exports.HTTP_FLAVOR_VALUE_HTTP_1_1 = exports.HTTP_FLAVOR_VALUE_HTTP_1_0 = exports.ATTR_HTTP_FLAVOR = exports.HTTP_CONNECTION_STATE_VALUE_IDLE = exports.HTTP_CONNECTION_STATE_VALUE_ACTIVE = exports.ATTR_HTTP_CONNECTION_STATE = void 0; -exports.ATTR_MESSAGING_MESSAGE_BODY_SIZE = exports.ATTR_MESSAGING_KAFKA_OFFSET = exports.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = exports.ATTR_MESSAGING_KAFKA_MESSAGE_OFFSET = exports.ATTR_MESSAGING_KAFKA_MESSAGE_KEY = exports.ATTR_MESSAGING_KAFKA_DESTINATION_PARTITION = exports.ATTR_MESSAGING_KAFKA_CONSUMER_GROUP = exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_DELIVERY_ATTEMPT = exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ACK_ID = exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ACK_DEADLINE = exports.ATTR_MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = exports.ATTR_MESSAGING_EVENTHUBS_CONSUMER_GROUP = exports.ATTR_MESSAGING_DESTINATION_PUBLISH_NAME = exports.ATTR_MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = exports.ATTR_MESSAGING_DESTINATION_TEMPORARY = exports.ATTR_MESSAGING_DESTINATION_TEMPLATE = exports.ATTR_MESSAGING_DESTINATION_SUBSCRIPTION_NAME = exports.ATTR_MESSAGING_DESTINATION_PARTITION_ID = exports.ATTR_MESSAGING_DESTINATION_NAME = exports.ATTR_MESSAGING_DESTINATION_ANONYMOUS = exports.ATTR_MESSAGING_CONSUMER_GROUP_NAME = exports.ATTR_MESSAGING_CLIENT_ID = exports.ATTR_MESSAGING_BATCH_MESSAGE_COUNT = exports.ATTR_MESSAGE_UNCOMPRESSED_SIZE = exports.MESSAGE_TYPE_VALUE_SENT = exports.MESSAGE_TYPE_VALUE_RECEIVED = exports.ATTR_MESSAGE_TYPE = exports.ATTR_MESSAGE_ID = exports.ATTR_MESSAGE_COMPRESSED_SIZE = exports.ATTR_LOG_RECORD_UID = exports.ATTR_LOG_RECORD_ORIGINAL = exports.LOG_IOSTREAM_VALUE_STDOUT = exports.LOG_IOSTREAM_VALUE_STDERR = exports.ATTR_LOG_IOSTREAM = exports.ATTR_LOG_FILE_PATH_RESOLVED = exports.ATTR_LOG_FILE_PATH = exports.ATTR_LOG_FILE_NAME_RESOLVED = exports.ATTR_LOG_FILE_NAME = exports.LINUX_MEMORY_SLAB_STATE_VALUE_UNRECLAIMABLE = exports.LINUX_MEMORY_SLAB_STATE_VALUE_RECLAIMABLE = exports.ATTR_LINUX_MEMORY_SLAB_STATE = exports.ATTR_K8S_STATEFULSET_UID = exports.ATTR_K8S_STATEFULSET_NAME = exports.ATTR_K8S_REPLICASET_UID = exports.ATTR_K8S_REPLICASET_NAME = exports.ATTR_K8S_POD_UID = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_POD_LABELS = exports.ATTR_K8S_POD_LABEL = void 0; -exports.ATTR_NET_HOST_IP = exports.MESSAGING_SYSTEM_VALUE_SERVICEBUS = exports.MESSAGING_SYSTEM_VALUE_ROCKETMQ = exports.MESSAGING_SYSTEM_VALUE_RABBITMQ = exports.MESSAGING_SYSTEM_VALUE_PULSAR = exports.MESSAGING_SYSTEM_VALUE_KAFKA = exports.MESSAGING_SYSTEM_VALUE_JMS = exports.MESSAGING_SYSTEM_VALUE_GCP_PUBSUB = exports.MESSAGING_SYSTEM_VALUE_EVENTHUBS = exports.MESSAGING_SYSTEM_VALUE_EVENTGRID = exports.MESSAGING_SYSTEM_VALUE_AWS_SQS = exports.MESSAGING_SYSTEM_VALUE_ACTIVEMQ = exports.ATTR_MESSAGING_SYSTEM = exports.ATTR_MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = exports.ATTR_MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_DEFER = exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_DEAD_LETTER = exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_COMPLETE = exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_ABANDON = exports.ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS = exports.ATTR_MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = exports.ATTR_MESSAGING_ROCKETMQ_NAMESPACE = exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_TRANSACTION = exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_NORMAL = exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_FIFO = exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_DELAY = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_TAG = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_KEYS = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_GROUP = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = exports.MESSAGING_ROCKETMQ_CONSUMPTION_MODEL_VALUE_CLUSTERING = exports.MESSAGING_ROCKETMQ_CONSUMPTION_MODEL_VALUE_BROADCASTING = exports.ATTR_MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = exports.ATTR_MESSAGING_ROCKETMQ_CLIENT_GROUP = exports.ATTR_MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = exports.ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = exports.MESSAGING_OPERATION_TYPE_VALUE_SETTLE = exports.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = exports.MESSAGING_OPERATION_TYPE_VALUE_PUBLISH = exports.MESSAGING_OPERATION_TYPE_VALUE_PROCESS = exports.MESSAGING_OPERATION_TYPE_VALUE_DELIVER = exports.MESSAGING_OPERATION_TYPE_VALUE_CREATE = exports.ATTR_MESSAGING_OPERATION_TYPE = exports.ATTR_MESSAGING_OPERATION_NAME = exports.ATTR_MESSAGING_OPERATION = exports.ATTR_MESSAGING_MESSAGE_ID = exports.ATTR_MESSAGING_MESSAGE_ENVELOPE_SIZE = exports.ATTR_MESSAGING_MESSAGE_CONVERSATION_ID = void 0; -exports.NETWORK_CONNECTION_TYPE_VALUE_CELL = exports.ATTR_NETWORK_CONNECTION_TYPE = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_UMTS = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_TD_SCDMA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_NRNSA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_NR = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_LTE_CA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_LTE = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_IWLAN = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_IDEN = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSUPA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSPAP = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSPA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSDPA = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_GSM = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_GPRS = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_B = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_A = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_0 = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EHRPD = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EDGE = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA2000_1XRTT = exports.NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA = exports.ATTR_NETWORK_CONNECTION_SUBTYPE = exports.ATTR_NETWORK_CARRIER_NAME = exports.ATTR_NETWORK_CARRIER_MNC = exports.ATTR_NETWORK_CARRIER_MCC = exports.ATTR_NETWORK_CARRIER_ICC = exports.NET_TRANSPORT_VALUE_PIPE = exports.NET_TRANSPORT_VALUE_OTHER = exports.NET_TRANSPORT_VALUE_IP_UDP = exports.NET_TRANSPORT_VALUE_IP_TCP = exports.NET_TRANSPORT_VALUE_INPROC = exports.ATTR_NET_TRANSPORT = exports.ATTR_NET_SOCK_PEER_PORT = exports.ATTR_NET_SOCK_PEER_NAME = exports.ATTR_NET_SOCK_PEER_ADDR = exports.ATTR_NET_SOCK_HOST_PORT = exports.ATTR_NET_SOCK_HOST_ADDR = exports.NET_SOCK_FAMILY_VALUE_UNIX = exports.NET_SOCK_FAMILY_VALUE_INET6 = exports.NET_SOCK_FAMILY_VALUE_INET = exports.ATTR_NET_SOCK_FAMILY = exports.ATTR_NET_PROTOCOL_VERSION = exports.ATTR_NET_PROTOCOL_NAME = exports.ATTR_NET_PEER_PORT = exports.ATTR_NET_PEER_NAME = exports.ATTR_NET_PEER_IP = exports.ATTR_NET_HOST_PORT = exports.ATTR_NET_HOST_NAME = void 0; -exports.ATTR_PROCESS_PAGING_FAULT_TYPE = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_INTERACTIVE = exports.ATTR_PROCESS_GROUP_LEADER_PID = exports.ATTR_PROCESS_EXIT_TIME = exports.ATTR_PROCESS_EXIT_CODE = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_CREATION_TIME = exports.PROCESS_CPU_STATE_VALUE_WAIT = exports.PROCESS_CPU_STATE_VALUE_USER = exports.PROCESS_CPU_STATE_VALUE_SYSTEM = exports.ATTR_PROCESS_CPU_STATE = exports.PROCESS_CONTEXT_SWITCH_TYPE_VALUE_VOLUNTARY = exports.PROCESS_CONTEXT_SWITCH_TYPE_VALUE_INVOLUNTARY = exports.ATTR_PROCESS_CONTEXT_SWITCH_TYPE = exports.ATTR_PROCESS_COMMAND_LINE = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_POOL_NAME = exports.ATTR_PEER_SERVICE = exports.ATTR_OTEL_LIBRARY_VERSION = exports.ATTR_OTEL_LIBRARY_NAME = exports.ATTR_OS_VERSION = exports.OS_TYPE_VALUE_Z_OS = exports.OS_TYPE_VALUE_WINDOWS = exports.OS_TYPE_VALUE_SOLARIS = exports.OS_TYPE_VALUE_OPENBSD = exports.OS_TYPE_VALUE_NETBSD = exports.OS_TYPE_VALUE_LINUX = exports.OS_TYPE_VALUE_HPUX = exports.OS_TYPE_VALUE_FREEBSD = exports.OS_TYPE_VALUE_DRAGONFLYBSD = exports.OS_TYPE_VALUE_DARWIN = exports.OS_TYPE_VALUE_AIX = exports.ATTR_OS_TYPE = exports.ATTR_OS_NAME = exports.ATTR_OS_DESCRIPTION = exports.ATTR_OS_BUILD_ID = exports.OPENTRACING_REF_TYPE_VALUE_FOLLOWS_FROM = exports.OPENTRACING_REF_TYPE_VALUE_CHILD_OF = exports.ATTR_OPENTRACING_REF_TYPE = exports.ATTR_OCI_MANIFEST_DIGEST = exports.NETWORK_IO_DIRECTION_VALUE_TRANSMIT = exports.NETWORK_IO_DIRECTION_VALUE_RECEIVE = exports.ATTR_NETWORK_IO_DIRECTION = exports.NETWORK_CONNECTION_TYPE_VALUE_WIRED = exports.NETWORK_CONNECTION_TYPE_VALUE_WIFI = exports.NETWORK_CONNECTION_TYPE_VALUE_UNKNOWN = exports.NETWORK_CONNECTION_TYPE_VALUE_UNAVAILABLE = void 0; -exports.RPC_GRPC_STATUS_CODE_VALUE_UNIMPLEMENTED = exports.RPC_GRPC_STATUS_CODE_VALUE_OUT_OF_RANGE = exports.RPC_GRPC_STATUS_CODE_VALUE_ABORTED = exports.RPC_GRPC_STATUS_CODE_VALUE_FAILED_PRECONDITION = exports.RPC_GRPC_STATUS_CODE_VALUE_RESOURCE_EXHAUSTED = exports.RPC_GRPC_STATUS_CODE_VALUE_PERMISSION_DENIED = exports.RPC_GRPC_STATUS_CODE_VALUE_ALREADY_EXISTS = exports.RPC_GRPC_STATUS_CODE_VALUE_NOT_FOUND = exports.RPC_GRPC_STATUS_CODE_VALUE_DEADLINE_EXCEEDED = exports.RPC_GRPC_STATUS_CODE_VALUE_INVALID_ARGUMENT = exports.RPC_GRPC_STATUS_CODE_VALUE_UNKNOWN = exports.RPC_GRPC_STATUS_CODE_VALUE_CANCELLED = exports.RPC_GRPC_STATUS_CODE_VALUE_OK = exports.ATTR_RPC_GRPC_STATUS_CODE = exports.ATTR_RPC_GRPC_RESPONSE_METADATA = exports.ATTR_RPC_GRPC_REQUEST_METADATA = exports.ATTR_RPC_CONNECT_RPC_RESPONSE_METADATA = exports.ATTR_RPC_CONNECT_RPC_REQUEST_METADATA = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNKNOWN = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNIMPLEMENTED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNAVAILABLE = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNAUTHENTICATED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_RESOURCE_EXHAUSTED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_PERMISSION_DENIED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_OUT_OF_RANGE = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_NOT_FOUND = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_INVALID_ARGUMENT = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_INTERNAL = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_FAILED_PRECONDITION = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_DEADLINE_EXCEEDED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_DATA_LOSS = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_CANCELLED = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_ALREADY_EXISTS = exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_ABORTED = exports.ATTR_RPC_CONNECT_RPC_ERROR_CODE = exports.ATTR_PROCESS_VPID = exports.ATTR_PROCESS_USER_NAME = exports.ATTR_PROCESS_USER_ID = exports.ATTR_PROCESS_SESSION_LEADER_PID = exports.ATTR_PROCESS_SAVED_USER_NAME = exports.ATTR_PROCESS_SAVED_USER_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_REAL_USER_NAME = exports.ATTR_PROCESS_REAL_USER_ID = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_PARENT_PID = exports.PROCESS_PAGING_FAULT_TYPE_VALUE_MINOR = exports.PROCESS_PAGING_FAULT_TYPE_VALUE_MAJOR = void 0; -exports.SYSTEM_FILESYSTEM_TYPE_VALUE_EXT4 = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_EXFAT = exports.ATTR_SYSTEM_FILESYSTEM_TYPE = exports.SYSTEM_FILESYSTEM_STATE_VALUE_USED = exports.SYSTEM_FILESYSTEM_STATE_VALUE_RESERVED = exports.SYSTEM_FILESYSTEM_STATE_VALUE_FREE = exports.ATTR_SYSTEM_FILESYSTEM_STATE = exports.ATTR_SYSTEM_FILESYSTEM_MOUNTPOINT = exports.ATTR_SYSTEM_FILESYSTEM_MODE = exports.ATTR_SYSTEM_DEVICE = exports.SYSTEM_CPU_STATE_VALUE_USER = exports.SYSTEM_CPU_STATE_VALUE_SYSTEM = exports.SYSTEM_CPU_STATE_VALUE_STEAL = exports.SYSTEM_CPU_STATE_VALUE_NICE = exports.SYSTEM_CPU_STATE_VALUE_IOWAIT = exports.SYSTEM_CPU_STATE_VALUE_INTERRUPT = exports.SYSTEM_CPU_STATE_VALUE_IDLE = exports.ATTR_SYSTEM_CPU_STATE = exports.ATTR_SYSTEM_CPU_LOGICAL_NUMBER = exports.STATE_VALUE_USED = exports.STATE_VALUE_IDLE = exports.ATTR_STATE = exports.ATTR_SOURCE_PORT = exports.ATTR_SOURCE_ADDRESS = exports.ATTR_SESSION_PREVIOUS_ID = exports.ATTR_SESSION_ID = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.RPC_SYSTEM_VALUE_JAVA_RMI = exports.RPC_SYSTEM_VALUE_GRPC = exports.RPC_SYSTEM_VALUE_DOTNET_WCF = exports.RPC_SYSTEM_VALUE_CONNECT_RPC = exports.RPC_SYSTEM_VALUE_APACHE_DUBBO = exports.ATTR_RPC_SYSTEM = exports.ATTR_RPC_SERVICE = exports.ATTR_RPC_METHOD = exports.ATTR_RPC_MESSAGE_UNCOMPRESSED_SIZE = exports.RPC_MESSAGE_TYPE_VALUE_SENT = exports.RPC_MESSAGE_TYPE_VALUE_RECEIVED = exports.ATTR_RPC_MESSAGE_TYPE = exports.ATTR_RPC_MESSAGE_ID = exports.ATTR_RPC_MESSAGE_COMPRESSED_SIZE = exports.ATTR_RPC_JSONRPC_VERSION = exports.ATTR_RPC_JSONRPC_REQUEST_ID = exports.ATTR_RPC_JSONRPC_ERROR_MESSAGE = exports.ATTR_RPC_JSONRPC_ERROR_CODE = exports.RPC_GRPC_STATUS_CODE_VALUE_UNAUTHENTICATED = exports.RPC_GRPC_STATUS_CODE_VALUE_DATA_LOSS = exports.RPC_GRPC_STATUS_CODE_VALUE_UNAVAILABLE = exports.RPC_GRPC_STATUS_CODE_VALUE_INTERNAL = void 0; -exports.ATTR_TEST_SUITE_RUN_STATUS = exports.ATTR_TEST_SUITE_NAME = exports.TEST_CASE_RESULT_STATUS_VALUE_PASS = exports.TEST_CASE_RESULT_STATUS_VALUE_FAIL = exports.ATTR_TEST_CASE_RESULT_STATUS = exports.ATTR_TEST_CASE_NAME = exports.ATTR_TELEMETRY_DISTRO_VERSION = exports.ATTR_TELEMETRY_DISTRO_NAME = exports.SYSTEM_PROCESSES_STATUS_VALUE_STOPPED = exports.SYSTEM_PROCESSES_STATUS_VALUE_SLEEPING = exports.SYSTEM_PROCESSES_STATUS_VALUE_RUNNING = exports.SYSTEM_PROCESSES_STATUS_VALUE_DEFUNCT = exports.ATTR_SYSTEM_PROCESSES_STATUS = exports.SYSTEM_PROCESS_STATUS_VALUE_STOPPED = exports.SYSTEM_PROCESS_STATUS_VALUE_SLEEPING = exports.SYSTEM_PROCESS_STATUS_VALUE_RUNNING = exports.SYSTEM_PROCESS_STATUS_VALUE_DEFUNCT = exports.ATTR_SYSTEM_PROCESS_STATUS = exports.SYSTEM_PAGING_TYPE_VALUE_MINOR = exports.SYSTEM_PAGING_TYPE_VALUE_MAJOR = exports.ATTR_SYSTEM_PAGING_TYPE = exports.SYSTEM_PAGING_STATE_VALUE_USED = exports.SYSTEM_PAGING_STATE_VALUE_FREE = exports.ATTR_SYSTEM_PAGING_STATE = exports.SYSTEM_PAGING_DIRECTION_VALUE_OUT = exports.SYSTEM_PAGING_DIRECTION_VALUE_IN = exports.ATTR_SYSTEM_PAGING_DIRECTION = exports.SYSTEM_NETWORK_STATE_VALUE_TIME_WAIT = exports.SYSTEM_NETWORK_STATE_VALUE_SYN_SENT = exports.SYSTEM_NETWORK_STATE_VALUE_SYN_RECV = exports.SYSTEM_NETWORK_STATE_VALUE_LISTEN = exports.SYSTEM_NETWORK_STATE_VALUE_LAST_ACK = exports.SYSTEM_NETWORK_STATE_VALUE_FIN_WAIT_2 = exports.SYSTEM_NETWORK_STATE_VALUE_FIN_WAIT_1 = exports.SYSTEM_NETWORK_STATE_VALUE_ESTABLISHED = exports.SYSTEM_NETWORK_STATE_VALUE_DELETE = exports.SYSTEM_NETWORK_STATE_VALUE_CLOSING = exports.SYSTEM_NETWORK_STATE_VALUE_CLOSE_WAIT = exports.SYSTEM_NETWORK_STATE_VALUE_CLOSE = exports.ATTR_SYSTEM_NETWORK_STATE = exports.SYSTEM_MEMORY_STATE_VALUE_USED = exports.SYSTEM_MEMORY_STATE_VALUE_SHARED = exports.SYSTEM_MEMORY_STATE_VALUE_FREE = exports.SYSTEM_MEMORY_STATE_VALUE_CACHED = exports.SYSTEM_MEMORY_STATE_VALUE_BUFFERS = exports.ATTR_SYSTEM_MEMORY_STATE = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_REFS = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_NTFS = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_HFSPLUS = exports.SYSTEM_FILESYSTEM_TYPE_VALUE_FAT32 = void 0; -exports.ATTR_USER_HASH = exports.ATTR_USER_FULL_NAME = exports.ATTR_USER_EMAIL = exports.ATTR_URL_TOP_LEVEL_DOMAIN = exports.ATTR_URL_TEMPLATE = exports.ATTR_URL_SUBDOMAIN = exports.ATTR_URL_REGISTERED_DOMAIN = exports.ATTR_URL_PORT = exports.ATTR_URL_ORIGINAL = exports.ATTR_URL_EXTENSION = exports.ATTR_URL_DOMAIN = exports.ATTR_TLS_SERVER_SUBJECT = exports.ATTR_TLS_SERVER_NOT_BEFORE = exports.ATTR_TLS_SERVER_NOT_AFTER = exports.ATTR_TLS_SERVER_JA3S = exports.ATTR_TLS_SERVER_ISSUER = exports.ATTR_TLS_SERVER_HASH_SHA256 = exports.ATTR_TLS_SERVER_HASH_SHA1 = exports.ATTR_TLS_SERVER_HASH_MD5 = exports.ATTR_TLS_SERVER_CERTIFICATE_CHAIN = exports.ATTR_TLS_SERVER_CERTIFICATE = exports.ATTR_TLS_RESUMED = exports.ATTR_TLS_PROTOCOL_VERSION = exports.TLS_PROTOCOL_NAME_VALUE_TLS = exports.TLS_PROTOCOL_NAME_VALUE_SSL = exports.ATTR_TLS_PROTOCOL_NAME = exports.ATTR_TLS_NEXT_PROTOCOL = exports.ATTR_TLS_ESTABLISHED = exports.ATTR_TLS_CURVE = exports.ATTR_TLS_CLIENT_SUPPORTED_CIPHERS = exports.ATTR_TLS_CLIENT_SUBJECT = exports.ATTR_TLS_CLIENT_SERVER_NAME = exports.ATTR_TLS_CLIENT_NOT_BEFORE = exports.ATTR_TLS_CLIENT_NOT_AFTER = exports.ATTR_TLS_CLIENT_JA3 = exports.ATTR_TLS_CLIENT_ISSUER = exports.ATTR_TLS_CLIENT_HASH_SHA256 = exports.ATTR_TLS_CLIENT_HASH_SHA1 = exports.ATTR_TLS_CLIENT_HASH_MD5 = exports.ATTR_TLS_CLIENT_CERTIFICATE_CHAIN = exports.ATTR_TLS_CLIENT_CERTIFICATE = exports.ATTR_TLS_CIPHER = exports.ATTR_THREAD_NAME = exports.ATTR_THREAD_ID = exports.TEST_SUITE_RUN_STATUS_VALUE_TIMED_OUT = exports.TEST_SUITE_RUN_STATUS_VALUE_SUCCESS = exports.TEST_SUITE_RUN_STATUS_VALUE_SKIPPED = exports.TEST_SUITE_RUN_STATUS_VALUE_IN_PROGRESS = exports.TEST_SUITE_RUN_STATUS_VALUE_FAILURE = exports.TEST_SUITE_RUN_STATUS_VALUE_ABORTED = void 0; -exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_VCS_REPOSITORY_URL_FULL = exports.VCS_REPOSITORY_REF_TYPE_VALUE_TAG = exports.VCS_REPOSITORY_REF_TYPE_VALUE_BRANCH = exports.ATTR_VCS_REPOSITORY_REF_TYPE = exports.ATTR_VCS_REPOSITORY_REF_REVISION = exports.ATTR_VCS_REPOSITORY_REF_NAME = exports.ATTR_VCS_REPOSITORY_CHANGE_TITLE = exports.ATTR_VCS_REPOSITORY_CHANGE_ID = exports.V8JS_HEAP_SPACE_NAME_VALUE_OLD_SPACE = exports.V8JS_HEAP_SPACE_NAME_VALUE_NEW_SPACE = exports.V8JS_HEAP_SPACE_NAME_VALUE_MAP_SPACE = exports.V8JS_HEAP_SPACE_NAME_VALUE_LARGE_OBJECT_SPACE = exports.V8JS_HEAP_SPACE_NAME_VALUE_CODE_SPACE = exports.ATTR_V8JS_HEAP_SPACE_NAME = exports.V8JS_GC_TYPE_VALUE_WEAKCB = exports.V8JS_GC_TYPE_VALUE_MINOR = exports.V8JS_GC_TYPE_VALUE_MAJOR = exports.V8JS_GC_TYPE_VALUE_INCREMENTAL = exports.ATTR_V8JS_GC_TYPE = exports.ATTR_USER_AGENT_VERSION = exports.ATTR_USER_AGENT_NAME = exports.ATTR_USER_ROLES = exports.ATTR_USER_NAME = exports.ATTR_USER_ID = void 0; -//---------------------------------------------------------------------------------------------------------- -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2 -//---------------------------------------------------------------------------------------------------------- -/** - * The ID of a running ECS task. The ID **MUST** be extracted from `task.arn`. - * - * @example 10838bed-421f-43ef-870a-f43feacbbb5b - * - * @example 23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_ECS_TASK_ID = 'aws.ecs.task.id'; -/** - * Uniquely identifies the framework API revision offered by a version (`os.version`) of the android operating system. More information can be found [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels). - * - * @example 33 - * - * @example 32 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ANDROID_OS_API_LEVEL = 'android.os.api_level'; -/** - * Deprecated use the `device.app.lifecycle` event definition including `android.state` as a payload field instead. - * - * @note The Android lifecycle states are defined in [Activity lifecycle callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), and from which the `OS identifiers` are derived. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ANDROID_STATE = 'android.state'; -/** - * Enum value "background" for attribute {@link ATTR_ANDROID_STATE}. - */ -exports.ANDROID_STATE_VALUE_BACKGROUND = "background"; -/** - * Enum value "created" for attribute {@link ATTR_ANDROID_STATE}. - */ -exports.ANDROID_STATE_VALUE_CREATED = "created"; -/** - * Enum value "foreground" for attribute {@link ATTR_ANDROID_STATE}. - */ -exports.ANDROID_STATE_VALUE_FOREGROUND = "foreground"; -/** - * The provenance filename of the built attestation which directly relates to the build artifact filename. This filename **SHOULD** accompany the artifact at publish time. See the [SLSA Relationship](https://slsa.dev/spec/v1.0/distributing-provenance#relationship-between-artifacts-and-attestations) specification for more information. - * - * @example golang-binary-amd64-v0.1.0.attestation - * - * @example docker-image-amd64-v0.1.0.intoto.json1 - * - * @example release-1.tar.gz.attestation - * - * @example file-name-package.tar.gz.intoto.json1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ARTIFACT_ATTESTATION_FILENAME = 'artifact.attestation.filename'; -/** - * The full [hash value (see glossary)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf), of the built attestation. Some envelopes in the software attestation space also refer to this as the [digest](https://github.com/in-toto/attestation/blob/main/spec/README.md#in-toto-attestation-framework-spec). - * - * @example 1b31dfcd5b7f9267bf2ff47651df1cfb9147b9e4df1f335accf65b4cda498408 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ARTIFACT_ATTESTATION_HASH = 'artifact.attestation.hash'; -/** - * The id of the build [software attestation](https://slsa.dev/attestation-model). - * - * @example 123 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ARTIFACT_ATTESTATION_ID = 'artifact.attestation.id'; -/** - * The human readable file name of the artifact, typically generated during build and release processes. Often includes the package name and version in the file name. - * - * @example golang-binary-amd64-v0.1.0 - * - * @example docker-image-amd64-v0.1.0 - * - * @example release-1.tar.gz - * - * @example file-name-package.tar.gz - * - * @note This file name can also act as the [Package Name](https://slsa.dev/spec/v1.0/terminology#package-model) - * in cases where the package ecosystem maps accordingly. - * Additionally, the artifact [can be published](https://slsa.dev/spec/v1.0/terminology#software-supply-chain) - * for others, but that is not a guarantee. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ARTIFACT_FILENAME = 'artifact.filename'; -/** - * The full [hash value (see glossary)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf), often found in checksum.txt on a release of the artifact and used to verify package integrity. - * - * @example 9ff4c52759e2c4ac70b7d517bc7fcdc1cda631ca0045271ddd1b192544f8a3e9 - * - * @note The specific algorithm used to create the cryptographic hash value is - * not defined. In situations where an artifact has multiple - * cryptographic hashes, it is up to the implementer to choose which - * hash value to set here; this should be the most secure hash algorithm - * that is suitable for the situation and consistent with the - * corresponding attestation. The implementer can then provide the other - * hash values through an additional set of attribute extensions as they - * deem necessary. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ARTIFACT_HASH = 'artifact.hash'; -/** - * The [Package URL](https://github.com/package-url/purl-spec) of the [package artifact](https://slsa.dev/spec/v1.0/terminology#package-model) provides a standard way to identify and locate the packaged artifact. - * - * @example pkg:github/package-url/purl-spec@1209109710924 - * - * @example pkg:npm/foo@12.12.3 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ARTIFACT_PURL = 'artifact.purl'; -/** - * The version of the artifact. - * - * @example v0.1.0 - * - * @example 1.2.1 - * - * @example 122691-build - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_ARTIFACT_VERSION = 'artifact.version'; -/** - * The JSON-serialized value of each item in the `AttributeDefinitions` request field. - * - * @example { "AttributeName": "string", "AttributeType": "string" } - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = 'aws.dynamodb.attribute_definitions'; -/** - * The value of the `AttributesToGet` request parameter. - * - * @example lives - * - * @example id - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_ATTRIBUTES_TO_GET = 'aws.dynamodb.attributes_to_get'; -/** - * The value of the `ConsistentRead` request parameter. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_CONSISTENT_READ = 'aws.dynamodb.consistent_read'; -/** - * The JSON-serialized value of each item in the `ConsumedCapacity` response field. - * - * @example { "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": "string", "WriteCapacityUnits": number } - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY = 'aws.dynamodb.consumed_capacity'; -/** - * The value of the `Count` response parameter. - * - * @example 10 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_COUNT = 'aws.dynamodb.count'; -/** - * The value of the `ExclusiveStartTableName` request parameter. - * - * @example Users - * - * @example CatsTable - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = 'aws.dynamodb.exclusive_start_table'; -/** - * The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field. - * - * @example { "Create": { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } } - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = 'aws.dynamodb.global_secondary_index_updates'; -/** - * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field - * - * @example { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } } - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = 'aws.dynamodb.global_secondary_indexes'; -/** - * The value of the `IndexName` request parameter. - * - * @example name_to_group - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name'; -/** - * The JSON-serialized value of the `ItemCollectionMetrics` response field. - * - * @example { "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] } - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = 'aws.dynamodb.item_collection_metrics'; -/** - * The value of the `Limit` request parameter. - * - * @example 10 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit'; -/** - * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. - * - * @example { "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } } - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = 'aws.dynamodb.local_secondary_indexes'; -/** - * The value of the `ProjectionExpression` request parameter. - * - * @example Title - * - * @example Title, Price, Color - * - * @example Title, Description, RelatedItems, ProductReviews - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection'; -/** - * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. - * - * @example 1.0 - * - * @example 2.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = 'aws.dynamodb.provisioned_read_capacity'; -/** - * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. - * - * @example 1.0 - * - * @example 2.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = 'aws.dynamodb.provisioned_write_capacity'; -/** - * The value of the `ScanIndexForward` request parameter. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_SCAN_FORWARD = 'aws.dynamodb.scan_forward'; -/** - * The value of the `ScannedCount` response parameter. - * - * @example 50 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_SCANNED_COUNT = 'aws.dynamodb.scanned_count'; -/** - * The value of the `Segment` request parameter. - * - * @example 10 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment'; -/** - * The value of the `Select` request parameter. - * - * @example ALL_ATTRIBUTES - * - * @example COUNT - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_SELECT = 'aws.dynamodb.select'; -/** - * The number of items in the `TableNames` response parameter. - * - * @example 20 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_TABLE_COUNT = 'aws.dynamodb.table_count'; -/** - * The keys in the `RequestItems` object field. - * - * @example Users - * - * @example Cats - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_TABLE_NAMES = 'aws.dynamodb.table_names'; -/** - * The value of the `TotalSegments` request parameter. - * - * @example 100 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS = 'aws.dynamodb.total_segments'; -/** - * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - * - * @example arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'; -/** - * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - * - * @example arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn'; -/** - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_ECS_LAUNCHTYPE = 'aws.ecs.launchtype'; -/** - * Enum value "ec2" for attribute {@link ATTR_AWS_ECS_LAUNCHTYPE}. - */ -exports.AWS_ECS_LAUNCHTYPE_VALUE_EC2 = "ec2"; -/** - * Enum value "fargate" for attribute {@link ATTR_AWS_ECS_LAUNCHTYPE}. - */ -exports.AWS_ECS_LAUNCHTYPE_VALUE_FARGATE = "fargate"; -/** - * The ARN of a running [ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html#ecs-resource-ids). - * - * @example arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b - * - * @example arn:aws:ecs:us-west-1:123456789123:task/my-cluster/task-id/23ebb8ac-c18f-46c6-8bbe-d55d0e37cfbd - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_ECS_TASK_ARN = 'aws.ecs.task.arn'; -/** - * The family name of the [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html) used to create the ECS task. - * - * @example opentelemetry-family - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_ECS_TASK_FAMILY = 'aws.ecs.task.family'; -/** - * The revision for the task definition used to create the ECS task. - * - * @example 8 - * - * @example 26 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_ECS_TASK_REVISION = 'aws.ecs.task.revision'; -/** - * The ARN of an EKS cluster. - * - * @example arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_EKS_CLUSTER_ARN = 'aws.eks.cluster.arn'; -/** - * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). - * - * @example arn:aws:lambda:us-east-1:123456:function:myfunction:myalias - * - * @note This may be different from `cloud.resource_id` if an alias is involved. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn'; -/** - * The Amazon Resource Name(s) (ARN) of the AWS log group(s). - * - * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:* - * - * @note See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'; -/** - * The name(s) of the AWS log group(s) an application is writing to. - * - * @example /aws/lambda/my-function - * - * @example opentelemetry-service - * - * @note Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_LOG_GROUP_NAMES = 'aws.log.group.names'; -/** - * The ARN(s) of the AWS log stream(s). - * - * @example arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b - * - * @note See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'; -/** - * The name(s) of the AWS log stream(s) an application is writing to. - * - * @example logs/main/10838bed-421f-43ef-870a-f43feacbbb5b - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_LOG_STREAM_NAMES = 'aws.log.stream.names'; -/** - * The AWS request ID as returned in the response headers `x-amz-request-id` or `x-amz-requestid`. - * - * @example 79b9da39-b7ae-508a-a6bc-864b2829c622 - * - * @example C9ER4AJX75574TDJ - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_REQUEST_ID = 'aws.request_id'; -/** - * The S3 bucket name the request refers to. Corresponds to the `--bucket` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. - * - * @example some-bucket-name - * - * @note The `bucket` attribute is applicable to all S3 operations that reference a bucket, i.e. that require the bucket name as a mandatory parameter. - * This applies to almost all S3 operations except `list-buckets`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_S3_BUCKET = 'aws.s3.bucket'; -/** - * The source object (in the form `bucket`/`key`) for the copy operation. - * - * @example someFile.yml - * - * @note The `copy_source` attribute applies to S3 copy operations and corresponds to the `--copy-source` parameter - * of the [copy-object operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). - * This applies in particular to the following operations: - * - * - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - * - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_S3_COPY_SOURCE = 'aws.s3.copy_source'; -/** - * The delete request container that specifies the objects to be deleted. - * - * @example Objects=[{Key=string,VersionId=string},{Key=string,VersionId=string}],Quiet=boolean - * - * @note The `delete` attribute is only applicable to the [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) operation. - * The `delete` attribute corresponds to the `--delete` parameter of the - * [delete-objects operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_S3_DELETE = 'aws.s3.delete'; -/** - * The S3 object key the request refers to. Corresponds to the `--key` parameter of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) operations. - * - * @example someFile.yml - * - * @note The `key` attribute is applicable to all object-related S3 operations, i.e. that require the object key as a mandatory parameter. - * This applies in particular to the following operations: - * - * - [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - * - [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - * - [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) - * - [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) - * - [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) - * - [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) - * - [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) - * - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - * - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - * - [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) - * - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - * - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - * - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_S3_KEY = 'aws.s3.key'; -/** - * The part number of the part being uploaded in a multipart-upload operation. This is a positive integer between 1 and 10,000. - * - * @example 3456 - * - * @note The `part_number` attribute is only applicable to the [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - * and [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) operations. - * The `part_number` attribute corresponds to the `--part-number` parameter of the - * [upload-part operation within the S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_S3_PART_NUMBER = 'aws.s3.part_number'; -/** - * Upload ID that identifies the multipart upload. - * - * @example dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ - * - * @note The `upload_id` attribute applies to S3 multipart-upload operations and corresponds to the `--upload-id` parameter - * of the [S3 API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) multipart operations. - * This applies in particular to the following operations: - * - * - [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - * - [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - * - [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - * - [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - * - [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AWS_S3_UPLOAD_ID = 'aws.s3.upload_id'; -/** - * The unique identifier of the service request. It's generated by the Azure service and returned with the response. - * - * @example 00000000-0000-0000-0000-000000000000 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_AZ_SERVICE_REQUEST_ID = 'az.service_request_id'; -/** - * Array of brand name and version separated by a space - * - * @example Not A;Brand 99 - * - * @example Chromium 99 - * - * @example Chrome 99 - * - * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_BROWSER_BRANDS = 'browser.brands'; -/** - * Preferred language of the user using the browser - * - * @example en - * - * @example en-US - * - * @example fr - * - * @example fr-FR - * - * @note This value is intended to be taken from the Navigator API `navigator.language`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_BROWSER_LANGUAGE = 'browser.language'; -/** - * A boolean that is true if the browser is running on a mobile device - * - * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.mobile`). If unavailable, this attribute **SHOULD** be left unset. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_BROWSER_MOBILE = 'browser.mobile'; -/** - * The platform on which the browser is running - * - * @example Windows - * - * @example macOS - * - * @example Android - * - * @note This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.platform`). If unavailable, the legacy `navigator.platform` API **SHOULD** **NOT** be used instead and this attribute **SHOULD** be left unset in order for the values to be consistent. - * The list of possible values is defined in the [W3C User-Agent Client Hints specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). Note that some (but not all) of these values can overlap with values in the [`os.type` and `os.name` attributes](./os.md). However, for consistency, the values in the `browser.platform` attribute should capture the exact value that the user agent provides. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_BROWSER_PLATFORM = 'browser.platform'; -/** - * The human readable name of the pipeline within a CI/CD system. - * - * @example Build and Test - * - * @example Lint - * - * @example Deploy Go Project - * - * @example deploy_to_environment - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CICD_PIPELINE_NAME = 'cicd.pipeline.name'; -/** - * The unique identifier of a pipeline run within a CI/CD system. - * - * @example 120912 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CICD_PIPELINE_RUN_ID = 'cicd.pipeline.run.id'; -/** - * The human readable name of a task within a pipeline. Task here most closely aligns with a [computing process](https://en.wikipedia.org/wiki/Pipeline_(computing)) in a pipeline. Other terms for tasks include commands, steps, and procedures. - * - * @example Run GoLang Linter - * - * @example Go Build - * - * @example go-test - * - * @example deploy_binary - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CICD_PIPELINE_TASK_NAME = 'cicd.pipeline.task.name'; -/** - * The unique identifier of a task run within a pipeline. - * - * @example 12097 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CICD_PIPELINE_TASK_RUN_ID = 'cicd.pipeline.task.run.id'; -/** - * The [URL](https://en.wikipedia.org/wiki/URL) of the pipeline run providing the complete address in order to locate and identify the pipeline run. - * - * @example https://github.com/open-telemetry/semantic-conventions/actions/runs/9753949763/job/26920038674?pr=1075 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CICD_PIPELINE_TASK_RUN_URL_FULL = 'cicd.pipeline.task.run.url.full'; -/** - * The type of the task within a pipeline. - * - * @example build - * - * @example test - * - * @example deploy - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CICD_PIPELINE_TASK_TYPE = 'cicd.pipeline.task.type'; -/** - * Enum value "build" for attribute {@link ATTR_CICD_PIPELINE_TASK_TYPE}. - */ -exports.CICD_PIPELINE_TASK_TYPE_VALUE_BUILD = "build"; -/** - * Enum value "deploy" for attribute {@link ATTR_CICD_PIPELINE_TASK_TYPE}. - */ -exports.CICD_PIPELINE_TASK_TYPE_VALUE_DEPLOY = "deploy"; -/** - * Enum value "test" for attribute {@link ATTR_CICD_PIPELINE_TASK_TYPE}. - */ -exports.CICD_PIPELINE_TASK_TYPE_VALUE_TEST = "test"; -/** - * 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'; -/** - * The cloud platform in use. - * - * @note The prefix of the service **SHOULD** match the one specified in `cloud.provider`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CLOUD_PLATFORM = 'cloud.platform'; -/** - * Enum value "alibaba_cloud_ecs" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs"; -/** - * Enum value "alibaba_cloud_fc" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_FC = "alibaba_cloud_fc"; -/** - * Enum value "alibaba_cloud_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift"; -/** - * Enum value "aws_app_runner" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AWS_APP_RUNNER = "aws_app_runner"; -/** - * Enum value "aws_ec2" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AWS_EC2 = "aws_ec2"; -/** - * Enum value "aws_ecs" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AWS_ECS = "aws_ecs"; -/** - * Enum value "aws_eks" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AWS_EKS = "aws_eks"; -/** - * Enum value "aws_elastic_beanstalk" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk"; -/** - * Enum value "aws_lambda" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AWS_LAMBDA = "aws_lambda"; -/** - * Enum value "aws_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AWS_OPENSHIFT = "aws_openshift"; -/** - * Enum value "azure_aks" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AZURE_AKS = "azure_aks"; -/** - * Enum value "azure_app_service" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE = "azure_app_service"; -/** - * Enum value "azure_container_apps" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_APPS = "azure_container_apps"; -/** - * Enum value "azure_container_instances" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_INSTANCES = "azure_container_instances"; -/** - * Enum value "azure_functions" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS = "azure_functions"; -/** - * Enum value "azure_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AZURE_OPENSHIFT = "azure_openshift"; -/** - * Enum value "azure_vm" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_AZURE_VM = "azure_vm"; -/** - * Enum value "gcp_app_engine" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE = "gcp_app_engine"; -/** - * Enum value "gcp_bare_metal_solution" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution"; -/** - * Enum value "gcp_cloud_functions" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions"; -/** - * Enum value "gcp_cloud_run" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN = "gcp_cloud_run"; -/** - * Enum value "gcp_compute_engine" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE = "gcp_compute_engine"; -/** - * Enum value "gcp_kubernetes_engine" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine"; -/** - * Enum value "gcp_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_GCP_OPENSHIFT = "gcp_openshift"; -/** - * Enum value "ibm_cloud_openshift" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift"; -/** - * Enum value "tencent_cloud_cvm" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_CVM = "tencent_cloud_cvm"; -/** - * Enum value "tencent_cloud_eks" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_EKS = "tencent_cloud_eks"; -/** - * Enum value "tencent_cloud_scf" for attribute {@link ATTR_CLOUD_PLATFORM}. - */ -exports.CLOUD_PLATFORM_VALUE_TENCENT_CLOUD_SCF = "tencent_cloud_scf"; -/** - * 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'; -/** - * Enum value "alibaba_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}. - */ -exports.CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD = "alibaba_cloud"; -/** - * Enum value "aws" for attribute {@link ATTR_CLOUD_PROVIDER}. - */ -exports.CLOUD_PROVIDER_VALUE_AWS = "aws"; -/** - * Enum value "azure" for attribute {@link ATTR_CLOUD_PROVIDER}. - */ -exports.CLOUD_PROVIDER_VALUE_AZURE = "azure"; -/** - * Enum value "gcp" for attribute {@link ATTR_CLOUD_PROVIDER}. - */ -exports.CLOUD_PROVIDER_VALUE_GCP = "gcp"; -/** - * Enum value "heroku" for attribute {@link ATTR_CLOUD_PROVIDER}. - */ -exports.CLOUD_PROVIDER_VALUE_HEROKU = "heroku"; -/** - * Enum value "ibm_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}. - */ -exports.CLOUD_PROVIDER_VALUE_IBM_CLOUD = "ibm_cloud"; -/** - * Enum value "tencent_cloud" for attribute {@link ATTR_CLOUD_PROVIDER}. - */ -exports.CLOUD_PROVIDER_VALUE_TENCENT_CLOUD = "tencent_cloud"; -/** - * 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'; -/** - * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) on AWS, a [fully qualified resource ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on Azure, a [full resource name](https://cloud.google.com/apis/design/resource_names#full_resource_name) on GCP) - * - * @example arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function - * - * @example //run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID - * - * @example /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/ - * - * @note On some cloud providers, it may not be possible to determine the full ID at startup, - * so it may be necessary to set `cloud.resource_id` as a span attribute instead. - * - * The exact value to use for `cloud.resource_id` depends on the cloud provider. - * The following well-known definitions **MUST** be used if you set this attribute and they apply: - * - * * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - * Take care not to use the "invoked ARN" directly but replace any - * [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) - * with the resolved function version, as the same runtime instance may be invocable with - * multiple different aliases. - * * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) - * * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function, - * *not* the function app, having the form - * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. - * This means that a span attribute **MUST** be used, as an Azure function app can host multiple functions that would usually share - * a TracerProvider. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CLOUD_RESOURCE_ID = 'cloud.resource_id'; -/** - * The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) uniquely identifies the event. - * - * @example 123e4567-e89b-12d3-a456-426614174000 - * - * @example 0001 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CLOUDEVENTS_EVENT_ID = 'cloudevents.event_id'; -/** - * The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) identifies the context in which an event happened. - * - * @example https://github.com/cloudevents - * - * @example /cloudevents/spec/pull/123 - * - * @example my-service - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CLOUDEVENTS_EVENT_SOURCE = 'cloudevents.event_source'; -/** - * The [version of the CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses. - * - * @example "1.0" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CLOUDEVENTS_EVENT_SPEC_VERSION = 'cloudevents.event_spec_version'; -/** - * The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) of the event in the context of the event producer (identified by source). - * - * @example "mynewfile.jpg" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CLOUDEVENTS_EVENT_SUBJECT = 'cloudevents.event_subject'; -/** - * The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) contains a value describing the type of event related to the originating occurrence. - * - * @example com.github.pull_request.opened - * - * @example com.example.object.deleted.v2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CLOUDEVENTS_EVENT_TYPE = 'cloudevents.event_type'; -/** - * The column number in `code.filepath` best representing the operation. It **SHOULD** point within the code unit named in `code.function`. - * - * @example 16 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CODE_COLUMN = 'code.column'; -/** - * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). - * - * @example "/usr/local/MyApplication/content_root/app/index.php" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CODE_FILEPATH = 'code.filepath'; -/** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). - * - * @example "serveRequest" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CODE_FUNCTION = 'code.function'; -/** - * The line number in `code.filepath` best representing the operation. It **SHOULD** point within the code unit named in `code.function`. - * - * @example 42 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CODE_LINENO = 'code.lineno'; -/** - * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. - * - * @example "com.example.MyHttpService" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CODE_NAMESPACE = 'code.namespace'; -/** - * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. - * - * @example "at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CODE_STACKTRACE = 'code.stacktrace'; -/** - * The command used to run the container (i.e. the command name). - * - * @example otelcontribcol - * - * @note If using embedded credentials or sensitive data, it is recommended to remove them to prevent potential leakage. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CONTAINER_COMMAND = 'container.command'; -/** - * All the command arguments (including the command/executable itself) run by the container. [2] - * - * @example otelcontribcol, --config, config.yaml - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CONTAINER_COMMAND_ARGS = 'container.command_args'; -/** - * The full command run by the container as a single string representing the full command. [2] - * - * @example otelcontribcol --config config.yaml - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CONTAINER_COMMAND_LINE = 'container.command_line'; -/** - * Deprecated, use `cpu.mode` instead. - * - * @example user - * - * @example kernel - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `cpu.mode` - */ -exports.ATTR_CONTAINER_CPU_STATE = 'container.cpu.state'; -/** - * Enum value "kernel" for attribute {@link ATTR_CONTAINER_CPU_STATE}. - */ -exports.CONTAINER_CPU_STATE_VALUE_KERNEL = "kernel"; -/** - * Enum value "system" for attribute {@link ATTR_CONTAINER_CPU_STATE}. - */ -exports.CONTAINER_CPU_STATE_VALUE_SYSTEM = "system"; -/** - * Enum value "user" for attribute {@link ATTR_CONTAINER_CPU_STATE}. - */ -exports.CONTAINER_CPU_STATE_VALUE_USER = "user"; -/** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/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'; -/** - * Runtime specific image identifier. Usually a hash algorithm followed by a UUID. - * - * @example sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f - * - * @note Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. - * K8s defines a link to the container registry repository with digest `"imageID": "registry.azurecr.io /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. - * The ID is assigned by the container runtime and can vary in different environments. Consider using `oci.manifest.digest` if it is important to identify the same image in different environments/runtimes. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CONTAINER_IMAGE_ID = 'container.image.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'; -/** - * Repo digests of the container image as provided by the container runtime. - * - * @example example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb - * - * @example internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578 - * - * @note [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CONTAINER_IMAGE_REPO_DIGESTS = 'container.image.repo_digests'; -/** - * 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 - * - * @example 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 labels, `` being the label name, the value being the label value. - * - * @example container.label.app=nginx - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_CONTAINER_LABEL = (key) => `container.label.${key}`; -exports.ATTR_CONTAINER_LABEL = ATTR_CONTAINER_LABEL; -/** - * Deprecated, use `container.label` instead. - * - * @example container.label.app=nginx - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `container.label`. - */ -const ATTR_CONTAINER_LABELS = (key) => `container.labels.${key}`; -exports.ATTR_CONTAINER_LABELS = ATTR_CONTAINER_LABELS; -/** - * 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 container runtime managing this container. - * - * @example docker - * - * @example containerd - * - * @example rkt - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CONTAINER_RUNTIME = 'container.runtime'; -/** - * The mode of the CPU - * - * @example user - * - * @example system - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_CPU_MODE = 'cpu.mode'; -/** - * Enum value "idle" for attribute {@link ATTR_CPU_MODE}. - */ -exports.CPU_MODE_VALUE_IDLE = "idle"; -/** - * Enum value "interrupt" for attribute {@link ATTR_CPU_MODE}. - */ -exports.CPU_MODE_VALUE_INTERRUPT = "interrupt"; -/** - * Enum value "iowait" for attribute {@link ATTR_CPU_MODE}. - */ -exports.CPU_MODE_VALUE_IOWAIT = "iowait"; -/** - * Enum value "kernel" for attribute {@link ATTR_CPU_MODE}. - */ -exports.CPU_MODE_VALUE_KERNEL = "kernel"; -/** - * Enum value "nice" for attribute {@link ATTR_CPU_MODE}. - */ -exports.CPU_MODE_VALUE_NICE = "nice"; -/** - * Enum value "steal" for attribute {@link ATTR_CPU_MODE}. - */ -exports.CPU_MODE_VALUE_STEAL = "steal"; -/** - * Enum value "system" for attribute {@link ATTR_CPU_MODE}. - */ -exports.CPU_MODE_VALUE_SYSTEM = "system"; -/** - * Enum value "user" for attribute {@link ATTR_CPU_MODE}. - */ -exports.CPU_MODE_VALUE_USER = "user"; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL = 'db.cassandra.consistency_level'; -/** - * Enum value "all" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ALL = "all"; -/** - * Enum value "any" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ANY = "any"; -/** - * Enum value "each_quorum" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_EACH_QUORUM = "each_quorum"; -/** - * Enum value "local_one" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_ONE = "local_one"; -/** - * Enum value "local_quorum" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_QUORUM = "local_quorum"; -/** - * Enum value "local_serial" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_SERIAL = "local_serial"; -/** - * Enum value "one" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ONE = "one"; -/** - * Enum value "quorum" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_QUORUM = "quorum"; -/** - * Enum value "serial" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_SERIAL = "serial"; -/** - * Enum value "three" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_THREE = "three"; -/** - * Enum value "two" for attribute {@link ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL}. - */ -exports.DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_TWO = "two"; -/** - * The data center of the coordinating node for a query. - * - * @example "us-west-2" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_CASSANDRA_COORDINATOR_DC = 'db.cassandra.coordinator.dc'; -/** - * The ID of the coordinating node for a query. - * - * @example "be13faa2-8574-4d71-926d-27f16cf8a7af" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_CASSANDRA_COORDINATOR_ID = 'db.cassandra.coordinator.id'; -/** - * Whether or not the query is idempotent. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_CASSANDRA_IDEMPOTENCE = 'db.cassandra.idempotence'; -/** - * The fetch size used for paging, i.e. how many rows will be returned at once. - * - * @example 5000 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'; -/** - * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - * - * @example 0 - * - * @example 2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = 'db.cassandra.speculative_execution_count'; -/** - * Deprecated, use `db.collection.name` instead. - * - * @example "mytable" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.collection.name`. - */ -exports.ATTR_DB_CASSANDRA_TABLE = 'db.cassandra.table'; -/** - * The name of the connection pool; unique within the instrumented application. In case the connection pool implementation doesn't provide a name, instrumentation **SHOULD** use a combination of parameters that would make the name unique, for example, combining attributes `server.address`, `server.port`, and `db.namespace`, formatted as `server.address:server.port/db.namespace`. Instrumentations that generate connection pool name following different patterns **SHOULD** document it. - * - * @example myDataSource - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_CLIENT_CONNECTION_POOL_NAME = 'db.client.connection.pool.name'; -/** - * The state of a connection in the pool - * - * @example idle - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_CLIENT_CONNECTION_STATE = 'db.client.connection.state'; -/** - * Enum value "idle" for attribute {@link ATTR_DB_CLIENT_CONNECTION_STATE}. - */ -exports.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE = "idle"; -/** - * Enum value "used" for attribute {@link ATTR_DB_CLIENT_CONNECTION_STATE}. - */ -exports.DB_CLIENT_CONNECTION_STATE_VALUE_USED = "used"; -/** - * Deprecated, use `db.client.connection.pool.name` instead. - * - * @example myDataSource - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.pool.name`. - */ -exports.ATTR_DB_CLIENT_CONNECTIONS_POOL_NAME = 'db.client.connections.pool.name'; -/** - * Deprecated, use `db.client.connection.state` instead. - * - * @example idle - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.state`. - */ -exports.ATTR_DB_CLIENT_CONNECTIONS_STATE = 'db.client.connections.state'; -/** - * Enum value "idle" for attribute {@link ATTR_DB_CLIENT_CONNECTIONS_STATE}. - */ -exports.DB_CLIENT_CONNECTIONS_STATE_VALUE_IDLE = "idle"; -/** - * Enum value "used" for attribute {@link ATTR_DB_CLIENT_CONNECTIONS_STATE}. - */ -exports.DB_CLIENT_CONNECTIONS_STATE_VALUE_USED = "used"; -/** - * The name of a collection (table, container) within the database. - * - * @example public.users - * - * @example customers - * - * @note It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. - * If the collection name is parsed from the query text, it **SHOULD** be the first collection name found in the query and it **SHOULD** match the value provided in the query text including any schema and database name prefix. - * For batch operations, if the individual operations are known to have the same collection name then that collection name **SHOULD** be used, otherwise `db.collection.name` **SHOULD** **NOT** be captured. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_COLLECTION_NAME = 'db.collection.name'; -/** - * Deprecated, use `server.address`, `server.port` attributes instead. - * - * @example "Server=(localdb)\\v11.0;Integrated Security=true;" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * "Replaced by `server.address` and `server.port`." - */ -exports.ATTR_DB_CONNECTION_STRING = 'db.connection_string'; -/** - * Unique Cosmos client instance id. - * - * @example "3ba4827d-4422-483f-b59f-85b74211c11d" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_COSMOSDB_CLIENT_ID = 'db.cosmosdb.client_id'; -/** - * Cosmos client connection mode. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_COSMOSDB_CONNECTION_MODE = 'db.cosmosdb.connection_mode'; -/** - * Enum value "direct" for attribute {@link ATTR_DB_COSMOSDB_CONNECTION_MODE}. - */ -exports.DB_COSMOSDB_CONNECTION_MODE_VALUE_DIRECT = "direct"; -/** - * Enum value "gateway" for attribute {@link ATTR_DB_COSMOSDB_CONNECTION_MODE}. - */ -exports.DB_COSMOSDB_CONNECTION_MODE_VALUE_GATEWAY = "gateway"; -/** - * Deprecated, use `db.collection.name` instead. - * - * @example "mytable" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.collection.name`. - */ -exports.ATTR_DB_COSMOSDB_CONTAINER = 'db.cosmosdb.container'; -/** - * CosmosDB Operation Type. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_COSMOSDB_OPERATION_TYPE = 'db.cosmosdb.operation_type'; -/** - * Enum value "Batch" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_BATCH = "Batch"; -/** - * Enum value "Create" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_CREATE = "Create"; -/** - * Enum value "Delete" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_DELETE = "Delete"; -/** - * Enum value "Execute" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE = "Execute"; -/** - * Enum value "ExecuteJavaScript" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_EXECUTE_JAVASCRIPT = "ExecuteJavaScript"; -/** - * Enum value "Head" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD = "Head"; -/** - * Enum value "HeadFeed" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_HEAD_FEED = "HeadFeed"; -/** - * Enum value "Invalid" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_INVALID = "Invalid"; -/** - * Enum value "Patch" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_PATCH = "Patch"; -/** - * Enum value "Query" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY = "Query"; -/** - * Enum value "QueryPlan" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_QUERY_PLAN = "QueryPlan"; -/** - * Enum value "Read" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_READ = "Read"; -/** - * Enum value "ReadFeed" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_READ_FEED = "ReadFeed"; -/** - * Enum value "Replace" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_REPLACE = "Replace"; -/** - * Enum value "Upsert" for attribute {@link ATTR_DB_COSMOSDB_OPERATION_TYPE}. - */ -exports.DB_COSMOSDB_OPERATION_TYPE_VALUE_UPSERT = "Upsert"; -/** - * RU consumed for that operation - * - * @example 46.18 - * - * @example 1.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_COSMOSDB_REQUEST_CHARGE = 'db.cosmosdb.request_charge'; -/** - * Request payload size in bytes - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_COSMOSDB_REQUEST_CONTENT_LENGTH = 'db.cosmosdb.request_content_length'; -/** - * Cosmos DB status code. - * - * @example 200 - * - * @example 201 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_COSMOSDB_STATUS_CODE = 'db.cosmosdb.status_code'; -/** - * Cosmos DB sub status code. - * - * @example 1000 - * - * @example 1002 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_COSMOSDB_SUB_STATUS_CODE = 'db.cosmosdb.sub_status_code'; -/** - * Deprecated, use `db.namespace` instead. - * - * @example e9106fc68e3044f0b1475b04bf4ffd5f - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.namespace`. - */ -exports.ATTR_DB_ELASTICSEARCH_CLUSTER_NAME = 'db.elasticsearch.cluster.name'; -/** - * Represents the human-readable identifier of the node/instance to which a request was routed. - * - * @example instance-0000000001 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_ELASTICSEARCH_NODE_NAME = 'db.elasticsearch.node.name'; -/** - * A dynamic value in the url path. - * - * @example db.elasticsearch.path_parts.index=test-index - * - * @example db.elasticsearch.path_parts.doc_id=123 - * - * @note Many Elasticsearch url paths allow dynamic values. These **SHOULD** be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation **SHOULD** reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_DB_ELASTICSEARCH_PATH_PARTS = (key) => `db.elasticsearch.path_parts.${key}`; -exports.ATTR_DB_ELASTICSEARCH_PATH_PARTS = ATTR_DB_ELASTICSEARCH_PATH_PARTS; -/** - * Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. - * - * @example "mysql-e26b99z.example.com" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. - */ -exports.ATTR_DB_INSTANCE_ID = 'db.instance.id'; -/** - * Removed, no replacement at this time. - * - * @example org.postgresql.Driver - * - * @example com.microsoft.sqlserver.jdbc.SQLServerDriver - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Removed as not used. - */ -exports.ATTR_DB_JDBC_DRIVER_CLASSNAME = 'db.jdbc.driver_classname'; -/** - * Deprecated, use `db.collection.name` instead. - * - * @example "mytable" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.collection.name`. - */ -exports.ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection'; -/** - * Deprecated, SQL Server instance is now populated as a part of `db.namespace` attribute. - * - * @example "MSSQLSERVER" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Deprecated, no replacement at this time. - */ -exports.ATTR_DB_MSSQL_INSTANCE_NAME = 'db.mssql.instance_name'; -/** - * Deprecated, use `db.namespace` instead. - * - * @example customers - * - * @example main - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.namespace`. - */ -exports.ATTR_DB_NAME = 'db.name'; -/** - * The name of the database, fully qualified within the server address and port. - * - * @example customers - * - * @example test.users - * - * @note If a database system has multiple namespace components, they **SHOULD** be concatenated (potentially using database system specific conventions) from most general to most specific namespace component, and more specific namespaces **SHOULD** **NOT** be captured without the more general namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. - * Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system. - * It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_NAMESPACE = 'db.namespace'; -/** - * Deprecated, use `db.operation.name` instead. - * - * @example findAndModify - * - * @example HMSET - * - * @example SELECT - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.operation.name`. - */ -exports.ATTR_DB_OPERATION = 'db.operation'; -/** - * The number of queries included in a [batch operation](/docs/database/database-spans.md#batch-operations). - * - * @example 2 - * - * @example 3 - * - * @example 4 - * - * @note Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` **SHOULD** never be `1`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_OPERATION_BATCH_SIZE = 'db.operation.batch.size'; -/** - * The name of the operation or command being executed. - * - * @example findAndModify - * - * @example HMSET - * - * @example SELECT - * - * @note It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. - * If the operation name is parsed from the query text, it **SHOULD** be the first operation name found in the query. - * For batch operations, if the individual operations are known to have the same operation name then that operation name **SHOULD** be used prepended by `BATCH `, otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database system specific term if more applicable. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_OPERATION_NAME = 'db.operation.name'; -/** - * A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. - * - * @example someval - * - * @example 55 - * - * @note Query parameters should only be captured when `db.query.text` is parameterized with placeholders. - * If a parameter has no name and instead is referenced only by index, then `` **SHOULD** be the 0-based index. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_DB_QUERY_PARAMETER = (key) => `db.query.parameter.${key}`; -exports.ATTR_DB_QUERY_PARAMETER = ATTR_DB_QUERY_PARAMETER; -/** - * The database query being executed. - * - * @example SELECT * FROM wuser_table where username = ? - * - * @example SET mykey "WuValue" - * - * @note For sanitization see [Sanitization of `db.query.text`](../../docs/database/database-spans.md#sanitization-of-dbquerytext). - * For batch operations, if the individual operations are known to have the same query text then that query text **SHOULD** be used, otherwise all of the individual query texts **SHOULD** be concatenated with separator `; ` or some other database system specific separator if more applicable. - * Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_QUERY_TEXT = 'db.query.text'; -/** - * Deprecated, use `db.namespace` instead. - * - * @example 0 - * - * @example 1 - * - * @example 15 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.namespace`. - */ -exports.ATTR_DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'; -/** - * Deprecated, use `db.collection.name` instead. - * - * @example "mytable" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.collection.name`. - */ -exports.ATTR_DB_SQL_TABLE = 'db.sql.table'; -/** - * The database statement being executed. - * - * @example SELECT * FROM wuser_table - * - * @example SET mykey "WuValue" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.query.text`. - */ -exports.ATTR_DB_STATEMENT = 'db.statement'; -/** - * The database management system (DBMS) product as identified by the client instrumentation. - * - * @note The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DB_SYSTEM = 'db.system'; -/** - * Enum value "adabas" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_ADABAS = "adabas"; -/** - * Enum value "cache" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_CACHE = "cache"; -/** - * Enum value "cassandra" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_CASSANDRA = "cassandra"; -/** - * Enum value "clickhouse" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_CLICKHOUSE = "clickhouse"; -/** - * Enum value "cloudscape" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_CLOUDSCAPE = "cloudscape"; -/** - * Enum value "cockroachdb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_COCKROACHDB = "cockroachdb"; -/** - * Enum value "coldfusion" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_COLDFUSION = "coldfusion"; -/** - * Enum value "cosmosdb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_COSMOSDB = "cosmosdb"; -/** - * Enum value "couchbase" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_COUCHBASE = "couchbase"; -/** - * Enum value "couchdb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_COUCHDB = "couchdb"; -/** - * Enum value "db2" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_DB2 = "db2"; -/** - * Enum value "derby" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_DERBY = "derby"; -/** - * Enum value "dynamodb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_DYNAMODB = "dynamodb"; -/** - * Enum value "edb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_EDB = "edb"; -/** - * Enum value "elasticsearch" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_ELASTICSEARCH = "elasticsearch"; -/** - * Enum value "filemaker" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_FILEMAKER = "filemaker"; -/** - * Enum value "firebird" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_FIREBIRD = "firebird"; -/** - * Enum value "firstsql" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_FIRSTSQL = "firstsql"; -/** - * Enum value "geode" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_GEODE = "geode"; -/** - * Enum value "h2" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_H2 = "h2"; -/** - * Enum value "hanadb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_HANADB = "hanadb"; -/** - * Enum value "hbase" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_HBASE = "hbase"; -/** - * Enum value "hive" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_HIVE = "hive"; -/** - * Enum value "hsqldb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_HSQLDB = "hsqldb"; -/** - * Enum value "influxdb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_INFLUXDB = "influxdb"; -/** - * Enum value "informix" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_INFORMIX = "informix"; -/** - * Enum value "ingres" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_INGRES = "ingres"; -/** - * Enum value "instantdb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_INSTANTDB = "instantdb"; -/** - * Enum value "interbase" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_INTERBASE = "interbase"; -/** - * Enum value "intersystems_cache" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_INTERSYSTEMS_CACHE = "intersystems_cache"; -/** - * Enum value "mariadb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_MARIADB = "mariadb"; -/** - * Enum value "maxdb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_MAXDB = "maxdb"; -/** - * Enum value "memcached" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_MEMCACHED = "memcached"; -/** - * Enum value "mongodb" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_MONGODB = "mongodb"; -/** - * Enum value "mssql" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_MSSQL = "mssql"; -/** - * Enum value "mssqlcompact" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_MSSQLCOMPACT = "mssqlcompact"; -/** - * Enum value "mysql" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_MYSQL = "mysql"; -/** - * Enum value "neo4j" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_NEO4J = "neo4j"; -/** - * Enum value "netezza" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_NETEZZA = "netezza"; -/** - * Enum value "opensearch" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_OPENSEARCH = "opensearch"; -/** - * Enum value "oracle" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_ORACLE = "oracle"; -/** - * Enum value "other_sql" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_OTHER_SQL = "other_sql"; -/** - * Enum value "pervasive" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_PERVASIVE = "pervasive"; -/** - * Enum value "pointbase" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_POINTBASE = "pointbase"; -/** - * Enum value "postgresql" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_POSTGRESQL = "postgresql"; -/** - * Enum value "progress" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_PROGRESS = "progress"; -/** - * Enum value "redis" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_REDIS = "redis"; -/** - * Enum value "redshift" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_REDSHIFT = "redshift"; -/** - * Enum value "spanner" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_SPANNER = "spanner"; -/** - * Enum value "sqlite" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_SQLITE = "sqlite"; -/** - * Enum value "sybase" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_SYBASE = "sybase"; -/** - * Enum value "teradata" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_TERADATA = "teradata"; -/** - * Enum value "trino" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_TRINO = "trino"; -/** - * Enum value "vertica" for attribute {@link ATTR_DB_SYSTEM}. - */ -exports.DB_SYSTEM_VALUE_VERTICA = "vertica"; -/** - * Deprecated, no replacement at this time. - * - * @example readonly_user - * - * @example reporting_user - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * No replacement at this time. - */ -exports.ATTR_DB_USER = 'db.user'; -/** - * 'Deprecated, use `deployment.environment.name` instead.' - * - * @example staging - * - * @example production - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Deprecated, use `deployment.environment.name` instead. - */ -exports.ATTR_DEPLOYMENT_ENVIRONMENT = 'deployment.environment'; -/** - * Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). - * - * @example staging - * - * @example production - * - * @note `deployment.environment.name` does not affect the uniqueness constraints defined through - * the `service.namespace`, `service.name` and `service.instance.id` resource attributes. - * This implies that resources carrying the following attribute combinations **MUST** be - * considered to be identifying the same service: - * - * * `service.name=frontend`, `deployment.environment.name=production` - * * `service.name=frontend`, `deployment.environment.name=staging`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DEPLOYMENT_ENVIRONMENT_NAME = 'deployment.environment.name'; -/** - * The id of the deployment. - * - * @example 1208 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DEPLOYMENT_ID = 'deployment.id'; -/** - * The name of the deployment. - * - * @example deploy my app - * - * @example deploy-frontend - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DEPLOYMENT_NAME = 'deployment.name'; -/** - * The status of the deployment. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DEPLOYMENT_STATUS = 'deployment.status'; -/** - * Enum value "failed" for attribute {@link ATTR_DEPLOYMENT_STATUS}. - */ -exports.DEPLOYMENT_STATUS_VALUE_FAILED = "failed"; -/** - * Enum value "succeeded" for attribute {@link ATTR_DEPLOYMENT_STATUS}. - */ -exports.DEPLOYMENT_STATUS_VALUE_SUCCEEDED = "succeeded"; -/** - * Destination address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - * - * @example destination.example.com - * - * @example 10.1.2.80 - * - * @example /tmp/my.sock - * - * @note When observed from the source side, and when communicating through an intermediary, `destination.address` **SHOULD** represent the destination address behind any intermediaries, for example proxies, if it's available. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DESTINATION_ADDRESS = 'destination.address'; -/** - * Destination port number - * - * @example 3389 - * - * @example 2888 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DESTINATION_PORT = 'destination.port'; -/** - * A unique identifier representing the device - * - * @example 2ab2916d-a51f-4ac8-80ee-45ac31a28092 - * - * @note The device identifier **MUST** only be defined using the values outlined below. This value is not an advertising identifier and **MUST** **NOT** be used as such. On iOS (Swift or Objective-C), this value **MUST** be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value **MUST** be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DEVICE_ID = 'device.id'; -/** - * The name of the device manufacturer - * - * @example Apple - * - * @example Samsung - * - * @note The Android OS provides this field via [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). iOS apps **SHOULD** hardcode the value `Apple`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DEVICE_MANUFACTURER = 'device.manufacturer'; -/** - * The model identifier for the device - * - * @example iPhone3,4 - * - * @example SM-G920F - * - * @note It's recommended this value represents a machine-readable version of the model identifier rather than the market or consumer-friendly name of the device. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DEVICE_MODEL_IDENTIFIER = 'device.model.identifier'; -/** - * The marketing name for the device model - * - * @example iPhone 6s Plus - * - * @example Samsung Galaxy S6 - * - * @note It's recommended this value represents a human-readable version of the device model rather than a machine-readable alternative. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DEVICE_MODEL_NAME = 'device.model.name'; -/** - * The disk IO operation direction. - * - * @example read - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DISK_IO_DIRECTION = 'disk.io.direction'; -/** - * Enum value "read" for attribute {@link ATTR_DISK_IO_DIRECTION}. - */ -exports.DISK_IO_DIRECTION_VALUE_READ = "read"; -/** - * Enum value "write" for attribute {@link ATTR_DISK_IO_DIRECTION}. - */ -exports.DISK_IO_DIRECTION_VALUE_WRITE = "write"; -/** - * The name being queried. - * - * @example www.example.com - * - * @example opentelemetry.io - * - * @note If the name field contains non-printable characters (below 32 or above 126), those characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n respectively. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_DNS_QUESTION_NAME = 'dns.question.name'; -/** - * Deprecated, use `user.id` instead. - * - * @example "username" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `user.id` attribute. - */ -exports.ATTR_ENDUSER_ID = 'enduser.id'; -/** - * Deprecated, use `user.roles` instead. - * - * @example "admin" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `user.roles` attribute. - */ -exports.ATTR_ENDUSER_ROLE = 'enduser.role'; -/** - * Deprecated, no replacement at this time. - * - * @example "read:message, write:files" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Removed. - */ -exports.ATTR_ENDUSER_SCOPE = 'enduser.scope'; -/** - * Identifies the class / type of event. - * - * @example browser.mouse.click - * - * @example device.app.lifecycle - * - * @note Event names are subject to the same rules as [attribute names](/docs/general/attribute-naming.md). Notably, event names are namespaced to avoid collisions and provide a clean separation of semantics for events in separate domains like browser, mobile, and kubernetes. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_EVENT_NAME = 'event.name'; -/** - * A boolean that is true if the serverless function is executed for the first time (aka cold-start). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_COLDSTART = 'faas.coldstart'; -/** - * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - * - * @example "0/5 * * * ? *" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_CRON = 'faas.cron'; -/** - * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. - * - * @example myBucketName - * - * @example myDbName - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_DOCUMENT_COLLECTION = 'faas.document.collection'; -/** - * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. - * - * @example myFile.txt - * - * @example myTableName - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_DOCUMENT_NAME = 'faas.document.name'; -/** - * Describes the type of the operation that was performed on the data. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_DOCUMENT_OPERATION = 'faas.document.operation'; -/** - * Enum value "delete" for attribute {@link ATTR_FAAS_DOCUMENT_OPERATION}. - */ -exports.FAAS_DOCUMENT_OPERATION_VALUE_DELETE = "delete"; -/** - * Enum value "edit" for attribute {@link ATTR_FAAS_DOCUMENT_OPERATION}. - */ -exports.FAAS_DOCUMENT_OPERATION_VALUE_EDIT = "edit"; -/** - * Enum value "insert" for attribute {@link ATTR_FAAS_DOCUMENT_OPERATION}. - */ -exports.FAAS_DOCUMENT_OPERATION_VALUE_INSERT = "insert"; -/** - * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - * - * @example "2020-01-23T13:47:06Z" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_DOCUMENT_TIME = 'faas.document.time'; -/** - * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. - * - * @example 2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de - * - * @note * **AWS Lambda:** Use the (full) log stream name. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_INSTANCE = 'faas.instance'; -/** - * The invocation ID of the current function invocation. - * - * @example "af9d5aa4-a685-4c5f-a22b-444f80b3cc28" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_INVOCATION_ID = 'faas.invocation_id'; -/** - * The name of the invoked function. - * - * @example "my-function" - * - * @note SHOULD be equal to the `faas.name` resource attribute of the invoked function. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_INVOKED_NAME = 'faas.invoked_name'; -/** - * The cloud provider of the invoked function. - * - * @note SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_INVOKED_PROVIDER = 'faas.invoked_provider'; -/** - * Enum value "alibaba_cloud" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. - */ -exports.FAAS_INVOKED_PROVIDER_VALUE_ALIBABA_CLOUD = "alibaba_cloud"; -/** - * Enum value "aws" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. - */ -exports.FAAS_INVOKED_PROVIDER_VALUE_AWS = "aws"; -/** - * Enum value "azure" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. - */ -exports.FAAS_INVOKED_PROVIDER_VALUE_AZURE = "azure"; -/** - * Enum value "gcp" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. - */ -exports.FAAS_INVOKED_PROVIDER_VALUE_GCP = "gcp"; -/** - * Enum value "tencent_cloud" for attribute {@link ATTR_FAAS_INVOKED_PROVIDER}. - */ -exports.FAAS_INVOKED_PROVIDER_VALUE_TENCENT_CLOUD = "tencent_cloud"; -/** - * The cloud region of the invoked function. - * - * @example "eu-central-1" - * - * @note SHOULD be equal to the `cloud.region` resource attribute of the invoked function. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_INVOKED_REGION = 'faas.invoked_region'; -/** - * The amount of memory available to the serverless function converted to Bytes. - * - * @example 134217728 - * - * @note It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be multiplied by 1,048,576). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_MAX_MEMORY = 'faas.max_memory'; -/** - * The name of the single function that this runtime instance executes. - * - * @example my-function - * - * @example myazurefunctionapp/some-function-name - * - * @note This is the name of the function as configured/deployed on the FaaS - * platform and is usually different from the name of the callback - * function (which may be stored in the - * [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) - * span attributes). - * - * For some cloud providers, the above definition is ambiguous. The following - * definition of function name **MUST** be used for this attribute - * (and consequently the span name) for the listed cloud providers/products: - * - * * **Azure:** The full name `/`, i.e., function app name - * followed by a forward slash followed by the function name (this form - * can also be seen in the resource JSON for the function). - * This means that a span attribute **MUST** be used, as an Azure function - * app can host multiple functions that would usually share - * a TracerProvider (see also the `cloud.resource_id` attribute). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_NAME = 'faas.name'; -/** - * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - * - * @example "2020-01-23T13:47:06Z" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_TIME = 'faas.time'; -/** - * Type of the trigger which caused this function invocation. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_TRIGGER = 'faas.trigger'; -/** - * Enum value "datasource" for attribute {@link ATTR_FAAS_TRIGGER}. - */ -exports.FAAS_TRIGGER_VALUE_DATASOURCE = "datasource"; -/** - * Enum value "http" for attribute {@link ATTR_FAAS_TRIGGER}. - */ -exports.FAAS_TRIGGER_VALUE_HTTP = "http"; -/** - * Enum value "other" for attribute {@link ATTR_FAAS_TRIGGER}. - */ -exports.FAAS_TRIGGER_VALUE_OTHER = "other"; -/** - * Enum value "pubsub" for attribute {@link ATTR_FAAS_TRIGGER}. - */ -exports.FAAS_TRIGGER_VALUE_PUBSUB = "pubsub"; -/** - * Enum value "timer" for attribute {@link ATTR_FAAS_TRIGGER}. - */ -exports.FAAS_TRIGGER_VALUE_TIMER = "timer"; -/** - * The immutable version of the function being executed. - * - * @example 26 - * - * @example pinkfroid-00002 - * - * @note Depending on the cloud provider and platform, use: - * - * * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - * (an integer represented as a decimal string). - * * **Google Cloud Run (Services):** The [revision](https://cloud.google.com/run/docs/managing/revisions) - * (i.e., the function name plus the revision suffix). - * * **Google Cloud Functions:** The value of the - * [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - * * **Azure Functions:** Not applicable. Do not set this attribute. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FAAS_VERSION = 'faas.version'; -/** - * The unique identifier of the feature flag. - * - * @example logo-color - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FEATURE_FLAG_KEY = 'feature_flag.key'; -/** - * The name of the service provider that performs the flag evaluation. - * - * @example Flag Manager - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FEATURE_FLAG_PROVIDER_NAME = 'feature_flag.provider_name'; -/** - * **SHOULD** be a semantic identifier for a value. If one is unavailable, a stringified version of the value can be used. - * - * @example red - * - * @example true - * - * @example on - * - * @note A semantic identifier, commonly referred to as a variant, provides a means - * for referring to a value without including the value itself. This can - * provide additional context for understanding the meaning behind a value. - * For example, the variant `red` maybe be used for the value `#c05543`. - * - * A stringified version of the value can be used in situations where a - * semantic identifier is unavailable. String representation of the value - * should be determined by the implementer. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FEATURE_FLAG_VARIANT = 'feature_flag.variant'; -/** - * Directory where the file is located. It should include the drive letter, when appropriate. - * - * @example /home/user - * - * @example C:\Program Files\MyApp - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FILE_DIRECTORY = 'file.directory'; -/** - * File extension, excluding the leading dot. - * - * @example png - * - * @example gz - * - * @note When the file name has multiple extensions (example.tar.gz), only the last one should be captured ("gz", not "tar.gz"). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FILE_EXTENSION = 'file.extension'; -/** - * Name of the file including the extension, without the directory. - * - * @example example.png - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FILE_NAME = 'file.name'; -/** - * Full path to the file, including the file name. It should include the drive letter, when appropriate. - * - * @example /home/alice/example.png - * - * @example C:\Program Files\MyApp\myapp.exe - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FILE_PATH = 'file.path'; -/** - * File size in bytes. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_FILE_SIZE = 'file.size'; -/** - * Identifies the Google Cloud service for which the official client library is intended. - * - * @example appengine - * - * @example run - * - * @example firestore - * - * @example alloydb - * - * @example spanner - * - * @note Intended to be a stable identifier for Google Cloud client libraries that is uniform across implementation languages. The value should be derived from the canonical service domain for the service; for example, 'foo.googleapis.com' should result in a value of 'foo'. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GCP_CLIENT_SERVICE = 'gcp.client.service'; -/** - * The name of the Cloud Run [execution](https://cloud.google.com/run/docs/managing/job-executions) being run for the Job, as set by the [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. - * - * @example job-name-xxxx - * - * @example sample-job-mdw84 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GCP_CLOUD_RUN_JOB_EXECUTION = 'gcp.cloud_run.job.execution'; -/** - * The index for a task within an execution as provided by the [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) environment variable. - * - * @example 0 - * - * @example 1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GCP_CLOUD_RUN_JOB_TASK_INDEX = 'gcp.cloud_run.job.task_index'; -/** - * The hostname of a GCE instance. This is the full value of the default or [custom hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). - * - * @example my-host1234.example.com - * - * @example sample-vm.us-west1-b.c.my-project.internal - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GCP_GCE_INSTANCE_HOSTNAME = 'gcp.gce.instance.hostname'; -/** - * The instance name of a GCE instance. This is the value provided by `host.name`, the visible name of the instance in the Cloud Console UI, and the prefix for the default hostname of the instance as defined by the [default internal DNS name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). - * - * @example instance-1 - * - * @example my-vm-name - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GCP_GCE_INSTANCE_NAME = 'gcp.gce.instance.name'; -/** - * The full response received from the GenAI model. - * - * @example [{'role': 'assistant', 'content': 'The capital of France is Paris.'}] - * - * @note It's RECOMMENDED to format completions as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_COMPLETION = 'gen_ai.completion'; -/** - * The name of the operation being performed. - * - * @note If one of the predefined values applies, but specific system uses a different name it's RECOMMENDED to document it in the semantic conventions for specific GenAI system and use system-specific name in the instrumentation. If a different name is not documented, instrumentation libraries **SHOULD** use applicable predefined value. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_OPERATION_NAME = 'gen_ai.operation.name'; -/** - * Enum value "chat" for attribute {@link ATTR_GEN_AI_OPERATION_NAME}. - */ -exports.GEN_AI_OPERATION_NAME_VALUE_CHAT = "chat"; -/** - * Enum value "text_completion" for attribute {@link ATTR_GEN_AI_OPERATION_NAME}. - */ -exports.GEN_AI_OPERATION_NAME_VALUE_TEXT_COMPLETION = "text_completion"; -/** - * The full prompt sent to the GenAI model. - * - * @example [{'role': 'user', 'content': 'What is the capital of France?'}] - * - * @note It's RECOMMENDED to format prompts as JSON string matching [OpenAI messages format](https://platform.openai.com/docs/guides/text-generation) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_PROMPT = 'gen_ai.prompt'; -/** - * The frequency penalty setting for the GenAI request. - * - * @example 0.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY = 'gen_ai.request.frequency_penalty'; -/** - * The maximum number of tokens the model generates for a request. - * - * @example 100 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_REQUEST_MAX_TOKENS = 'gen_ai.request.max_tokens'; -/** - * The name of the GenAI model a request is being made to. - * - * @example "gpt-4" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_REQUEST_MODEL = 'gen_ai.request.model'; -/** - * The presence penalty setting for the GenAI request. - * - * @example 0.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY = 'gen_ai.request.presence_penalty'; -/** - * List of sequences that the model will use to stop generating further tokens. - * - * @example forest - * - * @example lived - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_REQUEST_STOP_SEQUENCES = 'gen_ai.request.stop_sequences'; -/** - * The temperature setting for the GenAI request. - * - * @example 0.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_REQUEST_TEMPERATURE = 'gen_ai.request.temperature'; -/** - * The top_k sampling setting for the GenAI request. - * - * @example 1.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_REQUEST_TOP_K = 'gen_ai.request.top_k'; -/** - * The top_p sampling setting for the GenAI request. - * - * @example 1.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_REQUEST_TOP_P = 'gen_ai.request.top_p'; -/** - * Array of reasons the model stopped generating tokens, corresponding to each generation received. - * - * @example stop - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_RESPONSE_FINISH_REASONS = 'gen_ai.response.finish_reasons'; -/** - * The unique identifier for the completion. - * - * @example chatcmpl-123 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_RESPONSE_ID = 'gen_ai.response.id'; -/** - * The name of the model that generated the response. - * - * @example gpt-4-0613 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_RESPONSE_MODEL = 'gen_ai.response.model'; -/** - * The Generative AI product as identified by the client or server instrumentation. - * - * @example "openai" - * - * @note The `gen_ai.system` describes a family of GenAI models with specific model identified - * by `gen_ai.request.model` and `gen_ai.response.model` attributes. - * - * The actual GenAI product may differ from the one identified by the client. - * For example, when using OpenAI client libraries to communicate with Mistral, the `gen_ai.system` - * is set to `openai` based on the instrumentation's best knowledge. - * - * For custom model, a custom friendly name **SHOULD** be used. - * If none of these options apply, the `gen_ai.system` **SHOULD** be set to `_OTHER`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_SYSTEM = 'gen_ai.system'; -/** - * Enum value "anthropic" for attribute {@link ATTR_GEN_AI_SYSTEM}. - */ -exports.GEN_AI_SYSTEM_VALUE_ANTHROPIC = "anthropic"; -/** - * Enum value "cohere" for attribute {@link ATTR_GEN_AI_SYSTEM}. - */ -exports.GEN_AI_SYSTEM_VALUE_COHERE = "cohere"; -/** - * Enum value "openai" for attribute {@link ATTR_GEN_AI_SYSTEM}. - */ -exports.GEN_AI_SYSTEM_VALUE_OPENAI = "openai"; -/** - * Enum value "vertex_ai" for attribute {@link ATTR_GEN_AI_SYSTEM}. - */ -exports.GEN_AI_SYSTEM_VALUE_VERTEX_AI = "vertex_ai"; -/** - * The type of token being counted. - * - * @example input - * - * @example output - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_TOKEN_TYPE = 'gen_ai.token.type'; -/** - * Enum value "input" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}. - */ -exports.GEN_AI_TOKEN_TYPE_VALUE_INPUT = "input"; -/** - * Enum value "output" for attribute {@link ATTR_GEN_AI_TOKEN_TYPE}. - */ -exports.GEN_AI_TOKEN_TYPE_VALUE_COMPLETION = "output"; -/** - * Deprecated, use `gen_ai.usage.output_tokens` instead. - * - * @example 42 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `gen_ai.usage.output_tokens` attribute. - */ -exports.ATTR_GEN_AI_USAGE_COMPLETION_TOKENS = 'gen_ai.usage.completion_tokens'; -/** - * The number of tokens used in the GenAI input (prompt). - * - * @example 100 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_USAGE_INPUT_TOKENS = 'gen_ai.usage.input_tokens'; -/** - * The number of tokens used in the GenAI response (completion). - * - * @example 180 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GEN_AI_USAGE_OUTPUT_TOKENS = 'gen_ai.usage.output_tokens'; -/** - * Deprecated, use `gen_ai.usage.input_tokens` instead. - * - * @example 42 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `gen_ai.usage.input_tokens` attribute. - */ -exports.ATTR_GEN_AI_USAGE_PROMPT_TOKENS = 'gen_ai.usage.prompt_tokens'; -/** - * The type of memory. - * - * @example other - * - * @example stack - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GO_MEMORY_TYPE = 'go.memory.type'; -/** - * Enum value "other" for attribute {@link ATTR_GO_MEMORY_TYPE}. - */ -exports.GO_MEMORY_TYPE_VALUE_OTHER = "other"; -/** - * Enum value "stack" for attribute {@link ATTR_GO_MEMORY_TYPE}. - */ -exports.GO_MEMORY_TYPE_VALUE_STACK = "stack"; -/** - * The GraphQL document being executed. - * - * @example "query findBookById { bookById(id: ?) { name } }" - * - * @note The value may be sanitized to exclude sensitive information. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GRAPHQL_DOCUMENT = 'graphql.document'; -/** - * The name of the operation being executed. - * - * @example "findBookById" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GRAPHQL_OPERATION_NAME = 'graphql.operation.name'; -/** - * The type of the operation being executed. - * - * @example query - * - * @example mutation - * - * @example subscription - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_GRAPHQL_OPERATION_TYPE = 'graphql.operation.type'; -/** - * Enum value "mutation" for attribute {@link ATTR_GRAPHQL_OPERATION_TYPE}. - */ -exports.GRAPHQL_OPERATION_TYPE_VALUE_MUTATION = "mutation"; -/** - * Enum value "query" for attribute {@link ATTR_GRAPHQL_OPERATION_TYPE}. - */ -exports.GRAPHQL_OPERATION_TYPE_VALUE_QUERY = "query"; -/** - * Enum value "subscription" for attribute {@link ATTR_GRAPHQL_OPERATION_TYPE}. - */ -exports.GRAPHQL_OPERATION_TYPE_VALUE_SUBSCRIPTION = "subscription"; -/** - * Unique identifier for the application - * - * @example 2daa2797-e42b-4624-9322-ec3f968df4da - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HEROKU_APP_ID = 'heroku.app.id'; -/** - * Commit hash for the current release - * - * @example e6134959463efd8966b20e75b913cafe3f5ec - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HEROKU_RELEASE_COMMIT = 'heroku.release.commit'; -/** - * Time and date the release was created - * - * @example 2022-10-23T18:00:42Z - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HEROKU_RELEASE_CREATION_TIMESTAMP = 'heroku.release.creation_timestamp'; -/** - * 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'; -/** - * Enum value "amd64" for attribute {@link ATTR_HOST_ARCH}. - */ -exports.HOST_ARCH_VALUE_AMD64 = "amd64"; -/** - * Enum value "arm32" for attribute {@link ATTR_HOST_ARCH}. - */ -exports.HOST_ARCH_VALUE_ARM32 = "arm32"; -/** - * Enum value "arm64" for attribute {@link ATTR_HOST_ARCH}. - */ -exports.HOST_ARCH_VALUE_ARM64 = "arm64"; -/** - * Enum value "ia64" for attribute {@link ATTR_HOST_ARCH}. - */ -exports.HOST_ARCH_VALUE_IA64 = "ia64"; -/** - * Enum value "ppc32" for attribute {@link ATTR_HOST_ARCH}. - */ -exports.HOST_ARCH_VALUE_PPC32 = "ppc32"; -/** - * Enum value "ppc64" for attribute {@link ATTR_HOST_ARCH}. - */ -exports.HOST_ARCH_VALUE_PPC64 = "ppc64"; -/** - * Enum value "s390x" for attribute {@link ATTR_HOST_ARCH}. - */ -exports.HOST_ARCH_VALUE_S390X = "s390x"; -/** - * Enum value "x86" for attribute {@link ATTR_HOST_ARCH}. - */ -exports.HOST_ARCH_VALUE_X86 = "x86"; -/** - * The amount of level 2 memory cache available to the processor (in Bytes). - * - * @example 12288000 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HOST_CPU_CACHE_L2_SIZE = 'host.cpu.cache.l2.size'; -/** - * Family or generation of the CPU. - * - * @example 6 - * - * @example PA-RISC 1.1e - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HOST_CPU_FAMILY = 'host.cpu.family'; -/** - * Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. - * - * @example 6 - * - * @example 9000/778/B180L - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HOST_CPU_MODEL_ID = 'host.cpu.model.id'; -/** - * Model designation of the processor. - * - * @example 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HOST_CPU_MODEL_NAME = 'host.cpu.model.name'; -/** - * Stepping or core revisions. - * - * @example 1 - * - * @example r1p1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HOST_CPU_STEPPING = 'host.cpu.stepping'; -/** - * Processor manufacturer identifier. A maximum 12-character string. - * - * @example GenuineIntel - * - * @note [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HOST_CPU_VENDOR_ID = 'host.cpu.vendor.id'; -/** - * 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'; -/** - * Available IP addresses of the host, excluding loopback interfaces. - * - * @example 192.168.1.140 - * - * @example fe80::abc2:4a28:737a:609e - * - * @note IPv4 Addresses **MUST** be specified in dotted-quad notation. IPv6 addresses **MUST** be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HOST_IP = 'host.ip'; -/** - * Available MAC addresses of the host, excluding loopback interfaces. - * - * @example AC-DE-48-23-45-67 - * - * @example AC-DE-48-23-45-67-01-9F - * - * @note MAC Addresses **MUST** be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HOST_MAC = 'host.mac'; -/** - * 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'; -/** - * Deprecated, use `client.address` instead. - * - * @example "83.164.160.102" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `client.address`. - */ -exports.ATTR_HTTP_CLIENT_IP = 'http.client_ip'; -/** - * State of the HTTP connection in the HTTP connection pool. - * - * @example active - * - * @example idle - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HTTP_CONNECTION_STATE = 'http.connection.state'; -/** - * Enum value "active" for attribute {@link ATTR_HTTP_CONNECTION_STATE}. - */ -exports.HTTP_CONNECTION_STATE_VALUE_ACTIVE = "active"; -/** - * Enum value "idle" for attribute {@link ATTR_HTTP_CONNECTION_STATE}. - */ -exports.HTTP_CONNECTION_STATE_VALUE_IDLE = "idle"; -/** - * Deprecated, use `network.protocol.name` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.protocol.name`. - */ -exports.ATTR_HTTP_FLAVOR = 'http.flavor'; -/** - * Enum value "1.0" for attribute {@link ATTR_HTTP_FLAVOR}. - */ -exports.HTTP_FLAVOR_VALUE_HTTP_1_0 = "1.0"; -/** - * Enum value "1.1" for attribute {@link ATTR_HTTP_FLAVOR}. - */ -exports.HTTP_FLAVOR_VALUE_HTTP_1_1 = "1.1"; -/** - * Enum value "2.0" for attribute {@link ATTR_HTTP_FLAVOR}. - */ -exports.HTTP_FLAVOR_VALUE_HTTP_2_0 = "2.0"; -/** - * Enum value "3.0" for attribute {@link ATTR_HTTP_FLAVOR}. - */ -exports.HTTP_FLAVOR_VALUE_HTTP_3_0 = "3.0"; -/** - * Enum value "QUIC" for attribute {@link ATTR_HTTP_FLAVOR}. - */ -exports.HTTP_FLAVOR_VALUE_QUIC = "QUIC"; -/** - * Enum value "SPDY" for attribute {@link ATTR_HTTP_FLAVOR}. - */ -exports.HTTP_FLAVOR_VALUE_SPDY = "SPDY"; -/** - * Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage. - * - * @example www.example.org - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by one of `server.address`, `client.address` or `http.request.header.host`, depending on the usage. - */ -exports.ATTR_HTTP_HOST = 'http.host'; -/** - * Deprecated, use `http.request.method` instead. - * - * @example GET - * - * @example POST - * - * @example HEAD - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `http.request.method`. - */ -exports.ATTR_HTTP_METHOD = 'http.method'; -/** - * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - * - * @example 3495 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HTTP_REQUEST_BODY_SIZE = 'http.request.body.size'; -/** - * The total size of the request in bytes. This should be the total number of bytes sent over the wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request body if any. - * - * @example 1437 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HTTP_REQUEST_SIZE = 'http.request.size'; -/** - * Deprecated, use `http.request.header.content-length` instead. - * - * @example 3495 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `http.request.header.content-length`. - */ -exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length'; -/** - * Deprecated, use `http.request.body.size` instead. - * - * @example 5493 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `http.request.body.size`. - */ -exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = 'http.request_content_length_uncompressed'; -/** - * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - * - * @example 3495 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HTTP_RESPONSE_BODY_SIZE = 'http.response.body.size'; -/** - * The total size of the response in bytes. This should be the total number of bytes sent over the wire, including the status line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and response body and trailers if any. - * - * @example 1437 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_HTTP_RESPONSE_SIZE = 'http.response.size'; -/** - * Deprecated, use `http.response.header.content-length` instead. - * - * @example 3495 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `http.response.header.content-length`. - */ -exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length'; -/** - * Deprecated, use `http.response.body.size` instead. - * - * @example 5493 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replace by `http.response.body.size`. - */ -exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed'; -/** - * Deprecated, use `url.scheme` instead. - * - * @example http - * - * @example https - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `url.scheme` instead. - */ -exports.ATTR_HTTP_SCHEME = 'http.scheme'; -/** - * Deprecated, use `server.address` instead. - * - * @example example.com - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `server.address`. - */ -exports.ATTR_HTTP_SERVER_NAME = 'http.server_name'; -/** - * Deprecated, use `http.response.status_code` instead. - * - * @example 200 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `http.response.status_code`. - */ -exports.ATTR_HTTP_STATUS_CODE = 'http.status_code'; -/** - * Deprecated, use `url.path` and `url.query` instead. - * - * @example /search?q=OpenTelemetry#SemConv - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Split to `url.path` and `url.query. - */ -exports.ATTR_HTTP_TARGET = 'http.target'; -/** - * Deprecated, use `url.full` instead. - * - * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `url.full`. - */ -exports.ATTR_HTTP_URL = 'http.url'; -/** - * Deprecated, use `user_agent.original` instead. - * - * @example CERN-LineMode/2.15 libwww/2.17b3 - * - * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `user_agent.original`. - */ -exports.ATTR_HTTP_USER_AGENT = 'http.user_agent'; -/** - * Deprecated use the `device.app.lifecycle` event definition including `ios.state` as a payload field instead. - * - * @note The iOS lifecycle states are defined in the [UIApplicationDelegate documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), and from which the `OS terminology` column values are derived. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Moved to a payload field of `device.app.lifecycle`. - */ -exports.ATTR_IOS_STATE = 'ios.state'; -/** - * Enum value "active" for attribute {@link ATTR_IOS_STATE}. - */ -exports.IOS_STATE_VALUE_ACTIVE = "active"; -/** - * Enum value "background" for attribute {@link ATTR_IOS_STATE}. - */ -exports.IOS_STATE_VALUE_BACKGROUND = "background"; -/** - * Enum value "foreground" for attribute {@link ATTR_IOS_STATE}. - */ -exports.IOS_STATE_VALUE_FOREGROUND = "foreground"; -/** - * Enum value "inactive" for attribute {@link ATTR_IOS_STATE}. - */ -exports.IOS_STATE_VALUE_INACTIVE = "inactive"; -/** - * Enum value "terminate" for attribute {@link ATTR_IOS_STATE}. - */ -exports.IOS_STATE_VALUE_TERMINATE = "terminate"; -/** - * Name of the buffer pool. - * - * @example mapped - * - * @example direct - * - * @note Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_JVM_BUFFER_POOL_NAME = 'jvm.buffer.pool.name'; -/** - * 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'; -/** - * A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. - * - * @example 218fc5a9-a5f1-4b54-aa05-46717d0ab26d - * - * @note K8s doesn't have support for obtaining a cluster ID. If this is ever - * added, we will recommend collecting the `k8s.cluster.uid` through the - * official APIs. In the meantime, we are able to use the `uid` of the - * `kube-system` namespace as a proxy for cluster ID. Read on for the - * rationale. - * - * Every object created in a K8s cluster is assigned a distinct UID. The - * `kube-system` namespace is used by Kubernetes itself and will exist - * for the lifetime of the cluster. Using the `uid` of the `kube-system` - * namespace is a reasonable proxy for the K8s ClusterID as it will only - * change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are - * UUIDs as standardized by - * [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). - * Which states: - * - * > If generated according to one of the mechanisms defined in Rec. - * ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be - * different from all other UUIDs generated before 3603 A.D., or is - * extremely likely to be different (depending on the mechanism chosen). - * - * Therefore, UIDs between clusters should be extremely unlikely to - * conflict. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_CLUSTER_UID = 'k8s.cluster.uid'; -/** - * The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). - * - * @example redis - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_CONTAINER_NAME = 'k8s.container.name'; -/** - * Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_CONTAINER_RESTART_COUNT = 'k8s.container.restart_count'; -/** - * Last terminated reason of the Container. - * - * @example Evicted - * - * @example Error - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_CONTAINER_STATUS_LAST_TERMINATED_REASON = 'k8s.container.status.last_terminated_reason'; -/** - * The name of the CronJob. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_CRONJOB_NAME = 'k8s.cronjob.name'; -/** - * The UID of the CronJob. - * - * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_CRONJOB_UID = 'k8s.cronjob.uid'; -/** - * The name of the DaemonSet. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; -/** - * The UID of the DaemonSet. - * - * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_DAEMONSET_UID = 'k8s.daemonset.uid'; -/** - * 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 UID of the Deployment. - * - * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'; -/** - * The name of the Job. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_JOB_NAME = 'k8s.job.name'; -/** - * The UID of the Job. - * - * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_JOB_UID = 'k8s.job.uid'; -/** - * 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 Node. - * - * @example node-1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_NODE_NAME = 'k8s.node.name'; -/** - * The UID of the Node. - * - * @example 1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_NODE_UID = 'k8s.node.uid'; -/** - * The annotation key-value pairs placed on the Pod, the `` being the annotation name, the value being the annotation value. - * - * @example k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets=true - * - * @example k8s.pod.annotation.mycompany.io/arch=x64 - * - * @example k8s.pod.annotation.data= - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_K8S_POD_ANNOTATION = (key) => `k8s.pod.annotation.${key}`; -exports.ATTR_K8S_POD_ANNOTATION = ATTR_K8S_POD_ANNOTATION; -/** - * The label key-value pairs placed on the Pod, the `` being the label name, the value being the label value. - * - * @example k8s.pod.label.app=my-app - * - * @example k8s.pod.label.mycompany.io/arch=x64 - * - * @example k8s.pod.label.data= - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_K8S_POD_LABEL = (key) => `k8s.pod.label.${key}`; -exports.ATTR_K8S_POD_LABEL = ATTR_K8S_POD_LABEL; -/** - * Deprecated, use `k8s.pod.label` instead. - * - * @example k8s.pod.label.app=my-app - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `k8s.pod.label`. - */ -const ATTR_K8S_POD_LABELS = (key) => `k8s.pod.labels.${key}`; -exports.ATTR_K8S_POD_LABELS = ATTR_K8S_POD_LABELS; -/** - * 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 UID of the Pod. - * - * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_POD_UID = 'k8s.pod.uid'; -/** - * The name of the ReplicaSet. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_REPLICASET_NAME = 'k8s.replicaset.name'; -/** - * The UID of the ReplicaSet. - * - * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_REPLICASET_UID = 'k8s.replicaset.uid'; -/** - * The name of the StatefulSet. - * - * @example opentelemetry - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; -/** - * The UID of the StatefulSet. - * - * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_K8S_STATEFULSET_UID = 'k8s.statefulset.uid'; -/** - * The Linux Slab memory state - * - * @example reclaimable - * - * @example unreclaimable - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_LINUX_MEMORY_SLAB_STATE = 'linux.memory.slab.state'; -/** - * Enum value "reclaimable" for attribute {@link ATTR_LINUX_MEMORY_SLAB_STATE}. - */ -exports.LINUX_MEMORY_SLAB_STATE_VALUE_RECLAIMABLE = "reclaimable"; -/** - * Enum value "unreclaimable" for attribute {@link ATTR_LINUX_MEMORY_SLAB_STATE}. - */ -exports.LINUX_MEMORY_SLAB_STATE_VALUE_UNRECLAIMABLE = "unreclaimable"; -/** - * The basename of the file. - * - * @example audit.log - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_LOG_FILE_NAME = 'log.file.name'; -/** - * The basename of the file, with symlinks resolved. - * - * @example uuid.log - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_LOG_FILE_NAME_RESOLVED = 'log.file.name_resolved'; -/** - * The full path to the file. - * - * @example /var/log/mysql/audit.log - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_LOG_FILE_PATH = 'log.file.path'; -/** - * The full path to the file, with symlinks resolved. - * - * @example /var/lib/docker/uuid.log - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_LOG_FILE_PATH_RESOLVED = 'log.file.path_resolved'; -/** - * The stream associated with the log. See below for a list of well-known values. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_LOG_IOSTREAM = 'log.iostream'; -/** - * Enum value "stderr" for attribute {@link ATTR_LOG_IOSTREAM}. - */ -exports.LOG_IOSTREAM_VALUE_STDERR = "stderr"; -/** - * Enum value "stdout" for attribute {@link ATTR_LOG_IOSTREAM}. - */ -exports.LOG_IOSTREAM_VALUE_STDOUT = "stdout"; -/** - * The complete orignal Log Record. - * - * @example 77 <86>1 2015-08-06T21:58:59.694Z 192.168.2.133 inactive - - - Something happened - * - * @example [INFO] 8/3/24 12:34:56 Something happened - * - * @note This value **MAY** be added when processing a Log Record which was originally transmitted as a string or equivalent data type AND the Body field of the Log Record does not contain the same value. (e.g. a syslog or a log record read from a file.) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_LOG_RECORD_ORIGINAL = 'log.record.original'; -/** - * A unique identifier for the Log Record. - * - * @example 01ARZ3NDEKTSV4RRFFQ69G5FAV - * - * @note If an id is provided, other log records with the same id will be considered duplicates and can be removed safely. This means, that two distinguishable log records **MUST** have different values. - * The id **MAY** be an [Universally Unique Lexicographically Sortable Identifier (ULID)](https://github.com/ulid/spec), but other identifiers (e.g. UUID) may be used as needed. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_LOG_RECORD_UID = 'log.record.uid'; -/** - * Deprecated, use `rpc.message.compressed_size` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `rpc.message.compressed_size`. - */ -exports.ATTR_MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'; -/** - * Deprecated, use `rpc.message.id` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `rpc.message.id`. - */ -exports.ATTR_MESSAGE_ID = 'message.id'; -/** - * Deprecated, use `rpc.message.type` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `rpc.message.type`. - */ -exports.ATTR_MESSAGE_TYPE = 'message.type'; -/** - * Enum value "RECEIVED" for attribute {@link ATTR_MESSAGE_TYPE}. - */ -exports.MESSAGE_TYPE_VALUE_RECEIVED = "RECEIVED"; -/** - * Enum value "SENT" for attribute {@link ATTR_MESSAGE_TYPE}. - */ -exports.MESSAGE_TYPE_VALUE_SENT = "SENT"; -/** - * Deprecated, use `rpc.message.uncompressed_size` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `rpc.message.uncompressed_size`. - */ -exports.ATTR_MESSAGE_UNCOMPRESSED_SIZE = 'message.uncompressed_size'; -/** - * The number of messages sent, received, or processed in the scope of the batching operation. - * - * @example 0 - * - * @example 1 - * - * @example 2 - * - * @note Instrumentations **SHOULD** **NOT** set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations **SHOULD** use `messaging.batch.message_count` for batching APIs and **SHOULD** **NOT** use it for single-message APIs. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_BATCH_MESSAGE_COUNT = 'messaging.batch.message_count'; -/** - * A unique identifier for the client that consumes or produces a message. - * - * @example client-5 - * - * @example myhost@8742@s8083jm - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_CLIENT_ID = 'messaging.client.id'; -/** - * The name of the consumer group with which a consumer is associated. - * - * @example my-group - * - * @example indexer - * - * @note Semantic conventions for individual messaging systems **SHOULD** document whether `messaging.consumer.group.name` is applicable and what it means in the context of that system. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_CONSUMER_GROUP_NAME = 'messaging.consumer.group.name'; -/** - * A boolean that is true if the message destination is anonymous (could be unnamed or have auto-generated name). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_DESTINATION_ANONYMOUS = 'messaging.destination.anonymous'; -/** - * The message destination name - * - * @example MyQueue - * - * @example MyTopic - * - * @note Destination name **SHOULD** uniquely identify a specific queue, topic or other entity within the broker. If - * the broker doesn't have such notion, the destination name **SHOULD** uniquely identify the broker. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_DESTINATION_NAME = 'messaging.destination.name'; -/** - * The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`. - * - * @example "1" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_DESTINATION_PARTITION_ID = 'messaging.destination.partition.id'; -/** - * The name of the destination subscription from which a message is consumed. - * - * @example subscription-a - * - * @note Semantic conventions for individual messaging systems **SHOULD** document whether `messaging.destination.subscription.name` is applicable and what it means in the context of that system. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_DESTINATION_SUBSCRIPTION_NAME = 'messaging.destination.subscription.name'; -/** - * Low cardinality representation of the messaging destination name - * - * @example /customers/{customerId} - * - * @note Destination names could be constructed from templates. An example would be a destination name involving a user name or product id. Although the destination name in this case is of high cardinality, the underlying template is of low cardinality and can be effectively used for grouping and aggregation. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_DESTINATION_TEMPLATE = 'messaging.destination.template'; -/** - * A boolean that is true if the message destination is temporary and might not exist anymore after messages are processed. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_DESTINATION_TEMPORARY = 'messaging.destination.temporary'; -/** - * Deprecated, no replacement at this time. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * No replacement at this time. - */ -exports.ATTR_MESSAGING_DESTINATION_PUBLISH_ANONYMOUS = 'messaging.destination_publish.anonymous'; -/** - * Deprecated, no replacement at this time. - * - * @example MyQueue - * - * @example MyTopic - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * No replacement at this time. - */ -exports.ATTR_MESSAGING_DESTINATION_PUBLISH_NAME = 'messaging.destination_publish.name'; -/** - * Deprecated, use `messaging.consumer.group.name` instead. - * - * @example "$Default" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.consumer.group.name`. - */ -exports.ATTR_MESSAGING_EVENTHUBS_CONSUMER_GROUP = 'messaging.eventhubs.consumer.group'; -/** - * The UTC epoch seconds at which the message has been accepted and stored in the entity. - * - * @example 1701393730 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_EVENTHUBS_MESSAGE_ENQUEUED_TIME = 'messaging.eventhubs.message.enqueued_time'; -/** - * The ack deadline in seconds set for the modify ack deadline request. - * - * @example 10 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ACK_DEADLINE = 'messaging.gcp_pubsub.message.ack_deadline'; -/** - * The ack id for a given message. - * - * @example "ack_id" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ACK_ID = 'messaging.gcp_pubsub.message.ack_id'; -/** - * The delivery attempt for a given message. - * - * @example 2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_DELIVERY_ATTEMPT = 'messaging.gcp_pubsub.message.delivery_attempt'; -/** - * The ordering key for a given message. If the attribute is not present, the message does not have an ordering key. - * - * @example "ordering_key" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_GCP_PUBSUB_MESSAGE_ORDERING_KEY = 'messaging.gcp_pubsub.message.ordering_key'; -/** - * Deprecated, use `messaging.consumer.group.name` instead. - * - * @example "my-group" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.consumer.group.name`. - */ -exports.ATTR_MESSAGING_KAFKA_CONSUMER_GROUP = 'messaging.kafka.consumer.group'; -/** - * Deprecated, use `messaging.destination.partition.id` instead. - * - * @example 2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.destination.partition.id`. - */ -exports.ATTR_MESSAGING_KAFKA_DESTINATION_PARTITION = 'messaging.kafka.destination.partition'; -/** - * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute **MUST** **NOT** be set. - * - * @example "myKey" - * - * @note If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key'; -/** - * Deprecated, use `messaging.kafka.offset` instead. - * - * @example 42 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.kafka.offset`. - */ -exports.ATTR_MESSAGING_KAFKA_MESSAGE_OFFSET = 'messaging.kafka.message.offset'; -/** - * A boolean that is true if the message is a tombstone. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone'; -/** - * The offset of a record in the corresponding Kafka partition. - * - * @example 42 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_KAFKA_OFFSET = 'messaging.kafka.offset'; -/** - * The size of the message body in bytes. - * - * @example 1439 - * - * @note This can refer to both the compressed or uncompressed body size. If both sizes are known, the uncompressed - * body size should be used. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_MESSAGE_BODY_SIZE = 'messaging.message.body.size'; -/** - * The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". - * - * @example "MyConversationId" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_MESSAGE_CONVERSATION_ID = 'messaging.message.conversation_id'; -/** - * The size of the message body and metadata in bytes. - * - * @example 2738 - * - * @note This can refer to both the compressed or uncompressed size. If both sizes are known, the uncompressed - * size should be used. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_MESSAGE_ENVELOPE_SIZE = 'messaging.message.envelope.size'; -/** - * A value used by the messaging system as an identifier for the message, represented as a string. - * - * @example "452a7c7c7c7048c2f887f61572b18fc2" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_MESSAGE_ID = 'messaging.message.id'; -/** - * Deprecated, use `messaging.operation.type` instead. - * - * @example publish - * - * @example create - * - * @example process - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.operation.type`. - */ -exports.ATTR_MESSAGING_OPERATION = 'messaging.operation'; -/** - * The system-specific name of the messaging operation. - * - * @example ack - * - * @example nack - * - * @example send - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_OPERATION_NAME = 'messaging.operation.name'; -/** - * A string identifying the type of the messaging operation. - * - * @note If a custom value is used, it **MUST** be of low cardinality. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_OPERATION_TYPE = 'messaging.operation.type'; -/** - * Enum value "create" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. - */ -exports.MESSAGING_OPERATION_TYPE_VALUE_CREATE = "create"; -/** - * Enum value "deliver" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. - */ -exports.MESSAGING_OPERATION_TYPE_VALUE_DELIVER = "deliver"; -/** - * Enum value "process" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. - */ -exports.MESSAGING_OPERATION_TYPE_VALUE_PROCESS = "process"; -/** - * Enum value "publish" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. - */ -exports.MESSAGING_OPERATION_TYPE_VALUE_PUBLISH = "publish"; -/** - * Enum value "receive" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. - */ -exports.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = "receive"; -/** - * Enum value "settle" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}. - */ -exports.MESSAGING_OPERATION_TYPE_VALUE_SETTLE = "settle"; -/** - * RabbitMQ message routing key. - * - * @example "myKey" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = 'messaging.rabbitmq.destination.routing_key'; -/** - * RabbitMQ message delivery tag - * - * @example 123 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_RABBITMQ_MESSAGE_DELIVERY_TAG = 'messaging.rabbitmq.message.delivery_tag'; -/** - * Deprecated, use `messaging.consumer.group.name` instead. - * - * @example "myConsumerGroup" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.consumer.group.name` on the consumer spans. No replacement for producer spans. - */ -exports.ATTR_MESSAGING_ROCKETMQ_CLIENT_GROUP = 'messaging.rocketmq.client_group'; -/** - * Model of message consumption. This only applies to consumer spans. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_ROCKETMQ_CONSUMPTION_MODEL = 'messaging.rocketmq.consumption_model'; -/** - * Enum value "broadcasting" for attribute {@link ATTR_MESSAGING_ROCKETMQ_CONSUMPTION_MODEL}. - */ -exports.MESSAGING_ROCKETMQ_CONSUMPTION_MODEL_VALUE_BROADCASTING = "broadcasting"; -/** - * Enum value "clustering" for attribute {@link ATTR_MESSAGING_ROCKETMQ_CONSUMPTION_MODEL}. - */ -exports.MESSAGING_ROCKETMQ_CONSUMPTION_MODEL_VALUE_CLUSTERING = "clustering"; -/** - * The delay time level for delay message, which determines the message delay time. - * - * @example 3 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_DELAY_TIME_LEVEL = 'messaging.rocketmq.message.delay_time_level'; -/** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - * - * @example 1665987217045 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_DELIVERY_TIMESTAMP = 'messaging.rocketmq.message.delivery_timestamp'; -/** - * It is essential for FIFO message. Messages that belong to the same message group are always processed one by one within the same consumer group. - * - * @example "myMessageGroup" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_GROUP = 'messaging.rocketmq.message.group'; -/** - * Key(s) of message, another way to mark message besides message id. - * - * @example keyA - * - * @example keyB - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_KEYS = 'messaging.rocketmq.message.keys'; -/** - * The secondary classifier of message besides topic. - * - * @example "tagA" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_TAG = 'messaging.rocketmq.message.tag'; -/** - * Type of message. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE = 'messaging.rocketmq.message.type'; -/** - * Enum value "delay" for attribute {@link ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE}. - */ -exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_DELAY = "delay"; -/** - * Enum value "fifo" for attribute {@link ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE}. - */ -exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_FIFO = "fifo"; -/** - * Enum value "normal" for attribute {@link ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE}. - */ -exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_NORMAL = "normal"; -/** - * Enum value "transaction" for attribute {@link ATTR_MESSAGING_ROCKETMQ_MESSAGE_TYPE}. - */ -exports.MESSAGING_ROCKETMQ_MESSAGE_TYPE_VALUE_TRANSACTION = "transaction"; -/** - * Namespace of RocketMQ resources, resources in different namespaces are individual. - * - * @example "myNamespace" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_ROCKETMQ_NAMESPACE = 'messaging.rocketmq.namespace'; -/** - * Deprecated, use `messaging.servicebus.destination.subscription_name` instead. - * - * @example "subscription-a" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.servicebus.destination.subscription_name`. - */ -exports.ATTR_MESSAGING_SERVICEBUS_DESTINATION_SUBSCRIPTION_NAME = 'messaging.servicebus.destination.subscription_name'; -/** - * Describes the [settlement type](https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS = 'messaging.servicebus.disposition_status'; -/** - * Enum value "abandon" for attribute {@link ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. - */ -exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_ABANDON = "abandon"; -/** - * Enum value "complete" for attribute {@link ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. - */ -exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_COMPLETE = "complete"; -/** - * Enum value "dead_letter" for attribute {@link ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. - */ -exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_DEAD_LETTER = "dead_letter"; -/** - * Enum value "defer" for attribute {@link ATTR_MESSAGING_SERVICEBUS_DISPOSITION_STATUS}. - */ -exports.MESSAGING_SERVICEBUS_DISPOSITION_STATUS_VALUE_DEFER = "defer"; -/** - * Number of deliveries that have been attempted for this message. - * - * @example 2 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_SERVICEBUS_MESSAGE_DELIVERY_COUNT = 'messaging.servicebus.message.delivery_count'; -/** - * The UTC epoch seconds at which the message has been accepted and stored in the entity. - * - * @example 1701393730 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_SERVICEBUS_MESSAGE_ENQUEUED_TIME = 'messaging.servicebus.message.enqueued_time'; -/** - * The messaging system as identified by the client instrumentation. - * - * @note The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_MESSAGING_SYSTEM = 'messaging.system'; -/** - * Enum value "activemq" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_ACTIVEMQ = "activemq"; -/** - * Enum value "aws_sqs" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_AWS_SQS = "aws_sqs"; -/** - * Enum value "eventgrid" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_EVENTGRID = "eventgrid"; -/** - * Enum value "eventhubs" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_EVENTHUBS = "eventhubs"; -/** - * Enum value "gcp_pubsub" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_GCP_PUBSUB = "gcp_pubsub"; -/** - * Enum value "jms" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_JMS = "jms"; -/** - * Enum value "kafka" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_KAFKA = "kafka"; -/** - * Enum value "pulsar" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_PULSAR = "pulsar"; -/** - * Enum value "rabbitmq" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_RABBITMQ = "rabbitmq"; -/** - * Enum value "rocketmq" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_ROCKETMQ = "rocketmq"; -/** - * Enum value "servicebus" for attribute {@link ATTR_MESSAGING_SYSTEM}. - */ -exports.MESSAGING_SYSTEM_VALUE_SERVICEBUS = "servicebus"; -/** - * Deprecated, use `network.local.address`. - * - * @example "192.168.0.1" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.local.address`. - */ -exports.ATTR_NET_HOST_IP = 'net.host.ip'; -/** - * Deprecated, use `server.address`. - * - * @example example.com - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `server.address`. - */ -exports.ATTR_NET_HOST_NAME = 'net.host.name'; -/** - * Deprecated, use `server.port`. - * - * @example 8080 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `server.port`. - */ -exports.ATTR_NET_HOST_PORT = 'net.host.port'; -/** - * Deprecated, use `network.peer.address`. - * - * @example "127.0.0.1" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.peer.address`. - */ -exports.ATTR_NET_PEER_IP = 'net.peer.ip'; -/** - * Deprecated, use `server.address` on client spans and `client.address` on server spans. - * - * @example example.com - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `server.address` on client spans and `client.address` on server spans. - */ -exports.ATTR_NET_PEER_NAME = 'net.peer.name'; -/** - * Deprecated, use `server.port` on client spans and `client.port` on server spans. - * - * @example 8080 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `server.port` on client spans and `client.port` on server spans. - */ -exports.ATTR_NET_PEER_PORT = 'net.peer.port'; -/** - * Deprecated, use `network.protocol.name`. - * - * @example amqp - * - * @example http - * - * @example mqtt - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.protocol.name`. - */ -exports.ATTR_NET_PROTOCOL_NAME = 'net.protocol.name'; -/** - * Deprecated, use `network.protocol.version`. - * - * @example "3.1.1" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.protocol.version`. - */ -exports.ATTR_NET_PROTOCOL_VERSION = 'net.protocol.version'; -/** - * Deprecated, use `network.transport` and `network.type`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Split to `network.transport` and `network.type`. - */ -exports.ATTR_NET_SOCK_FAMILY = 'net.sock.family'; -/** - * Enum value "inet" for attribute {@link ATTR_NET_SOCK_FAMILY}. - */ -exports.NET_SOCK_FAMILY_VALUE_INET = "inet"; -/** - * Enum value "inet6" for attribute {@link ATTR_NET_SOCK_FAMILY}. - */ -exports.NET_SOCK_FAMILY_VALUE_INET6 = "inet6"; -/** - * Enum value "unix" for attribute {@link ATTR_NET_SOCK_FAMILY}. - */ -exports.NET_SOCK_FAMILY_VALUE_UNIX = "unix"; -/** - * Deprecated, use `network.local.address`. - * - * @example /var/my.sock - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.local.address`. - */ -exports.ATTR_NET_SOCK_HOST_ADDR = 'net.sock.host.addr'; -/** - * Deprecated, use `network.local.port`. - * - * @example 8080 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.local.port`. - */ -exports.ATTR_NET_SOCK_HOST_PORT = 'net.sock.host.port'; -/** - * Deprecated, use `network.peer.address`. - * - * @example 192.168.0.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.peer.address`. - */ -exports.ATTR_NET_SOCK_PEER_ADDR = 'net.sock.peer.addr'; -/** - * Deprecated, no replacement at this time. - * - * @example /var/my.sock - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Removed. - */ -exports.ATTR_NET_SOCK_PEER_NAME = 'net.sock.peer.name'; -/** - * Deprecated, use `network.peer.port`. - * - * @example 65531 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.peer.port`. - */ -exports.ATTR_NET_SOCK_PEER_PORT = 'net.sock.peer.port'; -/** - * Deprecated, use `network.transport`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `network.transport`. - */ -exports.ATTR_NET_TRANSPORT = 'net.transport'; -/** - * Enum value "inproc" for attribute {@link ATTR_NET_TRANSPORT}. - */ -exports.NET_TRANSPORT_VALUE_INPROC = "inproc"; -/** - * Enum value "ip_tcp" for attribute {@link ATTR_NET_TRANSPORT}. - */ -exports.NET_TRANSPORT_VALUE_IP_TCP = "ip_tcp"; -/** - * Enum value "ip_udp" for attribute {@link ATTR_NET_TRANSPORT}. - */ -exports.NET_TRANSPORT_VALUE_IP_UDP = "ip_udp"; -/** - * Enum value "other" for attribute {@link ATTR_NET_TRANSPORT}. - */ -exports.NET_TRANSPORT_VALUE_OTHER = "other"; -/** - * Enum value "pipe" for attribute {@link ATTR_NET_TRANSPORT}. - */ -exports.NET_TRANSPORT_VALUE_PIPE = "pipe"; -/** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - * - * @example "DE" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_NETWORK_CARRIER_ICC = 'network.carrier.icc'; -/** - * The mobile carrier country code. - * - * @example "310" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_NETWORK_CARRIER_MCC = 'network.carrier.mcc'; -/** - * The mobile carrier network code. - * - * @example "001" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_NETWORK_CARRIER_MNC = 'network.carrier.mnc'; -/** - * The name of the mobile carrier. - * - * @example "sprint" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_NETWORK_CARRIER_NAME = 'network.carrier.name'; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @example "LTE" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_NETWORK_CONNECTION_SUBTYPE = 'network.connection.subtype'; -/** - * Enum value "cdma" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA = "cdma"; -/** - * Enum value "cdma2000_1xrtt" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA2000_1XRTT = "cdma2000_1xrtt"; -/** - * Enum value "edge" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EDGE = "edge"; -/** - * Enum value "ehrpd" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EHRPD = "ehrpd"; -/** - * Enum value "evdo_0" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_0 = "evdo_0"; -/** - * Enum value "evdo_a" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_A = "evdo_a"; -/** - * Enum value "evdo_b" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_B = "evdo_b"; -/** - * Enum value "gprs" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_GPRS = "gprs"; -/** - * Enum value "gsm" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_GSM = "gsm"; -/** - * Enum value "hsdpa" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSDPA = "hsdpa"; -/** - * Enum value "hspa" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSPA = "hspa"; -/** - * Enum value "hspap" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSPAP = "hspap"; -/** - * Enum value "hsupa" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_HSUPA = "hsupa"; -/** - * Enum value "iden" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_IDEN = "iden"; -/** - * Enum value "iwlan" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_IWLAN = "iwlan"; -/** - * Enum value "lte" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_LTE = "lte"; -/** - * Enum value "lte_ca" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_LTE_CA = "lte_ca"; -/** - * Enum value "nr" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_NR = "nr"; -/** - * Enum value "nrnsa" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_NRNSA = "nrnsa"; -/** - * Enum value "td_scdma" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_TD_SCDMA = "td_scdma"; -/** - * Enum value "umts" for attribute {@link ATTR_NETWORK_CONNECTION_SUBTYPE}. - */ -exports.NETWORK_CONNECTION_SUBTYPE_VALUE_UMTS = "umts"; -/** - * The internet connection type. - * - * @example "wifi" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_NETWORK_CONNECTION_TYPE = 'network.connection.type'; -/** - * Enum value "cell" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. - */ -exports.NETWORK_CONNECTION_TYPE_VALUE_CELL = "cell"; -/** - * Enum value "unavailable" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. - */ -exports.NETWORK_CONNECTION_TYPE_VALUE_UNAVAILABLE = "unavailable"; -/** - * Enum value "unknown" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. - */ -exports.NETWORK_CONNECTION_TYPE_VALUE_UNKNOWN = "unknown"; -/** - * Enum value "wifi" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. - */ -exports.NETWORK_CONNECTION_TYPE_VALUE_WIFI = "wifi"; -/** - * Enum value "wired" for attribute {@link ATTR_NETWORK_CONNECTION_TYPE}. - */ -exports.NETWORK_CONNECTION_TYPE_VALUE_WIRED = "wired"; -/** - * The network IO operation direction. - * - * @example transmit - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_NETWORK_IO_DIRECTION = 'network.io.direction'; -/** - * Enum value "receive" for attribute {@link ATTR_NETWORK_IO_DIRECTION}. - */ -exports.NETWORK_IO_DIRECTION_VALUE_RECEIVE = "receive"; -/** - * Enum value "transmit" for attribute {@link ATTR_NETWORK_IO_DIRECTION}. - */ -exports.NETWORK_IO_DIRECTION_VALUE_TRANSMIT = "transmit"; -/** - * The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. - * - * @example sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4 - * - * @note Follows [OCI Image Manifest Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), and specifically the [Digest property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). - * An example can be found in [Example Image Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_OCI_MANIFEST_DIGEST = 'oci.manifest.digest'; -/** - * Parent-child Reference type - * - * @note The causal relationship between a child Span and a parent Span. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_OPENTRACING_REF_TYPE = 'opentracing.ref_type'; -/** - * Enum value "child_of" for attribute {@link ATTR_OPENTRACING_REF_TYPE}. - */ -exports.OPENTRACING_REF_TYPE_VALUE_CHILD_OF = "child_of"; -/** - * Enum value "follows_from" for attribute {@link ATTR_OPENTRACING_REF_TYPE}. - */ -exports.OPENTRACING_REF_TYPE_VALUE_FOLLOWS_FROM = "follows_from"; -/** - * Unique identifier for a particular build or compilation of the operating system. - * - * @example TQ3C.230805.001.B2 - * - * @example 20E247 - * - * @example 22621 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_OS_BUILD_ID = 'os.build_id'; -/** - * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. - * - * @example Microsoft Windows [Version 10.0.18363.778] - * - * @example Ubuntu 18.04.1 LTS - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_OS_DESCRIPTION = 'os.description'; -/** - * Human readable operating system name. - * - * @example iOS - * - * @example Android - * - * @example Ubuntu - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_OS_NAME = 'os.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'; -/** - * Enum value "aix" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_AIX = "aix"; -/** - * Enum value "darwin" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_DARWIN = "darwin"; -/** - * Enum value "dragonflybsd" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_DRAGONFLYBSD = "dragonflybsd"; -/** - * Enum value "freebsd" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_FREEBSD = "freebsd"; -/** - * Enum value "hpux" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_HPUX = "hpux"; -/** - * Enum value "linux" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_LINUX = "linux"; -/** - * Enum value "netbsd" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_NETBSD = "netbsd"; -/** - * Enum value "openbsd" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_OPENBSD = "openbsd"; -/** - * Enum value "solaris" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_SOLARIS = "solaris"; -/** - * Enum value "windows" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_WINDOWS = "windows"; -/** - * Enum value "z_os" for attribute {@link ATTR_OS_TYPE}. - */ -exports.OS_TYPE_VALUE_Z_OS = "z_os"; -/** - * 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'; -/** - - * - * @example io.opentelemetry.contrib.mongodb - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * use the `otel.scope.name` attribute. - */ -exports.ATTR_OTEL_LIBRARY_NAME = 'otel.library.name'; -/** - - * - * @example 1.0.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * use the `otel.scope.version` attribute. - */ -exports.ATTR_OTEL_LIBRARY_VERSION = 'otel.library.version'; -/** - * The [`service.name`](/docs/resource/README.md#service) of the remote service. **SHOULD** be equal to the actual `service.name` resource attribute of the remote service if any. - * - * @example "AuthTokenCache" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PEER_SERVICE = 'peer.service'; -/** - * Deprecated, use `db.client.connection.pool.name` instead. - * - * @example myDataSource - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.pool.name`. - */ -exports.ATTR_POOL_NAME = 'pool.name'; -/** - * 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 - * - * @example --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 full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. - * - * @example C:\cmd\otecol --config="my directory\config.yaml" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_COMMAND_LINE = 'process.command_line'; -/** - * Specifies whether the context switches for this data point were voluntary or involuntary. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_CONTEXT_SWITCH_TYPE = 'process.context_switch_type'; -/** - * Enum value "involuntary" for attribute {@link ATTR_PROCESS_CONTEXT_SWITCH_TYPE}. - */ -exports.PROCESS_CONTEXT_SWITCH_TYPE_VALUE_INVOLUNTARY = "involuntary"; -/** - * Enum value "voluntary" for attribute {@link ATTR_PROCESS_CONTEXT_SWITCH_TYPE}. - */ -exports.PROCESS_CONTEXT_SWITCH_TYPE_VALUE_VOLUNTARY = "voluntary"; -/** - * Deprecated, use `cpu.mode` instead. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `cpu.mode` - */ -exports.ATTR_PROCESS_CPU_STATE = 'process.cpu.state'; -/** - * Enum value "system" for attribute {@link ATTR_PROCESS_CPU_STATE}. - */ -exports.PROCESS_CPU_STATE_VALUE_SYSTEM = "system"; -/** - * Enum value "user" for attribute {@link ATTR_PROCESS_CPU_STATE}. - */ -exports.PROCESS_CPU_STATE_VALUE_USER = "user"; -/** - * Enum value "wait" for attribute {@link ATTR_PROCESS_CPU_STATE}. - */ -exports.PROCESS_CPU_STATE_VALUE_WAIT = "wait"; -/** - * The date and time the process was created, in ISO 8601 format. - * - * @example 2023-11-21T09:25:34.853Z - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_CREATION_TIME = 'process.creation.time'; -/** - * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can 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 exit code of the process. - * - * @example 127 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_EXIT_CODE = 'process.exit.code'; -/** - * The date and time the process exited, in ISO 8601 format. - * - * @example 2023-11-21T09:26:12.315Z - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_EXIT_TIME = 'process.exit.time'; -/** - * The PID of the process's group leader. This is also the process group ID (PGID) of the process. - * - * @example 23 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_GROUP_LEADER_PID = 'process.group_leader.pid'; -/** - * Whether the process is connected to an interactive shell. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_INTERACTIVE = 'process.interactive'; -/** - * 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'; -/** - * The type of page fault for this data point. Type `major` is for major/hard page faults, and `minor` is for minor/soft page faults. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_PAGING_FAULT_TYPE = 'process.paging.fault_type'; -/** - * Enum value "major" for attribute {@link ATTR_PROCESS_PAGING_FAULT_TYPE}. - */ -exports.PROCESS_PAGING_FAULT_TYPE_VALUE_MAJOR = "major"; -/** - * Enum value "minor" for attribute {@link ATTR_PROCESS_PAGING_FAULT_TYPE}. - */ -exports.PROCESS_PAGING_FAULT_TYPE_VALUE_MINOR = "minor"; -/** - * Parent Process identifier (PPID). - * - * @example 111 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_PARENT_PID = 'process.parent_pid'; -/** - * 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'; -/** - * The real user ID (RUID) of the process. - * - * @example 1000 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_REAL_USER_ID = 'process.real_user.id'; -/** - * The username of the real user of the process. - * - * @example operator - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_REAL_USER_NAME = 'process.real_user.name'; -/** - * 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 saved user ID (SUID) of the process. - * - * @example 1002 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_SAVED_USER_ID = 'process.saved_user.id'; -/** - * The username of the saved user. - * - * @example operator - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_SAVED_USER_NAME = 'process.saved_user.name'; -/** - * The PID of the process's session leader. This is also the session ID (SID) of the process. - * - * @example 14 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_SESSION_LEADER_PID = 'process.session_leader.pid'; -/** - * The effective user ID (EUID) of the process. - * - * @example 1001 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_USER_ID = 'process.user.id'; -/** - * The username of the effective user of 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_USER_NAME = 'process.user.name'; -/** - * Virtual process identifier. - * - * @example 12 - * - * @note The process ID within a PID namespace. This is not necessarily unique across all processes on the host but it is unique within the process namespace that the process exists within. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_PROCESS_VPID = 'process.vpid'; -/** - * The [error codes](https://connect.build/docs/protocol/#error-codes) of the Connect request. Error codes are always string values. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_CONNECT_RPC_ERROR_CODE = 'rpc.connect_rpc.error_code'; -/** - * Enum value "aborted" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_ABORTED = "aborted"; -/** - * Enum value "already_exists" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_ALREADY_EXISTS = "already_exists"; -/** - * Enum value "cancelled" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_CANCELLED = "cancelled"; -/** - * Enum value "data_loss" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_DATA_LOSS = "data_loss"; -/** - * Enum value "deadline_exceeded" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_DEADLINE_EXCEEDED = "deadline_exceeded"; -/** - * Enum value "failed_precondition" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_FAILED_PRECONDITION = "failed_precondition"; -/** - * Enum value "internal" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_INTERNAL = "internal"; -/** - * Enum value "invalid_argument" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_INVALID_ARGUMENT = "invalid_argument"; -/** - * Enum value "not_found" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_NOT_FOUND = "not_found"; -/** - * Enum value "out_of_range" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_OUT_OF_RANGE = "out_of_range"; -/** - * Enum value "permission_denied" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_PERMISSION_DENIED = "permission_denied"; -/** - * Enum value "resource_exhausted" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_RESOURCE_EXHAUSTED = "resource_exhausted"; -/** - * Enum value "unauthenticated" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNAUTHENTICATED = "unauthenticated"; -/** - * Enum value "unavailable" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNAVAILABLE = "unavailable"; -/** - * Enum value "unimplemented" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNIMPLEMENTED = "unimplemented"; -/** - * Enum value "unknown" for attribute {@link ATTR_RPC_CONNECT_RPC_ERROR_CODE}. - */ -exports.RPC_CONNECT_RPC_ERROR_CODE_VALUE_UNKNOWN = "unknown"; -/** - * Connect request metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. - * - * @example rpc.request.metadata.my-custom-metadata-attribute=["1.2.3.4", "1.2.3.5"] - * - * @note Instrumentations **SHOULD** require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_RPC_CONNECT_RPC_REQUEST_METADATA = (key) => `rpc.connect_rpc.request.metadata.${key}`; -exports.ATTR_RPC_CONNECT_RPC_REQUEST_METADATA = ATTR_RPC_CONNECT_RPC_REQUEST_METADATA; -/** - * Connect response metadata, `` being the normalized Connect Metadata key (lowercase), the value being the metadata values. - * - * @example rpc.response.metadata.my-custom-metadata-attribute=["attribute_value"] - * - * @note Instrumentations **SHOULD** require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_RPC_CONNECT_RPC_RESPONSE_METADATA = (key) => `rpc.connect_rpc.response.metadata.${key}`; -exports.ATTR_RPC_CONNECT_RPC_RESPONSE_METADATA = ATTR_RPC_CONNECT_RPC_RESPONSE_METADATA; -/** - * gRPC request metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. - * - * @example rpc.grpc.request.metadata.my-custom-metadata-attribute=["1.2.3.4", "1.2.3.5"] - * - * @note Instrumentations **SHOULD** require an explicit configuration of which metadata values are to be captured. Including all request metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_RPC_GRPC_REQUEST_METADATA = (key) => `rpc.grpc.request.metadata.${key}`; -exports.ATTR_RPC_GRPC_REQUEST_METADATA = ATTR_RPC_GRPC_REQUEST_METADATA; -/** - * gRPC response metadata, `` being the normalized gRPC Metadata key (lowercase), the value being the metadata values. - * - * @example rpc.grpc.response.metadata.my-custom-metadata-attribute=["attribute_value"] - * - * @note Instrumentations **SHOULD** require an explicit configuration of which metadata values are to be captured. Including all response metadata values can be a security risk - explicit configuration helps avoid leaking sensitive information. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -const ATTR_RPC_GRPC_RESPONSE_METADATA = (key) => `rpc.grpc.response.metadata.${key}`; -exports.ATTR_RPC_GRPC_RESPONSE_METADATA = ATTR_RPC_GRPC_RESPONSE_METADATA; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'; -/** - * Enum value 0 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_OK = 0; -/** - * Enum value 1 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_CANCELLED = 1; -/** - * Enum value 2 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_UNKNOWN = 2; -/** - * Enum value 3 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_INVALID_ARGUMENT = 3; -/** - * Enum value 4 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_DEADLINE_EXCEEDED = 4; -/** - * Enum value 5 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_NOT_FOUND = 5; -/** - * Enum value 6 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_ALREADY_EXISTS = 6; -/** - * Enum value 7 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_PERMISSION_DENIED = 7; -/** - * Enum value 8 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_RESOURCE_EXHAUSTED = 8; -/** - * Enum value 9 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_FAILED_PRECONDITION = 9; -/** - * Enum value 10 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_ABORTED = 10; -/** - * Enum value 11 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_OUT_OF_RANGE = 11; -/** - * Enum value 12 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_UNIMPLEMENTED = 12; -/** - * Enum value 13 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_INTERNAL = 13; -/** - * Enum value 14 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_UNAVAILABLE = 14; -/** - * Enum value 15 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_DATA_LOSS = 15; -/** - * Enum value 16 for attribute {@link ATTR_RPC_GRPC_STATUS_CODE}. - */ -exports.RPC_GRPC_STATUS_CODE_VALUE_UNAUTHENTICATED = 16; -/** - * `error.code` property of response if it is an error response. - * - * @example -32700 - * - * @example 100 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_JSONRPC_ERROR_CODE = 'rpc.jsonrpc.error_code'; -/** - * `error.message` property of response if it is an error response. - * - * @example Parse error - * - * @example User already exists - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_JSONRPC_ERROR_MESSAGE = 'rpc.jsonrpc.error_message'; -/** - * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. - * - * @example 10 - * - * @example request-7 - * - * @example - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'; -/** - * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 doesn't specify this, the value can be omitted. - * - * @example 2.0 - * - * @example 1.0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'; -/** - * Compressed size of the message in bytes. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_MESSAGE_COMPRESSED_SIZE = 'rpc.message.compressed_size'; -/** - * **MUST** be calculated as two different counters starting from `1` one for sent messages and one for received message. - * - * @note This way we guarantee that the values will be consistent between different implementations. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_MESSAGE_ID = 'rpc.message.id'; -/** - * Whether this is a received or sent message. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_MESSAGE_TYPE = 'rpc.message.type'; -/** - * Enum value "RECEIVED" for attribute {@link ATTR_RPC_MESSAGE_TYPE}. - */ -exports.RPC_MESSAGE_TYPE_VALUE_RECEIVED = "RECEIVED"; -/** - * Enum value "SENT" for attribute {@link ATTR_RPC_MESSAGE_TYPE}. - */ -exports.RPC_MESSAGE_TYPE_VALUE_SENT = "SENT"; -/** - * Uncompressed size of the message in bytes. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_MESSAGE_UNCOMPRESSED_SIZE = 'rpc.message.uncompressed_size'; -/** - * The name of the (logical) method being called, must be equal to the $method part in the span name. - * - * @example "exampleMethod" - * - * @note This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_METHOD = 'rpc.method'; -/** - * The full (logical) name of the service being called, including its package name, if applicable. - * - * @example "myservice.EchoService" - * - * @note This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_SERVICE = 'rpc.service'; -/** - * A string identifying the remoting system. See below for a list of well-known identifiers. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_RPC_SYSTEM = 'rpc.system'; -/** - * Enum value "apache_dubbo" for attribute {@link ATTR_RPC_SYSTEM}. - */ -exports.RPC_SYSTEM_VALUE_APACHE_DUBBO = "apache_dubbo"; -/** - * Enum value "connect_rpc" for attribute {@link ATTR_RPC_SYSTEM}. - */ -exports.RPC_SYSTEM_VALUE_CONNECT_RPC = "connect_rpc"; -/** - * Enum value "dotnet_wcf" for attribute {@link ATTR_RPC_SYSTEM}. - */ -exports.RPC_SYSTEM_VALUE_DOTNET_WCF = "dotnet_wcf"; -/** - * Enum value "grpc" for attribute {@link ATTR_RPC_SYSTEM}. - */ -exports.RPC_SYSTEM_VALUE_GRPC = "grpc"; -/** - * Enum value "java_rmi" for attribute {@link ATTR_RPC_SYSTEM}. - */ -exports.RPC_SYSTEM_VALUE_JAVA_RMI = "java_rmi"; -/** - * 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/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'; -/** - * A unique id to identify a session. - * - * @example "00112233-4455-6677-8899-aabbccddeeff" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SESSION_ID = 'session.id'; -/** - * The previous `session.id` for this user, when known. - * - * @example "00112233-4455-6677-8899-aabbccddeeff" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SESSION_PREVIOUS_ID = 'session.previous_id'; -/** - * Source address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - * - * @example source.example.com - * - * @example 10.1.2.80 - * - * @example /tmp/my.sock - * - * @note When observed from the destination side, and when communicating through an intermediary, `source.address` **SHOULD** represent the source address behind any intermediaries, for example proxies, if it's available. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SOURCE_ADDRESS = 'source.address'; -/** - * Source port number - * - * @example 3389 - * - * @example 2888 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SOURCE_PORT = 'source.port'; -/** - * Deprecated, use `db.client.connection.state` instead. - * - * @example idle - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.state`. - */ -exports.ATTR_STATE = 'state'; -/** - * Enum value "idle" for attribute {@link ATTR_STATE}. - */ -exports.STATE_VALUE_IDLE = "idle"; -/** - * Enum value "used" for attribute {@link ATTR_STATE}. - */ -exports.STATE_VALUE_USED = "used"; -/** - * The logical CPU number [0..n-1] - * - * @example 1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_CPU_LOGICAL_NUMBER = 'system.cpu.logical_number'; -/** - * Deprecated, use `cpu.mode` instead. - * - * @example idle - * - * @example interrupt - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `cpu.mode` - */ -exports.ATTR_SYSTEM_CPU_STATE = 'system.cpu.state'; -/** - * Enum value "idle" for attribute {@link ATTR_SYSTEM_CPU_STATE}. - */ -exports.SYSTEM_CPU_STATE_VALUE_IDLE = "idle"; -/** - * Enum value "interrupt" for attribute {@link ATTR_SYSTEM_CPU_STATE}. - */ -exports.SYSTEM_CPU_STATE_VALUE_INTERRUPT = "interrupt"; -/** - * Enum value "iowait" for attribute {@link ATTR_SYSTEM_CPU_STATE}. - */ -exports.SYSTEM_CPU_STATE_VALUE_IOWAIT = "iowait"; -/** - * Enum value "nice" for attribute {@link ATTR_SYSTEM_CPU_STATE}. - */ -exports.SYSTEM_CPU_STATE_VALUE_NICE = "nice"; -/** - * Enum value "steal" for attribute {@link ATTR_SYSTEM_CPU_STATE}. - */ -exports.SYSTEM_CPU_STATE_VALUE_STEAL = "steal"; -/** - * Enum value "system" for attribute {@link ATTR_SYSTEM_CPU_STATE}. - */ -exports.SYSTEM_CPU_STATE_VALUE_SYSTEM = "system"; -/** - * Enum value "user" for attribute {@link ATTR_SYSTEM_CPU_STATE}. - */ -exports.SYSTEM_CPU_STATE_VALUE_USER = "user"; -/** - * The device identifier - * - * @example (identifier) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_DEVICE = 'system.device'; -/** - * The filesystem mode - * - * @example rw, ro - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_FILESYSTEM_MODE = 'system.filesystem.mode'; -/** - * The filesystem mount path - * - * @example /mnt/data - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_FILESYSTEM_MOUNTPOINT = 'system.filesystem.mountpoint'; -/** - * The filesystem state - * - * @example used - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_FILESYSTEM_STATE = 'system.filesystem.state'; -/** - * Enum value "free" for attribute {@link ATTR_SYSTEM_FILESYSTEM_STATE}. - */ -exports.SYSTEM_FILESYSTEM_STATE_VALUE_FREE = "free"; -/** - * Enum value "reserved" for attribute {@link ATTR_SYSTEM_FILESYSTEM_STATE}. - */ -exports.SYSTEM_FILESYSTEM_STATE_VALUE_RESERVED = "reserved"; -/** - * Enum value "used" for attribute {@link ATTR_SYSTEM_FILESYSTEM_STATE}. - */ -exports.SYSTEM_FILESYSTEM_STATE_VALUE_USED = "used"; -/** - * The filesystem type - * - * @example ext4 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_FILESYSTEM_TYPE = 'system.filesystem.type'; -/** - * Enum value "exfat" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. - */ -exports.SYSTEM_FILESYSTEM_TYPE_VALUE_EXFAT = "exfat"; -/** - * Enum value "ext4" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. - */ -exports.SYSTEM_FILESYSTEM_TYPE_VALUE_EXT4 = "ext4"; -/** - * Enum value "fat32" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. - */ -exports.SYSTEM_FILESYSTEM_TYPE_VALUE_FAT32 = "fat32"; -/** - * Enum value "hfsplus" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. - */ -exports.SYSTEM_FILESYSTEM_TYPE_VALUE_HFSPLUS = "hfsplus"; -/** - * Enum value "ntfs" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. - */ -exports.SYSTEM_FILESYSTEM_TYPE_VALUE_NTFS = "ntfs"; -/** - * Enum value "refs" for attribute {@link ATTR_SYSTEM_FILESYSTEM_TYPE}. - */ -exports.SYSTEM_FILESYSTEM_TYPE_VALUE_REFS = "refs"; -/** - * The memory state - * - * @example free - * - * @example cached - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_MEMORY_STATE = 'system.memory.state'; -/** - * Enum value "buffers" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. - */ -exports.SYSTEM_MEMORY_STATE_VALUE_BUFFERS = "buffers"; -/** - * Enum value "cached" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. - */ -exports.SYSTEM_MEMORY_STATE_VALUE_CACHED = "cached"; -/** - * Enum value "free" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. - */ -exports.SYSTEM_MEMORY_STATE_VALUE_FREE = "free"; -/** - * Enum value "shared" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. - */ -exports.SYSTEM_MEMORY_STATE_VALUE_SHARED = "shared"; -/** - * Enum value "used" for attribute {@link ATTR_SYSTEM_MEMORY_STATE}. - */ -exports.SYSTEM_MEMORY_STATE_VALUE_USED = "used"; -/** - * A stateless protocol **MUST** **NOT** set this attribute - * - * @example close_wait - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_NETWORK_STATE = 'system.network.state'; -/** - * Enum value "close" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_CLOSE = "close"; -/** - * Enum value "close_wait" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_CLOSE_WAIT = "close_wait"; -/** - * Enum value "closing" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_CLOSING = "closing"; -/** - * Enum value "delete" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_DELETE = "delete"; -/** - * Enum value "established" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_ESTABLISHED = "established"; -/** - * Enum value "fin_wait_1" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_FIN_WAIT_1 = "fin_wait_1"; -/** - * Enum value "fin_wait_2" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_FIN_WAIT_2 = "fin_wait_2"; -/** - * Enum value "last_ack" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_LAST_ACK = "last_ack"; -/** - * Enum value "listen" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_LISTEN = "listen"; -/** - * Enum value "syn_recv" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_SYN_RECV = "syn_recv"; -/** - * Enum value "syn_sent" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_SYN_SENT = "syn_sent"; -/** - * Enum value "time_wait" for attribute {@link ATTR_SYSTEM_NETWORK_STATE}. - */ -exports.SYSTEM_NETWORK_STATE_VALUE_TIME_WAIT = "time_wait"; -/** - * The paging access direction - * - * @example in - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_PAGING_DIRECTION = 'system.paging.direction'; -/** - * Enum value "in" for attribute {@link ATTR_SYSTEM_PAGING_DIRECTION}. - */ -exports.SYSTEM_PAGING_DIRECTION_VALUE_IN = "in"; -/** - * Enum value "out" for attribute {@link ATTR_SYSTEM_PAGING_DIRECTION}. - */ -exports.SYSTEM_PAGING_DIRECTION_VALUE_OUT = "out"; -/** - * The memory paging state - * - * @example free - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_PAGING_STATE = 'system.paging.state'; -/** - * Enum value "free" for attribute {@link ATTR_SYSTEM_PAGING_STATE}. - */ -exports.SYSTEM_PAGING_STATE_VALUE_FREE = "free"; -/** - * Enum value "used" for attribute {@link ATTR_SYSTEM_PAGING_STATE}. - */ -exports.SYSTEM_PAGING_STATE_VALUE_USED = "used"; -/** - * The memory paging type - * - * @example minor - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_PAGING_TYPE = 'system.paging.type'; -/** - * Enum value "major" for attribute {@link ATTR_SYSTEM_PAGING_TYPE}. - */ -exports.SYSTEM_PAGING_TYPE_VALUE_MAJOR = "major"; -/** - * Enum value "minor" for attribute {@link ATTR_SYSTEM_PAGING_TYPE}. - */ -exports.SYSTEM_PAGING_TYPE_VALUE_MINOR = "minor"; -/** - * The process state, e.g., [Linux Process State Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) - * - * @example running - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_SYSTEM_PROCESS_STATUS = 'system.process.status'; -/** - * Enum value "defunct" for attribute {@link ATTR_SYSTEM_PROCESS_STATUS}. - */ -exports.SYSTEM_PROCESS_STATUS_VALUE_DEFUNCT = "defunct"; -/** - * Enum value "running" for attribute {@link ATTR_SYSTEM_PROCESS_STATUS}. - */ -exports.SYSTEM_PROCESS_STATUS_VALUE_RUNNING = "running"; -/** - * Enum value "sleeping" for attribute {@link ATTR_SYSTEM_PROCESS_STATUS}. - */ -exports.SYSTEM_PROCESS_STATUS_VALUE_SLEEPING = "sleeping"; -/** - * Enum value "stopped" for attribute {@link ATTR_SYSTEM_PROCESS_STATUS}. - */ -exports.SYSTEM_PROCESS_STATUS_VALUE_STOPPED = "stopped"; -/** - * Deprecated, use `system.process.status` instead. - * - * @example running - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `system.process.status`. - */ -exports.ATTR_SYSTEM_PROCESSES_STATUS = 'system.processes.status'; -/** - * Enum value "defunct" for attribute {@link ATTR_SYSTEM_PROCESSES_STATUS}. - */ -exports.SYSTEM_PROCESSES_STATUS_VALUE_DEFUNCT = "defunct"; -/** - * Enum value "running" for attribute {@link ATTR_SYSTEM_PROCESSES_STATUS}. - */ -exports.SYSTEM_PROCESSES_STATUS_VALUE_RUNNING = "running"; -/** - * Enum value "sleeping" for attribute {@link ATTR_SYSTEM_PROCESSES_STATUS}. - */ -exports.SYSTEM_PROCESSES_STATUS_VALUE_SLEEPING = "sleeping"; -/** - * Enum value "stopped" for attribute {@link ATTR_SYSTEM_PROCESSES_STATUS}. - */ -exports.SYSTEM_PROCESSES_STATUS_VALUE_STOPPED = "stopped"; -/** - * The name of the auto instrumentation agent or distribution, if used. - * - * @example parts-unlimited-java - * - * @note Official auto instrumentation agents and distributions **SHOULD** set the `telemetry.distro.name` attribute to - * a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TELEMETRY_DISTRO_NAME = 'telemetry.distro.name'; -/** - * The version string of the auto instrumentation agent or distribution, if used. - * - * @example 1.2.3 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TELEMETRY_DISTRO_VERSION = 'telemetry.distro.version'; -/** - * The fully qualified human readable name of the [test case](https://en.wikipedia.org/wiki/Test_case). - * - * @example org.example.TestCase1.test1 - * - * @example example/tests/TestCase1.test1 - * - * @example ExampleTestCase1_test1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TEST_CASE_NAME = 'test.case.name'; -/** - * The status of the actual test case result from test execution. - * - * @example pass - * - * @example fail - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TEST_CASE_RESULT_STATUS = 'test.case.result.status'; -/** - * Enum value "fail" for attribute {@link ATTR_TEST_CASE_RESULT_STATUS}. - */ -exports.TEST_CASE_RESULT_STATUS_VALUE_FAIL = "fail"; -/** - * Enum value "pass" for attribute {@link ATTR_TEST_CASE_RESULT_STATUS}. - */ -exports.TEST_CASE_RESULT_STATUS_VALUE_PASS = "pass"; -/** - * The human readable name of a [test suite](https://en.wikipedia.org/wiki/Test_suite). - * - * @example TestSuite1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TEST_SUITE_NAME = 'test.suite.name'; -/** - * The status of the test suite run. - * - * @example success - * - * @example failure - * - * @example skipped - * - * @example aborted - * - * @example timed_out - * - * @example in_progress - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TEST_SUITE_RUN_STATUS = 'test.suite.run.status'; -/** - * Enum value "aborted" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. - */ -exports.TEST_SUITE_RUN_STATUS_VALUE_ABORTED = "aborted"; -/** - * Enum value "failure" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. - */ -exports.TEST_SUITE_RUN_STATUS_VALUE_FAILURE = "failure"; -/** - * Enum value "in_progress" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. - */ -exports.TEST_SUITE_RUN_STATUS_VALUE_IN_PROGRESS = "in_progress"; -/** - * Enum value "skipped" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. - */ -exports.TEST_SUITE_RUN_STATUS_VALUE_SKIPPED = "skipped"; -/** - * Enum value "success" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. - */ -exports.TEST_SUITE_RUN_STATUS_VALUE_SUCCESS = "success"; -/** - * Enum value "timed_out" for attribute {@link ATTR_TEST_SUITE_RUN_STATUS}. - */ -exports.TEST_SUITE_RUN_STATUS_VALUE_TIMED_OUT = "timed_out"; -/** - * Current "managed" thread ID (as opposed to OS thread ID). - * - * @example 42 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_THREAD_ID = 'thread.id'; -/** - * Current thread name. - * - * @example "main" - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_THREAD_NAME = 'thread.name'; -/** - * String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. - * - * @example TLS_RSA_WITH_3DES_EDE_CBC_SHA - * - * @example TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * - * @note The values allowed for `tls.cipher` **MUST** be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CIPHER = 'tls.cipher'; -/** - * PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. - * - * @example MII... - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_CERTIFICATE = 'tls.client.certificate'; -/** - * Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. - * - * @example MII... - * - * @example MI... - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_CERTIFICATE_CHAIN = 'tls.client.certificate_chain'; -/** - * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. - * - * @example 0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_HASH_MD5 = 'tls.client.hash.md5'; -/** - * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. - * - * @example 9E393D93138888D288266C2D915214D1D1CCEB2A - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_HASH_SHA1 = 'tls.client.hash.sha1'; -/** - * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. - * - * @example 0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_HASH_SHA256 = 'tls.client.hash.sha256'; -/** - * Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. - * - * @example CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_ISSUER = 'tls.client.issuer'; -/** - * A hash that identifies clients based on how they perform an SSL/TLS handshake. - * - * @example d4e5b18d6b55c71272893221c96ba240 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_JA3 = 'tls.client.ja3'; -/** - * Date/Time indicating when client certificate is no longer considered valid. - * - * @example 2021-01-01T00:00:00.000Z - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_NOT_AFTER = 'tls.client.not_after'; -/** - * Date/Time indicating when client certificate is first considered valid. - * - * @example 1970-01-01T00:00:00.000Z - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_NOT_BEFORE = 'tls.client.not_before'; -/** - * Deprecated, use `server.address` instead. - * - * @example opentelemetry.io - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `server.address. - */ -exports.ATTR_TLS_CLIENT_SERVER_NAME = 'tls.client.server_name'; -/** - * Distinguished name of subject of the x.509 certificate presented by the client. - * - * @example CN=myclient, OU=Documentation Team, DC=example, DC=com - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_SUBJECT = 'tls.client.subject'; -/** - * Array of ciphers offered by the client during the client hello. - * - * @example TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * - * @example TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * - * @example ... - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CLIENT_SUPPORTED_CIPHERS = 'tls.client.supported_ciphers'; -/** - * String indicating the curve used for the given cipher, when applicable - * - * @example secp256r1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_CURVE = 'tls.curve'; -/** - * Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. - * - * @example true - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_ESTABLISHED = 'tls.established'; -/** - * String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. - * - * @example http/1.1 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_NEXT_PROTOCOL = 'tls.next_protocol'; -/** - * Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_PROTOCOL_NAME = 'tls.protocol.name'; -/** - * Enum value "ssl" for attribute {@link ATTR_TLS_PROTOCOL_NAME}. - */ -exports.TLS_PROTOCOL_NAME_VALUE_SSL = "ssl"; -/** - * Enum value "tls" for attribute {@link ATTR_TLS_PROTOCOL_NAME}. - */ -exports.TLS_PROTOCOL_NAME_VALUE_TLS = "tls"; -/** - * Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) - * - * @example 1.2 - * - * @example 3 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_PROTOCOL_VERSION = 'tls.protocol.version'; -/** - * Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. - * - * @example true - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_RESUMED = 'tls.resumed'; -/** - * PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. - * - * @example MII... - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_CERTIFICATE = 'tls.server.certificate'; -/** - * Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. - * - * @example MII... - * - * @example MI... - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_CERTIFICATE_CHAIN = 'tls.server.certificate_chain'; -/** - * Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. - * - * @example 0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_HASH_MD5 = 'tls.server.hash.md5'; -/** - * Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. - * - * @example 9E393D93138888D288266C2D915214D1D1CCEB2A - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_HASH_SHA1 = 'tls.server.hash.sha1'; -/** - * Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. - * - * @example 0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_HASH_SHA256 = 'tls.server.hash.sha256'; -/** - * Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. - * - * @example CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_ISSUER = 'tls.server.issuer'; -/** - * A hash that identifies servers based on how they perform an SSL/TLS handshake. - * - * @example d4e5b18d6b55c71272893221c96ba240 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_JA3S = 'tls.server.ja3s'; -/** - * Date/Time indicating when server certificate is no longer considered valid. - * - * @example 2021-01-01T00:00:00.000Z - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_NOT_AFTER = 'tls.server.not_after'; -/** - * Date/Time indicating when server certificate is first considered valid. - * - * @example 1970-01-01T00:00:00.000Z - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_NOT_BEFORE = 'tls.server.not_before'; -/** - * Distinguished name of subject of the x.509 certificate presented by the server. - * - * @example CN=myserver, OU=Documentation Team, DC=example, DC=com - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_TLS_SERVER_SUBJECT = 'tls.server.subject'; -/** - * Domain extracted from the `url.full`, such as "opentelemetry.io". - * - * @example www.foo.bar - * - * @example opentelemetry.io - * - * @example 3.12.167.2 - * - * @example [1080:0:0:0:8:800:200C:417A] - * - * @note In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, the IP address would go to the domain field. If the URL contains a [literal IPv6 address](https://www.rfc-editor.org/rfc/rfc2732#section-2) enclosed by `[` and `]`, the `[` and `]` characters should also be captured in the domain field. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_URL_DOMAIN = 'url.domain'; -/** - * The file extension extracted from the `url.full`, excluding the leading dot. - * - * @example png - * - * @example gz - * - * @note The file extension is only set if it exists, as not every url has a file extension. When the file name has multiple extensions `example.tar.gz`, only the last one should be captured `gz`, not `tar.gz`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_URL_EXTENSION = 'url.extension'; -/** - * Unmodified original URL as seen in the event source. - * - * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv - * - * @example search?q=OpenTelemetry - * - * @note In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not. - * `url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username **SHOULD** **NOT** be redacted and attribute's value **SHOULD** remain the same. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_URL_ORIGINAL = 'url.original'; -/** - * Port extracted from the `url.full` - * - * @example 443 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_URL_PORT = 'url.port'; -/** - * The highest registered url domain, stripped of the subdomain. - * - * @example example.com - * - * @example foo.co.uk - * - * @note This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_URL_REGISTERED_DOMAIN = 'url.registered_domain'; -/** - * The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain. - * - * @example east - * - * @example sub2.sub1 - * - * @note The subdomain portion of `www.east.mydomain.co.uk` is `east`. If the domain has multiple levels of subdomain, such as `sub2.sub1.example.com`, the subdomain field should contain `sub2.sub1`, with no trailing period. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_URL_SUBDOMAIN = 'url.subdomain'; -/** - * The low-cardinality template of an [absolute path reference](https://www.rfc-editor.org/rfc/rfc3986#section-4.2). - * - * @example /users/{id} - * - * @example /users/:id - * - * @example /users?id={id} - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_URL_TEMPLATE = 'url.template'; -/** - * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is `com`. - * - * @example com - * - * @example co.uk - * - * @note This value can be determined precisely with the [public suffix list](http://publicsuffix.org). - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_URL_TOP_LEVEL_DOMAIN = 'url.top_level_domain'; -/** - * User email address. - * - * @example a.einstein@example.com - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_USER_EMAIL = 'user.email'; -/** - * User's full name - * - * @example Albert Einstein - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_USER_FULL_NAME = 'user.full_name'; -/** - * Unique user hash to correlate information for a user in anonymized form. - * - * @example 364fc68eaf4c8acec74a4e52d7d1feaa - * - * @note Useful if `user.id` or `user.name` contain confidential information and cannot be used. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_USER_HASH = 'user.hash'; -/** - * Unique identifier of the user. - * - * @example S-1-5-21-202424912787-2692429404-2351956786-1000 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_USER_ID = 'user.id'; -/** - * Short name or login/username of the user. - * - * @example a.einstein - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_USER_NAME = 'user.name'; -/** - * Array of user roles at the time of the event. - * - * @example admin - * - * @example reporting_user - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_USER_ROLES = 'user.roles'; -/** - * Name of the user-agent extracted from original. Usually refers to the browser's name. - * - * @example Safari - * - * @example YourApp - * - * @note [Example](https://www.whatsmyua.info) of extracting browser's name from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant name **SHOULD** be selected. In such a scenario it should align with `user_agent.version` - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_USER_AGENT_NAME = 'user_agent.name'; -/** - * Version of the user-agent extracted from original. Usually refers to the browser's version - * - * @example 14.1.2 - * - * @example 1.0.0 - * - * @note [Example](https://www.whatsmyua.info) of extracting browser's version from original string. In the case of using a user-agent for non-browser products, such as microservices with multiple names/versions inside the `user_agent.original`, the most significant version **SHOULD** be selected. In such a scenario it should align with `user_agent.name` - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_USER_AGENT_VERSION = 'user_agent.version'; -/** - * The type of garbage collection. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_V8JS_GC_TYPE = 'v8js.gc.type'; -/** - * Enum value "incremental" for attribute {@link ATTR_V8JS_GC_TYPE}. - */ -exports.V8JS_GC_TYPE_VALUE_INCREMENTAL = "incremental"; -/** - * Enum value "major" for attribute {@link ATTR_V8JS_GC_TYPE}. - */ -exports.V8JS_GC_TYPE_VALUE_MAJOR = "major"; -/** - * Enum value "minor" for attribute {@link ATTR_V8JS_GC_TYPE}. - */ -exports.V8JS_GC_TYPE_VALUE_MINOR = "minor"; -/** - * Enum value "weakcb" for attribute {@link ATTR_V8JS_GC_TYPE}. - */ -exports.V8JS_GC_TYPE_VALUE_WEAKCB = "weakcb"; -/** - * The name of the space type of heap memory. - * - * @note Value can be retrieved from value `space_name` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_V8JS_HEAP_SPACE_NAME = 'v8js.heap.space.name'; -/** - * Enum value "code_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. - */ -exports.V8JS_HEAP_SPACE_NAME_VALUE_CODE_SPACE = "code_space"; -/** - * Enum value "large_object_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. - */ -exports.V8JS_HEAP_SPACE_NAME_VALUE_LARGE_OBJECT_SPACE = "large_object_space"; -/** - * Enum value "map_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. - */ -exports.V8JS_HEAP_SPACE_NAME_VALUE_MAP_SPACE = "map_space"; -/** - * Enum value "new_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. - */ -exports.V8JS_HEAP_SPACE_NAME_VALUE_NEW_SPACE = "new_space"; -/** - * Enum value "old_space" for attribute {@link ATTR_V8JS_HEAP_SPACE_NAME}. - */ -exports.V8JS_HEAP_SPACE_NAME_VALUE_OLD_SPACE = "old_space"; -/** - * The ID of the change (pull request/merge request) if applicable. This is usually a unique (within repository) identifier generated by the VCS system. - * - * @example 123 - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_VCS_REPOSITORY_CHANGE_ID = 'vcs.repository.change.id'; -/** - * The human readable title of the change (pull request/merge request). This title is often a brief summary of the change and may get merged in to a ref as the commit summary. - * - * @example Fixes broken thing - * - * @example feat: add my new feature - * - * @example [chore] update dependency - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_VCS_REPOSITORY_CHANGE_TITLE = 'vcs.repository.change.title'; -/** - * The name of the [reference](https://git-scm.com/docs/gitglossary#def_ref) such as **branch** or **tag** in the repository. - * - * @example my-feature-branch - * - * @example tag-1-test - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_VCS_REPOSITORY_REF_NAME = 'vcs.repository.ref.name'; -/** - * The revision, literally [revised version](https://www.merriam-webster.com/dictionary/revision), The revision most often refers to a commit object in Git, or a revision number in SVN. - * - * @example 9d59409acf479dfa0df1aa568182e43e43df8bbe28d60fcf2bc52e30068802cc - * - * @example main - * - * @example 123 - * - * @example HEAD - * - * @note The revision can be a full [hash value (see glossary)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf), - * of the recorded change to a ref within a repository pointing to a - * commit [commit](https://git-scm.com/docs/git-commit) object. It does - * not necessarily have to be a hash; it can simply define a - * [revision number](https://svnbook.red-bean.com/en/1.7/svn.tour.revs.specifiers.html) - * which is an integer that is monotonically increasing. In cases where - * it is identical to the `ref.name`, it **SHOULD** still be included. It is - * up to the implementer to decide which value to set as the revision - * based on the VCS system and situational context. - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_VCS_REPOSITORY_REF_REVISION = 'vcs.repository.ref.revision'; -/** - * The type of the [reference](https://git-scm.com/docs/gitglossary#def_ref) in the repository. - * - * @example branch - * - * @example tag - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_VCS_REPOSITORY_REF_TYPE = 'vcs.repository.ref.type'; -/** - * Enum value "branch" for attribute {@link ATTR_VCS_REPOSITORY_REF_TYPE}. - */ -exports.VCS_REPOSITORY_REF_TYPE_VALUE_BRANCH = "branch"; -/** - * Enum value "tag" for attribute {@link ATTR_VCS_REPOSITORY_REF_TYPE}. - */ -exports.VCS_REPOSITORY_REF_TYPE_VALUE_TAG = "tag"; -/** - * The [URL](https://en.wikipedia.org/wiki/URL) of the repository providing the complete address in order to locate and identify the repository. - * - * @example https://github.com/opentelemetry/open-telemetry-collector-contrib - * - * @example https://gitlab.com/my-org/my-project/my-projects-project/repo - * - * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.ATTR_VCS_REPOSITORY_URL_FULL = 'vcs.repository.url.full'; -/** - * 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'; -//# sourceMappingURL=experimental_attributes.js.map - -/***/ }), - -/***/ 44956: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.METRIC_HTTP_CLIENT_OPEN_CONNECTIONS = exports.METRIC_HTTP_CLIENT_CONNECTION_DURATION = exports.METRIC_HTTP_CLIENT_ACTIVE_REQUESTS = exports.METRIC_GO_SCHEDULE_DURATION = exports.METRIC_GO_PROCESSOR_LIMIT = exports.METRIC_GO_MEMORY_USED = exports.METRIC_GO_MEMORY_LIMIT = exports.METRIC_GO_MEMORY_GC_GOAL = exports.METRIC_GO_MEMORY_ALLOCATIONS = exports.METRIC_GO_MEMORY_ALLOCATED = exports.METRIC_GO_GOROUTINE_COUNT = exports.METRIC_GO_CONFIG_GOGC = exports.METRIC_GEN_AI_SERVER_TIME_TO_FIRST_TOKEN = exports.METRIC_GEN_AI_SERVER_TIME_PER_OUTPUT_TOKEN = exports.METRIC_GEN_AI_SERVER_REQUEST_DURATION = exports.METRIC_GEN_AI_CLIENT_TOKEN_USAGE = exports.METRIC_GEN_AI_CLIENT_OPERATION_DURATION = exports.METRIC_FAAS_TIMEOUTS = exports.METRIC_FAAS_NET_IO = exports.METRIC_FAAS_MEM_USAGE = exports.METRIC_FAAS_INVOKE_DURATION = exports.METRIC_FAAS_INVOCATIONS = exports.METRIC_FAAS_INIT_DURATION = exports.METRIC_FAAS_ERRORS = exports.METRIC_FAAS_CPU_USAGE = exports.METRIC_FAAS_COLDSTARTS = exports.METRIC_DNS_LOOKUP_DURATION = exports.METRIC_DB_CLIENT_OPERATION_DURATION = exports.METRIC_DB_CLIENT_CONNECTIONS_WAIT_TIME = exports.METRIC_DB_CLIENT_CONNECTIONS_USE_TIME = exports.METRIC_DB_CLIENT_CONNECTIONS_USAGE = exports.METRIC_DB_CLIENT_CONNECTIONS_TIMEOUTS = exports.METRIC_DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = exports.METRIC_DB_CLIENT_CONNECTIONS_MAX = exports.METRIC_DB_CLIENT_CONNECTIONS_IDLE_MIN = exports.METRIC_DB_CLIENT_CONNECTIONS_IDLE_MAX = exports.METRIC_DB_CLIENT_CONNECTIONS_CREATE_TIME = exports.METRIC_DB_CLIENT_CONNECTION_WAIT_TIME = exports.METRIC_DB_CLIENT_CONNECTION_USE_TIME = exports.METRIC_DB_CLIENT_CONNECTION_TIMEOUTS = exports.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS = exports.METRIC_DB_CLIENT_CONNECTION_MAX = exports.METRIC_DB_CLIENT_CONNECTION_IDLE_MIN = exports.METRIC_DB_CLIENT_CONNECTION_IDLE_MAX = exports.METRIC_DB_CLIENT_CONNECTION_CREATE_TIME = exports.METRIC_DB_CLIENT_CONNECTION_COUNT = exports.METRIC_CONTAINER_NETWORK_IO = exports.METRIC_CONTAINER_MEMORY_USAGE = exports.METRIC_CONTAINER_DISK_IO = exports.METRIC_CONTAINER_CPU_TIME = void 0; -exports.METRIC_SYSTEM_CPU_FREQUENCY = exports.METRIC_RPC_SERVER_RESPONSES_PER_RPC = exports.METRIC_RPC_SERVER_RESPONSE_SIZE = exports.METRIC_RPC_SERVER_REQUESTS_PER_RPC = exports.METRIC_RPC_SERVER_REQUEST_SIZE = exports.METRIC_RPC_SERVER_DURATION = exports.METRIC_RPC_CLIENT_RESPONSES_PER_RPC = exports.METRIC_RPC_CLIENT_RESPONSE_SIZE = exports.METRIC_RPC_CLIENT_REQUESTS_PER_RPC = exports.METRIC_RPC_CLIENT_REQUEST_SIZE = exports.METRIC_RPC_CLIENT_DURATION = exports.METRIC_PROCESS_THREAD_COUNT = exports.METRIC_PROCESS_PAGING_FAULTS = exports.METRIC_PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = exports.METRIC_PROCESS_NETWORK_IO = exports.METRIC_PROCESS_MEMORY_VIRTUAL = exports.METRIC_PROCESS_MEMORY_USAGE = exports.METRIC_PROCESS_DISK_IO = exports.METRIC_PROCESS_CPU_UTILIZATION = exports.METRIC_PROCESS_CPU_TIME = exports.METRIC_PROCESS_CONTEXT_SWITCHES = exports.METRIC_NODEJS_EVENTLOOP_UTILIZATION = exports.METRIC_NODEJS_EVENTLOOP_DELAY_STDDEV = exports.METRIC_NODEJS_EVENTLOOP_DELAY_P99 = exports.METRIC_NODEJS_EVENTLOOP_DELAY_P90 = exports.METRIC_NODEJS_EVENTLOOP_DELAY_P50 = exports.METRIC_NODEJS_EVENTLOOP_DELAY_MIN = exports.METRIC_NODEJS_EVENTLOOP_DELAY_MEAN = exports.METRIC_NODEJS_EVENTLOOP_DELAY_MAX = exports.METRIC_MESSAGING_RECEIVE_MESSAGES = exports.METRIC_MESSAGING_RECEIVE_DURATION = exports.METRIC_MESSAGING_PUBLISH_MESSAGES = exports.METRIC_MESSAGING_PUBLISH_DURATION = exports.METRIC_MESSAGING_PROCESS_MESSAGES = exports.METRIC_MESSAGING_PROCESS_DURATION = exports.METRIC_MESSAGING_CLIENT_PUBLISHED_MESSAGES = exports.METRIC_MESSAGING_CLIENT_OPERATION_DURATION = exports.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = exports.METRIC_JVM_SYSTEM_CPU_UTILIZATION = exports.METRIC_JVM_SYSTEM_CPU_LOAD_1M = exports.METRIC_JVM_MEMORY_INIT = exports.METRIC_JVM_BUFFER_MEMORY_USED = exports.METRIC_JVM_BUFFER_MEMORY_USAGE = exports.METRIC_JVM_BUFFER_MEMORY_LIMIT = exports.METRIC_JVM_BUFFER_COUNT = exports.METRIC_HTTP_SERVER_RESPONSE_BODY_SIZE = exports.METRIC_HTTP_SERVER_REQUEST_BODY_SIZE = exports.METRIC_HTTP_SERVER_ACTIVE_REQUESTS = exports.METRIC_HTTP_CLIENT_RESPONSE_BODY_SIZE = exports.METRIC_HTTP_CLIENT_REQUEST_BODY_SIZE = void 0; -exports.METRIC_V8JS_MEMORY_HEAP_USED = exports.METRIC_V8JS_MEMORY_HEAP_LIMIT = exports.METRIC_V8JS_HEAP_SPACE_PHYSICAL_SIZE = exports.METRIC_V8JS_HEAP_SPACE_AVAILABLE_SIZE = exports.METRIC_V8JS_GC_DURATION = exports.METRIC_SYSTEM_PROCESS_CREATED = exports.METRIC_SYSTEM_PROCESS_COUNT = exports.METRIC_SYSTEM_PAGING_UTILIZATION = exports.METRIC_SYSTEM_PAGING_USAGE = exports.METRIC_SYSTEM_PAGING_OPERATIONS = exports.METRIC_SYSTEM_PAGING_FAULTS = exports.METRIC_SYSTEM_NETWORK_PACKETS = exports.METRIC_SYSTEM_NETWORK_IO = exports.METRIC_SYSTEM_NETWORK_ERRORS = exports.METRIC_SYSTEM_NETWORK_DROPPED = exports.METRIC_SYSTEM_NETWORK_CONNECTIONS = exports.METRIC_SYSTEM_MEMORY_UTILIZATION = exports.METRIC_SYSTEM_MEMORY_USAGE = exports.METRIC_SYSTEM_MEMORY_SHARED = exports.METRIC_SYSTEM_MEMORY_LIMIT = exports.METRIC_SYSTEM_LINUX_MEMORY_SLAB_USAGE = exports.METRIC_SYSTEM_LINUX_MEMORY_AVAILABLE = exports.METRIC_SYSTEM_FILESYSTEM_UTILIZATION = exports.METRIC_SYSTEM_FILESYSTEM_USAGE = exports.METRIC_SYSTEM_DISK_OPERATIONS = exports.METRIC_SYSTEM_DISK_OPERATION_TIME = exports.METRIC_SYSTEM_DISK_MERGED = exports.METRIC_SYSTEM_DISK_IO_TIME = exports.METRIC_SYSTEM_DISK_IO = exports.METRIC_SYSTEM_CPU_UTILIZATION = exports.METRIC_SYSTEM_CPU_TIME = exports.METRIC_SYSTEM_CPU_PHYSICAL_COUNT = exports.METRIC_SYSTEM_CPU_LOGICAL_COUNT = void 0; -//---------------------------------------------------------------------------------------------------------- -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/register/stable/metrics.ts.j2 -//---------------------------------------------------------------------------------------------------------- -/** - * Total CPU time consumed - * - * @note Total CPU time consumed by the specific container on all available CPU cores - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_CONTAINER_CPU_TIME = 'container.cpu.time'; -/** - * Disk bytes for the container. - * - * @note The total number of bytes read/written successfully (aggregated from all disks). - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_CONTAINER_DISK_IO = 'container.disk.io'; -/** - * Memory usage of the container. - * - * @note Memory usage of the container. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_CONTAINER_MEMORY_USAGE = 'container.memory.usage'; -/** - * Network bytes for the container. - * - * @note The number of bytes sent/received on all network interfaces by the container. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_CONTAINER_NETWORK_IO = 'container.network.io'; -/** - * The number of connections that are currently in state described by the `state` attribute - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_COUNT = 'db.client.connection.count'; -/** - * The time it took to create a new connection - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_CREATE_TIME = 'db.client.connection.create_time'; -/** - * The maximum number of idle open connections allowed - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_IDLE_MAX = 'db.client.connection.idle.max'; -/** - * The minimum number of idle open connections allowed - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_IDLE_MIN = 'db.client.connection.idle.min'; -/** - * The maximum number of open connections allowed - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_MAX = 'db.client.connection.max'; -/** - * The number of pending requests for an open connection, cumulative for the entire pool - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS = 'db.client.connection.pending_requests'; -/** - * The number of connection timeouts that have occurred trying to obtain a connection from the pool - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_TIMEOUTS = 'db.client.connection.timeouts'; -/** - * The time between borrowing a connection and returning it to the pool - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_USE_TIME = 'db.client.connection.use_time'; -/** - * The time it took to obtain an open connection from the pool - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_CONNECTION_WAIT_TIME = 'db.client.connection.wait_time'; -/** - * Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from `ms` to `s`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.create_time`. Note: the unit also changed from `ms` to `s`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_CREATE_TIME = 'db.client.connections.create_time'; -/** - * Deprecated, use `db.client.connection.idle.max` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.idle.max`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_IDLE_MAX = 'db.client.connections.idle.max'; -/** - * Deprecated, use `db.client.connection.idle.min` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.idle.min`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_IDLE_MIN = 'db.client.connections.idle.min'; -/** - * Deprecated, use `db.client.connection.max` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.max`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_MAX = 'db.client.connections.max'; -/** - * Deprecated, use `db.client.connection.pending_requests` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.pending_requests`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_PENDING_REQUESTS = 'db.client.connections.pending_requests'; -/** - * Deprecated, use `db.client.connection.timeouts` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.timeouts`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_TIMEOUTS = 'db.client.connections.timeouts'; -/** - * Deprecated, use `db.client.connection.count` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.count`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_USAGE = 'db.client.connections.usage'; -/** - * Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from `ms` to `s`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.use_time`. Note: the unit also changed from `ms` to `s`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_USE_TIME = 'db.client.connections.use_time'; -/** - * Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from `ms` to `s`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `db.client.connection.wait_time`. Note: the unit also changed from `ms` to `s`. - */ -exports.METRIC_DB_CLIENT_CONNECTIONS_WAIT_TIME = 'db.client.connections.wait_time'; -/** - * Duration of database client operations. - * - * @note Batch operations **SHOULD** be recorded as a single operation. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DB_CLIENT_OPERATION_DURATION = 'db.client.operation.duration'; -/** - * Measures the time taken to perform a DNS lookup. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_DNS_LOOKUP_DURATION = 'dns.lookup.duration'; -/** - * Number of invocation cold starts - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_COLDSTARTS = 'faas.coldstarts'; -/** - * Distribution of CPU usage per invocation - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_CPU_USAGE = 'faas.cpu_usage'; -/** - * Number of invocation errors - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_ERRORS = 'faas.errors'; -/** - * Measures the duration of the function's initialization, such as a cold start - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_INIT_DURATION = 'faas.init_duration'; -/** - * Number of successful invocations - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_INVOCATIONS = 'faas.invocations'; -/** - * Measures the duration of the function's logic execution - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_INVOKE_DURATION = 'faas.invoke_duration'; -/** - * Distribution of max memory usage per invocation - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_MEM_USAGE = 'faas.mem_usage'; -/** - * Distribution of net I/O usage per invocation - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_NET_IO = 'faas.net_io'; -/** - * Number of invocation timeouts - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_FAAS_TIMEOUTS = 'faas.timeouts'; -/** - * GenAI operation duration - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GEN_AI_CLIENT_OPERATION_DURATION = 'gen_ai.client.operation.duration'; -/** - * Measures number of input and output tokens used - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GEN_AI_CLIENT_TOKEN_USAGE = 'gen_ai.client.token.usage'; -/** - * Generative AI server request duration such as time-to-last byte or last output token - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GEN_AI_SERVER_REQUEST_DURATION = 'gen_ai.server.request.duration'; -/** - * Time per output token generated after the first token for successful responses - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GEN_AI_SERVER_TIME_PER_OUTPUT_TOKEN = 'gen_ai.server.time_per_output_token'; -/** - * Time to generate first token for successful responses - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GEN_AI_SERVER_TIME_TO_FIRST_TOKEN = 'gen_ai.server.time_to_first_token'; -/** - * Heap size target percentage configured by the user, otherwise 100. - * - * @note The value range is [0.0,100.0]. Computed from `/gc/gogc:percent`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_CONFIG_GOGC = 'go.config.gogc'; -/** - * Count of live goroutines. - * - * @note Computed from `/sched/goroutines:goroutines`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_GOROUTINE_COUNT = 'go.goroutine.count'; -/** - * Memory allocated to the heap by the application. - * - * @note Computed from `/gc/heap/allocs:bytes`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_MEMORY_ALLOCATED = 'go.memory.allocated'; -/** - * Count of allocations to the heap by the application. - * - * @note Computed from `/gc/heap/allocs:objects`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_MEMORY_ALLOCATIONS = 'go.memory.allocations'; -/** - * Heap size target for the end of the GC cycle. - * - * @note Computed from `/gc/heap/goal:bytes`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_MEMORY_GC_GOAL = 'go.memory.gc.goal'; -/** - * Go runtime memory limit configured by the user, if a limit exists. - * - * @note Computed from `/gc/gomemlimit:bytes`. This metric is excluded if the limit obtained from the Go runtime is math.MaxInt64. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_MEMORY_LIMIT = 'go.memory.limit'; -/** - * Memory used by the Go runtime. - * - * @note Computed from `(/memory/classes/total:bytes - /memory/classes/heap/released:bytes)`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_MEMORY_USED = 'go.memory.used'; -/** - * The number of OS threads that can execute user-level Go code simultaneously. - * - * @note Computed from `/sched/gomaxprocs:threads`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_PROCESSOR_LIMIT = 'go.processor.limit'; -/** - * The time goroutines have spent in the scheduler in a runnable state before actually running. - * - * @note Computed from `/sched/latencies:seconds`. Bucket boundaries are provided by the runtime, and are subject to change. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_GO_SCHEDULE_DURATION = 'go.schedule.duration'; -/** - * Number of active HTTP requests. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_HTTP_CLIENT_ACTIVE_REQUESTS = 'http.client.active_requests'; -/** - * The duration of the successfully established outbound HTTP connections. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_HTTP_CLIENT_CONNECTION_DURATION = 'http.client.connection.duration'; -/** - * Number of outbound HTTP connections that are currently active or idle on the client. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_HTTP_CLIENT_OPEN_CONNECTIONS = 'http.client.open_connections'; -/** - * Size of HTTP client request bodies. - * - * @note The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_HTTP_CLIENT_REQUEST_BODY_SIZE = 'http.client.request.body.size'; -/** - * Size of HTTP client response bodies. - * - * @note The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_HTTP_CLIENT_RESPONSE_BODY_SIZE = 'http.client.response.body.size'; -/** - * Number of active HTTP server requests. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_HTTP_SERVER_ACTIVE_REQUESTS = 'http.server.active_requests'; -/** - * Size of HTTP server request bodies. - * - * @note The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_HTTP_SERVER_REQUEST_BODY_SIZE = 'http.server.request.body.size'; -/** - * Size of HTTP server response bodies. - * - * @note The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_HTTP_SERVER_RESPONSE_BODY_SIZE = 'http.server.response.body.size'; -/** - * Number of buffers in the pool. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_JVM_BUFFER_COUNT = 'jvm.buffer.count'; -/** - * Measure of total memory capacity of buffers. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_JVM_BUFFER_MEMORY_LIMIT = 'jvm.buffer.memory.limit'; -/** - * Deprecated, use `jvm.buffer.memory.used` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `jvm.buffer.memory.used`. - */ -exports.METRIC_JVM_BUFFER_MEMORY_USAGE = 'jvm.buffer.memory.usage'; -/** - * Measure of memory used by buffers. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_JVM_BUFFER_MEMORY_USED = 'jvm.buffer.memory.used'; -/** - * Measure of initial memory requested. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_JVM_MEMORY_INIT = 'jvm.memory.init'; -/** - * Average CPU load of the whole system for the last minute as reported by the JVM. - * - * @note The value range is [0,n], where n is the number of CPU cores - or a negative number if the value is not available. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/java.management/java/lang/management/OperatingSystemMXBean.html#getSystemLoadAverage()). - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_JVM_SYSTEM_CPU_LOAD_1M = 'jvm.system.cpu.load_1m'; -/** - * Recent CPU utilization for the whole system as reported by the JVM. - * - * @note The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getCpuLoad()). - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_JVM_SYSTEM_CPU_UTILIZATION = 'jvm.system.cpu.utilization'; -/** - * Number of messages that were delivered to the application. - * - * @note Records the number of messages pulled from the broker or number of messages dispatched to the application in push-based scenarios. - * The metric **SHOULD** be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, this counter is incremented when the message is received and not reported when it is processed. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = 'messaging.client.consumed.messages'; -/** - * Duration of messaging operation initiated by a producer or consumer client. - * - * @note This metric **SHOULD** **NOT** be used to report processing duration - processing duration is reported in `messaging.process.duration` metric. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_MESSAGING_CLIENT_OPERATION_DURATION = 'messaging.client.operation.duration'; -/** - * Number of messages producer attempted to publish to the broker. - * - * @note This metric **MUST** **NOT** count messages that were created haven't yet been attempted to be published. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_MESSAGING_CLIENT_PUBLISHED_MESSAGES = 'messaging.client.published.messages'; -/** - * Duration of processing operation. - * - * @note This metric **MUST** be reported for operations with `messaging.operation.type` that matches `process`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_MESSAGING_PROCESS_DURATION = 'messaging.process.duration'; -/** - * Deprecated. Use `messaging.client.consumed.messages` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.client.consumed.messages`. - */ -exports.METRIC_MESSAGING_PROCESS_MESSAGES = 'messaging.process.messages'; -/** - * Deprecated. Use `messaging.client.operation.duration` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.client.operation.duration`. - */ -exports.METRIC_MESSAGING_PUBLISH_DURATION = 'messaging.publish.duration'; -/** - * Deprecated. Use `messaging.client.produced.messages` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.client.produced.messages`. - */ -exports.METRIC_MESSAGING_PUBLISH_MESSAGES = 'messaging.publish.messages'; -/** - * Deprecated. Use `messaging.client.operation.duration` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.client.operation.duration`. - */ -exports.METRIC_MESSAGING_RECEIVE_DURATION = 'messaging.receive.duration'; -/** - * Deprecated. Use `messaging.client.consumed.messages` instead. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - * - * @deprecated * Replaced by `messaging.client.consumed.messages`. - */ -exports.METRIC_MESSAGING_RECEIVE_MESSAGES = 'messaging.receive.messages'; -/** - * Event loop maximum delay. - * - * @note Value can be retrieved from value `histogram.max` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_NODEJS_EVENTLOOP_DELAY_MAX = 'nodejs.eventloop.delay.max'; -/** - * Event loop mean delay. - * - * @note Value can be retrieved from value `histogram.mean` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_NODEJS_EVENTLOOP_DELAY_MEAN = 'nodejs.eventloop.delay.mean'; -/** - * Event loop minimum delay. - * - * @note Value can be retrieved from value `histogram.min` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_NODEJS_EVENTLOOP_DELAY_MIN = 'nodejs.eventloop.delay.min'; -/** - * Event loop 50 percentile delay. - * - * @note Value can be retrieved from value `histogram.percentile(50)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_NODEJS_EVENTLOOP_DELAY_P50 = 'nodejs.eventloop.delay.p50'; -/** - * Event loop 90 percentile delay. - * - * @note Value can be retrieved from value `histogram.percentile(90)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_NODEJS_EVENTLOOP_DELAY_P90 = 'nodejs.eventloop.delay.p90'; -/** - * Event loop 99 percentile delay. - * - * @note Value can be retrieved from value `histogram.percentile(99)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_NODEJS_EVENTLOOP_DELAY_P99 = 'nodejs.eventloop.delay.p99'; -/** - * Event loop standard deviation delay. - * - * @note Value can be retrieved from value `histogram.stddev` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_NODEJS_EVENTLOOP_DELAY_STDDEV = 'nodejs.eventloop.delay.stddev'; -/** - * Event loop utilization. - * - * @note The value range is [0.0,1.0] and can be retrieved from value [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_NODEJS_EVENTLOOP_UTILIZATION = 'nodejs.eventloop.utilization'; -/** - * Number of times the process has been context switched. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_CONTEXT_SWITCHES = 'process.context_switches'; -/** - * Total CPU seconds broken down by different states. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_CPU_TIME = 'process.cpu.time'; -/** - * Difference in process.cpu.time since the last measurement, divided by the elapsed time and number of CPUs available to the process. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_CPU_UTILIZATION = 'process.cpu.utilization'; -/** - * Disk bytes transferred. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_DISK_IO = 'process.disk.io'; -/** - * The amount of physical memory in use. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_MEMORY_USAGE = 'process.memory.usage'; -/** - * The amount of committed virtual memory. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_MEMORY_VIRTUAL = 'process.memory.virtual'; -/** - * Network bytes transferred. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_NETWORK_IO = 'process.network.io'; -/** - * Number of file descriptors in use by the process. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_OPEN_FILE_DESCRIPTOR_COUNT = 'process.open_file_descriptor.count'; -/** - * Number of page faults the process has made. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_PAGING_FAULTS = 'process.paging.faults'; -/** - * Process threads count. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_PROCESS_THREAD_COUNT = 'process.thread.count'; -/** - * Measures the duration of outbound RPC. - * - * @note While streaming RPCs may record this metric as start-of-batch - * to end-of-batch, it's hard to interpret in practice. - * - * **Streaming**: N/A. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_CLIENT_DURATION = 'rpc.client.duration'; -/** - * Measures the size of RPC request messages (uncompressed). - * - * @note **Streaming**: Recorded per message in a streaming batch - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_CLIENT_REQUEST_SIZE = 'rpc.client.request.size'; -/** - * Measures the number of messages received per RPC. - * - * @note Should be 1 for all non-streaming RPCs. - * - * **Streaming**: This metric is required for server and client streaming RPCs - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_CLIENT_REQUESTS_PER_RPC = 'rpc.client.requests_per_rpc'; -/** - * Measures the size of RPC response messages (uncompressed). - * - * @note **Streaming**: Recorded per response in a streaming batch - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_CLIENT_RESPONSE_SIZE = 'rpc.client.response.size'; -/** - * Measures the number of messages sent per RPC. - * - * @note Should be 1 for all non-streaming RPCs. - * - * **Streaming**: This metric is required for server and client streaming RPCs - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_CLIENT_RESPONSES_PER_RPC = 'rpc.client.responses_per_rpc'; -/** - * Measures the duration of inbound RPC. - * - * @note While streaming RPCs may record this metric as start-of-batch - * to end-of-batch, it's hard to interpret in practice. - * - * **Streaming**: N/A. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_SERVER_DURATION = 'rpc.server.duration'; -/** - * Measures the size of RPC request messages (uncompressed). - * - * @note **Streaming**: Recorded per message in a streaming batch - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_SERVER_REQUEST_SIZE = 'rpc.server.request.size'; -/** - * Measures the number of messages received per RPC. - * - * @note Should be 1 for all non-streaming RPCs. - * - * **Streaming** : This metric is required for server and client streaming RPCs - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_SERVER_REQUESTS_PER_RPC = 'rpc.server.requests_per_rpc'; -/** - * Measures the size of RPC response messages (uncompressed). - * - * @note **Streaming**: Recorded per response in a streaming batch - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_SERVER_RESPONSE_SIZE = 'rpc.server.response.size'; -/** - * Measures the number of messages sent per RPC. - * - * @note Should be 1 for all non-streaming RPCs. - * - * **Streaming**: This metric is required for server and client streaming RPCs - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_RPC_SERVER_RESPONSES_PER_RPC = 'rpc.server.responses_per_rpc'; -/** - * Reports the current frequency of the CPU in Hz - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_CPU_FREQUENCY = 'system.cpu.frequency'; -/** - * Reports the number of logical (virtual) processor cores created by the operating system to manage multitasking - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_CPU_LOGICAL_COUNT = 'system.cpu.logical.count'; -/** - * Reports the number of actual physical processor cores on the hardware - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_CPU_PHYSICAL_COUNT = 'system.cpu.physical.count'; -/** - * Seconds each logical CPU spent on each mode - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_CPU_TIME = 'system.cpu.time'; -/** - * Difference in system.cpu.time since the last measurement, divided by the elapsed time and number of logical CPUs - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_CPU_UTILIZATION = 'system.cpu.utilization'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_DISK_IO = 'system.disk.io'; -/** - * Time disk spent activated - * - * @note The real elapsed time ("wall clock") used in the I/O path (time from operations running in parallel are not counted). Measured as: - * - * - Linux: Field 13 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) - * - Windows: The complement of - * ["Disk\% Idle Time"](https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained) - * performance counter: `uptime * (100 - "Disk\% Idle Time") / 100` - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_DISK_IO_TIME = 'system.disk.io_time'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_DISK_MERGED = 'system.disk.merged'; -/** - * Sum of the time each operation took to complete - * - * @note Because it is the sum of time each request took, parallel-issued requests each contribute to make the count grow. Measured as: - * - * - Linux: Fields 7 & 11 from [procfs-diskstats](https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats) - * - Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter (similar for Writes) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_DISK_OPERATION_TIME = 'system.disk.operation_time'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_DISK_OPERATIONS = 'system.disk.operations'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_FILESYSTEM_USAGE = 'system.filesystem.usage'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_FILESYSTEM_UTILIZATION = 'system.filesystem.utilization'; -/** - * An estimate of how much memory is available for starting new applications, without causing swapping - * - * @note This is an alternative to `system.memory.usage` metric with `state=free`. - * Linux starting from 3.14 exports "available" memory. It takes "free" memory as a baseline, and then factors in kernel-specific values. - * This is supposed to be more accurate than just "free" memory. - * For reference, see the calculations [here](https://superuser.com/a/980821). - * See also `MemAvailable` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_LINUX_MEMORY_AVAILABLE = 'system.linux.memory.available'; -/** - * Reports the memory used by the Linux kernel for managing caches of frequently used objects. - * - * @note The sum over the `reclaimable` and `unreclaimable` state values in `linux.memory.slab.usage` **SHOULD** be equal to the total slab memory available on the system. - * Note that the total slab memory is not constant and may vary over time. - * See also the [Slab allocator](https://blogs.oracle.com/linux/post/understanding-linux-kernel-memory-statistics) and `Slab` in [/proc/meminfo](https://man7.org/linux/man-pages/man5/proc.5.html). - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_LINUX_MEMORY_SLAB_USAGE = 'system.linux.memory.slab.usage'; -/** - * Total memory available in the system. - * - * @note Its value **SHOULD** equal the sum of `system.memory.state` over all states. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_MEMORY_LIMIT = 'system.memory.limit'; -/** - * Shared memory used (mostly by tmpfs). - * - * @note Equivalent of `shared` from [`free` command](https://man7.org/linux/man-pages/man1/free.1.html) or - * `Shmem` from [`/proc/meminfo`](https://man7.org/linux/man-pages/man5/proc.5.html)" - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_MEMORY_SHARED = 'system.memory.shared'; -/** - * Reports memory in use by state. - * - * @note The sum over all `system.memory.state` values **SHOULD** equal the total memory - * available on the system, that is `system.memory.limit`. - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_MEMORY_USAGE = 'system.memory.usage'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_MEMORY_UTILIZATION = 'system.memory.utilization'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_NETWORK_CONNECTIONS = 'system.network.connections'; -/** - * Count of packets that are dropped or discarded even though there was no error - * - * @note Measured as: - * - * - Linux: the `drop` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)) - * - Windows: [`InDiscards`/`OutDiscards`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) - * from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_NETWORK_DROPPED = 'system.network.dropped'; -/** - * Count of network errors detected - * - * @note Measured as: - * - * - Linux: the `errs` column in `/proc/dev/net` ([source](https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html)). - * - Windows: [`InErrors`/`OutErrors`](https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2) - * from [`GetIfEntry2`](https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2). - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_NETWORK_ERRORS = 'system.network.errors'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_NETWORK_IO = 'system.network.io'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_NETWORK_PACKETS = 'system.network.packets'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_PAGING_FAULTS = 'system.paging.faults'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_PAGING_OPERATIONS = 'system.paging.operations'; -/** - * Unix swap or windows pagefile usage - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_PAGING_USAGE = 'system.paging.usage'; -/** - - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_PAGING_UTILIZATION = 'system.paging.utilization'; -/** - * Total number of processes in each state - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_PROCESS_COUNT = 'system.process.count'; -/** - * Total number of processes created over uptime of the host - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_SYSTEM_PROCESS_CREATED = 'system.process.created'; -/** - * Garbage collection duration. - * - * @note The values can be retrieve from [`perf_hooks.PerformanceObserver(...).observe({ entryTypes: ['gc'] })`](https://nodejs.org/api/perf_hooks.html#performanceobserverobserveoptions) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_V8JS_GC_DURATION = 'v8js.gc.duration'; -/** - * Heap space available size. - * - * @note Value can be retrieved from value `space_available_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_V8JS_HEAP_SPACE_AVAILABLE_SIZE = 'v8js.heap.space.available_size'; -/** - * Committed size of a heap space. - * - * @note Value can be retrieved from value `physical_space_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_V8JS_HEAP_SPACE_PHYSICAL_SIZE = 'v8js.heap.space.physical_size'; -/** - * Total heap memory size pre-allocated. - * - * @note The value can be retrieved from value `space_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_V8JS_MEMORY_HEAP_LIMIT = 'v8js.memory.heap.limit'; -/** - * Heap Memory size allocated. - * - * @note The value can be retrieved from value `space_used_size` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics) - * - * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. - */ -exports.METRIC_V8JS_MEMORY_HEAP_USED = 'v8js.memory.heap.used'; -//# sourceMappingURL=experimental_metrics.js.map - -/***/ }), - -/***/ 65849: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -// Incubating export also contains stable constants in order to maintain -// backward compatibility between minor version releases -__exportStar(__nccwpck_require__(28231), exports); -__exportStar(__nccwpck_require__(67409), exports); -__exportStar(__nccwpck_require__(86219), exports); -__exportStar(__nccwpck_require__(44956), exports); -//# sourceMappingURL=index-incubating.js.map - -/***/ }), - -/***/ 32736: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* eslint-disable no-restricted-syntax -- - * These re-exports are only of constants, only two-levels deep, and - * should not cause problems for tree-shakers. - */ -// Deprecated. These are kept around for compatibility purposes -__exportStar(__nccwpck_require__(19887), exports); -__exportStar(__nccwpck_require__(83327), exports); -// Use these instead -__exportStar(__nccwpck_require__(28231), exports); -__exportStar(__nccwpck_require__(67409), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 56803: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createConstMap = void 0; -/** - * 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) { - // eslint-disable-next-line prefer-const, @typescript-eslint/no-explicit-any - 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; -} -exports.createConstMap = createConstMap; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 73629: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = void 0; -exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = exports.CLOUDPLATFORMVALUES_AZURE_AKS = exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = exports.CLOUDPLATFORMVALUES_AZURE_VM = exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = exports.CLOUDPLATFORMVALUES_AWS_EKS = exports.CLOUDPLATFORMVALUES_AWS_ECS = exports.CLOUDPLATFORMVALUES_AWS_EC2 = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = exports.CloudProviderValues = exports.CLOUDPROVIDERVALUES_GCP = exports.CLOUDPROVIDERVALUES_AZURE = exports.CLOUDPROVIDERVALUES_AWS = exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = exports.SemanticResourceAttributes = exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = exports.SEMRESATTRS_WEBENGINE_VERSION = exports.SEMRESATTRS_WEBENGINE_NAME = exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = exports.SEMRESATTRS_TELEMETRY_SDK_NAME = exports.SEMRESATTRS_SERVICE_VERSION = exports.SEMRESATTRS_SERVICE_INSTANCE_ID = exports.SEMRESATTRS_SERVICE_NAMESPACE = exports.SEMRESATTRS_SERVICE_NAME = exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = exports.SEMRESATTRS_PROCESS_OWNER = exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = exports.SEMRESATTRS_PROCESS_COMMAND_LINE = exports.SEMRESATTRS_PROCESS_COMMAND = exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = exports.SEMRESATTRS_PROCESS_PID = exports.SEMRESATTRS_OS_VERSION = exports.SEMRESATTRS_OS_NAME = exports.SEMRESATTRS_OS_DESCRIPTION = exports.SEMRESATTRS_OS_TYPE = exports.SEMRESATTRS_K8S_CRONJOB_NAME = exports.SEMRESATTRS_K8S_CRONJOB_UID = exports.SEMRESATTRS_K8S_JOB_NAME = exports.SEMRESATTRS_K8S_JOB_UID = exports.SEMRESATTRS_K8S_DAEMONSET_NAME = exports.SEMRESATTRS_K8S_DAEMONSET_UID = void 0; -exports.TelemetrySdkLanguageValues = exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = exports.TELEMETRYSDKLANGUAGEVALUES_PHP = exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = exports.TELEMETRYSDKLANGUAGEVALUES_GO = exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = exports.TELEMETRYSDKLANGUAGEVALUES_CPP = exports.OsTypeValues = exports.OSTYPEVALUES_Z_OS = exports.OSTYPEVALUES_SOLARIS = exports.OSTYPEVALUES_AIX = exports.OSTYPEVALUES_HPUX = exports.OSTYPEVALUES_DRAGONFLYBSD = exports.OSTYPEVALUES_OPENBSD = exports.OSTYPEVALUES_NETBSD = exports.OSTYPEVALUES_FREEBSD = exports.OSTYPEVALUES_DARWIN = exports.OSTYPEVALUES_LINUX = exports.OSTYPEVALUES_WINDOWS = exports.HostArchValues = exports.HOSTARCHVALUES_X86 = exports.HOSTARCHVALUES_PPC64 = exports.HOSTARCHVALUES_PPC32 = exports.HOSTARCHVALUES_IA64 = exports.HOSTARCHVALUES_ARM64 = exports.HOSTARCHVALUES_ARM32 = exports.HOSTARCHVALUES_AMD64 = exports.AwsEcsLaunchtypeValues = exports.AWSECSLAUNCHTYPEVALUES_FARGATE = exports.AWSECSLAUNCHTYPEVALUES_EC2 = exports.CloudPlatformValues = exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = void 0; -const utils_1 = __nccwpck_require__(56803); -//---------------------------------------------------------------------------------------------------------- -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -//---------------------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------------------- -// Constant values for SemanticResourceAttributes -//---------------------------------------------------------------------------------------------------------- -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_CLOUD_PROVIDER = 'cloud.provider'; -const TMP_CLOUD_ACCOUNT_ID = 'cloud.account.id'; -const TMP_CLOUD_REGION = 'cloud.region'; -const TMP_CLOUD_AVAILABILITY_ZONE = 'cloud.availability_zone'; -const TMP_CLOUD_PLATFORM = 'cloud.platform'; -const TMP_AWS_ECS_CONTAINER_ARN = 'aws.ecs.container.arn'; -const TMP_AWS_ECS_CLUSTER_ARN = 'aws.ecs.cluster.arn'; -const TMP_AWS_ECS_LAUNCHTYPE = 'aws.ecs.launchtype'; -const TMP_AWS_ECS_TASK_ARN = 'aws.ecs.task.arn'; -const TMP_AWS_ECS_TASK_FAMILY = 'aws.ecs.task.family'; -const TMP_AWS_ECS_TASK_REVISION = 'aws.ecs.task.revision'; -const TMP_AWS_EKS_CLUSTER_ARN = 'aws.eks.cluster.arn'; -const TMP_AWS_LOG_GROUP_NAMES = 'aws.log.group.names'; -const TMP_AWS_LOG_GROUP_ARNS = 'aws.log.group.arns'; -const TMP_AWS_LOG_STREAM_NAMES = 'aws.log.stream.names'; -const TMP_AWS_LOG_STREAM_ARNS = 'aws.log.stream.arns'; -const TMP_CONTAINER_NAME = 'container.name'; -const TMP_CONTAINER_ID = 'container.id'; -const TMP_CONTAINER_RUNTIME = 'container.runtime'; -const TMP_CONTAINER_IMAGE_NAME = 'container.image.name'; -const TMP_CONTAINER_IMAGE_TAG = 'container.image.tag'; -const TMP_DEPLOYMENT_ENVIRONMENT = 'deployment.environment'; -const TMP_DEVICE_ID = 'device.id'; -const TMP_DEVICE_MODEL_IDENTIFIER = 'device.model.identifier'; -const TMP_DEVICE_MODEL_NAME = 'device.model.name'; -const TMP_FAAS_NAME = 'faas.name'; -const TMP_FAAS_ID = 'faas.id'; -const TMP_FAAS_VERSION = 'faas.version'; -const TMP_FAAS_INSTANCE = 'faas.instance'; -const TMP_FAAS_MAX_MEMORY = 'faas.max_memory'; -const TMP_HOST_ID = 'host.id'; -const TMP_HOST_NAME = 'host.name'; -const TMP_HOST_TYPE = 'host.type'; -const TMP_HOST_ARCH = 'host.arch'; -const TMP_HOST_IMAGE_NAME = 'host.image.name'; -const TMP_HOST_IMAGE_ID = 'host.image.id'; -const TMP_HOST_IMAGE_VERSION = 'host.image.version'; -const TMP_K8S_CLUSTER_NAME = 'k8s.cluster.name'; -const TMP_K8S_NODE_NAME = 'k8s.node.name'; -const TMP_K8S_NODE_UID = 'k8s.node.uid'; -const TMP_K8S_NAMESPACE_NAME = 'k8s.namespace.name'; -const TMP_K8S_POD_UID = 'k8s.pod.uid'; -const TMP_K8S_POD_NAME = 'k8s.pod.name'; -const TMP_K8S_CONTAINER_NAME = 'k8s.container.name'; -const TMP_K8S_REPLICASET_UID = 'k8s.replicaset.uid'; -const TMP_K8S_REPLICASET_NAME = 'k8s.replicaset.name'; -const TMP_K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'; -const TMP_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'; -const TMP_K8S_STATEFULSET_UID = 'k8s.statefulset.uid'; -const TMP_K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; -const TMP_K8S_DAEMONSET_UID = 'k8s.daemonset.uid'; -const TMP_K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; -const TMP_K8S_JOB_UID = 'k8s.job.uid'; -const TMP_K8S_JOB_NAME = 'k8s.job.name'; -const TMP_K8S_CRONJOB_UID = 'k8s.cronjob.uid'; -const TMP_K8S_CRONJOB_NAME = 'k8s.cronjob.name'; -const TMP_OS_TYPE = 'os.type'; -const TMP_OS_DESCRIPTION = 'os.description'; -const TMP_OS_NAME = 'os.name'; -const TMP_OS_VERSION = 'os.version'; -const TMP_PROCESS_PID = 'process.pid'; -const TMP_PROCESS_EXECUTABLE_NAME = 'process.executable.name'; -const TMP_PROCESS_EXECUTABLE_PATH = 'process.executable.path'; -const TMP_PROCESS_COMMAND = 'process.command'; -const TMP_PROCESS_COMMAND_LINE = 'process.command_line'; -const TMP_PROCESS_COMMAND_ARGS = 'process.command_args'; -const TMP_PROCESS_OWNER = 'process.owner'; -const TMP_PROCESS_RUNTIME_NAME = 'process.runtime.name'; -const TMP_PROCESS_RUNTIME_VERSION = 'process.runtime.version'; -const TMP_PROCESS_RUNTIME_DESCRIPTION = 'process.runtime.description'; -const TMP_SERVICE_NAME = 'service.name'; -const TMP_SERVICE_NAMESPACE = 'service.namespace'; -const TMP_SERVICE_INSTANCE_ID = 'service.instance.id'; -const TMP_SERVICE_VERSION = 'service.version'; -const TMP_TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; -const TMP_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; -const TMP_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; -const TMP_TELEMETRY_AUTO_VERSION = 'telemetry.auto.version'; -const TMP_WEBENGINE_NAME = 'webengine.name'; -const TMP_WEBENGINE_VERSION = 'webengine.version'; -const TMP_WEBENGINE_DESCRIPTION = 'webengine.description'; -/** - * Name of the cloud provider. - * - * @deprecated use ATTR_CLOUD_PROVIDER - */ -exports.SEMRESATTRS_CLOUD_PROVIDER = TMP_CLOUD_PROVIDER; -/** - * The cloud account ID the resource is assigned to. - * - * @deprecated use ATTR_CLOUD_ACCOUNT_ID - */ -exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = TMP_CLOUD_ACCOUNT_ID; -/** - * The geographical region the resource is running. 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/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). - * - * @deprecated use ATTR_CLOUD_REGION - */ -exports.SEMRESATTRS_CLOUD_REGION = TMP_CLOUD_REGION; -/** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - * - * @deprecated use ATTR_CLOUD_AVAILABILITY_ZONE - */ -exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = TMP_CLOUD_AVAILABILITY_ZONE; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated use ATTR_CLOUD_PLATFORM - */ -exports.SEMRESATTRS_CLOUD_PLATFORM = TMP_CLOUD_PLATFORM; -/** - * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - * - * @deprecated use ATTR_AWS_ECS_CONTAINER_ARN - */ -exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = TMP_AWS_ECS_CONTAINER_ARN; -/** - * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - * - * @deprecated use ATTR_AWS_ECS_CLUSTER_ARN - */ -exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = TMP_AWS_ECS_CLUSTER_ARN; -/** - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - * - * @deprecated use ATTR_AWS_ECS_LAUNCHTYPE - */ -exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = TMP_AWS_ECS_LAUNCHTYPE; -/** - * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). - * - * @deprecated use ATTR_AWS_ECS_TASK_ARN - */ -exports.SEMRESATTRS_AWS_ECS_TASK_ARN = TMP_AWS_ECS_TASK_ARN; -/** - * The task definition family this task definition is a member of. - * - * @deprecated use ATTR_AWS_ECS_TASK_FAMILY - */ -exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = TMP_AWS_ECS_TASK_FAMILY; -/** - * The revision for this task definition. - * - * @deprecated use ATTR_AWS_ECS_TASK_REVISION - */ -exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = TMP_AWS_ECS_TASK_REVISION; -/** - * The ARN of an EKS cluster. - * - * @deprecated use ATTR_AWS_EKS_CLUSTER_ARN - */ -exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = TMP_AWS_EKS_CLUSTER_ARN; -/** - * The name(s) of the AWS log group(s) an application is writing to. - * - * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. - * - * @deprecated use ATTR_AWS_LOG_GROUP_NAMES - */ -exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = TMP_AWS_LOG_GROUP_NAMES; -/** - * The Amazon Resource Name(s) (ARN) of the AWS log group(s). - * - * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - * - * @deprecated use ATTR_AWS_LOG_GROUP_ARNS - */ -exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = TMP_AWS_LOG_GROUP_ARNS; -/** - * The name(s) of the AWS log stream(s) an application is writing to. - * - * @deprecated use ATTR_AWS_LOG_STREAM_NAMES - */ -exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = TMP_AWS_LOG_STREAM_NAMES; -/** - * The ARN(s) of the AWS log stream(s). - * - * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. - * - * @deprecated use ATTR_AWS_LOG_STREAM_ARNS - */ -exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = TMP_AWS_LOG_STREAM_ARNS; -/** - * Container name. - * - * @deprecated use ATTR_CONTAINER_NAME - */ -exports.SEMRESATTRS_CONTAINER_NAME = TMP_CONTAINER_NAME; -/** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. - * - * @deprecated use ATTR_CONTAINER_ID - */ -exports.SEMRESATTRS_CONTAINER_ID = TMP_CONTAINER_ID; -/** - * The container runtime managing this container. - * - * @deprecated use ATTR_CONTAINER_RUNTIME - */ -exports.SEMRESATTRS_CONTAINER_RUNTIME = TMP_CONTAINER_RUNTIME; -/** - * Name of the image the container was built on. - * - * @deprecated use ATTR_CONTAINER_IMAGE_NAME - */ -exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = TMP_CONTAINER_IMAGE_NAME; -/** - * Container image tag. - * - * @deprecated use ATTR_CONTAINER_IMAGE_TAG - */ -exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = TMP_CONTAINER_IMAGE_TAG; -/** - * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). - * - * @deprecated use ATTR_DEPLOYMENT_ENVIRONMENT - */ -exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = TMP_DEPLOYMENT_ENVIRONMENT; -/** - * A unique identifier representing the device. - * - * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. - * - * @deprecated use ATTR_DEVICE_ID - */ -exports.SEMRESATTRS_DEVICE_ID = TMP_DEVICE_ID; -/** - * The model identifier for the device. - * - * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. - * - * @deprecated use ATTR_DEVICE_MODEL_IDENTIFIER - */ -exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = TMP_DEVICE_MODEL_IDENTIFIER; -/** - * The marketing name for the device model. - * - * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. - * - * @deprecated use ATTR_DEVICE_MODEL_NAME - */ -exports.SEMRESATTRS_DEVICE_MODEL_NAME = TMP_DEVICE_MODEL_NAME; -/** - * The name of the single function that this runtime instance executes. - * - * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes). - * - * @deprecated use ATTR_FAAS_NAME - */ -exports.SEMRESATTRS_FAAS_NAME = TMP_FAAS_NAME; -/** -* The unique ID of the single function that this runtime instance executes. -* -* Note: Depending on the cloud provider, use: - -* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). -Take care not to use the "invoked ARN" directly but replace any -[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple -different aliases. -* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) -* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). - -On some providers, it may not be possible to determine the full ID at startup, -which is why this field cannot be made required. For example, on AWS the account ID -part of the ARN is not available without calling another AWS API -which may be deemed too slow for a short-running lambda function. -As an alternative, consider setting `faas.id` as a span attribute instead. -* -* @deprecated use ATTR_FAAS_ID -*/ -exports.SEMRESATTRS_FAAS_ID = TMP_FAAS_ID; -/** -* The immutable version of the function being executed. -* -* Note: Depending on the cloud provider and platform, use: - -* **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - (an integer represented as a decimal string). -* **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) - (i.e., the function name plus the revision suffix). -* **Google Cloud Functions:** The value of the - [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). -* **Azure Functions:** Not applicable. Do not set this attribute. -* -* @deprecated use ATTR_FAAS_VERSION -*/ -exports.SEMRESATTRS_FAAS_VERSION = TMP_FAAS_VERSION; -/** - * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. - * - * Note: * **AWS Lambda:** Use the (full) log stream name. - * - * @deprecated use ATTR_FAAS_INSTANCE - */ -exports.SEMRESATTRS_FAAS_INSTANCE = TMP_FAAS_INSTANCE; -/** - * The amount of memory available to the serverless function in MiB. - * - * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. - * - * @deprecated use ATTR_FAAS_MAX_MEMORY - */ -exports.SEMRESATTRS_FAAS_MAX_MEMORY = TMP_FAAS_MAX_MEMORY; -/** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. - * - * @deprecated use ATTR_HOST_ID - */ -exports.SEMRESATTRS_HOST_ID = TMP_HOST_ID; -/** - * 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. - * - * @deprecated use ATTR_HOST_NAME - */ -exports.SEMRESATTRS_HOST_NAME = TMP_HOST_NAME; -/** - * Type of host. For Cloud, this must be the machine type. - * - * @deprecated use ATTR_HOST_TYPE - */ -exports.SEMRESATTRS_HOST_TYPE = TMP_HOST_TYPE; -/** - * The CPU architecture the host system is running on. - * - * @deprecated use ATTR_HOST_ARCH - */ -exports.SEMRESATTRS_HOST_ARCH = TMP_HOST_ARCH; -/** - * Name of the VM image or OS install the host was instantiated from. - * - * @deprecated use ATTR_HOST_IMAGE_NAME - */ -exports.SEMRESATTRS_HOST_IMAGE_NAME = TMP_HOST_IMAGE_NAME; -/** - * VM image ID. For Cloud, this value is from the provider. - * - * @deprecated use ATTR_HOST_IMAGE_ID - */ -exports.SEMRESATTRS_HOST_IMAGE_ID = TMP_HOST_IMAGE_ID; -/** - * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). - * - * @deprecated use ATTR_HOST_IMAGE_VERSION - */ -exports.SEMRESATTRS_HOST_IMAGE_VERSION = TMP_HOST_IMAGE_VERSION; -/** - * The name of the cluster. - * - * @deprecated use ATTR_K8S_CLUSTER_NAME - */ -exports.SEMRESATTRS_K8S_CLUSTER_NAME = TMP_K8S_CLUSTER_NAME; -/** - * The name of the Node. - * - * @deprecated use ATTR_K8S_NODE_NAME - */ -exports.SEMRESATTRS_K8S_NODE_NAME = TMP_K8S_NODE_NAME; -/** - * The UID of the Node. - * - * @deprecated use ATTR_K8S_NODE_UID - */ -exports.SEMRESATTRS_K8S_NODE_UID = TMP_K8S_NODE_UID; -/** - * The name of the namespace that the pod is running in. - * - * @deprecated use ATTR_K8S_NAMESPACE_NAME - */ -exports.SEMRESATTRS_K8S_NAMESPACE_NAME = TMP_K8S_NAMESPACE_NAME; -/** - * The UID of the Pod. - * - * @deprecated use ATTR_K8S_POD_UID - */ -exports.SEMRESATTRS_K8S_POD_UID = TMP_K8S_POD_UID; -/** - * The name of the Pod. - * - * @deprecated use ATTR_K8S_POD_NAME - */ -exports.SEMRESATTRS_K8S_POD_NAME = TMP_K8S_POD_NAME; -/** - * The name of the Container in a Pod template. - * - * @deprecated use ATTR_K8S_CONTAINER_NAME - */ -exports.SEMRESATTRS_K8S_CONTAINER_NAME = TMP_K8S_CONTAINER_NAME; -/** - * The UID of the ReplicaSet. - * - * @deprecated use ATTR_K8S_REPLICASET_UID - */ -exports.SEMRESATTRS_K8S_REPLICASET_UID = TMP_K8S_REPLICASET_UID; -/** - * The name of the ReplicaSet. - * - * @deprecated use ATTR_K8S_REPLICASET_NAME - */ -exports.SEMRESATTRS_K8S_REPLICASET_NAME = TMP_K8S_REPLICASET_NAME; -/** - * The UID of the Deployment. - * - * @deprecated use ATTR_K8S_DEPLOYMENT_UID - */ -exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = TMP_K8S_DEPLOYMENT_UID; -/** - * The name of the Deployment. - * - * @deprecated use ATTR_K8S_DEPLOYMENT_NAME - */ -exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = TMP_K8S_DEPLOYMENT_NAME; -/** - * The UID of the StatefulSet. - * - * @deprecated use ATTR_K8S_STATEFULSET_UID - */ -exports.SEMRESATTRS_K8S_STATEFULSET_UID = TMP_K8S_STATEFULSET_UID; -/** - * The name of the StatefulSet. - * - * @deprecated use ATTR_K8S_STATEFULSET_NAME - */ -exports.SEMRESATTRS_K8S_STATEFULSET_NAME = TMP_K8S_STATEFULSET_NAME; -/** - * The UID of the DaemonSet. - * - * @deprecated use ATTR_K8S_DAEMONSET_UID - */ -exports.SEMRESATTRS_K8S_DAEMONSET_UID = TMP_K8S_DAEMONSET_UID; -/** - * The name of the DaemonSet. - * - * @deprecated use ATTR_K8S_DAEMONSET_NAME - */ -exports.SEMRESATTRS_K8S_DAEMONSET_NAME = TMP_K8S_DAEMONSET_NAME; -/** - * The UID of the Job. - * - * @deprecated use ATTR_K8S_JOB_UID - */ -exports.SEMRESATTRS_K8S_JOB_UID = TMP_K8S_JOB_UID; -/** - * The name of the Job. - * - * @deprecated use ATTR_K8S_JOB_NAME - */ -exports.SEMRESATTRS_K8S_JOB_NAME = TMP_K8S_JOB_NAME; -/** - * The UID of the CronJob. - * - * @deprecated use ATTR_K8S_CRONJOB_UID - */ -exports.SEMRESATTRS_K8S_CRONJOB_UID = TMP_K8S_CRONJOB_UID; -/** - * The name of the CronJob. - * - * @deprecated use ATTR_K8S_CRONJOB_NAME - */ -exports.SEMRESATTRS_K8S_CRONJOB_NAME = TMP_K8S_CRONJOB_NAME; -/** - * The operating system type. - * - * @deprecated use ATTR_OS_TYPE - */ -exports.SEMRESATTRS_OS_TYPE = TMP_OS_TYPE; -/** - * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. - * - * @deprecated use ATTR_OS_DESCRIPTION - */ -exports.SEMRESATTRS_OS_DESCRIPTION = TMP_OS_DESCRIPTION; -/** - * Human readable operating system name. - * - * @deprecated use ATTR_OS_NAME - */ -exports.SEMRESATTRS_OS_NAME = TMP_OS_NAME; -/** - * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). - * - * @deprecated use ATTR_OS_VERSION - */ -exports.SEMRESATTRS_OS_VERSION = TMP_OS_VERSION; -/** - * Process identifier (PID). - * - * @deprecated use ATTR_PROCESS_PID - */ -exports.SEMRESATTRS_PROCESS_PID = TMP_PROCESS_PID; -/** - * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. - * - * @deprecated use ATTR_PROCESS_EXECUTABLE_NAME - */ -exports.SEMRESATTRS_PROCESS_EXECUTABLE_NAME = TMP_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`. - * - * @deprecated use ATTR_PROCESS_EXECUTABLE_PATH - */ -exports.SEMRESATTRS_PROCESS_EXECUTABLE_PATH = TMP_PROCESS_EXECUTABLE_PATH; -/** - * 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`. - * - * @deprecated use ATTR_PROCESS_COMMAND - */ -exports.SEMRESATTRS_PROCESS_COMMAND = TMP_PROCESS_COMMAND; -/** - * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. - * - * @deprecated use ATTR_PROCESS_COMMAND_LINE - */ -exports.SEMRESATTRS_PROCESS_COMMAND_LINE = TMP_PROCESS_COMMAND_LINE; -/** - * 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`. - * - * @deprecated use ATTR_PROCESS_COMMAND_ARGS - */ -exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = TMP_PROCESS_COMMAND_ARGS; -/** - * The username of the user that owns the process. - * - * @deprecated use ATTR_PROCESS_OWNER - */ -exports.SEMRESATTRS_PROCESS_OWNER = TMP_PROCESS_OWNER; -/** - * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. - * - * @deprecated use ATTR_PROCESS_RUNTIME_NAME - */ -exports.SEMRESATTRS_PROCESS_RUNTIME_NAME = TMP_PROCESS_RUNTIME_NAME; -/** - * The version of the runtime of this process, as returned by the runtime without modification. - * - * @deprecated use ATTR_PROCESS_RUNTIME_VERSION - */ -exports.SEMRESATTRS_PROCESS_RUNTIME_VERSION = TMP_PROCESS_RUNTIME_VERSION; -/** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - * - * @deprecated use ATTR_PROCESS_RUNTIME_DESCRIPTION - */ -exports.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION = TMP_PROCESS_RUNTIME_DESCRIPTION; -/** - * Logical name of the service. - * - * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. - * - * @deprecated use ATTR_SERVICE_NAME - */ -exports.SEMRESATTRS_SERVICE_NAME = TMP_SERVICE_NAME; -/** - * A namespace for `service.name`. - * - * 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. - * - * @deprecated use ATTR_SERVICE_NAMESPACE - */ -exports.SEMRESATTRS_SERVICE_NAMESPACE = TMP_SERVICE_NAMESPACE; -/** - * The string ID of the service instance. - * - * 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). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). - * - * @deprecated use ATTR_SERVICE_INSTANCE_ID - */ -exports.SEMRESATTRS_SERVICE_INSTANCE_ID = TMP_SERVICE_INSTANCE_ID; -/** - * The version string of the service API or implementation. - * - * @deprecated use ATTR_SERVICE_VERSION - */ -exports.SEMRESATTRS_SERVICE_VERSION = TMP_SERVICE_VERSION; -/** - * The name of the telemetry SDK as defined above. - * - * @deprecated use ATTR_TELEMETRY_SDK_NAME - */ -exports.SEMRESATTRS_TELEMETRY_SDK_NAME = TMP_TELEMETRY_SDK_NAME; -/** - * The language of the telemetry SDK. - * - * @deprecated use ATTR_TELEMETRY_SDK_LANGUAGE - */ -exports.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = TMP_TELEMETRY_SDK_LANGUAGE; -/** - * The version string of the telemetry SDK. - * - * @deprecated use ATTR_TELEMETRY_SDK_VERSION - */ -exports.SEMRESATTRS_TELEMETRY_SDK_VERSION = TMP_TELEMETRY_SDK_VERSION; -/** - * The version string of the auto instrumentation agent, if used. - * - * @deprecated use ATTR_TELEMETRY_AUTO_VERSION - */ -exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = TMP_TELEMETRY_AUTO_VERSION; -/** - * The name of the web engine. - * - * @deprecated use ATTR_WEBENGINE_NAME - */ -exports.SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; -/** - * The version of the web engine. - * - * @deprecated use ATTR_WEBENGINE_VERSION - */ -exports.SEMRESATTRS_WEBENGINE_VERSION = TMP_WEBENGINE_VERSION; -/** - * Additional description of the web engine (e.g. detailed version and edition information). - * - * @deprecated use ATTR_WEBENGINE_DESCRIPTION - */ -exports.SEMRESATTRS_WEBENGINE_DESCRIPTION = TMP_WEBENGINE_DESCRIPTION; -/** - * Create exported Value Map for SemanticResourceAttributes values - * @deprecated Use the SEMRESATTRS_XXXXX constants rather than the SemanticResourceAttributes.XXXXX for bundle minification - */ -exports.SemanticResourceAttributes = -/*#__PURE__*/ (0, utils_1.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, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for CloudProviderValues enum definition - * - * Name of the cloud provider. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD = 'alibaba_cloud'; -const TMP_CLOUDPROVIDERVALUES_AWS = 'aws'; -const TMP_CLOUDPROVIDERVALUES_AZURE = 'azure'; -const TMP_CLOUDPROVIDERVALUES_GCP = 'gcp'; -/** - * Name of the cloud provider. - * - * @deprecated Use CLOUD_PROVIDER_VALUE_ALIBABA_CLOUD. - */ -exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD; -/** - * Name of the cloud provider. - * - * @deprecated Use CLOUD_PROVIDER_VALUE_AWS. - */ -exports.CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; -/** - * Name of the cloud provider. - * - * @deprecated Use CLOUD_PROVIDER_VALUE_AZURE. - */ -exports.CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; -/** - * Name of the cloud provider. - * - * @deprecated Use CLOUD_PROVIDER_VALUE_GCP. - */ -exports.CLOUDPROVIDERVALUES_GCP = TMP_CLOUDPROVIDERVALUES_GCP; -/** - * The constant map of values for CloudProviderValues. - * @deprecated Use the CLOUDPROVIDERVALUES_XXXXX constants rather than the CloudProviderValues.XXXXX for bundle minification. - */ -exports.CloudProviderValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD, - TMP_CLOUDPROVIDERVALUES_AWS, - TMP_CLOUDPROVIDERVALUES_AZURE, - TMP_CLOUDPROVIDERVALUES_GCP, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for CloudPlatformValues enum definition - * - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = 'alibaba_cloud_ecs'; -const TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = 'alibaba_cloud_fc'; -const TMP_CLOUDPLATFORMVALUES_AWS_EC2 = 'aws_ec2'; -const TMP_CLOUDPLATFORMVALUES_AWS_ECS = 'aws_ecs'; -const TMP_CLOUDPLATFORMVALUES_AWS_EKS = 'aws_eks'; -const TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA = 'aws_lambda'; -const TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = 'aws_elastic_beanstalk'; -const TMP_CLOUDPLATFORMVALUES_AZURE_VM = 'azure_vm'; -const TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = 'azure_container_instances'; -const TMP_CLOUDPLATFORMVALUES_AZURE_AKS = 'azure_aks'; -const TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = 'azure_functions'; -const TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = 'azure_app_service'; -const TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = 'gcp_compute_engine'; -const TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = 'gcp_cloud_run'; -const TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = 'gcp_kubernetes_engine'; -const TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = 'gcp_cloud_functions'; -const TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE = 'gcp_app_engine'; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_ECS. - */ -exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_ALIBABA_CLOUD_FC. - */ -exports.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC = TMP_CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_EC2. - */ -exports.CLOUDPLATFORMVALUES_AWS_EC2 = TMP_CLOUDPLATFORMVALUES_AWS_EC2; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_ECS. - */ -exports.CLOUDPLATFORMVALUES_AWS_ECS = TMP_CLOUDPLATFORMVALUES_AWS_ECS; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_EKS. - */ -exports.CLOUDPLATFORMVALUES_AWS_EKS = TMP_CLOUDPLATFORMVALUES_AWS_EKS; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_LAMBDA. - */ -exports.CLOUDPLATFORMVALUES_AWS_LAMBDA = TMP_CLOUDPLATFORMVALUES_AWS_LAMBDA; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AWS_ELASTIC_BEANSTALK. - */ -exports.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK = TMP_CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_VM. - */ -exports.CLOUDPLATFORMVALUES_AZURE_VM = TMP_CLOUDPLATFORMVALUES_AZURE_VM; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_CONTAINER_INSTANCES. - */ -exports.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES = TMP_CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_AKS. - */ -exports.CLOUDPLATFORMVALUES_AZURE_AKS = TMP_CLOUDPLATFORMVALUES_AZURE_AKS; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS. - */ -exports.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_AZURE_FUNCTIONS; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE. - */ -exports.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE = TMP_CLOUDPLATFORMVALUES_AZURE_APP_SERVICE; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_COMPUTE_ENGINE. - */ -exports.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_CLOUD_RUN. - */ -exports.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_RUN; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_KUBERNETES_ENGINE. - */ -exports.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_CLOUD_FUNCTIONS. - */ -exports.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS = TMP_CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS; -/** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - * - * @deprecated Use CLOUD_PLATFORM_VALUE_GCP_APP_ENGINE. - */ -exports.CLOUDPLATFORMVALUES_GCP_APP_ENGINE = TMP_CLOUDPLATFORMVALUES_GCP_APP_ENGINE; -/** - * The constant map of values for CloudPlatformValues. - * @deprecated Use the CLOUDPLATFORMVALUES_XXXXX constants rather than the CloudPlatformValues.XXXXX for bundle minification. - */ -exports.CloudPlatformValues = -/*#__PURE__*/ (0, utils_1.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, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for AwsEcsLaunchtypeValues enum definition - * - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_AWSECSLAUNCHTYPEVALUES_EC2 = 'ec2'; -const TMP_AWSECSLAUNCHTYPEVALUES_FARGATE = 'fargate'; -/** - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - * - * @deprecated Use AWS_ECS_LAUNCHTYPE_VALUE_EC2. - */ -exports.AWSECSLAUNCHTYPEVALUES_EC2 = TMP_AWSECSLAUNCHTYPEVALUES_EC2; -/** - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - * - * @deprecated Use AWS_ECS_LAUNCHTYPE_VALUE_FARGATE. - */ -exports.AWSECSLAUNCHTYPEVALUES_FARGATE = TMP_AWSECSLAUNCHTYPEVALUES_FARGATE; -/** - * The constant map of values for AwsEcsLaunchtypeValues. - * @deprecated Use the AWSECSLAUNCHTYPEVALUES_XXXXX constants rather than the AwsEcsLaunchtypeValues.XXXXX for bundle minification. - */ -exports.AwsEcsLaunchtypeValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_AWSECSLAUNCHTYPEVALUES_EC2, - TMP_AWSECSLAUNCHTYPEVALUES_FARGATE, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for HostArchValues enum definition - * - * The CPU architecture the host system is running on. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_HOSTARCHVALUES_AMD64 = 'amd64'; -const TMP_HOSTARCHVALUES_ARM32 = 'arm32'; -const TMP_HOSTARCHVALUES_ARM64 = 'arm64'; -const TMP_HOSTARCHVALUES_IA64 = 'ia64'; -const TMP_HOSTARCHVALUES_PPC32 = 'ppc32'; -const TMP_HOSTARCHVALUES_PPC64 = 'ppc64'; -const TMP_HOSTARCHVALUES_X86 = 'x86'; -/** - * The CPU architecture the host system is running on. - * - * @deprecated Use HOST_ARCH_VALUE_AMD64. - */ -exports.HOSTARCHVALUES_AMD64 = TMP_HOSTARCHVALUES_AMD64; -/** - * The CPU architecture the host system is running on. - * - * @deprecated Use HOST_ARCH_VALUE_ARM32. - */ -exports.HOSTARCHVALUES_ARM32 = TMP_HOSTARCHVALUES_ARM32; -/** - * The CPU architecture the host system is running on. - * - * @deprecated Use HOST_ARCH_VALUE_ARM64. - */ -exports.HOSTARCHVALUES_ARM64 = TMP_HOSTARCHVALUES_ARM64; -/** - * The CPU architecture the host system is running on. - * - * @deprecated Use HOST_ARCH_VALUE_IA64. - */ -exports.HOSTARCHVALUES_IA64 = TMP_HOSTARCHVALUES_IA64; -/** - * The CPU architecture the host system is running on. - * - * @deprecated Use HOST_ARCH_VALUE_PPC32. - */ -exports.HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; -/** - * The CPU architecture the host system is running on. - * - * @deprecated Use HOST_ARCH_VALUE_PPC64. - */ -exports.HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; -/** - * The CPU architecture the host system is running on. - * - * @deprecated Use HOST_ARCH_VALUE_X86. - */ -exports.HOSTARCHVALUES_X86 = TMP_HOSTARCHVALUES_X86; -/** - * The constant map of values for HostArchValues. - * @deprecated Use the HOSTARCHVALUES_XXXXX constants rather than the HostArchValues.XXXXX for bundle minification. - */ -exports.HostArchValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_HOSTARCHVALUES_AMD64, - TMP_HOSTARCHVALUES_ARM32, - TMP_HOSTARCHVALUES_ARM64, - TMP_HOSTARCHVALUES_IA64, - TMP_HOSTARCHVALUES_PPC32, - TMP_HOSTARCHVALUES_PPC64, - TMP_HOSTARCHVALUES_X86, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for OsTypeValues enum definition - * - * The operating system type. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_OSTYPEVALUES_WINDOWS = 'windows'; -const TMP_OSTYPEVALUES_LINUX = 'linux'; -const TMP_OSTYPEVALUES_DARWIN = 'darwin'; -const TMP_OSTYPEVALUES_FREEBSD = 'freebsd'; -const TMP_OSTYPEVALUES_NETBSD = 'netbsd'; -const TMP_OSTYPEVALUES_OPENBSD = 'openbsd'; -const TMP_OSTYPEVALUES_DRAGONFLYBSD = 'dragonflybsd'; -const TMP_OSTYPEVALUES_HPUX = 'hpux'; -const TMP_OSTYPEVALUES_AIX = 'aix'; -const TMP_OSTYPEVALUES_SOLARIS = 'solaris'; -const TMP_OSTYPEVALUES_Z_OS = 'z_os'; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_WINDOWS. - */ -exports.OSTYPEVALUES_WINDOWS = TMP_OSTYPEVALUES_WINDOWS; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_LINUX. - */ -exports.OSTYPEVALUES_LINUX = TMP_OSTYPEVALUES_LINUX; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_DARWIN. - */ -exports.OSTYPEVALUES_DARWIN = TMP_OSTYPEVALUES_DARWIN; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_FREEBSD. - */ -exports.OSTYPEVALUES_FREEBSD = TMP_OSTYPEVALUES_FREEBSD; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_NETBSD. - */ -exports.OSTYPEVALUES_NETBSD = TMP_OSTYPEVALUES_NETBSD; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_OPENBSD. - */ -exports.OSTYPEVALUES_OPENBSD = TMP_OSTYPEVALUES_OPENBSD; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_DRAGONFLYBSD. - */ -exports.OSTYPEVALUES_DRAGONFLYBSD = TMP_OSTYPEVALUES_DRAGONFLYBSD; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_HPUX. - */ -exports.OSTYPEVALUES_HPUX = TMP_OSTYPEVALUES_HPUX; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_AIX. - */ -exports.OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_SOLARIS. - */ -exports.OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; -/** - * The operating system type. - * - * @deprecated Use OS_TYPE_VALUE_Z_OS. - */ -exports.OSTYPEVALUES_Z_OS = TMP_OSTYPEVALUES_Z_OS; -/** - * The constant map of values for OsTypeValues. - * @deprecated Use the OSTYPEVALUES_XXXXX constants rather than the OsTypeValues.XXXXX for bundle minification. - */ -exports.OsTypeValues = -/*#__PURE__*/ (0, utils_1.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, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for TelemetrySdkLanguageValues enum definition - * - * The language of the telemetry SDK. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_TELEMETRYSDKLANGUAGEVALUES_CPP = 'cpp'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET = 'dotnet'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG = 'erlang'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_GO = 'go'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA = 'java'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS = 'nodejs'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_PHP = 'php'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON = 'python'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY = 'ruby'; -const TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS = 'webjs'; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_CPP. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_CPP = TMP_TELEMETRYSDKLANGUAGEVALUES_CPP; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_DOTNET = TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_ERLANG = TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_GO. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_GO = TMP_TELEMETRYSDKLANGUAGEVALUES_GO; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_JAVA. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_JAVA = TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_NODEJS = TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_PHP. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_PHP = TMP_TELEMETRYSDKLANGUAGEVALUES_PHP; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_PYTHON = TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_RUBY. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_RUBY = TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY; -/** - * The language of the telemetry SDK. - * - * @deprecated Use TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS. - */ -exports.TELEMETRYSDKLANGUAGEVALUES_WEBJS = TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS; -/** - * The constant map of values for TelemetrySdkLanguageValues. - * @deprecated Use the TELEMETRYSDKLANGUAGEVALUES_XXXXX constants rather than the TelemetrySdkLanguageValues.XXXXX for bundle minification. - */ -exports.TelemetrySdkLanguageValues = -/*#__PURE__*/ (0, utils_1.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, -]); -//# sourceMappingURL=SemanticResourceAttributes.js.map - -/***/ }), - -/***/ 83327: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* eslint-disable no-restricted-syntax -- - * These re-exports are only of constants, only one-level deep at this point, - * and should not cause problems for tree-shakers. - */ -__exportStar(__nccwpck_require__(73629), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 28231: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HTTP_REQUEST_METHOD_VALUE_POST = exports.HTTP_REQUEST_METHOD_VALUE_PATCH = exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = exports.HTTP_REQUEST_METHOD_VALUE_HEAD = exports.HTTP_REQUEST_METHOD_VALUE_GET = exports.HTTP_REQUEST_METHOD_VALUE_DELETE = exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = exports.HTTP_REQUEST_METHOD_VALUE_OTHER = exports.ATTR_HTTP_REQUEST_METHOD = exports.ATTR_HTTP_REQUEST_HEADER = exports.ATTR_EXCEPTION_TYPE = exports.ATTR_EXCEPTION_STACKTRACE = exports.ATTR_EXCEPTION_MESSAGE = exports.ATTR_EXCEPTION_ESCAPED = exports.ERROR_TYPE_VALUE_OTHER = exports.ATTR_ERROR_TYPE = exports.ATTR_CLIENT_PORT = exports.ATTR_CLIENT_ADDRESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = exports.ATTR_TELEMETRY_SDK_VERSION = exports.ATTR_TELEMETRY_SDK_NAME = exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = exports.ATTR_TELEMETRY_SDK_LANGUAGE = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = void 0; -exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = exports.ATTR_SIGNALR_CONNECTION_STATUS = exports.ATTR_SERVICE_VERSION = exports.ATTR_SERVICE_NAME = exports.ATTR_SERVER_PORT = exports.ATTR_SERVER_ADDRESS = exports.ATTR_OTEL_STATUS_DESCRIPTION = exports.OTEL_STATUS_CODE_VALUE_OK = exports.OTEL_STATUS_CODE_VALUE_ERROR = exports.ATTR_OTEL_STATUS_CODE = exports.ATTR_OTEL_SCOPE_VERSION = exports.ATTR_OTEL_SCOPE_NAME = exports.NETWORK_TYPE_VALUE_IPV6 = exports.NETWORK_TYPE_VALUE_IPV4 = exports.ATTR_NETWORK_TYPE = exports.NETWORK_TRANSPORT_VALUE_UNIX = exports.NETWORK_TRANSPORT_VALUE_UDP = exports.NETWORK_TRANSPORT_VALUE_TCP = exports.NETWORK_TRANSPORT_VALUE_QUIC = exports.NETWORK_TRANSPORT_VALUE_PIPE = exports.ATTR_NETWORK_TRANSPORT = exports.ATTR_NETWORK_PROTOCOL_VERSION = exports.ATTR_NETWORK_PROTOCOL_NAME = exports.ATTR_NETWORK_PEER_PORT = exports.ATTR_NETWORK_PEER_ADDRESS = exports.ATTR_NETWORK_LOCAL_PORT = exports.ATTR_NETWORK_LOCAL_ADDRESS = exports.JVM_THREAD_STATE_VALUE_WAITING = exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = exports.JVM_THREAD_STATE_VALUE_TERMINATED = exports.JVM_THREAD_STATE_VALUE_RUNNABLE = exports.JVM_THREAD_STATE_VALUE_NEW = exports.JVM_THREAD_STATE_VALUE_BLOCKED = exports.ATTR_JVM_THREAD_STATE = exports.ATTR_JVM_THREAD_DAEMON = exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = exports.JVM_MEMORY_TYPE_VALUE_HEAP = exports.ATTR_JVM_MEMORY_TYPE = exports.ATTR_JVM_MEMORY_POOL_NAME = exports.ATTR_JVM_GC_NAME = exports.ATTR_JVM_GC_ACTION = exports.ATTR_HTTP_ROUTE = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = exports.ATTR_HTTP_RESPONSE_HEADER = exports.ATTR_HTTP_REQUEST_RESEND_COUNT = exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = exports.HTTP_REQUEST_METHOD_VALUE_TRACE = exports.HTTP_REQUEST_METHOD_VALUE_PUT = void 0; -exports.ATTR_USER_AGENT_ORIGINAL = exports.ATTR_URL_SCHEME = exports.ATTR_URL_QUERY = exports.ATTR_URL_PATH = exports.ATTR_URL_FULL = exports.ATTR_URL_FRAGMENT = exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = exports.ATTR_SIGNALR_TRANSPORT = void 0; -//---------------------------------------------------------------------------------------------------------- -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2 -//---------------------------------------------------------------------------------------------------------- -/** - * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason - * - * @example acquired - * - * @example request_canceled - */ -exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result'; -/** - * Enum value "acquired" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. - */ -exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; -/** - * Enum value "endpoint_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. - */ -exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; -/** - * Enum value "global_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. - */ -exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; -/** - * Enum value "request_canceled" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. - */ -exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; -/** - * The language of the telemetry SDK. - */ -exports.ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; -/** - * Enum value "cpp" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; -/** - * Enum value "dotnet" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; -/** - * Enum value "erlang" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; -/** - * Enum value "go" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; -/** - * Enum value "java" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; -/** - * Enum value "nodejs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; -/** - * Enum value "php" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; -/** - * Enum value "python" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; -/** - * Enum value "ruby" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; -/** - * Enum value "rust" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; -/** - * Enum value "swift" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; -/** - * Enum value "webjs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; -/** - * The name of the telemetry SDK as defined above. - * - * @example opentelemetry - * - * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`. - * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the - * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point - * or another suitable identifier depending on the language. - * The identifier `opentelemetry` is reserved and **MUST** **NOT** be used in this case. - * All custom identifiers **SHOULD** be stable across different versions of an implementation. - */ -exports.ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; -/** - * The version string of the telemetry SDK. - * - * @example 1.2.3 - */ -exports.ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; -/** - * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. - * - * @example Contoso.MyHandler - */ -exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type'; -/** - * ASP.NET Core exception middleware handling result - * - * @example handled - * - * @example unhandled - */ -exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result'; -/** - * Enum value "aborted" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. - */ -exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; -/** - * Enum value "handled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. - */ -exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled"; -/** - * Enum value "skipped" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. - */ -exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped"; -/** - * Enum value "unhandled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. - */ -exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; -/** - * Rate limiting policy name. - * - * @example fixed - * - * @example sliding - * - * @example token - */ -exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy'; -/** - * Flag indicating if request was handled by the application pipeline. - * - * @example true - */ -exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled'; -/** - * A value that indicates whether the matched route is a fallback route. - * - * @example true - */ -exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback'; -/** - * Match result - success or failure - * - * @example success - * - * @example failure - */ -exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status'; -/** - * Enum value "failure" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. - */ -exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; -/** - * Enum value "success" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. - */ -exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success"; -/** - * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - * - * @example client.example.com - * - * @example 10.1.2.80 - * - * @example /tmp/my.sock - * - * @note When observed from the server side, and when communicating through an intermediary, `client.address` **SHOULD** represent the client address behind any intermediaries, for example proxies, if it's available. - */ -exports.ATTR_CLIENT_ADDRESS = 'client.address'; -/** - * Client port number. - * - * @example 65123 - * - * @note When observed from the server side, and when communicating through an intermediary, `client.port` **SHOULD** represent the client port behind any intermediaries, for example proxies, if it's available. - */ -exports.ATTR_CLIENT_PORT = 'client.port'; -/** - * Describes a class of error the operation ended with. - * - * @example timeout - * - * @example java.net.UnknownHostException - * - * @example server_certificate_invalid - * - * @example 500 - * - * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality. - * - * When `error.type` is set to a type (e.g., an exception type), its - * canonical class name identifying the type within the artifact **SHOULD** be used. - * - * Instrumentations **SHOULD** document the list of errors they report. - * - * The cardinality of `error.type` within one instrumentation library **SHOULD** be low. - * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications - * should be prepared for `error.type` to have high cardinality at query time when no - * additional filters are applied. - * - * If the operation has completed successfully, instrumentations **SHOULD** **NOT** set `error.type`. - * - * If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), - * it's RECOMMENDED to: - * - * * Use a domain-specific attribute - * * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. - */ -exports.ATTR_ERROR_TYPE = 'error.type'; -/** - * Enum value "_OTHER" for attribute {@link ATTR_ERROR_TYPE}. - */ -exports.ERROR_TYPE_VALUE_OTHER = "_OTHER"; -/** - * **SHOULD** be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. - * - * @note An exception is considered to have escaped (or left) the scope of a span, - * if that span is ended while the exception is still logically "in flight". - * This may be actually "in flight" in some languages (e.g. if the exception - * is passed to a Context manager's `__exit__` method in Python) but will - * usually be caught at the point of recording the exception in most languages. - * - * It is usually not possible to determine at the point where an exception is thrown - * whether it will escape the scope of a span. - * However, it is trivial to know that an exception - * will escape, if one checks for an active exception just before ending the span, - * as done in the [example for recording span exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception). - * - * It follows that an exception may still escape the scope of the span - * even if the `exception.escaped` attribute was not set or set to false, - * since the event might have been recorded at a time where it was not - * clear whether the exception will escape. - */ -exports.ATTR_EXCEPTION_ESCAPED = 'exception.escaped'; -/** - * The exception message. - * - * @example Division by zero - * - * @example Can't convert 'int' object to str implicitly - */ -exports.ATTR_EXCEPTION_MESSAGE = 'exception.message'; -/** - * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. - * - * @example "Exception in thread \"main\" java.lang.RuntimeException: Test exception\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)" - */ -exports.ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace'; -/** - * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. - * - * @example java.net.ConnectException - * - * @example OSError - */ -exports.ATTR_EXCEPTION_TYPE = 'exception.type'; -/** - * HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. - * - * @example http.request.header.content-type=["application/json"] - * - * @example http.request.header.x-forwarded-for=["1.2.3.4", "1.2.3.5"] - * - * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. - * The `User-Agent` header is already captured in the `user_agent.original` attribute. Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. - * The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. - */ -const ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`; -exports.ATTR_HTTP_REQUEST_HEADER = ATTR_HTTP_REQUEST_HEADER; -/** - * HTTP request method. - * - * @example GET - * - * @example POST - * - * @example HEAD - * - * @note HTTP request method value **SHOULD** be "known" to the instrumentation. - * By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) - * and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - * - * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`. - * - * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override - * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named - * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods - * (this list **MUST** be a full override of the default known method, it is not a list of known methods in addition to the defaults). - * - * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly. - * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent. - * Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value. - */ -exports.ATTR_HTTP_REQUEST_METHOD = 'http.request.method'; -/** - * Enum value "_OTHER" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER"; -/** - * Enum value "CONNECT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; -/** - * Enum value "DELETE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE"; -/** - * Enum value "GET" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_GET = "GET"; -/** - * Enum value "HEAD" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD"; -/** - * Enum value "OPTIONS" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; -/** - * Enum value "PATCH" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH"; -/** - * Enum value "POST" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_POST = "POST"; -/** - * Enum value "PUT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_PUT = "PUT"; -/** - * Enum value "TRACE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ -exports.HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE"; -/** - * Original HTTP method sent by the client in the request line. - * - * @example GeT - * - * @example ACL - * - * @example foo - */ -exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original'; -/** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - * @example 3 - * - * @note The resend count **SHOULD** be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). - */ -exports.ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count'; -/** - * HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. - * - * @example http.response.header.content-type=["application/json"] - * - * @example http.response.header.my-custom-header=["abc", "def"] - * - * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. - * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. - * The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. - */ -const ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`; -exports.ATTR_HTTP_RESPONSE_HEADER = ATTR_HTTP_RESPONSE_HEADER; -/** - * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - * - * @example 200 - */ -exports.ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code'; -/** - * The matched route, that is, the path template in the format used by the respective server framework. - * - * @example /users/:userID? - * - * @example {controller}/{action}/{id?} - * - * @note MUST **NOT** be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can **NOT** substitute it. - * SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. - */ -exports.ATTR_HTTP_ROUTE = 'http.route'; -/** - * Name of the garbage collector action. - * - * @example end of minor GC - * - * @example end of major GC - * - * @note Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()). - */ -exports.ATTR_JVM_GC_ACTION = 'jvm.gc.action'; -/** - * Name of the garbage collector. - * - * @example G1 Young Generation - * - * @example G1 Old Generation - * - * @note Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()). - */ -exports.ATTR_JVM_GC_NAME = 'jvm.gc.name'; -/** - * Name of the memory pool. - * - * @example G1 Old Gen - * - * @example G1 Eden space - * - * @example G1 Survivor Space - * - * @note Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - */ -exports.ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name'; -/** - * The type of memory. - * - * @example heap - * - * @example non_heap - */ -exports.ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type'; -/** - * Enum value "heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. - */ -exports.JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; -/** - * Enum value "non_heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. - */ -exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap"; -/** - * Whether the thread is daemon or not. - */ -exports.ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon'; -/** - * State of the thread. - * - * @example runnable - * - * @example blocked - */ -exports.ATTR_JVM_THREAD_STATE = 'jvm.thread.state'; -/** - * Enum value "blocked" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ -exports.JVM_THREAD_STATE_VALUE_BLOCKED = "blocked"; -/** - * Enum value "new" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ -exports.JVM_THREAD_STATE_VALUE_NEW = "new"; -/** - * Enum value "runnable" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ -exports.JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable"; -/** - * Enum value "terminated" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ -exports.JVM_THREAD_STATE_VALUE_TERMINATED = "terminated"; -/** - * Enum value "timed_waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ -exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting"; -/** - * Enum value "waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ -exports.JVM_THREAD_STATE_VALUE_WAITING = "waiting"; -/** - * Local address of the network connection - IP address or Unix domain socket name. - * - * @example 10.1.2.80 - * - * @example /tmp/my.sock - */ -exports.ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address'; -/** - * Local port number of the network connection. - * - * @example 65123 - */ -exports.ATTR_NETWORK_LOCAL_PORT = 'network.local.port'; -/** - * Peer address of the network connection - IP address or Unix domain socket name. - * - * @example 10.1.2.80 - * - * @example /tmp/my.sock - */ -exports.ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address'; -/** - * Peer port number of the network connection. - * - * @example 65123 - */ -exports.ATTR_NETWORK_PEER_PORT = 'network.peer.port'; -/** - * [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. - * - * @example amqp - * - * @example http - * - * @example mqtt - * - * @note The value **SHOULD** be normalized to lowercase. - */ -exports.ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name'; -/** - * The actual version of the protocol used for network communication. - * - * @example 1.1 - * - * @example 2 - * - * @note If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute **SHOULD** be set to the negotiated version. If the actual protocol version is not known, this attribute **SHOULD** **NOT** be set. - */ -exports.ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version'; -/** - * [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). - * - * @example tcp - * - * @example udp - * - * @note The value **SHOULD** be normalized to lowercase. - * - * Consider always setting the transport when setting a port number, since - * a port number is ambiguous without knowing the transport. For example - * different processes could be listening on TCP port 12345 and UDP port 12345. - */ -exports.ATTR_NETWORK_TRANSPORT = 'network.transport'; -/** - * Enum value "pipe" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ -exports.NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; -/** - * Enum value "quic" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ -exports.NETWORK_TRANSPORT_VALUE_QUIC = "quic"; -/** - * Enum value "tcp" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ -exports.NETWORK_TRANSPORT_VALUE_TCP = "tcp"; -/** - * Enum value "udp" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ -exports.NETWORK_TRANSPORT_VALUE_UDP = "udp"; -/** - * Enum value "unix" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ -exports.NETWORK_TRANSPORT_VALUE_UNIX = "unix"; -/** - * [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. - * - * @example ipv4 - * - * @example ipv6 - * - * @note The value **SHOULD** be normalized to lowercase. - */ -exports.ATTR_NETWORK_TYPE = 'network.type'; -/** - * Enum value "ipv4" for attribute {@link ATTR_NETWORK_TYPE}. - */ -exports.NETWORK_TYPE_VALUE_IPV4 = "ipv4"; -/** - * Enum value "ipv6" for attribute {@link ATTR_NETWORK_TYPE}. - */ -exports.NETWORK_TYPE_VALUE_IPV6 = "ipv6"; -/** - * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). - * - * @example io.opentelemetry.contrib.mongodb - */ -exports.ATTR_OTEL_SCOPE_NAME = 'otel.scope.name'; -/** - * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - * - * @example 1.0.0 - */ -exports.ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version'; -/** - * Name of the code, either "OK" or "ERROR". **MUST** **NOT** be set if the status code is UNSET. - */ -exports.ATTR_OTEL_STATUS_CODE = 'otel.status_code'; -/** - * Enum value "ERROR" for attribute {@link ATTR_OTEL_STATUS_CODE}. - */ -exports.OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; -/** - * Enum value "OK" for attribute {@link ATTR_OTEL_STATUS_CODE}. - */ -exports.OTEL_STATUS_CODE_VALUE_OK = "OK"; -/** - * Description of the Status if it has a value, otherwise not set. - * - * @example resource not found - */ -exports.ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description'; -/** - * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - * - * @example example.com - * - * @example 10.1.2.80 - * - * @example /tmp/my.sock - * - * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available. - */ -exports.ATTR_SERVER_ADDRESS = 'server.address'; -/** - * Server port number. - * - * @example 80 - * - * @example 8080 - * - * @example 443 - * - * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available. - */ -exports.ATTR_SERVER_PORT = 'server.port'; -/** - * Logical name of the service. - * - * @example shoppingcart - * - * @note MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value **MUST** be set to `unknown_service`. - */ -exports.ATTR_SERVICE_NAME = 'service.name'; -/** - * The version string of the service API or implementation. The format is not defined by these conventions. - * - * @example 2.0.0 - * - * @example a01dbef8a - */ -exports.ATTR_SERVICE_VERSION = 'service.version'; -/** - * SignalR HTTP connection closure status. - * - * @example app_shutdown - * - * @example timeout - */ -exports.ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status'; -/** - * Enum value "app_shutdown" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. - */ -exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown"; -/** - * Enum value "normal_closure" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. - */ -exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; -/** - * Enum value "timeout" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. - */ -exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; -/** - * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) - * - * @example web_sockets - * - * @example long_polling - */ -exports.ATTR_SIGNALR_TRANSPORT = 'signalr.transport'; -/** - * Enum value "long_polling" for attribute {@link ATTR_SIGNALR_TRANSPORT}. - */ -exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling"; -/** - * Enum value "server_sent_events" for attribute {@link ATTR_SIGNALR_TRANSPORT}. - */ -exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; -/** - * Enum value "web_sockets" for attribute {@link ATTR_SIGNALR_TRANSPORT}. - */ -exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets"; -/** - * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component - * - * @example SemConv - */ -exports.ATTR_URL_FRAGMENT = 'url.fragment'; -/** - * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) - * - * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv - * - * @example //localhost - * - * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless. - * `url.full` **MUST** **NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`. - * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it. - */ -exports.ATTR_URL_FULL = 'url.full'; -/** - * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component - * - * @example /search - * - * @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it. - */ -exports.ATTR_URL_PATH = 'url.path'; -/** - * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component - * - * @example q=OpenTelemetry - * - * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it. - */ -exports.ATTR_URL_QUERY = 'url.query'; -/** - * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. - * - * @example https - * - * @example ftp - * - * @example telnet - */ -exports.ATTR_URL_SCHEME = 'url.scheme'; -/** - * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. - * - * @example CERN-LineMode/2.15 libwww/2.17b3 - * - * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1 - * - * @example YourApp/1.0.0 grpc-java-okhttp/1.27.2 - */ -exports.ATTR_USER_AGENT_ORIGINAL = 'user_agent.original'; -//# sourceMappingURL=stable_attributes.js.map - -/***/ }), - -/***/ 67409: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = exports.METRIC_KESTREL_REJECTED_CONNECTIONS = exports.METRIC_KESTREL_QUEUED_REQUESTS = exports.METRIC_KESTREL_QUEUED_CONNECTIONS = exports.METRIC_KESTREL_CONNECTION_DURATION = exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = exports.METRIC_JVM_THREAD_COUNT = exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = exports.METRIC_JVM_MEMORY_USED = exports.METRIC_JVM_MEMORY_LIMIT = exports.METRIC_JVM_MEMORY_COMMITTED = exports.METRIC_JVM_GC_DURATION = exports.METRIC_JVM_CPU_TIME = exports.METRIC_JVM_CPU_RECENT_UTILIZATION = exports.METRIC_JVM_CPU_COUNT = exports.METRIC_JVM_CLASS_UNLOADED = exports.METRIC_JVM_CLASS_LOADED = exports.METRIC_JVM_CLASS_COUNT = exports.METRIC_HTTP_SERVER_REQUEST_DURATION = exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = void 0; -//---------------------------------------------------------------------------------------------------------- -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/register/stable/metrics.ts.j2 -//---------------------------------------------------------------------------------------------------------- -/** - * Number of exceptions caught by exception handling middleware. - * - * @note Meter name: `Microsoft.AspNetCore.Diagnostics`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = 'aspnetcore.diagnostics.exceptions'; -/** - * Number of requests that are currently active on the server that hold a rate limiting lease. - * - * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = 'aspnetcore.rate_limiting.active_request_leases'; -/** - * Number of requests that are currently queued, waiting to acquire a rate limiting lease. - * - * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = 'aspnetcore.rate_limiting.queued_requests'; -/** - * The time the request spent in a queue waiting to acquire a rate limiting lease. - * - * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = 'aspnetcore.rate_limiting.request.time_in_queue'; -/** - * The duration of rate limiting lease held by requests on the server. - * - * @note Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = 'aspnetcore.rate_limiting.request_lease.duration'; -/** - * Number of requests that tried to acquire a rate limiting lease. - * - * @note Requests could be: - * - * * Rejected by global or endpoint rate limiting policies - * * Canceled while waiting for the lease. - * - * Meter name: `Microsoft.AspNetCore.RateLimiting`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = 'aspnetcore.rate_limiting.requests'; -/** - * Number of requests that were attempted to be matched to an endpoint. - * - * @note Meter name: `Microsoft.AspNetCore.Routing`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = 'aspnetcore.routing.match_attempts'; -/** - * Duration of HTTP client requests. - */ -exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = 'http.client.request.duration'; -/** - * Duration of HTTP server requests. - */ -exports.METRIC_HTTP_SERVER_REQUEST_DURATION = 'http.server.request.duration'; -/** - * Number of classes currently loaded. - */ -exports.METRIC_JVM_CLASS_COUNT = 'jvm.class.count'; -/** - * Number of classes loaded since JVM start. - */ -exports.METRIC_JVM_CLASS_LOADED = 'jvm.class.loaded'; -/** - * Number of classes unloaded since JVM start. - */ -exports.METRIC_JVM_CLASS_UNLOADED = 'jvm.class.unloaded'; -/** - * Number of processors available to the Java virtual machine. - */ -exports.METRIC_JVM_CPU_COUNT = 'jvm.cpu.count'; -/** - * Recent CPU utilization for the process as reported by the JVM. - * - * @note The value range is [0.0,1.0]. This utilization is not defined as being for the specific interval since last measurement (unlike `system.cpu.utilization`). [Reference](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()). - */ -exports.METRIC_JVM_CPU_RECENT_UTILIZATION = 'jvm.cpu.recent_utilization'; -/** - * CPU time used by the process as reported by the JVM. - */ -exports.METRIC_JVM_CPU_TIME = 'jvm.cpu.time'; -/** - * Duration of JVM garbage collection actions. - */ -exports.METRIC_JVM_GC_DURATION = 'jvm.gc.duration'; -/** - * Measure of memory committed. - */ -exports.METRIC_JVM_MEMORY_COMMITTED = 'jvm.memory.committed'; -/** - * Measure of max obtainable memory. - */ -exports.METRIC_JVM_MEMORY_LIMIT = 'jvm.memory.limit'; -/** - * Measure of memory used. - */ -exports.METRIC_JVM_MEMORY_USED = 'jvm.memory.used'; -/** - * Measure of memory used, as measured after the most recent garbage collection event on this pool. - */ -exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = 'jvm.memory.used_after_last_gc'; -/** - * Number of executing platform threads. - */ -exports.METRIC_JVM_THREAD_COUNT = 'jvm.thread.count'; -/** - * Number of connections that are currently active on the server. - * - * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = 'kestrel.active_connections'; -/** - * Number of TLS handshakes that are currently in progress on the server. - * - * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = 'kestrel.active_tls_handshakes'; -/** - * The duration of connections on the server. - * - * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_KESTREL_CONNECTION_DURATION = 'kestrel.connection.duration'; -/** - * Number of connections that are currently queued and are waiting to start. - * - * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_KESTREL_QUEUED_CONNECTIONS = 'kestrel.queued_connections'; -/** - * Number of HTTP requests on multiplexed connections (HTTP/2 and HTTP/3) that are currently queued and are waiting to start. - * - * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_KESTREL_QUEUED_REQUESTS = 'kestrel.queued_requests'; -/** - * Number of connections rejected by the server. - * - * @note Connections are rejected when the currently active count exceeds the value configured with `MaxConcurrentConnections`. - * Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_KESTREL_REJECTED_CONNECTIONS = 'kestrel.rejected_connections'; -/** - * The duration of TLS handshakes on the server. - * - * @note Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = 'kestrel.tls_handshake.duration'; -/** - * Number of connections that are currently upgraded (WebSockets). . - * - * @note The counter only tracks HTTP/1.1 connections. - * - * Meter name: `Microsoft.AspNetCore.Server.Kestrel`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = 'kestrel.upgraded_connections'; -/** - * Number of connections that are currently active on the server. - * - * @note Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = 'signalr.server.active_connections'; -/** - * The duration of connections on the server. - * - * @note Meter name: `Microsoft.AspNetCore.Http.Connections`; Added in: ASP.NET Core 8.0 - */ -exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = 'signalr.server.connection.duration'; -//# sourceMappingURL=stable_metrics.js.map - -/***/ }), - -/***/ 98999: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SEMATTRS_NET_HOST_CARRIER_ICC = exports.SEMATTRS_NET_HOST_CARRIER_MNC = exports.SEMATTRS_NET_HOST_CARRIER_MCC = exports.SEMATTRS_NET_HOST_CARRIER_NAME = exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = exports.SEMATTRS_NET_HOST_NAME = exports.SEMATTRS_NET_HOST_PORT = exports.SEMATTRS_NET_HOST_IP = exports.SEMATTRS_NET_PEER_NAME = exports.SEMATTRS_NET_PEER_PORT = exports.SEMATTRS_NET_PEER_IP = exports.SEMATTRS_NET_TRANSPORT = exports.SEMATTRS_FAAS_INVOKED_REGION = exports.SEMATTRS_FAAS_INVOKED_PROVIDER = exports.SEMATTRS_FAAS_INVOKED_NAME = exports.SEMATTRS_FAAS_COLDSTART = exports.SEMATTRS_FAAS_CRON = exports.SEMATTRS_FAAS_TIME = exports.SEMATTRS_FAAS_DOCUMENT_NAME = exports.SEMATTRS_FAAS_DOCUMENT_TIME = exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = exports.SEMATTRS_FAAS_EXECUTION = exports.SEMATTRS_FAAS_TRIGGER = exports.SEMATTRS_EXCEPTION_ESCAPED = exports.SEMATTRS_EXCEPTION_STACKTRACE = exports.SEMATTRS_EXCEPTION_MESSAGE = exports.SEMATTRS_EXCEPTION_TYPE = exports.SEMATTRS_DB_SQL_TABLE = exports.SEMATTRS_DB_MONGODB_COLLECTION = exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = exports.SEMATTRS_DB_HBASE_NAMESPACE = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = exports.SEMATTRS_DB_CASSANDRA_TABLE = exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = exports.SEMATTRS_DB_OPERATION = exports.SEMATTRS_DB_STATEMENT = exports.SEMATTRS_DB_NAME = exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = exports.SEMATTRS_DB_USER = exports.SEMATTRS_DB_CONNECTION_STRING = exports.SEMATTRS_DB_SYSTEM = exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = void 0; -exports.SEMATTRS_MESSAGING_DESTINATION_KIND = exports.SEMATTRS_MESSAGING_DESTINATION = exports.SEMATTRS_MESSAGING_SYSTEM = exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = exports.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = exports.SEMATTRS_AWS_DYNAMODB_COUNT = exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = exports.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = exports.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = exports.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = exports.SEMATTRS_AWS_DYNAMODB_SELECT = exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = exports.SEMATTRS_AWS_DYNAMODB_LIMIT = exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = exports.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = exports.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = exports.SEMATTRS_HTTP_CLIENT_IP = exports.SEMATTRS_HTTP_ROUTE = exports.SEMATTRS_HTTP_SERVER_NAME = exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = exports.SEMATTRS_HTTP_USER_AGENT = exports.SEMATTRS_HTTP_FLAVOR = exports.SEMATTRS_HTTP_STATUS_CODE = exports.SEMATTRS_HTTP_SCHEME = exports.SEMATTRS_HTTP_HOST = exports.SEMATTRS_HTTP_TARGET = exports.SEMATTRS_HTTP_URL = exports.SEMATTRS_HTTP_METHOD = exports.SEMATTRS_CODE_LINENO = exports.SEMATTRS_CODE_FILEPATH = exports.SEMATTRS_CODE_NAMESPACE = exports.SEMATTRS_CODE_FUNCTION = exports.SEMATTRS_THREAD_NAME = exports.SEMATTRS_THREAD_ID = exports.SEMATTRS_ENDUSER_SCOPE = exports.SEMATTRS_ENDUSER_ROLE = exports.SEMATTRS_ENDUSER_ID = exports.SEMATTRS_PEER_SERVICE = void 0; -exports.DBSYSTEMVALUES_FILEMAKER = exports.DBSYSTEMVALUES_DERBY = exports.DBSYSTEMVALUES_FIREBIRD = exports.DBSYSTEMVALUES_ADABAS = exports.DBSYSTEMVALUES_CACHE = exports.DBSYSTEMVALUES_EDB = exports.DBSYSTEMVALUES_FIRSTSQL = exports.DBSYSTEMVALUES_INGRES = exports.DBSYSTEMVALUES_HANADB = exports.DBSYSTEMVALUES_MAXDB = exports.DBSYSTEMVALUES_PROGRESS = exports.DBSYSTEMVALUES_HSQLDB = exports.DBSYSTEMVALUES_CLOUDSCAPE = exports.DBSYSTEMVALUES_HIVE = exports.DBSYSTEMVALUES_REDSHIFT = exports.DBSYSTEMVALUES_POSTGRESQL = exports.DBSYSTEMVALUES_DB2 = exports.DBSYSTEMVALUES_ORACLE = exports.DBSYSTEMVALUES_MYSQL = exports.DBSYSTEMVALUES_MSSQL = exports.DBSYSTEMVALUES_OTHER_SQL = exports.SemanticAttributes = exports.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = exports.SEMATTRS_MESSAGE_ID = exports.SEMATTRS_MESSAGE_TYPE = exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = exports.SEMATTRS_RPC_JSONRPC_ERROR_CODE = exports.SEMATTRS_RPC_JSONRPC_REQUEST_ID = exports.SEMATTRS_RPC_JSONRPC_VERSION = exports.SEMATTRS_RPC_GRPC_STATUS_CODE = exports.SEMATTRS_RPC_METHOD = exports.SEMATTRS_RPC_SERVICE = exports.SEMATTRS_RPC_SYSTEM = exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = exports.SEMATTRS_MESSAGING_KAFKA_PARTITION = exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = exports.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = exports.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = exports.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = exports.SEMATTRS_MESSAGING_CONSUMER_ID = exports.SEMATTRS_MESSAGING_OPERATION = exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = exports.SEMATTRS_MESSAGING_CONVERSATION_ID = exports.SEMATTRS_MESSAGING_MESSAGE_ID = exports.SEMATTRS_MESSAGING_URL = exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = exports.SEMATTRS_MESSAGING_PROTOCOL = exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = void 0; -exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = exports.FaasDocumentOperationValues = exports.FAASDOCUMENTOPERATIONVALUES_DELETE = exports.FAASDOCUMENTOPERATIONVALUES_EDIT = exports.FAASDOCUMENTOPERATIONVALUES_INSERT = exports.FaasTriggerValues = exports.FAASTRIGGERVALUES_OTHER = exports.FAASTRIGGERVALUES_TIMER = exports.FAASTRIGGERVALUES_PUBSUB = exports.FAASTRIGGERVALUES_HTTP = exports.FAASTRIGGERVALUES_DATASOURCE = exports.DbCassandraConsistencyLevelValues = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = exports.DbSystemValues = exports.DBSYSTEMVALUES_COCKROACHDB = exports.DBSYSTEMVALUES_MEMCACHED = exports.DBSYSTEMVALUES_ELASTICSEARCH = exports.DBSYSTEMVALUES_GEODE = exports.DBSYSTEMVALUES_NEO4J = exports.DBSYSTEMVALUES_DYNAMODB = exports.DBSYSTEMVALUES_COSMOSDB = exports.DBSYSTEMVALUES_COUCHDB = exports.DBSYSTEMVALUES_COUCHBASE = exports.DBSYSTEMVALUES_REDIS = exports.DBSYSTEMVALUES_MONGODB = exports.DBSYSTEMVALUES_HBASE = exports.DBSYSTEMVALUES_CASSANDRA = exports.DBSYSTEMVALUES_COLDFUSION = exports.DBSYSTEMVALUES_H2 = exports.DBSYSTEMVALUES_VERTICA = exports.DBSYSTEMVALUES_TERADATA = exports.DBSYSTEMVALUES_SYBASE = exports.DBSYSTEMVALUES_SQLITE = exports.DBSYSTEMVALUES_POINTBASE = exports.DBSYSTEMVALUES_PERVASIVE = exports.DBSYSTEMVALUES_NETEZZA = exports.DBSYSTEMVALUES_MARIADB = exports.DBSYSTEMVALUES_INTERBASE = exports.DBSYSTEMVALUES_INSTANTDB = exports.DBSYSTEMVALUES_INFORMIX = void 0; -exports.MESSAGINGOPERATIONVALUES_RECEIVE = exports.MessagingDestinationKindValues = exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = exports.HttpFlavorValues = exports.HTTPFLAVORVALUES_QUIC = exports.HTTPFLAVORVALUES_SPDY = exports.HTTPFLAVORVALUES_HTTP_2_0 = exports.HTTPFLAVORVALUES_HTTP_1_1 = exports.HTTPFLAVORVALUES_HTTP_1_0 = exports.NetHostConnectionSubtypeValues = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = exports.NetHostConnectionTypeValues = exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = exports.NETHOSTCONNECTIONTYPEVALUES_CELL = exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = exports.NetTransportValues = exports.NETTRANSPORTVALUES_OTHER = exports.NETTRANSPORTVALUES_INPROC = exports.NETTRANSPORTVALUES_PIPE = exports.NETTRANSPORTVALUES_UNIX = exports.NETTRANSPORTVALUES_IP = exports.NETTRANSPORTVALUES_IP_UDP = exports.NETTRANSPORTVALUES_IP_TCP = exports.FaasInvokedProviderValues = exports.FAASINVOKEDPROVIDERVALUES_GCP = exports.FAASINVOKEDPROVIDERVALUES_AZURE = exports.FAASINVOKEDPROVIDERVALUES_AWS = void 0; -exports.MessageTypeValues = exports.MESSAGETYPEVALUES_RECEIVED = exports.MESSAGETYPEVALUES_SENT = exports.RpcGrpcStatusCodeValues = exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = exports.RPCGRPCSTATUSCODEVALUES_ABORTED = exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = exports.RPCGRPCSTATUSCODEVALUES_OK = exports.MessagingOperationValues = exports.MESSAGINGOPERATIONVALUES_PROCESS = void 0; -const utils_1 = __nccwpck_require__(56803); -//---------------------------------------------------------------------------------------------------------- -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -//---------------------------------------------------------------------------------------------------------- -//---------------------------------------------------------------------------------------------------------- -// Constant values for SemanticAttributes -//---------------------------------------------------------------------------------------------------------- -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_AWS_LAMBDA_INVOKED_ARN = 'aws.lambda.invoked_arn'; -const TMP_DB_SYSTEM = 'db.system'; -const TMP_DB_CONNECTION_STRING = 'db.connection_string'; -const TMP_DB_USER = 'db.user'; -const TMP_DB_JDBC_DRIVER_CLASSNAME = 'db.jdbc.driver_classname'; -const TMP_DB_NAME = 'db.name'; -const TMP_DB_STATEMENT = 'db.statement'; -const TMP_DB_OPERATION = 'db.operation'; -const TMP_DB_MSSQL_INSTANCE_NAME = 'db.mssql.instance_name'; -const TMP_DB_CASSANDRA_KEYSPACE = 'db.cassandra.keyspace'; -const TMP_DB_CASSANDRA_PAGE_SIZE = 'db.cassandra.page_size'; -const TMP_DB_CASSANDRA_CONSISTENCY_LEVEL = 'db.cassandra.consistency_level'; -const TMP_DB_CASSANDRA_TABLE = 'db.cassandra.table'; -const TMP_DB_CASSANDRA_IDEMPOTENCE = 'db.cassandra.idempotence'; -const TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = 'db.cassandra.speculative_execution_count'; -const TMP_DB_CASSANDRA_COORDINATOR_ID = 'db.cassandra.coordinator.id'; -const TMP_DB_CASSANDRA_COORDINATOR_DC = 'db.cassandra.coordinator.dc'; -const TMP_DB_HBASE_NAMESPACE = 'db.hbase.namespace'; -const TMP_DB_REDIS_DATABASE_INDEX = 'db.redis.database_index'; -const TMP_DB_MONGODB_COLLECTION = 'db.mongodb.collection'; -const TMP_DB_SQL_TABLE = 'db.sql.table'; -const TMP_EXCEPTION_TYPE = 'exception.type'; -const TMP_EXCEPTION_MESSAGE = 'exception.message'; -const TMP_EXCEPTION_STACKTRACE = 'exception.stacktrace'; -const TMP_EXCEPTION_ESCAPED = 'exception.escaped'; -const TMP_FAAS_TRIGGER = 'faas.trigger'; -const TMP_FAAS_EXECUTION = 'faas.execution'; -const TMP_FAAS_DOCUMENT_COLLECTION = 'faas.document.collection'; -const TMP_FAAS_DOCUMENT_OPERATION = 'faas.document.operation'; -const TMP_FAAS_DOCUMENT_TIME = 'faas.document.time'; -const TMP_FAAS_DOCUMENT_NAME = 'faas.document.name'; -const TMP_FAAS_TIME = 'faas.time'; -const TMP_FAAS_CRON = 'faas.cron'; -const TMP_FAAS_COLDSTART = 'faas.coldstart'; -const TMP_FAAS_INVOKED_NAME = 'faas.invoked_name'; -const TMP_FAAS_INVOKED_PROVIDER = 'faas.invoked_provider'; -const TMP_FAAS_INVOKED_REGION = 'faas.invoked_region'; -const TMP_NET_TRANSPORT = 'net.transport'; -const TMP_NET_PEER_IP = 'net.peer.ip'; -const TMP_NET_PEER_PORT = 'net.peer.port'; -const TMP_NET_PEER_NAME = 'net.peer.name'; -const TMP_NET_HOST_IP = 'net.host.ip'; -const TMP_NET_HOST_PORT = 'net.host.port'; -const TMP_NET_HOST_NAME = 'net.host.name'; -const TMP_NET_HOST_CONNECTION_TYPE = 'net.host.connection.type'; -const TMP_NET_HOST_CONNECTION_SUBTYPE = 'net.host.connection.subtype'; -const TMP_NET_HOST_CARRIER_NAME = 'net.host.carrier.name'; -const TMP_NET_HOST_CARRIER_MCC = 'net.host.carrier.mcc'; -const TMP_NET_HOST_CARRIER_MNC = 'net.host.carrier.mnc'; -const TMP_NET_HOST_CARRIER_ICC = 'net.host.carrier.icc'; -const TMP_PEER_SERVICE = 'peer.service'; -const TMP_ENDUSER_ID = 'enduser.id'; -const TMP_ENDUSER_ROLE = 'enduser.role'; -const TMP_ENDUSER_SCOPE = 'enduser.scope'; -const TMP_THREAD_ID = 'thread.id'; -const TMP_THREAD_NAME = 'thread.name'; -const TMP_CODE_FUNCTION = 'code.function'; -const TMP_CODE_NAMESPACE = 'code.namespace'; -const TMP_CODE_FILEPATH = 'code.filepath'; -const TMP_CODE_LINENO = 'code.lineno'; -const TMP_HTTP_METHOD = 'http.method'; -const TMP_HTTP_URL = 'http.url'; -const TMP_HTTP_TARGET = 'http.target'; -const TMP_HTTP_HOST = 'http.host'; -const TMP_HTTP_SCHEME = 'http.scheme'; -const TMP_HTTP_STATUS_CODE = 'http.status_code'; -const TMP_HTTP_FLAVOR = 'http.flavor'; -const TMP_HTTP_USER_AGENT = 'http.user_agent'; -const TMP_HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length'; -const TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = 'http.request_content_length_uncompressed'; -const TMP_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length'; -const TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed'; -const TMP_HTTP_SERVER_NAME = 'http.server_name'; -const TMP_HTTP_ROUTE = 'http.route'; -const TMP_HTTP_CLIENT_IP = 'http.client_ip'; -const TMP_AWS_DYNAMODB_TABLE_NAMES = 'aws.dynamodb.table_names'; -const TMP_AWS_DYNAMODB_CONSUMED_CAPACITY = 'aws.dynamodb.consumed_capacity'; -const TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = 'aws.dynamodb.item_collection_metrics'; -const TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = 'aws.dynamodb.provisioned_read_capacity'; -const TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = 'aws.dynamodb.provisioned_write_capacity'; -const TMP_AWS_DYNAMODB_CONSISTENT_READ = 'aws.dynamodb.consistent_read'; -const TMP_AWS_DYNAMODB_PROJECTION = 'aws.dynamodb.projection'; -const TMP_AWS_DYNAMODB_LIMIT = 'aws.dynamodb.limit'; -const TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET = 'aws.dynamodb.attributes_to_get'; -const TMP_AWS_DYNAMODB_INDEX_NAME = 'aws.dynamodb.index_name'; -const TMP_AWS_DYNAMODB_SELECT = 'aws.dynamodb.select'; -const TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = 'aws.dynamodb.global_secondary_indexes'; -const TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = 'aws.dynamodb.local_secondary_indexes'; -const TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = 'aws.dynamodb.exclusive_start_table'; -const TMP_AWS_DYNAMODB_TABLE_COUNT = 'aws.dynamodb.table_count'; -const TMP_AWS_DYNAMODB_SCAN_FORWARD = 'aws.dynamodb.scan_forward'; -const TMP_AWS_DYNAMODB_SEGMENT = 'aws.dynamodb.segment'; -const TMP_AWS_DYNAMODB_TOTAL_SEGMENTS = 'aws.dynamodb.total_segments'; -const TMP_AWS_DYNAMODB_COUNT = 'aws.dynamodb.count'; -const TMP_AWS_DYNAMODB_SCANNED_COUNT = 'aws.dynamodb.scanned_count'; -const TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = 'aws.dynamodb.attribute_definitions'; -const TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = 'aws.dynamodb.global_secondary_index_updates'; -const TMP_MESSAGING_SYSTEM = 'messaging.system'; -const TMP_MESSAGING_DESTINATION = 'messaging.destination'; -const TMP_MESSAGING_DESTINATION_KIND = 'messaging.destination_kind'; -const TMP_MESSAGING_TEMP_DESTINATION = 'messaging.temp_destination'; -const TMP_MESSAGING_PROTOCOL = 'messaging.protocol'; -const TMP_MESSAGING_PROTOCOL_VERSION = 'messaging.protocol_version'; -const TMP_MESSAGING_URL = 'messaging.url'; -const TMP_MESSAGING_MESSAGE_ID = 'messaging.message_id'; -const TMP_MESSAGING_CONVERSATION_ID = 'messaging.conversation_id'; -const TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = 'messaging.message_payload_size_bytes'; -const TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = 'messaging.message_payload_compressed_size_bytes'; -const TMP_MESSAGING_OPERATION = 'messaging.operation'; -const TMP_MESSAGING_CONSUMER_ID = 'messaging.consumer_id'; -const TMP_MESSAGING_RABBITMQ_ROUTING_KEY = 'messaging.rabbitmq.routing_key'; -const TMP_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message_key'; -const TMP_MESSAGING_KAFKA_CONSUMER_GROUP = 'messaging.kafka.consumer_group'; -const TMP_MESSAGING_KAFKA_CLIENT_ID = 'messaging.kafka.client_id'; -const TMP_MESSAGING_KAFKA_PARTITION = 'messaging.kafka.partition'; -const TMP_MESSAGING_KAFKA_TOMBSTONE = 'messaging.kafka.tombstone'; -const TMP_RPC_SYSTEM = 'rpc.system'; -const TMP_RPC_SERVICE = 'rpc.service'; -const TMP_RPC_METHOD = 'rpc.method'; -const TMP_RPC_GRPC_STATUS_CODE = 'rpc.grpc.status_code'; -const TMP_RPC_JSONRPC_VERSION = 'rpc.jsonrpc.version'; -const TMP_RPC_JSONRPC_REQUEST_ID = 'rpc.jsonrpc.request_id'; -const TMP_RPC_JSONRPC_ERROR_CODE = 'rpc.jsonrpc.error_code'; -const TMP_RPC_JSONRPC_ERROR_MESSAGE = 'rpc.jsonrpc.error_message'; -const TMP_MESSAGE_TYPE = 'message.type'; -const TMP_MESSAGE_ID = 'message.id'; -const TMP_MESSAGE_COMPRESSED_SIZE = 'message.compressed_size'; -const TMP_MESSAGE_UNCOMPRESSED_SIZE = 'message.uncompressed_size'; -/** - * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). - * - * Note: This may be different from `faas.id` if an alias is involved. - * - * @deprecated use ATTR_AWS_LAMBDA_INVOKED_ARN - */ -exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = TMP_AWS_LAMBDA_INVOKED_ARN; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated use ATTR_DB_SYSTEM - */ -exports.SEMATTRS_DB_SYSTEM = TMP_DB_SYSTEM; -/** - * The connection string used to connect to the database. It is recommended to remove embedded credentials. - * - * @deprecated use ATTR_DB_CONNECTION_STRING - */ -exports.SEMATTRS_DB_CONNECTION_STRING = TMP_DB_CONNECTION_STRING; -/** - * Username for accessing the database. - * - * @deprecated use ATTR_DB_USER - */ -exports.SEMATTRS_DB_USER = TMP_DB_USER; -/** - * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - * - * @deprecated use ATTR_DB_JDBC_DRIVER_CLASSNAME - */ -exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = TMP_DB_JDBC_DRIVER_CLASSNAME; -/** - * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - * - * Note: In some SQL databases, the database name to be used is called "schema name". - * - * @deprecated use ATTR_DB_NAME - */ -exports.SEMATTRS_DB_NAME = TMP_DB_NAME; -/** - * The database statement being executed. - * - * Note: The value may be sanitized to exclude sensitive information. - * - * @deprecated use ATTR_DB_STATEMENT - */ -exports.SEMATTRS_DB_STATEMENT = TMP_DB_STATEMENT; -/** - * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - * - * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - * - * @deprecated use ATTR_DB_OPERATION - */ -exports.SEMATTRS_DB_OPERATION = TMP_DB_OPERATION; -/** - * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - * - * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). - * - * @deprecated use ATTR_DB_MSSQL_INSTANCE_NAME - */ -exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = TMP_DB_MSSQL_INSTANCE_NAME; -/** - * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. - * - * @deprecated use ATTR_DB_CASSANDRA_KEYSPACE - */ -exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = TMP_DB_CASSANDRA_KEYSPACE; -/** - * The fetch size used for paging, i.e. how many rows will be returned at once. - * - * @deprecated use ATTR_DB_CASSANDRA_PAGE_SIZE - */ -exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = TMP_DB_CASSANDRA_PAGE_SIZE; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated use ATTR_DB_CASSANDRA_CONSISTENCY_LEVEL - */ -exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = TMP_DB_CASSANDRA_CONSISTENCY_LEVEL; -/** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - * - * @deprecated use ATTR_DB_CASSANDRA_TABLE - */ -exports.SEMATTRS_DB_CASSANDRA_TABLE = TMP_DB_CASSANDRA_TABLE; -/** - * Whether or not the query is idempotent. - * - * @deprecated use ATTR_DB_CASSANDRA_IDEMPOTENCE - */ -exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = TMP_DB_CASSANDRA_IDEMPOTENCE; -/** - * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - * - * @deprecated use ATTR_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT - */ -exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = TMP_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT; -/** - * The ID of the coordinating node for a query. - * - * @deprecated use ATTR_DB_CASSANDRA_COORDINATOR_ID - */ -exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = TMP_DB_CASSANDRA_COORDINATOR_ID; -/** - * The data center of the coordinating node for a query. - * - * @deprecated use ATTR_DB_CASSANDRA_COORDINATOR_DC - */ -exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = TMP_DB_CASSANDRA_COORDINATOR_DC; -/** - * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. - * - * @deprecated use ATTR_DB_HBASE_NAMESPACE - */ -exports.SEMATTRS_DB_HBASE_NAMESPACE = TMP_DB_HBASE_NAMESPACE; -/** - * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - * - * @deprecated use ATTR_DB_REDIS_DATABASE_INDEX - */ -exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = TMP_DB_REDIS_DATABASE_INDEX; -/** - * The collection being accessed within the database stated in `db.name`. - * - * @deprecated use ATTR_DB_MONGODB_COLLECTION - */ -exports.SEMATTRS_DB_MONGODB_COLLECTION = TMP_DB_MONGODB_COLLECTION; -/** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - * - * @deprecated use ATTR_DB_SQL_TABLE - */ -exports.SEMATTRS_DB_SQL_TABLE = TMP_DB_SQL_TABLE; -/** - * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. - * - * @deprecated use ATTR_EXCEPTION_TYPE - */ -exports.SEMATTRS_EXCEPTION_TYPE = TMP_EXCEPTION_TYPE; -/** - * The exception message. - * - * @deprecated use ATTR_EXCEPTION_MESSAGE - */ -exports.SEMATTRS_EXCEPTION_MESSAGE = TMP_EXCEPTION_MESSAGE; -/** - * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. - * - * @deprecated use ATTR_EXCEPTION_STACKTRACE - */ -exports.SEMATTRS_EXCEPTION_STACKTRACE = TMP_EXCEPTION_STACKTRACE; -/** -* SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. -* -* Note: An exception is considered to have escaped (or left) the scope of a span, -if that span is ended while the exception is still logically "in flight". -This may be actually "in flight" in some languages (e.g. if the exception -is passed to a Context manager's `__exit__` method in Python) but will -usually be caught at the point of recording the exception in most languages. - -It is usually not possible to determine at the point where an exception is thrown -whether it will escape the scope of a span. -However, it is trivial to know that an exception -will escape, if one checks for an active exception just before ending the span, -as done in the [example above](#exception-end-example). - -It follows that an exception may still escape the scope of the span -even if the `exception.escaped` attribute was not set or set to false, -since the event might have been recorded at a time where it was not -clear whether the exception will escape. -* -* @deprecated use ATTR_EXCEPTION_ESCAPED -*/ -exports.SEMATTRS_EXCEPTION_ESCAPED = TMP_EXCEPTION_ESCAPED; -/** - * Type of the trigger on which the function is executed. - * - * @deprecated use ATTR_FAAS_TRIGGER - */ -exports.SEMATTRS_FAAS_TRIGGER = TMP_FAAS_TRIGGER; -/** - * The execution ID of the current function execution. - * - * @deprecated use ATTR_FAAS_EXECUTION - */ -exports.SEMATTRS_FAAS_EXECUTION = TMP_FAAS_EXECUTION; -/** - * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. - * - * @deprecated use ATTR_FAAS_DOCUMENT_COLLECTION - */ -exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = TMP_FAAS_DOCUMENT_COLLECTION; -/** - * Describes the type of the operation that was performed on the data. - * - * @deprecated use ATTR_FAAS_DOCUMENT_OPERATION - */ -exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = TMP_FAAS_DOCUMENT_OPERATION; -/** - * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - * - * @deprecated use ATTR_FAAS_DOCUMENT_TIME - */ -exports.SEMATTRS_FAAS_DOCUMENT_TIME = TMP_FAAS_DOCUMENT_TIME; -/** - * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. - * - * @deprecated use ATTR_FAAS_DOCUMENT_NAME - */ -exports.SEMATTRS_FAAS_DOCUMENT_NAME = TMP_FAAS_DOCUMENT_NAME; -/** - * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - * - * @deprecated use ATTR_FAAS_TIME - */ -exports.SEMATTRS_FAAS_TIME = TMP_FAAS_TIME; -/** - * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - * - * @deprecated use ATTR_FAAS_CRON - */ -exports.SEMATTRS_FAAS_CRON = TMP_FAAS_CRON; -/** - * A boolean that is true if the serverless function is executed for the first time (aka cold-start). - * - * @deprecated use ATTR_FAAS_COLDSTART - */ -exports.SEMATTRS_FAAS_COLDSTART = TMP_FAAS_COLDSTART; -/** - * The name of the invoked function. - * - * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. - * - * @deprecated use ATTR_FAAS_INVOKED_NAME - */ -exports.SEMATTRS_FAAS_INVOKED_NAME = TMP_FAAS_INVOKED_NAME; -/** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - * - * @deprecated use ATTR_FAAS_INVOKED_PROVIDER - */ -exports.SEMATTRS_FAAS_INVOKED_PROVIDER = TMP_FAAS_INVOKED_PROVIDER; -/** - * The cloud region of the invoked function. - * - * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. - * - * @deprecated use ATTR_FAAS_INVOKED_REGION - */ -exports.SEMATTRS_FAAS_INVOKED_REGION = TMP_FAAS_INVOKED_REGION; -/** - * Transport protocol used. See note below. - * - * @deprecated use ATTR_NET_TRANSPORT - */ -exports.SEMATTRS_NET_TRANSPORT = TMP_NET_TRANSPORT; -/** - * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). - * - * @deprecated use ATTR_NET_PEER_IP - */ -exports.SEMATTRS_NET_PEER_IP = TMP_NET_PEER_IP; -/** - * Remote port number. - * - * @deprecated use ATTR_NET_PEER_PORT - */ -exports.SEMATTRS_NET_PEER_PORT = TMP_NET_PEER_PORT; -/** - * Remote hostname or similar, see note below. - * - * @deprecated use ATTR_NET_PEER_NAME - */ -exports.SEMATTRS_NET_PEER_NAME = TMP_NET_PEER_NAME; -/** - * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. - * - * @deprecated use ATTR_NET_HOST_IP - */ -exports.SEMATTRS_NET_HOST_IP = TMP_NET_HOST_IP; -/** - * Like `net.peer.port` but for the host port. - * - * @deprecated use ATTR_NET_HOST_PORT - */ -exports.SEMATTRS_NET_HOST_PORT = TMP_NET_HOST_PORT; -/** - * Local hostname or similar, see note below. - * - * @deprecated use ATTR_NET_HOST_NAME - */ -exports.SEMATTRS_NET_HOST_NAME = TMP_NET_HOST_NAME; -/** - * The internet connection type currently being used by the host. - * - * @deprecated use ATTR_NET_HOST_CONNECTION_TYPE - */ -exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = TMP_NET_HOST_CONNECTION_TYPE; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated use ATTR_NET_HOST_CONNECTION_SUBTYPE - */ -exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = TMP_NET_HOST_CONNECTION_SUBTYPE; -/** - * The name of the mobile carrier. - * - * @deprecated use ATTR_NET_HOST_CARRIER_NAME - */ -exports.SEMATTRS_NET_HOST_CARRIER_NAME = TMP_NET_HOST_CARRIER_NAME; -/** - * The mobile carrier country code. - * - * @deprecated use ATTR_NET_HOST_CARRIER_MCC - */ -exports.SEMATTRS_NET_HOST_CARRIER_MCC = TMP_NET_HOST_CARRIER_MCC; -/** - * The mobile carrier network code. - * - * @deprecated use ATTR_NET_HOST_CARRIER_MNC - */ -exports.SEMATTRS_NET_HOST_CARRIER_MNC = TMP_NET_HOST_CARRIER_MNC; -/** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - * - * @deprecated use ATTR_NET_HOST_CARRIER_ICC - */ -exports.SEMATTRS_NET_HOST_CARRIER_ICC = TMP_NET_HOST_CARRIER_ICC; -/** - * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. - * - * @deprecated use ATTR_PEER_SERVICE - */ -exports.SEMATTRS_PEER_SERVICE = TMP_PEER_SERVICE; -/** - * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. - * - * @deprecated use ATTR_ENDUSER_ID - */ -exports.SEMATTRS_ENDUSER_ID = TMP_ENDUSER_ID; -/** - * Actual/assumed role the client is making the request under extracted from token or application security context. - * - * @deprecated use ATTR_ENDUSER_ROLE - */ -exports.SEMATTRS_ENDUSER_ROLE = TMP_ENDUSER_ROLE; -/** - * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - * - * @deprecated use ATTR_ENDUSER_SCOPE - */ -exports.SEMATTRS_ENDUSER_SCOPE = TMP_ENDUSER_SCOPE; -/** - * Current "managed" thread ID (as opposed to OS thread ID). - * - * @deprecated use ATTR_THREAD_ID - */ -exports.SEMATTRS_THREAD_ID = TMP_THREAD_ID; -/** - * Current thread name. - * - * @deprecated use ATTR_THREAD_NAME - */ -exports.SEMATTRS_THREAD_NAME = TMP_THREAD_NAME; -/** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). - * - * @deprecated use ATTR_CODE_FUNCTION - */ -exports.SEMATTRS_CODE_FUNCTION = TMP_CODE_FUNCTION; -/** - * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. - * - * @deprecated use ATTR_CODE_NAMESPACE - */ -exports.SEMATTRS_CODE_NAMESPACE = TMP_CODE_NAMESPACE; -/** - * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). - * - * @deprecated use ATTR_CODE_FILEPATH - */ -exports.SEMATTRS_CODE_FILEPATH = TMP_CODE_FILEPATH; -/** - * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. - * - * @deprecated use ATTR_CODE_LINENO - */ -exports.SEMATTRS_CODE_LINENO = TMP_CODE_LINENO; -/** - * HTTP request method. - * - * @deprecated use ATTR_HTTP_METHOD - */ -exports.SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD; -/** - * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. - * - * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. - * - * @deprecated use ATTR_HTTP_URL - */ -exports.SEMATTRS_HTTP_URL = TMP_HTTP_URL; -/** - * The full request target as passed in a HTTP request line or equivalent. - * - * @deprecated use ATTR_HTTP_TARGET - */ -exports.SEMATTRS_HTTP_TARGET = TMP_HTTP_TARGET; -/** - * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note. - * - * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set. - * - * @deprecated use ATTR_HTTP_HOST - */ -exports.SEMATTRS_HTTP_HOST = TMP_HTTP_HOST; -/** - * The URI scheme identifying the used protocol. - * - * @deprecated use ATTR_HTTP_SCHEME - */ -exports.SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME; -/** - * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - * - * @deprecated use ATTR_HTTP_STATUS_CODE - */ -exports.SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE; -/** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - * - * @deprecated use ATTR_HTTP_FLAVOR - */ -exports.SEMATTRS_HTTP_FLAVOR = TMP_HTTP_FLAVOR; -/** - * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. - * - * @deprecated use ATTR_HTTP_USER_AGENT - */ -exports.SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT; -/** - * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. - * - * @deprecated use ATTR_HTTP_REQUEST_CONTENT_LENGTH - */ -exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH = TMP_HTTP_REQUEST_CONTENT_LENGTH; -/** - * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. - * - * @deprecated use ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED - */ -exports.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED; -/** - * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. - * - * @deprecated use ATTR_HTTP_RESPONSE_CONTENT_LENGTH - */ -exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH; -/** - * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. - * - * @deprecated use ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED - */ -exports.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED; -/** - * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). - * - * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. - * - * @deprecated use ATTR_HTTP_SERVER_NAME - */ -exports.SEMATTRS_HTTP_SERVER_NAME = TMP_HTTP_SERVER_NAME; -/** - * The matched route (path template). - * - * @deprecated use ATTR_HTTP_ROUTE - */ -exports.SEMATTRS_HTTP_ROUTE = TMP_HTTP_ROUTE; -/** -* The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). -* -* Note: This is not necessarily the same as `net.peer.ip`, which would -identify the network-level peer, which may be a proxy. - -This attribute should be set when a source of information different -from the one used for `net.peer.ip`, is available even if that other -source just confirms the same value as `net.peer.ip`. -Rationale: For `net.peer.ip`, one typically does not know if it -comes from a proxy, reverse proxy, or the actual client. Setting -`http.client_ip` when it's the same as `net.peer.ip` means that -one is at least somewhat confident that the address is not that of -the closest proxy. -* -* @deprecated use ATTR_HTTP_CLIENT_IP -*/ -exports.SEMATTRS_HTTP_CLIENT_IP = TMP_HTTP_CLIENT_IP; -/** - * The keys in the `RequestItems` object field. - * - * @deprecated use ATTR_AWS_DYNAMODB_TABLE_NAMES - */ -exports.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES = TMP_AWS_DYNAMODB_TABLE_NAMES; -/** - * The JSON-serialized value of each item in the `ConsumedCapacity` response field. - * - * @deprecated use ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY - */ -exports.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY = TMP_AWS_DYNAMODB_CONSUMED_CAPACITY; -/** - * The JSON-serialized value of the `ItemCollectionMetrics` response field. - * - * @deprecated use ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS - */ -exports.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS = TMP_AWS_DYNAMODB_ITEM_COLLECTION_METRICS; -/** - * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY - */ -exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY; -/** - * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY - */ -exports.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY = TMP_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY; -/** - * The value of the `ConsistentRead` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_CONSISTENT_READ - */ -exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = TMP_AWS_DYNAMODB_CONSISTENT_READ; -/** - * The value of the `ProjectionExpression` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_PROJECTION - */ -exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = TMP_AWS_DYNAMODB_PROJECTION; -/** - * The value of the `Limit` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_LIMIT - */ -exports.SEMATTRS_AWS_DYNAMODB_LIMIT = TMP_AWS_DYNAMODB_LIMIT; -/** - * The value of the `AttributesToGet` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_ATTRIBUTES_TO_GET - */ -exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET = TMP_AWS_DYNAMODB_ATTRIBUTES_TO_GET; -/** - * The value of the `IndexName` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_INDEX_NAME - */ -exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = TMP_AWS_DYNAMODB_INDEX_NAME; -/** - * The value of the `Select` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_SELECT - */ -exports.SEMATTRS_AWS_DYNAMODB_SELECT = TMP_AWS_DYNAMODB_SELECT; -/** - * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. - * - * @deprecated use ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES - */ -exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES; -/** - * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. - * - * @deprecated use ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES - */ -exports.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES = TMP_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES; -/** - * The value of the `ExclusiveStartTableName` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE - */ -exports.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE = TMP_AWS_DYNAMODB_EXCLUSIVE_START_TABLE; -/** - * The the number of items in the `TableNames` response parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_TABLE_COUNT - */ -exports.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT = TMP_AWS_DYNAMODB_TABLE_COUNT; -/** - * The value of the `ScanIndexForward` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_SCAN_FORWARD - */ -exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = TMP_AWS_DYNAMODB_SCAN_FORWARD; -/** - * The value of the `Segment` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_SEGMENT - */ -exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = TMP_AWS_DYNAMODB_SEGMENT; -/** - * The value of the `TotalSegments` request parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS - */ -exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = TMP_AWS_DYNAMODB_TOTAL_SEGMENTS; -/** - * The value of the `Count` response parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_COUNT - */ -exports.SEMATTRS_AWS_DYNAMODB_COUNT = TMP_AWS_DYNAMODB_COUNT; -/** - * The value of the `ScannedCount` response parameter. - * - * @deprecated use ATTR_AWS_DYNAMODB_SCANNED_COUNT - */ -exports.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT = TMP_AWS_DYNAMODB_SCANNED_COUNT; -/** - * The JSON-serialized value of each item in the `AttributeDefinitions` request field. - * - * @deprecated use ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS - */ -exports.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS = TMP_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS; -/** - * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. - * - * @deprecated use ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES - */ -exports.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES = TMP_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES; -/** - * A string identifying the messaging system. - * - * @deprecated use ATTR_MESSAGING_SYSTEM - */ -exports.SEMATTRS_MESSAGING_SYSTEM = TMP_MESSAGING_SYSTEM; -/** - * The message destination name. This might be equal to the span name but is required nevertheless. - * - * @deprecated use ATTR_MESSAGING_DESTINATION - */ -exports.SEMATTRS_MESSAGING_DESTINATION = TMP_MESSAGING_DESTINATION; -/** - * The kind of message destination. - * - * @deprecated use ATTR_MESSAGING_DESTINATION_KIND - */ -exports.SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND; -/** - * A boolean that is true if the message destination is temporary. - * - * @deprecated use ATTR_MESSAGING_TEMP_DESTINATION - */ -exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = TMP_MESSAGING_TEMP_DESTINATION; -/** - * The name of the transport protocol. - * - * @deprecated use ATTR_MESSAGING_PROTOCOL - */ -exports.SEMATTRS_MESSAGING_PROTOCOL = TMP_MESSAGING_PROTOCOL; -/** - * The version of the transport protocol. - * - * @deprecated use ATTR_MESSAGING_PROTOCOL_VERSION - */ -exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = TMP_MESSAGING_PROTOCOL_VERSION; -/** - * Connection string. - * - * @deprecated use ATTR_MESSAGING_URL - */ -exports.SEMATTRS_MESSAGING_URL = TMP_MESSAGING_URL; -/** - * A value used by the messaging system as an identifier for the message, represented as a string. - * - * @deprecated use ATTR_MESSAGING_MESSAGE_ID - */ -exports.SEMATTRS_MESSAGING_MESSAGE_ID = TMP_MESSAGING_MESSAGE_ID; -/** - * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". - * - * @deprecated use ATTR_MESSAGING_CONVERSATION_ID - */ -exports.SEMATTRS_MESSAGING_CONVERSATION_ID = TMP_MESSAGING_CONVERSATION_ID; -/** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. - * - * @deprecated use ATTR_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES - */ -exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; -/** - * The compressed size of the message payload in bytes. - * - * @deprecated use ATTR_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES - */ -exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES; -/** - * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. - * - * @deprecated use ATTR_MESSAGING_OPERATION - */ -exports.SEMATTRS_MESSAGING_OPERATION = TMP_MESSAGING_OPERATION; -/** - * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. - * - * @deprecated use ATTR_MESSAGING_CONSUMER_ID - */ -exports.SEMATTRS_MESSAGING_CONSUMER_ID = TMP_MESSAGING_CONSUMER_ID; -/** - * RabbitMQ message routing key. - * - * @deprecated use ATTR_MESSAGING_RABBITMQ_ROUTING_KEY - */ -exports.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY = TMP_MESSAGING_RABBITMQ_ROUTING_KEY; -/** - * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. - * - * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. - * - * @deprecated use ATTR_MESSAGING_KAFKA_MESSAGE_KEY - */ -exports.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY = TMP_MESSAGING_KAFKA_MESSAGE_KEY; -/** - * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. - * - * @deprecated use ATTR_MESSAGING_KAFKA_CONSUMER_GROUP - */ -exports.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP = TMP_MESSAGING_KAFKA_CONSUMER_GROUP; -/** - * Client Id for the Consumer or Producer that is handling the message. - * - * @deprecated use ATTR_MESSAGING_KAFKA_CLIENT_ID - */ -exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = TMP_MESSAGING_KAFKA_CLIENT_ID; -/** - * Partition the message is sent to. - * - * @deprecated use ATTR_MESSAGING_KAFKA_PARTITION - */ -exports.SEMATTRS_MESSAGING_KAFKA_PARTITION = TMP_MESSAGING_KAFKA_PARTITION; -/** - * A boolean that is true if the message is a tombstone. - * - * @deprecated use ATTR_MESSAGING_KAFKA_TOMBSTONE - */ -exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = TMP_MESSAGING_KAFKA_TOMBSTONE; -/** - * A string identifying the remoting system. - * - * @deprecated use ATTR_RPC_SYSTEM - */ -exports.SEMATTRS_RPC_SYSTEM = TMP_RPC_SYSTEM; -/** - * The full (logical) name of the service being called, including its package name, if applicable. - * - * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - * - * @deprecated use ATTR_RPC_SERVICE - */ -exports.SEMATTRS_RPC_SERVICE = TMP_RPC_SERVICE; -/** - * The name of the (logical) method being called, must be equal to the $method part in the span name. - * - * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). - * - * @deprecated use ATTR_RPC_METHOD - */ -exports.SEMATTRS_RPC_METHOD = TMP_RPC_METHOD; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated use ATTR_RPC_GRPC_STATUS_CODE - */ -exports.SEMATTRS_RPC_GRPC_STATUS_CODE = TMP_RPC_GRPC_STATUS_CODE; -/** - * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. - * - * @deprecated use ATTR_RPC_JSONRPC_VERSION - */ -exports.SEMATTRS_RPC_JSONRPC_VERSION = TMP_RPC_JSONRPC_VERSION; -/** - * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. - * - * @deprecated use ATTR_RPC_JSONRPC_REQUEST_ID - */ -exports.SEMATTRS_RPC_JSONRPC_REQUEST_ID = TMP_RPC_JSONRPC_REQUEST_ID; -/** - * `error.code` property of response if it is an error response. - * - * @deprecated use ATTR_RPC_JSONRPC_ERROR_CODE - */ -exports.SEMATTRS_RPC_JSONRPC_ERROR_CODE = TMP_RPC_JSONRPC_ERROR_CODE; -/** - * `error.message` property of response if it is an error response. - * - * @deprecated use ATTR_RPC_JSONRPC_ERROR_MESSAGE - */ -exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = TMP_RPC_JSONRPC_ERROR_MESSAGE; -/** - * Whether this is a received or sent message. - * - * @deprecated use ATTR_MESSAGE_TYPE - */ -exports.SEMATTRS_MESSAGE_TYPE = TMP_MESSAGE_TYPE; -/** - * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. - * - * Note: This way we guarantee that the values will be consistent between different implementations. - * - * @deprecated use ATTR_MESSAGE_ID - */ -exports.SEMATTRS_MESSAGE_ID = TMP_MESSAGE_ID; -/** - * Compressed size of the message in bytes. - * - * @deprecated use ATTR_MESSAGE_COMPRESSED_SIZE - */ -exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = TMP_MESSAGE_COMPRESSED_SIZE; -/** - * Uncompressed size of the message in bytes. - * - * @deprecated use ATTR_MESSAGE_UNCOMPRESSED_SIZE - */ -exports.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE = TMP_MESSAGE_UNCOMPRESSED_SIZE; -/** - * Create exported Value Map for SemanticAttributes values - * @deprecated Use the SEMATTRS_XXXXX constants rather than the SemanticAttributes.XXXXX for bundle minification - */ -exports.SemanticAttributes = -/*#__PURE__*/ (0, utils_1.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, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for DbSystemValues enum definition - * - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_DBSYSTEMVALUES_OTHER_SQL = 'other_sql'; -const TMP_DBSYSTEMVALUES_MSSQL = 'mssql'; -const TMP_DBSYSTEMVALUES_MYSQL = 'mysql'; -const TMP_DBSYSTEMVALUES_ORACLE = 'oracle'; -const TMP_DBSYSTEMVALUES_DB2 = 'db2'; -const TMP_DBSYSTEMVALUES_POSTGRESQL = 'postgresql'; -const TMP_DBSYSTEMVALUES_REDSHIFT = 'redshift'; -const TMP_DBSYSTEMVALUES_HIVE = 'hive'; -const TMP_DBSYSTEMVALUES_CLOUDSCAPE = 'cloudscape'; -const TMP_DBSYSTEMVALUES_HSQLDB = 'hsqldb'; -const TMP_DBSYSTEMVALUES_PROGRESS = 'progress'; -const TMP_DBSYSTEMVALUES_MAXDB = 'maxdb'; -const TMP_DBSYSTEMVALUES_HANADB = 'hanadb'; -const TMP_DBSYSTEMVALUES_INGRES = 'ingres'; -const TMP_DBSYSTEMVALUES_FIRSTSQL = 'firstsql'; -const TMP_DBSYSTEMVALUES_EDB = 'edb'; -const TMP_DBSYSTEMVALUES_CACHE = 'cache'; -const TMP_DBSYSTEMVALUES_ADABAS = 'adabas'; -const TMP_DBSYSTEMVALUES_FIREBIRD = 'firebird'; -const TMP_DBSYSTEMVALUES_DERBY = 'derby'; -const TMP_DBSYSTEMVALUES_FILEMAKER = 'filemaker'; -const TMP_DBSYSTEMVALUES_INFORMIX = 'informix'; -const TMP_DBSYSTEMVALUES_INSTANTDB = 'instantdb'; -const TMP_DBSYSTEMVALUES_INTERBASE = 'interbase'; -const TMP_DBSYSTEMVALUES_MARIADB = 'mariadb'; -const TMP_DBSYSTEMVALUES_NETEZZA = 'netezza'; -const TMP_DBSYSTEMVALUES_PERVASIVE = 'pervasive'; -const TMP_DBSYSTEMVALUES_POINTBASE = 'pointbase'; -const TMP_DBSYSTEMVALUES_SQLITE = 'sqlite'; -const TMP_DBSYSTEMVALUES_SYBASE = 'sybase'; -const TMP_DBSYSTEMVALUES_TERADATA = 'teradata'; -const TMP_DBSYSTEMVALUES_VERTICA = 'vertica'; -const TMP_DBSYSTEMVALUES_H2 = 'h2'; -const TMP_DBSYSTEMVALUES_COLDFUSION = 'coldfusion'; -const TMP_DBSYSTEMVALUES_CASSANDRA = 'cassandra'; -const TMP_DBSYSTEMVALUES_HBASE = 'hbase'; -const TMP_DBSYSTEMVALUES_MONGODB = 'mongodb'; -const TMP_DBSYSTEMVALUES_REDIS = 'redis'; -const TMP_DBSYSTEMVALUES_COUCHBASE = 'couchbase'; -const TMP_DBSYSTEMVALUES_COUCHDB = 'couchdb'; -const TMP_DBSYSTEMVALUES_COSMOSDB = 'cosmosdb'; -const TMP_DBSYSTEMVALUES_DYNAMODB = 'dynamodb'; -const TMP_DBSYSTEMVALUES_NEO4J = 'neo4j'; -const TMP_DBSYSTEMVALUES_GEODE = 'geode'; -const TMP_DBSYSTEMVALUES_ELASTICSEARCH = 'elasticsearch'; -const TMP_DBSYSTEMVALUES_MEMCACHED = 'memcached'; -const TMP_DBSYSTEMVALUES_COCKROACHDB = 'cockroachdb'; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_OTHER_SQL. - */ -exports.DBSYSTEMVALUES_OTHER_SQL = TMP_DBSYSTEMVALUES_OTHER_SQL; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_MSSQL. - */ -exports.DBSYSTEMVALUES_MSSQL = TMP_DBSYSTEMVALUES_MSSQL; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_MYSQL. - */ -exports.DBSYSTEMVALUES_MYSQL = TMP_DBSYSTEMVALUES_MYSQL; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_ORACLE. - */ -exports.DBSYSTEMVALUES_ORACLE = TMP_DBSYSTEMVALUES_ORACLE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_DB2. - */ -exports.DBSYSTEMVALUES_DB2 = TMP_DBSYSTEMVALUES_DB2; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_POSTGRESQL. - */ -exports.DBSYSTEMVALUES_POSTGRESQL = TMP_DBSYSTEMVALUES_POSTGRESQL; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_REDSHIFT. - */ -exports.DBSYSTEMVALUES_REDSHIFT = TMP_DBSYSTEMVALUES_REDSHIFT; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_HIVE. - */ -exports.DBSYSTEMVALUES_HIVE = TMP_DBSYSTEMVALUES_HIVE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_CLOUDSCAPE. - */ -exports.DBSYSTEMVALUES_CLOUDSCAPE = TMP_DBSYSTEMVALUES_CLOUDSCAPE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_HSQLDB. - */ -exports.DBSYSTEMVALUES_HSQLDB = TMP_DBSYSTEMVALUES_HSQLDB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_PROGRESS. - */ -exports.DBSYSTEMVALUES_PROGRESS = TMP_DBSYSTEMVALUES_PROGRESS; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_MAXDB. - */ -exports.DBSYSTEMVALUES_MAXDB = TMP_DBSYSTEMVALUES_MAXDB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_HANADB. - */ -exports.DBSYSTEMVALUES_HANADB = TMP_DBSYSTEMVALUES_HANADB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_INGRES. - */ -exports.DBSYSTEMVALUES_INGRES = TMP_DBSYSTEMVALUES_INGRES; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_FIRSTSQL. - */ -exports.DBSYSTEMVALUES_FIRSTSQL = TMP_DBSYSTEMVALUES_FIRSTSQL; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_EDB. - */ -exports.DBSYSTEMVALUES_EDB = TMP_DBSYSTEMVALUES_EDB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_CACHE. - */ -exports.DBSYSTEMVALUES_CACHE = TMP_DBSYSTEMVALUES_CACHE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_ADABAS. - */ -exports.DBSYSTEMVALUES_ADABAS = TMP_DBSYSTEMVALUES_ADABAS; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_FIREBIRD. - */ -exports.DBSYSTEMVALUES_FIREBIRD = TMP_DBSYSTEMVALUES_FIREBIRD; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_DERBY. - */ -exports.DBSYSTEMVALUES_DERBY = TMP_DBSYSTEMVALUES_DERBY; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_FILEMAKER. - */ -exports.DBSYSTEMVALUES_FILEMAKER = TMP_DBSYSTEMVALUES_FILEMAKER; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_INFORMIX. - */ -exports.DBSYSTEMVALUES_INFORMIX = TMP_DBSYSTEMVALUES_INFORMIX; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_INSTANTDB. - */ -exports.DBSYSTEMVALUES_INSTANTDB = TMP_DBSYSTEMVALUES_INSTANTDB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_INTERBASE. - */ -exports.DBSYSTEMVALUES_INTERBASE = TMP_DBSYSTEMVALUES_INTERBASE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_MARIADB. - */ -exports.DBSYSTEMVALUES_MARIADB = TMP_DBSYSTEMVALUES_MARIADB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_NETEZZA. - */ -exports.DBSYSTEMVALUES_NETEZZA = TMP_DBSYSTEMVALUES_NETEZZA; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_PERVASIVE. - */ -exports.DBSYSTEMVALUES_PERVASIVE = TMP_DBSYSTEMVALUES_PERVASIVE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_POINTBASE. - */ -exports.DBSYSTEMVALUES_POINTBASE = TMP_DBSYSTEMVALUES_POINTBASE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_SQLITE. - */ -exports.DBSYSTEMVALUES_SQLITE = TMP_DBSYSTEMVALUES_SQLITE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_SYBASE. - */ -exports.DBSYSTEMVALUES_SYBASE = TMP_DBSYSTEMVALUES_SYBASE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_TERADATA. - */ -exports.DBSYSTEMVALUES_TERADATA = TMP_DBSYSTEMVALUES_TERADATA; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_VERTICA. - */ -exports.DBSYSTEMVALUES_VERTICA = TMP_DBSYSTEMVALUES_VERTICA; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_H2. - */ -exports.DBSYSTEMVALUES_H2 = TMP_DBSYSTEMVALUES_H2; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_COLDFUSION. - */ -exports.DBSYSTEMVALUES_COLDFUSION = TMP_DBSYSTEMVALUES_COLDFUSION; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_CASSANDRA. - */ -exports.DBSYSTEMVALUES_CASSANDRA = TMP_DBSYSTEMVALUES_CASSANDRA; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_HBASE. - */ -exports.DBSYSTEMVALUES_HBASE = TMP_DBSYSTEMVALUES_HBASE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_MONGODB. - */ -exports.DBSYSTEMVALUES_MONGODB = TMP_DBSYSTEMVALUES_MONGODB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_REDIS. - */ -exports.DBSYSTEMVALUES_REDIS = TMP_DBSYSTEMVALUES_REDIS; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_COUCHBASE. - */ -exports.DBSYSTEMVALUES_COUCHBASE = TMP_DBSYSTEMVALUES_COUCHBASE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_COUCHDB. - */ -exports.DBSYSTEMVALUES_COUCHDB = TMP_DBSYSTEMVALUES_COUCHDB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_COSMOSDB. - */ -exports.DBSYSTEMVALUES_COSMOSDB = TMP_DBSYSTEMVALUES_COSMOSDB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_DYNAMODB. - */ -exports.DBSYSTEMVALUES_DYNAMODB = TMP_DBSYSTEMVALUES_DYNAMODB; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_NEO4J. - */ -exports.DBSYSTEMVALUES_NEO4J = TMP_DBSYSTEMVALUES_NEO4J; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_GEODE. - */ -exports.DBSYSTEMVALUES_GEODE = TMP_DBSYSTEMVALUES_GEODE; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_ELASTICSEARCH. - */ -exports.DBSYSTEMVALUES_ELASTICSEARCH = TMP_DBSYSTEMVALUES_ELASTICSEARCH; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_MEMCACHED. - */ -exports.DBSYSTEMVALUES_MEMCACHED = TMP_DBSYSTEMVALUES_MEMCACHED; -/** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - * - * @deprecated Use DB_SYSTEM_VALUE_COCKROACHDB. - */ -exports.DBSYSTEMVALUES_COCKROACHDB = TMP_DBSYSTEMVALUES_COCKROACHDB; -/** - * The constant map of values for DbSystemValues. - * @deprecated Use the DBSYSTEMVALUES_XXXXX constants rather than the DbSystemValues.XXXXX for bundle minification. - */ -exports.DbSystemValues = -/*#__PURE__*/ (0, utils_1.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, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for DbCassandraConsistencyLevelValues enum definition - * - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL = 'all'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = 'each_quorum'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = 'quorum'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = 'local_quorum'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE = 'one'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO = 'two'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE = 'three'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = 'local_one'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY = 'any'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = 'serial'; -const TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = 'local_serial'; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ALL. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_ALL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ALL; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_EACH_QUORUM. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_QUORUM. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_QUORUM. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ONE. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ONE; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_TWO. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_TWO = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_TWO; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_THREE. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_THREE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_THREE; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_ONE. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_ANY. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_ANY = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_ANY; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_SERIAL. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL; -/** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - * - * @deprecated Use DB_CASSANDRA_CONSISTENCY_LEVEL_VALUE_LOCAL_SERIAL. - */ -exports.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL = TMP_DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL; -/** - * The constant map of values for DbCassandraConsistencyLevelValues. - * @deprecated Use the DBCASSANDRACONSISTENCYLEVELVALUES_XXXXX constants rather than the DbCassandraConsistencyLevelValues.XXXXX for bundle minification. - */ -exports.DbCassandraConsistencyLevelValues = -/*#__PURE__*/ (0, utils_1.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, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for FaasTriggerValues enum definition - * - * Type of the trigger on which the function is executed. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_FAASTRIGGERVALUES_DATASOURCE = 'datasource'; -const TMP_FAASTRIGGERVALUES_HTTP = 'http'; -const TMP_FAASTRIGGERVALUES_PUBSUB = 'pubsub'; -const TMP_FAASTRIGGERVALUES_TIMER = 'timer'; -const TMP_FAASTRIGGERVALUES_OTHER = 'other'; -/** - * Type of the trigger on which the function is executed. - * - * @deprecated Use FAAS_TRIGGER_VALUE_DATASOURCE. - */ -exports.FAASTRIGGERVALUES_DATASOURCE = TMP_FAASTRIGGERVALUES_DATASOURCE; -/** - * Type of the trigger on which the function is executed. - * - * @deprecated Use FAAS_TRIGGER_VALUE_HTTP. - */ -exports.FAASTRIGGERVALUES_HTTP = TMP_FAASTRIGGERVALUES_HTTP; -/** - * Type of the trigger on which the function is executed. - * - * @deprecated Use FAAS_TRIGGER_VALUE_PUBSUB. - */ -exports.FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; -/** - * Type of the trigger on which the function is executed. - * - * @deprecated Use FAAS_TRIGGER_VALUE_TIMER. - */ -exports.FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; -/** - * Type of the trigger on which the function is executed. - * - * @deprecated Use FAAS_TRIGGER_VALUE_OTHER. - */ -exports.FAASTRIGGERVALUES_OTHER = TMP_FAASTRIGGERVALUES_OTHER; -/** - * The constant map of values for FaasTriggerValues. - * @deprecated Use the FAASTRIGGERVALUES_XXXXX constants rather than the FaasTriggerValues.XXXXX for bundle minification. - */ -exports.FaasTriggerValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_FAASTRIGGERVALUES_DATASOURCE, - TMP_FAASTRIGGERVALUES_HTTP, - TMP_FAASTRIGGERVALUES_PUBSUB, - TMP_FAASTRIGGERVALUES_TIMER, - TMP_FAASTRIGGERVALUES_OTHER, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for FaasDocumentOperationValues enum definition - * - * Describes the type of the operation that was performed on the data. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_FAASDOCUMENTOPERATIONVALUES_INSERT = 'insert'; -const TMP_FAASDOCUMENTOPERATIONVALUES_EDIT = 'edit'; -const TMP_FAASDOCUMENTOPERATIONVALUES_DELETE = 'delete'; -/** - * Describes the type of the operation that was performed on the data. - * - * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_INSERT. - */ -exports.FAASDOCUMENTOPERATIONVALUES_INSERT = TMP_FAASDOCUMENTOPERATIONVALUES_INSERT; -/** - * Describes the type of the operation that was performed on the data. - * - * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_EDIT. - */ -exports.FAASDOCUMENTOPERATIONVALUES_EDIT = TMP_FAASDOCUMENTOPERATIONVALUES_EDIT; -/** - * Describes the type of the operation that was performed on the data. - * - * @deprecated Use FAAS_DOCUMENT_OPERATION_VALUE_DELETE. - */ -exports.FAASDOCUMENTOPERATIONVALUES_DELETE = TMP_FAASDOCUMENTOPERATIONVALUES_DELETE; -/** - * The constant map of values for FaasDocumentOperationValues. - * @deprecated Use the FAASDOCUMENTOPERATIONVALUES_XXXXX constants rather than the FaasDocumentOperationValues.XXXXX for bundle minification. - */ -exports.FaasDocumentOperationValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_FAASDOCUMENTOPERATIONVALUES_INSERT, - TMP_FAASDOCUMENTOPERATIONVALUES_EDIT, - TMP_FAASDOCUMENTOPERATIONVALUES_DELETE, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for FaasInvokedProviderValues enum definition - * - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = 'alibaba_cloud'; -const TMP_FAASINVOKEDPROVIDERVALUES_AWS = 'aws'; -const TMP_FAASINVOKEDPROVIDERVALUES_AZURE = 'azure'; -const TMP_FAASINVOKEDPROVIDERVALUES_GCP = 'gcp'; -/** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - * - * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_ALIBABA_CLOUD. - */ -exports.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD = TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD; -/** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - * - * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_AWS. - */ -exports.FAASINVOKEDPROVIDERVALUES_AWS = TMP_FAASINVOKEDPROVIDERVALUES_AWS; -/** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - * - * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_AZURE. - */ -exports.FAASINVOKEDPROVIDERVALUES_AZURE = TMP_FAASINVOKEDPROVIDERVALUES_AZURE; -/** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - * - * @deprecated Use FAAS_INVOKED_PROVIDER_VALUE_GCP. - */ -exports.FAASINVOKEDPROVIDERVALUES_GCP = TMP_FAASINVOKEDPROVIDERVALUES_GCP; -/** - * The constant map of values for FaasInvokedProviderValues. - * @deprecated Use the FAASINVOKEDPROVIDERVALUES_XXXXX constants rather than the FaasInvokedProviderValues.XXXXX for bundle minification. - */ -exports.FaasInvokedProviderValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD, - TMP_FAASINVOKEDPROVIDERVALUES_AWS, - TMP_FAASINVOKEDPROVIDERVALUES_AZURE, - TMP_FAASINVOKEDPROVIDERVALUES_GCP, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for NetTransportValues enum definition - * - * Transport protocol used. See note below. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_NETTRANSPORTVALUES_IP_TCP = 'ip_tcp'; -const TMP_NETTRANSPORTVALUES_IP_UDP = 'ip_udp'; -const TMP_NETTRANSPORTVALUES_IP = 'ip'; -const TMP_NETTRANSPORTVALUES_UNIX = 'unix'; -const TMP_NETTRANSPORTVALUES_PIPE = 'pipe'; -const TMP_NETTRANSPORTVALUES_INPROC = 'inproc'; -const TMP_NETTRANSPORTVALUES_OTHER = 'other'; -/** - * Transport protocol used. See note below. - * - * @deprecated Use NET_TRANSPORT_VALUE_IP_TCP. - */ -exports.NETTRANSPORTVALUES_IP_TCP = TMP_NETTRANSPORTVALUES_IP_TCP; -/** - * Transport protocol used. See note below. - * - * @deprecated Use NET_TRANSPORT_VALUE_IP_UDP. - */ -exports.NETTRANSPORTVALUES_IP_UDP = TMP_NETTRANSPORTVALUES_IP_UDP; -/** - * Transport protocol used. See note below. - * - * @deprecated Use NET_TRANSPORT_VALUE_IP. - */ -exports.NETTRANSPORTVALUES_IP = TMP_NETTRANSPORTVALUES_IP; -/** - * Transport protocol used. See note below. - * - * @deprecated Use NET_TRANSPORT_VALUE_UNIX. - */ -exports.NETTRANSPORTVALUES_UNIX = TMP_NETTRANSPORTVALUES_UNIX; -/** - * Transport protocol used. See note below. - * - * @deprecated Use NET_TRANSPORT_VALUE_PIPE. - */ -exports.NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; -/** - * Transport protocol used. See note below. - * - * @deprecated Use NET_TRANSPORT_VALUE_INPROC. - */ -exports.NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; -/** - * Transport protocol used. See note below. - * - * @deprecated Use NET_TRANSPORT_VALUE_OTHER. - */ -exports.NETTRANSPORTVALUES_OTHER = TMP_NETTRANSPORTVALUES_OTHER; -/** - * The constant map of values for NetTransportValues. - * @deprecated Use the NETTRANSPORTVALUES_XXXXX constants rather than the NetTransportValues.XXXXX for bundle minification. - */ -exports.NetTransportValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_NETTRANSPORTVALUES_IP_TCP, - TMP_NETTRANSPORTVALUES_IP_UDP, - TMP_NETTRANSPORTVALUES_IP, - TMP_NETTRANSPORTVALUES_UNIX, - TMP_NETTRANSPORTVALUES_PIPE, - TMP_NETTRANSPORTVALUES_INPROC, - TMP_NETTRANSPORTVALUES_OTHER, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for NetHostConnectionTypeValues enum definition - * - * The internet connection type currently being used by the host. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI = 'wifi'; -const TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED = 'wired'; -const TMP_NETHOSTCONNECTIONTYPEVALUES_CELL = 'cell'; -const TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = 'unavailable'; -const TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = 'unknown'; -/** - * The internet connection type currently being used by the host. - * - * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_WIFI. - */ -exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI; -/** - * The internet connection type currently being used by the host. - * - * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_WIRED. - */ -exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED; -/** - * The internet connection type currently being used by the host. - * - * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_CELL. - */ -exports.NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; -/** - * The internet connection type currently being used by the host. - * - * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_UNAVAILABLE. - */ -exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; -/** - * The internet connection type currently being used by the host. - * - * @deprecated Use NET_HOST_CONNECTION_TYPE_VALUE_UNKNOWN. - */ -exports.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN = TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN; -/** - * The constant map of values for NetHostConnectionTypeValues. - * @deprecated Use the NETHOSTCONNECTIONTYPEVALUES_XXXXX constants rather than the NetHostConnectionTypeValues.XXXXX for bundle minification. - */ -exports.NetHostConnectionTypeValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI, - TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED, - TMP_NETHOSTCONNECTIONTYPEVALUES_CELL, - TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE, - TMP_NETHOSTCONNECTIONTYPEVALUES_UNKNOWN, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for NetHostConnectionSubtypeValues enum definition - * - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = 'gprs'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = 'edge'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = 'umts'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = 'cdma'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = 'evdo_0'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = 'evdo_a'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = 'cdma2000_1xrtt'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = 'hsdpa'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = 'hsupa'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = 'hspa'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = 'iden'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = 'evdo_b'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE = 'lte'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = 'ehrpd'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = 'hspap'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM = 'gsm'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = 'td_scdma'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = 'iwlan'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR = 'nr'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = 'nrnsa'; -const TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = 'lte_ca'; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_GPRS. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GPRS; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EDGE. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EDGE; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_UMTS. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_UMTS; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_CDMA. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EVDO_0. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0 = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EVDO_A. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_CDMA2000_1XRTT. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_HSDPA. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_HSUPA. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_HSPA. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPA; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_IDEN. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IDEN; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EVDO_B. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_LTE. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_EHRPD. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_HSPAP. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_GSM. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_GSM = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_GSM; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_TD_SCDMA. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_IWLAN. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_NR. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_NR = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NR; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_NRNSA. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA; -/** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - * - * @deprecated Use NET_HOST_CONNECTION_SUBTYPE_VALUE_LTE_CA. - */ -exports.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA = TMP_NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA; -/** - * The constant map of values for NetHostConnectionSubtypeValues. - * @deprecated Use the NETHOSTCONNECTIONSUBTYPEVALUES_XXXXX constants rather than the NetHostConnectionSubtypeValues.XXXXX for bundle minification. - */ -exports.NetHostConnectionSubtypeValues = -/*#__PURE__*/ (0, utils_1.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, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for HttpFlavorValues enum definition - * - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_HTTPFLAVORVALUES_HTTP_1_0 = '1.0'; -const TMP_HTTPFLAVORVALUES_HTTP_1_1 = '1.1'; -const TMP_HTTPFLAVORVALUES_HTTP_2_0 = '2.0'; -const TMP_HTTPFLAVORVALUES_SPDY = 'SPDY'; -const TMP_HTTPFLAVORVALUES_QUIC = 'QUIC'; -/** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - * - * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_1_0. - */ -exports.HTTPFLAVORVALUES_HTTP_1_0 = TMP_HTTPFLAVORVALUES_HTTP_1_0; -/** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - * - * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_1_1. - */ -exports.HTTPFLAVORVALUES_HTTP_1_1 = TMP_HTTPFLAVORVALUES_HTTP_1_1; -/** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - * - * @deprecated Use HTTP_FLAVOR_VALUE_HTTP_2_0. - */ -exports.HTTPFLAVORVALUES_HTTP_2_0 = TMP_HTTPFLAVORVALUES_HTTP_2_0; -/** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - * - * @deprecated Use HTTP_FLAVOR_VALUE_SPDY. - */ -exports.HTTPFLAVORVALUES_SPDY = TMP_HTTPFLAVORVALUES_SPDY; -/** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - * - * @deprecated Use HTTP_FLAVOR_VALUE_QUIC. - */ -exports.HTTPFLAVORVALUES_QUIC = TMP_HTTPFLAVORVALUES_QUIC; -/** - * The constant map of values for HttpFlavorValues. - * @deprecated Use the HTTPFLAVORVALUES_XXXXX constants rather than the HttpFlavorValues.XXXXX for bundle minification. - */ -exports.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, -}; -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for MessagingDestinationKindValues enum definition - * - * The kind of message destination. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE = 'queue'; -const TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC = 'topic'; -/** - * The kind of message destination. - * - * @deprecated Use MESSAGING_DESTINATION_KIND_VALUE_QUEUE. - */ -exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; -/** - * The kind of message destination. - * - * @deprecated Use MESSAGING_DESTINATION_KIND_VALUE_TOPIC. - */ -exports.MESSAGINGDESTINATIONKINDVALUES_TOPIC = TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC; -/** - * The constant map of values for MessagingDestinationKindValues. - * @deprecated Use the MESSAGINGDESTINATIONKINDVALUES_XXXXX constants rather than the MessagingDestinationKindValues.XXXXX for bundle minification. - */ -exports.MessagingDestinationKindValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE, - TMP_MESSAGINGDESTINATIONKINDVALUES_TOPIC, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for MessagingOperationValues enum definition - * - * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_MESSAGINGOPERATIONVALUES_RECEIVE = 'receive'; -const TMP_MESSAGINGOPERATIONVALUES_PROCESS = 'process'; -/** - * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. - * - * @deprecated Use MESSAGING_OPERATION_VALUE_RECEIVE. - */ -exports.MESSAGINGOPERATIONVALUES_RECEIVE = TMP_MESSAGINGOPERATIONVALUES_RECEIVE; -/** - * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. - * - * @deprecated Use MESSAGING_OPERATION_VALUE_PROCESS. - */ -exports.MESSAGINGOPERATIONVALUES_PROCESS = TMP_MESSAGINGOPERATIONVALUES_PROCESS; -/** - * The constant map of values for MessagingOperationValues. - * @deprecated Use the MESSAGINGOPERATIONVALUES_XXXXX constants rather than the MessagingOperationValues.XXXXX for bundle minification. - */ -exports.MessagingOperationValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_MESSAGINGOPERATIONVALUES_RECEIVE, - TMP_MESSAGINGOPERATIONVALUES_PROCESS, -]); -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for RpcGrpcStatusCodeValues enum definition - * - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_RPCGRPCSTATUSCODEVALUES_OK = 0; -const TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED = 1; -const TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN = 2; -const TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = 3; -const TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = 4; -const TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND = 5; -const TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = 6; -const TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = 7; -const TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = 8; -const TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = 9; -const TMP_RPCGRPCSTATUSCODEVALUES_ABORTED = 10; -const TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = 11; -const TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = 12; -const TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL = 13; -const TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = 14; -const TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS = 15; -const TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = 16; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_OK. - */ -exports.RPCGRPCSTATUSCODEVALUES_OK = TMP_RPCGRPCSTATUSCODEVALUES_OK; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_CANCELLED. - */ -exports.RPCGRPCSTATUSCODEVALUES_CANCELLED = TMP_RPCGRPCSTATUSCODEVALUES_CANCELLED; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNKNOWN. - */ -exports.RPCGRPCSTATUSCODEVALUES_UNKNOWN = TMP_RPCGRPCSTATUSCODEVALUES_UNKNOWN; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_INVALID_ARGUMENT. - */ -exports.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT = TMP_RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_DEADLINE_EXCEEDED. - */ -exports.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED = TMP_RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_NOT_FOUND. - */ -exports.RPCGRPCSTATUSCODEVALUES_NOT_FOUND = TMP_RPCGRPCSTATUSCODEVALUES_NOT_FOUND; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_ALREADY_EXISTS. - */ -exports.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS = TMP_RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_PERMISSION_DENIED. - */ -exports.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED = TMP_RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_RESOURCE_EXHAUSTED. - */ -exports.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED = TMP_RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_FAILED_PRECONDITION. - */ -exports.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION = TMP_RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_ABORTED. - */ -exports.RPCGRPCSTATUSCODEVALUES_ABORTED = TMP_RPCGRPCSTATUSCODEVALUES_ABORTED; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_OUT_OF_RANGE. - */ -exports.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE = TMP_RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNIMPLEMENTED. - */ -exports.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED = TMP_RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_INTERNAL. - */ -exports.RPCGRPCSTATUSCODEVALUES_INTERNAL = TMP_RPCGRPCSTATUSCODEVALUES_INTERNAL; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNAVAILABLE. - */ -exports.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE = TMP_RPCGRPCSTATUSCODEVALUES_UNAVAILABLE; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_DATA_LOSS. - */ -exports.RPCGRPCSTATUSCODEVALUES_DATA_LOSS = TMP_RPCGRPCSTATUSCODEVALUES_DATA_LOSS; -/** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - * - * @deprecated Use RPC_GRPC_STATUS_CODE_VALUE_UNAUTHENTICATED. - */ -exports.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED = TMP_RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED; -/** - * The constant map of values for RpcGrpcStatusCodeValues. - * @deprecated Use the RPCGRPCSTATUSCODEVALUES_XXXXX constants rather than the RpcGrpcStatusCodeValues.XXXXX for bundle minification. - */ -exports.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, -}; -/* ---------------------------------------------------------------------------------------------------------- - * Constant values for MessageTypeValues enum definition - * - * Whether this is a received or sent message. - * ---------------------------------------------------------------------------------------------------------- */ -// Temporary local constants to assign to the individual exports and the namespaced version -// Required to avoid the namespace exports using the unminifiable export names for some package types -const TMP_MESSAGETYPEVALUES_SENT = 'SENT'; -const TMP_MESSAGETYPEVALUES_RECEIVED = 'RECEIVED'; -/** - * Whether this is a received or sent message. - * - * @deprecated Use MESSAGE_TYPE_VALUE_SENT. - */ -exports.MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; -/** - * Whether this is a received or sent message. - * - * @deprecated Use MESSAGE_TYPE_VALUE_RECEIVED. - */ -exports.MESSAGETYPEVALUES_RECEIVED = TMP_MESSAGETYPEVALUES_RECEIVED; -/** - * The constant map of values for MessageTypeValues. - * @deprecated Use the MESSAGETYPEVALUES_XXXXX constants rather than the MessageTypeValues.XXXXX for bundle minification. - */ -exports.MessageTypeValues = -/*#__PURE__*/ (0, utils_1.createConstMap)([ - TMP_MESSAGETYPEVALUES_SENT, - TMP_MESSAGETYPEVALUES_RECEIVED, -]); -//# sourceMappingURL=SemanticAttributes.js.map - -/***/ }), - -/***/ 19887: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* eslint-disable no-restricted-syntax -- - * These re-exports are only of constants, only one-level deep at this point, - * and should not cause problems for tree-shakers. - */ -__exportStar(__nccwpck_require__(98999), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 53291: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(78683), exports); -__exportStar(__nccwpck_require__(19144), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 78683: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RedisInstrumentation = void 0; -const api_1 = __nccwpck_require__(65163); -const instrumentation_1 = __nccwpck_require__(65584); -const utils_1 = __nccwpck_require__(81757); -const redis_common_1 = __nccwpck_require__(3194); -/** @knipignore */ -const version_1 = __nccwpck_require__(39279); -const semantic_conventions_1 = __nccwpck_require__(67275); -const OTEL_OPEN_SPANS = Symbol('opentelemetry.instrumentation.redis.open_spans'); -const MULTI_COMMAND_OPTIONS = Symbol('opentelemetry.instrumentation.redis.multi_command_options'); -const DEFAULT_CONFIG = { - requireParentSpan: false, -}; -class RedisInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); - } - setConfig(config = {}) { - super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config)); - } - init() { - // @node-redis/client is a new package introduced and consumed by 'redis 4.0.x' - // on redis@4.1.0 it was changed to @redis/client. - // we will instrument both packages - return [ - this._getInstrumentationNodeModuleDefinition('@redis/client'), - this._getInstrumentationNodeModuleDefinition('@node-redis/client'), - ]; - } - _getInstrumentationNodeModuleDefinition(basePackageName) { - const commanderModuleFile = new instrumentation_1.InstrumentationNodeModuleFile(`${basePackageName}/dist/lib/commander.js`, ['^1.0.0'], (moduleExports, moduleVersion) => { - const transformCommandArguments = moduleExports.transformCommandArguments; - if (!transformCommandArguments) { - this._diag.error('internal instrumentation error, missing transformCommandArguments function'); - return moduleExports; - } - // function name and signature changed in redis 4.1.0 from 'extendWithCommands' to 'attachCommands' - // the matching internal package names starts with 1.0.x (for redis 4.0.x) - const functionToPatch = (moduleVersion === null || moduleVersion === void 0 ? void 0 : moduleVersion.startsWith('1.0.')) - ? 'extendWithCommands' - : 'attachCommands'; - // this is the function that extend a redis client with a list of commands. - // the function patches the commandExecutor to record a span - if ((0, instrumentation_1.isWrapped)(moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports[functionToPatch])) { - this._unwrap(moduleExports, functionToPatch); - } - this._wrap(moduleExports, functionToPatch, this._getPatchExtendWithCommands(transformCommandArguments)); - return moduleExports; - }, (moduleExports) => { - if ((0, instrumentation_1.isWrapped)(moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.extendWithCommands)) { - this._unwrap(moduleExports, 'extendWithCommands'); - } - if ((0, instrumentation_1.isWrapped)(moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.attachCommands)) { - this._unwrap(moduleExports, 'attachCommands'); - } - }); - const multiCommanderModule = new instrumentation_1.InstrumentationNodeModuleFile(`${basePackageName}/dist/lib/client/multi-command.js`, ['^1.0.0'], (moduleExports) => { - var _a; - const redisClientMultiCommandPrototype = (_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.default) === null || _a === void 0 ? void 0 : _a.prototype; - if ((0, instrumentation_1.isWrapped)(redisClientMultiCommandPrototype === null || redisClientMultiCommandPrototype === void 0 ? void 0 : redisClientMultiCommandPrototype.exec)) { - this._unwrap(redisClientMultiCommandPrototype, 'exec'); - } - this._wrap(redisClientMultiCommandPrototype, 'exec', this._getPatchMultiCommandsExec()); - if ((0, instrumentation_1.isWrapped)(redisClientMultiCommandPrototype === null || redisClientMultiCommandPrototype === void 0 ? void 0 : redisClientMultiCommandPrototype.addCommand)) { - this._unwrap(redisClientMultiCommandPrototype, 'addCommand'); - } - this._wrap(redisClientMultiCommandPrototype, 'addCommand', this._getPatchMultiCommandsAddCommand()); - return moduleExports; - }, (moduleExports) => { - var _a; - const redisClientMultiCommandPrototype = (_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.default) === null || _a === void 0 ? void 0 : _a.prototype; - if ((0, instrumentation_1.isWrapped)(redisClientMultiCommandPrototype === null || redisClientMultiCommandPrototype === void 0 ? void 0 : redisClientMultiCommandPrototype.exec)) { - this._unwrap(redisClientMultiCommandPrototype, 'exec'); - } - if ((0, instrumentation_1.isWrapped)(redisClientMultiCommandPrototype === null || redisClientMultiCommandPrototype === void 0 ? void 0 : redisClientMultiCommandPrototype.addCommand)) { - this._unwrap(redisClientMultiCommandPrototype, 'addCommand'); - } - }); - const clientIndexModule = new instrumentation_1.InstrumentationNodeModuleFile(`${basePackageName}/dist/lib/client/index.js`, ['^1.0.0'], (moduleExports) => { - var _a; - const redisClientPrototype = (_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.default) === null || _a === void 0 ? void 0 : _a.prototype; - // In some @redis/client versions 'multi' is a method. In later - // versions, as of https://github.com/redis/node-redis/pull/2324, - // 'MULTI' is a method and 'multi' is a property defined in the - // constructor that points to 'MULTI', and therefore it will not - // be defined on the prototype. - if (redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.multi) { - if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.multi)) { - this._unwrap(redisClientPrototype, 'multi'); - } - this._wrap(redisClientPrototype, 'multi', this._getPatchRedisClientMulti()); - } - if (redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.MULTI) { - if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.MULTI)) { - this._unwrap(redisClientPrototype, 'MULTI'); - } - this._wrap(redisClientPrototype, 'MULTI', this._getPatchRedisClientMulti()); - } - if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.sendCommand)) { - this._unwrap(redisClientPrototype, 'sendCommand'); - } - this._wrap(redisClientPrototype, 'sendCommand', this._getPatchRedisClientSendCommand()); - this._wrap(redisClientPrototype, 'connect', this._getPatchedClientConnect()); - return moduleExports; - }, (moduleExports) => { - var _a; - const redisClientPrototype = (_a = moduleExports === null || moduleExports === void 0 ? void 0 : moduleExports.default) === null || _a === void 0 ? void 0 : _a.prototype; - if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.multi)) { - this._unwrap(redisClientPrototype, 'multi'); - } - if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.MULTI)) { - this._unwrap(redisClientPrototype, 'MULTI'); - } - if ((0, instrumentation_1.isWrapped)(redisClientPrototype === null || redisClientPrototype === void 0 ? void 0 : redisClientPrototype.sendCommand)) { - this._unwrap(redisClientPrototype, 'sendCommand'); - } - }); - return new instrumentation_1.InstrumentationNodeModuleDefinition(basePackageName, ['^1.0.0'], (moduleExports) => { - return moduleExports; - }, () => { }, [commanderModuleFile, multiCommanderModule, clientIndexModule]); - } - // serves both for redis 4.0.x where function name is extendWithCommands - // and redis ^4.1.0 where function name is attachCommands - _getPatchExtendWithCommands(transformCommandArguments) { - const plugin = this; - return function extendWithCommandsPatchWrapper(original) { - return function extendWithCommandsPatch(config) { - var _a; - if (((_a = config === null || config === void 0 ? void 0 : config.BaseClass) === null || _a === void 0 ? void 0 : _a.name) !== 'RedisClient') { - return original.apply(this, arguments); - } - const origExecutor = config.executor; - config.executor = function (command, args) { - const redisCommandArguments = transformCommandArguments(command, args).args; - return plugin._traceClientCommand(origExecutor, this, arguments, redisCommandArguments); - }; - return original.apply(this, arguments); - }; - }; - } - _getPatchMultiCommandsExec() { - const plugin = this; - return function execPatchWrapper(original) { - return function execPatch() { - const execRes = original.apply(this, arguments); - if (typeof (execRes === null || execRes === void 0 ? void 0 : execRes.then) !== 'function') { - plugin._diag.error('got non promise result when patching RedisClientMultiCommand.exec'); - return execRes; - } - return execRes - .then((redisRes) => { - const openSpans = this[OTEL_OPEN_SPANS]; - plugin._endSpansWithRedisReplies(openSpans, redisRes); - return redisRes; - }) - .catch((err) => { - const openSpans = this[OTEL_OPEN_SPANS]; - if (!openSpans) { - plugin._diag.error('cannot find open spans to end for redis multi command'); - } - else { - const replies = err.constructor.name === 'MultiErrorReply' - ? err.replies - : new Array(openSpans.length).fill(err); - plugin._endSpansWithRedisReplies(openSpans, replies); - } - return Promise.reject(err); - }); - }; - }; - } - _getPatchMultiCommandsAddCommand() { - const plugin = this; - return function addCommandWrapper(original) { - return function addCommandPatch(args) { - return plugin._traceClientCommand(original, this, arguments, args); - }; - }; - } - _getPatchRedisClientMulti() { - return function multiPatchWrapper(original) { - return function multiPatch() { - const multiRes = original.apply(this, arguments); - multiRes[MULTI_COMMAND_OPTIONS] = this.options; - return multiRes; - }; - }; - } - _getPatchRedisClientSendCommand() { - const plugin = this; - return function sendCommandWrapper(original) { - return function sendCommandPatch(args) { - return plugin._traceClientCommand(original, this, arguments, args); - }; - }; - } - _getPatchedClientConnect() { - const plugin = this; - return function connectWrapper(original) { - return function patchedConnect() { - const options = this.options; - const attributes = (0, utils_1.getClientAttributes)(plugin._diag, options); - const span = plugin.tracer.startSpan(`${RedisInstrumentation.COMPONENT}-connect`, { - kind: api_1.SpanKind.CLIENT, - attributes, - }); - const res = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return original.apply(this); - }); - return res - .then((result) => { - span.end(); - return result; - }) - .catch((error) => { - span.recordException(error); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: error.message, - }); - span.end(); - return Promise.reject(error); - }); - }; - }; - } - _traceClientCommand(origFunction, origThis, origArguments, redisCommandArguments) { - const hasNoParentSpan = api_1.trace.getSpan(api_1.context.active()) === undefined; - if (hasNoParentSpan && this.getConfig().requireParentSpan) { - return origFunction.apply(origThis, origArguments); - } - const clientOptions = origThis.options || origThis[MULTI_COMMAND_OPTIONS]; - const commandName = redisCommandArguments[0]; // types also allows it to be a Buffer, but in practice it only string - const commandArgs = redisCommandArguments.slice(1); - const dbStatementSerializer = this.getConfig().dbStatementSerializer || redis_common_1.defaultDbStatementSerializer; - const attributes = (0, utils_1.getClientAttributes)(this._diag, clientOptions); - try { - const dbStatement = dbStatementSerializer(commandName, commandArgs); - if (dbStatement != null) { - attributes[semantic_conventions_1.SEMATTRS_DB_STATEMENT] = dbStatement; - } - } - catch (e) { - this._diag.error('dbStatementSerializer throw an exception', e, { - commandName, - }); - } - const span = this.tracer.startSpan(`${RedisInstrumentation.COMPONENT}-${commandName}`, { - kind: api_1.SpanKind.CLIENT, - attributes, - }); - const res = api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), () => { - return origFunction.apply(origThis, origArguments); - }); - if (typeof (res === null || res === void 0 ? void 0 : res.then) === 'function') { - res.then((redisRes) => { - this._endSpanWithResponse(span, commandName, commandArgs, redisRes, undefined); - }, (err) => { - this._endSpanWithResponse(span, commandName, commandArgs, null, err); - }); - } - else { - const redisClientMultiCommand = res; - redisClientMultiCommand[OTEL_OPEN_SPANS] = - redisClientMultiCommand[OTEL_OPEN_SPANS] || []; - redisClientMultiCommand[OTEL_OPEN_SPANS].push({ - span, - commandName, - commandArgs, - }); - } - return res; - } - _endSpansWithRedisReplies(openSpans, replies) { - if (!openSpans) { - return this._diag.error('cannot find open spans to end for redis multi command'); - } - if (replies.length !== openSpans.length) { - return this._diag.error('number of multi command spans does not match response from redis'); - } - for (let i = 0; i < openSpans.length; i++) { - const { span, commandName, commandArgs } = openSpans[i]; - const currCommandRes = replies[i]; - const [res, err] = currCommandRes instanceof Error - ? [null, currCommandRes] - : [currCommandRes, undefined]; - this._endSpanWithResponse(span, commandName, commandArgs, res, err); - } - } - _endSpanWithResponse(span, commandName, commandArgs, response, error) { - const { responseHook } = this.getConfig(); - if (!error && responseHook) { - try { - responseHook(span, commandName, commandArgs, response); - } - catch (err) { - this._diag.error('responseHook throw an exception', err); - } - } - if (error) { - span.recordException(error); - span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error === null || error === void 0 ? void 0 : error.message }); - } - span.end(); - } -} -exports.RedisInstrumentation = RedisInstrumentation; -RedisInstrumentation.COMPONENT = 'redis'; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 19144: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 81757: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getClientAttributes = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -function getClientAttributes(diag, options) { - var _a, _b; - return { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_REDIS, - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: (_a = options === null || options === void 0 ? void 0 : options.socket) === null || _a === void 0 ? void 0 : _a.host, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: (_b = options === null || options === void 0 ? void 0 : options.socket) === null || _b === void 0 ? void 0 : _b.port, - [semantic_conventions_1.SEMATTRS_DB_CONNECTION_STRING]: removeCredentialsFromDBConnectionStringAttribute(diag, options === null || options === void 0 ? void 0 : options.url), - }; -} -exports.getClientAttributes = getClientAttributes; -/** - * removeCredentialsFromDBConnectionStringAttribute removes basic auth from url and user_pwd from query string - * - * Examples: - * redis://user:pass@localhost:6379/mydb => redis://localhost:6379/mydb - * redis://localhost:6379?db=mydb&user_pwd=pass => redis://localhost:6379?db=mydb - */ -function removeCredentialsFromDBConnectionStringAttribute(diag, url) { - if (typeof url !== 'string' || !url) { - return; - } - try { - const u = new URL(url); - u.searchParams.delete('user_pwd'); - u.username = ''; - u.password = ''; - return u.href; - } - catch (err) { - diag.error('failed to sanitize redis connection url', err); - } - return; -} -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 39279: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.46.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-redis-4'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 70450: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(75850), exports); -__exportStar(__nccwpck_require__(30861), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 75850: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TediousInstrumentation = void 0; -const api = __nccwpck_require__(65163); -const events_1 = __nccwpck_require__(82361); -const instrumentation_1 = __nccwpck_require__(65584); -const semantic_conventions_1 = __nccwpck_require__(67275); -const utils_1 = __nccwpck_require__(60185); -/** @knipignore */ -const version_1 = __nccwpck_require__(39322); -const CURRENT_DATABASE = Symbol('opentelemetry.instrumentation-tedious.current-database'); -const PATCHED_METHODS = [ - 'callProcedure', - 'execSql', - 'execSqlBatch', - 'execBulkLoad', - 'prepare', - 'execute', -]; -function setDatabase(databaseName) { - Object.defineProperty(this, CURRENT_DATABASE, { - value: databaseName, - writable: true, - }); -} -class TediousInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - } - init() { - return [ - new instrumentation_1.InstrumentationNodeModuleDefinition(TediousInstrumentation.COMPONENT, ['>=1.11.0 <20'], (moduleExports) => { - const ConnectionPrototype = moduleExports.Connection.prototype; - for (const method of PATCHED_METHODS) { - if ((0, instrumentation_1.isWrapped)(ConnectionPrototype[method])) { - this._unwrap(ConnectionPrototype, method); - } - this._wrap(ConnectionPrototype, method, this._patchQuery(method)); - } - if ((0, instrumentation_1.isWrapped)(ConnectionPrototype.connect)) { - this._unwrap(ConnectionPrototype, 'connect'); - } - this._wrap(ConnectionPrototype, 'connect', this._patchConnect); - return moduleExports; - }, (moduleExports) => { - if (moduleExports === undefined) - return; - const ConnectionPrototype = moduleExports.Connection.prototype; - for (const method of PATCHED_METHODS) { - this._unwrap(ConnectionPrototype, method); - } - this._unwrap(ConnectionPrototype, 'connect'); - }), - ]; - } - _patchConnect(original) { - return function patchedConnect() { - var _a, _b; - setDatabase.call(this, (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.database); - // remove the listener first in case it's already added - this.removeListener('databaseChange', setDatabase); - this.on('databaseChange', setDatabase); - this.once('end', () => { - this.removeListener('databaseChange', setDatabase); - }); - return original.apply(this, arguments); - }; - } - _patchQuery(operation) { - return (originalMethod) => { - const thisPlugin = this; - function patchedMethod(request) { - var _a, _b, _c, _d, _e, _f, _g, _h; - if (!(request instanceof events_1.EventEmitter)) { - thisPlugin._diag.warn(`Unexpected invocation of patched ${operation} method. Span not recorded`); - return originalMethod.apply(this, arguments); - } - let procCount = 0; - let statementCount = 0; - const incrementStatementCount = () => statementCount++; - const incrementProcCount = () => procCount++; - const databaseName = this[CURRENT_DATABASE]; - const sql = (request => { - var _a, _b; - // Required for <11.0.9 - if (request.sqlTextOrProcedure === 'sp_prepare' && - ((_b = (_a = request.parametersByName) === null || _a === void 0 ? void 0 : _a.stmt) === null || _b === void 0 ? void 0 : _b.value)) { - return request.parametersByName.stmt.value; - } - return request.sqlTextOrProcedure; - })(request); - const span = thisPlugin.tracer.startSpan((0, utils_1.getSpanName)(operation, databaseName, sql, request.table), { - kind: api.SpanKind.CLIENT, - attributes: { - [semantic_conventions_1.SEMATTRS_DB_SYSTEM]: semantic_conventions_1.DBSYSTEMVALUES_MSSQL, - [semantic_conventions_1.SEMATTRS_DB_NAME]: databaseName, - [semantic_conventions_1.SEMATTRS_NET_PEER_PORT]: (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.port, - [semantic_conventions_1.SEMATTRS_NET_PEER_NAME]: (_c = this.config) === null || _c === void 0 ? void 0 : _c.server, - // >=4 uses `authentication` object, older versions just userName and password pair - [semantic_conventions_1.SEMATTRS_DB_USER]: (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.userName) !== null && _e !== void 0 ? _e : (_h = (_g = (_f = this.config) === null || _f === void 0 ? void 0 : _f.authentication) === null || _g === void 0 ? void 0 : _g.options) === null || _h === void 0 ? void 0 : _h.userName, - [semantic_conventions_1.SEMATTRS_DB_STATEMENT]: sql, - [semantic_conventions_1.SEMATTRS_DB_SQL_TABLE]: request.table, - }, - }); - const endSpan = (0, utils_1.once)((err) => { - request.removeListener('done', incrementStatementCount); - request.removeListener('doneInProc', incrementStatementCount); - request.removeListener('doneProc', incrementProcCount); - request.removeListener('error', endSpan); - this.removeListener('end', endSpan); - span.setAttribute('tedious.procedure_count', procCount); - span.setAttribute('tedious.statement_count', statementCount); - if (err) { - span.setStatus({ - code: api.SpanStatusCode.ERROR, - message: err.message, - }); - } - span.end(); - }); - request.on('done', incrementStatementCount); - request.on('doneInProc', incrementStatementCount); - request.on('doneProc', incrementProcCount); - request.once('error', endSpan); - this.on('end', endSpan); - if (typeof request.callback === 'function') { - thisPlugin._wrap(request, 'callback', thisPlugin._patchCallbackQuery(endSpan)); - } - else { - thisPlugin._diag.error('Expected request.callback to be a function'); - } - return api.context.with(api.trace.setSpan(api.context.active(), span), originalMethod, this, ...arguments); - } - Object.defineProperty(patchedMethod, 'length', { - value: originalMethod.length, - writable: false, - }); - return patchedMethod; - }; - } - _patchCallbackQuery(endSpan) { - return (originalCallback) => { - return function (err, rowCount, rows) { - endSpan(err); - return originalCallback.apply(this, arguments); - }; - }; - } -} -exports.TediousInstrumentation = TediousInstrumentation; -TediousInstrumentation.COMPONENT = 'tedious'; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 30861: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 60185: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.once = exports.getSpanName = void 0; -/** - * The span name SHOULD be set to a low cardinality value - * representing the statement executed on the database. - * - * @returns Operation executed on Tedious Connection. Does not map to SQL statement in any way. - */ -function getSpanName(operation, db, sql, bulkLoadTable) { - if (operation === 'execBulkLoad' && bulkLoadTable && db) { - return `${operation} ${bulkLoadTable} ${db}`; - } - if (operation === 'callProcedure') { - // `sql` refers to procedure name with `callProcedure` - if (db) { - return `${operation} ${sql} ${db}`; - } - return `${operation} ${sql}`; - } - // do not use `sql` in general case because of high-cardinality - if (db) { - return `${operation} ${db}`; - } - return `${operation}`; -} -exports.getSpanName = getSpanName; -const once = (fn) => { - let called = false; - return (...args) => { - if (called) - return; - called = true; - return fn(...args); - }; -}; -exports.once = once; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 39322: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.18.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-tedious'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 21353: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SemanticAttributes = void 0; -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -exports.SemanticAttributes = { - /** - * State of the HTTP connection in the HTTP connection pool. - */ - HTTP_CONNECTION_STATE: 'http.connection.state', - /** - * Describes a class of error the operation ended with. - * - * Note: The `error.type` SHOULD be predictable and SHOULD have low cardinality. - Instrumentations SHOULD document the list of errors they report. - - The cardinality of `error.type` within one instrumentation library SHOULD be low. - Telemetry consumers that aggregate data from multiple instrumentation libraries and applications - should be prepared for `error.type` to have high cardinality at query time when no - additional filters are applied. - - If the operation has completed successfully, instrumentations SHOULD NOT set `error.type`. - - If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), - it's RECOMMENDED to: - - * Use a domain-specific attribute - * Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not. - */ - ERROR_TYPE: 'error.type', - /** - * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - */ - HTTP_REQUEST_BODY_SIZE: 'http.request.body.size', - /** - * HTTP request method. - * - * Note: HTTP request method value SHOULD be "known" to the instrumentation. - By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) - and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - - If the HTTP request method is not known to instrumentation, it MUST set the `http.request.method` attribute to `_OTHER`. - - If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it MUST provide a way to override - the list of known HTTP methods. If this override is done via environment variable, then the environment variable MUST be named - OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods - (this list MUST be a full override of the default known method, it is not a list of known methods in addition to the defaults). - - HTTP method names are case-sensitive and `http.request.method` attribute value MUST match a known HTTP method name exactly. - Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, SHOULD populate a canonical equivalent. - Tracing instrumentations that do so, MUST also set `http.request.method_original` to the original value. - */ - HTTP_REQUEST_METHOD: 'http.request.method', - /** - * Original HTTP method sent by the client in the request line. - */ - HTTP_REQUEST_METHOD_ORIGINAL: 'http.request.method_original', - /** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - * Note: The resend count SHOULD be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other). - */ - HTTP_REQUEST_RESEND_COUNT: 'http.request.resend_count', - /** - * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) header. For requests using transport encoding, this should be the compressed size. - */ - HTTP_RESPONSE_BODY_SIZE: 'http.response.body.size', - /** - * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - */ - HTTP_RESPONSE_STATUS_CODE: 'http.response.status_code', - /** - * The matched route, that is, the path template in the format used by the respective server framework. - * - * Note: MUST NOT be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. - SHOULD include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. - */ - HTTP_ROUTE: 'http.route', - /** - * Peer address of the network connection - IP address or Unix domain socket name. - */ - NETWORK_PEER_ADDRESS: 'network.peer.address', - /** - * Peer port number of the network connection. - */ - NETWORK_PEER_PORT: 'network.peer.port', - /** - * [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. - * - * Note: The value SHOULD be normalized to lowercase. - */ - NETWORK_PROTOCOL_NAME: 'network.protocol.name', - /** - * Version of the protocol specified in `network.protocol.name`. - * - * Note: `network.protocol.version` refers to the version of the protocol used and might be different from the protocol client's version. If the HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, this attribute should be set to `1.1`. - */ - NETWORK_PROTOCOL_VERSION: 'network.protocol.version', - /** - * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. - * - * Note: When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available. - */ - SERVER_ADDRESS: 'server.address', - /** - * Server port number. - * - * Note: When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available. - */ - SERVER_PORT: 'server.port', - /** - * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986). - * - * Note: For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless. - `url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`. - `url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed) and SHOULD NOT be validated or modified except for sanitizing purposes. - */ - URL_FULL: 'url.full', - /** - * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component. - */ - URL_PATH: 'url.path', - /** - * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component. - * - * Note: Sensitive content provided in query string SHOULD be scrubbed when instrumentations can identify it. - */ - URL_QUERY: 'url.query', - /** - * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol. - */ - URL_SCHEME: 'url.scheme', - /** - * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client. - */ - USER_AGENT_ORIGINAL: 'user_agent.original', -}; -//# sourceMappingURL=SemanticAttributes.js.map - -/***/ }), - -/***/ 8076: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(3345), exports); -__exportStar(__nccwpck_require__(29450), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 29450: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 3345: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.UndiciInstrumentation = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const diagch = __nccwpck_require__(67643); -const url_1 = __nccwpck_require__(57310); -const instrumentation_1 = __nccwpck_require__(65584); -const api_1 = __nccwpck_require__(65163); -/** @knipignore */ -const version_1 = __nccwpck_require__(85978); -const SemanticAttributes_1 = __nccwpck_require__(21353); -const core_1 = __nccwpck_require__(89736); -// A combination of https://github.com/elastic/apm-agent-nodejs and -// https://github.com/gadget-inc/opentelemetry-instrumentations/blob/main/packages/opentelemetry-instrumentation-undici/src/index.ts -class UndiciInstrumentation extends instrumentation_1.InstrumentationBase { - constructor(config = {}) { - super(version_1.PACKAGE_NAME, version_1.PACKAGE_VERSION, config); - this._recordFromReq = new WeakMap(); - } - // No need to instrument files/modules - init() { - return undefined; - } - disable() { - super.disable(); - this._channelSubs.forEach(sub => sub.unsubscribe()); - this._channelSubs.length = 0; - } - enable() { - // "enabled" handling is currently a bit messy with InstrumentationBase. - // If constructed with `{enabled: false}`, this `.enable()` is still called, - // and `this.getConfig().enabled !== this.isEnabled()`, creating confusion. - // - // For now, this class will setup for instrumenting if `.enable()` is - // called, but use `this.getConfig().enabled` to determine if - // instrumentation should be generated. This covers the more likely common - // case of config being given a construction time, rather than later via - // `instance.enable()`, `.disable()`, or `.setConfig()` calls. - super.enable(); - // This method is called by the super-class constructor before ours is - // called. So we need to ensure the property is initalized. - this._channelSubs = this._channelSubs || []; - // Avoid to duplicate subscriptions - if (this._channelSubs.length > 0) { - return; - } - this.subscribeToChannel('undici:request:create', this.onRequestCreated.bind(this)); - this.subscribeToChannel('undici:client:sendHeaders', this.onRequestHeaders.bind(this)); - this.subscribeToChannel('undici:request:headers', this.onResponseHeaders.bind(this)); - this.subscribeToChannel('undici:request:trailers', this.onDone.bind(this)); - this.subscribeToChannel('undici:request:error', this.onError.bind(this)); - } - _updateMetricInstruments() { - this._httpClientDurationHistogram = this.meter.createHistogram('http.client.request.duration', { - description: 'Measures the duration of outbound HTTP requests.', - unit: 's', - valueType: api_1.ValueType.DOUBLE, - advice: { - explicitBucketBoundaries: [ - 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, - 7.5, 10, - ], - }, - }); - } - subscribeToChannel(diagnosticChannel, onMessage) { - var _a; - // `diagnostics_channel` had a ref counting bug until v18.19.0. - // https://github.com/nodejs/node/pull/47520 - const [major, minor] = process.version - .replace('v', '') - .split('.') - .map(n => Number(n)); - const useNewSubscribe = major > 18 || (major === 18 && minor >= 19); - let unsubscribe; - if (useNewSubscribe) { - (_a = diagch.subscribe) === null || _a === void 0 ? void 0 : _a.call(diagch, diagnosticChannel, onMessage); - unsubscribe = () => { var _a; return (_a = diagch.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(diagch, diagnosticChannel, onMessage); }; - } - else { - const channel = diagch.channel(diagnosticChannel); - channel.subscribe(onMessage); - unsubscribe = () => channel.unsubscribe(onMessage); - } - this._channelSubs.push({ - name: diagnosticChannel, - unsubscribe, - }); - } - // This is the 1st message we receive for each request (fired after request creation). Here we will - // create the span and populate some atttributes, then link the span to the request for further - // span processing - onRequestCreated({ request }) { - // Ignore if: - // - instrumentation is disabled - // - ignored by config - // - method is 'CONNECT' - const config = this.getConfig(); - const enabled = config.enabled !== false; - const shouldIgnoreReq = (0, instrumentation_1.safeExecuteInTheMiddle)(() => { - var _a; - return !enabled || - request.method === 'CONNECT' || - ((_a = config.ignoreRequestHook) === null || _a === void 0 ? void 0 : _a.call(config, request)); - }, e => e && this._diag.error('caught ignoreRequestHook error: ', e), true); - if (shouldIgnoreReq) { - return; - } - const startTime = (0, core_1.hrTime)(); - let requestUrl; - try { - requestUrl = new url_1.URL(request.path, request.origin); - } - catch (err) { - this._diag.warn('could not determine url.full:', err); - // Skip instrumenting this request. - return; - } - const urlScheme = requestUrl.protocol.replace(':', ''); - const requestMethod = this.getRequestMethod(request.method); - const attributes = { - [SemanticAttributes_1.SemanticAttributes.HTTP_REQUEST_METHOD]: requestMethod, - [SemanticAttributes_1.SemanticAttributes.HTTP_REQUEST_METHOD_ORIGINAL]: request.method, - [SemanticAttributes_1.SemanticAttributes.URL_FULL]: requestUrl.toString(), - [SemanticAttributes_1.SemanticAttributes.URL_PATH]: requestUrl.pathname, - [SemanticAttributes_1.SemanticAttributes.URL_QUERY]: requestUrl.search, - [SemanticAttributes_1.SemanticAttributes.URL_SCHEME]: urlScheme, - }; - const schemePorts = { https: '443', http: '80' }; - const serverAddress = requestUrl.hostname; - const serverPort = requestUrl.port || schemePorts[urlScheme]; - attributes[SemanticAttributes_1.SemanticAttributes.SERVER_ADDRESS] = serverAddress; - if (serverPort && !isNaN(Number(serverPort))) { - attributes[SemanticAttributes_1.SemanticAttributes.SERVER_PORT] = Number(serverPort); - } - // Get user agent from headers - let userAgent; - if (Array.isArray(request.headers)) { - const idx = request.headers.findIndex(h => h.toLowerCase() === 'user-agent'); - if (idx >= 0) { - userAgent = request.headers[idx + 1]; - } - } - else if (typeof request.headers === 'string') { - const headers = request.headers.split('\r\n'); - const uaHeader = headers.find(h => h.toLowerCase().startsWith('user-agent')); - userAgent = - uaHeader && uaHeader.substring(uaHeader.indexOf(':') + 1).trim(); - } - if (userAgent) { - attributes[SemanticAttributes_1.SemanticAttributes.USER_AGENT_ORIGINAL] = userAgent; - } - // Get attributes from the hook if present - const hookAttributes = (0, instrumentation_1.safeExecuteInTheMiddle)(() => { var _a; return (_a = config.startSpanHook) === null || _a === void 0 ? void 0 : _a.call(config, request); }, e => e && this._diag.error('caught startSpanHook error: ', e), true); - if (hookAttributes) { - Object.entries(hookAttributes).forEach(([key, val]) => { - attributes[key] = val; - }); - } - // Check if parent span is required via config and: - // - if a parent is required but not present, we use a `NoopSpan` to still - // propagate context without recording it. - // - create a span otherwise - const activeCtx = api_1.context.active(); - const currentSpan = api_1.trace.getSpan(activeCtx); - let span; - if (config.requireParentforSpans && - (!currentSpan || !api_1.trace.isSpanContextValid(currentSpan.spanContext()))) { - span = api_1.trace.wrapSpanContext(api_1.INVALID_SPAN_CONTEXT); - } - else { - span = this.tracer.startSpan(requestMethod === '_OTHER' ? 'HTTP' : requestMethod, { - kind: api_1.SpanKind.CLIENT, - attributes: attributes, - }, activeCtx); - } - // Execute the request hook if defined - (0, instrumentation_1.safeExecuteInTheMiddle)(() => { var _a; return (_a = config.requestHook) === null || _a === void 0 ? void 0 : _a.call(config, span, request); }, e => e && this._diag.error('caught requestHook error: ', e), true); - // Context propagation goes last so no hook can tamper - // the propagation headers - const requestContext = api_1.trace.setSpan(api_1.context.active(), span); - const addedHeaders = {}; - api_1.propagation.inject(requestContext, addedHeaders); - const headerEntries = Object.entries(addedHeaders); - for (let i = 0; i < headerEntries.length; i++) { - const [k, v] = headerEntries[i]; - if (typeof request.addHeader === 'function') { - request.addHeader(k, v); - } - else if (typeof request.headers === 'string') { - request.headers += `${k}: ${v}\r\n`; - } - else if (Array.isArray(request.headers)) { - // undici@6.11.0 accidentally, briefly removed `request.addHeader()`. - request.headers.push(k, v); - } - } - this._recordFromReq.set(request, { span, attributes, startTime }); - } - // This is the 2nd message we receive for each request. It is fired when connection with - // the remote is established and about to send the first byte. Here we do have info about the - // remote address and port so we can populate some `network.*` attributes into the span - onRequestHeaders({ request, socket }) { - var _a; - const record = this._recordFromReq.get(request); - if (!record) { - return; - } - const config = this.getConfig(); - const { span } = record; - const { remoteAddress, remotePort } = socket; - const spanAttributes = { - [SemanticAttributes_1.SemanticAttributes.NETWORK_PEER_ADDRESS]: remoteAddress, - [SemanticAttributes_1.SemanticAttributes.NETWORK_PEER_PORT]: remotePort, - }; - // After hooks have been processed (which may modify request headers) - // we can collect the headers based on the configuration - if ((_a = config.headersToSpanAttributes) === null || _a === void 0 ? void 0 : _a.requestHeaders) { - const headersToAttribs = new Set(config.headersToSpanAttributes.requestHeaders.map(n => n.toLowerCase())); - // headers could be in form - // ['name: value', ...] for v5 - // ['name', 'value', ...] for v6 - const rawHeaders = Array.isArray(request.headers) - ? request.headers - : request.headers.split('\r\n'); - rawHeaders.forEach((h, idx) => { - const sepIndex = h.indexOf(':'); - const hasSeparator = sepIndex !== -1; - const name = (hasSeparator ? h.substring(0, sepIndex) : h).toLowerCase(); - const value = hasSeparator - ? h.substring(sepIndex + 1) - : rawHeaders[idx + 1]; - if (headersToAttribs.has(name)) { - spanAttributes[`http.request.header.${name}`] = value.trim(); - } - }); - } - span.setAttributes(spanAttributes); - } - // This is the 3rd message we get for each request and it's fired when the server - // headers are received, body may not be accessible yet. - // From the response headers we can set the status and content length - onResponseHeaders({ request, response, }) { - var _a, _b; - const record = this._recordFromReq.get(request); - if (!record) { - return; - } - const { span, attributes } = record; - const spanAttributes = { - [SemanticAttributes_1.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE]: response.statusCode, - }; - const config = this.getConfig(); - // Execute the response hook if defined - (0, instrumentation_1.safeExecuteInTheMiddle)(() => { var _a; return (_a = config.responseHook) === null || _a === void 0 ? void 0 : _a.call(config, span, { request, response }); }, e => e && this._diag.error('caught responseHook error: ', e), true); - const headersToAttribs = new Set(); - if ((_a = config.headersToSpanAttributes) === null || _a === void 0 ? void 0 : _a.responseHeaders) { - (_b = config.headersToSpanAttributes) === null || _b === void 0 ? void 0 : _b.responseHeaders.forEach(name => headersToAttribs.add(name.toLowerCase())); - } - for (let idx = 0; idx < response.headers.length; idx = idx + 2) { - const name = response.headers[idx].toString().toLowerCase(); - const value = response.headers[idx + 1]; - if (headersToAttribs.has(name)) { - spanAttributes[`http.response.header.${name}`] = value.toString(); - } - if (name === 'content-length') { - const contentLength = Number(value.toString()); - if (!isNaN(contentLength)) { - spanAttributes['http.response.header.content-length'] = contentLength; - } - } - } - span.setAttributes(spanAttributes); - span.setStatus({ - code: response.statusCode >= 400 - ? api_1.SpanStatusCode.ERROR - : api_1.SpanStatusCode.UNSET, - }); - record.attributes = Object.assign(attributes, spanAttributes); - } - // This is the last event we receive if the request went without any errors - onDone({ request }) { - const record = this._recordFromReq.get(request); - if (!record) { - return; - } - const { span, attributes, startTime } = record; - // End the span - span.end(); - this._recordFromReq.delete(request); - // Record metrics - this.recordRequestDuration(attributes, startTime); - } - // This is the event we get when something is wrong in the request like - // - invalid options when calling `fetch` global API or any undici method for request - // - connectivity errors such as unreachable host - // - requests aborted through an `AbortController.signal` - // NOTE: server errors are considered valid responses and it's the lib consumer - // who should deal with that. - onError({ request, error }) { - const record = this._recordFromReq.get(request); - if (!record) { - return; - } - const { span, attributes, startTime } = record; - // NOTE: in `undici@6.3.0` when request aborted the error type changes from - // a custom error (`RequestAbortedError`) to a built-in `DOMException` carrying - // some differences: - // - `code` is from DOMEXception (ABORT_ERR: 20) - // - `message` changes - // - stacktrace is smaller and contains node internal frames - span.recordException(error); - span.setStatus({ - code: api_1.SpanStatusCode.ERROR, - message: error.message, - }); - span.end(); - this._recordFromReq.delete(request); - // Record metrics (with the error) - attributes[SemanticAttributes_1.SemanticAttributes.ERROR_TYPE] = error.message; - this.recordRequestDuration(attributes, startTime); - } - recordRequestDuration(attributes, startTime) { - // Time to record metrics - const metricsAttributes = {}; - // Get the attribs already in span attributes - const keysToCopy = [ - SemanticAttributes_1.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, - SemanticAttributes_1.SemanticAttributes.HTTP_REQUEST_METHOD, - SemanticAttributes_1.SemanticAttributes.SERVER_ADDRESS, - SemanticAttributes_1.SemanticAttributes.SERVER_PORT, - SemanticAttributes_1.SemanticAttributes.URL_SCHEME, - SemanticAttributes_1.SemanticAttributes.ERROR_TYPE, - ]; - keysToCopy.forEach(key => { - if (key in attributes) { - metricsAttributes[key] = attributes[key]; - } - }); - // Take the duration and record it - const durationSeconds = (0, core_1.hrTimeToMilliseconds)((0, core_1.hrTimeDuration)(startTime, (0, core_1.hrTime)())) / 1000; - this._httpClientDurationHistogram.record(durationSeconds, metricsAttributes); - } - getRequestMethod(original) { - const knownMethods = { - CONNECT: true, - OPTIONS: true, - HEAD: true, - GET: true, - POST: true, - PUT: true, - PATCH: true, - DELETE: true, - TRACE: true, - }; - if (original.toUpperCase() in knownMethods) { - return original.toUpperCase(); - } - return '_OTHER'; - } -} -exports.UndiciInstrumentation = UndiciInstrumentation; -//# sourceMappingURL=undici.js.map - -/***/ }), - -/***/ 85978: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PACKAGE_NAME = exports.PACKAGE_VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.PACKAGE_VERSION = '0.10.0'; -exports.PACKAGE_NAME = '@opentelemetry/instrumentation-undici'; +exports.VERSION = '2.10.0'; //# sourceMappingURL=version.js.map /***/ }), @@ -39795,18 +8085,7 @@ exports.PACKAGE_NAME = '@opentelemetry/instrumentation-undici'; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.registerInstrumentations = void 0; @@ -39820,11 +8099,10 @@ const autoLoaderUtils_1 = __nccwpck_require__(16307); * registered */ function registerInstrumentations(options) { - var _a, _b; const tracerProvider = options.tracerProvider || api_1.trace.getTracerProvider(); const meterProvider = options.meterProvider || api_1.metrics.getMeterProvider(); const loggerProvider = options.loggerProvider || api_logs_1.logs.getLoggerProvider(); - const instrumentations = (_b = (_a = options.instrumentations) === null || _a === void 0 ? void 0 : _a.flat()) !== null && _b !== void 0 ? _b : []; + const instrumentations = options.instrumentations?.flat() ?? []; (0, autoLoaderUtils_1.enableInstrumentations)(instrumentations, tracerProvider, meterProvider, loggerProvider); return () => { (0, autoLoaderUtils_1.disableInstrumentations)(instrumentations); @@ -39842,18 +8120,7 @@ exports.registerInstrumentations = registerInstrumentations; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.disableInstrumentations = exports.enableInstrumentations = void 0; @@ -39904,21 +8171,10 @@ exports.disableInstrumentations = disableInstrumentations; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = exports.isWrapped = exports.InstrumentationNodeModuleFile = exports.InstrumentationNodeModuleDefinition = exports.InstrumentationBase = exports.registerInstrumentations = void 0; +exports.semconvStabilityFromStr = exports.SemconvStability = exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = exports.isWrapped = exports.InstrumentationNodeModuleFile = exports.InstrumentationNodeModuleDefinition = exports.InstrumentationBase = exports.registerInstrumentations = void 0; var autoLoader_1 = __nccwpck_require__(7507); Object.defineProperty(exports, "registerInstrumentations", ({ enumerable: true, get: function () { return autoLoader_1.registerInstrumentations; } })); var index_1 = __nccwpck_require__(20997); @@ -39931,6 +8187,9 @@ var utils_1 = __nccwpck_require__(93806); Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return utils_1.isWrapped; } })); Object.defineProperty(exports, "safeExecuteInTheMiddle", ({ enumerable: true, get: function () { return utils_1.safeExecuteInTheMiddle; } })); Object.defineProperty(exports, "safeExecuteInTheMiddleAsync", ({ enumerable: true, get: function () { return utils_1.safeExecuteInTheMiddleAsync; } })); +var semconvStability_1 = __nccwpck_require__(86129); +Object.defineProperty(exports, "SemconvStability", ({ enumerable: true, get: function () { return semconvStability_1.SemconvStability; } })); +Object.defineProperty(exports, "semconvStabilityFromStr", ({ enumerable: true, get: function () { return semconvStability_1.semconvStabilityFromStr; } })); //# sourceMappingURL=index.js.map /***/ }), @@ -39942,40 +8201,27 @@ Object.defineProperty(exports, "safeExecuteInTheMiddleAsync", ({ enumerable: tru /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.InstrumentationAbstract = void 0; const api_1 = __nccwpck_require__(65163); const api_logs_1 = __nccwpck_require__(32832); -const shimmer = __nccwpck_require__(16672); +const shimmer = __nccwpck_require__(34337); /** * Base abstract internal class for instrumenting node and web plugins */ class InstrumentationAbstract { + _config = {}; + _tracer; + _meter; + _logger; + _diag; + instrumentationName; + instrumentationVersion; constructor(instrumentationName, instrumentationVersion, config) { this.instrumentationName = instrumentationName; this.instrumentationVersion = instrumentationVersion; - this._config = {}; - /* Api to wrap instrumented method */ - this._wrap = shimmer.wrap; - /* Api to unwrap instrumented methods */ - this._unwrap = shimmer.unwrap; - /* Api to mass wrap instrumented method */ - this._massWrap = shimmer.massWrap; - /* Api to mass unwrap instrumented methods */ - this._massUnwrap = shimmer.massUnwrap; this.setConfig(config); this._diag = api_1.diag.createComponentLogger({ namespace: instrumentationName, @@ -39985,6 +8231,14 @@ class InstrumentationAbstract { this._logger = api_logs_1.logs.getLogger(instrumentationName, instrumentationVersion); this._updateMetricInstruments(); } + /* Api to wrap instrumented method */ + _wrap = shimmer.wrap; + /* Api to unwrap instrumented methods */ + _unwrap = shimmer.unwrap; + /* Api to mass wrap instrumented method */ + _massWrap = shimmer.massWrap; + /* Api to mass unwrap instrumented methods */ + _massUnwrap = shimmer.massUnwrap; /* Returns meter */ get meter() { return this._meter; @@ -40017,8 +8271,7 @@ class InstrumentationAbstract { * @returns an array of {@link InstrumentationModuleDefinition} */ getModuleDefinitions() { - var _a; - const initResult = (_a = this.init()) !== null && _a !== void 0 ? _a : []; + const initResult = this.init() ?? []; if (!Array.isArray(initResult)) { return [initResult]; } @@ -40041,10 +8294,13 @@ class InstrumentationAbstract { setConfig(config) { // copy config first level properties to ensure they are immutable. // nested properties are not copied, thus are mutable from the outside. - this._config = Object.assign({ enabled: true }, config); + this._config = { + enabled: true, + ...config, + }; } /** - * Sets TraceProvider to this plugin + * Sets TracerProvider to this plugin * @param tracerProvider */ setTracerProvider(tracerProvider) { @@ -40070,7 +8326,7 @@ class InstrumentationAbstract { hookHandler(span, info); } catch (e) { - this._diag.error(`Error running span customization hook due to exception in handler`, { triggerName }, e); + this._diag.error('Error running span customization hook due to exception in handler', { triggerName }, e); } } } @@ -40086,32 +8342,26 @@ exports.InstrumentationAbstract = InstrumentationAbstract; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.InstrumentationNodeModuleDefinition = void 0; class InstrumentationNodeModuleDefinition { + files; + name; + supportedVersions; + patch; + unpatch; constructor(name, supportedVersions, // eslint-disable-next-line @typescript-eslint/no-explicit-any patch, // eslint-disable-next-line @typescript-eslint/no-explicit-any unpatch, files) { + this.files = files || []; this.name = name; this.supportedVersions = supportedVersions; this.patch = patch; this.unpatch = unpatch; - this.files = files || []; } } exports.InstrumentationNodeModuleDefinition = InstrumentationNodeModuleDefinition; @@ -40126,32 +8376,25 @@ exports.InstrumentationNodeModuleDefinition = InstrumentationNodeModuleDefinitio /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.InstrumentationNodeModuleFile = void 0; const index_1 = __nccwpck_require__(20997); class InstrumentationNodeModuleFile { + name; + supportedVersions; + patch; + unpatch; constructor(name, supportedVersions, // eslint-disable-next-line @typescript-eslint/no-explicit-any patch, // eslint-disable-next-line @typescript-eslint/no-explicit-any unpatch) { + this.name = (0, index_1.normalize)(name); this.supportedVersions = supportedVersions; this.patch = patch; this.unpatch = unpatch; - this.name = (0, index_1.normalize)(name); } } exports.InstrumentationNodeModuleFile = InstrumentationNodeModuleFile; @@ -40166,18 +8409,7 @@ exports.InstrumentationNodeModuleFile = InstrumentationNodeModuleFile; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.normalize = exports.InstrumentationBase = void 0; @@ -40195,18 +8427,7 @@ Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function ( /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ModuleNameTrie = exports.ModuleNameSeparator = void 0; @@ -40215,19 +8436,15 @@ exports.ModuleNameSeparator = '/'; * Node in a `ModuleNameTrie` */ class ModuleNameTrieNode { - constructor() { - this.hooks = []; - this.children = new Map(); - } + hooks = []; + children = new Map(); } /** * Trie containing nodes that represent a part of a module name (i.e. the parts separated by forward slash) */ class ModuleNameTrie { - constructor() { - this._trie = new ModuleNameTrieNode(); - this._counter = 0; - } + _trie = new ModuleNameTrieNode(); + _counter = 0; /** * Insert a module hook into the trie * @@ -40295,18 +8512,7 @@ exports.ModuleNameTrie = ModuleNameTrie; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RequireInTheMiddleSingleton = void 0; @@ -40340,8 +8546,9 @@ const isMocha = [ * on the performance of instrumentation hooks being applied. */ class RequireInTheMiddleSingleton { + _moduleNameTrie = new ModuleNameTrie_1.ModuleNameTrie(); + static _instance; constructor() { - this._moduleNameTrie = new ModuleNameTrie_1.ModuleNameTrie(); this._initialize(); } _initialize() { @@ -40381,13 +8588,12 @@ class RequireInTheMiddleSingleton { * @returns {RequireInTheMiddleSingleton} Singleton of `RequireInTheMiddleSingleton` */ static getInstance() { - var _a; // Mocha runs all test suites in the same process // This prevents test suites from sharing a singleton if (isMocha) return new RequireInTheMiddleSingleton(); return (this._instance = - (_a = this._instance) !== null && _a !== void 0 ? _a : new RequireInTheMiddleSingleton()); + this._instance ?? new RequireInTheMiddleSingleton()); } } exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton; @@ -40415,18 +8621,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.normalize = exports.InstrumentationBase = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 instrumentation_1 = __nccwpck_require__(93608); Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return instrumentation_1.InstrumentationBase; } })); @@ -40443,25 +8638,14 @@ Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function ( /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.InstrumentationBase = void 0; const path = __nccwpck_require__(71017); const util_1 = __nccwpck_require__(73837); -const semver_1 = __nccwpck_require__(63547); -const shimmer_1 = __nccwpck_require__(16672); +const semver_1 = __nccwpck_require__(86887); +const shimmer_1 = __nccwpck_require__(34337); const instrumentation_1 = __nccwpck_require__(9216); const RequireInTheMiddleSingleton_1 = __nccwpck_require__(77404); const import_in_the_middle_1 = __nccwpck_require__(36151); @@ -40473,72 +8657,12 @@ const utils_1 = __nccwpck_require__(93806); * Base abstract class for instrumenting node plugins */ class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { + _modules; + _hooks = []; + _requireInTheMiddleSingleton = RequireInTheMiddleSingleton_1.RequireInTheMiddleSingleton.getInstance(); + _enabled = false; constructor(instrumentationName, instrumentationVersion, config) { super(instrumentationName, instrumentationVersion, config); - this._hooks = []; - this._requireInTheMiddleSingleton = RequireInTheMiddleSingleton_1.RequireInTheMiddleSingleton.getInstance(); - this._enabled = false; - this._wrap = (moduleExports, name, wrapper) => { - if ((0, utils_1.isWrapped)(moduleExports[name])) { - this._unwrap(moduleExports, name); - } - if (!util_1.types.isProxy(moduleExports)) { - return (0, shimmer_1.wrap)(moduleExports, name, wrapper); - } - else { - const wrapped = (0, shimmer_1.wrap)(Object.assign({}, moduleExports), name, wrapper); - Object.defineProperty(moduleExports, name, { - value: wrapped, - }); - return wrapped; - } - }; - this._unwrap = (moduleExports, name) => { - if (!util_1.types.isProxy(moduleExports)) { - return (0, shimmer_1.unwrap)(moduleExports, name); - } - else { - return Object.defineProperty(moduleExports, name, { - value: moduleExports[name], - }); - } - }; - this._massWrap = (moduleExportsArray, names, wrapper) => { - if (!moduleExportsArray) { - api_1.diag.error('must provide one or more modules to patch'); - return; - } - else if (!Array.isArray(moduleExportsArray)) { - moduleExportsArray = [moduleExportsArray]; - } - if (!(names && Array.isArray(names))) { - api_1.diag.error('must provide one or more functions to wrap on modules'); - return; - } - moduleExportsArray.forEach(moduleExports => { - names.forEach(name => { - this._wrap(moduleExports, name, wrapper); - }); - }); - }; - this._massUnwrap = (moduleExportsArray, names) => { - if (!moduleExportsArray) { - api_1.diag.error('must provide one or more modules to patch'); - return; - } - else if (!Array.isArray(moduleExportsArray)) { - moduleExportsArray = [moduleExportsArray]; - } - if (!(names && Array.isArray(names))) { - api_1.diag.error('must provide one or more functions to wrap on modules'); - return; - } - moduleExportsArray.forEach(moduleExports => { - names.forEach(name => { - this._unwrap(moduleExports, name); - }); - }); - }; let modules = this.init(); if (modules && !Array.isArray(modules)) { modules = [modules]; @@ -40548,17 +8672,82 @@ class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { this.enable(); } } + _wrap = (moduleExports, name, wrapper) => { + if ((0, utils_1.isWrapped)(moduleExports[name])) { + this._unwrap(moduleExports, name); + } + if (!util_1.types.isProxy(moduleExports)) { + return (0, shimmer_1.wrap)(moduleExports, name, wrapper); + } + else { + const wrapped = (0, shimmer_1.wrap)(Object.assign({}, moduleExports), name, wrapper); + Object.defineProperty(moduleExports, name, { + value: wrapped, + }); + return wrapped; + } + }; + _unwrap = (moduleExports, name) => { + if (!util_1.types.isProxy(moduleExports)) { + return (0, shimmer_1.unwrap)(moduleExports, name); + } + else { + return Object.defineProperty(moduleExports, name, { + value: moduleExports[name], + }); + } + }; + _massWrap = (moduleExportsArray, names, wrapper) => { + if (!moduleExportsArray) { + api_1.diag.error('must provide one or more modules to patch'); + return; + } + else if (!Array.isArray(moduleExportsArray)) { + moduleExportsArray = [moduleExportsArray]; + } + if (!(names && Array.isArray(names))) { + api_1.diag.error('must provide one or more functions to wrap on modules'); + return; + } + moduleExportsArray.forEach(moduleExports => { + names.forEach(name => { + this._wrap(moduleExports, name, wrapper); + }); + }); + }; + _massUnwrap = (moduleExportsArray, names) => { + if (!moduleExportsArray) { + api_1.diag.error('must provide one or more modules to patch'); + return; + } + else if (!Array.isArray(moduleExportsArray)) { + moduleExportsArray = [moduleExportsArray]; + } + if (!(names && Array.isArray(names))) { + api_1.diag.error('must provide one or more functions to wrap on modules'); + return; + } + moduleExportsArray.forEach(moduleExports => { + names.forEach(name => { + this._unwrap(moduleExports, name); + }); + }); + }; _warnOnPreloadedModules() { + // Access require via globalThis to prevent webpack from analyzing it as a dependency expression + const nodeRequire = globalThis.require; + if (!nodeRequire?.resolve || !nodeRequire?.cache) + return; this._modules.forEach((module) => { const { name } = module; try { - const resolvedModule = require.resolve(name); - if (require.cache[resolvedModule]) { + const resolvedModule = nodeRequire.resolve(name); + if (nodeRequire.cache[resolvedModule]?.loaded) { // Module is already cached, which means the instrumentation hook might not work this._diag.warn(`Module ${name} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${name}`); } } - catch (_a) { + catch { // Module isn't available, we can simply skip } }); @@ -40571,13 +8760,12 @@ class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { const version = JSON.parse(json).version; return typeof version === 'string' ? version : undefined; } - catch (error) { + catch { api_1.diag.warn('Failed extracting version', baseDir); } return undefined; } _onRequire(module, exports, name, baseDir) { - var _a; if (!baseDir) { if (typeof module.patch === 'function') { module.moduleExports = exports; @@ -40610,11 +8798,10 @@ class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { return exports; } // internal file - const files = (_a = module.files) !== null && _a !== void 0 ? _a : []; + const files = module.files ?? []; const normalizedName = path.normalize(name); - const supportedFileInstrumentations = files - .filter(f => f.name === normalizedName) - .filter(f => isSupported(f.supportedVersions, version, module.includePrerelease)); + const supportedFileInstrumentations = files.filter(f => f.name === normalizedName && + isSupported(f.supportedVersions, version, module.includePrerelease)); return supportedFileInstrumentations.reduce((patchedExports, file) => { file.moduleExports = patchedExports; if (this._enabled) { @@ -40662,6 +8849,9 @@ class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { for (const module of this._modules) { const hookFn = (exports, name, baseDir) => { if (!baseDir && path.isAbsolute(name)) { + // Change IITM `name` and `baseDir` values to match what RITM returns. + // See "Comparing to RITM" on https://github.com/nodejs/import-in-the-middle/pull/241 + // for an example of the differences. const parsedPath = path.parse(name); name = parsedPath.name; baseDir = parsedPath.dir; @@ -40678,7 +8868,7 @@ class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { ? new require_in_the_middle_1.Hook([module.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module.name, onRequire); this._hooks.push(hook); - const esmHook = new import_in_the_middle_1.Hook([module.name], { internals: false }, hookFn); + const esmHook = new import_in_the_middle_1.Hook([module.name], { internals: true }, hookFn); this._hooks.push(esmHook); } } @@ -40732,18 +8922,7 @@ function isSupported(supportedVersions, version, includePrerelease) { /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.normalize = void 0; @@ -40753,6 +8932,740 @@ Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function ( /***/ }), +/***/ 86129: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.semconvStabilityFromStr = exports.SemconvStability = void 0; +var SemconvStability; +(function (SemconvStability) { + /** Emit only stable semantic conventions. */ + SemconvStability[SemconvStability["STABLE"] = 1] = "STABLE"; + /** Emit only old semantic conventions. */ + SemconvStability[SemconvStability["OLD"] = 2] = "OLD"; + /** Emit both stable and old semantic conventions. */ + SemconvStability[SemconvStability["DUPLICATE"] = 3] = "DUPLICATE"; +})(SemconvStability = exports.SemconvStability || (exports.SemconvStability = {})); +/** + * Determine the appropriate semconv stability for the given namespace. + * + * This will parse the given string of comma-separated values (often + * `process.env.OTEL_SEMCONV_STABILITY_OPT_IN`) looking for the `${namespace}` + * or `${namespace}/dup` tokens. This is a pattern defined by a number of + * non-normative semconv documents. + * + * For example: + * - namespace 'http': https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/ + * - namespace 'database': https://opentelemetry.io/docs/specs/semconv/non-normative/database-migration/ + * - namespace 'k8s': https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-migration/ + * + * Usage: + * + * import {SemconvStability, semconvStabilityFromStr} from '@opentelemetry/instrumentation'; + * + * export class FooInstrumentation extends InstrumentationBase { + * private _semconvStability: SemconvStability; + * constructor(config: FooInstrumentationConfig = {}) { + * super('@opentelemetry/instrumentation-foo', VERSION, config); + * + * // When supporting the OTEL_SEMCONV_STABILITY_OPT_IN envvar + * this._semconvStability = semconvStabilityFromStr( + * 'http', + * process.env.OTEL_SEMCONV_STABILITY_OPT_IN + * ); + * + * // or when supporting a `semconvStabilityOptIn` config option (e.g. for + * // the web where there are no envvars). + * this._semconvStability = semconvStabilityFromStr( + * 'http', + * config?.semconvStabilityOptIn + * ); + * } + * } + * + * // Then, to apply semconv, use the following or similar: + * if (this._semconvStability & SemconvStability.OLD) { + * // ... + * } + * if (this._semconvStability & SemconvStability.STABLE) { + * // ... + * } + * + */ +function semconvStabilityFromStr(namespace, str) { + let semconvStability = SemconvStability.OLD; + // The same parsing of `str` as `getStringListFromEnv` from the core pkg. + const entries = str + ?.split(',') + .map(v => v.trim()) + .filter(s => s !== ''); + for (const entry of entries ?? []) { + if (entry.toLowerCase() === namespace + '/dup') { + // DUPLICATE takes highest precedence. + semconvStability = SemconvStability.DUPLICATE; + break; + } + else if (entry.toLowerCase() === namespace) { + semconvStability = SemconvStability.STABLE; + } + } + return semconvStability; +} +exports.semconvStabilityFromStr = semconvStabilityFromStr; +//# sourceMappingURL=semconvStability.js.map + +/***/ }), + +/***/ 86887: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.satisfies = void 0; +// This is a custom semantic versioning implementation compatible with the +// `satisfies(version, range, options?)` function from the `semver` npm package; +// with the exception that the `loose` option is not supported. +// +// The motivation for the custom semver implementation is that +// `semver` package has some initialization delay (lots of RegExp init and compile) +// and this leads to coldstart overhead for the OTEL Lambda Node.js layer. +// Hence, we have implemented lightweight version of it internally with required functionalities. +const api_1 = __nccwpck_require__(65163); +const VERSION_REGEXP = /^(?:v)?(?(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*))(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; +const RANGE_REGEXP = /^(?<|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?(?x|X|\*|0|[1-9]\d*)(?:\.(?x|X|\*|0|[1-9]\d*))?(?:\.(?x|X|\*|0|[1-9]\d*))?)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; +const operatorResMap = { + '>': [1], + '>=': [0, 1], + '=': [0], + '<=': [-1, 0], + '<': [-1], + '!=': [-1, 1], +}; +/** + * Checks given version whether it satisfies given range expression. + * @param version the [version](https://github.com/npm/node-semver#versions) to be checked + * @param range the [range](https://github.com/npm/node-semver#ranges) expression for version check + * @param options options to configure semver satisfy check + */ +function satisfies(version, range, options) { + // Strict semver format check + if (!_validateVersion(version)) { + api_1.diag.error(`Invalid version: ${version}`); + return false; + } + // If range is empty, satisfy check succeeds regardless what version is + if (!range) { + return true; + } + // Cleanup range + range = range.replace(/([<>=~^]+)\s+/g, '$1'); + // Parse version + const parsedVersion = _parseVersion(version); + if (!parsedVersion) { + return false; + } + const allParsedRanges = []; + // Check given version whether it satisfies given range expression + const checkResult = _doSatisfies(parsedVersion, range, allParsedRanges, options); + // If check result is OK, + // do another final check for pre-release, if pre-release check is included by option + if (checkResult && !options?.includePrerelease) { + return _doPreleaseCheck(parsedVersion, allParsedRanges); + } + return checkResult; +} +exports.satisfies = satisfies; +function _validateVersion(version) { + return typeof version === 'string' && VERSION_REGEXP.test(version); +} +function _doSatisfies(parsedVersion, range, allParsedRanges, options) { + if (range.includes('||')) { + // A version matches a range if and only if + // every comparator in at least one of the ||-separated comparator sets is satisfied by the version + const ranges = range.trim().split('||'); + for (const r of ranges) { + if (_checkRange(parsedVersion, r, allParsedRanges, options)) { + return true; + } + } + return false; + } + else if (range.includes(' - ')) { + // Hyphen ranges: https://github.com/npm/node-semver#hyphen-ranges-xyz---abc + range = replaceHyphen(range, options); + } + else if (range.includes(' ')) { + // Multiple separated ranges and all needs to be satisfied for success + const ranges = range + .trim() + .replace(/\s{2,}/g, ' ') + .split(' '); + for (const r of ranges) { + if (!_checkRange(parsedVersion, r, allParsedRanges, options)) { + return false; + } + } + return true; + } + // Check given parsed version with given range + return _checkRange(parsedVersion, range, allParsedRanges, options); +} +function _checkRange(parsedVersion, range, allParsedRanges, options) { + range = _normalizeRange(range, options); + if (range.includes(' ')) { + // If there are multiple ranges separated, satisfy each of them + return _doSatisfies(parsedVersion, range, allParsedRanges, options); + } + else { + // Validate and parse range + const parsedRange = _parseRange(range); + allParsedRanges.push(parsedRange); + // Check parsed version by parsed range + return _satisfies(parsedVersion, parsedRange); + } +} +function _satisfies(parsedVersion, parsedRange) { + // If range is invalid, satisfy check fails (no error throw) + if (parsedRange.invalid) { + return false; + } + // If range is empty or wildcard, satisfy check succeeds regardless what version is + if (!parsedRange.version || _isWildcard(parsedRange.version)) { + return true; + } + // Compare version segment first + let comparisonResult = _compareVersionSegments(parsedVersion.versionSegments || [], parsedRange.versionSegments || []); + // If versions segments are equal, compare by pre-release segments + if (comparisonResult === 0) { + const versionPrereleaseSegments = parsedVersion.prereleaseSegments || []; + const rangePrereleaseSegments = parsedRange.prereleaseSegments || []; + if (!versionPrereleaseSegments.length && !rangePrereleaseSegments.length) { + comparisonResult = 0; + } + else if (!versionPrereleaseSegments.length && + rangePrereleaseSegments.length) { + comparisonResult = 1; + } + else if (versionPrereleaseSegments.length && + !rangePrereleaseSegments.length) { + comparisonResult = -1; + } + else { + comparisonResult = _compareVersionSegments(versionPrereleaseSegments, rangePrereleaseSegments); + } + } + // Resolve check result according to comparison operator + return operatorResMap[parsedRange.op]?.includes(comparisonResult); +} +function _doPreleaseCheck(parsedVersion, allParsedRanges) { + if (parsedVersion.prerelease) { + return allParsedRanges.some(r => r.prerelease && r.version === parsedVersion.version); + } + return true; +} +function _normalizeRange(range, options) { + range = range.trim(); + range = replaceCaret(range, options); + range = replaceTilde(range); + range = replaceXRange(range, options); + range = range.trim(); + return range; +} +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} +function _parseVersion(versionString) { + const match = versionString.match(VERSION_REGEXP); + if (!match) { + api_1.diag.error(`Invalid version: ${versionString}`); + return undefined; + } + const version = match.groups.version; + const prerelease = match.groups.prerelease; + const build = match.groups.build; + const versionSegments = version.split('.'); + const prereleaseSegments = prerelease?.split('.'); + return { + op: undefined, + version, + versionSegments, + versionSegmentCount: versionSegments.length, + prerelease, + prereleaseSegments, + prereleaseSegmentCount: prereleaseSegments ? prereleaseSegments.length : 0, + build, + }; +} +function _parseRange(rangeString) { + if (!rangeString) { + return {}; + } + const match = rangeString.match(RANGE_REGEXP); + if (!match) { + api_1.diag.error(`Invalid range: ${rangeString}`); + return { + invalid: true, + }; + } + let op = match.groups.op; + const version = match.groups.version; + const prerelease = match.groups.prerelease; + const build = match.groups.build; + const versionSegments = version.split('.'); + const prereleaseSegments = prerelease?.split('.'); + if (op === '==') { + op = '='; + } + return { + op: op || '=', + version, + versionSegments, + versionSegmentCount: versionSegments.length, + prerelease, + prereleaseSegments, + prereleaseSegmentCount: prereleaseSegments ? prereleaseSegments.length : 0, + build, + }; +} +function _isWildcard(s) { + return s === '*' || s === 'x' || s === 'X'; +} +function _parseVersionString(v) { + const n = parseInt(v, 10); + return isNaN(n) ? v : n; +} +function _normalizeVersionType(a, b) { + if (typeof a === typeof b) { + if (typeof a === 'number') { + return [a, b]; + } + else if (typeof a === 'string') { + return [a, b]; + } + else { + throw new Error('Version segments can only be strings or numbers'); + } + } + else { + return [String(a), String(b)]; + } +} +function _compareVersionStrings(v1, v2) { + if (_isWildcard(v1) || _isWildcard(v2)) { + return 0; + } + const [parsedV1, parsedV2] = _normalizeVersionType(_parseVersionString(v1), _parseVersionString(v2)); + if (parsedV1 > parsedV2) { + return 1; + } + else if (parsedV1 < parsedV2) { + return -1; + } + return 0; +} +function _compareVersionSegments(v1, v2) { + for (let i = 0; i < Math.max(v1.length, v2.length); i++) { + const res = _compareVersionStrings(v1[i] || '0', v2[i] || '0'); + if (res !== 0) { + return res; + } + } + return 0; +} +//////////////////////////////////////////////////////////////////////////////// +// The rest of this file is adapted from portions of https://github.com/npm/node-semver/tree/868d4bb +// License: +/* + * The ISC License + * + * Copyright (c) Isaac Z. Schlueter and Contributors + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR + * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +const LETTERDASHNUMBER = '[a-zA-Z0-9-]'; +const NUMERICIDENTIFIER = '0|[1-9]\\d*'; +const NONNUMERICIDENTIFIER = `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`; +const GTLT = '((?:<|>)?=?)'; +const PRERELEASEIDENTIFIER = `(?:${NUMERICIDENTIFIER}|${NONNUMERICIDENTIFIER})`; +const PRERELEASE = `(?:-(${PRERELEASEIDENTIFIER}(?:\\.${PRERELEASEIDENTIFIER})*))`; +const BUILDIDENTIFIER = `${LETTERDASHNUMBER}+`; +const BUILD = `(?:\\+(${BUILDIDENTIFIER}(?:\\.${BUILDIDENTIFIER})*))`; +const XRANGEIDENTIFIER = `${NUMERICIDENTIFIER}|x|X|\\*`; +const XRANGEPLAIN = `[v=\\s]*(${XRANGEIDENTIFIER})` + + `(?:\\.(${XRANGEIDENTIFIER})` + + `(?:\\.(${XRANGEIDENTIFIER})` + + `(?:${PRERELEASE})?${BUILD}?` + + ')?)?'; +const XRANGE = `^${GTLT}\\s*${XRANGEPLAIN}$`; +const XRANGE_REGEXP = new RegExp(XRANGE); +const HYPHENRANGE = `^\\s*(${XRANGEPLAIN})` + '\\s+-\\s+' + `(${XRANGEPLAIN})` + '\\s*$'; +const HYPHENRANGE_REGEXP = new RegExp(HYPHENRANGE); +const LONETILDE = '(?:~>?)'; +const TILDE = `^${LONETILDE}${XRANGEPLAIN}$`; +const TILDE_REGEXP = new RegExp(TILDE); +const LONECARET = '(?:\\^)'; +const CARET = `^${LONECARET}${XRANGEPLAIN}$`; +const CARET_REGEXP = new RegExp(CARET); +// Borrowed from https://github.com/npm/node-semver/blob/868d4bbe3d318c52544f38d5f9977a1103e924c2/classes/range.js#L285 +// +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +function replaceTilde(comp) { + const r = TILDE_REGEXP; + return comp.replace(r, (_, M, m, p, pr) => { + let ret; + if (isX(M)) { + ret = ''; + } + else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } + else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; + } + else if (pr) { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } + else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + } + return ret; + }); +} +// Borrowed from https://github.com/npm/node-semver/blob/868d4bbe3d318c52544f38d5f9977a1103e924c2/classes/range.js#L329 +// +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +function replaceCaret(comp, options) { + const r = CARET_REGEXP; + const z = options?.includePrerelease ? '-0' : ''; + return comp.replace(r, (_, M, m, p, pr) => { + let ret; + if (isX(M)) { + ret = ''; + } + else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } + else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; + } + else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; + } + } + else if (pr) { + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; + } + else { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } + } + else { + ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; + } + } + else { + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; + } + else { + ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; + } + } + else { + ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; + } + } + return ret; + }); +} +// Borrowed from https://github.com/npm/node-semver/blob/868d4bbe3d318c52544f38d5f9977a1103e924c2/classes/range.js#L390 +function replaceXRange(comp, options) { + const r = XRANGE_REGEXP; + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + const xM = isX(M); + const xm = xM || isX(m); + const xp = xm || isX(p); + const anyX = xp; + if (gtlt === '=' && anyX) { + gtlt = ''; + } + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options?.includePrerelease ? '-0' : ''; + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0'; + } + else { + // nothing is forbidden + ret = '*'; + } + } + else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0; + } + p = 0; + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } + else { + m = +m + 1; + p = 0; + } + } + else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<'; + if (xm) { + M = +M + 1; + } + else { + m = +m + 1; + } + } + if (gtlt === '<') { + pr = '-0'; + } + ret = `${gtlt + M}.${m}.${p}${pr}`; + } + else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } + else if (xp) { + ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; + } + return ret; + }); +} +// Borrowed from https://github.com/npm/node-semver/blob/868d4bbe3d318c52544f38d5f9977a1103e924c2/classes/range.js#L488 +// +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +function replaceHyphen(comp, options) { + const r = HYPHENRANGE_REGEXP; + return comp.replace(r, (_, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = ''; + } + else if (isX(fm)) { + from = `>=${fM}.0.0${options?.includePrerelease ? '-0' : ''}`; + } + else if (isX(fp)) { + from = `>=${fM}.${fm}.0${options?.includePrerelease ? '-0' : ''}`; + } + else if (fpr) { + from = `>=${from}`; + } + else { + from = `>=${from}${options?.includePrerelease ? '-0' : ''}`; + } + if (isX(tM)) { + to = ''; + } + else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } + else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } + else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } + else if (options?.includePrerelease) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } + else { + to = `<=${to}`; + } + return `${from} ${to}`.trim(); + }); +} +//# sourceMappingURL=semver.js.map + +/***/ }), + +/***/ 34337: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.massUnwrap = exports.unwrap = exports.massWrap = exports.wrap = void 0; +// Default to complaining loudly when things don't go according to plan. +// eslint-disable-next-line no-console +let logger = console.error.bind(console); +// Sets a property on an object, preserving its enumerability. +// This function assumes that the property is already writable. +function defineProperty(obj, name, value) { + const enumerable = !!obj[name] && + Object.prototype.propertyIsEnumerable.call(obj, name); + Object.defineProperty(obj, name, { + configurable: true, + enumerable, + writable: true, + value, + }); +} +const wrap = (nodule, name, wrapper) => { + if (!nodule || !nodule[name]) { + logger('no original function ' + String(name) + ' to wrap'); + return; + } + if (!wrapper) { + logger('no wrapper function'); + logger(new Error().stack); + return; + } + const original = nodule[name]; + if (typeof original !== 'function' || typeof wrapper !== 'function') { + logger('original object and wrapper must be functions'); + return; + } + const wrapped = wrapper(original, name); + defineProperty(wrapped, '__original', original); + defineProperty(wrapped, '__unwrap', () => { + if (nodule[name] === wrapped) { + defineProperty(nodule, name, original); + } + }); + defineProperty(wrapped, '__wrapped', true); + defineProperty(nodule, name, wrapped); + return wrapped; +}; +exports.wrap = wrap; +const massWrap = (nodules, names, wrapper) => { + if (!nodules) { + logger('must provide one or more modules to patch'); + logger(new Error().stack); + return; + } + else if (!Array.isArray(nodules)) { + nodules = [nodules]; + } + if (!(names && Array.isArray(names))) { + logger('must provide one or more functions to wrap on modules'); + return; + } + nodules.forEach(nodule => { + names.forEach(name => { + (0, exports.wrap)(nodule, name, wrapper); + }); + }); +}; +exports.massWrap = massWrap; +const unwrap = (nodule, name) => { + if (!nodule || !nodule[name]) { + logger('no function to unwrap.'); + logger(new Error().stack); + return; + } + const wrapped = nodule[name]; + if (!wrapped.__unwrap) { + logger('no original to unwrap to -- has ' + + String(name) + + ' already been unwrapped?'); + } + else { + wrapped.__unwrap(); + return; + } +}; +exports.unwrap = unwrap; +const massUnwrap = (nodules, names) => { + if (!nodules) { + logger('must provide one or more modules to patch'); + logger(new Error().stack); + return; + } + else if (!Array.isArray(nodules)) { + nodules = [nodules]; + } + if (!(names && Array.isArray(names))) { + logger('must provide one or more functions to unwrap on modules'); + return; + } + nodules.forEach(nodule => { + names.forEach(name => { + (0, exports.unwrap)(nodule, name); + }); + }); +}; +exports.massUnwrap = massUnwrap; +function shimmer(options) { + if (options && options.logger) { + if (typeof options.logger !== 'function') { + logger("new logger isn't a function, not replacing"); + } + else { + logger = options.logger; + } + } +} +exports["default"] = shimmer; +shimmer.wrap = exports.wrap; +shimmer.massWrap = exports.massWrap; +shimmer.unwrap = exports.unwrap; +shimmer.massUnwrap = exports.massUnwrap; +//# sourceMappingURL=shimmer.js.map + +/***/ }), + /***/ 93806: /***/ ((__unused_webpack_module, exports) => { @@ -40760,18 +9673,7 @@ Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function ( /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isWrapped = exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = void 0; @@ -40815,7 +9717,7 @@ async function safeExecuteInTheMiddleAsync(execute, onFinish, preventThrowingErr error = e; } finally { - onFinish(error, result); + await onFinish(error, result); if (error && !preventThrowingError) { // eslint-disable-next-line no-unsafe-finally throw error; @@ -40840,2746 +9742,205 @@ exports.isWrapped = isWrapped; /***/ }), -/***/ 62433: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const ANY = Symbol('SemVer ANY') -// hoisted class for cyclic dependency -class Comparator { - static get ANY () { - return ANY - } - - constructor (comp, options) { - options = parseOptions(options) - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - comp = comp.trim().split(/\s+/).join(' ') - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) - } - - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) - - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } - } - - toString () { - return this.value - } - - test (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY || version === ANY) { - return true - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - return cmp(version, this.operator, this.semver, this.options) - } - - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } - - options = parseOptions(options) - - // Special cases where nothing can possibly be lower - if (options.includePrerelease && - (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { - return false - } - if (!options.includePrerelease && - (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { - return false - } - - // Same direction increasing (> or >=) - if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { - return true - } - // Same direction decreasing (< or <=) - if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { - return true - } - // same SemVer and both sides are inclusive (<= or >=) - if ( - (this.semver.version === comp.semver.version) && - this.operator.includes('=') && comp.operator.includes('=')) { - return true - } - // opposite directions less than - if (cmp(this.semver, '<', comp.semver, options) && - this.operator.startsWith('>') && comp.operator.startsWith('<')) { - return true - } - // opposite directions greater than - if (cmp(this.semver, '>', comp.semver, options) && - this.operator.startsWith('<') && comp.operator.startsWith('>')) { - return true - } - return false - } -} - -module.exports = Comparator - -const parseOptions = __nccwpck_require__(1893) -const { safeRe: re, t } = __nccwpck_require__(1681) -const cmp = __nccwpck_require__(41219) -const debug = __nccwpck_require__(27480) -const SemVer = __nccwpck_require__(16458) -const Range = __nccwpck_require__(62614) - - -/***/ }), - -/***/ 62614: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SPACE_CHARACTERS = /\s+/g - -// hoisted class for cyclic dependency -class Range { - constructor (range, options) { - options = parseOptions(options) - - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value - this.set = [[range]] - this.formatted = undefined - return this - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First reduce all whitespace as much as possible so we do not have to rely - // on potentially slow regexes like \s*. This is then stored and used for - // future error messages as well. - this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') - - // First, split on || - this.set = this.raw - .split('||') - // map the range to a 2d array of comparators - .map(r => this.parseRange(r.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) - - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`) - } - - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0] - this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) { - this.set = [first] - } else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c] - break - } - } - } - } - - this.formatted = undefined - } - - get range () { - if (this.formatted === undefined) { - this.formatted = '' - for (let i = 0; i < this.set.length; i++) { - if (i > 0) { - this.formatted += '||' - } - const comps = this.set[i] - for (let k = 0; k < comps.length; k++) { - if (k > 0) { - this.formatted += ' ' - } - this.formatted += comps[k].toString().trim() - } - } - } - return this.formatted - } - - format () { - return this.range - } - - toString () { - return this.range - } - - parseRange (range) { - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = - (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | - (this.options.loose && FLAG_LOOSE) - const memoKey = memoOpts + ':' + range - const cached = cache.get(memoKey) - if (cached) { - return cached - } - - const loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - debug('tilde trim', range) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - debug('caret trim', range) - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - let rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - - if (loose) { - // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter(comp => { - debug('loose invalid filter', comp, this.options) - return !!comp.match(re[t.COMPARATORLOOSE]) - }) - } - debug('range list', rangeList) - - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const rangeMap = new Map() - const comparators = rangeList.map(comp => new Comparator(comp, this.options)) - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp] - } - rangeMap.set(comp.value, comp) - } - if (rangeMap.size > 1 && rangeMap.has('')) { - rangeMap.delete('') - } - - const result = [...rangeMap.values()] - cache.set(memoKey, result) - return result - } - - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } - - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false - } -} - -module.exports = Range - -const LRU = __nccwpck_require__(35617) -const cache = new LRU() - -const parseOptions = __nccwpck_require__(1893) -const Comparator = __nccwpck_require__(62433) -const debug = __nccwpck_require__(27480) -const SemVer = __nccwpck_require__(16458) -const { - safeRe: re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace, -} = __nccwpck_require__(1681) -const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(95804) - -const isNullSet = c => c.value === '<0.0.0-0' -const isAny = c => c.value === '' - -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() - - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) - - testComparator = remainingComparators.pop() - } - - return result -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -// ~0.0.1 --> >=0.0.1 <0.1.0-0 -const replaceTildes = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceTilde(c, options)) - .join(' ') -} - -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -// ^0.0.1 --> >=0.0.1 <0.0.2-0 -// ^0.1.0 --> >=0.1.0 <0.2.0-0 -const replaceCarets = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceCaret(c, options)) - .join(' ') -} - -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } - - debug('caret return', ret) - return ret - }) -} - -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp - .split(/\s+/) - .map((c) => replaceXRange(c, options)) - .join(' ') -} - -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - if (gtlt === '<') { - pr = '-0' - } - - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp - .trim() - .replace(re[t.STAR], '') -} - -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp - .trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -// TODO build? -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr) => { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? '-0' : ''}` - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` - } else if (fpr) { - from = `>=${from}` - } else { - from = `>=${from}${incPr ? '-0' : ''}` - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0` - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0` - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}` - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0` - } else { - to = `<=${to}` - } - - return `${from} ${to}`.trim() -} - -const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === Comparator.ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} - - -/***/ }), - -/***/ 16458: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const debug = __nccwpck_require__(27480) -const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(95804) -const { safeRe: re, t } = __nccwpck_require__(1681) - -const parseOptions = __nccwpck_require__(1893) -const { compareIdentifiers } = __nccwpck_require__(37852) -class SemVer { - constructor (version, options) { - options = parseOptions(options) - - if (version instanceof SemVer) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease - - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() - } - - format () { - this.version = `${this.major}.${this.minor}.${this.patch}` - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}` - } - return this.version - } - - toString () { - return this.version - } - - compare (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer(other, this.options) - } - - if (other.version === this.version) { - return 0 - } - - return this.compareMain(other) || this.comparePre(other) - } - - compareMain (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) - } - - comparePre (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - let i = 0 - do { - const a = this.prerelease[i] - const b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - compareBuild (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - let i = 0 - do { - const a = this.build[i] - const b = other.build[i] - debug('build compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier, identifierBase) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier, identifierBase) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier, identifierBase) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier, identifierBase) - this.inc('pre', identifier, identifierBase) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier, identifierBase) - } - this.inc('pre', identifier, identifierBase) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': { - const base = Number(identifierBase) ? 1 : 0 - - if (!identifier && identifierBase === false) { - throw new Error('invalid increment argument: identifier is empty') - } - - if (this.prerelease.length === 0) { - this.prerelease = [base] - } else { - let i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - if (identifier === this.prerelease.join('.') && identifierBase === false) { - throw new Error('invalid increment argument: identifier already exists') - } - this.prerelease.push(base) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - let prerelease = [identifier, base] - if (identifierBase === false) { - prerelease = [identifier] - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease - } - } else { - this.prerelease = prerelease - } - } - break - } - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.raw = this.format() - if (this.build.length) { - this.raw += `+${this.build.join('.')}` - } - return this - } -} - -module.exports = SemVer - - -/***/ }), - -/***/ 68420: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(53155) -const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -module.exports = clean - - -/***/ }), - -/***/ 41219: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const eq = __nccwpck_require__(92759) -const neq = __nccwpck_require__(76489) -const gt = __nccwpck_require__(20617) -const gte = __nccwpck_require__(31581) -const lt = __nccwpck_require__(11959) -const lte = __nccwpck_require__(46264) - -const cmp = (a, op, b, loose) => { - switch (op) { - case '===': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a === b - - case '!==': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError(`Invalid operator: ${op}`) - } -} -module.exports = cmp - - -/***/ }), - -/***/ 32766: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const parse = __nccwpck_require__(53155) -const { safeRe: re, t } = __nccwpck_require__(1681) - -const coerce = (version, options) => { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - options = options || {} - - let match = null - if (!options.rtl) { - match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] - let next - while ((next = coerceRtlRegex.exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - coerceRtlRegex.lastIndex = -1 - } - - if (match === null) { - return null - } - - const major = match[2] - const minor = match[3] || '0' - const patch = match[4] || '0' - const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' - const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' - - return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) -} -module.exports = coerce - - -/***/ }), - -/***/ 43327: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose) - const versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} -module.exports = compareBuild - - -/***/ }), - -/***/ 83723: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(54168) -const compareLoose = (a, b) => compare(a, b, true) -module.exports = compareLoose - - -/***/ }), - -/***/ 54168: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)) - -module.exports = compare - - -/***/ }), - -/***/ 79623: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(53155) - -const diff = (version1, version2) => { - const v1 = parse(version1, null, true) - const v2 = parse(version2, null, true) - const comparison = v1.compare(v2) - - if (comparison === 0) { - return null - } - - const v1Higher = comparison > 0 - const highVersion = v1Higher ? v1 : v2 - const lowVersion = v1Higher ? v2 : v1 - const highHasPre = !!highVersion.prerelease.length - const lowHasPre = !!lowVersion.prerelease.length - - if (lowHasPre && !highHasPre) { - // Going from prerelease -> no prerelease requires some special casing - - // If the low version has only a major, then it will always be a major - // Some examples: - // 1.0.0-1 -> 1.0.0 - // 1.0.0-1 -> 1.1.1 - // 1.0.0-1 -> 2.0.0 - if (!lowVersion.patch && !lowVersion.minor) { - return 'major' - } - - // Otherwise it can be determined by checking the high version - - if (highVersion.patch) { - // anything higher than a patch bump would result in the wrong version - return 'patch' - } - - if (highVersion.minor) { - // anything higher than a minor bump would result in the wrong version - return 'minor' - } - - // bumping major/minor/patch all have same result - return 'major' - } - - // add the `pre` prefix if we are going to a prerelease version - const prefix = highHasPre ? 'pre' : '' - - if (v1.major !== v2.major) { - return prefix + 'major' - } - - if (v1.minor !== v2.minor) { - return prefix + 'minor' - } - - if (v1.patch !== v2.patch) { - return prefix + 'patch' - } - - // high and low are preleases - return 'prerelease' -} - -module.exports = diff - - -/***/ }), - -/***/ 92759: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(54168) -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq - - -/***/ }), - -/***/ 20617: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(54168) -const gt = (a, b, loose) => compare(a, b, loose) > 0 -module.exports = gt - - -/***/ }), - -/***/ 31581: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(54168) -const gte = (a, b, loose) => compare(a, b, loose) >= 0 -module.exports = gte - - -/***/ }), - -/***/ 98571: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) - -const inc = (version, release, options, identifier, identifierBase) => { - if (typeof (options) === 'string') { - identifierBase = identifier - identifier = options - options = undefined - } - - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier, identifierBase).version - } catch (er) { - return null - } -} -module.exports = inc - - -/***/ }), - -/***/ 11959: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(54168) -const lt = (a, b, loose) => compare(a, b, loose) < 0 -module.exports = lt - - -/***/ }), - -/***/ 46264: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(54168) -const lte = (a, b, loose) => compare(a, b, loose) <= 0 -module.exports = lte - - -/***/ }), - -/***/ 19066: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const major = (a, loose) => new SemVer(a, loose).major -module.exports = major - - -/***/ }), - -/***/ 47524: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor - - -/***/ }), - -/***/ 76489: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(54168) -const neq = (a, b, loose) => compare(a, b, loose) !== 0 -module.exports = neq - - -/***/ }), - -/***/ 53155: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const parse = (version, options, throwErrors = false) => { - if (version instanceof SemVer) { - return version - } - try { - return new SemVer(version, options) - } catch (er) { - if (!throwErrors) { - return null - } - throw er - } -} - -module.exports = parse - - -/***/ }), - -/***/ 95436: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch - - -/***/ }), - -/***/ 76207: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(53155) -const prerelease = (version, options) => { - const parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -module.exports = prerelease - - -/***/ }), - -/***/ 53133: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(54168) -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare - - -/***/ }), - -/***/ 10035: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compareBuild = __nccwpck_require__(43327) -const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) -module.exports = rsort - - -/***/ }), - -/***/ 17913: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(62614) -const satisfies = (version, range, options) => { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} -module.exports = satisfies - - -/***/ }), - -/***/ 32857: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compareBuild = __nccwpck_require__(43327) -const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) -module.exports = sort - - -/***/ }), - -/***/ 85517: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(53155) -const valid = (version, options) => { - const v = parse(version, options) - return v ? v.version : null -} -module.exports = valid - - -/***/ }), - -/***/ 63547: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// just pre-load all the stuff that index.js lazily exports -const internalRe = __nccwpck_require__(1681) -const constants = __nccwpck_require__(95804) -const SemVer = __nccwpck_require__(16458) -const identifiers = __nccwpck_require__(37852) -const parse = __nccwpck_require__(53155) -const valid = __nccwpck_require__(85517) -const clean = __nccwpck_require__(68420) -const inc = __nccwpck_require__(98571) -const diff = __nccwpck_require__(79623) -const major = __nccwpck_require__(19066) -const minor = __nccwpck_require__(47524) -const patch = __nccwpck_require__(95436) -const prerelease = __nccwpck_require__(76207) -const compare = __nccwpck_require__(54168) -const rcompare = __nccwpck_require__(53133) -const compareLoose = __nccwpck_require__(83723) -const compareBuild = __nccwpck_require__(43327) -const sort = __nccwpck_require__(32857) -const rsort = __nccwpck_require__(10035) -const gt = __nccwpck_require__(20617) -const lt = __nccwpck_require__(11959) -const eq = __nccwpck_require__(92759) -const neq = __nccwpck_require__(76489) -const gte = __nccwpck_require__(31581) -const lte = __nccwpck_require__(46264) -const cmp = __nccwpck_require__(41219) -const coerce = __nccwpck_require__(32766) -const Comparator = __nccwpck_require__(62433) -const Range = __nccwpck_require__(62614) -const satisfies = __nccwpck_require__(17913) -const toComparators = __nccwpck_require__(12204) -const maxSatisfying = __nccwpck_require__(92103) -const minSatisfying = __nccwpck_require__(99584) -const minVersion = __nccwpck_require__(66053) -const validRange = __nccwpck_require__(91117) -const outside = __nccwpck_require__(87855) -const gtr = __nccwpck_require__(4215) -const ltr = __nccwpck_require__(84497) -const intersects = __nccwpck_require__(90680) -const simplifyRange = __nccwpck_require__(25556) -const subset = __nccwpck_require__(15301) -module.exports = { - parse, - valid, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers, -} - - -/***/ }), - -/***/ 95804: -/***/ ((module) => { - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0' - -const MAX_LENGTH = 256 -const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16 - -// Max safe length for a build identifier. The max length minus 6 characters for -// the shortest version with a build 0.0.0+BUILD. -const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 - -const RELEASE_TYPES = [ - 'major', - 'premajor', - 'minor', - 'preminor', - 'patch', - 'prepatch', - 'prerelease', -] - -module.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 0b001, - FLAG_LOOSE: 0b010, -} - - -/***/ }), - -/***/ 27480: -/***/ ((module) => { - -const debug = ( - typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) -) ? (...args) => console.error('SEMVER', ...args) - : () => {} - -module.exports = debug - - -/***/ }), - -/***/ 37852: -/***/ ((module) => { - -const numeric = /^[0-9]+$/ -const compareIdentifiers = (a, b) => { - const anum = numeric.test(a) - const bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) - -module.exports = { - compareIdentifiers, - rcompareIdentifiers, -} - - -/***/ }), - -/***/ 35617: -/***/ ((module) => { - -class LRUCache { - constructor () { - this.max = 1000 - this.map = new Map() - } - - get (key) { - const value = this.map.get(key) - if (value === undefined) { - return undefined - } else { - // Remove the key from the map and add it to the end - this.map.delete(key) - this.map.set(key, value) - return value - } - } - - delete (key) { - return this.map.delete(key) - } - - set (key, value) { - const deleted = this.delete(key) - - if (!deleted && value !== undefined) { - // If cache is full, delete the least recently used item - if (this.map.size >= this.max) { - const firstKey = this.map.keys().next().value - this.delete(firstKey) - } - - this.map.set(key, value) - } - - return this - } -} - -module.exports = LRUCache - - -/***/ }), - -/***/ 1893: -/***/ ((module) => { - -// parse out just the options we care about -const looseOption = Object.freeze({ loose: true }) -const emptyOpts = Object.freeze({ }) -const parseOptions = options => { - if (!options) { - return emptyOpts - } - - if (typeof options !== 'object') { - return looseOption - } - - return options -} -module.exports = parseOptions - - -/***/ }), - -/***/ 1681: -/***/ ((module, exports, __nccwpck_require__) => { - -const { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH, -} = __nccwpck_require__(95804) -const debug = __nccwpck_require__(27480) -exports = module.exports = {} - -// The actual regexps go on exports.re -const re = exports.re = [] -const safeRe = exports.safeRe = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 - -const LETTERDASHNUMBER = '[a-zA-Z0-9-]' - -// Replace some greedy regex tokens to prevent regex dos issues. These regex are -// used internally via the safeRe object since all inputs in this library get -// normalized first to trim and collapse all extra whitespace. The original -// regexes are exported for userland consumption and lower level usage. A -// future breaking change could export the safer regex only with a note that -// all input should have extra whitespace removed. -const safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] - -const makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value - .split(`${token}*`).join(`${token}{0,${max}}`) - .split(`${token}+`).join(`${token}{1,${max}}`) - } - return value -} - -const createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value) - const index = R++ - debug(name, index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, isGlobal ? 'g' : undefined) - safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '\\d+') - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) - -// ## Main Version -// Three dot-separated numeric identifiers. - -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`) - -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`) - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) - -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`) - -createToken('FULL', `^${src[t.FULLPLAIN]}$`) - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`) - -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) - -createToken('GTLT', '((?:<|>)?=?)') - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) - -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCEPLAIN', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) -createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) -createToken('COERCEFULL', src[t.COERCEPLAIN] + - `(?:${src[t.PRERELEASE]})?` + - `(?:${src[t.BUILD]})?` + - `(?:$|[^\\d])`) -createToken('COERCERTL', src[t.COERCE], true) -createToken('COERCERTLFULL', src[t.COERCEFULL], true) - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -createToken('LONETILDE', '(?:~>?)') - -createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) -exports.tildeTrimReplace = '$1~' - -createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) -createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -createToken('LONECARET', '(?:\\^)') - -createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) -exports.caretTrimReplace = '$1^' - -createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) -createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) -createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] -}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) -exports.comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$`) - -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`) - -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*') -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') - - -/***/ }), - -/***/ 4215: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// Determine if version is greater than all the versions possible in the range. -const outside = __nccwpck_require__(87855) -const gtr = (version, range, options) => outside(version, range, '>', options) -module.exports = gtr - - -/***/ }), - -/***/ 90680: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(62614) -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2, options) -} -module.exports = intersects - - -/***/ }), - -/***/ 84497: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const outside = __nccwpck_require__(87855) -// Determine if version is less than all the versions possible in the range -const ltr = (version, range, options) => outside(version, range, '<', options) -module.exports = ltr - - -/***/ }), - -/***/ 92103: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const Range = __nccwpck_require__(62614) - -const maxSatisfying = (versions, range, options) => { - let max = null - let maxSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} -module.exports = maxSatisfying - - -/***/ }), - -/***/ 99584: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const Range = __nccwpck_require__(62614) -const minSatisfying = (versions, range, options) => { - let min = null - let minSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} -module.exports = minSatisfying - - -/***/ }), - -/***/ 66053: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const Range = __nccwpck_require__(62614) -const gt = __nccwpck_require__(20617) - -const minVersion = (range, loose) => { - range = new Range(range, loose) - - let minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let setMin = null - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!setMin || gt(compver, setMin)) { - setMin = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`) - } - }) - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin - } - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} -module.exports = minVersion - - -/***/ }), - -/***/ 87855: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(16458) -const Comparator = __nccwpck_require__(62433) -const { ANY } = Comparator -const Range = __nccwpck_require__(62614) -const satisfies = __nccwpck_require__(17913) -const gt = __nccwpck_require__(20617) -const lt = __nccwpck_require__(11959) -const lte = __nccwpck_require__(46264) -const gte = __nccwpck_require__(31581) - -const outside = (version, range, hilo, options) => { - version = new SemVer(version, options) - range = new Range(range, options) - - let gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisfies the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let high = null - let low = null - - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -module.exports = outside - - -/***/ }), - -/***/ 25556: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// given a set of versions and a range, create a "simplified" range -// that includes the same versions that the original range does -// If the original range is shorter than the simplified one, return that. -const satisfies = __nccwpck_require__(17913) -const compare = __nccwpck_require__(54168) -module.exports = (versions, range, options) => { - const set = [] - let first = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!first) { - first = version - } - } else { - if (prev) { - set.push([first, prev]) - } - prev = null - first = null - } - } - if (first) { - set.push([first, null]) - } - - const ranges = [] - for (const [min, max] of set) { - if (min === max) { - ranges.push(min) - } else if (!max && min === v[0]) { - ranges.push('*') - } else if (!max) { - ranges.push(`>=${min}`) - } else if (min === v[0]) { - ranges.push(`<=${max}`) - } else { - ranges.push(`${min} - ${max}`) - } - } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range -} - - -/***/ }), - -/***/ 15301: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(62614) -const Comparator = __nccwpck_require__(62433) -const { ANY } = Comparator -const satisfies = __nccwpck_require__(17913) -const compare = __nccwpck_require__(54168) - -// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: -// - Every simple range `r1, r2, ...` is a null set, OR -// - Every simple range `r1, r2, ...` which is not a null set is a subset of -// some `R1, R2, ...` -// -// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: -// - If c is only the ANY comparator -// - If C is only the ANY comparator, return true -// - Else if in prerelease mode, return false -// - else replace c with `[>=0.0.0]` -// - If C is only the ANY comparator -// - if in prerelease mode, return true -// - else replace C with `[>=0.0.0]` -// - Let EQ be the set of = comparators in c -// - If EQ is more than one, return true (null set) -// - Let GT be the highest > or >= comparator in c -// - Let LT be the lowest < or <= comparator in c -// - If GT and LT, and GT.semver > LT.semver, return true (null set) -// - If any C is a = range, and GT or LT are set, return false -// - If EQ -// - If GT, and EQ does not satisfy GT, return true (null set) -// - If LT, and EQ does not satisfy LT, return true (null set) -// - If EQ satisfies every C, return true -// - Else return false -// - If GT -// - If GT.semver is lower than any > or >= comp in C, return false -// - If GT is >=, and GT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the GT.semver tuple, return false -// - If LT -// - If LT.semver is greater than any < or <= comp in C, return false -// - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the LT.semver tuple, return false -// - Else return true - -const subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true - } - - sub = new Range(sub, options) - dom = new Range(dom, options) - let sawNonNull = false - - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options) - sawNonNull = sawNonNull || isSub !== null - if (isSub) { - continue OUTER - } - } - // the null set is a subset of everything, but null simple ranges in - // a complex range should be ignored. so if we saw a non-null range, - // then we know this isn't a subset, but if EVERY simple range was null, - // then it is a subset. - if (sawNonNull) { - return false - } - } - return true -} - -const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] -const minimumVersion = [new Comparator('>=0.0.0')] - -const simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true - } - - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease - } else { - sub = minimumVersion - } - } - - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true - } else { - dom = minimumVersion - } - } - - const eqSet = new Set() - let gt, lt - for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') { - gt = higherGT(gt, c, options) - } else if (c.operator === '<' || c.operator === '<=') { - lt = lowerLT(lt, c, options) - } else { - eqSet.add(c.semver) - } - } - - if (eqSet.size > 1) { - return null - } - - let gtltComp - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) { - return null - } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { - return null - } - } - - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null - } - - if (lt && !satisfies(eq, String(lt), options)) { - return null - } - - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false - } - } - - return true - } - - let higher, lower - let hasDomLT, hasDomGT - // if the subset has a prerelease, we need a comparator in the superset - // with the same tuple and a prerelease, or it's not a subset - let needDomLTPre = lt && - !options.includePrerelease && - lt.semver.prerelease.length ? lt.semver : false - let needDomGTPre = gt && - !options.includePrerelease && - gt.semver.prerelease.length ? gt.semver : false - // exception: <1.2.3-0 is the same as <1.2.3 - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && - lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false - } - - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' - hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomGTPre.major && - c.semver.minor === needDomGTPre.minor && - c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false - } - } - if (c.operator === '>' || c.operator === '>=') { - higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) { - return false - } - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { - return false - } - } - if (lt) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomLTPre.major && - c.semver.minor === needDomLTPre.minor && - c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false - } - } - if (c.operator === '<' || c.operator === '<=') { - lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) { - return false - } - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { - return false - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false - } - } - - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false - } - - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false - } - - // we needed a prerelease range in a specific tuple, but didn't get one - // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, - // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { - return false - } - - return true -} - -// >=1.2.3 is lower than >1.2.3 -const higherGT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp > 0 ? a - : comp < 0 ? b - : b.operator === '>' && a.operator === '>=' ? b - : a -} - -// <=1.2.3 is higher than <1.2.3 -const lowerLT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp < 0 ? a - : comp > 0 ? b - : b.operator === '<' && a.operator === '<=' ? b - : a -} - -module.exports = subset - - -/***/ }), - -/***/ 12204: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(62614) - -// Mostly just for testing and legacy API reasons -const toComparators = (range, options) => - new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) - -module.exports = toComparators - - -/***/ }), - -/***/ 91117: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(62614) -const validRange = (range, options) => { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} -module.exports = validRange - - -/***/ }), - -/***/ 3194: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultDbStatementSerializer = void 0; -/** - * List of regexes and the number of arguments that should be serialized for matching commands. - * For example, HSET should serialize which key and field it's operating on, but not its value. - * Setting the subset to -1 will serialize all arguments. - * Commands without a match will have their first argument serialized. - * - * Refer to https://redis.io/commands/ for the full list. - */ -const serializationSubsets = [ - { - regex: /^ECHO/i, - args: 0, - }, - { - regex: /^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i, - args: 1, - }, - { - regex: /^(HSET|HMSET|LSET|LINSERT)/i, - args: 2, - }, - { - regex: /^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i, - args: -1, - }, -]; -/** - * Given the redis command name and arguments, return a combination of the - * command name + the allowed arguments according to `serializationSubsets`. - * @param cmdName The redis command name - * @param cmdArgs The redis command arguments - * @returns a combination of the command name + args according to `serializationSubsets`. - */ -const defaultDbStatementSerializer = (cmdName, cmdArgs) => { - var _a, _b; - if (Array.isArray(cmdArgs) && cmdArgs.length) { - const nArgsToSerialize = (_b = (_a = serializationSubsets.find(({ regex }) => { - return regex.test(cmdName); - })) === null || _a === void 0 ? void 0 : _a.args) !== null && _b !== void 0 ? _b : 0; - const argsToSerialize = nArgsToSerialize >= 0 ? cmdArgs.slice(0, nArgsToSerialize) : cmdArgs; - if (cmdArgs.length > argsToSerialize.length) { - argsToSerialize.push(`[${cmdArgs.length - nArgsToSerialize} other arguments]`); - } - return `${cmdName} ${argsToSerialize.join(' ')}`; - } - return cmdName; -}; -exports.defaultDbStatementSerializer = defaultDbStatementSerializer; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 72723: +/***/ 22153: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Resource = void 0; +exports.defaultResource = exports.emptyResource = exports.resourceFromDetectedResource = exports.resourceFromAttributes = void 0; const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); const semantic_conventions_1 = __nccwpck_require__(67275); -const core_1 = __nccwpck_require__(98156); -const platform_1 = __nccwpck_require__(7784); -/** - * A Resource describes the entity for which a signals (metrics or trace) are - * collected. - */ -class Resource { +const default_service_name_1 = __nccwpck_require__(4453); +const utils_1 = __nccwpck_require__(44298); +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( /** * A dictionary of attributes with string keys and values that provide * information about the entity as numbers, strings or booleans * TODO: Consider to add check/validation on attributes. */ - attributes, asyncAttributesPromise) { - var _a; - this._attributes = attributes; - this.asyncAttributesPending = asyncAttributesPromise != null; - this._syncAttributes = (_a = this._attributes) !== null && _a !== void 0 ? _a : {}; - this._asyncAttributesPromise = asyncAttributesPromise === null || asyncAttributesPromise === void 0 ? void 0 : asyncAttributesPromise.then(asyncAttributes => { - this._attributes = Object.assign({}, this._attributes, asyncAttributes); - this.asyncAttributesPending = false; - return asyncAttributes; - }, err => { - api_1.diag.debug("a resource's async attributes promise rejected: %s", err); - this.asyncAttributesPending = false; - return {}; + resource, options) { + const attributes = resource.attributes ?? {}; + this._rawAttributes = Object.entries(attributes).map(([k, v]) => { + if ((0, utils_1.isPromiseLike)(v)) { + // side-effect + this._asyncAttributesPending = true; + } + return [k, v]; }); + this._rawAttributes = guardedRawAttributes(this._rawAttributes); + this._schemaUrl = validateSchemaUrl(options?.schemaUrl); } - /** - * Returns an empty Resource - */ - static empty() { - return Resource.EMPTY; + get asyncAttributesPending() { + return this._asyncAttributesPending; } - /** - * Returns a Resource that identifies the SDK in use. - */ - static default() { - return new Resource({ - [semantic_conventions_1.SEMRESATTRS_SERVICE_NAME]: (0, platform_1.defaultServiceName)(), - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE], - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME], - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION], - }); + 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() { - var _a; if (this.asyncAttributesPending) { api_1.diag.error('Accessing resource attributes before async attributes settled'); } - return (_a = this._attributes) !== null && _a !== void 0 ? _a : {}; - } - /** - * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to - * this Resource's attributes. This is useful in exporters to block until resource detection - * has finished. - */ - async waitForAsyncAttributes() { - if (this.asyncAttributesPending) { - await this._asyncAttributesPromise; + 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; + } + } + // only memoize output if all attributes are settled + if (!this._asyncAttributesPending) { + this._memoizedAttributes = attrs; + } + return attrs; } - /** - * Returns a new, merged {@link Resource} by merging the current Resource - * with the other Resource. In case of a collision, other Resource takes - * precedence. - * - * @param other the Resource that will be merged with this. - * @returns the newly merged Resource. - */ - merge(other) { - var _a; - if (!other) + getRawAttributes() { + return this._rawAttributes; + } + get schemaUrl() { + return this._schemaUrl; + } + merge(resource) { + if (resource == null) return this; - // SpanAttributes from other resource overwrite attributes from this resource. - const mergedSyncAttributes = Object.assign(Object.assign({}, this._syncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)); - if (!this._asyncAttributesPromise && - !other._asyncAttributesPromise) { - return new Resource(mergedSyncAttributes); - } - const mergedAttributesPromise = Promise.all([ - this._asyncAttributesPromise, - other._asyncAttributesPromise, - ]).then(([thisAsyncAttributes, otherAsyncAttributes]) => { - var _a; - return Object.assign(Object.assign(Object.assign(Object.assign({}, this._syncAttributes), thisAsyncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)), otherAsyncAttributes); - }); - return new Resource(mergedSyncAttributes, mergedAttributesPromise); + // Order is important + // Spec states incoming attributes override existing attributes + const mergedSchemaUrl = mergeSchemaUrl(this, resource); + const mergedOptions = mergedSchemaUrl + ? { schemaUrl: mergedSchemaUrl } + : undefined; + return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions); } } -exports.Resource = Resource; -Resource.EMPTY = new Resource({}); -//# sourceMappingURL=Resource.js.map +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 undefined; + }), + ]; + } + return [k, v]; + }); +} +function validateSchemaUrl(schemaUrl) { + if (typeof schemaUrl === 'string' || schemaUrl === undefined) { + return schemaUrl; + } + api_1.diag.warn('Schema URL must be string or undefined, got %s. Schema URL will be ignored.', schemaUrl); + return undefined; +} +function mergeSchemaUrl(old, updating) { + const oldSchemaUrl = old?.schemaUrl; + const updatingSchemaUrl = updating?.schemaUrl; + const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === ''; + const isUpdatingEmpty = updatingSchemaUrl === undefined || 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); + return undefined; +} +//# sourceMappingURL=ResourceImpl.js.map + +/***/ }), + +/***/ 4453: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +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 === undefined) { + 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 = undefined; +} +exports._clearDefaultServiceNameCache = _clearDefaultServiceNameCache; +//# sourceMappingURL=default-service-name.js.map /***/ }), @@ -43590,219 +9951,36 @@ Resource.EMPTY = new Resource({}); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.detectResourcesSync = exports.detectResources = void 0; -const Resource_1 = __nccwpck_require__(72723); +exports.detectResources = void 0; const api_1 = __nccwpck_require__(65163); -const utils_1 = __nccwpck_require__(44298); +const ResourceImpl_1 = __nccwpck_require__(22153); /** - * Runs all resource detectors and returns the results merged into a single Resource. Promise - * does not resolve until all the underlying detectors have resolved, unlike - * detectResourcesSync. + * Runs all resource detectors and returns the results merged into a single Resource. * - * @deprecated use detectResourcesSync() instead. * @param config Configuration for resource detection */ -const detectResources = async (config = {}) => { - const resources = await Promise.all((config.detectors || []).map(async (d) => { +const detectResources = (config = {}) => { + const resources = (config.detectors || []).map(d => { try { - const resource = await d.detect(config); + 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 Resource_1.Resource.empty(); + return (0, ResourceImpl_1.emptyResource)(); } - })); - // Future check if verbose logging is enabled issue #1903 - logResources(resources); - return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); + }); + return resources.reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); }; exports.detectResources = detectResources; -/** - * Runs all resource detectors synchronously, merging their results. In case of attribute collision later resources will take precedence. - * - * @param config Configuration for resource detection - */ -const detectResourcesSync = (config = {}) => { - var _a; - const resources = ((_a = config.detectors) !== null && _a !== void 0 ? _a : []).map((d) => { - try { - const resourceOrPromise = d.detect(config); - let resource; - if ((0, utils_1.isPromiseLike)(resourceOrPromise)) { - const createPromise = async () => { - var _a; - const resolvedResource = await resourceOrPromise; - await ((_a = resolvedResource.waitForAsyncAttributes) === null || _a === void 0 ? void 0 : _a.call(resolvedResource)); - return resolvedResource.attributes; - }; - resource = new Resource_1.Resource({}, createPromise()); - } - else { - resource = resourceOrPromise; - } - if (resource.waitForAsyncAttributes) { - void resource - .waitForAsyncAttributes() - .then(() => api_1.diag.debug(`${d.constructor.name} found resource.`, resource)); - } - else { - api_1.diag.debug(`${d.constructor.name} found resource.`, resource); - } - return resource; - } - catch (e) { - api_1.diag.error(`${d.constructor.name} failed: ${e.message}`); - return Resource_1.Resource.empty(); - } - }); - const mergedResources = resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); - if (mergedResources.waitForAsyncAttributes) { - void mergedResources.waitForAsyncAttributes().then(() => { - // Future check if verbose logging is enabled issue #1903 - logResources(resources); - }); - } - return mergedResources; -}; -exports.detectResourcesSync = detectResourcesSync; -/** - * Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided. - * - * @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored. - */ -const logResources = (resources) => { - resources.forEach(resource => { - // Print only populated resources - if (Object.keys(resource.attributes).length > 0) { - const resourceDebugString = JSON.stringify(resource.attributes, null, 4); - api_1.diag.verbose(resourceDebugString); - } - }); -}; //# sourceMappingURL=detect-resources.js.map /***/ }), -/***/ 15969: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.browserDetector = void 0; -const BrowserDetectorSync_1 = __nccwpck_require__(33010); -/** - * BrowserDetector will be used to detect the resources related to browser. - */ -class BrowserDetector { - detect(config) { - return Promise.resolve(BrowserDetectorSync_1.browserDetectorSync.detect(config)); - } -} -exports.browserDetector = new BrowserDetector(); -//# sourceMappingURL=BrowserDetector.js.map - -/***/ }), - -/***/ 33010: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.browserDetectorSync = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const api_1 = __nccwpck_require__(65163); -const Resource_1 = __nccwpck_require__(72723); -/** - * BrowserDetectorSync will be used to detect the resources related to browser. - */ -class BrowserDetectorSync { - detect(config) { - var _a, _b, _c; - const isBrowser = typeof navigator !== 'undefined' && - ((_b = (_a = global.process) === null || _a === void 0 ? void 0 : _a.versions) === null || _b === void 0 ? void 0 : _b.node) === undefined && // Node.js v21 adds `navigator` - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore don't have Bun types - ((_c = global.Bun) === null || _c === void 0 ? void 0 : _c.version) === undefined; // Bun (bun.sh) defines `navigator` - if (!isBrowser) { - return Resource_1.Resource.empty(); - } - const browserResource = { - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'browser', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: navigator.userAgent, - }; - return this._getResourceAttributes(browserResource, config); - } - /** - * Validates process resource attribute map from process variables - * - * @param browserResource The un-sanitized resource attributes from process as key/value pairs. - * @param config: Config - * @returns The sanitized resource attributes. - */ - _getResourceAttributes(browserResource, _config) { - if (browserResource[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION] === '') { - api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. '); - return Resource_1.Resource.empty(); - } - else { - return new Resource_1.Resource(Object.assign({}, browserResource)); - } - } -} -exports.browserDetectorSync = new BrowserDetectorSync(); -//# sourceMappingURL=BrowserDetectorSync.js.map - -/***/ }), - /***/ 22474: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -43810,88 +9988,24 @@ exports.browserDetectorSync = new BrowserDetectorSync(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.envDetector = void 0; -const EnvDetectorSync_1 = __nccwpck_require__(84565); +const api_1 = __nccwpck_require__(65163); +const semantic_conventions_1 = __nccwpck_require__(67275); +const core_1 = __nccwpck_require__(89736); /** * EnvDetector can be used to detect the presence of and create a Resource * from the OTEL_RESOURCE_ATTRIBUTES environment variable. */ class EnvDetector { - /** - * 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) { - return Promise.resolve(EnvDetectorSync_1.envDetectorSync.detect(config)); - } -} -exports.envDetector = new EnvDetector(); -//# sourceMappingURL=EnvDetector.js.map - -/***/ }), - -/***/ 84565: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.envDetectorSync = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(98156); -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(72723); -/** - * EnvDetectorSync can be used to detect the presence of and create a Resource - * from the OTEL_RESOURCE_ATTRIBUTES environment variable. - */ -class EnvDetectorSync { - constructor() { - // Type, attribute keys, and attribute values should not exceed 256 characters. - this._MAX_LENGTH = 255; - // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes. - this._COMMA_SEPARATOR = ','; - // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='. - this._LABEL_KEY_VALUE_SPLITTER = '='; - this._ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + - this._MAX_LENGTH + - ' characters.'; - this._ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' + - this._MAX_LENGTH + - ' characters.'; - } + // Type, attribute keys, and attribute values should not exceed 256 characters. + _MAX_LENGTH = 255; + // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes. + _COMMA_SEPARATOR = ','; + // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='. + _LABEL_KEY_VALUE_SPLITTER = '='; /** * Returns a {@link Resource} populated with attributes from the * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async @@ -43901,94 +10015,105 @@ class EnvDetectorSync { */ detect(_config) { const attributes = {}; - const env = (0, core_1.getEnv)(); - const rawAttributes = env.OTEL_RESOURCE_ATTRIBUTES; - const serviceName = env.OTEL_SERVICE_NAME; + 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}`); + api_1.diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); } } if (serviceName) { - attributes[semantic_conventions_1.SEMRESATTRS_SERVICE_NAME] = serviceName; + attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; } - return new Resource_1.Resource(attributes); + 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. + * 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 sanitized resource attributes. + * @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, -1); + const rawAttributes = rawEnvAttributes + .split(this._COMMA_SEPARATOR) + .filter(attr => attr.trim() !== ''); // Filter out empty entries for (const rawAttribute of rawAttributes) { - const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER); + // Per spec: ',' and '=' MUST be percent-encoded in keys and values. + // If we get != 2 parts, there's an unencoded '=' which is an error. if (keyValuePair.length !== 2) { - continue; + 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."); } - let [key, value] = keyValuePair; - // Leading and trailing whitespaces are trimmed. - key = key.trim(); - value = value.trim().split(/^"|"$/).join(''); - if (!this._isValidAndNotEmpty(key)) { - throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); + 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}".`); } - if (!this._isValid(value)) { - throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); + let decodedKey; + let decodedValue; + try { + decodedKey = decodeURIComponent(key); + decodedValue = decodeURIComponent(value); } - attributes[key] = 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; } - /** - * 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); - } - // https://www.w3.org/TR/baggage/#definition - _isBaggageOctetString(str) { - for (let i = 0; i < str.length; i++) { - const ch = str.charCodeAt(i); - if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) { - return false; - } - } - return true; - } - /** - * Determines whether the given String is a valid printable ASCII string with - * a length greater than 0 and not exceed _MAX_LENGTH characters. - * - * @param str The String to be validated. - * @returns Whether the String is valid and not empty. - */ - _isValidAndNotEmpty(str) { - return str.length > 0 && this._isValid(str); +} +exports.envDetector = new EnvDetector(); +//# sourceMappingURL=EnvDetector.js.map + +/***/ }), + +/***/ 39838: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.noopDetector = exports.NoopDetector = void 0; +class NoopDetector { + detect() { + return { + attributes: {}, + }; } } -exports.envDetectorSync = new EnvDetectorSync(); -//# sourceMappingURL=EnvDetectorSync.js.map +exports.NoopDetector = NoopDetector; +exports.noopDetector = new NoopDetector(); +//# sourceMappingURL=NoopDetector.js.map /***/ }), @@ -43999,37 +10124,19 @@ exports.envDetectorSync = new EnvDetectorSync(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.envDetectorSync = exports.browserDetectorSync = exports.envDetector = exports.browserDetector = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; -var platform_1 = __nccwpck_require__(3098); -Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return platform_1.hostDetector; } })); -Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return platform_1.hostDetectorSync; } })); -Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return platform_1.osDetector; } })); -Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return platform_1.osDetectorSync; } })); -Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return platform_1.processDetector; } })); -Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return platform_1.processDetectorSync; } })); -Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return platform_1.serviceInstanceIdDetectorSync; } })); -var BrowserDetector_1 = __nccwpck_require__(15969); -Object.defineProperty(exports, "browserDetector", ({ enumerable: true, get: function () { return BrowserDetector_1.browserDetector; } })); +exports.noopDetector = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = void 0; var EnvDetector_1 = __nccwpck_require__(22474); Object.defineProperty(exports, "envDetector", ({ enumerable: true, get: function () { return EnvDetector_1.envDetector; } })); -var BrowserDetectorSync_1 = __nccwpck_require__(33010); -Object.defineProperty(exports, "browserDetectorSync", ({ enumerable: true, get: function () { return BrowserDetectorSync_1.browserDetectorSync; } })); -var EnvDetectorSync_1 = __nccwpck_require__(84565); -Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: function () { return EnvDetectorSync_1.envDetectorSync; } })); +var platform_1 = __nccwpck_require__(3098); +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 = __nccwpck_require__(39838); +Object.defineProperty(exports, "noopDetector", ({ enumerable: true, get: function () { return NoopDetector_1.noopDetector; } })); //# sourceMappingURL=index.js.map /***/ }), @@ -44040,30 +10147,16 @@ Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: func "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; +exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 node_1 = __nccwpck_require__(29920); Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return node_1.hostDetector; } })); -Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return node_1.hostDetectorSync; } })); Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return node_1.osDetector; } })); -Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return node_1.osDetectorSync; } })); Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return node_1.processDetector; } })); -Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return node_1.processDetectorSync; } })); -Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return node_1.serviceInstanceIdDetectorSync; } })); +Object.defineProperty(exports, "serviceInstanceIdDetector", ({ enumerable: true, get: function () { return node_1.serviceInstanceIdDetector; } })); //# sourceMappingURL=index.js.map /***/ }), @@ -44075,29 +10168,26 @@ Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: t /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.hostDetector = void 0; -const HostDetectorSync_1 = __nccwpck_require__(13172); +const semconv_1 = __nccwpck_require__(24466); +const os_1 = __nccwpck_require__(22037); +const getMachineId_1 = __nccwpck_require__(11804); +const utils_1 = __nccwpck_require__(88227); /** * HostDetector detects the resources related to the host current process is * running on. Currently only non-cloud-based attributes are included. */ class HostDetector { detect(_config) { - return Promise.resolve(HostDetectorSync_1.hostDetectorSync.detect(_config)); + const attributes = { + [semconv_1.ATTR_HOST_NAME]: (0, os_1.hostname)(), + [semconv_1.ATTR_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1.arch)()), + [semconv_1.ATTR_HOST_ID]: (0, getMachineId_1.getMachineId)(), + }; + return { attributes }; } } exports.hostDetector = new HostDetector(); @@ -44105,60 +10195,6 @@ exports.hostDetector = new HostDetector(); /***/ }), -/***/ 13172: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hostDetectorSync = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(72723); -const os_1 = __nccwpck_require__(22037); -const utils_1 = __nccwpck_require__(88227); -const getMachineId_1 = __nccwpck_require__(11804); -/** - * HostDetectorSync detects the resources related to the host current process is - * running on. Currently only non-cloud-based attributes are included. - */ -class HostDetectorSync { - detect(_config) { - const attributes = { - [semantic_conventions_1.SEMRESATTRS_HOST_NAME]: (0, os_1.hostname)(), - [semantic_conventions_1.SEMRESATTRS_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1.arch)()), - }; - return new Resource_1.Resource(attributes, this._getAsyncAttributes()); - } - _getAsyncAttributes() { - return (0, getMachineId_1.getMachineId)().then(machineId => { - const attributes = {}; - if (machineId) { - attributes[semantic_conventions_1.SEMRESATTRS_HOST_ID] = machineId; - } - return attributes; - }); - } -} -exports.hostDetectorSync = new HostDetectorSync(); -//# sourceMappingURL=HostDetectorSync.js.map - -/***/ }), - /***/ 58102: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -44166,29 +10202,24 @@ exports.hostDetectorSync = new HostDetectorSync(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.osDetector = void 0; -const OSDetectorSync_1 = __nccwpck_require__(53136); +const semconv_1 = __nccwpck_require__(24466); +const os_1 = __nccwpck_require__(22037); +const utils_1 = __nccwpck_require__(88227); /** * OSDetector detects the resources related to the operating system (OS) on * which the process represented by this resource is running. */ class OSDetector { detect(_config) { - return Promise.resolve(OSDetectorSync_1.osDetectorSync.detect(_config)); + const attributes = { + [semconv_1.ATTR_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), + [semconv_1.ATTR_OS_VERSION]: (0, os_1.release)(), + }; + return { attributes }; } } exports.osDetector = new OSDetector(); @@ -44196,50 +10227,6 @@ exports.osDetector = new OSDetector(); /***/ }), -/***/ 53136: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.osDetectorSync = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(72723); -const os_1 = __nccwpck_require__(22037); -const utils_1 = __nccwpck_require__(88227); -/** - * OSDetectorSync detects the resources related to the operating system (OS) on - * which the process represented by this resource is running. - */ -class OSDetectorSync { - detect(_config) { - const attributes = { - [semantic_conventions_1.SEMRESATTRS_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), - [semantic_conventions_1.SEMRESATTRS_OS_VERSION]: (0, os_1.release)(), - }; - return new Resource_1.Resource(attributes); - } -} -exports.osDetectorSync = new OSDetectorSync(); -//# sourceMappingURL=OSDetectorSync.js.map - -/***/ }), - /***/ 62471: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -44247,29 +10234,43 @@ exports.osDetectorSync = new OSDetectorSync(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.processDetector = void 0; -const ProcessDetectorSync_1 = __nccwpck_require__(68786); +const api_1 = __nccwpck_require__(65163); +const semconv_1 = __nccwpck_require__(24466); +const os = __nccwpck_require__(22037); /** * ProcessDetector will be used to detect the resources related current process running * and being instrumented from the NodeJS Process module. */ class ProcessDetector { - detect(config) { - return Promise.resolve(ProcessDetectorSync_1.processDetectorSync.detect(config)); + 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(); @@ -44277,110 +10278,36 @@ exports.processDetector = new ProcessDetector(); /***/ }), -/***/ 68786: +/***/ 4663: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.processDetectorSync = void 0; -const api_1 = __nccwpck_require__(65163); -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(72723); -const os = __nccwpck_require__(22037); -/** - * ProcessDetectorSync will be used to detect the resources related current process running - * and being instrumented from the NodeJS Process module. - */ -class ProcessDetectorSync { - detect(_config) { - const attributes = { - [semantic_conventions_1.SEMRESATTRS_PROCESS_PID]: process.pid, - [semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_NAME]: process.title, - [semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_PATH]: process.execPath, - [semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND_ARGS]: [ - process.argv[0], - ...process.execArgv, - ...process.argv.slice(1), - ], - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: process.versions.node, - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'nodejs', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js', - }; - if (process.argv.length > 1) { - attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND] = process.argv[1]; - } - try { - const userInfo = os.userInfo(); - attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_OWNER] = userInfo.username; - } - catch (e) { - api_1.diag.debug(`error obtaining process owner: ${e}`); - } - return new Resource_1.Resource(attributes); - } -} -exports.processDetectorSync = new ProcessDetectorSync(); -//# sourceMappingURL=ProcessDetectorSync.js.map - -/***/ }), - -/***/ 47750: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serviceInstanceIdDetectorSync = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(72723); +exports.serviceInstanceIdDetector = void 0; +const semconv_1 = __nccwpck_require__(24466); const crypto_1 = __nccwpck_require__(6113); /** - * ServiceInstanceIdDetectorSync detects the resources related to the service instance ID. + * ServiceInstanceIdDetector detects the resources related to the service instance ID. */ -class ServiceInstanceIdDetectorSync { +class ServiceInstanceIdDetector { detect(_config) { - const attributes = { - [semantic_conventions_1.SEMRESATTRS_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)(), + return { + attributes: { + [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)(), + }, }; - return new Resource_1.Resource(attributes); } } /** * @experimental */ -exports.serviceInstanceIdDetectorSync = new ServiceInstanceIdDetectorSync(); -//# sourceMappingURL=ServiceInstanceIdDetectorSync.js.map +exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); +//# sourceMappingURL=ServiceInstanceIdDetector.js.map /***/ }), @@ -44391,290 +10318,22 @@ exports.serviceInstanceIdDetectorSync = new ServiceInstanceIdDetectorSync(); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; +exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; var HostDetector_1 = __nccwpck_require__(59251); Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return HostDetector_1.hostDetector; } })); -var HostDetectorSync_1 = __nccwpck_require__(13172); -Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return HostDetectorSync_1.hostDetectorSync; } })); var OSDetector_1 = __nccwpck_require__(58102); Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return OSDetector_1.osDetector; } })); -var OSDetectorSync_1 = __nccwpck_require__(53136); -Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return OSDetectorSync_1.osDetectorSync; } })); var ProcessDetector_1 = __nccwpck_require__(62471); Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return ProcessDetector_1.processDetector; } })); -var ProcessDetectorSync_1 = __nccwpck_require__(68786); -Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return ProcessDetectorSync_1.processDetectorSync; } })); -var ServiceInstanceIdDetectorSync_1 = __nccwpck_require__(47750); -Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return ServiceInstanceIdDetectorSync_1.serviceInstanceIdDetectorSync; } })); +var ServiceInstanceIdDetector_1 = __nccwpck_require__(4663); +Object.defineProperty(exports, "serviceInstanceIdDetector", ({ enumerable: true, get: function () { return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; } })); //# sourceMappingURL=index.js.map /***/ }), -/***/ 70055: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.execAsync = void 0; -const child_process = __nccwpck_require__(32081); -const util = __nccwpck_require__(73837); -exports.execAsync = util.promisify(child_process.exec); -//# sourceMappingURL=execAsync.js.map - -/***/ }), - -/***/ 82605: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -const fs_1 = __nccwpck_require__(57147); -const execAsync_1 = __nccwpck_require__(70055); -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - try { - const result = await fs_1.promises.readFile('/etc/hostid', { encoding: 'utf8' }); - return result.trim(); - } - catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - try { - const result = await (0, execAsync_1.execAsync)('kenv -q smbios.system.uuid'); - return result.stdout.trim(); - } - catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-bsd.js.map - -/***/ }), - -/***/ 32685: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -const execAsync_1 = __nccwpck_require__(70055); -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - try { - const result = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"'); - const idLine = result.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}`); - } - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-darwin.js.map - -/***/ }), - -/***/ 8319: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const fs_1 = __nccwpck_require__(57147); -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id']; - for (const path of paths) { - try { - const result = await fs_1.promises.readFile(path, { encoding: 'utf8' }); - return result.trim(); - } - catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-linux.js.map - -/***/ }), - -/***/ 56083: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - api_1.diag.debug('could not read machine-id: unsupported platform'); - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-unsupported.js.map - -/***/ }), - -/***/ 29937: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -const process = __nccwpck_require__(77282); -const execAsync_1 = __nccwpck_require__(70055); -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - const args = 'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid'; - let command = '%windir%\\System32\\REG.exe'; - if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) { - command = '%windir%\\sysnative\\cmd.exe /c ' + command; - } - try { - const result = await (0, execAsync_1.execAsync)(`${command} ${args}`); - const parts = result.stdout.split('REG_SZ'); - if (parts.length === 2) { - return parts[1].trim(); - } - } - catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-win.js.map - -/***/ }), - /***/ 11804: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { @@ -44684,38 +10343,36 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getMachineId = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ const process = __nccwpck_require__(77282); -let getMachineId; -exports.getMachineId = getMachineId; -switch (process.platform) { - case 'darwin': - (exports.getMachineId = getMachineId = (__nccwpck_require__(32685)/* .getMachineId */ .$)); - break; - case 'linux': - (exports.getMachineId = getMachineId = (__nccwpck_require__(8319)/* .getMachineId */ .$)); - break; - case 'freebsd': - (exports.getMachineId = getMachineId = (__nccwpck_require__(82605)/* .getMachineId */ .$)); - break; - case 'win32': - (exports.getMachineId = getMachineId = (__nccwpck_require__(29937)/* .getMachineId */ .$)); - break; - default: - (exports.getMachineId = getMachineId = (__nccwpck_require__(56083)/* .getMachineId */ .$)); +let getMachineIdImpl; +async function getMachineId() { + if (!getMachineIdImpl) { + switch (process.platform) { + case 'darwin': + getMachineIdImpl = (await __nccwpck_require__.e(/* import() */ 685).then(__nccwpck_require__.bind(__nccwpck_require__, 32685))) + .getMachineId; + break; + case 'linux': + getMachineIdImpl = (await __nccwpck_require__.e(/* import() */ 319).then(__nccwpck_require__.bind(__nccwpck_require__, 8319))) + .getMachineId; + break; + case 'freebsd': + getMachineIdImpl = (await __nccwpck_require__.e(/* import() */ 605).then(__nccwpck_require__.bind(__nccwpck_require__, 82605))).getMachineId; + break; + case 'win32': + getMachineIdImpl = (await __nccwpck_require__.e(/* import() */ 937).then(__nccwpck_require__.bind(__nccwpck_require__, 29937))).getMachineId; + break; + default: + getMachineIdImpl = (await __nccwpck_require__.e(/* import() */ 83).then(__nccwpck_require__.bind(__nccwpck_require__, 56083))) + .getMachineId; + break; + } + } + return getMachineIdImpl(); } +exports.getMachineId = getMachineId; //# sourceMappingURL=getMachineId.js.map /***/ }), @@ -44729,18 +10386,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.normalizeType = exports.normalizeArch = void 0; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ const normalizeArch = (nodeArchString) => { // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec: @@ -44781,127 +10427,356 @@ exports.normalizeType = normalizeType; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.detectResources = exports.detectResourcesSync = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = exports.envDetectorSync = exports.envDetector = exports.browserDetectorSync = exports.browserDetector = exports.defaultServiceName = exports.Resource = void 0; -var Resource_1 = __nccwpck_require__(72723); -Object.defineProperty(exports, "Resource", ({ enumerable: true, get: function () { return Resource_1.Resource; } })); -var platform_1 = __nccwpck_require__(7784); -Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return platform_1.defaultServiceName; } })); -var detectors_1 = __nccwpck_require__(24918); -Object.defineProperty(exports, "browserDetector", ({ enumerable: true, get: function () { return detectors_1.browserDetector; } })); -Object.defineProperty(exports, "browserDetectorSync", ({ enumerable: true, get: function () { return detectors_1.browserDetectorSync; } })); -Object.defineProperty(exports, "envDetector", ({ enumerable: true, get: function () { return detectors_1.envDetector; } })); -Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: function () { return detectors_1.envDetectorSync; } })); -Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return detectors_1.hostDetector; } })); -Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return detectors_1.hostDetectorSync; } })); -Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return detectors_1.osDetector; } })); -Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return detectors_1.osDetectorSync; } })); -Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return detectors_1.processDetector; } })); -Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return detectors_1.processDetectorSync; } })); -Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return detectors_1.serviceInstanceIdDetectorSync; } })); +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 = __nccwpck_require__(990); -Object.defineProperty(exports, "detectResourcesSync", ({ enumerable: true, get: function () { return detect_resources_1.detectResourcesSync; } })); Object.defineProperty(exports, "detectResources", ({ enumerable: true, get: function () { return detect_resources_1.detectResources; } })); +var detectors_1 = __nccwpck_require__(24918); +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 = __nccwpck_require__(22153); +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 = __nccwpck_require__(4453); +Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return default_service_name_1.defaultServiceName; } })); //# sourceMappingURL=index.js.map /***/ }), -/***/ 7784: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultServiceName = void 0; -var node_1 = __nccwpck_require__(90342); -Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return node_1.defaultServiceName; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 85671: +/***/ 24466: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultServiceName = void 0; -function defaultServiceName() { - return `unknown_service:${process.argv0}`; -} -exports.defaultServiceName = defaultServiceName; -//# sourceMappingURL=default-service-name.js.map - -/***/ }), - -/***/ 90342: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultServiceName = void 0; +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; /* - * Copyright The OpenTelemetry 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 - * - * https://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. + * This file contains a copy of unstable semantic convention definitions + * used by this package. + * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv */ -var default_service_name_1 = __nccwpck_require__(85671); -Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return default_service_name_1.defaultServiceName; } })); -//# sourceMappingURL=index.js.map +/** + * 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'; +//# sourceMappingURL=semconv.js.map /***/ }), @@ -44912,2675 +10787,137 @@ Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: f /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isPromiseLike = void 0; const isPromiseLike = (val) => { - return (val !== null && typeof val === 'object' && typeof val.then === 'function'); + return (val !== null && + typeof val === 'object' && + typeof val.then === 'function'); }; exports.isPromiseLike = isPromiseLike; //# sourceMappingURL=utils.js.map /***/ }), -/***/ 79285: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExportResultCode = void 0; -var ExportResultCode; -(function (ExportResultCode) { - ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; -})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); -//# sourceMappingURL=ExportResult.js.map - -/***/ }), - -/***/ 15121: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = ','; -// Name of the http header used to propagate the baggage -exports.BAGGAGE_HEADER = 'baggage'; -// Maximum number of name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; -// Maximum number of bytes per a single name-value pair allowed by w3c spec -exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; -// Maximum total length of all name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; -//# sourceMappingURL=constants.js.map - -/***/ }), - -/***/ 46439: +/***/ 69453: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CBaggagePropagator = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(54777); -const constants_1 = __nccwpck_require__(15121); -const utils_1 = __nccwpck_require__(31576); +exports.BasicTracerProvider = void 0; +const core_1 = __nccwpck_require__(89736); +const config_1 = __nccwpck_require__(91); +const utility_1 = __nccwpck_require__(54324); +const sdk_trace_1 = __nccwpck_require__(1516); /** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ + * A TracerProvider implementation that reads configuration defaults from + * OTEL_* environment variables per + * https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ */ -class W3CBaggagePropagator { - inject(context, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context); - if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) - return; - const keyPairs = (0, utils_1.getKeyPairs)(baggage) - .filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }) - .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); - if (headerValue.length > 0) { - setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - } - extract(context, 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; - const baggage = {}; - if (baggageString.length === 0) { - return context; - } - const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); - pairs.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; - } - return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; - } -} -exports.W3CBaggagePropagator = W3CBaggagePropagator; -//# sourceMappingURL=W3CBaggagePropagator.js.map - -/***/ }), - -/***/ 31576: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const constants_1 = __nccwpck_require__(15121); -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)}`; - // include opaque metadata if provided - // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation - if (value.metadata !== undefined) { - 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) { - if (typeof value !== 'string' || value.length === 0) - return {}; - return value - .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) - .map(entry => { - return parsePairKeyValue(entry); - }) - .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) - .reduce((headers, keyPair) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - headers[keyPair.key] = keyPair.value; - return headers; - }, {}); -} -exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 46620: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 - */ -class AnchoredClock { - /** - * 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; -//# sourceMappingURL=anchored-clock.js.map - -/***/ }), - -/***/ 14764: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; -const api_1 = __nccwpck_require__(65163); -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) { - // null/undefined elements are allowed - if (element == null) - continue; - if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; - continue; - } - // encountered an invalid primitive - 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; -} -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 85207: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; -const logging_error_handler_1 = __nccwpck_require__(27173); -/** The global error handler delegate */ -let delegateHandler = (0, 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 (_a) { } // eslint-disable-line no-empty -} -exports.globalErrorHandler = globalErrorHandler; -//# sourceMappingURL=global-error-handler.js.map - -/***/ }), - -/***/ 78799: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBinary = void 0; -function intValue(charCode) { - // 0-9 - if (charCode >= 48 && charCode <= 57) { - return charCode - 48; - } - // a-f - if (charCode >= 97 && charCode <= 102) { - return charCode - 87; - } - // A-F - 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; -//# sourceMappingURL=hex-to-binary.js.map - -/***/ }), - -/***/ 27173: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loggingErrorHandler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * 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; -} -//# sourceMappingURL=logging-error-handler.js.map - -/***/ }), - -/***/ 45604: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = __nccwpck_require__(3887); -const NANOSECOND_DIGITS = 9; -const NANOSECOND_DIGITS_IN_MILLIS = 6; -const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); -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 / 1000; - // Decimals only. - const seconds = Math.trunc(epochSeconds); - // Round sub-nanosecond accuracy to nanosecond. - const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); - return [seconds, nanos]; -} -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) { - const timeOrigin = millisToHrTime(getTimeOrigin()); - const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); - return addHrTimes(timeOrigin, now); -} -exports.hrTime = hrTime; -/** - * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time - */ -function timeInputToHrTime(time) { - // process.hrtime - if (isTimeInputHrTime(time)) { - return time; - } - else if (typeof time === 'number') { - // Must be a performance.now() if it's smaller than process start time. - if (time < getTimeOrigin()) { - return hrTime(time); - } - else { - // epoch milliseconds or performance.timeOrigin - 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]; - // overflow - if (nanos < 0) { - seconds -= 1; - // negate - 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); - const date = new Date(time[0] * 1000).toISOString(); - return date.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]]; - // Nanoseconds - if (out[1] >= SECOND_TO_NANOSECONDS) { - out[1] -= SECOND_TO_NANOSECONDS; - out[0] += 1; - } - return out; -} -exports.addHrTimes = addHrTimes; -//# sourceMappingURL=time.js.map - -/***/ }), - -/***/ 98156: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = 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.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = 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.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; -exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; -var W3CBaggagePropagator_1 = __nccwpck_require__(46439); -Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); -var anchored_clock_1 = __nccwpck_require__(46620); -Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); -var attributes_1 = __nccwpck_require__(14764); -Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); -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 = __nccwpck_require__(85207); -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 = __nccwpck_require__(27173); -Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); -var time_1 = __nccwpck_require__(45604); -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 hex_to_binary_1 = __nccwpck_require__(78799); -Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); -var ExportResult_1 = __nccwpck_require__(79285); -Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); -const utils_1 = __nccwpck_require__(31576); -exports.baggageUtils = { - getKeyPairs: utils_1.getKeyPairs, - serializeKeyPairs: utils_1.serializeKeyPairs, - parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, - parsePairKeyValue: utils_1.parsePairKeyValue, -}; -var platform_1 = __nccwpck_require__(3887); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); -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, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); -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 = __nccwpck_require__(24627); -Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); -var W3CTraceContextPropagator_1 = __nccwpck_require__(93280); -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 = __nccwpck_require__(91787); -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 AlwaysOffSampler_1 = __nccwpck_require__(8204); -Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); -var AlwaysOnSampler_1 = __nccwpck_require__(81598); -Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); -var ParentBasedSampler_1 = __nccwpck_require__(7291); -Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); -var TraceIdRatioBasedSampler_1 = __nccwpck_require__(17973); -Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); -var suppress_tracing_1 = __nccwpck_require__(54777); -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 = __nccwpck_require__(87297); -Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); -var environment_1 = __nccwpck_require__(50157); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); -Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); -var merge_1 = __nccwpck_require__(60317); -Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); -var sampling_1 = __nccwpck_require__(18963); -Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); -var timeout_1 = __nccwpck_require__(39223); -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 = __nccwpck_require__(17839); -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 wrap_1 = __nccwpck_require__(46644); -Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); -var callback_1 = __nccwpck_require__(57297); -Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); -var version_1 = __nccwpck_require__(12421); -Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); -const exporter_1 = __nccwpck_require__(5786); -exports.internal = { - _export: exporter_1._export, -}; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 5786: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._export = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(54777); -/** - * @internal - * Shared functionality used by Exporters while exporting data, including suppression of Traces. - */ -function _export(exporter, arg) { - return new Promise(resolve => { - // prevent downstream exporter calls from generating spans - api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { - exporter.export(arg, (result) => { - resolve(result); - }); - }); - }); -} -exports._export = _export; -//# sourceMappingURL=exporter.js.map - -/***/ }), - -/***/ 54107: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = 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; -//# sourceMappingURL=validators.js.map - -/***/ }), - -/***/ 3887: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var node_1 = __nccwpck_require__(83021); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); -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, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 10720: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = void 0; -const SPAN_ID_BYTES = 8; -const TRACE_ID_BYTES = 16; -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - */ -class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.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++) { - // unsigned right shift drops decimal part of the number - // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE - SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); - } - // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated - 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); - }; -} -//# sourceMappingURL=RandomIdGenerator.js.map - -/***/ }), - -/***/ 1518: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEnvWithoutDefaults = exports.getEnv = void 0; -const environment_1 = __nccwpck_require__(50157); -/** - * Gets the environment variables - */ -function getEnv() { - const processEnv = (0, environment_1.parseEnvironment)(process.env); - return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); -} -exports.getEnv = getEnv; -function getEnvWithoutDefaults() { - return (0, environment_1.parseEnvironment)(process.env); -} -exports.getEnvWithoutDefaults = getEnvWithoutDefaults; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 71595: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 64978: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBase64 = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const hex_to_binary_1 = __nccwpck_require__(78799); -function hexToBase64(hexStr) { - return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); -} -exports.hexToBase64 = hexToBase64; -//# sourceMappingURL=hex-to-base64.js.map - -/***/ }), - -/***/ 83021: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; -var environment_1 = __nccwpck_require__(1518); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); -var globalThis_1 = __nccwpck_require__(71595); -Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); -var hex_to_base64_1 = __nccwpck_require__(64978); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); -var RandomIdGenerator_1 = __nccwpck_require__(10720); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); -var performance_1 = __nccwpck_require__(38502); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); -var sdk_info_1 = __nccwpck_require__(16826); -Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); -var timer_util_1 = __nccwpck_require__(17049); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 38502: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.otperformance = void 0; -const perf_hooks_1 = __nccwpck_require__(4074); -exports.otperformance = perf_hooks_1.performance; -//# sourceMappingURL=performance.js.map - -/***/ }), - -/***/ 16826: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SDK_INFO = void 0; -const version_1 = __nccwpck_require__(12421); -const semantic_conventions_1 = __nccwpck_require__(67275); -/** Constants describing the SDK in use */ -exports.SDK_INFO = { - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, -}; -//# sourceMappingURL=sdk-info.js.map - -/***/ }), - -/***/ 17049: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -function unrefTimer(timer) { - timer.unref(); -} -exports.unrefTimer = unrefTimer; -//# sourceMappingURL=timer-util.js.map - -/***/ }), - -/***/ 24627: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompositePropagator = void 0; -const api_1 = __nccwpck_require__(65163); -/** Combines multiple propagators into a single propagator. */ -class CompositePropagator { - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ +class BasicTracerProvider extends sdk_trace_1.TracerProvider { constructor(config = {}) { - var _a; - this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; - this._fields = Array.from(new Set(this._propagators - // older propagators may not have fields function, null check to be sure - .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, carrier, setter) { - for (const propagator of this._propagators) { - try { - propagator.inject(context, 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, 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); - } - fields() { - // return a new array so our fields cannot be modified - return this._fields.slice(); + const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config)); + delete mergedConfig.generalLimits; + super(mergedConfig); } } -exports.CompositePropagator = CompositePropagator; -//# sourceMappingURL=composite.js.map +exports.BasicTracerProvider = BasicTracerProvider; +//# sourceMappingURL=BasicTracerProvider-shim.js.map /***/ }), -/***/ 87297: +/***/ 19560: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceState = void 0; -const validators_1 = __nccwpck_require__(54107); -const MAX_TRACE_STATE_ITEMS = 32; -const MAX_TRACE_STATE_LEN = 512; -const LIST_MEMBERS_SEPARATOR = ','; -const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; +exports.BatchSpanProcessor = void 0; +const core_1 = __nccwpck_require__(89736); +const sdk_trace_1 = __nccwpck_require__(1516); /** - * 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. + * A BatchSpanProcessor that applies `OTEL_*` environment variable fallbacks per + * https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ */ -class TraceState { - constructor(rawTraceState) { - this._internalState = new Map(); - if (rawTraceState) - this._parse(rawTraceState); - } - set(key, value) { - // TODO: Benchmark the different approaches(map vs list) and - // use the faster one. - const traceState = this._clone(); - if (traceState._internalState.has(key)) { - traceState._internalState.delete(key); +class BatchSpanProcessor extends sdk_trace_1.BatchSpanProcessor { + constructor(exporter, config) { + if (!config) { + config = {}; } - 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() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { - const listMember = part.trim(); // Optional Whitespace (OWS) handling - 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); - } - else { - // TODO: Consider to add warning log - } - } - return agg; - }, new Map()); - // Because of the reverse() requirement, trunc must be done after map is created - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { - this._internalState = new Map(Array.from(this._internalState.entries()) - .reverse() // Use reverse same as original tracestate parse chain - .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; -//# sourceMappingURL=TraceState.js.map - -/***/ }), - -/***/ 93280: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(54777); -const TraceState_1 = __nccwpck_require__(87297); -exports.TRACE_PARENT_HEADER = 'traceparent'; -exports.TRACE_STATE_HEADER = 'tracestate'; -const VERSION = '00'; -const VERSION_PART = '(?!ff)[\\da-f]{2}'; -const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; -const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; -const FLAGS_PART = '[\\da-f]{2}'; -const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\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; - // According to the specification the implementation should be compatible - // with future versions. If there are more parts, we only reject it if it's using version 00 - // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent - 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/ - */ -class W3CTraceContextPropagator { - inject(context, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context); - if (!spanContext || - (0, suppress_tracing_1.isTracingSuppressed)(context) || - !(0, api_1.isSpanContextValid)(spanContext)) - return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) { - setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } - } - extract(context, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) - return context; - const traceParent = Array.isArray(traceParentHeader) - ? traceParentHeader[0] - : traceParentHeader; - if (typeof traceParent !== 'string') - return context; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) - return context; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - // If more than one `tracestate` header is found, we merge them into a - // single header. - const state = Array.isArray(traceStateHeader) - ? traceStateHeader.join(',') - : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); - } - return api_1.trace.setSpanContext(context, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; - } -} -exports.W3CTraceContextPropagator = W3CTraceContextPropagator; -//# sourceMappingURL=W3CTraceContextPropagator.js.map - -/***/ }), - -/***/ 91787: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; -const api_1 = __nccwpck_require__(65163); -const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); -var RPCType; -(function (RPCType) { - RPCType["HTTP"] = "http"; -})(RPCType = exports.RPCType || (exports.RPCType = {})); -function setRPCMetadata(context, meta) { - return context.setValue(RPC_METADATA_KEY, meta); -} -exports.setRPCMetadata = setRPCMetadata; -function deleteRPCMetadata(context) { - return context.deleteValue(RPC_METADATA_KEY); -} -exports.deleteRPCMetadata = deleteRPCMetadata; -function getRPCMetadata(context) { - return context.getValue(RPC_METADATA_KEY); -} -exports.getRPCMetadata = getRPCMetadata; -//# sourceMappingURL=rpc-metadata.js.map - -/***/ }), - -/***/ 8204: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOffSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples no traces. - */ -class AlwaysOffSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return 'AlwaysOffSampler'; - } -} -exports.AlwaysOffSampler = AlwaysOffSampler; -//# sourceMappingURL=AlwaysOffSampler.js.map - -/***/ }), - -/***/ 81598: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOnSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples all traces. - */ -class AlwaysOnSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, - }; - } - toString() { - return 'AlwaysOnSampler'; - } -} -exports.AlwaysOnSampler = AlwaysOnSampler; -//# sourceMappingURL=AlwaysOnSampler.js.map - -/***/ }), - -/***/ 7291: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ParentBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -const global_error_handler_1 = __nccwpck_require__(85207); -const AlwaysOffSampler_1 = __nccwpck_require__(8204); -const AlwaysOnSampler_1 = __nccwpck_require__(81598); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ -class ParentBasedSampler { - constructor(config) { - var _a, _b, _c, _d; - this._root = config.root; - if (!this._root) { - (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context); - if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { - return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } -} -exports.ParentBasedSampler = ParentBasedSampler; -//# sourceMappingURL=ParentBasedSampler.js.map - -/***/ }), - -/***/ 17973: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceIdRatioBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples a given fraction of traces based of trace id deterministically. - */ -class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); - } - shouldSample(context, traceId) { - return { - decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound - ? api_1.SamplingDecision.RECORD_AND_SAMPLED - : api_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 < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } -} -exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -//# sourceMappingURL=TraceIdRatioBasedSampler.js.map - -/***/ }), - -/***/ 54777: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; -const api_1 = __nccwpck_require__(65163); -const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); -function suppressTracing(context) { - return context.setValue(SUPPRESS_TRACING_KEY, true); -} -exports.suppressTracing = suppressTracing; -function unsuppressTracing(context) { - return context.deleteValue(SUPPRESS_TRACING_KEY); -} -exports.unsuppressTracing = unsuppressTracing; -function isTracingSuppressed(context) { - return context.getValue(SUPPRESS_TRACING_KEY) === true; -} -exports.isTracingSuppressed = isTracingSuppressed; -//# sourceMappingURL=suppress-tracing.js.map - -/***/ }), - -/***/ 57297: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BindOnceFuture = void 0; -const promise_1 = __nccwpck_require__(7857); -/** - * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. - */ -class BindOnceFuture { - constructor(_callback, _that) { - this._callback = _callback; - this._that = _that; - this._isCalled = false; - this._deferred = new promise_1.Deferred(); - } - 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; -//# sourceMappingURL=callback.js.map - -/***/ }), - -/***/ 50157: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; -const api_1 = __nccwpck_require__(65163); -const sampling_1 = __nccwpck_require__(18963); -const DEFAULT_LIST_SEPARATOR = ','; -/** - * Environment interface to define all names - */ -const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; -function isEnvVarABoolean(key) { - return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_NUMBERS_KEYS = [ - 'OTEL_BSP_EXPORT_TIMEOUT', - 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BSP_MAX_QUEUE_SIZE', - 'OTEL_BSP_SCHEDULE_DELAY', - 'OTEL_BLRP_EXPORT_TIMEOUT', - 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BLRP_MAX_QUEUE_SIZE', - 'OTEL_BLRP_SCHEDULE_DELAY', - 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_LINK_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', - 'OTEL_EXPORTER_OTLP_TIMEOUT', - 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', - 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', - 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', - 'OTEL_EXPORTER_JAEGER_AGENT_PORT', -]; -function isEnvVarANumber(key) { - return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_LISTS_KEYS = [ - 'OTEL_NO_PATCH_MODULES', - 'OTEL_PROPAGATORS', - 'OTEL_SEMCONV_STABILITY_OPT_IN', -]; -function isEnvVarAList(key) { - return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; -} -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; -exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; -/** - * Default environment variables - */ -exports.DEFAULT_ENVIRONMENT = { - OTEL_SDK_DISABLED: false, - CONTAINER_NAME: '', - ECS_CONTAINER_METADATA_URI_V4: '', - ECS_CONTAINER_METADATA_URI: '', - HOSTNAME: '', - KUBERNETES_SERVICE_HOST: '', - NAMESPACE: '', - OTEL_BSP_EXPORT_TIMEOUT: 30000, - OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BSP_MAX_QUEUE_SIZE: 2048, - OTEL_BSP_SCHEDULE_DELAY: 5000, - OTEL_BLRP_EXPORT_TIMEOUT: 30000, - OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BLRP_MAX_QUEUE_SIZE: 2048, - OTEL_BLRP_SCHEDULE_DELAY: 5000, - OTEL_EXPORTER_JAEGER_AGENT_HOST: '', - OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, - OTEL_EXPORTER_JAEGER_ENDPOINT: '', - OTEL_EXPORTER_JAEGER_PASSWORD: '', - OTEL_EXPORTER_JAEGER_USER: '', - OTEL_EXPORTER_OTLP_ENDPOINT: '', - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_HEADERS: '', - OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', - OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', - OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', - OTEL_EXPORTER_OTLP_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, - OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', - OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, - OTEL_NO_PATCH_MODULES: [], - OTEL_PROPAGATORS: ['tracecontext', 'baggage'], - OTEL_RESOURCE_ATTRIBUTES: '', - OTEL_SERVICE_NAME: '', - OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_EVENT_COUNT_LIMIT: 128, - OTEL_SPAN_LINK_COUNT_LIMIT: 128, - OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, - OTEL_TRACES_EXPORTER: '', - OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, - OTEL_TRACES_SAMPLER_ARG: '', - OTEL_LOGS_EXPORTER: '', - OTEL_EXPORTER_OTLP_INSECURE: '', - OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', - OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', - OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', - OTEL_EXPORTER_OTLP_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_COMPRESSION: '', - OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', - OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', - OTEL_SEMCONV_STABILITY_OPT_IN: [], -}; -/** - * @param key - * @param environment - * @param values - */ -function parseBoolean(key, environment, values) { - if (typeof values[key] === 'undefined') { - return; - } - const value = String(values[key]); - // support case-insensitive "true" - environment[key] = value.toLowerCase() === 'true'; -} -/** - * Parses a variable as number with number validation - * @param name - * @param environment - * @param values - * @param min - * @param max - */ -function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { - if (typeof values[name] !== 'undefined') { - const value = Number(values[name]); - if (!isNaN(value)) { - if (value < min) { - environment[name] = min; - } - else if (value > max) { - environment[name] = max; - } - else { - environment[name] = value; - } - } - } -} -/** - * Parses list-like strings from input into output. - * @param name - * @param environment - * @param values - * @param separator - */ -function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { - const givenValue = input[name]; - if (typeof givenValue === 'string') { - output[name] = givenValue.split(separator).map(v => v.trim()); - } -} -// The support string -> DiagLogLevel mappings -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, -}; -/** - * Environmentally sets log level if valid log level string is provided - * @param key - * @param environment - * @param values - */ -function setLogLevelFromEnv(key, environment, values) { - const value = values[key]; - if (typeof value === 'string') { - const theLevel = logLevelMap[value.toUpperCase()]; - if (theLevel != null) { - environment[key] = theLevel; - } - } -} -/** - * Parses environment values - * @param values - */ -function parseEnvironment(values) { - const environment = {}; - for (const env in exports.DEFAULT_ENVIRONMENT) { - const key = env; - switch (key) { - case 'OTEL_LOG_LEVEL': - setLogLevelFromEnv(key, environment, values); - break; - default: - if (isEnvVarABoolean(key)) { - parseBoolean(key, environment, values); - } - else if (isEnvVarANumber(key)) { - parseNumber(key, environment, values); - } - else if (isEnvVarAList(key)) { - parseStringList(key, environment, values); - } - else { - const value = values[key]; - if (typeof value !== 'undefined' && value !== null) { - environment[key] = String(value); - } - } - } - } - return environment; -} -exports.parseEnvironment = parseEnvironment; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 55366: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPlainObject = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/** - * 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 funcProto = Function.prototype; -const funcToString = funcProto.toString; -const objectCtorString = funcToString.call(Object); -const getPrototype = overArg(Object.getPrototypeOf, Object); -const objectProto = Object.prototype; -const hasOwnProperty = objectProto.hasOwnProperty; -const symToStringTag = Symbol ? Symbol.toStringTag : undefined; -const nativeObjectToString = objectProto.toString; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function (arg) { - return func(transform(arg)); - }; -} -/** - * 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 = getPrototype(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 === undefined ? 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] = undefined; - unmasked = true; - } - catch (e) { - // silence - } - 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); -} -//# sourceMappingURL=lodash.merge.js.map - -/***/ }), - -/***/ 60317: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.merge = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -const lodash_merge_1 = __nccwpck_require__(55366); -const MAX_LEVEL = 20; -/** - * Merges objects together - * @param args - objects / values to be merged - */ -function merge(...args) { - let result = args.shift(); - const objects = 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 undefined; - } - 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] = takeValue(twoValue); - 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); - } + const envFallbacks = [ + ['maxExportBatchSize', 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE'], + ['maxQueueSize', 'OTEL_BSP_MAX_QUEUE_SIZE'], + ['scheduledDelayMillis', 'OTEL_BSP_SCHEDULE_DELAY'], + ['exportTimeoutMillis', 'OTEL_BSP_EXPORT_TIMEOUT'], + ]; + for (const [configName, envName] of envFallbacks) { + if (config[configName] === undefined) { + const envFallback = (0, core_1.getNumberFromEnv)(envName); + if (envFallback !== undefined) { + config[configName] = envFallback; } } } - else { - result = two; - } + super({ exporter, ...config }); } - return result; } +exports.BatchSpanProcessor = BatchSpanProcessor; +//# sourceMappingURL=BatchSpanProcessor-shim.js.map + +/***/ }), + +/***/ 68942: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SimpleSpanProcessor = void 0; +const sdk_trace_1 = __nccwpck_require__(1516); /** - * Function to check if object has been already reference - * @param obj - * @param key - * @param objects + * A SimpleSpanProcessor with the old constructor call signature that + * takes just a single exporter argument. This version does not support + * the additional options that the SimpleSpanProcessor in sdk-trace does. */ -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; - } +class SimpleSpanProcessor extends sdk_trace_1.SimpleSpanProcessor { + constructor(exporter) { + super({ exporter }); } - 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; -} -//# sourceMappingURL=merge.js.map +exports.SimpleSpanProcessor = SimpleSpanProcessor; +//# sourceMappingURL=SimpleSpanProcessor-shim.js.map /***/ }), -/***/ 7857: -/***/ ((__unused_webpack_module, exports) => { +/***/ 91: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Deferred = void 0; -class Deferred { - 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; -//# sourceMappingURL=promise.js.map - -/***/ }), - -/***/ 18963: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TracesSamplerValues = void 0; +exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; +const api_1 = __nccwpck_require__(65163); +const core_1 = __nccwpck_require__(89736); +const sdk_trace_1 = __nccwpck_require__(1516); var TracesSamplerValues; (function (TracesSamplerValues) { TracesSamplerValues["AlwaysOff"] = "always_off"; @@ -47589,442 +10926,181 @@ var TracesSamplerValues; TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; TracesSamplerValues["TraceIdRatio"] = "traceidratio"; -})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); -//# sourceMappingURL=sampling.js.map - -/***/ }), - -/***/ 39223: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.callWithTimeout = exports.TimeoutError = void 0; +})(TracesSamplerValues || (TracesSamplerValues = {})); +const DEFAULT_RATIO = 1; /** - * Error that is thrown on timeouts. + * 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. */ -class TimeoutError extends Error { - constructor(message) { - super(message); - // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: - // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - Object.setPrototypeOf(this, TimeoutError.prototype); - } +// object needs to be wrapped in this function and called when needed otherwise +// envs are parsed before tests are ran - causes tests using these envs to fail +function loadDefaultConfig() { + return { + sampler: buildSamplerFromEnv(), + forceFlushTimeoutMillis: 30000, + 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.TimeoutError = TimeoutError; +exports.loadDefaultConfig = loadDefaultConfig; /** - * 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. + * Based on environment, builds a sampler, complies with specification. */ -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; - }); +function buildSamplerFromEnv() { + const sampler = (0, core_1.getStringFromEnv)('OTEL_TRACES_SAMPLER') ?? + TracesSamplerValues.ParentBasedAlwaysOn; + switch (sampler) { + case TracesSamplerValues.AlwaysOn: + return new sdk_trace_1.AlwaysOnSampler(); + case TracesSamplerValues.AlwaysOff: + return new sdk_trace_1.AlwaysOffSampler(); + case TracesSamplerValues.ParentBasedAlwaysOn: + return new sdk_trace_1.ParentBasedSampler({ + root: new sdk_trace_1.AlwaysOnSampler(), + }); + case TracesSamplerValues.ParentBasedAlwaysOff: + return new sdk_trace_1.ParentBasedSampler({ + root: new sdk_trace_1.AlwaysOffSampler(), + }); + case TracesSamplerValues.TraceIdRatio: + return new sdk_trace_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()); + case TracesSamplerValues.ParentBasedTraceIdRatio: + return new sdk_trace_1.ParentBasedSampler({ + root: new sdk_trace_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()), + }); + default: + api_1.diag.error(`OTEL_TRACES_SAMPLER value "${sampler}" invalid, defaulting to "${TracesSamplerValues.ParentBasedAlwaysOn}".`); + return new sdk_trace_1.ParentBasedSampler({ + root: new sdk_trace_1.AlwaysOnSampler(), + }); + } } -exports.callWithTimeout = callWithTimeout; -//# sourceMappingURL=timeout.js.map +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; +} +//# sourceMappingURL=config.js.map /***/ }), -/***/ 17839: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isUrlIgnored = exports.urlMatches = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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; -//# sourceMappingURL=url.js.map - -/***/ }), - -/***/ 46644: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWrapped = void 0; -/** - * Checks if certain function has been already wrapped - * @param func - */ -function isWrapped(func) { - return (typeof func === 'function' && - typeof func.__original === 'function' && - typeof func.__unwrap === 'function' && - func.__wrapped === true); -} -exports.isWrapped = isWrapped; -//# sourceMappingURL=wrap.js.map - -/***/ }), - -/***/ 12421: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.30.1'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 78920: +/***/ 88266: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BasicTracerProvider = exports.ForceFlushState = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(56460); -const resources_1 = __nccwpck_require__(3871); -const Tracer_1 = __nccwpck_require__(63806); -const config_1 = __nccwpck_require__(91); -const MultiSpanProcessor_1 = __nccwpck_require__(12352); -const NoopSpanProcessor_1 = __nccwpck_require__(69252); -const platform_1 = __nccwpck_require__(10262); -const utility_1 = __nccwpck_require__(54324); -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 - */ -class BasicTracerProvider { - constructor(config = {}) { - var _a, _b; - this._registeredSpanProcessors = []; - this._tracers = new Map(); - const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config)); - this.resource = (_a = mergedConfig.resource) !== null && _a !== void 0 ? _a : resources_1.Resource.empty(); - if (mergedConfig.mergeResourceWithDefaults) { - this.resource = resources_1.Resource.default().merge(this.resource); - } - this._config = Object.assign({}, mergedConfig, { - resource: this.resource, - }); - if ((_b = config.spanProcessors) === null || _b === void 0 ? void 0 : _b.length) { - this._registeredSpanProcessors = [...config.spanProcessors]; - this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); - } - else { - const defaultExporter = this._buildExporterFromEnv(); - if (defaultExporter !== undefined) { - const batchProcessor = new platform_1.BatchSpanProcessor(defaultExporter); - this.activeSpanProcessor = batchProcessor; - } - else { - this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor(); - } - } - } - getTracer(name, version, options) { - const key = `${name}@${version || ''}:${(options === null || options === void 0 ? void 0 : options.schemaUrl) || ''}`; - if (!this._tracers.has(key)) { - this._tracers.set(key, new Tracer_1.Tracer({ name, version, schemaUrl: options === null || options === void 0 ? void 0 : options.schemaUrl }, this._config, this)); - } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - return this._tracers.get(key); - } - /** - * @deprecated please use {@link TracerConfig} spanProcessors property - * Adds a new {@link SpanProcessor} to this tracer. - * @param spanProcessor the new SpanProcessor to be added. - */ - addSpanProcessor(spanProcessor) { - if (this._registeredSpanProcessors.length === 0) { - // since we might have enabled by default a batchProcessor, we disable it - // before adding the new one - this.activeSpanProcessor - .shutdown() - .catch(err => api_1.diag.error('Error while trying to shutdown current span processor', err)); - } - this._registeredSpanProcessors.push(spanProcessor); - this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); - } - getActiveSpanProcessor() { - return this.activeSpanProcessor; - } - /** - * 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); - if (config.propagator === undefined) { - config.propagator = this._buildPropagatorFromEnv(); - } - if (config.contextManager) { - api_1.context.setGlobalContextManager(config.contextManager); - } - if (config.propagator) { - api_1.propagation.setGlobalPropagator(config.propagator); - } - } - forceFlush() { - const timeout = this._config.forceFlushTimeoutMillis; - const promises = this._registeredSpanProcessors.map((spanProcessor) => { - return new Promise(resolve => { - let state; - const timeoutInterval = setTimeout(() => { - resolve(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(); - } - /** - * TS cannot yet infer the type of this.constructor: - * https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146 - * There is no need to override either of the getters in your child class. - * The type of the registered component maps should be the same across all - * classes in the inheritance tree. - */ - _getPropagator(name) { - var _a; - return (_a = this.constructor._registeredPropagators.get(name)) === null || _a === void 0 ? void 0 : _a(); - } - _getSpanExporter(name) { - var _a; - return (_a = this.constructor._registeredExporters.get(name)) === null || _a === void 0 ? void 0 : _a(); - } - _buildPropagatorFromEnv() { - // per spec, propagators from env must be deduplicated - const uniquePropagatorNames = Array.from(new Set((0, core_1.getEnv)().OTEL_PROPAGATORS)); - const propagators = uniquePropagatorNames.map(name => { - const propagator = this._getPropagator(name); - if (!propagator) { - api_1.diag.warn(`Propagator "${name}" requested through environment variable is unavailable.`); - } - return propagator; - }); - const validPropagators = propagators.reduce((list, item) => { - if (item) { - list.push(item); - } - return list; - }, []); - if (validPropagators.length === 0) { - return; - } - else if (uniquePropagatorNames.length === 1) { - return validPropagators[0]; - } - else { - return new core_1.CompositePropagator({ - propagators: validPropagators, - }); - } - } - _buildExporterFromEnv() { - const exporterName = (0, core_1.getEnv)().OTEL_TRACES_EXPORTER; - if (exporterName === 'none' || exporterName === '') - return; - const exporter = this._getSpanExporter(exporterName); - if (!exporter) { - api_1.diag.error(`Exporter "${exporterName}" requested through environment variable is unavailable.`); - } - return exporter; - } -} -exports.BasicTracerProvider = BasicTracerProvider; -BasicTracerProvider._registeredPropagators = new Map([ - ['tracecontext', () => new core_1.W3CTraceContextPropagator()], - ['baggage', () => new core_1.W3CBaggagePropagator()], -]); -BasicTracerProvider._registeredExporters = new Map(); -//# sourceMappingURL=BasicTracerProvider.js.map +exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.InMemorySpanExporter = exports.RandomIdGenerator = exports.ConsoleSpanExporter = exports.SimpleSpanProcessor = exports.BatchSpanProcessor = exports.BasicTracerProvider = void 0; +var BasicTracerProvider_shim_1 = __nccwpck_require__(69453); +Object.defineProperty(exports, "BasicTracerProvider", ({ enumerable: true, get: function () { return BasicTracerProvider_shim_1.BasicTracerProvider; } })); +var BatchSpanProcessor_shim_1 = __nccwpck_require__(19560); +Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return BatchSpanProcessor_shim_1.BatchSpanProcessor; } })); +var SimpleSpanProcessor_shim_1 = __nccwpck_require__(68942); +Object.defineProperty(exports, "SimpleSpanProcessor", ({ enumerable: true, get: function () { return SimpleSpanProcessor_shim_1.SimpleSpanProcessor; } })); +var sdk_trace_1 = __nccwpck_require__(1516); +Object.defineProperty(exports, "ConsoleSpanExporter", ({ enumerable: true, get: function () { return sdk_trace_1.ConsoleSpanExporter; } })); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return sdk_trace_1.RandomIdGenerator; } })); +Object.defineProperty(exports, "InMemorySpanExporter", ({ enumerable: true, get: function () { return sdk_trace_1.InMemorySpanExporter; } })); +Object.defineProperty(exports, "NoopSpanProcessor", ({ enumerable: true, get: function () { return sdk_trace_1.NoopSpanProcessor; } })); +Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return sdk_trace_1.AlwaysOffSampler; } })); +Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return sdk_trace_1.AlwaysOnSampler; } })); +Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return sdk_trace_1.ParentBasedSampler; } })); +Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return sdk_trace_1.TraceIdRatioBasedSampler; } })); +Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return sdk_trace_1.SamplingDecision; } })); +//# sourceMappingURL=index-shim.js.map /***/ }), -/***/ 12352: +/***/ 54324: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reconfigureLimits = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = void 0; +const core_1 = __nccwpck_require__(89736); +exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; +exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; +/** + * When general limits are provided and model specific limits are not, + * configures the model specific limits by using the values from the general ones. + * @param userConfig User provided tracer configuration + */ +function reconfigureLimits(userConfig) { + const spanLimits = Object.assign({}, userConfig.spanLimits); + /** + * Reassign span attribute count limit to use first non null value defined by user or use default value + */ + spanLimits.attributeCountLimit = + userConfig.spanLimits?.attributeCountLimit ?? + userConfig.generalLimits?.attributeCountLimit ?? + (0, core_1.getNumberFromEnv)('OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT') ?? + (0, core_1.getNumberFromEnv)('OTEL_ATTRIBUTE_COUNT_LIMIT') ?? + exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT; + /** + * Reassign span attribute value length limit to use first non null value defined by user or use default value + */ + spanLimits.attributeValueLengthLimit = + userConfig.spanLimits?.attributeValueLengthLimit ?? + userConfig.generalLimits?.attributeValueLengthLimit ?? + (0, core_1.getNumberFromEnv)('OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT') ?? + (0, core_1.getNumberFromEnv)('OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT') ?? + exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; + return Object.assign({}, userConfig, { spanLimits }); +} +exports.reconfigureLimits = reconfigureLimits; +//# sourceMappingURL=utility.js.map + +/***/ }), + +/***/ 37875: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MultiSpanProcessor = void 0; -const core_1 = __nccwpck_require__(56460); +const core_1 = __nccwpck_require__(89736); /** * Implementation of the {@link SpanProcessor} that simply forwards all * received events to a list of {@link SpanProcessor}s. */ class MultiSpanProcessor { - constructor(_spanProcessors) { - this._spanProcessors = _spanProcessors; + _spanProcessors; + constructor(spanProcessors) { + this._spanProcessors = spanProcessors; } forceFlush() { const promises = []; @@ -48047,6 +11123,13 @@ class MultiSpanProcessor { spanProcessor.onStart(span, context); } } + 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); @@ -48069,25 +11152,14 @@ exports.MultiSpanProcessor = MultiSpanProcessor; /***/ }), -/***/ 17446: +/***/ 41584: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SamplingDecision = void 0; @@ -48112,81 +11184,90 @@ var SamplingDecision; * MUST be set. */ SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; -})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); +})(SamplingDecision || (exports.SamplingDecision = SamplingDecision = {})); //# sourceMappingURL=Sampler.js.map /***/ }), -/***/ 61301: +/***/ 91816: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Span = void 0; +exports.SpanImpl = void 0; const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(56460); +const core_1 = __nccwpck_require__(89736); const semantic_conventions_1 = __nccwpck_require__(67275); -const enums_1 = __nccwpck_require__(35092); +const enums_1 = __nccwpck_require__(83539); +const inspect_1 = __nccwpck_require__(83691); /** * This class represents a span. */ -class Span { +class SpanImpl { + // Below properties are included to implement ReadableSpan for export + // purposes but are not intended to be written-to directly. + _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 Span instance. - * - * @deprecated calling Span constructor directly is not supported. Please use tracer.startSpan. - * */ - constructor(parentTracer, context, spanName, spanContext, kind, parentSpanId, links = [], startTime, _deprecatedClock, // keeping this argument even though it is unused to ensure backwards compatibility - attributes) { - this.attributes = {}; - this.links = []; - this.events = []; - this._droppedAttributesCount = 0; - this._droppedEventsCount = 0; - this._droppedLinksCount = 0; - this.status = { - code: api_1.SpanStatusCode.UNSET, - }; - this.endTime = [0, 0]; - this._ended = false; - this._duration = [-1, -1]; - this.name = spanName; - this._spanContext = spanContext; - this.parentSpanId = parentSpanId; - this.kind = kind; - this.links = links; + * 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 + (0, core_1.getTimeOrigin)()); - this._startTimeProvided = startTime != null; - this.startTime = this._getTime(startTime !== null && startTime !== void 0 ? startTime : now); - this.resource = parentTracer.resource; - this.instrumentationLibrary = parentTracer.instrumentationLibrary; - this._spanLimits = parentTracer.getSpanLimits(); + now - (this._performanceStartTime + core_1.otperformance.timeOrigin); + this._startTimeProvided = opts.startTime != null; + this._spanLimits = opts.spanLimits; this._attributeValueLengthLimit = - this._spanLimits.attributeValueLengthLimit || 0; - if (attributes != null) { - this.setAttributes(attributes); + 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._spanProcessor = parentTracer.getActiveSpanProcessor(); - this._spanProcessor.onStart(this, context); + 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; @@ -48202,18 +11283,25 @@ class Span { api_1.diag.warn(`Invalid attribute value set for key: ${key}`); return this; } - if (Object.keys(this.attributes).length >= - this._spanLimits.attributeCountLimit && - !Object.prototype.hasOwnProperty.call(this.attributes, key)) { + const { attributeCountLimit } = this._spanLimits; + const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key); + if (attributeCountLimit !== undefined && + this._attributesCount >= attributeCountLimit && + isNewKey) { this._droppedAttributesCount++; return this; } this.attributes[key] = this._truncateToSize(value); + if (isNewKey) { + this._attributesCount++; + } return this; } setAttributes(attributes) { - for (const [k, v] of Object.entries(attributes)) { - this.setAttribute(k, v); + for (const key in attributes) { + if (Object.prototype.hasOwnProperty.call(attributes, key)) { + this.setAttribute(key, attributes[key]); + } } return this; } @@ -48227,12 +11315,14 @@ class Span { addEvent(name, attributesOrStartTime, timeStamp) { if (this._isSpanEnded()) return this; - if (this._spanLimits.eventCountLimit === 0) { + const { eventCountLimit } = this._spanLimits; + if (eventCountLimit === 0) { api_1.diag.warn('No events allowed.'); this._droppedEventsCount++; return this; } - if (this.events.length >= this._spanLimits.eventCountLimit) { + if (eventCountLimit !== undefined && + this.events.length >= eventCountLimit) { if (this._droppedEventsCount === 0) { api_1.diag.debug('Dropping extra events.'); } @@ -48245,35 +11335,102 @@ class Span { } attributesOrStartTime = undefined; } - const attributes = (0, core_1.sanitizeAttributes)(attributesOrStartTime); + 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 !== undefined && + eventAttributesCount >= attributePerEventCountLimit) { + droppedAttributesCount++; + continue; + } + attributes[attr] = this._truncateToSize(attrVal); + eventAttributesCount++; + } this.events.push({ name, attributes, time: this._getTime(timeStamp), - droppedAttributesCount: 0, + droppedAttributesCount, }); return this; } addLink(link) { - this.links.push(link); + if (this._isSpanEnded()) + return this; + const { linkCountLimit } = this._spanLimits; + if (linkCountLimit === 0) { + this._droppedLinksCount++; + return this; + } + if (linkCountLimit !== undefined && 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 !== undefined && + 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) { - this.links.push(...links); + for (const link of links) { + this.addLink(link); + } return this; } setStatus(status) { if (this._isSpanEnded()) return this; - this.status = Object.assign({}, status); + if (status.code === api_1.SpanStatusCode.UNSET) + return this; + if (this.status.code === api_1.SpanStatusCode.OK) + return this; + const newStatus = { code: status.code }; // When using try-catch, the caught "error" is of type `any`. When then assigning `any` to `status.message`, // TypeScript will not error. While this can happen during use of any API, it is more common on Span#setStatus() // as it's likely used in a catch-block. Therefore, we validate if `status.message` is actually a string, null, or // undefined to avoid an incorrect type causing issues downstream. - if (this.status.message != null && typeof status.message !== 'string') { - api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); - delete this.status.message; + 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) { @@ -48287,7 +11444,6 @@ class Span { api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); return; } - this._ended = true; this.endTime = this._getTime(endTime); this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); if (this._duration[0] < 0) { @@ -48298,6 +11454,14 @@ class Span { 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) { @@ -48329,25 +11493,24 @@ class Span { recordException(exception, time) { const attributes = {}; if (typeof exception === 'string') { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE] = exception; + attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception; } else if (exception) { if (exception.code) { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] = exception.code.toString(); + attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.code.toString(); } else if (exception.name) { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] = exception.name; + attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.name; } if (exception.message) { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE] = exception.message; + attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception.message; } if (exception.stack) { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_STACKTRACE] = exception.stack; + attributes[semantic_conventions_1.ATTR_EXCEPTION_STACKTRACE] = exception.stack; } } // these are minimum requirements from spec - if (attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] || - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE]) { + if (attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] || attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE]) { this.addEvent(enums_1.ExceptionEventName, attributes, time); } else { @@ -48371,7 +11534,8 @@ class Span { } _isSpanEnded() { if (this._ended) { - api_1.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); + const error = 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; } @@ -48415,62 +11579,80 @@ class Span { // Other types, no need to apply value length limit 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.Span = Span; +exports.SpanImpl = SpanImpl; //# sourceMappingURL=Span.js.map /***/ }), -/***/ 63806: +/***/ 80984: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Tracer = void 0; const api = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(56460); -const Span_1 = __nccwpck_require__(61301); -const utility_1 = __nccwpck_require__(54324); -const platform_1 = __nccwpck_require__(10262); +const core_1 = __nccwpck_require__(89736); +const Span_1 = __nccwpck_require__(91816); +const TracerMetrics_1 = __nccwpck_require__(40932); +const version_1 = __nccwpck_require__(93195); +const inspect_1 = __nccwpck_require__(83691); /** * This class represents a basic tracer. */ class Tracer { + _sampler; + _spanLimits; + _idGenerator; + instrumentationScope; + _resource; + _spanProcessor; + _tracerMetrics; /** * Constructs a new Tracer instance. */ - constructor(instrumentationLibrary, config, _tracerProvider) { - this._tracerProvider = _tracerProvider; - 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 = _tracerProvider.resource; - this.instrumentationLibrary = instrumentationLibrary; + constructor(instrumentationScope, options) { + this.instrumentationScope = instrumentationScope; + this._sampler = options.sampler; + this._spanLimits = options.spanLimits; + this._resource = options.resource; + this._idGenerator = options.idGenerator; + this._spanProcessor = options.spanProcessor; + const meter = options.meterProvider.getMeter('@opentelemetry/sdk-trace', version_1.VERSION); + this._tracerMetrics = new TracerMetrics_1.TracerMetrics(meter); } /** * Starts a new Span or returns the default NoopSpan based on the sampling * decision. */ startSpan(name, options = {}, context = api.context.active()) { - var _a, _b, _c; // remove span from context in case a root span is requested via options if (options.root) { context = api.trace.deleteSpan(context); @@ -48481,11 +11663,11 @@ class Tracer { const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); return nonRecordingSpan; } - const parentSpanContext = parentSpan === null || parentSpan === void 0 ? void 0 : parentSpan.spanContext(); + const parentSpanContext = parentSpan?.spanContext(); const spanId = this._idGenerator.generateSpanId(); + let validParentSpanContext; let traceId; let traceState; - let parentSpanId; if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) { // New root span. @@ -48495,10 +11677,10 @@ class Tracer { // New child span. traceId = parentSpanContext.traceId; traceState = parentSpanContext.traceState; - parentSpanId = parentSpanContext.spanId; + validParentSpanContext = parentSpanContext; } - const spanKind = (_a = options.kind) !== null && _a !== void 0 ? _a : api.SpanKind.INTERNAL; - const links = ((_b = options.links) !== null && _b !== void 0 ? _b : []).map(link => { + const spanKind = options.kind ?? api.SpanKind.INTERNAL; + const links = (options.links ?? []).map(link => { return { context: link.context, attributes: (0, core_1.sanitizeAttributes)(link.attributes), @@ -48507,7 +11689,8 @@ class Tracer { const attributes = (0, core_1.sanitizeAttributes)(options.attributes); // make sampling decision const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); - traceState = (_c = samplingResult.traceState) !== null && _c !== void 0 ? _c : traceState; + 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; @@ -48520,7 +11703,21 @@ class Tracer { // Set initial span attributes. The attributes object may have been mutated // by the sampler, so we sanitize the merged attributes before setting them. const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); - const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime, undefined, initAttributes); + const span = new Span_1.SpanImpl({ + resource: this._resource, + scope: this.instrumentationScope, + context, + spanContext, + name, + kind: spanKind, + links, + parentSpanContext: validParentSpanContext, + attributes: initAttributes, + startTime: options.startTime, + spanProcessor: this._spanProcessor, + spanLimits: this._spanLimits, + recordEndMetrics, + }); return span; } startActiveSpan(name, arg2, arg3, arg4) { @@ -48542,21 +11739,18 @@ class Tracer { ctx = arg3; fn = arg4; } - const parentContext = ctx !== null && ctx !== void 0 ? ctx : api.context.active(); + 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, undefined, span); } - /** Returns the active {@link GeneralLimits}. */ - getGeneralLimits() { - return this._generalLimits; - } - /** Returns the active {@link SpanLimits}. */ - getSpanLimits() { - return this._spanLimits; - } - getActiveSpanProcessor() { - return this._tracerProvider.getActiveSpanProcessor(); + [inspect_1.inspectCustom](depth, options, inspect) { + const payload = { + instrumentationScope: this.instrumentationScope, + resource: { attributes: (0, inspect_1.settledResourceAttributes)(this._resource) }, + spanLimits: this._spanLimits, + }; + return (0, inspect_1.formatInspect)('Tracer', payload, depth, options, inspect); } } exports.Tracer = Tracer; @@ -48564,135 +11758,209 @@ exports.Tracer = Tracer; /***/ }), -/***/ 91: +/***/ 40932: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TracerMetrics = void 0; +const Sampler_1 = __nccwpck_require__(41584); +const semconv_1 = __nccwpck_require__(89064); +/** + * Generates `otel.sdk.span.*` metrics. + * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics + */ +class TracerMetrics { + 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'; + } +} +//# sourceMappingURL=TracerMetrics.js.map + +/***/ }), + +/***/ 3097: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; +exports.TracerProvider = void 0; const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(56460); -const AlwaysOffSampler_1 = __nccwpck_require__(68118); -const AlwaysOnSampler_1 = __nccwpck_require__(13032); -const ParentBasedSampler_1 = __nccwpck_require__(58070); -const TraceIdRatioBasedSampler_1 = __nccwpck_require__(16712); -const FALLBACK_OTEL_TRACES_SAMPLER = core_1.TracesSamplerValues.AlwaysOn; -const DEFAULT_RATIO = 1; +const resources_1 = __nccwpck_require__(3871); +const Tracer_1 = __nccwpck_require__(80984); +const MultiSpanProcessor_1 = __nccwpck_require__(37875); +const ParentBasedSampler_1 = __nccwpck_require__(51724); +const AlwaysOnSampler_1 = __nccwpck_require__(43632); +const platform_1 = __nccwpck_require__(37067); +const inspect_1 = __nccwpck_require__(83691); +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 || (ForceFlushState = {})); /** - * 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. + * This class represents a basic tracer provider which platform libraries can extend */ -// object needs to be wrapped in this function and called when needed otherwise -// envs are parsed before tests are ran - causes tests using these envs to fail -function loadDefaultConfig() { - const env = (0, core_1.getEnv)(); - return { - sampler: buildSamplerFromEnv(env), - forceFlushTimeoutMillis: 30000, - generalLimits: { - attributeValueLengthLimit: env.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, - attributeCountLimit: env.OTEL_ATTRIBUTE_COUNT_LIMIT, - }, - spanLimits: { - attributeValueLengthLimit: env.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, - attributeCountLimit: env.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, - linkCountLimit: env.OTEL_SPAN_LINK_COUNT_LIMIT, - eventCountLimit: env.OTEL_SPAN_EVENT_COUNT_LIMIT, - attributePerEventCountLimit: env.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, - attributePerLinkCountLimit: env.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, - }, - mergeResourceWithDefaults: true, - }; -} -exports.loadDefaultConfig = loadDefaultConfig; -/** - * Based on environment, builds a sampler, complies with specification. - * @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment - */ -function buildSamplerFromEnv(environment = (0, core_1.getEnv)()) { - switch (environment.OTEL_TRACES_SAMPLER) { - case core_1.TracesSamplerValues.AlwaysOn: - return new AlwaysOnSampler_1.AlwaysOnSampler(); - case core_1.TracesSamplerValues.AlwaysOff: - return new AlwaysOffSampler_1.AlwaysOffSampler(); - case core_1.TracesSamplerValues.ParentBasedAlwaysOn: - return new ParentBasedSampler_1.ParentBasedSampler({ - root: new AlwaysOnSampler_1.AlwaysOnSampler(), +class TracerProvider { + _resource; + _activeSpanProcessor; + _forceFlushTimeoutMillis; + _tracerOptions; + _tracers = new Map(); + constructor(options = {}) { + this._forceFlushTimeoutMillis = options.forceFlushTimeoutMillis ?? 30000; + this._resource = options.resource ?? (0, resources_1.defaultResource)(); + const spanProcessors = options.spanProcessors ?? []; + this._activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(spanProcessors); + this._tracerOptions = { + resource: this._resource, + sampler: options.sampler ?? + new ParentBasedSampler_1.ParentBasedSampler({ + root: new AlwaysOnSampler_1.AlwaysOnSampler(), + }), + spanLimits: { + attributeCountLimit: options.spanLimits?.attributeCountLimit ?? 128, + attributeValueLengthLimit: options.spanLimits?.attributeValueLengthLimit ?? Infinity, + eventCountLimit: options.spanLimits?.eventCountLimit ?? 128, + linkCountLimit: options.spanLimits?.linkCountLimit ?? 128, + attributePerEventCountLimit: options.spanLimits?.attributePerEventCountLimit ?? 128, + attributePerLinkCountLimit: options.spanLimits?.attributePerLinkCountLimit ?? 128, + }, + idGenerator: options.idGenerator || new platform_1.RandomIdGenerator(), + spanProcessor: this._activeSpanProcessor, + meterProvider: options.meterProvider ?? { + getMeter() { + return (0, api_1.createNoopMeter)(); + }, + }, + }; + } + getTracer(name, version, 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._tracerOptions)); + } + return this._tracers.get(key); + } + forceFlush() { + const timeout = this._forceFlushTimeoutMillis; + const promises = this._activeSpanProcessor['_spanProcessors'].map((spanProcessor) => { + return new Promise(resolve => { + let state; + const timeoutInterval = setTimeout(() => { + resolve(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); + }); }); - case core_1.TracesSamplerValues.ParentBasedAlwaysOff: - return new ParentBasedSampler_1.ParentBasedSampler({ - root: new AlwaysOffSampler_1.AlwaysOffSampler(), - }); - case core_1.TracesSamplerValues.TraceIdRatio: - return new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)); - case core_1.TracesSamplerValues.ParentBasedTraceIdRatio: - return new ParentBasedSampler_1.ParentBasedSampler({ - root: new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)), - }); - default: - api_1.diag.error(`OTEL_TRACES_SAMPLER value "${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".`); - return new AlwaysOnSampler_1.AlwaysOnSampler(); + }); + 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)('TracerProvider', payload, depth, options, inspect); } } -exports.buildSamplerFromEnv = buildSamplerFromEnv; -function getSamplerProbabilityFromEnv(environment) { - if (environment.OTEL_TRACES_SAMPLER_ARG === undefined || - environment.OTEL_TRACES_SAMPLER_ARG === '') { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - const probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); - if (isNaN(probability)) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - if (probability < 0 || probability > 1) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - return probability; -} -//# sourceMappingURL=config.js.map +exports.TracerProvider = TracerProvider; +//# sourceMappingURL=TracerProvider.js.map /***/ }), -/***/ 35092: +/***/ 83539: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExceptionEventName = void 0; @@ -48702,62 +11970,55 @@ exports.ExceptionEventName = 'exception'; /***/ }), -/***/ 69727: +/***/ 32908: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BatchSpanProcessorBase = void 0; const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(56460); +const core_1 = __nccwpck_require__(89736); +const SpanProcessorMetrics_1 = __nccwpck_require__(24592); +const semconv_1 = __nccwpck_require__(89064); /** * Implementation of the {@link SpanProcessor} that batches spans exported by * the SDK then pushes them to the exporter pipeline. */ class BatchSpanProcessorBase { - constructor(_exporter, config) { - this._exporter = _exporter; - this._isExporting = false; - this._finishedSpans = []; - this._droppedSpansCount = 0; - const env = (0, core_1.getEnv)(); - this._maxExportBatchSize = - typeof (config === null || config === void 0 ? void 0 : config.maxExportBatchSize) === 'number' - ? config.maxExportBatchSize - : env.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; - this._maxQueueSize = - typeof (config === null || config === void 0 ? void 0 : config.maxQueueSize) === 'number' - ? config.maxQueueSize - : env.OTEL_BSP_MAX_QUEUE_SIZE; - this._scheduledDelayMillis = - typeof (config === null || config === void 0 ? void 0 : config.scheduledDelayMillis) === 'number' - ? config.scheduledDelayMillis - : env.OTEL_BSP_SCHEDULE_DELAY; - this._exportTimeoutMillis = - typeof (config === null || config === void 0 ? void 0 : config.exportTimeoutMillis) === 'number' - ? config.exportTimeoutMillis - : env.OTEL_BSP_EXPORT_TIMEOUT; + _maxExportBatchSize; + _maxQueueSize; + _scheduledDelayMillis; + _exportTimeoutMillis; + _exporter; + _metrics; + _isExporting = false; + _finishedSpans = []; + _timer; + _shutdownOnce; + _droppedSpansCount = 0; + constructor(options) { + this._exporter = options.exporter; + this._maxExportBatchSize = options.maxExportBatchSize ?? 512; + this._maxQueueSize = options.maxQueueSize ?? 2048; + this._scheduledDelayMillis = options.scheduledDelayMillis ?? 5000; + this._exportTimeoutMillis = options.exportTimeoutMillis ?? 30000; this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); if (this._maxExportBatchSize > this._maxQueueSize) { api_1.diag.warn('BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize'); this._maxExportBatchSize = this._maxQueueSize; } + const meter = options.selfObsMeterProvider + ? options.selfObsMeterProvider.getMeter('@opentelemetry/sdk-trace') + : (0, api_1.createNoopMeter)(); + this._metrics = new SpanProcessorMetrics_1.SpanProcessorMetrics(semconv_1.OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR, meter, { + capacity: this._maxQueueSize, + getQueueSize: () => this._finishedSpans.length, + }); } forceFlush() { if (this._shutdownOnce.isCalled) { @@ -48788,6 +12049,7 @@ class BatchSpanProcessorBase { return this._flushAll(); }) .then(() => { + this._metrics.shutdown(); return this._exporter.shutdown(); }); } @@ -48799,6 +12061,7 @@ class BatchSpanProcessorBase { api_1.diag.debug('maxQueueSize reached, dropping spans'); } this._droppedSpansCount++; + this._metrics.dropSpans(1); return; } if (this._droppedSpansCount > 0) { @@ -48853,13 +12116,14 @@ class BatchSpanProcessorBase { spans = this._finishedSpans.splice(0, this._maxExportBatchSize); } const doExport = () => this._exporter.export(spans, result => { - var _a; clearTimeout(timer); + this._metrics.finishSpans(spans.length, result.error); if (result.code === core_1.ExportResultCode.SUCCESS) { resolve(); } else { - reject((_a = result.error) !== null && _a !== void 0 ? _a : new Error('BatchSpanProcessor: span export failed')); + reject(result.error ?? + new Error('BatchSpanProcessor: span export failed')); } }); let pendingResources = null; @@ -48867,7 +12131,7 @@ class BatchSpanProcessorBase { const span = spans[i]; if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) { - pendingResources !== null && pendingResources !== void 0 ? pendingResources : (pendingResources = []); + pendingResources ??= []; pendingResources.push(span.resource.waitForAsyncAttributes()); } } @@ -48909,7 +12173,10 @@ class BatchSpanProcessorBase { if (this._timer !== undefined) return; this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); - (0, core_1.unrefTimer)(this._timer); + // depending on runtime, this may be a 'number' or NodeJS.Timeout + if (typeof this._timer !== 'number') { + this._timer.unref(); + } } _clearTimer() { if (this._timer !== undefined) { @@ -48923,29 +12190,18 @@ exports.BatchSpanProcessorBase = BatchSpanProcessorBase; /***/ }), -/***/ 36784: +/***/ 90599: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ConsoleSpanExporter = void 0; -const core_1 = __nccwpck_require__(56460); +const core_1 = __nccwpck_require__(89736); /** * This is implementation of {@link SpanExporter} that prints spans to the * console. This class can be used for diagnostic purposes. @@ -48980,15 +12236,14 @@ class ConsoleSpanExporter { * @param span */ _exportInfo(span) { - var _a; return { resource: { attributes: span.resource.attributes, }, - instrumentationScope: span.instrumentationLibrary, + instrumentationScope: span.instrumentationScope, traceId: span.spanContext().traceId, - parentId: span.parentSpanId, - traceState: (_a = span.spanContext().traceState) === null || _a === void 0 ? void 0 : _a.serialize(), + parentSpanContext: span.parentSpanContext, + traceState: span.spanContext().traceState?.serialize(), name: span.name, id: span.spanContext().spanId, kind: span.kind, @@ -49019,43 +12274,30 @@ exports.ConsoleSpanExporter = ConsoleSpanExporter; /***/ }), -/***/ 24093: +/***/ 81231: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.InMemorySpanExporter = void 0; -const core_1 = __nccwpck_require__(56460); +const core_1 = __nccwpck_require__(89736); /** * 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. */ class InMemorySpanExporter { - constructor() { - this._finishedSpans = []; - /** - * Indicates if the exporter has been "shutdown." - * When false, exported spans will not be stored in-memory. - */ - this._stopped = false; - } + _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({ @@ -49088,25 +12330,14 @@ exports.InMemorySpanExporter = InMemorySpanExporter; /***/ }), -/***/ 69252: +/***/ 58929: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NoopSpanProcessor = void 0; @@ -49126,30 +12357,21 @@ exports.NoopSpanProcessor = NoopSpanProcessor; /***/ }), -/***/ 89802: +/***/ 40107: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SimpleSpanProcessor = void 0; const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(56460); +const core_1 = __nccwpck_require__(89736); +const SpanProcessorMetrics_1 = __nccwpck_require__(24592); +const semconv_1 = __nccwpck_require__(89064); /** * An implementation of the {@link SpanProcessor} that converts the {@link Span} * to {@link ReadableSpan} and passes it to the configured exporter. @@ -49159,59 +12381,71 @@ const core_1 = __nccwpck_require__(56460); * 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. */ class SimpleSpanProcessor { - constructor(_exporter) { - this._exporter = _exporter; + _exporter; + _metrics; + _shutdownOnce; + _pendingExports; + constructor(options) { + this._exporter = options.exporter; this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); - this._unresolvedExports = new Set(); + this._pendingExports = new Set(); + const meter = options.selfObsMeterProvider + ? options.selfObsMeterProvider.getMeter('@opentelemetry/sdk-trace') + : (0, api_1.createNoopMeter)(); + this._metrics = new SpanProcessorMetrics_1.SpanProcessorMetrics(semconv_1.OTEL_COMPONENT_TYPE_VALUE_SIMPLE_SPAN_PROCESSOR, meter); } async forceFlush() { - // await unresolved resources before resolving - await Promise.all(Array.from(this._unresolvedExports)); + let pendingExportError; + let pendingExportRejected = false; + try { + await Promise.all(Array.from(this._pendingExports)); + } + catch (err) { + pendingExportError = err; + pendingExportRejected = true; + } if (this._exporter.forceFlush) { await this._exporter.forceFlush(); } + if (pendingExportRejected) { + throw pendingExportError; + } } onStart(_span, _parentContext) { } onEnd(span) { - var _a, _b; if (this._shutdownOnce.isCalled) { return; } if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { return; } - const doExport = () => core_1.internal - ._export(this._exporter, [span]) - .then((result) => { - var _a; - if (result.code !== core_1.ExportResultCode.SUCCESS) { - (0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`)); - } - }) - .catch(error => { - (0, core_1.globalErrorHandler)(error); + const pendingExport = this._doExport(span); + // Enqueue this export to the pending list so it can be flushed by the user. + this._pendingExports.add(pendingExport); + void pendingExport.then(() => { + this._pendingExports.delete(pendingExport); + }, err => { + (0, core_1.globalErrorHandler)(err); + this._pendingExports.delete(pendingExport); }); - // Avoid scheduling a promise to make the behavior more predictable and easier to test + } + async _doExport(span) { if (span.resource.asyncAttributesPending) { - const exportPromise = (_b = (_a = span.resource).waitForAsyncAttributes) === null || _b === void 0 ? void 0 : _b.call(_a).then(() => { - if (exportPromise != null) { - this._unresolvedExports.delete(exportPromise); - } - return doExport(); - }, err => (0, core_1.globalErrorHandler)(err)); - // store the unresolved exports - if (exportPromise != null) { - this._unresolvedExports.add(exportPromise); - } + // Ensure resource is fully resolved before exporting. + await span.resource.waitForAsyncAttributes?.(); } - else { - void doExport(); + const result = await core_1.internal._export(this._exporter, [span]); + this._metrics.finishSpans(1, result.error); + if (result.code !== core_1.ExportResultCode.SUCCESS) { + throw (result.error ?? + new Error(`SimpleSpanProcessor: span export failed (status ${result})`)); } } shutdown() { return this._shutdownOnce.call(); } _shutdown() { + this._metrics.shutdown(); return this._exporter.shutdown(); } } @@ -49220,126 +12454,228 @@ exports.SimpleSpanProcessor = SimpleSpanProcessor; /***/ }), -/***/ 29253: +/***/ 24592: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Span = exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.ForceFlushState = exports.BasicTracerProvider = exports.Tracer = void 0; -var Tracer_1 = __nccwpck_require__(63806); -Object.defineProperty(exports, "Tracer", ({ enumerable: true, get: function () { return Tracer_1.Tracer; } })); -var BasicTracerProvider_1 = __nccwpck_require__(78920); -Object.defineProperty(exports, "BasicTracerProvider", ({ enumerable: true, get: function () { return BasicTracerProvider_1.BasicTracerProvider; } })); -Object.defineProperty(exports, "ForceFlushState", ({ enumerable: true, get: function () { return BasicTracerProvider_1.ForceFlushState; } })); -var platform_1 = __nccwpck_require__(10262); +exports.SpanProcessorMetrics = void 0; +const semantic_conventions_1 = __nccwpck_require__(67275); +const semconv_1 = __nccwpck_require__(89064); +const componentCounter = new Map(); +class SpanProcessorMetrics { + processedSpans; + queueSize; + queueSizeCallback; + standardAttrs; + droppedAttrs; + constructor(componentType, meter, queueConfig) { + const counter = componentCounter.get(componentType) ?? 0; + componentCounter.set(componentType, counter + 1); + this.standardAttrs = { + [semconv_1.ATTR_OTEL_COMPONENT_TYPE]: componentType, + [semconv_1.ATTR_OTEL_COMPONENT_NAME]: `${componentType}/${counter}`, + }; + this.droppedAttrs = { + ...this.standardAttrs, + [semantic_conventions_1.ATTR_ERROR_TYPE]: 'queue_full', + }; + this.processedSpans = meter.createCounter(semconv_1.METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED, { + unit: '{span}', + description: 'The number of spans for which the processing has finished, either successful or failed.', + }); + if (queueConfig) { + const { capacity, getQueueSize } = queueConfig; + const queueCapacity = meter.createUpDownCounter(semconv_1.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY, { + unit: '{span}', + description: 'The maximum number of spans the queue of a given instance of an SDK span processor can hold.', + }); + queueCapacity.add(capacity, this.standardAttrs); + this.queueSize = meter.createObservableUpDownCounter(semconv_1.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE, { + unit: '{span}', + description: 'The number of spans in the queue of a given instance of an SDK span processor.', + }); + this.queueSizeCallback = result => result.observe(getQueueSize(), this.standardAttrs); + this.queueSize.addCallback(this.queueSizeCallback); + } + } + dropSpans(count) { + this.processedSpans.add(count, this.droppedAttrs); + } + finishSpans(count, error) { + if (!error) { + this.processedSpans.add(count, this.standardAttrs); + return; + } + const attrs = { + ...this.standardAttrs, + [semantic_conventions_1.ATTR_ERROR_TYPE]: error.name, + }; + this.processedSpans.add(count, attrs); + } + shutdown() { + if (this.queueSize && this.queueSizeCallback) { + this.queueSize.removeCallback(this.queueSizeCallback); + } + } +} +exports.SpanProcessorMetrics = SpanProcessorMetrics; +//# sourceMappingURL=SpanProcessorMetrics.js.map + +/***/ }), + +/***/ 1516: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.createAlwaysRecordSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.TracerProvider = void 0; +var TracerProvider_1 = __nccwpck_require__(3097); +Object.defineProperty(exports, "TracerProvider", ({ enumerable: true, get: function () { return TracerProvider_1.TracerProvider; } })); +var platform_1 = __nccwpck_require__(37067); 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 = __nccwpck_require__(36784); +var ConsoleSpanExporter_1 = __nccwpck_require__(90599); Object.defineProperty(exports, "ConsoleSpanExporter", ({ enumerable: true, get: function () { return ConsoleSpanExporter_1.ConsoleSpanExporter; } })); -var InMemorySpanExporter_1 = __nccwpck_require__(24093); +var InMemorySpanExporter_1 = __nccwpck_require__(81231); Object.defineProperty(exports, "InMemorySpanExporter", ({ enumerable: true, get: function () { return InMemorySpanExporter_1.InMemorySpanExporter; } })); -var SimpleSpanProcessor_1 = __nccwpck_require__(89802); +var SimpleSpanProcessor_1 = __nccwpck_require__(40107); Object.defineProperty(exports, "SimpleSpanProcessor", ({ enumerable: true, get: function () { return SimpleSpanProcessor_1.SimpleSpanProcessor; } })); -var NoopSpanProcessor_1 = __nccwpck_require__(69252); +var NoopSpanProcessor_1 = __nccwpck_require__(58929); Object.defineProperty(exports, "NoopSpanProcessor", ({ enumerable: true, get: function () { return NoopSpanProcessor_1.NoopSpanProcessor; } })); -var AlwaysOffSampler_1 = __nccwpck_require__(68118); +var AlwaysOffSampler_1 = __nccwpck_require__(13951); Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); -var AlwaysOnSampler_1 = __nccwpck_require__(13032); +var AlwaysOnSampler_1 = __nccwpck_require__(43632); Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); -var ParentBasedSampler_1 = __nccwpck_require__(58070); +var AlwaysRecordSampler_1 = __nccwpck_require__(31841); +Object.defineProperty(exports, "createAlwaysRecordSampler", ({ enumerable: true, get: function () { return AlwaysRecordSampler_1.createAlwaysRecordSampler; } })); +var ParentBasedSampler_1 = __nccwpck_require__(51724); Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); -var TraceIdRatioBasedSampler_1 = __nccwpck_require__(16712); +var TraceIdRatioBasedSampler_1 = __nccwpck_require__(81419); Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); -var Sampler_1 = __nccwpck_require__(17446); +var Sampler_1 = __nccwpck_require__(41584); Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return Sampler_1.SamplingDecision; } })); -var Span_1 = __nccwpck_require__(61301); -Object.defineProperty(exports, "Span", ({ enumerable: true, get: function () { return Span_1.Span; } })); //# sourceMappingURL=index.js.map /***/ }), -/***/ 10262: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; -var node_1 = __nccwpck_require__(36573); -Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return node_1.BatchSpanProcessor; } })); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 97670: +/***/ 83691: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 + */ +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; + } + const childOptions = { + ...options, + depth: options.depth == null ? options.depth : options.depth - 1, + }; + return `${className} ${inspect(payload, childOptions)}`; +} +exports.formatInspect = formatInspect; +//# sourceMappingURL=inspect.js.map + +/***/ }), + +/***/ 37067: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; +var node_1 = __nccwpck_require__(19921); +Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return node_1.BatchSpanProcessor; } })); +Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 94332: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RandomIdGenerator = void 0; const SPAN_ID_BYTES = 8; const TRACE_ID_BYTES = 16; class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); - } + /** + * 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); @@ -49366,29 +12702,18 @@ function getIdGenerator(bytes) { /***/ }), -/***/ 97913: +/***/ 37085: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BatchSpanProcessor = void 0; -const BatchSpanProcessorBase_1 = __nccwpck_require__(69727); +const BatchSpanProcessorBase_1 = __nccwpck_require__(32908); class BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { onShutdown() { } } @@ -49397,59 +12722,37 @@ exports.BatchSpanProcessor = BatchSpanProcessor; /***/ }), -/***/ 36573: +/***/ 19921: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; -var BatchSpanProcessor_1 = __nccwpck_require__(97913); +var BatchSpanProcessor_1 = __nccwpck_require__(37085); Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return BatchSpanProcessor_1.BatchSpanProcessor; } })); -var RandomIdGenerator_1 = __nccwpck_require__(97670); +var RandomIdGenerator_1 = __nccwpck_require__(94332); Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); //# sourceMappingURL=index.js.map /***/ }), -/***/ 68118: +/***/ 13951: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AlwaysOffSampler = void 0; -const Sampler_1 = __nccwpck_require__(17446); +const Sampler_1 = __nccwpck_require__(41584); /** Sampler that samples no traces. */ class AlwaysOffSampler { shouldSample() { @@ -49466,29 +12769,18 @@ exports.AlwaysOffSampler = AlwaysOffSampler; /***/ }), -/***/ 13032: +/***/ 43632: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AlwaysOnSampler = void 0; -const Sampler_1 = __nccwpck_require__(17446); +const Sampler_1 = __nccwpck_require__(41584); /** Sampler that samples all traces. */ class AlwaysOnSampler { shouldSample() { @@ -49505,52 +12797,87 @@ exports.AlwaysOnSampler = AlwaysOnSampler; /***/ }), -/***/ 58070: +/***/ 31841: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createAlwaysRecordSampler = void 0; +const Sampler_1 = __nccwpck_require__(41584); +/** + * Creates a sampler that wraps a delegate and upgrades NOT_RECORD decisions to + * RECORD, ensuring all spans are recorded without affecting the sampling rate. + */ +function createAlwaysRecordSampler(delegate) { + if (!delegate) { + throw new Error('createAlwaysRecordSampler requires a delegate sampler'); + } + return { + shouldSample(context, traceId, spanName, spanKind, attributes, links) { + const result = delegate.shouldSample(context, traceId, spanName, spanKind, attributes, links); + if (result.decision === Sampler_1.SamplingDecision.NOT_RECORD) { + return { + decision: Sampler_1.SamplingDecision.RECORD, + attributes: result.attributes, + traceState: result.traceState, + }; + } + return result; + }, + toString() { + return `AlwaysRecordSampler{${delegate.toString()}}`; + }, + }; +} +exports.createAlwaysRecordSampler = createAlwaysRecordSampler; +//# sourceMappingURL=AlwaysRecordSampler.js.map + +/***/ }), + +/***/ 51724: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ParentBasedSampler = void 0; const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(56460); -const AlwaysOffSampler_1 = __nccwpck_require__(68118); -const AlwaysOnSampler_1 = __nccwpck_require__(13032); +const core_1 = __nccwpck_require__(89736); +const AlwaysOffSampler_1 = __nccwpck_require__(13951); +const AlwaysOnSampler_1 = __nccwpck_require__(43632); /** * A composite sampler that either respects the parent span's sampling decision * or delegates to `delegateSampler` for root spans. */ class ParentBasedSampler { + _root; + _remoteParentSampled; + _remoteParentNotSampled; + _localParentSampled; + _localParentNotSampled; constructor(config) { - var _a, _b, _c, _d; this._root = config.root; if (!this._root) { (0, core_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); } this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); + config.remoteParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); + config.remoteParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); + config.localParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); + config.localParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); } shouldSample(context, traceId, spanName, spanKind, attributes, links) { const parentContext = api_1.trace.getSpanContext(context); @@ -49577,36 +12904,27 @@ exports.ParentBasedSampler = ParentBasedSampler; /***/ }), -/***/ 16712: +/***/ 81419: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceIdRatioBasedSampler = void 0; const api_1 = __nccwpck_require__(65163); -const Sampler_1 = __nccwpck_require__(17446); +const Sampler_1 = __nccwpck_require__(41584); /** Sampler that samples a given fraction of traces based of trace id deterministically. */ class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); + _ratio; + _upperBound; + constructor(ratio = 0) { + this._ratio = this._normalize(ratio); + this._upperBound = + this._ratio === 1 ? 0x100000000 : Math.floor(this._ratio * 0xffffffff); } shouldSample(context, traceId) { return { @@ -49625,9 +12943,14 @@ class TraceIdRatioBasedSampler { } _accumulate(traceId) { let accumulation = 0; - for (let i = 0; i < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); + for (let i = 0; i < 32; i += 8) { + let part = 0; + for (let j = 0; j < 8; j++) { + const c = traceId.charCodeAt(i + j); + // Convert hex char code to value: '0'-'9' -> 0-9, 'a'-'f' -> 10-15, 'A'-'F' -> 10-15 + const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87; + part = (part << 4) | v; + } accumulation = (accumulation ^ part) >>> 0; } return accumulation; @@ -49638,2906 +12961,141 @@ exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; /***/ }), -/***/ 54324: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reconfigureLimits = exports.mergeConfig = void 0; -const config_1 = __nccwpck_require__(91); -const core_1 = __nccwpck_require__(56460); -/** - * 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) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; - const spanLimits = Object.assign({}, userConfig.spanLimits); - const parsedEnvConfig = (0, core_1.getEnvWithoutDefaults)(); - /** - * Reassign span attribute count limit to use first non null value defined by user or use default value - */ - spanLimits.attributeCountLimit = - (_f = (_e = (_d = (_b = (_a = userConfig.spanLimits) === null || _a === void 0 ? void 0 : _a.attributeCountLimit) !== null && _b !== void 0 ? _b : (_c = userConfig.generalLimits) === null || _c === void 0 ? void 0 : _c.attributeCountLimit) !== null && _d !== void 0 ? _d : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT) !== null && _e !== void 0 ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _f !== void 0 ? _f : core_1.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 = - (_m = (_l = (_k = (_h = (_g = userConfig.spanLimits) === null || _g === void 0 ? void 0 : _g.attributeValueLengthLimit) !== null && _h !== void 0 ? _h : (_j = userConfig.generalLimits) === null || _j === void 0 ? void 0 : _j.attributeValueLengthLimit) !== null && _k !== void 0 ? _k : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _l !== void 0 ? _l : parsedEnvConfig.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _m !== void 0 ? _m : core_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; - return Object.assign({}, userConfig, { spanLimits }); -} -exports.reconfigureLimits = reconfigureLimits; -//# sourceMappingURL=utility.js.map - -/***/ }), - -/***/ 59872: +/***/ 89064: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExportResultCode = void 0; -var ExportResultCode; -(function (ExportResultCode) { - ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; -})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); -//# sourceMappingURL=ExportResult.js.map +exports.OTEL_COMPONENT_TYPE_VALUE_SIMPLE_SPAN_PROCESSOR = exports.OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR = exports.METRIC_OTEL_SDK_SPAN_STARTED = exports.METRIC_OTEL_SDK_SPAN_LIVE = exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE = exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY = exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED = exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = exports.ATTR_OTEL_COMPONENT_TYPE = exports.ATTR_OTEL_COMPONENT_NAME = void 0; +/* + * This file contains a copy of unstable semantic convention definitions + * used by this package. + * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv + */ +/** + * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance. + * + * @example otlp_grpc_span_exporter/0 + * @example custom-name + * + * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts. + * E.g. implementations **MUST NOT** use UUIDs as values for this attribute. + * + * Implementations **MAY** achieve these goals by following a `/` pattern, e.g. `batching_span_processor/0`. + * Hereby `otel.component.type` refers to the corresponding attribute value of the component. + * + * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed. + * For example, `` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an + * instance of the given component type is started. + * + * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0` + * as `otel.component.name`, the second one `batching_span_processor/1` and so on. + * These values will therefore be reused in the case of an application restart. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OTEL_COMPONENT_NAME = 'otel.component.name'; +/** + * A name identifying the type of the OpenTelemetry component. + * + * @example batching_span_processor + * @example com.example.MySpanExporter + * + * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type. + * E.g. for Java the fully qualified classname **SHOULD** be used in this case. + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OTEL_COMPONENT_TYPE = 'otel.component.type'; +/** + * Determines whether the span has a parent span, and if so, [whether it is a remote parent](https://opentelemetry.io/docs/specs/otel/trace/api/#isremote) + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OTEL_SPAN_PARENT_ORIGIN = 'otel.span.parent.origin'; +/** + * The result value of the sampler for this span + * + * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.ATTR_OTEL_SPAN_SAMPLING_RESULT = 'otel.span.sampling_result'; +/** + * The number of spans for which the processing has finished, either successful or failed. + * + * @note For successful processing, `error.type` **MUST NOT** be set. For failed processing, `error.type` **MUST** contain the failure cause. + * For the SDK Simple and Batching Span Processor a span is considered to be processed already when it has been submitted to the exporter, not when the corresponding export call has finished. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_PROCESSED = 'otel.sdk.processor.span.processed'; +/** + * The maximum number of spans the queue of a given instance of an SDK span processor can hold. + * + * @note Only applies to span processors which use a queue, e.g. the SDK Batching Span Processor. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_CAPACITY = 'otel.sdk.processor.span.queue.capacity'; +/** + * The number of spans in the queue of a given instance of an SDK span processor. + * + * @note Only applies to span processors which use a queue, e.g. the SDK Batching Span Processor. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_OTEL_SDK_PROCESSOR_SPAN_QUEUE_SIZE = 'otel.sdk.processor.span.queue.size'; +/** + * The number of created spans with `recording=true` for which the end operation has not been called yet. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_OTEL_SDK_SPAN_LIVE = 'otel.sdk.span.live'; +/** + * The number of created spans. + * + * @note Implementations **MUST** record this metric for all spans, even for non-recording ones. + * + * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.METRIC_OTEL_SDK_SPAN_STARTED = 'otel.sdk.span.started'; +/** + * Enum value "batching_span_processor" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}. + * + * The builtin SDK batching span processor + * + * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.OTEL_COMPONENT_TYPE_VALUE_BATCHING_SPAN_PROCESSOR = 'batching_span_processor'; +/** + * Enum value "simple_span_processor" for attribute {@link ATTR_OTEL_COMPONENT_TYPE}. + * + * The builtin SDK simple span processor + * + * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`. + */ +exports.OTEL_COMPONENT_TYPE_VALUE_SIMPLE_SPAN_PROCESSOR = 'simple_span_processor'; +//# sourceMappingURL=semconv.js.map /***/ }), -/***/ 2477: +/***/ 93195: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = ','; -// Name of the http header used to propagate the baggage -exports.BAGGAGE_HEADER = 'baggage'; -// Maximum number of name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; -// Maximum number of bytes per a single name-value pair allowed by w3c spec -exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; -// Maximum total length of all name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; -//# sourceMappingURL=constants.js.map - -/***/ }), - -/***/ 76683: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CBaggagePropagator = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(1761); -const constants_1 = __nccwpck_require__(2477); -const utils_1 = __nccwpck_require__(37830); -/** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ - */ -class W3CBaggagePropagator { - inject(context, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context); - if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) - return; - const keyPairs = (0, utils_1.getKeyPairs)(baggage) - .filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }) - .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); - if (headerValue.length > 0) { - setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - } - extract(context, 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; - const baggage = {}; - if (baggageString.length === 0) { - return context; - } - const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); - pairs.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; - } - return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; - } -} -exports.W3CBaggagePropagator = W3CBaggagePropagator; -//# sourceMappingURL=W3CBaggagePropagator.js.map - -/***/ }), - -/***/ 37830: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const constants_1 = __nccwpck_require__(2477); -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)}`; - // include opaque metadata if provided - // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation - if (value.metadata !== undefined) { - 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) { - if (typeof value !== 'string' || value.length === 0) - return {}; - return value - .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) - .map(entry => { - return parsePairKeyValue(entry); - }) - .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) - .reduce((headers, keyPair) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - headers[keyPair.key] = keyPair.value; - return headers; - }, {}); -} -exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 61558: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 - */ -class AnchoredClock { - /** - * 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; -//# sourceMappingURL=anchored-clock.js.map - -/***/ }), - -/***/ 49925: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; -const api_1 = __nccwpck_require__(65163); -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) { - // null/undefined elements are allowed - if (element == null) - continue; - if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; - continue; - } - // encountered an invalid primitive - 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; -} -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 54328: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; -const logging_error_handler_1 = __nccwpck_require__(76149); -/** The global error handler delegate */ -let delegateHandler = (0, 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 (_a) { } // eslint-disable-line no-empty -} -exports.globalErrorHandler = globalErrorHandler; -//# sourceMappingURL=global-error-handler.js.map - -/***/ }), - -/***/ 23954: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBinary = void 0; -function intValue(charCode) { - // 0-9 - if (charCode >= 48 && charCode <= 57) { - return charCode - 48; - } - // a-f - if (charCode >= 97 && charCode <= 102) { - return charCode - 87; - } - // A-F - 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; -//# sourceMappingURL=hex-to-binary.js.map - -/***/ }), - -/***/ 76149: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loggingErrorHandler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * 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; -} -//# sourceMappingURL=logging-error-handler.js.map - -/***/ }), - -/***/ 94806: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = __nccwpck_require__(45649); -const NANOSECOND_DIGITS = 9; -const NANOSECOND_DIGITS_IN_MILLIS = 6; -const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); -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 / 1000; - // Decimals only. - const seconds = Math.trunc(epochSeconds); - // Round sub-nanosecond accuracy to nanosecond. - const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); - return [seconds, nanos]; -} -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) { - const timeOrigin = millisToHrTime(getTimeOrigin()); - const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); - return addHrTimes(timeOrigin, now); -} -exports.hrTime = hrTime; -/** - * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time - */ -function timeInputToHrTime(time) { - // process.hrtime - if (isTimeInputHrTime(time)) { - return time; - } - else if (typeof time === 'number') { - // Must be a performance.now() if it's smaller than process start time. - if (time < getTimeOrigin()) { - return hrTime(time); - } - else { - // epoch milliseconds or performance.timeOrigin - 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]; - // overflow - if (nanos < 0) { - seconds -= 1; - // negate - 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); - const date = new Date(time[0] * 1000).toISOString(); - return date.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]]; - // Nanoseconds - if (out[1] >= SECOND_TO_NANOSECONDS) { - out[1] -= SECOND_TO_NANOSECONDS; - out[0] += 1; - } - return out; -} -exports.addHrTimes = addHrTimes; -//# sourceMappingURL=time.js.map - -/***/ }), - -/***/ 56460: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = 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.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = 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.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; -exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; -var W3CBaggagePropagator_1 = __nccwpck_require__(76683); -Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); -var anchored_clock_1 = __nccwpck_require__(61558); -Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); -var attributes_1 = __nccwpck_require__(49925); -Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); -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 = __nccwpck_require__(54328); -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 = __nccwpck_require__(76149); -Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); -var time_1 = __nccwpck_require__(94806); -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 hex_to_binary_1 = __nccwpck_require__(23954); -Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); -var ExportResult_1 = __nccwpck_require__(59872); -Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); -const utils_1 = __nccwpck_require__(37830); -exports.baggageUtils = { - getKeyPairs: utils_1.getKeyPairs, - serializeKeyPairs: utils_1.serializeKeyPairs, - parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, - parsePairKeyValue: utils_1.parsePairKeyValue, -}; -var platform_1 = __nccwpck_require__(45649); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); -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, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); -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 = __nccwpck_require__(74712); -Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); -var W3CTraceContextPropagator_1 = __nccwpck_require__(39344); -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 = __nccwpck_require__(84727); -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 AlwaysOffSampler_1 = __nccwpck_require__(11742); -Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); -var AlwaysOnSampler_1 = __nccwpck_require__(30137); -Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); -var ParentBasedSampler_1 = __nccwpck_require__(67801); -Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); -var TraceIdRatioBasedSampler_1 = __nccwpck_require__(12900); -Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); -var suppress_tracing_1 = __nccwpck_require__(1761); -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 = __nccwpck_require__(13837); -Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); -var environment_1 = __nccwpck_require__(15017); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); -Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); -var merge_1 = __nccwpck_require__(85841); -Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); -var sampling_1 = __nccwpck_require__(30731); -Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); -var timeout_1 = __nccwpck_require__(20480); -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 = __nccwpck_require__(38966); -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 wrap_1 = __nccwpck_require__(49625); -Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); -var callback_1 = __nccwpck_require__(86119); -Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); -var version_1 = __nccwpck_require__(33802); -Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); -const exporter_1 = __nccwpck_require__(19189); -exports.internal = { - _export: exporter_1._export, -}; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 19189: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._export = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(1761); -/** - * @internal - * Shared functionality used by Exporters while exporting data, including suppression of Traces. - */ -function _export(exporter, arg) { - return new Promise(resolve => { - // prevent downstream exporter calls from generating spans - api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { - exporter.export(arg, (result) => { - resolve(result); - }); - }); - }); -} -exports._export = _export; -//# sourceMappingURL=exporter.js.map - -/***/ }), - -/***/ 94763: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = 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; -//# sourceMappingURL=validators.js.map - -/***/ }), - -/***/ 45649: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var node_1 = __nccwpck_require__(63591); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); -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, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 25336: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = void 0; -const SPAN_ID_BYTES = 8; -const TRACE_ID_BYTES = 16; -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - */ -class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.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++) { - // unsigned right shift drops decimal part of the number - // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE - SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); - } - // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated - 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); - }; -} -//# sourceMappingURL=RandomIdGenerator.js.map - -/***/ }), - -/***/ 61542: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEnvWithoutDefaults = exports.getEnv = void 0; -const environment_1 = __nccwpck_require__(15017); -/** - * Gets the environment variables - */ -function getEnv() { - const processEnv = (0, environment_1.parseEnvironment)(process.env); - return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); -} -exports.getEnv = getEnv; -function getEnvWithoutDefaults() { - return (0, environment_1.parseEnvironment)(process.env); -} -exports.getEnvWithoutDefaults = getEnvWithoutDefaults; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 40247: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 94028: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBase64 = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const hex_to_binary_1 = __nccwpck_require__(23954); -function hexToBase64(hexStr) { - return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); -} -exports.hexToBase64 = hexToBase64; -//# sourceMappingURL=hex-to-base64.js.map - -/***/ }), - -/***/ 63591: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; -var environment_1 = __nccwpck_require__(61542); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); -var globalThis_1 = __nccwpck_require__(40247); -Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); -var hex_to_base64_1 = __nccwpck_require__(94028); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); -var RandomIdGenerator_1 = __nccwpck_require__(25336); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); -var performance_1 = __nccwpck_require__(54813); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); -var sdk_info_1 = __nccwpck_require__(97526); -Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); -var timer_util_1 = __nccwpck_require__(84589); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 54813: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.otperformance = void 0; -const perf_hooks_1 = __nccwpck_require__(4074); -exports.otperformance = perf_hooks_1.performance; -//# sourceMappingURL=performance.js.map - -/***/ }), - -/***/ 97526: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SDK_INFO = void 0; -const version_1 = __nccwpck_require__(33802); -const semantic_conventions_1 = __nccwpck_require__(67275); -/** Constants describing the SDK in use */ -exports.SDK_INFO = { - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, -}; -//# sourceMappingURL=sdk-info.js.map - -/***/ }), - -/***/ 84589: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -function unrefTimer(timer) { - timer.unref(); -} -exports.unrefTimer = unrefTimer; -//# sourceMappingURL=timer-util.js.map - -/***/ }), - -/***/ 74712: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompositePropagator = void 0; -const api_1 = __nccwpck_require__(65163); -/** Combines multiple propagators into a single propagator. */ -class CompositePropagator { - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ - constructor(config = {}) { - var _a; - this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; - this._fields = Array.from(new Set(this._propagators - // older propagators may not have fields function, null check to be sure - .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, carrier, setter) { - for (const propagator of this._propagators) { - try { - propagator.inject(context, 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, 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); - } - fields() { - // return a new array so our fields cannot be modified - return this._fields.slice(); - } -} -exports.CompositePropagator = CompositePropagator; -//# sourceMappingURL=composite.js.map - -/***/ }), - -/***/ 13837: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceState = void 0; -const validators_1 = __nccwpck_require__(94763); -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. - */ -class TraceState { - constructor(rawTraceState) { - this._internalState = new Map(); - if (rawTraceState) - this._parse(rawTraceState); - } - set(key, value) { - // TODO: Benchmark the different approaches(map vs list) and - // use the faster one. - 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() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { - const listMember = part.trim(); // Optional Whitespace (OWS) handling - 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); - } - else { - // TODO: Consider to add warning log - } - } - return agg; - }, new Map()); - // Because of the reverse() requirement, trunc must be done after map is created - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { - this._internalState = new Map(Array.from(this._internalState.entries()) - .reverse() // Use reverse same as original tracestate parse chain - .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; -//# sourceMappingURL=TraceState.js.map - -/***/ }), - -/***/ 39344: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(1761); -const TraceState_1 = __nccwpck_require__(13837); -exports.TRACE_PARENT_HEADER = 'traceparent'; -exports.TRACE_STATE_HEADER = 'tracestate'; -const VERSION = '00'; -const VERSION_PART = '(?!ff)[\\da-f]{2}'; -const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; -const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; -const FLAGS_PART = '[\\da-f]{2}'; -const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\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; - // According to the specification the implementation should be compatible - // with future versions. If there are more parts, we only reject it if it's using version 00 - // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent - 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/ - */ -class W3CTraceContextPropagator { - inject(context, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context); - if (!spanContext || - (0, suppress_tracing_1.isTracingSuppressed)(context) || - !(0, api_1.isSpanContextValid)(spanContext)) - return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) { - setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } - } - extract(context, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) - return context; - const traceParent = Array.isArray(traceParentHeader) - ? traceParentHeader[0] - : traceParentHeader; - if (typeof traceParent !== 'string') - return context; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) - return context; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - // If more than one `tracestate` header is found, we merge them into a - // single header. - const state = Array.isArray(traceStateHeader) - ? traceStateHeader.join(',') - : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); - } - return api_1.trace.setSpanContext(context, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; - } -} -exports.W3CTraceContextPropagator = W3CTraceContextPropagator; -//# sourceMappingURL=W3CTraceContextPropagator.js.map - -/***/ }), - -/***/ 84727: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; -const api_1 = __nccwpck_require__(65163); -const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); -var RPCType; -(function (RPCType) { - RPCType["HTTP"] = "http"; -})(RPCType = exports.RPCType || (exports.RPCType = {})); -function setRPCMetadata(context, meta) { - return context.setValue(RPC_METADATA_KEY, meta); -} -exports.setRPCMetadata = setRPCMetadata; -function deleteRPCMetadata(context) { - return context.deleteValue(RPC_METADATA_KEY); -} -exports.deleteRPCMetadata = deleteRPCMetadata; -function getRPCMetadata(context) { - return context.getValue(RPC_METADATA_KEY); -} -exports.getRPCMetadata = getRPCMetadata; -//# sourceMappingURL=rpc-metadata.js.map - -/***/ }), - -/***/ 11742: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOffSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples no traces. - */ -class AlwaysOffSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return 'AlwaysOffSampler'; - } -} -exports.AlwaysOffSampler = AlwaysOffSampler; -//# sourceMappingURL=AlwaysOffSampler.js.map - -/***/ }), - -/***/ 30137: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOnSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples all traces. - */ -class AlwaysOnSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, - }; - } - toString() { - return 'AlwaysOnSampler'; - } -} -exports.AlwaysOnSampler = AlwaysOnSampler; -//# sourceMappingURL=AlwaysOnSampler.js.map - -/***/ }), - -/***/ 67801: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ParentBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -const global_error_handler_1 = __nccwpck_require__(54328); -const AlwaysOffSampler_1 = __nccwpck_require__(11742); -const AlwaysOnSampler_1 = __nccwpck_require__(30137); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ -class ParentBasedSampler { - constructor(config) { - var _a, _b, _c, _d; - this._root = config.root; - if (!this._root) { - (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context); - if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { - return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } -} -exports.ParentBasedSampler = ParentBasedSampler; -//# sourceMappingURL=ParentBasedSampler.js.map - -/***/ }), - -/***/ 12900: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceIdRatioBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples a given fraction of traces based of trace id deterministically. - */ -class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); - } - shouldSample(context, traceId) { - return { - decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound - ? api_1.SamplingDecision.RECORD_AND_SAMPLED - : api_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 < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } -} -exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -//# sourceMappingURL=TraceIdRatioBasedSampler.js.map - -/***/ }), - -/***/ 1761: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; -const api_1 = __nccwpck_require__(65163); -const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); -function suppressTracing(context) { - return context.setValue(SUPPRESS_TRACING_KEY, true); -} -exports.suppressTracing = suppressTracing; -function unsuppressTracing(context) { - return context.deleteValue(SUPPRESS_TRACING_KEY); -} -exports.unsuppressTracing = unsuppressTracing; -function isTracingSuppressed(context) { - return context.getValue(SUPPRESS_TRACING_KEY) === true; -} -exports.isTracingSuppressed = isTracingSuppressed; -//# sourceMappingURL=suppress-tracing.js.map - -/***/ }), - -/***/ 86119: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BindOnceFuture = void 0; -const promise_1 = __nccwpck_require__(1491); -/** - * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. - */ -class BindOnceFuture { - constructor(_callback, _that) { - this._callback = _callback; - this._that = _that; - this._isCalled = false; - this._deferred = new promise_1.Deferred(); - } - 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; -//# sourceMappingURL=callback.js.map - -/***/ }), - -/***/ 15017: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; -const api_1 = __nccwpck_require__(65163); -const sampling_1 = __nccwpck_require__(30731); -const DEFAULT_LIST_SEPARATOR = ','; -/** - * Environment interface to define all names - */ -const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; -function isEnvVarABoolean(key) { - return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_NUMBERS_KEYS = [ - 'OTEL_BSP_EXPORT_TIMEOUT', - 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BSP_MAX_QUEUE_SIZE', - 'OTEL_BSP_SCHEDULE_DELAY', - 'OTEL_BLRP_EXPORT_TIMEOUT', - 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BLRP_MAX_QUEUE_SIZE', - 'OTEL_BLRP_SCHEDULE_DELAY', - 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_LINK_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', - 'OTEL_EXPORTER_OTLP_TIMEOUT', - 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', - 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', - 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', - 'OTEL_EXPORTER_JAEGER_AGENT_PORT', -]; -function isEnvVarANumber(key) { - return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_LISTS_KEYS = [ - 'OTEL_NO_PATCH_MODULES', - 'OTEL_PROPAGATORS', - 'OTEL_SEMCONV_STABILITY_OPT_IN', -]; -function isEnvVarAList(key) { - return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; -} -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; -exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; -/** - * Default environment variables - */ -exports.DEFAULT_ENVIRONMENT = { - OTEL_SDK_DISABLED: false, - CONTAINER_NAME: '', - ECS_CONTAINER_METADATA_URI_V4: '', - ECS_CONTAINER_METADATA_URI: '', - HOSTNAME: '', - KUBERNETES_SERVICE_HOST: '', - NAMESPACE: '', - OTEL_BSP_EXPORT_TIMEOUT: 30000, - OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BSP_MAX_QUEUE_SIZE: 2048, - OTEL_BSP_SCHEDULE_DELAY: 5000, - OTEL_BLRP_EXPORT_TIMEOUT: 30000, - OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BLRP_MAX_QUEUE_SIZE: 2048, - OTEL_BLRP_SCHEDULE_DELAY: 5000, - OTEL_EXPORTER_JAEGER_AGENT_HOST: '', - OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, - OTEL_EXPORTER_JAEGER_ENDPOINT: '', - OTEL_EXPORTER_JAEGER_PASSWORD: '', - OTEL_EXPORTER_JAEGER_USER: '', - OTEL_EXPORTER_OTLP_ENDPOINT: '', - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_HEADERS: '', - OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', - OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', - OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', - OTEL_EXPORTER_OTLP_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, - OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', - OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, - OTEL_NO_PATCH_MODULES: [], - OTEL_PROPAGATORS: ['tracecontext', 'baggage'], - OTEL_RESOURCE_ATTRIBUTES: '', - OTEL_SERVICE_NAME: '', - OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_EVENT_COUNT_LIMIT: 128, - OTEL_SPAN_LINK_COUNT_LIMIT: 128, - OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, - OTEL_TRACES_EXPORTER: '', - OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, - OTEL_TRACES_SAMPLER_ARG: '', - OTEL_LOGS_EXPORTER: '', - OTEL_EXPORTER_OTLP_INSECURE: '', - OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', - OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', - OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', - OTEL_EXPORTER_OTLP_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_COMPRESSION: '', - OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', - OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', - OTEL_SEMCONV_STABILITY_OPT_IN: [], -}; -/** - * @param key - * @param environment - * @param values - */ -function parseBoolean(key, environment, values) { - if (typeof values[key] === 'undefined') { - return; - } - const value = String(values[key]); - // support case-insensitive "true" - environment[key] = value.toLowerCase() === 'true'; -} -/** - * Parses a variable as number with number validation - * @param name - * @param environment - * @param values - * @param min - * @param max - */ -function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { - if (typeof values[name] !== 'undefined') { - const value = Number(values[name]); - if (!isNaN(value)) { - if (value < min) { - environment[name] = min; - } - else if (value > max) { - environment[name] = max; - } - else { - environment[name] = value; - } - } - } -} -/** - * Parses list-like strings from input into output. - * @param name - * @param environment - * @param values - * @param separator - */ -function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { - const givenValue = input[name]; - if (typeof givenValue === 'string') { - output[name] = givenValue.split(separator).map(v => v.trim()); - } -} -// The support string -> DiagLogLevel mappings -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, -}; -/** - * Environmentally sets log level if valid log level string is provided - * @param key - * @param environment - * @param values - */ -function setLogLevelFromEnv(key, environment, values) { - const value = values[key]; - if (typeof value === 'string') { - const theLevel = logLevelMap[value.toUpperCase()]; - if (theLevel != null) { - environment[key] = theLevel; - } - } -} -/** - * Parses environment values - * @param values - */ -function parseEnvironment(values) { - const environment = {}; - for (const env in exports.DEFAULT_ENVIRONMENT) { - const key = env; - switch (key) { - case 'OTEL_LOG_LEVEL': - setLogLevelFromEnv(key, environment, values); - break; - default: - if (isEnvVarABoolean(key)) { - parseBoolean(key, environment, values); - } - else if (isEnvVarANumber(key)) { - parseNumber(key, environment, values); - } - else if (isEnvVarAList(key)) { - parseStringList(key, environment, values); - } - else { - const value = values[key]; - if (typeof value !== 'undefined' && value !== null) { - environment[key] = String(value); - } - } - } - } - return environment; -} -exports.parseEnvironment = parseEnvironment; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 35449: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPlainObject = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/** - * 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 funcProto = Function.prototype; -const funcToString = funcProto.toString; -const objectCtorString = funcToString.call(Object); -const getPrototype = overArg(Object.getPrototypeOf, Object); -const objectProto = Object.prototype; -const hasOwnProperty = objectProto.hasOwnProperty; -const symToStringTag = Symbol ? Symbol.toStringTag : undefined; -const nativeObjectToString = objectProto.toString; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function (arg) { - return func(transform(arg)); - }; -} -/** - * 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 = getPrototype(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 === undefined ? 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] = undefined; - unmasked = true; - } - catch (e) { - // silence - } - 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); -} -//# sourceMappingURL=lodash.merge.js.map - -/***/ }), - -/***/ 85841: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.merge = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -const lodash_merge_1 = __nccwpck_require__(35449); -const MAX_LEVEL = 20; -/** - * Merges objects together - * @param args - objects / values to be merged - */ -function merge(...args) { - let result = args.shift(); - const objects = 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 undefined; - } - 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] = takeValue(twoValue); - 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; -} -//# sourceMappingURL=merge.js.map - -/***/ }), - -/***/ 1491: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Deferred = void 0; -class Deferred { - 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; -//# sourceMappingURL=promise.js.map - -/***/ }), - -/***/ 30731: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TracesSamplerValues = void 0; -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 = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); -//# sourceMappingURL=sampling.js.map - -/***/ }), - -/***/ 20480: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.callWithTimeout = exports.TimeoutError = void 0; -/** - * Error that is thrown on timeouts. - */ -class TimeoutError extends Error { - constructor(message) { - super(message); - // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: - // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - 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; -//# sourceMappingURL=timeout.js.map - -/***/ }), - -/***/ 38966: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isUrlIgnored = exports.urlMatches = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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; -//# sourceMappingURL=url.js.map - -/***/ }), - -/***/ 49625: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWrapped = void 0; -/** - * Checks if certain function has been already wrapped - * @param func - */ -function isWrapped(func) { - return (typeof func === 'function' && - typeof func.__original === 'function' && - typeof func.__unwrap === 'function' && - func.__wrapped === true); -} -exports.isWrapped = isWrapped; -//# sourceMappingURL=wrap.js.map - -/***/ }), - -/***/ 33802: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VERSION = void 0; // this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.30.1'; +exports.VERSION = '2.10.0'; //# sourceMappingURL=version.js.map /***/ }), @@ -52549,22 +13107,15 @@ exports.VERSION = '1.30.1'; /* * Copyright The OpenTelemetry 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 - * - * https://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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -52583,6 +13134,7 @@ __exportStar(__nccwpck_require__(2834), exports); // Use these instead __exportStar(__nccwpck_require__(69301), exports); __exportStar(__nccwpck_require__(46152), exports); +__exportStar(__nccwpck_require__(66237), exports); //# sourceMappingURL=index.js.map /***/ }), @@ -52594,18 +13146,7 @@ __exportStar(__nccwpck_require__(46152), exports); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createConstMap = void 0; @@ -52639,18 +13180,7 @@ exports.createConstMap = createConstMap; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SEMRESATTRS_K8S_STATEFULSET_NAME = exports.SEMRESATTRS_K8S_STATEFULSET_UID = exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = exports.SEMRESATTRS_K8S_REPLICASET_NAME = exports.SEMRESATTRS_K8S_REPLICASET_UID = exports.SEMRESATTRS_K8S_CONTAINER_NAME = exports.SEMRESATTRS_K8S_POD_NAME = exports.SEMRESATTRS_K8S_POD_UID = exports.SEMRESATTRS_K8S_NAMESPACE_NAME = exports.SEMRESATTRS_K8S_NODE_UID = exports.SEMRESATTRS_K8S_NODE_NAME = exports.SEMRESATTRS_K8S_CLUSTER_NAME = exports.SEMRESATTRS_HOST_IMAGE_VERSION = exports.SEMRESATTRS_HOST_IMAGE_ID = exports.SEMRESATTRS_HOST_IMAGE_NAME = exports.SEMRESATTRS_HOST_ARCH = exports.SEMRESATTRS_HOST_TYPE = exports.SEMRESATTRS_HOST_NAME = exports.SEMRESATTRS_HOST_ID = exports.SEMRESATTRS_FAAS_MAX_MEMORY = exports.SEMRESATTRS_FAAS_INSTANCE = exports.SEMRESATTRS_FAAS_VERSION = exports.SEMRESATTRS_FAAS_ID = exports.SEMRESATTRS_FAAS_NAME = exports.SEMRESATTRS_DEVICE_MODEL_NAME = exports.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER = exports.SEMRESATTRS_DEVICE_ID = exports.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT = exports.SEMRESATTRS_CONTAINER_IMAGE_TAG = exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = exports.SEMRESATTRS_CONTAINER_RUNTIME = exports.SEMRESATTRS_CONTAINER_ID = exports.SEMRESATTRS_CONTAINER_NAME = exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = exports.SEMRESATTRS_AWS_LOG_STREAM_NAMES = exports.SEMRESATTRS_AWS_LOG_GROUP_ARNS = exports.SEMRESATTRS_AWS_LOG_GROUP_NAMES = exports.SEMRESATTRS_AWS_EKS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = exports.SEMRESATTRS_AWS_ECS_TASK_ARN = exports.SEMRESATTRS_AWS_ECS_LAUNCHTYPE = exports.SEMRESATTRS_AWS_ECS_CLUSTER_ARN = exports.SEMRESATTRS_AWS_ECS_CONTAINER_ARN = exports.SEMRESATTRS_CLOUD_PLATFORM = exports.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE = exports.SEMRESATTRS_CLOUD_REGION = exports.SEMRESATTRS_CLOUD_ACCOUNT_ID = exports.SEMRESATTRS_CLOUD_PROVIDER = void 0; @@ -53912,22 +14442,15 @@ exports.TelemetrySdkLanguageValues = /* * Copyright The OpenTelemetry 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 - * - * https://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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -53952,149 +14475,53 @@ __exportStar(__nccwpck_require__(85003), exports); /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HTTP_REQUEST_METHOD_VALUE_POST = exports.HTTP_REQUEST_METHOD_VALUE_PATCH = exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = exports.HTTP_REQUEST_METHOD_VALUE_HEAD = exports.HTTP_REQUEST_METHOD_VALUE_GET = exports.HTTP_REQUEST_METHOD_VALUE_DELETE = exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = exports.HTTP_REQUEST_METHOD_VALUE_OTHER = exports.ATTR_HTTP_REQUEST_METHOD = exports.ATTR_HTTP_REQUEST_HEADER = exports.ATTR_EXCEPTION_TYPE = exports.ATTR_EXCEPTION_STACKTRACE = exports.ATTR_EXCEPTION_MESSAGE = exports.ATTR_EXCEPTION_ESCAPED = exports.ERROR_TYPE_VALUE_OTHER = exports.ATTR_ERROR_TYPE = exports.ATTR_CLIENT_PORT = exports.ATTR_CLIENT_ADDRESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = exports.ATTR_TELEMETRY_SDK_VERSION = exports.ATTR_TELEMETRY_SDK_NAME = exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = exports.ATTR_TELEMETRY_SDK_LANGUAGE = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = void 0; -exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = exports.ATTR_SIGNALR_CONNECTION_STATUS = exports.ATTR_SERVICE_VERSION = exports.ATTR_SERVICE_NAME = exports.ATTR_SERVER_PORT = exports.ATTR_SERVER_ADDRESS = exports.ATTR_OTEL_STATUS_DESCRIPTION = exports.OTEL_STATUS_CODE_VALUE_OK = exports.OTEL_STATUS_CODE_VALUE_ERROR = exports.ATTR_OTEL_STATUS_CODE = exports.ATTR_OTEL_SCOPE_VERSION = exports.ATTR_OTEL_SCOPE_NAME = exports.NETWORK_TYPE_VALUE_IPV6 = exports.NETWORK_TYPE_VALUE_IPV4 = exports.ATTR_NETWORK_TYPE = exports.NETWORK_TRANSPORT_VALUE_UNIX = exports.NETWORK_TRANSPORT_VALUE_UDP = exports.NETWORK_TRANSPORT_VALUE_TCP = exports.NETWORK_TRANSPORT_VALUE_QUIC = exports.NETWORK_TRANSPORT_VALUE_PIPE = exports.ATTR_NETWORK_TRANSPORT = exports.ATTR_NETWORK_PROTOCOL_VERSION = exports.ATTR_NETWORK_PROTOCOL_NAME = exports.ATTR_NETWORK_PEER_PORT = exports.ATTR_NETWORK_PEER_ADDRESS = exports.ATTR_NETWORK_LOCAL_PORT = exports.ATTR_NETWORK_LOCAL_ADDRESS = exports.JVM_THREAD_STATE_VALUE_WAITING = exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = exports.JVM_THREAD_STATE_VALUE_TERMINATED = exports.JVM_THREAD_STATE_VALUE_RUNNABLE = exports.JVM_THREAD_STATE_VALUE_NEW = exports.JVM_THREAD_STATE_VALUE_BLOCKED = exports.ATTR_JVM_THREAD_STATE = exports.ATTR_JVM_THREAD_DAEMON = exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = exports.JVM_MEMORY_TYPE_VALUE_HEAP = exports.ATTR_JVM_MEMORY_TYPE = exports.ATTR_JVM_MEMORY_POOL_NAME = exports.ATTR_JVM_GC_NAME = exports.ATTR_JVM_GC_ACTION = exports.ATTR_HTTP_ROUTE = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = exports.ATTR_HTTP_RESPONSE_HEADER = exports.ATTR_HTTP_REQUEST_RESEND_COUNT = exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = exports.HTTP_REQUEST_METHOD_VALUE_TRACE = exports.HTTP_REQUEST_METHOD_VALUE_PUT = void 0; -exports.ATTR_USER_AGENT_ORIGINAL = exports.ATTR_URL_SCHEME = exports.ATTR_URL_QUERY = exports.ATTR_URL_PATH = exports.ATTR_URL_FULL = exports.ATTR_URL_FRAGMENT = exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = exports.ATTR_SIGNALR_TRANSPORT = void 0; +exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = exports.ATTR_DOTNET_GC_HEAP_GENERATION = exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST = exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING = exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION = exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT = exports.ATTR_DEPLOYMENT_ENVIRONMENT_NAME = exports.DB_SYSTEM_NAME_VALUE_POSTGRESQL = exports.DB_SYSTEM_NAME_VALUE_MYSQL = exports.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = exports.DB_SYSTEM_NAME_VALUE_MARIADB = exports.ATTR_DB_SYSTEM_NAME = exports.ATTR_DB_STORED_PROCEDURE_NAME = exports.ATTR_DB_RESPONSE_STATUS_CODE = exports.ATTR_DB_QUERY_TEXT = exports.ATTR_DB_QUERY_SUMMARY = exports.ATTR_DB_OPERATION_NAME = exports.ATTR_DB_OPERATION_BATCH_SIZE = exports.ATTR_DB_NAMESPACE = exports.ATTR_DB_COLLECTION_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_REPO_DIGESTS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CODE_STACKTRACE = exports.ATTR_CODE_LINE_NUMBER = exports.ATTR_CODE_FUNCTION_NAME = exports.ATTR_CODE_FILE_PATH = exports.ATTR_CODE_COLUMN_NUMBER = exports.ATTR_CLIENT_PORT = exports.ATTR_CLIENT_ADDRESS = exports.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = exports.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = void 0; +exports.ATTR_K8S_DAEMONSET_LABEL = exports.ATTR_K8S_DAEMONSET_ANNOTATION = exports.ATTR_K8S_CRONJOB_UID = exports.ATTR_K8S_CRONJOB_NAME = exports.ATTR_K8S_CRONJOB_LABEL = exports.ATTR_K8S_CRONJOB_ANNOTATION = exports.ATTR_K8S_CONTAINER_RESTART_COUNT = exports.ATTR_K8S_CONTAINER_NAME = exports.ATTR_K8S_CLUSTER_UID = exports.ATTR_K8S_CLUSTER_NAME = exports.JVM_THREAD_STATE_VALUE_WAITING = exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = exports.JVM_THREAD_STATE_VALUE_TERMINATED = exports.JVM_THREAD_STATE_VALUE_RUNNABLE = exports.JVM_THREAD_STATE_VALUE_NEW = exports.JVM_THREAD_STATE_VALUE_BLOCKED = exports.ATTR_JVM_THREAD_STATE = exports.ATTR_JVM_THREAD_DAEMON = exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = exports.JVM_MEMORY_TYPE_VALUE_HEAP = exports.ATTR_JVM_MEMORY_TYPE = exports.ATTR_JVM_MEMORY_POOL_NAME = exports.ATTR_JVM_GC_NAME = exports.ATTR_JVM_GC_ACTION = exports.ATTR_HTTP_ROUTE = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = exports.ATTR_HTTP_RESPONSE_HEADER = exports.ATTR_HTTP_REQUEST_RESEND_COUNT = exports.ATTR_HTTP_REQUEST_METHOD_ORIGINAL = exports.HTTP_REQUEST_METHOD_VALUE_TRACE = exports.HTTP_REQUEST_METHOD_VALUE_PUT = exports.HTTP_REQUEST_METHOD_VALUE_POST = exports.HTTP_REQUEST_METHOD_VALUE_PATCH = exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = exports.HTTP_REQUEST_METHOD_VALUE_HEAD = exports.HTTP_REQUEST_METHOD_VALUE_GET = exports.HTTP_REQUEST_METHOD_VALUE_DELETE = exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = exports.HTTP_REQUEST_METHOD_VALUE_OTHER = exports.ATTR_HTTP_REQUEST_METHOD = exports.ATTR_HTTP_REQUEST_HEADER = exports.ATTR_EXCEPTION_TYPE = exports.ATTR_EXCEPTION_STACKTRACE = exports.ATTR_EXCEPTION_MESSAGE = exports.ATTR_EXCEPTION_ESCAPED = exports.ERROR_TYPE_VALUE_OTHER = exports.ATTR_ERROR_TYPE = exports.DOTNET_GC_HEAP_GENERATION_VALUE_POH = exports.DOTNET_GC_HEAP_GENERATION_VALUE_LOH = exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = void 0; +exports.ATTR_OTEL_SCOPE_VERSION = exports.ATTR_OTEL_SCOPE_NAME = exports.ATTR_OTEL_EVENT_NAME = exports.NETWORK_TYPE_VALUE_IPV6 = exports.NETWORK_TYPE_VALUE_IPV4 = exports.ATTR_NETWORK_TYPE = exports.NETWORK_TRANSPORT_VALUE_UNIX = exports.NETWORK_TRANSPORT_VALUE_UDP = exports.NETWORK_TRANSPORT_VALUE_TCP = exports.NETWORK_TRANSPORT_VALUE_QUIC = exports.NETWORK_TRANSPORT_VALUE_PIPE = exports.ATTR_NETWORK_TRANSPORT = exports.ATTR_NETWORK_PROTOCOL_VERSION = exports.ATTR_NETWORK_PROTOCOL_NAME = exports.ATTR_NETWORK_PEER_PORT = exports.ATTR_NETWORK_PEER_ADDRESS = exports.ATTR_NETWORK_LOCAL_PORT = exports.ATTR_NETWORK_LOCAL_ADDRESS = exports.ATTR_K8S_STATEFULSET_UID = exports.ATTR_K8S_STATEFULSET_NAME = exports.ATTR_K8S_STATEFULSET_LABEL = exports.ATTR_K8S_STATEFULSET_ANNOTATION = exports.ATTR_K8S_REPLICASET_UID = exports.ATTR_K8S_REPLICASET_NAME = exports.ATTR_K8S_REPLICASET_LABEL = exports.ATTR_K8S_REPLICASET_ANNOTATION = exports.ATTR_K8S_POD_UID = exports.ATTR_K8S_POD_START_TIME = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_POD_LABEL = exports.ATTR_K8S_POD_IP = exports.ATTR_K8S_POD_HOSTNAME = exports.ATTR_K8S_POD_ANNOTATION = exports.ATTR_K8S_NODE_UID = exports.ATTR_K8S_NODE_NAME = exports.ATTR_K8S_NODE_LABEL = exports.ATTR_K8S_NODE_ANNOTATION = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_NAMESPACE_LABEL = exports.ATTR_K8S_NAMESPACE_ANNOTATION = exports.ATTR_K8S_JOB_UID = exports.ATTR_K8S_JOB_NAME = exports.ATTR_K8S_JOB_LABEL = exports.ATTR_K8S_JOB_ANNOTATION = exports.ATTR_K8S_DEPLOYMENT_UID = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_DEPLOYMENT_LABEL = exports.ATTR_K8S_DEPLOYMENT_ANNOTATION = exports.ATTR_K8S_DAEMONSET_UID = exports.ATTR_K8S_DAEMONSET_NAME = void 0; +exports.ATTR_USER_AGENT_ORIGINAL = exports.ATTR_URL_SCHEME = exports.ATTR_URL_QUERY = exports.ATTR_URL_PATH = exports.ATTR_URL_FULL = exports.ATTR_URL_FRAGMENT = exports.ATTR_TELEMETRY_SDK_VERSION = exports.ATTR_TELEMETRY_SDK_NAME = exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = exports.TELEMETRY_SDK_LANGUAGE_VALUE_KOTLIN = exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = exports.ATTR_TELEMETRY_SDK_LANGUAGE = exports.ATTR_TELEMETRY_DISTRO_VERSION = exports.ATTR_TELEMETRY_DISTRO_NAME = exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = exports.ATTR_SIGNALR_TRANSPORT = exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = exports.ATTR_SIGNALR_CONNECTION_STATUS = exports.ATTR_SERVICE_VERSION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_NAME = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_SERVER_PORT = exports.ATTR_SERVER_ADDRESS = exports.ATTR_OTEL_STATUS_DESCRIPTION = exports.OTEL_STATUS_CODE_VALUE_OK = exports.OTEL_STATUS_CODE_VALUE_ERROR = exports.ATTR_OTEL_STATUS_CODE = void 0; //---------------------------------------------------------------------------------------------------------- // DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2 //---------------------------------------------------------------------------------------------------------- /** - * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason - * - * @example acquired - * @example request_canceled - */ -exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result'; -/** - * Enum value "acquired" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. - */ -exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; -/** - * Enum value "endpoint_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. - */ -exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; -/** - * Enum value "global_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. - */ -exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; -/** - * Enum value "request_canceled" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. - */ -exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; -/** - * The language of the telemetry SDK. - */ -exports.ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; -/** - * Enum value "cpp" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; -/** - * Enum value "dotnet" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; -/** - * Enum value "erlang" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; -/** - * Enum value "go" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; -/** - * Enum value "java" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; -/** - * Enum value "nodejs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; -/** - * Enum value "php" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; -/** - * Enum value "python" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; -/** - * Enum value "ruby" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; -/** - * Enum value "rust" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; -/** - * Enum value "swift" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; -/** - * Enum value "webjs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. - */ -exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; -/** - * The name of the telemetry SDK as defined above. - * - * @example opentelemetry - * - * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`. - * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the - * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point - * or another suitable identifier depending on the language. - * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case. - * All custom identifiers **SHOULD** be stable across different versions of an implementation. - */ -exports.ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; -/** - * The version string of the telemetry SDK. - * - * @example 1.2.3 - */ -exports.ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; -/** - * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. - * - * @example Contoso.MyHandler - */ -exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type'; -/** - * ASP.NET Core exception middleware handling result + * ASP.NET Core exception middleware handling result. * * @example handled * @example unhandled */ exports.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result'; /** - * Enum value "aborted" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. - */ + * Enum value "aborted" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + * + * Exception handling didn't run because the request was aborted. + */ exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = "aborted"; /** - * Enum value "handled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. - */ + * Enum value "handled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + * + * Exception was handled by the exception handling middleware. + */ exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = "handled"; /** - * Enum value "skipped" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. - */ + * Enum value "skipped" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + * + * Exception handling was skipped because the response had started. + */ exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = "skipped"; /** - * Enum value "unhandled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. - */ + * Enum value "unhandled" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}. + * + * Exception was not handled by the exception handling middleware. + */ exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; +/** + * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception. + * + * @example Contoso.MyHandler + */ +exports.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type'; /** * Rate limiting policy name. * @@ -54103,6 +14530,37 @@ exports.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = "unhandled"; * @example token */ exports.ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy'; +/** + * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason + * + * @example acquired + * @example request_canceled + */ +exports.ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result'; +/** + * Enum value "acquired" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + * + * Lease was acquired + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = "acquired"; +/** + * Enum value "endpoint_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + * + * Lease request was rejected by the endpoint limiter + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = "endpoint_limiter"; +/** + * Enum value "global_limiter" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + * + * Lease request was rejected by the global limiter + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = "global_limiter"; +/** + * Enum value "request_canceled" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}. + * + * Lease request was canceled + */ +exports.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = "request_canceled"; /** * Flag indicating if request was handled by the application pipeline. * @@ -54123,13 +14581,23 @@ exports.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback'; */ exports.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status'; /** - * Enum value "failure" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. - */ + * Enum value "failure" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. + * + * Match failed + */ exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; /** - * Enum value "success" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. - */ + * Enum value "success" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}. + * + * Match succeeded + */ exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = "success"; +/** + * A value that indicates whether the user is authenticated. + * + * @example true + */ +exports.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = 'aspnetcore.user.is_authenticated'; /** * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name. * @@ -54148,6 +14616,327 @@ exports.ATTR_CLIENT_ADDRESS = 'client.address'; * @note When observed from the server side, and when communicating through an intermediary, `client.port` **SHOULD** represent the client port behind any intermediaries, for example proxies, if it's available. */ exports.ATTR_CLIENT_PORT = 'client.port'; +/** + * The column number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. + * + * @example 16 + */ +exports.ATTR_CODE_COLUMN_NUMBER = 'code.column.number'; +/** + * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. + * + * @example "/usr/local/MyApplication/content_root/app/index.php" + */ +exports.ATTR_CODE_FILE_PATH = 'code.file.path'; +/** + * The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity. + * + * @example com.example.MyHttpService.serveRequest + * @example GuzzleHttp\\Client::transfer + * @example fopen + * + * @note Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples. + * The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in + * `code.stacktrace` without information on arguments. + * + * Examples: + * + * - Java method: `com.example.MyHttpService.serveRequest` + * - Java anonymous class method: `com.mycompany.Main$1.myMethod` + * - Java lambda method: `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod` + * - PHP function: `GuzzleHttp\Client::transfer` + * - Go function: `github.com/my/repo/pkg.foo.func5` + * - Elixir: `OpenTelemetry.Ctx.new` + * - Erlang: `opentelemetry_ctx:new` + * - Rust: `playground::my_module::my_cool_func` + * - C function: `fopen` + */ +exports.ATTR_CODE_FUNCTION_NAME = 'code.function.name'; +/** + * The line number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity. + * + * @example 42 + */ +exports.ATTR_CODE_LINE_NUMBER = 'code.line.number'; +/** + * A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity. + * + * @example "at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\n" + */ +exports.ATTR_CODE_STACKTRACE = 'code.stacktrace'; +/** + * 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 + */ +exports.ATTR_CONTAINER_ID = 'container.id'; +/** + * Name of the image the container was built on. + * + * @example gcr.io/opentelemetry/operator + */ +exports.ATTR_CONTAINER_IMAGE_NAME = 'container.image.name'; +/** + * Repo digests of the container image as provided by the container runtime. + * + * @example ["example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"] + * + * @note [Docker](https://docs.docker.com/reference/api/engine/version/v1.52/#tag/Image/operation/ImageInspect) and [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. + */ +exports.ATTR_CONTAINER_IMAGE_REPO_DIGESTS = 'container.image.repo_digests'; +/** + * Container image tags. An example can be found in [Docker Image Inspect](https://docs.docker.com/reference/api/engine/version/v1.52/#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"] + */ +exports.ATTR_CONTAINER_IMAGE_TAGS = 'container.image.tags'; +/** + * The name of a collection (table, container) within the database. + * + * @example public.users + * @example customers + * + * @note It is **RECOMMENDED** to capture the value as provided by the application + * without attempting to do any case normalization. + * + * The collection name **SHOULD NOT** be extracted from `db.query.text`, + * when the database system supports query text with multiple collections + * in non-batch operations. + * + * For batch operations, if the individual operations are known to have the same + * collection name then that collection name **SHOULD** be used. + */ +exports.ATTR_DB_COLLECTION_NAME = 'db.collection.name'; +/** + * The name of the database, fully qualified within the server address and port. + * + * @example customers + * @example test.users + * + * @note If a database system has multiple namespace components, they **SHOULD** be concatenated from the most general to the most specific namespace component, using `|` as a separator between the components. Any missing components (and their associated separators) **SHOULD** be omitted. + * Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system. + * It is **RECOMMENDED** to capture the value as provided by the application without attempting to do any case normalization. + */ +exports.ATTR_DB_NAMESPACE = 'db.namespace'; +/** + * The number of database operations included in a batch operation. + * + * @example 2 + * @example 3 + * @example 4 + * + * @note Except for empty batch requests described below, a batch operation contains two + * or more database operations explicitly submitted as separate operations in a single + * client call, protocol message, or database command. + * + * Requests to batch APIs that contain only one operation **SHOULD** be modeled as single + * operations, not as batch operations. + * + * A database call is not a batch operation solely because one operation accepts + * multiple operands, such as keys, rows, documents, points, or other data elements, + * including Redis [`MGET`](https://redis.io/docs/latest/commands/mget/) with + * multiple keys. + * + * In batch APIs that execute the same parameterized operation with parameter sets, + * each parameter set represents one database operation for determining whether the + * request is a batch operation. Requests with only one parameter set **SHOULD** be modeled + * as single operations, not as batch operations. + * + * `db.operation.batch.size` **SHOULD** be set to the number of operations in the batch. + * It **SHOULD NOT** be set for non-batch operations. + * + * A request to execute a batch operation with no operations **SHOULD** also be treated + * as a batch operation, and `db.operation.batch.size` **SHOULD** be set to `0`. + */ +exports.ATTR_DB_OPERATION_BATCH_SIZE = 'db.operation.batch.size'; +/** + * The name of the operation or command being executed. + * + * @example findAndModify + * @example HMSET + * @example SELECT + * + * @note It is **RECOMMENDED** to capture the value as provided by the application + * without attempting to do any case normalization. + * + * The operation name **SHOULD NOT** be extracted from `db.query.text`, + * when the database system supports query text with multiple operations + * in non-batch operations. + * + * If spaces can occur in the operation name, multiple consecutive spaces + * **SHOULD** be normalized to a single space. + * + * For batch operations, if the individual operations are known to have the same operation name + * then that operation name **SHOULD** be used prepended by `BATCH `, + * otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database + * system specific term if more applicable. + */ +exports.ATTR_DB_OPERATION_NAME = 'db.operation.name'; +/** + * Low cardinality summary of a database query. + * + * @example SELECT wuser_table + * @example INSERT shipping_details SELECT orders + * @example get user by id + * + * @note The query summary describes a class of database queries and is useful + * as a grouping key, especially when analyzing telemetry for database + * calls involving complex queries. + * + * Summary may be available to the instrumentation through + * instrumentation hooks or other means. If it is not available, instrumentations + * that support query parsing **SHOULD** generate a summary following + * [Generating query summary](/docs/db/database-spans.md#generating-a-summary-of-the-query) + * section. + * + * For batch operations, if the individual operations are known to have the same query summary + * then that query summary **SHOULD** be used prepended by `BATCH `, + * otherwise `db.query.summary` **SHOULD** be `BATCH` or some other database + * system specific term if more applicable. + */ +exports.ATTR_DB_QUERY_SUMMARY = 'db.query.summary'; +/** + * The database query being executed. + * + * @example SELECT * FROM wuser_table where username = ? + * @example SET mykey ? + * + * @note For sanitization see [Sanitization of `db.query.text`](/docs/db/database-spans.md#sanitization-of-dbquerytext). + * For batch operations, if the individual operations are known to have the same query text then that query text **SHOULD** be used, otherwise all of the individual query texts **SHOULD** be concatenated with separator `; ` or some other database system specific separator if more applicable. + * Parameterized query text **SHOULD NOT** be sanitized. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk. + */ +exports.ATTR_DB_QUERY_TEXT = 'db.query.text'; +/** + * Database response status code. + * + * @example 102 + * @example ORA-17002 + * @example 08P01 + * @example 404 + * + * @note The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes. + * Semantic conventions for individual database systems **SHOULD** document what `db.response.status_code` means in the context of that system. + */ +exports.ATTR_DB_RESPONSE_STATUS_CODE = 'db.response.status_code'; +/** + * The name of a stored procedure within the database. + * + * @example GetCustomer + * + * @note It is **RECOMMENDED** to capture the value as provided by the application + * without attempting to do any case normalization. + * + * For batch operations, if the individual operations are known to have the same + * stored procedure name then that stored procedure name **SHOULD** be used. + */ +exports.ATTR_DB_STORED_PROCEDURE_NAME = 'db.stored_procedure.name'; +/** + * The database management system (DBMS) product as identified by the client instrumentation. + * + * @note The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system.name` is set to `postgresql` based on the instrumentation's best knowledge. + */ +exports.ATTR_DB_SYSTEM_NAME = 'db.system.name'; +/** + * Enum value "mariadb" for attribute {@link ATTR_DB_SYSTEM_NAME}. + * + * [MariaDB](https://mariadb.org/) + */ +exports.DB_SYSTEM_NAME_VALUE_MARIADB = "mariadb"; +/** + * Enum value "microsoft.sql_server" for attribute {@link ATTR_DB_SYSTEM_NAME}. + * + * [Microsoft SQL Server](https://www.microsoft.com/sql-server) + */ +exports.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = "microsoft.sql_server"; +/** + * Enum value "mysql" for attribute {@link ATTR_DB_SYSTEM_NAME}. + * + * [MySQL](https://www.mysql.com/) + */ +exports.DB_SYSTEM_NAME_VALUE_MYSQL = "mysql"; +/** + * Enum value "postgresql" for attribute {@link ATTR_DB_SYSTEM_NAME}. + * + * [PostgreSQL](https://www.postgresql.org/) + */ +exports.DB_SYSTEM_NAME_VALUE_POSTGRESQL = "postgresql"; +/** + * Name of the [deployment environment](https://wikipedia.org/wiki/Deployment_environment) (aka deployment tier). + * + * @example staging + * @example production + * + * @note `deployment.environment.name` does not affect the uniqueness constraints defined through + * the `service.namespace`, `service.name` and `service.instance.id` resource attributes. + * This implies that resources carrying the following attribute combinations **MUST** be + * considered to be identifying the same service: + * + * - `service.name=frontend`, `deployment.environment.name=production` + * - `service.name=frontend`, `deployment.environment.name=staging`. + */ +exports.ATTR_DEPLOYMENT_ENVIRONMENT_NAME = 'deployment.environment.name'; +/** + * Enum value "development" for attribute {@link ATTR_DEPLOYMENT_ENVIRONMENT_NAME}. + * + * Development environment + */ +exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_DEVELOPMENT = "development"; +/** + * Enum value "production" for attribute {@link ATTR_DEPLOYMENT_ENVIRONMENT_NAME}. + * + * Production environment + */ +exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_PRODUCTION = "production"; +/** + * Enum value "staging" for attribute {@link ATTR_DEPLOYMENT_ENVIRONMENT_NAME}. + * + * Staging environment + */ +exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_STAGING = "staging"; +/** + * Enum value "test" for attribute {@link ATTR_DEPLOYMENT_ENVIRONMENT_NAME}. + * + * Testing environment + */ +exports.DEPLOYMENT_ENVIRONMENT_NAME_VALUE_TEST = "test"; +/** + * Name of the garbage collector managed heap generation. + * + * @example gen0 + * @example gen1 + * @example gen2 + */ +exports.ATTR_DOTNET_GC_HEAP_GENERATION = 'dotnet.gc.heap.generation'; +/** + * Enum value "gen0" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}. + * + * Generation 0 + */ +exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = "gen0"; +/** + * Enum value "gen1" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}. + * + * Generation 1 + */ +exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = "gen1"; +/** + * Enum value "gen2" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}. + * + * Generation 2 + */ +exports.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = "gen2"; +/** + * Enum value "loh" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}. + * + * Large Object Heap + */ +exports.DOTNET_GC_HEAP_GENERATION_VALUE_LOH = "loh"; +/** + * Enum value "poh" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}. + * + * Pinned Object Heap + */ +exports.DOTNET_GC_HEAP_GENERATION_VALUE_POH = "poh"; /** * Describes a class of error the operation ended with. * @@ -54161,6 +14950,12 @@ exports.ATTR_CLIENT_PORT = 'client.port'; * When `error.type` is set to a type (e.g., an exception type), its * canonical class name identifying the type within the artifact **SHOULD** be used. * + * If the recorded error type is a wrapper that is not meaningful for + * failure classification, instrumentation **MAY** use the type of the inner + * error instead. For example, in Go, errors created with `fmt.Errorf` + * using `%w` **MAY** be unwrapped when the wrapper type does not help + * classify the failure. + * * Instrumentations **SHOULD** document the list of errors they report. * * The cardinality of `error.type` within one instrumentation library **SHOULD** be low. @@ -54170,7 +14965,7 @@ exports.ATTR_CLIENT_PORT = 'client.port'; * * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`. * - * If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status codes), + * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes), * it's **RECOMMENDED** to: * * - Use a domain-specific attribute @@ -54178,28 +14973,15 @@ exports.ATTR_CLIENT_PORT = 'client.port'; */ exports.ATTR_ERROR_TYPE = 'error.type'; /** - * Enum value "_OTHER" for attribute {@link ATTR_ERROR_TYPE}. - */ + * Enum value "_OTHER" for attribute {@link ATTR_ERROR_TYPE}. + * + * A fallback error value to be used when the instrumentation doesn't define a custom value. + */ exports.ERROR_TYPE_VALUE_OTHER = "_OTHER"; /** - * **SHOULD** be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. + * Indicates that the exception is escaping the scope of the span. * - * @note An exception is considered to have escaped (or left) the scope of a span, - * if that span is ended while the exception is still logically "in flight". - * This may be actually "in flight" in some languages (e.g. if the exception - * is passed to a Context manager's `__exit__` method in Python) but will - * usually be caught at the point of recording the exception in most languages. - * - * It is usually not possible to determine at the point where an exception is thrown - * whether it will escape the scope of a span. - * However, it is trivial to know that an exception - * will escape, if one checks for an active exception just before ending the span, - * as done in the [example for recording span exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/#recording-an-exception). - * - * It follows that an exception may still escape the scope of the span - * even if the `exception.escaped` attribute was not set or set to false, - * since the event might have been recorded at a time where it was not - * clear whether the exception will escape. + * @deprecated It's no longer recommended to record exceptions that are handled and do not escape the scope of a span. */ exports.ATTR_EXCEPTION_ESCAPED = 'exception.escaped'; /** @@ -54207,6 +14989,10 @@ exports.ATTR_EXCEPTION_ESCAPED = 'exception.escaped'; * * @example Division by zero * @example Can't convert 'int' object to str implicitly + * + * @note > [!WARNING] + * + * > This attribute may contain sensitive information. */ exports.ATTR_EXCEPTION_MESSAGE = 'exception.message'; /** @@ -54220,17 +15006,36 @@ exports.ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace'; * * @example java.net.ConnectException * @example OSError + * + * @note If the recorded exception type is a wrapper that is not meaningful for + * failure classification, instrumentation **MAY** use the type of the inner + * exception instead. For example, in Go, errors created with `fmt.Errorf` + * using `%w` **MAY** be unwrapped when the wrapper type does not help + * classify the failure. */ exports.ATTR_EXCEPTION_TYPE = 'exception.type'; /** * HTTP request headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. * - * @example http.request.header.content-type=["application/json"] - * @example http.request.header.x-forwarded-for=["1.2.3.4", "1.2.3.5"] + * @example ["application/json"] + * @example ["1.2.3.4", "1.2.3.5"] * - * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. - * The `User-Agent` header is already captured in the `user_agent.original` attribute. Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. - * The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. + * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. + * Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information. + * + * The `User-Agent` header is already captured in the `user_agent.original` attribute. + * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. + * + * The attribute value **MUST** consist of either multiple header values as an array of strings + * or a single-item array containing a possibly comma-concatenated string, depending on the way + * the HTTP library provides access to headers. + * + * Examples: + * + * - A header `Content-Type: application/json` **SHOULD** be recorded as the `http.request.header.content-type` + * attribute with value `["application/json"]`. + * - A header `X-Forwarded-For: 1.2.3.4, 1.2.3.5` **SHOULD** be recorded as the `http.request.header.x-forwarded-for` + * attribute with value `["1.2.3.4", "1.2.3.5"]` or `["1.2.3.4, 1.2.3.5"]` depending on the HTTP library. */ const ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`; exports.ATTR_HTTP_REQUEST_HEADER = ATTR_HTTP_REQUEST_HEADER; @@ -54242,15 +15047,23 @@ exports.ATTR_HTTP_REQUEST_HEADER = ATTR_HTTP_REQUEST_HEADER; * @example HEAD * * @note HTTP request method value **SHOULD** be "known" to the instrumentation. - * By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) - * and the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + * By default, this convention defines "known" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods), + * the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html) + * and the QUERY method defined in [httpbis-safe-method-w-body](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1). * * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`. * * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named - * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods - * (this list **MUST** be a full override of the default known method, it is not a list of known methods in addition to the defaults). + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods. + * + * + * If this override is done via declarative configuration, then the list **MUST** be configurable via the `known_methods` property + * (an array of case-sensitive strings with minimum items 0) under `.instrumentation/development.general.http.client` and/or + * `.instrumentation/development.general.http.server`. + * + * In either case, this list **MUST** be a full override of the default known methods, + * it is not a list of known methods in addition to the defaults. * * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly. * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent. @@ -54258,44 +15071,64 @@ exports.ATTR_HTTP_REQUEST_HEADER = ATTR_HTTP_REQUEST_HEADER; */ exports.ATTR_HTTP_REQUEST_METHOD = 'http.request.method'; /** - * Enum value "_OTHER" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "_OTHER" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * Any HTTP method that the instrumentation has no prior knowledge of. + */ exports.HTTP_REQUEST_METHOD_VALUE_OTHER = "_OTHER"; /** - * Enum value "CONNECT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "CONNECT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * CONNECT method. + */ exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; /** - * Enum value "DELETE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "DELETE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * DELETE method. + */ exports.HTTP_REQUEST_METHOD_VALUE_DELETE = "DELETE"; /** - * Enum value "GET" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "GET" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * GET method. + */ exports.HTTP_REQUEST_METHOD_VALUE_GET = "GET"; /** - * Enum value "HEAD" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "HEAD" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * HEAD method. + */ exports.HTTP_REQUEST_METHOD_VALUE_HEAD = "HEAD"; /** - * Enum value "OPTIONS" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "OPTIONS" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * OPTIONS method. + */ exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; /** - * Enum value "PATCH" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "PATCH" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * PATCH method. + */ exports.HTTP_REQUEST_METHOD_VALUE_PATCH = "PATCH"; /** - * Enum value "POST" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "POST" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * POST method. + */ exports.HTTP_REQUEST_METHOD_VALUE_POST = "POST"; /** - * Enum value "PUT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "PUT" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * PUT method. + */ exports.HTTP_REQUEST_METHOD_VALUE_PUT = "PUT"; /** - * Enum value "TRACE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. - */ + * Enum value "TRACE" for attribute {@link ATTR_HTTP_REQUEST_METHOD}. + * + * TRACE method. + */ exports.HTTP_REQUEST_METHOD_VALUE_TRACE = "TRACE"; /** * Original HTTP method sent by the client in the request line. @@ -54316,12 +15149,24 @@ exports.ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count'; /** * HTTP response headers, `` being the normalized HTTP Header name (lowercase), the value being the header values. * - * @example http.response.header.content-type=["application/json"] - * @example http.response.header.my-custom-header=["abc", "def"] + * @example ["application/json"] + * @example ["abc", "def"] + * + * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. + * Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. * - * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured. Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information. * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended. - * The attribute value **MUST** consist of either multiple header values as an array of strings or a single-item array containing a possibly comma-concatenated string, depending on the way the HTTP library provides access to headers. + * + * The attribute value **MUST** consist of either multiple header values as an array of strings + * or a single-item array containing a possibly comma-concatenated string, depending on the way + * the HTTP library provides access to headers. + * + * Examples: + * + * - A header `Content-Type: application/json` header **SHOULD** be recorded as the `http.request.response.content-type` + * attribute with value `["application/json"]`. + * - A header `My-custom-header: abc, def` header **SHOULD** be recorded as the `http.response.header.my-custom-header` + * attribute with value `["abc", "def"]` or `["abc, def"]` depending on the HTTP library. */ const ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`; exports.ATTR_HTTP_RESPONSE_HEADER = ATTR_HTTP_RESPONSE_HEADER; @@ -54332,13 +15177,21 @@ exports.ATTR_HTTP_RESPONSE_HEADER = ATTR_HTTP_RESPONSE_HEADER; */ exports.ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code'; /** - * The matched route, that is, the path template in the format used by the respective server framework. + * The matched route template for the request. This **MUST** be low-cardinality and include all static path segments, with dynamic path segments represented with placeholders. * * @example /users/:userID? - * @example {controller}/{action}/{id?} + * @example my-controller/my-action/{id?} * * @note **MUST NOT** be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it. * **SHOULD** include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one. + * + * A static path segment is a part of the route template with a fixed, low-cardinality value. This includes literal strings like `/users/` and placeholders that + * are constrained to a finite, predefined set of values, e.g. `{controller}` or `{action}`. + * + * A dynamic path segment is a placeholder for a value that can have high cardinality and is not constrained to a predefined list like static path segments. + * + * Instrumentations **SHOULD** use routing information provided by the corresponding web framework. They **SHOULD** pick the most precise source of routing information and **MAY** + * support custom route formatting. Instrumentations **SHOULD** document the format and the API used to obtain the route string. */ exports.ATTR_HTTP_ROUTE = 'http.route'; /** @@ -54377,12 +15230,16 @@ exports.ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name'; */ exports.ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type'; /** - * Enum value "heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. - */ + * Enum value "heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. + * + * Heap memory. + */ exports.JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; /** - * Enum value "non_heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. - */ + * Enum value "non_heap" for attribute {@link ATTR_JVM_MEMORY_TYPE}. + * + * Non-heap memory + */ exports.JVM_MEMORY_TYPE_VALUE_NON_HEAP = "non_heap"; /** * Whether the thread is daemon or not. @@ -54396,29 +15253,511 @@ exports.ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon'; */ exports.ATTR_JVM_THREAD_STATE = 'jvm.thread.state'; /** - * Enum value "blocked" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ + * Enum value "blocked" for attribute {@link ATTR_JVM_THREAD_STATE}. + * + * A thread that is blocked waiting for a monitor lock is in this state. + */ exports.JVM_THREAD_STATE_VALUE_BLOCKED = "blocked"; /** - * Enum value "new" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ + * Enum value "new" for attribute {@link ATTR_JVM_THREAD_STATE}. + * + * A thread that has not yet started is in this state. + */ exports.JVM_THREAD_STATE_VALUE_NEW = "new"; /** - * Enum value "runnable" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ + * Enum value "runnable" for attribute {@link ATTR_JVM_THREAD_STATE}. + * + * A thread executing in the Java virtual machine is in this state. + */ exports.JVM_THREAD_STATE_VALUE_RUNNABLE = "runnable"; /** - * Enum value "terminated" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ + * Enum value "terminated" for attribute {@link ATTR_JVM_THREAD_STATE}. + * + * A thread that has exited is in this state. + */ exports.JVM_THREAD_STATE_VALUE_TERMINATED = "terminated"; /** - * Enum value "timed_waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ + * Enum value "timed_waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. + * + * A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state. + */ exports.JVM_THREAD_STATE_VALUE_TIMED_WAITING = "timed_waiting"; /** - * Enum value "waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. - */ + * Enum value "waiting" for attribute {@link ATTR_JVM_THREAD_STATE}. + * + * A thread that is waiting indefinitely for another thread to perform a particular action is in this state. + */ exports.JVM_THREAD_STATE_VALUE_WAITING = "waiting"; +/** + * The name of the cluster. + * + * @example opentelemetry-cluster + */ +exports.ATTR_K8S_CLUSTER_NAME = 'k8s.cluster.name'; +/** + * A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. + * + * @example 218fc5a9-a5f1-4b54-aa05-46717d0ab26d + * + * @note K8s doesn't have support for obtaining a cluster ID. If this is ever + * added, we will recommend collecting the `k8s.cluster.uid` through the + * official APIs. In the meantime, we are able to use the `uid` of the + * `kube-system` namespace as a proxy for cluster ID. Read on for the + * rationale. + * + * Every object created in a K8s cluster is assigned a distinct UID. The + * `kube-system` namespace is used by Kubernetes itself and will exist + * for the lifetime of the cluster. Using the `uid` of the `kube-system` + * namespace is a reasonable proxy for the K8s ClusterID as it will only + * change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + * UUIDs as standardized by + * [ISO/IEC 9834-8 and ITU-T X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). + * Which states: + * + * > If generated according to one of the mechanisms defined in Rec. + * > ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + * > different from all other UUIDs generated before 3603 A.D., or is + * > extremely likely to be different (depending on the mechanism chosen). + * + * Therefore, UIDs between clusters should be extremely unlikely to + * conflict. + */ +exports.ATTR_K8S_CLUSTER_UID = 'k8s.cluster.uid'; +/** + * The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). + * + * @example redis + */ +exports.ATTR_K8S_CONTAINER_NAME = 'k8s.container.name'; +/** + * Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. + */ +exports.ATTR_K8S_CONTAINER_RESTART_COUNT = 'k8s.container.restart_count'; +/** + * The cronjob annotation placed on the CronJob, the `` being the annotation name, the value being the annotation value. + * + * @example 4 + * @example + * + * @note Examples: + * + * - An annotation `retries` with value `4` **SHOULD** be recorded as the + * `k8s.cronjob.annotation.retries` attribute with value `"4"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.cronjob.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_CRONJOB_ANNOTATION = (key) => `k8s.cronjob.annotation.${key}`; +exports.ATTR_K8S_CRONJOB_ANNOTATION = ATTR_K8S_CRONJOB_ANNOTATION; +/** + * The label placed on the CronJob, the `` being the label name, the value being the label value. + * + * @example weekly + * @example + * + * @note Examples: + * + * - A label `type` with value `weekly` **SHOULD** be recorded as the + * `k8s.cronjob.label.type` attribute with value `"weekly"`. + * - A label `automated` with empty string value **SHOULD** be recorded as + * the `k8s.cronjob.label.automated` attribute with value `""`. + */ +const ATTR_K8S_CRONJOB_LABEL = (key) => `k8s.cronjob.label.${key}`; +exports.ATTR_K8S_CRONJOB_LABEL = ATTR_K8S_CRONJOB_LABEL; +/** + * The name of the CronJob. + * + * @example opentelemetry + */ +exports.ATTR_K8S_CRONJOB_NAME = 'k8s.cronjob.name'; +/** + * The UID of the CronJob. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ +exports.ATTR_K8S_CRONJOB_UID = 'k8s.cronjob.uid'; +/** + * The annotation placed on the DaemonSet, the `` being the annotation name, the value being the annotation value, even if the value is empty. + * + * @example 1 + * @example + * + * @note + * Examples: + * + * - An annotation `replicas` with value `1` **SHOULD** be recorded + * as the `k8s.daemonset.annotation.replicas` attribute with value `"1"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.daemonset.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_DAEMONSET_ANNOTATION = (key) => `k8s.daemonset.annotation.${key}`; +exports.ATTR_K8S_DAEMONSET_ANNOTATION = ATTR_K8S_DAEMONSET_ANNOTATION; +/** + * The label placed on the DaemonSet, the `` being the label name, the value being the label value, even if the value is empty. + * + * @example guestbook + * @example + * + * @note + * Examples: + * + * - A label `app` with value `guestbook` **SHOULD** be recorded + * as the `k8s.daemonset.label.app` attribute with value `"guestbook"`. + * - A label `injected` with empty string value **SHOULD** be recorded as + * the `k8s.daemonset.label.injected` attribute with value `""`. + */ +const ATTR_K8S_DAEMONSET_LABEL = (key) => `k8s.daemonset.label.${key}`; +exports.ATTR_K8S_DAEMONSET_LABEL = ATTR_K8S_DAEMONSET_LABEL; +/** + * The name of the DaemonSet. + * + * @example opentelemetry + */ +exports.ATTR_K8S_DAEMONSET_NAME = 'k8s.daemonset.name'; +/** + * The UID of the DaemonSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ +exports.ATTR_K8S_DAEMONSET_UID = 'k8s.daemonset.uid'; +/** + * The annotation placed on the Deployment, the `` being the annotation name, the value being the annotation value, even if the value is empty. + * + * @example 1 + * @example + * + * @note + * Examples: + * + * - An annotation `replicas` with value `1` **SHOULD** be recorded + * as the `k8s.deployment.annotation.replicas` attribute with value `"1"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.deployment.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_DEPLOYMENT_ANNOTATION = (key) => `k8s.deployment.annotation.${key}`; +exports.ATTR_K8S_DEPLOYMENT_ANNOTATION = ATTR_K8S_DEPLOYMENT_ANNOTATION; +/** + * The label placed on the Deployment, the `` being the label name, the value being the label value, even if the value is empty. + * + * @example guestbook + * @example + * + * @note + * Examples: + * + * - A label `app` with value `guestbook` **SHOULD** be recorded + * as the `k8s.deployment.label.app` attribute with value `"guestbook"`. + * - A label `injected` with empty string value **SHOULD** be recorded as + * the `k8s.deployment.label.injected` attribute with value `""`. + */ +const ATTR_K8S_DEPLOYMENT_LABEL = (key) => `k8s.deployment.label.${key}`; +exports.ATTR_K8S_DEPLOYMENT_LABEL = ATTR_K8S_DEPLOYMENT_LABEL; +/** + * The name of the Deployment. + * + * @example opentelemetry + */ +exports.ATTR_K8S_DEPLOYMENT_NAME = 'k8s.deployment.name'; +/** + * The UID of the Deployment. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ +exports.ATTR_K8S_DEPLOYMENT_UID = 'k8s.deployment.uid'; +/** + * The annotation placed on the Job, the `` being the annotation name, the value being the annotation value, even if the value is empty. + * + * @example 1 + * @example + * + * @note + * Examples: + * + * - An annotation `number` with value `1` **SHOULD** be recorded + * as the `k8s.job.annotation.number` attribute with value `"1"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.job.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_JOB_ANNOTATION = (key) => `k8s.job.annotation.${key}`; +exports.ATTR_K8S_JOB_ANNOTATION = ATTR_K8S_JOB_ANNOTATION; +/** + * The label placed on the Job, the `` being the label name, the value being the label value, even if the value is empty. + * + * @example ci + * @example + * + * @note + * Examples: + * + * - A label `jobtype` with value `ci` **SHOULD** be recorded + * as the `k8s.job.label.jobtype` attribute with value `"ci"`. + * - A label `automated` with empty string value **SHOULD** be recorded as + * the `k8s.job.label.automated` attribute with value `""`. + */ +const ATTR_K8S_JOB_LABEL = (key) => `k8s.job.label.${key}`; +exports.ATTR_K8S_JOB_LABEL = ATTR_K8S_JOB_LABEL; +/** + * The name of the Job. + * + * @example opentelemetry + */ +exports.ATTR_K8S_JOB_NAME = 'k8s.job.name'; +/** + * The UID of the Job. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ +exports.ATTR_K8S_JOB_UID = 'k8s.job.uid'; +/** + * The annotation placed on the Namespace, the `` being the annotation name, the value being the annotation value, even if the value is empty. + * + * @example 0 + * @example + * + * @note + * Examples: + * + * - An annotation `ttl` with value `0` **SHOULD** be recorded + * as the `k8s.namespace.annotation.ttl` attribute with value `"0"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.namespace.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_NAMESPACE_ANNOTATION = (key) => `k8s.namespace.annotation.${key}`; +exports.ATTR_K8S_NAMESPACE_ANNOTATION = ATTR_K8S_NAMESPACE_ANNOTATION; +/** + * The label placed on the Namespace, the `` being the label name, the value being the label value, even if the value is empty. + * + * @example default + * @example + * + * @note + * Examples: + * + * - A label `kubernetes.io/metadata.name` with value `default` **SHOULD** be recorded + * as the `k8s.namespace.label.kubernetes.io/metadata.name` attribute with value `"default"`. + * - A label `data` with empty string value **SHOULD** be recorded as + * the `k8s.namespace.label.data` attribute with value `""`. + */ +const ATTR_K8S_NAMESPACE_LABEL = (key) => `k8s.namespace.label.${key}`; +exports.ATTR_K8S_NAMESPACE_LABEL = ATTR_K8S_NAMESPACE_LABEL; +/** + * The name of the namespace that the pod is running in. + * + * @example default + */ +exports.ATTR_K8S_NAMESPACE_NAME = 'k8s.namespace.name'; +/** + * The annotation placed on the Node, the `` being the annotation name, the value being the annotation value, even if the value is empty. + * + * @example 0 + * @example + * + * @note Examples: + * + * - An annotation `node.alpha.kubernetes.io/ttl` with value `0` **SHOULD** be recorded as + * the `k8s.node.annotation.node.alpha.kubernetes.io/ttl` attribute with value `"0"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.node.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_NODE_ANNOTATION = (key) => `k8s.node.annotation.${key}`; +exports.ATTR_K8S_NODE_ANNOTATION = ATTR_K8S_NODE_ANNOTATION; +/** + * The label placed on the Node, the `` being the label name, the value being the label value, even if the value is empty. + * + * @example arm64 + * @example + * + * @note Examples: + * + * - A label `kubernetes.io/arch` with value `arm64` **SHOULD** be recorded + * as the `k8s.node.label.kubernetes.io/arch` attribute with value `"arm64"`. + * - A label `data` with empty string value **SHOULD** be recorded as + * the `k8s.node.label.data` attribute with value `""`. + */ +const ATTR_K8S_NODE_LABEL = (key) => `k8s.node.label.${key}`; +exports.ATTR_K8S_NODE_LABEL = ATTR_K8S_NODE_LABEL; +/** + * The name of the Node. + * + * @example node-1 + */ +exports.ATTR_K8S_NODE_NAME = 'k8s.node.name'; +/** + * The UID of the Node. + * + * @example 1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2 + */ +exports.ATTR_K8S_NODE_UID = 'k8s.node.uid'; +/** + * The annotation placed on the Pod, the `` being the annotation name, the value being the annotation value. + * + * @example true + * @example x64 + * @example + * + * @note Examples: + * + * - An annotation `kubernetes.io/enforce-mountable-secrets` with value `true` **SHOULD** be recorded as + * the `k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets` attribute with value `"true"`. + * - An annotation `mycompany.io/arch` with value `x64` **SHOULD** be recorded as + * the `k8s.pod.annotation.mycompany.io/arch` attribute with value `"x64"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.pod.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_POD_ANNOTATION = (key) => `k8s.pod.annotation.${key}`; +exports.ATTR_K8S_POD_ANNOTATION = ATTR_K8S_POD_ANNOTATION; +/** + * Specifies the hostname of the Pod. + * + * @example collector-gateway + * + * @note The K8s Pod spec has an optional hostname field, which can be used to specify a hostname. + * Refer to [K8s docs](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-hostname-and-subdomain-field) + * for more information about this field. + * + * This attribute aligns with the `hostname` field of the + * [K8s PodSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podspec-v1-core). + */ +exports.ATTR_K8S_POD_HOSTNAME = 'k8s.pod.hostname'; +/** + * IP address allocated to the Pod. + * + * @example 172.18.0.2 + * + * @note This attribute aligns with the `podIP` field of the + * [K8s PodStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podstatus-v1-core). + */ +exports.ATTR_K8S_POD_IP = 'k8s.pod.ip'; +/** + * The label placed on the Pod, the `` being the label name, the value being the label value. + * + * @example my-app + * @example x64 + * @example + * + * @note Examples: + * + * - A label `app` with value `my-app` **SHOULD** be recorded as + * the `k8s.pod.label.app` attribute with value `"my-app"`. + * - A label `mycompany.io/arch` with value `x64` **SHOULD** be recorded as + * the `k8s.pod.label.mycompany.io/arch` attribute with value `"x64"`. + * - A label `data` with empty string value **SHOULD** be recorded as + * the `k8s.pod.label.data` attribute with value `""`. + */ +const ATTR_K8S_POD_LABEL = (key) => `k8s.pod.label.${key}`; +exports.ATTR_K8S_POD_LABEL = ATTR_K8S_POD_LABEL; +/** + * The name of the Pod. + * + * @example opentelemetry-pod-autoconf + */ +exports.ATTR_K8S_POD_NAME = 'k8s.pod.name'; +/** + * The start timestamp of the Pod. + * + * @example 2025-12-04T08:41:03Z + * + * @note Date and time at which the object was acknowledged by the Kubelet. + * This is before the Kubelet pulled the container image(s) for the pod. + * + * This attribute aligns with the `startTime` field of the + * [K8s PodStatus](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#podstatus-v1-core), + * in ISO 8601 (RFC 3339 compatible) format. + */ +exports.ATTR_K8S_POD_START_TIME = 'k8s.pod.start_time'; +/** + * The UID of the Pod. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ +exports.ATTR_K8S_POD_UID = 'k8s.pod.uid'; +/** + * The annotation placed on the ReplicaSet, the `` being the annotation name, the value being the annotation value, even if the value is empty. + * + * @example 0 + * @example + * + * @note + * Examples: + * + * - An annotation `replicas` with value `0` **SHOULD** be recorded + * as the `k8s.replicaset.annotation.replicas` attribute with value `"0"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.replicaset.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_REPLICASET_ANNOTATION = (key) => `k8s.replicaset.annotation.${key}`; +exports.ATTR_K8S_REPLICASET_ANNOTATION = ATTR_K8S_REPLICASET_ANNOTATION; +/** + * The label placed on the ReplicaSet, the `` being the label name, the value being the label value, even if the value is empty. + * + * @example guestbook + * @example + * + * @note + * Examples: + * + * - A label `app` with value `guestbook` **SHOULD** be recorded + * as the `k8s.replicaset.label.app` attribute with value `"guestbook"`. + * - A label `injected` with empty string value **SHOULD** be recorded as + * the `k8s.replicaset.label.injected` attribute with value `""`. + */ +const ATTR_K8S_REPLICASET_LABEL = (key) => `k8s.replicaset.label.${key}`; +exports.ATTR_K8S_REPLICASET_LABEL = ATTR_K8S_REPLICASET_LABEL; +/** + * The name of the ReplicaSet. + * + * @example opentelemetry + */ +exports.ATTR_K8S_REPLICASET_NAME = 'k8s.replicaset.name'; +/** + * The UID of the ReplicaSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ +exports.ATTR_K8S_REPLICASET_UID = 'k8s.replicaset.uid'; +/** + * The annotation placed on the StatefulSet, the `` being the annotation name, the value being the annotation value, even if the value is empty. + * + * @example 1 + * @example + * + * @note + * Examples: + * + * - An annotation `replicas` with value `1` **SHOULD** be recorded + * as the `k8s.statefulset.annotation.replicas` attribute with value `"1"`. + * - An annotation `data` with empty string value **SHOULD** be recorded as + * the `k8s.statefulset.annotation.data` attribute with value `""`. + */ +const ATTR_K8S_STATEFULSET_ANNOTATION = (key) => `k8s.statefulset.annotation.${key}`; +exports.ATTR_K8S_STATEFULSET_ANNOTATION = ATTR_K8S_STATEFULSET_ANNOTATION; +/** + * The label placed on the StatefulSet, the `` being the label name, the value being the label value, even if the value is empty. + * + * @example guestbook + * @example + * + * @note + * Examples: + * + * - A label `app` with value `guestbook` **SHOULD** be recorded + * as the `k8s.statefulset.label.app` attribute with value `"guestbook"`. + * - A label `injected` with empty string value **SHOULD** be recorded as + * the `k8s.statefulset.label.injected` attribute with value `""`. + */ +const ATTR_K8S_STATEFULSET_LABEL = (key) => `k8s.statefulset.label.${key}`; +exports.ATTR_K8S_STATEFULSET_LABEL = ATTR_K8S_STATEFULSET_LABEL; +/** + * The name of the StatefulSet. + * + * @example opentelemetry + */ +exports.ATTR_K8S_STATEFULSET_NAME = 'k8s.statefulset.name'; +/** + * The UID of the StatefulSet. + * + * @example 275ecb36-5aa8-4c2a-9c47-d8bb681b9aff + */ +exports.ATTR_K8S_STATEFULSET_UID = 'k8s.statefulset.uid'; /** * Local address of the network connection - IP address or Unix domain socket name. * @@ -54446,7 +15785,7 @@ exports.ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address'; */ exports.ATTR_NETWORK_PEER_PORT = 'network.peer.port'; /** - * [OSI application layer](https://osi-model.com/application-layer/) or non-OSI equivalent. + * [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent. * * @example amqp * @example http @@ -54465,7 +15804,7 @@ exports.ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name'; */ exports.ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version'; /** - * [OSI transport layer](https://osi-model.com/transport-layer/) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). + * [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication). * * @example tcp * @example udp @@ -54478,27 +15817,37 @@ exports.ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version'; */ exports.ATTR_NETWORK_TRANSPORT = 'network.transport'; /** - * Enum value "pipe" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ + * Enum value "pipe" for attribute {@link ATTR_NETWORK_TRANSPORT}. + * + * Named or anonymous pipe. + */ exports.NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; /** - * Enum value "quic" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ + * Enum value "quic" for attribute {@link ATTR_NETWORK_TRANSPORT}. + * + * QUIC + */ exports.NETWORK_TRANSPORT_VALUE_QUIC = "quic"; /** - * Enum value "tcp" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ + * Enum value "tcp" for attribute {@link ATTR_NETWORK_TRANSPORT}. + * + * TCP + */ exports.NETWORK_TRANSPORT_VALUE_TCP = "tcp"; /** - * Enum value "udp" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ + * Enum value "udp" for attribute {@link ATTR_NETWORK_TRANSPORT}. + * + * UDP + */ exports.NETWORK_TRANSPORT_VALUE_UDP = "udp"; /** - * Enum value "unix" for attribute {@link ATTR_NETWORK_TRANSPORT}. - */ + * Enum value "unix" for attribute {@link ATTR_NETWORK_TRANSPORT}. + * + * Unix domain socket + */ exports.NETWORK_TRANSPORT_VALUE_UNIX = "unix"; /** - * [OSI network layer](https://osi-model.com/network-layer/) or non-OSI equivalent. + * [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent. * * @example ipv4 * @example ipv6 @@ -54507,13 +15856,26 @@ exports.NETWORK_TRANSPORT_VALUE_UNIX = "unix"; */ exports.ATTR_NETWORK_TYPE = 'network.type'; /** - * Enum value "ipv4" for attribute {@link ATTR_NETWORK_TYPE}. - */ + * Enum value "ipv4" for attribute {@link ATTR_NETWORK_TYPE}. + * + * IPv4 + */ exports.NETWORK_TYPE_VALUE_IPV4 = "ipv4"; /** - * Enum value "ipv6" for attribute {@link ATTR_NETWORK_TYPE}. - */ + * Enum value "ipv6" for attribute {@link ATTR_NETWORK_TYPE}. + * + * IPv6 + */ exports.NETWORK_TYPE_VALUE_IPV6 = "ipv6"; +/** + * Identifies the class / type of event. + * + * @example browser.mouse.click + * @example device.app.lifecycle + * + * @note This attribute **SHOULD** be used by non-OTLP exporters when destination does not support `EventName` or equivalent field. This attribute **MAY** be used by applications using existing logging libraries so that it can be used to set the `EventName` field by Collector or SDK components. + */ +exports.ATTR_OTEL_EVENT_NAME = 'otel.event.name'; /** * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). * @@ -54531,12 +15893,16 @@ exports.ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version'; */ exports.ATTR_OTEL_STATUS_CODE = 'otel.status_code'; /** - * Enum value "ERROR" for attribute {@link ATTR_OTEL_STATUS_CODE}. - */ + * Enum value "ERROR" for attribute {@link ATTR_OTEL_STATUS_CODE}. + * + * The operation contains an error. + */ exports.OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; /** - * Enum value "OK" for attribute {@link ATTR_OTEL_STATUS_CODE}. - */ + * Enum value "OK" for attribute {@link ATTR_OTEL_STATUS_CODE}. + * + * The operation has been validated by an Application developer or Operator to have completed successfully. + */ exports.OTEL_STATUS_CODE_VALUE_OK = "OK"; /** * Description of the Status if it has a value, otherwise not set. @@ -54564,16 +15930,58 @@ exports.ATTR_SERVER_ADDRESS = 'server.address'; * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available. */ exports.ATTR_SERVER_PORT = 'server.port'; +/** + * 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. + */ +exports.ATTR_SERVICE_INSTANCE_ID = 'service.instance.id'; /** * Logical name of the service. * * @example shoppingcart * - * @note **MUST** be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value **MUST** be set to `unknown_service`. + * @note **MUST** be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with the process executable name, e.g. `unknown_service:bash`. If the process executable name is not available, the value **MUST** be set to `unknown_service`. + * The process executable name is the name of the process executable, the same value as described by the [`process.executable.name`](process.md) resource attribute. */ exports.ATTR_SERVICE_NAME = 'service.name'; /** - * The version string of the service API or implementation. The format is not defined by these conventions. + * 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. + */ +exports.ATTR_SERVICE_NAMESPACE = 'service.namespace'; +/** + * The version string of the service component. The format is not defined by these conventions. * * @example 2.0.0 * @example a01dbef8a @@ -54587,16 +15995,22 @@ exports.ATTR_SERVICE_VERSION = 'service.version'; */ exports.ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status'; /** - * Enum value "app_shutdown" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. - */ + * Enum value "app_shutdown" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + * + * The connection was closed because the app is shutting down. + */ exports.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = "app_shutdown"; /** - * Enum value "normal_closure" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. - */ + * Enum value "normal_closure" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + * + * The connection was closed normally. + */ exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; /** - * Enum value "timeout" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. - */ + * Enum value "timeout" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}. + * + * The connection was closed due to a timeout. + */ exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; /** * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) @@ -54606,17 +16020,113 @@ exports.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = "timeout"; */ exports.ATTR_SIGNALR_TRANSPORT = 'signalr.transport'; /** - * Enum value "long_polling" for attribute {@link ATTR_SIGNALR_TRANSPORT}. - */ + * Enum value "long_polling" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + * + * LongPolling protocol + */ exports.SIGNALR_TRANSPORT_VALUE_LONG_POLLING = "long_polling"; /** - * Enum value "server_sent_events" for attribute {@link ATTR_SIGNALR_TRANSPORT}. - */ + * Enum value "server_sent_events" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + * + * ServerSentEvents protocol + */ exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; /** - * Enum value "web_sockets" for attribute {@link ATTR_SIGNALR_TRANSPORT}. - */ + * Enum value "web_sockets" for attribute {@link ATTR_SIGNALR_TRANSPORT}. + * + * WebSockets protocol + */ exports.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = "web_sockets"; +/** + * The name of the auto instrumentation agent or distribution, if used. + * + * @example parts-unlimited-java + * + * @note Official auto instrumentation agents and distributions **SHOULD** set the `telemetry.distro.name` attribute to + * a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. + */ +exports.ATTR_TELEMETRY_DISTRO_NAME = 'telemetry.distro.name'; +/** + * The version string of the auto instrumentation agent or distribution, if used. + * + * @example 1.2.3 + */ +exports.ATTR_TELEMETRY_DISTRO_VERSION = 'telemetry.distro.version'; +/** + * The language of the telemetry SDK. + */ +exports.ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language'; +/** + * Enum value "cpp" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_CPP = "cpp"; +/** + * Enum value "dotnet" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = "dotnet"; +/** + * Enum value "erlang" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = "erlang"; +/** + * Enum value "go" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_GO = "go"; +/** + * Enum value "java" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = "java"; +/** + * Enum value "kotlin" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_KOTLIN = "kotlin"; +/** + * Enum value "nodejs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs"; +/** + * Enum value "php" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_PHP = "php"; +/** + * Enum value "python" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = "python"; +/** + * Enum value "ruby" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = "ruby"; +/** + * Enum value "rust" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_RUST = "rust"; +/** + * Enum value "swift" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = "swift"; +/** + * Enum value "webjs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}. + */ +exports.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs"; +/** + * The name of the telemetry SDK as defined above. + * + * @example opentelemetry + * + * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`. + * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the + * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point + * or another suitable identifier depending on the language. + * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case. + * All custom identifiers **SHOULD** be stable across different versions of an implementation. + */ +exports.ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name'; +/** + * The version string of the telemetry SDK. + * + * @example 1.2.3 + */ +exports.ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version'; /** * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component * @@ -54629,9 +16139,40 @@ exports.ATTR_URL_FRAGMENT = 'url.fragment'; * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv * @example //localhost * - * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless. - * `url.full` **MUST NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`. - * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it. + * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment + * is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless. + * + * `url.full` **MUST NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`. + * In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`. + * + * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed). + * + * Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it. + * + * + * Query string values for the following keys **SHOULD** be redacted by default and replaced by the + * value `REDACTED`: + * + * - [`X-Amz-Signature`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html) + * - [`X-Amz-Credential`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html) + * - [`X-Amz-Security-Token`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html) + * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token) + * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls) + * + * This list is subject to change over time. + * + * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive. + * + * + * Instrumentation **MAY** provide a way to override this list via declarative configuration. + * If so, it **SHOULD** use the `sensitive_query_parameters` property + * (an array of case-sensitive strings with minimum items 0) under + * `.instrumentation/development.general.sanitization.url`. + * This list is a full override of the default sensitive query parameter keys, + * it is not a list of keys in addition to the defaults. + * + * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g. + * `https://www.example.com/path?color=blue&sig=REDACTED`. */ exports.ATTR_URL_FULL = 'url.full'; /** @@ -54648,6 +16189,29 @@ exports.ATTR_URL_PATH = 'url.path'; * @example q=OpenTelemetry * * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it. + * + * + * Query string values for the following keys **SHOULD** be redacted by default and replaced by the value `REDACTED`: + * + * - [`X-Amz-Signature`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html) + * - [`X-Amz-Credential`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html) + * - [`X-Amz-Security-Token`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html) + * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token) + * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls) + * + * This list is subject to change over time. + * + * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive. + * + * Instrumentation **MAY** provide a way to override this list via declarative configuration. + * If so, it **SHOULD** use the `sensitive_query_parameters` property + * (an array of case-sensitive strings with minimum items 0) under + * `.instrumentation/development.general.sanitization.url`. + * This list is a full override of the default sensitive query parameter keys, + * it is not a list of keys in addition to the defaults. + * + * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g. + * `q=OpenTelemetry&sig=REDACTED`. */ exports.ATTR_URL_QUERY = 'url.query'; /** @@ -54670,6 +16234,28 @@ exports.ATTR_USER_AGENT_ORIGINAL = 'user_agent.original'; /***/ }), +/***/ 66237: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EVENT_EXCEPTION = void 0; +//----------------------------------------------------------------------------------------------------------- +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/ts-stable/events.ts.j2 +//----------------------------------------------------------------------------------------------------------- +/** + * This event describes a single exception. + */ +exports.EVENT_EXCEPTION = 'exception'; +//# sourceMappingURL=stable_events.js.map + +/***/ }), + /***/ 46152: /***/ ((__unused_webpack_module, exports) => { @@ -54677,21 +16263,11 @@ exports.ATTR_USER_AGENT_ORIGINAL = 'user_agent.original'; /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = exports.METRIC_KESTREL_REJECTED_CONNECTIONS = exports.METRIC_KESTREL_QUEUED_REQUESTS = exports.METRIC_KESTREL_QUEUED_CONNECTIONS = exports.METRIC_KESTREL_CONNECTION_DURATION = exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = exports.METRIC_JVM_THREAD_COUNT = exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = exports.METRIC_JVM_MEMORY_USED = exports.METRIC_JVM_MEMORY_LIMIT = exports.METRIC_JVM_MEMORY_COMMITTED = exports.METRIC_JVM_GC_DURATION = exports.METRIC_JVM_CPU_TIME = exports.METRIC_JVM_CPU_RECENT_UTILIZATION = exports.METRIC_JVM_CPU_COUNT = exports.METRIC_JVM_CLASS_UNLOADED = exports.METRIC_JVM_CLASS_LOADED = exports.METRIC_JVM_CLASS_COUNT = exports.METRIC_HTTP_SERVER_REQUEST_DURATION = exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = void 0; +exports.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS = exports.METRIC_KESTREL_UPGRADED_CONNECTIONS = exports.METRIC_KESTREL_TLS_HANDSHAKE_DURATION = exports.METRIC_KESTREL_REJECTED_CONNECTIONS = exports.METRIC_KESTREL_QUEUED_REQUESTS = exports.METRIC_KESTREL_QUEUED_CONNECTIONS = exports.METRIC_KESTREL_CONNECTION_DURATION = exports.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES = exports.METRIC_KESTREL_ACTIVE_CONNECTIONS = exports.METRIC_JVM_THREAD_COUNT = exports.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC = exports.METRIC_JVM_MEMORY_USED = exports.METRIC_JVM_MEMORY_LIMIT = exports.METRIC_JVM_MEMORY_COMMITTED = exports.METRIC_JVM_GC_DURATION = exports.METRIC_JVM_CPU_TIME = exports.METRIC_JVM_CPU_RECENT_UTILIZATION = exports.METRIC_JVM_CPU_COUNT = exports.METRIC_JVM_CLASS_UNLOADED = exports.METRIC_JVM_CLASS_LOADED = exports.METRIC_JVM_CLASS_COUNT = exports.METRIC_HTTP_SERVER_REQUEST_DURATION = exports.METRIC_HTTP_CLIENT_REQUEST_DURATION = exports.METRIC_DOTNET_TIMER_COUNT = exports.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT = exports.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT = exports.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH = exports.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET = exports.METRIC_DOTNET_PROCESS_CPU_TIME = exports.METRIC_DOTNET_PROCESS_CPU_COUNT = exports.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS = exports.METRIC_DOTNET_JIT_COMPILED_METHODS = exports.METRIC_DOTNET_JIT_COMPILED_IL_SIZE = exports.METRIC_DOTNET_JIT_COMPILATION_TIME = exports.METRIC_DOTNET_GC_PAUSE_TIME = exports.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE = exports.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE = exports.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE = exports.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED = exports.METRIC_DOTNET_GC_COLLECTIONS = exports.METRIC_DOTNET_EXCEPTIONS = exports.METRIC_DOTNET_ASSEMBLY_COUNT = exports.METRIC_DB_CLIENT_OPERATION_DURATION = exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION = exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE = exports.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS = exports.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES = exports.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS = void 0; +exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = void 0; //---------------------------------------------------------------------------------------------------------- // DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/register/stable/metrics.ts.j2 //---------------------------------------------------------------------------------------------------------- @@ -54742,6 +16318,145 @@ exports.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS = 'aspnetcore.rate_limiting.req * @note Meter name: `Microsoft.AspNetCore.Routing`; Added in: ASP.NET Core 8.0 */ exports.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS = 'aspnetcore.routing.match_attempts'; +/** + * Duration of database client operations. + * + * @note Batch operations **SHOULD** be recorded as a single operation. + */ +exports.METRIC_DB_CLIENT_OPERATION_DURATION = 'db.client.operation.duration'; +/** + * The number of .NET assemblies that are currently loaded. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`AppDomain.CurrentDomain.GetAssemblies().Length`](https://learn.microsoft.com/dotnet/api/system.appdomain.getassemblies). + */ +exports.METRIC_DOTNET_ASSEMBLY_COUNT = 'dotnet.assembly.count'; +/** + * The number of exceptions that have been thrown in managed code. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as counting calls to [`AppDomain.CurrentDomain.FirstChanceException`](https://learn.microsoft.com/dotnet/api/system.appdomain.firstchanceexception). + */ +exports.METRIC_DOTNET_EXCEPTIONS = 'dotnet.exceptions'; +/** + * The number of garbage collections that have occurred since the process has started. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric uses the [`GC.CollectionCount(int generation)`](https://learn.microsoft.com/dotnet/api/system.gc.collectioncount) API to calculate exclusive collections per generation. + */ +exports.METRIC_DOTNET_GC_COLLECTIONS = 'dotnet.gc.collections'; +/** + * The *approximate* number of bytes allocated on the managed GC heap since the process has started. The returned value does not include any native allocations. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`GC.GetTotalAllocatedBytes()`](https://learn.microsoft.com/dotnet/api/system.gc.gettotalallocatedbytes). + */ +exports.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED = 'dotnet.gc.heap.total_allocated'; +/** + * The heap fragmentation, as observed during the latest garbage collection. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`GC.GetGCMemoryInfo().GenerationInfo.FragmentationAfterBytes`](https://learn.microsoft.com/dotnet/api/system.gcgenerationinfo.fragmentationafterbytes). + */ +exports.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE = 'dotnet.gc.last_collection.heap.fragmentation.size'; +/** + * The managed GC heap size (including fragmentation), as observed during the latest garbage collection. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`GC.GetGCMemoryInfo().GenerationInfo.SizeAfterBytes`](https://learn.microsoft.com/dotnet/api/system.gcgenerationinfo.sizeafterbytes). + */ +exports.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE = 'dotnet.gc.last_collection.heap.size'; +/** + * The amount of committed virtual memory in use by the .NET GC, as observed during the latest garbage collection. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`GC.GetGCMemoryInfo().TotalCommittedBytes`](https://learn.microsoft.com/dotnet/api/system.gcmemoryinfo.totalcommittedbytes). Committed virtual memory may be larger than the heap size because it includes both memory for storing existing objects (the heap size) and some extra memory that is ready to handle newly allocated objects in the future. + */ +exports.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE = 'dotnet.gc.last_collection.memory.committed_size'; +/** + * The total amount of time paused in GC since the process has started. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`GC.GetTotalPauseDuration()`](https://learn.microsoft.com/dotnet/api/system.gc.gettotalpauseduration). + */ +exports.METRIC_DOTNET_GC_PAUSE_TIME = 'dotnet.gc.pause.time'; +/** + * The amount of time the JIT compiler has spent compiling methods since the process has started. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`JitInfo.GetCompilationTime()`](https://learn.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompilationtime). + */ +exports.METRIC_DOTNET_JIT_COMPILATION_TIME = 'dotnet.jit.compilation.time'; +/** + * Count of bytes of intermediate language that have been compiled since the process has started. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`JitInfo.GetCompiledILBytes()`](https://learn.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledilbytes). + */ +exports.METRIC_DOTNET_JIT_COMPILED_IL_SIZE = 'dotnet.jit.compiled_il.size'; +/** + * The number of times the JIT compiler (re)compiled methods since the process has started. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`JitInfo.GetCompiledMethodCount()`](https://learn.microsoft.com/dotnet/api/system.runtime.jitinfo.getcompiledmethodcount). + */ +exports.METRIC_DOTNET_JIT_COMPILED_METHODS = 'dotnet.jit.compiled_methods'; +/** + * The number of times there was contention when trying to acquire a monitor lock since the process has started. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`Monitor.LockContentionCount`](https://learn.microsoft.com/dotnet/api/system.threading.monitor.lockcontentioncount). + */ +exports.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS = 'dotnet.monitor.lock_contentions'; +/** + * The number of processors available to the process. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as accessing [`Environment.ProcessorCount`](https://learn.microsoft.com/dotnet/api/system.environment.processorcount). + */ +exports.METRIC_DOTNET_PROCESS_CPU_COUNT = 'dotnet.process.cpu.count'; +/** + * CPU time used by the process. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as accessing the corresponding processor time properties on [`System.Diagnostics.Process`](https://learn.microsoft.com/dotnet/api/system.diagnostics.process). + */ +exports.METRIC_DOTNET_PROCESS_CPU_TIME = 'dotnet.process.cpu.time'; +/** + * The number of bytes of physical memory mapped to the process context. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`Environment.WorkingSet`](https://learn.microsoft.com/dotnet/api/system.environment.workingset). + */ +exports.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET = 'dotnet.process.memory.working_set'; +/** + * The number of work items that are currently queued to be processed by the thread pool. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`ThreadPool.PendingWorkItemCount`](https://learn.microsoft.com/dotnet/api/system.threading.threadpool.pendingworkitemcount). + */ +exports.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH = 'dotnet.thread_pool.queue.length'; +/** + * The number of thread pool threads that currently exist. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`ThreadPool.ThreadCount`](https://learn.microsoft.com/dotnet/api/system.threading.threadpool.threadcount). + */ +exports.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT = 'dotnet.thread_pool.thread.count'; +/** + * The number of work items that the thread pool has completed since the process has started. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`ThreadPool.CompletedWorkItemCount`](https://learn.microsoft.com/dotnet/api/system.threading.threadpool.completedworkitemcount). + */ +exports.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT = 'dotnet.thread_pool.work_item.count'; +/** + * The number of timer instances that are currently active. + * + * @note Meter name: `System.Runtime`; Added in: .NET 9.0. + * This metric reports the same values as calling [`Timer.ActiveCount`](https://learn.microsoft.com/dotnet/api/system.threading.timer.activecount). + */ +exports.METRIC_DOTNET_TIMER_COUNT = 'dotnet.timer.count'; /** * Duration of HTTP client requests. */ @@ -54874,18 +16589,7 @@ exports.METRIC_SIGNALR_SERVER_CONNECTION_DURATION = 'signalr.server.connection.d /* * Copyright The OpenTelemetry 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 - * - * https://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 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SEMATTRS_NET_HOST_CARRIER_ICC = exports.SEMATTRS_NET_HOST_CARRIER_MNC = exports.SEMATTRS_NET_HOST_CARRIER_MCC = exports.SEMATTRS_NET_HOST_CARRIER_NAME = exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = exports.SEMATTRS_NET_HOST_CONNECTION_TYPE = exports.SEMATTRS_NET_HOST_NAME = exports.SEMATTRS_NET_HOST_PORT = exports.SEMATTRS_NET_HOST_IP = exports.SEMATTRS_NET_PEER_NAME = exports.SEMATTRS_NET_PEER_PORT = exports.SEMATTRS_NET_PEER_IP = exports.SEMATTRS_NET_TRANSPORT = exports.SEMATTRS_FAAS_INVOKED_REGION = exports.SEMATTRS_FAAS_INVOKED_PROVIDER = exports.SEMATTRS_FAAS_INVOKED_NAME = exports.SEMATTRS_FAAS_COLDSTART = exports.SEMATTRS_FAAS_CRON = exports.SEMATTRS_FAAS_TIME = exports.SEMATTRS_FAAS_DOCUMENT_NAME = exports.SEMATTRS_FAAS_DOCUMENT_TIME = exports.SEMATTRS_FAAS_DOCUMENT_OPERATION = exports.SEMATTRS_FAAS_DOCUMENT_COLLECTION = exports.SEMATTRS_FAAS_EXECUTION = exports.SEMATTRS_FAAS_TRIGGER = exports.SEMATTRS_EXCEPTION_ESCAPED = exports.SEMATTRS_EXCEPTION_STACKTRACE = exports.SEMATTRS_EXCEPTION_MESSAGE = exports.SEMATTRS_EXCEPTION_TYPE = exports.SEMATTRS_DB_SQL_TABLE = exports.SEMATTRS_DB_MONGODB_COLLECTION = exports.SEMATTRS_DB_REDIS_DATABASE_INDEX = exports.SEMATTRS_DB_HBASE_NAMESPACE = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC = exports.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID = exports.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT = exports.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE = exports.SEMATTRS_DB_CASSANDRA_TABLE = exports.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL = exports.SEMATTRS_DB_CASSANDRA_PAGE_SIZE = exports.SEMATTRS_DB_CASSANDRA_KEYSPACE = exports.SEMATTRS_DB_MSSQL_INSTANCE_NAME = exports.SEMATTRS_DB_OPERATION = exports.SEMATTRS_DB_STATEMENT = exports.SEMATTRS_DB_NAME = exports.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME = exports.SEMATTRS_DB_USER = exports.SEMATTRS_DB_CONNECTION_STRING = exports.SEMATTRS_DB_SYSTEM = exports.SEMATTRS_AWS_LAMBDA_INVOKED_ARN = void 0; @@ -57260,22 +18964,15 @@ exports.MessageTypeValues = /* * Copyright The OpenTelemetry 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 - * - * https://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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -57291,7860 +18988,54 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); __exportStar(__nccwpck_require__(89943), exports); //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 58156: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.addSqlCommenterComment = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -// NOTE: This function currently is returning false-positives -// in cases where comment characters appear in string literals -// ("SELECT '-- not a comment';" would return true, although has no comment) -function hasValidSqlComment(query) { - const indexOpeningDashDashComment = query.indexOf('--'); - if (indexOpeningDashDashComment >= 0) { - return true; - } - const indexOpeningSlashComment = query.indexOf('/*'); - if (indexOpeningSlashComment < 0) { - return false; - } - const indexClosingSlashComment = query.indexOf('*/'); - return indexOpeningDashDashComment < indexClosingSlashComment; -} -// sqlcommenter specification (https://google.github.io/sqlcommenter/spec/#value-serialization) -// expects us to URL encode based on the RFC 3986 spec (https://en.wikipedia.org/wiki/Percent-encoding), -// but encodeURIComponent does not handle some characters correctly (! ' ( ) *), -// which means we need special handling for this -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent -function fixedEncodeURIComponent(str) { - return encodeURIComponent(str).replace(/[!'()*]/g, c => `%${c.charCodeAt(0).toString(16).toUpperCase()}`); -} -function addSqlCommenterComment(span, query) { - if (typeof query !== 'string' || query.length === 0) { - return query; - } - // As per sqlcommenter spec we shall not add a comment if there already is a comment - // in the query - if (hasValidSqlComment(query)) { - return query; - } - const propagator = new core_1.W3CTraceContextPropagator(); - const headers = {}; - propagator.inject(api_1.trace.setSpan(api_1.ROOT_CONTEXT, span), headers, api_1.defaultTextMapSetter); - // sqlcommenter spec requires keys in the comment to be sorted lexicographically - const sortedKeys = Object.keys(headers).sort(); - if (sortedKeys.length === 0) { - return query; - } - const commentString = sortedKeys - .map(key => { - const encodedValue = fixedEncodeURIComponent(headers[key]); - return `${key}='${encodedValue}'`; - }) - .join(','); - return `${query} /*${commentString}*/`; -} -exports.addSqlCommenterComment = addSqlCommenterComment; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 84656: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name2 in all) - __defProp(target, name2, { get: all[name2], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var chunk_5J6RGI77_exports = {}; -__export(chunk_5J6RGI77_exports, { - GLOBAL_KEY: () => GLOBAL_KEY, - MODULE_NAME: () => MODULE_NAME, - NAME: () => NAME, - VERSION: () => VERSION -}); -module.exports = __toCommonJS(chunk_5J6RGI77_exports); -var import_chunk_FTA5RKYX = __nccwpck_require__(20435); -var require_package = (0, import_chunk_FTA5RKYX.__commonJS)({ - "package.json"(exports, module2) { - module2.exports = { - name: "@prisma/instrumentation", - version: "5.22.0", - description: "OpenTelemetry compliant instrumentation for Prisma Client", - main: "dist/index.js", - types: "dist/index.d.ts", - license: "Apache-2.0", - homepage: "https://www.prisma.io", - repository: { - type: "git", - url: "https://github.com/prisma/prisma.git", - directory: "packages/instrumentation" - }, - bugs: "https://github.com/prisma/prisma/issues", - devDependencies: { - "@prisma/internals": "workspace:*", - "@swc/core": "1.6.13", - "@types/jest": "29.5.12", - "@types/node": "18.19.31", - jest: "29.7.0", - "jest-junit": "16.0.0", - typescript: "5.4.5" - }, - dependencies: { - "@opentelemetry/api": "^1.8", - "@opentelemetry/instrumentation": "^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0", - "@opentelemetry/sdk-trace-base": "^1.22" - }, - files: [ - "dist" - ], - keywords: [ - "prisma", - "instrumentation", - "opentelemetry", - "otel" - ], - scripts: { - dev: "DEV=true tsx helpers/build.ts", - build: "tsx helpers/build.ts", - prepublishOnly: "pnpm run build", - test: "jest" - }, - sideEffects: false - }; - } -}); -var { version, name } = require_package(); -var GLOBAL_KEY = "PRISMA_INSTRUMENTATION"; -var VERSION = version; -var NAME = name; -var MODULE_NAME = "prisma"; - - -/***/ }), - -/***/ 20435: -/***/ ((module) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var chunk_FTA5RKYX_exports = {}; -__export(chunk_FTA5RKYX_exports, { - __commonJS: () => __commonJS -}); -module.exports = __toCommonJS(chunk_FTA5RKYX_exports); -var __getOwnPropNames2 = Object.getOwnPropertyNames; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; - - -/***/ }), - -/***/ 69525: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var chunk_O7OBHTYQ_exports = {}; -__export(chunk_O7OBHTYQ_exports, { - ActiveTracingHelper: () => ActiveTracingHelper -}); -module.exports = __toCommonJS(chunk_O7OBHTYQ_exports); -var import_api = __nccwpck_require__(65163); -var import_sdk_trace_base = __nccwpck_require__(67030); -var showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true"; -var nonSampledTraceParent = `00-10-10-00`; -function engineSpanKindToOTELSpanKind(engineSpanKind) { - switch (engineSpanKind) { - case "client": - return import_api.SpanKind.CLIENT; - case "internal": - default: - return import_api.SpanKind.INTERNAL; - } -} -var ActiveTracingHelper = class { - constructor({ traceMiddleware }) { - this.traceMiddleware = traceMiddleware; - } - isEnabled() { - return true; - } - getTraceParent(context) { - const span = import_api.trace.getSpanContext(context ?? import_api.context.active()); - if (span) { - return `00-${span.traceId}-${span.spanId}-0${span.traceFlags}`; - } - return nonSampledTraceParent; - } - createEngineSpan(engineSpanEvent) { - const tracer = import_api.trace.getTracer("prisma"); - engineSpanEvent.spans.forEach((engineSpan) => { - const spanKind = engineSpanKindToOTELSpanKind(engineSpan.kind); - const spanContext = { - traceId: engineSpan.trace_id, - spanId: engineSpan.span_id, - traceFlags: import_api.TraceFlags.SAMPLED - }; - const links = engineSpan.links?.map((link) => { - return { - context: { - traceId: link.trace_id, - spanId: link.span_id, - traceFlags: import_api.TraceFlags.SAMPLED - } - }; - }); - const span = new import_sdk_trace_base.Span( - tracer, - import_api.ROOT_CONTEXT, - engineSpan.name, - spanContext, - spanKind, - engineSpan.parent_span_id, - links, - engineSpan.start_time - ); - if (engineSpan.attributes) { - span.setAttributes(engineSpan.attributes); - } - span.end(engineSpan.end_time); - }); - } - getActiveContext() { - return import_api.context.active(); - } - runInChildSpan(options, callback) { - if (typeof options === "string") { - options = { name: options }; - } - if (options.internal && !showAllTraces) { - return callback(); - } - if (options.middleware && !this.traceMiddleware) { - return callback(); - } - const tracer = import_api.trace.getTracer("prisma"); - const context = options.context ?? this.getActiveContext(); - const name = `prisma:client:${options.name}`; - if (options.active === false) { - const span = tracer.startSpan(name, options, context); - return endSpan(span, callback(span, context)); - } - return tracer.startActiveSpan(name, options, (span) => endSpan(span, callback(span, context))); - } -}; -function endSpan(span, result) { - if (isPromiseLike(result)) { - return result.then( - (value) => { - span.end(); - return value; - }, - (reason) => { - span.end(); - throw reason; - } - ); - } - span.end(); - return result; -} -function isPromiseLike(value) { - return value != null && typeof value["then"] === "function"; -} - - -/***/ }), - -/***/ 91897: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var chunk_PVBRMQBZ_exports = {}; -__export(chunk_PVBRMQBZ_exports, { - PrismaInstrumentation: () => PrismaInstrumentation -}); -module.exports = __toCommonJS(chunk_PVBRMQBZ_exports); -var import_chunk_O7OBHTYQ = __nccwpck_require__(69525); -var import_chunk_5J6RGI77 = __nccwpck_require__(84656); -var import_instrumentation = __nccwpck_require__(52007); -var PrismaInstrumentation = class extends import_instrumentation.InstrumentationBase { - constructor(config = {}) { - super(import_chunk_5J6RGI77.NAME, import_chunk_5J6RGI77.VERSION, config); - } - init() { - const module2 = new import_instrumentation.InstrumentationNodeModuleDefinition(import_chunk_5J6RGI77.MODULE_NAME, [import_chunk_5J6RGI77.VERSION]); - return [module2]; - } - enable() { - const config = this._config; - const globalValue = { - helper: new import_chunk_O7OBHTYQ.ActiveTracingHelper({ traceMiddleware: config.middleware ?? false }) - }; - global[import_chunk_5J6RGI77.GLOBAL_KEY] = globalValue; - } - disable() { - delete global[import_chunk_5J6RGI77.GLOBAL_KEY]; - } - isEnabled() { - return Boolean(global[import_chunk_5J6RGI77.GLOBAL_KEY]); - } -}; - - -/***/ }), - -/***/ 50976: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var dist_exports = {}; -__export(dist_exports, { - PrismaInstrumentation: () => import_chunk_PVBRMQBZ.PrismaInstrumentation -}); -module.exports = __toCommonJS(dist_exports); -var import_chunk_PVBRMQBZ = __nccwpck_require__(91897); -var import_chunk_O7OBHTYQ = __nccwpck_require__(69525); -var import_chunk_5J6RGI77 = __nccwpck_require__(84656); -var import_chunk_FTA5RKYX = __nccwpck_require__(20435); - - -/***/ }), - -/***/ 19670: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_LOGGER = exports.NoopLogger = void 0; -class NoopLogger { - emit(_logRecord) { } -} -exports.NoopLogger = NoopLogger; -exports.NOOP_LOGGER = new NoopLogger(); -//# sourceMappingURL=NoopLogger.js.map - -/***/ }), - -/***/ 89568: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_LOGGER_PROVIDER = exports.NoopLoggerProvider = void 0; -const NoopLogger_1 = __nccwpck_require__(19670); -class NoopLoggerProvider { - getLogger(_name, _version, _options) { - return new NoopLogger_1.NoopLogger(); - } -} -exports.NoopLoggerProvider = NoopLoggerProvider; -exports.NOOP_LOGGER_PROVIDER = new NoopLoggerProvider(); -//# sourceMappingURL=NoopLoggerProvider.js.map - -/***/ }), - -/***/ 897: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LogsAPI = void 0; -const global_utils_1 = __nccwpck_require__(70960); -const NoopLoggerProvider_1 = __nccwpck_require__(89568); -class LogsAPI { - constructor() { } - static getInstance() { - if (!this._instance) { - this._instance = new LogsAPI(); - } - return this._instance; - } - setGlobalLoggerProvider(provider) { - if (global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) { - return this.getLoggerProvider(); - } - global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY] = (0, global_utils_1.makeGetter)(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER); - return provider; - } - /** - * Returns the global logger provider. - * - * @returns LoggerProvider - */ - getLoggerProvider() { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER); - } - /** - * Returns a logger from the global logger provider. - * - * @returns Logger - */ - getLogger(name, version, options) { - return this.getLoggerProvider().getLogger(name, version, options); - } - /** Remove the global logger provider */ - disable() { - delete global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]; - } -} -exports.LogsAPI = LogsAPI; -//# sourceMappingURL=logs.js.map - -/***/ }), - -/***/ 8689: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.logs = exports.NoopLoggerProvider = exports.NOOP_LOGGER_PROVIDER = exports.NoopLogger = exports.NOOP_LOGGER = exports.SeverityNumber = void 0; -var LogRecord_1 = __nccwpck_require__(61481); -Object.defineProperty(exports, "SeverityNumber", ({ enumerable: true, get: function () { return LogRecord_1.SeverityNumber; } })); -var NoopLogger_1 = __nccwpck_require__(19670); -Object.defineProperty(exports, "NOOP_LOGGER", ({ enumerable: true, get: function () { return NoopLogger_1.NOOP_LOGGER; } })); -Object.defineProperty(exports, "NoopLogger", ({ enumerable: true, get: function () { return NoopLogger_1.NoopLogger; } })); -var NoopLoggerProvider_1 = __nccwpck_require__(89568); -Object.defineProperty(exports, "NOOP_LOGGER_PROVIDER", ({ enumerable: true, get: function () { return NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; } })); -Object.defineProperty(exports, "NoopLoggerProvider", ({ enumerable: true, get: function () { return NoopLoggerProvider_1.NoopLoggerProvider; } })); -const logs_1 = __nccwpck_require__(897); -exports.logs = logs_1.LogsAPI.getInstance(); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 70960: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_LOGS_API_KEY = void 0; -const platform_1 = __nccwpck_require__(19117); -exports.GLOBAL_LOGS_API_KEY = Symbol.for('io.opentelemetry.js.api.logs'); -exports._global = platform_1._globalThis; -/** - * Make a function which accepts a version integer and returns the instance of an API if the version - * is compatible, or a fallback version (usually NOOP) if it is not. - * - * @param requiredVersion Backwards compatibility version which is required to return the instance - * @param instance Instance which should be returned if the required version is compatible - * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible - */ -function makeGetter(requiredVersion, instance, fallback) { - return (version) => version === requiredVersion ? instance : fallback; -} -exports.makeGetter = makeGetter; -/** - * A number which should be incremented each time a backwards incompatible - * change is made to the API. This number is used when an API package - * attempts to access the global API to ensure it is getting a compatible - * version. If the global API is not compatible with the API package - * attempting to get it, a NOOP API implementation will be returned. - */ -exports.API_BACKWARDS_COMPATIBILITY_VERSION = 1; -//# sourceMappingURL=global-utils.js.map - -/***/ }), - -/***/ 19117: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -var node_1 = __nccwpck_require__(10096); -Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 66826: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 10096: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -var globalThis_1 = __nccwpck_require__(66826); -Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 61481: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SeverityNumber = void 0; -var SeverityNumber; -(function (SeverityNumber) { - SeverityNumber[SeverityNumber["UNSPECIFIED"] = 0] = "UNSPECIFIED"; - SeverityNumber[SeverityNumber["TRACE"] = 1] = "TRACE"; - SeverityNumber[SeverityNumber["TRACE2"] = 2] = "TRACE2"; - SeverityNumber[SeverityNumber["TRACE3"] = 3] = "TRACE3"; - SeverityNumber[SeverityNumber["TRACE4"] = 4] = "TRACE4"; - SeverityNumber[SeverityNumber["DEBUG"] = 5] = "DEBUG"; - SeverityNumber[SeverityNumber["DEBUG2"] = 6] = "DEBUG2"; - SeverityNumber[SeverityNumber["DEBUG3"] = 7] = "DEBUG3"; - SeverityNumber[SeverityNumber["DEBUG4"] = 8] = "DEBUG4"; - SeverityNumber[SeverityNumber["INFO"] = 9] = "INFO"; - SeverityNumber[SeverityNumber["INFO2"] = 10] = "INFO2"; - SeverityNumber[SeverityNumber["INFO3"] = 11] = "INFO3"; - SeverityNumber[SeverityNumber["INFO4"] = 12] = "INFO4"; - SeverityNumber[SeverityNumber["WARN"] = 13] = "WARN"; - SeverityNumber[SeverityNumber["WARN2"] = 14] = "WARN2"; - SeverityNumber[SeverityNumber["WARN3"] = 15] = "WARN3"; - SeverityNumber[SeverityNumber["WARN4"] = 16] = "WARN4"; - SeverityNumber[SeverityNumber["ERROR"] = 17] = "ERROR"; - SeverityNumber[SeverityNumber["ERROR2"] = 18] = "ERROR2"; - SeverityNumber[SeverityNumber["ERROR3"] = 19] = "ERROR3"; - SeverityNumber[SeverityNumber["ERROR4"] = 20] = "ERROR4"; - SeverityNumber[SeverityNumber["FATAL"] = 21] = "FATAL"; - SeverityNumber[SeverityNumber["FATAL2"] = 22] = "FATAL2"; - SeverityNumber[SeverityNumber["FATAL3"] = 23] = "FATAL3"; - SeverityNumber[SeverityNumber["FATAL4"] = 24] = "FATAL4"; -})(SeverityNumber = exports.SeverityNumber || (exports.SeverityNumber = {})); -//# sourceMappingURL=LogRecord.js.map - -/***/ }), - -/***/ 55775: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.registerInstrumentations = void 0; -const api_1 = __nccwpck_require__(65163); -const api_logs_1 = __nccwpck_require__(8689); -const autoLoaderUtils_1 = __nccwpck_require__(97587); -/** - * It will register instrumentations and plugins - * @param options - * @return returns function to unload instrumentation and plugins that were - * registered - */ -function registerInstrumentations(options) { - var _a, _b; - const tracerProvider = options.tracerProvider || api_1.trace.getTracerProvider(); - const meterProvider = options.meterProvider || api_1.metrics.getMeterProvider(); - const loggerProvider = options.loggerProvider || api_logs_1.logs.getLoggerProvider(); - const instrumentations = (_b = (_a = options.instrumentations) === null || _a === void 0 ? void 0 : _a.flat()) !== null && _b !== void 0 ? _b : []; - (0, autoLoaderUtils_1.enableInstrumentations)(instrumentations, tracerProvider, meterProvider, loggerProvider); - return () => { - (0, autoLoaderUtils_1.disableInstrumentations)(instrumentations); - }; -} -exports.registerInstrumentations = registerInstrumentations; -//# sourceMappingURL=autoLoader.js.map - -/***/ }), - -/***/ 97587: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.disableInstrumentations = exports.enableInstrumentations = void 0; -/** - * Enable instrumentations - * @param instrumentations - * @param tracerProvider - * @param meterProvider - */ -function enableInstrumentations(instrumentations, tracerProvider, meterProvider, loggerProvider) { - for (let i = 0, j = instrumentations.length; i < j; i++) { - const instrumentation = instrumentations[i]; - if (tracerProvider) { - instrumentation.setTracerProvider(tracerProvider); - } - if (meterProvider) { - instrumentation.setMeterProvider(meterProvider); - } - if (loggerProvider && instrumentation.setLoggerProvider) { - instrumentation.setLoggerProvider(loggerProvider); - } - // instrumentations have been already enabled during creation - // so enable only if user prevented that by setting enabled to false - // this is to prevent double enabling but when calling register all - // instrumentations should be now enabled - if (!instrumentation.getConfig().enabled) { - instrumentation.enable(); - } - } -} -exports.enableInstrumentations = enableInstrumentations; -/** - * Disable instrumentations - * @param instrumentations - */ -function disableInstrumentations(instrumentations) { - instrumentations.forEach(instrumentation => instrumentation.disable()); -} -exports.disableInstrumentations = disableInstrumentations; -//# sourceMappingURL=autoLoaderUtils.js.map - -/***/ }), - -/***/ 52007: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = exports.isWrapped = exports.InstrumentationNodeModuleFile = exports.InstrumentationNodeModuleDefinition = exports.InstrumentationBase = exports.registerInstrumentations = void 0; -var autoLoader_1 = __nccwpck_require__(55775); -Object.defineProperty(exports, "registerInstrumentations", ({ enumerable: true, get: function () { return autoLoader_1.registerInstrumentations; } })); -var index_1 = __nccwpck_require__(58114); -Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return index_1.InstrumentationBase; } })); -var instrumentationNodeModuleDefinition_1 = __nccwpck_require__(32834); -Object.defineProperty(exports, "InstrumentationNodeModuleDefinition", ({ enumerable: true, get: function () { return instrumentationNodeModuleDefinition_1.InstrumentationNodeModuleDefinition; } })); -var instrumentationNodeModuleFile_1 = __nccwpck_require__(67915); -Object.defineProperty(exports, "InstrumentationNodeModuleFile", ({ enumerable: true, get: function () { return instrumentationNodeModuleFile_1.InstrumentationNodeModuleFile; } })); -var utils_1 = __nccwpck_require__(42941); -Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return utils_1.isWrapped; } })); -Object.defineProperty(exports, "safeExecuteInTheMiddle", ({ enumerable: true, get: function () { return utils_1.safeExecuteInTheMiddle; } })); -Object.defineProperty(exports, "safeExecuteInTheMiddleAsync", ({ enumerable: true, get: function () { return utils_1.safeExecuteInTheMiddleAsync; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 83972: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InstrumentationAbstract = void 0; -const api_1 = __nccwpck_require__(65163); -const api_logs_1 = __nccwpck_require__(8689); -const shimmer = __nccwpck_require__(16672); -/** - * Base abstract internal class for instrumenting node and web plugins - */ -class InstrumentationAbstract { - constructor(instrumentationName, instrumentationVersion, config) { - this.instrumentationName = instrumentationName; - this.instrumentationVersion = instrumentationVersion; - this._config = {}; - /* Api to wrap instrumented method */ - this._wrap = shimmer.wrap; - /* Api to unwrap instrumented methods */ - this._unwrap = shimmer.unwrap; - /* Api to mass wrap instrumented method */ - this._massWrap = shimmer.massWrap; - /* Api to mass unwrap instrumented methods */ - this._massUnwrap = shimmer.massUnwrap; - this.setConfig(config); - this._diag = api_1.diag.createComponentLogger({ - namespace: instrumentationName, - }); - this._tracer = api_1.trace.getTracer(instrumentationName, instrumentationVersion); - this._meter = api_1.metrics.getMeter(instrumentationName, instrumentationVersion); - this._logger = api_logs_1.logs.getLogger(instrumentationName, instrumentationVersion); - this._updateMetricInstruments(); - } - /* Returns meter */ - get meter() { - return this._meter; - } - /** - * Sets MeterProvider to this plugin - * @param meterProvider - */ - setMeterProvider(meterProvider) { - this._meter = meterProvider.getMeter(this.instrumentationName, this.instrumentationVersion); - this._updateMetricInstruments(); - } - /* Returns logger */ - get logger() { - return this._logger; - } - /** - * Sets LoggerProvider to this plugin - * @param loggerProvider - */ - setLoggerProvider(loggerProvider) { - this._logger = loggerProvider.getLogger(this.instrumentationName, this.instrumentationVersion); - } - /** - * @experimental - * - * Get module definitions defined by {@link init}. - * This can be used for experimental compile-time instrumentation. - * - * @returns an array of {@link InstrumentationModuleDefinition} - */ - getModuleDefinitions() { - var _a; - const initResult = (_a = this.init()) !== null && _a !== void 0 ? _a : []; - if (!Array.isArray(initResult)) { - return [initResult]; - } - return initResult; - } - /** - * Sets the new metric instruments with the current Meter. - */ - _updateMetricInstruments() { - return; - } - /* Returns InstrumentationConfig */ - getConfig() { - return this._config; - } - /** - * Sets InstrumentationConfig to this plugin - * @param config - */ - setConfig(config) { - // copy config first level properties to ensure they are immutable. - // nested properties are not copied, thus are mutable from the outside. - this._config = Object.assign({ enabled: true }, config); - } - /** - * Sets TraceProvider to this plugin - * @param tracerProvider - */ - setTracerProvider(tracerProvider) { - this._tracer = tracerProvider.getTracer(this.instrumentationName, this.instrumentationVersion); - } - /* Returns tracer */ - get tracer() { - return this._tracer; - } - /** - * Execute span customization hook, if configured, and log any errors. - * Any semantics of the trigger and info are defined by the specific instrumentation. - * @param hookHandler The optional hook handler which the user has configured via instrumentation config - * @param triggerName The name of the trigger for executing the hook for logging purposes - * @param span The span to which the hook should be applied - * @param info The info object to be passed to the hook, with useful data the hook may use - */ - _runSpanCustomizationHook(hookHandler, triggerName, span, info) { - if (!hookHandler) { - return; - } - try { - hookHandler(span, info); - } - catch (e) { - this._diag.error(`Error running span customization hook due to exception in handler`, { triggerName }, e); - } - } -} -exports.InstrumentationAbstract = InstrumentationAbstract; -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 32834: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InstrumentationNodeModuleDefinition = void 0; -class InstrumentationNodeModuleDefinition { - constructor(name, supportedVersions, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - patch, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - unpatch, files) { - this.name = name; - this.supportedVersions = supportedVersions; - this.patch = patch; - this.unpatch = unpatch; - this.files = files || []; - } -} -exports.InstrumentationNodeModuleDefinition = InstrumentationNodeModuleDefinition; -//# sourceMappingURL=instrumentationNodeModuleDefinition.js.map - -/***/ }), - -/***/ 67915: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InstrumentationNodeModuleFile = void 0; -const index_1 = __nccwpck_require__(58114); -class InstrumentationNodeModuleFile { - constructor(name, supportedVersions, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - patch, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - unpatch) { - this.supportedVersions = supportedVersions; - this.patch = patch; - this.unpatch = unpatch; - this.name = (0, index_1.normalize)(name); - } -} -exports.InstrumentationNodeModuleFile = InstrumentationNodeModuleFile; -//# sourceMappingURL=instrumentationNodeModuleFile.js.map - -/***/ }), - -/***/ 58114: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalize = exports.InstrumentationBase = void 0; -var node_1 = __nccwpck_require__(92870); -Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return node_1.InstrumentationBase; } })); -Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return node_1.normalize; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 62934: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ModuleNameTrie = exports.ModuleNameSeparator = void 0; -exports.ModuleNameSeparator = '/'; -/** - * Node in a `ModuleNameTrie` - */ -class ModuleNameTrieNode { - constructor() { - this.hooks = []; - this.children = new Map(); - } -} -/** - * Trie containing nodes that represent a part of a module name (i.e. the parts separated by forward slash) - */ -class ModuleNameTrie { - constructor() { - this._trie = new ModuleNameTrieNode(); - this._counter = 0; - } - /** - * Insert a module hook into the trie - * - * @param {Hooked} hook Hook - */ - insert(hook) { - let trieNode = this._trie; - for (const moduleNamePart of hook.moduleName.split(exports.ModuleNameSeparator)) { - let nextNode = trieNode.children.get(moduleNamePart); - if (!nextNode) { - nextNode = new ModuleNameTrieNode(); - trieNode.children.set(moduleNamePart, nextNode); - } - trieNode = nextNode; - } - trieNode.hooks.push({ hook, insertedId: this._counter++ }); - } - /** - * Search for matching hooks in the trie - * - * @param {string} moduleName Module name - * @param {boolean} maintainInsertionOrder Whether to return the results in insertion order - * @param {boolean} fullOnly Whether to return only full matches - * @returns {Hooked[]} Matching hooks - */ - search(moduleName, { maintainInsertionOrder, fullOnly } = {}) { - let trieNode = this._trie; - const results = []; - let foundFull = true; - for (const moduleNamePart of moduleName.split(exports.ModuleNameSeparator)) { - const nextNode = trieNode.children.get(moduleNamePart); - if (!nextNode) { - foundFull = false; - break; - } - if (!fullOnly) { - results.push(...nextNode.hooks); - } - trieNode = nextNode; - } - if (fullOnly && foundFull) { - results.push(...trieNode.hooks); - } - if (results.length === 0) { - return []; - } - if (results.length === 1) { - return [results[0].hook]; - } - if (maintainInsertionOrder) { - results.sort((a, b) => a.insertedId - b.insertedId); - } - return results.map(({ hook }) => hook); - } -} -exports.ModuleNameTrie = ModuleNameTrie; -//# sourceMappingURL=ModuleNameTrie.js.map - -/***/ }), - -/***/ 4218: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RequireInTheMiddleSingleton = void 0; -const require_in_the_middle_1 = __nccwpck_require__(62009); -const path = __nccwpck_require__(71017); -const ModuleNameTrie_1 = __nccwpck_require__(62934); -/** - * Whether Mocha is running in this process - * Inspired by https://github.com/AndreasPizsa/detect-mocha - * - * @type {boolean} - */ -const isMocha = [ - 'afterEach', - 'after', - 'beforeEach', - 'before', - 'describe', - 'it', -].every(fn => { - // @ts-expect-error TS7053: Element implicitly has an 'any' type - return typeof global[fn] === 'function'; -}); -/** - * Singleton class for `require-in-the-middle` - * Allows instrumentation plugins to patch modules with only a single `require` patch - * WARNING: Because this class will create its own `require-in-the-middle` (RITM) instance, - * we should minimize the number of new instances of this class. - * Multiple instances of `@opentelemetry/instrumentation` (e.g. multiple versions) in a single process - * will result in multiple instances of RITM, which will have an impact - * on the performance of instrumentation hooks being applied. - */ -class RequireInTheMiddleSingleton { - constructor() { - this._moduleNameTrie = new ModuleNameTrie_1.ModuleNameTrie(); - this._initialize(); - } - _initialize() { - new require_in_the_middle_1.Hook( - // Intercept all `require` calls; we will filter the matching ones below - null, { internals: true }, (exports, name, basedir) => { - // For internal files on Windows, `name` will use backslash as the path separator - const normalizedModuleName = normalizePathSeparators(name); - const matches = this._moduleNameTrie.search(normalizedModuleName, { - maintainInsertionOrder: true, - // For core modules (e.g. `fs`), do not match on sub-paths (e.g. `fs/promises'). - // This matches the behavior of `require-in-the-middle`. - // `basedir` is always `undefined` for core modules. - fullOnly: basedir === undefined, - }); - for (const { onRequire } of matches) { - exports = onRequire(exports, name, basedir); - } - return exports; - }); - } - /** - * Register a hook with `require-in-the-middle` - * - * @param {string} moduleName Module name - * @param {OnRequireFn} onRequire Hook function - * @returns {Hooked} Registered hook - */ - register(moduleName, onRequire) { - const hooked = { moduleName, onRequire }; - this._moduleNameTrie.insert(hooked); - return hooked; - } - /** - * Get the `RequireInTheMiddleSingleton` singleton - * - * @returns {RequireInTheMiddleSingleton} Singleton of `RequireInTheMiddleSingleton` - */ - static getInstance() { - var _a; - // Mocha runs all test suites in the same process - // This prevents test suites from sharing a singleton - if (isMocha) - return new RequireInTheMiddleSingleton(); - return (this._instance = - (_a = this._instance) !== null && _a !== void 0 ? _a : new RequireInTheMiddleSingleton()); - } -} -exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton; -/** - * Normalize the path separators to forward slash in a module name or path - * - * @param {string} moduleNameOrPath Module name or path - * @returns {string} Normalized module name or path - */ -function normalizePathSeparators(moduleNameOrPath) { - return path.sep !== ModuleNameTrie_1.ModuleNameSeparator - ? moduleNameOrPath.split(path.sep).join(ModuleNameTrie_1.ModuleNameSeparator) - : moduleNameOrPath; -} -//# sourceMappingURL=RequireInTheMiddleSingleton.js.map - -/***/ }), - -/***/ 92870: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalize = exports.InstrumentationBase = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var instrumentation_1 = __nccwpck_require__(27785); -Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return instrumentation_1.InstrumentationBase; } })); -var normalize_1 = __nccwpck_require__(36197); -Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return normalize_1.normalize; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 27785: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InstrumentationBase = void 0; -const path = __nccwpck_require__(71017); -const util_1 = __nccwpck_require__(73837); -const semver_1 = __nccwpck_require__(52023); -const shimmer_1 = __nccwpck_require__(16672); -const instrumentation_1 = __nccwpck_require__(83972); -const RequireInTheMiddleSingleton_1 = __nccwpck_require__(4218); -const import_in_the_middle_1 = __nccwpck_require__(36151); -const api_1 = __nccwpck_require__(65163); -const require_in_the_middle_1 = __nccwpck_require__(62009); -const fs_1 = __nccwpck_require__(57147); -const utils_1 = __nccwpck_require__(42941); -/** - * Base abstract class for instrumenting node plugins - */ -class InstrumentationBase extends instrumentation_1.InstrumentationAbstract { - constructor(instrumentationName, instrumentationVersion, config) { - super(instrumentationName, instrumentationVersion, config); - this._hooks = []; - this._requireInTheMiddleSingleton = RequireInTheMiddleSingleton_1.RequireInTheMiddleSingleton.getInstance(); - this._enabled = false; - this._wrap = (moduleExports, name, wrapper) => { - if ((0, utils_1.isWrapped)(moduleExports[name])) { - this._unwrap(moduleExports, name); - } - if (!util_1.types.isProxy(moduleExports)) { - return (0, shimmer_1.wrap)(moduleExports, name, wrapper); - } - else { - const wrapped = (0, shimmer_1.wrap)(Object.assign({}, moduleExports), name, wrapper); - Object.defineProperty(moduleExports, name, { - value: wrapped, - }); - return wrapped; - } - }; - this._unwrap = (moduleExports, name) => { - if (!util_1.types.isProxy(moduleExports)) { - return (0, shimmer_1.unwrap)(moduleExports, name); - } - else { - return Object.defineProperty(moduleExports, name, { - value: moduleExports[name], - }); - } - }; - this._massWrap = (moduleExportsArray, names, wrapper) => { - if (!moduleExportsArray) { - api_1.diag.error('must provide one or more modules to patch'); - return; - } - else if (!Array.isArray(moduleExportsArray)) { - moduleExportsArray = [moduleExportsArray]; - } - if (!(names && Array.isArray(names))) { - api_1.diag.error('must provide one or more functions to wrap on modules'); - return; - } - moduleExportsArray.forEach(moduleExports => { - names.forEach(name => { - this._wrap(moduleExports, name, wrapper); - }); - }); - }; - this._massUnwrap = (moduleExportsArray, names) => { - if (!moduleExportsArray) { - api_1.diag.error('must provide one or more modules to patch'); - return; - } - else if (!Array.isArray(moduleExportsArray)) { - moduleExportsArray = [moduleExportsArray]; - } - if (!(names && Array.isArray(names))) { - api_1.diag.error('must provide one or more functions to wrap on modules'); - return; - } - moduleExportsArray.forEach(moduleExports => { - names.forEach(name => { - this._unwrap(moduleExports, name); - }); - }); - }; - let modules = this.init(); - if (modules && !Array.isArray(modules)) { - modules = [modules]; - } - this._modules = modules || []; - if (this._config.enabled) { - this.enable(); - } - } - _warnOnPreloadedModules() { - this._modules.forEach((module) => { - const { name } = module; - try { - const resolvedModule = require.resolve(name); - if (require.cache[resolvedModule]) { - // Module is already cached, which means the instrumentation hook might not work - this._diag.warn(`Module ${name} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${name}`); - } - } - catch (_a) { - // Module isn't available, we can simply skip - } - }); - } - _extractPackageVersion(baseDir) { - try { - const json = (0, fs_1.readFileSync)(path.join(baseDir, 'package.json'), { - encoding: 'utf8', - }); - const version = JSON.parse(json).version; - return typeof version === 'string' ? version : undefined; - } - catch (error) { - api_1.diag.warn('Failed extracting version', baseDir); - } - return undefined; - } - _onRequire(module, exports, name, baseDir) { - var _a; - if (!baseDir) { - if (typeof module.patch === 'function') { - module.moduleExports = exports; - if (this._enabled) { - this._diag.debug('Applying instrumentation patch for nodejs core module on require hook', { - module: module.name, - }); - return module.patch(exports); - } - } - return exports; - } - const version = this._extractPackageVersion(baseDir); - module.moduleVersion = version; - if (module.name === name) { - // main module - if (isSupported(module.supportedVersions, version, module.includePrerelease)) { - if (typeof module.patch === 'function') { - module.moduleExports = exports; - if (this._enabled) { - this._diag.debug('Applying instrumentation patch for module on require hook', { - module: module.name, - version: module.moduleVersion, - baseDir, - }); - return module.patch(exports, module.moduleVersion); - } - } - } - return exports; - } - // internal file - const files = (_a = module.files) !== null && _a !== void 0 ? _a : []; - const normalizedName = path.normalize(name); - const supportedFileInstrumentations = files - .filter(f => f.name === normalizedName) - .filter(f => isSupported(f.supportedVersions, version, module.includePrerelease)); - return supportedFileInstrumentations.reduce((patchedExports, file) => { - file.moduleExports = patchedExports; - if (this._enabled) { - this._diag.debug('Applying instrumentation patch for nodejs module file on require hook', { - module: module.name, - version: module.moduleVersion, - fileName: file.name, - baseDir, - }); - // patch signature is not typed, so we cast it assuming it's correct - return file.patch(patchedExports, module.moduleVersion); - } - return patchedExports; - }, exports); - } - enable() { - if (this._enabled) { - return; - } - this._enabled = true; - // already hooked, just call patch again - if (this._hooks.length > 0) { - for (const module of this._modules) { - if (typeof module.patch === 'function' && module.moduleExports) { - this._diag.debug('Applying instrumentation patch for nodejs module on instrumentation enabled', { - module: module.name, - version: module.moduleVersion, - }); - module.patch(module.moduleExports, module.moduleVersion); - } - for (const file of module.files) { - if (file.moduleExports) { - this._diag.debug('Applying instrumentation patch for nodejs module file on instrumentation enabled', { - module: module.name, - version: module.moduleVersion, - fileName: file.name, - }); - file.patch(file.moduleExports, module.moduleVersion); - } - } - } - return; - } - this._warnOnPreloadedModules(); - for (const module of this._modules) { - const hookFn = (exports, name, baseDir) => { - return this._onRequire(module, exports, name, baseDir); - }; - const onRequire = (exports, name, baseDir) => { - return this._onRequire(module, exports, name, baseDir); - }; - // `RequireInTheMiddleSingleton` does not support absolute paths. - // For an absolute paths, we must create a separate instance of the - // require-in-the-middle `Hook`. - const hook = path.isAbsolute(module.name) - ? new require_in_the_middle_1.Hook([module.name], { internals: true }, onRequire) - : this._requireInTheMiddleSingleton.register(module.name, onRequire); - this._hooks.push(hook); - const esmHook = new import_in_the_middle_1.Hook([module.name], { internals: false }, hookFn); - this._hooks.push(esmHook); - } - } - disable() { - if (!this._enabled) { - return; - } - this._enabled = false; - for (const module of this._modules) { - if (typeof module.unpatch === 'function' && module.moduleExports) { - this._diag.debug('Removing instrumentation patch for nodejs module on instrumentation disabled', { - module: module.name, - version: module.moduleVersion, - }); - module.unpatch(module.moduleExports, module.moduleVersion); - } - for (const file of module.files) { - if (file.moduleExports) { - this._diag.debug('Removing instrumentation patch for nodejs module file on instrumentation disabled', { - module: module.name, - version: module.moduleVersion, - fileName: file.name, - }); - file.unpatch(file.moduleExports, module.moduleVersion); - } - } - } - } - isEnabled() { - return this._enabled; - } -} -exports.InstrumentationBase = InstrumentationBase; -function isSupported(supportedVersions, version, includePrerelease) { - if (typeof version === 'undefined') { - // If we don't have the version, accept the wildcard case only - return supportedVersions.includes('*'); - } - return supportedVersions.some(supportedVersion => { - return (0, semver_1.satisfies)(version, supportedVersion, { includePrerelease }); - }); -} -//# sourceMappingURL=instrumentation.js.map - -/***/ }), - -/***/ 36197: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalize = void 0; -var path_1 = __nccwpck_require__(71017); -Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return path_1.normalize; } })); -//# sourceMappingURL=normalize.js.map - -/***/ }), - -/***/ 42941: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWrapped = exports.safeExecuteInTheMiddleAsync = exports.safeExecuteInTheMiddle = void 0; -/** - * function to execute patched function and being able to catch errors - * @param execute - function to be executed - * @param onFinish - callback to run when execute finishes - */ -function safeExecuteInTheMiddle(execute, onFinish, preventThrowingError) { - let error; - let result; - try { - result = execute(); - } - catch (e) { - error = e; - } - finally { - onFinish(error, result); - if (error && !preventThrowingError) { - // eslint-disable-next-line no-unsafe-finally - throw error; - } - // eslint-disable-next-line no-unsafe-finally - return result; - } -} -exports.safeExecuteInTheMiddle = safeExecuteInTheMiddle; -/** - * Async function to execute patched function and being able to catch errors - * @param execute - function to be executed - * @param onFinish - callback to run when execute finishes - */ -async function safeExecuteInTheMiddleAsync(execute, onFinish, preventThrowingError) { - let error; - let result; - try { - result = await execute(); - } - catch (e) { - error = e; - } - finally { - onFinish(error, result); - if (error && !preventThrowingError) { - // eslint-disable-next-line no-unsafe-finally - throw error; - } - // eslint-disable-next-line no-unsafe-finally - return result; - } -} -exports.safeExecuteInTheMiddleAsync = safeExecuteInTheMiddleAsync; -/** - * Checks if certain function has been already wrapped - * @param func - */ -function isWrapped(func) { - return (typeof func === 'function' && - typeof func.__original === 'function' && - typeof func.__unwrap === 'function' && - func.__wrapped === true); -} -exports.isWrapped = isWrapped; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 89973: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Resource = void 0; -const api_1 = __nccwpck_require__(65163); -const semantic_conventions_1 = __nccwpck_require__(67275); -const core_1 = __nccwpck_require__(89736); -const platform_1 = __nccwpck_require__(63669); -/** - * A Resource describes the entity for which a signals (metrics or trace) are - * collected. - */ -class Resource { - constructor( - /** - * A dictionary of attributes with string keys and values that provide - * information about the entity as numbers, strings or booleans - * TODO: Consider to add check/validation on attributes. - */ - attributes, asyncAttributesPromise) { - var _a; - this._attributes = attributes; - this.asyncAttributesPending = asyncAttributesPromise != null; - this._syncAttributes = (_a = this._attributes) !== null && _a !== void 0 ? _a : {}; - this._asyncAttributesPromise = asyncAttributesPromise === null || asyncAttributesPromise === void 0 ? void 0 : asyncAttributesPromise.then(asyncAttributes => { - this._attributes = Object.assign({}, this._attributes, asyncAttributes); - this.asyncAttributesPending = false; - return asyncAttributes; - }, err => { - api_1.diag.debug("a resource's async attributes promise rejected: %s", err); - this.asyncAttributesPending = false; - return {}; - }); - } - /** - * Returns an empty Resource - */ - static empty() { - return Resource.EMPTY; - } - /** - * Returns a Resource that identifies the SDK in use. - */ - static default() { - return new Resource({ - [semantic_conventions_1.SEMRESATTRS_SERVICE_NAME]: (0, platform_1.defaultServiceName)(), - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE], - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME], - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION], - }); - } - get attributes() { - var _a; - if (this.asyncAttributesPending) { - api_1.diag.error('Accessing resource attributes before async attributes settled'); - } - return (_a = this._attributes) !== null && _a !== void 0 ? _a : {}; - } - /** - * Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to - * this Resource's attributes. This is useful in exporters to block until resource detection - * has finished. - */ - async waitForAsyncAttributes() { - if (this.asyncAttributesPending) { - await this._asyncAttributesPromise; - } - } - /** - * Returns a new, merged {@link Resource} by merging the current Resource - * with the other Resource. In case of a collision, other Resource takes - * precedence. - * - * @param other the Resource that will be merged with this. - * @returns the newly merged Resource. - */ - merge(other) { - var _a; - if (!other) - return this; - // SpanAttributes from other resource overwrite attributes from this resource. - const mergedSyncAttributes = Object.assign(Object.assign({}, this._syncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)); - if (!this._asyncAttributesPromise && - !other._asyncAttributesPromise) { - return new Resource(mergedSyncAttributes); - } - const mergedAttributesPromise = Promise.all([ - this._asyncAttributesPromise, - other._asyncAttributesPromise, - ]).then(([thisAsyncAttributes, otherAsyncAttributes]) => { - var _a; - return Object.assign(Object.assign(Object.assign(Object.assign({}, this._syncAttributes), thisAsyncAttributes), ((_a = other._syncAttributes) !== null && _a !== void 0 ? _a : other.attributes)), otherAsyncAttributes); - }); - return new Resource(mergedSyncAttributes, mergedAttributesPromise); - } -} -exports.Resource = Resource; -Resource.EMPTY = new Resource({}); -//# sourceMappingURL=Resource.js.map - -/***/ }), - -/***/ 89224: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.detectResourcesSync = exports.detectResources = void 0; -const Resource_1 = __nccwpck_require__(89973); -const api_1 = __nccwpck_require__(65163); -const utils_1 = __nccwpck_require__(76620); -/** - * Runs all resource detectors and returns the results merged into a single Resource. Promise - * does not resolve until all the underlying detectors have resolved, unlike - * detectResourcesSync. - * - * @deprecated use detectResourcesSync() instead. - * @param config Configuration for resource detection - */ -const detectResources = async (config = {}) => { - const resources = await Promise.all((config.detectors || []).map(async (d) => { - try { - const resource = await 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 Resource_1.Resource.empty(); - } - })); - // Future check if verbose logging is enabled issue #1903 - logResources(resources); - return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); -}; -exports.detectResources = detectResources; -/** - * Runs all resource detectors synchronously, merging their results. In case of attribute collision later resources will take precedence. - * - * @param config Configuration for resource detection - */ -const detectResourcesSync = (config = {}) => { - var _a; - const resources = ((_a = config.detectors) !== null && _a !== void 0 ? _a : []).map((d) => { - try { - const resourceOrPromise = d.detect(config); - let resource; - if ((0, utils_1.isPromiseLike)(resourceOrPromise)) { - const createPromise = async () => { - var _a; - const resolvedResource = await resourceOrPromise; - await ((_a = resolvedResource.waitForAsyncAttributes) === null || _a === void 0 ? void 0 : _a.call(resolvedResource)); - return resolvedResource.attributes; - }; - resource = new Resource_1.Resource({}, createPromise()); - } - else { - resource = resourceOrPromise; - } - if (resource.waitForAsyncAttributes) { - void resource - .waitForAsyncAttributes() - .then(() => api_1.diag.debug(`${d.constructor.name} found resource.`, resource)); - } - else { - api_1.diag.debug(`${d.constructor.name} found resource.`, resource); - } - return resource; - } - catch (e) { - api_1.diag.error(`${d.constructor.name} failed: ${e.message}`); - return Resource_1.Resource.empty(); - } - }); - const mergedResources = resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); - if (mergedResources.waitForAsyncAttributes) { - void mergedResources.waitForAsyncAttributes().then(() => { - // Future check if verbose logging is enabled issue #1903 - logResources(resources); - }); - } - return mergedResources; -}; -exports.detectResourcesSync = detectResourcesSync; -/** - * Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided. - * - * @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored. - */ -const logResources = (resources) => { - resources.forEach(resource => { - // Print only populated resources - if (Object.keys(resource.attributes).length > 0) { - const resourceDebugString = JSON.stringify(resource.attributes, null, 4); - api_1.diag.verbose(resourceDebugString); - } - }); -}; -//# sourceMappingURL=detect-resources.js.map - -/***/ }), - -/***/ 51756: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.browserDetector = void 0; -const BrowserDetectorSync_1 = __nccwpck_require__(86107); -/** - * BrowserDetector will be used to detect the resources related to browser. - */ -class BrowserDetector { - detect(config) { - return Promise.resolve(BrowserDetectorSync_1.browserDetectorSync.detect(config)); - } -} -exports.browserDetector = new BrowserDetector(); -//# sourceMappingURL=BrowserDetector.js.map - -/***/ }), - -/***/ 86107: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.browserDetectorSync = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const api_1 = __nccwpck_require__(65163); -const Resource_1 = __nccwpck_require__(89973); -/** - * BrowserDetectorSync will be used to detect the resources related to browser. - */ -class BrowserDetectorSync { - detect(config) { - var _a, _b, _c; - const isBrowser = typeof navigator !== 'undefined' && - ((_b = (_a = global.process) === null || _a === void 0 ? void 0 : _a.versions) === null || _b === void 0 ? void 0 : _b.node) === undefined && // Node.js v21 adds `navigator` - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore don't have Bun types - ((_c = global.Bun) === null || _c === void 0 ? void 0 : _c.version) === undefined; // Bun (bun.sh) defines `navigator` - if (!isBrowser) { - return Resource_1.Resource.empty(); - } - const browserResource = { - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'browser', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: navigator.userAgent, - }; - return this._getResourceAttributes(browserResource, config); - } - /** - * Validates process resource attribute map from process variables - * - * @param browserResource The un-sanitized resource attributes from process as key/value pairs. - * @param config: Config - * @returns The sanitized resource attributes. - */ - _getResourceAttributes(browserResource, _config) { - if (browserResource[semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION] === '') { - api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. '); - return Resource_1.Resource.empty(); - } - else { - return new Resource_1.Resource(Object.assign({}, browserResource)); - } - } -} -exports.browserDetectorSync = new BrowserDetectorSync(); -//# sourceMappingURL=BrowserDetectorSync.js.map - -/***/ }), - -/***/ 97540: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.envDetector = void 0; -const EnvDetectorSync_1 = __nccwpck_require__(36390); -/** - * EnvDetector can be used to detect the presence of and create a Resource - * from the OTEL_RESOURCE_ATTRIBUTES environment variable. - */ -class EnvDetector { - /** - * 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) { - return Promise.resolve(EnvDetectorSync_1.envDetectorSync.detect(config)); - } -} -exports.envDetector = new EnvDetector(); -//# sourceMappingURL=EnvDetector.js.map - -/***/ }), - -/***/ 36390: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.envDetectorSync = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(89973); -/** - * EnvDetectorSync can be used to detect the presence of and create a Resource - * from the OTEL_RESOURCE_ATTRIBUTES environment variable. - */ -class EnvDetectorSync { - constructor() { - // Type, attribute keys, and attribute values should not exceed 256 characters. - this._MAX_LENGTH = 255; - // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes. - this._COMMA_SEPARATOR = ','; - // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='. - this._LABEL_KEY_VALUE_SPLITTER = '='; - this._ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + - this._MAX_LENGTH + - ' characters.'; - this._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 env = (0, core_1.getEnv)(); - const rawAttributes = env.OTEL_RESOURCE_ATTRIBUTES; - const serviceName = env.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.SEMRESATTRS_SERVICE_NAME] = serviceName; - } - return new Resource_1.Resource(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; - // Leading and trailing whitespaces are trimmed. - 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); - } - // https://www.w3.org/TR/baggage/#definition - _isBaggageOctetString(str) { - for (let i = 0; i < str.length; i++) { - const ch = str.charCodeAt(i); - if (ch < 0x21 || ch === 0x2c || ch === 0x3b || ch === 0x5c || ch > 0x7e) { - return false; - } - } - return true; - } - /** - * Determines whether the given String is a valid printable ASCII string with - * a length greater than 0 and not exceed _MAX_LENGTH characters. - * - * @param str The String to be validated. - * @returns Whether the String is valid and not empty. - */ - _isValidAndNotEmpty(str) { - return str.length > 0 && this._isValid(str); - } -} -exports.envDetectorSync = new EnvDetectorSync(); -//# sourceMappingURL=EnvDetectorSync.js.map - -/***/ }), - -/***/ 50622: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.envDetectorSync = exports.browserDetectorSync = exports.envDetector = exports.browserDetector = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; -var platform_1 = __nccwpck_require__(2327); -Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return platform_1.hostDetector; } })); -Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return platform_1.hostDetectorSync; } })); -Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return platform_1.osDetector; } })); -Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return platform_1.osDetectorSync; } })); -Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return platform_1.processDetector; } })); -Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return platform_1.processDetectorSync; } })); -Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return platform_1.serviceInstanceIdDetectorSync; } })); -var BrowserDetector_1 = __nccwpck_require__(51756); -Object.defineProperty(exports, "browserDetector", ({ enumerable: true, get: function () { return BrowserDetector_1.browserDetector; } })); -var EnvDetector_1 = __nccwpck_require__(97540); -Object.defineProperty(exports, "envDetector", ({ enumerable: true, get: function () { return EnvDetector_1.envDetector; } })); -var BrowserDetectorSync_1 = __nccwpck_require__(86107); -Object.defineProperty(exports, "browserDetectorSync", ({ enumerable: true, get: function () { return BrowserDetectorSync_1.browserDetectorSync; } })); -var EnvDetectorSync_1 = __nccwpck_require__(36390); -Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: function () { return EnvDetectorSync_1.envDetectorSync; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 2327: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var node_1 = __nccwpck_require__(60551); -Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return node_1.hostDetector; } })); -Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return node_1.hostDetectorSync; } })); -Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return node_1.osDetector; } })); -Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return node_1.osDetectorSync; } })); -Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return node_1.processDetector; } })); -Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return node_1.processDetectorSync; } })); -Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return node_1.serviceInstanceIdDetectorSync; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 81322: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hostDetector = void 0; -const HostDetectorSync_1 = __nccwpck_require__(35715); -/** - * HostDetector detects the resources related to the host current process is - * running on. Currently only non-cloud-based attributes are included. - */ -class HostDetector { - detect(_config) { - return Promise.resolve(HostDetectorSync_1.hostDetectorSync.detect(_config)); - } -} -exports.hostDetector = new HostDetector(); -//# sourceMappingURL=HostDetector.js.map - -/***/ }), - -/***/ 35715: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hostDetectorSync = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(89973); -const os_1 = __nccwpck_require__(22037); -const utils_1 = __nccwpck_require__(42090); -const getMachineId_1 = __nccwpck_require__(49090); -/** - * HostDetectorSync detects the resources related to the host current process is - * running on. Currently only non-cloud-based attributes are included. - */ -class HostDetectorSync { - detect(_config) { - const attributes = { - [semantic_conventions_1.SEMRESATTRS_HOST_NAME]: (0, os_1.hostname)(), - [semantic_conventions_1.SEMRESATTRS_HOST_ARCH]: (0, utils_1.normalizeArch)((0, os_1.arch)()), - }; - return new Resource_1.Resource(attributes, this._getAsyncAttributes()); - } - _getAsyncAttributes() { - return (0, getMachineId_1.getMachineId)().then(machineId => { - const attributes = {}; - if (machineId) { - attributes[semantic_conventions_1.SEMRESATTRS_HOST_ID] = machineId; - } - return attributes; - }); - } -} -exports.hostDetectorSync = new HostDetectorSync(); -//# sourceMappingURL=HostDetectorSync.js.map - -/***/ }), - -/***/ 80863: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.osDetector = void 0; -const OSDetectorSync_1 = __nccwpck_require__(55240); -/** - * OSDetector detects the resources related to the operating system (OS) on - * which the process represented by this resource is running. - */ -class OSDetector { - detect(_config) { - return Promise.resolve(OSDetectorSync_1.osDetectorSync.detect(_config)); - } -} -exports.osDetector = new OSDetector(); -//# sourceMappingURL=OSDetector.js.map - -/***/ }), - -/***/ 55240: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.osDetectorSync = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(89973); -const os_1 = __nccwpck_require__(22037); -const utils_1 = __nccwpck_require__(42090); -/** - * OSDetectorSync detects the resources related to the operating system (OS) on - * which the process represented by this resource is running. - */ -class OSDetectorSync { - detect(_config) { - const attributes = { - [semantic_conventions_1.SEMRESATTRS_OS_TYPE]: (0, utils_1.normalizeType)((0, os_1.platform)()), - [semantic_conventions_1.SEMRESATTRS_OS_VERSION]: (0, os_1.release)(), - }; - return new Resource_1.Resource(attributes); - } -} -exports.osDetectorSync = new OSDetectorSync(); -//# sourceMappingURL=OSDetectorSync.js.map - -/***/ }), - -/***/ 78924: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.processDetector = void 0; -const ProcessDetectorSync_1 = __nccwpck_require__(1167); -/** - * ProcessDetector will be used to detect the resources related current process running - * and being instrumented from the NodeJS Process module. - */ -class ProcessDetector { - detect(config) { - return Promise.resolve(ProcessDetectorSync_1.processDetectorSync.detect(config)); - } -} -exports.processDetector = new ProcessDetector(); -//# sourceMappingURL=ProcessDetector.js.map - -/***/ }), - -/***/ 1167: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.processDetectorSync = void 0; -const api_1 = __nccwpck_require__(65163); -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(89973); -const os = __nccwpck_require__(22037); -/** - * ProcessDetectorSync will be used to detect the resources related current process running - * and being instrumented from the NodeJS Process module. - */ -class ProcessDetectorSync { - detect(_config) { - const attributes = { - [semantic_conventions_1.SEMRESATTRS_PROCESS_PID]: process.pid, - [semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_NAME]: process.title, - [semantic_conventions_1.SEMRESATTRS_PROCESS_EXECUTABLE_PATH]: process.execPath, - [semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND_ARGS]: [ - process.argv[0], - ...process.execArgv, - ...process.argv.slice(1), - ], - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_VERSION]: process.versions.node, - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'nodejs', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]: 'Node.js', - }; - if (process.argv.length > 1) { - attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_COMMAND] = process.argv[1]; - } - try { - const userInfo = os.userInfo(); - attributes[semantic_conventions_1.SEMRESATTRS_PROCESS_OWNER] = userInfo.username; - } - catch (e) { - api_1.diag.debug(`error obtaining process owner: ${e}`); - } - return new Resource_1.Resource(attributes); - } -} -exports.processDetectorSync = new ProcessDetectorSync(); -//# sourceMappingURL=ProcessDetectorSync.js.map - -/***/ }), - -/***/ 91077: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serviceInstanceIdDetectorSync = void 0; -const semantic_conventions_1 = __nccwpck_require__(67275); -const Resource_1 = __nccwpck_require__(89973); -const crypto_1 = __nccwpck_require__(6113); -/** - * ServiceInstanceIdDetectorSync detects the resources related to the service instance ID. - */ -class ServiceInstanceIdDetectorSync { - detect(_config) { - const attributes = { - [semantic_conventions_1.SEMRESATTRS_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)(), - }; - return new Resource_1.Resource(attributes); - } -} -/** - * @experimental - */ -exports.serviceInstanceIdDetectorSync = new ServiceInstanceIdDetectorSync(); -//# sourceMappingURL=ServiceInstanceIdDetectorSync.js.map - -/***/ }), - -/***/ 60551: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = void 0; -var HostDetector_1 = __nccwpck_require__(81322); -Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return HostDetector_1.hostDetector; } })); -var HostDetectorSync_1 = __nccwpck_require__(35715); -Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return HostDetectorSync_1.hostDetectorSync; } })); -var OSDetector_1 = __nccwpck_require__(80863); -Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return OSDetector_1.osDetector; } })); -var OSDetectorSync_1 = __nccwpck_require__(55240); -Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return OSDetectorSync_1.osDetectorSync; } })); -var ProcessDetector_1 = __nccwpck_require__(78924); -Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return ProcessDetector_1.processDetector; } })); -var ProcessDetectorSync_1 = __nccwpck_require__(1167); -Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return ProcessDetectorSync_1.processDetectorSync; } })); -var ServiceInstanceIdDetectorSync_1 = __nccwpck_require__(91077); -Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return ServiceInstanceIdDetectorSync_1.serviceInstanceIdDetectorSync; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 68242: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.execAsync = void 0; -const child_process = __nccwpck_require__(32081); -const util = __nccwpck_require__(73837); -exports.execAsync = util.promisify(child_process.exec); -//# sourceMappingURL=execAsync.js.map - -/***/ }), - -/***/ 71309: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -const fs_1 = __nccwpck_require__(57147); -const execAsync_1 = __nccwpck_require__(68242); -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - try { - const result = await fs_1.promises.readFile('/etc/hostid', { encoding: 'utf8' }); - return result.trim(); - } - catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - try { - const result = await (0, execAsync_1.execAsync)('kenv -q smbios.system.uuid'); - return result.stdout.trim(); - } - catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-bsd.js.map - -/***/ }), - -/***/ 57327: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -const execAsync_1 = __nccwpck_require__(68242); -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - try { - const result = await (0, execAsync_1.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"'); - const idLine = result.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}`); - } - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-darwin.js.map - -/***/ }), - -/***/ 88540: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const fs_1 = __nccwpck_require__(57147); -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - const paths = ['/etc/machine-id', '/var/lib/dbus/machine-id']; - for (const path of paths) { - try { - const result = await fs_1.promises.readFile(path, { encoding: 'utf8' }); - return result.trim(); - } - catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - } - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-linux.js.map - -/***/ }), - -/***/ 66091: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - api_1.diag.debug('could not read machine-id: unsupported platform'); - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-unsupported.js.map - -/***/ }), - -/***/ 29607: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -var __webpack_unused_export__; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -__webpack_unused_export__ = ({ value: true }); -exports.$ = void 0; -const process = __nccwpck_require__(77282); -const execAsync_1 = __nccwpck_require__(68242); -const api_1 = __nccwpck_require__(65163); -async function getMachineId() { - const args = 'QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid'; - let command = '%windir%\\System32\\REG.exe'; - if (process.arch === 'ia32' && 'PROCESSOR_ARCHITEW6432' in process.env) { - command = '%windir%\\sysnative\\cmd.exe /c ' + command; - } - try { - const result = await (0, execAsync_1.execAsync)(`${command} ${args}`); - const parts = result.stdout.split('REG_SZ'); - if (parts.length === 2) { - return parts[1].trim(); - } - } - catch (e) { - api_1.diag.debug(`error reading machine id: ${e}`); - } - return ''; -} -exports.$ = getMachineId; -//# sourceMappingURL=getMachineId-win.js.map - -/***/ }), - -/***/ 49090: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getMachineId = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const process = __nccwpck_require__(77282); -let getMachineId; -exports.getMachineId = getMachineId; -switch (process.platform) { - case 'darwin': - (exports.getMachineId = getMachineId = (__nccwpck_require__(57327)/* .getMachineId */ .$)); - break; - case 'linux': - (exports.getMachineId = getMachineId = (__nccwpck_require__(88540)/* .getMachineId */ .$)); - break; - case 'freebsd': - (exports.getMachineId = getMachineId = (__nccwpck_require__(71309)/* .getMachineId */ .$)); - break; - case 'win32': - (exports.getMachineId = getMachineId = (__nccwpck_require__(29607)/* .getMachineId */ .$)); - break; - default: - (exports.getMachineId = getMachineId = (__nccwpck_require__(66091)/* .getMachineId */ .$)); -} -//# sourceMappingURL=getMachineId.js.map - -/***/ }), - -/***/ 42090: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalizeType = exports.normalizeArch = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const normalizeArch = (nodeArchString) => { - // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec: - // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md - switch (nodeArchString) { - case 'arm': - return 'arm32'; - case 'ppc': - return 'ppc32'; - case 'x64': - return 'amd64'; - default: - return nodeArchString; - } -}; -exports.normalizeArch = normalizeArch; -const normalizeType = (nodePlatform) => { - // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec: - // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md - switch (nodePlatform) { - case 'sunos': - return 'solaris'; - case 'win32': - return 'windows'; - default: - return nodePlatform; - } -}; -exports.normalizeType = normalizeType; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 32972: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.detectResources = exports.detectResourcesSync = exports.serviceInstanceIdDetectorSync = exports.processDetectorSync = exports.processDetector = exports.osDetectorSync = exports.osDetector = exports.hostDetectorSync = exports.hostDetector = exports.envDetectorSync = exports.envDetector = exports.browserDetectorSync = exports.browserDetector = exports.defaultServiceName = exports.Resource = void 0; -var Resource_1 = __nccwpck_require__(89973); -Object.defineProperty(exports, "Resource", ({ enumerable: true, get: function () { return Resource_1.Resource; } })); -var platform_1 = __nccwpck_require__(63669); -Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return platform_1.defaultServiceName; } })); -var detectors_1 = __nccwpck_require__(50622); -Object.defineProperty(exports, "browserDetector", ({ enumerable: true, get: function () { return detectors_1.browserDetector; } })); -Object.defineProperty(exports, "browserDetectorSync", ({ enumerable: true, get: function () { return detectors_1.browserDetectorSync; } })); -Object.defineProperty(exports, "envDetector", ({ enumerable: true, get: function () { return detectors_1.envDetector; } })); -Object.defineProperty(exports, "envDetectorSync", ({ enumerable: true, get: function () { return detectors_1.envDetectorSync; } })); -Object.defineProperty(exports, "hostDetector", ({ enumerable: true, get: function () { return detectors_1.hostDetector; } })); -Object.defineProperty(exports, "hostDetectorSync", ({ enumerable: true, get: function () { return detectors_1.hostDetectorSync; } })); -Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return detectors_1.osDetector; } })); -Object.defineProperty(exports, "osDetectorSync", ({ enumerable: true, get: function () { return detectors_1.osDetectorSync; } })); -Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return detectors_1.processDetector; } })); -Object.defineProperty(exports, "processDetectorSync", ({ enumerable: true, get: function () { return detectors_1.processDetectorSync; } })); -Object.defineProperty(exports, "serviceInstanceIdDetectorSync", ({ enumerable: true, get: function () { return detectors_1.serviceInstanceIdDetectorSync; } })); -var detect_resources_1 = __nccwpck_require__(89224); -Object.defineProperty(exports, "detectResourcesSync", ({ enumerable: true, get: function () { return detect_resources_1.detectResourcesSync; } })); -Object.defineProperty(exports, "detectResources", ({ enumerable: true, get: function () { return detect_resources_1.detectResources; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 63669: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultServiceName = void 0; -var node_1 = __nccwpck_require__(82491); -Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return node_1.defaultServiceName; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 82157: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultServiceName = void 0; -function defaultServiceName() { - return `unknown_service:${process.argv0}`; -} -exports.defaultServiceName = defaultServiceName; -//# sourceMappingURL=default-service-name.js.map - -/***/ }), - -/***/ 82491: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultServiceName = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var default_service_name_1 = __nccwpck_require__(82157); -Object.defineProperty(exports, "defaultServiceName", ({ enumerable: true, get: function () { return default_service_name_1.defaultServiceName; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 76620: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 83795: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BasicTracerProvider = exports.ForceFlushState = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const resources_1 = __nccwpck_require__(32972); -const Tracer_1 = __nccwpck_require__(8914); -const config_1 = __nccwpck_require__(90897); -const MultiSpanProcessor_1 = __nccwpck_require__(49060); -const NoopSpanProcessor_1 = __nccwpck_require__(36280); -const platform_1 = __nccwpck_require__(85583); -const utility_1 = __nccwpck_require__(44636); -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 - */ -class BasicTracerProvider { - constructor(config = {}) { - var _a, _b; - this._registeredSpanProcessors = []; - this._tracers = new Map(); - const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config)); - this.resource = (_a = mergedConfig.resource) !== null && _a !== void 0 ? _a : resources_1.Resource.empty(); - if (mergedConfig.mergeResourceWithDefaults) { - this.resource = resources_1.Resource.default().merge(this.resource); - } - this._config = Object.assign({}, mergedConfig, { - resource: this.resource, - }); - if ((_b = config.spanProcessors) === null || _b === void 0 ? void 0 : _b.length) { - this._registeredSpanProcessors = [...config.spanProcessors]; - this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); - } - else { - const defaultExporter = this._buildExporterFromEnv(); - if (defaultExporter !== undefined) { - const batchProcessor = new platform_1.BatchSpanProcessor(defaultExporter); - this.activeSpanProcessor = batchProcessor; - } - else { - this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor(); - } - } - } - getTracer(name, version, options) { - const key = `${name}@${version || ''}:${(options === null || options === void 0 ? void 0 : options.schemaUrl) || ''}`; - if (!this._tracers.has(key)) { - this._tracers.set(key, new Tracer_1.Tracer({ name, version, schemaUrl: options === null || options === void 0 ? void 0 : options.schemaUrl }, this._config, this)); - } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - return this._tracers.get(key); - } - /** - * @deprecated please use {@link TracerConfig} spanProcessors property - * Adds a new {@link SpanProcessor} to this tracer. - * @param spanProcessor the new SpanProcessor to be added. - */ - addSpanProcessor(spanProcessor) { - if (this._registeredSpanProcessors.length === 0) { - // since we might have enabled by default a batchProcessor, we disable it - // before adding the new one - this.activeSpanProcessor - .shutdown() - .catch(err => api_1.diag.error('Error while trying to shutdown current span processor', err)); - } - this._registeredSpanProcessors.push(spanProcessor); - this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); - } - getActiveSpanProcessor() { - return this.activeSpanProcessor; - } - /** - * 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); - if (config.propagator === undefined) { - config.propagator = this._buildPropagatorFromEnv(); - } - if (config.contextManager) { - api_1.context.setGlobalContextManager(config.contextManager); - } - if (config.propagator) { - api_1.propagation.setGlobalPropagator(config.propagator); - } - } - forceFlush() { - const timeout = this._config.forceFlushTimeoutMillis; - const promises = this._registeredSpanProcessors.map((spanProcessor) => { - return new Promise(resolve => { - let state; - const timeoutInterval = setTimeout(() => { - resolve(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(); - } - /** - * TS cannot yet infer the type of this.constructor: - * https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146 - * There is no need to override either of the getters in your child class. - * The type of the registered component maps should be the same across all - * classes in the inheritance tree. - */ - _getPropagator(name) { - var _a; - return (_a = this.constructor._registeredPropagators.get(name)) === null || _a === void 0 ? void 0 : _a(); - } - _getSpanExporter(name) { - var _a; - return (_a = this.constructor._registeredExporters.get(name)) === null || _a === void 0 ? void 0 : _a(); - } - _buildPropagatorFromEnv() { - // per spec, propagators from env must be deduplicated - const uniquePropagatorNames = Array.from(new Set((0, core_1.getEnv)().OTEL_PROPAGATORS)); - const propagators = uniquePropagatorNames.map(name => { - const propagator = this._getPropagator(name); - if (!propagator) { - api_1.diag.warn(`Propagator "${name}" requested through environment variable is unavailable.`); - } - return propagator; - }); - const validPropagators = propagators.reduce((list, item) => { - if (item) { - list.push(item); - } - return list; - }, []); - if (validPropagators.length === 0) { - return; - } - else if (uniquePropagatorNames.length === 1) { - return validPropagators[0]; - } - else { - return new core_1.CompositePropagator({ - propagators: validPropagators, - }); - } - } - _buildExporterFromEnv() { - const exporterName = (0, core_1.getEnv)().OTEL_TRACES_EXPORTER; - if (exporterName === 'none' || exporterName === '') - return; - const exporter = this._getSpanExporter(exporterName); - if (!exporter) { - api_1.diag.error(`Exporter "${exporterName}" requested through environment variable is unavailable.`); - } - return exporter; - } -} -exports.BasicTracerProvider = BasicTracerProvider; -BasicTracerProvider._registeredPropagators = new Map([ - ['tracecontext', () => new core_1.W3CTraceContextPropagator()], - ['baggage', () => new core_1.W3CBaggagePropagator()], -]); -BasicTracerProvider._registeredExporters = new Map(); -//# sourceMappingURL=BasicTracerProvider.js.map - -/***/ }), - -/***/ 49060: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MultiSpanProcessor = void 0; -const core_1 = __nccwpck_require__(89736); -/** - * Implementation of the {@link SpanProcessor} that simply forwards all - * received events to a list of {@link SpanProcessor}s. - */ -class MultiSpanProcessor { - 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 || new Error('MultiSpanProcessor: forceFlush failed')); - resolve(); - }); - }); - } - onStart(span, context) { - for (const spanProcessor of this._spanProcessors) { - spanProcessor.onStart(span, context); - } - } - 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; -//# sourceMappingURL=MultiSpanProcessor.js.map - -/***/ }), - -/***/ 89427: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SamplingDecision = void 0; -/** - * A sampling decision that determines how a {@link Span} will be recorded - * and collected. - */ -var SamplingDecision; -(function (SamplingDecision) { - /** - * `Span.isRecording() === false`, span will not be recorded and all events - * and attributes will be dropped. - */ - SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; - /** - * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} - * MUST NOT be set. - */ - SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; - /** - * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} - * MUST be set. - */ - SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; -})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); -//# sourceMappingURL=Sampler.js.map - -/***/ }), - -/***/ 49837: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Span = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const semantic_conventions_1 = __nccwpck_require__(67275); -const enums_1 = __nccwpck_require__(94962); -/** - * This class represents a span. - */ -class Span { - /** - * Constructs a new Span instance. - * - * @deprecated calling Span constructor directly is not supported. Please use tracer.startSpan. - * */ - constructor(parentTracer, context, spanName, spanContext, kind, parentSpanId, links = [], startTime, _deprecatedClock, // keeping this argument even though it is unused to ensure backwards compatibility - attributes) { - this.attributes = {}; - this.links = []; - this.events = []; - this._droppedAttributesCount = 0; - this._droppedEventsCount = 0; - this._droppedLinksCount = 0; - this.status = { - code: api_1.SpanStatusCode.UNSET, - }; - this.endTime = [0, 0]; - this._ended = false; - this._duration = [-1, -1]; - this.name = spanName; - this._spanContext = spanContext; - this.parentSpanId = parentSpanId; - this.kind = kind; - this.links = links; - const now = Date.now(); - this._performanceStartTime = core_1.otperformance.now(); - this._performanceOffset = - now - (this._performanceStartTime + (0, core_1.getTimeOrigin)()); - this._startTimeProvided = startTime != null; - this.startTime = this._getTime(startTime !== null && startTime !== void 0 ? startTime : now); - this.resource = parentTracer.resource; - this.instrumentationLibrary = parentTracer.instrumentationLibrary; - this._spanLimits = parentTracer.getSpanLimits(); - this._attributeValueLengthLimit = - this._spanLimits.attributeValueLengthLimit || 0; - if (attributes != null) { - this.setAttributes(attributes); - } - this._spanProcessor = parentTracer.getActiveSpanProcessor(); - this._spanProcessor.onStart(this, 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; - } - if (Object.keys(this.attributes).length >= - this._spanLimits.attributeCountLimit && - !Object.prototype.hasOwnProperty.call(this.attributes, key)) { - this._droppedAttributesCount++; - return this; - } - this.attributes[key] = this._truncateToSize(value); - return this; - } - setAttributes(attributes) { - for (const [k, v] of Object.entries(attributes)) { - this.setAttribute(k, v); - } - 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; - if (this._spanLimits.eventCountLimit === 0) { - api_1.diag.warn('No events allowed.'); - this._droppedEventsCount++; - return this; - } - if (this.events.length >= this._spanLimits.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 = undefined; - } - const attributes = (0, core_1.sanitizeAttributes)(attributesOrStartTime); - this.events.push({ - name, - attributes, - time: this._getTime(timeStamp), - droppedAttributesCount: 0, - }); - return this; - } - addLink(link) { - this.links.push(link); - return this; - } - addLinks(links) { - this.links.push(...links); - return this; - } - setStatus(status) { - if (this._isSpanEnded()) - return this; - this.status = Object.assign({}, status); - // When using try-catch, the caught "error" is of type `any`. When then assigning `any` to `status.message`, - // TypeScript will not error. While this can happen during use of any API, it is more common on Span#setStatus() - // as it's likely used in a catch-block. Therefore, we validate if `status.message` is actually a string, null, or - // undefined to avoid an incorrect type causing issues downstream. - if (this.status.message != null && typeof status.message !== 'string') { - api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); - delete this.status.message; - } - 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._ended = true; - 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`); - } - this._spanProcessor.onEnd(this); - } - _getTime(inp) { - if (typeof inp === 'number' && inp <= core_1.otperformance.now()) { - // must be a performance timestamp - // apply correction and convert to hrtime - 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) { - // if user provided a time for the start manually - // we can't use duration to calculate event/end times - 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.SEMATTRS_EXCEPTION_MESSAGE] = exception; - } - else if (exception) { - if (exception.code) { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] = exception.code.toString(); - } - else if (exception.name) { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] = exception.name; - } - if (exception.message) { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_MESSAGE] = exception.message; - } - if (exception.stack) { - attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_STACKTRACE] = exception.stack; - } - } - // these are minimum requirements from spec - if (attributes[semantic_conventions_1.SEMATTRS_EXCEPTION_TYPE] || - attributes[semantic_conventions_1.SEMATTRS_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) { - api_1.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); - } - return this._ended; - } - // Utility function to truncate given value within size - // for value type of string, will truncate to given limit - // for type of non-string, will return same value - _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; - // Check limit - if (limit <= 0) { - // Negative values are invalid, so do not truncate - api_1.diag.warn(`Attribute value limit must be positive, got ${limit}`); - return value; - } - // String - if (typeof value === 'string') { - return this._truncateToLimitUtil(value, limit); - } - // Array of strings - if (Array.isArray(value)) { - return value.map(val => typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val); - } - // Other types, no need to apply value length limit - return value; - } -} -exports.Span = Span; -//# sourceMappingURL=Span.js.map - -/***/ }), - -/***/ 8914: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Tracer = void 0; -const api = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const Span_1 = __nccwpck_require__(49837); -const utility_1 = __nccwpck_require__(44636); -const platform_1 = __nccwpck_require__(85583); -/** - * This class represents a basic tracer. - */ -class Tracer { - /** - * Constructs a new Tracer instance. - */ - constructor(instrumentationLibrary, config, _tracerProvider) { - this._tracerProvider = _tracerProvider; - 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 = _tracerProvider.resource; - this.instrumentationLibrary = instrumentationLibrary; - } - /** - * Starts a new Span or returns the default NoopSpan based on the sampling - * decision. - */ - startSpan(name, options = {}, context = api.context.active()) { - var _a, _b, _c; - // remove span from context in case a root span is requested via options - if (options.root) { - context = api.trace.deleteSpan(context); - } - const parentSpan = api.trace.getSpan(context); - if ((0, core_1.isTracingSuppressed)(context)) { - api.diag.debug('Instrumentation suppressed, returning Noop Span'); - const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); - return nonRecordingSpan; - } - const parentSpanContext = parentSpan === null || parentSpan === void 0 ? void 0 : parentSpan.spanContext(); - const spanId = this._idGenerator.generateSpanId(); - let traceId; - let traceState; - let parentSpanId; - if (!parentSpanContext || - !api.trace.isSpanContextValid(parentSpanContext)) { - // New root span. - traceId = this._idGenerator.generateTraceId(); - } - else { - // New child span. - traceId = parentSpanContext.traceId; - traceState = parentSpanContext.traceState; - parentSpanId = parentSpanContext.spanId; - } - const spanKind = (_a = options.kind) !== null && _a !== void 0 ? _a : api.SpanKind.INTERNAL; - const links = ((_b = options.links) !== null && _b !== void 0 ? _b : []).map(link => { - return { - context: link.context, - attributes: (0, core_1.sanitizeAttributes)(link.attributes), - }; - }); - const attributes = (0, core_1.sanitizeAttributes)(options.attributes); - // make sampling decision - const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); - traceState = (_c = samplingResult.traceState) !== null && _c !== void 0 ? _c : 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'); - const nonRecordingSpan = api.trace.wrapSpanContext(spanContext); - return nonRecordingSpan; - } - // Set initial span attributes. The attributes object may have been mutated - // by the sampler, so we sanitize the merged attributes before setting them. - const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); - const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime, undefined, initAttributes); - return span; - } - 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 : api.context.active(); - const span = this.startSpan(name, opts, parentContext); - const contextWithSpanSet = api.trace.setSpan(parentContext, span); - return api.context.with(contextWithSpanSet, fn, undefined, span); - } - /** Returns the active {@link GeneralLimits}. */ - getGeneralLimits() { - return this._generalLimits; - } - /** Returns the active {@link SpanLimits}. */ - getSpanLimits() { - return this._spanLimits; - } - getActiveSpanProcessor() { - return this._tracerProvider.getActiveSpanProcessor(); - } -} -exports.Tracer = Tracer; -//# sourceMappingURL=Tracer.js.map - -/***/ }), - -/***/ 90897: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildSamplerFromEnv = exports.loadDefaultConfig = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const AlwaysOffSampler_1 = __nccwpck_require__(30524); -const AlwaysOnSampler_1 = __nccwpck_require__(37870); -const ParentBasedSampler_1 = __nccwpck_require__(91943); -const TraceIdRatioBasedSampler_1 = __nccwpck_require__(5791); -const FALLBACK_OTEL_TRACES_SAMPLER = core_1.TracesSamplerValues.AlwaysOn; -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. - */ -// object needs to be wrapped in this function and called when needed otherwise -// envs are parsed before tests are ran - causes tests using these envs to fail -function loadDefaultConfig() { - const env = (0, core_1.getEnv)(); - return { - sampler: buildSamplerFromEnv(env), - forceFlushTimeoutMillis: 30000, - generalLimits: { - attributeValueLengthLimit: env.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, - attributeCountLimit: env.OTEL_ATTRIBUTE_COUNT_LIMIT, - }, - spanLimits: { - attributeValueLengthLimit: env.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, - attributeCountLimit: env.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, - linkCountLimit: env.OTEL_SPAN_LINK_COUNT_LIMIT, - eventCountLimit: env.OTEL_SPAN_EVENT_COUNT_LIMIT, - attributePerEventCountLimit: env.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, - attributePerLinkCountLimit: env.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, - }, - mergeResourceWithDefaults: true, - }; -} -exports.loadDefaultConfig = loadDefaultConfig; -/** - * Based on environment, builds a sampler, complies with specification. - * @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment - */ -function buildSamplerFromEnv(environment = (0, core_1.getEnv)()) { - switch (environment.OTEL_TRACES_SAMPLER) { - case core_1.TracesSamplerValues.AlwaysOn: - return new AlwaysOnSampler_1.AlwaysOnSampler(); - case core_1.TracesSamplerValues.AlwaysOff: - return new AlwaysOffSampler_1.AlwaysOffSampler(); - case core_1.TracesSamplerValues.ParentBasedAlwaysOn: - return new ParentBasedSampler_1.ParentBasedSampler({ - root: new AlwaysOnSampler_1.AlwaysOnSampler(), - }); - case core_1.TracesSamplerValues.ParentBasedAlwaysOff: - return new ParentBasedSampler_1.ParentBasedSampler({ - root: new AlwaysOffSampler_1.AlwaysOffSampler(), - }); - case core_1.TracesSamplerValues.TraceIdRatio: - return new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)); - case core_1.TracesSamplerValues.ParentBasedTraceIdRatio: - return new ParentBasedSampler_1.ParentBasedSampler({ - root: new TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)), - }); - default: - api_1.diag.error(`OTEL_TRACES_SAMPLER value "${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".`); - return new AlwaysOnSampler_1.AlwaysOnSampler(); - } -} -exports.buildSamplerFromEnv = buildSamplerFromEnv; -function getSamplerProbabilityFromEnv(environment) { - if (environment.OTEL_TRACES_SAMPLER_ARG === undefined || - environment.OTEL_TRACES_SAMPLER_ARG === '') { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - const probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); - if (isNaN(probability)) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - if (probability < 0 || probability > 1) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - return probability; -} -//# sourceMappingURL=config.js.map - -/***/ }), - -/***/ 94962: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExceptionEventName = void 0; -// Event name definitions -exports.ExceptionEventName = 'exception'; -//# sourceMappingURL=enums.js.map - -/***/ }), - -/***/ 4647: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchSpanProcessorBase = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -/** - * Implementation of the {@link SpanProcessor} that batches spans exported by - * the SDK then pushes them to the exporter pipeline. - */ -class BatchSpanProcessorBase { - constructor(_exporter, config) { - this._exporter = _exporter; - this._isExporting = false; - this._finishedSpans = []; - this._droppedSpansCount = 0; - const env = (0, core_1.getEnv)(); - this._maxExportBatchSize = - typeof (config === null || config === void 0 ? void 0 : config.maxExportBatchSize) === 'number' - ? config.maxExportBatchSize - : env.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; - this._maxQueueSize = - typeof (config === null || config === void 0 ? void 0 : config.maxQueueSize) === 'number' - ? config.maxQueueSize - : env.OTEL_BSP_MAX_QUEUE_SIZE; - this._scheduledDelayMillis = - typeof (config === null || config === void 0 ? void 0 : config.scheduledDelayMillis) === 'number' - ? config.scheduledDelayMillis - : env.OTEL_BSP_SCHEDULE_DELAY; - this._exportTimeoutMillis = - typeof (config === null || config === void 0 ? void 0 : config.exportTimeoutMillis) === 'number' - ? config.exportTimeoutMillis - : env.OTEL_BSP_EXPORT_TIMEOUT; - 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(); - } - // does nothing. - 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) { - // limit reached, drop span - if (this._droppedSpansCount === 0) { - api_1.diag.debug('maxQueueSize reached, dropping spans'); - } - this._droppedSpansCount++; - return; - } - if (this._droppedSpansCount > 0) { - // some spans were dropped, log once with count of spans dropped - 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 = []; - // calculate number of batches - 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(() => { - // don't wait anymore for export, this way the next batch can start - reject(new Error('Timeout')); - }, this._exportTimeoutMillis); - // prevent downstream exporter calls from generating spans - api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { - // Reset the finished spans buffer here because the next invocations of the _flush method - // could pass the same finished spans to the exporter if the buffer is cleared - // outside the execution of this callback. - 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 => { - var _a; - clearTimeout(timer); - if (result.code === core_1.ExportResultCode.SUCCESS) { - resolve(); - } - else { - reject((_a = result.error) !== null && _a !== void 0 ? _a : 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 !== null && pendingResources !== void 0 ? pendingResources : (pendingResources = []); - pendingResources.push(span.resource.waitForAsyncAttributes()); - } - } - // Avoid scheduling a promise to make the behavior more predictable and easier to test - 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); - }); - }; - // we only wait if the queue doesn't have enough elements yet - if (this._finishedSpans.length >= this._maxExportBatchSize) { - return flush(); - } - if (this._timer !== undefined) - return; - this._timer = setTimeout(() => flush(), this._scheduledDelayMillis); - (0, core_1.unrefTimer)(this._timer); - } - _clearTimer() { - if (this._timer !== undefined) { - clearTimeout(this._timer); - this._timer = undefined; - } - } -} -exports.BatchSpanProcessorBase = BatchSpanProcessorBase; -//# sourceMappingURL=BatchSpanProcessorBase.js.map - -/***/ }), - -/***/ 56239: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConsoleSpanExporter = void 0; -const core_1 = __nccwpck_require__(89736); -/** - * 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. - */ -/* eslint-disable no-console */ -class ConsoleSpanExporter { - /** - * 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) { - var _a; - return { - resource: { - attributes: span.resource.attributes, - }, - instrumentationScope: span.instrumentationLibrary, - traceId: span.spanContext().traceId, - parentId: span.parentSpanId, - traceState: (_a = span.spanContext().traceState) === null || _a === void 0 ? void 0 : _a.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; -//# sourceMappingURL=ConsoleSpanExporter.js.map - -/***/ }), - -/***/ 33505: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InMemorySpanExporter = void 0; -const core_1 = __nccwpck_require__(89736); -/** - * 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. - */ -class InMemorySpanExporter { - constructor() { - this._finishedSpans = []; - /** - * Indicates if the exporter has been "shutdown." - * When false, exported spans will not be stored in-memory. - */ - this._stopped = false; - } - export(spans, resultCallback) { - if (this._stopped) - return resultCallback({ - code: core_1.ExportResultCode.FAILED, - error: 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; -//# sourceMappingURL=InMemorySpanExporter.js.map - -/***/ }), - -/***/ 36280: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopSpanProcessor = void 0; -/** No-op implementation of SpanProcessor */ -class NoopSpanProcessor { - onStart(_span, _context) { } - onEnd(_span) { } - shutdown() { - return Promise.resolve(); - } - forceFlush() { - return Promise.resolve(); - } -} -exports.NoopSpanProcessor = NoopSpanProcessor; -//# sourceMappingURL=NoopSpanProcessor.js.map - -/***/ }), - -/***/ 20187: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SimpleSpanProcessor = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -/** - * 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. - */ -class SimpleSpanProcessor { - constructor(_exporter) { - this._exporter = _exporter; - this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); - this._unresolvedExports = new Set(); - } - async forceFlush() { - // await unresolved resources before resolving - await Promise.all(Array.from(this._unresolvedExports)); - if (this._exporter.forceFlush) { - await this._exporter.forceFlush(); - } - } - onStart(_span, _parentContext) { } - onEnd(span) { - var _a, _b; - if (this._shutdownOnce.isCalled) { - return; - } - if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { - return; - } - const doExport = () => core_1.internal - ._export(this._exporter, [span]) - .then((result) => { - var _a; - if (result.code !== core_1.ExportResultCode.SUCCESS) { - (0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`)); - } - }) - .catch(error => { - (0, core_1.globalErrorHandler)(error); - }); - // Avoid scheduling a promise to make the behavior more predictable and easier to test - if (span.resource.asyncAttributesPending) { - const exportPromise = (_b = (_a = span.resource).waitForAsyncAttributes) === null || _b === void 0 ? void 0 : _b.call(_a).then(() => { - if (exportPromise != null) { - this._unresolvedExports.delete(exportPromise); - } - return doExport(); - }, err => (0, core_1.globalErrorHandler)(err)); - // store the unresolved exports - if (exportPromise != null) { - this._unresolvedExports.add(exportPromise); - } - } - else { - void doExport(); - } - } - shutdown() { - return this._shutdownOnce.call(); - } - _shutdown() { - return this._exporter.shutdown(); - } -} -exports.SimpleSpanProcessor = SimpleSpanProcessor; -//# sourceMappingURL=SimpleSpanProcessor.js.map - -/***/ }), - -/***/ 67030: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Span = exports.SamplingDecision = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = exports.NoopSpanProcessor = exports.SimpleSpanProcessor = exports.InMemorySpanExporter = exports.ConsoleSpanExporter = exports.RandomIdGenerator = exports.BatchSpanProcessor = exports.ForceFlushState = exports.BasicTracerProvider = exports.Tracer = void 0; -var Tracer_1 = __nccwpck_require__(8914); -Object.defineProperty(exports, "Tracer", ({ enumerable: true, get: function () { return Tracer_1.Tracer; } })); -var BasicTracerProvider_1 = __nccwpck_require__(83795); -Object.defineProperty(exports, "BasicTracerProvider", ({ enumerable: true, get: function () { return BasicTracerProvider_1.BasicTracerProvider; } })); -Object.defineProperty(exports, "ForceFlushState", ({ enumerable: true, get: function () { return BasicTracerProvider_1.ForceFlushState; } })); -var platform_1 = __nccwpck_require__(85583); -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 = __nccwpck_require__(56239); -Object.defineProperty(exports, "ConsoleSpanExporter", ({ enumerable: true, get: function () { return ConsoleSpanExporter_1.ConsoleSpanExporter; } })); -var InMemorySpanExporter_1 = __nccwpck_require__(33505); -Object.defineProperty(exports, "InMemorySpanExporter", ({ enumerable: true, get: function () { return InMemorySpanExporter_1.InMemorySpanExporter; } })); -var SimpleSpanProcessor_1 = __nccwpck_require__(20187); -Object.defineProperty(exports, "SimpleSpanProcessor", ({ enumerable: true, get: function () { return SimpleSpanProcessor_1.SimpleSpanProcessor; } })); -var NoopSpanProcessor_1 = __nccwpck_require__(36280); -Object.defineProperty(exports, "NoopSpanProcessor", ({ enumerable: true, get: function () { return NoopSpanProcessor_1.NoopSpanProcessor; } })); -var AlwaysOffSampler_1 = __nccwpck_require__(30524); -Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); -var AlwaysOnSampler_1 = __nccwpck_require__(37870); -Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); -var ParentBasedSampler_1 = __nccwpck_require__(91943); -Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); -var TraceIdRatioBasedSampler_1 = __nccwpck_require__(5791); -Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); -var Sampler_1 = __nccwpck_require__(89427); -Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return Sampler_1.SamplingDecision; } })); -var Span_1 = __nccwpck_require__(49837); -Object.defineProperty(exports, "Span", ({ enumerable: true, get: function () { return Span_1.Span; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 85583: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; -var node_1 = __nccwpck_require__(2252); -Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return node_1.BatchSpanProcessor; } })); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 24010: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = void 0; -const SPAN_ID_BYTES = 8; -const TRACE_ID_BYTES = 16; -class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.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++) { - // unsigned right shift drops decimal part of the number - // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE - SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); - } - // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated - 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); - }; -} -//# sourceMappingURL=RandomIdGenerator.js.map - -/***/ }), - -/***/ 63575: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchSpanProcessor = void 0; -const BatchSpanProcessorBase_1 = __nccwpck_require__(4647); -class BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { - onShutdown() { } -} -exports.BatchSpanProcessor = BatchSpanProcessor; -//# sourceMappingURL=BatchSpanProcessor.js.map - -/***/ }), - -/***/ 2252: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = exports.BatchSpanProcessor = void 0; -var BatchSpanProcessor_1 = __nccwpck_require__(63575); -Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return BatchSpanProcessor_1.BatchSpanProcessor; } })); -var RandomIdGenerator_1 = __nccwpck_require__(24010); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 30524: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOffSampler = void 0; -const Sampler_1 = __nccwpck_require__(89427); -/** Sampler that samples no traces. */ -class AlwaysOffSampler { - shouldSample() { - return { - decision: Sampler_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return 'AlwaysOffSampler'; - } -} -exports.AlwaysOffSampler = AlwaysOffSampler; -//# sourceMappingURL=AlwaysOffSampler.js.map - -/***/ }), - -/***/ 37870: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOnSampler = void 0; -const Sampler_1 = __nccwpck_require__(89427); -/** Sampler that samples all traces. */ -class AlwaysOnSampler { - shouldSample() { - return { - decision: Sampler_1.SamplingDecision.RECORD_AND_SAMPLED, - }; - } - toString() { - return 'AlwaysOnSampler'; - } -} -exports.AlwaysOnSampler = AlwaysOnSampler; -//# sourceMappingURL=AlwaysOnSampler.js.map - -/***/ }), - -/***/ 91943: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ParentBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -const core_1 = __nccwpck_require__(89736); -const AlwaysOffSampler_1 = __nccwpck_require__(30524); -const AlwaysOnSampler_1 = __nccwpck_require__(37870); -/** - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ -class ParentBasedSampler { - constructor(config) { - var _a, _b, _c, _d; - this._root = config.root; - if (!this._root) { - (0, core_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context); - if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { - return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } -} -exports.ParentBasedSampler = ParentBasedSampler; -//# sourceMappingURL=ParentBasedSampler.js.map - -/***/ }), - -/***/ 5791: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceIdRatioBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -const Sampler_1 = __nccwpck_require__(89427); -/** Sampler that samples a given fraction of traces based of trace id deterministically. */ -class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); - } - shouldSample(context, traceId) { - return { - decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound - ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED - : Sampler_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return `TraceIdRatioBased{${this._ratio}}`; - } - _normalize(ratio) { - if (typeof ratio !== 'number' || isNaN(ratio)) - return 0; - return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; - } - _accumulate(traceId) { - let accumulation = 0; - for (let i = 0; i < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } -} -exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -//# sourceMappingURL=TraceIdRatioBasedSampler.js.map - -/***/ }), - -/***/ 44636: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reconfigureLimits = exports.mergeConfig = void 0; -const config_1 = __nccwpck_require__(90897); -const core_1 = __nccwpck_require__(89736); -/** - * 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) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; - const spanLimits = Object.assign({}, userConfig.spanLimits); - const parsedEnvConfig = (0, core_1.getEnvWithoutDefaults)(); - /** - * Reassign span attribute count limit to use first non null value defined by user or use default value - */ - spanLimits.attributeCountLimit = - (_f = (_e = (_d = (_b = (_a = userConfig.spanLimits) === null || _a === void 0 ? void 0 : _a.attributeCountLimit) !== null && _b !== void 0 ? _b : (_c = userConfig.generalLimits) === null || _c === void 0 ? void 0 : _c.attributeCountLimit) !== null && _d !== void 0 ? _d : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT) !== null && _e !== void 0 ? _e : parsedEnvConfig.OTEL_ATTRIBUTE_COUNT_LIMIT) !== null && _f !== void 0 ? _f : core_1.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 = - (_m = (_l = (_k = (_h = (_g = userConfig.spanLimits) === null || _g === void 0 ? void 0 : _g.attributeValueLengthLimit) !== null && _h !== void 0 ? _h : (_j = userConfig.generalLimits) === null || _j === void 0 ? void 0 : _j.attributeValueLengthLimit) !== null && _k !== void 0 ? _k : parsedEnvConfig.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _l !== void 0 ? _l : parsedEnvConfig.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT) !== null && _m !== void 0 ? _m : core_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; - return Object.assign({}, userConfig, { spanLimits }); -} -exports.reconfigureLimits = reconfigureLimits; -//# sourceMappingURL=utility.js.map - -/***/ }), - -/***/ 20155: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const ANY = Symbol('SemVer ANY') -// hoisted class for cyclic dependency -class Comparator { - static get ANY () { - return ANY - } - - constructor (comp, options) { - options = parseOptions(options) - - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp - } else { - comp = comp.value - } - } - - comp = comp.trim().split(/\s+/).join(' ') - debug('comparator', comp, options) - this.options = options - this.loose = !!options.loose - this.parse(comp) - - if (this.semver === ANY) { - this.value = '' - } else { - this.value = this.operator + this.semver.version - } - - debug('comp', this) - } - - parse (comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] - const m = comp.match(r) - - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`) - } - - this.operator = m[1] !== undefined ? m[1] : '' - if (this.operator === '=') { - this.operator = '' - } - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) { - this.semver = ANY - } else { - this.semver = new SemVer(m[2], this.options.loose) - } - } - - toString () { - return this.value - } - - test (version) { - debug('Comparator.test', version, this.options.loose) - - if (this.semver === ANY || version === ANY) { - return true - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - return cmp(version, this.operator, this.semver, this.options) - } - - intersects (comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required') - } - - if (this.operator === '') { - if (this.value === '') { - return true - } - return new Range(comp.value, options).test(this.value) - } else if (comp.operator === '') { - if (comp.value === '') { - return true - } - return new Range(this.value, options).test(comp.semver) - } - - options = parseOptions(options) - - // Special cases where nothing can possibly be lower - if (options.includePrerelease && - (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { - return false - } - if (!options.includePrerelease && - (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { - return false - } - - // Same direction increasing (> or >=) - if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { - return true - } - // Same direction decreasing (< or <=) - if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { - return true - } - // same SemVer and both sides are inclusive (<= or >=) - if ( - (this.semver.version === comp.semver.version) && - this.operator.includes('=') && comp.operator.includes('=')) { - return true - } - // opposite directions less than - if (cmp(this.semver, '<', comp.semver, options) && - this.operator.startsWith('>') && comp.operator.startsWith('<')) { - return true - } - // opposite directions greater than - if (cmp(this.semver, '>', comp.semver, options) && - this.operator.startsWith('<') && comp.operator.startsWith('>')) { - return true - } - return false - } -} - -module.exports = Comparator - -const parseOptions = __nccwpck_require__(84611) -const { safeRe: re, t } = __nccwpck_require__(57529) -const cmp = __nccwpck_require__(58289) -const debug = __nccwpck_require__(91308) -const SemVer = __nccwpck_require__(11776) -const Range = __nccwpck_require__(32009) - - -/***/ }), - -/***/ 32009: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SPACE_CHARACTERS = /\s+/g - -// hoisted class for cyclic dependency -class Range { - constructor (range, options) { - options = parseOptions(options) - - if (range instanceof Range) { - if ( - range.loose === !!options.loose && - range.includePrerelease === !!options.includePrerelease - ) { - return range - } else { - return new Range(range.raw, options) - } - } - - if (range instanceof Comparator) { - // just put it in the set and return - this.raw = range.value - this.set = [[range]] - this.formatted = undefined - return this - } - - this.options = options - this.loose = !!options.loose - this.includePrerelease = !!options.includePrerelease - - // First reduce all whitespace as much as possible so we do not have to rely - // on potentially slow regexes like \s*. This is then stored and used for - // future error messages as well. - this.raw = range.trim().replace(SPACE_CHARACTERS, ' ') - - // First, split on || - this.set = this.raw - .split('||') - // map the range to a 2d array of comparators - .map(r => this.parseRange(r.trim())) - // throw out any comparator lists that are empty - // this generally means that it was not a valid range, which is allowed - // in loose mode, but will still throw if the WHOLE range is invalid. - .filter(c => c.length) - - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`) - } - - // if we have any that are not the null set, throw out null sets. - if (this.set.length > 1) { - // keep the first one, in case they're all null sets - const first = this.set[0] - this.set = this.set.filter(c => !isNullSet(c[0])) - if (this.set.length === 0) { - this.set = [first] - } else if (this.set.length > 1) { - // if we have any that are *, then the range is just * - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c] - break - } - } - } - } - - this.formatted = undefined - } - - get range () { - if (this.formatted === undefined) { - this.formatted = '' - for (let i = 0; i < this.set.length; i++) { - if (i > 0) { - this.formatted += '||' - } - const comps = this.set[i] - for (let k = 0; k < comps.length; k++) { - if (k > 0) { - this.formatted += ' ' - } - this.formatted += comps[k].toString().trim() - } - } - } - return this.formatted - } - - format () { - return this.range - } - - toString () { - return this.range - } - - parseRange (range) { - // memoize range parsing for performance. - // this is a very hot path, and fully deterministic. - const memoOpts = - (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | - (this.options.loose && FLAG_LOOSE) - const memoKey = memoOpts + ':' + range - const cached = cache.get(memoKey) - if (cached) { - return cached - } - - const loose = this.options.loose - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) - debug('hyphen replace', range) - - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) - debug('comparator trim', range) - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[t.TILDETRIM], tildeTrimReplace) - debug('tilde trim', range) - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[t.CARETTRIM], caretTrimReplace) - debug('caret trim', range) - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - let rangeList = range - .split(' ') - .map(comp => parseComparator(comp, this.options)) - .join(' ') - .split(/\s+/) - // >=0.0.0 is equivalent to * - .map(comp => replaceGTE0(comp, this.options)) - - if (loose) { - // in loose mode, throw out any that are not valid comparators - rangeList = rangeList.filter(comp => { - debug('loose invalid filter', comp, this.options) - return !!comp.match(re[t.COMPARATORLOOSE]) - }) - } - debug('range list', rangeList) - - // if any comparators are the null set, then replace with JUST null set - // if more than one comparator, remove any * comparators - // also, don't include the same comparator more than once - const rangeMap = new Map() - const comparators = rangeList.map(comp => new Comparator(comp, this.options)) - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp] - } - rangeMap.set(comp.value, comp) - } - if (rangeMap.size > 1 && rangeMap.has('')) { - rangeMap.delete('') - } - - const result = [...rangeMap.values()] - cache.set(memoKey, result) - return result - } - - intersects (range, options) { - if (!(range instanceof Range)) { - throw new TypeError('a Range is required') - } - - return this.set.some((thisComparators) => { - return ( - isSatisfiable(thisComparators, options) && - range.set.some((rangeComparators) => { - return ( - isSatisfiable(rangeComparators, options) && - thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options) - }) - }) - ) - }) - ) - }) - } - - // if ANY of the sets match ALL of its comparators, then pass - test (version) { - if (!version) { - return false - } - - if (typeof version === 'string') { - try { - version = new SemVer(version, this.options) - } catch (er) { - return false - } - } - - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true - } - } - return false - } -} - -module.exports = Range - -const LRU = __nccwpck_require__(88412) -const cache = new LRU() - -const parseOptions = __nccwpck_require__(84611) -const Comparator = __nccwpck_require__(20155) -const debug = __nccwpck_require__(91308) -const SemVer = __nccwpck_require__(11776) -const { - safeRe: re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace, -} = __nccwpck_require__(57529) -const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = __nccwpck_require__(28487) - -const isNullSet = c => c.value === '<0.0.0-0' -const isAny = c => c.value === '' - -// take a set of comparators and determine whether there -// exists a version which can satisfy it -const isSatisfiable = (comparators, options) => { - let result = true - const remainingComparators = comparators.slice() - let testComparator = remainingComparators.pop() - - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options) - }) - - testComparator = remainingComparators.pop() - } - - return result -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -const parseComparator = (comp, options) => { - debug('comp', comp, options) - comp = replaceCarets(comp, options) - debug('caret', comp) - comp = replaceTildes(comp, options) - debug('tildes', comp) - comp = replaceXRanges(comp, options) - debug('xrange', comp) - comp = replaceStars(comp, options) - debug('stars', comp) - return comp -} - -const isX = id => !id || id.toLowerCase() === 'x' || id === '*' - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 -// ~0.0.1 --> >=0.0.1 <0.1.0-0 -const replaceTildes = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceTilde(c, options)) - .join(' ') -} - -const replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] - return comp.replace(r, (_, M, m, p, pr) => { - debug('tilde', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0` - } else if (isX(p)) { - // ~1.2 == >=1.2.0 <1.3.0-0 - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` - } else if (pr) { - debug('replaceTilde pr', pr) - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } else { - // ~1.2.3 == >=1.2.3 <1.3.0-0 - ret = `>=${M}.${m}.${p - } <${M}.${+m + 1}.0-0` - } - - debug('tilde return', ret) - return ret - }) -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 -// ^1.2.3 --> >=1.2.3 <2.0.0-0 -// ^1.2.0 --> >=1.2.0 <2.0.0-0 -// ^0.0.1 --> >=0.0.1 <0.0.2-0 -// ^0.1.0 --> >=0.1.0 <0.2.0-0 -const replaceCarets = (comp, options) => { - return comp - .trim() - .split(/\s+/) - .map((c) => replaceCaret(c, options)) - .join(' ') -} - -const replaceCaret = (comp, options) => { - debug('caret', comp, options) - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] - const z = options.includePrerelease ? '-0' : '' - return comp.replace(r, (_, M, m, p, pr) => { - debug('caret', comp, _, M, m, p, pr) - let ret - - if (isX(M)) { - ret = '' - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` - } else if (isX(p)) { - if (M === '0') { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` - } - } else if (pr) { - debug('replaceCaret pr', pr) - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p}-${pr - } <${+M + 1}.0.0-0` - } - } else { - debug('no pr') - if (M === '0') { - if (m === '0') { - ret = `>=${M}.${m}.${p - }${z} <${M}.${m}.${+p + 1}-0` - } else { - ret = `>=${M}.${m}.${p - }${z} <${M}.${+m + 1}.0-0` - } - } else { - ret = `>=${M}.${m}.${p - } <${+M + 1}.0.0-0` - } - } - - debug('caret return', ret) - return ret - }) -} - -const replaceXRanges = (comp, options) => { - debug('replaceXRanges', comp, options) - return comp - .split(/\s+/) - .map((c) => replaceXRange(c, options)) - .join(' ') -} - -const replaceXRange = (comp, options) => { - comp = comp.trim() - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug('xRange', comp, ret, gtlt, M, m, p, pr) - const xM = isX(M) - const xm = xM || isX(m) - const xp = xm || isX(p) - const anyX = xp - - if (gtlt === '=' && anyX) { - gtlt = '' - } - - // if we're including prereleases in the match, then we need - // to fix this to -0, the lowest possible prerelease value - pr = options.includePrerelease ? '-0' : '' - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0-0' - } else { - // nothing is forbidden - ret = '*' - } - } else if (gtlt && anyX) { - // we know patch is an x, because we have any x at all. - // replace X with 0 - if (xm) { - m = 0 - } - p = 0 - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - gtlt = '>=' - if (xm) { - M = +M + 1 - m = 0 - p = 0 - } else { - m = +m + 1 - p = 0 - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) { - M = +M + 1 - } else { - m = +m + 1 - } - } - - if (gtlt === '<') { - pr = '-0' - } - - ret = `${gtlt + M}.${m}.${p}${pr}` - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` - } else if (xp) { - ret = `>=${M}.${m}.0${pr - } <${M}.${+m + 1}.0-0` - } - - debug('xRange return', ret) - - return ret - }) -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -const replaceStars = (comp, options) => { - debug('replaceStars', comp, options) - // Looseness is ignored here. star is always as loose as it gets! - return comp - .trim() - .replace(re[t.STAR], '') -} - -const replaceGTE0 = (comp, options) => { - debug('replaceGTE0', comp, options) - return comp - .trim() - .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') -} - -// This function is passed to string.replace(re[t.HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 -// TODO build? -const hyphenReplace = incPr => ($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr) => { - if (isX(fM)) { - from = '' - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? '-0' : ''}` - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` - } else if (fpr) { - from = `>=${from}` - } else { - from = `>=${from}${incPr ? '-0' : ''}` - } - - if (isX(tM)) { - to = '' - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0` - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0` - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}` - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0` - } else { - to = `<=${to}` - } - - return `${from} ${to}`.trim() -} - -const testSet = (set, version, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version)) { - return false - } - } - - if (version.prerelease.length && !options.includePrerelease) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (let i = 0; i < set.length; i++) { - debug(set[i].semver) - if (set[i].semver === Comparator.ANY) { - continue - } - - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) { - return true - } - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false - } - - return true -} - - -/***/ }), - -/***/ 11776: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const debug = __nccwpck_require__(91308) -const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(28487) -const { safeRe: re, t } = __nccwpck_require__(57529) - -const parseOptions = __nccwpck_require__(84611) -const { compareIdentifiers } = __nccwpck_require__(28370) -class SemVer { - constructor (version, options) { - options = parseOptions(options) - - if (version instanceof SemVer) { - if (version.loose === !!options.loose && - version.includePrerelease === !!options.includePrerelease) { - return version - } else { - version = version.version - } - } else if (typeof version !== 'string') { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) - } - - if (version.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ) - } - - debug('SemVer', version, options) - this.options = options - this.loose = !!options.loose - // this isn't actually relevant for versions, but keep it so that we - // don't run into trouble passing this.options around. - this.includePrerelease = !!options.includePrerelease - - const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) - - if (!m) { - throw new TypeError(`Invalid Version: ${version}`) - } - - this.raw = version - - // these are actually numbers - this.major = +m[1] - this.minor = +m[2] - this.patch = +m[3] - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError('Invalid major version') - } - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError('Invalid minor version') - } - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError('Invalid patch version') - } - - // numberify any prerelease numeric ids - if (!m[4]) { - this.prerelease = [] - } else { - this.prerelease = m[4].split('.').map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num - } - } - return id - }) - } - - this.build = m[5] ? m[5].split('.') : [] - this.format() - } - - format () { - this.version = `${this.major}.${this.minor}.${this.patch}` - if (this.prerelease.length) { - this.version += `-${this.prerelease.join('.')}` - } - return this.version - } - - toString () { - return this.version - } - - compare (other) { - debug('SemVer.compare', this.version, this.options, other) - if (!(other instanceof SemVer)) { - if (typeof other === 'string' && other === this.version) { - return 0 - } - other = new SemVer(other, this.options) - } - - if (other.version === this.version) { - return 0 - } - - return this.compareMain(other) || this.comparePre(other) - } - - compareMain (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - return ( - compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch) - ) - } - - comparePre (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) { - return -1 - } else if (!this.prerelease.length && other.prerelease.length) { - return 1 - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0 - } - - let i = 0 - do { - const a = this.prerelease[i] - const b = other.prerelease[i] - debug('prerelease compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - compareBuild (other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options) - } - - let i = 0 - do { - const a = this.build[i] - const b = other.build[i] - debug('build compare', i, a, b) - if (a === undefined && b === undefined) { - return 0 - } else if (b === undefined) { - return 1 - } else if (a === undefined) { - return -1 - } else if (a === b) { - continue - } else { - return compareIdentifiers(a, b) - } - } while (++i) - } - - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc (release, identifier, identifierBase) { - switch (release) { - case 'premajor': - this.prerelease.length = 0 - this.patch = 0 - this.minor = 0 - this.major++ - this.inc('pre', identifier, identifierBase) - break - case 'preminor': - this.prerelease.length = 0 - this.patch = 0 - this.minor++ - this.inc('pre', identifier, identifierBase) - break - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0 - this.inc('patch', identifier, identifierBase) - this.inc('pre', identifier, identifierBase) - break - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) { - this.inc('patch', identifier, identifierBase) - } - this.inc('pre', identifier, identifierBase) - break - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if ( - this.minor !== 0 || - this.patch !== 0 || - this.prerelease.length === 0 - ) { - this.major++ - } - this.minor = 0 - this.patch = 0 - this.prerelease = [] - break - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++ - } - this.patch = 0 - this.prerelease = [] - break - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) { - this.patch++ - } - this.prerelease = [] - break - // This probably shouldn't be used publicly. - // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. - case 'pre': { - const base = Number(identifierBase) ? 1 : 0 - - if (!identifier && identifierBase === false) { - throw new Error('invalid increment argument: identifier is empty') - } - - if (this.prerelease.length === 0) { - this.prerelease = [base] - } else { - let i = this.prerelease.length - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++ - i = -2 - } - } - if (i === -1) { - // didn't increment anything - if (identifier === this.prerelease.join('.') && identifierBase === false) { - throw new Error('invalid increment argument: identifier already exists') - } - this.prerelease.push(base) - } - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - let prerelease = [identifier, base] - if (identifierBase === false) { - prerelease = [identifier] - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease - } - } else { - this.prerelease = prerelease - } - } - break - } - default: - throw new Error(`invalid increment argument: ${release}`) - } - this.raw = this.format() - if (this.build.length) { - this.raw += `+${this.build.join('.')}` - } - return this - } -} - -module.exports = SemVer - - -/***/ }), - -/***/ 16911: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(42083) -const clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ''), options) - return s ? s.version : null -} -module.exports = clean - - -/***/ }), - -/***/ 58289: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const eq = __nccwpck_require__(34618) -const neq = __nccwpck_require__(28728) -const gt = __nccwpck_require__(16565) -const gte = __nccwpck_require__(93358) -const lt = __nccwpck_require__(93586) -const lte = __nccwpck_require__(34113) - -const cmp = (a, op, b, loose) => { - switch (op) { - case '===': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a === b - - case '!==': - if (typeof a === 'object') { - a = a.version - } - if (typeof b === 'object') { - b = b.version - } - return a !== b - - case '': - case '=': - case '==': - return eq(a, b, loose) - - case '!=': - return neq(a, b, loose) - - case '>': - return gt(a, b, loose) - - case '>=': - return gte(a, b, loose) - - case '<': - return lt(a, b, loose) - - case '<=': - return lte(a, b, loose) - - default: - throw new TypeError(`Invalid operator: ${op}`) - } -} -module.exports = cmp - - -/***/ }), - -/***/ 35207: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const parse = __nccwpck_require__(42083) -const { safeRe: re, t } = __nccwpck_require__(57529) - -const coerce = (version, options) => { - if (version instanceof SemVer) { - return version - } - - if (typeof version === 'number') { - version = String(version) - } - - if (typeof version !== 'string') { - return null - } - - options = options || {} - - let match = null - if (!options.rtl) { - match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]) - } else { - // Find the right-most coercible string that does not share - // a terminus with a more left-ward coercible string. - // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' - // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4' - // - // Walk through the string checking with a /g regexp - // Manually set the index so as to pick up overlapping matches. - // Stop when we get a match that ends at the string end, since no - // coercible string can be more right-ward without the same terminus. - const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL] - let next - while ((next = coerceRtlRegex.exec(version)) && - (!match || match.index + match[0].length !== version.length) - ) { - if (!match || - next.index + next[0].length !== match.index + match[0].length) { - match = next - } - coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length - } - // leave it in a clean state - coerceRtlRegex.lastIndex = -1 - } - - if (match === null) { - return null - } - - const major = match[2] - const minor = match[3] || '0' - const patch = match[4] || '0' - const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '' - const build = options.includePrerelease && match[6] ? `+${match[6]}` : '' - - return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options) -} -module.exports = coerce - - -/***/ }), - -/***/ 28099: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose) - const versionB = new SemVer(b, loose) - return versionA.compare(versionB) || versionA.compareBuild(versionB) -} -module.exports = compareBuild - - -/***/ }), - -/***/ 56531: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(61020) -const compareLoose = (a, b) => compare(a, b, true) -module.exports = compareLoose - - -/***/ }), - -/***/ 61020: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const compare = (a, b, loose) => - new SemVer(a, loose).compare(new SemVer(b, loose)) - -module.exports = compare - - -/***/ }), - -/***/ 52704: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(42083) - -const diff = (version1, version2) => { - const v1 = parse(version1, null, true) - const v2 = parse(version2, null, true) - const comparison = v1.compare(v2) - - if (comparison === 0) { - return null - } - - const v1Higher = comparison > 0 - const highVersion = v1Higher ? v1 : v2 - const lowVersion = v1Higher ? v2 : v1 - const highHasPre = !!highVersion.prerelease.length - const lowHasPre = !!lowVersion.prerelease.length - - if (lowHasPre && !highHasPre) { - // Going from prerelease -> no prerelease requires some special casing - - // If the low version has only a major, then it will always be a major - // Some examples: - // 1.0.0-1 -> 1.0.0 - // 1.0.0-1 -> 1.1.1 - // 1.0.0-1 -> 2.0.0 - if (!lowVersion.patch && !lowVersion.minor) { - return 'major' - } - - // Otherwise it can be determined by checking the high version - - if (highVersion.patch) { - // anything higher than a patch bump would result in the wrong version - return 'patch' - } - - if (highVersion.minor) { - // anything higher than a minor bump would result in the wrong version - return 'minor' - } - - // bumping major/minor/patch all have same result - return 'major' - } - - // add the `pre` prefix if we are going to a prerelease version - const prefix = highHasPre ? 'pre' : '' - - if (v1.major !== v2.major) { - return prefix + 'major' - } - - if (v1.minor !== v2.minor) { - return prefix + 'minor' - } - - if (v1.patch !== v2.patch) { - return prefix + 'patch' - } - - // high and low are preleases - return 'prerelease' -} - -module.exports = diff - - -/***/ }), - -/***/ 34618: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(61020) -const eq = (a, b, loose) => compare(a, b, loose) === 0 -module.exports = eq - - -/***/ }), - -/***/ 16565: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(61020) -const gt = (a, b, loose) => compare(a, b, loose) > 0 -module.exports = gt - - -/***/ }), - -/***/ 93358: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(61020) -const gte = (a, b, loose) => compare(a, b, loose) >= 0 -module.exports = gte - - -/***/ }), - -/***/ 96881: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) - -const inc = (version, release, options, identifier, identifierBase) => { - if (typeof (options) === 'string') { - identifierBase = identifier - identifier = options - options = undefined - } - - try { - return new SemVer( - version instanceof SemVer ? version.version : version, - options - ).inc(release, identifier, identifierBase).version - } catch (er) { - return null - } -} -module.exports = inc - - -/***/ }), - -/***/ 93586: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(61020) -const lt = (a, b, loose) => compare(a, b, loose) < 0 -module.exports = lt - - -/***/ }), - -/***/ 34113: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(61020) -const lte = (a, b, loose) => compare(a, b, loose) <= 0 -module.exports = lte - - -/***/ }), - -/***/ 23501: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const major = (a, loose) => new SemVer(a, loose).major -module.exports = major - - -/***/ }), - -/***/ 92013: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const minor = (a, loose) => new SemVer(a, loose).minor -module.exports = minor - - -/***/ }), - -/***/ 28728: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(61020) -const neq = (a, b, loose) => compare(a, b, loose) !== 0 -module.exports = neq - - -/***/ }), - -/***/ 42083: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const parse = (version, options, throwErrors = false) => { - if (version instanceof SemVer) { - return version - } - try { - return new SemVer(version, options) - } catch (er) { - if (!throwErrors) { - return null - } - throw er - } -} - -module.exports = parse - - -/***/ }), - -/***/ 73539: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const patch = (a, loose) => new SemVer(a, loose).patch -module.exports = patch - - -/***/ }), - -/***/ 67881: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(42083) -const prerelease = (version, options) => { - const parsed = parse(version, options) - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null -} -module.exports = prerelease - - -/***/ }), - -/***/ 86396: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compare = __nccwpck_require__(61020) -const rcompare = (a, b, loose) => compare(b, a, loose) -module.exports = rcompare - - -/***/ }), - -/***/ 47804: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compareBuild = __nccwpck_require__(28099) -const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) -module.exports = rsort - - -/***/ }), - -/***/ 7980: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(32009) -const satisfies = (version, range, options) => { - try { - range = new Range(range, options) - } catch (er) { - return false - } - return range.test(version) -} -module.exports = satisfies - - -/***/ }), - -/***/ 91350: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const compareBuild = __nccwpck_require__(28099) -const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) -module.exports = sort - - -/***/ }), - -/***/ 6783: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const parse = __nccwpck_require__(42083) -const valid = (version, options) => { - const v = parse(version, options) - return v ? v.version : null -} -module.exports = valid - - -/***/ }), - -/***/ 52023: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// just pre-load all the stuff that index.js lazily exports -const internalRe = __nccwpck_require__(57529) -const constants = __nccwpck_require__(28487) -const SemVer = __nccwpck_require__(11776) -const identifiers = __nccwpck_require__(28370) -const parse = __nccwpck_require__(42083) -const valid = __nccwpck_require__(6783) -const clean = __nccwpck_require__(16911) -const inc = __nccwpck_require__(96881) -const diff = __nccwpck_require__(52704) -const major = __nccwpck_require__(23501) -const minor = __nccwpck_require__(92013) -const patch = __nccwpck_require__(73539) -const prerelease = __nccwpck_require__(67881) -const compare = __nccwpck_require__(61020) -const rcompare = __nccwpck_require__(86396) -const compareLoose = __nccwpck_require__(56531) -const compareBuild = __nccwpck_require__(28099) -const sort = __nccwpck_require__(91350) -const rsort = __nccwpck_require__(47804) -const gt = __nccwpck_require__(16565) -const lt = __nccwpck_require__(93586) -const eq = __nccwpck_require__(34618) -const neq = __nccwpck_require__(28728) -const gte = __nccwpck_require__(93358) -const lte = __nccwpck_require__(34113) -const cmp = __nccwpck_require__(58289) -const coerce = __nccwpck_require__(35207) -const Comparator = __nccwpck_require__(20155) -const Range = __nccwpck_require__(32009) -const satisfies = __nccwpck_require__(7980) -const toComparators = __nccwpck_require__(89918) -const maxSatisfying = __nccwpck_require__(79211) -const minSatisfying = __nccwpck_require__(78235) -const minVersion = __nccwpck_require__(53373) -const validRange = __nccwpck_require__(93210) -const outside = __nccwpck_require__(96789) -const gtr = __nccwpck_require__(89685) -const ltr = __nccwpck_require__(72549) -const intersects = __nccwpck_require__(64514) -const simplifyRange = __nccwpck_require__(90590) -const subset = __nccwpck_require__(48462) -module.exports = { - parse, - valid, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers, -} - - -/***/ }), - -/***/ 28487: -/***/ ((module) => { - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -const SEMVER_SPEC_VERSION = '2.0.0' - -const MAX_LENGTH = 256 -const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || -/* istanbul ignore next */ 9007199254740991 - -// Max safe segment length for coercion. -const MAX_SAFE_COMPONENT_LENGTH = 16 - -// Max safe length for a build identifier. The max length minus 6 characters for -// the shortest version with a build 0.0.0+BUILD. -const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 - -const RELEASE_TYPES = [ - 'major', - 'premajor', - 'minor', - 'preminor', - 'patch', - 'prepatch', - 'prerelease', -] - -module.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 0b001, - FLAG_LOOSE: 0b010, -} - - -/***/ }), - -/***/ 91308: -/***/ ((module) => { - -const debug = ( - typeof process === 'object' && - process.env && - process.env.NODE_DEBUG && - /\bsemver\b/i.test(process.env.NODE_DEBUG) -) ? (...args) => console.error('SEMVER', ...args) - : () => {} - -module.exports = debug - - -/***/ }), - -/***/ 28370: -/***/ ((module) => { - -const numeric = /^[0-9]+$/ -const compareIdentifiers = (a, b) => { - const anum = numeric.test(a) - const bnum = numeric.test(b) - - if (anum && bnum) { - a = +a - b = +b - } - - return a === b ? 0 - : (anum && !bnum) ? -1 - : (bnum && !anum) ? 1 - : a < b ? -1 - : 1 -} - -const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) - -module.exports = { - compareIdentifiers, - rcompareIdentifiers, -} - - -/***/ }), - -/***/ 88412: -/***/ ((module) => { - -class LRUCache { - constructor () { - this.max = 1000 - this.map = new Map() - } - - get (key) { - const value = this.map.get(key) - if (value === undefined) { - return undefined - } else { - // Remove the key from the map and add it to the end - this.map.delete(key) - this.map.set(key, value) - return value - } - } - - delete (key) { - return this.map.delete(key) - } - - set (key, value) { - const deleted = this.delete(key) - - if (!deleted && value !== undefined) { - // If cache is full, delete the least recently used item - if (this.map.size >= this.max) { - const firstKey = this.map.keys().next().value - this.delete(firstKey) - } - - this.map.set(key, value) - } - - return this - } -} - -module.exports = LRUCache - - -/***/ }), - -/***/ 84611: -/***/ ((module) => { - -// parse out just the options we care about -const looseOption = Object.freeze({ loose: true }) -const emptyOpts = Object.freeze({ }) -const parseOptions = options => { - if (!options) { - return emptyOpts - } - - if (typeof options !== 'object') { - return looseOption - } - - return options -} -module.exports = parseOptions - - -/***/ }), - -/***/ 57529: -/***/ ((module, exports, __nccwpck_require__) => { - -const { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH, -} = __nccwpck_require__(28487) -const debug = __nccwpck_require__(91308) -exports = module.exports = {} - -// The actual regexps go on exports.re -const re = exports.re = [] -const safeRe = exports.safeRe = [] -const src = exports.src = [] -const t = exports.t = {} -let R = 0 - -const LETTERDASHNUMBER = '[a-zA-Z0-9-]' - -// Replace some greedy regex tokens to prevent regex dos issues. These regex are -// used internally via the safeRe object since all inputs in this library get -// normalized first to trim and collapse all extra whitespace. The original -// regexes are exported for userland consumption and lower level usage. A -// future breaking change could export the safer regex only with a note that -// all input should have extra whitespace removed. -const safeRegexReplacements = [ - ['\\s', 1], - ['\\d', MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], -] - -const makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value - .split(`${token}*`).join(`${token}{0,${max}}`) - .split(`${token}+`).join(`${token}{1,${max}}`) - } - return value -} - -const createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value) - const index = R++ - debug(name, index, value) - t[name] = index - src[index] = value - re[index] = new RegExp(value, isGlobal ? 'g' : undefined) - safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) -} - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') -createToken('NUMERICIDENTIFIERLOOSE', '\\d+') - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) - -// ## Main Version -// Three dot-separated numeric identifiers. - -createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})\\.` + - `(${src[t.NUMERICIDENTIFIER]})`) - -createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + - `(${src[t.NUMERICIDENTIFIERLOOSE]})`) - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] -}|${src[t.NONNUMERICIDENTIFIER]})`) - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] -}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) - -createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] -}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] -}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -createToken('FULLPLAIN', `v?${src[t.MAINVERSION] -}${src[t.PRERELEASE]}?${ - src[t.BUILD]}?`) - -createToken('FULL', `^${src[t.FULLPLAIN]}$`) - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] -}${src[t.PRERELEASELOOSE]}?${ - src[t.BUILD]}?`) - -createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) - -createToken('GTLT', '((?:<|>)?=?)') - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) -createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) - -createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + - `(?:${src[t.PRERELEASE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + - `(?:${src[t.PRERELEASELOOSE]})?${ - src[t.BUILD]}?` + - `)?)?`) - -createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) -createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) - -// Coercion. -// Extract anything that could conceivably be a part of a valid semver -createToken('COERCEPLAIN', `${'(^|[^\\d])' + - '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + - `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`) -createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`) -createToken('COERCEFULL', src[t.COERCEPLAIN] + - `(?:${src[t.PRERELEASE]})?` + - `(?:${src[t.BUILD]})?` + - `(?:$|[^\\d])`) -createToken('COERCERTL', src[t.COERCE], true) -createToken('COERCERTLFULL', src[t.COERCEFULL], true) - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -createToken('LONETILDE', '(?:~>?)') - -createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) -exports.tildeTrimReplace = '$1~' - -createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) -createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -createToken('LONECARET', '(?:\\^)') - -createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) -exports.caretTrimReplace = '$1^' - -createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) -createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) -createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] -}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) -exports.comparatorTrimReplace = '$1$2$3' - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAIN]})` + - `\\s*$`) - -createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + - `\\s+-\\s+` + - `(${src[t.XRANGEPLAINLOOSE]})` + - `\\s*$`) - -// Star ranges basically just allow anything at all. -createToken('STAR', '(<|>)?=?\\s*\\*') -// >=0.0.0 is like a star -createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') -createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') - - -/***/ }), - -/***/ 89685: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// Determine if version is greater than all the versions possible in the range. -const outside = __nccwpck_require__(96789) -const gtr = (version, range, options) => outside(version, range, '>', options) -module.exports = gtr - - -/***/ }), - -/***/ 64514: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(32009) -const intersects = (r1, r2, options) => { - r1 = new Range(r1, options) - r2 = new Range(r2, options) - return r1.intersects(r2, options) -} -module.exports = intersects - - -/***/ }), - -/***/ 72549: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const outside = __nccwpck_require__(96789) -// Determine if version is less than all the versions possible in the range -const ltr = (version, range, options) => outside(version, range, '<', options) -module.exports = ltr - - -/***/ }), - -/***/ 79211: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const Range = __nccwpck_require__(32009) - -const maxSatisfying = (versions, range, options) => { - let max = null - let maxSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { - // compare(max, v, true) - max = v - maxSV = new SemVer(max, options) - } - } - }) - return max -} -module.exports = maxSatisfying - - -/***/ }), - -/***/ 78235: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const Range = __nccwpck_require__(32009) -const minSatisfying = (versions, range, options) => { - let min = null - let minSV = null - let rangeObj = null - try { - rangeObj = new Range(range, options) - } catch (er) { - return null - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { - // compare(min, v, true) - min = v - minSV = new SemVer(min, options) - } - } - }) - return min -} -module.exports = minSatisfying - - -/***/ }), - -/***/ 53373: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const Range = __nccwpck_require__(32009) -const gt = __nccwpck_require__(16565) - -const minVersion = (range, loose) => { - range = new Range(range, loose) - - let minver = new SemVer('0.0.0') - if (range.test(minver)) { - return minver - } - - minver = new SemVer('0.0.0-0') - if (range.test(minver)) { - return minver - } - - minver = null - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let setMin = null - comparators.forEach((comparator) => { - // Clone to avoid manipulating the comparator's semver object. - const compver = new SemVer(comparator.semver.version) - switch (comparator.operator) { - case '>': - if (compver.prerelease.length === 0) { - compver.patch++ - } else { - compver.prerelease.push(0) - } - compver.raw = compver.format() - /* fallthrough */ - case '': - case '>=': - if (!setMin || gt(compver, setMin)) { - setMin = compver - } - break - case '<': - case '<=': - /* Ignore maximum versions */ - break - /* istanbul ignore next */ - default: - throw new Error(`Unexpected operation: ${comparator.operator}`) - } - }) - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin - } - } - - if (minver && range.test(minver)) { - return minver - } - - return null -} -module.exports = minVersion - - -/***/ }), - -/***/ 96789: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const SemVer = __nccwpck_require__(11776) -const Comparator = __nccwpck_require__(20155) -const { ANY } = Comparator -const Range = __nccwpck_require__(32009) -const satisfies = __nccwpck_require__(7980) -const gt = __nccwpck_require__(16565) -const lt = __nccwpck_require__(93586) -const lte = __nccwpck_require__(34113) -const gte = __nccwpck_require__(93358) - -const outside = (version, range, hilo, options) => { - version = new SemVer(version, options) - range = new Range(range, options) - - let gtfn, ltefn, ltfn, comp, ecomp - switch (hilo) { - case '>': - gtfn = gt - ltefn = lte - ltfn = lt - comp = '>' - ecomp = '>=' - break - case '<': - gtfn = lt - ltefn = gte - ltfn = gt - comp = '<' - ecomp = '<=' - break - default: - throw new TypeError('Must provide a hilo val of "<" or ">"') - } - - // If it satisfies the range it is not outside - if (satisfies(version, range, options)) { - return false - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i] - - let high = null - let low = null - - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator - low = low || comparator - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator - } - }) - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false - } - } - return true -} - -module.exports = outside - - -/***/ }), - -/***/ 90590: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// given a set of versions and a range, create a "simplified" range -// that includes the same versions that the original range does -// If the original range is shorter than the simplified one, return that. -const satisfies = __nccwpck_require__(7980) -const compare = __nccwpck_require__(61020) -module.exports = (versions, range, options) => { - const set = [] - let first = null - let prev = null - const v = versions.sort((a, b) => compare(a, b, options)) - for (const version of v) { - const included = satisfies(version, range, options) - if (included) { - prev = version - if (!first) { - first = version - } - } else { - if (prev) { - set.push([first, prev]) - } - prev = null - first = null - } - } - if (first) { - set.push([first, null]) - } - - const ranges = [] - for (const [min, max] of set) { - if (min === max) { - ranges.push(min) - } else if (!max && min === v[0]) { - ranges.push('*') - } else if (!max) { - ranges.push(`>=${min}`) - } else if (min === v[0]) { - ranges.push(`<=${max}`) - } else { - ranges.push(`${min} - ${max}`) - } - } - const simplified = ranges.join(' || ') - const original = typeof range.raw === 'string' ? range.raw : String(range) - return simplified.length < original.length ? simplified : range -} - - -/***/ }), - -/***/ 48462: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(32009) -const Comparator = __nccwpck_require__(20155) -const { ANY } = Comparator -const satisfies = __nccwpck_require__(7980) -const compare = __nccwpck_require__(61020) - -// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: -// - Every simple range `r1, r2, ...` is a null set, OR -// - Every simple range `r1, r2, ...` which is not a null set is a subset of -// some `R1, R2, ...` -// -// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: -// - If c is only the ANY comparator -// - If C is only the ANY comparator, return true -// - Else if in prerelease mode, return false -// - else replace c with `[>=0.0.0]` -// - If C is only the ANY comparator -// - if in prerelease mode, return true -// - else replace C with `[>=0.0.0]` -// - Let EQ be the set of = comparators in c -// - If EQ is more than one, return true (null set) -// - Let GT be the highest > or >= comparator in c -// - Let LT be the lowest < or <= comparator in c -// - If GT and LT, and GT.semver > LT.semver, return true (null set) -// - If any C is a = range, and GT or LT are set, return false -// - If EQ -// - If GT, and EQ does not satisfy GT, return true (null set) -// - If LT, and EQ does not satisfy LT, return true (null set) -// - If EQ satisfies every C, return true -// - Else return false -// - If GT -// - If GT.semver is lower than any > or >= comp in C, return false -// - If GT is >=, and GT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the GT.semver tuple, return false -// - If LT -// - If LT.semver is greater than any < or <= comp in C, return false -// - If LT is <=, and LT.semver does not satisfy every C, return false -// - If GT.semver has a prerelease, and not in prerelease mode -// - If no C has a prerelease and the LT.semver tuple, return false -// - Else return true - -const subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true - } - - sub = new Range(sub, options) - dom = new Range(dom, options) - let sawNonNull = false - - OUTER: for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options) - sawNonNull = sawNonNull || isSub !== null - if (isSub) { - continue OUTER - } - } - // the null set is a subset of everything, but null simple ranges in - // a complex range should be ignored. so if we saw a non-null range, - // then we know this isn't a subset, but if EVERY simple range was null, - // then it is a subset. - if (sawNonNull) { - return false - } - } - return true -} - -const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] -const minimumVersion = [new Comparator('>=0.0.0')] - -const simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true - } - - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease - } else { - sub = minimumVersion - } - } - - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true - } else { - dom = minimumVersion - } - } - - const eqSet = new Set() - let gt, lt - for (const c of sub) { - if (c.operator === '>' || c.operator === '>=') { - gt = higherGT(gt, c, options) - } else if (c.operator === '<' || c.operator === '<=') { - lt = lowerLT(lt, c, options) - } else { - eqSet.add(c.semver) - } - } - - if (eqSet.size > 1) { - return null - } - - let gtltComp - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options) - if (gtltComp > 0) { - return null - } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { - return null - } - } - - // will iterate one or zero times - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null - } - - if (lt && !satisfies(eq, String(lt), options)) { - return null - } - - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false - } - } - - return true - } - - let higher, lower - let hasDomLT, hasDomGT - // if the subset has a prerelease, we need a comparator in the superset - // with the same tuple and a prerelease, or it's not a subset - let needDomLTPre = lt && - !options.includePrerelease && - lt.semver.prerelease.length ? lt.semver : false - let needDomGTPre = gt && - !options.includePrerelease && - gt.semver.prerelease.length ? gt.semver : false - // exception: <1.2.3-0 is the same as <1.2.3 - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && - lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false - } - - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' - hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomGTPre.major && - c.semver.minor === needDomGTPre.minor && - c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false - } - } - if (c.operator === '>' || c.operator === '>=') { - higher = higherGT(gt, c, options) - if (higher === c && higher !== gt) { - return false - } - } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { - return false - } - } - if (lt) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && - c.semver.major === needDomLTPre.major && - c.semver.minor === needDomLTPre.minor && - c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false - } - } - if (c.operator === '<' || c.operator === '<=') { - lower = lowerLT(lt, c, options) - if (lower === c && lower !== lt) { - return false - } - } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { - return false - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false - } - } - - // if there was a < or >, and nothing in the dom, then must be false - // UNLESS it was limited by another range in the other direction. - // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false - } - - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false - } - - // we needed a prerelease range in a specific tuple, but didn't get one - // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, - // because it includes prereleases in the 1.2.3 tuple - if (needDomGTPre || needDomLTPre) { - return false - } - - return true -} - -// >=1.2.3 is lower than >1.2.3 -const higherGT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp > 0 ? a - : comp < 0 ? b - : b.operator === '>' && a.operator === '>=' ? b - : a -} - -// <=1.2.3 is higher than <1.2.3 -const lowerLT = (a, b, options) => { - if (!a) { - return b - } - const comp = compare(a.semver, b.semver, options) - return comp < 0 ? a - : comp > 0 ? b - : b.operator === '<' && a.operator === '<=' ? b - : a -} - -module.exports = subset - - -/***/ }), - -/***/ 89918: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(32009) - -// Mostly just for testing and legacy API reasons -const toComparators = (range, options) => - new Range(range, options).set - .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) - -module.exports = toComparators - - -/***/ }), - -/***/ 93210: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -const Range = __nccwpck_require__(32009) -const validRange = (range, options) => { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, options).range || '*' - } catch (er) { - return null - } -} -module.exports = validRange - - /***/ }), /***/ 88563: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const dsn = __nccwpck_require__(32540); +const dsn = __nccwpck_require__(91582); -const SENTRY_API_VERSION = '7'; - -/** Returns the prefix to construct Sentry ingestion API endpoints. */ +const SENTRY_API_VERSION = "7"; function getBaseApiEndpoint(dsn) { - const protocol = dsn.protocol ? `${dsn.protocol}:` : ''; - const port = dsn.port ? `:${dsn.port}` : ''; - return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`; + const protocol = dsn.protocol ? `${dsn.protocol}:` : ""; + const port = dsn.port ? `:${dsn.port}` : ""; + return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ""}/api/`; } - -/** Returns the ingest API endpoint for target. */ function _getIngestEndpoint(dsn) { return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; } - -/** Returns a URL-encoded string with auth config suitable for a query string. */ function _encodedAuth(dsn, sdkInfo) { const params = { - sentry_version: SENTRY_API_VERSION, + sentry_version: SENTRY_API_VERSION }; - if (dsn.publicKey) { - // We send only the minimum set of required information. See - // https://github.com/getsentry/sentry-javascript/issues/2572. params.sentry_key = dsn.publicKey; } - if (sdkInfo) { params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`; } - return new URLSearchParams(params).toString(); } - -/** - * Returns the envelope endpoint URL with auth in the query string. - * - * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. - */ function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) { return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; } - -/** Returns the url to the report dialog endpoint. */ -function getReportDialogEndpoint( - dsnLike, - dialogOptions - -, -) { +function getReportDialogEndpoint(dsnLike, dialogOptions) { const dsn$1 = dsn.makeDsn(dsnLike); if (!dsn$1) { - return ''; + return ""; } - const endpoint = `${getBaseApiEndpoint(dsn$1)}embed/error-page/`; - let encodedOptions = `dsn=${dsn.dsnToString(dsn$1)}`; for (const key in dialogOptions) { - if (key === 'dsn') { + if (key === "dsn") { continue; } - - if (key === 'onClose') { + if (key === "onClose") { continue; } - - if (key === 'user') { + if (key === "user") { const user = dialogOptions.user; if (!user) { continue; @@ -65156,13 +19047,13 @@ function getReportDialogEndpoint( encodedOptions += `&email=${encodeURIComponent(user.email)}`; } } else { - encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`; + encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key])}`; } } - return `${endpoint}?${encodedOptions}`; } +exports.SENTRY_API_VERSION = SENTRY_API_VERSION; exports.getEnvelopeEndpointWithUrlEncodedAuth = getEnvelopeEndpointWithUrlEncodedAuth; exports.getReportDialogEndpoint = getReportDialogEndpoint; //# sourceMappingURL=api.js.map @@ -65173,35 +19064,21 @@ exports.getReportDialogEndpoint = getReportDialogEndpoint; /***/ 29878: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const carrier = __nccwpck_require__(38080); const stackStrategy = __nccwpck_require__(88484); -/** - * @private Private API with no semver guarantees! - * - * Sets the global async context strategy - */ function setAsyncContextStrategy(strategy) { - // Get main carrier (global for every environment) const registry = carrier.getMainCarrier(); const sentry = carrier.getSentryCarrier(registry); sentry.acs = strategy; } - -/** - * Get the current async context strategy. - * If none has been setup, the default will be used. - */ function getAsyncContextStrategy(carrier$1) { const sentry = carrier.getSentryCarrier(carrier$1); - if (sentry.acs) { return sentry.acs; } - - // Otherwise, use the default one (stack) return stackStrategy.getStackAsyncContextStrategy(); } @@ -65215,44 +19092,36 @@ exports.setAsyncContextStrategy = setAsyncContextStrategy; /***/ 88484: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const defaultScopes = __nccwpck_require__(80496); const scope = __nccwpck_require__(49417); -const is = __nccwpck_require__(84085); +const chainAndCopyPromiselike = __nccwpck_require__(8438); +const is = __nccwpck_require__(68370); const carrier = __nccwpck_require__(38080); -/** - * This is an object that holds a stack of scopes. - */ class AsyncContextStack { - - constructor(scope$1, isolationScope) { + constructor(scope$1, isolationScope) { let assignedScope; if (!scope$1) { assignedScope = new scope.Scope(); } else { assignedScope = scope$1; } - let assignedIsolationScope; if (!isolationScope) { assignedIsolationScope = new scope.Scope(); } else { assignedIsolationScope = isolationScope; } - - // scope stack for domains or the process this._stack = [{ scope: assignedScope }]; this._isolationScope = assignedIsolationScope; } - /** * Fork a scope for the stack. */ - withScope(callback) { + withScope(callback) { const scope = this._pushScope(); - let maybePromiseResult; try { maybePromiseResult = callback(scope); @@ -65260,107 +19129,79 @@ class AsyncContextStack { this._popScope(); throw e; } - if (is.isThenable(maybePromiseResult)) { - // @ts-expect-error - isThenable returns the wrong type - return maybePromiseResult.then( - res => { - this._popScope(); - return res; - }, - e => { - this._popScope(); - throw e; - }, + return chainAndCopyPromiselike.chainAndCopyPromiseLike( + maybePromiseResult, + () => this._popScope(), + () => this._popScope() ); } - this._popScope(); return maybePromiseResult; } - /** * Get the client of the stack. */ - getClient() { - return this.getStackTop().client ; + getClient() { + return this.getStackTop().client; } - /** * Returns the scope of the top stack. */ - getScope() { + getScope() { return this.getStackTop().scope; } - /** * Get the isolation scope for the stack. */ - getIsolationScope() { + getIsolationScope() { return this._isolationScope; } - /** * Returns the topmost scope layer in the order domain > local > process. */ - getStackTop() { - return this._stack[this._stack.length - 1] ; + getStackTop() { + return this._stack[this._stack.length - 1]; } - /** * Push a scope to the stack. */ - _pushScope() { - // We want to clone the content of prev scope + _pushScope() { const scope = this.getScope().clone(); this._stack.push({ client: this.getClient(), - scope, + scope }); return scope; } - /** * Pop a scope from the stack. */ - _popScope() { + _popScope() { if (this._stack.length <= 1) return false; return !!this._stack.pop(); } } - -/** - * Get the global async context stack. - * This will be removed during the v8 cycle and is only here to make migration easier. - */ function getAsyncContextStack() { const registry = carrier.getMainCarrier(); const sentry = carrier.getSentryCarrier(registry); - - return (sentry.stack = sentry.stack || new AsyncContextStack(defaultScopes.getDefaultCurrentScope(), defaultScopes.getDefaultIsolationScope())); + return sentry.stack = sentry.stack || new AsyncContextStack(defaultScopes.getDefaultCurrentScope(), defaultScopes.getDefaultIsolationScope()); } - function withScope(callback) { return getAsyncContextStack().withScope(callback); } - function withSetScope(scope, callback) { - const stack = getAsyncContextStack() ; + const stack = getAsyncContextStack(); return stack.withScope(() => { stack.getStackTop().scope = scope; return callback(scope); }); } - function withIsolationScope(callback) { return getAsyncContextStack().withScope(() => { return callback(getAsyncContextStack().getIsolationScope()); }); } - -/** - * Get the stack-based async context strategy. - */ function getStackAsyncContextStrategy() { return { withIsolationScope, @@ -65370,7 +19211,7 @@ function getStackAsyncContextStrategy() { return withIsolationScope(callback); }, getCurrentScope: () => getAsyncContextStack().getScope(), - getIsolationScope: () => getAsyncContextStack().getIsolationScope(), + getIsolationScope: () => getAsyncContextStack().getIsolationScope() }; } @@ -65381,460 +19222,716 @@ exports.getStackAsyncContextStrategy = getStackAsyncContextStrategy; /***/ }), -/***/ 95457: +/***/ 50098: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const carrier = __nccwpck_require__(38080); +const spanOnScope = __nccwpck_require__(14379); +const timer = __nccwpck_require__(85548); +const index = __nccwpck_require__(29878); + +function waitForTracingChannelBinding(callback, retries = 1) { + const binding = index.getAsyncContextStrategy(carrier.getMainCarrier()).getTracingChannelBinding?.(); + if (binding) { + callback(); + return; + } + if (!retries) { + return; + } + timer.safeUnref( + setTimeout(() => { + waitForTracingChannelBinding(callback, retries - 1); + }, 1) + ); +} +function _INTERNAL_createTracingChannelBinding(asyncLocalStorage, getScopes) { + return { + asyncLocalStorage, + getStoreWithActiveSpan: (span) => { + const { scope, isolationScope } = getScopes(); + const activeScope = scope.clone(); + spanOnScope._setSpanForScope(activeScope, span); + return { scope: activeScope, isolationScope }; + } + }; +} + +exports._INTERNAL_createTracingChannelBinding = _INTERNAL_createTracingChannelBinding; +exports.waitForTracingChannelBinding = waitForTracingChannelBinding; +//# sourceMappingURL=tracing-channel-binding.js.map + + +/***/ }), + +/***/ 26925: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const is = __nccwpck_require__(68370); + +function isAttributeObject(maybeObj) { + return typeof maybeObj === "object" && maybeObj != null && !Array.isArray(maybeObj) && Object.keys(maybeObj).includes("value"); +} +function attributeValueToTypedAttributeValue(rawValue, useFallback) { + const { value, unit } = isAttributeObject(rawValue) ? rawValue : { value: rawValue, unit: void 0 }; + const attributeValue = getTypedAttributeValue(value); + const checkedUnit = unit && typeof unit === "string" ? { unit } : {}; + if (attributeValue) { + return { ...attributeValue, ...checkedUnit }; + } + if (!useFallback || useFallback === "skip-undefined" && value === void 0) { + return; + } + let stringValue = ""; + try { + stringValue = JSON.stringify(value) ?? ""; + } catch { + } + return { + value: stringValue, + type: "string", + ...checkedUnit + }; +} +function serializeAttributes(attributes, fallback = false) { + const serializedAttributes = {}; + for (const [key, value] of Object.entries(attributes ?? {})) { + const typedValue = attributeValueToTypedAttributeValue(value, fallback); + if (typedValue) { + serializedAttributes[key] = typedValue; + } + } + return serializedAttributes; +} +function estimateTypedAttributesSizeInBytes(attributes) { + if (!attributes) { + return 0; + } + let weight = 0; + for (const [key, attr] of Object.entries(attributes)) { + weight += key.length * 2; + weight += attr.type.length * 2; + weight += (attr.unit?.length ?? 0) * 2; + const val = attr.value; + if (Array.isArray(val)) { + weight += estimatePrimitiveSizeInBytes(val[0]) * val.length; + } else if (is.isPrimitive(val)) { + weight += estimatePrimitiveSizeInBytes(val); + } else { + weight += 100; + } + } + return weight; +} +function estimatePrimitiveSizeInBytes(value) { + if (typeof value === "string") { + return value.length * 2; + } else if (typeof value === "boolean") { + return 4; + } else if (typeof value === "number") { + return 8; + } + return 0; +} +function getTypedAttributeValue(value) { + if (Array.isArray(value)) { + return { value, type: "array" }; + } + const primitiveType = typeof value === "string" ? "string" : typeof value === "boolean" ? "boolean" : typeof value === "number" && !Number.isNaN(value) ? Number.isInteger(value) ? "integer" : "double" : null; + if (primitiveType) { + return { value, type: primitiveType }; + } +} + +exports.attributeValueToTypedAttributeValue = attributeValueToTypedAttributeValue; +exports.estimateTypedAttributesSizeInBytes = estimateTypedAttributesSizeInBytes; +exports.isAttributeObject = isAttributeObject; +exports.serializeAttributes = serializeAttributes; +//# sourceMappingURL=attributes.js.map + + +/***/ }), + +/***/ 5608: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const debugLogger = __nccwpck_require__(41772); +const time = __nccwpck_require__(66690); + +const DEFAULT_BREADCRUMBS = 100; +function addBreadcrumb(breadcrumb, hint) { + const client = currentScopes.getClient(); + const isolationScope = currentScopes.getIsolationScope(); + if (!client) return; + const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions(); + if (maxBreadcrumbs <= 0) return; + const timestamp = time.dateTimestampInSeconds(); + const mergedBreadcrumb = { timestamp, ...breadcrumb }; + const finalBreadcrumb = beforeBreadcrumb ? debugLogger.consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) : mergedBreadcrumb; + if (finalBreadcrumb === null) return; + if (client.emit) { + client.emit("beforeAddBreadcrumb", finalBreadcrumb, hint); + } + isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); +} + +exports.addBreadcrumb = addBreadcrumb; +//# sourceMappingURL=breadcrumbs.js.map + + +/***/ }), + +/***/ 38080: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const version = __nccwpck_require__(71795); +const worldwide = __nccwpck_require__(90935); + +function getMainCarrier() { + getSentryCarrier(worldwide.GLOBAL_OBJ); + return worldwide.GLOBAL_OBJ; +} +function getSentryCarrier(carrier) { + const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {}; + __SENTRY__.version = __SENTRY__.version || version.SDK_VERSION; + return __SENTRY__[version.SDK_VERSION] = __SENTRY__[version.SDK_VERSION] || {}; +} +function getGlobalSingleton(name, creator, obj = worldwide.GLOBAL_OBJ) { + const __SENTRY__ = obj.__SENTRY__ = obj.__SENTRY__ || {}; + const carrier = __SENTRY__[version.SDK_VERSION] = __SENTRY__[version.SDK_VERSION] || {}; + return carrier[name] || (carrier[name] = creator()); +} + +exports.getGlobalSingleton = getGlobalSingleton; +exports.getMainCarrier = getMainCarrier; +exports.getSentryCarrier = getSentryCarrier; +//# sourceMappingURL=carrier.js.map + + +/***/ }), + +/***/ 54413: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const dsn = __nccwpck_require__(91582); +const envelope = __nccwpck_require__(56987); +const randomSafeContext = __nccwpck_require__(28695); + +function createCheckInEnvelope(checkIn, dynamicSamplingContext, metadata, tunnel, dsn$1) { + const headers = { + sent_at: new Date(randomSafeContext.safeDateNow()).toISOString() + }; + if (metadata?.sdk) { + headers.sdk = { + name: metadata.sdk.name, + version: metadata.sdk.version + }; + } + if (!!tunnel && !!dsn$1) { + headers.dsn = dsn.dsnToString(dsn$1); + } + if (dynamicSamplingContext) { + headers.trace = dynamicSamplingContext; + } + const item = createCheckInEnvelopeItem(checkIn); + return envelope.createEnvelope(headers, [item]); +} +function createCheckInEnvelopeItem(checkIn) { + const checkInHeaders = { + type: "check_in" + }; + return [checkInHeaders, checkIn]; +} + +exports.createCheckInEnvelope = createCheckInEnvelope; +//# sourceMappingURL=checkin.js.map + + +/***/ }), + +/***/ 36316: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const api = __nccwpck_require__(88563); +const constants = __nccwpck_require__(5958); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const envelope = __nccwpck_require__(58784); const integration = __nccwpck_require__(67428); +const internal = __nccwpck_require__(97113); +const internal$1 = __nccwpck_require__(48803); const session = __nccwpck_require__(60233); const dynamicSamplingContext = __nccwpck_require__(29724); -const clientreport = __nccwpck_require__(27962); -const dsn = __nccwpck_require__(32540); -const envelope$1 = __nccwpck_require__(72635); -const error = __nccwpck_require__(66322); -const is = __nccwpck_require__(84085); -const logger = __nccwpck_require__(38752); -const misc = __nccwpck_require__(3181); -const syncpromise = __nccwpck_require__(15621); +const beforeSendSpan = __nccwpck_require__(33579); +const extractGenAiSpans = __nccwpck_require__(21699); +const base = __nccwpck_require__(24899); +const clientreport = __nccwpck_require__(96472); +const debugLogger = __nccwpck_require__(41772); +const dsn = __nccwpck_require__(91582); +const envelope$1 = __nccwpck_require__(56987); +const eventUtils = __nccwpck_require__(26667); +const is = __nccwpck_require__(68370); +const merge = __nccwpck_require__(32003); +const misc = __nccwpck_require__(52619); const parseSampleRate = __nccwpck_require__(54078); const prepareEvent = __nccwpck_require__(22264); +const promisebuffer = __nccwpck_require__(80503); +const randomSafeContext = __nccwpck_require__(28695); +const shouldIgnoreSpan = __nccwpck_require__(65771); const spanUtils = __nccwpck_require__(47569); +const timer = __nccwpck_require__(85548); +const transactionEvent = __nccwpck_require__(72214); +const resolveDataCollectionOptions = __nccwpck_require__(49908); const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured."; - -/** - * Base implementation for all JavaScript SDK clients. - * - * Call the constructor with the corresponding options - * specific to the client subclass. To access these options later, use - * {@link Client.getOptions}. - * - * If a Dsn is specified in the options, it will be parsed and stored. Use - * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is - * invalid, the constructor will throw a {@link SentryException}. Note that - * without a valid Dsn, the SDK will not send any events to Sentry. - * - * Before sending an event, it is passed through - * {@link BaseClient._prepareEvent} to add SDK information and scope data - * (breadcrumbs and context). To add more custom information, override this - * method and extend the resulting prepared event. - * - * To issue automatically created events (e.g. via instrumentation), use - * {@link Client.captureEvent}. It will prepare the event and pass it through - * the callback lifecycle. To issue auto-breadcrumbs, use - * {@link Client.addBreadcrumb}. - * - * @example - * class NodeClient extends BaseClient { - * public constructor(options: NodeOptions) { - * super(options); - * } - * - * // ... - * } - */ -class BaseClient { - /** Options passed to the SDK. */ - - /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */ - - /** Array of set up integrations. */ - - /** Number of calls being processed */ - - /** Holds flushable */ - - // eslint-disable-next-line @typescript-eslint/ban-types - +const MISSING_RELEASE_FOR_SESSION_ERROR = "Discarded session because of missing or non-string release"; +const INTERNAL_ERROR_SYMBOL = /* @__PURE__ */ Symbol.for("SentryInternalError"); +const DO_NOT_SEND_EVENT_SYMBOL = /* @__PURE__ */ Symbol.for("SentryDoNotSendEventError"); +const DEFAULT_FLUSH_INTERVAL = 5e3; +function _makeInternalError(message) { + return { + message, + [INTERNAL_ERROR_SYMBOL]: true + }; +} +function _makeDoNotSendEventError(message) { + return { + message, + [DO_NOT_SEND_EVENT_SYMBOL]: true + }; +} +function _isInternalError(error) { + return is.isObjectLike(error) && INTERNAL_ERROR_SYMBOL in error; +} +function _isDoNotSendEventError(error) { + return is.isObjectLike(error) && DO_NOT_SEND_EVENT_SYMBOL in error; +} +function setupWeightBasedFlushing(client, afterCaptureHook, flushHook, estimateSizeFn, flushFn) { + let weight = 0; + let flushTimeout; + let isTimerActive = false; + client.on(flushHook, () => { + weight = 0; + clearTimeout(flushTimeout); + isTimerActive = false; + }); + client.on(afterCaptureHook, (item) => { + weight += estimateSizeFn(item); + if (weight >= 8e5) { + flushFn(client); + } else if (!isTimerActive) { + const flushInterval = client.getOptions()._flushInterval ?? DEFAULT_FLUSH_INTERVAL; + if (flushInterval > 0) { + isTimerActive = true; + flushTimeout = timer.safeUnref( + setTimeout(() => { + flushFn(client); + }, flushInterval) + ); + } + } + }); + client.on("flush", () => { + flushFn(client); + }); +} +class Client { /** * Initializes this client instance. * * @param options Options for the client. */ - constructor(options) { + constructor(options) { this._options = options; this._integrations = {}; this._numProcessing = 0; this._outcomes = {}; this._hooks = {}; this._eventProcessors = []; - + this._promiseBuffer = promisebuffer.makePromiseBuffer(options.transportOptions?.bufferSize ?? base.DEFAULT_TRANSPORT_BUFFER_SIZE); + this._dataCollection = resolveDataCollectionOptions.resolveDataCollectionOptions(options); if (options.dsn) { this._dsn = dsn.makeDsn(options.dsn); } else { - debugBuild.DEBUG_BUILD && logger.logger.warn('No DSN provided, client will not send events.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No DSN provided, client will not send events."); } - if (this._dsn) { const url = api.getEnvelopeEndpointWithUrlEncodedAuth( this._dsn, options.tunnel, - options._metadata ? options._metadata.sdk : undefined, + options._metadata ? options._metadata.sdk : void 0 ); this._transport = options.transport({ tunnel: this._options.tunnel, recordDroppedEvent: this.recordDroppedEvent.bind(this), ...options.transportOptions, - url, + url }); } - - // TODO(v9): Remove this deprecation warning - const tracingOptions = ['enableTracing', 'tracesSampleRate', 'tracesSampler'] ; - const undefinedOption = tracingOptions.find(option => option in options && options[option] == undefined); - if (undefinedOption) { - logger.consoleSandbox(() => { - // eslint-disable-next-line no-console - console.warn( - `[Sentry] Deprecation warning: \`${undefinedOption}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`, - ); - }); + this._options.enableLogs = this._options.enableLogs ?? this._options._experiments?.enableLogs ?? true; + if (this._options.enableLogs) { + setupWeightBasedFlushing(this, "afterCaptureLog", "flushLogs", estimateLogSizeInBytes, internal._INTERNAL_flushLogsBuffer); + } + const enableMetrics = this._options.enableMetrics ?? this._options._experiments?.enableMetrics ?? true; + if (enableMetrics) { + setupWeightBasedFlushing( + this, + "afterCaptureMetric", + "flushMetrics", + estimateMetricSizeInBytes, + internal$1._INTERNAL_flushMetricsBuffer + ); } } - /** - * @inheritDoc + * Captures an exception event and sends it to Sentry. + * + * Unlike `captureException` exported from every SDK, this method requires that you pass it the current scope. */ - captureException(exception, hint, scope) { + captureException(exception, hint, scope) { const eventId = misc.uuid4(); - - // ensure we haven't captured this very object before if (misc.checkOrSetAlreadyCaught(exception)) { - debugBuild.DEBUG_BUILD && logger.logger.log(ALREADY_SEEN_ERROR); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(ALREADY_SEEN_ERROR); return eventId; } - const hintWithEventId = { event_id: eventId, - ...hint, + ...hint }; - this._process( - this.eventFromException(exception, hintWithEventId).then(event => - this._captureEvent(event, hintWithEventId, scope), - ), + () => this.eventFromException(exception, hintWithEventId).then((event) => this._captureEvent(event, hintWithEventId, scope)).then((res) => res), + "error" ); - return hintWithEventId.event_id; } - /** - * @inheritDoc + * Captures a message event and sends it to Sentry. + * + * Unlike `captureMessage` exported from every SDK, this method requires that you pass it the current scope. */ - captureMessage( - message, - level, - hint, - currentScope, - ) { + captureMessage(message, level, hint, currentScope) { const hintWithEventId = { event_id: misc.uuid4(), - ...hint, + ...hint }; - const eventMessage = is.isParameterizedString(message) ? message : String(message); - - const promisedEvent = is.isPrimitive(message) - ? this.eventFromMessage(eventMessage, level, hintWithEventId) - : this.eventFromException(message, hintWithEventId); - - this._process(promisedEvent.then(event => this._captureEvent(event, hintWithEventId, currentScope))); - + const isMessage = is.isPrimitive(message); + const promisedEvent = isMessage ? this.eventFromMessage(eventMessage, level, hintWithEventId) : this.eventFromException(message, hintWithEventId); + this._process( + () => promisedEvent.then((event) => this._captureEvent(event, hintWithEventId, currentScope)), + isMessage ? "unknown" : "error" + ); return hintWithEventId.event_id; } - /** - * @inheritDoc + * Captures a manually created event and sends it to Sentry. + * + * Unlike `captureEvent` exported from every SDK, this method requires that you pass it the current scope. */ - captureEvent(event, hint, currentScope) { + captureEvent(event, hint, currentScope) { const eventId = misc.uuid4(); - - // ensure we haven't captured this very object before - if (hint && hint.originalException && misc.checkOrSetAlreadyCaught(hint.originalException)) { - debugBuild.DEBUG_BUILD && logger.logger.log(ALREADY_SEEN_ERROR); + if (hint?.originalException && misc.checkOrSetAlreadyCaught(hint.originalException)) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log(ALREADY_SEEN_ERROR); return eventId; } - const hintWithEventId = { event_id: eventId, - ...hint, + ...hint }; - const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope; - - this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope)); - + const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope; + const dataCategory = getDataCategoryByType(event.type); + this._process( + () => this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope, capturedSpanIsolationScope), + dataCategory + ); return hintWithEventId.event_id; } - /** - * @inheritDoc + * Captures a session. */ - captureSession(session$1) { - if (!(typeof session$1.release === 'string')) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Discarded session because of missing or non-string release'); - } else { - this.sendSession(session$1); - // After sending, we set init false to indicate it's not the first occurrence - session.updateSession(session$1, { init: false }); - } + captureSession(session$1) { + this.sendSession(session$1); + session.updateSession(session$1, { init: false }); } - /** - * @inheritDoc + * Get the current Dsn. */ - getDsn() { + getDsn() { return this._dsn; } - /** - * @inheritDoc + * Get the current options. */ - getOptions() { + getOptions() { return this._options; } - /** - * @see SdkMetadata - * - * @return The metadata of the SDK + * Get the resolved data collection configuration. */ - getSdkMetadata() { + getDataCollectionOptions() { + return this._dataCollection; + } + /** + * Get the SDK metadata. + * @see SdkMetadata + */ + getSdkMetadata() { return this._options._metadata; } - /** - * @inheritDoc + * Returns the transport that is used by the client. + * Please note that the transport gets lazy initialized so it will only be there once the first event has been sent. */ - getTransport() { + getTransport() { return this._transport; } - /** - * @inheritDoc + * Wait for all events to be sent or the timeout to expire, whichever comes first. + * + * @param timeout Maximum time in ms the client should wait for events to be flushed. Omitting this parameter will + * cause the client to wait until all events are sent before resolving the promise. + * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are + * still events in the queue when the timeout is reached. */ - flush(timeout) { + // @ts-expect-error - PromiseLike is a subset of Promise + async flush(timeout) { const transport = this._transport; - if (transport) { - this.emit('flush'); - return this._isClientDoneProcessing(timeout).then(clientFinished => { - return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed); - }); - } else { - return syncpromise.resolvedSyncPromise(true); + this.emit("flush"); + if (!transport) { + return true; } + const clientFinished = await this._isClientDoneProcessing(timeout); + const transportFlushed = await transport.flush(timeout); + return clientFinished && transportFlushed; } - /** - * @inheritDoc + * Flush the event queue and set the client to `enabled = false`. See {@link Client.flush}. + * + * @param {number} timeout Maximum time in ms the client should wait before shutting down. Omitting this parameter will cause + * the client to wait until all events are sent before disabling itself. + * @returns {Promise} A promise which resolves to `true` if the flush completes successfully before the timeout, or `false` if + * it doesn't. */ - close(timeout) { - return this.flush(timeout).then(result => { - this.getOptions().enabled = false; - this.emit('close'); - return result; - }); + // @ts-expect-error - PromiseLike is a subset of Promise + async close(timeout) { + const result = await this.flush(timeout); + this.getOptions().enabled = false; + this.emit("close"); + return result; } - - /** Get all installed event processors. */ - getEventProcessors() { + /** + * Get all installed event processors. + */ + getEventProcessors() { return this._eventProcessors; } - - /** @inheritDoc */ - addEventProcessor(eventProcessor) { + /** + * Adds an event processor that applies to any event processed by this client. + */ + addEventProcessor(eventProcessor) { this._eventProcessors.push(eventProcessor); } - - /** @inheritdoc */ - init() { - if ( - this._isEnabled() || - // Force integrations to be setup even if no DSN was set when we have - // Spotlight enabled. This is particularly important for browser as we - // don't support the `spotlight` option there and rely on the users - // adding the `spotlightBrowserIntegration()` to their integrations which - // wouldn't get initialized with the check below when there's no DSN set. - this._options.integrations.some(({ name }) => name.startsWith('Spotlight')) - ) { + /** + * Initialize this client. + * Call this after the client was set on a scope. + */ + init() { + if (this._isEnabled() || // Force integrations to be setup even if no DSN was set when we have + // Spotlight enabled. This is particularly important for browser as we + // don't support the `spotlight` option there and rely on the users + // adding the `spotlightBrowserIntegration()` to their integrations which + // wouldn't get initialized with the check below when there's no DSN set. + this._options.integrations.some(({ name }) => name.startsWith("Spotlight"))) { this._setupIntegrations(); } } - /** * Gets an installed integration by its name. * - * @returns The installed integration or `undefined` if no integration with that `name` was installed. + * @returns {Integration|undefined} The installed integration or `undefined` if no integration with that `name` was installed. */ - getIntegrationByName(integrationName) { - return this._integrations[integrationName] ; + getIntegrationByName(integrationName) { + return this._integrations[integrationName]; } - /** - * @inheritDoc + * Returns the names of all installed integrations. */ - addIntegration(integration$1) { + getIntegrationNames() { + return Object.keys(this._integrations); + } + /** + * Add an integration to the client. + * This can be used to e.g. lazy load integrations. + * In most cases, this should not be necessary, + * and you're better off just passing the integrations via `integrations: []` at initialization time. + * However, if you find the need to conditionally load & add an integration, you can use `addIntegration` to do so. + */ + addIntegration(integration$1) { const isAlreadyInstalled = this._integrations[integration$1.name]; - - // This hook takes care of only installing if not already installed + if (!isAlreadyInstalled && integration$1.beforeSetup) { + integration$1.beforeSetup(this); + } integration.setupIntegration(this, integration$1, this._integrations); - // Here we need to check manually to make sure to not run this multiple times if (!isAlreadyInstalled) { integration.afterSetupIntegrations(this, [integration$1]); } } - /** - * @inheritDoc + * Send a fully prepared event to Sentry. */ - sendEvent(event, hint = {}) { - this.emit('beforeSendEvent', event, hint); - + sendEvent(event, hint = {}) { + this.emit("beforeSendEvent", event, hint); + const genAiSpanItem = extractGenAiSpans.extractGenAiSpansFromEvent(event, this); let env = envelope.createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel); - for (const attachment of hint.attachments || []) { env = envelope$1.addItemToEnvelope(env, envelope$1.createAttachmentEnvelopeItem(attachment)); } - - const promise = this.sendEnvelope(env); - if (promise) { - promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null); + if (genAiSpanItem) { + env = envelope$1.addItemToEnvelope(env, genAiSpanItem); } + this.sendEnvelope(env).then((sendResponse) => this.emit("afterSendEvent", event, sendResponse)); } - /** - * @inheritDoc + * Send a session or session aggregrates to Sentry. */ - sendSession(session) { + sendSession(session) { + const { release: clientReleaseOption, environment: clientEnvironmentOption = constants.DEFAULT_ENVIRONMENT } = this._options; + if ("aggregates" in session) { + const sessionAttrs = session.attrs || {}; + if (!sessionAttrs.release && !clientReleaseOption) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn(MISSING_RELEASE_FOR_SESSION_ERROR); + return; + } + sessionAttrs.release = sessionAttrs.release || clientReleaseOption; + sessionAttrs.environment = sessionAttrs.environment || clientEnvironmentOption; + session.attrs = sessionAttrs; + } else { + if (!session.release && !clientReleaseOption) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn(MISSING_RELEASE_FOR_SESSION_ERROR); + return; + } + session.release = session.release || clientReleaseOption; + session.environment = session.environment || clientEnvironmentOption; + } + this.emit("beforeSendSession", session); const env = envelope.createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel); - - // sendEnvelope should not throw - // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendEnvelope(env); } - /** - * @inheritDoc + * Record on the client that an event got dropped (ie, an event that will not be sent to Sentry). */ - recordDroppedEvent(reason, category, eventOrCount) { + recordDroppedEvent(reason, category, count = 1) { if (this._options.sendClientReports) { - // TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload - // If event is passed as third argument, we assume this is a count of 1 - const count = typeof eventOrCount === 'number' ? eventOrCount : 1; - - // We want to track each category (error, transaction, session, replay_event) separately - // but still keep the distinction between different type of outcomes. - // We could use nested maps, but it's much easier to read and type this way. - // A correct type for map-based implementation if we want to go that route - // would be `Partial>>>` - // With typescript 4.1 we could even use template literal types const key = `${reason}:${category}`; - debugBuild.DEBUG_BUILD && logger.logger.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ''}`); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ""}`); this._outcomes[key] = (this._outcomes[key] || 0) + count; } } - - // Keep on() & emit() signatures in sync with types' client.ts interface - /* eslint-disable @typescript-eslint/unified-signatures */ - - /** @inheritdoc */ - - /** @inheritdoc */ - on(hook, callback) { - const hooks = (this._hooks[hook] = this._hooks[hook] || []); - - // @ts-expect-error We assume the types are correct - hooks.push(callback); - - // This function returns a callback execution handler that, when invoked, - // deregisters a callback. This is crucial for managing instances where callbacks - // need to be unregistered to prevent self-referencing in callback closures, - // ensuring proper garbage collection. + /** + * Register a hook on this client. + */ + on(hook, callback) { + const hookCallbacks = this._hooks[hook] = this._hooks[hook] || /* @__PURE__ */ new Set(); + const uniqueCallback = (...args) => callback(...args); + hookCallbacks.add(uniqueCallback); return () => { - // @ts-expect-error We assume the types are correct - const cbIndex = hooks.indexOf(callback); - if (cbIndex > -1) { - hooks.splice(cbIndex, 1); - } + hookCallbacks.delete(uniqueCallback); }; } - - /** @inheritdoc */ - - /** @inheritdoc */ - emit(hook, ...rest) { + /** + * Emit a hook that was previously registered via `on()`. + */ + emit(hook, ...rest) { const callbacks = this._hooks[hook]; if (callbacks) { - callbacks.forEach(callback => callback(...rest)); + callbacks.forEach((callback) => callback(...rest)); } } - /** - * @inheritdoc + * Send an envelope to Sentry. */ - sendEnvelope(envelope) { - this.emit('beforeEnvelope', envelope); - + // @ts-expect-error - PromiseLike is a subset of Promise + async sendEnvelope(envelope) { + this.emit("beforeEnvelope", envelope); if (this._isEnabled() && this._transport) { - return this._transport.send(envelope).then(null, reason => { - debugBuild.DEBUG_BUILD && logger.logger.error('Error while sending envelope:', reason); - return reason; - }); + try { + return await this._transport.send(envelope); + } catch (reason) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Error while sending envelope:", reason); + return {}; + } } - - debugBuild.DEBUG_BUILD && logger.logger.error('Transport disabled'); - - return syncpromise.resolvedSyncPromise({}); + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Transport disabled"); + return {}; + } + /** + * Register a cleanup function to be called when the client is disposed. + * This is useful for integrations that need to clean up global state. + * + * NOTE: This is a no-op in the base `Client` class. Subclasses like `ServerRuntimeClient` + * override this method to actually register and execute cleanup callbacks. + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + registerCleanup(callback) { + } + /** + * Disposes of the client and releases all resources. + * + * Subclasses should override this method to clean up their own resources, including invoking + * any callbacks registered via {@link Client.registerCleanup}. The base implementation is a + * no-op and does NOT execute registered cleanup callbacks. + * + * After calling dispose(), the client should not be used anymore. + */ + dispose() { } - /* eslint-enable @typescript-eslint/unified-signatures */ - /** Setup integrations for this client. */ - _setupIntegrations() { + _setupIntegrations() { const { integrations } = this._options; this._integrations = integration.setupIntegrations(this, integrations); integration.afterSetupIntegrations(this, integrations); } - /** Updates existing session based on the provided event */ - _updateSessionFromEvent(session$1, event) { - let crashed = event.level === 'fatal'; + _updateSessionFromEvent(session$1, event) { + let crashed = event.level === "fatal"; let errored = false; - const exceptions = event.exception && event.exception.values; - + const exceptions = event.exception?.values; if (exceptions) { errored = true; - + crashed = false; for (const ex of exceptions) { - const mechanism = ex.mechanism; - if (mechanism && mechanism.handled === false) { + if (ex.mechanism?.handled === false) { crashed = true; break; } } } - - // A session is updated and that session update is sent in only one of the two following scenarios: - // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update - // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update - const sessionNonTerminal = session$1.status === 'ok'; - const shouldUpdateAndSend = (sessionNonTerminal && session$1.errors === 0) || (sessionNonTerminal && crashed); - + const sessionNonTerminal = session$1.status === "ok"; + const shouldUpdateAndSend = sessionNonTerminal && session$1.errors === 0 || sessionNonTerminal && crashed; if (shouldUpdateAndSend) { session.updateSession(session$1, { - ...(crashed && { status: 'crashed' }), - errors: session$1.errors || Number(errored || crashed), + ...crashed && { status: "crashed" }, + errors: session$1.errors || Number(errored || crashed) }); this.captureSession(session$1); } } - /** * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying * "no" (resolving to `false`) in order to give the client a chance to potentially finish first. @@ -65845,31 +19942,21 @@ class BaseClient { * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and * `false` otherwise */ - _isClientDoneProcessing(timeout) { - return new syncpromise.SyncPromise(resolve => { - let ticked = 0; - const tick = 1; - - const interval = setInterval(() => { - if (this._numProcessing == 0) { - clearInterval(interval); - resolve(true); - } else { - ticked += tick; - if (timeout && ticked >= timeout) { - clearInterval(interval); - resolve(false); - } - } - }, tick); - }); + async _isClientDoneProcessing(timeout) { + let ticked = 0; + while (!timeout || ticked < timeout) { + await new Promise((resolve) => setTimeout(resolve, 1)); + if (!this._numProcessing) { + return true; + } + ticked++; + } + return false; } - /** Determines whether this SDK is enabled and a transport is present. */ - _isEnabled() { - return this.getOptions().enabled !== false && this._transport !== undefined; + _isEnabled() { + return this.getOptions().enabled !== false && this._transport !== void 0; } - /** * Adds common information to events. * @@ -65884,71 +19971,61 @@ class BaseClient { * @param currentScope A scope containing event metadata. * @returns A new event with more information. */ - _prepareEvent( - event, - hint, - currentScope = currentScopes.getCurrentScope(), - isolationScope = currentScopes.getIsolationScope(), - ) { + _prepareEvent(event, hint, currentScope, isolationScope) { const options = this.getOptions(); - const integrations = Object.keys(this._integrations); - if (!hint.integrations && integrations.length > 0) { + const integrations = this.getIntegrationNames(); + if (!hint.integrations && integrations.length) { hint.integrations = integrations; } - - this.emit('preprocessEvent', event, hint); - + this.emit("preprocessEvent", event, hint); if (!event.type) { isolationScope.setLastEventId(event.event_id || hint.event_id); } - - return prepareEvent.prepareEvent(options, event, hint, currentScope, this, isolationScope).then(evt => { + return prepareEvent.prepareEvent(options, event, hint, currentScope, this, isolationScope).then((evt) => { if (evt === null) { return evt; } - + this.emit("postprocessEvent", evt, hint); evt.contexts = { - trace: currentScopes.getTraceContextFromScope(currentScope), - ...evt.contexts, + trace: { ...evt.contexts?.trace, ...currentScopes.getTraceContextFromScope(currentScope) }, + ...evt.contexts }; - const dynamicSamplingContext$1 = dynamicSamplingContext.getDynamicSamplingContextFromScope(this, currentScope); - evt.sdkProcessingMetadata = { dynamicSamplingContext: dynamicSamplingContext$1, - ...evt.sdkProcessingMetadata, + ...evt.sdkProcessingMetadata }; - return evt; }); } - /** * Processes the event and logs an error in case of rejection * @param event * @param hint * @param scope */ - _captureEvent(event, hint = {}, scope) { - return this._processEvent(event, hint, scope).then( - finalEvent => { + _captureEvent(event, hint = {}, currentScope = currentScopes.getCurrentScope(), isolationScope = currentScopes.getIsolationScope()) { + if (debugBuild.DEBUG_BUILD && isErrorEvent(event)) { + debugLogger.debug.log(`Captured error event \`${eventUtils.getPossibleEventMessages(event)[0] || ""}\``); + } + return this._processEvent(event, hint, currentScope, isolationScope).then( + (finalEvent) => { return finalEvent.event_id; }, - reason => { + (reason) => { if (debugBuild.DEBUG_BUILD) { - // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for - // control flow, log just the message (no stack) as a log-level log. - if (reason instanceof error.SentryError && reason.logLevel === 'log') { - logger.logger.log(reason.message); + if (_isDoNotSendEventError(reason)) { + debugLogger.debug.log(reason.message); + } else if (_isInternalError(reason)) { + debugLogger.debug.warn(reason.message); } else { - logger.logger.warn(reason); + debugLogger.debug.warn(reason); } } - return undefined; - }, + return void 0; + } ); } - /** * Processes an event (either error or message) and sends it to Sentry. * @@ -65962,412 +20039,273 @@ class BaseClient { * @param currentScope A scope containing event metadata. * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. */ - _processEvent(event, hint, currentScope) { + _processEvent(event, hint, currentScope, isolationScope) { const options = this.getOptions(); const { sampleRate } = options; - const isTransaction = isTransactionEvent(event); const isError = isErrorEvent(event); - const eventType = event.type || 'error'; + const eventType = event.type || "error"; const beforeSendLabel = `before send for type \`${eventType}\``; - - // 1.0 === 100% events are sent - // 0.0 === 0% events are sent - // Sampling for transaction happens somewhere else - const parsedSampleRate = typeof sampleRate === 'undefined' ? undefined : parseSampleRate.parseSampleRate(sampleRate); - if (isError && typeof parsedSampleRate === 'number' && Math.random() > parsedSampleRate) { - this.recordDroppedEvent('sample_rate', 'error', event); - return syncpromise.rejectedSyncPromise( - new error.SentryError( - `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`, - 'log', - ), - ); - } - - const dataCategory = eventType === 'replay_event' ? 'replay' : eventType; - - const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; - const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope; - - return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope) - .then(prepared => { - if (prepared === null) { - this.recordDroppedEvent('event_processor', dataCategory, event); - throw new error.SentryError('An event processor returned `null`, will not send event.', 'log'); - } - - const isInternalException = hint.data && (hint.data ).__sentry__ === true; - if (isInternalException) { - return prepared; - } - - const result = processBeforeSend(this, options, prepared, hint); - return _validateBeforeSendResult(result, beforeSendLabel); - }) - .then(processedEvent => { - if (processedEvent === null) { - this.recordDroppedEvent('before_send', dataCategory, event); - if (isTransaction) { - const spans = event.spans || []; - // the transaction itself counts as one span, plus all the child spans that are added - const spanCount = 1 + spans.length; - this.recordDroppedEvent('before_send', 'span', spanCount); - } - throw new error.SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log'); - } - - const session = currentScope && currentScope.getSession(); - if (!isTransaction && session) { - this._updateSessionFromEvent(session, processedEvent); - } - + const parsedSampleRate = typeof sampleRate === "undefined" ? void 0 : parseSampleRate.parseSampleRate(sampleRate); + const dataCategory = getDataCategoryByType(event.type); + return this._prepareEvent(event, hint, currentScope, isolationScope).then((prepared) => { + if (prepared === null) { + this.recordDroppedEvent("event_processor", dataCategory); + throw _makeDoNotSendEventError("An event processor returned `null`, will not send event."); + } + const isInternalException = hint.data?.__sentry__ === true; + if (isInternalException) { + return prepared; + } + const result = processBeforeSend(this, options, prepared, hint); + return _validateBeforeSendResult(result, beforeSendLabel); + }).then((processedEvent) => { + if (processedEvent === null) { + this.recordDroppedEvent("before_send", dataCategory); if (isTransaction) { - const spanCountBefore = - (processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) || - 0; - const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; - - const droppedSpanCount = spanCountBefore - spanCountAfter; - if (droppedSpanCount > 0) { - this.recordDroppedEvent('before_send', 'span', droppedSpanCount); - } + const spans = event.spans || []; + const spanCount = 1 + spans.length; + this.recordDroppedEvent("before_send", "span", spanCount); } - - // None of the Sentry built event processor will update transaction name, - // so if the transaction name has been changed by an event processor, we know - // it has to come from custom event processor added by a user - const transactionInfo = processedEvent.transaction_info; - if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { - const source = 'custom'; - processedEvent.transaction_info = { - ...transactionInfo, - source, - }; - } - - this.sendEvent(processedEvent, hint); - return processedEvent; - }) - .then(null, reason => { - if (reason instanceof error.SentryError) { - throw reason; - } - - this.captureException(reason, { - data: { - __sentry__: true, - }, - originalException: reason, - }); - throw new error.SentryError( - `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`, + throw _makeDoNotSendEventError(`${beforeSendLabel} returned \`null\`, will not send event.`); + } + const session = currentScope.getSession() || isolationScope.getSession(); + if (isError && session) { + this._updateSessionFromEvent(session, processedEvent); + } + if (isError && typeof parsedSampleRate === "number" && randomSafeContext.safeMathRandom() > parsedSampleRate) { + this.recordDroppedEvent("sample_rate", "error"); + throw _makeDoNotSendEventError( + `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})` ); + } + if (isTransaction) { + const spanCountBefore = processedEvent.sdkProcessingMetadata?.spanCountBeforeProcessing || 0; + const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; + const droppedSpanCount = spanCountBefore - spanCountAfter; + if (droppedSpanCount > 0) { + this.recordDroppedEvent("before_send", "span", droppedSpanCount); + } + } + const transactionInfo = processedEvent.transaction_info; + if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) { + const source = "custom"; + processedEvent.transaction_info = { + ...transactionInfo, + source + }; + } + this.sendEvent(processedEvent, hint); + return processedEvent; + }).then(null, (reason) => { + if (_isDoNotSendEventError(reason) || _isInternalError(reason)) { + throw reason; + } + this.captureException(reason, { + mechanism: { + handled: false, + type: "internal" + }, + data: { + __sentry__: true + }, + originalException: reason }); + throw _makeInternalError( + `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. +Reason: ${reason}` + ); + }); } - /** * Occupies the client with processing and event */ - _process(promise) { + _process(taskProducer, dataCategory) { this._numProcessing++; - void promise.then( - value => { + void this._promiseBuffer.add(taskProducer).then( + (value) => { this._numProcessing--; return value; }, - reason => { + (reason) => { this._numProcessing--; + if (reason === promisebuffer.SENTRY_BUFFER_FULL_ERROR) { + this.recordDroppedEvent("queue_overflow", dataCategory); + } return reason; - }, + } ); } - /** * Clears outcomes on this client and returns them. */ - _clearOutcomes() { + _clearOutcomes() { const outcomes = this._outcomes; this._outcomes = {}; return Object.entries(outcomes).map(([key, quantity]) => { - const [reason, category] = key.split(':') ; + const [reason, category] = key.split(":"); return { reason, category, - quantity, + quantity }; }); } - /** * Sends client reports as an envelope. */ - _flushOutcomes() { - debugBuild.DEBUG_BUILD && logger.logger.log('Flushing outcomes...'); - + _flushOutcomes() { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Flushing outcomes..."); const outcomes = this._clearOutcomes(); - if (outcomes.length === 0) { - debugBuild.DEBUG_BUILD && logger.logger.log('No outcomes to send'); + debugBuild.DEBUG_BUILD && debugLogger.debug.log("No outcomes to send"); return; } - - // This is really the only place where we want to check for a DSN and only send outcomes then if (!this._dsn) { - debugBuild.DEBUG_BUILD && logger.logger.log('No dsn provided, will not send outcomes'); + debugBuild.DEBUG_BUILD && debugLogger.debug.log("No dsn provided, will not send outcomes"); return; } - - debugBuild.DEBUG_BUILD && logger.logger.log('Sending outcomes:', outcomes); - + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Sending outcomes:", outcomes); const envelope = clientreport.createClientReportEnvelope(outcomes, this._options.tunnel && dsn.dsnToString(this._dsn)); - - // sendEnvelope should not throw - // eslint-disable-next-line @typescript-eslint/no-floating-promises this.sendEnvelope(envelope); } - - /** - * @inheritDoc - */ - } - -/** - * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so. - */ -function _validateBeforeSendResult( - beforeSendResult, - beforeSendLabel, -) { +function getDataCategoryByType(type) { + return type === "replay_event" ? "replay" : type || "error"; +} +function _validateBeforeSendResult(beforeSendResult, beforeSendLabel) { const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`; if (is.isThenable(beforeSendResult)) { return beforeSendResult.then( - event => { + (event) => { if (!is.isPlainObject(event) && event !== null) { - throw new error.SentryError(invalidValueError); + throw _makeInternalError(invalidValueError); } return event; }, - e => { - throw new error.SentryError(`${beforeSendLabel} rejected with ${e}`); - }, + (e) => { + throw _makeInternalError(`${beforeSendLabel} rejected with ${e}`); + } ); } else if (!is.isPlainObject(beforeSendResult) && beforeSendResult !== null) { - throw new error.SentryError(invalidValueError); + throw _makeInternalError(invalidValueError); } return beforeSendResult; } - -/** - * Process the matching `beforeSendXXX` callback. - */ -function processBeforeSend( - client, - options, - event, - hint, -) { - const { beforeSend, beforeSendTransaction, beforeSendSpan } = options; - - if (isErrorEvent(event) && beforeSend) { - return beforeSend(event, hint); +function processBeforeSend(client, options, event, hint) { + const { beforeSend, beforeSendTransaction, ignoreSpans } = options; + const beforeSendSpan$1 = !beforeSendSpan.isStreamedBeforeSendSpanCallback(options.beforeSendSpan) && options.beforeSendSpan; + let processedEvent = event; + if (isErrorEvent(processedEvent) && beforeSend) { + return beforeSend(processedEvent, hint); } - - if (isTransactionEvent(event)) { - if (event.spans && beforeSendSpan) { - const processedSpans = []; - for (const span of event.spans) { - const processedSpan = beforeSendSpan(span); - if (processedSpan) { - processedSpans.push(processedSpan); - } else { + if (isTransactionEvent(processedEvent)) { + if (beforeSendSpan$1 || ignoreSpans) { + const rootSpanJson = transactionEvent.convertTransactionEventToSpanJson(processedEvent); + if (ignoreSpans?.length && shouldIgnoreSpan.shouldIgnoreSpan( + { description: rootSpanJson.description, op: rootSpanJson.op, attributes: rootSpanJson.data }, + ignoreSpans + )) { + return null; + } + if (beforeSendSpan$1) { + const processedRootSpanJson = beforeSendSpan$1(rootSpanJson); + if (!processedRootSpanJson) { spanUtils.showSpanDropWarning(); - client.recordDroppedEvent('before_send', 'span'); + } else { + processedEvent = merge.merge(event, transactionEvent.convertSpanJsonToTransactionEvent(processedRootSpanJson)); } } - event.spans = processedSpans; + if (processedEvent.spans) { + const processedSpans = []; + const initialSpans = processedEvent.spans; + for (const span of initialSpans) { + if (ignoreSpans?.length && shouldIgnoreSpan.shouldIgnoreSpan({ description: span.description, op: span.op, attributes: span.data }, ignoreSpans)) { + shouldIgnoreSpan.reparentChildSpans(initialSpans, span); + continue; + } + if (beforeSendSpan$1) { + const processedSpan = beforeSendSpan$1(span); + if (!processedSpan) { + spanUtils.showSpanDropWarning(); + processedSpans.push(span); + } else { + processedSpans.push(processedSpan); + } + } else { + processedSpans.push(span); + } + } + const droppedSpans = processedEvent.spans.length - processedSpans.length; + if (droppedSpans) { + client.recordDroppedEvent("before_send", "span", droppedSpans); + } + processedEvent.spans = processedSpans; + } } - if (beforeSendTransaction) { - if (event.spans) { - // We store the # of spans before processing in SDK metadata, - // so we can compare it afterwards to determine how many spans were dropped - const spanCountBefore = event.spans.length; - event.sdkProcessingMetadata = { + if (processedEvent.spans) { + const spanCountBefore = processedEvent.spans.length; + processedEvent.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, - spanCountBeforeProcessing: spanCountBefore, + spanCountBeforeProcessing: spanCountBefore }; } - return beforeSendTransaction(event, hint); + return beforeSendTransaction(processedEvent, hint); } } - - return event; + return processedEvent; } - function isErrorEvent(event) { - return event.type === undefined; + return event.type === void 0; } - function isTransactionEvent(event) { - return event.type === 'transaction'; + return event.type === "transaction"; } - -exports.BaseClient = BaseClient; -//# sourceMappingURL=baseclient.js.map - - -/***/ }), - -/***/ 5608: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const currentScopes = __nccwpck_require__(8131); -const logger = __nccwpck_require__(38752); -const time = __nccwpck_require__(75872); - -/** - * Default maximum number of breadcrumbs added to an event. Can be overwritten - * with {@link Options.maxBreadcrumbs}. - */ -const DEFAULT_BREADCRUMBS = 100; - -/** - * Records a new breadcrumb which will be attached to future events. - * - * Breadcrumbs will be added to subsequent events to provide more context on - * user's actions prior to an error or crash. - */ -function addBreadcrumb(breadcrumb, hint) { - const client = currentScopes.getClient(); - const isolationScope = currentScopes.getIsolationScope(); - - if (!client) return; - - const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions(); - - if (maxBreadcrumbs <= 0) return; - - const timestamp = time.dateTimestampInSeconds(); - const mergedBreadcrumb = { timestamp, ...breadcrumb }; - const finalBreadcrumb = beforeBreadcrumb - ? (logger.consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) ) - : mergedBreadcrumb; - - if (finalBreadcrumb === null) return; - - if (client.emit) { - client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint); +function estimateMetricSizeInBytes(metric) { + let weight = 0; + if (metric.name) { + weight += metric.name.length * 2; } - - isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs); + weight += 8; + return weight + estimateAttributesSizeInBytes(metric.attributes); } - -exports.addBreadcrumb = addBreadcrumb; -//# sourceMappingURL=breadcrumbs.js.map - - -/***/ }), - -/***/ 38080: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const version = __nccwpck_require__(17370); -const worldwide = __nccwpck_require__(10891); - -/** - * An object that contains globally accessible properties and maintains a scope stack. - * @hidden - */ - -/** - * Returns the global shim registry. - * - * FIXME: This function is problematic, because despite always returning a valid Carrier, - * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check - * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there. - **/ -function getMainCarrier() { - // This ensures a Sentry carrier exists - getSentryCarrier(worldwide.GLOBAL_OBJ); - return worldwide.GLOBAL_OBJ; -} - -/** Will either get the existing sentry carrier, or create a new one. */ -function getSentryCarrier(carrier) { - const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {}); - - // For now: First SDK that sets the .version property wins - __SENTRY__.version = __SENTRY__.version || version.SDK_VERSION; - - // Intentionally populating and returning the version of "this" SDK instance - // rather than what's set in .version so that "this" SDK always gets its carrier - return (__SENTRY__[version.SDK_VERSION] = __SENTRY__[version.SDK_VERSION] || {}); -} - -exports.getMainCarrier = getMainCarrier; -exports.getSentryCarrier = getSentryCarrier; -//# sourceMappingURL=carrier.js.map - - -/***/ }), - -/***/ 54413: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const dsn = __nccwpck_require__(32540); -const envelope = __nccwpck_require__(72635); -const object = __nccwpck_require__(16100); - -/** - * Create envelope from check in item. - */ -function createCheckInEnvelope( - checkIn, - dynamicSamplingContext, - metadata, - tunnel, - dsn$1, -) { - const headers = { - sent_at: new Date().toISOString(), - }; - - if (metadata && metadata.sdk) { - headers.sdk = { - name: metadata.sdk.name, - version: metadata.sdk.version, - }; +function estimateLogSizeInBytes(log) { + let weight = 0; + if (log.message) { + weight += log.message.length * 2; } - - if (!!tunnel && !!dsn$1) { - headers.dsn = dsn.dsnToString(dsn$1); + return weight + estimateAttributesSizeInBytes(log.attributes); +} +function estimateAttributesSizeInBytes(attributes) { + if (!attributes) { + return 0; } - - if (dynamicSamplingContext) { - headers.trace = object.dropUndefinedKeys(dynamicSamplingContext) ; + let weight = 0; + Object.values(attributes).forEach((value) => { + if (Array.isArray(value)) { + weight += value.length * estimatePrimitiveSizeInBytes(value[0]); + } else if (is.isPrimitive(value)) { + weight += estimatePrimitiveSizeInBytes(value); + } else { + weight += 100; + } + }); + return weight; +} +function estimatePrimitiveSizeInBytes(value) { + if (typeof value === "string") { + return value.length * 2; + } else if (typeof value === "number") { + return 8; + } else if (typeof value === "boolean") { + return 4; } - - const item = createCheckInEnvelopeItem(checkIn); - return envelope.createEnvelope(headers, [item]); + return 0; } -function createCheckInEnvelopeItem(checkIn) { - const checkInHeaders = { - type: 'check_in', - }; - return [checkInHeaders, checkIn]; -} - -exports.createCheckInEnvelope = createCheckInEnvelope; -//# sourceMappingURL=checkin.js.map +exports.Client = Client; +//# sourceMappingURL=client.js.map /***/ }), @@ -66375,11 +20313,13 @@ exports.createCheckInEnvelope = createCheckInEnvelope; /***/ 5958: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const DEFAULT_ENVIRONMENT = 'production'; +const DEFAULT_ENVIRONMENT = "production"; +const DEV_ENVIRONMENT = "development"; exports.DEFAULT_ENVIRONMENT = DEFAULT_ENVIRONMENT; +exports.DEV_ENVIRONMENT = DEV_ENVIRONMENT; //# sourceMappingURL=constants.js.map @@ -66388,136 +20328,88 @@ exports.DEFAULT_ENVIRONMENT = DEFAULT_ENVIRONMENT; /***/ 8131: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const index = __nccwpck_require__(29878); const carrier = __nccwpck_require__(38080); const scope = __nccwpck_require__(49417); -const object = __nccwpck_require__(16100); -const worldwide = __nccwpck_require__(10891); +const propagationContext = __nccwpck_require__(95102); -/** - * Get the currently active scope. - */ +let _externalPropagationContextProvider; +function registerExternalPropagationContext(fn) { + _externalPropagationContextProvider = fn; +} +function getExternalPropagationContext() { + return _externalPropagationContextProvider?.(); +} +function hasExternalPropagationContext() { + return _externalPropagationContextProvider !== void 0; +} function getCurrentScope() { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); return acs.getCurrentScope(); } - -/** - * Get the currently active isolation scope. - * The isolation scope is active for the current execution context. - */ function getIsolationScope() { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); return acs.getIsolationScope(); } - -/** - * Get the global scope. - * This scope is applied to _all_ events. - */ function getGlobalScope() { - return worldwide.getGlobalSingleton('globalScope', () => new scope.Scope()); + return carrier.getGlobalSingleton("globalScope", () => new scope.Scope()); } - -/** - * Creates a new scope with and executes the given operation within. - * The scope is automatically removed once the operation - * finishes or throws. - */ - -/** - * Either creates a new active scope, or sets the given scope as active scope in the given callback. - */ -function withScope( - ...rest -) { +function withScope(...rest) { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); - - // If a scope is defined, we want to make this the active scope instead of the default one if (rest.length === 2) { const [scope, callback] = rest; - if (!scope) { return acs.withScope(callback); } - return acs.withSetScope(scope, callback); } - return acs.withScope(rest[0]); } - -/** - * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no - * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the - * case, for example, in the browser). - * - * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour. - * - * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in "normal" - * applications directly because it comes with pitfalls. Use at your own risk! - */ - -/** - * Either creates a new active isolation scope, or sets the given isolation scope as active scope in the given callback. - */ -function withIsolationScope( - ...rest - -) { +function withIsolationScope(...rest) { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); - - // If a scope is defined, we want to make this the active scope instead of the default one if (rest.length === 2) { const [isolationScope, callback] = rest; - if (!isolationScope) { return acs.withIsolationScope(callback); } - return acs.withSetIsolationScope(isolationScope, callback); } - return acs.withIsolationScope(rest[0]); } - -/** - * Get the currently active client. - */ function getClient() { return getCurrentScope().getClient(); } - -/** - * Get a trace context for the given scope. - */ function getTraceContextFromScope(scope) { - const propagationContext = scope.getPropagationContext(); - - // TODO(v9): Use generateSpanId() instead of spanId - // eslint-disable-next-line deprecation/deprecation - const { traceId, spanId, parentSpanId } = propagationContext; - - const traceContext = object.dropUndefinedKeys({ + const externalContext = getExternalPropagationContext(); + if (externalContext) { + return { trace_id: externalContext.traceId, span_id: externalContext.spanId }; + } + const propagationContext$1 = scope.getPropagationContext(); + const { traceId, parentSpanId, propagationSpanId } = propagationContext$1; + const traceContext = { trace_id: traceId, - span_id: spanId, - parent_span_id: parentSpanId, - }); - + span_id: propagationSpanId || propagationContext.generateSpanId() + }; + if (parentSpanId) { + traceContext.parent_span_id = parentSpanId; + } return traceContext; } exports.getClient = getClient; exports.getCurrentScope = getCurrentScope; +exports.getExternalPropagationContext = getExternalPropagationContext; exports.getGlobalScope = getGlobalScope; exports.getIsolationScope = getIsolationScope; exports.getTraceContextFromScope = getTraceContextFromScope; +exports.hasExternalPropagationContext = hasExternalPropagationContext; +exports.registerExternalPropagationContext = registerExternalPropagationContext; exports.withIsolationScope = withIsolationScope; exports.withScope = withScope; //# sourceMappingURL=currentScopes.js.map @@ -66528,13 +20420,8 @@ exports.withScope = withScope; /***/ 14488: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** - * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. - * - * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. - */ const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); exports.DEBUG_BUILD = DEBUG_BUILD; @@ -66546,19 +20433,16 @@ exports.DEBUG_BUILD = DEBUG_BUILD; /***/ 80496: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const carrier = __nccwpck_require__(38080); const scope = __nccwpck_require__(49417); -const worldwide = __nccwpck_require__(10891); -/** Get the default current scope. */ function getDefaultCurrentScope() { - return worldwide.getGlobalSingleton('defaultCurrentScope', () => new scope.Scope()); + return carrier.getGlobalSingleton("defaultCurrentScope", () => new scope.Scope()); } - -/** Get the default isolation scope. */ function getDefaultIsolationScope() { - return worldwide.getGlobalSingleton('defaultIsolationScope', () => new scope.Scope()); + return carrier.getGlobalSingleton("defaultIsolationScope", () => new scope.Scope()); } exports.getDefaultCurrentScope = getDefaultCurrentScope; @@ -66571,131 +20455,94 @@ exports.getDefaultIsolationScope = getDefaultIsolationScope; /***/ 58784: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const dynamicSamplingContext = __nccwpck_require__(29724); -const dsn = __nccwpck_require__(32540); -const envelope = __nccwpck_require__(72635); -__nccwpck_require__(87038); -__nccwpck_require__(38752); +const beforeSendSpan = __nccwpck_require__(33579); +const dsn = __nccwpck_require__(91582); +const envelope = __nccwpck_require__(56987); +const randomSafeContext = __nccwpck_require__(28695); +const shouldIgnoreSpan = __nccwpck_require__(65771); const spanUtils = __nccwpck_require__(47569); -/** - * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key. - * Merge with existing data if any. - **/ -function enhanceEventWithSdkInfo(event, sdkInfo) { - if (!sdkInfo) { +function _enhanceEventWithSdkInfo(event, newSdkInfo) { + if (!newSdkInfo) { return event; } - event.sdk = event.sdk || {}; - event.sdk.name = event.sdk.name || sdkInfo.name; - event.sdk.version = event.sdk.version || sdkInfo.version; - event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])]; - event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])]; + const eventSdkInfo = event.sdk || {}; + event.sdk = { + ...eventSdkInfo, + name: eventSdkInfo.name || newSdkInfo.name, + version: eventSdkInfo.version || newSdkInfo.version, + integrations: [...event.sdk?.integrations || [], ...newSdkInfo.integrations || []], + packages: [...event.sdk?.packages || [], ...newSdkInfo.packages || []], + settings: event.sdk?.settings || newSdkInfo.settings ? { + ...event.sdk?.settings, + ...newSdkInfo.settings + } : void 0 + }; return event; } - -/** Creates an envelope from a Session */ -function createSessionEnvelope( - session, - dsn$1, - metadata, - tunnel, -) { +function createSessionEnvelope(session, dsn$1, metadata, tunnel) { const sdkInfo = envelope.getSdkMetadataForEnvelopeHeader(metadata); const envelopeHeaders = { - sent_at: new Date().toISOString(), - ...(sdkInfo && { sdk: sdkInfo }), - ...(!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) }), + sent_at: new Date(randomSafeContext.safeDateNow()).toISOString(), + ...sdkInfo && { sdk: sdkInfo }, + ...!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) } }; - - const envelopeItem = - 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()]; - + const envelopeItem = "aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()]; return envelope.createEnvelope(envelopeHeaders, [envelopeItem]); } - -/** - * Create an Envelope from an event. - */ -function createEventEnvelope( - event, - dsn, - metadata, - tunnel, -) { +function createEventEnvelope(event, dsn, metadata, tunnel) { const sdkInfo = envelope.getSdkMetadataForEnvelopeHeader(metadata); - - /* - Note: Due to TS, event.type may be `replay_event`, theoretically. - In practice, we never call `createEventEnvelope` with `replay_event` type, - and we'd have to adjust a looot of types to make this work properly. - We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type) - So the safe choice is to really guard against the replay_event type here. - */ - const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event'; - - enhanceEventWithSdkInfo(event, metadata && metadata.sdk); - + const eventType = event.type && event.type !== "replay_event" ? event.type : "event"; + _enhanceEventWithSdkInfo(event, metadata?.sdk); const envelopeHeaders = envelope.createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn); - - // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to - // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may - // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid - // of this `delete`, lest we miss putting it back in the next time the property is in use.) delete event.sdkProcessingMetadata; - const eventItem = [{ type: eventType }, event]; return envelope.createEnvelope(envelopeHeaders, [eventItem]); } - -/** - * Create envelope from Span item. - * - * Takes an optional client and runs spans through `beforeSendSpan` if available. - */ function createSpanEnvelope(spans, client) { - function dscHasRequiredProps(dsc) { - return !!dsc.trace_id && !!dsc.public_key; + function dscHasRequiredProps(dsc2) { + return !!dsc2.trace_id && !!dsc2.public_key; } - - // For the moment we'll obtain the DSC from the first span in the array - // This might need to be changed if we permit sending multiple spans from - // different segments in one envelope const dsc = dynamicSamplingContext.getDynamicSamplingContextFromSpan(spans[0]); - - const dsn$1 = client && client.getDsn(); - const tunnel = client && client.getOptions().tunnel; - + const dsn$1 = client?.getDsn(); + const tunnel = client?.getOptions().tunnel; const headers = { - sent_at: new Date().toISOString(), - ...(dscHasRequiredProps(dsc) && { trace: dsc }), - ...(!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) }), + sent_at: new Date(randomSafeContext.safeDateNow()).toISOString(), + ...dscHasRequiredProps(dsc) && { trace: dsc }, + ...!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) } }; - - const beforeSendSpan = client && client.getOptions().beforeSendSpan; - const convertToSpanJSON = beforeSendSpan - ? (span) => { - const spanJson = beforeSendSpan(spanUtils.spanToJSON(span) ); - if (!spanJson) { - spanUtils.showSpanDropWarning(); - } - return spanJson; - } - : (span) => spanUtils.spanToJSON(span); - + const { beforeSendSpan: beforeSendSpan$1, ignoreSpans } = client?.getOptions() || {}; + const filteredSpans = ignoreSpans?.length ? spans.filter((span) => { + const json = spanUtils.spanToJSON(span); + return !shouldIgnoreSpan.shouldIgnoreSpan({ description: json.description, op: json.op, attributes: json.data }, ignoreSpans); + }) : spans; + const droppedSpans = spans.length - filteredSpans.length; + if (droppedSpans) { + client?.recordDroppedEvent("before_send", "span", droppedSpans); + } + const convertToSpanJSON = beforeSendSpan$1 ? (span) => { + const spanJson = spanUtils.spanToJSON(span); + const processedSpan = !beforeSendSpan.isStreamedBeforeSendSpanCallback(beforeSendSpan$1) ? beforeSendSpan$1(spanJson) : spanJson; + if (!processedSpan) { + spanUtils.showSpanDropWarning(); + return spanJson; + } + return processedSpan; + } : spanUtils.spanToJSON; const items = []; - for (const span of spans) { + for (const span of filteredSpans) { const spanJson = convertToSpanJSON(span); if (spanJson) { items.push(envelope.createSpanEnvelopeItem(spanJson)); } } - return envelope.createEnvelope(headers, items); } +exports._enhanceEventWithSdkInfo = _enhanceEventWithSdkInfo; exports.createEventEnvelope = createEventEnvelope; exports.createSessionEnvelope = createSessionEnvelope; exports.createSpanEnvelope = createSpanEnvelope; @@ -66707,42 +20554,32 @@ exports.createSpanEnvelope = createSpanEnvelope; /***/ 45796: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); -const is = __nccwpck_require__(84085); -const logger = __nccwpck_require__(38752); -const syncpromise = __nccwpck_require__(15621); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); +const syncpromise = __nccwpck_require__(56291); -/** - * Process an array of event processors, returning the processed event (or `null` if the event was dropped). - */ -function notifyEventProcessors( - processors, - event, - hint, - index = 0, -) { - return new syncpromise.SyncPromise((resolve, reject) => { - const processor = processors[index]; - if (event === null || typeof processor !== 'function') { - resolve(event); - } else { - const result = processor({ ...event }, hint) ; - - debugBuild.DEBUG_BUILD && processor.id && result === null && logger.logger.log(`Event processor "${processor.id}" dropped event`); - - if (is.isThenable(result)) { - void result - .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve)) - .then(null, reject); - } else { - void notifyEventProcessors(processors, result, hint, index + 1) - .then(resolve) - .then(null, reject); - } - } - }); +function notifyEventProcessors(processors, event, hint, index = 0) { + try { + const result = _notifyEventProcessors(event, hint, processors, index); + return is.isThenable(result) ? result : syncpromise.resolvedSyncPromise(result); + } catch (error) { + return syncpromise.rejectedSyncPromise(error); + } +} +function _notifyEventProcessors(event, hint, processors, index) { + const processor = processors[index]; + if (!event || !processor) { + return event; + } + const result = processor({ ...event }, hint); + debugBuild.DEBUG_BUILD && result === null && debugLogger.debug.log(`Event processor "${processor.id || "?"}" dropped event`); + if (is.isThenable(result)) { + return result.then((final) => _notifyEventProcessors(final, hint, processors, index + 1)); + } + return _notifyEventProcessors(result, hint, processors, index + 1); } exports.notifyEventProcessors = notifyEventProcessors; @@ -66754,342 +20591,170 @@ exports.notifyEventProcessors = notifyEventProcessors; /***/ 10779: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const constants = __nccwpck_require__(5958); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const session = __nccwpck_require__(60233); -const is = __nccwpck_require__(84085); -const logger = __nccwpck_require__(38752); -const misc = __nccwpck_require__(3181); -const time = __nccwpck_require__(75872); -const worldwide = __nccwpck_require__(10891); +const trace = __nccwpck_require__(97956); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); +const misc = __nccwpck_require__(52619); const prepareEvent = __nccwpck_require__(22264); +const scopeData = __nccwpck_require__(72332); +const time = __nccwpck_require__(66690); +const worldwide = __nccwpck_require__(90935); -/** - * Captures an exception event and sends it to Sentry. - * - * @param exception The exception to capture. - * @param hint Optional additional data to attach to the Sentry event. - * @returns the id of the captured Sentry event. - */ function captureException(exception, hint) { return currentScopes.getCurrentScope().captureException(exception, prepareEvent.parseEventHintOrCaptureContext(hint)); } - -/** - * Captures a message event and sends it to Sentry. - * - * @param message The message to send to Sentry. - * @param captureContext Define the level of the message or pass in additional data to attach to the message. - * @returns the id of the captured message. - */ function captureMessage(message, captureContext) { - // This is necessary to provide explicit scopes upgrade, without changing the original - // arity of the `captureMessage(message, level)` method. - const level = typeof captureContext === 'string' ? captureContext : undefined; - const context = typeof captureContext !== 'string' ? { captureContext } : undefined; - return currentScopes.getCurrentScope().captureMessage(message, level, context); + const level = typeof captureContext === "string" ? captureContext : void 0; + const hint = typeof captureContext !== "string" ? { captureContext } : void 0; + return currentScopes.getCurrentScope().captureMessage(message, level, hint); } - -/** - * Captures a manually created event and sends it to Sentry. - * - * @param event The event to send to Sentry. - * @param hint Optional additional data to attach to the Sentry event. - * @returns the id of the captured event. - */ function captureEvent(event, hint) { return currentScopes.getCurrentScope().captureEvent(event, hint); } - -/** - * Sets context data with the given name. - * @param name of the context - * @param context Any kind of data. This data will be normalized. - */ function setContext(name, context) { currentScopes.getIsolationScope().setContext(name, context); } - -/** - * Set an object that will be merged sent as extra data with the event. - * @param extras Extras object to merge into current context. - */ function setExtras(extras) { currentScopes.getIsolationScope().setExtras(extras); } - -/** - * Set key:value that will be sent as extra data with the event. - * @param key String of extra - * @param extra Any kind of data. This data will be normalized. - */ function setExtra(key, extra) { currentScopes.getIsolationScope().setExtra(key, extra); } - -/** - * Set an object that will be merged sent as tags data with the event. - * @param tags Tags context object to merge into current context. - */ function setTags(tags) { currentScopes.getIsolationScope().setTags(tags); } - -/** - * Set key:value that will be sent as tags data with the event. - * - * Can also be used to unset a tag, by passing `undefined`. - * - * @param key String key of tag - * @param value Value of tag - */ function setTag(key, value) { currentScopes.getIsolationScope().setTag(key, value); } - -/** - * Updates user context information for future events. - * - * @param user User context object to be set in the current context. Pass `null` to unset the user. - */ +function setAttributes(attributes) { + currentScopes.getIsolationScope().setAttributes(attributes); +} +function setAttribute(key, value) { + currentScopes.getIsolationScope().setAttribute(key, value); +} function setUser(user) { currentScopes.getIsolationScope().setUser(user); } - -/** - * The last error event id of the isolation scope. - * - * Warning: This function really returns the last recorded error event id on the current - * isolation scope. If you call this function after handling a certain error and another error - * is captured in between, the last one is returned instead of the one you might expect. - * Also, ids of events that were never sent to Sentry (for example because - * they were dropped in `beforeSend`) could be returned. - * - * @returns The last event id of the isolation scope. - */ +function setConversationId(conversationId) { + currentScopes.getIsolationScope().setConversationId(conversationId); +} function lastEventId() { return currentScopes.getIsolationScope().lastEventId(); } - -/** - * Create a cron monitor check in and send it to Sentry. - * - * @param checkIn An object that describes a check in. - * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want - * to create a monitor automatically when sending a check in. - */ function captureCheckIn(checkIn, upsertMonitorConfig) { const scope = currentScopes.getCurrentScope(); const client = currentScopes.getClient(); if (!client) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot capture check-in. No client defined.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Cannot capture check-in. No client defined."); } else if (!client.captureCheckIn) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot capture check-in. Client does not support sending check-ins.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Cannot capture check-in. Client does not support sending check-ins."); } else { return client.captureCheckIn(checkIn, upsertMonitorConfig, scope); } - return misc.uuid4(); } - -/** - * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes. - * - * @param monitorSlug The distinct slug of the monitor. - * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want - * to create a monitor automatically when sending a check in. - */ -function withMonitor( - monitorSlug, - callback, - upsertMonitorConfig, -) { - const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig); - const now = time.timestampInSeconds(); - - function finishCheckIn(status) { - captureCheckIn({ monitorSlug, status, checkInId, duration: time.timestampInSeconds() - now }); - } - - return currentScopes.withIsolationScope(() => { +function withMonitor(monitorSlug, callback, upsertMonitorConfig) { + function runCallback() { + const checkInId = captureCheckIn({ monitorSlug, status: "in_progress" }, upsertMonitorConfig); + const now = time.timestampInSeconds(); + function finishCheckIn(status) { + captureCheckIn({ monitorSlug, status, checkInId, duration: time.timestampInSeconds() - now }); + } let maybePromiseResult; try { maybePromiseResult = callback(); } catch (e) { - finishCheckIn('error'); + finishCheckIn("error"); throw e; } - if (is.isThenable(maybePromiseResult)) { - Promise.resolve(maybePromiseResult).then( - () => { - finishCheckIn('ok'); + return maybePromiseResult.then( + (r) => { + finishCheckIn("ok"); + return r; }, - e => { - finishCheckIn('error'); + (e) => { + finishCheckIn("error"); throw e; - }, + } ); - } else { - finishCheckIn('ok'); } - + finishCheckIn("ok"); return maybePromiseResult; - }); + } + return currentScopes.withIsolationScope(() => upsertMonitorConfig?.isolateTrace ? trace.startNewTrace(runCallback) : runCallback()); } - -/** - * Call `flush()` on the current client, if there is one. See {@link Client.flush}. - * - * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause - * the client to wait until all events are sent before resolving the promise. - * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it - * doesn't (or if there's no client defined). - */ async function flush(timeout) { const client = currentScopes.getClient(); if (client) { return client.flush(timeout); } - debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot flush events. No client defined.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Cannot flush events. No client defined."); return Promise.resolve(false); } - -/** - * Call `close()` on the current client, if there is one. See {@link Client.close}. - * - * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this - * parameter will cause the client to wait until all events are sent before disabling itself. - * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it - * doesn't (or if there's no client defined). - */ async function close(timeout) { const client = currentScopes.getClient(); if (client) { return client.close(timeout); } - debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot flush events and disable SDK. No client defined.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Cannot flush events and disable SDK. No client defined."); return Promise.resolve(false); } - -/** - * Returns true if Sentry has been properly initialized. - */ function isInitialized() { return !!currentScopes.getClient(); } - -/** If the SDK is initialized & enabled. */ function isEnabled() { const client = currentScopes.getClient(); - return !!client && client.getOptions().enabled !== false && !!client.getTransport(); + return client?.getOptions().enabled !== false && !!client?.getTransport(); } - -/** - * Add an event processor. - * This will be added to the current isolation scope, ensuring any event that is processed in the current execution - * context will have the processor applied. - */ function addEventProcessor(callback) { currentScopes.getIsolationScope().addEventProcessor(callback); } - -/** - * Start a session on the current isolation scope. - * - * @param context (optional) additional properties to be applied to the returned session object - * - * @returns the new active session - */ function startSession(context) { - const client = currentScopes.getClient(); const isolationScope = currentScopes.getIsolationScope(); - const currentScope = currentScopes.getCurrentScope(); - - const { release, environment = constants.DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {}; - - // Will fetch userAgent if called from browser sdk + const { user } = scopeData.getCombinedScopeData(isolationScope, currentScopes.getCurrentScope()); const { userAgent } = worldwide.GLOBAL_OBJ.navigator || {}; - const session$1 = session.makeSession({ - release, - environment, - user: currentScope.getUser() || isolationScope.getUser(), - ...(userAgent && { userAgent }), - ...context, + user, + ...userAgent && { userAgent }, + ...context }); - - // End existing session if there's one const currentSession = isolationScope.getSession(); - if (currentSession && currentSession.status === 'ok') { - session.updateSession(currentSession, { status: 'exited' }); + if (currentSession?.status === "ok") { + session.updateSession(currentSession, { status: "exited" }); } - endSession(); - - // Afterwards we set the new session on the scope isolationScope.setSession(session$1); - - // TODO (v8): Remove this and only use the isolation scope(?). - // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() - currentScope.setSession(session$1); - return session$1; } - -/** - * End the session on the current isolation scope. - */ function endSession() { const isolationScope = currentScopes.getIsolationScope(); const currentScope = currentScopes.getCurrentScope(); - const session$1 = currentScope.getSession() || isolationScope.getSession(); if (session$1) { session.closeSession(session$1); } _sendSessionUpdate(); - - // the session is over; take it off of the scope isolationScope.setSession(); - - // TODO (v8): Remove this and only use the isolation scope(?). - // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() - currentScope.setSession(); } - -/** - * Sends the current Session on the scope - */ function _sendSessionUpdate() { const isolationScope = currentScopes.getIsolationScope(); - const currentScope = currentScopes.getCurrentScope(); const client = currentScopes.getClient(); - // TODO (v8): Remove currentScope and only use the isolation scope(?). - // For v7 though, we can't "soft-break" people using getCurrentHub().getScope().setSession() - const session = currentScope.getSession() || isolationScope.getSession(); + const session = isolationScope.getSession(); if (session && client) { client.captureSession(session); } } - -/** - * Sends the current session on the scope to Sentry - * - * @param end If set the session will be marked as exited and removed from the scope. - * Defaults to `false`. - */ function captureSession(end = false) { - // both send the update and pull the session from the scope if (end) { endSession(); return; } - - // only send the update _sendSessionUpdate(); } @@ -67105,7 +20770,10 @@ exports.flush = flush; exports.isEnabled = isEnabled; exports.isInitialized = isInitialized; exports.lastEventId = lastEventId; +exports.setAttribute = setAttribute; +exports.setAttributes = setAttributes; exports.setContext = setContext; +exports.setConversationId = setConversationId; exports.setExtra = setExtra; exports.setExtras = setExtras; exports.setTag = setTag; @@ -67121,45 +20789,32 @@ exports.withMonitor = withMonitor; /***/ 66883: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); -const object = __nccwpck_require__(16100); -/** - * Send user feedback to Sentry. - */ -function captureFeedback( - params, - hint = {}, - scope = currentScopes.getCurrentScope(), -) { +function captureFeedback(params, hint = {}, scope = currentScopes.getCurrentScope()) { const { message, name, email, url, source, associatedEventId, tags } = params; - const feedbackEvent = { contexts: { - feedback: object.dropUndefinedKeys({ + feedback: { contact_email: email, name, message, url, source, - associated_event_id: associatedEventId, - }), + associated_event_id: associatedEventId + } }, - type: 'feedback', - level: 'info', - tags, + type: "feedback", + level: "info", + tags }; - - const client = (scope && scope.getClient()) || currentScopes.getClient(); - + const client = scope?.getClient() || currentScopes.getClient(); if (client) { - client.emit('beforeSendFeedback', feedbackEvent, hint); + client.emit("beforeSendFeedback", feedbackEvent, hint); } - const eventId = scope.captureEvent(feedbackEvent, hint); - return eventId; } @@ -67172,363 +20827,228 @@ exports.captureFeedback = captureFeedback; /***/ 17808: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const attributes = __nccwpck_require__(88264); +const currentScopes = __nccwpck_require__(8131); const semanticAttributes = __nccwpck_require__(36827); -__nccwpck_require__(21834); -const is = __nccwpck_require__(84085); -__nccwpck_require__(87038); -__nccwpck_require__(38752); -__nccwpck_require__(75872); -__nccwpck_require__(15621); -const url = __nccwpck_require__(44673); -const baggage = __nccwpck_require__(86741); -__nccwpck_require__(14488); -const hasTracingEnabled = __nccwpck_require__(79223); const spanUtils = __nccwpck_require__(47569); -const sentryNonRecordingSpan = __nccwpck_require__(36854); const spanstatus = __nccwpck_require__(21119); +const is = __nccwpck_require__(68370); +const hasSpansEnabled = __nccwpck_require__(42982); +const sentryNonRecordingSpan = __nccwpck_require__(36854); +const baggage = __nccwpck_require__(2135); +const hasSpanStreamingEnabled = __nccwpck_require__(73642); const trace = __nccwpck_require__(97956); const traceData = __nccwpck_require__(7522); +const url = __nccwpck_require__(78253); -/** - * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`. - * - * @returns Span if a span was created, otherwise void. - */ -function instrumentFetchRequest( - handlerData, - shouldCreateSpan, - shouldAttachHeaders, - spans, - spanOrigin = 'auto.http.browser', -) { +function instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeaders, spans, spanOriginOrOptions) { if (!handlerData.fetchData) { - return undefined; + return void 0; } - - const shouldCreateSpanResult = hasTracingEnabled.hasTracingEnabled() && shouldCreateSpan(handlerData.fetchData.url); - - if (handlerData.endTimestamp && shouldCreateSpanResult) { + const { method, url } = handlerData.fetchData; + const shouldCreateSpanResult = hasSpansEnabled.hasSpansEnabled() && shouldCreateSpan(url); + if (handlerData.endTimestamp) { const spanId = handlerData.fetchData.__span; if (!spanId) return; - - const span = spans[spanId]; - if (span) { - endSpan(span, handlerData); - - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + const span2 = spans[spanId]; + if (span2) { + if (shouldCreateSpanResult) { + endSpan(span2, handlerData); + _callOnRequestSpanEnd(span2, handlerData, spanOriginOrOptions); + } delete spans[spanId]; } - return undefined; + return void 0; } - - const { method, url: url$1 } = handlerData.fetchData; - - const fullUrl = getFullURL(url$1); - const host = fullUrl ? url.parseUrl(fullUrl).host : undefined; - + const { spanOrigin = "auto.http.browser", propagateTraceparent = false } = typeof spanOriginOrOptions === "object" ? spanOriginOrOptions : { spanOrigin: spanOriginOrOptions }; + const client = currentScopes.getClient(); const hasParent = !!spanUtils.getActiveSpan(); - - const span = - shouldCreateSpanResult && hasParent - ? trace.startInactiveSpan({ - name: `${method} ${url$1}`, - attributes: { - url: url$1, - type: 'fetch', - 'http.method': method, - 'http.url': fullUrl, - 'server.address': host, - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client', - }, - }) - : new sentryNonRecordingSpan.SentryNonRecordingSpan(); - + const shouldEmitSpan = hasParent || !!client && hasSpanStreamingEnabled.hasSpanStreamingEnabled(client); + const span = shouldCreateSpanResult && shouldEmitSpan ? trace.startInactiveSpan(getSpanStartOptions(url, method, spanOrigin)) : new sentryNonRecordingSpan.SentryNonRecordingSpan(); + const spanForTraceHeaders = trace.spanIsIgnored(span) && hasParent ? void 0 : span; + if (shouldCreateSpanResult && !shouldEmitSpan) { + client?.recordDroppedEvent("no_parent_span", "span"); + } handlerData.fetchData.__span = span.spanContext().spanId; spans[span.spanContext().spanId] = span; - if (shouldAttachHeaders(handlerData.fetchData.url)) { const request = handlerData.args[0]; - - const options = handlerData.args[1] || {}; - - const headers = _addTracingHeadersToFetchRequest( + const options = { ...handlerData.args[1] || {} }; + const headers = _INTERNAL_getTracingHeadersForFetchRequest( request, options, // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction), // we do not want to use the span as base for the trace headers, // which means that the headers will be generated from the scope and the sampling decision is deferred - hasTracingEnabled.hasTracingEnabled() && hasParent ? span : undefined, + hasSpansEnabled.hasSpansEnabled() && shouldEmitSpan ? spanForTraceHeaders : void 0, + propagateTraceparent ); if (headers) { - // Ensure this is actually set, if no options have been passed previously handlerData.args[1] = options; options.headers = headers; } } - + if (client) { + const fetchHint = { + input: handlerData.args, + response: handlerData.response, + startTimestamp: handlerData.startTimestamp, + endTimestamp: handlerData.endTimestamp + }; + client.emit("beforeOutgoingRequestSpan", span, fetchHint); + } return span; } - -/** - * Adds sentry-trace and baggage headers to the various forms of fetch headers. - */ -function _addTracingHeadersToFetchRequest( - request, - fetchOptionsObj - -, - span, -) { - const traceHeaders = traceData.getTraceData({ span }); - const sentryTrace = traceHeaders['sentry-trace']; +function _callOnRequestSpanEnd(span, handlerData, spanOriginOrOptions) { + const onRequestSpanEnd = typeof spanOriginOrOptions === "object" && spanOriginOrOptions !== null ? spanOriginOrOptions.onRequestSpanEnd : void 0; + onRequestSpanEnd?.(span, { + headers: handlerData.response?.headers, + error: handlerData.error + }); +} +function _INTERNAL_getTracingHeadersForFetchRequest(request, fetchOptionsObj, span, propagateTraceparent) { + const traceHeaders = traceData.getTraceData({ span, propagateTraceparent }); + const sentryTrace = traceHeaders["sentry-trace"]; const baggage = traceHeaders.baggage; - - // Nothing to do, when we return undefined here, the original headers will be used + const traceparent = traceHeaders.traceparent; if (!sentryTrace) { - return undefined; + return void 0; } - - const headers = fetchOptionsObj.headers || (isRequest(request) ? request.headers : undefined); - - if (!headers) { - return { ...traceHeaders }; - } else if (isHeaders(headers)) { - const newHeaders = new Headers(headers); - newHeaders.set('sentry-trace', sentryTrace); - + const originalHeaders = fetchOptionsObj.headers || (is.isRequest(request) ? request.headers : void 0); + if (!originalHeaders) { + return { + "sentry-trace": sentryTrace, + ...baggage && { baggage }, + ...traceparent && { traceparent } + }; + } else if (isHeaders(originalHeaders)) { + const newHeaders = new Headers(originalHeaders); + if (!newHeaders.get("sentry-trace")) { + newHeaders.set("sentry-trace", sentryTrace); + } + if (propagateTraceparent && traceparent && !newHeaders.get("traceparent")) { + newHeaders.set("traceparent", traceparent); + } if (baggage) { - const prevBaggageHeader = newHeaders.get('baggage'); - if (prevBaggageHeader) { - const prevHeaderStrippedFromSentryBaggage = stripBaggageHeaderOfSentryBaggageValues(prevBaggageHeader); - newHeaders.set( - 'baggage', - // If there are non-sentry entries (i.e. if the stripped string is non-empty/truthy) combine the stripped header and sentry baggage header - // otherwise just set the sentry baggage header - prevHeaderStrippedFromSentryBaggage ? `${prevHeaderStrippedFromSentryBaggage},${baggage}` : baggage, - ); - } else { - newHeaders.set('baggage', baggage); + const prevBaggageHeader = newHeaders.get("baggage"); + if (!prevBaggageHeader) { + newHeaders.set("baggage", baggage); + } else if (!baggageHeaderHasSentryBaggageValues(prevBaggageHeader)) { + newHeaders.set("baggage", `${prevBaggageHeader},${baggage}`); } } - return newHeaders; - } else if (Array.isArray(headers)) { - const newHeaders = [ - ...headers - // Remove any existing sentry-trace headers - .filter(header => { - return !(Array.isArray(header) && header[0] === 'sentry-trace'); - }) - // Get rid of previous sentry baggage values in baggage header - .map(header => { - if (Array.isArray(header) && header[0] === 'baggage' && typeof header[1] === 'string') { - const [headerName, headerValue, ...rest] = header; - return [headerName, stripBaggageHeaderOfSentryBaggageValues(headerValue), ...rest]; - } else { - return header; - } - }), - // Attach the new sentry-trace header - ['sentry-trace', sentryTrace], - ]; - - if (baggage) { - // If there are multiple entries with the same key, the browser will merge the values into a single request header. - // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header. - newHeaders.push(['baggage', baggage]); + } else if (isHeadersInitTupleArray(originalHeaders)) { + const newHeaders = [...originalHeaders]; + if (!newHeaders.find((header) => header[0] === "sentry-trace")) { + newHeaders.push(["sentry-trace", sentryTrace]); } - - return newHeaders ; + if (propagateTraceparent && traceparent && !newHeaders.find((header) => header[0] === "traceparent")) { + newHeaders.push(["traceparent", traceparent]); + } + const prevBaggageHeaderWithSentryValues = originalHeaders.find( + (header) => header[0] === "baggage" && typeof header[1] === "string" && baggageHeaderHasSentryBaggageValues(header[1]) + ); + if (baggage && !prevBaggageHeaderWithSentryValues) { + newHeaders.push(["baggage", baggage]); + } + return newHeaders; } else { - const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined; - let newBaggageHeaders = []; - - if (Array.isArray(existingBaggageHeader)) { - newBaggageHeaders = existingBaggageHeader - .map(headerItem => - typeof headerItem === 'string' ? stripBaggageHeaderOfSentryBaggageValues(headerItem) : headerItem, - ) - .filter(headerItem => headerItem === ''); - } else if (existingBaggageHeader) { - newBaggageHeaders.push(stripBaggageHeaderOfSentryBaggageValues(existingBaggageHeader)); - } - - if (baggage) { + const existingSentryTraceHeader = "sentry-trace" in originalHeaders ? originalHeaders["sentry-trace"] : void 0; + const existingTraceparentHeader = "traceparent" in originalHeaders ? originalHeaders.traceparent : void 0; + const existingBaggageHeader = "baggage" in originalHeaders ? originalHeaders.baggage : void 0; + const newBaggageHeaders = existingBaggageHeader ? Array.isArray(existingBaggageHeader) ? [...existingBaggageHeader] : [existingBaggageHeader] : []; + const prevBaggageHeaderWithSentryValues = existingBaggageHeader && (Array.isArray(existingBaggageHeader) ? existingBaggageHeader.find((headerItem) => baggageHeaderHasSentryBaggageValues(headerItem)) : baggageHeaderHasSentryBaggageValues(existingBaggageHeader)); + if (baggage && !prevBaggageHeaderWithSentryValues) { newBaggageHeaders.push(baggage); } - - return { - ...(headers ), - 'sentry-trace': sentryTrace, - baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined, - }; + const newHeaders = Object.assign({}, originalHeaders, { + "sentry-trace": existingSentryTraceHeader ?? sentryTrace, + ...newBaggageHeaders.length > 0 && { baggage: newBaggageHeaders.join(",") } + }); + if (propagateTraceparent && traceparent && !existingTraceparentHeader) { + newHeaders.traceparent = traceparent; + } + return newHeaders; } } - -/** - * Adds sentry-trace and baggage headers to the various forms of fetch headers. - * - * @deprecated This function will not be exported anymore in v9. - */ -function addTracingHeadersToFetchRequest( - request, - _client, - _scope, - fetchOptionsObj - -, - span, -) { - return _addTracingHeadersToFetchRequest(request , fetchOptionsObj, span); -} - -function getFullURL(url) { - try { - const parsed = new URL(url); - return parsed.href; - } catch (e) { - return undefined; - } -} - function endSpan(span, handlerData) { if (handlerData.response) { spanstatus.setHttpStatus(span, handlerData.response.status); - - const contentLength = - handlerData.response && handlerData.response.headers && handlerData.response.headers.get('content-length'); - + const contentLength = handlerData.response?.headers?.get("content-length"); if (contentLength) { const contentLengthNum = parseInt(contentLength); if (contentLengthNum > 0) { - span.setAttribute('http.response_content_length', contentLengthNum); + span.setAttribute("http.response_content_length", contentLengthNum); } } } else if (handlerData.error) { - span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'internal_error' }); + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); } span.end(); } - -function stripBaggageHeaderOfSentryBaggageValues(baggageHeader) { - return ( - baggageHeader - .split(',') - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - .filter(baggageEntry => !baggageEntry.split('=')[0].startsWith(baggage.SENTRY_BAGGAGE_KEY_PREFIX)) - .join(',') +function baggageHeaderHasSentryBaggageValues(baggageHeader) { + if (typeof baggageHeader !== "string") { + return false; + } + return baggageHeader.split(",").some((baggageEntry) => baggageEntry.trim().startsWith(baggage.SENTRY_BAGGAGE_KEY_PREFIX)); +} +function isHeaders(headers) { + return typeof Headers !== "undefined" && is.isInstanceOf(headers, Headers); +} +function isHeadersInitTupleArray(headers) { + if (!Array.isArray(headers)) { + return false; + } + return headers.every( + (item) => Array.isArray(item) && item.length === 2 && typeof item[0] === "string" ); } - -function isRequest(request) { - return typeof Request !== 'undefined' && is.isInstanceOf(request, Request); -} - -function isHeaders(headers) { - return typeof Headers !== 'undefined' && is.isInstanceOf(headers, Headers); -} - -exports.addTracingHeadersToFetchRequest = addTracingHeadersToFetchRequest; -exports.instrumentFetchRequest = instrumentFetchRequest; -//# sourceMappingURL=fetch.js.map - - -/***/ }), - -/***/ 55103: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const breadcrumbs = __nccwpck_require__(5608); -const currentScopes = __nccwpck_require__(8131); -const exports$1 = __nccwpck_require__(10779); - -/** - * This is for legacy reasons, and returns a proxy object instead of a hub to be used. - * - * @deprecated Use the methods directly from the top level Sentry API (e.g. `Sentry.withScope`) - * For more information see our migration guide for - * [replacing `getCurrentHub` and `Hub`](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub) - * usage - */ -// eslint-disable-next-line deprecation/deprecation -function getCurrentHubShim() { +function getSpanStartOptions(url$1, method, spanOrigin) { + if (url$1.startsWith("data:")) { + const sanitizedUrl2 = url.stripDataUrlContent(url$1); + return { + name: `${method} ${sanitizedUrl2}`, + attributes: getFetchSpanAttributes(url$1, void 0, method, spanOrigin) + }; + } + const parsedUrl = url.parseStringToURLObject(url$1); + const sanitizedUrl = parsedUrl ? url.getSanitizedUrlStringFromUrlObject(parsedUrl) : url$1; return { - bindClient(client) { - const scope = currentScopes.getCurrentScope(); - scope.setClient(client); - }, - - withScope: currentScopes.withScope, - getClient: () => currentScopes.getClient() , - getScope: currentScopes.getCurrentScope, - getIsolationScope: currentScopes.getIsolationScope, - captureException: (exception, hint) => { - return currentScopes.getCurrentScope().captureException(exception, hint); - }, - captureMessage: (message, level, hint) => { - return currentScopes.getCurrentScope().captureMessage(message, level, hint); - }, - captureEvent: exports$1.captureEvent, - addBreadcrumb: breadcrumbs.addBreadcrumb, - setUser: exports$1.setUser, - setTags: exports$1.setTags, - setTag: exports$1.setTag, - setExtra: exports$1.setExtra, - setExtras: exports$1.setExtras, - setContext: exports$1.setContext, - - getIntegration(integration) { - const client = currentScopes.getClient(); - return (client && client.getIntegrationByName(integration.id)) || null; - }, - - startSession: exports$1.startSession, - endSession: exports$1.endSession, - captureSession(end) { - // both send the update and pull the session from the scope - if (end) { - return exports$1.endSession(); - } - - // only send the update - _sendSessionUpdate(); - }, + name: `${method} ${sanitizedUrl}`, + attributes: getFetchSpanAttributes(url$1, parsedUrl, method, spanOrigin) }; } - -/** - * Returns the default hub instance. - * - * If a hub is already registered in the global carrier but this module - * contains a more recent version, it replaces the registered version. - * Otherwise, the currently registered hub will be returned. - * - * @deprecated Use the respective replacement method directly instead. - */ -// eslint-disable-next-line deprecation/deprecation -const getCurrentHub = getCurrentHubShim; - -/** - * Sends the current Session on the scope - */ -function _sendSessionUpdate() { - const scope = currentScopes.getCurrentScope(); - const client = currentScopes.getClient(); - - const session = scope.getSession(); - if (client && session) { - client.captureSession(session); +function getFetchSpanAttributes(url$1, parsedUrl, method, spanOrigin) { + const attributes$1 = { + url: url.stripDataUrlContent(url$1), + type: "fetch", + "http.method": method, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client" + }; + if (parsedUrl) { + if (!url.isURLObjectRelative(parsedUrl)) { + attributes$1[attributes.HTTP_URL] = url.stripDataUrlContent(parsedUrl.href); + attributes$1[attributes.URL_FULL] = url.stripDataUrlContent(parsedUrl.href); + attributes$1["server.address"] = parsedUrl.host; + } + if (parsedUrl.search) { + attributes$1["http.query"] = parsedUrl.search; + } + if (parsedUrl.hash) { + attributes$1["http.fragment"] = parsedUrl.hash; + } } + return attributes$1; } -exports.getCurrentHub = getCurrentHub; -exports.getCurrentHubShim = getCurrentHubShim; -//# sourceMappingURL=getCurrentHubShim.js.map +exports._INTERNAL_getTracingHeadersForFetchRequest = _INTERNAL_getTracingHeadersForFetchRequest; +exports._callOnRequestSpanEnd = _callOnRequestSpanEnd; +exports.instrumentFetchRequest = instrumentFetchRequest; +//# sourceMappingURL=fetch.js.map /***/ }), @@ -67536,151 +21056,217 @@ exports.getCurrentHubShim = getCurrentHubShim; /***/ 84466: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const errors = __nccwpck_require__(21834); -const utils = __nccwpck_require__(77989); -const hubextensions = __nccwpck_require__(51019); +const utils$4 = __nccwpck_require__(77989); const idleSpan = __nccwpck_require__(89709); const sentrySpan = __nccwpck_require__(53263); +const deferSegmentSpanCapture = __nccwpck_require__(65512); const sentryNonRecordingSpan = __nccwpck_require__(36854); const spanstatus = __nccwpck_require__(21119); const trace = __nccwpck_require__(97956); +const bindScopeToEmitter = __nccwpck_require__(77388); const dynamicSamplingContext = __nccwpck_require__(29724); const measurement = __nccwpck_require__(50722); const sampling = __nccwpck_require__(79478); const logSpans = __nccwpck_require__(28761); +const captureSpan = __nccwpck_require__(29729); const semanticAttributes = __nccwpck_require__(36827); -const envelope = __nccwpck_require__(58784); +const envelope$1 = __nccwpck_require__(58784); const exports$1 = __nccwpck_require__(10779); const currentScopes = __nccwpck_require__(8131); const defaultScopes = __nccwpck_require__(80496); -const index = __nccwpck_require__(29878); +const index$7 = __nccwpck_require__(29878); +const tracingChannelBinding = __nccwpck_require__(50098); const carrier = __nccwpck_require__(38080); const session = __nccwpck_require__(60233); -const sessionflusher = __nccwpck_require__(88971); const scope = __nccwpck_require__(49417); const eventProcessors = __nccwpck_require__(45796); const api = __nccwpck_require__(88563); -const baseclient = __nccwpck_require__(95457); -const serverRuntimeClient = __nccwpck_require__(37238); +const client = __nccwpck_require__(36316); const sdk = __nccwpck_require__(6183); const base = __nccwpck_require__(24899); const offline = __nccwpck_require__(52419); const multiplexed = __nccwpck_require__(97281); const integration = __nccwpck_require__(67428); -const applyScopeDataToEvent = __nccwpck_require__(87359); +const providerSkip = __nccwpck_require__(32397); +const filterKeyValueData = __nccwpck_require__(88468); +const filterCookies = __nccwpck_require__(48482); +const filterQueryParams = __nccwpck_require__(25589); +const envToBool = __nccwpck_require__(61258); +const scopeData = __nccwpck_require__(72332); const prepareEvent = __nccwpck_require__(22264); const checkin = __nccwpck_require__(54413); -const hasTracingEnabled = __nccwpck_require__(79223); +const hasSpansEnabled = __nccwpck_require__(42982); +const beforeSendSpan = __nccwpck_require__(33579); const isSentryRequestUrl = __nccwpck_require__(2554); const handleCallbackErrors = __nccwpck_require__(77864); const parameterize = __nccwpck_require__(32957); +const tunnel = __nccwpck_require__(90792); +const ipAddress = __nccwpck_require__(61343); const spanUtils = __nccwpck_require__(47569); +const spanOnScope = __nccwpck_require__(14379); const parseSampleRate = __nccwpck_require__(54078); const sdkMetadata = __nccwpck_require__(24054); const traceData = __nccwpck_require__(7522); +const tracePropagationTargets = __nccwpck_require__(22680); const meta = __nccwpck_require__(34314); -const constants = __nccwpck_require__(5958); +const debounce = __nccwpck_require__(18431); +const array = __nccwpck_require__(65064); +const weakRef = __nccwpck_require__(98981); +const shouldIgnoreSpan = __nccwpck_require__(65771); +const request = __nccwpck_require__(82141); +const constants$1 = __nccwpck_require__(5958); +const spanKind = __nccwpck_require__(14516); const breadcrumbs = __nccwpck_require__(5608); const functiontostring = __nccwpck_require__(48318); -const inboundfilters = __nccwpck_require__(81264); +const eventFilters = __nccwpck_require__(34568); const linkederrors = __nccwpck_require__(90529); -const metadata = __nccwpck_require__(1668); +const moduleMetadata = __nccwpck_require__(3390); const requestdata = __nccwpck_require__(71679); const captureconsole = __nccwpck_require__(25821); -const debug = __nccwpck_require__(39957); const dedupe = __nccwpck_require__(96514); const extraerrordata = __nccwpck_require__(88764); const rewriteframes = __nccwpck_require__(94102); -const sessiontiming = __nccwpck_require__(20871); +const supabase = __nccwpck_require__(98283); const zoderrors = __nccwpck_require__(55472); const thirdPartyErrorsFilter = __nccwpck_require__(86140); -const exports$2 = __nccwpck_require__(57134); +const console$1 = __nccwpck_require__(32587); +const featureFlagsIntegration = __nccwpck_require__(56508); +const growthbook = __nccwpck_require__(68326); +const conversationId = __nccwpck_require__(71831); const profiling = __nccwpck_require__(25750); -const exportsDefault = __nccwpck_require__(19001); -const browserAggregator = __nccwpck_require__(53128); -const metricSummary = __nccwpck_require__(48306); const fetch = __nccwpck_require__(17808); -const trpc = __nccwpck_require__(18833); const feedback = __nccwpck_require__(66883); -const getCurrentHubShim = __nccwpck_require__(55103); -const aggregateErrors = __nccwpck_require__(29416); -const array = __nccwpck_require__(28904); -const breadcrumbLogLevel = __nccwpck_require__(56448); -const browser = __nccwpck_require__(24450); -const dsn = __nccwpck_require__(32540); -const error = __nccwpck_require__(66322); -const worldwide = __nccwpck_require__(10891); -const console = __nccwpck_require__(32758); -const fetch$1 = __nccwpck_require__(34670); -const globalError = __nccwpck_require__(97033); -const globalUnhandledRejection = __nccwpck_require__(26156); -const handlers = __nccwpck_require__(44639); -const is = __nccwpck_require__(84085); -const isBrowser = __nccwpck_require__(52200); -const logger = __nccwpck_require__(38752); -const memo = __nccwpck_require__(13414); -const misc = __nccwpck_require__(3181); -const node = __nccwpck_require__(10116); -const normalize = __nccwpck_require__(65543); -const object = __nccwpck_require__(16100); -const path = __nccwpck_require__(94509); -const promisebuffer = __nccwpck_require__(28058); -const requestdata$1 = __nccwpck_require__(4630); -const severity = __nccwpck_require__(25753); -const stacktrace = __nccwpck_require__(85820); -const nodeStackTrace = __nccwpck_require__(70169); -const string = __nccwpck_require__(93529); -const supports = __nccwpck_require__(73872); -const syncpromise = __nccwpck_require__(15621); -const time = __nccwpck_require__(75872); -const tracing = __nccwpck_require__(15977); -const env = __nccwpck_require__(11318); -const envelope$1 = __nccwpck_require__(72635); -const clientreport = __nccwpck_require__(27962); -const ratelimit = __nccwpck_require__(78922); -const baggage = __nccwpck_require__(86741); -const url = __nccwpck_require__(44673); -const cache = __nccwpck_require__(6360); -const eventbuilder = __nccwpck_require__(2781); -const anr = __nccwpck_require__(13231); -const lru = __nccwpck_require__(50981); -const propagationContext = __nccwpck_require__(37264); -const vercelWaitUntil = __nccwpck_require__(77437); -const version = __nccwpck_require__(17370); -const debugIds = __nccwpck_require__(4263); -const escapeStringForRegex = __nccwpck_require__(20677); -const supportsHistory = __nccwpck_require__(86017); -const _asyncNullishCoalesce = __nccwpck_require__(89294); -const _asyncOptionalChain = __nccwpck_require__(82384); -const _asyncOptionalChainDelete = __nccwpck_require__(24613); -const _nullishCoalesce = __nccwpck_require__(68874); -const _optionalChain = __nccwpck_require__(6752); -const _optionalChainDelete = __nccwpck_require__(65631); +const internal = __nccwpck_require__(97113); +const publicApi = __nccwpck_require__(57557); +const consoleIntegration = __nccwpck_require__(35180); +const internal$1 = __nccwpck_require__(48803); +const publicApi$1 = __nccwpck_require__(64701); +const consola = __nccwpck_require__(25173); +const index$4 = __nccwpck_require__(72388); +const utils$5 = __nccwpck_require__(78481); +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(91407); +const constants$7 = __nccwpck_require__(29792); +const index$3 = __nccwpck_require__(87279); +const utils$2 = __nccwpck_require__(3854); +const streaming$2 = __nccwpck_require__(30878); +const constants$6 = __nccwpck_require__(45393); +const index$1 = __nccwpck_require__(39865); +const streaming = __nccwpck_require__(10091); +const constants = __nccwpck_require__(27044); +const index$2 = __nccwpck_require__(51067); +const streaming$1 = __nccwpck_require__(47879); +const constants$2 = __nccwpck_require__(78950); +const index$5 = __nccwpck_require__(28392); +const embeddings = __nccwpck_require__(94842); +const utils$1 = __nccwpck_require__(50284); +const constants$4 = __nccwpck_require__(38134); +const index = __nccwpck_require__(61572); +const utils$3 = __nccwpck_require__(8592); +const constants$5 = __nccwpck_require__(54658); +const index$8 = __nccwpck_require__(69669); +const spanBuffer = __nccwpck_require__(48298); +const hasSpanStreamingEnabled = __nccwpck_require__(73642); +const spanStreaming = __nccwpck_require__(9869); +const featureFlags = __nccwpck_require__(65422); +const aggregateErrors = __nccwpck_require__(70277); +const breadcrumbLogLevel = __nccwpck_require__(12297); +const dsn = __nccwpck_require__(91582); +const error = __nccwpck_require__(20816); +const worldwide = __nccwpck_require__(90935); +const console = __nccwpck_require__(98510); +const fetch$1 = __nccwpck_require__(75393); +const globalError = __nccwpck_require__(63022); +const globalUnhandledRejection = __nccwpck_require__(36099); +const handlers = __nccwpck_require__(48176); +const is = __nccwpck_require__(68370); +const isBrowser = __nccwpck_require__(71287); +const debugLogger = __nccwpck_require__(41772); +const misc = __nccwpck_require__(52619); +const normalize = __nccwpck_require__(68446); +const normalizationHints = __nccwpck_require__(1477); +const object = __nccwpck_require__(5906); +const path = __nccwpck_require__(82426); +const promisebuffer = __nccwpck_require__(80503); +const severity = __nccwpck_require__(13367); +const exports$2 = __nccwpck_require__(26006); +const stacktrace = __nccwpck_require__(22902); +const string = __nccwpck_require__(77673); +const supports = __nccwpck_require__(59809); +const syncpromise = __nccwpck_require__(56291); +const time = __nccwpck_require__(66690); +const tracing = __nccwpck_require__(35606); +const env = __nccwpck_require__(582); +const envelope = __nccwpck_require__(56987); +const clientreport = __nccwpck_require__(96472); +const ratelimit = __nccwpck_require__(6928); +const baggage = __nccwpck_require__(2135); +const url = __nccwpck_require__(78253); +const eventbuilder = __nccwpck_require__(16273); +const lru = __nccwpck_require__(67080); +const propagationContext = __nccwpck_require__(95102); +const version = __nccwpck_require__(71795); +const debugIds = __nccwpck_require__(26859); +const metadata = __nccwpck_require__(44592); +const escapeStringForRegex = __nccwpck_require__(19734); +const randomSafeContext = __nccwpck_require__(28695); +const serverRuntimeClient = __nccwpck_require__(37238); +const trpc = __nccwpck_require__(18833); +const index$9 = __nccwpck_require__(21150); +const node = __nccwpck_require__(84934); +const nodeStackTrace = __nccwpck_require__(27068); +const vercelWaitUntil = __nccwpck_require__(70420); +const flushIfServerless = __nccwpck_require__(15894); +const anr = __nccwpck_require__(87507); +const timer = __nccwpck_require__(85548); +const index$6 = __nccwpck_require__(94806); +const postgresjs = __nccwpck_require__(45676); +const sql = __nccwpck_require__(50664); +const clientPatch = __nccwpck_require__(54615); +const clientSubscriptions = __nccwpck_require__(81832); +const serverSubscription = __nccwpck_require__(29290); +const recordRequestSession = __nccwpck_require__(11273); +const addOutgoingRequestBreadcrumb = __nccwpck_require__(2492); +const getRequestUrl = __nccwpck_require__(51462); +const constants$3 = __nccwpck_require__(39009); +const browser = __nccwpck_require__(77387); exports.registerSpanErrorInstrumentation = errors.registerSpanErrorInstrumentation; -exports.getCapturedScopesOnSpan = utils.getCapturedScopesOnSpan; -exports.setCapturedScopesOnSpan = utils.setCapturedScopesOnSpan; -exports.addTracingExtensions = hubextensions.addTracingExtensions; +exports.getCapturedScopesOnSpan = utils$4.getCapturedScopesOnSpan; +exports.markSpanAsTracerProviderSpan = utils$4.markSpanAsTracerProviderSpan; +exports.markSpanForOtelSourceInference = utils$4.markSpanForOtelSourceInference; +exports.markSpanSourceAsExplicit = utils$4.markSpanSourceAsExplicit; +exports.setCapturedScopesOnSpan = utils$4.setCapturedScopesOnSpan; +exports.spanIsTracerProviderSpan = utils$4.spanIsTracerProviderSpan; +exports.spanShouldInferOtelSource = utils$4.spanShouldInferOtelSource; +exports.spanSourceWasExplicitlySet = utils$4.spanSourceWasExplicitlySet; exports.TRACING_DEFAULTS = idleSpan.TRACING_DEFAULTS; exports.startIdleSpan = idleSpan.startIdleSpan; exports.SentrySpan = sentrySpan.SentrySpan; +exports._INTERNAL_setDeferSegmentSpanCapture = deferSegmentSpanCapture._INTERNAL_setDeferSegmentSpanCapture; exports.SentryNonRecordingSpan = sentryNonRecordingSpan.SentryNonRecordingSpan; exports.SPAN_STATUS_ERROR = spanstatus.SPAN_STATUS_ERROR; exports.SPAN_STATUS_OK = spanstatus.SPAN_STATUS_OK; exports.SPAN_STATUS_UNSET = spanstatus.SPAN_STATUS_UNSET; exports.getSpanStatusFromHttpCode = spanstatus.getSpanStatusFromHttpCode; exports.setHttpStatus = spanstatus.setHttpStatus; +exports.SUPPRESS_TRACING_KEY = trace.SUPPRESS_TRACING_KEY; +exports._INTERNAL_startInactiveSpan = trace._INTERNAL_startInactiveSpan; exports.continueTrace = trace.continueTrace; +exports.isTracingSuppressed = trace.isTracingSuppressed; +exports.spanIsIgnored = trace.spanIsIgnored; exports.startInactiveSpan = trace.startInactiveSpan; exports.startNewTrace = trace.startNewTrace; exports.startSpan = trace.startSpan; exports.startSpanManual = trace.startSpanManual; exports.suppressTracing = trace.suppressTracing; exports.withActiveSpan = trace.withActiveSpan; +exports.bindScopeToEmitter = bindScopeToEmitter.bindScopeToEmitter; exports.getDynamicSamplingContextFromClient = dynamicSamplingContext.getDynamicSamplingContextFromClient; exports.getDynamicSamplingContextFromScope = dynamicSamplingContext.getDynamicSamplingContextFromScope; exports.getDynamicSamplingContextFromSpan = dynamicSamplingContext.getDynamicSamplingContextFromSpan; @@ -67690,6 +21276,9 @@ exports.timedEventsToMeasurements = measurement.timedEventsToMeasurements; exports.sampleSpan = sampling.sampleSpan; exports.logSpanEnd = logSpans.logSpanEnd; exports.logSpanStart = logSpans.logSpanStart; +exports.captureSpan = captureSpan.captureSpan; +exports.safeSetSpanJSONAttributes = captureSpan.safeSetSpanJSONAttributes; +exports.GEN_AI_CONVERSATION_ID_ATTRIBUTE = semanticAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE; exports.SEMANTIC_ATTRIBUTE_CACHE_HIT = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_HIT; exports.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE; exports.SEMANTIC_ATTRIBUTE_CACHE_KEY = semanticAttributes.SEMANTIC_ATTRIBUTE_CACHE_KEY; @@ -67697,17 +21286,31 @@ exports.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = semanticAttributes.SEMANTIC_ATTRIBUT exports.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = semanticAttributes.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD; exports.SEMANTIC_ATTRIBUTE_PROFILE_ID = semanticAttributes.SEMANTIC_ATTRIBUTE_PROFILE_ID; exports.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME; +exports.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT; exports.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON; exports.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT; exports.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE; exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP; exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN; +exports.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE; exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME; exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE = semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE; exports.SEMANTIC_ATTRIBUTE_URL_FULL = semanticAttributes.SEMANTIC_ATTRIBUTE_URL_FULL; -exports.createEventEnvelope = envelope.createEventEnvelope; -exports.createSessionEnvelope = envelope.createSessionEnvelope; -exports.createSpanEnvelope = envelope.createSpanEnvelope; +exports.SEMANTIC_ATTRIBUTE_USER_EMAIL = semanticAttributes.SEMANTIC_ATTRIBUTE_USER_EMAIL; +exports.SEMANTIC_ATTRIBUTE_USER_ID = semanticAttributes.SEMANTIC_ATTRIBUTE_USER_ID; +exports.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = semanticAttributes.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS; +exports.SEMANTIC_ATTRIBUTE_USER_USERNAME = semanticAttributes.SEMANTIC_ATTRIBUTE_USER_USERNAME; +exports.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = semanticAttributes.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE; +exports.createEventEnvelope = envelope$1.createEventEnvelope; +exports.createSessionEnvelope = envelope$1.createSessionEnvelope; +exports.createSpanEnvelope = envelope$1.createSpanEnvelope; exports.addEventProcessor = exports$1.addEventProcessor; exports.captureCheckIn = exports$1.captureCheckIn; exports.captureEvent = exports$1.captureEvent; @@ -67720,7 +21323,10 @@ exports.flush = exports$1.flush; exports.isEnabled = exports$1.isEnabled; exports.isInitialized = exports$1.isInitialized; exports.lastEventId = exports$1.lastEventId; +exports.setAttribute = exports$1.setAttribute; +exports.setAttributes = exports$1.setAttributes; exports.setContext = exports$1.setContext; +exports.setConversationId = exports$1.setConversationId; exports.setExtra = exports$1.setExtra; exports.setExtras = exports$1.setExtras; exports.setTag = exports$1.setTag; @@ -67730,95 +21336,199 @@ exports.startSession = exports$1.startSession; exports.withMonitor = exports$1.withMonitor; exports.getClient = currentScopes.getClient; exports.getCurrentScope = currentScopes.getCurrentScope; +exports.getExternalPropagationContext = currentScopes.getExternalPropagationContext; exports.getGlobalScope = currentScopes.getGlobalScope; exports.getIsolationScope = currentScopes.getIsolationScope; exports.getTraceContextFromScope = currentScopes.getTraceContextFromScope; +exports.hasExternalPropagationContext = currentScopes.hasExternalPropagationContext; +exports.registerExternalPropagationContext = currentScopes.registerExternalPropagationContext; exports.withIsolationScope = currentScopes.withIsolationScope; exports.withScope = currentScopes.withScope; exports.getDefaultCurrentScope = defaultScopes.getDefaultCurrentScope; exports.getDefaultIsolationScope = defaultScopes.getDefaultIsolationScope; -exports.setAsyncContextStrategy = index.setAsyncContextStrategy; +exports.getAsyncContextStrategy = index$7.getAsyncContextStrategy; +exports.setAsyncContextStrategy = index$7.setAsyncContextStrategy; +exports._INTERNAL_createTracingChannelBinding = tracingChannelBinding._INTERNAL_createTracingChannelBinding; +exports.waitForTracingChannelBinding = tracingChannelBinding.waitForTracingChannelBinding; +exports.getGlobalSingleton = carrier.getGlobalSingleton; exports.getMainCarrier = carrier.getMainCarrier; exports.closeSession = session.closeSession; exports.makeSession = session.makeSession; exports.updateSession = session.updateSession; -exports.SessionFlusher = sessionflusher.SessionFlusher; exports.Scope = scope.Scope; exports.notifyEventProcessors = eventProcessors.notifyEventProcessors; +exports.SENTRY_API_VERSION = api.SENTRY_API_VERSION; exports.getEnvelopeEndpointWithUrlEncodedAuth = api.getEnvelopeEndpointWithUrlEncodedAuth; exports.getReportDialogEndpoint = api.getReportDialogEndpoint; -exports.BaseClient = baseclient.BaseClient; -exports.ServerRuntimeClient = serverRuntimeClient.ServerRuntimeClient; +exports.Client = client.Client; exports.initAndBind = sdk.initAndBind; exports.setCurrentClient = sdk.setCurrentClient; exports.createTransport = base.createTransport; exports.makeOfflineTransport = offline.makeOfflineTransport; +exports.MULTIPLEXED_TRANSPORT_EXTRA_KEY = multiplexed.MULTIPLEXED_TRANSPORT_EXTRA_KEY; exports.makeMultiplexedTransport = multiplexed.makeMultiplexedTransport; exports.addIntegration = integration.addIntegration; exports.defineIntegration = integration.defineIntegration; +exports.extendIntegration = integration.extendIntegration; exports.getIntegrationsToSetup = integration.getIntegrationsToSetup; -exports.applyScopeDataToEvent = applyScopeDataToEvent.applyScopeDataToEvent; -exports.mergeScopeData = applyScopeDataToEvent.mergeScopeData; +exports.installedIntegrations = integration.installedIntegrations; +exports._INTERNAL_clearAiProviderSkips = providerSkip._INTERNAL_clearAiProviderSkips; +exports._INTERNAL_shouldSkipAiProviderWrapping = providerSkip._INTERNAL_shouldSkipAiProviderWrapping; +exports._INTERNAL_skipAiProviderWrapping = providerSkip._INTERNAL_skipAiProviderWrapping; +exports._INTERNAL_filterKeyValueData = filterKeyValueData.filterKeyValueData; +exports._INTERNAL_filterCookies = filterCookies.filterCookies; +exports._INTERNAL_filterQueryParams = filterQueryParams.filterQueryParams; +exports.envToBool = envToBool.envToBool; +exports.applyScopeDataToEvent = scopeData.applyScopeDataToEvent; +exports.getCombinedScopeData = scopeData.getCombinedScopeData; +exports.mergeScopeData = scopeData.mergeScopeData; exports.prepareEvent = prepareEvent.prepareEvent; exports.createCheckInEnvelope = checkin.createCheckInEnvelope; -exports.hasTracingEnabled = hasTracingEnabled.hasTracingEnabled; +exports.hasSpansEnabled = hasSpansEnabled.hasSpansEnabled; +exports.isStreamedBeforeSendSpanCallback = beforeSendSpan.isStreamedBeforeSendSpanCallback; +exports.withStreamedSpan = beforeSendSpan.withStreamedSpan; exports.isSentryRequestUrl = isSentryRequestUrl.isSentryRequestUrl; exports.handleCallbackErrors = handleCallbackErrors.handleCallbackErrors; +exports.fmt = parameterize.fmt; exports.parameterize = parameterize.parameterize; +exports.handleTunnelRequest = tunnel.handleTunnelRequest; +exports.addAutoIpAddressToSession = ipAddress.addAutoIpAddressToSession; +exports.addAutoIpAddressToUser = ipAddress.addAutoIpAddressToUser; +exports.INTERNAL_getSegmentSpan = spanUtils.INTERNAL_getSegmentSpan; exports.addChildSpanToSpan = spanUtils.addChildSpanToSpan; +exports.convertSpanLinksForEnvelope = spanUtils.convertSpanLinksForEnvelope; exports.getActiveSpan = spanUtils.getActiveSpan; exports.getRootSpan = spanUtils.getRootSpan; exports.getSpanDescendants = spanUtils.getSpanDescendants; exports.getStatusMessage = spanUtils.getStatusMessage; exports.spanIsSampled = spanUtils.spanIsSampled; +exports.spanIsSentrySpan = spanUtils.spanIsSentrySpan; exports.spanTimeInputToSeconds = spanUtils.spanTimeInputToSeconds; exports.spanToJSON = spanUtils.spanToJSON; +exports.spanToStreamedSpanJSON = spanUtils.spanToStreamedSpanJSON; exports.spanToTraceContext = spanUtils.spanToTraceContext; exports.spanToTraceHeader = spanUtils.spanToTraceHeader; exports.updateSpanName = spanUtils.updateSpanName; +exports._INTERNAL_setSpanForScope = spanOnScope._setSpanForScope; exports.parseSampleRate = parseSampleRate.parseSampleRate; exports.applySdkMetadata = sdkMetadata.applySdkMetadata; exports.getTraceData = traceData.getTraceData; +exports.shouldPropagateTraceForUrl = tracePropagationTargets.shouldPropagateTraceForUrl; exports.getTraceMetaTags = meta.getTraceMetaTags; -exports.DEFAULT_ENVIRONMENT = constants.DEFAULT_ENVIRONMENT; +exports.debounce = debounce.debounce; +exports.uniq = array.uniq; +exports.derefWeakRef = weakRef.derefWeakRef; +exports.makeWeakRef = weakRef.makeWeakRef; +exports.shouldIgnoreSpan = shouldIgnoreSpan.shouldIgnoreSpan; +exports.MAX_BODY_BYTE_LENGTH = request.MAX_BODY_BYTE_LENGTH; +exports.captureBodyFromWinterCGRequest = request.captureBodyFromWinterCGRequest; +exports.extractQueryParamsFromUrl = request.extractQueryParamsFromUrl; +exports.getMaxBodyByteLength = request.getMaxBodyByteLength; +exports.headersToDict = request.headersToDict; +exports.httpHeadersToSpanAttributes = request.httpHeadersToSpanAttributes; +exports.httpRequestToRequestData = request.httpRequestToRequestData; +exports.winterCGHeadersToDict = request.winterCGHeadersToDict; +exports.winterCGRequestToRequestData = request.winterCGRequestToRequestData; +exports.DEFAULT_ENVIRONMENT = constants$1.DEFAULT_ENVIRONMENT; +exports.DEV_ENVIRONMENT = constants$1.DEV_ENVIRONMENT; +exports.SPAN_KIND = spanKind.SPAN_KIND; +exports.spanKindToName = spanKind.spanKindToName; exports.addBreadcrumb = breadcrumbs.addBreadcrumb; exports.functionToStringIntegration = functiontostring.functionToStringIntegration; -exports.inboundFiltersIntegration = inboundfilters.inboundFiltersIntegration; +exports.eventFiltersIntegration = eventFilters.eventFiltersIntegration; +exports.inboundFiltersIntegration = eventFilters.inboundFiltersIntegration; exports.linkedErrorsIntegration = linkederrors.linkedErrorsIntegration; -exports.moduleMetadataIntegration = metadata.moduleMetadataIntegration; +exports.moduleMetadataIntegration = moduleMetadata.moduleMetadataIntegration; exports.requestDataIntegration = requestdata.requestDataIntegration; exports.captureConsoleIntegration = captureconsole.captureConsoleIntegration; -exports.debugIntegration = debug.debugIntegration; exports.dedupeIntegration = dedupe.dedupeIntegration; exports.extraErrorDataIntegration = extraerrordata.extraErrorDataIntegration; exports.rewriteFramesIntegration = rewriteframes.rewriteFramesIntegration; -exports.sessionTimingIntegration = sessiontiming.sessionTimingIntegration; +exports.instrumentSupabaseClient = supabase.instrumentSupabaseClient; +exports.supabaseIntegration = supabase.supabaseIntegration; exports.zodErrorsIntegration = zoderrors.zodErrorsIntegration; exports.thirdPartyErrorFilterIntegration = thirdPartyErrorsFilter.thirdPartyErrorFilterIntegration; -exports.metrics = exports$2.metrics; +exports.consoleIntegration = console$1.consoleIntegration; +exports.featureFlagsIntegration = featureFlagsIntegration.featureFlagsIntegration; +exports.growthbookIntegration = growthbook.growthbookIntegration; +exports.conversationIdIntegration = conversationId.conversationIdIntegration; exports.profiler = profiling.profiler; -exports.metricsDefault = exportsDefault.metricsDefault; -exports.BrowserMetricsAggregator = browserAggregator.BrowserMetricsAggregator; -exports.getMetricSummaryJsonForSpan = metricSummary.getMetricSummaryJsonForSpan; -exports.addTracingHeadersToFetchRequest = fetch.addTracingHeadersToFetchRequest; +exports._INTERNAL_getTracingHeadersForFetchRequest = fetch._INTERNAL_getTracingHeadersForFetchRequest; exports.instrumentFetchRequest = fetch.instrumentFetchRequest; -exports.trpcMiddleware = trpc.trpcMiddleware; exports.captureFeedback = feedback.captureFeedback; -exports.getCurrentHub = getCurrentHubShim.getCurrentHub; -exports.getCurrentHubShim = getCurrentHubShim.getCurrentHubShim; +exports._INTERNAL_captureLog = internal._INTERNAL_captureLog; +exports._INTERNAL_captureSerializedLog = internal._INTERNAL_captureSerializedLog; +exports._INTERNAL_flushLogsBuffer = internal._INTERNAL_flushLogsBuffer; +exports.logger = publicApi; +exports.consoleLoggingIntegration = consoleIntegration.consoleLoggingIntegration; +exports._INTERNAL_captureMetric = internal$1._INTERNAL_captureMetric; +exports._INTERNAL_captureSerializedMetric = internal$1._INTERNAL_captureSerializedMetric; +exports._INTERNAL_flushMetricsBuffer = internal$1._INTERNAL_flushMetricsBuffer; +exports.metrics = publicApi$1; +exports.createConsolaReporter = consola.createConsolaReporter; +exports.addVercelAiProcessors = index$4.addVercelAiProcessors; +exports.getProviderMetadataAttributes = index$4.getProviderMetadataAttributes; +exports.getTruncatedJsonString = utils$5.getTruncatedJsonString; +exports.resolveAIRecordingOptions = utils$5.resolveAIRecordingOptions; +exports.shouldEnableTruncation = utils$5.shouldEnableTruncation; +exports.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE = genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE; +exports.GEN_AI_REQUEST_MODEL_ATTRIBUTE = genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE; +exports.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE = genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE; +exports._INTERNAL_cleanupToolCallSpanContext = utils._INTERNAL_cleanupToolCallSpanContext; +exports._INTERNAL_getSpanContextForToolCallId = utils._INTERNAL_getSpanContextForToolCallId; +exports._INTERNAL_toolCallSpanContextMap = constants$7.toolCallSpanContextMap; +exports.addOpenAiRequestAttributes = index$3.addRequestAttributes; +exports.extractOpenAiRequestAttributes = index$3.extractRequestAttributes; +exports.instrumentOpenAiClient = index$3.instrumentOpenAiClient; +exports.addOpenAiResponseAttributes = utils$2.addResponseAttributes; +exports.extractOpenAiRequestParameters = utils$2.extractRequestParameters; +exports.instrumentOpenAiStream = streaming$2.instrumentStream; +exports.OPENAI_INTEGRATION_NAME = constants$6.OPENAI_INTEGRATION_NAME; +exports.addAnthropicRequestAttributes = index$1.addPrivateRequestAttributes; +exports.addAnthropicResponseAttributes = index$1.addResponseAttributes; +exports.extractAnthropicRequestAttributes = index$1.extractRequestAttributes; +exports.instrumentAnthropicAiClient = index$1.instrumentAnthropicAiClient; +exports.instrumentAsyncIterableStream = streaming.instrumentAsyncIterableStream; +exports.instrumentMessageStream = streaming.instrumentMessageStream; +exports.ANTHROPIC_AI_INTEGRATION_NAME = constants.ANTHROPIC_AI_INTEGRATION_NAME; +exports.addGoogleGenAIRequestAttributes = index$2.addPrivateRequestAttributes; +exports.addGoogleGenAIResponseAttributes = index$2.addResponseAttributes; +exports.extractGoogleGenAIRequestAttributes = index$2.extractRequestAttributes; +exports.instrumentGoogleGenAIClient = index$2.instrumentGoogleGenAIClient; +exports.instrumentGoogleGenAIStream = streaming$1.instrumentStream; +exports.GOOGLE_GENAI_INTEGRATION_NAME = constants$2.GOOGLE_GENAI_INTEGRATION_NAME; +exports.createLangChainCallbackHandler = index$5.createLangChainCallbackHandler; +exports._INTERNAL_getLangChainEmbeddingsSpanOptions = embeddings._INTERNAL_getLangChainEmbeddingsSpanOptions; +exports.instrumentLangChainEmbeddings = embeddings.instrumentLangChainEmbeddings; +exports._INTERNAL_mergeLangChainCallbackHandler = utils$1._INTERNAL_mergeLangChainCallbackHandler; +exports.LANGCHAIN_INTEGRATION_NAME = constants$4.LANGCHAIN_INTEGRATION_NAME; +exports._INTERNAL_getLangGraphCreateAgentSpanOptions = index._INTERNAL_getLangGraphCreateAgentSpanOptions; +exports.instrumentCompiledGraphInvoke = index.instrumentCompiledGraphInvoke; +exports.instrumentCreateReactAgent = index.instrumentCreateReactAgent; +exports.instrumentLangGraph = index.instrumentLangGraph; +exports.instrumentStateGraph = index.instrumentStateGraph; +exports.instrumentStateGraphCompile = index.instrumentStateGraphCompile; +exports.extractAgentNameFromParams = utils$3.extractAgentNameFromParams; +exports.extractLLMFromParams = utils$3.extractLLMFromParams; +exports.wrapToolsWithSpans = utils$3.wrapToolsWithSpans; +exports.LANGGRAPH_INTEGRATION_NAME = constants$5.LANGGRAPH_INTEGRATION_NAME; +exports.instrumentWorkersAiClient = index$8.instrumentWorkersAiClient; +exports.SpanBuffer = spanBuffer.SpanBuffer; +exports.hasSpanStreamingEnabled = hasSpanStreamingEnabled.hasSpanStreamingEnabled; +exports.spanStreamingIntegration = spanStreaming.spanStreamingIntegration; +exports._INTERNAL_FLAG_BUFFER_SIZE = featureFlags._INTERNAL_FLAG_BUFFER_SIZE; +exports._INTERNAL_MAX_FLAGS_PER_SPAN = featureFlags._INTERNAL_MAX_FLAGS_PER_SPAN; +exports._INTERNAL_addFeatureFlagToActiveSpan = featureFlags._INTERNAL_addFeatureFlagToActiveSpan; +exports._INTERNAL_copyFlagsFromScopeToEvent = featureFlags._INTERNAL_copyFlagsFromScopeToEvent; +exports._INTERNAL_insertFlagToScope = featureFlags._INTERNAL_insertFlagToScope; exports.applyAggregateErrorsToEvent = aggregateErrors.applyAggregateErrorsToEvent; -exports.flatten = array.flatten; exports.getBreadcrumbLogLevelFromHttpStatusCode = breadcrumbLogLevel.getBreadcrumbLogLevelFromHttpStatusCode; -exports.getComponentName = browser.getComponentName; -exports.getDomElement = browser.getDomElement; -exports.getLocationHref = browser.getLocationHref; -exports.htmlTreeAsString = browser.htmlTreeAsString; exports.dsnFromString = dsn.dsnFromString; exports.dsnToString = dsn.dsnToString; exports.makeDsn = dsn.makeDsn; exports.SentryError = error.SentryError; exports.GLOBAL_OBJ = worldwide.GLOBAL_OBJ; -exports.getGlobalSingleton = worldwide.getGlobalSingleton; +exports.addConsoleInstrumentationFilter = console.addConsoleInstrumentationFilter; exports.addConsoleInstrumentationHandler = console.addConsoleInstrumentationHandler; exports.addFetchEndInstrumentationHandler = fetch$1.addFetchEndInstrumentationHandler; exports.addFetchInstrumentationHandler = fetch$1.addFetchInstrumentationHandler; @@ -67835,6 +21545,7 @@ exports.isError = is.isError; exports.isErrorEvent = is.isErrorEvent; exports.isEvent = is.isEvent; exports.isInstanceOf = is.isInstanceOf; +exports.isObjectLike = is.isObjectLike; exports.isParameterizedString = is.isParameterizedString; exports.isPlainObject = is.isPlainObject; exports.isPrimitive = is.isPrimitive; @@ -67844,25 +21555,24 @@ exports.isSyntheticEvent = is.isSyntheticEvent; exports.isThenable = is.isThenable; exports.isVueViewModel = is.isVueViewModel; exports.isBrowser = isBrowser.isBrowser; -exports.CONSOLE_LEVELS = logger.CONSOLE_LEVELS; -exports.consoleSandbox = logger.consoleSandbox; -exports.logger = logger.logger; -exports.originalConsoleMethods = logger.originalConsoleMethods; -exports.memoBuilder = memo.memoBuilder; +exports.CONSOLE_LEVELS = debugLogger.CONSOLE_LEVELS; +exports.consoleSandbox = debugLogger.consoleSandbox; +exports.debug = debugLogger.debug; +exports.originalConsoleMethods = debugLogger.originalConsoleMethods; exports.addContextToFrame = misc.addContextToFrame; exports.addExceptionMechanism = misc.addExceptionMechanism; exports.addExceptionTypeValue = misc.addExceptionTypeValue; -exports.arrayify = misc.arrayify; exports.checkOrSetAlreadyCaught = misc.checkOrSetAlreadyCaught; exports.getEventDescription = misc.getEventDescription; +exports.isAlreadyCaptured = misc.isAlreadyCaptured; exports.parseSemver = misc.parseSemver; exports.uuid4 = misc.uuid4; -exports.dynamicRequire = node.dynamicRequire; -exports.isNodeEnv = node.isNodeEnv; -exports.loadModule = node.loadModule; exports.normalize = normalize.normalize; exports.normalizeToSize = normalize.normalizeToSize; exports.normalizeUrlToBase = normalize.normalizeUrlToBase; +exports.setNormalizeStringifier = normalize.setNormalizeStringifier; +exports.setNormalizationDepthOverrideHint = normalizationHints.setNormalizationDepthOverrideHint; +exports.setSkipNormalizationHint = normalizationHints.setSkipNormalizationHint; exports.addNonEnumerableProperty = object.addNonEnumerableProperty; exports.convertToPlainObject = object.convertToPlainObject; exports.dropUndefinedKeys = object.dropUndefinedKeys; @@ -67871,7 +21581,6 @@ exports.fill = object.fill; exports.getOriginalFunction = object.getOriginalFunction; exports.markFunctionWrapped = object.markFunctionWrapped; exports.objectify = object.objectify; -exports.urlEncode = object.urlEncode; exports.basename = path.basename; exports.dirname = path.dirname; exports.isAbsolute = path.isAbsolute; @@ -67879,279 +21588,674 @@ exports.join = path.join; exports.normalizePath = path.normalizePath; exports.relative = path.relative; exports.resolve = path.resolve; +exports.SENTRY_BUFFER_FULL_ERROR = promisebuffer.SENTRY_BUFFER_FULL_ERROR; exports.makePromiseBuffer = promisebuffer.makePromiseBuffer; -exports.DEFAULT_USER_INCLUDES = requestdata$1.DEFAULT_USER_INCLUDES; -exports.addNormalizedRequestDataToEvent = requestdata$1.addNormalizedRequestDataToEvent; -exports.addRequestDataToEvent = requestdata$1.addRequestDataToEvent; -exports.extractPathForTransaction = requestdata$1.extractPathForTransaction; -exports.extractQueryParamsFromUrl = requestdata$1.extractQueryParamsFromUrl; -exports.extractRequestData = requestdata$1.extractRequestData; -exports.headersToDict = requestdata$1.headersToDict; -exports.httpRequestToRequestData = requestdata$1.httpRequestToRequestData; -exports.winterCGHeadersToDict = requestdata$1.winterCGHeadersToDict; -exports.winterCGRequestToRequestData = requestdata$1.winterCGRequestToRequestData; exports.severityLevelFromString = severity.severityLevelFromString; -exports.validSeverityLevels = severity.validSeverityLevels; +exports.replaceExports = exports$2.replaceExports; exports.UNKNOWN_FUNCTION = stacktrace.UNKNOWN_FUNCTION; exports.createStackParser = stacktrace.createStackParser; exports.getFramesFromEvent = stacktrace.getFramesFromEvent; exports.getFunctionName = stacktrace.getFunctionName; exports.stackParserFromStackParserOptions = stacktrace.stackParserFromStackParserOptions; exports.stripSentryFramesAndReverse = stacktrace.stripSentryFramesAndReverse; -exports.filenameIsInApp = nodeStackTrace.filenameIsInApp; -exports.node = nodeStackTrace.node; -exports.nodeStackLineParser = nodeStackTrace.nodeStackLineParser; exports.isMatchingPattern = string.isMatchingPattern; exports.safeJoin = string.safeJoin; exports.snipLine = string.snipLine; exports.stringMatchesSomePattern = string.stringMatchesSomePattern; +exports.stringify = string.stringify; exports.truncate = string.truncate; exports.isNativeFunction = supports.isNativeFunction; exports.supportsDOMError = supports.supportsDOMError; exports.supportsDOMException = supports.supportsDOMException; exports.supportsErrorEvent = supports.supportsErrorEvent; exports.supportsFetch = supports.supportsFetch; +exports.supportsHistory = supports.supportsHistory; exports.supportsNativeFetch = supports.supportsNativeFetch; exports.supportsReferrerPolicy = supports.supportsReferrerPolicy; exports.supportsReportingObserver = supports.supportsReportingObserver; exports.SyncPromise = syncpromise.SyncPromise; exports.rejectedSyncPromise = syncpromise.rejectedSyncPromise; exports.resolvedSyncPromise = syncpromise.resolvedSyncPromise; -Object.defineProperty(exports, "_browserPerformanceTimeOriginMode", ({ - enumerable: true, - get: () => time._browserPerformanceTimeOriginMode -})); exports.browserPerformanceTimeOrigin = time.browserPerformanceTimeOrigin; exports.dateTimestampInSeconds = time.dateTimestampInSeconds; exports.timestampInSeconds = time.timestampInSeconds; exports.TRACEPARENT_REGEXP = tracing.TRACEPARENT_REGEXP; exports.extractTraceparentData = tracing.extractTraceparentData; exports.generateSentryTraceHeader = tracing.generateSentryTraceHeader; +exports.generateTraceparentHeader = tracing.generateTraceparentHeader; exports.propagationContextFromHeaders = tracing.propagationContextFromHeaders; +exports.shouldContinueTrace = tracing.shouldContinueTrace; exports.getSDKSource = env.getSDKSource; exports.isBrowserBundle = env.isBrowserBundle; -exports.addItemToEnvelope = envelope$1.addItemToEnvelope; -exports.createAttachmentEnvelopeItem = envelope$1.createAttachmentEnvelopeItem; -exports.createEnvelope = envelope$1.createEnvelope; -exports.createEventEnvelopeHeaders = envelope$1.createEventEnvelopeHeaders; -exports.createSpanEnvelopeItem = envelope$1.createSpanEnvelopeItem; -exports.envelopeContainsItemType = envelope$1.envelopeContainsItemType; -exports.envelopeItemTypeToDataCategory = envelope$1.envelopeItemTypeToDataCategory; -exports.forEachEnvelopeItem = envelope$1.forEachEnvelopeItem; -exports.getSdkMetadataForEnvelopeHeader = envelope$1.getSdkMetadataForEnvelopeHeader; -exports.parseEnvelope = envelope$1.parseEnvelope; -exports.serializeEnvelope = envelope$1.serializeEnvelope; +exports.addItemToEnvelope = envelope.addItemToEnvelope; +exports.createAttachmentEnvelopeItem = envelope.createAttachmentEnvelopeItem; +exports.createEnvelope = envelope.createEnvelope; +exports.createEventEnvelopeHeaders = envelope.createEventEnvelopeHeaders; +exports.createSpanEnvelopeItem = envelope.createSpanEnvelopeItem; +exports.envelopeContainsItemType = envelope.envelopeContainsItemType; +exports.envelopeItemTypeToDataCategory = envelope.envelopeItemTypeToDataCategory; +exports.forEachEnvelopeItem = envelope.forEachEnvelopeItem; +exports.getSdkMetadataForEnvelopeHeader = envelope.getSdkMetadataForEnvelopeHeader; +exports.parseEnvelope = envelope.parseEnvelope; +exports.serializeEnvelope = envelope.serializeEnvelope; exports.createClientReportEnvelope = clientreport.createClientReportEnvelope; exports.DEFAULT_RETRY_AFTER = ratelimit.DEFAULT_RETRY_AFTER; exports.disabledUntil = ratelimit.disabledUntil; exports.isRateLimited = ratelimit.isRateLimited; exports.parseRetryAfterHeader = ratelimit.parseRetryAfterHeader; exports.updateRateLimits = ratelimit.updateRateLimits; -exports.BAGGAGE_HEADER_NAME = baggage.BAGGAGE_HEADER_NAME; exports.MAX_BAGGAGE_STRING_LENGTH = baggage.MAX_BAGGAGE_STRING_LENGTH; exports.SENTRY_BAGGAGE_KEY_PREFIX = baggage.SENTRY_BAGGAGE_KEY_PREFIX; exports.SENTRY_BAGGAGE_KEY_PREFIX_REGEX = baggage.SENTRY_BAGGAGE_KEY_PREFIX_REGEX; exports.baggageHeaderToDynamicSamplingContext = baggage.baggageHeaderToDynamicSamplingContext; exports.dynamicSamplingContextToSentryBaggageHeader = baggage.dynamicSamplingContextToSentryBaggageHeader; +exports.mergeBaggageHeaders = baggage.mergeBaggageHeaders; +exports.objectToBaggageHeader = baggage.objectToBaggageHeader; exports.parseBaggageHeader = baggage.parseBaggageHeader; -exports.getNumberOfUrlSegments = url.getNumberOfUrlSegments; +exports.getHttpSpanDetailsFromUrlObject = url.getHttpSpanDetailsFromUrlObject; exports.getSanitizedUrlString = url.getSanitizedUrlString; +exports.getSanitizedUrlStringFromUrlObject = url.getSanitizedUrlStringFromUrlObject; +exports.isURLObjectRelative = url.isURLObjectRelative; +exports.parseStringToURLObject = url.parseStringToURLObject; exports.parseUrl = url.parseUrl; +exports.stripDataUrlContent = url.stripDataUrlContent; exports.stripUrlQueryAndFragment = url.stripUrlQueryAndFragment; -exports.makeFifoCache = cache.makeFifoCache; +exports._INTERNAL_enhanceErrorWithSentryInfo = eventbuilder._enhanceErrorWithSentryInfo; exports.eventFromMessage = eventbuilder.eventFromMessage; exports.eventFromUnknownInput = eventbuilder.eventFromUnknownInput; exports.exceptionFromError = eventbuilder.exceptionFromError; exports.parseStackFrames = eventbuilder.parseStackFrames; -exports.callFrameToStackFrame = anr.callFrameToStackFrame; -exports.watchdogTimer = anr.watchdogTimer; exports.LRUMap = lru.LRUMap; -exports.generatePropagationContext = propagationContext.generatePropagationContext; exports.generateSpanId = propagationContext.generateSpanId; exports.generateTraceId = propagationContext.generateTraceId; -exports.vercelWaitUntil = vercelWaitUntil.vercelWaitUntil; exports.SDK_VERSION = version.SDK_VERSION; exports.getDebugImagesForResources = debugIds.getDebugImagesForResources; exports.getFilenameToDebugIdMap = debugIds.getFilenameToDebugIdMap; +exports.getFilenameToMetadataMap = metadata.getFilenameToMetadataMap; exports.escapeStringForRegex = escapeStringForRegex.escapeStringForRegex; -exports.supportsHistory = supportsHistory.supportsHistory; -exports._asyncNullishCoalesce = _asyncNullishCoalesce._asyncNullishCoalesce; -exports._asyncOptionalChain = _asyncOptionalChain._asyncOptionalChain; -exports._asyncOptionalChainDelete = _asyncOptionalChainDelete._asyncOptionalChainDelete; -exports._nullishCoalesce = _nullishCoalesce._nullishCoalesce; -exports._optionalChain = _optionalChain._optionalChain; -exports._optionalChainDelete = _optionalChainDelete._optionalChainDelete; +exports._INTERNAL_safeDateNow = randomSafeContext.safeDateNow; +exports._INTERNAL_safeMathRandom = randomSafeContext.safeMathRandom; +exports._INTERNAL_withRandomSafeContext = randomSafeContext.withRandomSafeContext; +exports.ServerRuntimeClient = serverRuntimeClient.ServerRuntimeClient; +exports.trpcMiddleware = trpc.trpcMiddleware; +exports.wrapMcpServerWithSentry = index$9.wrapMcpServerWithSentry; +exports.isNodeEnv = node.isNodeEnv; +exports.loadModule = node.loadModule; +exports.filenameIsInApp = nodeStackTrace.filenameIsInApp; +exports.node = nodeStackTrace.node; +exports.nodeStackLineParser = nodeStackTrace.nodeStackLineParser; +exports.vercelWaitUntil = vercelWaitUntil.vercelWaitUntil; +exports.flushIfServerless = flushIfServerless.flushIfServerless; +exports.callFrameToStackFrame = anr.callFrameToStackFrame; +exports.watchdogTimer = anr.watchdogTimer; +exports._INTERNAL_safeUnref = timer.safeUnref; +exports.expressErrorHandler = index$6.expressErrorHandler; +exports.patchExpressModule = index$6.patchExpressModule; +exports.setupExpressErrorHandler = index$6.setupExpressErrorHandler; +exports._INTERNAL_buildPostgresConnectionContext = postgresjs._buildConnectionContext; +exports._INTERNAL_reconstructPostgresQuery = postgresjs._reconstructQuery; +exports._INTERNAL_sanitizeSqlQuery = postgresjs._sanitizeSqlQuery; +exports._INTERNAL_setPostgresConnectionAttributes = postgresjs._setConnectionAttributes; +exports._INTERNAL_setPostgresOperationName = postgresjs._setOperationName; +exports.instrumentPostgresJsSql = postgresjs.instrumentPostgresJsSql; +exports._INTERNAL_getSqlQuerySummary = sql.getSqlQuerySummary; +exports.patchHttpModuleClient = clientPatch.patchHttpModuleClient; +exports.getHttpClientSubscriptions = clientSubscriptions.getHttpClientSubscriptions; +exports.getHttpServerSubscriptions = serverSubscription.getHttpServerSubscriptions; +exports.isStaticAssetRequest = serverSubscription.isStaticAssetRequest; +exports.recordRequestSession = recordRequestSession.recordRequestSession; +exports.addOutgoingRequestBreadcrumb = addOutgoingRequestBreadcrumb.addOutgoingRequestBreadcrumb; +exports.getRequestOptions = getRequestUrl.getRequestOptions; +exports.getRequestUrl = getRequestUrl.getRequestUrl; +exports.getRequestUrlFromClientRequest = getRequestUrl.getRequestUrlFromClientRequest; +exports.getRequestUrlObject = getRequestUrl.getRequestUrlObject; +exports.HTTP_ON_CLIENT_REQUEST = constants$3.HTTP_ON_CLIENT_REQUEST; +exports.HTTP_ON_SERVER_REQUEST = constants$3.HTTP_ON_SERVER_REQUEST; +exports.getComponentName = browser.getComponentName; +exports.getLocationHref = browser.getLocationHref; +exports.htmlTreeAsString = browser.htmlTreeAsString; //# sourceMappingURL=index.js.map +/***/ }), + +/***/ 98510: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const object = __nccwpck_require__(5906); +const string = __nccwpck_require__(77673); +const worldwide = __nccwpck_require__(90935); +const handlers = __nccwpck_require__(48176); + +const _filter = /* @__PURE__ */ new Set([]); +function addConsoleInstrumentationHandler(handler) { + const type = "console"; + const removeHandler = handlers.addHandler(type, handler); + handlers.maybeInstrument(type, instrumentConsole); + return removeHandler; +} +function addConsoleInstrumentationFilter(filter) { + for (const f of filter) { + _filter.add(f); + } + return () => { + for (const f of filter) { + _filter.delete(f); + } + }; +} +const instrumentedLevels = /* @__PURE__ */ new Set(); +function instrumentConsole() { + if (!("console" in worldwide.GLOBAL_OBJ)) { + return; + } + debugLogger.CONSOLE_LEVELS.forEach(function(level) { + if (instrumentedLevels.has(level) || !(level in worldwide.GLOBAL_OBJ.console)) { + return; + } + instrumentedLevels.add(level); + object.fill(worldwide.GLOBAL_OBJ.console, level, function(originalConsoleMethod) { + debugLogger.originalConsoleMethods[level] = originalConsoleMethod; + return function(...args) { + const firstArg = args[0]; + const log = debugLogger.originalConsoleMethods[level]; + const isFiltered = _filter.size && typeof firstArg === "string" && string.stringMatchesSomePattern(firstArg, _filter); + if (!isFiltered) { + handlers.triggerHandlers("console", { args, level }); + } + if (!isFiltered || debugBuild.DEBUG_BUILD && debugLogger.debug.isEnabled()) { + log?.apply(worldwide.GLOBAL_OBJ.console, args); + } + }; + }); + }); +} + +exports.addConsoleInstrumentationFilter = addConsoleInstrumentationFilter; +exports.addConsoleInstrumentationHandler = addConsoleInstrumentationHandler; +exports.instrumentConsole = instrumentConsole; +//# sourceMappingURL=console.js.map + + +/***/ }), + +/***/ 75393: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const is = __nccwpck_require__(68370); +const object = __nccwpck_require__(5906); +const supports = __nccwpck_require__(59809); +const time = __nccwpck_require__(66690); +const worldwide = __nccwpck_require__(90935); +const handlers = __nccwpck_require__(48176); + +function addFetchInstrumentationHandler(handler, skipNativeFetchCheck) { + const type = "fetch"; + const removeHandler = handlers.addHandler(type, handler); + handlers.maybeInstrument(type, () => instrumentFetch(void 0, skipNativeFetchCheck)); + return removeHandler; +} +function addFetchEndInstrumentationHandler(handler) { + const type = "fetch-body-resolved"; + const removeHandler = handlers.addHandler(type, handler); + handlers.maybeInstrument(type, () => instrumentFetch(streamHandler)); + return removeHandler; +} +function instrumentFetch(onFetchResolved, skipNativeFetchCheck = false) { + if (skipNativeFetchCheck && !supports.supportsNativeFetch()) { + return; + } + object.fill(worldwide.GLOBAL_OBJ, "fetch", function(originalFetch) { + return function(...args) { + const virtualError = new Error(); + const { method, url } = parseFetchArgs(args); + const handlerData = { + args, + fetchData: { + method, + url + }, + startTimestamp: time.timestampInSeconds() * 1e3, + // // Adding the error to be able to fingerprint the failed fetch event in HttpClient instrumentation + virtualError, + headers: getHeadersFromFetchArgs(args) + }; + if (!onFetchResolved) { + handlers.triggerHandlers("fetch", { + ...handlerData + }); + } + return originalFetch.apply(worldwide.GLOBAL_OBJ, args).then( + async (response) => { + if (onFetchResolved) { + onFetchResolved(response); + } else { + handlers.triggerHandlers("fetch", { + ...handlerData, + endTimestamp: time.timestampInSeconds() * 1e3, + response + }); + } + return response; + }, + (error) => { + handlers.triggerHandlers("fetch", { + ...handlerData, + endTimestamp: time.timestampInSeconds() * 1e3, + error + }); + if (is.isError(error) && error.stack === void 0) { + error.stack = virtualError.stack; + object.addNonEnumerableProperty(error, "framesToPop", 1); + } + const client = currentScopes.getClient(); + const enhanceOption = client?.getOptions().enhanceFetchErrorMessages ?? "always"; + const shouldEnhance = enhanceOption !== false; + if (shouldEnhance && is.isError(error) && error.name === "TypeError" && (error.message === "Failed to fetch" || error.message === "Load failed" || error.message === "NetworkError when attempting to fetch resource.")) { + try { + const url2 = new URL(handlerData.fetchData.url); + const hostname = url2.host; + if (enhanceOption === "always") { + error.message = `${error.message} (${hostname})`; + } else { + object.addNonEnumerableProperty(error, "__sentry_fetch_url_host__", hostname); + } + } catch { + } + } + throw error; + } + ); + }; + }); +} +async function resolveResponse(res, onFinishedResolving) { + if (res?.body) { + const body = res.body; + const responseReader = body.getReader(); + const maxFetchDurationTimeout = setTimeout( + () => { + body.cancel().then(null, () => { + }); + }, + 90 * 1e3 + // 90s + ); + let readingActive = true; + while (readingActive) { + let chunkTimeout; + try { + chunkTimeout = setTimeout(() => { + body.cancel().then(null, () => { + }); + }, 5e3); + const { done } = await responseReader.read(); + clearTimeout(chunkTimeout); + if (done) { + onFinishedResolving(); + readingActive = false; + } + } catch { + readingActive = false; + } finally { + clearTimeout(chunkTimeout); + } + } + clearTimeout(maxFetchDurationTimeout); + responseReader.releaseLock(); + body.cancel().then(null, () => { + }); + } +} +function streamHandler(response) { + let clonedResponseForResolving; + try { + clonedResponseForResolving = response.clone(); + } catch { + return; + } + resolveResponse(clonedResponseForResolving, () => { + handlers.triggerHandlers("fetch-body-resolved", { + endTimestamp: time.timestampInSeconds() * 1e3, + response + }); + }); +} +function hasProp(obj, prop) { + return is.isObjectLike(obj) && !!obj[prop]; +} +function getUrlFromResource(resource) { + if (typeof resource === "string") { + return resource; + } + if (!resource) { + return ""; + } + if (hasProp(resource, "url")) { + return resource.url; + } + if (resource.toString) { + return resource.toString(); + } + return ""; +} +function parseFetchArgs(fetchArgs) { + if (fetchArgs.length === 0) { + return { method: "GET", url: "" }; + } + if (fetchArgs.length === 2) { + const [resource, options] = fetchArgs; + return { + url: getUrlFromResource(resource), + method: hasProp(options, "method") ? String(options.method).toUpperCase() : ( + // Request object as first argument + is.isRequest(resource) && hasProp(resource, "method") ? String(resource.method).toUpperCase() : "GET" + ) + }; + } + const arg = fetchArgs[0]; + return { + url: getUrlFromResource(arg), + method: hasProp(arg, "method") ? String(arg.method).toUpperCase() : "GET" + }; +} +function getHeadersFromFetchArgs(fetchArgs) { + const [requestArgument, optionsArgument] = fetchArgs; + try { + if (typeof optionsArgument === "object" && optionsArgument !== null && "headers" in optionsArgument && optionsArgument.headers) { + return new Headers(optionsArgument.headers); + } + if (is.isRequest(requestArgument)) { + return new Headers(requestArgument.headers); + } + } catch { + } + return; +} + +exports.addFetchEndInstrumentationHandler = addFetchEndInstrumentationHandler; +exports.addFetchInstrumentationHandler = addFetchInstrumentationHandler; +exports.parseFetchArgs = parseFetchArgs; +//# sourceMappingURL=fetch.js.map + + +/***/ }), + +/***/ 63022: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const worldwide = __nccwpck_require__(90935); +const handlers = __nccwpck_require__(48176); + +let _oldOnErrorHandler = null; +function addGlobalErrorInstrumentationHandler(handler) { + const type = "error"; + handlers.addHandler(type, handler); + handlers.maybeInstrument(type, instrumentError); +} +function instrumentError() { + _oldOnErrorHandler = worldwide.GLOBAL_OBJ.onerror; + worldwide.GLOBAL_OBJ.onerror = function(msg, url, line, column, error) { + const handlerData = { + column, + error, + line, + msg, + url + }; + handlers.triggerHandlers("error", handlerData); + if (_oldOnErrorHandler) { + return _oldOnErrorHandler.apply(this, arguments); + } + return false; + }; + worldwide.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; +} + +exports.addGlobalErrorInstrumentationHandler = addGlobalErrorInstrumentationHandler; +//# sourceMappingURL=globalError.js.map + + +/***/ }), + +/***/ 36099: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const worldwide = __nccwpck_require__(90935); +const handlers = __nccwpck_require__(48176); + +let _oldOnUnhandledRejectionHandler = null; +function addGlobalUnhandledRejectionInstrumentationHandler(handler) { + const type = "unhandledrejection"; + handlers.addHandler(type, handler); + handlers.maybeInstrument(type, instrumentUnhandledRejection); +} +function instrumentUnhandledRejection() { + _oldOnUnhandledRejectionHandler = worldwide.GLOBAL_OBJ.onunhandledrejection; + worldwide.GLOBAL_OBJ.onunhandledrejection = function(e) { + const handlerData = e; + handlers.triggerHandlers("unhandledrejection", handlerData); + if (_oldOnUnhandledRejectionHandler) { + return _oldOnUnhandledRejectionHandler.apply(this, arguments); + } + return true; + }; + worldwide.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; +} + +exports.addGlobalUnhandledRejectionInstrumentationHandler = addGlobalUnhandledRejectionInstrumentationHandler; +//# sourceMappingURL=globalUnhandledRejection.js.map + + +/***/ }), + +/***/ 48176: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const stacktrace = __nccwpck_require__(22902); + +const handlers = {}; +const instrumented = {}; +function addHandler(type, handler) { + handlers[type] = handlers[type] || []; + handlers[type].push(handler); + return () => { + const typeHandlers = handlers[type]; + if (typeHandlers) { + const index = typeHandlers.indexOf(handler); + if (index !== -1) { + typeHandlers.splice(index, 1); + } + } + }; +} +function resetInstrumentationHandlers() { + Object.keys(handlers).forEach((key) => { + handlers[key] = void 0; + }); +} +function maybeInstrument(type, instrumentFn) { + if (!instrumented[type]) { + instrumented[type] = true; + try { + instrumentFn(); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error(`Error while instrumenting ${type}`, e); + } + } +} +function triggerHandlers(type, data) { + const typeHandlers = type && handlers[type]; + if (!typeHandlers) { + return; + } + for (const handler of typeHandlers) { + try { + handler(data); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error( + `Error while triggering instrumentation handler. +Type: ${type} +Name: ${stacktrace.getFunctionName(handler)} +Error:`, + e + ); + } + } +} + +exports.addHandler = addHandler; +exports.maybeInstrument = maybeInstrument; +exports.resetInstrumentationHandlers = resetInstrumentationHandlers; +exports.triggerHandlers = triggerHandlers; +//# sourceMappingURL=handlers.js.map + + /***/ }), /***/ 67428: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); -const logger = __nccwpck_require__(38752); +const debugLogger = __nccwpck_require__(41772); const installedIntegrations = []; - -/** Map of integrations assigned to a client */ - -/** - * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to - * preserve the order of integrations in the array. - * - * @private - */ function filterDuplicates(integrations) { const integrationsByName = {}; - integrations.forEach((currentInstance) => { const { name } = currentInstance; - const existingInstance = integrationsByName[name]; - - // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a - // default instance to overwrite an existing user instance if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { return; } - integrationsByName[name] = currentInstance; }); - return Object.values(integrationsByName); } - -/** Gets integrations to install */ function getIntegrationsToSetup(options) { const defaultIntegrations = options.defaultIntegrations || []; const userIntegrations = options.integrations; - - // We flag default instances, so that later we can tell them apart from any user-created instances of the same class defaultIntegrations.forEach((integration) => { integration.isDefaultInstance = true; }); - let integrations; - if (Array.isArray(userIntegrations)) { integrations = [...defaultIntegrations, ...userIntegrations]; - } else if (typeof userIntegrations === 'function') { + } else if (typeof userIntegrations === "function") { const resolvedUserIntegrations = userIntegrations(defaultIntegrations); integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations]; } else { integrations = defaultIntegrations; } - - const finalIntegrations = filterDuplicates(integrations); - - // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or - // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event - // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore - // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array. - const debugIndex = finalIntegrations.findIndex(integration => integration.name === 'Debug'); - if (debugIndex > -1) { - const [debugInstance] = finalIntegrations.splice(debugIndex, 1) ; - finalIntegrations.push(debugInstance); - } - - return finalIntegrations; + return filterDuplicates(integrations); } - -/** - * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default - * integrations are added unless they were already provided before. - * @param integrations array of integration instances - * @param withDefault should enable default integrations - */ function setupIntegrations(client, integrations) { const integrationIndex = {}; - - integrations.forEach(integration => { - // guard against empty provided integrations + integrations.forEach((integration) => { + if (integration?.beforeSetup) { + integration.beforeSetup(client); + } + }); + integrations.forEach((integration) => { if (integration) { setupIntegration(client, integration, integrationIndex); } }); - return integrationIndex; } - -/** - * Execute the `afterAllSetup` hooks of the given integrations. - */ function afterSetupIntegrations(client, integrations) { for (const integration of integrations) { - // guard against empty provided integrations - if (integration && integration.afterAllSetup) { + if (integration?.afterAllSetup) { integration.afterAllSetup(client); } } } - -/** Setup a single integration. */ function setupIntegration(client, integration, integrationIndex) { if (integrationIndex[integration.name]) { - debugBuild.DEBUG_BUILD && logger.logger.log(`Integration skipped because it was already installed: ${integration.name}`); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Integration skipped because it was already installed: ${integration.name}`); return; } integrationIndex[integration.name] = integration; - - // `setupOnce` is only called the first time - if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === 'function') { + if (!installedIntegrations.includes(integration.name) && typeof integration.setupOnce === "function") { integration.setupOnce(); installedIntegrations.push(integration.name); } - - // `setup` is run for each client - if (integration.setup && typeof integration.setup === 'function') { + if (integration.setup && typeof integration.setup === "function") { integration.setup(client); } - - if (typeof integration.preprocessEvent === 'function') { - const callback = integration.preprocessEvent.bind(integration) ; - client.on('preprocessEvent', (event, hint) => callback(event, hint, client)); + if (typeof integration.preprocessEvent === "function") { + const callback = integration.preprocessEvent.bind(integration); + client.on("preprocessEvent", (event, hint) => callback(event, hint, client)); } - - if (typeof integration.processEvent === 'function') { - const callback = integration.processEvent.bind(integration) ; - + if (typeof integration.processEvent === "function") { + const callback = integration.processEvent.bind(integration); const processor = Object.assign((event, hint) => callback(event, hint, client), { - id: integration.name, + id: integration.name }); - client.addEventProcessor(processor); } - - debugBuild.DEBUG_BUILD && logger.logger.log(`Integration installed: ${integration.name}`); + ["processSpan", "processSegmentSpan"].forEach((hook) => { + const callback = integration[hook]; + if (typeof callback === "function") { + client.on(hook, (span) => callback.call(integration, span, client)); + } + }); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Integration installed: ${integration.name}`); } - -/** Add an integration to the current scope's client. */ function addIntegration(integration) { const client = currentScopes.getClient(); - if (!client) { - debugBuild.DEBUG_BUILD && logger.logger.warn(`Cannot add integration "${integration.name}" because no SDK Client is available.`); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn(`Cannot add integration "${integration.name}" because no SDK Client is available.`); return; } - client.addIntegration(integration); } - -/** - * Define an integration function that can be used to create an integration instance. - * Note that this by design hides the implementation details of the integration, as they are considered internal. - */ function defineIntegration(fn) { return fn; } +function extendIntegration(integration, extendedIntegration) { + const wrappedIntegration = { + ...integration, + ...extendedIntegration + }; + for (const key in extendedIntegration) { + const baseValue = integration[key]; + const extendedValue = extendedIntegration[key]; + if (typeof baseValue === "function" && typeof extendedValue === "function") { + const wrappedFunction = new Proxy(baseValue, { + apply: (target, thisArg, args) => { + Reflect.apply(target, thisArg, args); + return Reflect.apply(extendedValue, thisArg, args); + } + }); + wrappedIntegration[key] = wrappedFunction; + } + } + return wrappedIntegration; +} exports.addIntegration = addIntegration; exports.afterSetupIntegrations = afterSetupIntegrations; exports.defineIntegration = defineIntegration; +exports.extendIntegration = extendIntegration; exports.getIntegrationsToSetup = getIntegrationsToSetup; exports.installedIntegrations = installedIntegrations; exports.setupIntegration = setupIntegration; @@ -68164,85 +22268,71 @@ exports.setupIntegrations = setupIntegrations; /***/ 25821: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const exports$1 = __nccwpck_require__(10779); +const console = __nccwpck_require__(98510); const integration = __nccwpck_require__(67428); -const console = __nccwpck_require__(32758); -const logger = __nccwpck_require__(38752); -const misc = __nccwpck_require__(3181); -const severity = __nccwpck_require__(25753); -const string = __nccwpck_require__(93529); -const worldwide = __nccwpck_require__(10891); - -const INTEGRATION_NAME = 'CaptureConsole'; +const debugLogger = __nccwpck_require__(41772); +const misc = __nccwpck_require__(52619); +const severity = __nccwpck_require__(13367); +const string = __nccwpck_require__(77673); +const worldwide = __nccwpck_require__(90935); +const INTEGRATION_NAME = "CaptureConsole"; const _captureConsoleIntegration = ((options = {}) => { - const levels = options.levels || logger.CONSOLE_LEVELS; - // TODO(v9): Flip default value to `true` - const handled = !!options.handled; - + const levels = options.levels || debugLogger.CONSOLE_LEVELS; + const handled = options.handled ?? true; return { name: INTEGRATION_NAME, setup(client) { - if (!('console' in worldwide.GLOBAL_OBJ)) { + if (!("console" in worldwide.GLOBAL_OBJ)) { return; } - console.addConsoleInstrumentationHandler(({ args, level }) => { if (currentScopes.getClient() !== client || !levels.includes(level)) { return; } - consoleHandler(args, level, handled); }); - }, + } }; -}) ; - -/** - * Send Console API calls as Sentry Events. - */ +}); const captureConsoleIntegration = integration.defineIntegration(_captureConsoleIntegration); - function consoleHandler(args, level, handled) { + const severityLevel = severity.severityLevelFromString(level); + const syntheticException = new Error(); const captureContext = { level: severity.severityLevelFromString(level), extra: { - arguments: args, - }, + arguments: args + } }; - - currentScopes.withScope(scope => { - scope.addEventProcessor(event => { - event.logger = 'console'; - + currentScopes.withScope((scope) => { + scope.addEventProcessor((event) => { + event.logger = "console"; misc.addExceptionMechanism(event, { handled, - type: 'console', + type: "auto.core.capture_console" }); - return event; }); - - if (level === 'assert') { + if (level === "assert") { if (!args[0]) { - const message = `Assertion failed: ${string.safeJoin(args.slice(1), ' ') || 'console.assert'}`; - scope.setExtra('arguments', args.slice(1)); - exports$1.captureMessage(message, captureContext); + const message2 = `Assertion failed: ${string.safeJoin(args.slice(1), " ") || "console.assert"}`; + scope.setExtra("arguments", args.slice(1)); + scope.captureMessage(message2, severityLevel, { captureContext, syntheticException }); } return; } - - const error = args.find(arg => arg instanceof Error); + const error = args.find((arg) => arg instanceof Error); if (error) { exports$1.captureException(error, captureContext); return; } - - const message = string.safeJoin(args, ' '); - exports$1.captureMessage(message, captureContext); + const message = string.safeJoin(args, " "); + scope.captureMessage(message, severityLevel, { captureContext, syntheticException }); }); } @@ -68252,63 +22342,275 @@ exports.captureConsoleIntegration = captureConsoleIntegration; /***/ }), -/***/ 39957: +/***/ 25173: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const integration = __nccwpck_require__(67428); -const logger = __nccwpck_require__(38752); +const currentScopes = __nccwpck_require__(8131); +const internal = __nccwpck_require__(97113); +const utils = __nccwpck_require__(46162); +const is = __nccwpck_require__(68370); +const normalize = __nccwpck_require__(68446); -const INTEGRATION_NAME = 'Debug'; - -const _debugIntegration = ((options = {}) => { - const _options = { - debugger: false, - stringify: false, - ...options, +const DEFAULT_CAPTURED_LEVELS = ["trace", "debug", "info", "warn", "error", "fatal"]; +function createConsolaReporter(options = {}) { + const levels = new Set(options.levels ?? DEFAULT_CAPTURED_LEVELS); + const providedClient = options.client; + return { + log(logObj) { + const { type, level, message: consolaMessage, args, tag, date: _date, ...rest } = logObj; + const client = providedClient || currentScopes.getClient(); + if (!client) { + return; + } + const logSeverityLevel = getLogSeverityLevel(type, level); + if (!levels.has(logSeverityLevel)) { + return; + } + const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = client.getOptions(); + const attributes = {}; + for (const [key, value] of Object.entries(rest)) { + attributes[key] = normalize.normalize(value, normalizeDepth, normalizeMaxBreadth); + } + attributes["sentry.origin"] = "auto.log.consola"; + if (tag) { + attributes["consola.tag"] = tag; + } + if (type) { + attributes["consola.type"] = type; + } + if (level != null && typeof level === "number") { + attributes["consola.level"] = level; + } + const extractionResult = processExtractedAttributes( + defaultExtractAttributes(args, normalizeDepth, normalizeMaxBreadth), + normalizeDepth, + normalizeMaxBreadth + ); + if (extractionResult?.attributes) { + Object.assign(attributes, extractionResult.attributes); + } + internal._INTERNAL_captureLog({ + level: logSeverityLevel, + message: extractionResult?.message || consolaMessage || args && utils.formatConsoleArgs(args, normalizeDepth, normalizeMaxBreadth) || "", + attributes + }); + } }; +} +const CONSOLA_TYPE_TO_LOG_SEVERITY_LEVEL_MAP = { + // Consola built-in types + silent: "trace", + fatal: "fatal", + error: "error", + warn: "warn", + log: "info", + info: "info", + success: "info", + fail: "error", + ready: "info", + start: "info", + box: "info", + debug: "debug", + trace: "trace", + verbose: "debug", + // Custom types that might exist + critical: "fatal", + notice: "info" +}; +const CONSOLA_LEVEL_TO_LOG_SEVERITY_LEVEL_MAP = { + 0: "fatal", + // Fatal and Error + 1: "warn", + // Warnings + 2: "info", + // Normal logs + 3: "info", + // Informational logs, success, fail, ready, start, ... + 4: "debug", + // Debug logs + 5: "trace" + // Trace logs +}; +function getLogSeverityLevel(type, level) { + if (type === "verbose") { + return "debug"; + } + if (type === "silent") { + return "trace"; + } + if (type) { + const mappedLevel = CONSOLA_TYPE_TO_LOG_SEVERITY_LEVEL_MAP[type]; + if (mappedLevel) { + return mappedLevel; + } + } + if (typeof level === "number") { + const mappedLevel = CONSOLA_LEVEL_TO_LOG_SEVERITY_LEVEL_MAP[level]; + if (mappedLevel) { + return mappedLevel; + } + } + return "info"; +} +function defaultExtractAttributes(args, normalizeDepth, normalizeMaxBreadth) { + if (!args?.length) { + return { message: "" }; + } + const message = utils.formatConsoleArgs(args, normalizeDepth, normalizeMaxBreadth); + const firstArg = args[0]; + if (is.isPlainObject(firstArg)) { + const remainingArgsStartIndex = typeof args[1] === "string" ? 2 : 1; + const remainingArgs = args.slice(remainingArgsStartIndex); + return { + message, + // Object content from first arg is added as attributes + attributes: firstArg, + // Add remaining args as message parameters + messageParameters: remainingArgs + }; + } else { + const followingArgs = args.slice(1); + const shouldAddTemplateAttr = followingArgs.length > 0 && typeof firstArg === "string" && !utils.hasConsoleSubstitutions(firstArg); + return { + message, + messageTemplate: shouldAddTemplateAttr ? firstArg : void 0, + messageParameters: shouldAddTemplateAttr ? followingArgs : void 0 + }; + } +} +function processExtractedAttributes(extractionResult, normalizeDepth, normalizeMaxBreadth) { + const { message, attributes, messageTemplate, messageParameters } = extractionResult; + const messageParamAttributes = {}; + if (messageTemplate && messageParameters) { + const templateAttrs = utils.createConsoleTemplateAttributes(messageTemplate, messageParameters); + for (const [key, value] of Object.entries(templateAttrs)) { + messageParamAttributes[key] = key.startsWith("sentry.message.parameter.") ? normalize.normalize(value, normalizeDepth, normalizeMaxBreadth) : value; + } + } else if (messageParameters && messageParameters.length > 0) { + messageParameters.forEach((arg, index) => { + messageParamAttributes[`sentry.message.parameter.${index}`] = normalize.normalize(arg, normalizeDepth, normalizeMaxBreadth); + }); + } + return { + message, + attributes: { + ...normalize.normalize(attributes, normalizeDepth, normalizeMaxBreadth), + ...messageParamAttributes + } + }; +} +exports.createConsolaReporter = createConsolaReporter; +//# sourceMappingURL=consola.js.map + + +/***/ }), + +/***/ 32587: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const breadcrumbs = __nccwpck_require__(5608); +const currentScopes = __nccwpck_require__(8131); +const console = __nccwpck_require__(98510); +const integration = __nccwpck_require__(67428); +const debugLogger = __nccwpck_require__(41772); +const severity = __nccwpck_require__(13367); +const string = __nccwpck_require__(77673); +const worldwide = __nccwpck_require__(90935); + +const INTEGRATION_NAME = "Console"; +const consoleIntegration = integration.defineIntegration((options = {}) => { + const levels = new Set(options.levels || debugLogger.CONSOLE_LEVELS); return { name: INTEGRATION_NAME, setup(client) { - client.on('beforeSendEvent', (event, hint) => { - if (_options.debugger) { - // eslint-disable-next-line no-debugger - debugger; + const unsubscribe = console.addConsoleInstrumentationHandler(({ args, level }) => { + if (currentScopes.getClient() !== client || !levels.has(level)) { + return; } - - /* eslint-disable no-console */ - logger.consoleSandbox(() => { - if (_options.stringify) { - console.log(JSON.stringify(event, null, 2)); - if (hint && Object.keys(hint).length) { - console.log(JSON.stringify(hint, null, 2)); - } - } else { - console.log(event); - if (hint && Object.keys(hint).length) { - console.log(hint); - } - } - }); - /* eslint-enable no-console */ + addConsoleBreadcrumb(level, args); }); - }, + client.registerCleanup(unsubscribe); + if (options.filter) { + const unsubscribe2 = console.addConsoleInstrumentationFilter(options.filter); + client.registerCleanup(unsubscribe2); + } + } }; -}) ; +}); +function addConsoleBreadcrumb(level, args) { + const breadcrumb = { + category: "console", + data: { + arguments: args, + logger: "console" + }, + level: severity.severityLevelFromString(level), + message: formatConsoleArgs(args) + }; + if (level === "assert") { + if (args[0] === false) { + const assertionArgs = args.slice(1); + breadcrumb.message = assertionArgs.length > 0 ? `Assertion failed: ${formatConsoleArgs(assertionArgs)}` : "Assertion failed"; + breadcrumb.data.arguments = assertionArgs; + } else { + return; + } + } + breadcrumbs.addBreadcrumb(breadcrumb, { + input: args, + level + }); +} +function formatConsoleArgs(values) { + return "util" in worldwide.GLOBAL_OBJ && typeof worldwide.GLOBAL_OBJ.util.format === "function" ? worldwide.GLOBAL_OBJ.util.format(...values) : string.safeJoin(values, " "); +} -/** - * Integration to debug sent Sentry events. - * This integration should not be used in production. - * - * @deprecated This integration is deprecated and will be removed in the next major version of the SDK. - * To log outgoing events, use [Hook Options](https://docs.sentry.io/platforms/javascript/configuration/options/#hooks) (`beforeSend`, `beforeSendTransaction`, ...). - */ -const debugIntegration = integration.defineIntegration(_debugIntegration); +exports.addConsoleBreadcrumb = addConsoleBreadcrumb; +exports.consoleIntegration = consoleIntegration; +//# sourceMappingURL=console.js.map -exports.debugIntegration = debugIntegration; -//# sourceMappingURL=debug.js.map + +/***/ }), + +/***/ 71831: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const integration = __nccwpck_require__(67428); +const semanticAttributes = __nccwpck_require__(36827); +const spanUtils = __nccwpck_require__(47569); + +const INTEGRATION_NAME = "ConversationId"; +const _conversationIdIntegration = (() => { + return { + name: INTEGRATION_NAME, + setup(client) { + client.on("spanStart", (span) => { + const scopeData = currentScopes.getCurrentScope().getScopeData(); + const isolationScopeData = currentScopes.getIsolationScope().getScopeData(); + const conversationId = scopeData.conversationId || isolationScopeData.conversationId; + if (conversationId) { + const { op, data: attributes, description: name } = spanUtils.spanToJSON(span); + if (!op?.startsWith("gen_ai.") && !attributes["ai.operationId"] && !name?.startsWith("ai.")) { + return; + } + span.setAttribute(semanticAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE, conversationId); + } + }); + } + }; +}); +const conversationIdIntegration = integration.defineIntegration(_conversationIdIntegration); + +exports.conversationIdIntegration = conversationIdIntegration; +//# sourceMappingURL=conversationId.js.map /***/ }), @@ -68316,183 +22618,125 @@ exports.debugIntegration = debugIntegration; /***/ 96514: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const integration = __nccwpck_require__(67428); const debugBuild = __nccwpck_require__(14488); -const logger = __nccwpck_require__(38752); -const stacktrace = __nccwpck_require__(85820); - -const INTEGRATION_NAME = 'Dedupe'; +const integration = __nccwpck_require__(67428); +const debugLogger = __nccwpck_require__(41772); +const stacktrace = __nccwpck_require__(22902); +const INTEGRATION_NAME = "Dedupe"; const _dedupeIntegration = (() => { let previousEvent; - return { name: INTEGRATION_NAME, processEvent(currentEvent) { - // We want to ignore any non-error type events, e.g. transactions or replays - // These should never be deduped, and also not be compared against as _previousEvent. if (currentEvent.type) { return currentEvent; } - - // Juuust in case something goes wrong try { if (_shouldDropEvent(currentEvent, previousEvent)) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Event dropped due to being a duplicate of previously captured event.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Event dropped due to being a duplicate of previously captured event."); return null; } - } catch (_oO) {} // eslint-disable-line no-empty - - return (previousEvent = currentEvent); - }, + } catch { + } + return previousEvent = currentEvent; + } }; -}) ; - -/** - * Deduplication filter. - */ +}); const dedupeIntegration = integration.defineIntegration(_dedupeIntegration); - -/** only exported for tests. */ function _shouldDropEvent(currentEvent, previousEvent) { if (!previousEvent) { return false; } - if (_isSameMessageEvent(currentEvent, previousEvent)) { return true; } - if (_isSameExceptionEvent(currentEvent, previousEvent)) { return true; } - return false; } - function _isSameMessageEvent(currentEvent, previousEvent) { const currentMessage = currentEvent.message; const previousMessage = previousEvent.message; - - // If neither event has a message property, they were both exceptions, so bail out if (!currentMessage && !previousMessage) { return false; } - - // If only one event has a stacktrace, but not the other one, they are not the same - if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) { + if (currentMessage && !previousMessage || !currentMessage && previousMessage) { return false; } - if (currentMessage !== previousMessage) { return false; } - if (!_isSameFingerprint(currentEvent, previousEvent)) { return false; } - if (!_isSameStacktrace(currentEvent, previousEvent)) { return false; } - return true; } - function _isSameExceptionEvent(currentEvent, previousEvent) { const previousException = _getExceptionFromEvent(previousEvent); const currentException = _getExceptionFromEvent(currentEvent); - if (!previousException || !currentException) { return false; } - if (previousException.type !== currentException.type || previousException.value !== currentException.value) { return false; } - if (!_isSameFingerprint(currentEvent, previousEvent)) { return false; } - if (!_isSameStacktrace(currentEvent, previousEvent)) { return false; } - return true; } - function _isSameStacktrace(currentEvent, previousEvent) { let currentFrames = stacktrace.getFramesFromEvent(currentEvent); let previousFrames = stacktrace.getFramesFromEvent(previousEvent); - - // If neither event has a stacktrace, they are assumed to be the same if (!currentFrames && !previousFrames) { return true; } - - // If only one event has a stacktrace, but not the other one, they are not the same - if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) { + if (currentFrames && !previousFrames || !currentFrames && previousFrames) { return false; } - - currentFrames = currentFrames ; - previousFrames = previousFrames ; - - // If number of frames differ, they are not the same + currentFrames = currentFrames; + previousFrames = previousFrames; if (previousFrames.length !== currentFrames.length) { return false; } - - // Otherwise, compare the two for (let i = 0; i < previousFrames.length; i++) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const frameA = previousFrames[i]; - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const frameB = currentFrames[i]; - - if ( - frameA.filename !== frameB.filename || - frameA.lineno !== frameB.lineno || - frameA.colno !== frameB.colno || - frameA.function !== frameB.function - ) { + if (frameA.filename !== frameB.filename || frameA.lineno !== frameB.lineno || frameA.colno !== frameB.colno || frameA.function !== frameB.function) { return false; } } - return true; } - function _isSameFingerprint(currentEvent, previousEvent) { let currentFingerprint = currentEvent.fingerprint; let previousFingerprint = previousEvent.fingerprint; - - // If neither event has a fingerprint, they are assumed to be the same if (!currentFingerprint && !previousFingerprint) { return true; } - - // If only one event has a fingerprint, but not the other one, they are not the same - if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) { + if (currentFingerprint && !previousFingerprint || !currentFingerprint && previousFingerprint) { return false; } - - currentFingerprint = currentFingerprint ; - previousFingerprint = previousFingerprint ; - - // Otherwise, compare the two + currentFingerprint = currentFingerprint; + previousFingerprint = previousFingerprint; try { - return !!(currentFingerprint.join('') === previousFingerprint.join('')); - } catch (_oO) { + return !!(currentFingerprint.join("") === previousFingerprint.join("")); + } catch { return false; } } - function _getExceptionFromEvent(event) { - return event.exception && event.exception.values && event.exception.values[0]; + return event.exception?.values?.[0]; } exports._shouldDropEvent = _shouldDropEvent; @@ -68500,130 +22744,770 @@ exports.dedupeIntegration = dedupeIntegration; //# sourceMappingURL=dedupe.js.map +/***/ }), + +/***/ 34568: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const integration = __nccwpck_require__(67428); +const debugLogger = __nccwpck_require__(41772); +const eventUtils = __nccwpck_require__(26667); +const misc = __nccwpck_require__(52619); +const string = __nccwpck_require__(77673); + +const DEFAULT_IGNORE_ERRORS = [ + /^Script error\.?$/, + /^Javascript error: Script error\.? on line 0$/, + /^ResizeObserver loop completed with undelivered notifications.$/, + // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness. + /^Cannot redefine property: googletag$/, + // This is thrown when google tag manager is used in combination with an ad blocker + /^Can't find variable: gmo$/, + // Error from Google Search App https://issuetracker.google.com/issues/396043331 + /^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/, + // Random error that happens but not actionable or noticeable to end-users. + /can't redefine non-configurable property "solana"/, + // Probably a browser extension or custom browser (Brave) throwing this error + /vv\(\)\.getRestrictions is not a function/, + // Error thrown by GTM, seemingly not affecting end-users + /Can't find variable: _AutofillCallbackHandler/, + // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ + /Object Not Found Matching Id:\d+, MethodName:simulateEvent/, + // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps + /^Java exception was raised during method invocation$/ + // error from Facebook Mobile browser (https://github.com/getsentry/sentry-javascript/issues/15065) +]; +const INTEGRATION_NAME = "EventFilters"; +const eventFiltersIntegration = integration.defineIntegration((options = {}) => { + let mergedOptions; + return { + name: INTEGRATION_NAME, + setup(client) { + const clientOptions = client.getOptions(); + mergedOptions = _mergeOptions(options, clientOptions); + }, + processEvent(event, _hint, client) { + if (!mergedOptions) { + const clientOptions = client.getOptions(); + mergedOptions = _mergeOptions(options, clientOptions); + } + return _shouldDropEvent(event, mergedOptions) ? null : event; + } + }; +}); +const inboundFiltersIntegration = integration.defineIntegration(((options = {}) => { + return { + ...eventFiltersIntegration(options), + name: "InboundFilters" + }; +})); +function _mergeOptions(internalOptions = {}, clientOptions = {}) { + return { + allowUrls: [...internalOptions.allowUrls || [], ...clientOptions.allowUrls || []], + denyUrls: [...internalOptions.denyUrls || [], ...clientOptions.denyUrls || []], + ignoreErrors: [ + ...internalOptions.ignoreErrors || [], + ...clientOptions.ignoreErrors || [], + ...internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS + ], + ignoreTransactions: [...internalOptions.ignoreTransactions || [], ...clientOptions.ignoreTransactions || []] + }; +} +function _shouldDropEvent(event, options) { + if (!event.type) { + if (_isIgnoredError(event, options.ignoreErrors)) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn( + `Event dropped due to being matched by \`ignoreErrors\` option. +Event: ${misc.getEventDescription(event)}` + ); + return true; + } + if (_isUselessError(event)) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn( + `Event dropped due to not having an error message, error type or stacktrace. +Event: ${misc.getEventDescription( + event + )}` + ); + return true; + } + if (_isDeniedUrl(event, options.denyUrls)) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn( + `Event dropped due to being matched by \`denyUrls\` option. +Event: ${misc.getEventDescription( + event + )}. +Url: ${_getEventFilterUrl(event)}` + ); + return true; + } + if (!_isAllowedUrl(event, options.allowUrls)) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn( + `Event dropped due to not being matched by \`allowUrls\` option. +Event: ${misc.getEventDescription( + event + )}. +Url: ${_getEventFilterUrl(event)}` + ); + return true; + } + } else if (event.type === "transaction") { + if (_isIgnoredTransaction(event, options.ignoreTransactions)) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn( + `Event dropped due to being matched by \`ignoreTransactions\` option. +Event: ${misc.getEventDescription(event)}` + ); + return true; + } + } + return false; +} +function _isIgnoredError(event, ignoreErrors) { + if (!ignoreErrors?.length) { + return false; + } + return eventUtils.getPossibleEventMessages(event).some((message) => string.stringMatchesSomePattern(message, ignoreErrors)); +} +function _isIgnoredTransaction(event, ignoreTransactions) { + if (!ignoreTransactions?.length) { + return false; + } + const name = event.transaction; + return name ? string.stringMatchesSomePattern(name, ignoreTransactions) : false; +} +function _isDeniedUrl(event, denyUrls) { + if (!denyUrls?.length) { + return false; + } + const url = _getEventFilterUrl(event); + return !url ? false : string.stringMatchesSomePattern(url, denyUrls); +} +function _isAllowedUrl(event, allowUrls) { + if (!allowUrls?.length) { + return true; + } + const url = _getEventFilterUrl(event); + return !url ? true : string.stringMatchesSomePattern(url, allowUrls); +} +function _getLastValidUrl(frames = []) { + for (let i = frames.length - 1; i >= 0; i--) { + const frame = frames[i]; + if (frame && frame.filename !== "" && frame.filename !== "[native code]") { + return frame.filename || null; + } + } + return null; +} +function _getEventFilterUrl(event) { + try { + const rootException = [...event.exception?.values ?? []].reverse().find((value) => value.mechanism?.parent_id === void 0 && value.stacktrace?.frames?.length); + const frames = rootException?.stacktrace?.frames; + return frames ? _getLastValidUrl(frames) : null; + } catch { + debugBuild.DEBUG_BUILD && debugLogger.debug.error(`Cannot extract url for event ${misc.getEventDescription(event)}`); + return null; + } +} +function _isUselessError(event) { + if (!event.exception?.values?.length) { + return false; + } + return ( + // No top-level message + !event.message && // There are no exception values that have a stacktrace, a non-generic-Error type or value + !event.exception.values.some((value) => value.stacktrace || value.type && value.type !== "Error" || value.value) + ); +} + +exports.eventFiltersIntegration = eventFiltersIntegration; +exports.inboundFiltersIntegration = inboundFiltersIntegration; +//# sourceMappingURL=eventFilters.js.map + + +/***/ }), + +/***/ 94806: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugLogger = __nccwpck_require__(41772); +const exports$1 = __nccwpck_require__(10779); +const debugBuild = __nccwpck_require__(14488); +const utils = __nccwpck_require__(94301); +const object = __nccwpck_require__(5906); +const patchLayer = __nccwpck_require__(87298); +const setSdkProcessingMetadata = __nccwpck_require__(27399); +const getDefaultExport = __nccwpck_require__(94853); + +function isLegacyOptions(options) { + return !!options.express; +} +let didLegacyDeprecationWarning = false; +function deprecationWarning() { + if (!didLegacyDeprecationWarning) { + didLegacyDeprecationWarning = true; + debugBuild.DEBUG_BUILD && debugLogger.debug.warn( + "[Express] `patchExpressModule(options)` is deprecated. Use `patchExpressModule(moduleExports, getOptions)` instead." + ); + } +} +function patchExpressModule(optionsOrExports, maybeGetOptions) { + let getOptions; + let moduleExports; + if (!maybeGetOptions && isLegacyOptions(optionsOrExports)) { + const { express: express2, ...options } = optionsOrExports; + moduleExports = express2; + getOptions = () => options; + deprecationWarning(); + } else if (typeof maybeGetOptions !== "function") { + throw new TypeError("`patchExpressModule(moduleExports, getOptions)` requires a `getOptions` callback"); + } else { + getOptions = maybeGetOptions; + moduleExports = optionsOrExports; + } + const express = getDefaultExport.getDefaultExport(moduleExports); + const routerProto = utils.isExpressWithRouterPrototype(express) ? express.Router.prototype : utils.isExpressWithoutRouterPrototype(express) ? express.Router : void 0; + if (!routerProto) { + throw new TypeError("no valid Express route function to instrument"); + } + const originalRouteMethod = routerProto.route; + try { + object.wrapMethod( + routerProto, + "route", + function routeTrace(...args) { + const route = originalRouteMethod.apply(this, args); + const layer = this.stack[this.stack.length - 1]; + patchLayer.patchLayer(getOptions, layer, utils.getLayerPath(args)); + return route; + } + ); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Failed to patch express route method:", e); + } + const originalRouterUse = routerProto.use; + try { + object.wrapMethod( + routerProto, + "use", + function useTrace(...args) { + const route = originalRouterUse.apply(this, args); + const layer = this.stack[this.stack.length - 1]; + if (!layer) { + return route; + } + patchLayer.patchLayer(getOptions, layer, utils.getLayerPath(args)); + return route; + } + ); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Failed to patch express use method:", e); + } + const { application } = express; + const originalApplicationUse = application.use; + try { + object.wrapMethod( + application, + "use", + function appUseTrace(...args) { + const route = originalApplicationUse.apply(this, args); + const router = utils.isExpressWithRouterPrototype(express) ? this.router : this._router; + if (router) { + const layer = router.stack[router.stack.length - 1]; + if (layer) { + patchLayer.patchLayer(getOptions, layer, utils.getLayerPath(args)); + } + } + return route; + } + ); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Failed to patch express application.use method:", e); + } + return express; +} +function expressErrorHandler(options) { + return function sentryErrorMiddleware(error, request, res, next) { + setSdkProcessingMetadata.setSDKProcessingMetadata(request); + const shouldHandleError = options?.shouldHandleError || utils.defaultShouldHandleError; + if (shouldHandleError(error)) { + const eventId = exports$1.captureException(error, { + mechanism: { type: "auto.middleware.express", handled: false } + }); + res.sentry = eventId; + } + next(error); + }; +} +function setupExpressErrorHandler(app, options) { + app.use(expressRequestHandler()); + app.use(expressErrorHandler(options)); +} +function expressRequestHandler() { + return function sentryRequestMiddleware(request, _res, next) { + setSdkProcessingMetadata.setSDKProcessingMetadata(request); + next(); + }; +} + +exports.expressErrorHandler = expressErrorHandler; +exports.patchExpressModule = patchExpressModule; +exports.setupExpressErrorHandler = setupExpressErrorHandler; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 87298: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const semanticAttributes = __nccwpck_require__(36827); +const debugLogger = __nccwpck_require__(41772); +const spanUtils = __nccwpck_require__(47569); +const spanstatus = __nccwpck_require__(21119); +const object = __nccwpck_require__(5906); +const currentScopes = __nccwpck_require__(8131); +const trace = __nccwpck_require__(97956); +const requestLayerStore = __nccwpck_require__(59516); +const types = __nccwpck_require__(69210); +const utils = __nccwpck_require__(94301); +const defaultScopes = __nccwpck_require__(80496); +const setSdkProcessingMetadata = __nccwpck_require__(27399); + +function patchLayer(getOptions, maybeLayer, layerPath) { + if (!maybeLayer?.handle) { + return; + } + const layer = maybeLayer; + const layerHandleOriginal = layer.handle; + if (object.getOriginalFunction(layerHandleOriginal)) { + return; + } + if (layerHandleOriginal.length === 4) { + return; + } + function layerHandlePatched(req, res, ...otherArgs) { + const options = getOptions(); + setSdkProcessingMetadata.setSDKProcessingMetadata(req); + const parentSpan = spanUtils.getActiveSpan(); + if (!parentSpan) { + return layerHandleOriginal.apply(this, [req, res, ...otherArgs]); + } + if (layerPath) { + requestLayerStore.storeLayer(req, layerPath); + } + const storedLayers = requestLayerStore.getStoredLayers(req); + const isLayerPathStored = !!layerPath; + const constructedRoute = utils.getConstructedRoute(req); + const actualMatchedRoute = utils.getActualMatchedRoute(req, constructedRoute); + options.onRouteResolved?.(actualMatchedRoute); + const metadata = utils.getLayerMetadata(constructedRoute, layer, layerPath); + const name = metadata.attributes[types.ATTR_EXPRESS_NAME]; + const type = metadata.attributes[types.ATTR_EXPRESS_TYPE]; + const attributes = Object.assign(metadata.attributes, { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.express", + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.express` + }); + if (actualMatchedRoute) { + attributes[types.ATTR_HTTP_ROUTE] = actualMatchedRoute; + } + if (utils.isLayerIgnored(metadata.attributes[types.ATTR_EXPRESS_NAME], type, options)) { + if (isLayerPathStored) { + storedLayers.pop(); + } + return layerHandleOriginal.apply(this, [req, res, ...otherArgs]); + } + const currentScope = currentScopes.getIsolationScope(); + if (currentScope !== defaultScopes.getDefaultIsolationScope()) { + if (type === "request_handler") { + const method = req.method ? req.method.toUpperCase() : "GET"; + currentScope.setTransactionName(`${method} ${constructedRoute}`); + } + } else { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Isolation scope is still default isolation scope - skipping setting transactionName"); + } + return trace.startSpanManual({ name, attributes }, (span) => { + let spanHasEnded = false; + if (metadata.attributes[types.ATTR_EXPRESS_TYPE] === types.ExpressLayerType_ROUTER) { + span.end(); + spanHasEnded = true; + } + const onResponseFinish = () => { + if (!spanHasEnded) { + spanHasEnded = true; + span.end(); + } + }; + for (let i = 0; i < otherArgs.length; i++) { + const callback = otherArgs[i]; + if (typeof callback !== "function") { + continue; + } + otherArgs[i] = function(...args) { + const maybeError = args[0]; + const isError = !!maybeError && maybeError !== "route" && maybeError !== "router"; + if (!spanHasEnded && isError) { + const [_, message] = utils.asErrorAndMessage(maybeError); + span.setStatus({ + code: spanstatus.SPAN_STATUS_ERROR, + message + }); + } + if (!spanHasEnded) { + spanHasEnded = true; + res.removeListener("finish", onResponseFinish); + span.end(); + } + if (!(req.route && isError) && isLayerPathStored) { + storedLayers.pop(); + } + return trace.withActiveSpan(parentSpan, () => callback.apply(this, args)); + }; + break; + } + try { + return layerHandleOriginal.apply(this, [req, res, ...otherArgs]); + } catch (anyError) { + const [_, message] = utils.asErrorAndMessage(anyError); + span.setStatus({ + code: spanstatus.SPAN_STATUS_ERROR, + message + }); + throw anyError; + } finally { + if (!spanHasEnded) { + res.once("finish", onResponseFinish); + } + } + }); + } + for (const key in layerHandleOriginal) { + if (key in layerHandlePatched) { + continue; + } + Object.defineProperty(layerHandlePatched, key, { + get() { + return layerHandleOriginal[key]; + }, + set(value) { + layerHandleOriginal[key] = value; + } + }); + } + object.markFunctionWrapped(layerHandlePatched, layerHandleOriginal); + Object.defineProperty(layer, "handle", { + enumerable: true, + configurable: true, + writable: true, + value: layerHandlePatched + }); +} + +exports.patchLayer = patchLayer; +//# sourceMappingURL=patch-layer.js.map + + +/***/ }), + +/***/ 59516: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const requestLayerStore = /* @__PURE__ */ new WeakMap(); +const storeLayer = (req, layer) => { + const store = requestLayerStore.get(req); + if (!store) { + requestLayerStore.set(req, [layer]); + } else { + store.push(layer); + } +}; +const getStoredLayers = (req) => { + let store = requestLayerStore.get(req); + if (!store) { + store = []; + requestLayerStore.set(req, store); + } + return store; +}; + +exports.getStoredLayers = getStoredLayers; +exports.storeLayer = storeLayer; +//# sourceMappingURL=request-layer-store.js.map + + +/***/ }), + +/***/ 27399: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const request = __nccwpck_require__(82141); + +function setSDKProcessingMetadata(request$1) { + const sdkProcMeta = currentScopes.getIsolationScope()?.getScopeData()?.sdkProcessingMetadata; + if (!sdkProcMeta?.normalizedRequest) { + const normalizedRequest = request.httpRequestToRequestData(request$1); + currentScopes.getIsolationScope().setSDKProcessingMetadata({ normalizedRequest }); + } +} + +exports.setSDKProcessingMetadata = setSDKProcessingMetadata; +//# sourceMappingURL=set-sdk-processing-metadata.js.map + + +/***/ }), + +/***/ 69210: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_EXPRESS_NAME = "express.name"; +const ATTR_HTTP_ROUTE = "http.route"; +const ATTR_EXPRESS_TYPE = "express.type"; +const ExpressLayerType_ROUTER = "router"; +const ExpressLayerType_MIDDLEWARE = "middleware"; +const ExpressLayerType_REQUEST_HANDLER = "request_handler"; + +exports.ATTR_EXPRESS_NAME = ATTR_EXPRESS_NAME; +exports.ATTR_EXPRESS_TYPE = ATTR_EXPRESS_TYPE; +exports.ATTR_HTTP_ROUTE = ATTR_HTTP_ROUTE; +exports.ExpressLayerType_MIDDLEWARE = ExpressLayerType_MIDDLEWARE; +exports.ExpressLayerType_REQUEST_HANDLER = ExpressLayerType_REQUEST_HANDLER; +exports.ExpressLayerType_ROUTER = ExpressLayerType_ROUTER; +//# sourceMappingURL=types.js.map + + +/***/ }), + +/***/ 94301: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const requestLayerStore = __nccwpck_require__(59516); +const types = __nccwpck_require__(69210); +const string = __nccwpck_require__(77673); + +const asErrorAndMessage = (error) => error instanceof Error ? [error, error.message] : [String(error), String(error)]; +function isRoutePattern(route) { + return route.includes(":") || route.includes("*"); +} +const getLayerMetadata = (route, layer, layerPath) => { + if (layer.name === "router") { + const maybeRouterPath = getRouterPath("", layer); + const extractedRouterPath = maybeRouterPath ? maybeRouterPath : layerPath || route || "/"; + return { + attributes: { + [types.ATTR_EXPRESS_NAME]: extractedRouterPath, + [types.ATTR_EXPRESS_TYPE]: types.ExpressLayerType_ROUTER + }, + name: `router - ${extractedRouterPath}` + }; + } else if (layer.name === "bound dispatch" || layer.name === "handle") { + return { + attributes: { + [types.ATTR_EXPRESS_NAME]: (route || layerPath) ?? "request handler", + [types.ATTR_EXPRESS_TYPE]: types.ExpressLayerType_REQUEST_HANDLER + }, + name: `request handler${layer.path ? ` - ${route || layerPath}` : ""}` + }; + } else { + return { + attributes: { + [types.ATTR_EXPRESS_NAME]: layer.name, + [types.ATTR_EXPRESS_TYPE]: types.ExpressLayerType_MIDDLEWARE + }, + name: `middleware - ${layer.name}` + }; + } +}; +const getRouterPath = (path, layer) => { + const stackLayer = Array.isArray(layer.handle?.stack) ? layer.handle?.stack?.[0] : void 0; + if (stackLayer?.route?.path) { + return `${path}${stackLayer.route.path}`; + } + if (stackLayer && Array.isArray(stackLayer?.handle?.stack)) { + return getRouterPath(path, stackLayer); + } + return path; +}; +const isLayerIgnored = (name, type, config) => { + if (Array.isArray(config?.ignoreLayersType) && config?.ignoreLayersType?.includes(type)) { + return true; + } + if (!Array.isArray(config?.ignoreLayers)) { + return false; + } + try { + return string.stringMatchesSomePattern(name, config.ignoreLayers, true); + } catch { + } + return false; +}; +function getActualMatchedRoute(req, constructedRoute) { + const layersStore = requestLayerStore.getStoredLayers(req); + if (layersStore.length === 0) { + return void 0; + } + if (layersStore.every((path) => path === "/")) { + return req.originalUrl === "/" ? "/" : void 0; + } + if (constructedRoute === "*") { + return constructedRoute; + } + if (constructedRoute.includes("/") && (constructedRoute.includes(",") || constructedRoute.includes("\\") || constructedRoute.includes("*") || constructedRoute.includes("["))) { + return constructedRoute; + } + const normalizedRoute = constructedRoute.startsWith("/") ? constructedRoute : `/${constructedRoute}`; + const isValidRoute = normalizedRoute.length > 0 && (req.originalUrl === normalizedRoute || req.originalUrl.startsWith(normalizedRoute) || isRoutePattern(normalizedRoute)); + return isValidRoute ? normalizedRoute : void 0; +} +function getConstructedRoute(req) { + const layersStore = requestLayerStore.getStoredLayers(req); + let constructedRoute = ""; + for (const path of layersStore) { + if (path === "/" || path === "/*") { + continue; + } + constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ? path : `/${path}`; + } + return constructedRoute.replace(/\/{2,}/g, "/"); +} +const getLayerPath = (args) => { + const firstArg = args[0]; + if (Array.isArray(firstArg)) { + return firstArg.map((arg) => extractLayerPathSegment(arg) || "").join(","); + } + return extractLayerPathSegment(firstArg); +}; +const extractLayerPathSegment = (arg) => typeof arg === "string" ? arg : arg instanceof RegExp || typeof arg === "number" ? String(arg) : void 0; +const isExpressWithRouterPrototype = (express) => isExpressRouterPrototype(express?.Router?.prototype); +const isExpressRouterPrototype = (routerProto) => (typeof routerProto === "object" || typeof routerProto === "function") && !!routerProto && "route" in routerProto && typeof routerProto.route === "function"; +const isExpressWithoutRouterPrototype = (express) => isExpressRouterPrototype(express.Router) && !isExpressWithRouterPrototype(express); +function getStatusCodeFromResponse(error) { + const statusCode = error.status || error.statusCode || error.status_code || error.output?.statusCode; + return statusCode ? parseInt(statusCode, 10) : 500; +} +function defaultShouldHandleError(error) { + const status = getStatusCodeFromResponse(error); + return status >= 500; +} + +exports.asErrorAndMessage = asErrorAndMessage; +exports.defaultShouldHandleError = defaultShouldHandleError; +exports.getActualMatchedRoute = getActualMatchedRoute; +exports.getConstructedRoute = getConstructedRoute; +exports.getLayerMetadata = getLayerMetadata; +exports.getLayerPath = getLayerPath; +exports.getRouterPath = getRouterPath; +exports.isExpressWithRouterPrototype = isExpressWithRouterPrototype; +exports.isExpressWithoutRouterPrototype = isExpressWithoutRouterPrototype; +exports.isLayerIgnored = isLayerIgnored; +exports.isRoutePattern = isRoutePattern; +//# sourceMappingURL=utils.js.map + + /***/ }), /***/ 88764: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const integration = __nccwpck_require__(67428); const debugBuild = __nccwpck_require__(14488); -const is = __nccwpck_require__(84085); -const logger = __nccwpck_require__(38752); -const normalize = __nccwpck_require__(65543); -const object = __nccwpck_require__(16100); -const string = __nccwpck_require__(93529); +const integration = __nccwpck_require__(67428); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); +const normalize = __nccwpck_require__(68446); +const normalizationHints = __nccwpck_require__(1477); +const string = __nccwpck_require__(77673); -const INTEGRATION_NAME = 'ExtraErrorData'; - -/** - * Extract additional data for from original exceptions. - */ +const INTEGRATION_NAME = "ExtraErrorData"; const _extraErrorDataIntegration = ((options = {}) => { const { depth = 3, captureErrorCause = true } = options; return { name: INTEGRATION_NAME, processEvent(event, hint, client) { - const { maxValueLength = 250 } = client.getOptions(); + const { maxValueLength } = client.getOptions(); return _enhanceEventWithErrorData(event, hint, depth, captureErrorCause, maxValueLength); - }, + } }; -}) ; - +}); const extraErrorDataIntegration = integration.defineIntegration(_extraErrorDataIntegration); - -function _enhanceEventWithErrorData( - event, - hint = {}, - depth, - captureErrorCause, - maxValueLength, -) { +function _enhanceEventWithErrorData(event, hint = {}, depth, captureErrorCause, maxValueLength) { if (!hint.originalException || !is.isError(hint.originalException)) { return event; } - const exceptionName = (hint.originalException ).name || hint.originalException.constructor.name; - - const errorData = _extractErrorData(hint.originalException , captureErrorCause, maxValueLength); - + const exceptionName = hint.originalException.name || hint.originalException.constructor.name; + const errorData = _extractErrorData(hint.originalException, captureErrorCause, maxValueLength); if (errorData) { const contexts = { - ...event.contexts, + ...event.contexts }; - const normalizedErrorData = normalize.normalize(errorData, depth); - if (is.isPlainObject(normalizedErrorData)) { - // We mark the error data as "already normalized" here, because we don't want other normalization procedures to - // potentially truncate the data we just already normalized, with a certain depth setting. - object.addNonEnumerableProperty(normalizedErrorData, '__sentry_skip_normalization__', true); + normalizationHints.setSkipNormalizationHint(normalizedErrorData); contexts[exceptionName] = normalizedErrorData; } - return { ...event, - contexts, + contexts }; } - return event; } - -/** - * Extract extra information from the Error object - */ -function _extractErrorData( - error, - captureErrorCause, - maxValueLength, -) { - // We are trying to enhance already existing event, so no harm done if it won't succeed +function _extractErrorData(error, captureErrorCause, maxValueLength) { try { const nativeKeys = [ - 'name', - 'message', - 'stack', - 'line', - 'column', - 'fileName', - 'lineNumber', - 'columnNumber', - 'toJSON', + "name", + "message", + "stack", + "line", + "column", + "fileName", + "lineNumber", + "columnNumber", + "toJSON" ]; - const extraErrorInfo = {}; - - // We want only enumerable properties, thus `getOwnPropertyNames` is redundant here, as we filter keys anyway. for (const key of Object.keys(error)) { if (nativeKeys.indexOf(key) !== -1) { continue; } const value = error[key]; - extraErrorInfo[key] = is.isError(value) || typeof value === 'string' ? string.truncate(`${value}`, maxValueLength) : value; + extraErrorInfo[key] = is.isError(value) || typeof value === "string" ? maxValueLength ? string.truncate(`${value}`, maxValueLength) : `${value}` : value; } - - // Error.cause is a standard property that is non enumerable, we therefore need to access it separately. - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause - if (captureErrorCause && error.cause !== undefined) { - extraErrorInfo.cause = is.isError(error.cause) ? error.cause.toString() : error.cause; + if (captureErrorCause && error.cause !== void 0) { + if (is.isError(error.cause)) { + const errorName = error.cause.name || error.cause.constructor.name; + extraErrorInfo.cause = { [errorName]: _extractErrorData(error.cause, false, maxValueLength) }; + } else { + extraErrorInfo.cause = error.cause; + } } - - // Check if someone attached `toJSON` method to grab even more properties (eg. axios is doing that) - if (typeof error.toJSON === 'function') { - const serializedError = error.toJSON() ; - + if (typeof error.toJSON === "function") { + const serializedError = error.toJSON(); for (const key of Object.keys(serializedError)) { const value = serializedError[key]; extraErrorInfo[key] = is.isError(value) ? value.toString() : value; } } - return extraErrorInfo; } catch (oO) { - debugBuild.DEBUG_BUILD && logger.logger.error('Unable to extract extra data from the Error object:', oO); + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Unable to extract extra data from the Error object:", oO); } - return null; } @@ -68631,60 +23515,117 @@ exports.extraErrorDataIntegration = extraErrorDataIntegration; //# sourceMappingURL=extraerrordata.js.map +/***/ }), + +/***/ 56508: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const integration = __nccwpck_require__(67428); +const featureFlags = __nccwpck_require__(65422); + +const featureFlagsIntegration = integration.defineIntegration(() => { + return { + name: "FeatureFlags", + processEvent(event, _hint, _client) { + return featureFlags._INTERNAL_copyFlagsFromScopeToEvent(event); + }, + addFeatureFlag(name, value) { + featureFlags._INTERNAL_insertFlagToScope(name, value); + featureFlags._INTERNAL_addFeatureFlagToActiveSpan(name, value); + } + }; +}); + +exports.featureFlagsIntegration = featureFlagsIntegration; +//# sourceMappingURL=featureFlagsIntegration.js.map + + +/***/ }), + +/***/ 68326: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const integration = __nccwpck_require__(67428); +const featureFlags = __nccwpck_require__(65422); +const object = __nccwpck_require__(5906); + +const growthbookIntegration = integration.defineIntegration( + ({ growthbookClass }) => { + return { + name: "GrowthBook", + setupOnce() { + const proto = growthbookClass.prototype; + if (typeof proto.isOn === "function") { + object.fill(proto, "isOn", _wrapAndCaptureBooleanResult); + } + if (typeof proto.getFeatureValue === "function") { + object.fill(proto, "getFeatureValue", _wrapAndCaptureBooleanResult); + } + }, + processEvent(event, _hint, _client) { + return featureFlags._INTERNAL_copyFlagsFromScopeToEvent(event); + } + }; + } +); +function _wrapAndCaptureBooleanResult(original) { + return function(...args) { + const flagName = args[0]; + const result = original.apply(this, args); + if (typeof flagName === "string" && typeof result === "boolean") { + featureFlags._INTERNAL_insertFlagToScope(flagName, result); + featureFlags._INTERNAL_addFeatureFlagToActiveSpan(flagName, result); + } + return result; + }; +} + +exports.growthbookIntegration = growthbookIntegration; +//# sourceMappingURL=growthbook.js.map + + /***/ }), /***/ 48318: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const integration = __nccwpck_require__(67428); -const object = __nccwpck_require__(16100); - -let originalFunctionToString; - -const INTEGRATION_NAME = 'FunctionToString'; - -const SETUP_CLIENTS = new WeakMap(); +const object = __nccwpck_require__(5906); +const INTEGRATION_NAME = "FunctionToString"; +const SETUP_CLIENTS = /* @__PURE__ */ new WeakMap(); const _functionToStringIntegration = (() => { return { name: INTEGRATION_NAME, setupOnce() { - // eslint-disable-next-line @typescript-eslint/unbound-method - originalFunctionToString = Function.prototype.toString; - - // intrinsics (like Function.prototype) might be immutable in some environments - // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal) + const originalFunctionToString = Function.prototype.toString; try { - Function.prototype.toString = function ( ...args) { + Function.prototype.toString = function(...args) { const originalFunction = object.getOriginalFunction(this); - const context = - SETUP_CLIENTS.has(currentScopes.getClient() ) && originalFunction !== undefined ? originalFunction : this; - return originalFunctionToString.apply(context, args); + let unwrappedFunction; + try { + if (SETUP_CLIENTS.has(currentScopes.getClient()) && originalFunction !== void 0) { + unwrappedFunction = originalFunction; + } + } catch { + } + return originalFunctionToString.apply(unwrappedFunction ?? this, args); }; - } catch (e) { - // ignore errors here, just don't patch this + } catch { } }, setup(client) { SETUP_CLIENTS.set(client, true); - }, + } }; -}) ; - -/** - * Patch toString calls to return proper name for wrapped functions. - * - * ```js - * Sentry.init({ - * integrations: [ - * functionToStringIntegration(), - * ], - * }); - * ``` - */ +}); const functionToStringIntegration = integration.defineIntegration(_functionToStringIntegration); exports.functionToStringIntegration = functionToStringIntegration; @@ -68693,236 +23634,917 @@ exports.functionToStringIntegration = functionToStringIntegration; /***/ }), -/***/ 81264: +/***/ 2492: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const debugBuild = __nccwpck_require__(14488); -const integration = __nccwpck_require__(67428); -const logger = __nccwpck_require__(38752); -const misc = __nccwpck_require__(3181); -const string = __nccwpck_require__(93529); +const breadcrumbs = __nccwpck_require__(5608); +const breadcrumbLogLevel = __nccwpck_require__(12297); +const url = __nccwpck_require__(78253); +const getRequestUrl = __nccwpck_require__(51462); -// "Script error." is hard coded into browsers for errors that it can't read. -// this is the result of a script being pulled in from an external domain and CORS. -const DEFAULT_IGNORE_ERRORS = [ - /^Script error\.?$/, - /^Javascript error: Script error\.? on line 0$/, - /^ResizeObserver loop completed with undelivered notifications.$/, // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness. - /^Cannot redefine property: googletag$/, // This is thrown when google tag manager is used in combination with an ad blocker - "undefined is not an object (evaluating 'a.L')", // Random error that happens but not actionable or noticeable to end-users. - 'can\'t redefine non-configurable property "solana"', // Probably a browser extension or custom browser (Brave) throwing this error - "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", // Error thrown by GTM, seemingly not affecting end-users - "Can't find variable: _AutofillCallbackHandler", // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/ - /^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/, // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps -]; - -/** Options for the InboundFilters integration */ - -const INTEGRATION_NAME = 'InboundFilters'; -const _inboundFiltersIntegration = ((options = {}) => { - return { - name: INTEGRATION_NAME, - processEvent(event, _hint, client) { - const clientOptions = client.getOptions(); - const mergedOptions = _mergeOptions(options, clientOptions); - return _shouldDropEvent(event, mergedOptions) ? null : event; +function addOutgoingRequestBreadcrumb(request, response) { + const url$1 = getRequestUrl.getRequestUrlFromClientRequest(request); + const parsedUrl = url.parseUrl(url$1); + const statusCode = response?.statusCode; + const level = breadcrumbLogLevel.getBreadcrumbLogLevelFromHttpStatusCode(statusCode); + breadcrumbs.addBreadcrumb( + { + category: "http", + data: { + status_code: statusCode, + url: url.getSanitizedUrlString(parsedUrl), + "http.method": request.method || "GET", + ...parsedUrl.search ? { "http.query": parsedUrl.search } : {}, + ...parsedUrl.hash ? { "http.fragment": parsedUrl.hash } : {} + }, + type: "http", + level }, - }; -}) ; - -const inboundFiltersIntegration = integration.defineIntegration(_inboundFiltersIntegration); - -function _mergeOptions( - internalOptions = {}, - clientOptions = {}, -) { - return { - allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])], - denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])], - ignoreErrors: [ - ...(internalOptions.ignoreErrors || []), - ...(clientOptions.ignoreErrors || []), - ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS), - ], - ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])], - ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true, - }; -} - -function _shouldDropEvent(event, options) { - if (options.ignoreInternal && _isSentryError(event)) { - debugBuild.DEBUG_BUILD && - logger.logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${misc.getEventDescription(event)}`); - return true; - } - if (_isIgnoredError(event, options.ignoreErrors)) { - debugBuild.DEBUG_BUILD && - logger.logger.warn( - `Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${misc.getEventDescription(event)}`, - ); - return true; - } - if (_isUselessError(event)) { - debugBuild.DEBUG_BUILD && - logger.logger.warn( - `Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${misc.getEventDescription( - event, - )}`, - ); - return true; - } - if (_isIgnoredTransaction(event, options.ignoreTransactions)) { - debugBuild.DEBUG_BUILD && - logger.logger.warn( - `Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${misc.getEventDescription(event)}`, - ); - return true; - } - if (_isDeniedUrl(event, options.denyUrls)) { - debugBuild.DEBUG_BUILD && - logger.logger.warn( - `Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${misc.getEventDescription( - event, - )}.\nUrl: ${_getEventFilterUrl(event)}`, - ); - return true; - } - if (!_isAllowedUrl(event, options.allowUrls)) { - debugBuild.DEBUG_BUILD && - logger.logger.warn( - `Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${misc.getEventDescription( - event, - )}.\nUrl: ${_getEventFilterUrl(event)}`, - ); - return true; - } - return false; -} - -function _isIgnoredError(event, ignoreErrors) { - // If event.type, this is not an error - if (event.type || !ignoreErrors || !ignoreErrors.length) { - return false; - } - - return _getPossibleEventMessages(event).some(message => string.stringMatchesSomePattern(message, ignoreErrors)); -} - -function _isIgnoredTransaction(event, ignoreTransactions) { - if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) { - return false; - } - - const name = event.transaction; - return name ? string.stringMatchesSomePattern(name, ignoreTransactions) : false; -} - -function _isDeniedUrl(event, denyUrls) { - // TODO: Use Glob instead? - if (!denyUrls || !denyUrls.length) { - return false; - } - const url = _getEventFilterUrl(event); - return !url ? false : string.stringMatchesSomePattern(url, denyUrls); -} - -function _isAllowedUrl(event, allowUrls) { - // TODO: Use Glob instead? - if (!allowUrls || !allowUrls.length) { - return true; - } - const url = _getEventFilterUrl(event); - return !url ? true : string.stringMatchesSomePattern(url, allowUrls); -} - -function _getPossibleEventMessages(event) { - const possibleMessages = []; - - if (event.message) { - possibleMessages.push(event.message); - } - - let lastException; - try { - // @ts-expect-error Try catching to save bundle size - lastException = event.exception.values[event.exception.values.length - 1]; - } catch (e) { - // try catching to save bundle size checking existence of variables - } - - if (lastException) { - if (lastException.value) { - possibleMessages.push(lastException.value); - if (lastException.type) { - possibleMessages.push(`${lastException.type}: ${lastException.value}`); - } + { + event: "response", + request, + response } - } - - return possibleMessages; -} - -function _isSentryError(event) { - try { - // @ts-expect-error can't be a sentry error if undefined - return event.exception.values[0].type === 'SentryError'; - } catch (e) { - // ignore - } - return false; -} - -function _getLastValidUrl(frames = []) { - for (let i = frames.length - 1; i >= 0; i--) { - const frame = frames[i]; - - if (frame && frame.filename !== '' && frame.filename !== '[native code]') { - return frame.filename || null; - } - } - - return null; -} - -function _getEventFilterUrl(event) { - try { - let frames; - try { - // @ts-expect-error we only care about frames if the whole thing here is defined - frames = event.exception.values[0].stacktrace.frames; - } catch (e) { - // ignore - } - return frames ? _getLastValidUrl(frames) : null; - } catch (oO) { - debugBuild.DEBUG_BUILD && logger.logger.error(`Cannot extract url for event ${misc.getEventDescription(event)}`); - return null; - } -} - -function _isUselessError(event) { - if (event.type) { - // event is not an error - return false; - } - - // We only want to consider events for dropping that actually have recorded exception values. - if (!event.exception || !event.exception.values || event.exception.values.length === 0) { - return false; - } - - return ( - // No top-level message - !event.message && - // There are no exception values that have a stacktrace, a non-generic-Error type or value - !event.exception.values.some(value => value.stacktrace || (value.type && value.type !== 'Error') || value.value) ); } -exports.inboundFiltersIntegration = inboundFiltersIntegration; -//# sourceMappingURL=inboundfilters.js.map +exports.addOutgoingRequestBreadcrumb = addOutgoingRequestBreadcrumb; +//# sourceMappingURL=add-outgoing-request-breadcrumb.js.map + + +/***/ }), + +/***/ 54615: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const getDefaultExport = __nccwpck_require__(94853); +const constants = __nccwpck_require__(39009); +const object = __nccwpck_require__(5906); +const clientSubscriptions = __nccwpck_require__(81832); + +let onHttpClientRequestCreated; +function patchClientRequest(httpModule, options) { + const proto = httpModule.ClientRequest?.prototype; + if (typeof proto?._storeHeader !== "function") { + return; + } + const subscriptions = clientSubscriptions.getHttpClientSubscriptions({ + ...options, + http: httpModule + }); + onHttpClientRequestCreated = subscriptions[constants.HTTP_ON_CLIENT_REQUEST]; + if (object.getOriginalFunction(proto._storeHeader)) { + return; + } + const originalStoreHeader = proto._storeHeader; + object.wrapMethod(proto, "_storeHeader", function patchedStoreHeader(...args) { + try { + onHttpClientRequestCreated({ request: this }, constants.HTTP_ON_CLIENT_REQUEST); + } catch { + } + return originalStoreHeader.apply(this, args); + }); +} +function patchModule(httpModuleExport, options = {}) { + const httpModule = getDefaultExport.getDefaultExport(httpModuleExport); + patchClientRequest(httpModule, options); + return httpModuleExport; +} +const patchHttpModuleClient = (httpModuleExport, options = {}) => patchModule(httpModuleExport, options); + +exports.patchHttpModuleClient = patchHttpModuleClient; +//# sourceMappingURL=client-patch.js.map + + +/***/ }), + +/***/ 81832: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const addOutgoingRequestBreadcrumb = __nccwpck_require__(2492); +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const currentScopes = __nccwpck_require__(8131); +const spanstatus = __nccwpck_require__(21119); +const hasSpansEnabled = __nccwpck_require__(42982); +const trace = __nccwpck_require__(97956); +const bindScopeToEmitter = __nccwpck_require__(77388); +const lru = __nccwpck_require__(67080); +const getOutgoingSpanData = __nccwpck_require__(54290); +const getRequestUrl = __nccwpck_require__(51462); +const injectTracePropagationHeaders = __nccwpck_require__(89283); +const constants = __nccwpck_require__(39009); +const doubleWrapWarning = __nccwpck_require__(10999); + +function getHttpClientSubscriptions(options) { + const propagationDecisionMap = new lru.LRUMap(100); + const getConfig = () => currentScopes.getClient()?.getOptions(); + const onHttpClientRequestCreated = (data) => { + if (currentScopes.getCurrentScope().getScopeData().sdkProcessingMetadata[trace.SUPPRESS_TRACING_KEY] === true) { + return; + } + const clientOptions = getConfig(); + const { + errorMonitor = "error", + spans: createSpans = clientOptions ? hasSpansEnabled.hasSpansEnabled(clientOptions) : true, + propagateTrace = false, + breadcrumbs = true, + http, + https, + suppressOtelWarning = false + } = options; + const { request } = data; + if (options.ignoreOutgoingRequests?.(getRequestUrl.getRequestUrlFromClientRequest(request), request)) { + return; + } + let addedBreadcrumbs = false; + function addBreadcrumbs(request2, response) { + if (!addedBreadcrumbs) { + addedBreadcrumbs = true; + addOutgoingRequestBreadcrumb.addOutgoingRequestBreadcrumb(request2, response); + } + } + function breadcrumbsOnly(request2) { + request2.on(errorMonitor, () => addBreadcrumbs(request2, void 0)); + request2.prependListener("response", (response) => { + if (request2.listenerCount("response") <= 1) { + response.resume(); + } + response.on("end", () => addBreadcrumbs(request2, response)); + response.on(errorMonitor, () => addBreadcrumbs(request2, response)); + }); + } + if (!createSpans) { + if (breadcrumbs) { + breadcrumbsOnly(request); + } + if (propagateTrace) { + injectTracePropagationHeaders.injectTracePropagationHeaders(request, propagationDecisionMap); + } + return; + } + if (!suppressOtelWarning) { + if (http) doubleWrapWarning.doubleWrapWarning(http); + if (https) doubleWrapWarning.doubleWrapWarning(https); + } + const span = trace.startInactiveSpan(getOutgoingSpanData.getOutgoingRequestSpanData(request)); + options.outgoingRequestHook?.(span, request); + if (propagateTrace) { + if (span.isRecording()) { + trace.withActiveSpan(span, () => { + injectTracePropagationHeaders.injectTracePropagationHeaders(request, propagationDecisionMap); + }); + } else { + injectTracePropagationHeaders.injectTracePropagationHeaders(request, propagationDecisionMap); + } + } + let spanEnded = false; + function endSpan(status) { + if (!spanEnded) { + spanEnded = true; + span.setStatus(status); + span.end(); + } + } + const requestOnClose = () => endSpan({ code: spanstatus.SPAN_STATUS_UNSET }); + request.on("close", requestOnClose); + request.on(errorMonitor, (error) => { + debugBuild.DEBUG_BUILD && debugLogger.debug.log(constants.LOG_PREFIX, "outgoingRequest on request error()", error); + if (breadcrumbs) { + addBreadcrumbs(request, void 0); + } + endSpan({ code: spanstatus.SPAN_STATUS_ERROR }); + }); + request.prependListener("response", (response) => { + request.removeListener("close", requestOnClose); + if (request.listenerCount("response") <= 1) { + response.resume(); + } + getOutgoingSpanData.setIncomingResponseSpanData(response, span); + bindScopeToEmitter.bindScopeToEmitter(response); + options.outgoingResponseHook?.(span, response); + let finished = false; + function finishWithResponse(error) { + if (!finished) { + finished = true; + if (error) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log(constants.LOG_PREFIX, "outgoingRequest on response error()", error); + } + if (breadcrumbs) { + addBreadcrumbs(request, response); + } + const aborted = response.aborted && !response.complete; + const status = error || typeof response.statusCode !== "number" || aborted ? { code: spanstatus.SPAN_STATUS_ERROR } : spanstatus.getSpanStatusFromHttpCode(response.statusCode); + options.applyCustomAttributesOnSpan?.(span, request, response); + endSpan(status); + } + } + response.on("end", () => finishWithResponse()); + response.on(errorMonitor, finishWithResponse); + }); + }; + return { + [constants.HTTP_ON_CLIENT_REQUEST]: onHttpClientRequestCreated + }; +} + +exports.getHttpClientSubscriptions = getHttpClientSubscriptions; +//# sourceMappingURL=client-subscriptions.js.map + + +/***/ }), + +/***/ 39009: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const LOG_PREFIX = "@sentry/instrumentation-http"; +const HTTP_ON_CLIENT_REQUEST = "http.client.request.created"; +const HTTP_ON_SERVER_REQUEST = "http.server.request.start"; + +exports.HTTP_ON_CLIENT_REQUEST = HTTP_ON_CLIENT_REQUEST; +exports.HTTP_ON_SERVER_REQUEST = HTTP_ON_SERVER_REQUEST; +exports.LOG_PREFIX = LOG_PREFIX; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 10999: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); + +const isOtelWrapped = (fn) => typeof fn.__unwrap === "function"; +const warning = "Double-wrapped http.client detected. Either disable spans in Sentry.httpIntegration, or disable the OpenTelemetry HTTP instrumentation. See: https://docs.sentry.io/platforms/javascript/guides/express/opentelemetry/custom-setup/#custom-http-instrumentation"; +let didDoubleWrapWarning = false; +const doubleWrapWarning = debugBuild.DEBUG_BUILD ? (http) => { + if (!didDoubleWrapWarning) { + if (isOtelWrapped(http.request) || isOtelWrapped(http.get)) { + didDoubleWrapWarning = true; + debugLogger.debug.warn(warning); + } + } +} : () => { +}; + +exports.doubleWrapWarning = doubleWrapWarning; +exports.warning = warning; +//# sourceMappingURL=double-wrap-warning.js.map + + +/***/ }), + +/***/ 54290: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const semanticAttributes = __nccwpck_require__(36827); +const url = __nccwpck_require__(78253); +const getRequestUrl = __nccwpck_require__(51462); + +function getOutgoingRequestSpanData(request) { + const url$1 = getRequestUrl.getRequestUrlFromClientRequest(request); + const [name, attributes] = url.getHttpSpanDetailsFromUrlObject( + url.parseStringToURLObject(url$1), + "client", + "auto.http.client", + request + ); + const userAgent = request.getHeader("user-agent"); + return { + name, + attributes: { + // TODO(v11): Update these to the Sentry semantic attributes for urls. + // https://getsentry.github.io/sentry-conventions/attributes/ + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client", + "otel.kind": "CLIENT", + "http.url": url$1, + "http.method": request.method, + "http.target": request.path || "/", + "net.peer.name": request.host, + "http.host": request.getHeader("host"), + ...userAgent ? { "user_agent.original": userAgent } : {}, + ...attributes + }, + onlyIfParent: true + }; +} +function setIncomingResponseSpanData(response, span) { + const { statusCode, statusMessage, httpVersion, socket } = response; + const transport = httpVersion?.toUpperCase() !== "QUIC" ? "ip_tcp" : "ip_udp"; + span.setAttributes({ + "http.response.status_code": statusCode, + "network.protocol.version": httpVersion, + // TODO(v11): Update these to the Sentry semantic attributes for urls. + // https://getsentry.github.io/sentry-conventions/attributes/ + "http.flavor": httpVersion, + "network.transport": transport, + "net.transport": transport, + "http.status_text": statusMessage?.toUpperCase(), + "http.status_code": statusCode, + ...getResponseContentLengthAttributes(response), + ...getSocketAttrs(socket) + }); +} +function getSocketAttrs(socket) { + if (!socket) return {}; + const { remoteAddress, remotePort } = socket; + return { + "network.peer.address": remoteAddress, + "network.peer.port": remotePort, + "net.peer.ip": remoteAddress, + "net.peer.port": remotePort + }; +} +function getResponseContentLengthAttributes(response) { + const { headers } = response; + const contentLengthHeader = headers["content-length"]; + const length = contentLengthHeader ? parseInt(String(contentLengthHeader), 10) : -1; + const encoding = headers["content-encoding"]; + return length >= 0 ? encoding && encoding !== "identity" ? { "http.response_content_length": length } : { "http.response_content_length_uncompressed": length } : {}; +} + +exports.getOutgoingRequestSpanData = getOutgoingRequestSpanData; +exports.setIncomingResponseSpanData = setIncomingResponseSpanData; +//# sourceMappingURL=get-outgoing-span-data.js.map + + +/***/ }), + +/***/ 51462: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function getRequestOptions(request) { + const hostWithPort = request.host || ""; + const portInHost = /^(.*):(\d+)$/.exec(hostWithPort); + const hostname = portInHost ? portInHost[1] : hostWithPort; + const port = request.port ?? (portInHost ? Number(portInHost[2]) : void 0); + return { + method: request.method, + port, + protocol: request.protocol, + host: request.host, + hostname, + path: request.path, + headers: request.getHeaders() + }; +} +function getRequestUrl(requestOptions) { + try { + return String(getRequestUrlObject(requestOptions)); + } catch { + return ""; + } +} +function getRequestUrlObject(requestOptions) { + const protocol = requestOptions.protocol || "http:"; + const hostHeader = requestOptions.headers?.host && String(requestOptions.headers?.host); + const hostname = hostHeader || requestOptions.hostname || requestOptions.host || ""; + const port = !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname) ? "" : `:${requestOptions.port}`; + const path = requestOptions.path ? requestOptions.path : "/"; + const base = `${protocol}//${hostname}${port}`; + return new URL(path.startsWith("//") ? `${base}${path}` : path, base); +} +function getRequestUrlFromClientRequest(request) { + return String(getRequestUrl(getRequestOptions(request))); +} + +exports.getRequestOptions = getRequestOptions; +exports.getRequestUrl = getRequestUrl; +exports.getRequestUrlFromClientRequest = getRequestUrlFromClientRequest; +exports.getRequestUrlObject = getRequestUrlObject; +//# sourceMappingURL=get-request-url.js.map + + +/***/ }), + +/***/ 89283: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); +const traceData = __nccwpck_require__(7522); +const tracePropagationTargets = __nccwpck_require__(22680); +const constants = __nccwpck_require__(39009); +const getRequestUrl = __nccwpck_require__(51462); +const baggage = __nccwpck_require__(2135); + +function injectTracePropagationHeaders(request, propagationDecisionMap) { + const url = getRequestUrl.getRequestUrlFromClientRequest(request); + const clientOptions = currentScopes.getClient()?.getOptions(); + const { tracePropagationTargets: tracePropagationTargets$1, propagateTraceparent } = clientOptions ?? {}; + if (!tracePropagationTargets.shouldPropagateTraceForUrl(url, tracePropagationTargets$1, propagationDecisionMap)) { + return; + } + const hasExistingSentryTraceHeader = !!request.getHeader("sentry-trace"); + if (hasExistingSentryTraceHeader) { + return; + } + const traceData$1 = traceData.getTraceData({ propagateTraceparent }); + if (!traceData$1) return; + const { "sentry-trace": sentryTrace, baggage: baggage$1, traceparent } = traceData$1; + if (sentryTrace) { + try { + request.setHeader("sentry-trace", sentryTrace); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(constants.LOG_PREFIX, "Added sentry-trace header"); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error(constants.LOG_PREFIX, "Failed to set sentry-trace header:", is.isError(e) ? e.message : "Unknown error"); + } + } + if (traceparent && !request.getHeader("traceparent")) { + try { + request.setHeader("traceparent", traceparent); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(constants.LOG_PREFIX, "Added traceparent header"); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error(constants.LOG_PREFIX, "Failed to set traceparent header:", is.isError(e) ? e.message : "Unknown error"); + } + } + if (baggage$1) { + const merged = baggage.mergeBaggageHeaders(request.getHeader("baggage"), baggage$1); + if (merged) { + try { + request.setHeader("baggage", merged); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(constants.LOG_PREFIX, "Added baggage header"); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error(constants.LOG_PREFIX, "Failed to set baggage header:", is.isError(e) ? e.message : "Unknown error"); + } + } + } +} + +exports.injectTracePropagationHeaders = injectTracePropagationHeaders; +//# sourceMappingURL=inject-trace-propagation-headers.js.map + + +/***/ }), + +/***/ 73008: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugLogger = __nccwpck_require__(41772); +const debugBuild = __nccwpck_require__(14488); +const request = __nccwpck_require__(82141); + +function patchRequestToCaptureBody(req, isolationScope, maxIncomingRequestBodySize, integrationName) { + let bodyByteLength = 0; + const chunks = []; + debugBuild.DEBUG_BUILD && debugLogger.debug.log(integrationName, "Patching request.on"); + const callbackMap = /* @__PURE__ */ new WeakMap(); + const maxBodySize = request.getMaxBodyByteLength(maxIncomingRequestBodySize); + try { + req.on = req.addListener = new Proxy(req.on, { + apply: (target, thisArg, args) => { + const [event, listener, ...restArgs] = args; + if (event === "data") { + debugBuild.DEBUG_BUILD && debugLogger.debug.log(integrationName, `Handling request.on("data") with maximum body size of ${maxBodySize}b`); + const callback = new Proxy(listener, { + apply: (target2, thisArg2, args2) => { + try { + const chunk = args2[0]; + const bufferifiedChunk = Buffer.from(chunk); + if (bodyByteLength < maxBodySize) { + chunks.push(bufferifiedChunk); + bodyByteLength += bufferifiedChunk.byteLength; + } else if (debugBuild.DEBUG_BUILD) { + debugLogger.debug.log( + integrationName, + `Dropping request body chunk because maximum body length of ${maxBodySize}b is exceeded.` + ); + } + } catch (_err) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error(integrationName, "Encountered error while storing body chunk."); + } + return Reflect.apply(target2, thisArg2, args2); + } + }); + callbackMap.set(listener, callback); + return Reflect.apply(target, thisArg, [event, callback, ...restArgs]); + } + return Reflect.apply(target, thisArg, args); + } + }); + req.off = req.removeListener = new Proxy(req.off, { + apply: (target, thisArg, args) => { + const [, listener] = args; + const callback = callbackMap.get(listener); + if (callback) { + callbackMap.delete(listener); + const modifiedArgs = args.slice(); + modifiedArgs[1] = callback; + return Reflect.apply(target, thisArg, modifiedArgs); + } + return Reflect.apply(target, thisArg, args); + } + }); + req.on("end", () => { + try { + const body = Buffer.concat(chunks).toString("utf-8"); + if (body) { + const bodyByteLength2 = Buffer.byteLength(body, "utf-8"); + const truncatedBody = bodyByteLength2 > maxBodySize ? `${Buffer.from(body).subarray(0, maxBodySize - 3).toString("utf-8")}...` : body; + isolationScope.setSDKProcessingMetadata({ normalizedRequest: { data: truncatedBody } }); + } + } catch (error) { + if (debugBuild.DEBUG_BUILD) { + debugLogger.debug.error(integrationName, "Error building captured request body", error); + } + } + }); + } catch (error) { + if (debugBuild.DEBUG_BUILD) { + debugLogger.debug.error(integrationName, "Error patching request to capture body", error); + } + } +} + +exports.patchRequestToCaptureBody = patchRequestToCaptureBody; +//# sourceMappingURL=patch-request-to-capture-body.js.map + + +/***/ }), + +/***/ 11273: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugLogger = __nccwpck_require__(41772); +const debugBuild = __nccwpck_require__(14488); +const randomSafeContext = __nccwpck_require__(28695); +const timer = __nccwpck_require__(85548); + +const clientToRequestSessionAggregatesMap = /* @__PURE__ */ new WeakMap(); +function recordRequestSession(client, { + requestIsolationScope, + response, + sessionFlushingDelayMS +}) { + requestIsolationScope.setSDKProcessingMetadata({ + requestSession: { status: "ok" } + }); + response.once("close", () => { + const requestSession = requestIsolationScope.getScopeData().sdkProcessingMetadata.requestSession; + if (client && requestSession) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Recorded request session with status: ${requestSession.status}`); + const roundedDate = new Date(randomSafeContext.safeDateNow()); + roundedDate.setSeconds(0, 0); + const dateBucketKey = roundedDate.toISOString(); + const existingClientAggregate = clientToRequestSessionAggregatesMap.get(client); + const bucket = existingClientAggregate?.[dateBucketKey] || { exited: 0, crashed: 0, errored: 0 }; + bucket[{ ok: "exited", crashed: "crashed", errored: "errored" }[requestSession.status]]++; + if (existingClientAggregate) { + existingClientAggregate[dateBucketKey] = bucket; + } else { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Opened new request session aggregate."); + const newClientAggregate = { [dateBucketKey]: bucket }; + clientToRequestSessionAggregatesMap.set(client, newClientAggregate); + const flushPendingClientAggregates = () => { + clearTimeout(timeout); + unregisterClientFlushHook(); + clientToRequestSessionAggregatesMap.delete(client); + const aggregatePayload = Object.entries(newClientAggregate).map( + ([timestamp, value]) => ({ + started: timestamp, + exited: value.exited, + errored: value.errored, + crashed: value.crashed + }) + ); + client.sendSession({ aggregates: aggregatePayload }); + }; + const unregisterClientFlushHook = client.on("flush", () => { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Sending request session aggregate due to client flush"); + flushPendingClientAggregates(); + }); + const timeout = setTimeout(() => { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Sending request session aggregate due to flushing schedule"); + flushPendingClientAggregates(); + }, sessionFlushingDelayMS); + timer.safeUnref(timeout); + } + } + }); +} + +exports.recordRequestSession = recordRequestSession; +//# sourceMappingURL=record-request-session.js.map + + +/***/ }), + +/***/ 29290: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const constants = __nccwpck_require__(39009); +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const currentScopes = __nccwpck_require__(8131); +const hasSpansEnabled = __nccwpck_require__(42982); +const request = __nccwpck_require__(82141); +const patchRequestToCaptureBody = __nccwpck_require__(73008); +const url = __nccwpck_require__(78253); +const recordRequestSession = __nccwpck_require__(11273); +const propagationContext = __nccwpck_require__(95102); +const trace = __nccwpck_require__(97956); +const randomSafeContext = __nccwpck_require__(28695); +const semanticAttributes = __nccwpck_require__(36827); +const spanstatus = __nccwpck_require__(21119); +const attributes = __nccwpck_require__(88264); +const spanKind = __nccwpck_require__(14516); + +const INTEGRATION_NAME = "Http.Server"; +const SPANS_INTEGRATION_NAME = "Http.SentryServerSpans"; +const lastSentryEmitMap = /* @__PURE__ */ new WeakMap(); +const kRequestMark = /* @__PURE__ */ Symbol.for("sentry_http_server_instrumented"); +function markRequest(request) { + return !request[kRequestMark] && (request[kRequestMark] = true); +} +function instrumentServer(options, server) { + const currentEmit = server.emit; + const instrumentedEmit = lastSentryEmitMap.get(server); + if (currentEmit === instrumentedEmit) { + return; + } + const newEmit = new Proxy(currentEmit, { + apply(target, thisArg, args) { + const [event, ...data] = args; + if (event !== "request") { + return target.apply(thisArg, args); + } + const client = currentScopes.getClient(); + const [request$1, response] = data; + if (!client || !markRequest(request$1)) { + return target.apply(thisArg, args); + } + debugBuild.DEBUG_BUILD && debugLogger.debug.log(INTEGRATION_NAME, "Handling incoming request"); + const isolationScope = currentScopes.getIsolationScope().clone(); + isolationScope.setClient(client); + const ipAddress = request$1.socket?.remoteAddress; + const url$1 = request$1.url || "/"; + const normalizedRequest = request.httpRequestToRequestData(request$1); + const { + maxRequestBodySize = "medium", + ignoreRequestBody, + sessions = true, + sessionFlushingDelayMS = 6e4 + } = options; + if (maxRequestBodySize !== "none" && !ignoreRequestBody?.(url$1, request$1)) { + patchRequestToCaptureBody.patchRequestToCaptureBody(request$1, isolationScope, maxRequestBodySize, INTEGRATION_NAME); + } + isolationScope.setSDKProcessingMetadata({ normalizedRequest, ipAddress }); + const httpMethod = (request$1.method || "GET").toUpperCase(); + const httpTargetWithoutQueryFragment = url.stripUrlQueryAndFragment(url$1); + const bestEffortTransactionName = `${httpMethod} ${httpTargetWithoutQueryFragment}`; + isolationScope.setTransactionName(bestEffortTransactionName); + if (sessions) { + recordRequestSession.recordRequestSession(client, { + requestIsolationScope: isolationScope, + response, + sessionFlushingDelayMS: sessionFlushingDelayMS ?? 6e4 + }); + } + return currentScopes.withIsolationScope(isolationScope, () => { + const sentryTrace = normalizedRequest.headers?.["sentry-trace"]; + const baggage = normalizedRequest.headers?.["baggage"]; + const sentryTraceValue = Array.isArray(sentryTrace) ? sentryTrace[0] : sentryTrace; + return trace.continueTrace( + { + sentryTrace: sentryTraceValue, + baggage: Array.isArray(baggage) ? baggage[0] : baggage + }, + () => { + const propagationContext$1 = currentScopes.getCurrentScope().getPropagationContext(); + propagationContext$1.propagationSpanId = propagationContext.generateSpanId(); + if (!sentryTraceValue) { + propagationContext$1.traceId = propagationContext.generateTraceId(); + propagationContext$1.sampleRand = randomSafeContext.safeMathRandom(); + } + response.once("close", () => { + isolationScope.setContext("response", { + status_code: response.statusCode + }); + }); + const wrap = options.wrapServerEmitRequest; + let emitResult = false; + if (wrap) { + wrap(request$1, response, normalizedRequest, () => { + emitResult = target.apply(thisArg, args); + }); + } else { + emitResult = target.apply(thisArg, args); + } + return emitResult; + } + ); + }); + } + }); + lastSentryEmitMap.set(server, newEmit); + server.emit = newEmit; +} +function getHttpServerSubscriptions(options) { + const userWrap = options.wrapServerEmitRequest; + const spanWrap = buildServerSpanWrap(options); + const effectiveOptions = { + ...options, + wrapServerEmitRequest(request, response, normalizedRequest, next) { + const clientOptions = currentScopes.getClient()?.getOptions(); + const createSpans = options.spans ?? (clientOptions ? hasSpansEnabled.hasSpansEnabled(clientOptions) : false); + if (createSpans) { + spanWrap(request, response, normalizedRequest, next); + } else if (userWrap) { + userWrap(request, response, normalizedRequest, next); + } else { + next(); + } + } + }; + const onHttpServerRequest = (data) => { + const { server } = data; + instrumentServer(effectiveOptions, server); + }; + return { [constants.HTTP_ON_SERVER_REQUEST]: onHttpServerRequest }; +} +function buildServerSpanWrap(options) { + const { + wrapServerEmitRequest: userWrap, + ignoreIncomingRequests, + ignoreStaticAssets = true, + onSpanCreated, + errorMonitor = "error", + onSpanEnd + } = options; + return (request$1, response, normalizedRequest, next) => { + if (typeof __SENTRY_TRACING__ !== "undefined" && !__SENTRY_TRACING__) { + return next(); + } + return userWrap ? userWrap(request$1, response, normalizedRequest, createSpan) : createSpan(); + function createSpan() { + const isolationScope = currentScopes.getIsolationScope(); + const client = isolationScope.getClient(); + if (!client) { + return next(); + } + if (shouldIgnoreSpansForIncomingRequest(request$1, { + ignoreStaticAssets, + ignoreIncomingRequests + })) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log(SPANS_INTEGRATION_NAME, "Skipping span creation for incoming request", request$1.url); + return next(); + } + const fullUrl = normalizedRequest.url || request$1.url || "/"; + const urlObj = url.parseStringToURLObject(fullUrl); + const httpTargetWithoutQueryFragment = urlObj ? urlObj.pathname : url.stripUrlQueryAndFragment(fullUrl); + const method = (request$1.method || "GET").toUpperCase(); + const name = `${method} ${httpTargetWithoutQueryFragment}`; + const headers = request$1.headers; + const userAgent = headers["user-agent"]; + const ips = headers["x-forwarded-for"]; + const httpVersion = request$1.httpVersion; + const host = headers.host; + const hostname = host?.replace(/^(.*)(:[0-9]{1,5})/, "$1") || "localhost"; + const scheme = fullUrl.startsWith("https") ? "https" : "http"; + const { socket } = request$1; + const { localAddress, localPort, remoteAddress, remotePort } = socket ?? {}; + return trace.startSpanManual( + { + name, + // Pass SERVER so the OTel sampler infers op='http.server' rather than + // 'http', which it does for the INTERNAL default. + kind: spanKind.SPAN_KIND.SERVER, + attributes: { + // Sentry-specific attributes + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.server", + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.server", + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url", + // Set http.route to the URL path as a best-effort route name. + // Framework integrations (Express, etc.) update this via onSpanEnd. + "http.route": httpTargetWithoutQueryFragment, + // OTel kind (explicit attribute so it appears in span data) + "otel.kind": "SERVER", + // Network attributes + "net.host.ip": localAddress, + "net.host.port": localPort, + "net.peer.ip": remoteAddress, + "net.peer.port": remotePort, + "sentry.http.prefetch": isKnownPrefetchRequest(request$1) || void 0, + // Old Semantic Conventions attributes for compatibility + [attributes.URL_FULL]: urlObj && !url.isURLObjectRelative(urlObj) ? urlObj.href : void 0, + [attributes.URL_PATH]: urlObj?.pathname ?? httpTargetWithoutQueryFragment, + // oxlint-disable-next-line typescript-eslint(no-deprecated) + [attributes.HTTP_URL]: fullUrl, + "http.method": method, + "http.target": urlObj ? `${urlObj.pathname}${urlObj.search}` : httpTargetWithoutQueryFragment, + "http.host": host, + "net.host.name": hostname, + "http.client_ip": typeof ips === "string" ? ips.split(",")[0] : void 0, + "http.user_agent": userAgent, + "http.scheme": scheme, + "http.flavor": httpVersion, + "net.transport": httpVersion?.toUpperCase() === "QUIC" ? "ip_udp" : "ip_tcp", + ...getRequestContentLengthAttribute(request$1), + ...request.httpHeadersToSpanAttributes(normalizedRequest.headers || {}, client.getDataCollectionOptions()) + } + }, + (span) => { + onSpanCreated?.(span, request$1, response); + let isEnded = false; + function endSpan(status) { + if (isEnded) { + return; + } + isEnded = true; + span.setAttributes({ + "http.status_text": response.statusMessage?.toUpperCase(), + "http.response.status_code": response.statusCode, + "http.status_code": response.statusCode, + ...request.httpHeadersToSpanAttributes( + request.headersToDict(response.headers), + client?.getDataCollectionOptions() ?? false, + "response" + ) + }); + span.setStatus(status); + onSpanEnd?.(span, request$1, response); + span.end(); + } + response.once("close", () => { + endSpan(spanstatus.getSpanStatusFromHttpCode(response.statusCode)); + }); + response.once(errorMonitor, () => { + const httpStatus = spanstatus.getSpanStatusFromHttpCode(response.statusCode); + endSpan(httpStatus.code === spanstatus.SPAN_STATUS_ERROR ? httpStatus : { code: spanstatus.SPAN_STATUS_ERROR }); + }); + next(); + } + ); + } + }; +} +function shouldIgnoreSpansForIncomingRequest(request, { + ignoreStaticAssets, + ignoreIncomingRequests +}) { + const urlPath = request.url; + const method = request.method?.toUpperCase(); + if (method === "OPTIONS" || method === "HEAD" || !urlPath) { + return true; + } + if (ignoreStaticAssets && method === "GET" && isStaticAssetRequest(urlPath)) { + return true; + } + if (ignoreIncomingRequests?.(urlPath, request)) { + return true; + } + return false; +} +function isStaticAssetRequest(urlPath) { + const path = url.stripUrlQueryAndFragment(urlPath); + if (path.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) { + return true; + } + if (path.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) { + return true; + } + return false; +} +function isKnownPrefetchRequest(req) { + return req.headers["next-router-prefetch"] === "1"; +} +function getRequestContentLengthAttribute(request) { + const { headers } = request; + const contentLengthHeader = headers["content-length"]; + const length = contentLengthHeader ? parseInt(String(contentLengthHeader), 10) : -1; + const encoding = headers["content-encoding"]; + return length >= 0 ? encoding && encoding !== "identity" ? { "http.request_content_length": length } : { "http.request_content_length_uncompressed": length } : {}; +} + +exports.getHttpServerSubscriptions = getHttpServerSubscriptions; +exports.instrumentServer = instrumentServer; +exports.isStaticAssetRequest = isStaticAssetRequest; +//# sourceMappingURL=server-subscription.js.map /***/ }), @@ -68930,39 +24552,26 @@ exports.inboundFiltersIntegration = inboundFiltersIntegration; /***/ 90529: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const integration = __nccwpck_require__(67428); -const aggregateErrors = __nccwpck_require__(29416); -const eventbuilder = __nccwpck_require__(2781); +const aggregateErrors = __nccwpck_require__(70277); +const eventbuilder = __nccwpck_require__(16273); -const DEFAULT_KEY = 'cause'; +const DEFAULT_KEY = "cause"; const DEFAULT_LIMIT = 5; - -const INTEGRATION_NAME = 'LinkedErrors'; - +const INTEGRATION_NAME = "LinkedErrors"; const _linkedErrorsIntegration = ((options = {}) => { const limit = options.limit || DEFAULT_LIMIT; const key = options.key || DEFAULT_KEY; - return { name: INTEGRATION_NAME, preprocessEvent(event, hint, client) { - const options = client.getOptions(); - - aggregateErrors.applyAggregateErrorsToEvent( - eventbuilder.exceptionFromError, - options.stackParser, - options.maxValueLength, - key, - limit, - event, - hint, - ); - }, + const options2 = client.getOptions(); + aggregateErrors.applyAggregateErrorsToEvent(eventbuilder.exceptionFromError, options2.stackParser, key, limit, event, hint); + } }; -}) ; - +}); const linkedErrorsIntegration = integration.defineIntegration(_linkedErrorsIntegration); exports.linkedErrorsIntegration = linkedErrorsIntegration; @@ -68971,34 +24580,1271 @@ exports.linkedErrorsIntegration = linkedErrorsIntegration; /***/ }), -/***/ 1668: +/***/ 27940: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const url = __nccwpck_require__(78253); +const attributes = __nccwpck_require__(72498); +const methodConfig = __nccwpck_require__(67274); + +function formatLoggingData(data) { + return typeof data === "string" ? data : JSON.stringify(data); +} +function getNotificationAttributes(method, params, recordInputs) { + const attributes$1 = {}; + switch (method) { + case "notifications/cancelled": + if (params?.requestId) { + attributes$1["mcp.cancelled.request_id"] = String(params.requestId); + } + if (params?.reason) { + attributes$1["mcp.cancelled.reason"] = String(params.reason); + } + break; + case "notifications/message": + if (params?.level) { + attributes$1[attributes.MCP_LOGGING_LEVEL_ATTRIBUTE] = String(params.level); + } + if (params?.logger) { + attributes$1[attributes.MCP_LOGGING_LOGGER_ATTRIBUTE] = String(params.logger); + } + if (params?.data !== void 0) { + attributes$1[attributes.MCP_LOGGING_DATA_TYPE_ATTRIBUTE] = typeof params.data; + if (recordInputs) { + attributes$1[attributes.MCP_LOGGING_MESSAGE_ATTRIBUTE] = formatLoggingData(params.data); + } + } + break; + case "notifications/progress": + if (params?.progressToken) { + attributes$1["mcp.progress.token"] = String(params.progressToken); + } + if (typeof params?.progress === "number") { + attributes$1["mcp.progress.current"] = params.progress; + } + if (typeof params?.total === "number") { + attributes$1["mcp.progress.total"] = params.total; + if (typeof params?.progress === "number") { + attributes$1["mcp.progress.percentage"] = params.progress / params.total * 100; + } + } + if (params?.message) { + attributes$1["mcp.progress.message"] = String(params.message); + } + break; + case "notifications/resources/updated": + if (params?.uri) { + attributes$1[attributes.MCP_RESOURCE_URI_ATTRIBUTE] = String(params.uri); + const urlObject = url.parseStringToURLObject(String(params.uri)); + if (urlObject && !url.isURLObjectRelative(urlObject)) { + attributes$1["mcp.resource.protocol"] = urlObject.protocol.replace(":", ""); + } + } + break; + case "notifications/initialized": + attributes$1["mcp.lifecycle.phase"] = "initialization_complete"; + attributes$1["mcp.protocol.ready"] = 1; + break; + } + return attributes$1; +} +function buildTypeSpecificAttributes(type, message, params, recordInputs) { + if (type === "request") { + const request = message; + const targetInfo = methodConfig.extractTargetInfo(request.method, params || {}); + return { + ...request.id !== void 0 && { [attributes.MCP_REQUEST_ID_ATTRIBUTE]: String(request.id) }, + ...targetInfo.attributes, + ...recordInputs ? methodConfig.getRequestArguments(request.method, params || {}) : {} + }; + } + return getNotificationAttributes(message.method, params || {}, recordInputs); +} + +exports.buildTypeSpecificAttributes = buildTypeSpecificAttributes; +exports.getNotificationAttributes = getNotificationAttributes; +//# sourceMappingURL=attributeExtraction.js.map + + +/***/ }), + +/***/ 72498: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const MCP_METHOD_NAME_ATTRIBUTE = "mcp.method.name"; +const MCP_REQUEST_ID_ATTRIBUTE = "mcp.request.id"; +const MCP_SESSION_ID_ATTRIBUTE = "mcp.session.id"; +const MCP_TRANSPORT_ATTRIBUTE = "mcp.transport"; +const MCP_SERVER_NAME_ATTRIBUTE = "mcp.server.name"; +const MCP_SERVER_TITLE_ATTRIBUTE = "mcp.server.title"; +const MCP_SERVER_VERSION_ATTRIBUTE = "mcp.server.version"; +const MCP_PROTOCOL_VERSION_ATTRIBUTE = "mcp.protocol.version"; +const MCP_TOOL_NAME_ATTRIBUTE = "mcp.tool.name"; +const MCP_RESOURCE_URI_ATTRIBUTE = "mcp.resource.uri"; +const MCP_PROMPT_NAME_ATTRIBUTE = "mcp.prompt.name"; +const MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE = "mcp.tool.result.is_error"; +const MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE = "mcp.tool.result.content_count"; +const MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE = "mcp.prompt.result.description"; +const MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE = "mcp.prompt.result.message_count"; +const MCP_REQUEST_ARGUMENT = "mcp.request.argument"; +const MCP_LOGGING_LEVEL_ATTRIBUTE = "mcp.logging.level"; +const MCP_LOGGING_LOGGER_ATTRIBUTE = "mcp.logging.logger"; +const MCP_LOGGING_DATA_TYPE_ATTRIBUTE = "mcp.logging.data_type"; +const MCP_LOGGING_MESSAGE_ATTRIBUTE = "mcp.logging.message"; +const NETWORK_TRANSPORT_ATTRIBUTE = "network.transport"; +const NETWORK_PROTOCOL_VERSION_ATTRIBUTE = "network.protocol.version"; +const CLIENT_ADDRESS_ATTRIBUTE = "client.address"; +const CLIENT_PORT_ATTRIBUTE = "client.port"; +const MCP_SERVER_OP_VALUE = "mcp.server"; +const MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE = "mcp.notification.client_to_server"; +const MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE = "mcp.notification.server_to_client"; +const MCP_FUNCTION_ORIGIN_VALUE = "auto.function.mcp_server"; +const MCP_NOTIFICATION_ORIGIN_VALUE = "auto.mcp.notification"; +const MCP_ROUTE_SOURCE_VALUE = "route"; + +exports.CLIENT_ADDRESS_ATTRIBUTE = CLIENT_ADDRESS_ATTRIBUTE; +exports.CLIENT_PORT_ATTRIBUTE = CLIENT_PORT_ATTRIBUTE; +exports.MCP_FUNCTION_ORIGIN_VALUE = MCP_FUNCTION_ORIGIN_VALUE; +exports.MCP_LOGGING_DATA_TYPE_ATTRIBUTE = MCP_LOGGING_DATA_TYPE_ATTRIBUTE; +exports.MCP_LOGGING_LEVEL_ATTRIBUTE = MCP_LOGGING_LEVEL_ATTRIBUTE; +exports.MCP_LOGGING_LOGGER_ATTRIBUTE = MCP_LOGGING_LOGGER_ATTRIBUTE; +exports.MCP_LOGGING_MESSAGE_ATTRIBUTE = MCP_LOGGING_MESSAGE_ATTRIBUTE; +exports.MCP_METHOD_NAME_ATTRIBUTE = MCP_METHOD_NAME_ATTRIBUTE; +exports.MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE = MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE; +exports.MCP_NOTIFICATION_ORIGIN_VALUE = MCP_NOTIFICATION_ORIGIN_VALUE; +exports.MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE = MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE; +exports.MCP_PROMPT_NAME_ATTRIBUTE = MCP_PROMPT_NAME_ATTRIBUTE; +exports.MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE = MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE; +exports.MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE = MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE; +exports.MCP_PROTOCOL_VERSION_ATTRIBUTE = MCP_PROTOCOL_VERSION_ATTRIBUTE; +exports.MCP_REQUEST_ARGUMENT = MCP_REQUEST_ARGUMENT; +exports.MCP_REQUEST_ID_ATTRIBUTE = MCP_REQUEST_ID_ATTRIBUTE; +exports.MCP_RESOURCE_URI_ATTRIBUTE = MCP_RESOURCE_URI_ATTRIBUTE; +exports.MCP_ROUTE_SOURCE_VALUE = MCP_ROUTE_SOURCE_VALUE; +exports.MCP_SERVER_NAME_ATTRIBUTE = MCP_SERVER_NAME_ATTRIBUTE; +exports.MCP_SERVER_OP_VALUE = MCP_SERVER_OP_VALUE; +exports.MCP_SERVER_TITLE_ATTRIBUTE = MCP_SERVER_TITLE_ATTRIBUTE; +exports.MCP_SERVER_VERSION_ATTRIBUTE = MCP_SERVER_VERSION_ATTRIBUTE; +exports.MCP_SESSION_ID_ATTRIBUTE = MCP_SESSION_ID_ATTRIBUTE; +exports.MCP_TOOL_NAME_ATTRIBUTE = MCP_TOOL_NAME_ATTRIBUTE; +exports.MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE = MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE; +exports.MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE = MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE; +exports.MCP_TRANSPORT_ATTRIBUTE = MCP_TRANSPORT_ATTRIBUTE; +exports.NETWORK_PROTOCOL_VERSION_ATTRIBUTE = NETWORK_PROTOCOL_VERSION_ATTRIBUTE; +exports.NETWORK_TRANSPORT_ATTRIBUTE = NETWORK_TRANSPORT_ATTRIBUTE; +//# sourceMappingURL=attributes.js.map + + +/***/ }), + +/***/ 16727: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const spanstatus = __nccwpck_require__(21119); +const attributes = __nccwpck_require__(72498); +const resultExtraction = __nccwpck_require__(5603); +const sessionExtraction = __nccwpck_require__(19359); +const sessionManagement = __nccwpck_require__(16271); + +const sessionToSpanMap = /* @__PURE__ */ new Map(); +const statelessSpanMap = /* @__PURE__ */ new WeakMap(); +function getOrCreateSpanMap(transport) { + const sessionId = transport.sessionId; + if (sessionId) { + let spanMap2 = sessionToSpanMap.get(sessionId); + if (!spanMap2) { + spanMap2 = /* @__PURE__ */ new Map(); + sessionToSpanMap.set(sessionId, spanMap2); + } + return spanMap2; + } + let spanMap = statelessSpanMap.get(transport); + if (!spanMap) { + spanMap = /* @__PURE__ */ new Map(); + statelessSpanMap.set(transport, spanMap); + } + return spanMap; +} +function storeSpanForRequest(transport, requestId, span, method) { + const spanMap = getOrCreateSpanMap(transport); + spanMap.set(requestId, { + span, + method, + // oxlint-disable-next-line sdk/no-unsafe-random-apis + startTime: Date.now() + }); +} +function completeSpanWithResults(transport, requestId, result, options, hasError = false) { + const spanMap = getOrCreateSpanMap(transport); + const spanData = spanMap.get(requestId); + if (spanData) { + const { span, method } = spanData; + const responseSessionData = method === "initialize" ? sessionExtraction.extractSessionDataFromInitializeResponse(result) : sessionExtraction.extractSessionDataFromResponse(result); + if (responseSessionData.protocolVersion || responseSessionData.serverInfo) { + sessionManagement.updateSessionDataForTransport(transport, responseSessionData); + } + const responseAttributes = { + ...sessionExtraction.buildServerAttributesFromInfo(responseSessionData.serverInfo) + }; + if (responseSessionData.protocolVersion) { + responseAttributes[attributes.MCP_PROTOCOL_VERSION_ATTRIBUTE] = responseSessionData.protocolVersion; + } + if (Object.keys(responseAttributes).length > 0) { + span.setAttributes(responseAttributes); + } + if (hasError) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + } else if (method === "tools/call") { + const toolAttributes = resultExtraction.extractToolResultAttributes(result, options.recordOutputs); + span.setAttributes(toolAttributes); + } else if (method === "prompts/get") { + const promptAttributes = resultExtraction.extractPromptResultAttributes(result, options.recordOutputs); + span.setAttributes(promptAttributes); + } + span.end(); + spanMap.delete(requestId); + } +} +function cleanupPendingSpansForTransport(transport) { + const sessionId = transport.sessionId; + if (sessionId) { + const spanMap2 = sessionToSpanMap.get(sessionId); + if (spanMap2) { + for (const [, spanData] of spanMap2) { + spanData.span.setStatus({ + code: spanstatus.SPAN_STATUS_ERROR, + message: "cancelled" + }); + spanData.span.end(); + } + sessionToSpanMap.delete(sessionId); + } + return; + } + const spanMap = statelessSpanMap.get(transport); + if (spanMap) { + for (const [, spanData] of spanMap) { + spanData.span.setStatus({ + code: spanstatus.SPAN_STATUS_ERROR, + message: "cancelled" + }); + spanData.span.end(); + } + spanMap.clear(); + } +} + +exports.cleanupPendingSpansForTransport = cleanupPendingSpansForTransport; +exports.completeSpanWithResults = completeSpanWithResults; +exports.storeSpanForRequest = storeSpanForRequest; +//# sourceMappingURL=correlation.js.map + + +/***/ }), + +/***/ 21882: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const exports$1 = __nccwpck_require__(10779); +const spanUtils = __nccwpck_require__(47569); +const spanstatus = __nccwpck_require__(21119); + +function captureError(error, errorType, extraData) { + try { + const client = currentScopes.getClient(); + if (!client) { + return; + } + const activeSpan = spanUtils.getActiveSpan(); + if (activeSpan?.isRecording()) { + activeSpan.setStatus({ + code: spanstatus.SPAN_STATUS_ERROR, + message: "internal_error" + }); + } + exports$1.captureException(error, { + mechanism: { + type: "auto.ai.mcp_server", + handled: false, + data: { + error_type: errorType || "handler_execution", + ...extraData + } + } + }); + } catch { + } +} + +exports.captureError = captureError; +//# sourceMappingURL=errorCapture.js.map + + +/***/ }), + +/***/ 82287: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); +const object = __nccwpck_require__(5906); +const errorCapture = __nccwpck_require__(21882); + +function wrapMethodHandler(serverInstance, methodName) { + object.fill(serverInstance, methodName, (originalMethod) => { + return function(name, ...args) { + const handler = args[args.length - 1]; + if (typeof handler !== "function") { + return originalMethod.call(this, name, ...args); + } + const wrappedHandler = createWrappedHandler(handler, methodName, name); + return originalMethod.call(this, name, ...args.slice(0, -1), wrappedHandler); + }; + }); +} +function createWrappedHandler(originalHandler, methodName, handlerName) { + return function(...handlerArgs) { + try { + return createErrorCapturingHandler.call(this, originalHandler, methodName, handlerName, handlerArgs); + } catch (error) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("MCP handler wrapping failed:", error); + return originalHandler.apply(this, handlerArgs); + } + }; +} +function createErrorCapturingHandler(originalHandler, methodName, handlerName, handlerArgs) { + try { + const result = originalHandler.apply(this, handlerArgs); + if (is.isObjectLike(result) && typeof result.then === "function") { + return Promise.resolve(result).catch((error) => { + captureHandlerError(error, methodName, handlerName); + throw error; + }); + } + return result; + } catch (error) { + captureHandlerError(error, methodName, handlerName); + throw error; + } +} +function captureHandlerError(error, methodName, handlerName) { + try { + const extraData = {}; + if (methodName === "tool" || methodName === "registerTool") { + extraData.tool_name = handlerName; + if (error.name === "ProtocolValidationError" || error.message.includes("validation") || error.message.includes("protocol")) { + errorCapture.captureError(error, "validation", extraData); + } else if (error.name === "ServerTimeoutError" || error.message.includes("timed out") || error.message.includes("timeout")) { + errorCapture.captureError(error, "timeout", extraData); + } else { + errorCapture.captureError(error, "tool_execution", extraData); + } + } else if (methodName === "resource" || methodName === "registerResource") { + extraData.resource_uri = handlerName; + errorCapture.captureError(error, "resource_execution", extraData); + } else if (methodName === "prompt" || methodName === "registerPrompt") { + extraData.prompt_name = handlerName; + errorCapture.captureError(error, "prompt_execution", extraData); + } + } catch (_captureErr) { + } +} +function wrapToolHandlers(serverInstance) { + if (typeof serverInstance.tool === "function") wrapMethodHandler(serverInstance, "tool"); + if (typeof serverInstance.registerTool === "function") wrapMethodHandler(serverInstance, "registerTool"); +} +function wrapResourceHandlers(serverInstance) { + if (typeof serverInstance.resource === "function") wrapMethodHandler(serverInstance, "resource"); + if (typeof serverInstance.registerResource === "function") wrapMethodHandler(serverInstance, "registerResource"); +} +function wrapPromptHandlers(serverInstance) { + if (typeof serverInstance.prompt === "function") wrapMethodHandler(serverInstance, "prompt"); + if (typeof serverInstance.registerPrompt === "function") wrapMethodHandler(serverInstance, "registerPrompt"); +} +function wrapAllMCPHandlers(serverInstance) { + wrapToolHandlers(serverInstance); + wrapResourceHandlers(serverInstance); + wrapPromptHandlers(serverInstance); +} +function wrapExistingHandlers(serverInstance) { + const server = serverInstance; + const registeredTools = server["_registeredTools"]; + if (is.isObjectLike(registeredTools)) { + for (const [name, tool] of Object.entries(registeredTools)) { + if (typeof tool["executor"] === "function") { + tool["executor"] = createWrappedHandler(tool["executor"], "registerTool", name); + } + } + } + const registeredResources = server["_registeredResources"]; + if (is.isObjectLike(registeredResources)) { + for (const [name, resource] of Object.entries(registeredResources)) { + if (typeof resource["readCallback"] === "function") { + resource["readCallback"] = createWrappedHandler( + resource["readCallback"], + "registerResource", + name + ); + } + } + } + const registeredResourceTemplates = server["_registeredResourceTemplates"]; + if (is.isObjectLike(registeredResourceTemplates)) { + for (const [name, template] of Object.entries( + registeredResourceTemplates + )) { + if (typeof template["readCallback"] === "function") { + template["readCallback"] = createWrappedHandler( + template["readCallback"], + "registerResource", + name + ); + } + } + } + const registeredPrompts = server["_registeredPrompts"]; + if (is.isObjectLike(registeredPrompts)) { + for (const [name, prompt] of Object.entries(registeredPrompts)) { + if (typeof prompt["handler"] === "function") { + prompt["handler"] = createWrappedHandler(prompt["handler"], "registerPrompt", name); + } + } + } +} + +exports.wrapAllMCPHandlers = wrapAllMCPHandlers; +exports.wrapExistingHandlers = wrapExistingHandlers; +exports.wrapPromptHandlers = wrapPromptHandlers; +exports.wrapResourceHandlers = wrapResourceHandlers; +exports.wrapToolHandlers = wrapToolHandlers; +//# sourceMappingURL=handlers.js.map + + +/***/ }), + +/***/ 21150: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const object = __nccwpck_require__(5906); +const handlers = __nccwpck_require__(82287); +const transport = __nccwpck_require__(35831); +const validation = __nccwpck_require__(19975); + +const wrappedMcpServerInstances = /* @__PURE__ */ new WeakSet(); +function wrapMcpServerWithSentry(mcpServerInstance, options) { + if (wrappedMcpServerInstances.has(mcpServerInstance)) { + return mcpServerInstance; + } + if (!validation.validateMcpServerInstance(mcpServerInstance)) { + return mcpServerInstance; + } + const serverInstance = mcpServerInstance; + const client = currentScopes.getClient(); + const genAI = client?.getDataCollectionOptions().genAI; + const resolvedOptions = { + recordInputs: options?.recordInputs ?? genAI?.inputs ?? false, + recordOutputs: options?.recordOutputs ?? genAI?.outputs ?? false + }; + object.fill(serverInstance, "connect", (originalConnect) => { + return async function(transport$1, ...restArgs) { + const result = await originalConnect.call( + this, + transport$1, + ...restArgs + ); + transport.wrapTransportOnMessage(transport$1, resolvedOptions); + transport.wrapTransportSend(transport$1, resolvedOptions); + transport.wrapTransportOnClose(transport$1); + transport.wrapTransportError(transport$1); + return result; + }; + }); + handlers.wrapAllMCPHandlers(serverInstance); + handlers.wrapExistingHandlers(serverInstance); + wrappedMcpServerInstances.add(mcpServerInstance); + return mcpServerInstance; +} + +exports.wrapMcpServerWithSentry = wrapMcpServerWithSentry; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 67274: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const is = __nccwpck_require__(68370); +const attributes = __nccwpck_require__(72498); + +const METHOD_CONFIGS = { + "tools/call": { + targetField: "name", + targetAttribute: attributes.MCP_TOOL_NAME_ATTRIBUTE, + captureArguments: true, + argumentsField: "arguments" + }, + "resources/read": { + targetField: "uri", + targetAttribute: attributes.MCP_RESOURCE_URI_ATTRIBUTE, + captureUri: true + }, + "resources/subscribe": { + targetField: "uri", + targetAttribute: attributes.MCP_RESOURCE_URI_ATTRIBUTE + }, + "resources/unsubscribe": { + targetField: "uri", + targetAttribute: attributes.MCP_RESOURCE_URI_ATTRIBUTE + }, + "prompts/get": { + targetField: "name", + targetAttribute: attributes.MCP_PROMPT_NAME_ATTRIBUTE, + captureName: true, + captureArguments: true, + argumentsField: "arguments" + } +}; +function extractTargetInfo(method, params) { + const config = METHOD_CONFIGS[method]; + if (!config) { + return { attributes: {} }; + } + const target = config.targetField && typeof params?.[config.targetField] === "string" ? params[config.targetField] : void 0; + return { + target, + attributes: target && config.targetAttribute ? { [config.targetAttribute]: target } : {} + }; +} +function getRequestArguments(method, params) { + const args = {}; + const config = METHOD_CONFIGS[method]; + if (!config) { + return args; + } + if (config.captureArguments && config.argumentsField && params?.[config.argumentsField]) { + const argumentsObj = params[config.argumentsField]; + if (is.isObjectLike(argumentsObj)) { + for (const [key, value] of Object.entries(argumentsObj)) { + args[`${attributes.MCP_REQUEST_ARGUMENT}.${key.toLowerCase()}`] = JSON.stringify(value); + } + } + } + if (config.captureUri && params?.uri) { + args[`${attributes.MCP_REQUEST_ARGUMENT}.uri`] = JSON.stringify(params.uri); + } + if (config.captureName && params?.name) { + args[`${attributes.MCP_REQUEST_ARGUMENT}.name`] = JSON.stringify(params.name); + } + return args; +} + +exports.extractTargetInfo = extractTargetInfo; +exports.getRequestArguments = getRequestArguments; +//# sourceMappingURL=methodConfig.js.map + + +/***/ }), + +/***/ 80220: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(72498); + +const NETWORK_PII_ATTRIBUTES = /* @__PURE__ */ new Set([attributes.CLIENT_ADDRESS_ATTRIBUTE, attributes.CLIENT_PORT_ATTRIBUTE, attributes.MCP_RESOURCE_URI_ATTRIBUTE]); +function isNetworkPiiAttribute(key) { + return NETWORK_PII_ATTRIBUTES.has(key); +} +function filterMcpPiiFromSpanData(spanData, userInfo) { + if (userInfo) { + return spanData; + } + return Object.entries(spanData).reduce( + (acc, [key, value]) => { + if (!isNetworkPiiAttribute(key)) { + acc[key] = value; + } + return acc; + }, + {} + ); +} + +exports.filterMcpPiiFromSpanData = filterMcpPiiFromSpanData; +//# sourceMappingURL=piiFiltering.js.map + + +/***/ }), + +/***/ 5603: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(72498); +const validation = __nccwpck_require__(19975); + +function buildAllContentItemAttributes(content, includeContent) { + const attributes$1 = { + [attributes.MCP_TOOL_RESULT_CONTENT_COUNT_ATTRIBUTE]: content.length + }; + for (const [i, item] of content.entries()) { + if (!validation.isValidContentItem(item)) { + continue; + } + const prefix = content.length === 1 ? "mcp.tool.result" : `mcp.tool.result.${i}`; + if (typeof item.type === "string") { + attributes$1[`${prefix}.content_type`] = item.type; + } + if (includeContent) { + const safeSet = (key, value) => { + if (typeof value === "string") { + attributes$1[`${prefix}.${key}`] = value; + } + }; + safeSet("mime_type", item.mimeType); + safeSet("uri", item.uri); + safeSet("name", item.name); + if (typeof item.text === "string") { + attributes$1[`${prefix}.content`] = item.text; + } + if (typeof item.data === "string") { + attributes$1[`${prefix}.data_size`] = item.data.length; + } + const resource = item.resource; + if (validation.isValidContentItem(resource)) { + safeSet("resource_uri", resource.uri); + safeSet("resource_mime_type", resource.mimeType); + } + } + } + return attributes$1; +} +function extractToolResultAttributes(result, recordOutputs) { + if (!validation.isValidContentItem(result)) { + return {}; + } + const attributes$1 = Array.isArray(result.content) ? buildAllContentItemAttributes(result.content, recordOutputs) : {}; + if (typeof result.isError === "boolean") { + attributes$1[attributes.MCP_TOOL_RESULT_IS_ERROR_ATTRIBUTE] = result.isError; + } + return attributes$1; +} +function extractPromptResultAttributes(result, recordOutputs) { + const attributes$1 = {}; + if (!validation.isValidContentItem(result)) { + return attributes$1; + } + if (recordOutputs && typeof result.description === "string") { + attributes$1[attributes.MCP_PROMPT_RESULT_DESCRIPTION_ATTRIBUTE] = result.description; + } + if (Array.isArray(result.messages)) { + attributes$1[attributes.MCP_PROMPT_RESULT_MESSAGE_COUNT_ATTRIBUTE] = result.messages.length; + if (recordOutputs) { + const messages = result.messages; + for (const [i, message] of messages.entries()) { + if (!validation.isValidContentItem(message)) { + continue; + } + const prefix = messages.length === 1 ? "mcp.prompt.result" : `mcp.prompt.result.${i}`; + const safeSet = (key, value) => { + if (typeof value === "string") { + const attrName = messages.length === 1 ? `${prefix}.message_${key}` : `${prefix}.${key}`; + attributes$1[attrName] = value; + } + }; + safeSet("role", message.role); + if (validation.isValidContentItem(message.content)) { + const content = message.content; + if (typeof content.text === "string") { + const attrName = messages.length === 1 ? `${prefix}.message_content` : `${prefix}.content`; + attributes$1[attrName] = content.text; + } + } + } + } + } + return attributes$1; +} + +exports.extractPromptResultAttributes = extractPromptResultAttributes; +exports.extractToolResultAttributes = extractToolResultAttributes; +//# sourceMappingURL=resultExtraction.js.map + + +/***/ }), + +/***/ 19359: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(72498); +const sessionManagement = __nccwpck_require__(16271); +const validation = __nccwpck_require__(19975); + +const MCP_PROTOCOL_VERSION_META_KEY = "io.modelcontextprotocol/protocolVersion"; +const MCP_CLIENT_INFO_META_KEY = "io.modelcontextprotocol/clientInfo"; +const MCP_SERVER_INFO_META_KEY = "io.modelcontextprotocol/serverInfo"; +function extractPartyInfo(obj) { + const partyInfo = {}; + if (validation.isValidContentItem(obj)) { + if (typeof obj.name === "string") { + partyInfo.name = obj.name; + } + if (typeof obj.title === "string") { + partyInfo.title = obj.title; + } + if (typeof obj.version === "string") { + partyInfo.version = obj.version; + } + } + return partyInfo; +} +function extractSessionDataFromInitializeRequest(request) { + const sessionData = {}; + if (validation.isValidContentItem(request.params)) { + if (typeof request.params.protocolVersion === "string") { + sessionData.protocolVersion = request.params.protocolVersion; + } + if (request.params.clientInfo) { + sessionData.clientInfo = extractPartyInfo(request.params.clientInfo); + } + } + return sessionData; +} +function extractSessionDataFromMessage(message) { + const sessionData = {}; + if (validation.isValidContentItem(message.params)) { + if (validation.isValidContentItem(message.params._meta)) { + const meta = message.params._meta; + if (typeof meta[MCP_PROTOCOL_VERSION_META_KEY] === "string") { + sessionData.protocolVersion = meta[MCP_PROTOCOL_VERSION_META_KEY]; + } + if (meta[MCP_CLIENT_INFO_META_KEY]) { + sessionData.clientInfo = extractPartyInfo(meta[MCP_CLIENT_INFO_META_KEY]); + } + } + } + return sessionData; +} +function extractSessionDataFromInitializeResponse(result) { + const sessionData = {}; + if (validation.isValidContentItem(result)) { + if (typeof result.protocolVersion === "string") { + sessionData.protocolVersion = result.protocolVersion; + } + if (result.serverInfo) { + sessionData.serverInfo = extractPartyInfo(result.serverInfo); + } + } + return sessionData; +} +function extractSessionDataFromResponse(result) { + const sessionData = {}; + if (validation.isValidContentItem(result)) { + if (validation.isValidContentItem(result._meta) && result._meta[MCP_SERVER_INFO_META_KEY]) { + sessionData.serverInfo = extractPartyInfo(result._meta[MCP_SERVER_INFO_META_KEY]); + } + } + return sessionData; +} +function getClientAttributes(transport) { + const clientInfo = sessionManagement.getClientInfoForTransport(transport); + const attributes = {}; + if (clientInfo?.name) { + attributes["mcp.client.name"] = clientInfo.name; + } + if (clientInfo?.title) { + attributes["mcp.client.title"] = clientInfo.title; + } + if (clientInfo?.version) { + attributes["mcp.client.version"] = clientInfo.version; + } + return attributes; +} +function buildClientAttributesFromInfo(clientInfo) { + const attributes = {}; + if (clientInfo?.name) { + attributes["mcp.client.name"] = clientInfo.name; + } + if (clientInfo?.title) { + attributes["mcp.client.title"] = clientInfo.title; + } + if (clientInfo?.version) { + attributes["mcp.client.version"] = clientInfo.version; + } + return attributes; +} +function getServerAttributes(transport) { + const serverInfo = sessionManagement.getSessionDataForTransport(transport)?.serverInfo; + const attributes$1 = {}; + if (serverInfo?.name) { + attributes$1[attributes.MCP_SERVER_NAME_ATTRIBUTE] = serverInfo.name; + } + if (serverInfo?.title) { + attributes$1[attributes.MCP_SERVER_TITLE_ATTRIBUTE] = serverInfo.title; + } + if (serverInfo?.version) { + attributes$1[attributes.MCP_SERVER_VERSION_ATTRIBUTE] = serverInfo.version; + } + return attributes$1; +} +function buildServerAttributesFromInfo(serverInfo) { + const attributes$1 = {}; + if (serverInfo?.name) { + attributes$1[attributes.MCP_SERVER_NAME_ATTRIBUTE] = serverInfo.name; + } + if (serverInfo?.title) { + attributes$1[attributes.MCP_SERVER_TITLE_ATTRIBUTE] = serverInfo.title; + } + if (serverInfo?.version) { + attributes$1[attributes.MCP_SERVER_VERSION_ATTRIBUTE] = serverInfo.version; + } + return attributes$1; +} +function extractClientInfo(extra) { + return { + address: extra?.requestInfo?.remoteAddress || extra?.clientAddress || extra?.request?.ip || extra?.request?.connection?.remoteAddress, + port: extra?.requestInfo?.remotePort || extra?.clientPort || extra?.request?.connection?.remotePort + }; +} +function getTransportTypes(transport) { + if (!transport?.constructor) { + return { mcpTransport: "unknown", networkTransport: "unknown" }; + } + const transportName = typeof transport.constructor?.name === "string" ? transport.constructor.name : "unknown"; + let networkTransport = "unknown"; + const lowerTransportName = transportName.toLowerCase(); + if (lowerTransportName.includes("stdio")) { + networkTransport = "pipe"; + } else if (lowerTransportName.includes("http") || lowerTransportName.includes("sse")) { + networkTransport = "tcp"; + } + return { + mcpTransport: transportName, + networkTransport + }; +} +function buildTransportAttributes(transport, extra) { + const sessionId = transport && "sessionId" in transport ? transport.sessionId : void 0; + const clientInfo = extra ? extractClientInfo(extra) : {}; + const { mcpTransport, networkTransport } = getTransportTypes(transport); + const clientAttributes = getClientAttributes(transport); + const serverAttributes = getServerAttributes(transport); + const protocolVersion = sessionManagement.getProtocolVersionForTransport(transport); + const attributes$1 = { + ...sessionId && { [attributes.MCP_SESSION_ID_ATTRIBUTE]: sessionId }, + ...clientInfo.address && { [attributes.CLIENT_ADDRESS_ATTRIBUTE]: clientInfo.address }, + ...clientInfo.port && { [attributes.CLIENT_PORT_ATTRIBUTE]: clientInfo.port }, + [attributes.MCP_TRANSPORT_ATTRIBUTE]: mcpTransport, + [attributes.NETWORK_TRANSPORT_ATTRIBUTE]: networkTransport, + [attributes.NETWORK_PROTOCOL_VERSION_ATTRIBUTE]: "2.0", + ...protocolVersion && { [attributes.MCP_PROTOCOL_VERSION_ATTRIBUTE]: protocolVersion }, + ...clientAttributes, + ...serverAttributes + }; + return attributes$1; +} + +exports.buildClientAttributesFromInfo = buildClientAttributesFromInfo; +exports.buildServerAttributesFromInfo = buildServerAttributesFromInfo; +exports.buildTransportAttributes = buildTransportAttributes; +exports.extractClientInfo = extractClientInfo; +exports.extractSessionDataFromInitializeRequest = extractSessionDataFromInitializeRequest; +exports.extractSessionDataFromInitializeResponse = extractSessionDataFromInitializeResponse; +exports.extractSessionDataFromMessage = extractSessionDataFromMessage; +exports.extractSessionDataFromResponse = extractSessionDataFromResponse; +exports.getClientAttributes = getClientAttributes; +exports.getServerAttributes = getServerAttributes; +exports.getTransportTypes = getTransportTypes; +//# sourceMappingURL=sessionExtraction.js.map + + +/***/ }), + +/***/ 16271: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const sessionToSessionData = /* @__PURE__ */ new Map(); +const statelessSessionData = /* @__PURE__ */ new WeakMap(); +function getSessionData(transport) { + const sessionId = transport.sessionId; + if (sessionId) { + return sessionToSessionData.get(sessionId); + } + return statelessSessionData.get(transport); +} +function setSessionData(transport, data) { + const sessionId = transport.sessionId; + if (sessionId) { + sessionToSessionData.set(sessionId, data); + } else { + statelessSessionData.set(transport, data); + } +} +function updateSessionDataForTransport(transport, partialSessionData) { + const existingData = getSessionData(transport) || {}; + setSessionData(transport, { ...existingData, ...partialSessionData }); +} +function getClientInfoForTransport(transport) { + return getSessionData(transport)?.clientInfo; +} +function getProtocolVersionForTransport(transport) { + return getSessionData(transport)?.protocolVersion; +} +function getSessionDataForTransport(transport) { + return getSessionData(transport); +} +function cleanupSessionDataForTransport(transport) { + const sessionId = transport.sessionId; + if (sessionId) { + sessionToSessionData.delete(sessionId); + } +} + +exports.cleanupSessionDataForTransport = cleanupSessionDataForTransport; +exports.getClientInfoForTransport = getClientInfoForTransport; +exports.getProtocolVersionForTransport = getProtocolVersionForTransport; +exports.getSessionDataForTransport = getSessionDataForTransport; +exports.updateSessionDataForTransport = updateSessionDataForTransport; +//# sourceMappingURL=sessionManagement.js.map + + +/***/ }), + +/***/ 63101: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const semanticAttributes = __nccwpck_require__(36827); +const trace = __nccwpck_require__(97956); +const attributeExtraction = __nccwpck_require__(27940); +const attributes = __nccwpck_require__(72498); +const methodConfig = __nccwpck_require__(67274); +const piiFiltering = __nccwpck_require__(80220); +const sessionExtraction = __nccwpck_require__(19359); + +function createSpanName(method, target) { + return target ? `${method} ${target}` : method; +} +function buildSentryAttributes(type) { + let op; + let origin; + switch (type) { + case "request": + op = attributes.MCP_SERVER_OP_VALUE; + origin = attributes.MCP_FUNCTION_ORIGIN_VALUE; + break; + case "notification-incoming": + op = attributes.MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE; + origin = attributes.MCP_NOTIFICATION_ORIGIN_VALUE; + break; + case "notification-outgoing": + op = attributes.MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE; + origin = attributes.MCP_NOTIFICATION_ORIGIN_VALUE; + break; + } + return { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: attributes.MCP_ROUTE_SOURCE_VALUE + }; +} +function createMcpSpan(config) { + const { type, message, transport, extra, callback, options } = config; + const { method } = message; + const params = message.params; + let spanName; + if (type === "request") { + const targetInfo = methodConfig.extractTargetInfo(method, params || {}); + spanName = createSpanName(method, targetInfo.target); + } else { + spanName = method; + } + const rawAttributes = { + ...sessionExtraction.buildTransportAttributes(transport, extra), + [attributes.MCP_METHOD_NAME_ATTRIBUTE]: method, + ...attributeExtraction.buildTypeSpecificAttributes(type, message, params, options?.recordInputs), + ...buildSentryAttributes(type) + }; + const client = currentScopes.getClient(); + const userInfo = Boolean(client?.getDataCollectionOptions().userInfo); + const attributes$1 = piiFiltering.filterMcpPiiFromSpanData(rawAttributes, userInfo); + return trace.startSpan( + { + name: spanName, + forceTransaction: true, + attributes: attributes$1 + }, + callback + ); +} +function createMcpNotificationSpan(jsonRpcMessage, transport, extra, options, callback) { + return createMcpSpan({ + type: "notification-incoming", + message: jsonRpcMessage, + transport, + extra, + callback, + options + }); +} +function createMcpOutgoingNotificationSpan(jsonRpcMessage, transport, options, callback) { + return createMcpSpan({ + type: "notification-outgoing", + message: jsonRpcMessage, + transport, + options, + callback + }); +} +function buildMcpServerSpanConfig(jsonRpcMessage, transport, extra, options) { + const { method } = jsonRpcMessage; + const params = jsonRpcMessage.params; + const targetInfo = methodConfig.extractTargetInfo(method, params || {}); + const spanName = createSpanName(method, targetInfo.target); + const rawAttributes = { + ...sessionExtraction.buildTransportAttributes(transport, extra), + [attributes.MCP_METHOD_NAME_ATTRIBUTE]: method, + ...attributeExtraction.buildTypeSpecificAttributes("request", jsonRpcMessage, params, options?.recordInputs), + ...buildSentryAttributes("request") + }; + const client = currentScopes.getClient(); + const userInfo = Boolean(client?.getDataCollectionOptions().userInfo); + const attributes$1 = piiFiltering.filterMcpPiiFromSpanData(rawAttributes, userInfo); + return { + name: spanName, + op: attributes.MCP_SERVER_OP_VALUE, + forceTransaction: true, + attributes: attributes$1 + }; +} + +exports.buildMcpServerSpanConfig = buildMcpServerSpanConfig; +exports.createMcpNotificationSpan = createMcpNotificationSpan; +exports.createMcpOutgoingNotificationSpan = createMcpOutgoingNotificationSpan; +//# sourceMappingURL=spans.js.map + + +/***/ }), + +/***/ 35831: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const object = __nccwpck_require__(5906); +const is = __nccwpck_require__(68370); +const trace = __nccwpck_require__(97956); +const attributes = __nccwpck_require__(72498); +const correlation = __nccwpck_require__(16727); +const errorCapture = __nccwpck_require__(21882); +const sessionExtraction = __nccwpck_require__(19359); +const sessionManagement = __nccwpck_require__(16271); +const spans = __nccwpck_require__(63101); +const validation = __nccwpck_require__(19975); + +function wrapTransportOnMessage(transport, options) { + if (transport.onmessage) { + object.fill(transport, "onmessage", (originalOnMessage) => { + return function(message, extra) { + const request = validation.isJsonRpcRequest(message) ? message : void 0; + const notification = validation.isJsonRpcNotification(message) ? message : void 0; + const jsonRpcMessage = request || notification; + let messageSessionData; + if (jsonRpcMessage) { + try { + messageSessionData = request?.method === "initialize" ? sessionExtraction.extractSessionDataFromInitializeRequest(request) : sessionExtraction.extractSessionDataFromMessage(jsonRpcMessage); + if (messageSessionData.protocolVersion || messageSessionData.clientInfo) { + sessionManagement.updateSessionDataForTransport(transport, messageSessionData); + } + } catch { + } + } + if (request) { + const isolationScope = currentScopes.getIsolationScope().clone(); + return currentScopes.withIsolationScope(isolationScope, () => { + const spanConfig = spans.buildMcpServerSpanConfig(request, transport, extra, options); + const span = trace.startInactiveSpan(spanConfig); + if (request.method === "initialize" && messageSessionData) { + span.setAttributes({ + ...sessionExtraction.buildClientAttributesFromInfo(messageSessionData.clientInfo), + ...messageSessionData.protocolVersion && { + [attributes.MCP_PROTOCOL_VERSION_ATTRIBUTE]: messageSessionData.protocolVersion + } + }); + } + correlation.storeSpanForRequest(transport, request.id, span, request.method); + return trace.withActiveSpan(span, () => { + return originalOnMessage.call(this, request, extra); + }); + }); + } + if (notification) { + return spans.createMcpNotificationSpan(notification, transport, extra, options, () => { + return originalOnMessage.call(this, notification, extra); + }); + } + return originalOnMessage.call(this, message, extra); + }; + }); + } +} +function wrapTransportSend(transport, options) { + if (transport.send) { + object.fill(transport, "send", (originalSend) => { + return async function(...args) { + const [message] = args; + if (validation.isJsonRpcNotification(message)) { + return spans.createMcpOutgoingNotificationSpan(message, transport, options, () => { + return originalSend.call(this, ...args); + }); + } + if (validation.isJsonRpcResponse(message)) { + if (message.id !== null && message.id !== void 0) { + if (message.error) { + captureJsonRpcErrorResponse(message.error); + } + correlation.completeSpanWithResults(transport, message.id, message.result, options, !!message.error); + } + } + return originalSend.call(this, ...args); + }; + }); + } +} +function wrapTransportOnClose(transport) { + if (transport.onclose) { + object.fill(transport, "onclose", (originalOnClose) => { + return function(...args) { + correlation.cleanupPendingSpansForTransport(transport); + sessionManagement.cleanupSessionDataForTransport(transport); + return originalOnClose.call(this, ...args); + }; + }); + } +} +function wrapTransportError(transport) { + if (transport.onerror) { + object.fill(transport, "onerror", (originalOnError) => { + return function(error) { + captureTransportError(error); + return originalOnError.call(this, error); + }; + }); + } +} +function captureJsonRpcErrorResponse(errorResponse) { + try { + if (is.isObjectLike(errorResponse) && "code" in errorResponse && "message" in errorResponse) { + const jsonRpcError = errorResponse; + const isServerError = jsonRpcError.code === -32603 || jsonRpcError.code >= -32099 && jsonRpcError.code <= -32e3; + if (isServerError) { + const error = new Error(jsonRpcError.message); + error.name = `JsonRpcError_${jsonRpcError.code}`; + errorCapture.captureError(error, "protocol"); + } + } + } catch { + } +} +function captureTransportError(error) { + try { + errorCapture.captureError(error, "transport"); + } catch { + } +} + +exports.wrapTransportError = wrapTransportError; +exports.wrapTransportOnClose = wrapTransportOnClose; +exports.wrapTransportOnMessage = wrapTransportOnMessage; +exports.wrapTransportSend = wrapTransportSend; +//# sourceMappingURL=transport.js.map + + +/***/ }), + +/***/ 19975: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); + +function isJsonRpcRequest(message) { + return is.isObjectLike(message) && "jsonrpc" in message && message.jsonrpc === "2.0" && "method" in message && "id" in message; +} +function isJsonRpcNotification(message) { + return is.isObjectLike(message) && "jsonrpc" in message && message.jsonrpc === "2.0" && "method" in message && !("id" in message); +} +function isJsonRpcResponse(message) { + return is.isObjectLike(message) && "jsonrpc" in message && message.jsonrpc === "2.0" && "id" in message && ("result" in message || "error" in message); +} +function validateMcpServerInstance(instance) { + if (is.isObjectLike(instance) && "connect" in instance && ("tool" in instance && "resource" in instance && "prompt" in instance || "registerTool" in instance && "registerResource" in instance && "registerPrompt" in instance)) { + return true; + } + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Did not patch MCP server. Interface is incompatible."); + return false; +} +function isValidContentItem(item) { + return is.isObjectLike(item); +} + +exports.isJsonRpcNotification = isJsonRpcNotification; +exports.isJsonRpcRequest = isJsonRpcRequest; +exports.isJsonRpcResponse = isJsonRpcResponse; +exports.isValidContentItem = isValidContentItem; +exports.validateMcpServerInstance = validateMcpServerInstance; +//# sourceMappingURL=validation.js.map + + +/***/ }), + +/***/ 3390: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const integration = __nccwpck_require__(67428); const metadata = __nccwpck_require__(44592); -const envelope = __nccwpck_require__(72635); +const envelope = __nccwpck_require__(56987); -/** - * Adds module metadata to stack frames. - * - * Metadata can be injected by the Sentry bundler plugins using the `moduleMetadata` config option. - * - * When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events - * under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams - * our sources - */ const moduleMetadataIntegration = integration.defineIntegration(() => { return { - name: 'ModuleMetadata', + name: "ModuleMetadata", setup(client) { - // We need to strip metadata from stack frames before sending them to Sentry since these are client side only. - client.on('beforeEnvelope', envelope$1 => { + client.on("beforeEnvelope", (envelope$1) => { envelope.forEachEnvelopeItem(envelope$1, (item, type) => { - if (type === 'event') { - const event = Array.isArray(item) ? (item )[1] : undefined; - + if (type === "event") { + const event = Array.isArray(item) ? item[1] : void 0; if (event) { metadata.stripMetadataFromStackFrames(event); item[1] = event; @@ -69006,22 +25852,265 @@ const moduleMetadataIntegration = integration.defineIntegration(() => { } }); }); - - client.on('applyFrameMetadata', event => { - // Only apply stack frame metadata to error events + client.on("applyFrameMetadata", (event) => { if (event.type) { return; } - const stackParser = client.getOptions().stackParser; metadata.addMetadataToStackFrames(stackParser, event); }); - }, + } }; }); exports.moduleMetadataIntegration = moduleMetadataIntegration; -//# sourceMappingURL=metadata.js.map +//# sourceMappingURL=moduleMetadata.js.map + + +/***/ }), + +/***/ 45676: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const semanticAttributes = __nccwpck_require__(36827); +const debugLogger = __nccwpck_require__(41772); +const spanUtils = __nccwpck_require__(47569); +const spanstatus = __nccwpck_require__(21119); +const is = __nccwpck_require__(68370); +const trace = __nccwpck_require__(97956); + +const SQL_OPERATION_REGEX = /^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i; +const CONNECTION_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol("sentryPostgresConnectionContext"); +const INSTRUMENTED_MARKER = /* @__PURE__ */ Symbol.for("sentry.instrumented.postgresjs"); +const QUERY_FROM_INSTRUMENTED_SQL = /* @__PURE__ */ Symbol.for("sentry.query.from.instrumented.sql"); +function instrumentPostgresJsSql(sql, options) { + if (!sql || typeof sql !== "function") { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("instrumentPostgresJsSql: provided value is not a valid postgres.js sql instance"); + return sql; + } + return _instrumentSqlInstance(sql, { requireParentSpan: true, ...options }); +} +function _instrumentSqlInstance(sql, options, parentConnectionContext) { + if (sql[INSTRUMENTED_MARKER]) { + return sql; + } + const proxiedSql = new Proxy(sql, { + apply(target, thisArg, argumentsList) { + const query = Reflect.apply(target, thisArg, argumentsList); + if (is.isObjectLike(query) && "handle" in query) { + _wrapSingleQueryHandle(query, proxiedSql, options); + } + return query; + }, + get(target, prop) { + const original = target[prop]; + if (typeof prop !== "string" || typeof original !== "function") { + return original; + } + if (prop === "unsafe" || prop === "file") { + return _wrapQueryMethod(original, target, proxiedSql, options); + } + if (prop === "begin" || prop === "reserve") { + return _wrapCallbackMethod(original, target, proxiedSql, options); + } + return original; + } + }); + if (parentConnectionContext) { + proxiedSql[CONNECTION_CONTEXT_SYMBOL] = parentConnectionContext; + } else { + _attachConnectionContext(sql, proxiedSql); + } + sql[INSTRUMENTED_MARKER] = true; + proxiedSql[INSTRUMENTED_MARKER] = true; + return proxiedSql; +} +function _wrapQueryMethod(original, target, proxiedSql, options) { + return function(...args) { + const query = Reflect.apply(original, target, args); + if (is.isObjectLike(query) && "handle" in query) { + _wrapSingleQueryHandle(query, proxiedSql, options); + } + return query; + }; +} +function _wrapCallbackMethod(original, target, parentSqlInstance, options) { + return function(...args) { + const parentContext = parentSqlInstance[CONNECTION_CONTEXT_SYMBOL]; + const isCallbackBased = typeof args[args.length - 1] === "function"; + if (!isCallbackBased) { + const result = Reflect.apply(original, target, args); + if (result && typeof result.then === "function") { + return result.then((sqlInstance) => { + return _instrumentSqlInstance(sqlInstance, options, parentContext); + }); + } + return result; + } + const callback = args.length === 1 ? args[0] : args[1]; + const wrappedCallback = function(sqlInstance) { + const instrumentedSql = _instrumentSqlInstance(sqlInstance, options, parentContext); + return callback(instrumentedSql); + }; + const newArgs = args.length === 1 ? [wrappedCallback] : [args[0], wrappedCallback]; + return Reflect.apply(original, target, newArgs); + }; +} +function _wrapSingleQueryHandle(query, sqlInstance, options) { + if (query.handle?.__sentryWrapped) { + return; + } + query[QUERY_FROM_INSTRUMENTED_SQL] = true; + const originalHandle = query.handle; + const wrappedHandle = async function(...args) { + if (this.executed || !_shouldCreateSpans(options)) { + return originalHandle.apply(this, args); + } + const fullQuery = _reconstructQuery(query.strings); + const sanitizedSqlQuery = _sanitizeSqlQuery(fullQuery); + return trace.startSpanManual( + { + name: sanitizedSqlQuery || "postgresjs.query", + op: "db" + }, + (span) => { + span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto.db.postgresjs"); + span.setAttributes({ + "db.system.name": "postgres", + "db.query.text": sanitizedSqlQuery + }); + const connectionContext = sqlInstance ? sqlInstance[CONNECTION_CONTEXT_SYMBOL] : void 0; + _setConnectionAttributes(span, connectionContext); + if (options.requestHook) { + try { + options.requestHook(span, sanitizedSqlQuery, connectionContext); + } catch (e) { + span.setAttribute("sentry.hook.error", "requestHook failed"); + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Error in requestHook for PostgresJs instrumentation:", e); + } + } + const queryWithCallbacks = this; + queryWithCallbacks.resolve = new Proxy(queryWithCallbacks.resolve, { + apply: (resolveTarget, resolveThisArg, resolveArgs) => { + try { + _setOperationName(span, sanitizedSqlQuery, resolveArgs?.[0]?.command); + span.end(); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Error ending span in resolve callback:", e); + } + return Reflect.apply(resolveTarget, resolveThisArg, resolveArgs); + } + }); + queryWithCallbacks.reject = new Proxy(queryWithCallbacks.reject, { + apply: (rejectTarget, rejectThisArg, rejectArgs) => { + try { + span.setStatus({ + code: spanstatus.SPAN_STATUS_ERROR, + message: rejectArgs?.[0]?.message || "unknown_error" + }); + span.setAttribute("db.response.status_code", rejectArgs?.[0]?.code || "unknown"); + span.setAttribute("error.type", rejectArgs?.[0]?.name || "unknown"); + _setOperationName(span, sanitizedSqlQuery); + span.end(); + } catch (e) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Error ending span in reject callback:", e); + } + return Reflect.apply(rejectTarget, rejectThisArg, rejectArgs); + } + }); + try { + return originalHandle.apply(this, args); + } catch (e) { + span.setStatus({ + code: spanstatus.SPAN_STATUS_ERROR, + message: e instanceof Error ? e.message : "unknown_error" + }); + span.end(); + throw e; + } + } + ); + }; + wrappedHandle.__sentryWrapped = true; + query.handle = wrappedHandle; +} +function _shouldCreateSpans(options) { + const hasParentSpan = spanUtils.getActiveSpan() !== void 0; + return hasParentSpan || !options.requireParentSpan; +} +function _reconstructQuery(strings) { + if (!strings?.length) { + return void 0; + } + if (strings.length === 1) { + return strings[0] || void 0; + } + return strings.reduce((acc, str, i) => i === 0 ? str : `${acc}$${i}${str}`, ""); +} +let integerLiteralRE; +function _sanitizeSqlQuery(sqlQuery) { + if (!sqlQuery) { + return "Unknown SQL Query"; + } + if (!integerLiteralRE) { + integerLiteralRE = new RegExp("(? { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const currentScopes = __nccwpck_require__(8131); const integration = __nccwpck_require__(67428); -const requestdata = __nccwpck_require__(4630); - -const DEFAULT_OPTIONS = { - include: { - cookies: true, - data: true, - headers: true, - ip: false, - query_string: true, - url: true, - user: { - id: true, - username: true, - email: true, - }, - }, - transactionNamingScheme: 'methodPath' , -}; - -const INTEGRATION_NAME = 'RequestData'; +const semanticAttributes = __nccwpck_require__(36827); +const cookie = __nccwpck_require__(34724); +const request = __nccwpck_require__(82141); +const getIpAddress = __nccwpck_require__(70866); +const captureSpan = __nccwpck_require__(29729); +const attributes = __nccwpck_require__(88264); +const INTEGRATION_NAME = "RequestData"; const _requestDataIntegration = ((options = {}) => { - const _options = { - ...DEFAULT_OPTIONS, - ...options, - include: { - ...DEFAULT_OPTIONS.include, - ...options.include, - user: - options.include && typeof options.include.user === 'boolean' - ? options.include.user - : { - ...DEFAULT_OPTIONS.include.user, - // Unclear why TS still thinks `options.include.user` could be a boolean at this point - ...((options.include || {}).user ), - }, - }, - }; - + function resolveIncludeAndDataCollection(client) { + const dc = client.getDataCollectionOptions(); + const dataCollection = { + ...dc, + ...options.include?.cookies === true && dc.cookies === false && { cookies: true }, + ...options.include?.headers === true && dc.httpHeaders.request === false && { + httpHeaders: { ...dc.httpHeaders, request: true } + } + }; + return { + dataCollection, + include: { + cookies: dataCollection.cookies !== false, + // Always attach body data that's already on the scope — dataCollection.httpBodies gates write-time, not read-time + data: true, + headers: dataCollection.httpHeaders.request !== false, + ip: dataCollection.userInfo, + query_string: dataCollection.urlQueryParams !== false, + // No dataCollection equivalent — URL is always included + url: true, + ...options.include + } + }; + } return { name: INTEGRATION_NAME, - processEvent(event) { - // Note: In the long run, most of the logic here should probably move into the request data utility functions. For - // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed. - // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be cleaned up. Once - // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.) - + processEvent(event, _hint, client) { const { sdkProcessingMetadata = {} } = event; - const { request, normalizedRequest } = sdkProcessingMetadata; - - const addRequestDataOptions = convertReqDataIntegrationOptsToAddReqDataOpts(_options); - - // If this is set, it takes precedence over the plain request object + const { normalizedRequest, ipAddress } = sdkProcessingMetadata; + const { include } = resolveIncludeAndDataCollection(client); if (normalizedRequest) { - // Some other data is not available in standard HTTP requests, but can sometimes be augmented by e.g. Express or Next.js - const ipAddress = request ? request.ip || (request.socket && request.socket.remoteAddress) : undefined; - const user = request ? request.user : undefined; - - requestdata.addNormalizedRequestDataToEvent(event, normalizedRequest, { ipAddress, user }, addRequestDataOptions); - return event; + addNormalizedRequestDataToEvent(event, normalizedRequest, { ipAddress }, include); } - - // TODO(v9): Eventually we can remove this fallback branch and only rely on the normalizedRequest above - if (!request) { - return event; - } - - // eslint-disable-next-line deprecation/deprecation - return requestdata.addRequestDataToEvent(event, request, addRequestDataOptions); + return event; }, + processSegmentSpan(span, client) { + const { sdkProcessingMetadata = {} } = currentScopes.getIsolationScope().getScopeData(); + const { normalizedRequest, ipAddress } = sdkProcessingMetadata; + if (!normalizedRequest) { + return; + } + const { include, dataCollection } = resolveIncludeAndDataCollection(client); + addNormalizedRequestDataToSpan(span, normalizedRequest, ipAddress, include, dataCollection); + } }; -}) ; - -/** - * Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/core` - * so it can be used in cross-platform SDKs like `@sentry/nextjs`. - */ +}); const requestDataIntegration = integration.defineIntegration(_requestDataIntegration); - -/** Convert this integration's options to match what `addRequestDataToEvent` expects */ -/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */ -function convertReqDataIntegrationOptsToAddReqDataOpts( - integrationOptions, -) { - const { - // eslint-disable-next-line deprecation/deprecation - transactionNamingScheme, - include: { ip, user, ...requestOptions }, - } = integrationOptions; - - const requestIncludeKeys = ['method']; - for (const [key, value] of Object.entries(requestOptions)) { - if (value) { - requestIncludeKeys.push(key); +function addNormalizedRequestDataToEvent(event, req, additionalData, include) { + event.request = { + ...event.request, + ...extractNormalizedRequestData(req, include) + }; + if (include.ip) { + const ip = req.headers && getIpAddress.getClientIPAddress(req.headers) || additionalData.ipAddress; + if (ip) { + event.user = { + ...event.user, + ip_address: ip + }; } } - - let addReqDataUserOpt; - if (user === undefined) { - addReqDataUserOpt = true; - } else if (typeof user === 'boolean') { - addReqDataUserOpt = user; - } else { - const userIncludeKeys = []; - for (const [key, value] of Object.entries(user)) { - if (value) { - userIncludeKeys.push(key); +} +function addNormalizedRequestDataToSpan(span, normalizedRequest, ipAddress, include, dataCollection) { + const requestData = extractNormalizedRequestData(normalizedRequest, include); + const attributes$1 = {}; + if (requestData.url) { + attributes$1[attributes.URL_FULL] = requestData.url; + } + if (requestData.method) { + attributes$1["http.request.method"] = requestData.method; + } + if (requestData.query_string) { + attributes$1[attributes.URL_QUERY] = normalizeQueryString(requestData.query_string); + } + captureSpan.safeSetSpanJSONAttributes(span, attributes$1); + if (requestData.cookies && Object.keys(requestData.cookies).length > 0) { + const cookieString = Object.entries(requestData.cookies).map(([name, value]) => `${name}=${value}`).join("; "); + const cookieAttributes = request.httpHeadersToSpanAttributes({ cookie: cookieString }, dataCollection, "request"); + captureSpan.safeSetSpanJSONAttributes(span, cookieAttributes); + } + if (requestData.headers) { + const headerAttributes = request.httpHeadersToSpanAttributes(requestData.headers, dataCollection, "request"); + captureSpan.safeSetSpanJSONAttributes(span, headerAttributes); + } + if (requestData.data != null) { + const serialized = typeof requestData.data === "string" ? requestData.data : JSON.stringify(requestData.data); + if (serialized) { + captureSpan.safeSetSpanJSONAttributes(span, { "http.request.body.data": serialized }); + } + } + if (include.ip) { + const ip = normalizedRequest.headers && getIpAddress.getClientIPAddress(normalizedRequest.headers) || ipAddress || void 0; + if (ip) { + captureSpan.safeSetSpanJSONAttributes(span, { [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: ip }); + } + } +} +function extractNormalizedRequestData(normalizedRequest, include) { + const requestData = {}; + const headers = { ...normalizedRequest.headers }; + if (include.headers) { + requestData.headers = headers; + if (!include.cookies) { + delete headers.cookie; + } + if (!include.ip) { + const ipHeaderNamesLower = new Set(getIpAddress.ipHeaderNames.map((name) => name.toLowerCase())); + for (const key of Object.keys(headers)) { + if (ipHeaderNamesLower.has(key.toLowerCase())) { + delete headers[key]; + } } } - addReqDataUserOpt = userIncludeKeys; } - - return { - include: { - ip, - user: addReqDataUserOpt, - request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined, - transaction: transactionNamingScheme, - }, - }; + requestData.method = normalizedRequest.method; + if (include.url) { + requestData.url = normalizedRequest.url; + } + if (include.cookies) { + const cookies = normalizedRequest.cookies || (headers?.cookie ? cookie.parseCookie(headers.cookie) : void 0); + requestData.cookies = cookies || {}; + } + if (include.query_string) { + requestData.query_string = normalizedRequest.query_string; + } + if (include.data) { + requestData.data = normalizedRequest.data; + } + return requestData; +} +function normalizeQueryString(queryString) { + if (typeof queryString === "string") { + return queryString || void 0; + } + const pairs = Array.isArray(queryString) ? queryString : Object.entries(queryString); + const result = pairs.map(([key, value]) => `${key}=${value}`).join("&"); + return result || void 0; } exports.requestDataIntegration = requestDataIntegration; @@ -69163,26 +26279,18 @@ exports.requestDataIntegration = requestDataIntegration; /***/ 94102: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const integration = __nccwpck_require__(67428); -const path = __nccwpck_require__(94509); -const worldwide = __nccwpck_require__(10891); +const path = __nccwpck_require__(82426); +const worldwide = __nccwpck_require__(90935); -const INTEGRATION_NAME = 'RewriteFrames'; - -/** - * Rewrite event frames paths. - */ +const INTEGRATION_NAME = "RewriteFrames"; const rewriteFramesIntegration = integration.defineIntegration((options = {}) => { const root = options.root; - const prefix = options.prefix || 'app:///'; - - const isBrowser = 'window' in worldwide.GLOBAL_OBJ && worldwide.GLOBAL_OBJ.window !== undefined; - + const prefix = options.prefix || "app:///"; + const isBrowser = "window" in worldwide.GLOBAL_OBJ && !!worldwide.GLOBAL_OBJ.window; const iteratee = options.iteratee || generateIteratee({ isBrowser, root, prefix }); - - /** Process an exception event. */ function _processExceptionsEvent(event) { try { return { @@ -69191,63 +26299,45 @@ const rewriteFramesIntegration = integration.defineIntegration((options = {}) => ...event.exception, // The check for this is performed inside `process` call itself, safe to skip here // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - values: event.exception.values.map(value => ({ + values: event.exception.values.map((value) => ({ ...value, - ...(value.stacktrace && { stacktrace: _processStacktrace(value.stacktrace) }), - })), - }, + ...value.stacktrace && { stacktrace: _processStacktrace(value.stacktrace) } + })) + } }; - } catch (_oO) { + } catch { return event; } } - - /** Process a stack trace. */ function _processStacktrace(stacktrace) { return { ...stacktrace, - frames: stacktrace && stacktrace.frames && stacktrace.frames.map(f => iteratee(f)), + frames: stacktrace?.frames?.map((f) => iteratee(f)) }; } - return { name: INTEGRATION_NAME, processEvent(originalEvent) { let processedEvent = originalEvent; - if (originalEvent.exception && Array.isArray(originalEvent.exception.values)) { processedEvent = _processExceptionsEvent(processedEvent); } - return processedEvent; - }, + } }; }); - -/** - * Exported only for tests. - */ function generateIteratee({ isBrowser, root, - prefix, -} - -) { + prefix +}) { return (frame) => { if (!frame.filename) { return frame; } - - // Determine if this is a Windows frame by checking for a Windows-style prefix such as `C:\` - const isWindowsFrame = - /^[a-zA-Z]:\\/.test(frame.filename) || - // or the presence of a backslash without a forward slash (which are not allowed on Windows) - (frame.filename.includes('\\') && !frame.filename.includes('/')); - - // Check if the frame filename begins with `/` + const isWindowsFrame = /^[a-zA-Z]:\\/.test(frame.filename) || // or the presence of a backslash without a forward slash (which are not allowed on Windows) + frame.filename.includes("\\") && !frame.filename.includes("/"); const startsWithSlash = /^\//.test(frame.filename); - if (isBrowser) { if (root) { const oldFilename = frame.filename; @@ -69257,16 +26347,11 @@ function generateIteratee({ } } else { if (isWindowsFrame || startsWithSlash) { - const filename = isWindowsFrame - ? frame.filename - .replace(/^[a-zA-Z]:/, '') // remove Windows-style prefix - .replace(/\\/g, '/') // replace all `\\` instances with `/` - : frame.filename; + const filename = isWindowsFrame ? frame.filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/") : frame.filename; const base = root ? path.relative(root, filename) : path.basename(filename); frame.filename = `${prefix}${base}`; } } - return frame; }; } @@ -69278,48 +26363,469 @@ exports.rewriteFramesIntegration = rewriteFramesIntegration; /***/ }), -/***/ 20871: +/***/ 9869: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const debugBuild = __nccwpck_require__(14488); const integration = __nccwpck_require__(67428); -const time = __nccwpck_require__(75872); - -const INTEGRATION_NAME = 'SessionTiming'; - -const _sessionTimingIntegration = (() => { - const startTime = time.timestampInSeconds() * 1000; +const beforeSendSpan = __nccwpck_require__(33579); +const captureSpan = __nccwpck_require__(29729); +const hasSpanStreamingEnabled = __nccwpck_require__(73642); +const spanBuffer = __nccwpck_require__(48298); +const debugLogger = __nccwpck_require__(41772); +const spanUtils = __nccwpck_require__(47569); +const spanStreamingIntegration = integration.defineIntegration(() => { return { - name: INTEGRATION_NAME, - processEvent(event) { - const now = time.timestampInSeconds() * 1000; - - return { - ...event, - extra: { - ...event.extra, - ['session:start']: startTime, - ['session:duration']: now - startTime, - ['session:end']: now, - }, - }; - }, + name: "SpanStreaming", + setup(client) { + const initialMessage = "SpanStreaming integration requires"; + const fallbackMsg = "Falling back to static trace lifecycle."; + const clientOptions = client.getOptions(); + if (!hasSpanStreamingEnabled.hasSpanStreamingEnabled(client)) { + clientOptions.traceLifecycle = "static"; + debugBuild.DEBUG_BUILD && debugLogger.debug.warn(`${initialMessage} \`traceLifecycle\` to be set to "stream"! ${fallbackMsg}`); + return; + } + const beforeSendSpan$1 = clientOptions.beforeSendSpan; + if (beforeSendSpan$1 && !beforeSendSpan.isStreamedBeforeSendSpanCallback(beforeSendSpan$1)) { + clientOptions.traceLifecycle = "static"; + debugBuild.DEBUG_BUILD && debugLogger.debug.warn(`${initialMessage} a beforeSendSpan callback using \`withStreamedSpan\`! ${fallbackMsg}`); + return; + } + const buffer = new spanBuffer.SpanBuffer(client); + client.on("afterSpanEnd", (span) => { + if (!spanUtils.spanIsSampled(span)) { + return; + } + buffer.add(captureSpan.captureSpan(span, client)); + }); + } }; -}) ; +}); -/** - * This function adds duration since the sessionTimingIntegration was initialized - * till the time event was sent. - * - * @deprecated This integration is deprecated and will be removed in the next major version of the SDK. - * To capture session durations alongside events, use [Context](https://docs.sentry.io/platforms/javascript/enriching-events/context/) (`Sentry.setContext()`). - */ -const sessionTimingIntegration = integration.defineIntegration(_sessionTimingIntegration); +exports.spanStreamingIntegration = spanStreamingIntegration; +//# sourceMappingURL=spanStreaming.js.map -exports.sessionTimingIntegration = sessionTimingIntegration; -//# sourceMappingURL=sessiontiming.js.map + +/***/ }), + +/***/ 98283: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const breadcrumbs = __nccwpck_require__(5608); +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const exports$1 = __nccwpck_require__(10779); +const integration = __nccwpck_require__(67428); +const semanticAttributes = __nccwpck_require__(36827); +const debugLogger = __nccwpck_require__(41772); +const misc = __nccwpck_require__(52619); +const is = __nccwpck_require__(68370); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); + +const AUTH_OPERATIONS_TO_INSTRUMENT = [ + "reauthenticate", + "signInAnonymously", + "signInWithOAuth", + "signInWithIdToken", + "signInWithOtp", + "signInWithPassword", + "signInWithSSO", + "signOut", + "signUp", + "verifyOtp" +]; +const AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT = [ + "createUser", + "deleteUser", + "listUsers", + "getUserById", + "updateUserById", + "inviteUserByEmail" +]; +const FILTER_MAPPINGS = { + eq: "eq", + neq: "neq", + gt: "gt", + gte: "gte", + lt: "lt", + lte: "lte", + like: "like", + "like(all)": "likeAllOf", + "like(any)": "likeAnyOf", + ilike: "ilike", + "ilike(all)": "ilikeAllOf", + "ilike(any)": "ilikeAnyOf", + is: "is", + in: "in", + cs: "contains", + cd: "containedBy", + sr: "rangeGt", + nxl: "rangeGte", + sl: "rangeLt", + nxr: "rangeLte", + adj: "rangeAdjacent", + ov: "overlaps", + fts: "", + plfts: "plain", + phfts: "phrase", + wfts: "websearch", + not: "not" +}; +const DB_OPERATIONS_TO_INSTRUMENT = ["select", "insert", "upsert", "update", "delete"]; +function markAsInstrumented(fn) { + try { + fn.__SENTRY_INSTRUMENTED__ = true; + } catch { + } +} +function isInstrumented(fn) { + try { + return fn.__SENTRY_INSTRUMENTED__; + } catch { + return false; + } +} +function getMutationBodyPayloadForTelemetry(rawBody, plainBody) { + if (Object.keys(plainBody).length > 0) { + return plainBody; + } + if (Array.isArray(rawBody) && rawBody.length > 0) { + return rawBody; + } + return void 0; +} +function hasMutationBodyForDescription(rawBody, plainBody) { + return getMutationBodyPayloadForTelemetry(rawBody, plainBody) !== void 0; +} +function getHeader(headers, name) { + if (!headers) { + return void 0; + } + if (typeof headers.get === "function") { + return headers.get(name) ?? void 0; + } + const plainHeaders = headers; + const lowerCaseName = name.toLowerCase(); + const key = Object.keys(plainHeaders).find((headerName) => headerName.toLowerCase() === lowerCaseName); + return key !== void 0 ? plainHeaders[key] : void 0; +} +function extractOperation(method, headers = {}) { + switch (method) { + case "GET": { + return "select"; + } + case "POST": { + if (getHeader(headers, "Prefer")?.includes("resolution=")) { + return "upsert"; + } else { + return "insert"; + } + } + case "PATCH": { + return "update"; + } + case "DELETE": { + return "delete"; + } + default: { + return ""; + } + } +} +function translateFiltersIntoMethods(key, query) { + if (query === "" || query === "*") { + return "select(*)"; + } + if (key === "select") { + return `select(${query})`; + } + if (key === "or" || key.endsWith(".or")) { + return `${key}${query}`; + } + const [filter, ...value] = query.split("."); + let method; + if (filter?.startsWith("fts")) { + method = "textSearch"; + } else if (filter?.startsWith("plfts")) { + method = "textSearch[plain]"; + } else if (filter?.startsWith("phfts")) { + method = "textSearch[phrase]"; + } else if (filter?.startsWith("wfts")) { + method = "textSearch[websearch]"; + } else { + method = filter && FILTER_MAPPINGS[filter] || "filter"; + } + return `${method}(${key}, ${value.join(".")})`; +} +function instrumentAuthOperation(operation, isAdmin = false) { + return new Proxy(operation, { + apply(target, thisArg, argumentsList) { + return trace.startSpan( + { + name: `auth ${isAdmin ? "(admin) " : ""}${operation.name}`, + attributes: { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.supabase", + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db", + "db.system": "postgresql", + "db.operation": `auth.${isAdmin ? "admin." : ""}${operation.name}` + } + }, + (span) => { + return Reflect.apply(target, thisArg, argumentsList).then((res) => { + if (is.isObjectLike(res) && "error" in res && res.error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR }); + exports$1.captureException(res.error, { + mechanism: { + handled: false, + type: "auto.db.supabase.auth" + } + }); + } else { + span.setStatus({ code: spanstatus.SPAN_STATUS_OK }); + } + span.end(); + return res; + }).catch((err) => { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR }); + span.end(); + exports$1.captureException(err, { + mechanism: { + handled: false, + type: "auto.db.supabase.auth" + } + }); + throw err; + }).then(...argumentsList); + } + ); + } + }); +} +function instrumentSupabaseAuthClient(supabaseClientInstance) { + const auth = supabaseClientInstance.auth; + if (!auth || isInstrumented(supabaseClientInstance.auth)) { + return; + } + for (const operation of AUTH_OPERATIONS_TO_INSTRUMENT) { + const authOperation = auth[operation]; + if (!authOperation) { + continue; + } + if (typeof supabaseClientInstance.auth[operation] === "function") { + supabaseClientInstance.auth[operation] = instrumentAuthOperation(authOperation); + } + } + for (const operation of AUTH_ADMIN_OPERATIONS_TO_INSTRUMENT) { + const authOperation = auth.admin[operation]; + if (!authOperation) { + continue; + } + if (typeof supabaseClientInstance.auth.admin[operation] === "function") { + supabaseClientInstance.auth.admin[operation] = instrumentAuthOperation(authOperation, true); + } + } + markAsInstrumented(supabaseClientInstance.auth); +} +function instrumentSupabaseClientConstructor(SupabaseClient, _options) { + if (isInstrumented(SupabaseClient.prototype.from)) { + return; + } + SupabaseClient.prototype.from = new Proxy( + SupabaseClient.prototype.from, + { + apply(target, thisArg, argumentsList) { + const rv = Reflect.apply(target, thisArg, argumentsList); + const PostgRESTQueryBuilder = rv.constructor; + instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder, _options); + return rv; + } + } + ); + markAsInstrumented(SupabaseClient.prototype.from); +} +function instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder, _options) { + if (isInstrumented(PostgRESTFilterBuilder.prototype.then)) { + return; + } + PostgRESTFilterBuilder.prototype.then = new Proxy( + PostgRESTFilterBuilder.prototype.then, + { + apply(target, thisArg, argumentsList) { + const operations = DB_OPERATIONS_TO_INSTRUMENT; + const typedThis = thisArg; + const operation = extractOperation(typedThis.method, typedThis.headers); + if (!operations.includes(operation)) { + return Reflect.apply(target, thisArg, argumentsList); + } + if (!typedThis?.url?.pathname || typeof typedThis.url.pathname !== "string") { + return Reflect.apply(target, thisArg, argumentsList); + } + const pathParts = typedThis.url.pathname.split("/"); + const table = pathParts.length > 0 ? pathParts[pathParts.length - 1] : ""; + const queryItems = []; + for (const [key, value] of typedThis.url.searchParams.entries()) { + queryItems.push(translateFiltersIntoMethods(key, value)); + } + const body = /* @__PURE__ */ Object.create(null); + if (is.isPlainObject(typedThis.body)) { + for (const [key, value] of Object.entries(typedThis.body)) { + body[key] = value; + } + } + const client = currentScopes.getClient(); + const shouldSendData = _options.sendOperationData ?? client?.getDataCollectionOptions().databaseQueryData === true; + const bodyPayload = getMutationBodyPayloadForTelemetry(typedThis.body, body); + const mutationPart = operation === "select" ? "" : `${operation}${hasMutationBodyForDescription(typedThis.body, body) ? "(...) " : ""}`; + const queryPart = shouldSendData ? queryItems.join(" ") : queryItems.length > 0 ? "[redacted]" : ""; + const descriptionMiddle = [mutationPart.trimEnd(), queryPart].filter(Boolean).join(" "); + const description = descriptionMiddle ? `${descriptionMiddle} from(${table})` : `from(${table})`; + const attributes = { + "db.table": table, + "db.schema": typedThis.schema, + "db.url": typedThis.url.origin, + "db.sdk": getHeader(typedThis.headers, "X-Client-Info"), + "db.system": "postgresql", + "db.operation": operation, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.supabase", + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db" + }; + if (queryItems.length && shouldSendData) { + attributes["db.query"] = queryItems; + } + if (bodyPayload !== void 0 && shouldSendData) { + attributes["db.body"] = bodyPayload; + } + return trace.startSpan( + { + name: description, + attributes + }, + (span) => { + return Reflect.apply(target, thisArg, []).then( + (res) => { + if (span) { + if (res && typeof res === "object" && "status" in res) { + spanstatus.setHttpStatus(span, res.status || 500); + } + span.end(); + } + if (res?.error) { + const err = new Error(res.error.message); + if (res.error.code) { + err.code = res.error.code; + } + if (res.error.details) { + err.details = res.error.details; + } + const supabaseContext = {}; + if (queryItems.length && shouldSendData) { + supabaseContext.query = queryItems; + } + if (bodyPayload !== void 0 && shouldSendData) { + supabaseContext.body = bodyPayload; + } + exports$1.captureException(err, (scope) => { + scope.addEventProcessor((e) => { + misc.addExceptionMechanism(e, { + handled: false, + type: "auto.db.supabase.postgres" + }); + return e; + }); + scope.setContext("supabase", supabaseContext); + return scope; + }); + } + const breadcrumb = { + type: "supabase", + category: `db.${operation}`, + message: description + }; + const data = {}; + if (queryItems.length && shouldSendData) { + data.query = queryItems; + } + if (bodyPayload !== void 0 && shouldSendData) { + data.body = bodyPayload; + } + if (Object.keys(data).length) { + breadcrumb.data = data; + } + breadcrumbs.addBreadcrumb(breadcrumb); + return res; + }, + (err) => { + if (span) { + spanstatus.setHttpStatus(span, 500); + span.end(); + } + throw err; + } + ).then(...argumentsList); + } + ); + } + } + ); + markAsInstrumented(PostgRESTFilterBuilder.prototype.then); +} +function instrumentPostgRESTQueryBuilder(PostgRESTQueryBuilder, _options) { + for (const operation of DB_OPERATIONS_TO_INSTRUMENT) { + if (isInstrumented(PostgRESTQueryBuilder.prototype[operation])) { + continue; + } + PostgRESTQueryBuilder.prototype[operation] = new Proxy( + PostgRESTQueryBuilder.prototype[operation], + { + apply(target, thisArg, argumentsList) { + const rv = Reflect.apply(target, thisArg, argumentsList); + const PostgRESTFilterBuilder = rv.constructor; + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Instrumenting ${operation} operation's PostgRESTFilterBuilder`); + instrumentPostgRESTFilterBuilder(PostgRESTFilterBuilder, _options); + return rv; + } + } + ); + markAsInstrumented(PostgRESTQueryBuilder.prototype[operation]); + } +} +const instrumentSupabaseClient = (supabaseClient, options = {}) => { + if (!supabaseClient) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Supabase integration was not installed because no Supabase client was provided."); + return; + } + const SupabaseClientConstructor = supabaseClient.constructor === Function ? supabaseClient : supabaseClient.constructor; + instrumentSupabaseClientConstructor(SupabaseClientConstructor, options); + instrumentSupabaseAuthClient(supabaseClient); +}; +const INTEGRATION_NAME = "Supabase"; +const _supabaseIntegration = ((supabaseClient, options) => { + return { + setupOnce() { + instrumentSupabaseClient(supabaseClient, options); + }, + name: INTEGRATION_NAME + }; +}); +const supabaseIntegration = integration.defineIntegration((options) => { + return _supabaseIntegration(options.supabaseClient, { sendOperationData: options.sendOperationData }); +}); + +exports.DB_OPERATIONS_TO_INSTRUMENT = DB_OPERATIONS_TO_INSTRUMENT; +exports.FILTER_MAPPINGS = FILTER_MAPPINGS; +exports.extractOperation = extractOperation; +exports.getHeader = getHeader; +exports.instrumentSupabaseClient = instrumentSupabaseClient; +exports.supabaseIntegration = supabaseIntegration; +exports.translateFiltersIntoMethods = translateFiltersIntoMethods; +//# sourceMappingURL=supabase.js.map /***/ }), @@ -69327,27 +26833,22 @@ exports.sessionTimingIntegration = sessionTimingIntegration; /***/ 86140: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const integration = __nccwpck_require__(67428); const metadata = __nccwpck_require__(44592); -const envelope = __nccwpck_require__(72635); -const stacktrace = __nccwpck_require__(85820); +const envelope = __nccwpck_require__(56987); +const stacktrace = __nccwpck_require__(22902); +const worldwide = __nccwpck_require__(90935); -/** - * This integration allows you to filter out, or tag error events that do not come from user code marked with a bundle key via the Sentry bundler plugins. - */ const thirdPartyErrorFilterIntegration = integration.defineIntegration((options) => { return { - name: 'ThirdPartyErrorsFilter', + name: "ThirdPartyErrorsFilter", setup(client) { - // We need to strip metadata from stack frames before sending them to Sentry since these are client side only. - // TODO(lforst): Move this cleanup logic into a more central place in the SDK. - client.on('beforeEnvelope', envelope$1 => { + client.on("beforeEnvelope", (envelope$1) => { envelope.forEachEnvelopeItem(envelope$1, (item, type) => { - if (type === 'event') { - const event = Array.isArray(item) ? (item )[1] : undefined; - + if (type === "event") { + const event = Array.isArray(item) ? item[1] : void 0; if (event) { metadata.stripMetadataFromStackFrames(event); item[1] = event; @@ -69355,73 +26856,101 @@ const thirdPartyErrorFilterIntegration = integration.defineIntegration((options) } }); }); - - client.on('applyFrameMetadata', event => { - // Only apply stack frame metadata to error events + client.on("applyFrameMetadata", (event) => { if (event.type) { return; } - const stackParser = client.getOptions().stackParser; metadata.addMetadataToStackFrames(stackParser, event); }); }, - + preprocessEvent(event) { + if (options.ignoreSentryInternalFrames && (worldwide.GLOBAL_OBJ._sentryWrappedDepth ?? 0) > 0) { + event.sdkProcessingMetadata = { + ...event.sdkProcessingMetadata, + insideSentryWrapped: true + }; + } + }, processEvent(event) { - const frameKeys = getBundleKeysForAllFramesWithFilenames(event); - + const insideSentryWrapped = options.ignoreSentryInternalFrames ? event.sdkProcessingMetadata?.insideSentryWrapped === true && event.exception?.values?.length === 1 : false; + const frameKeys = getBundleKeysForAllFramesWithFilenames( + event, + options.ignoreSentryInternalFrames, + insideSentryWrapped + ); if (frameKeys) { - const arrayMethod = - options.behaviour === 'drop-error-if-contains-third-party-frames' || - options.behaviour === 'apply-tag-if-contains-third-party-frames' - ? 'some' - : 'every'; - - const behaviourApplies = frameKeys[arrayMethod](keys => !keys.some(key => options.filterKeys.includes(key))); - + const arrayMethod = options.behaviour === "drop-error-if-contains-third-party-frames" || options.behaviour === "apply-tag-if-contains-third-party-frames" ? "some" : "every"; + const behaviourApplies = frameKeys[arrayMethod]((keys) => !keys.some((key) => options.filterKeys.includes(key))); if (behaviourApplies) { - const shouldDrop = - options.behaviour === 'drop-error-if-contains-third-party-frames' || - options.behaviour === 'drop-error-if-exclusively-contains-third-party-frames'; + const shouldDrop = options.behaviour === "drop-error-if-contains-third-party-frames" || options.behaviour === "drop-error-if-exclusively-contains-third-party-frames"; if (shouldDrop) { return null; } else { event.tags = { ...event.tags, - third_party_code: true, + third_party_code: true }; } } } - return event; - }, + } }; }); - -function getBundleKeysForAllFramesWithFilenames(event) { - const frames = stacktrace.getFramesFromEvent(event); - - if (!frames) { - return undefined; +function isSentryInternalFrame(frame, frameIndex, insideSentryWrapped) { + if (frameIndex !== 0) { + return false; } - - return ( - frames - // Exclude frames without a filename since these are likely native code or built-ins - .filter(frame => !!frame.filename) - .map(frame => { - if (frame.module_metadata) { - return Object.keys(frame.module_metadata) - .filter(key => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX)) - .map(key => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length)); - } - return []; - }) - ); + if (insideSentryWrapped && isLikelyMinifiedSentryWrappedFrame(frame)) { + return true; + } + if (frame.function === "sentryWrapped") { + return true; + } + if (!frame.context_line || !frame.filename) { + return false; + } + if (!frame.filename.includes("sentry") || !frame.filename.includes("helpers") || // Filename would look something like this: 'node_modules/@sentry/browser/build/npm/esm/helpers.js' + !frame.context_line.includes(SENTRY_INTERNAL_FN_APPLY)) { + return false; + } + if (frame.pre_context) { + const len = frame.pre_context.length; + for (let i = 0; i < len; i++) { + if (frame.pre_context[i]?.includes(SENTRY_INTERNAL_COMMENT)) { + return true; + } + } + } + return false; } - -const BUNDLER_PLUGIN_APP_KEY_PREFIX = '_sentryBundlerPluginAppKey:'; +function getBundleKeysForAllFramesWithFilenames(event, ignoreSentryInternalFrames, insideSentryWrapped) { + const frames = stacktrace.getFramesFromEvent(event); + if (!frames) { + return void 0; + } + return frames.filter((frame, index) => { + if (!frame.filename) { + return false; + } + if (frame.lineno == null && frame.colno == null && frame.instruction_addr == null) { + return false; + } + return !ignoreSentryInternalFrames || !isSentryInternalFrame(frame, index, !!insideSentryWrapped); + }).map((frame) => { + if (!frame.module_metadata) { + return []; + } + return Object.keys(frame.module_metadata).filter((key) => key.startsWith(BUNDLER_PLUGIN_APP_KEY_PREFIX)).map((key) => key.slice(BUNDLER_PLUGIN_APP_KEY_PREFIX.length)); + }); +} +function isLikelyMinifiedSentryWrappedFrame(frame) { + return !frame.context_line && !frame.pre_context && !!frame.function && frame.function.length <= 2; +} +const BUNDLER_PLUGIN_APP_KEY_PREFIX = "_sentryBundlerPluginAppKey:"; +const SENTRY_INTERNAL_COMMENT = "Attempt to invoke user-land function"; +const SENTRY_INTERNAL_FN_APPLY = "fn.apply(this, wrappedArguments)"; exports.thirdPartyErrorFilterIntegration = thirdPartyErrorFilterIntegration; //# sourceMappingURL=third-party-errors-filter.js.map @@ -69432,144 +26961,73 @@ exports.thirdPartyErrorFilterIntegration = thirdPartyErrorFilterIntegration; /***/ 55472: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const integration = __nccwpck_require__(67428); -const is = __nccwpck_require__(84085); -const string = __nccwpck_require__(93529); +const is = __nccwpck_require__(68370); +const string = __nccwpck_require__(77673); const DEFAULT_LIMIT = 10; -const INTEGRATION_NAME = 'ZodErrors'; - -/** - * Simplified ZodIssue type definition - */ - +const INTEGRATION_NAME = "ZodErrors"; function originalExceptionIsZodError(originalException) { - return ( - is.isError(originalException) && - originalException.name === 'ZodError' && - Array.isArray((originalException ).issues) - ); + return is.isError(originalException) && originalException.name === "ZodError" && Array.isArray(originalException.issues); } - -/** - * Formats child objects or arrays to a string - * that is preserved when sent to Sentry. - * - * Without this, we end up with something like this in Sentry: - * - * [ - * [Object], - * [Object], - * [Object], - * [Object] - * ] - */ function flattenIssue(issue) { return { ...issue, - path: 'path' in issue && Array.isArray(issue.path) ? issue.path.join('.') : undefined, - keys: 'keys' in issue ? JSON.stringify(issue.keys) : undefined, - unionErrors: 'unionErrors' in issue ? JSON.stringify(issue.unionErrors) : undefined, + path: "path" in issue && Array.isArray(issue.path) ? issue.path.join(".") : void 0, + keys: "keys" in issue ? JSON.stringify(issue.keys) : void 0, + unionErrors: "unionErrors" in issue ? JSON.stringify(issue.unionErrors) : void 0 }; } - -/** - * Takes ZodError issue path array and returns a flattened version as a string. - * This makes it easier to display paths within a Sentry error message. - * - * Array indexes are normalized to reduce duplicate entries - * - * @param path ZodError issue path - * @returns flattened path - * - * @example - * flattenIssuePath([0, 'foo', 1, 'bar']) // -> '.foo..bar' - */ function flattenIssuePath(path) { - return path - .map(p => { - if (typeof p === 'number') { - return ''; - } else { - return p; - } - }) - .join('.'); + return path.map((p) => { + if (typeof p === "number") { + return ""; + } else { + return p; + } + }).join("."); } - -/** - * Zod error message is a stringified version of ZodError.issues - * This doesn't display well in the Sentry UI. Replace it with something shorter. - */ function formatIssueMessage(zodError) { - const errorKeyMap = new Set(); + const errorKeyMap = /* @__PURE__ */ new Set(); for (const iss of zodError.issues) { const issuePath = flattenIssuePath(iss.path); if (issuePath.length > 0) { errorKeyMap.add(issuePath); } } - const errorKeys = Array.from(errorKeyMap); if (errorKeys.length === 0) { - // If there are no keys, then we're likely validating the root - // variable rather than a key within an object. This attempts - // to extract what type it was that failed to validate. - // For example, z.string().parse(123) would return "string" here. - let rootExpectedType = 'variable'; + let rootExpectedType = "variable"; if (zodError.issues.length > 0) { const iss = zodError.issues[0]; - if (iss !== undefined && 'expected' in iss && typeof iss.expected === 'string') { + if (iss !== void 0 && "expected" in iss && typeof iss.expected === "string") { rootExpectedType = iss.expected; } } return `Failed to validate ${rootExpectedType}`; } - return `Failed to validate keys: ${string.truncate(errorKeys.join(', '), 100)}`; + return `Failed to validate keys: ${string.truncate(errorKeys.join(", "), 100)}`; } - -/** - * Applies ZodError issues to an event extra and replaces the error message - */ -function applyZodErrorsToEvent( - limit, - saveZodIssuesAsAttachment = false, - event, - hint, -) { - if ( - !event.exception || - !event.exception.values || - !hint || - !hint.originalException || - !originalExceptionIsZodError(hint.originalException) || - hint.originalException.issues.length === 0 - ) { +function applyZodErrorsToEvent(limit, saveZodIssuesAsAttachment = false, event, hint) { + if (!event.exception?.values || !hint.originalException || !originalExceptionIsZodError(hint.originalException) || hint.originalException.issues.length === 0) { return event; } - try { - const issuesToFlatten = saveZodIssuesAsAttachment - ? hint.originalException.issues - : hint.originalException.issues.slice(0, limit); + const issuesToFlatten = saveZodIssuesAsAttachment ? hint.originalException.issues : hint.originalException.issues.slice(0, limit); const flattenedIssues = issuesToFlatten.map(flattenIssue); - if (saveZodIssuesAsAttachment) { - // Sometimes having the full error details can be helpful. - // Attachments have much higher limits, so we can include the full list of issues. if (!Array.isArray(hint.attachments)) { hint.attachments = []; } hint.attachments.push({ - filename: 'zod_issues.json', + filename: "zod_issues.json", data: JSON.stringify({ - issues: flattenedIssues, - }), + issues: flattenedIssues + }) }); } - return { ...event, exception: { @@ -69577,47 +27035,40 @@ function applyZodErrorsToEvent( values: [ { ...event.exception.values[0], - value: formatIssueMessage(hint.originalException), + value: formatIssueMessage(hint.originalException) }, - ...event.exception.values.slice(1), - ], + ...event.exception.values.slice(1) + ] }, extra: { ...event.extra, - 'zoderror.issues': flattenedIssues.slice(0, limit), - }, + "zoderror.issues": flattenedIssues.slice(0, limit) + } }; } catch (e) { - // Hopefully we never throw errors here, but record it - // with the event just in case. return { ...event, extra: { ...event.extra, - 'zoderrors sentry integration parse error': { - message: 'an exception was thrown while processing ZodError within applyZodErrorsToEvent()', - error: e instanceof Error ? `${e.name}: ${e.message}\n${e.stack}` : 'unknown', - }, - }, + "zoderrors sentry integration parse error": { + message: "an exception was thrown while processing ZodError within applyZodErrorsToEvent()", + error: e instanceof Error ? `${e.name}: ${e.message} +${e.stack}` : "unknown" + } + } }; } } - const _zodErrorsIntegration = ((options = {}) => { - const limit = typeof options.limit === 'undefined' ? DEFAULT_LIMIT : options.limit; - + const limit = options.limit ?? DEFAULT_LIMIT; return { name: INTEGRATION_NAME, processEvent(originalEvent, hint) { const processedEvent = applyZodErrorsToEvent(limit, options.saveZodIssuesAsAttachment, originalEvent, hint); return processedEvent; - }, + } }; -}) ; - -/** - * Sentry integration to process Zod errors, making them easier to work with in Sentry. - */ +}); const zodErrorsIntegration = integration.defineIntegration(_zodErrorsIntegration); exports.applyZodErrorsToEvent = applyZodErrorsToEvent; @@ -69628,1163 +27079,698 @@ exports.zodErrorsIntegration = zodErrorsIntegration; //# sourceMappingURL=zoderrors.js.map +/***/ }), + +/***/ 35180: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const console = __nccwpck_require__(98510); +const integration = __nccwpck_require__(67428); +const semanticAttributes = __nccwpck_require__(36827); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); +const normalize = __nccwpck_require__(68446); +const internal = __nccwpck_require__(97113); +const utils = __nccwpck_require__(46162); + +const INTEGRATION_NAME = "ConsoleLogs"; +const DEFAULT_ATTRIBUTES = { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.log.console" +}; +const _consoleLoggingIntegration = ((options = {}) => { + const levels = options.levels || debugLogger.CONSOLE_LEVELS; + return { + name: INTEGRATION_NAME, + setup(client) { + const { enableLogs, normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = client.getOptions(); + if (!enableLogs) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled"); + return; + } + const unsubscribe = console.addConsoleInstrumentationHandler(({ args, level }) => { + if (currentScopes.getClient() !== client || !levels.includes(level)) { + return; + } + const firstArg = args[0]; + const followingArgs = args.slice(1); + if (level === "assert") { + if (!firstArg) { + const assertionMessage = followingArgs.length > 0 ? `Assertion failed: ${utils.formatConsoleArgs(followingArgs, normalizeDepth, normalizeMaxBreadth)}` : "Assertion failed"; + internal._INTERNAL_captureLog({ level: "error", message: assertionMessage, attributes: DEFAULT_ATTRIBUTES }); + } + return; + } + const isLevelLog = level === "log"; + const attributes = { ...DEFAULT_ATTRIBUTES }; + if (is.isPlainObject(firstArg)) { + Object.assign(attributes, normalize.normalize(firstArg, normalizeDepth, normalizeMaxBreadth)); + const remainingArgsStartIndex = typeof args[1] === "string" ? 2 : 1; + const remainingArgs = args.slice(remainingArgsStartIndex); + remainingArgs.forEach((arg, index) => { + attributes[`sentry.message.parameter.${index}`] = normalize.normalize(arg, normalizeDepth, normalizeMaxBreadth); + }); + } else { + const shouldGenerateTemplate = followingArgs.length > 0 && typeof firstArg === "string" && !utils.hasConsoleSubstitutions(firstArg); + if (shouldGenerateTemplate) { + const templateAttrs = utils.createConsoleTemplateAttributes(firstArg, followingArgs); + for (const [key, value] of Object.entries(templateAttrs)) { + attributes[key] = key.startsWith("sentry.message.parameter.") ? normalize.normalize(value, normalizeDepth, normalizeMaxBreadth) : value; + } + } + } + internal._INTERNAL_captureLog({ + level: isLevelLog ? "info" : level, + message: utils.formatConsoleArgs(args, normalizeDepth, normalizeMaxBreadth), + severityNumber: isLevelLog ? 10 : void 0, + attributes + }); + }); + client.registerCleanup(unsubscribe); + } + }; +}); +const consoleLoggingIntegration = integration.defineIntegration(_consoleLoggingIntegration); + +exports.consoleLoggingIntegration = consoleLoggingIntegration; +//# sourceMappingURL=console-integration.js.map + + +/***/ }), + +/***/ 28627: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const SEVERITY_TEXT_TO_SEVERITY_NUMBER = { + trace: 1, + debug: 5, + info: 9, + warn: 13, + error: 17, + fatal: 21 +}; + +exports.SEVERITY_TEXT_TO_SEVERITY_NUMBER = SEVERITY_TEXT_TO_SEVERITY_NUMBER; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 57944: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const dsn = __nccwpck_require__(91582); +const envelope = __nccwpck_require__(56987); +const isBrowser = __nccwpck_require__(71287); + +function createLogContainerEnvelopeItem(items, inferUserData) { + const inferSetting = inferUserData ? "auto" : "never"; + return [ + { + type: "log", + item_count: items.length, + content_type: "application/vnd.sentry.items.log+json" + }, + { + version: 2, + ...isBrowser.isBrowser() && { + ingest_settings: { infer_ip: inferSetting, infer_user_agent: inferSetting } + }, + items + } + ]; +} +function createLogEnvelope(logs, metadata, tunnel, dsn$1, inferUserData) { + const headers = {}; + if (metadata?.sdk) { + headers.sdk = { + name: metadata.sdk.name, + version: metadata.sdk.version + }; + } + if (!!tunnel && !!dsn$1) { + headers.dsn = dsn.dsnToString(dsn$1); + } + return envelope.createEnvelope(headers, [createLogContainerEnvelopeItem(logs, inferUserData)]); +} + +exports.createLogContainerEnvelopeItem = createLogContainerEnvelopeItem; +exports.createLogEnvelope = createLogEnvelope; +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ 97113: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(26925); +const carrier = __nccwpck_require__(38080); +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); +const scopeData = __nccwpck_require__(72332); +const spanOnScope = __nccwpck_require__(14379); +const time = __nccwpck_require__(66690); +const timestampSequence = __nccwpck_require__(4002); +const traceInfo = __nccwpck_require__(7535); +const constants = __nccwpck_require__(28627); +const envelope = __nccwpck_require__(57944); + +const MAX_LOG_BUFFER_SIZE = 100; +function setLogAttribute(logAttributes, key, value, setEvenIfPresent = true) { + if (value && (!logAttributes[key] || setEvenIfPresent)) { + logAttributes[key] = value; + } +} +function _INTERNAL_captureSerializedLog(client, serializedLog) { + const bufferMap = _getBufferMap(); + const logBuffer = _INTERNAL_getLogBuffer(client); + if (logBuffer === void 0) { + bufferMap.set(client, [serializedLog]); + } else { + if (logBuffer.length >= MAX_LOG_BUFFER_SIZE) { + _INTERNAL_flushLogsBuffer(client, logBuffer); + bufferMap.set(client, [serializedLog]); + } else { + bufferMap.set(client, [...logBuffer, serializedLog]); + } + } +} +function _INTERNAL_captureLog(beforeLog, currentScope = currentScopes.getCurrentScope(), captureSerializedLog = _INTERNAL_captureSerializedLog) { + const client = currentScope?.getClient() ?? currentScopes.getClient(); + if (!client) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No client available to capture log."); + return; + } + const { release, environment, enableLogs = true, beforeSendLog } = client.getOptions(); + if (!enableLogs) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("logging option not enabled, log will not be captured."); + return; + } + const [, traceContext] = traceInfo._getTraceInfoFromScope(client, currentScope); + const processedLogAttributes = { + ...beforeLog.attributes + }; + const { + user: { id, email, username }, + attributes: scopeAttributes = {} + } = scopeData.getCombinedScopeData(currentScopes.getIsolationScope(), currentScope); + setLogAttribute(processedLogAttributes, "user.id", id, false); + setLogAttribute(processedLogAttributes, "user.email", email, false); + setLogAttribute(processedLogAttributes, "user.name", username, false); + setLogAttribute(processedLogAttributes, "sentry.release", release); + setLogAttribute(processedLogAttributes, "sentry.environment", environment); + const { name, version } = client.getSdkMetadata()?.sdk ?? {}; + setLogAttribute(processedLogAttributes, "sentry.sdk.name", name); + setLogAttribute(processedLogAttributes, "sentry.sdk.version", version); + const replay = client.getIntegrationByName("Replay"); + const replayId = replay?.getReplayId(true); + setLogAttribute(processedLogAttributes, "sentry.replay_id", replayId); + if (replayId && replay?.getRecordingMode() === "buffer") { + setLogAttribute(processedLogAttributes, "sentry._internal.replay_is_buffering", true); + } + const beforeLogMessage = beforeLog.message; + if (is.isParameterizedString(beforeLogMessage)) { + const { __sentry_template_string__, __sentry_template_values__ = [] } = beforeLogMessage; + if (__sentry_template_values__?.length) { + processedLogAttributes["sentry.message.template"] = __sentry_template_string__; + } + __sentry_template_values__.forEach((param, index) => { + processedLogAttributes[`sentry.message.parameter.${index}`] = param; + }); + } + const span = spanOnScope._getSpanForScope(currentScope); + setLogAttribute(processedLogAttributes, "sentry.trace.parent_span_id", span?.spanContext().spanId); + const processedLog = { ...beforeLog, attributes: processedLogAttributes }; + client.emit("beforeCaptureLog", processedLog); + const log = beforeSendLog ? debugLogger.consoleSandbox(() => beforeSendLog(processedLog)) : processedLog; + if (!log) { + client.recordDroppedEvent("before_send", "log_item", 1); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("beforeSendLog returned null, log will not be captured."); + return; + } + const { level, message, attributes: logAttributes = {}, severityNumber } = log; + const timestamp = time.timestampInSeconds(); + const sequenceAttr = timestampSequence.getSequenceAttribute(timestamp); + const serializedLog = { + timestamp, + level, + body: _removeLoneSurrogates(String(message)), + trace_id: traceContext?.trace_id, + severity_number: severityNumber ?? constants.SEVERITY_TEXT_TO_SEVERITY_NUMBER[level], + attributes: sanitizeLogAttributes({ + ...attributes.serializeAttributes(scopeAttributes), + ...attributes.serializeAttributes(logAttributes, true), + [sequenceAttr.key]: sequenceAttr.value + }) + }; + captureSerializedLog(client, serializedLog); + client.emit("afterCaptureLog", log); +} +function _INTERNAL_flushLogsBuffer(client, maybeLogBuffer) { + const logBuffer = maybeLogBuffer ?? _INTERNAL_getLogBuffer(client) ?? []; + if (logBuffer.length === 0) { + return; + } + const clientOptions = client.getOptions(); + const envelope$1 = envelope.createLogEnvelope( + logBuffer, + clientOptions._metadata, + clientOptions.tunnel, + client.getDsn(), + client.getDataCollectionOptions().userInfo + ); + _getBufferMap().set(client, []); + client.emit("flushLogs"); + client.sendEnvelope(envelope$1); +} +function _INTERNAL_getLogBuffer(client) { + return _getBufferMap().get(client); +} +function _getBufferMap() { + return carrier.getGlobalSingleton("clientToLogBufferMap", () => /* @__PURE__ */ new WeakMap()); +} +function sanitizeLogAttributes(attributes) { + const sanitized = {}; + for (const [key, attr] of Object.entries(attributes)) { + const sanitizedKey = _removeLoneSurrogates(key); + if (attr.type === "string") { + sanitized[sanitizedKey] = { ...attr, value: _removeLoneSurrogates(attr.value) }; + } else { + sanitized[sanitizedKey] = attr; + } + } + return sanitized; +} +function _removeLoneSurrogates(str) { + const strObj = Object(str); + const isWellFormed = strObj["isWellFormed"]; + const toWellFormed = strObj["toWellFormed"]; + if (typeof isWellFormed === "function" && typeof toWellFormed === "function") { + return isWellFormed.call(str) ? str : toWellFormed.call(str); + } + return str; +} + +exports._INTERNAL_captureLog = _INTERNAL_captureLog; +exports._INTERNAL_captureSerializedLog = _INTERNAL_captureSerializedLog; +exports._INTERNAL_flushLogsBuffer = _INTERNAL_flushLogsBuffer; +exports._INTERNAL_getLogBuffer = _INTERNAL_getLogBuffer; +exports._removeLoneSurrogates = _removeLoneSurrogates; +//# sourceMappingURL=internal.js.map + + +/***/ }), + +/***/ 57557: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const internal = __nccwpck_require__(97113); +const parameterize = __nccwpck_require__(32957); + +function captureLog(level, message, attributes, scope, severityNumber) { + internal._INTERNAL_captureLog({ level, message, attributes, severityNumber }, scope); +} +function trace(message, attributes, { scope } = {}) { + captureLog("trace", message, attributes, scope); +} +function debug(message, attributes, { scope } = {}) { + captureLog("debug", message, attributes, scope); +} +function info(message, attributes, { scope } = {}) { + captureLog("info", message, attributes, scope); +} +function warn(message, attributes, { scope } = {}) { + captureLog("warn", message, attributes, scope); +} +function error(message, attributes, { scope } = {}) { + captureLog("error", message, attributes, scope); +} +function fatal(message, attributes, { scope } = {}) { + captureLog("fatal", message, attributes, scope); +} + +exports.fmt = parameterize.fmt; +exports.debug = debug; +exports.error = error; +exports.fatal = fatal; +exports.info = info; +exports.trace = trace; +exports.warn = warn; +//# sourceMappingURL=public-api.js.map + + +/***/ }), + +/***/ 46162: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const is = __nccwpck_require__(68370); +const normalize = __nccwpck_require__(68446); +const worldwide = __nccwpck_require__(90935); + +function formatConsoleArgs(values, normalizeDepth, normalizeMaxBreadth) { + return "util" in worldwide.GLOBAL_OBJ && typeof worldwide.GLOBAL_OBJ.util.format === "function" ? worldwide.GLOBAL_OBJ.util.format(...values) : safeJoinConsoleArgs(values, normalizeDepth, normalizeMaxBreadth); +} +function safeJoinConsoleArgs(values, normalizeDepth, normalizeMaxBreadth) { + return values.map( + (value) => is.isPrimitive(value) ? String(value) : JSON.stringify(normalize.normalize(value, normalizeDepth, normalizeMaxBreadth)) + ).join(" "); +} +function hasConsoleSubstitutions(str) { + return /%[sdifocO]/.test(str); +} +function createConsoleTemplateAttributes(firstArg, followingArgs) { + const attributes = {}; + const template = new Array(followingArgs.length).fill("{}").join(" "); + attributes["sentry.message.template"] = `${firstArg} ${template}`; + followingArgs.forEach((arg, index) => { + attributes[`sentry.message.parameter.${index}`] = arg; + }); + return attributes; +} + +exports.createConsoleTemplateAttributes = createConsoleTemplateAttributes; +exports.formatConsoleArgs = formatConsoleArgs; +exports.hasConsoleSubstitutions = hasConsoleSubstitutions; +exports.safeJoinConsoleArgs = safeJoinConsoleArgs; +//# sourceMappingURL=utils.js.map + + /***/ }), /***/ 44592: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const worldwide = __nccwpck_require__(10891); - -/** Keys are source filename/url, values are metadata objects. */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const filenameMetadataMap = new Map(); -/** Set of stack strings that have already been parsed. */ -const parsedStacks = new Set(); +const worldwide = __nccwpck_require__(90935); +const filenameMetadataMap = /* @__PURE__ */ new Map(); +const parsedStacks = /* @__PURE__ */ new Set(); +function getFilenameToMetadataMap(parser) { + if (!worldwide.GLOBAL_OBJ._sentryModuleMetadata) { + return {}; + } + const filenameMap = {}; + for (const stack of Object.keys(worldwide.GLOBAL_OBJ._sentryModuleMetadata)) { + const metadata = worldwide.GLOBAL_OBJ._sentryModuleMetadata[stack]; + const frames = parser(stack); + for (const frame of frames.reverse()) { + if (frame.filename) { + filenameMap[frame.filename] = metadata; + break; + } + } + } + return filenameMap; +} function ensureMetadataStacksAreParsed(parser) { if (!worldwide.GLOBAL_OBJ._sentryModuleMetadata) { return; } - for (const stack of Object.keys(worldwide.GLOBAL_OBJ._sentryModuleMetadata)) { const metadata = worldwide.GLOBAL_OBJ._sentryModuleMetadata[stack]; - if (parsedStacks.has(stack)) { continue; } - - // Ensure this stack doesn't get parsed again parsedStacks.add(stack); - const frames = parser(stack); - - // Go through the frames starting from the top of the stack and find the first one with a filename for (const frame of frames.reverse()) { if (frame.filename) { - // Save the metadata for this filename filenameMetadataMap.set(frame.filename, metadata); break; } } } } - -/** - * Retrieve metadata for a specific JavaScript file URL. - * - * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any function getMetadataForUrl(parser, filename) { ensureMetadataStacksAreParsed(parser); return filenameMetadataMap.get(filename); } - -/** - * Adds metadata to stack frames. - * - * Metadata is injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option. - */ function addMetadataToStackFrames(parser, event) { - try { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - event.exception.values.forEach(exception => { - if (!exception.stacktrace) { + event.exception?.values?.forEach((exception) => { + exception.stacktrace?.frames?.forEach((frame) => { + if (!frame.filename || frame.module_metadata) { return; } - - for (const frame of exception.stacktrace.frames || []) { - if (!frame.filename || frame.module_metadata) { - continue; - } - - const metadata = getMetadataForUrl(parser, frame.filename); - - if (metadata) { - frame.module_metadata = metadata; - } + const metadata = getMetadataForUrl(parser, frame.filename); + if (metadata) { + frame.module_metadata = metadata; } }); - } catch (_) { - // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. - } + }); } - -/** - * Strips metadata from stack frames. - */ function stripMetadataFromStackFrames(event) { - try { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - event.exception.values.forEach(exception => { - if (!exception.stacktrace) { - return; - } - - for (const frame of exception.stacktrace.frames || []) { - delete frame.module_metadata; - } + event.exception?.values?.forEach((exception) => { + exception.stacktrace?.frames?.forEach((frame) => { + delete frame.module_metadata; }); - } catch (_) { - // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. - } + }); } exports.addMetadataToStackFrames = addMetadataToStackFrames; +exports.getFilenameToMetadataMap = getFilenameToMetadataMap; exports.getMetadataForUrl = getMetadataForUrl; exports.stripMetadataFromStackFrames = stripMetadataFromStackFrames; //# sourceMappingURL=metadata.js.map -/***/ }), - -/***/ 33325: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const time = __nccwpck_require__(75872); -const spanUtils = __nccwpck_require__(47569); -const constants = __nccwpck_require__(12510); -const envelope = __nccwpck_require__(61993); -const instance = __nccwpck_require__(23260); -const utils = __nccwpck_require__(72475); - -/** - * A metrics aggregator that aggregates metrics in memory and flushes them periodically. - */ -class MetricsAggregator { - // TODO(@anonrig): Use FinalizationRegistry to have a proper way of flushing the buckets - // when the aggregator is garbage collected. - // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry - - // Different metrics have different weights. We use this to limit the number of metrics - // that we store in memory. - - // We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer - - // SDKs are required to shift the flush interval by random() * rollup_in_seconds. - // That shift is determined once per startup to create jittering. - - // An SDK is required to perform force flushing ahead of scheduled time if the memory - // pressure is too high. There is no rule for this other than that SDKs should be tracking - // abstract aggregation complexity (eg: a counter only carries a single float, whereas a - // distribution is a float per emission). - // - // Force flush is used on either shutdown, flush() or when we exceed the max weight. - - constructor( _client) {this._client = _client; - this._buckets = new Map(); - this._bucketsTotalWeight = 0; - - this._interval = setInterval(() => this._flush(), constants.DEFAULT_FLUSH_INTERVAL); - if (this._interval.unref) { - this._interval.unref(); - } - - this._flushShift = Math.floor((Math.random() * constants.DEFAULT_FLUSH_INTERVAL) / 1000); - this._forceFlush = false; - } - - /** - * @inheritDoc - */ - add( - metricType, - unsanitizedName, - value, - unsanitizedUnit = 'none', - unsanitizedTags = {}, - maybeFloatTimestamp = time.timestampInSeconds(), - ) { - const timestamp = Math.floor(maybeFloatTimestamp); - const name = utils.sanitizeMetricKey(unsanitizedName); - const tags = utils.sanitizeTags(unsanitizedTags); - const unit = utils.sanitizeUnit(unsanitizedUnit ); - - const bucketKey = utils.getBucketKey(metricType, name, unit, tags); - - let bucketItem = this._buckets.get(bucketKey); - // If this is a set metric, we need to calculate the delta from the previous weight. - const previousWeight = bucketItem && metricType === constants.SET_METRIC_TYPE ? bucketItem.metric.weight : 0; - - if (bucketItem) { - bucketItem.metric.add(value); - // TODO(abhi): Do we need this check? - if (bucketItem.timestamp < timestamp) { - bucketItem.timestamp = timestamp; - } - } else { - bucketItem = { - // @ts-expect-error we don't need to narrow down the type of value here, saves bundle size. - metric: new instance.METRIC_MAP[metricType](value), - timestamp, - metricType, - name, - unit, - tags, - }; - this._buckets.set(bucketKey, bucketItem); - } - - // If value is a string, it's a set metric so calculate the delta from the previous weight. - const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value; - spanUtils.updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey); - - // We need to keep track of the total weight of the buckets so that we can - // flush them when we exceed the max weight. - this._bucketsTotalWeight += bucketItem.metric.weight; - - if (this._bucketsTotalWeight >= constants.MAX_WEIGHT) { - this.flush(); - } - } - - /** - * Flushes the current metrics to the transport via the transport. - */ - flush() { - this._forceFlush = true; - this._flush(); - } - - /** - * Shuts down metrics aggregator and clears all metrics. - */ - close() { - this._forceFlush = true; - clearInterval(this._interval); - this._flush(); - } - - /** - * Flushes the buckets according to the internal state of the aggregator. - * If it is a force flush, which happens on shutdown, it will flush all buckets. - * Otherwise, it will only flush buckets that are older than the flush interval, - * and according to the flush shift. - * - * This function mutates `_forceFlush` and `_bucketsTotalWeight` properties. - */ - _flush() { - // TODO(@anonrig): Add Atomics for locking to avoid having force flush and regular flush - // running at the same time. - // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics - - // This path eliminates the need for checking for timestamps since we're forcing a flush. - // Remember to reset the flag, or it will always flush all metrics. - if (this._forceFlush) { - this._forceFlush = false; - this._bucketsTotalWeight = 0; - this._captureMetrics(this._buckets); - this._buckets.clear(); - return; - } - const cutoffSeconds = Math.floor(time.timestampInSeconds()) - constants.DEFAULT_FLUSH_INTERVAL / 1000 - this._flushShift; - // TODO(@anonrig): Optimization opportunity. - // Convert this map to an array and store key in the bucketItem. - const flushedBuckets = new Map(); - for (const [key, bucket] of this._buckets) { - if (bucket.timestamp <= cutoffSeconds) { - flushedBuckets.set(key, bucket); - this._bucketsTotalWeight -= bucket.metric.weight; - } - } - - for (const [key] of flushedBuckets) { - this._buckets.delete(key); - } - - this._captureMetrics(flushedBuckets); - } - - /** - * Only captures a subset of the buckets passed to this function. - * @param flushedBuckets - */ - _captureMetrics(flushedBuckets) { - if (flushedBuckets.size > 0) { - // TODO(@anonrig): Optimization opportunity. - // This copy operation can be avoided if we store the key in the bucketItem. - const buckets = Array.from(flushedBuckets).map(([, bucketItem]) => bucketItem); - envelope.captureAggregateMetrics(this._client, buckets); - } - } -} - -exports.MetricsAggregator = MetricsAggregator; -//# sourceMappingURL=aggregator.js.map - - -/***/ }), - -/***/ 53128: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const time = __nccwpck_require__(75872); -const spanUtils = __nccwpck_require__(47569); -const constants = __nccwpck_require__(12510); -const envelope = __nccwpck_require__(61993); -const instance = __nccwpck_require__(23260); -const utils = __nccwpck_require__(72475); - -/** - * A simple metrics aggregator that aggregates metrics in memory and flushes them periodically. - * Default flush interval is 5 seconds. - * - * @experimental This API is experimental and might change in the future. - */ -class BrowserMetricsAggregator { - // TODO(@anonrig): Use FinalizationRegistry to have a proper way of flushing the buckets - // when the aggregator is garbage collected. - // Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry - - constructor( _client) {this._client = _client; - this._buckets = new Map(); - this._interval = setInterval(() => this.flush(), constants.DEFAULT_BROWSER_FLUSH_INTERVAL); - } - - /** - * @inheritDoc - */ - add( - metricType, - unsanitizedName, - value, - unsanitizedUnit = 'none', - unsanitizedTags = {}, - maybeFloatTimestamp = time.timestampInSeconds(), - ) { - const timestamp = Math.floor(maybeFloatTimestamp); - const name = utils.sanitizeMetricKey(unsanitizedName); - const tags = utils.sanitizeTags(unsanitizedTags); - const unit = utils.sanitizeUnit(unsanitizedUnit ); - - const bucketKey = utils.getBucketKey(metricType, name, unit, tags); - - let bucketItem = this._buckets.get(bucketKey); - // If this is a set metric, we need to calculate the delta from the previous weight. - const previousWeight = bucketItem && metricType === constants.SET_METRIC_TYPE ? bucketItem.metric.weight : 0; - - if (bucketItem) { - bucketItem.metric.add(value); - // TODO(abhi): Do we need this check? - if (bucketItem.timestamp < timestamp) { - bucketItem.timestamp = timestamp; - } - } else { - bucketItem = { - // @ts-expect-error we don't need to narrow down the type of value here, saves bundle size. - metric: new instance.METRIC_MAP[metricType](value), - timestamp, - metricType, - name, - unit, - tags, - }; - this._buckets.set(bucketKey, bucketItem); - } - - // If value is a string, it's a set metric so calculate the delta from the previous weight. - const val = typeof value === 'string' ? bucketItem.metric.weight - previousWeight : value; - spanUtils.updateMetricSummaryOnActiveSpan(metricType, name, val, unit, unsanitizedTags, bucketKey); - } - - /** - * @inheritDoc - */ - flush() { - // short circuit if buckets are empty. - if (this._buckets.size === 0) { - return; - } - - const metricBuckets = Array.from(this._buckets.values()); - envelope.captureAggregateMetrics(this._client, metricBuckets); - - this._buckets.clear(); - } - - /** - * @inheritDoc - */ - close() { - clearInterval(this._interval); - this.flush(); - } -} - -exports.BrowserMetricsAggregator = BrowserMetricsAggregator; -//# sourceMappingURL=browser-aggregator.js.map - - -/***/ }), - -/***/ 12510: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const COUNTER_METRIC_TYPE = 'c' ; -const GAUGE_METRIC_TYPE = 'g' ; -const SET_METRIC_TYPE = 's' ; -const DISTRIBUTION_METRIC_TYPE = 'd' ; - -/** - * This does not match spec in https://develop.sentry.dev/sdk/metrics - * but was chosen to optimize for the most common case in browser environments. - */ -const DEFAULT_BROWSER_FLUSH_INTERVAL = 5000; - -/** - * SDKs are required to bucket into 10 second intervals (rollup in seconds) - * which is the current lower bound of metric accuracy. - */ -const DEFAULT_FLUSH_INTERVAL = 10000; - -/** - * The maximum number of metrics that should be stored in memory. - */ -const MAX_WEIGHT = 10000; - -exports.COUNTER_METRIC_TYPE = COUNTER_METRIC_TYPE; -exports.DEFAULT_BROWSER_FLUSH_INTERVAL = DEFAULT_BROWSER_FLUSH_INTERVAL; -exports.DEFAULT_FLUSH_INTERVAL = DEFAULT_FLUSH_INTERVAL; -exports.DISTRIBUTION_METRIC_TYPE = DISTRIBUTION_METRIC_TYPE; -exports.GAUGE_METRIC_TYPE = GAUGE_METRIC_TYPE; -exports.MAX_WEIGHT = MAX_WEIGHT; -exports.SET_METRIC_TYPE = SET_METRIC_TYPE; -//# sourceMappingURL=constants.js.map - - /***/ }), /***/ 61993: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const dsn = __nccwpck_require__(32540); -const envelope = __nccwpck_require__(72635); -const logger = __nccwpck_require__(38752); -const utils = __nccwpck_require__(72475); +const dsn = __nccwpck_require__(91582); +const envelope = __nccwpck_require__(56987); +const isBrowser = __nccwpck_require__(71287); -/** - * Captures aggregated metrics to the supplied client. - */ -function captureAggregateMetrics(client, metricBucketItems) { - logger.logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`); - const dsn = client.getDsn(); - const metadata = client.getSdkMetadata(); - const tunnel = client.getOptions().tunnel; - - const metricsEnvelope = createMetricEnvelope(metricBucketItems, dsn, metadata, tunnel); - - // sendEnvelope should not throw - // eslint-disable-next-line @typescript-eslint/no-floating-promises - client.sendEnvelope(metricsEnvelope); +function createMetricContainerEnvelopeItem(items, inferUserData) { + const inferSetting = inferUserData ? "auto" : "never"; + return [ + { + type: "trace_metric", + item_count: items.length, + content_type: "application/vnd.sentry.items.trace-metric+json" + }, + { + version: 2, + ...isBrowser.isBrowser() && { + ingest_settings: { infer_ip: inferSetting, infer_user_agent: inferSetting } + }, + items + } + ]; } - -/** - * Create envelope from a metric aggregate. - */ -function createMetricEnvelope( - metricBucketItems, - dsn$1, - metadata, - tunnel, -) { - const headers = { - sent_at: new Date().toISOString(), - }; - - if (metadata && metadata.sdk) { +function createMetricEnvelope(metrics, metadata, tunnel, dsn$1, inferUserData) { + const headers = {}; + if (metadata?.sdk) { headers.sdk = { name: metadata.sdk.name, - version: metadata.sdk.version, + version: metadata.sdk.version }; } - - if (!!tunnel && dsn$1) { + if (!!tunnel && !!dsn$1) { headers.dsn = dsn.dsnToString(dsn$1); } - - const item = createMetricEnvelopeItem(metricBucketItems); - return envelope.createEnvelope(headers, [item]); + return envelope.createEnvelope(headers, [createMetricContainerEnvelopeItem(metrics, inferUserData)]); } -function createMetricEnvelopeItem(metricBucketItems) { - const payload = utils.serializeMetricBuckets(metricBucketItems); - const metricHeaders = { - type: 'statsd', - length: payload.length, - }; - return [metricHeaders, payload]; -} - -exports.captureAggregateMetrics = captureAggregateMetrics; +exports.createMetricContainerEnvelopeItem = createMetricContainerEnvelopeItem; exports.createMetricEnvelope = createMetricEnvelope; //# sourceMappingURL=envelope.js.map /***/ }), -/***/ 19001: +/***/ 48803: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const aggregator = __nccwpck_require__(33325); -const exports$1 = __nccwpck_require__(57134); - -/** - * Adds a value to a counter metric - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function increment(name, value = 1, data) { - // eslint-disable-next-line deprecation/deprecation - exports$1.metrics.increment(aggregator.MetricsAggregator, name, value, data); -} - -/** - * Adds a value to a distribution metric - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function distribution(name, value, data) { - // eslint-disable-next-line deprecation/deprecation - exports$1.metrics.distribution(aggregator.MetricsAggregator, name, value, data); -} - -/** - * Adds a value to a set metric. Value must be a string or integer. - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function set(name, value, data) { - // eslint-disable-next-line deprecation/deprecation - exports$1.metrics.set(aggregator.MetricsAggregator, name, value, data); -} - -/** - * Adds a value to a gauge metric - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function gauge(name, value, data) { - // eslint-disable-next-line deprecation/deprecation - exports$1.metrics.gauge(aggregator.MetricsAggregator, name, value, data); -} - -/** - * Adds a timing metric. - * The metric is added as a distribution metric. - * - * You can either directly capture a numeric `value`, or wrap a callback function in `timing`. - * In the latter case, the duration of the callback execution will be captured as a span & a metric. - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ - -function timing( - name, - value, - unit = 'second', - data, -) { - // eslint-disable-next-line deprecation/deprecation - return exports$1.metrics.timing(aggregator.MetricsAggregator, name, value, unit, data); -} - -/** - * Returns the metrics aggregator for a given client. - */ -function getMetricsAggregatorForClient(client) { - // eslint-disable-next-line deprecation/deprecation - return exports$1.metrics.getMetricsAggregatorForClient(client, aggregator.MetricsAggregator); -} - -/** - * The metrics API is used to capture custom metrics in Sentry. - * - * @deprecated The Sentry metrics beta has ended. This export will be removed in a future release. - */ -const metricsDefault - - = { - increment, - distribution, - set, - gauge, - timing, - /** - * @ignore This is for internal use only. - */ - getMetricsAggregatorForClient, -}; - -exports.metricsDefault = metricsDefault; -//# sourceMappingURL=exports-default.js.map - - -/***/ }), - -/***/ 57134: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const attributes = __nccwpck_require__(26925); +const carrier = __nccwpck_require__(38080); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); -__nccwpck_require__(21834); -const worldwide = __nccwpck_require__(10891); -__nccwpck_require__(87038); -const logger = __nccwpck_require__(38752); -const time = __nccwpck_require__(75872); -const spanUtils = __nccwpck_require__(47569); -const trace = __nccwpck_require__(97956); -const handleCallbackErrors = __nccwpck_require__(77864); -const constants = __nccwpck_require__(12510); +const debugLogger = __nccwpck_require__(41772); +const scopeData = __nccwpck_require__(72332); +const spanOnScope = __nccwpck_require__(14379); +const time = __nccwpck_require__(66690); +const timestampSequence = __nccwpck_require__(4002); +const traceInfo = __nccwpck_require__(7535); +const envelope = __nccwpck_require__(61993); -/** - * Gets the metrics aggregator for a given client. - * @param client The client for which to get the metrics aggregator. - * @param Aggregator Optional metrics aggregator class to use to create an aggregator if one does not exist. - */ -function getMetricsAggregatorForClient( - client, - Aggregator, -) { - const globalMetricsAggregators = worldwide.getGlobalSingleton( - 'globalMetricsAggregators', - () => new WeakMap(), - ); - - const aggregator = globalMetricsAggregators.get(client); - if (aggregator) { - return aggregator; +const MAX_METRIC_BUFFER_SIZE = 1e3; +function setMetricAttribute(metricAttributes, key, value, setEvenIfPresent = true) { + if (value && (setEvenIfPresent || !(key in metricAttributes))) { + metricAttributes[key] = value; } - - const newAggregator = new Aggregator(client); - client.on('flush', () => newAggregator.flush()); - client.on('close', () => newAggregator.close()); - globalMetricsAggregators.set(client, newAggregator); - - return newAggregator; } - -function addToMetricsAggregator( - Aggregator, - metricType, - name, - value, - data = {}, -) { - const client = data.client || currentScopes.getClient(); - +function _INTERNAL_captureSerializedMetric(client, serializedMetric) { + const bufferMap = _getBufferMap(); + const metricBuffer = _INTERNAL_getMetricBuffer(client); + if (metricBuffer === void 0) { + bufferMap.set(client, [serializedMetric]); + } else { + if (metricBuffer.length >= MAX_METRIC_BUFFER_SIZE) { + _INTERNAL_flushMetricsBuffer(client, metricBuffer); + bufferMap.set(client, [serializedMetric]); + } else { + bufferMap.set(client, [...metricBuffer, serializedMetric]); + } + } +} +function _enrichMetricAttributes(beforeMetric, client, user) { + const { release, environment } = client.getOptions(); + const processedMetricAttributes = { + ...beforeMetric.attributes + }; + setMetricAttribute(processedMetricAttributes, "user.id", user.id, false); + setMetricAttribute(processedMetricAttributes, "user.email", user.email, false); + setMetricAttribute(processedMetricAttributes, "user.name", user.username, false); + setMetricAttribute(processedMetricAttributes, "sentry.release", release); + setMetricAttribute(processedMetricAttributes, "sentry.environment", environment); + const { name, version } = client.getSdkMetadata()?.sdk ?? {}; + setMetricAttribute(processedMetricAttributes, "sentry.sdk.name", name); + setMetricAttribute(processedMetricAttributes, "sentry.sdk.version", version); + const replay = client.getIntegrationByName("Replay"); + const replayId = replay?.getReplayId(true); + setMetricAttribute(processedMetricAttributes, "sentry.replay_id", replayId); + if (replayId && replay?.getRecordingMode() === "buffer") { + setMetricAttribute(processedMetricAttributes, "sentry._internal.replay_is_buffering", true); + } + return { + ...beforeMetric, + attributes: processedMetricAttributes + }; +} +function _buildSerializedMetric(metric, client, currentScope, scopeAttributes) { + const [, traceContext] = traceInfo._getTraceInfoFromScope(client, currentScope); + const span = spanOnScope._getSpanForScope(currentScope); + const traceId = span ? span.spanContext().traceId : traceContext?.trace_id; + const spanId = span ? span.spanContext().spanId : void 0; + const timestamp = time.timestampInSeconds(); + const sequenceAttr = timestampSequence.getSequenceAttribute(timestamp); + return { + timestamp, + trace_id: traceId ?? "", + span_id: spanId, + name: metric.name, + type: metric.type, + unit: metric.unit, + value: metric.value, + attributes: { + ...attributes.serializeAttributes(scopeAttributes), + ...attributes.serializeAttributes(metric.attributes, "skip-undefined"), + [sequenceAttr.key]: sequenceAttr.value + } + }; +} +function _INTERNAL_captureMetric(beforeMetric, options) { + const currentScope = options?.scope ?? currentScopes.getCurrentScope(); + const captureSerializedMetric = options?.captureSerializedMetric ?? _INTERNAL_captureSerializedMetric; + const client = currentScope?.getClient() ?? currentScopes.getClient(); if (!client) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No client available to capture metric."); return; } - - const span = spanUtils.getActiveSpan(); - const rootSpan = span ? spanUtils.getRootSpan(span) : undefined; - const transactionName = rootSpan && spanUtils.spanToJSON(rootSpan).description; - - const { unit, tags, timestamp } = data; - const { release, environment } = client.getOptions(); - const metricTags = {}; - if (release) { - metricTags.release = release; + const { _experiments, enableMetrics, beforeSendMetric } = client.getOptions(); + const metricsEnabled = enableMetrics ?? _experiments?.enableMetrics ?? true; + if (!metricsEnabled) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("metrics option not enabled, metric will not be captured."); + return; } - if (environment) { - metricTags.environment = environment; + const { user, attributes: scopeAttributes } = scopeData.getCombinedScopeData(currentScopes.getIsolationScope(), currentScope); + const enrichedMetric = _enrichMetricAttributes(beforeMetric, client, user); + client.emit("processMetric", enrichedMetric); + const beforeSendCallback = beforeSendMetric || _experiments?.beforeSendMetric; + const processedMetric = beforeSendCallback ? beforeSendCallback(enrichedMetric) : enrichedMetric; + if (!processedMetric) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("`beforeSendMetric` returned `null`, will not send metric."); + return; } - if (transactionName) { - metricTags.transaction = transactionName; + const serializedMetric = _buildSerializedMetric(processedMetric, client, currentScope, scopeAttributes); + debugBuild.DEBUG_BUILD && debugLogger.debug.log("[Metric]", serializedMetric); + captureSerializedMetric(client, serializedMetric); + client.emit("afterCaptureMetric", processedMetric); +} +function _INTERNAL_flushMetricsBuffer(client, maybeMetricBuffer) { + const metricBuffer = maybeMetricBuffer ?? _INTERNAL_getMetricBuffer(client) ?? []; + if (metricBuffer.length === 0) { + return; } - - debugBuild.DEBUG_BUILD && logger.logger.log(`Adding value of ${value} to ${metricType} metric ${name}`); - - const aggregator = getMetricsAggregatorForClient(client, Aggregator); - aggregator.add(metricType, name, value, unit, { ...metricTags, ...tags }, timestamp); + const clientOptions = client.getOptions(); + const envelope$1 = envelope.createMetricEnvelope( + metricBuffer, + clientOptions._metadata, + clientOptions.tunnel, + client.getDsn(), + client.getDataCollectionOptions().userInfo + ); + _getBufferMap().set(client, []); + client.emit("flushMetrics"); + client.sendEnvelope(envelope$1); +} +function _INTERNAL_getMetricBuffer(client) { + return _getBufferMap().get(client); +} +function _getBufferMap() { + return carrier.getGlobalSingleton("clientToMetricBufferMap", () => /* @__PURE__ */ new WeakMap()); } -/** - * Adds a value to a counter metric - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function increment(aggregator, name, value = 1, data) { - addToMetricsAggregator(aggregator, constants.COUNTER_METRIC_TYPE, name, ensureNumber(value), data); -} - -/** - * Adds a value to a distribution metric - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function distribution(aggregator, name, value, data) { - addToMetricsAggregator(aggregator, constants.DISTRIBUTION_METRIC_TYPE, name, ensureNumber(value), data); -} - -/** - * Adds a timing metric. - * The metric is added as a distribution metric. - * - * You can either directly capture a numeric `value`, or wrap a callback function in `timing`. - * In the latter case, the duration of the callback execution will be captured as a span & a metric. - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function timing( - aggregator, - name, - value, - unit = 'second', - data, -) { - // callback form - if (typeof value === 'function') { - const startTime = time.timestampInSeconds(); - - return trace.startSpanManual( - { - op: 'metrics.timing', - name, - startTime, - onlyIfParent: true, - }, - span => { - return handleCallbackErrors.handleCallbackErrors( - () => value(), - () => { - // no special error handling necessary - }, - () => { - const endTime = time.timestampInSeconds(); - const timeDiff = endTime - startTime; - // eslint-disable-next-line deprecation/deprecation - distribution(aggregator, name, timeDiff, { ...data, unit: 'second' }); - span.end(endTime); - }, - ); - }, - ); - } - - // value form - // eslint-disable-next-line deprecation/deprecation - distribution(aggregator, name, value, { ...data, unit }); -} - -/** - * Adds a value to a set metric. Value must be a string or integer. - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function set(aggregator, name, value, data) { - addToMetricsAggregator(aggregator, constants.SET_METRIC_TYPE, name, value, data); -} - -/** - * Adds a value to a gauge metric - * - * @deprecated The Sentry metrics beta has ended. This method will be removed in a future release. - */ -function gauge(aggregator, name, value, data) { - addToMetricsAggregator(aggregator, constants.GAUGE_METRIC_TYPE, name, ensureNumber(value), data); -} - -/** - * The metrics API is used to capture custom metrics in Sentry. - * - * @deprecated The Sentry metrics beta has ended. This export will be removed in a future release. - */ -const metrics = { - increment, - distribution, - set, - gauge, - timing, - /** - * @ignore This is for internal use only. - */ - getMetricsAggregatorForClient, -}; - -// Although this is typed to be a number, we try to handle strings as well here -function ensureNumber(number) { - return typeof number === 'string' ? parseInt(number) : number; -} - -exports.metrics = metrics; -//# sourceMappingURL=exports.js.map +exports._INTERNAL_captureMetric = _INTERNAL_captureMetric; +exports._INTERNAL_captureSerializedMetric = _INTERNAL_captureSerializedMetric; +exports._INTERNAL_flushMetricsBuffer = _INTERNAL_flushMetricsBuffer; +exports._INTERNAL_getMetricBuffer = _INTERNAL_getMetricBuffer; +//# sourceMappingURL=internal.js.map /***/ }), -/***/ 23260: +/***/ 64701: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const constants = __nccwpck_require__(12510); -const utils = __nccwpck_require__(72475); +const internal = __nccwpck_require__(48803); -/** - * A metric instance representing a counter. - */ -class CounterMetric { - constructor( _value) {this._value = _value;} - - /** @inheritDoc */ - get weight() { - return 1; - } - - /** @inheritdoc */ - add(value) { - this._value += value; - } - - /** @inheritdoc */ - toString() { - return `${this._value}`; - } +function captureMetric(type, name, value, options) { + internal._INTERNAL_captureMetric( + { type, name, value, unit: options?.unit, attributes: options?.attributes }, + { scope: options?.scope } + ); +} +function count(name, value = 1, options) { + captureMetric("counter", name, value, options); +} +function gauge(name, value, options) { + captureMetric("gauge", name, value, options); +} +function distribution(name, value, options) { + captureMetric("distribution", name, value, options); } -/** - * A metric instance representing a gauge. - */ -class GaugeMetric { - - constructor(value) { - this._last = value; - this._min = value; - this._max = value; - this._sum = value; - this._count = 1; - } - - /** @inheritDoc */ - get weight() { - return 5; - } - - /** @inheritdoc */ - add(value) { - this._last = value; - if (value < this._min) { - this._min = value; - } - if (value > this._max) { - this._max = value; - } - this._sum += value; - this._count++; - } - - /** @inheritdoc */ - toString() { - return `${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`; - } -} - -/** - * A metric instance representing a distribution. - */ -class DistributionMetric { - - constructor(first) { - this._value = [first]; - } - - /** @inheritDoc */ - get weight() { - return this._value.length; - } - - /** @inheritdoc */ - add(value) { - this._value.push(value); - } - - /** @inheritdoc */ - toString() { - return this._value.join(':'); - } -} - -/** - * A metric instance representing a set. - */ -class SetMetric { - - constructor( first) {this.first = first; - this._value = new Set([first]); - } - - /** @inheritDoc */ - get weight() { - return this._value.size; - } - - /** @inheritdoc */ - add(value) { - this._value.add(value); - } - - /** @inheritdoc */ - toString() { - return Array.from(this._value) - .map(val => (typeof val === 'string' ? utils.simpleHash(val) : val)) - .join(':'); - } -} - -const METRIC_MAP = { - [constants.COUNTER_METRIC_TYPE]: CounterMetric, - [constants.GAUGE_METRIC_TYPE]: GaugeMetric, - [constants.DISTRIBUTION_METRIC_TYPE]: DistributionMetric, - [constants.SET_METRIC_TYPE]: SetMetric, -}; - -exports.CounterMetric = CounterMetric; -exports.DistributionMetric = DistributionMetric; -exports.GaugeMetric = GaugeMetric; -exports.METRIC_MAP = METRIC_MAP; -exports.SetMetric = SetMetric; -//# sourceMappingURL=instance.js.map - - -/***/ }), - -/***/ 48306: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const object = __nccwpck_require__(16100); - -/** - * key: bucketKey - * value: [exportKey, MetricSummary] - */ - -const METRICS_SPAN_FIELD = '_sentryMetrics'; - -/** - * Fetches the metric summary if it exists for the passed span - */ -function getMetricSummaryJsonForSpan(span) { - const storage = (span )[METRICS_SPAN_FIELD]; - - if (!storage) { - return undefined; - } - const output = {}; - - for (const [, [exportKey, summary]] of storage) { - const arr = output[exportKey] || (output[exportKey] = []); - arr.push(object.dropUndefinedKeys(summary)); - } - - return output; -} - -/** - * Updates the metric summary on a span. - */ -function updateMetricSummaryOnSpan( - span, - metricType, - sanitizedName, - value, - unit, - tags, - bucketKey, -) { - const existingStorage = (span )[METRICS_SPAN_FIELD]; - const storage = - existingStorage || - ((span )[METRICS_SPAN_FIELD] = new Map()); - - const exportKey = `${metricType}:${sanitizedName}@${unit}`; - const bucketItem = storage.get(bucketKey); - - if (bucketItem) { - const [, summary] = bucketItem; - storage.set(bucketKey, [ - exportKey, - { - min: Math.min(summary.min, value), - max: Math.max(summary.max, value), - count: (summary.count += 1), - sum: (summary.sum += value), - tags: summary.tags, - }, - ]); - } else { - storage.set(bucketKey, [ - exportKey, - { - min: value, - max: value, - count: 1, - sum: value, - tags, - }, - ]); - } -} - -exports.getMetricSummaryJsonForSpan = getMetricSummaryJsonForSpan; -exports.updateMetricSummaryOnSpan = updateMetricSummaryOnSpan; -//# sourceMappingURL=metric-summary.js.map - - -/***/ }), - -/***/ 72475: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const object = __nccwpck_require__(16100); - -/** - * Generate bucket key from metric properties. - */ -function getBucketKey( - metricType, - name, - unit, - tags, -) { - const stringifiedTags = Object.entries(object.dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0])); - return `${metricType}${name}${unit}${stringifiedTags}`; -} - -/* eslint-disable no-bitwise */ -/** - * Simple hash function for strings. - */ -function simpleHash(s) { - let rv = 0; - for (let i = 0; i < s.length; i++) { - const c = s.charCodeAt(i); - rv = (rv << 5) - rv + c; - rv &= rv; - } - return rv >>> 0; -} -/* eslint-enable no-bitwise */ - -/** - * Serialize metrics buckets into a string based on statsd format. - * - * Example of format: - * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677 - * Segments: - * name: metric.name - * unit: second - * value: [1, 1.2] - * type of metric: d (distribution) - * tags: { a: value, b: anothervalue } - * timestamp: 12345677 - */ -function serializeMetricBuckets(metricBucketItems) { - let out = ''; - for (const item of metricBucketItems) { - const tagEntries = Object.entries(item.tags); - const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : ''; - out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\n`; - } - return out; -} - -/** - * Sanitizes units - * - * These Regex's are straight from the normalisation docs: - * https://develop.sentry.dev/sdk/metrics/#normalization - */ -function sanitizeUnit(unit) { - return unit.replace(/[^\w]+/gi, '_'); -} - -/** - * Sanitizes metric keys - * - * These Regex's are straight from the normalisation docs: - * https://develop.sentry.dev/sdk/metrics/#normalization - */ -function sanitizeMetricKey(key) { - return key.replace(/[^\w\-.]+/gi, '_'); -} - -/** - * Sanitizes metric keys - * - * These Regex's are straight from the normalisation docs: - * https://develop.sentry.dev/sdk/metrics/#normalization - */ -function sanitizeTagKey(key) { - return key.replace(/[^\w\-./]+/gi, ''); -} - -/** - * These Regex's are straight from the normalisation docs: - * https://develop.sentry.dev/sdk/metrics/#normalization - */ -const tagValueReplacements = [ - ['\n', '\\n'], - ['\r', '\\r'], - ['\t', '\\t'], - ['\\', '\\\\'], - ['|', '\\u{7c}'], - [',', '\\u{2c}'], -]; - -function getCharOrReplacement(input) { - for (const [search, replacement] of tagValueReplacements) { - if (input === search) { - return replacement; - } - } - - return input; -} - -function sanitizeTagValue(value) { - return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), ''); -} - -/** - * Sanitizes tags. - */ -function sanitizeTags(unsanitizedTags) { - const tags = {}; - for (const key in unsanitizedTags) { - if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) { - const sanitizedKey = sanitizeTagKey(key); - tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key])); - } - } - return tags; -} - -exports.getBucketKey = getBucketKey; -exports.sanitizeMetricKey = sanitizeMetricKey; -exports.sanitizeTags = sanitizeTags; -exports.sanitizeUnit = sanitizeUnit; -exports.serializeMetricBuckets = serializeMetricBuckets; -exports.simpleHash = simpleHash; -//# sourceMappingURL=utils.js.map +exports.count = count; +exports.distribution = distribution; +exports.gauge = gauge; +//# sourceMappingURL=public-api.js.map /***/ }), @@ -70792,77 +27778,52 @@ exports.simpleHash = simpleHash; /***/ 25750: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); -const logger = __nccwpck_require__(38752); +const debugLogger = __nccwpck_require__(41772); -function isProfilingIntegrationWithProfiler( - integration, -) { - return ( - !!integration && - typeof integration['_profiler'] !== 'undefined' && - typeof integration['_profiler']['start'] === 'function' && - typeof integration['_profiler']['stop'] === 'function' - ); +function isProfilingIntegrationWithProfiler(integration) { + return !!integration && typeof integration["_profiler"] !== "undefined" && typeof integration["_profiler"]["start"] === "function" && typeof integration["_profiler"]["stop"] === "function"; } -/** - * Starts the Sentry continuous profiler. - * This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value. - * In continuous profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application. - */ function startProfiler() { const client = currentScopes.getClient(); if (!client) { - debugBuild.DEBUG_BUILD && logger.logger.warn('No Sentry client available, profiling is not started'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No Sentry client available, profiling is not started"); return; } - - const integration = client.getIntegrationByName('ProfilingIntegration'); - + const integration = client.getIntegrationByName("ProfilingIntegration"); if (!integration) { - debugBuild.DEBUG_BUILD && logger.logger.warn('ProfilingIntegration is not available'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("ProfilingIntegration is not available"); return; } - if (!isProfilingIntegrationWithProfiler(integration)) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Profiler is not available on profiling integration.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Profiler is not available on profiling integration."); return; } - integration._profiler.start(); } - -/** - * Stops the Sentry continuous profiler. - * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry. - */ function stopProfiler() { const client = currentScopes.getClient(); if (!client) { - debugBuild.DEBUG_BUILD && logger.logger.warn('No Sentry client available, profiling is not started'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No Sentry client available, profiling is not started"); return; } - - const integration = client.getIntegrationByName('ProfilingIntegration'); + const integration = client.getIntegrationByName("ProfilingIntegration"); if (!integration) { - debugBuild.DEBUG_BUILD && logger.logger.warn('ProfilingIntegration is not available'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("ProfilingIntegration is not available"); return; } - if (!isProfilingIntegrationWithProfiler(integration)) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Profiler is not available on profiling integration.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Profiler is not available on profiling integration."); return; } - integration._profiler.stop(); } - const profiler = { startProfiler, - stopProfiler, + stopProfiler }; exports.profiler = profiler; @@ -70874,74 +27835,24 @@ exports.profiler = profiler; /***/ 49417: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const debugBuild = __nccwpck_require__(14488); const session = __nccwpck_require__(60233); -const is = __nccwpck_require__(84085); -const logger = __nccwpck_require__(38752); -const misc = __nccwpck_require__(3181); -const propagationContext = __nccwpck_require__(37264); -const time = __nccwpck_require__(75872); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); const merge = __nccwpck_require__(32003); +const misc = __nccwpck_require__(52619); +const propagationContext = __nccwpck_require__(95102); +const randomSafeContext = __nccwpck_require__(28695); const spanOnScope = __nccwpck_require__(14379); +const string = __nccwpck_require__(77673); +const time = __nccwpck_require__(66690); -/** - * Default value for maximum number of breadcrumbs added to an event. - */ const DEFAULT_MAX_BREADCRUMBS = 100; - -/** - * Holds additional event information. - */ -class ScopeClass { - /** Flag if notifying is happening. */ - - /** Callback for client to receive scope changes. */ - - /** Callback list that will be called during event processing. */ - - /** Array of breadcrumbs. */ - - /** User */ - - /** Tags */ - - /** Extra */ - - /** Contexts */ - - /** Attachments */ - - /** Propagation Context for distributed tracing */ - - /** - * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get - * sent to Sentry - */ - - /** Fingerprint */ - - /** Severity */ - - /** - * Transaction Name - * - * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects. - * It's purpose is to assign a transaction to the scope that's added to non-transaction events. - */ - - /** Session */ - - /** Request Mode Session Status */ - // eslint-disable-next-line deprecation/deprecation - - /** The client on this scope */ - - /** Contains the last event id of a captured event. */ - +class Scope { // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. - - constructor() { + constructor() { this._notifyingListeners = false; this._scopeListeners = []; this._eventProcessors = []; @@ -70949,198 +27860,236 @@ class ScopeClass { this._attachments = []; this._user = {}; this._tags = {}; + this._attributes = {}; this._extra = {}; this._contexts = {}; this._sdkProcessingMetadata = {}; this._propagationContext = { traceId: propagationContext.generateTraceId(), - spanId: propagationContext.generateSpanId(), + sampleRand: randomSafeContext.safeMathRandom() }; } - /** - * @inheritDoc + * Clone all data from this scope into a new scope. */ - clone() { - const newScope = new ScopeClass(); + clone() { + const newScope = new Scope(); newScope._breadcrumbs = [...this._breadcrumbs]; newScope._tags = { ...this._tags }; + newScope._attributes = { ...this._attributes }; newScope._extra = { ...this._extra }; newScope._contexts = { ...this._contexts }; if (this._contexts.flags) { - // We need to copy the `values` array so insertions on a cloned scope - // won't affect the original array. newScope._contexts.flags = { - values: [...this._contexts.flags.values], + values: [...this._contexts.flags.values] }; } - newScope._user = this._user; newScope._level = this._level; newScope._session = this._session; newScope._transactionName = this._transactionName; newScope._fingerprint = this._fingerprint; newScope._eventProcessors = [...this._eventProcessors]; - newScope._requestSession = this._requestSession; newScope._attachments = [...this._attachments]; newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata }; newScope._propagationContext = { ...this._propagationContext }; newScope._client = this._client; newScope._lastEventId = this._lastEventId; - + newScope._conversationId = this._conversationId; spanOnScope._setSpanForScope(newScope, spanOnScope._getSpanForScope(this)); - return newScope; } - /** - * @inheritDoc + * Update the client assigned to this scope. + * Note that not every scope will have a client assigned - isolation scopes & the global scope will generally not have a client, + * as well as manually created scopes. */ - setClient(client) { + setClient(client) { this._client = client; } - /** - * @inheritDoc + * Set the ID of the last captured error event. + * This is generally only captured on the isolation scope. */ - setLastEventId(lastEventId) { + setLastEventId(lastEventId) { this._lastEventId = lastEventId; } - /** - * @inheritDoc + * Get the client assigned to this scope. */ - getClient() { - return this._client ; + getClient() { + return this._client; } - /** - * @inheritDoc + * Get the ID of the last captured error event. + * This is generally only available on the isolation scope. */ - lastEventId() { + lastEventId() { return this._lastEventId; } - /** * @inheritDoc */ - addScopeListener(callback) { + addScopeListener(callback) { this._scopeListeners.push(callback); } - /** - * @inheritDoc + * Add an event processor that will be called before an event is sent. */ - addEventProcessor(callback) { + addEventProcessor(callback) { this._eventProcessors.push(callback); return this; } - /** - * @inheritDoc + * Set the user for this scope. + * Set to `null` to unset the user. */ - setUser(user) { - // If null is passed we want to unset everything, but still define keys, - // so that later down in the pipeline any existing values are cleared. + setUser(user) { this._user = user || { - email: undefined, - id: undefined, - ip_address: undefined, - username: undefined, + email: void 0, + id: void 0, + ip_address: void 0, + username: void 0 }; - if (this._session) { session.updateSession(this._session, { user }); } - this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Get the user from this scope. */ - getUser() { + getUser() { return this._user; } - /** - * @inheritDoc + * Set the conversation ID for this scope. + * Set to `null` to unset the conversation ID. */ - // eslint-disable-next-line deprecation/deprecation - getRequestSession() { - return this._requestSession; - } - - /** - * @inheritDoc - */ - // eslint-disable-next-line deprecation/deprecation - setRequestSession(requestSession) { - this._requestSession = requestSession; + setConversationId(conversationId) { + this._conversationId = conversationId || void 0; + this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Set an object that will be merged into existing tags on the scope, + * and will be sent as tags data with the event. */ - setTags(tags) { + setTags(tags) { this._tags = { ...this._tags, - ...tags, + ...tags }; this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Set a single tag that will be sent as tags data with the event. */ - setTag(key, value) { - this._tags = { ...this._tags, [key]: value }; + setTag(key, value) { + return this.setTags({ [key]: value }); + } + /** + * Sets attributes onto the scope. + * + * These attributes are applied to logs, metrics and streamed spans. + * + * Supported attribute value types are `string`, `number`, `boolean`, `string[]`, `number[]` and `boolean[]`. + * + * @param newAttributes - The attributes to set on the scope, as key-value pairs. + * + * @example + * ```typescript + * scope.setAttributes({ + * is_admin: true, + * payment_selection: 'credit_card', + * render_duration: 150, + * }); + * ``` + */ + setAttributes(newAttributes) { + this._attributes = { + ...this._attributes, + ...newAttributes + }; this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Sets an attribute onto the scope. + * + * These attributes are applied to logs, metrics and streamed spans. + * + * Supported attribute value types are `string`, `number`, `boolean`, `string[]`, `number[]` and `boolean[]`. + * + * @param key - The attribute key. + * @param value - The attribute value. + * + * @example + * ```typescript + * scope.setAttribute('is_admin', true); + * scope.setAttribute('render_duration', 150); + * ``` */ - setExtras(extras) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + setAttribute(key, value) { + return this.setAttributes({ [key]: value }); + } + /** + * Removes the attribute with the given key from the scope. + * + * @param key - The attribute key. + * + * @example + * ```typescript + * scope.removeAttribute('is_admin'); + * ``` + */ + removeAttribute(key) { + if (key in this._attributes) { + delete this._attributes[key]; + this._notifyScopeListeners(); + } + return this; + } + /** + * Set an object that will be merged into existing extra on the scope, + * and will be sent as extra data with the event. + */ + setExtras(extras) { this._extra = { ...this._extra, - ...extras, + ...extras }; this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Set a single key:value extra entry that will be sent as extra data with the event. */ - setExtra(key, extra) { + setExtra(key, extra) { this._extra = { ...this._extra, [key]: extra }; this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Sets the fingerprint on the scope to send with the events. + * @param {string[]} fingerprint Fingerprint to group events in Sentry. */ - setFingerprint(fingerprint) { + setFingerprint(fingerprint) { this._fingerprint = fingerprint; this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Sets the level on the scope for future events. */ - setLevel(level) { + setLevel(level) { this._level = level; this._notifyScopeListeners(); return this; } - /** * Sets the transaction name on the scope so that the name of e.g. taken server route or * the page location is attached to future events. @@ -71152,31 +28101,29 @@ class ScopeClass { * By default, the SDK updates the scope's transaction name automatically on sensible * occasions, such as a page navigation or when handling a new request on the server. */ - setTransactionName(name) { + setTransactionName(name) { this._transactionName = name; this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Sets context data with the given name. + * Data passed as context will be normalized. You can also pass `null` to unset the context. + * Note that context data will not be merged - calling `setContext` will overwrite an existing context with the same key. */ - setContext(key, context) { + setContext(key, context) { if (context === null) { - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete delete this._contexts[key]; } else { this._contexts[key] = context; } - this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Set the session for the scope. */ - setSession(session) { + setSession(session) { if (!session) { delete this._session; } else { @@ -71185,152 +28132,145 @@ class ScopeClass { this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Get the session from the scope. */ - getSession() { + getSession() { return this._session; } - /** - * @inheritDoc + * Updates the scope with provided data. Can work in three variations: + * - plain object containing updatable attributes + * - Scope instance that'll extract the attributes from + * - callback function that'll receive the current scope as an argument and allow for modifications */ - update(captureContext) { + update(captureContext) { if (!captureContext) { return this; } - - const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext; - - const [scopeInstance, requestSession] = - scopeToMerge instanceof Scope - ? // eslint-disable-next-line deprecation/deprecation - [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()] - : is.isPlainObject(scopeToMerge) - ? [captureContext , (captureContext ).requestSession] - : []; - - const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {}; - + const scopeToMerge = typeof captureContext === "function" ? captureContext(this) : captureContext; + const scopeInstance = scopeToMerge instanceof Scope ? scopeToMerge.getScopeData() : is.isPlainObject(scopeToMerge) ? captureContext : void 0; + const { + tags, + attributes, + extra, + user, + contexts, + level, + fingerprint = [], + propagationContext, + conversationId + } = scopeInstance || {}; this._tags = { ...this._tags, ...tags }; + this._attributes = { ...this._attributes, ...attributes }; this._extra = { ...this._extra, ...extra }; this._contexts = { ...this._contexts, ...contexts }; - if (user && Object.keys(user).length) { this._user = user; } - if (level) { this._level = level; } - if (fingerprint.length) { this._fingerprint = fingerprint; } - if (propagationContext) { this._propagationContext = propagationContext; } - - if (requestSession) { - this._requestSession = requestSession; + if (conversationId) { + this._conversationId = conversationId; } - return this; } - /** - * @inheritDoc + * Clears the current scope and resets its properties. + * Note: The client will not be cleared. + * + * @deprecated This method will be removed in v11. To reset scope state, re-initialize the SDK or run + * your code in a fresh scope via `withScope` instead. */ - clear() { - // client is not cleared here on purpose! + clear() { this._breadcrumbs = []; this._tags = {}; + this._attributes = {}; this._extra = {}; this._user = {}; this._contexts = {}; - this._level = undefined; - this._transactionName = undefined; - this._fingerprint = undefined; - this._requestSession = undefined; - this._session = undefined; - spanOnScope._setSpanForScope(this, undefined); + this._level = void 0; + this._transactionName = void 0; + this._fingerprint = void 0; + this._session = void 0; + this._conversationId = void 0; + spanOnScope._setSpanForScope(this, void 0); this._attachments = []; - this.setPropagationContext({ traceId: propagationContext.generateTraceId() }); - + this.setPropagationContext({ + traceId: propagationContext.generateTraceId(), + sampleRand: randomSafeContext.safeMathRandom() + }); this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Adds a breadcrumb to the scope. + * By default, the last 100 breadcrumbs are kept. */ - addBreadcrumb(breadcrumb, maxBreadcrumbs) { - const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; - - // No data has been changed, so don't notify scope listeners + addBreadcrumb(breadcrumb, maxBreadcrumbs) { + const maxCrumbs = typeof maxBreadcrumbs === "number" ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS; if (maxCrumbs <= 0) { return this; } - const mergedBreadcrumb = { timestamp: time.dateTimestampInSeconds(), ...breadcrumb, + // Breadcrumb messages can theoretically be infinitely large and they're held in memory so we truncate them not to leak (too much) memory + message: breadcrumb.message ? string.truncate(breadcrumb.message, 2048) : breadcrumb.message }; - this._breadcrumbs.push(mergedBreadcrumb); if (this._breadcrumbs.length > maxCrumbs) { this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs); - if (this._client) { - this._client.recordDroppedEvent('buffer_overflow', 'log_item'); - } + this._client?.recordDroppedEvent("buffer_overflow", "log_item"); } - this._notifyScopeListeners(); - return this; } - /** - * @inheritDoc + * Get the last breadcrumb of the scope. */ - getLastBreadcrumb() { + getLastBreadcrumb() { return this._breadcrumbs[this._breadcrumbs.length - 1]; } - /** - * @inheritDoc + * Clear all breadcrumbs from the scope. */ - clearBreadcrumbs() { + clearBreadcrumbs() { this._breadcrumbs = []; this._notifyScopeListeners(); return this; } - /** - * @inheritDoc + * Add an attachment to the scope. */ - addAttachment(attachment) { + addAttachment(attachment) { this._attachments.push(attachment); return this; } - /** - * @inheritDoc + * Clear all attachments from the scope. */ - clearAttachments() { + clearAttachments() { this._attachments = []; return this; } - - /** @inheritDoc */ - getScopeData() { + /** + * Get the data of this scope, which should be applied to an event during processing. + */ + getScopeData() { return { breadcrumbs: this._breadcrumbs, attachments: this._attachments, contexts: this._contexts, tags: this._tags, + attributes: this._attributes, extra: this._extra, user: this._user, level: this._level, @@ -71340,78 +28280,65 @@ class ScopeClass { sdkProcessingMetadata: this._sdkProcessingMetadata, transactionName: this._transactionName, span: spanOnScope._getSpanForScope(this), + conversationId: this._conversationId }; } - /** - * @inheritDoc + * Add data which will be accessible during event processing but won't get sent to Sentry. */ - setSDKProcessingMetadata(newData) { + setSDKProcessingMetadata(newData) { this._sdkProcessingMetadata = merge.merge(this._sdkProcessingMetadata, newData, 2); return this; } - /** - * @inheritDoc + * Add propagation context to the scope, used for distributed tracing */ - setPropagationContext( - context, - ) { - this._propagationContext = { - // eslint-disable-next-line deprecation/deprecation - spanId: propagationContext.generateSpanId(), - ...context, - }; + setPropagationContext(context) { + this._propagationContext = context; return this; } - /** - * @inheritDoc + * Get propagation context from the scope, used for distributed tracing */ - getPropagationContext() { + getPropagationContext() { return this._propagationContext; } - /** - * @inheritDoc + * Capture an exception for this scope. + * + * @returns {string} The id of the captured Sentry event. */ - captureException(exception, hint) { - const eventId = hint && hint.event_id ? hint.event_id : misc.uuid4(); - + captureException(exception, hint) { + const eventId = hint?.event_id || misc.uuid4(); if (!this._client) { - logger.logger.warn('No client configured on scope - will not capture exception!'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No client configured on scope - will not capture exception!"); return eventId; } - - const syntheticException = new Error('Sentry syntheticException'); - + const syntheticException = new Error("Sentry syntheticException"); this._client.captureException( exception, { originalException: exception, syntheticException, ...hint, - event_id: eventId, + event_id: eventId }, - this, + this ); - return eventId; } - /** - * @inheritDoc + * Capture a message for this scope. + * + * @returns {string} The id of the captured message. */ - captureMessage(message, level, hint) { - const eventId = hint && hint.event_id ? hint.event_id : misc.uuid4(); - + captureMessage(message, level, hint) { + const eventId = hint?.event_id || misc.uuid4(); if (!this._client) { - logger.logger.warn('No client configured on scope - will not capture message!'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No client configured on scope - will not capture message!"); return eventId; } - - const syntheticException = new Error(message); - + const syntheticException = hint?.syntheticException ?? new Error(message); this._client.captureMessage( message, level, @@ -71419,40 +28346,33 @@ class ScopeClass { originalException: message, syntheticException, ...hint, - event_id: eventId, + event_id: eventId }, - this, + this ); - return eventId; } - /** - * @inheritDoc + * Capture a Sentry event for this scope. + * + * @returns {string} The id of the captured event. */ - captureEvent(event, hint) { - const eventId = hint && hint.event_id ? hint.event_id : misc.uuid4(); - + captureEvent(event, hint) { + const eventId = event.event_id || hint?.event_id || misc.uuid4(); if (!this._client) { - logger.logger.warn('No client configured on scope - will not capture event!'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No client configured on scope - will not capture event!"); return eventId; } - this._client.captureEvent(event, { ...hint, event_id: eventId }, this); - return eventId; } - /** * This will be called on every set call. */ - _notifyScopeListeners() { - // We need this check for this._notifyingListeners to be able to work on scope during updates - // If this check is not here we'll produce endless recursion when something is done with the scope - // during the callback. + _notifyScopeListeners() { if (!this._notifyingListeners) { this._notifyingListeners = true; - this._scopeListeners.forEach(callback => { + this._scopeListeners.forEach((callback) => { callback(this); }); this._notifyingListeners = false; @@ -71460,15 +28380,6 @@ class ScopeClass { } } -/** - * Holds additional event information. - */ -const Scope = ScopeClass; - -/** - * Holds additional event information. - */ - exports.Scope = Scope; //# sourceMappingURL=scope.js.map @@ -71478,48 +28389,29 @@ exports.Scope = Scope; /***/ 6183: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); -const logger = __nccwpck_require__(38752); +const debugLogger = __nccwpck_require__(41772); -/** A class object that can instantiate Client objects. */ - -/** - * Internal function to create a new SDK client instance. The client is - * installed and then bound to the current scope. - * - * @param clientClass The client class to instantiate. - * @param options Options to pass to the client. - */ -function initAndBind( - clientClass, - options, -) { +function initAndBind(clientClass, options) { if (options.debug === true) { if (debugBuild.DEBUG_BUILD) { - logger.logger.enable(); + debugLogger.debug.enable(); } else { - // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped - logger.consoleSandbox(() => { - // eslint-disable-next-line no-console - console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); + debugLogger.consoleSandbox(() => { + console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."); }); } } const scope = currentScopes.getCurrentScope(); scope.update(options.initialScope); - const client = new clientClass(options); setCurrentClient(client); client.init(); return client; } - -/** - * Make the given client the current client. - */ function setCurrentClient(client) { currentScopes.getCurrentScope().setClient(client); } @@ -71534,65 +28426,40 @@ exports.setCurrentClient = setCurrentClient; /***/ 36827: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** - * Use this attribute to represent the source of a span. - * Should be one of: custom, url, route, view, component, task, unknown - * - */ -const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source'; - -/** - * Use this attribute to represent the sample rate used for a span. - */ -const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate'; - -/** - * Use this attribute to represent the operation of a span. - */ -const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op'; - -/** - * Use this attribute to represent the origin of a span. - */ -const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin'; - -/** The reason why an idle span finished. */ -const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason'; - -/** The unit of a measurement, which may be stored as a TimedEvent. */ -const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit'; - -/** The value of a measurement, which may be stored as a TimedEvent. */ -const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value'; - -/** - * A custom span name set by users guaranteed to be taken over any automatically - * inferred name. This attribute is removed before the span is sent. - * - * @internal only meant for internal SDK usage - * @hidden - */ -const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = 'sentry.custom_span_name'; - -/** - * The id of the profile that this span occurred in. - */ -const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id'; - -const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time'; - -const SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit'; - -const SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key'; - -const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size'; - -/** TODO: Remove these once we update to latest semantic conventions */ -const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = 'http.request.method'; -const SEMANTIC_ATTRIBUTE_URL_FULL = 'url.full'; +const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = "sentry.source"; +const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = "sentry.sample_rate"; +const SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = "sentry.previous_trace_sample_rate"; +const SEMANTIC_ATTRIBUTE_SENTRY_OP = "sentry.op"; +const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = "sentry.origin"; +const SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE = "sentry.status.message"; +const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = "sentry.idle_span_finish_reason"; +const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = "sentry.measurement_unit"; +const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = "sentry.measurement_value"; +const SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = "sentry.release"; +const SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = "sentry.environment"; +const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = "sentry.segment.name"; +const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = "sentry.segment.id"; +const SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = "sentry.sdk.name"; +const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = "sentry.sdk.version"; +const SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS = "sentry.sdk.integrations"; +const SEMANTIC_ATTRIBUTE_USER_ID = "user.id"; +const SEMANTIC_ATTRIBUTE_USER_EMAIL = "user.email"; +const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = "user.ip_address"; +const SEMANTIC_ATTRIBUTE_USER_USERNAME = "user.name"; +const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = "sentry.custom_span_name"; +const SEMANTIC_ATTRIBUTE_PROFILE_ID = "sentry.profile_id"; +const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = "sentry.exclusive_time"; +const SEMANTIC_ATTRIBUTE_CACHE_HIT = "cache.hit"; +const SEMANTIC_ATTRIBUTE_CACHE_KEY = "cache.key"; +const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = "cache.item_size"; +const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = "http.request.method"; +const SEMANTIC_ATTRIBUTE_URL_FULL = "url.full"; +const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = "sentry.link.type"; +const GEN_AI_CONVERSATION_ID_ATTRIBUTE = "gen_ai.conversation.id"; +exports.GEN_AI_CONVERSATION_ID_ATTRIBUTE = GEN_AI_CONVERSATION_ID_ATTRIBUTE; exports.SEMANTIC_ATTRIBUTE_CACHE_HIT = SEMANTIC_ATTRIBUTE_CACHE_HIT; exports.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE; exports.SEMANTIC_ATTRIBUTE_CACHE_KEY = SEMANTIC_ATTRIBUTE_CACHE_KEY; @@ -71600,14 +28467,28 @@ exports.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME; exports.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD; exports.SEMANTIC_ATTRIBUTE_PROFILE_ID = SEMANTIC_ATTRIBUTE_PROFILE_ID; exports.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME; +exports.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT; exports.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON; exports.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT; exports.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE; exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = SEMANTIC_ATTRIBUTE_SENTRY_OP; exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN; +exports.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = SEMANTIC_ATTRIBUTE_SENTRY_RELEASE; exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS = SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME; exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = SEMANTIC_ATTRIBUTE_SENTRY_SOURCE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE = SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE; exports.SEMANTIC_ATTRIBUTE_URL_FULL = SEMANTIC_ATTRIBUTE_URL_FULL; +exports.SEMANTIC_ATTRIBUTE_USER_EMAIL = SEMANTIC_ATTRIBUTE_USER_EMAIL; +exports.SEMANTIC_ATTRIBUTE_USER_ID = SEMANTIC_ATTRIBUTE_USER_ID; +exports.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS; +exports.SEMANTIC_ATTRIBUTE_USER_USERNAME = SEMANTIC_ATTRIBUTE_USER_USERNAME; +exports.SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE; //# sourceMappingURL=semanticAttributes.js.map @@ -71616,150 +28497,69 @@ exports.SEMANTIC_ATTRIBUTE_URL_FULL = SEMANTIC_ATTRIBUTE_URL_FULL; /***/ 37238: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const baseclient = __nccwpck_require__(95457); const checkin = __nccwpck_require__(54413); +const client = __nccwpck_require__(36316); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); -const sessionflusher = __nccwpck_require__(88971); -const errors = __nccwpck_require__(21834); -__nccwpck_require__(87038); -const logger = __nccwpck_require__(38752); -__nccwpck_require__(75872); -const spanOnScope = __nccwpck_require__(14379); -const spanUtils = __nccwpck_require__(47569); -const misc = __nccwpck_require__(3181); -const syncpromise = __nccwpck_require__(15621); -const eventbuilder = __nccwpck_require__(2781); -const dynamicSamplingContext = __nccwpck_require__(29724); - -/** - * The Sentry Server Runtime Client SDK. - */ -class ServerRuntimeClient - - extends baseclient.BaseClient { - // eslint-disable-next-line deprecation/deprecation +const spanStreaming = __nccwpck_require__(9869); +const base = __nccwpck_require__(24899); +const userAgent = __nccwpck_require__(54620); +const debugLogger = __nccwpck_require__(41772); +const eventbuilder = __nccwpck_require__(16273); +const misc = __nccwpck_require__(52619); +const promisebuffer = __nccwpck_require__(80503); +const syncpromise = __nccwpck_require__(56291); +const traceInfo = __nccwpck_require__(7535); +class ServerRuntimeClient extends client.Client { /** * Creates a new Edge SDK instance. * @param options Configuration options for this SDK. */ - constructor(options) { - // Server clients always support tracing - errors.registerSpanErrorInstrumentation(); - + constructor(options) { + userAgent.addUserAgentToTransportHeaders(options); + if (options.traceLifecycle === "stream" && !options.integrations.some((i) => i.name === "SpanStreaming")) { + options.integrations.push(spanStreaming.spanStreamingIntegration()); + } super(options); + this._disposeCallbacks = []; + this._setUpMetricsProcessing(); } - /** * @inheritDoc */ - eventFromException(exception, hint) { + eventFromException(exception, hint) { const event = eventbuilder.eventFromUnknownInput(this, this._options.stackParser, exception, hint); - event.level = 'error'; - + event.level = "error"; return syncpromise.resolvedSyncPromise(event); } - /** * @inheritDoc */ - eventFromMessage( - message, - level = 'info', - hint, - ) { + eventFromMessage(message, level = "info", hint) { return syncpromise.resolvedSyncPromise( - eventbuilder.eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace), + eventbuilder.eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace) ); } - /** * @inheritDoc */ - captureException(exception, hint, scope) { - // Check if `_sessionFlusher` exists because it is initialized (defined) only when the `autoSessionTracking` is enabled. - // The expectation is that session aggregates are only sent when `autoSessionTracking` is enabled. - // TODO(v9): Our goal in the future is to not have the `autoSessionTracking` option and instead rely on integrations doing the creation and sending of sessions. We will not have a central kill-switch for sessions. - // TODO(v9): This should move into the httpIntegration. - // eslint-disable-next-line deprecation/deprecation - if (this._options.autoSessionTracking && this._sessionFlusher) { - // eslint-disable-next-line deprecation/deprecation - const requestSession = currentScopes.getIsolationScope().getRequestSession(); - - // Necessary checks to ensure this is code block is executed only within a request - // Should override the status only if `requestSession.status` is `Ok`, which is its initial stage - if (requestSession && requestSession.status === 'ok') { - requestSession.status = 'errored'; - } - } - + captureException(exception, hint, scope) { + setCurrentRequestSessionErroredOrCrashed(hint); return super.captureException(exception, hint, scope); } - /** * @inheritDoc */ - captureEvent(event, hint, scope) { - // Check if `_sessionFlusher` exists because it is initialized only when the `autoSessionTracking` is enabled. - // The expectation is that session aggregates are only sent when `autoSessionTracking` is enabled. - // TODO(v9): Our goal in the future is to not have the `autoSessionTracking` option and instead rely on integrations doing the creation and sending of sessions. We will not have a central kill-switch for sessions. - // TODO(v9): This should move into the httpIntegration. - // eslint-disable-next-line deprecation/deprecation - if (this._options.autoSessionTracking && this._sessionFlusher) { - const eventType = event.type || 'exception'; - const isException = - eventType === 'exception' && event.exception && event.exception.values && event.exception.values.length > 0; - - // If the event is of type Exception, then a request session should be captured - if (isException) { - // eslint-disable-next-line deprecation/deprecation - const requestSession = currentScopes.getIsolationScope().getRequestSession(); - - // Ensure that this is happening within the bounds of a request, and make sure not to override - // Session Status if Errored / Crashed - if (requestSession && requestSession.status === 'ok') { - requestSession.status = 'errored'; - } - } + captureEvent(event, hint, scope) { + const isException = !event.type && event.exception?.values && event.exception.values.length > 0; + if (isException) { + setCurrentRequestSessionErroredOrCrashed(hint); } - return super.captureEvent(event, hint, scope); } - - /** - * - * @inheritdoc - */ - close(timeout) { - if (this._sessionFlusher) { - this._sessionFlusher.close(); - } - return super.close(timeout); - } - - /** - * Initializes an instance of SessionFlusher on the client which will aggregate and periodically flush session data. - * - * NOTICE: This method will implicitly create an interval that is periodically called. - * To clean up this resources, call `.close()` when you no longer intend to use the client. - * Not doing so will result in a memory leak. - */ - initSessionFlusher() { - const { release, environment } = this._options; - if (!release) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Cannot initialize an instance of SessionFlusher if no release is provided!'); - } else { - // eslint-disable-next-line deprecation/deprecation - this._sessionFlusher = new sessionflusher.SessionFlusher(this, { - release, - environment, - }); - } - } - /** * Create a cron monitor check in and send it to Sentry. * @@ -71767,28 +28567,24 @@ class ServerRuntimeClient * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want * to create a monitor automatically when sending a check in. */ - captureCheckIn(checkIn, monitorConfig, scope) { - const id = 'checkInId' in checkIn && checkIn.checkInId ? checkIn.checkInId : misc.uuid4(); + captureCheckIn(checkIn, monitorConfig, scope) { + const id = "checkInId" in checkIn && checkIn.checkInId ? checkIn.checkInId : misc.uuid4(); if (!this._isEnabled()) { - debugBuild.DEBUG_BUILD && logger.logger.warn('SDK not enabled, will not capture checkin.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("SDK not enabled, will not capture check-in."); return id; } - const options = this.getOptions(); const { release, environment, tunnel } = options; - const serializedCheckIn = { check_in_id: id, monitor_slug: checkIn.monitorSlug, status: checkIn.status, release, - environment, + environment }; - - if ('duration' in checkIn) { + if ("duration" in checkIn) { serializedCheckIn.duration = checkIn.duration; } - if (monitorConfig) { serializedCheckIn.monitor_config = { schedule: monitorConfig.schedule, @@ -71796,90 +28592,103 @@ class ServerRuntimeClient max_runtime: monitorConfig.maxRuntime, timezone: monitorConfig.timezone, failure_issue_threshold: monitorConfig.failureIssueThreshold, - recovery_threshold: monitorConfig.recoveryThreshold, + recovery_threshold: monitorConfig.recoveryThreshold }; } - - const [dynamicSamplingContext, traceContext] = this._getTraceInfoFromScope(scope); + const [dynamicSamplingContext, traceContext] = traceInfo._getTraceInfoFromScope(this, scope); if (traceContext) { serializedCheckIn.contexts = { - trace: traceContext, + trace: traceContext }; } - const envelope = checkin.createCheckInEnvelope( serializedCheckIn, dynamicSamplingContext, this.getSdkMetadata(), tunnel, - this.getDsn(), + this.getDsn() ); - - debugBuild.DEBUG_BUILD && logger.logger.info('Sending checkin:', checkIn.monitorSlug, checkIn.status); - - // sendEnvelope should not throw - // eslint-disable-next-line @typescript-eslint/no-floating-promises + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Sending checkin:", checkIn.monitorSlug, checkIn.status); this.sendEnvelope(envelope); - return id; } - - /** - * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment - * appropriate session aggregates bucket - * - * @deprecated This method should not be used or extended. It's functionality will move into the `httpIntegration` and not be part of any public API. - */ - _captureRequestSession() { - if (!this._sessionFlusher) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Discarded request mode session because autoSessionTracking option was disabled'); - } else { - this._sessionFlusher.incrementSessionStatusCount(); - } - } - /** * @inheritDoc */ - _prepareEvent( - event, - hint, - scope, - isolationScope, - ) { + registerCleanup(callback) { + this._disposeCallbacks.push(callback); + } + /** + * Disposes of the client and releases all resources. + * + * This method clears all internal state to allow the client to be garbage collected. + * It clears hooks, event processors, integrations, transport, and other internal references. + * + * Call this method after flushing to allow the client to be garbage collected. + * After calling dispose(), the client should not be used anymore. + * + * Subclasses should override this method to clean up their own resources and call `super.dispose()`. + */ + dispose() { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Disposing client..."); + for (const callback of this._disposeCallbacks) { + try { + callback(); + } catch { + } + } + this._disposeCallbacks.length = 0; + for (const hookName of Object.keys(this._hooks)) { + this._hooks[hookName]?.clear(); + } + this._hooks = {}; + this._eventProcessors.length = 0; + this._integrations = {}; + this._outcomes = {}; + this._transport = void 0; + this._promiseBuffer = promisebuffer.makePromiseBuffer(base.DEFAULT_TRANSPORT_BUFFER_SIZE); + } + /** + * @inheritDoc + */ + _prepareEvent(event, hint, currentScope, isolationScope) { if (this._options.platform) { event.platform = event.platform || this._options.platform; } - if (this._options.runtime) { event.contexts = { ...event.contexts, - runtime: (event.contexts || {}).runtime || this._options.runtime, + runtime: event.contexts?.runtime || this._options.runtime }; } - if (this._options.serverName) { event.server_name = event.server_name || this._options.serverName; } - - return super._prepareEvent(event, hint, scope, isolationScope); + return super._prepareEvent(event, hint, currentScope, isolationScope); } - - /** Extract trace information from scope */ - _getTraceInfoFromScope( - scope, - ) { - if (!scope) { - return [undefined, undefined]; + /** + * Process a server-side metric before it is captured. + */ + _setUpMetricsProcessing() { + this.on("processMetric", (metric) => { + if (this._options.serverName) { + metric.attributes = { + "server.address": this._options.serverName, + ...metric.attributes + }; + } + }); + } +} +function setCurrentRequestSessionErroredOrCrashed(eventHint) { + const requestSession = currentScopes.getIsolationScope().getScopeData().sdkProcessingMetadata.requestSession; + if (requestSession) { + const isHandledException = eventHint?.mechanism?.handled ?? true; + if (isHandledException && requestSession.status !== "crashed") { + requestSession.status = "errored"; + } else if (!isHandledException) { + requestSession.status = "crashed"; } - - const span = spanOnScope._getSpanForScope(scope); - - const traceContext = span ? spanUtils.spanToTraceContext(span) : currentScopes.getTraceContextFromScope(scope); - const dynamicSamplingContext$1 = span - ? dynamicSamplingContext.getDynamicSamplingContextFromSpan(span) - : dynamicSamplingContext.getDynamicSamplingContextFromScope(this, scope); - return [dynamicSamplingContext$1, traceContext]; } } @@ -71892,94 +28701,60 @@ exports.ServerRuntimeClient = ServerRuntimeClient; /***/ 60233: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -__nccwpck_require__(87038); -__nccwpck_require__(38752); -const object = __nccwpck_require__(16100); -const time = __nccwpck_require__(75872); -const misc = __nccwpck_require__(3181); -__nccwpck_require__(15621); +const misc = __nccwpck_require__(52619); +const time = __nccwpck_require__(66690); -/** - * Creates a new `Session` object by setting certain default parameters. If optional @param context - * is passed, the passed properties are applied to the session object. - * - * @param context (optional) additional properties to be applied to the returned session object - * - * @returns a new `Session` object - */ function makeSession(context) { - // Both timestamp and started are in seconds since the UNIX epoch. const startingTime = time.timestampInSeconds(); - const session = { sid: misc.uuid4(), init: true, timestamp: startingTime, started: startingTime, duration: 0, - status: 'ok', + status: "ok", errors: 0, ignoreDuration: false, - toJSON: () => sessionToJSON(session), + toJSON: () => sessionToJSON(session) }; - if (context) { updateSession(session, context); } - return session; } - -/** - * Updates a session object with the properties passed in the context. - * - * Note that this function mutates the passed object and returns void. - * (Had to do this instead of returning a new and updated session because closing and sending a session - * makes an update to the session after it was passed to the sending logic. - * @see BaseClient.captureSession ) - * - * @param session the `Session` to update - * @param context the `SessionContext` holding the properties that should be updated in @param session - */ -// eslint-disable-next-line complexity function updateSession(session, context = {}) { if (context.user) { if (!session.ipAddress && context.user.ip_address) { session.ipAddress = context.user.ip_address; } - if (!session.did && !context.did) { session.did = context.user.id || context.user.email || context.user.username; } } - session.timestamp = context.timestamp || time.timestampInSeconds(); - if (context.abnormal_mechanism) { session.abnormal_mechanism = context.abnormal_mechanism; } - if (context.ignoreDuration) { session.ignoreDuration = context.ignoreDuration; } if (context.sid) { - // Good enough uuid validation. — Kamil session.sid = context.sid.length === 32 ? context.sid : misc.uuid4(); } - if (context.init !== undefined) { + if (context.init !== void 0) { session.init = context.init; } if (!session.did && context.did) { session.did = `${context.did}`; } - if (typeof context.started === 'number') { + if (typeof context.started === "number") { session.started = context.started; } if (session.ignoreDuration) { - session.duration = undefined; - } else if (typeof context.duration === 'number') { + session.duration = void 0; + } else if (typeof context.duration === "number") { session.duration = context.duration; } else { const duration = session.timestamp - session.started; @@ -71997,64 +28772,41 @@ function updateSession(session, context = {}) { if (!session.userAgent && context.userAgent) { session.userAgent = context.userAgent; } - if (typeof context.errors === 'number') { + if (typeof context.errors === "number") { session.errors = context.errors; } if (context.status) { session.status = context.status; } } - -/** - * Closes a session by setting its status and updating the session object with it. - * Internally calls `updateSession` to update the passed session object. - * - * Note that this function mutates the passed session (@see updateSession for explanation). - * - * @param session the `Session` object to be closed - * @param status the `SessionStatus` with which the session was closed. If you don't pass a status, - * this function will keep the previously set status, unless it was `'ok'` in which case - * it is changed to `'exited'`. - */ function closeSession(session, status) { let context = {}; if (status) { context = { status }; - } else if (session.status === 'ok') { - context = { status: 'exited' }; + } else if (session.status === "ok") { + context = { status: "exited" }; } - updateSession(session, context); } - -/** - * Serializes a passed session object to a JSON object with a slightly different structure. - * This is necessary because the Sentry backend requires a slightly different schema of a session - * than the one the JS SDKs use internally. - * - * @param session the session to be converted - * - * @returns a JSON object of the passed session - */ function sessionToJSON(session) { - return object.dropUndefinedKeys({ + return { sid: `${session.sid}`, init: session.init, // Make sure that sec is converted to ms for date constructor - started: new Date(session.started * 1000).toISOString(), - timestamp: new Date(session.timestamp * 1000).toISOString(), + started: new Date(session.started * 1e3).toISOString(), + timestamp: new Date(session.timestamp * 1e3).toISOString(), status: session.status, errors: session.errors, - did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined, + did: typeof session.did === "number" || typeof session.did === "string" ? `${session.did}` : void 0, duration: session.duration, abnormal_mechanism: session.abnormal_mechanism, attrs: { release: session.release, environment: session.environment, ip_address: session.ipAddress, - user_agent: session.userAgent, - }, - }); + user_agent: session.userAgent + } + }; } exports.closeSession = closeSession; @@ -72065,121 +28817,1295 @@ exports.updateSession = updateSession; /***/ }), -/***/ 88971: +/***/ 14516: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const SPAN_KIND = { + INTERNAL: 0, + SERVER: 1, + CLIENT: 2, + PRODUCER: 3, + CONSUMER: 4 +}; +const SPAN_KIND_NAME = { + [SPAN_KIND.INTERNAL]: "INTERNAL", + [SPAN_KIND.SERVER]: "SERVER", + [SPAN_KIND.CLIENT]: "CLIENT", + [SPAN_KIND.PRODUCER]: "PRODUCER", + [SPAN_KIND.CONSUMER]: "CONSUMER" +}; +function spanKindToName(kind) { + return SPAN_KIND_NAME[kind]; +} + +exports.SPAN_KIND = SPAN_KIND; +exports.spanKindToName = spanKindToName; +//# sourceMappingURL=spanKind.js.map + + +/***/ }), + +/***/ 53989: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const GEN_AI_PROMPT_ATTRIBUTE = "gen_ai.prompt"; +const GEN_AI_SYSTEM_ATTRIBUTE = "gen_ai.system"; +const GEN_AI_REQUEST_MODEL_ATTRIBUTE = "gen_ai.request.model"; +const GEN_AI_REQUEST_STREAM_ATTRIBUTE = "gen_ai.request.stream"; +const GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE = "gen_ai.request.temperature"; +const GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE = "gen_ai.request.max_tokens"; +const GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE = "gen_ai.request.frequency_penalty"; +const GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE = "gen_ai.request.presence_penalty"; +const GEN_AI_REQUEST_TOP_P_ATTRIBUTE = "gen_ai.request.top_p"; +const GEN_AI_REQUEST_TOP_K_ATTRIBUTE = "gen_ai.request.top_k"; +const GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE = "gen_ai.request.encoding_format"; +const GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE = "gen_ai.request.dimensions"; +const GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE = "gen_ai.response.finish_reasons"; +const GEN_AI_RESPONSE_MODEL_ATTRIBUTE = "gen_ai.response.model"; +const GEN_AI_RESPONSE_ID_ATTRIBUTE = "gen_ai.response.id"; +const GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE = "gen_ai.response.stop_reason"; +const GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE = "gen_ai.usage.input_tokens"; +const GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE = "gen_ai.usage.output_tokens"; +const GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE = "gen_ai.usage.total_tokens"; +const GEN_AI_OPERATION_NAME_ATTRIBUTE = "gen_ai.operation.name"; +const GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE = "sentry.sdk_meta.gen_ai.input.messages.original_length"; +const GEN_AI_INPUT_MESSAGES_ATTRIBUTE = "gen_ai.input.messages"; +const GEN_AI_OUTPUT_MESSAGES_ATTRIBUTE = "gen_ai.output.messages"; +const GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE = "gen_ai.system_instructions"; +const GEN_AI_RESPONSE_TEXT_ATTRIBUTE = "gen_ai.response.text"; +const GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE = "gen_ai.request.available_tools"; +const GEN_AI_RESPONSE_STREAMING_ATTRIBUTE = "gen_ai.response.streaming"; +const GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = "gen_ai.response.tool_calls"; +const GEN_AI_AGENT_NAME_ATTRIBUTE = "gen_ai.agent.name"; +const GEN_AI_PIPELINE_NAME_ATTRIBUTE = "gen_ai.pipeline.name"; +const GEN_AI_CONVERSATION_ID_ATTRIBUTE = "gen_ai.conversation.id"; +const GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE = "gen_ai.usage.cache_creation_input_tokens"; +const GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE = "gen_ai.usage.cache_read_input_tokens"; +const GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE = "gen_ai.usage.input_tokens.cache_write"; +const GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE = "gen_ai.usage.input_tokens.cached"; +const GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE = "gen_ai.invoke_agent"; +const GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE = "gen_ai.embeddings.input"; +const GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE = "gen_ai.embeddings"; +const GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE = "gen_ai.execute_tool"; +const GEN_AI_TOOL_NAME_ATTRIBUTE = "gen_ai.tool.name"; +const GEN_AI_TOOL_CALL_ID_ATTRIBUTE = "gen_ai.tool.call.id"; +const GEN_AI_TOOL_TYPE_ATTRIBUTE = "gen_ai.tool.type"; +const GEN_AI_TOOL_INPUT_ATTRIBUTE = "gen_ai.tool.input"; +const GEN_AI_TOOL_OUTPUT_ATTRIBUTE = "gen_ai.tool.output"; +const GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE = "gen_ai.tool.description"; + +exports.GEN_AI_AGENT_NAME_ATTRIBUTE = GEN_AI_AGENT_NAME_ATTRIBUTE; +exports.GEN_AI_CONVERSATION_ID_ATTRIBUTE = GEN_AI_CONVERSATION_ID_ATTRIBUTE; +exports.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE = GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE; +exports.GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE = GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE; +exports.GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE = GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE; +exports.GEN_AI_INPUT_MESSAGES_ATTRIBUTE = GEN_AI_INPUT_MESSAGES_ATTRIBUTE; +exports.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE = GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE; +exports.GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE = GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE; +exports.GEN_AI_OPERATION_NAME_ATTRIBUTE = GEN_AI_OPERATION_NAME_ATTRIBUTE; +exports.GEN_AI_OUTPUT_MESSAGES_ATTRIBUTE = GEN_AI_OUTPUT_MESSAGES_ATTRIBUTE; +exports.GEN_AI_PIPELINE_NAME_ATTRIBUTE = GEN_AI_PIPELINE_NAME_ATTRIBUTE; +exports.GEN_AI_PROMPT_ATTRIBUTE = GEN_AI_PROMPT_ATTRIBUTE; +exports.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE = GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE; +exports.GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE = GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE; +exports.GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE = GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE; +exports.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE = GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE; +exports.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE = GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE; +exports.GEN_AI_REQUEST_MODEL_ATTRIBUTE = GEN_AI_REQUEST_MODEL_ATTRIBUTE; +exports.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE = GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE; +exports.GEN_AI_REQUEST_STREAM_ATTRIBUTE = GEN_AI_REQUEST_STREAM_ATTRIBUTE; +exports.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE = GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE; +exports.GEN_AI_REQUEST_TOP_K_ATTRIBUTE = GEN_AI_REQUEST_TOP_K_ATTRIBUTE; +exports.GEN_AI_REQUEST_TOP_P_ATTRIBUTE = GEN_AI_REQUEST_TOP_P_ATTRIBUTE; +exports.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE = GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE; +exports.GEN_AI_RESPONSE_ID_ATTRIBUTE = GEN_AI_RESPONSE_ID_ATTRIBUTE; +exports.GEN_AI_RESPONSE_MODEL_ATTRIBUTE = GEN_AI_RESPONSE_MODEL_ATTRIBUTE; +exports.GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE = GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE; +exports.GEN_AI_RESPONSE_STREAMING_ATTRIBUTE = GEN_AI_RESPONSE_STREAMING_ATTRIBUTE; +exports.GEN_AI_RESPONSE_TEXT_ATTRIBUTE = GEN_AI_RESPONSE_TEXT_ATTRIBUTE; +exports.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE; +exports.GEN_AI_SYSTEM_ATTRIBUTE = GEN_AI_SYSTEM_ATTRIBUTE; +exports.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE = GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE; +exports.GEN_AI_TOOL_CALL_ID_ATTRIBUTE = GEN_AI_TOOL_CALL_ID_ATTRIBUTE; +exports.GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE = GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE; +exports.GEN_AI_TOOL_INPUT_ATTRIBUTE = GEN_AI_TOOL_INPUT_ATTRIBUTE; +exports.GEN_AI_TOOL_NAME_ATTRIBUTE = GEN_AI_TOOL_NAME_ATTRIBUTE; +exports.GEN_AI_TOOL_OUTPUT_ATTRIBUTE = GEN_AI_TOOL_OUTPUT_ATTRIBUTE; +exports.GEN_AI_TOOL_TYPE_ATTRIBUTE = GEN_AI_TOOL_TYPE_ATTRIBUTE; +exports.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE = GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE; +exports.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE = GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE; +exports.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE = GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE; +exports.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE = GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE; +exports.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE = GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE; +exports.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE = GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE; +exports.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE = GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE; +//# sourceMappingURL=gen-ai-attributes.js.map + + +/***/ }), + +/***/ 91604: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function isContentMedia(part) { + if (!part || typeof part !== "object") return false; + return isContentMediaSource(part) || hasInlineData(part) || hasImageUrl(part) || hasInputAudio(part) || hasFileData(part) || hasMediaTypeData(part) || hasVercelFileData(part) || hasVercelImageData(part) || hasBlobOrBase64Type(part) || hasB64Json(part) || hasImageGenerationResult(part) || hasDataUri(part); +} +function hasImageUrl(part) { + if (!("image_url" in part)) return false; + if (typeof part.image_url === "string") return part.image_url.startsWith("data:"); + return hasNestedImageUrl(part); +} +function hasNestedImageUrl(part) { + return "image_url" in part && !!part.image_url && typeof part.image_url === "object" && "url" in part.image_url && typeof part.image_url.url === "string" && part.image_url.url.startsWith("data:"); +} +function isContentMediaSource(part) { + return "type" in part && typeof part.type === "string" && "source" in part && isContentMedia(part.source); +} +function hasInlineData(part) { + return "inlineData" in part && !!part.inlineData && typeof part.inlineData === "object" && "data" in part.inlineData && typeof part.inlineData.data === "string"; +} +function hasInputAudio(part) { + return "type" in part && part.type === "input_audio" && "input_audio" in part && !!part.input_audio && typeof part.input_audio === "object" && "data" in part.input_audio && typeof part.input_audio.data === "string"; +} +function hasFileData(part) { + return "type" in part && part.type === "file" && "file" in part && !!part.file && typeof part.file === "object" && "file_data" in part.file && typeof part.file.file_data === "string"; +} +function hasMediaTypeData(part) { + return "media_type" in part && typeof part.media_type === "string" && "data" in part; +} +function hasVercelFileData(part) { + return "type" in part && part.type === "file" && "mediaType" in part && typeof part.mediaType === "string" && "data" in part && typeof part.data === "string" && // Only strip base64/binary data, not HTTP/HTTPS URLs which should be preserved as references + !part.data.startsWith("http://") && !part.data.startsWith("https://"); +} +function hasVercelImageData(part) { + return "type" in part && part.type === "image" && "image" in part && typeof part.image === "string" && // Only strip base64/data URIs, not HTTP/HTTPS URLs which should be preserved as references + !part.image.startsWith("http://") && !part.image.startsWith("https://"); +} +function hasBlobOrBase64Type(part) { + return "type" in part && (part.type === "blob" || part.type === "base64"); +} +function hasB64Json(part) { + return "b64_json" in part; +} +function hasImageGenerationResult(part) { + return "type" in part && "result" in part && part.type === "image_generation"; +} +function hasDataUri(part) { + return "uri" in part && typeof part.uri === "string" && part.uri.startsWith("data:"); +} +const REMOVED_STRING = "[Blob substitute]"; +const MEDIA_FIELDS = ["image_url", "data", "content", "b64_json", "result", "uri", "image"]; +function stripInlineMediaFromSingleMessage(part) { + const strip = { ...part }; + if (isContentMedia(strip.source)) { + strip.source = stripInlineMediaFromSingleMessage(strip.source); + } + if (hasInlineData(part)) { + strip.inlineData = { ...part.inlineData, data: REMOVED_STRING }; + } + if (hasNestedImageUrl(part)) { + strip.image_url = { ...part.image_url, url: REMOVED_STRING }; + } + if (hasInputAudio(part)) { + strip.input_audio = { ...part.input_audio, data: REMOVED_STRING }; + } + if (hasFileData(part)) { + strip.file = { ...part.file, file_data: REMOVED_STRING }; + } + for (const field of MEDIA_FIELDS) { + if (typeof strip[field] === "string") strip[field] = REMOVED_STRING; + } + return strip; +} + +exports.isContentMedia = isContentMedia; +exports.stripInlineMediaFromSingleMessage = stripInlineMediaFromSingleMessage; +//# sourceMappingURL=mediaStripping.js.map + + +/***/ }), + +/***/ 18368: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const mediaStripping = __nccwpck_require__(91604); + +const DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT = 2e4; +const utf8Bytes = (text) => { + return new TextEncoder().encode(text).length; +}; +const jsonBytes = (value) => { + return utf8Bytes(JSON.stringify(value)); +}; +function truncateTextByBytes(text, maxBytes) { + if (utf8Bytes(text) <= maxBytes) { + return text; + } + let low = 0; + let high = text.length; + let bestFit = ""; + while (low <= high) { + const mid = Math.floor((low + high) / 2); + const candidate = text.slice(0, mid); + const byteSize = utf8Bytes(candidate); + if (byteSize <= maxBytes) { + bestFit = candidate; + low = mid + 1; + } else { + high = mid - 1; + } + } + return bestFit; +} +function getItemText(item) { + if (typeof item === "string") { + return item; + } + if ("text" in item && typeof item.text === "string") { + return item.text; + } + return ""; +} +function withItemText(item, text) { + if (typeof item === "string") { + return text; + } + return { ...item, text }; +} +function isContentMessage(message) { + return message !== null && typeof message === "object" && "content" in message && typeof message.content === "string"; +} +function isContentArrayMessage(message) { + return message !== null && typeof message === "object" && "content" in message && Array.isArray(message.content); +} +function isPartsMessage(message) { + return message !== null && typeof message === "object" && "parts" in message && Array.isArray(message.parts) && message.parts.length > 0; +} +function truncateContentMessage(message, maxBytes) { + const emptyMessage = { ...message, content: "" }; + const overhead = jsonBytes(emptyMessage); + const availableForContent = maxBytes - overhead; + if (availableForContent <= 0) { + return []; + } + const truncatedContent = truncateTextByBytes(message.content, availableForContent); + return [{ ...message, content: truncatedContent }]; +} +function getArrayItems(message) { + if ("parts" in message && Array.isArray(message.parts)) { + return { key: "parts", items: message.parts }; + } + if ("content" in message && Array.isArray(message.content)) { + return { key: "content", items: message.content }; + } + return { key: null, items: [] }; +} +function truncateArrayMessage(message, maxBytes) { + const { key, items } = getArrayItems(message); + if (key === null || items.length === 0) { + return []; + } + const emptyItems = items.map((item) => withItemText(item, "")); + const overhead = jsonBytes({ ...message, [key]: emptyItems }); + let remainingBytes = maxBytes - overhead; + if (remainingBytes <= 0) { + return []; + } + const includedItems = []; + for (const item of items) { + const text = getItemText(item); + const textSize = utf8Bytes(text); + if (textSize <= remainingBytes) { + includedItems.push(item); + remainingBytes -= textSize; + } else if (includedItems.length === 0) { + const truncated = truncateTextByBytes(text, remainingBytes); + if (truncated) { + includedItems.push(withItemText(item, truncated)); + } + break; + } else { + break; + } + } + if (includedItems.length <= 0) { + return []; + } else { + return [{ ...message, [key]: includedItems }]; + } +} +function truncateSingleMessage(message, maxBytes) { + if (!message) return []; + if (typeof message === "string") { + const truncated = truncateTextByBytes(message, maxBytes); + return truncated ? [truncated] : []; + } + if (typeof message !== "object") { + return []; + } + if (isContentMessage(message)) { + return truncateContentMessage(message, maxBytes); + } + if (isContentArrayMessage(message) || isPartsMessage(message)) { + return truncateArrayMessage(message, maxBytes); + } + return []; +} +function stripInlineMediaFromMessages(messages) { + const stripped = messages.map((message) => { + let newMessage = void 0; + if (!!message && typeof message === "object") { + if (isContentArrayMessage(message)) { + newMessage = { + ...message, + content: stripInlineMediaFromMessages(message.content) + }; + } else if ("content" in message && mediaStripping.isContentMedia(message.content)) { + newMessage = { + ...message, + content: mediaStripping.stripInlineMediaFromSingleMessage(message.content) + }; + } + if (isPartsMessage(message)) { + newMessage = { + // might have to strip content AND parts + ...newMessage ?? message, + parts: stripInlineMediaFromMessages(message.parts) + }; + } + if (mediaStripping.isContentMedia(newMessage)) { + newMessage = mediaStripping.stripInlineMediaFromSingleMessage(newMessage); + } else if (mediaStripping.isContentMedia(message)) { + newMessage = mediaStripping.stripInlineMediaFromSingleMessage(message); + } + } + return newMessage ?? message; + }); + return stripped; +} +function truncateMessagesByBytes(messages, maxBytes) { + if (!Array.isArray(messages) || messages.length === 0) { + return messages; + } + const effectiveMaxBytes = maxBytes - 2; + const lastMessage = messages[messages.length - 1]; + const stripped = stripInlineMediaFromMessages([lastMessage]); + const strippedMessage = stripped[0]; + const messageBytes = jsonBytes(strippedMessage); + if (messageBytes <= effectiveMaxBytes) { + return stripped; + } + return truncateSingleMessage(strippedMessage, effectiveMaxBytes); +} +function truncateGenAiMessages(messages) { + return truncateMessagesByBytes(messages, DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT); +} +function truncateGenAiStringInput(input) { + return truncateTextByBytes(input, DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT); +} + +exports.DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT = DEFAULT_GEN_AI_MESSAGES_BYTE_LIMIT; +exports.truncateGenAiMessages = truncateGenAiMessages; +exports.truncateGenAiStringInput = truncateGenAiStringInput; +//# sourceMappingURL=messageTruncation.js.map + + +/***/ }), + +/***/ 78481: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); const currentScopes = __nccwpck_require__(8131); -const object = __nccwpck_require__(16100); +const hasSpanStreamingEnabled = __nccwpck_require__(73642); +const is = __nccwpck_require__(68370); +const genAiAttributes = __nccwpck_require__(53989); +const messageTruncation = __nccwpck_require__(18368); -/** - * @deprecated `SessionFlusher` is deprecated and will be removed in the next major version of the SDK. - */ -// TODO(v9): The goal for the SessionFlusher is to become a stupidly simple mechanism to aggregate "Sessions" (actually "RequestSessions"). It should probably live directly inside the Http integration/instrumentation. -// eslint-disable-next-line deprecation/deprecation -class SessionFlusher { - - // We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer - - constructor(client, attrs) { - this._client = client; - this.flushTimeout = 60; - this._pendingAggregates = new Map(); - this._isEnabled = true; - - // Call to setInterval, so that flush is called every 60 seconds. - this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000); - if (this._intervalId.unref) { - this._intervalId.unref(); - } - this._sessionAttrs = attrs; +function resolveAIRecordingOptions(options) { + const genAI = currentScopes.getClient()?.getDataCollectionOptions().genAI; + return { + ...options, + recordInputs: options?.recordInputs ?? genAI?.inputs ?? false, + recordOutputs: options?.recordOutputs ?? genAI?.outputs ?? false + }; +} +function shouldEnableTruncation(enableTruncation) { + if (enableTruncation !== void 0) { + return enableTruncation; } - - /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */ - flush() { - const sessionAggregates = this.getSessionAggregates(); - if (sessionAggregates.aggregates.length === 0) { - return; - } - this._pendingAggregates = new Map(); - this._client.sendSession(sessionAggregates); + const client = currentScopes.getClient(); + if (!client) { + return true; } - - /** Massages the entries in `pendingAggregates` and returns aggregated sessions */ - getSessionAggregates() { - const aggregates = Array.from(this._pendingAggregates.values()); - - const sessionAggregates = { - attrs: this._sessionAttrs, - aggregates, + return !hasSpanStreamingEnabled.hasSpanStreamingEnabled(client) && client.getOptions().streamGenAiSpans === false; +} +function buildMethodPath(currentPath, prop) { + return currentPath ? `${currentPath}.${prop}` : prop; +} +function setTokenUsageAttributes(span, promptTokens, completionTokens, cachedInputTokens, cachedOutputTokens) { + if (promptTokens !== void 0) { + span.setAttributes({ + [genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]: promptTokens + }); + } + if (completionTokens !== void 0) { + span.setAttributes({ + [genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]: completionTokens + }); + } + if (promptTokens !== void 0 || completionTokens !== void 0 || cachedInputTokens !== void 0 || cachedOutputTokens !== void 0) { + const totalTokens = (promptTokens ?? 0) + (completionTokens ?? 0) + (cachedInputTokens ?? 0) + (cachedOutputTokens ?? 0); + span.setAttributes({ + [genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]: totalTokens + }); + } +} +function endStreamSpan(span, state, recordOutputs) { + if (!span.isRecording()) { + return; + } + const attrs = { + [genAiAttributes.GEN_AI_RESPONSE_STREAMING_ATTRIBUTE]: true + }; + if (state.responseId) attrs[genAiAttributes.GEN_AI_RESPONSE_ID_ATTRIBUTE] = state.responseId; + if (state.responseModel) attrs[genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE] = state.responseModel; + if (state.promptTokens !== void 0) attrs[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] = state.promptTokens; + if (state.completionTokens !== void 0) attrs[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] = state.completionTokens; + if (state.totalTokens !== void 0) { + attrs[genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE] = state.totalTokens; + } else if (state.promptTokens !== void 0 || state.completionTokens !== void 0 || state.cacheCreationInputTokens !== void 0 || state.cacheReadInputTokens !== void 0) { + attrs[genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE] = (state.promptTokens ?? 0) + (state.completionTokens ?? 0) + (state.cacheCreationInputTokens ?? 0) + (state.cacheReadInputTokens ?? 0); + } + if (state.finishReasons.length) { + attrs[genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE] = JSON.stringify(state.finishReasons); + } + if (recordOutputs && state.responseTexts.length) { + attrs[genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE] = state.responseTexts.join(""); + } + if (recordOutputs && state.toolCalls.length) { + attrs[genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE] = JSON.stringify(state.toolCalls); + } + span.setAttributes(attrs); + span.end(); +} +function getTruncatedJsonString(value) { + if (typeof value === "string") { + return messageTruncation.truncateGenAiStringInput(value); + } + try { + return JSON.stringify(Array.isArray(value) ? messageTruncation.truncateGenAiMessages(value) : value); + } catch { + return "[unserializable]"; + } +} +function extractSystemInstructions(messages) { + if (!Array.isArray(messages)) { + return { systemInstructions: void 0, filteredMessages: messages }; + } + const systemMessageIndex = messages.findIndex( + (msg) => msg && typeof msg === "object" && "role" in msg && msg.role === "system" + ); + if (systemMessageIndex === -1) { + return { systemInstructions: void 0, filteredMessages: messages }; + } + const systemMessage = messages[systemMessageIndex]; + const systemContent = typeof systemMessage.content === "string" ? systemMessage.content : systemMessage.content !== void 0 ? JSON.stringify(systemMessage.content) : void 0; + if (!systemContent) { + return { systemInstructions: void 0, filteredMessages: messages }; + } + const systemInstructions = JSON.stringify([{ type: "text", content: systemContent }]); + const filteredMessages = [...messages.slice(0, systemMessageIndex), ...messages.slice(systemMessageIndex + 1)]; + return { systemInstructions, filteredMessages }; +} +async function createWithResponseWrapper(originalWithResponse, instrumentedPromise, mechanismType) { + const safeOriginalWithResponse = originalWithResponse.catch((error) => { + exports$1.captureException(error, { + mechanism: { + handled: false, + type: mechanismType + } + }); + throw error; + }); + const instrumentedResult = await instrumentedPromise; + const originalWrapper = await safeOriginalWithResponse; + if (originalWrapper && typeof originalWrapper === "object" && "data" in originalWrapper) { + return { + ...originalWrapper, + data: instrumentedResult }; - return object.dropUndefinedKeys(sessionAggregates); } - - /** JSDoc */ - close() { - clearInterval(this._intervalId); - this._isEnabled = false; - this.flush(); + return instrumentedResult; +} +function wrapPromiseWithMethods(originalPromiseLike, instrumentedPromise, mechanismType) { + if (!is.isThenable(originalPromiseLike)) { + return instrumentedPromise; } - - /** - * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then - * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to - * `_incrementSessionStatusCount` along with the start date - */ - incrementSessionStatusCount() { - if (!this._isEnabled) { - return; + return new Proxy(originalPromiseLike, { + get(target, prop) { + const useInstrumentedPromise = prop in Promise.prototype || prop === Symbol.toStringTag; + const source = useInstrumentedPromise ? instrumentedPromise : target; + const value = Reflect.get(source, prop); + if (prop === "withResponse" && typeof value === "function") { + return function wrappedWithResponse() { + const originalWithResponse = value.call(target); + return createWithResponseWrapper(originalWithResponse, instrumentedPromise, mechanismType); + }; + } + return typeof value === "function" ? value.bind(source) : value; } - const isolationScope = currentScopes.getIsolationScope(); - // eslint-disable-next-line deprecation/deprecation - const requestSession = isolationScope.getRequestSession(); + }); +} - if (requestSession && requestSession.status) { - this._incrementSessionStatusCount(requestSession.status, new Date()); - // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in - // case captureRequestSession is called more than once to prevent double count - // eslint-disable-next-line deprecation/deprecation - isolationScope.setRequestSession(undefined); - /* eslint-enable @typescript-eslint/no-unsafe-member-access */ +exports.buildMethodPath = buildMethodPath; +exports.endStreamSpan = endStreamSpan; +exports.extractSystemInstructions = extractSystemInstructions; +exports.getTruncatedJsonString = getTruncatedJsonString; +exports.resolveAIRecordingOptions = resolveAIRecordingOptions; +exports.setTokenUsageAttributes = setTokenUsageAttributes; +exports.shouldEnableTruncation = shouldEnableTruncation; +exports.wrapPromiseWithMethods = wrapPromiseWithMethods; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 27044: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ANTHROPIC_AI_INTEGRATION_NAME = "Anthropic_AI"; +const ANTHROPIC_METHOD_REGISTRY = { + "messages.create": { operation: "chat" }, + "messages.stream": { operation: "chat", streaming: true }, + "messages.countTokens": { operation: "chat" }, + "models.get": { operation: "models" }, + "completions.create": { operation: "chat" }, + "models.retrieve": { operation: "models" }, + "beta.messages.create": { operation: "chat" } +}; + +exports.ANTHROPIC_AI_INTEGRATION_NAME = ANTHROPIC_AI_INTEGRATION_NAME; +exports.ANTHROPIC_METHOD_REGISTRY = ANTHROPIC_METHOD_REGISTRY; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 39865: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const semanticAttributes = __nccwpck_require__(36827); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const genAiAttributes = __nccwpck_require__(53989); +const utils$1 = __nccwpck_require__(78481); +const constants = __nccwpck_require__(27044); +const streaming = __nccwpck_require__(10091); +const utils = __nccwpck_require__(14306); + +let suppressDelegatedCreate = false; +const INSTRUMENTED_METHODS = /* @__PURE__ */ new WeakSet(); +function extractRequestAttributes(args, methodPath, operationName) { + const attributes = { + [genAiAttributes.GEN_AI_SYSTEM_ATTRIBUTE]: "anthropic", + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: operationName, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ai.anthropic" + }; + if (args.length > 0 && typeof args[0] === "object" && args[0] !== null) { + const params = args[0]; + if (params.tools && Array.isArray(params.tools)) { + attributes[genAiAttributes.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE] = JSON.stringify(params.tools); + } + attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] = params.model ?? "unknown"; + if ("temperature" in params) attributes[genAiAttributes.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE] = params.temperature; + if ("top_p" in params) attributes[genAiAttributes.GEN_AI_REQUEST_TOP_P_ATTRIBUTE] = params.top_p; + if ("stream" in params) attributes[genAiAttributes.GEN_AI_REQUEST_STREAM_ATTRIBUTE] = params.stream; + if ("top_k" in params) attributes[genAiAttributes.GEN_AI_REQUEST_TOP_K_ATTRIBUTE] = params.top_k; + if ("frequency_penalty" in params) + attributes[genAiAttributes.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE] = params.frequency_penalty; + if ("max_tokens" in params) attributes[genAiAttributes.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE] = params.max_tokens; + } else { + if (methodPath === "models.retrieve" || methodPath === "models.get") { + attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] = args[0]; + } else { + attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] = "unknown"; } } - - /** - * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of - * the session received - */ - // eslint-disable-next-line deprecation/deprecation - _incrementSessionStatusCount(status, date) { - // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys - const sessionStartedTrunc = new Date(date).setSeconds(0, 0); - - // corresponds to aggregated sessions in one specific minute bucket - // for example, {"started":"2021-03-16T08:00:00.000Z","exited":4, "errored": 1} - let aggregationCounts = this._pendingAggregates.get(sessionStartedTrunc); - if (!aggregationCounts) { - aggregationCounts = { started: new Date(sessionStartedTrunc).toISOString() }; - this._pendingAggregates.set(sessionStartedTrunc, aggregationCounts); + return attributes; +} +function addPrivateRequestAttributes(span, params, enableTruncation) { + const messages = utils.messagesFromParams(params); + utils.setMessagesAttribute(span, messages, enableTruncation); + if ("prompt" in params) { + span.setAttributes({ [genAiAttributes.GEN_AI_PROMPT_ATTRIBUTE]: JSON.stringify(params.prompt) }); + } +} +function addContentAttributes(span, response) { + if ("content" in response) { + if (Array.isArray(response.content)) { + span.setAttributes({ + [genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: response.content.map((item) => item.text).filter((text) => !!text).join("") + }); + const toolCalls = []; + for (const item of response.content) { + if (item.type === "tool_use" || item.type === "server_tool_use") { + toolCalls.push(item); + } + } + if (toolCalls.length > 0) { + span.setAttributes({ [genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]: JSON.stringify(toolCalls) }); + } } - - switch (status) { - case 'errored': - aggregationCounts.errored = (aggregationCounts.errored || 0) + 1; - return aggregationCounts.errored; - case 'ok': - aggregationCounts.exited = (aggregationCounts.exited || 0) + 1; - return aggregationCounts.exited; - default: - aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1; - return aggregationCounts.crashed; + } + if ("completion" in response) { + span.setAttributes({ [genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: response.completion }); + } + if ("input_tokens" in response) { + span.setAttributes({ [genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: JSON.stringify(response.input_tokens) }); + } +} +function addMetadataAttributes(span, response) { + if ("id" in response && "model" in response) { + span.setAttributes({ + [genAiAttributes.GEN_AI_RESPONSE_ID_ATTRIBUTE]: response.id, + [genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]: response.model + }); + if ("usage" in response && response.usage) { + utils$1.setTokenUsageAttributes( + span, + response.usage.input_tokens, + response.usage.output_tokens, + response.usage.cache_creation_input_tokens, + response.usage.cache_read_input_tokens + ); } } } +function addResponseAttributes(span, response, recordOutputs) { + if (!response || typeof response !== "object") return; + if ("type" in response && response.type === "error") { + utils.handleResponseError(span, response); + return; + } + if (recordOutputs) { + addContentAttributes(span, response); + } + addMetadataAttributes(span, response); +} +function handleStreamingError(error, span, methodPath) { + exports$1.captureException(error, { + mechanism: { handled: false, type: "auto.ai.anthropic", data: { function: methodPath } } + }); + if (span.isRecording()) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + span.end(); + } + throw error; +} +function handleStreamingRequest(target, invocationThis, args, requestAttributes, operationName, methodPath, params, options, isStreamRequested, isStreamingMethod) { + const model = requestAttributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] ?? "unknown"; + const spanConfig = { + name: `${operationName} ${model}`, + op: `gen_ai.${operationName}`, + attributes: requestAttributes + }; + if (isStreamRequested && !isStreamingMethod) { + let originalResult; + const instrumentedPromise = trace.startSpanManual(spanConfig, (span) => { + originalResult = target.apply(invocationThis, args); + if (options.recordInputs && params) { + addPrivateRequestAttributes(span, params, utils$1.shouldEnableTruncation(options.enableTruncation)); + } + return (async () => { + try { + const result = await originalResult; + return streaming.instrumentAsyncIterableStream( + result, + span, + options.recordOutputs ?? false + ); + } catch (error) { + return handleStreamingError(error, span, methodPath); + } + })(); + }); + return utils$1.wrapPromiseWithMethods(originalResult, instrumentedPromise, "auto.ai.anthropic"); + } else { + return trace.startSpanManual(spanConfig, (span) => { + try { + if (options.recordInputs && params) { + addPrivateRequestAttributes(span, params, utils$1.shouldEnableTruncation(options.enableTruncation)); + } + suppressDelegatedCreate = true; + const messageStream = target.apply(invocationThis, args); + suppressDelegatedCreate = false; + return streaming.instrumentMessageStream(messageStream, span, options.recordOutputs ?? false); + } catch (error) { + suppressDelegatedCreate = false; + return handleStreamingError(error, span, methodPath); + } + }); + } +} +function instrumentMethod(originalMethod, methodPath, instrumentedMethod, context, options) { + return new Proxy(originalMethod, { + apply(target, thisArg, args) { + const invocationThis = thisArg !== void 0 ? thisArg : context; + const isStreamingMethod = instrumentedMethod.streaming === true; + if (!isStreamingMethod && suppressDelegatedCreate) { + return target.apply(invocationThis, args); + } + const operationName = instrumentedMethod.operation || "unknown"; + const requestAttributes = extractRequestAttributes(args, methodPath, operationName); + const model = requestAttributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] ?? "unknown"; + const params = typeof args[0] === "object" ? args[0] : void 0; + const isStreamRequested = Boolean(params?.stream); + if (isStreamRequested || isStreamingMethod) { + return handleStreamingRequest( + target, + invocationThis, + args, + requestAttributes, + operationName, + methodPath, + params, + options, + isStreamRequested, + isStreamingMethod + ); + } + let originalResult; + const instrumentedPromise = trace.startSpan( + { + name: `${operationName} ${model}`, + op: `gen_ai.${operationName}`, + attributes: requestAttributes + }, + (span) => { + originalResult = target.apply(invocationThis, args); + if (options.recordInputs && params) { + addPrivateRequestAttributes(span, params, utils$1.shouldEnableTruncation(options.enableTruncation)); + } + return originalResult.then( + (result) => { + addResponseAttributes(span, result, options.recordOutputs); + return result; + }, + (error) => { + exports$1.captureException(error, { + mechanism: { + handled: false, + type: "auto.ai.anthropic", + data: { + function: methodPath + } + } + }); + throw error; + } + ); + } + ); + return utils$1.wrapPromiseWithMethods(originalResult, instrumentedPromise, "auto.ai.anthropic"); + } + }); +} +function instrumentClientInPlace(client, options) { + for (const methodPath of Object.keys(constants.ANTHROPIC_METHOD_REGISTRY)) { + const segments = methodPath.split("."); + const methodName = segments.pop(); + let owner = client; + for (const segment of segments) { + owner = owner?.[segment]; + } + if (!owner || typeof owner[methodName] !== "function") { + continue; + } + const originalMethod = owner[methodName]; + if (INSTRUMENTED_METHODS.has(originalMethod)) { + continue; + } + const instrumented = instrumentMethod( + originalMethod, + methodPath, + constants.ANTHROPIC_METHOD_REGISTRY[methodPath], + owner, + options + ); + INSTRUMENTED_METHODS.add(instrumented); + owner[methodName] = instrumented; + } + return client; +} +function instrumentAnthropicAiClient(anthropicAiClient, options) { + return instrumentClientInPlace(anthropicAiClient, utils$1.resolveAIRecordingOptions(options)); +} -exports.SessionFlusher = SessionFlusher; -//# sourceMappingURL=sessionflusher.js.map +exports.addPrivateRequestAttributes = addPrivateRequestAttributes; +exports.addResponseAttributes = addResponseAttributes; +exports.extractRequestAttributes = extractRequestAttributes; +exports.instrumentAnthropicAiClient = instrumentAnthropicAiClient; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 10091: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const spanstatus = __nccwpck_require__(21119); +const utils = __nccwpck_require__(78481); +const utils$1 = __nccwpck_require__(14306); + +function isErrorEvent(event, span) { + if ("type" in event && typeof event.type === "string") { + if (event.type === "error") { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: utils$1.mapAnthropicErrorToStatusMessage(event.error?.type) }); + exports$1.captureException(event.error, { + mechanism: { + handled: false, + type: "auto.ai.anthropic.anthropic_error" + } + }); + return true; + } + } + return false; +} +function handleMessageMetadata(event, state) { + if (event.type === "message_delta") { + if (event.usage && typeof event.usage.output_tokens === "number") { + state.completionTokens = event.usage.output_tokens; + } + if (event.delta?.stop_reason) { + state.finishReasons.push(event.delta.stop_reason); + } + } + if (event.message) { + const message = event.message; + if (message.id) state.responseId = message.id; + if (message.model) state.responseModel = message.model; + if (message.usage) { + if (typeof message.usage.input_tokens === "number") state.promptTokens = message.usage.input_tokens; + if (typeof message.usage.cache_creation_input_tokens === "number") + state.cacheCreationInputTokens = message.usage.cache_creation_input_tokens; + if (typeof message.usage.cache_read_input_tokens === "number") + state.cacheReadInputTokens = message.usage.cache_read_input_tokens; + } + } +} +function handleContentBlockStart(event, state) { + if (event.type !== "content_block_start" || typeof event.index !== "number" || !event.content_block) return; + if (event.content_block.type === "tool_use" || event.content_block.type === "server_tool_use") { + state.activeToolBlocks[event.index] = { + id: event.content_block.id, + name: event.content_block.name, + inputJsonParts: [] + }; + } +} +function handleContentBlockDelta(event, state, recordOutputs) { + if (event.type !== "content_block_delta" || !event.delta) return; + if (typeof event.index === "number" && "partial_json" in event.delta && typeof event.delta.partial_json === "string") { + const active = state.activeToolBlocks[event.index]; + if (active) { + active.inputJsonParts.push(event.delta.partial_json); + } + } + if (recordOutputs && typeof event.delta.text === "string") { + state.responseTexts.push(event.delta.text); + } +} +function handleContentBlockStop(event, state) { + if (event.type !== "content_block_stop" || typeof event.index !== "number") return; + const active = state.activeToolBlocks[event.index]; + if (!active) return; + const raw = active.inputJsonParts.join(""); + let parsedInput; + try { + parsedInput = raw ? JSON.parse(raw) : {}; + } catch { + parsedInput = { __unparsed: raw }; + } + state.toolCalls.push({ + type: "tool_use", + id: active.id, + name: active.name, + input: parsedInput + }); + delete state.activeToolBlocks[event.index]; +} +function processEvent(event, state, recordOutputs, span) { + if (!(event && typeof event === "object")) { + return; + } + const isError = isErrorEvent(event, span); + if (isError) return; + handleMessageMetadata(event, state); + handleContentBlockStart(event, state); + handleContentBlockDelta(event, state, recordOutputs); + handleContentBlockStop(event, state); +} +async function* instrumentAsyncIterableStream(stream, span, recordOutputs) { + const state = { + responseTexts: [], + finishReasons: [], + responseId: "", + responseModel: "", + promptTokens: void 0, + completionTokens: void 0, + cacheCreationInputTokens: void 0, + cacheReadInputTokens: void 0, + toolCalls: [], + activeToolBlocks: {} + }; + try { + for await (const event of stream) { + processEvent(event, state, recordOutputs, span); + yield event; + } + } finally { + utils.endStreamSpan(span, state, recordOutputs); + } +} +function instrumentMessageStream(stream, span, recordOutputs) { + const state = { + responseTexts: [], + finishReasons: [], + responseId: "", + responseModel: "", + promptTokens: void 0, + completionTokens: void 0, + cacheCreationInputTokens: void 0, + cacheReadInputTokens: void 0, + toolCalls: [], + activeToolBlocks: {} + }; + stream.on("streamEvent", (event) => { + processEvent(event, state, recordOutputs, span); + }); + stream.on("message", () => { + utils.endStreamSpan(span, state, recordOutputs); + }); + stream.on("error", (error) => { + exports$1.captureException(error, { + mechanism: { + handled: false, + type: "auto.ai.anthropic.stream_error" + } + }); + if (span.isRecording()) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + span.end(); + } + }); + return stream; +} + +exports.instrumentAsyncIterableStream = instrumentAsyncIterableStream; +exports.instrumentMessageStream = instrumentMessageStream; +//# sourceMappingURL=streaming.js.map + + +/***/ }), + +/***/ 14306: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const string = __nccwpck_require__(77673); +const spanstatus = __nccwpck_require__(21119); +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(78481); + +function setMessagesAttribute(span, messages, enableTruncation) { + if (Array.isArray(messages) && messages.length === 0) { + return; + } + const { systemInstructions, filteredMessages } = utils.extractSystemInstructions(messages); + if (systemInstructions) { + span.setAttributes({ + [genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE]: systemInstructions + }); + } + const filteredLength = Array.isArray(filteredMessages) ? filteredMessages.length : 1; + span.setAttributes({ + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]: enableTruncation ? utils.getTruncatedJsonString(filteredMessages) : string.stringify(filteredMessages), + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]: filteredLength + }); +} +const ANTHROPIC_ERROR_TYPE_TO_SPAN_STATUS = { + invalid_request_error: "invalid_argument", + authentication_error: "unauthenticated", + permission_error: "permission_denied", + not_found_error: "not_found", + request_too_large: "failed_precondition", + rate_limit_error: "resource_exhausted", + api_error: "internal_error", + overloaded_error: "unavailable" +}; +function mapAnthropicErrorToStatusMessage(errorType) { + if (!errorType) { + return "internal_error"; + } + return ANTHROPIC_ERROR_TYPE_TO_SPAN_STATUS[errorType] || "internal_error"; +} +function handleResponseError(span, response) { + if (response.error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: mapAnthropicErrorToStatusMessage(response.error.type) }); + exports$1.captureException(response.error, { + mechanism: { + handled: false, + type: "auto.ai.anthropic.anthropic_error" + } + }); + } +} +function messagesFromParams(params) { + const { system, messages, input } = params; + const systemMessages = typeof system === "string" ? [{ role: "system", content: params.system }] : []; + const inputParamMessages = Array.isArray(input) ? input : input != null ? [input] : void 0; + const messagesParamMessages = Array.isArray(messages) ? messages : messages != null ? [messages] : []; + const userMessages = inputParamMessages ?? messagesParamMessages; + return [...systemMessages, ...userMessages]; +} + +exports.handleResponseError = handleResponseError; +exports.mapAnthropicErrorToStatusMessage = mapAnthropicErrorToStatusMessage; +exports.messagesFromParams = messagesFromParams; +exports.setMessagesAttribute = setMessagesAttribute; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 77388: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); + +const ADD_LISTENER_METHODS = [ + "addListener", + "on", + "once", + "prependListener", + "prependOnceListener", + "addEventListener" +]; +const REMOVE_LISTENER_METHODS = ["removeListener", "off", "removeEventListener"]; +const SCOPE_BOUND_LISTENERS = /* @__PURE__ */ Symbol("SentryScopeBoundListeners"); +let registeringWrapper; +function isReentrantWrapperRegistration(listener) { + return registeringWrapper !== void 0 && (listener === registeringWrapper || listener.listener === registeringWrapper); +} +function bindScopeToEmitter(emitter, scope = currentScopes.getCurrentScope()) { + const ee = emitter; + if (getPatchMap(ee)) { + return emitter; + } + createPatchMap(ee); + for (const methodName of ADD_LISTENER_METHODS) { + if (typeof ee[methodName] !== "function") { + continue; + } + ee[methodName] = patchAddListener(ee, ee[methodName], scope); + } + for (const methodName of REMOVE_LISTENER_METHODS) { + if (typeof ee[methodName] !== "function") { + continue; + } + ee[methodName] = patchRemoveListener(ee, ee[methodName]); + } + if (typeof ee.removeAllListeners === "function") { + ee.removeAllListeners = patchRemoveAllListeners(ee, ee.removeAllListeners); + } + return emitter; +} +function bindListenerToScope(listener, scope) { + return function(...args) { + return currentScopes.withScope(scope, () => listener.apply(this, args)); + }; +} +function isBoundListener(listener) { + return typeof listener === "function"; +} +function patchAddListener(ee, original, scope) { + return function(...args) { + const event = args[0]; + const listener = args[1]; + const rest = args.slice(2); + if (!isBoundListener(listener) || isReentrantWrapperRegistration(listener)) { + return original.apply(this, args); + } + const map = getPatchMap(ee) || createPatchMap(ee); + let listeners = map.get(event); + if (!listeners) { + listeners = /* @__PURE__ */ new WeakMap(); + map.set(event, listeners); + } + let boundListener = listeners.get(listener); + if (!boundListener) { + boundListener = bindListenerToScope(listener, scope); + listeners.set(listener, boundListener); + } + const previous = registeringWrapper; + registeringWrapper = boundListener; + try { + return original.call(this, event, boundListener, ...rest); + } finally { + registeringWrapper = previous; + } + }; +} +function patchRemoveListener(ee, original) { + return function(...args) { + const event = args[0]; + const listener = args[1]; + const rest = args.slice(2); + const boundListener = isBoundListener(listener) ? getPatchMap(ee)?.get(event)?.get(listener) : void 0; + if (!boundListener) { + return original.apply(this, args); + } + return original.call(this, event, boundListener, ...rest); + }; +} +function patchRemoveAllListeners(ee, original) { + return function(...args) { + const map = getPatchMap(ee); + if (map) { + if (args.length === 0) { + createPatchMap(ee); + } else { + const event = args[0]; + map.delete(event); + } + } + return original.apply(this, args); + }; +} +function createPatchMap(ee) { + const map = /* @__PURE__ */ new Map(); + ee[SCOPE_BOUND_LISTENERS] = map; + return map; +} +function getPatchMap(ee) { + return ee[SCOPE_BOUND_LISTENERS]; +} + +exports.bindScopeToEmitter = bindScopeToEmitter; +//# sourceMappingURL=bindScopeToEmitter.js.map + + +/***/ }), + +/***/ 65512: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debounce = __nccwpck_require__(18431); +const segmentSpanCaptureStrategy = __nccwpck_require__(52325); + +const CAPTURED_SPANS = /* @__PURE__ */ new WeakSet(); +const isSpanAlreadyCaptured = (span) => CAPTURED_SPANS.has(span); +const markSpanCaptured = (span) => { + CAPTURED_SPANS.add(span); +}; +const CLIENT_QUEUES = /* @__PURE__ */ new WeakMap(); +function _INTERNAL_setDeferSegmentSpanCapture(client) { + if (!segmentSpanCaptureStrategy.getSegmentSpanCaptureStrategy()) { + segmentSpanCaptureStrategy.setSegmentSpanCaptureStrategy(deferredSegmentSpanCaptureStrategy); + } + if (CLIENT_QUEUES.has(client)) { + return; + } + const pendingCaptures = /* @__PURE__ */ new Set(); + const debouncedDrain = debounce.debounce( + () => { + const captures = [...pendingCaptures]; + pendingCaptures.clear(); + for (const capture of captures) { + capture(); + } + }, + 1, + { maxWait: 100 } + ); + client.on("flush", () => { + debouncedDrain.flush(); + }); + CLIENT_QUEUES.set(client, (capture) => { + pendingCaptures.add(capture); + debouncedDrain(); + }); +} +const deferredSegmentSpanCaptureStrategy = { + onSegmentSpanEnded(convert, scope) { + const client = scope.getClient(); + const enqueue = client && CLIENT_QUEUES.get(client); + if (!enqueue) { + const transactionEvent = convert(); + if (transactionEvent) { + client?.captureEvent(transactionEvent); + } + return; + } + enqueue(() => { + const transactionEvent = convert({ isSpanAlreadyCaptured, onSpanCaptured: markSpanCaptured }); + if (transactionEvent) { + client.captureEvent(transactionEvent); + } + }); + }, + onChildSpanEnded(span, rootSpan, convert, scope) { + if (CAPTURED_SPANS.has(span) || !CAPTURED_SPANS.has(rootSpan)) { + return; + } + const client = scope.getClient(); + const enqueue = client && CLIENT_QUEUES.get(client); + const captureOrphan = () => { + const transactionEvent = convert({ isSpanAlreadyCaptured, onSpanCaptured: markSpanCaptured }); + if (transactionEvent?.contexts?.trace?.data) { + transactionEvent.contexts.trace.data["sentry.parent_span_already_sent"] = true; + } + if (transactionEvent) { + client?.captureEvent(transactionEvent); + } + }; + if (enqueue) { + enqueue(captureOrphan); + } else { + captureOrphan(); + } + } +}; + +exports._INTERNAL_setDeferSegmentSpanCapture = _INTERNAL_setDeferSegmentSpanCapture; +//# sourceMappingURL=deferSegmentSpanCapture.js.map /***/ }), @@ -72187,126 +30113,95 @@ exports.SessionFlusher = SessionFlusher; /***/ 29724: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const constants = __nccwpck_require__(5958); const currentScopes = __nccwpck_require__(8131); const semanticAttributes = __nccwpck_require__(36827); -const baggage = __nccwpck_require__(86741); -const object = __nccwpck_require__(16100); -const hasTracingEnabled = __nccwpck_require__(79223); +const baggage = __nccwpck_require__(2135); +const dsn = __nccwpck_require__(91582); +const hasSpansEnabled = __nccwpck_require__(42982); +const object = __nccwpck_require__(5906); const spanUtils = __nccwpck_require__(47569); +const sentryNonRecordingSpan = __nccwpck_require__(36854); +const utils = __nccwpck_require__(77989); -/** - * If you change this value, also update the terser plugin config to - * avoid minification of the object property! - */ -const FROZEN_DSC_FIELD = '_frozenDsc'; - -/** - * Freeze the given DSC on the given span. - */ +const FROZEN_DSC_FIELD = "_frozenDsc"; function freezeDscOnSpan(span, dsc) { - const spanWithMaybeDsc = span ; + const spanWithMaybeDsc = span; object.addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc); } - -/** - * Creates a dynamic sampling context from a client. - * - * Dispatches the `createDsc` lifecycle hook as a side effect. - */ function getDynamicSamplingContextFromClient(trace_id, client) { const options = client.getOptions(); - const { publicKey: public_key } = client.getDsn() || {}; - - const dsc = object.dropUndefinedKeys({ + const dsc = { environment: options.environment || constants.DEFAULT_ENVIRONMENT, release: options.release, public_key, trace_id, - }) ; - - client.emit('createDsc', dsc); - + org_id: dsn.extractOrgIdFromClient(client) + }; + client.emit("createDsc", dsc); return dsc; } - -/** - * Get the dynamic sampling context for the currently active scopes. - */ function getDynamicSamplingContextFromScope(client, scope) { const propagationContext = scope.getPropagationContext(); return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client); } - -/** - * Creates a dynamic sampling context from a span (and client and scope) - * - * @param span the span from which a few values like the root span name and sample rate are extracted. - * - * @returns a dynamic sampling context - */ function getDynamicSamplingContextFromSpan(span) { const client = currentScopes.getClient(); if (!client) { return {}; } - const rootSpan = spanUtils.getRootSpan(span); - - // For core implementation, we freeze the DSC onto the span as a non-enumerable property - const frozenDsc = (rootSpan )[FROZEN_DSC_FIELD]; - if (frozenDsc) { - return frozenDsc; - } - - // For OpenTelemetry, we freeze the DSC on the trace state + const rootSpanJson = spanUtils.spanToJSON(rootSpan); + const rootSpanAttributes = rootSpanJson.data; const traceState = rootSpan.spanContext().traceState; - const traceStateDsc = traceState && traceState.get('sentry.dsc'); - - // If the span has a DSC, we want it to take precedence + const rootSpanSampleRate = traceState?.get("sentry.sample_rate") ?? rootSpanAttributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] ?? rootSpanAttributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE]; + function applyLocalSampleRateToDsc(dsc2) { + if (typeof rootSpanSampleRate === "number" || typeof rootSpanSampleRate === "string") { + dsc2.sample_rate = `${rootSpanSampleRate}`; + } + return dsc2; + } + const frozenDsc = rootSpan[FROZEN_DSC_FIELD]; + if (frozenDsc) { + return applyLocalSampleRateToDsc(frozenDsc); + } + const isNonRecordingRoot = sentryNonRecordingSpan.spanIsNonRecordingSpan(rootSpan); + const isIgnoredRoot = isNonRecordingRoot && rootSpan.dropReason === "ignored"; + if (isNonRecordingRoot && (!hasSpansEnabled.hasSpansEnabled(client.getOptions()) || isIgnoredRoot)) { + const capturedScope = utils.getCapturedScopesOnSpan(rootSpan).scope; + if (capturedScope) { + const dsc2 = { ...getDynamicSamplingContextFromScope(client, capturedScope) }; + if (isIgnoredRoot) { + dsc2.sampled = "false"; + } + return applyLocalSampleRateToDsc(dsc2); + } + } + const traceStateDsc = traceState?.get("sentry.dsc"); const dscOnTraceState = traceStateDsc && baggage.baggageHeaderToDynamicSamplingContext(traceStateDsc); - if (dscOnTraceState) { - return dscOnTraceState; + return applyLocalSampleRateToDsc(dscOnTraceState); } - - // Else, we generate it from the span const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client); - const jsonSpan = spanUtils.spanToJSON(rootSpan); - const attributes = jsonSpan.data || {}; - const maybeSampleRate = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; - - if (maybeSampleRate != null) { - dsc.sample_rate = `${maybeSampleRate}`; - } - - // We don't want to have a transaction name in the DSC if the source is "url" because URLs might contain PII - const source = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; - - // after JSON conversion, txn.name becomes jsonSpan.description - const name = jsonSpan.description; - if (source !== 'url' && name) { + const source = rootSpanAttributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ?? rootSpanAttributes["sentry.segment.name.source"]; + const name = rootSpanJson.description; + if (source !== "url" && name) { dsc.transaction = name; } - - // How can we even land here with hasTracingEnabled() returning false? - // Otel creates a Non-recording span in Tracing Without Performance mode when handling incoming requests - // So we end up with an active span that is not sampled (neither positively nor negatively) - if (hasTracingEnabled.hasTracingEnabled()) { + if (hasSpansEnabled.hasSpansEnabled()) { dsc.sampled = String(spanUtils.spanIsSampled(rootSpan)); + dsc.sample_rand = // In OTEL we store the sample rand on the trace state because we cannot access scopes for NonRecordingSpans + // The Sentry OTEL SpanSampler takes care of writing the sample rand on the root span + traceState?.get("sentry.sample_rand") ?? // On all other platforms we can actually get the scopes from a root span (we use this as a fallback) + utils.getCapturedScopesOnSpan(rootSpan).scope?.getPropagationContext().sampleRand.toString(); } - - client.emit('createDsc', dsc, rootSpan); - + applyLocalSampleRateToDsc(dsc); + client.emit("createDsc", dsc, rootSpan); return dsc; } - -/** - * Convert a Span to a baggage header. - */ function spanToBaggageHeader(span) { const dsc = getDynamicSamplingContextFromSpan(span); return baggage.dynamicSamplingContextToSentryBaggageHeader(dsc); @@ -72325,69 +30220,440 @@ exports.spanToBaggageHeader = spanToBaggageHeader; /***/ 21834: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); -const globalError = __nccwpck_require__(97033); -const globalUnhandledRejection = __nccwpck_require__(26156); -const logger = __nccwpck_require__(38752); +const globalError = __nccwpck_require__(63022); +const globalUnhandledRejection = __nccwpck_require__(36099); +const debugLogger = __nccwpck_require__(41772); const spanUtils = __nccwpck_require__(47569); const spanstatus = __nccwpck_require__(21119); let errorsInstrumented = false; - -/** - * Ensure that global errors automatically set the active span status. - */ function registerSpanErrorInstrumentation() { if (errorsInstrumented) { return; } - + function errorCallback() { + const activeSpan = spanUtils.getActiveSpan(); + const rootSpan = activeSpan && spanUtils.getRootSpan(activeSpan); + if (rootSpan) { + const message = "internal_error"; + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`[Tracing] Root span: ${message} -> Global error occurred`); + rootSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message }); + } + } errorsInstrumented = true; globalError.addGlobalErrorInstrumentationHandler(errorCallback); globalUnhandledRejection.addGlobalUnhandledRejectionInstrumentationHandler(errorCallback); } -/** - * If an error or unhandled promise occurs, we mark the active root span as failed - */ -function errorCallback() { - const activeSpan = spanUtils.getActiveSpan(); - const rootSpan = activeSpan && spanUtils.getRootSpan(activeSpan); - if (rootSpan) { - const message = 'internal_error'; - debugBuild.DEBUG_BUILD && logger.logger.log(`[Tracing] Root span: ${message} -> Global error occurred`); - rootSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message }); - } -} - -// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the -// node.js default exit behaviour -errorCallback.tag = 'sentry_tracingErrorCallback'; - exports.registerSpanErrorInstrumentation = registerSpanErrorInstrumentation; //# sourceMappingURL=errors.js.map /***/ }), -/***/ 51019: +/***/ 78950: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const GOOGLE_GENAI_INTEGRATION_NAME = "Google_GenAI"; +const GOOGLE_GENAI_METHOD_REGISTRY = { + "models.generateContent": { operation: "generate_content" }, + "models.generateContentStream": { operation: "generate_content", streaming: true }, + "models.embedContent": { operation: "embeddings" }, + "chats.create": { proxyResultPath: "chat" }, + "chat.sendMessage": { operation: "chat" }, + "chat.sendMessageStream": { operation: "chat", streaming: true } +}; +const GOOGLE_GENAI_SYSTEM_NAME = "google_genai"; + +exports.GOOGLE_GENAI_INTEGRATION_NAME = GOOGLE_GENAI_INTEGRATION_NAME; +exports.GOOGLE_GENAI_METHOD_REGISTRY = GOOGLE_GENAI_METHOD_REGISTRY; +exports.GOOGLE_GENAI_SYSTEM_NAME = GOOGLE_GENAI_SYSTEM_NAME; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 51067: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const errors = __nccwpck_require__(21834); +const exports$1 = __nccwpck_require__(10779); +const semanticAttributes = __nccwpck_require__(36827); +const string = __nccwpck_require__(77673); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const handleCallbackErrors = __nccwpck_require__(77864); +const genAiAttributes = __nccwpck_require__(53989); +const utils$1 = __nccwpck_require__(78481); +const constants = __nccwpck_require__(78950); +const streaming = __nccwpck_require__(47879); +const utils = __nccwpck_require__(86101); -/** - * @deprecated Use `registerSpanErrorInstrumentation()` instead. In v9, this function will be removed. Note that you don't need to call this in Node-based SDKs or when using `browserTracingIntegration`. - */ -function addTracingExtensions() { - errors.registerSpanErrorInstrumentation(); +function extractModel(params, context) { + if ("model" in params && typeof params.model === "string") { + return params.model; + } + if (context && typeof context === "object") { + const contextObj = context; + if ("model" in contextObj && typeof contextObj.model === "string") { + return contextObj.model; + } + if ("modelVersion" in contextObj && typeof contextObj.modelVersion === "string") { + return contextObj.modelVersion; + } + } + return "unknown"; +} +function extractConfigAttributes(config) { + const attributes = {}; + if ("temperature" in config && typeof config.temperature === "number") { + attributes[genAiAttributes.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE] = config.temperature; + } + if ("topP" in config && typeof config.topP === "number") { + attributes[genAiAttributes.GEN_AI_REQUEST_TOP_P_ATTRIBUTE] = config.topP; + } + if ("topK" in config && typeof config.topK === "number") { + attributes[genAiAttributes.GEN_AI_REQUEST_TOP_K_ATTRIBUTE] = config.topK; + } + if ("maxOutputTokens" in config && typeof config.maxOutputTokens === "number") { + attributes[genAiAttributes.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE] = config.maxOutputTokens; + } + if ("frequencyPenalty" in config && typeof config.frequencyPenalty === "number") { + attributes[genAiAttributes.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE] = config.frequencyPenalty; + } + if ("presencePenalty" in config && typeof config.presencePenalty === "number") { + attributes[genAiAttributes.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE] = config.presencePenalty; + } + return attributes; +} +function extractRequestAttributes(operationName, params, context) { + const attributes = { + [genAiAttributes.GEN_AI_SYSTEM_ATTRIBUTE]: constants.GOOGLE_GENAI_SYSTEM_NAME, + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: operationName, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ai.google_genai" + }; + if (params) { + attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] = extractModel(params, context); + if ("config" in params && typeof params.config === "object" && params.config) { + const config = params.config; + Object.assign(attributes, extractConfigAttributes(config)); + if ("tools" in config && Array.isArray(config.tools)) { + const functionDeclarations = config.tools.flatMap( + (tool) => tool.functionDeclarations + ); + attributes[genAiAttributes.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE] = JSON.stringify(functionDeclarations); + } + } + } else { + attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] = extractModel({}, context); + } + return attributes; +} +function addPrivateRequestAttributes(span, params, operationName, enableTruncation) { + if (operationName === "embeddings") { + const contents = params.contents; + if (contents != null) { + span.setAttribute( + genAiAttributes.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE, + typeof contents === "string" ? contents : JSON.stringify(contents) + ); + } + return; + } + const messages = []; + if ("config" in params && params.config && typeof params.config === "object" && "systemInstruction" in params.config && params.config.systemInstruction) { + messages.push(...utils.contentUnionToMessages(params.config.systemInstruction, "system")); + } + if ("history" in params) { + messages.push(...utils.contentUnionToMessages(params.history, "user")); + } + if ("contents" in params) { + messages.push(...utils.contentUnionToMessages(params.contents, "user")); + } + if ("message" in params) { + messages.push(...utils.contentUnionToMessages(params.message, "user")); + } + if (Array.isArray(messages) && messages.length) { + const { systemInstructions, filteredMessages } = utils$1.extractSystemInstructions(messages); + if (systemInstructions) { + span.setAttribute(genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE, systemInstructions); + } + const filteredLength = Array.isArray(filteredMessages) ? filteredMessages.length : 0; + span.setAttributes({ + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]: filteredLength, + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]: enableTruncation ? utils$1.getTruncatedJsonString(filteredMessages) : string.stringify(filteredMessages) + }); + } +} +function addResponseAttributes(span, response, recordOutputs) { + if (!response || typeof response !== "object") return; + if (response.modelVersion) { + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE, response.modelVersion); + } + if (response.usageMetadata && typeof response.usageMetadata === "object") { + const usage = response.usageMetadata; + if (typeof usage.promptTokenCount === "number") { + span.setAttributes({ + [genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]: usage.promptTokenCount + }); + } + if (typeof usage.candidatesTokenCount === "number") { + span.setAttributes({ + [genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]: usage.candidatesTokenCount + }); + } + if (typeof usage.totalTokenCount === "number") { + span.setAttributes({ + [genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]: usage.totalTokenCount + }); + } + } + if (recordOutputs && Array.isArray(response.candidates) && response.candidates.length > 0) { + const responseTexts = response.candidates.map((candidate) => { + if (candidate.content?.parts && Array.isArray(candidate.content.parts)) { + return candidate.content.parts.map((part) => typeof part.text === "string" ? part.text : "").filter((text) => text.length > 0).join(""); + } + return ""; + }).filter((text) => text.length > 0); + if (responseTexts.length > 0) { + span.setAttributes({ + [genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]: responseTexts.join("") + }); + } + } + if (recordOutputs && response.functionCalls) { + const functionCalls = response.functionCalls; + if (Array.isArray(functionCalls) && functionCalls.length > 0) { + span.setAttributes({ + [genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]: JSON.stringify(functionCalls) + }); + } + } +} +function instrumentMethod(originalMethod, methodPath, instrumentedMethod, context, options) { + const isEmbeddings = instrumentedMethod.operation === "embeddings"; + return new Proxy(originalMethod, { + apply(target, _, args) { + const operationName = instrumentedMethod.operation || "unknown"; + const params = args[0]; + const requestAttributes = extractRequestAttributes(operationName, params, context); + const model = requestAttributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] ?? "unknown"; + if (instrumentedMethod.streaming) { + return trace.startSpanManual( + { + name: `${operationName} ${model}`, + op: `gen_ai.${operationName}`, + attributes: requestAttributes + }, + async (span) => { + try { + if (options.recordInputs && params) { + addPrivateRequestAttributes( + span, + params, + operationName, + utils$1.shouldEnableTruncation(options.enableTruncation) + ); + } + const stream = await target.apply(context, args); + return streaming.instrumentStream(stream, span, Boolean(options.recordOutputs)); + } catch (error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exports$1.captureException(error, { + mechanism: { + handled: false, + type: "auto.ai.google_genai", + data: { function: methodPath } + } + }); + span.end(); + throw error; + } + } + ); + } + return trace.startSpan( + { + name: `${operationName} ${model}`, + op: `gen_ai.${operationName}`, + attributes: requestAttributes + }, + (span) => { + if (options.recordInputs && params) { + addPrivateRequestAttributes(span, params, operationName, utils$1.shouldEnableTruncation(options.enableTruncation)); + } + return handleCallbackErrors.handleCallbackErrors( + () => target.apply(context, args), + (error) => { + exports$1.captureException(error, { + mechanism: { handled: false, type: "auto.ai.google_genai", data: { function: methodPath } } + }); + }, + () => { + }, + (result) => { + if (!isEmbeddings) { + addResponseAttributes(span, result, options.recordOutputs); + } + } + ); + } + ); + } + }); +} +function createDeepProxy(target, currentPath = "", options) { + return new Proxy(target, { + get: (t, prop, receiver) => { + const value = Reflect.get(t, prop, receiver); + const methodPath = utils$1.buildMethodPath(currentPath, String(prop)); + const instrumentedMethod = constants.GOOGLE_GENAI_METHOD_REGISTRY[methodPath]; + if (typeof value === "function" && instrumentedMethod) { + const wrappedMethod = instrumentedMethod.operation ? instrumentMethod(value, methodPath, instrumentedMethod, t, options) : value.bind(t); + if (!instrumentedMethod.proxyResultPath) { + return wrappedMethod; + } + return function(...args) { + const result = wrappedMethod(...args); + if (result && typeof result === "object") { + return createDeepProxy(result, instrumentedMethod.proxyResultPath, options); + } + return result; + }; + } + if (typeof value === "function") { + return value.bind(t); + } + if (value && typeof value === "object") { + return createDeepProxy(value, methodPath, options); + } + return value; + } + }); +} +function instrumentGoogleGenAIClient(client, options) { + return createDeepProxy(client, "", utils$1.resolveAIRecordingOptions(options)); } -exports.addTracingExtensions = addTracingExtensions; -//# sourceMappingURL=hubextensions.js.map +exports.addPrivateRequestAttributes = addPrivateRequestAttributes; +exports.addResponseAttributes = addResponseAttributes; +exports.extractModel = extractModel; +exports.extractRequestAttributes = extractRequestAttributes; +exports.instrumentGoogleGenAIClient = instrumentGoogleGenAIClient; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 47879: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const spanstatus = __nccwpck_require__(21119); +const utils = __nccwpck_require__(78481); + +function isErrorChunk(chunk, span) { + const feedback = chunk?.promptFeedback; + if (feedback?.blockReason) { + const message = feedback.blockReasonMessage ?? feedback.blockReason; + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exports$1.captureException(`Content blocked: ${message}`, { + mechanism: { handled: false, type: "auto.ai.google_genai" } + }); + return true; + } + return false; +} +function handleResponseMetadata(chunk, state) { + if (typeof chunk.responseId === "string") state.responseId = chunk.responseId; + if (typeof chunk.modelVersion === "string") state.responseModel = chunk.modelVersion; + const usage = chunk.usageMetadata; + if (usage) { + if (typeof usage.promptTokenCount === "number") state.promptTokens = usage.promptTokenCount; + if (typeof usage.candidatesTokenCount === "number") state.completionTokens = usage.candidatesTokenCount; + if (typeof usage.totalTokenCount === "number") state.totalTokens = usage.totalTokenCount; + } +} +function handleCandidateContent(chunk, state, recordOutputs) { + if (Array.isArray(chunk.functionCalls)) { + state.toolCalls.push(...chunk.functionCalls); + } + for (const candidate of chunk.candidates ?? []) { + if (candidate?.finishReason && !state.finishReasons.includes(candidate.finishReason)) { + state.finishReasons.push(candidate.finishReason); + } + for (const part of candidate?.content?.parts ?? []) { + if (recordOutputs && part.text) state.responseTexts.push(part.text); + if (part.functionCall) { + state.toolCalls.push({ + type: "function", + id: part.functionCall.id, + name: part.functionCall.name, + arguments: part.functionCall.args + }); + } + } + } +} +function processChunk(chunk, state, recordOutputs, span) { + if (!chunk || isErrorChunk(chunk, span)) return; + handleResponseMetadata(chunk, state); + handleCandidateContent(chunk, state, recordOutputs); +} +async function* instrumentStream(stream, span, recordOutputs) { + const state = { + responseTexts: [], + finishReasons: [], + toolCalls: [] + }; + try { + for await (const chunk of stream) { + processChunk(chunk, state, recordOutputs, span); + yield chunk; + } + } finally { + utils.endStreamSpan(span, state, recordOutputs); + } +} + +exports.instrumentStream = instrumentStream; +//# sourceMappingURL=streaming.js.map + + +/***/ }), + +/***/ 86101: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function contentUnionToMessages(content, role = "user") { + if (typeof content === "string") { + return [{ role, content }]; + } + if (Array.isArray(content)) { + return content.flatMap((content2) => contentUnionToMessages(content2, role)); + } + if (typeof content !== "object" || !content) return []; + if ("role" in content && typeof content.role === "string") { + return [content]; + } + if ("parts" in content) { + return [{ ...content, role }]; + } + return [{ role, content }]; +} + +exports.contentUnionToMessages = contentUnionToMessages; +//# sourceMappingURL=utils.js.map /***/ }), @@ -72395,127 +30661,101 @@ exports.addTracingExtensions = addTracingExtensions; /***/ 89709: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const semanticAttributes = __nccwpck_require__(36827); -const logger = __nccwpck_require__(38752); -const time = __nccwpck_require__(75872); -const hasTracingEnabled = __nccwpck_require__(79223); +const debugLogger = __nccwpck_require__(41772); +const hasSpansEnabled = __nccwpck_require__(42982); +const shouldIgnoreSpan = __nccwpck_require__(65771); const spanOnScope = __nccwpck_require__(14379); const spanUtils = __nccwpck_require__(47569); +const time = __nccwpck_require__(66690); const sentryNonRecordingSpan = __nccwpck_require__(36854); +const sentrySpan = __nccwpck_require__(53263); const spanstatus = __nccwpck_require__(21119); const trace = __nccwpck_require__(97956); +const utils = __nccwpck_require__(77989); const TRACING_DEFAULTS = { - idleTimeout: 1000, - finalTimeout: 30000, - childSpanTimeout: 15000, + idleTimeout: 1e3, + finalTimeout: 3e4, + childSpanTimeout: 15e3 }; - -const FINISH_REASON_HEARTBEAT_FAILED = 'heartbeatFailed'; -const FINISH_REASON_IDLE_TIMEOUT = 'idleTimeout'; -const FINISH_REASON_FINAL_TIMEOUT = 'finalTimeout'; -const FINISH_REASON_EXTERNAL_FINISH = 'externalFinish'; - -/** - * An idle span is a span that automatically finishes. It does this by tracking child spans as activities. - * An idle span is always the active span. - */ +const FINISH_REASON_HEARTBEAT_FAILED = "heartbeatFailed"; +const FINISH_REASON_IDLE_TIMEOUT = "idleTimeout"; +const FINISH_REASON_FINAL_TIMEOUT = "finalTimeout"; +const FINISH_REASON_EXTERNAL_FINISH = "externalFinish"; function startIdleSpan(startSpanOptions, options = {}) { - // Activities store a list of active spans - const activities = new Map(); - - // We should not use heartbeat if we finished a span + const activities = /* @__PURE__ */ new Map(); let _finished = false; - - // Timer that tracks idleTimeout let _idleTimeoutID; - - // The reason why the span was finished let _finishReason = FINISH_REASON_EXTERNAL_FINISH; - let _autoFinishAllowed = !options.disableAutoFinish; - const _cleanupHooks = []; - const { idleTimeout = TRACING_DEFAULTS.idleTimeout, finalTimeout = TRACING_DEFAULTS.finalTimeout, childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout, beforeSpanEnd, + trimIdleSpanEndTimestamp = true } = options; - const client = currentScopes.getClient(); - - if (!client || !hasTracingEnabled.hasTracingEnabled()) { - return new sentryNonRecordingSpan.SentryNonRecordingSpan(); - } - const scope = currentScopes.getCurrentScope(); + if (!client || !hasSpansEnabled.hasSpansEnabled()) { + const span2 = new sentryNonRecordingSpan.SentryNonRecordingSpan({ traceId: scope.getPropagationContext().traceId }); + utils.setCapturedScopesOnSpan(span2, scope, currentScopes.getIsolationScope()); + return span2; + } const previousActiveSpan = spanUtils.getActiveSpan(); const span = _startIdleSpan(startSpanOptions); - - // We patch span.end to ensure we can run some things before the span is ended - // eslint-disable-next-line @typescript-eslint/unbound-method span.end = new Proxy(span.end, { apply(target, thisArg, args) { if (beforeSpanEnd) { beforeSpanEnd(span); } - - // Just ensuring that this keeps working, even if we ever have more arguments here + if (sentryNonRecordingSpan.spanIsNonRecordingSpan(thisArg)) { + return; + } const [definedEndTimestamp, ...rest] = args; const timestamp = definedEndTimestamp || time.timestampInSeconds(); const spanEndTimestamp = spanUtils.spanTimeInputToSeconds(timestamp); - - // Ensure we end with the last span timestamp, if possible - const spans = spanUtils.getSpanDescendants(span).filter(child => child !== span); - - // If we have no spans, we just end, nothing else to do here - if (!spans.length) { + const spans = spanUtils.getSpanDescendants(span).filter((child) => child !== span); + const spanJson = spanUtils.spanToJSON(span); + if (!spans.length || !trimIdleSpanEndTimestamp) { onIdleSpanEnded(spanEndTimestamp); return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]); } - - const childEndTimestamps = spans - .map(span => spanUtils.spanToJSON(span).timestamp) - .filter(timestamp => !!timestamp) ; - const latestSpanEndTimestamp = childEndTimestamps.length ? Math.max(...childEndTimestamps) : undefined; - - // In reality this should always exist here, but type-wise it may be undefined... - const spanStartTimestamp = spanUtils.spanToJSON(span).start_timestamp; - - // The final endTimestamp should: - // * Never be before the span start timestamp - // * Be the latestSpanEndTimestamp, if there is one, and it is smaller than the passed span end timestamp - // * Otherwise be the passed end timestamp - // Final timestamp can never be after finalTimeout + const ignoreSpans = client.getOptions().ignoreSpans; + const latestSpanEndTimestamp = spans?.reduce((acc, current) => { + const currentSpanJson = spanUtils.spanToJSON(current); + if (!currentSpanJson.timestamp) { + return acc; + } + if (ignoreSpans && shouldIgnoreSpan.shouldIgnoreSpan( + { description: currentSpanJson.description, op: currentSpanJson.op, attributes: currentSpanJson.data }, + ignoreSpans + )) { + return acc; + } + return acc ? Math.max(acc, currentSpanJson.timestamp) : currentSpanJson.timestamp; + }, void 0); + const spanStartTimestamp = spanJson.start_timestamp; const endTimestamp = Math.min( - spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1000 : Infinity, - Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)), + spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1e3 : Infinity, + Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)) ); - onIdleSpanEnded(endTimestamp); return Reflect.apply(target, thisArg, [endTimestamp, ...rest]); - }, + } }); - - /** - * Cancels the existing idle timeout, if there is one. - */ function _cancelIdleTimeout() { if (_idleTimeoutID) { clearTimeout(_idleTimeoutID); - _idleTimeoutID = undefined; + _idleTimeoutID = void 0; } } - - /** - * Restarts idle timeout, if there is no running idle timeout it will start one. - */ function _restartIdleTimeout(endTimestamp) { _cancelIdleTimeout(); _idleTimeoutID = setTimeout(() => { @@ -72525,10 +30765,6 @@ function startIdleSpan(startSpanOptions, options = {}) { } }, idleTimeout); } - - /** - * Restarts child span timeout, if there is none running it will start one. - */ function _restartChildSpanTimeout(endTimestamp) { _idleTimeoutID = setTimeout(() => { if (!_finished && _autoFinishAllowed) { @@ -72537,167 +30773,116 @@ function startIdleSpan(startSpanOptions, options = {}) { } }, childSpanTimeout); } - - /** - * Start tracking a specific activity. - * @param spanId The span id that represents the activity - */ function _pushActivity(spanId) { _cancelIdleTimeout(); activities.set(spanId, true); - const endTimestamp = time.timestampInSeconds(); - // We need to add the timeout here to have the real endtimestamp of the idle span - // Remember timestampInSeconds is in seconds, timeout is in ms - _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1000); + _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1e3); } - - /** - * Remove an activity from usage - * @param spanId The span id that represents the activity - */ function _popActivity(spanId) { if (activities.has(spanId)) { activities.delete(spanId); } - if (activities.size === 0) { const endTimestamp = time.timestampInSeconds(); - // We need to add the timeout here to have the real endtimestamp of the idle span - // Remember timestampInSeconds is in seconds, timeout is in ms - _restartIdleTimeout(endTimestamp + idleTimeout / 1000); + _restartIdleTimeout(endTimestamp + idleTimeout / 1e3); } } - function onIdleSpanEnded(endTimestamp) { _finished = true; activities.clear(); - - _cleanupHooks.forEach(cleanup => cleanup()); - + _cleanupHooks.forEach((cleanup) => cleanup()); spanOnScope._setSpanForScope(scope, previousActiveSpan); - const spanJSON = spanUtils.spanToJSON(span); - const { start_timestamp: startTimestamp } = spanJSON; - // This should never happen, but to make TS happy... if (!startTimestamp) { return; } - - const attributes = spanJSON.data || {}; + const attributes = spanJSON.data; if (!attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) { span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason); } - - logger.logger.log(`[Tracing] Idle span "${spanJSON.op}" finished`); - - const childSpans = spanUtils.getSpanDescendants(span).filter(child => child !== span); - + const currentStatus = spanJSON.status; + if (!currentStatus || currentStatus === "unknown") { + span.setStatus({ code: spanstatus.SPAN_STATUS_OK }); + } + debugLogger.debug.log(`[Tracing] Idle span "${spanJSON.op}" finished`); + const childSpans = spanUtils.getSpanDescendants(span).filter((child) => child !== span); let discardedSpans = 0; - childSpans.forEach(childSpan => { - // We cancel all pending spans with status "cancelled" to indicate the idle span was finished early + childSpans.forEach((childSpan) => { if (childSpan.isRecording()) { - childSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'cancelled' }); + childSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "cancelled" }); childSpan.end(endTimestamp); - debugBuild.DEBUG_BUILD && - logger.logger.log('[Tracing] Cancelling span since span ended early', JSON.stringify(childSpan, undefined, 2)); + debugBuild.DEBUG_BUILD && debugLogger.debug.log("[Tracing] Cancelling span since span ended early", JSON.stringify(childSpan, void 0, 2)); } - const childSpanJSON = spanUtils.spanToJSON(childSpan); const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON; - const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp; - - // Add a delta with idle timeout so that we prevent false positives - const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1000; + const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1e3; const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError; - if (debugBuild.DEBUG_BUILD) { - const stringifiedSpan = JSON.stringify(childSpan, undefined, 2); + const stringifiedSpan = JSON.stringify(childSpan, void 0, 2); if (!spanStartedBeforeIdleSpanEnd) { - logger.logger.log('[Tracing] Discarding span since it happened after idle span was finished', stringifiedSpan); + debugLogger.debug.log("[Tracing] Discarding span since it happened after idle span was finished", stringifiedSpan); } else if (!spanEndedBeforeFinalTimeout) { - logger.logger.log('[Tracing] Discarding span since it finished after idle span final timeout', stringifiedSpan); + debugLogger.debug.log("[Tracing] Discarding span since it finished after idle span final timeout", stringifiedSpan); } } - if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) { spanUtils.removeChildSpanFromSpan(span, childSpan); discardedSpans++; } }); - if (discardedSpans > 0) { - span.setAttribute('sentry.idle_span_discarded_spans', discardedSpans); + span.setAttribute("sentry.idle_span_discarded_spans", discardedSpans); } } - _cleanupHooks.push( - client.on('spanStart', startedSpan => { - // If we already finished the idle span, - // or if this is the idle span itself being started, - // or if the started span has already been closed, - // we don't care about it for activity - if (_finished || startedSpan === span || !!spanUtils.spanToJSON(startedSpan).timestamp) { + client.on("spanStart", (startedSpan) => { + if (_finished || startedSpan === span || !!spanUtils.spanToJSON(startedSpan).timestamp || startedSpan instanceof sentrySpan.SentrySpan && startedSpan.isStandaloneSpan()) { return; } - const allSpans = spanUtils.getSpanDescendants(span); - - // If the span that was just started is a child of the idle span, we should track it if (allSpans.includes(startedSpan)) { _pushActivity(startedSpan.spanContext().spanId); } - }), + }) ); - _cleanupHooks.push( - client.on('spanEnd', endedSpan => { + client.on("spanEnd", (endedSpan) => { if (_finished) { return; } - _popActivity(endedSpan.spanContext().spanId); - }), + }) ); - _cleanupHooks.push( - client.on('idleSpanEnableAutoFinish', spanToAllowAutoFinish => { + client.on("idleSpanEnableAutoFinish", (spanToAllowAutoFinish) => { if (spanToAllowAutoFinish === span) { _autoFinishAllowed = true; _restartIdleTimeout(); - if (activities.size) { _restartChildSpanTimeout(); } } - }), + }) ); - - // We only start the initial idle timeout if we are not delaying the auto finish if (!options.disableAutoFinish) { _restartIdleTimeout(); } - setTimeout(() => { if (!_finished) { - span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'deadline_exceeded' }); + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "deadline_exceeded" }); _finishReason = FINISH_REASON_FINAL_TIMEOUT; span.end(); } }, finalTimeout); - return span; } - function _startIdleSpan(options) { const span = trace.startInactiveSpan(options); - spanOnScope._setSpanForScope(currentScopes.getCurrentScope(), span); - - debugBuild.DEBUG_BUILD && logger.logger.log('[Tracing] Started span is an idle span'); - + debugBuild.DEBUG_BUILD && debugLogger.debug.log("[Tracing] Started span is an idle span"); return span; } @@ -72706,66 +30891,1225 @@ exports.startIdleSpan = startIdleSpan; //# sourceMappingURL=idleSpan.js.map +/***/ }), + +/***/ 38134: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const LANGCHAIN_INTEGRATION_NAME = "LangChain"; +const LANGCHAIN_ORIGIN = "auto.ai.langchain"; +const ROLE_MAP = { + human: "user", + ai: "assistant", + assistant: "assistant", + system: "system", + function: "function", + tool: "tool" +}; + +exports.LANGCHAIN_INTEGRATION_NAME = LANGCHAIN_INTEGRATION_NAME; +exports.LANGCHAIN_ORIGIN = LANGCHAIN_ORIGIN; +exports.ROLE_MAP = ROLE_MAP; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 94842: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const semanticAttributes = __nccwpck_require__(36827); +const trace = __nccwpck_require__(97956); +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(78481); +const constants = __nccwpck_require__(38134); + +function inferSystemFromInstance(instance) { + const name = instance.constructor?.name ?? ""; + if (name.includes("OpenAI")) return "openai"; + if (name.includes("Google")) return "google_genai"; + if (name.includes("Mistral")) return "mistralai"; + if (name.includes("Vertex")) return "google_vertexai"; + if (name.includes("Bedrock")) return "aws_bedrock"; + if (name.includes("Ollama")) return "ollama"; + if (name.includes("Cloudflare")) return "cloudflare"; + if (name.includes("Cohere")) return "cohere"; + return "langchain"; +} +function extractEmbeddingAttributes(instance) { + const embeddingsInstance = instance ?? {}; + const attributes = { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.LANGCHAIN_ORIGIN, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: genAiAttributes.GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE, + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: "embeddings", + [genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE]: embeddingsInstance.model ?? "unknown" + }; + attributes[genAiAttributes.GEN_AI_SYSTEM_ATTRIBUTE] = inferSystemFromInstance(embeddingsInstance); + if ("dimensions" in embeddingsInstance) { + attributes[genAiAttributes.GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE] = embeddingsInstance.dimensions; + } + if ("encodingFormat" in embeddingsInstance) { + attributes[genAiAttributes.GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE] = embeddingsInstance.encodingFormat; + } + return attributes; +} +function _INTERNAL_getLangChainEmbeddingsSpanOptions(instance, input, options = {}) { + const { recordInputs } = utils.resolveAIRecordingOptions(options); + const attributes = extractEmbeddingAttributes(instance); + const modelName = attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] || "unknown"; + if (recordInputs && input != null) { + attributes[genAiAttributes.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE] = typeof input === "string" ? input : JSON.stringify(input); + } + return { + name: `embeddings ${modelName}`, + op: genAiAttributes.GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE, + attributes + }; +} +function instrumentEmbeddingMethod(originalMethod, options = {}) { + return new Proxy(originalMethod, { + apply(target, thisArg, args) { + return trace.startSpan(_INTERNAL_getLangChainEmbeddingsSpanOptions(thisArg, args[0], options), () => { + return Reflect.apply(target, thisArg, args).then(void 0, (error) => { + exports$1.captureException(error, { + mechanism: { handled: false, type: "auto.ai.langchain" } + }); + throw error; + }); + }); + } + }); +} +function instrumentLangChainEmbeddings(instance, options) { + const embeddingsInstance = instance; + if (typeof embeddingsInstance.embedQuery === "function") { + embeddingsInstance.embedQuery = instrumentEmbeddingMethod( + embeddingsInstance.embedQuery, + options + ); + } + if (typeof embeddingsInstance.embedDocuments === "function") { + embeddingsInstance.embedDocuments = instrumentEmbeddingMethod( + embeddingsInstance.embedDocuments, + options + ); + } + return instance; +} + +exports._INTERNAL_getLangChainEmbeddingsSpanOptions = _INTERNAL_getLangChainEmbeddingsSpanOptions; +exports.instrumentEmbeddingMethod = instrumentEmbeddingMethod; +exports.instrumentLangChainEmbeddings = instrumentLangChainEmbeddings; +//# sourceMappingURL=embeddings.js.map + + +/***/ }), + +/***/ 28392: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const semanticAttributes = __nccwpck_require__(36827); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(78481); +const constants = __nccwpck_require__(38134); +const utils$1 = __nccwpck_require__(50284); + +function createLangChainCallbackHandler(options = {}) { + const { recordInputs, recordOutputs } = utils.resolveAIRecordingOptions(options); + const enableTruncation = utils.shouldEnableTruncation(options.enableTruncation); + const spanMap = /* @__PURE__ */ new Map(); + const exitSpan = (runId) => { + const span = spanMap.get(runId); + if (span?.isRecording()) { + span.end(); + spanMap.delete(runId); + } + }; + const handler = { + // Required LangChain BaseCallbackHandler properties + lc_serializable: false, + lc_namespace: ["langchain_core", "callbacks", "sentry"], + lc_secrets: void 0, + lc_attributes: void 0, + lc_aliases: void 0, + lc_serializable_keys: void 0, + lc_id: ["langchain_core", "callbacks", "sentry"], + lc_kwargs: {}, + name: "SentryCallbackHandler", + // BaseCallbackHandlerInput boolean flags + ignoreLLM: false, + ignoreChain: false, + ignoreAgent: false, + ignoreRetriever: false, + ignoreCustomEvent: false, + raiseError: false, + awaitHandlers: true, + handleLLMStart(llm, prompts, runId, _parentRunId, _extraParams, tags, metadata, _runName) { + const invocationParams = utils$1.getInvocationParams(tags); + const attributes = utils$1.extractLLMRequestAttributes( + llm, + prompts, + recordInputs, + enableTruncation, + invocationParams, + metadata + ); + const modelName = attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE]; + const operationName = attributes[genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]; + trace.startSpanManual( + { + name: `${operationName} ${modelName}`, + op: "gen_ai.chat", + attributes: { + ...utils$1.getAgentNameFromMetadata(metadata), + ...attributes, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "gen_ai.chat" + } + }, + (span) => { + spanMap.set(runId, span); + return span; + } + ); + }, + // Chat Model Start Handler + handleChatModelStart(llm, messages, runId, _parentRunId, extraParams, tags, metadata, _runName) { + const invocationParams = utils$1.getInvocationParams(tags); + const attributes = utils$1.extractChatModelRequestAttributes( + llm, + messages, + recordInputs, + enableTruncation, + invocationParams, + metadata + ); + const toolDefsJson = utils$1.extractToolDefinitions(extraParams); + if (toolDefsJson) { + attributes[genAiAttributes.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE] = toolDefsJson; + } + const modelName = attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE]; + const operationName = attributes[genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]; + trace.startSpanManual( + { + name: `${operationName} ${modelName}`, + op: "gen_ai.chat", + attributes: { + ...utils$1.getAgentNameFromMetadata(metadata), + ...attributes, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "gen_ai.chat" + } + }, + (span) => { + spanMap.set(runId, span); + return span; + } + ); + }, + // LLM End Handler - note: handleLLMEnd with capital LLM (used by both LLMs and chat models!) + handleLLMEnd(output, runId, _parentRunId, _tags, _extraParams) { + const span = spanMap.get(runId); + if (span?.isRecording()) { + const attributes = utils$1.extractLlmResponseAttributes(output, recordOutputs); + if (attributes) { + span.setAttributes(attributes); + } + exitSpan(runId); + } + }, + // LLM Error Handler - note: handleLLMError with capital LLM + handleLLMError(error, runId) { + const span = spanMap.get(runId); + if (span?.isRecording()) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exitSpan(runId); + } + exports$1.captureException(error, { + mechanism: { + handled: false, + type: `${constants.LANGCHAIN_ORIGIN}.llm_error_handler` + } + }); + }, + // Chain Start Handler + handleChainStart(chain, inputs, runId, _parentRunId, _tags, metadata, _runType, runName) { + if (metadata?.__sentry_langgraph__) { + return; + } + const chainName = runName || chain.name || "unknown_chain"; + const attributes = { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ai.langchain", + "langchain.chain.name": chainName + }; + if (recordInputs) { + attributes["langchain.chain.inputs"] = JSON.stringify(inputs); + } + trace.startSpanManual( + { + name: `chain ${chainName}`, + op: "gen_ai.invoke_agent", + attributes: { + ...attributes, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "gen_ai.invoke_agent" + } + }, + (span) => { + spanMap.set(runId, span); + return span; + } + ); + }, + // Chain End Handler + handleChainEnd(outputs, runId) { + const span = spanMap.get(runId); + if (span?.isRecording()) { + if (recordOutputs) { + span.setAttributes({ + "langchain.chain.outputs": JSON.stringify(outputs) + }); + } + exitSpan(runId); + } + }, + // Chain Error Handler + handleChainError(error, runId) { + const span = spanMap.get(runId); + if (span?.isRecording()) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exitSpan(runId); + } + exports$1.captureException(error, { + mechanism: { + handled: false, + type: `${constants.LANGCHAIN_ORIGIN}.chain_error_handler` + } + }); + }, + // Tool Start Handler + handleToolStart(tool, input, runId, _parentRunId, _tags, metadata, runName) { + if (metadata?.__sentry_langgraph__) { + return; + } + const toolName = runName || tool.name || "unknown_tool"; + const attributes = { + ...utils$1.getAgentNameFromMetadata(metadata), + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.LANGCHAIN_ORIGIN, + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: "execute_tool", + [genAiAttributes.GEN_AI_TOOL_NAME_ATTRIBUTE]: toolName + }; + if (recordInputs) { + attributes[genAiAttributes.GEN_AI_TOOL_INPUT_ATTRIBUTE] = input; + } + trace.startSpanManual( + { + name: `execute_tool ${toolName}`, + op: "gen_ai.execute_tool", + attributes: { + ...attributes, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "gen_ai.execute_tool" + } + }, + (span) => { + spanMap.set(runId, span); + return span; + } + ); + }, + // Tool End Handler + handleToolEnd(output, runId) { + const span = spanMap.get(runId); + if (span?.isRecording()) { + if (recordOutputs) { + const outputObj = output; + const content = outputObj && typeof outputObj === "object" && "content" in outputObj ? outputObj.content : output; + span.setAttributes({ + [genAiAttributes.GEN_AI_TOOL_OUTPUT_ATTRIBUTE]: typeof content === "string" ? content : JSON.stringify(content) + }); + } + exitSpan(runId); + } + }, + // Tool Error Handler + handleToolError(error, runId) { + const span = spanMap.get(runId); + if (span?.isRecording()) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exitSpan(runId); + } + exports$1.captureException(error, { + mechanism: { + handled: false, + type: `${constants.LANGCHAIN_ORIGIN}.tool_error_handler` + } + }); + }, + // LangChain BaseCallbackHandler required methods + copy() { + return handler; + }, + toJSON() { + return { + lc: 1, + type: "not_implemented", + id: handler.lc_id + }; + }, + toJSONNotImplemented() { + return { + lc: 1, + type: "not_implemented", + id: handler.lc_id + }; + } + }; + return handler; +} + +exports.createLangChainCallbackHandler = createLangChainCallbackHandler; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 50284: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const semanticAttributes = __nccwpck_require__(36827); +const string = __nccwpck_require__(77673); +const genAiAttributes = __nccwpck_require__(53989); +const mediaStripping = __nccwpck_require__(91604); +const utils = __nccwpck_require__(78481); +const constants = __nccwpck_require__(38134); + +const setIfDefined = (target, key, value) => { + if (value != null) target[key] = value; +}; +const setNumberIfDefined = (target, key, value) => { + const n = Number(value); + if (!Number.isNaN(n)) target[key] = n; +}; +function normalizeContent(v) { + if (Array.isArray(v)) { + try { + const stripped = v.map( + (part) => part && typeof part === "object" && mediaStripping.isContentMedia(part) ? mediaStripping.stripInlineMediaFromSingleMessage(part) : part + ); + return JSON.stringify(stripped); + } catch { + return String(v); + } + } + return string.stringify(v, String); +} +function normalizeMessageRole(role) { + const normalized = role.toLowerCase(); + return constants.ROLE_MAP[normalized] ?? normalized; +} +function normalizeRoleNameFromCtor(name) { + if (name.includes("System")) return "system"; + if (name.includes("Human")) return "user"; + if (name.includes("AI") || name.includes("Assistant")) return "assistant"; + if (name.includes("Function")) return "function"; + if (name.includes("Tool")) return "tool"; + return "user"; +} +function getInvocationParams(tags) { + if (!tags || Array.isArray(tags)) return void 0; + return tags.invocation_params; +} +function normalizeLangChainMessages(messages) { + return messages.map((message) => { + const maybeGetType = message._getType; + if (typeof maybeGetType === "function") { + const messageType = maybeGetType.call(message); + return { + role: normalizeMessageRole(messageType), + content: normalizeContent(message.content) + }; + } + if (message.lc === 1 && message.kwargs) { + const id = message.id; + const messageType = Array.isArray(id) && id.length > 0 ? id[id.length - 1] : ""; + const role = typeof messageType === "string" ? normalizeRoleNameFromCtor(messageType) : "user"; + return { + role: normalizeMessageRole(role), + content: normalizeContent(message.kwargs?.content) + }; + } + if (message.type) { + const role = String(message.type).toLowerCase(); + return { + role: normalizeMessageRole(role), + content: normalizeContent(message.content) + }; + } + if (message.role) { + return { + role: normalizeMessageRole(String(message.role)), + content: normalizeContent(message.content) + }; + } + const ctor = message.constructor?.name; + if (ctor && ctor !== "Object") { + return { + role: normalizeMessageRole(normalizeRoleNameFromCtor(ctor)), + content: normalizeContent(message.content) + }; + } + return { + role: "user", + content: normalizeContent(message.content) + }; + }); +} +function extractCommonRequestAttributes(serialized, invocationParams, langSmithMetadata) { + const attrs = {}; + const kwargs = "kwargs" in serialized ? serialized.kwargs : void 0; + const temperature = invocationParams?.temperature ?? langSmithMetadata?.ls_temperature ?? kwargs?.temperature; + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE, temperature); + const maxTokens = invocationParams?.max_tokens ?? langSmithMetadata?.ls_max_tokens ?? kwargs?.max_tokens; + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_REQUEST_MAX_TOKENS_ATTRIBUTE, maxTokens); + const topP = invocationParams?.top_p ?? kwargs?.top_p; + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_REQUEST_TOP_P_ATTRIBUTE, topP); + const frequencyPenalty = invocationParams?.frequency_penalty; + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE, frequencyPenalty); + const presencePenalty = invocationParams?.presence_penalty; + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE, presencePenalty); + if (invocationParams && "stream" in invocationParams) { + setIfDefined(attrs, genAiAttributes.GEN_AI_REQUEST_STREAM_ATTRIBUTE, Boolean(invocationParams.stream)); + } + return attrs; +} +function baseRequestAttributes(system, modelName, serialized, invocationParams, langSmithMetadata) { + return { + [genAiAttributes.GEN_AI_SYSTEM_ATTRIBUTE]: string.stringify(system ?? "langchain", String), + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: "chat", + [genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE]: string.stringify(modelName, String), + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.LANGCHAIN_ORIGIN, + ...extractCommonRequestAttributes(serialized, invocationParams, langSmithMetadata) + }; +} +function extractLLMRequestAttributes(llm, prompts, recordInputs, enableTruncation, invocationParams, langSmithMetadata) { + const system = langSmithMetadata?.ls_provider; + const modelName = invocationParams?.model ?? langSmithMetadata?.ls_model_name ?? "unknown"; + const attrs = baseRequestAttributes(system, modelName, llm, invocationParams, langSmithMetadata); + if (recordInputs && Array.isArray(prompts) && prompts.length > 0) { + setIfDefined(attrs, genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, prompts.length); + const messages = prompts.map((p) => ({ role: "user", content: p })); + setIfDefined( + attrs, + genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE, + enableTruncation ? utils.getTruncatedJsonString(messages) : string.stringify(messages) + ); + } + return attrs; +} +function extractChatModelRequestAttributes(llm, langChainMessages, recordInputs, enableTruncation, invocationParams, langSmithMetadata) { + const system = langSmithMetadata?.ls_provider ?? llm.id?.[2]; + const modelName = invocationParams?.model ?? langSmithMetadata?.ls_model_name ?? "unknown"; + const attrs = baseRequestAttributes(system, modelName, llm, invocationParams, langSmithMetadata); + if (recordInputs && Array.isArray(langChainMessages) && langChainMessages.length > 0) { + const normalized = normalizeLangChainMessages(langChainMessages.flat()); + const { systemInstructions, filteredMessages } = utils.extractSystemInstructions(normalized); + if (systemInstructions) { + setIfDefined(attrs, genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE, systemInstructions); + } + const filteredLength = Array.isArray(filteredMessages) ? filteredMessages.length : 0; + setIfDefined(attrs, genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, filteredLength); + setIfDefined( + attrs, + genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE, + enableTruncation ? utils.getTruncatedJsonString(filteredMessages) : string.stringify(filteredMessages) + ); + } + return attrs; +} +function addToolCallsAttributes(generations, attrs) { + const toolCalls = []; + const flatGenerations = generations.flat(); + for (const gen of flatGenerations) { + const msg = gen.message; + const msgToolCalls = msg?.tool_calls; + if (Array.isArray(msgToolCalls) && msgToolCalls.length > 0) { + toolCalls.push(...msgToolCalls); + } else { + const content = gen.message?.content; + if (Array.isArray(content)) { + for (const item of content) { + const t = item; + if (t.type === "tool_use") toolCalls.push(t); + } + } + } + } + if (toolCalls.length > 0) { + setIfDefined(attrs, genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, string.stringify(toolCalls, String)); + } +} +function addTokenUsageAttributes(llmOutput, attrs) { + if (!llmOutput) return; + const tokenUsage = llmOutput.tokenUsage; + const anthropicUsage = llmOutput.usage; + if (tokenUsage) { + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE, tokenUsage.promptTokens); + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE, tokenUsage.completionTokens); + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE, tokenUsage.totalTokens); + } else if (anthropicUsage) { + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE, anthropicUsage.input_tokens); + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE, anthropicUsage.output_tokens); + const input = Number(anthropicUsage.input_tokens); + const output = Number(anthropicUsage.output_tokens); + const total = (Number.isNaN(input) ? 0 : input) + (Number.isNaN(output) ? 0 : output); + if (total > 0) setNumberIfDefined(attrs, genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE, total); + if (anthropicUsage.cache_creation_input_tokens !== void 0) + setNumberIfDefined( + attrs, + genAiAttributes.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS_ATTRIBUTE, + anthropicUsage.cache_creation_input_tokens + ); + if (anthropicUsage.cache_read_input_tokens !== void 0) + setNumberIfDefined(attrs, genAiAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS_ATTRIBUTE, anthropicUsage.cache_read_input_tokens); + } +} +function extractLlmResponseAttributes(llmResult, recordOutputs) { + if (!llmResult) return; + const attrs = {}; + if (Array.isArray(llmResult.generations)) { + const finishReasons = llmResult.generations.flat().map((g) => { + if (g.generationInfo?.finish_reason) { + return g.generationInfo.finish_reason; + } + if (g.generation_info?.finish_reason) { + return g.generation_info.finish_reason; + } + return null; + }).filter((r) => typeof r === "string"); + if (finishReasons.length > 0) { + setIfDefined(attrs, genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE, string.stringify(finishReasons, String)); + } + addToolCallsAttributes(llmResult.generations, attrs); + if (recordOutputs) { + const texts = llmResult.generations.flat().map((gen) => gen.text ?? gen.message?.content).filter((t) => typeof t === "string"); + if (texts.length > 0) { + setIfDefined(attrs, genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE, string.stringify(texts, String)); + } + } + } + addTokenUsageAttributes(llmResult.llmOutput, attrs); + const llmOutput = llmResult.llmOutput; + const firstGeneration = llmResult.generations?.[0]?.[0]; + const v1Message = firstGeneration?.message; + const modelName = llmOutput?.model_name ?? llmOutput?.model ?? v1Message?.response_metadata?.model_name; + if (modelName) setIfDefined(attrs, genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE, modelName); + const responseId = llmOutput?.id ?? v1Message?.id; + if (responseId) { + setIfDefined(attrs, genAiAttributes.GEN_AI_RESPONSE_ID_ATTRIBUTE, responseId); + } + const stopReason = llmOutput?.stop_reason ?? v1Message?.response_metadata?.finish_reason; + if (stopReason) { + setIfDefined(attrs, genAiAttributes.GEN_AI_RESPONSE_STOP_REASON_ATTRIBUTE, string.stringify(stopReason, String)); + } + return attrs; +} +function getAgentNameFromMetadata(metadata) { + const attrs = {}; + const agentName = metadata?.lc_agent_name; + if (typeof agentName === "string") { + attrs[genAiAttributes.GEN_AI_AGENT_NAME_ATTRIBUTE] = agentName; + } + return attrs; +} +function extractToolDefinitions(extraParams) { + const tools = extraParams?.invocation_params?.tools ?? extraParams?.options?.tools; + if (!Array.isArray(tools) || tools.length === 0) return void 0; + const toolDefs = tools.map((tool) => { + const fn = tool.function; + return { + type: "function", + name: tool.name ?? fn?.name ?? "", + description: tool.description ?? fn?.description + }; + }); + return JSON.stringify(toolDefs); +} +function isCallbackManager(value) { + if (!value || typeof value !== "object") { + return false; + } + const candidate = value; + return typeof candidate.addHandler === "function" && typeof candidate.copy === "function"; +} +function isSentryHandler(handler) { + return typeof handler === "object" && handler?.name === "SentryCallbackHandler"; +} +function containsSentryHandler(handlers) { + return handlers.some(isSentryHandler); +} +function _INTERNAL_mergeLangChainCallbackHandler(existing, sentryHandler) { + if (!existing) { + return [sentryHandler]; + } + if (isCallbackManager(existing)) { + if (containsSentryHandler(existing.handlers ?? [])) { + return existing; + } + const copied = existing.copy(); + copied.addHandler(sentryHandler, true); + return copied; + } + const handlers = Array.isArray(existing) ? existing : [existing]; + if (containsSentryHandler(handlers)) { + return existing; + } + return [...handlers, sentryHandler]; +} + +exports._INTERNAL_mergeLangChainCallbackHandler = _INTERNAL_mergeLangChainCallbackHandler; +exports.extractChatModelRequestAttributes = extractChatModelRequestAttributes; +exports.extractLLMRequestAttributes = extractLLMRequestAttributes; +exports.extractLlmResponseAttributes = extractLlmResponseAttributes; +exports.extractToolDefinitions = extractToolDefinitions; +exports.getAgentNameFromMetadata = getAgentNameFromMetadata; +exports.getInvocationParams = getInvocationParams; +exports.normalizeLangChainMessages = normalizeLangChainMessages; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 54658: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const LANGGRAPH_INTEGRATION_NAME = "LangGraph"; +const LANGGRAPH_ORIGIN = "auto.ai.langgraph"; + +exports.LANGGRAPH_INTEGRATION_NAME = LANGGRAPH_INTEGRATION_NAME; +exports.LANGGRAPH_ORIGIN = LANGGRAPH_ORIGIN; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 61572: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const semanticAttributes = __nccwpck_require__(36827); +const string = __nccwpck_require__(77673); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(78481); +const index = __nccwpck_require__(28392); +const utils$2 = __nccwpck_require__(50284); +const constants = __nccwpck_require__(54658); +const utils$1 = __nccwpck_require__(8592); + +let _insideCreateReactAgent = false; +const SENTRY_PATCHED = "__sentry_patched__"; +function _INTERNAL_getLangGraphCreateAgentSpanOptions(agentName) { + const attributes = { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.LANGGRAPH_ORIGIN, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "gen_ai.create_agent", + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: "create_agent" + }; + if (agentName) { + attributes[genAiAttributes.GEN_AI_AGENT_NAME_ATTRIBUTE] = agentName; + } + return { + op: "gen_ai.create_agent", + name: agentName ? `create_agent ${agentName}` : "create_agent", + attributes + }; +} +function instrumentStateGraphCompile(originalCompile, options) { + if (Object.prototype.hasOwnProperty.call(originalCompile, SENTRY_PATCHED)) { + return originalCompile; + } + const sentryHandler = index.createLangChainCallbackHandler(options); + const wrapped = new Proxy(originalCompile, { + apply(target, thisArg, args) { + if (_insideCreateReactAgent) { + return Reflect.apply(target, thisArg, args); + } + return trace.startSpan(_INTERNAL_getLangGraphCreateAgentSpanOptions(), (span) => { + try { + const compiledGraph = Reflect.apply(target, thisArg, args); + const compileOptions = args.length > 0 ? args[0] : {}; + if (compileOptions?.name && typeof compileOptions.name === "string") { + span.setAttribute(genAiAttributes.GEN_AI_AGENT_NAME_ATTRIBUTE, compileOptions.name); + span.updateName(`create_agent ${compileOptions.name}`); + } + const originalInvoke = compiledGraph.invoke; + if (originalInvoke && typeof originalInvoke === "function") { + compiledGraph.invoke = instrumentCompiledGraphInvoke( + originalInvoke.bind(compiledGraph), + compiledGraph, + compileOptions, + options, + void 0, + sentryHandler + ); + } + return compiledGraph; + } catch (error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exports$1.captureException(error, { + mechanism: { + handled: false, + type: "auto.ai.langgraph.error" + } + }); + throw error; + } + }); + } + }); + Object.defineProperty(wrapped, SENTRY_PATCHED, { value: true, enumerable: false }); + return wrapped; +} +function instrumentCompiledGraphInvoke(originalInvoke, graphInstance, compileOptions, options, llm, sentryCallbackHandler) { + return new Proxy(originalInvoke, { + apply(target, thisArg, args) { + const modelName = llm?.modelName ?? llm?.model; + return trace.startSpan( + { + op: "gen_ai.invoke_agent", + name: "invoke_agent", + attributes: { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.LANGGRAPH_ORIGIN, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: genAiAttributes.GEN_AI_INVOKE_AGENT_OPERATION_ATTRIBUTE, + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: "invoke_agent" + } + }, + async (span) => { + try { + const graphName = compileOptions?.name; + if (graphName && typeof graphName === "string") { + span.setAttribute(genAiAttributes.GEN_AI_PIPELINE_NAME_ATTRIBUTE, graphName); + span.setAttribute(genAiAttributes.GEN_AI_AGENT_NAME_ATTRIBUTE, graphName); + span.updateName(`invoke_agent ${graphName}`); + } + if (modelName) { + span.setAttribute(genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE, modelName); + } + const config = args.length > 1 ? args[1] : void 0; + const configurable = config?.configurable; + const threadId = configurable?.thread_id; + if (threadId && typeof threadId === "string") { + span.setAttribute(genAiAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE, threadId); + } + if (sentryCallbackHandler) { + const invokeConfig = args[1] ?? {}; + args[1] = invokeConfig; + const existingMetadata = invokeConfig.metadata ?? {}; + invokeConfig.metadata = { + ...existingMetadata, + __sentry_langgraph__: true, + ...typeof graphName === "string" ? { lc_agent_name: graphName } : {} + }; + invokeConfig.callbacks = utils$2._INTERNAL_mergeLangChainCallbackHandler( + invokeConfig.callbacks, + sentryCallbackHandler + ); + } + const tools = utils$1.extractToolsFromCompiledGraph(graphInstance); + if (tools) { + span.setAttribute(genAiAttributes.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE, JSON.stringify(tools)); + } + const recordInputs = options.recordInputs; + const recordOutputs = options.recordOutputs; + const inputMessages = args.length > 0 ? args[0]?.messages ?? [] : []; + if (inputMessages && recordInputs) { + const normalizedMessages = utils$2.normalizeLangChainMessages(inputMessages); + const { systemInstructions, filteredMessages } = utils.extractSystemInstructions(normalizedMessages); + if (systemInstructions) { + span.setAttribute(genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE, systemInstructions); + } + const enableTruncation = utils.shouldEnableTruncation(options.enableTruncation); + const filteredLength = Array.isArray(filteredMessages) ? filteredMessages.length : 0; + span.setAttributes({ + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]: enableTruncation ? utils.getTruncatedJsonString(filteredMessages) : string.stringify(filteredMessages), + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]: filteredLength + }); + } + const result = await Reflect.apply(target, thisArg, args); + if (recordOutputs) { + utils$1.setResponseAttributes(span, inputMessages ?? null, result); + } + return result; + } catch (error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exports$1.captureException(error, { + mechanism: { + handled: false, + type: "auto.ai.langgraph.error" + } + }); + throw error; + } + } + ); + } + }); +} +function instrumentCreateReactAgent(originalCreateReactAgent, options) { + if (Object.prototype.hasOwnProperty.call(originalCreateReactAgent, SENTRY_PATCHED)) { + return originalCreateReactAgent; + } + const resolvedOptions = utils.resolveAIRecordingOptions(options); + const sentryHandler = index.createLangChainCallbackHandler(resolvedOptions); + const wrapped = new Proxy(originalCreateReactAgent, { + apply(target, thisArg, args) { + const llm = utils$1.extractLLMFromParams(args); + const agentName = utils$1.extractAgentNameFromParams(args); + const params = args[0]; + if (params && Array.isArray(params.tools) && params.tools.length > 0) { + utils$1.wrapToolsWithSpans(params.tools, resolvedOptions, agentName ?? void 0); + } + _insideCreateReactAgent = true; + let compiledGraph; + try { + compiledGraph = Reflect.apply(target, thisArg, args); + } finally { + _insideCreateReactAgent = false; + } + const originalInvoke = compiledGraph.invoke; + if (originalInvoke && typeof originalInvoke === "function") { + const compileOptions = {}; + if (agentName) { + compileOptions.name = agentName; + } + compiledGraph.invoke = instrumentCompiledGraphInvoke( + originalInvoke.bind(compiledGraph), + compiledGraph, + compileOptions, + resolvedOptions, + llm, + sentryHandler + ); + } + return compiledGraph; + } + }); + Object.defineProperty(wrapped, SENTRY_PATCHED, { value: true, enumerable: false }); + return wrapped; +} +function instrumentStateGraph(stateGraph, options) { + stateGraph.compile = instrumentStateGraphCompile(stateGraph.compile, utils.resolveAIRecordingOptions(options)); + return stateGraph; +} +const instrumentLangGraph = instrumentStateGraph; + +exports._INTERNAL_getLangGraphCreateAgentSpanOptions = _INTERNAL_getLangGraphCreateAgentSpanOptions; +exports.instrumentCompiledGraphInvoke = instrumentCompiledGraphInvoke; +exports.instrumentCreateReactAgent = instrumentCreateReactAgent; +exports.instrumentLangGraph = instrumentLangGraph; +exports.instrumentStateGraph = instrumentStateGraph; +exports.instrumentStateGraphCompile = instrumentStateGraphCompile; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 8592: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const semanticAttributes = __nccwpck_require__(36827); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(50284); +const constants = __nccwpck_require__(54658); + +function extractLLMFromParams(args) { + const arg = args[0]; + if (typeof arg !== "object" || !arg || !("llm" in arg) || !arg.llm || typeof arg.llm !== "object") { + return null; + } + const llm = arg.llm; + if (typeof llm.modelName !== "string" && typeof llm.model !== "string") { + return null; + } + return llm; +} +function extractAgentNameFromParams(args) { + const arg = args[0]; + if (typeof arg === "object" && !!arg && "name" in arg && typeof arg.name === "string") { + return arg.name; + } + return null; +} +function wrapToolsWithSpans(tools, options, agentName) { + const SENTRY_WRAPPED = "__sentry_tool_wrapped__"; + for (const tool of tools) { + if (!tool || typeof tool !== "object") { + continue; + } + const t = tool; + const originalInvoke = t.invoke; + if (typeof originalInvoke !== "function" || Object.prototype.hasOwnProperty.call(t, SENTRY_WRAPPED)) { + continue; + } + const toolName = typeof t.name === "string" ? t.name : "unknown_tool"; + const toolDescription = typeof t.description === "string" ? t.description : void 0; + const wrappedInvoke = new Proxy(originalInvoke, { + apply(target, thisArg, args) { + const spanAttributes = { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.LANGGRAPH_ORIGIN, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: genAiAttributes.GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE, + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: "execute_tool", + [genAiAttributes.GEN_AI_TOOL_NAME_ATTRIBUTE]: toolName, + [genAiAttributes.GEN_AI_TOOL_TYPE_ATTRIBUTE]: "function" + }; + const callConfig = args[1]; + const callAgentName = callConfig?.metadata?.lc_agent_name ?? agentName; + if (typeof callAgentName === "string") { + spanAttributes[genAiAttributes.GEN_AI_AGENT_NAME_ATTRIBUTE] = callAgentName; + } + if (toolDescription) { + spanAttributes[genAiAttributes.GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE] = toolDescription; + } + const input = args[0]; + if (typeof input === "object" && !!input) { + if ("id" in input && typeof input.id === "string") { + spanAttributes[genAiAttributes.GEN_AI_TOOL_CALL_ID_ATTRIBUTE] = input.id; + } + if (options.recordInputs) { + const toolArgs = "args" in input && typeof input.args === "object" ? input.args : input; + try { + spanAttributes[genAiAttributes.GEN_AI_TOOL_INPUT_ATTRIBUTE] = JSON.stringify(toolArgs); + } catch { + } + } + } + return trace.startSpan( + { + op: genAiAttributes.GEN_AI_EXECUTE_TOOL_OPERATION_ATTRIBUTE, + name: `execute_tool ${toolName}`, + attributes: spanAttributes + }, + async (span) => { + try { + const result = await Reflect.apply(target, thisArg, args); + if (options.recordOutputs) { + try { + const resultObj = result; + const content = resultObj && typeof resultObj === "object" && "content" in resultObj ? resultObj.content : result; + span.setAttribute( + genAiAttributes.GEN_AI_TOOL_OUTPUT_ATTRIBUTE, + typeof content === "string" ? content : JSON.stringify(content) + ); + } catch { + } + } + return result; + } catch (error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exports$1.captureException(error, { + mechanism: { + handled: false, + type: "auto.ai.langgraph.error" + } + }); + throw error; + } + } + ); + } + }); + t.invoke = wrappedInvoke; + Object.defineProperty(t, SENTRY_WRAPPED, { value: true, enumerable: false }); + } + return tools; +} +function extractToolCalls(messages) { + if (!messages || messages.length === 0) { + return null; + } + const toolCalls = []; + for (const message of messages) { + if (message && typeof message === "object") { + const msgToolCalls = message.tool_calls; + if (msgToolCalls && Array.isArray(msgToolCalls)) { + toolCalls.push(...msgToolCalls); + } + } + } + return toolCalls.length > 0 ? toolCalls : null; +} +function extractTokenUsageFromMessage(message) { + const msg = message; + let inputTokens = 0; + let outputTokens = 0; + let totalTokens = 0; + if (msg.usage_metadata && typeof msg.usage_metadata === "object") { + const usage = msg.usage_metadata; + if (typeof usage.input_tokens === "number") { + inputTokens = usage.input_tokens; + } + if (typeof usage.output_tokens === "number") { + outputTokens = usage.output_tokens; + } + if (typeof usage.total_tokens === "number") { + totalTokens = usage.total_tokens; + } + return { inputTokens, outputTokens, totalTokens }; + } + if (msg.response_metadata && typeof msg.response_metadata === "object") { + const metadata = msg.response_metadata; + if (metadata.tokenUsage && typeof metadata.tokenUsage === "object") { + const tokenUsage = metadata.tokenUsage; + if (typeof tokenUsage.promptTokens === "number") { + inputTokens = tokenUsage.promptTokens; + } + if (typeof tokenUsage.completionTokens === "number") { + outputTokens = tokenUsage.completionTokens; + } + if (typeof tokenUsage.totalTokens === "number") { + totalTokens = tokenUsage.totalTokens; + } + } + } + return { inputTokens, outputTokens, totalTokens }; +} +function extractModelMetadata(span, message) { + const msg = message; + if (msg.response_metadata && typeof msg.response_metadata === "object") { + const metadata = msg.response_metadata; + if (metadata.model_name && typeof metadata.model_name === "string") { + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE, metadata.model_name); + } + if (metadata.finish_reason && typeof metadata.finish_reason === "string") { + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE, [metadata.finish_reason]); + } + } +} +function extractToolsFromCompiledGraph(compiledGraph) { + if (!compiledGraph.builder?.nodes?.tools?.runnable?.tools) { + return null; + } + const tools = compiledGraph.builder?.nodes?.tools?.runnable?.tools; + if (!tools || !Array.isArray(tools) || tools.length === 0) { + return null; + } + return tools.map((tool) => ({ + name: tool.lc_kwargs?.name, + description: tool.lc_kwargs?.description, + schema: tool.lc_kwargs?.schema + })); +} +function setResponseAttributes(span, inputMessages, result) { + const resultObj = result; + const outputMessages = resultObj?.messages; + if (!outputMessages || !Array.isArray(outputMessages)) { + return; + } + const inputCount = inputMessages?.length ?? 0; + const newMessages = outputMessages.length > inputCount ? outputMessages.slice(inputCount) : []; + if (newMessages.length === 0) { + return; + } + const toolCalls = extractToolCalls(newMessages); + if (toolCalls) { + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, JSON.stringify(toolCalls)); + } + const normalizedNewMessages = utils.normalizeLangChainMessages(newMessages); + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE, JSON.stringify(normalizedNewMessages)); + let totalInputTokens = 0; + let totalOutputTokens = 0; + let totalTokens = 0; + for (const message of newMessages) { + const tokens = extractTokenUsageFromMessage(message); + totalInputTokens += tokens.inputTokens; + totalOutputTokens += tokens.outputTokens; + totalTokens += tokens.totalTokens; + extractModelMetadata(span, message); + } + if (totalInputTokens > 0) { + span.setAttribute(genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE, totalInputTokens); + } + if (totalOutputTokens > 0) { + span.setAttribute(genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE, totalOutputTokens); + } + if (totalTokens > 0) { + span.setAttribute(genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE, totalTokens); + } +} + +exports.extractAgentNameFromParams = extractAgentNameFromParams; +exports.extractLLMFromParams = extractLLMFromParams; +exports.extractModelMetadata = extractModelMetadata; +exports.extractTokenUsageFromMessage = extractTokenUsageFromMessage; +exports.extractToolCalls = extractToolCalls; +exports.extractToolsFromCompiledGraph = extractToolsFromCompiledGraph; +exports.setResponseAttributes = setResponseAttributes; +exports.wrapToolsWithSpans = wrapToolsWithSpans; +//# sourceMappingURL=utils.js.map + + /***/ }), /***/ 28761: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); -const logger = __nccwpck_require__(38752); +const debugLogger = __nccwpck_require__(41772); const spanUtils = __nccwpck_require__(47569); -/** - * Print a log message for a started span. - */ function logSpanStart(span) { if (!debugBuild.DEBUG_BUILD) return; - - const { description = '< unknown name >', op = '< unknown op >', parent_span_id: parentSpanId } = spanUtils.spanToJSON(span); + const { description = "< unknown name >", op = "< unknown op >", parent_span_id: parentSpanId } = spanUtils.spanToJSON(span); const { spanId } = span.spanContext(); - const sampled = spanUtils.spanIsSampled(span); const rootSpan = spanUtils.getRootSpan(span); const isRootSpan = rootSpan === span; - - const header = `[Tracing] Starting ${sampled ? 'sampled' : 'unsampled'} ${isRootSpan ? 'root ' : ''}span`; - + const header = `[Tracing] Starting ${sampled ? "sampled" : "unsampled"} ${isRootSpan ? "root " : ""}span`; const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`]; - if (parentSpanId) { infoParts.push(`parent ID: ${parentSpanId}`); } - if (!isRootSpan) { - const { op, description } = spanUtils.spanToJSON(rootSpan); + const { op: op2, description: description2 } = spanUtils.spanToJSON(rootSpan); infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`); - if (op) { - infoParts.push(`root op: ${op}`); + if (op2) { + infoParts.push(`root op: ${op2}`); } - if (description) { - infoParts.push(`root description: ${description}`); + if (description2) { + infoParts.push(`root description: ${description2}`); } } - - logger.logger.log(`${header} - ${infoParts.join('\n ')}`); + debugLogger.debug.log(`${header} + ${infoParts.join("\n ")}`); } - -/** - * Print a log message for an ended span. - */ function logSpanEnd(span) { if (!debugBuild.DEBUG_BUILD) return; - - const { description = '< unknown name >', op = '< unknown op >' } = spanUtils.spanToJSON(span); + const { description = "< unknown name >", op = "< unknown op >" } = spanUtils.spanToJSON(span); const { spanId } = span.spanContext(); const rootSpan = spanUtils.getRootSpan(span); const isRootSpan = rootSpan === span; - - const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? 'root ' : ''}span "${description}" with ID ${spanId}`; - logger.logger.log(msg); + const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? "root " : ""}span "${description}" with ID ${spanId}`; + debugLogger.debug.log(msg); } exports.logSpanEnd = logSpanEnd; @@ -72778,48 +32122,36 @@ exports.logSpanStart = logSpanStart; /***/ 50722: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); const semanticAttributes = __nccwpck_require__(36827); -const logger = __nccwpck_require__(38752); +const debugLogger = __nccwpck_require__(41772); const spanUtils = __nccwpck_require__(47569); -/** - * Adds a measurement to the active transaction on the current global scope. You can optionally pass in a different span - * as the 4th parameter. - */ function setMeasurement(name, value, unit, activeSpan = spanUtils.getActiveSpan()) { const rootSpan = activeSpan && spanUtils.getRootSpan(activeSpan); - if (rootSpan) { - debugBuild.DEBUG_BUILD && logger.logger.log(`[Measurement] Setting measurement on root span: ${name} = ${value} ${unit}`); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`[Measurement] Setting measurement on root span: ${name} = ${value} ${unit}`); rootSpan.addEvent(name, { [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value, - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit , + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit }); } } - -/** - * Convert timed events to measurements. - */ function timedEventsToMeasurements(events) { if (!events || events.length === 0) { - return undefined; + return void 0; } - const measurements = {}; - events.forEach(event => { + events.forEach((event) => { const attributes = event.attributes || {}; - const unit = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT] ; - const value = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE] ; - - if (typeof unit === 'string' && typeof value === 'number') { + const unit = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]; + const value = attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]; + if (typeof unit === "string" && typeof value === "number") { measurements[event.name] = { value, unit }; } }); - return measurements; } @@ -72828,168 +32160,641 @@ exports.timedEventsToMeasurements = timedEventsToMeasurements; //# sourceMappingURL=measurement.js.map +/***/ }), + +/***/ 45393: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const OPENAI_INTEGRATION_NAME = "OpenAI"; +const OPENAI_METHOD_REGISTRY = { + "responses.create": { operation: "chat" }, + "chat.completions.create": { operation: "chat" }, + "embeddings.create": { operation: "embeddings" }, + // Conversations API - for conversation state management + // https://platform.openai.com/docs/guides/conversation-state + "conversations.create": { operation: "chat" } +}; +const RESPONSES_TOOL_CALL_EVENT_TYPES = [ + "response.output_item.added", + "response.function_call_arguments.delta", + "response.function_call_arguments.done", + "response.output_item.done" +]; +const RESPONSE_EVENT_TYPES = [ + "response.created", + "response.in_progress", + "response.failed", + "response.completed", + "response.incomplete", + "response.queued", + "response.output_text.delta", + ...RESPONSES_TOOL_CALL_EVENT_TYPES +]; + +exports.OPENAI_INTEGRATION_NAME = OPENAI_INTEGRATION_NAME; +exports.OPENAI_METHOD_REGISTRY = OPENAI_METHOD_REGISTRY; +exports.RESPONSES_TOOL_CALL_EVENT_TYPES = RESPONSES_TOOL_CALL_EVENT_TYPES; +exports.RESPONSE_EVENT_TYPES = RESPONSE_EVENT_TYPES; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 87279: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const exports$1 = __nccwpck_require__(10779); +const semanticAttributes = __nccwpck_require__(36827); +const debugLogger = __nccwpck_require__(41772); +const string = __nccwpck_require__(77673); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(78481); +const constants = __nccwpck_require__(45393); +const streaming = __nccwpck_require__(30878); +const utils$1 = __nccwpck_require__(3854); + +function extractAvailableTools(params) { + const tools = Array.isArray(params.tools) ? params.tools : []; + const hasWebSearchOptions = params.web_search_options && typeof params.web_search_options === "object"; + const webSearchOptions = hasWebSearchOptions ? [{ type: "web_search_options", ...params.web_search_options }] : []; + const availableTools = [...tools, ...webSearchOptions]; + if (availableTools.length === 0) { + return void 0; + } + try { + return JSON.stringify(availableTools); + } catch (error) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Failed to serialize OpenAI tools:", error); + return void 0; + } +} +function extractRequestAttributes(args, operationName) { + const attributes = { + [genAiAttributes.GEN_AI_SYSTEM_ATTRIBUTE]: "openai", + [genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE]: operationName, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.ai.openai" + }; + if (args.length > 0 && typeof args[0] === "object" && args[0] !== null) { + const params = args[0]; + const availableTools = extractAvailableTools(params); + if (availableTools) { + attributes[genAiAttributes.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE] = availableTools; + } + Object.assign(attributes, utils$1.extractRequestParameters(params)); + } else { + attributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] = "unknown"; + } + return attributes; +} +function addRequestAttributes(span, params, operationName, enableTruncation) { + if (operationName === "embeddings" && "input" in params) { + const input = params.input; + if (input == null) { + return; + } + if (typeof input === "string" && input.length === 0) { + return; + } + if (Array.isArray(input) && input.length === 0) { + return; + } + span.setAttribute(genAiAttributes.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE, typeof input === "string" ? input : JSON.stringify(input)); + return; + } + const src = "input" in params ? params.input : "messages" in params ? params.messages : void 0; + if (!src) { + return; + } + if (Array.isArray(src) && src.length === 0) { + return; + } + const { systemInstructions, filteredMessages } = utils.extractSystemInstructions(src); + if (systemInstructions) { + span.setAttribute(genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE, systemInstructions); + } + span.setAttribute( + genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE, + enableTruncation ? utils.getTruncatedJsonString(filteredMessages) : string.stringify(filteredMessages) + ); + if (Array.isArray(filteredMessages)) { + span.setAttribute(genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, filteredMessages.length); + } else { + span.setAttribute(genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, 1); + } +} +function instrumentMethod(originalMethod, methodPath, instrumentedMethod, context, options) { + return function instrumentedCall(...args) { + const operationName = instrumentedMethod.operation || "unknown"; + const requestAttributes = extractRequestAttributes(args, operationName); + const model = requestAttributes[genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE] || "unknown"; + const params = args[0]; + const isStreamRequested = params && typeof params === "object" && params.stream === true; + const spanConfig = { + name: `${operationName} ${model}`, + op: `gen_ai.${operationName}`, + attributes: requestAttributes + }; + if (isStreamRequested) { + let originalResult2; + const instrumentedPromise2 = trace.startSpanManual(spanConfig, (span) => { + originalResult2 = originalMethod.apply(context, args); + if (options.recordInputs && params) { + addRequestAttributes(span, params, operationName, utils.shouldEnableTruncation(options.enableTruncation)); + } + return (async () => { + try { + const result = await originalResult2; + return streaming.instrumentStream( + result, + span, + options.recordOutputs ?? false + ); + } catch (error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exports$1.captureException(error, { + mechanism: { + handled: false, + type: "auto.ai.openai.stream", + data: { function: methodPath } + } + }); + span.end(); + throw error; + } + })(); + }); + return utils.wrapPromiseWithMethods(originalResult2, instrumentedPromise2, "auto.ai.openai"); + } + let originalResult; + const instrumentedPromise = trace.startSpan(spanConfig, (span) => { + originalResult = originalMethod.apply(context, args); + if (options.recordInputs && params) { + addRequestAttributes(span, params, operationName, utils.shouldEnableTruncation(options.enableTruncation)); + } + return originalResult.then( + (result) => { + utils$1.addResponseAttributes(span, result, options.recordOutputs); + return result; + }, + (error) => { + exports$1.captureException(error, { + mechanism: { + handled: false, + type: "auto.ai.openai", + data: { function: methodPath } + } + }); + throw error; + } + ); + }); + return utils.wrapPromiseWithMethods(originalResult, instrumentedPromise, "auto.ai.openai"); + }; +} +function createDeepProxy(target, currentPath = "", options) { + return new Proxy(target, { + get(obj, prop) { + const value = obj[prop]; + const methodPath = utils.buildMethodPath(currentPath, String(prop)); + const instrumentedMethod = constants.OPENAI_METHOD_REGISTRY[methodPath]; + if (typeof value === "function" && instrumentedMethod) { + return instrumentMethod( + value, + methodPath, + instrumentedMethod, + obj, + options + ); + } + if (typeof value === "function") { + return value.bind(obj); + } + if (value && typeof value === "object") { + return createDeepProxy(value, methodPath, options); + } + return value; + } + }); +} +function instrumentOpenAiClient(client, options) { + return createDeepProxy(client, "", utils.resolveAIRecordingOptions(options)); +} + +exports.addRequestAttributes = addRequestAttributes; +exports.extractRequestAttributes = extractRequestAttributes; +exports.instrumentOpenAiClient = instrumentOpenAiClient; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 30878: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const spanstatus = __nccwpck_require__(21119); +const utils$1 = __nccwpck_require__(78481); +const constants = __nccwpck_require__(45393); +const utils = __nccwpck_require__(3854); + +function processChatCompletionToolCalls(toolCalls, state) { + for (const toolCall of toolCalls) { + const index = toolCall.index; + if (index === void 0 || !toolCall.function) continue; + if (!(index in state.chatCompletionToolCalls)) { + state.chatCompletionToolCalls[index] = { + ...toolCall, + function: { + name: toolCall.function.name, + arguments: toolCall.function.arguments || "" + } + }; + } else { + const existingToolCall = state.chatCompletionToolCalls[index]; + if (toolCall.function.arguments && existingToolCall?.function) { + existingToolCall.function.arguments += toolCall.function.arguments; + } + } + } +} +function processChatCompletionChunk(chunk, state, recordOutputs) { + state.responseId = chunk.id ?? state.responseId; + state.responseModel = chunk.model ?? state.responseModel; + if (chunk.usage) { + state.promptTokens = chunk.usage.prompt_tokens; + state.completionTokens = chunk.usage.completion_tokens; + state.totalTokens = chunk.usage.total_tokens; + } + for (const choice of chunk.choices ?? []) { + if (recordOutputs) { + if (choice.delta?.content) { + state.responseTexts.push(choice.delta.content); + } + if (choice.delta?.tool_calls) { + processChatCompletionToolCalls(choice.delta.tool_calls, state); + } + } + if (choice.finish_reason) { + state.finishReasons.push(choice.finish_reason); + } + } +} +function processResponsesApiEvent(streamEvent, state, recordOutputs, span) { + if (!(streamEvent && typeof streamEvent === "object")) { + state.eventTypes.push("unknown:non-object"); + return; + } + if (streamEvent instanceof Error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + exports$1.captureException(streamEvent, { + mechanism: { + handled: false, + type: "auto.ai.openai.stream-response" + } + }); + return; + } + if (!("type" in streamEvent)) return; + const event = streamEvent; + if (!constants.RESPONSE_EVENT_TYPES.includes(event.type)) { + state.eventTypes.push(event.type); + return; + } + if (recordOutputs) { + if (event.type === "response.output_item.done" && "item" in event) { + state.responsesApiToolCalls.push(event.item); + } + if (event.type === "response.output_text.delta" && "delta" in event && event.delta) { + state.responseTexts.push(event.delta); + return; + } + } + if ("response" in event) { + const { response } = event; + state.responseId = response.id ?? state.responseId; + state.responseModel = response.model ?? state.responseModel; + if (response.usage) { + state.promptTokens = response.usage.input_tokens; + state.completionTokens = response.usage.output_tokens; + state.totalTokens = response.usage.total_tokens; + } + if (response.status) { + state.finishReasons.push(response.status); + } + if (recordOutputs && response.output_text) { + state.responseTexts.push(response.output_text); + } + } +} +async function* instrumentStream(stream, span, recordOutputs) { + const state = { + eventTypes: [], + responseTexts: [], + finishReasons: [], + responseId: "", + responseModel: "", + promptTokens: void 0, + completionTokens: void 0, + totalTokens: void 0, + chatCompletionToolCalls: {}, + responsesApiToolCalls: [] + }; + try { + for await (const event of stream) { + if (utils.isChatCompletionChunk(event)) { + processChatCompletionChunk(event, state, recordOutputs); + } else if (utils.isResponsesApiStreamEvent(event)) { + processResponsesApiEvent(event, state, recordOutputs, span); + } + yield event; + } + } finally { + const allToolCalls = [...Object.values(state.chatCompletionToolCalls), ...state.responsesApiToolCalls]; + utils$1.endStreamSpan(span, { ...state, toolCalls: allToolCalls }, recordOutputs); + } +} + +exports.instrumentStream = instrumentStream; +//# sourceMappingURL=streaming.js.map + + +/***/ }), + +/***/ 3854: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const genAiAttributes = __nccwpck_require__(53989); + +function isResponsesApiStreamEvent(event) { + return event !== null && typeof event === "object" && "type" in event && typeof event.type === "string" && event.type.startsWith("response."); +} +function isChatCompletionChunk(event) { + return event !== null && typeof event === "object" && "object" in event && event.object === "chat.completion.chunk"; +} +function addResponseAttributes(span, result, recordOutputs) { + if (!result || typeof result !== "object") return; + const response = result; + const attrs = {}; + if (typeof response.id === "string") { + attrs[genAiAttributes.GEN_AI_RESPONSE_ID_ATTRIBUTE] = response.id; + } + if (typeof response.model === "string") { + attrs[genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE] = response.model; + } + if (response.object === "conversation" && typeof response.id === "string") { + attrs[genAiAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE] = response.id; + } + if (response.usage && typeof response.usage === "object") { + const usage = response.usage; + const inputTokens = usage.prompt_tokens ?? usage.input_tokens; + if (typeof inputTokens === "number") { + attrs[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] = inputTokens; + } + const outputTokens = usage.completion_tokens ?? usage.output_tokens; + if (typeof outputTokens === "number") { + attrs[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] = outputTokens; + } + if (typeof usage.total_tokens === "number") { + attrs[genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE] = usage.total_tokens; + } + } + if (Array.isArray(response.choices)) { + const choices = response.choices; + const finishReasons = choices.map((choice) => choice.finish_reason).filter((reason) => typeof reason === "string"); + if (finishReasons.length > 0) { + attrs[genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE] = JSON.stringify(finishReasons); + } + if (recordOutputs) { + const responseTexts = choices.map((choice) => { + const message = choice.message; + return message?.content || ""; + }); + attrs[genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE] = JSON.stringify(responseTexts); + const toolCalls = choices.map((choice) => { + const message = choice.message; + return message?.tool_calls; + }).filter((calls) => Array.isArray(calls) && calls.length > 0).flat(); + if (toolCalls.length > 0) { + attrs[genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE] = JSON.stringify(toolCalls); + } + } + } + if (typeof response.status === "string") { + if (!attrs[genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE]) { + attrs[genAiAttributes.GEN_AI_RESPONSE_FINISH_REASONS_ATTRIBUTE] = JSON.stringify([response.status]); + } + } + if (recordOutputs) { + if (typeof response.output_text === "string" && !attrs[genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE]) { + attrs[genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE] = response.output_text; + } + if (Array.isArray(response.output) && response.output.length > 0 && !attrs[genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]) { + const functionCalls = response.output.filter( + (item) => item?.type === "function_call" + ); + if (functionCalls.length > 0) { + attrs[genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE] = JSON.stringify(functionCalls); + } + } + } + span.setAttributes(attrs); +} +function extractConversationId(params) { + if ("conversation" in params && typeof params.conversation === "string") { + return params.conversation; + } + if ("previous_response_id" in params && typeof params.previous_response_id === "string") { + return params.previous_response_id; + } + return void 0; +} +function extractRequestParameters(params) { + const attributes = { + [genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE]: params.model ?? "unknown" + }; + if ("temperature" in params) attributes[genAiAttributes.GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE] = params.temperature; + if ("top_p" in params) attributes[genAiAttributes.GEN_AI_REQUEST_TOP_P_ATTRIBUTE] = params.top_p; + if ("frequency_penalty" in params) attributes[genAiAttributes.GEN_AI_REQUEST_FREQUENCY_PENALTY_ATTRIBUTE] = params.frequency_penalty; + if ("presence_penalty" in params) attributes[genAiAttributes.GEN_AI_REQUEST_PRESENCE_PENALTY_ATTRIBUTE] = params.presence_penalty; + if ("stream" in params) attributes[genAiAttributes.GEN_AI_REQUEST_STREAM_ATTRIBUTE] = params.stream; + if ("encoding_format" in params) attributes[genAiAttributes.GEN_AI_REQUEST_ENCODING_FORMAT_ATTRIBUTE] = params.encoding_format; + if ("dimensions" in params) attributes[genAiAttributes.GEN_AI_REQUEST_DIMENSIONS_ATTRIBUTE] = params.dimensions; + const conversationId = extractConversationId(params); + if (conversationId) { + attributes[genAiAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE] = conversationId; + } + return attributes; +} + +exports.addResponseAttributes = addResponseAttributes; +exports.extractRequestParameters = extractRequestParameters; +exports.isChatCompletionChunk = isChatCompletionChunk; +exports.isResponsesApiStreamEvent = isResponsesApiStreamEvent; +//# sourceMappingURL=utils.js.map + + /***/ }), /***/ 79478: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); -const logger = __nccwpck_require__(38752); -const hasTracingEnabled = __nccwpck_require__(79223); +const debugLogger = __nccwpck_require__(41772); +const hasSpansEnabled = __nccwpck_require__(42982); const parseSampleRate = __nccwpck_require__(54078); -/** - * Makes a sampling decision for the given options. - * - * Called every time a root span is created. Only root spans which emerge with a `sampled` value of `true` will be - * sent to Sentry. - */ -function sampleSpan( - options, - samplingContext, -) { - // nothing to do if tracing is not enabled - if (!hasTracingEnabled.hasTracingEnabled(options)) { +function sampleSpan(options, samplingContext, sampleRand) { + if (!hasSpansEnabled.hasSpansEnabled(options)) { return [false]; } - - // Casting this from unknown, as the type of `sdkProcessingMetadata` is only changed in v9 and `normalizedRequest` is set in SentryHttpInstrumentation - const normalizedRequest = currentScopes.getIsolationScope().getScopeData().sdkProcessingMetadata - .normalizedRequest ; - - const enhancedSamplingContext = { - ...samplingContext, - normalizedRequest: samplingContext.normalizedRequest || normalizedRequest, - }; - - // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should - // work; prefer the hook if so + let localSampleRateWasApplied = void 0; let sampleRate; - if (typeof options.tracesSampler === 'function') { - sampleRate = options.tracesSampler(enhancedSamplingContext); - } else if (enhancedSamplingContext.parentSampled !== undefined) { - sampleRate = enhancedSamplingContext.parentSampled; - } else if (typeof options.tracesSampleRate !== 'undefined') { + if (typeof options.tracesSampler === "function") { + sampleRate = options.tracesSampler({ + ...samplingContext, + inheritOrSampleWith: (fallbackSampleRate) => { + if (typeof samplingContext.parentSampleRate === "number") { + return samplingContext.parentSampleRate; + } + if (typeof samplingContext.parentSampled === "boolean") { + return Number(samplingContext.parentSampled); + } + return fallbackSampleRate; + } + }); + localSampleRateWasApplied = true; + } else if (samplingContext.parentSampled !== void 0) { + sampleRate = samplingContext.parentSampled; + } else if (typeof options.tracesSampleRate !== "undefined") { sampleRate = options.tracesSampleRate; - } else { - // When `enableTracing === true`, we use a sample rate of 100% - sampleRate = 1; + localSampleRateWasApplied = true; } - - // Since this is coming from the user (or from a function provided by the user), who knows what we might get. - // (The only valid values are booleans or numbers between 0 and 1.) const parsedSampleRate = parseSampleRate.parseSampleRate(sampleRate); - - if (parsedSampleRate === undefined) { - debugBuild.DEBUG_BUILD && logger.logger.warn('[Tracing] Discarding transaction because of invalid sample rate.'); + if (parsedSampleRate === void 0) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn( + `[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( + sampleRate + )} of type ${JSON.stringify(typeof sampleRate)}.` + ); return [false]; } - - // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped if (!parsedSampleRate) { - debugBuild.DEBUG_BUILD && - logger.logger.log( - `[Tracing] Discarding transaction because ${ - typeof options.tracesSampler === 'function' - ? 'tracesSampler returned 0 or false' - : 'a negative sampling decision was inherited or tracesSampleRate is set to 0' - }`, - ); - return [false, parsedSampleRate]; + debugBuild.DEBUG_BUILD && debugLogger.debug.log( + `[Tracing] Discarding transaction because ${typeof options.tracesSampler === "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}` + ); + return [false, parsedSampleRate, localSampleRateWasApplied]; } - - // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is - // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false. - const shouldSample = Math.random() < parsedSampleRate; - - // if we're not going to keep it, we're done + const shouldSample = sampleRand < parsedSampleRate; if (!shouldSample) { - debugBuild.DEBUG_BUILD && - logger.logger.log( - `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( - sampleRate, - )})`, - ); - return [false, parsedSampleRate]; + debugBuild.DEBUG_BUILD && debugLogger.debug.log( + `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( + sampleRate + )})` + ); } - - return [true, parsedSampleRate]; + return [shouldSample, parsedSampleRate, localSampleRateWasApplied]; } exports.sampleSpan = sampleSpan; //# sourceMappingURL=sampling.js.map +/***/ }), + +/***/ 52325: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const carrier = __nccwpck_require__(38080); + +function setSegmentSpanCaptureStrategy(strategy) { + carrier.getSentryCarrier(carrier.getMainCarrier()).segmentSpanCaptureStrategy = strategy; +} +function getSegmentSpanCaptureStrategy() { + return carrier.getSentryCarrier(carrier.getMainCarrier()).segmentSpanCaptureStrategy; +} + +exports.getSegmentSpanCaptureStrategy = getSegmentSpanCaptureStrategy; +exports.setSegmentSpanCaptureStrategy = setSegmentSpanCaptureStrategy; +//# sourceMappingURL=segmentSpanCaptureStrategy.js.map + + /***/ }), /***/ 36854: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const propagationContext = __nccwpck_require__(37264); +const object = __nccwpck_require__(5906); +const propagationContext = __nccwpck_require__(95102); const spanUtils = __nccwpck_require__(47569); -/** - * A Sentry Span that is non-recording, meaning it will not be sent to Sentry. - */ -class SentryNonRecordingSpan { - - constructor(spanContext = {}) { +const NON_RECORDING_SPAN_FIELD = /* @__PURE__ */ Symbol.for("sentry.nonRecordingSpan"); +class SentryNonRecordingSpan { + constructor(spanContext = {}) { this._traceId = spanContext.traceId || propagationContext.generateTraceId(); this._spanId = spanContext.spanId || propagationContext.generateSpanId(); + this.dropReason = spanContext.dropReason; + object.addNonEnumerableProperty(this, NON_RECORDING_SPAN_FIELD, true); } - /** @inheritdoc */ - spanContext() { + spanContext() { return { spanId: this._spanId, traceId: this._traceId, - traceFlags: spanUtils.TRACE_FLAG_NONE, + traceFlags: spanUtils.TRACE_FLAG_NONE }; } - /** @inheritdoc */ - // eslint-disable-next-line @typescript-eslint/no-empty-function - end(_timestamp) {} - + end(_timestamp) { + } /** @inheritdoc */ - setAttribute(_key, _value) { + setAttribute(_key, _value) { return this; } - /** @inheritdoc */ - setAttributes(_values) { + setAttributes(_values) { return this; } - /** @inheritdoc */ - setStatus(_status) { + setStatus(_status) { return this; } - /** @inheritdoc */ - updateName(_name) { + updateName(_name) { return this; } - /** @inheritdoc */ - isRecording() { + isRecording() { return false; } - /** @inheritdoc */ - addEvent( - _name, - _attributesOrStartTime, - _startTime, - ) { + addEvent(_name, _attributesOrStartTime, _startTime) { + return this; + } + /** @inheritDoc */ + addLink(_link) { + return this; + } + /** @inheritDoc */ + addLinks(_links) { return this; } - /** * This should generally not be used, * but we need it for being compliant with the OTEL Span interface. @@ -72997,34 +32802,15 @@ class SentryNonRecordingSpan { * @hidden * @internal */ - addLink(_link) { - return this; - } - - /** - * This should generally not be used, - * but we need it for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - addLinks(_links) { - return this; - } - - /** - * This should generally not be used, - * but we need it for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - recordException(_exception, _time) { - // noop + recordException(_exception, _time) { } } +function spanIsNonRecordingSpan(span) { + return !!span && span[NON_RECORDING_SPAN_FIELD] === true; +} exports.SentryNonRecordingSpan = SentryNonRecordingSpan; +exports.spanIsNonRecordingSpan = spanIsNonRecordingSpan; //# sourceMappingURL=sentryNonRecordingSpan.js.map @@ -73033,40 +32819,25 @@ exports.SentryNonRecordingSpan = SentryNonRecordingSpan; /***/ 53263: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const envelope = __nccwpck_require__(58784); -const metricSummary = __nccwpck_require__(48306); const semanticAttributes = __nccwpck_require__(36827); -const logger = __nccwpck_require__(38752); -const object = __nccwpck_require__(16100); -const propagationContext = __nccwpck_require__(37264); -const time = __nccwpck_require__(75872); +const debugLogger = __nccwpck_require__(41772); +const propagationContext = __nccwpck_require__(95102); const spanUtils = __nccwpck_require__(47569); +const time = __nccwpck_require__(66690); const dynamicSamplingContext = __nccwpck_require__(29724); const logSpans = __nccwpck_require__(28761); const measurement = __nccwpck_require__(50722); +const segmentSpanCaptureStrategy = __nccwpck_require__(52325); +const hasSpanStreamingEnabled = __nccwpck_require__(73642); const utils = __nccwpck_require__(77989); -const MAX_SPAN_COUNT = 1000; - -/** - * Span contains all data about a span - */ -class SentrySpan { - - /** Epoch timestamp in seconds when the span started. */ - - /** Epoch timestamp in seconds when the span ended. */ - - /** Internal keeper of the status */ - - /** The timed events added to this span. */ - - /** if true, treat span as a standalone span (not part of a transaction) */ - +const MAX_SPAN_COUNT = 1e3; +class SentrySpan { /** * You should never call the constructor manually, always use `Sentry.startSpan()` * or other span methods. @@ -73074,63 +32845,57 @@ class SentrySpan { * @hideconstructor * @hidden */ - constructor(spanContext = {}) { + constructor(spanContext = {}) { this._traceId = spanContext.traceId || propagationContext.generateTraceId(); this._spanId = spanContext.spanId || propagationContext.generateSpanId(); this._startTime = spanContext.startTimestamp || time.timestampInSeconds(); - + this._links = spanContext.links; this._attributes = {}; this.setAttributes({ - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'manual', + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "manual", [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op, - ...spanContext.attributes, + ...spanContext.attributes }); - this._name = spanContext.name; - if (spanContext.parentSpanId) { this._parentSpanId = spanContext.parentSpanId; } - // We want to include booleans as well here - if ('sampled' in spanContext) { + if ("sampled" in spanContext) { this._sampled = spanContext.sampled; } if (spanContext.endTimestamp) { this._endTime = spanContext.endTimestamp; } - this._events = []; - this._isStandaloneSpan = spanContext.isStandalone; - - // If the span is already ended, ensure we finalize the span immediately if (this._endTime) { this._onSpanEnded(); } } - - /** - * This should generally not be used, - * but it is needed for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - addLink(_link) { + /** @inheritDoc */ + addLink(link) { + if (this._frozen) { + return this; + } + if (this._links) { + this._links.push(link); + } else { + this._links = [link]; + } return this; } - - /** - * This should generally not be used, - * but it is needed for being compliant with the OTEL Span interface. - * - * @hidden - * @internal - */ - addLinks(_links) { + /** @inheritDoc */ + addLinks(links) { + if (this._frozen) { + return this; + } + if (this._links) { + this._links.push(...links); + } else { + this._links = links; + } return this; } - /** * This should generally not be used, * but it is needed for being compliant with the OTEL Span interface. @@ -73138,38 +32903,37 @@ class SentrySpan { * @hidden * @internal */ - recordException(_exception, _time) { - // noop + recordException(_exception, _time) { } - /** @inheritdoc */ - spanContext() { + spanContext() { const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this; return { spanId, traceId, - traceFlags: sampled ? spanUtils.TRACE_FLAG_SAMPLED : spanUtils.TRACE_FLAG_NONE, + traceFlags: sampled ? spanUtils.TRACE_FLAG_SAMPLED : spanUtils.TRACE_FLAG_NONE }; } - /** @inheritdoc */ - setAttribute(key, value) { - if (value === undefined) { - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete + setAttribute(key, value) { + if (this._frozen) { + return this; + } + if (value === void 0) { delete this._attributes[key]; } else { this._attributes[key] = value; } - + if (key === semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE && value !== void 0 && utils.spanShouldInferOtelSource(this)) { + utils.markSpanSourceAsExplicit(this); + } return this; } - /** @inheritdoc */ - setAttributes(attributes) { - Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key])); + setAttributes(attributes) { + Object.keys(attributes).forEach((key) => this.setAttribute(key, attributes[key])); return this; } - /** * This should generally not be used, * but we need it for browser tracing where we want to adjust the start time afterwards. @@ -73178,40 +32942,46 @@ class SentrySpan { * @hidden * @internal */ - updateStartTime(timeInput) { + updateStartTime(timeInput) { + if (this._frozen) { + return; + } this._startTime = spanUtils.spanTimeInputToSeconds(timeInput); } - /** * @inheritDoc */ - setStatus(value) { + setStatus(value) { + if (this._frozen) { + return this; + } this._status = value; return this; } - /** * @inheritDoc */ - updateName(name) { + updateName(name) { + if (this._frozen) { + return this; + } this._name = name; - this.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'custom'); + if (!utils.spanShouldInferOtelSource(this)) { + this.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "custom"); + } return this; } - /** @inheritdoc */ - end(endTimestamp) { - // If already ended, skip + end(endTimestamp) { if (this._endTime) { + this._frozen = utils.spanIsTracerProviderSpan(this); return; } - this._endTime = spanUtils.spanTimeInputToSeconds(endTimestamp); logSpans.logSpanEnd(this); - this._onSpanEnded(); + this._frozen = utils.spanIsTracerProviderSpan(this); } - /** * Get JSON representation of this span. * @@ -73220,8 +32990,8 @@ class SentrySpan { * of SDK code. If you need to get a JSON representation of a span, * use `spanToJSON(span)` instead. */ - getSpanJSON() { - return object.dropUndefinedKeys({ + getSpanJSON() { + return { data: this._attributes, description: this._name, op: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP], @@ -73231,45 +33001,60 @@ class SentrySpan { status: spanUtils.getStatusMessage(this._status), timestamp: this._endTime, trace_id: this._traceId, - origin: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] , - _metrics_summary: metricSummary.getMetricSummaryJsonForSpan(this), - profile_id: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_PROFILE_ID] , - exclusive_time: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME] , + origin: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN], + profile_id: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_PROFILE_ID], + exclusive_time: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME], measurements: measurement.timedEventsToMeasurements(this._events), - is_segment: (this._isStandaloneSpan && spanUtils.getRootSpan(this) === this) || undefined, - segment_id: this._isStandaloneSpan ? spanUtils.getRootSpan(this).spanContext().spanId : undefined, - }); + is_segment: this._isStandaloneSpan && spanUtils.getRootSpan(this) === this || void 0, + segment_id: this._isStandaloneSpan ? spanUtils.getRootSpan(this).spanContext().spanId : void 0, + links: spanUtils.convertSpanLinksForEnvelope(this._links) + }; + } + /** + * Get {@link StreamedSpanJSON} representation of this span. + * + * @hidden + * @internal This method is purely for internal purposes and should not be used outside + * of SDK code. If you need to get a JSON representation of a span, + * use `spanToStreamedSpanJSON(span)` instead. + */ + getStreamedSpanJSON() { + return { + name: this._name ?? "", + span_id: this._spanId, + trace_id: this._traceId, + parent_span_id: this._parentSpanId, + start_timestamp: this._startTime, + // just in case _endTime is not set, we use the start time (i.e. duration 0) + end_timestamp: this._endTime ?? this._startTime, + is_segment: this._isStandaloneSpan || this === spanUtils.getRootSpan(this), + status: spanUtils.getSimpleStatus(this._status), + attributes: spanUtils.addStatusMessageAttribute(this._attributes, this._status), + links: spanUtils.getStreamedSpanLinks(this._links) + }; } - /** @inheritdoc */ - isRecording() { + isRecording() { return !this._endTime && !!this._sampled; } - /** * @inheritdoc */ - addEvent( - name, - attributesOrStartTime, - startTime, - ) { - debugBuild.DEBUG_BUILD && logger.logger.log('[Tracing] Adding an event to span:', name); - + addEvent(name, attributesOrStartTime, startTime) { + if (this._frozen) { + return this; + } + debugBuild.DEBUG_BUILD && debugLogger.debug.log("[Tracing] Adding an event to span:", name); const time$1 = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || time.timestampInSeconds(); const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {}; - const event = { name, time: spanUtils.spanTimeInputToSeconds(time$1), - attributes, + attributes }; - this._events.push(event); - return this; } - /** * This method should generally not be used, * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set. @@ -73278,170 +33063,149 @@ class SentrySpan { * @hidden * @experimental */ - isStandaloneSpan() { + isStandaloneSpan() { return !!this._isStandaloneSpan; } - /** Emit `spanEnd` when the span is ended. */ - _onSpanEnded() { + _onSpanEnded() { const client = currentScopes.getClient(); if (client) { - client.emit('spanEnd', this); + client.emit("spanEnd", this); + if (!this._isStandaloneSpan) { + client.emit("afterSpanEnd", this); + } } - - // A segment span is basically the root span of a local span tree. - // So for now, this is either what we previously refer to as the root span, - // or a standalone span. - const isSegmentSpan = this._isStandaloneSpan || this === spanUtils.getRootSpan(this); - - if (!isSegmentSpan) { - return; - } - - // if this is a standalone span, we send it immediately + const rootSpan = spanUtils.getRootSpan(this); + const isSegmentSpan = this._isStandaloneSpan || this === rootSpan; if (this._isStandaloneSpan) { if (this._sampled) { sendSpanEnvelope(envelope.createSpanEnvelope([this], client)); } else { - debugBuild.DEBUG_BUILD && - logger.logger.log('[Tracing] Discarding standalone span because its trace was not chosen to be sampled.'); + debugBuild.DEBUG_BUILD && debugLogger.debug.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."); if (client) { - client.recordDroppedEvent('sample_rate', 'span'); + client.recordDroppedEvent("sample_rate", "span"); } } return; } - - const transactionEvent = this._convertSpanToTransaction(); - if (transactionEvent) { - const scope = utils.getCapturedScopesOnSpan(this).scope || currentScopes.getCurrentScope(); - scope.captureEvent(transactionEvent); + if (!isSegmentSpan) { + const strategy2 = segmentSpanCaptureStrategy.getSegmentSpanCaptureStrategy(); + if (strategy2) { + const scope2 = utils.getCapturedScopesOnSpan(this).scope || currentScopes.getCurrentScope(); + strategy2.onChildSpanEnded(this, rootSpan, (options) => this._convertSpanToTransaction(options), scope2); + } + return; + } + if (client && hasSpanStreamingEnabled.hasSpanStreamingEnabled(client)) { + client.emit("afterSegmentSpanEnd", this); + return; + } + const scope = utils.getCapturedScopesOnSpan(this).scope || currentScopes.getCurrentScope(); + const strategy = segmentSpanCaptureStrategy.getSegmentSpanCaptureStrategy(); + if (strategy) { + strategy.onSegmentSpanEnded((options) => this._convertSpanToTransaction(options), scope); + } else { + const transactionEvent = this._convertSpanToTransaction(); + if (transactionEvent) { + scope.captureEvent(transactionEvent); + } } } - /** * Finish the transaction & prepare the event to send to Sentry. */ - _convertSpanToTransaction() { - // We can only convert finished spans + _convertSpanToTransaction(options = {}) { if (!isFullFinishedSpan(spanUtils.spanToJSON(this))) { - return undefined; + return void 0; } - if (!this._name) { - debugBuild.DEBUG_BUILD && logger.logger.warn('Transaction has no name, falling back to ``.'); - this._name = ''; + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Transaction has no name, falling back to ``."); + this._name = ""; } - const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = utils.getCapturedScopesOnSpan(this); - const scope = capturedSpanScope || currentScopes.getCurrentScope(); - const client = scope.getClient() || currentScopes.getClient(); - + const normalizedRequest = capturedSpanScope?.getScopeData().sdkProcessingMetadata?.normalizedRequest; if (this._sampled !== true) { - // At this point if `sampled !== true` we want to discard the transaction. - debugBuild.DEBUG_BUILD && logger.logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.'); - - if (client) { - client.recordDroppedEvent('sample_rate', 'transaction'); - } - - return undefined; + return void 0; } - - // The transaction span itself as well as any potential standalone spans should be filtered out - const finishedSpans = spanUtils.getSpanDescendants(this).filter(span => span !== this && !isStandaloneSpan(span)); - - const spans = finishedSpans.map(span => spanUtils.spanToJSON(span)).filter(isFullFinishedSpan); - - const source = this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ; - - // remove internal root span attributes we don't need to send. - /* eslint-disable @typescript-eslint/no-dynamic-delete */ + options.onSpanCaptured?.(this); + const spans = []; + for (const descendant of spanUtils.getSpanDescendants(this)) { + if (descendant === this || isStandaloneSpan(descendant) || options.isSpanAlreadyCaptured?.(descendant)) { + continue; + } + const spanJSON = spanUtils.spanToJSON(descendant); + if (!isFullFinishedSpan(spanJSON)) { + continue; + } + options.onSpanCaptured?.(descendant); + spans.push(spanJSON); + } + const source = this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; delete this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; - spans.forEach(span => { - span.data && delete span.data[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + let hasGenAiSpans = false; + spans.forEach((span) => { + delete span.data[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + if (span.op?.startsWith("gen_ai.")) { + hasGenAiSpans = true; + } }); - // eslint-enabled-next-line @typescript-eslint/no-dynamic-delete - const transaction = { contexts: { - trace: spanUtils.spanToTransactionTraceContext(this), + trace: spanUtils.spanToTransactionTraceContext(this) }, - spans: + spans: ( // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here // we do not use spans anymore after this point - spans.length > MAX_SPAN_COUNT - ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT) - : spans, + spans.length > MAX_SPAN_COUNT ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT) : spans + ), start_timestamp: this._startTime, timestamp: this._endTime, transaction: this._name, - type: 'transaction', + type: "transaction", sdkProcessingMetadata: { capturedSpanScope, capturedSpanIsolationScope, - ...object.dropUndefinedKeys({ - dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(this), - }), + dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(this), + hasGenAiSpans }, - _metrics_summary: metricSummary.getMetricSummaryJsonForSpan(this), - ...(source && { + request: normalizedRequest, + ...source && { transaction_info: { - source, - }, - }), + source + } + } }; - const measurements = measurement.timedEventsToMeasurements(this._events); const hasMeasurements = measurements && Object.keys(measurements).length; - if (hasMeasurements) { - debugBuild.DEBUG_BUILD && - logger.logger.log( - '[Measurements] Adding measurements to transaction event', - JSON.stringify(measurements, undefined, 2), - ); + debugBuild.DEBUG_BUILD && debugLogger.debug.log( + "[Measurements] Adding measurements to transaction event", + JSON.stringify(measurements, void 0, 2) + ); transaction.measurements = measurements; } - return transaction; } } - function isSpanTimeInput(value) { - return (value && typeof value === 'number') || value instanceof Date || Array.isArray(value); + return value && typeof value === "number" || value instanceof Date || Array.isArray(value); } - -// We want to filter out any incomplete SpanJSON objects function isFullFinishedSpan(input) { return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id; } - -/** `SentrySpan`s can be sent as a standalone span rather than belonging to a transaction */ function isStandaloneSpan(span) { return span instanceof SentrySpan && span.isStandaloneSpan(); } - -/** - * Sends a `SpanEnvelope`. - * - * Note: If the envelope's spans are dropped, e.g. via `beforeSendSpan`, - * the envelope will not be sent either. - */ function sendSpanEnvelope(envelope) { const client = currentScopes.getClient(); if (!client) { return; } - const spanItems = envelope[1]; if (!spanItems || spanItems.length === 0) { - client.recordDroppedEvent('before_send', 'span'); + client.recordDroppedEvent("before_send", "span"); return; } - - // sendEnvelope should not throw - // eslint-disable-next-line @typescript-eslint/no-floating-promises client.sendEnvelope(envelope); } @@ -73449,75 +33213,515 @@ exports.SentrySpan = SentrySpan; //# sourceMappingURL=sentrySpan.js.map +/***/ }), + +/***/ 33579: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const object = __nccwpck_require__(5906); + +function withStreamedSpan(callback) { + object.addNonEnumerableProperty(callback, "_streamed", true); + return callback; +} +function isStreamedBeforeSendSpanCallback(callback) { + return !!callback && typeof callback === "function" && "_streamed" in callback && !!callback._streamed; +} + +exports.isStreamedBeforeSendSpanCallback = isStreamedBeforeSendSpanCallback; +exports.withStreamedSpan = withStreamedSpan; +//# sourceMappingURL=beforeSendSpan.js.map + + +/***/ }), + +/***/ 29729: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const semanticAttributes = __nccwpck_require__(36827); +const scopeData = __nccwpck_require__(72332); +const spanUtils = __nccwpck_require__(47569); +const utils = __nccwpck_require__(77989); +const beforeSendSpan = __nccwpck_require__(33579); +const scopeContextAttributes = __nccwpck_require__(3660); +const constants = __nccwpck_require__(5958); +const attributes = __nccwpck_require__(88264); + +function captureSpan(span, client) { + const spanJSON = spanUtils.spanToStreamedSpanJSON(span); + const segmentSpan = spanUtils.INTERNAL_getSegmentSpan(span); + const serializedSegmentSpan = spanUtils.spanToStreamedSpanJSON(segmentSpan); + const { isolationScope: spanIsolationScope, scope: spanScope } = utils.getCapturedScopesOnSpan(span); + const finalScopeData = scopeData.getCombinedScopeData(spanIsolationScope, spanScope); + applyCommonSpanAttributes(spanJSON, serializedSegmentSpan, client, finalScopeData); + const spanKind = span.kind; + client.emit("preprocessSpan", spanJSON, { spanKind }); + if (spanJSON.is_segment) { + applyScopeToSegmentSpan(spanJSON, finalScopeData); + applySdkMetadataToSegmentSpan(spanJSON, client); + client.emit("processSegmentSpan", spanJSON); + } + client.emit("processSpan", spanJSON); + const { beforeSendSpan: beforeSendSpan$1 } = client.getOptions(); + const processedSpan = beforeSendSpan$1 && beforeSendSpan.isStreamedBeforeSendSpanCallback(beforeSendSpan$1) ? applyBeforeSendSpanCallback(spanJSON, beforeSendSpan$1) : spanJSON; + const spanNameSource = processedSpan.attributes?.[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; + if (spanJSON.is_segment && spanNameSource) { + safeSetSpanJSONAttributes(processedSpan, { + ["sentry.segment.name.source"]: spanNameSource + }); + } + return { + ...spanUtils.streamedSpanJsonToSerializedSpan(processedSpan), + _segmentSpan: segmentSpan + }; +} +function applyScopeToSegmentSpan(segmentSpanJSON, scopeData) { + const contextAttributes = scopeContextAttributes.scopeContextsToSpanAttributes(scopeData.contexts); + safeSetSpanJSONAttributes(segmentSpanJSON, contextAttributes); +} +function safeSetSpanJSONAttributes(spanJSON, newAttributes) { + const originalAttributes = spanJSON.attributes ?? (spanJSON.attributes = {}); + Object.entries(newAttributes).forEach(([key, value]) => { + if (value != null && !(key in originalAttributes)) { + originalAttributes[key] = value; + } + }); +} +function applySdkMetadataToSegmentSpan(segmentSpanJSON, client) { + const integrationNames = client.getIntegrationNames(); + if (!integrationNames.length) return; + safeSetSpanJSONAttributes(segmentSpanJSON, { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS]: integrationNames + }); +} +function applyCommonSpanAttributes(spanJSON, serializedSegmentSpan, client, scopeData) { + const sdk = client.getSdkMetadata(); + const { release, environment } = client.getOptions(); + safeSetSpanJSONAttributes(spanJSON, { + [attributes.SENTRY_TRACE_LIFECYCLE]: "stream", + [attributes.SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name, + [attributes.SENTRY_SEGMENT_ID]: serializedSegmentSpan.span_id, + [attributes.SENTRY_SDK_NAME]: sdk?.sdk?.name, + [attributes.SENTRY_SDK_VERSION]: sdk?.sdk?.version, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment || constants.DEFAULT_ENVIRONMENT, + [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id, + [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email, + [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address, + [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username, + ...scopeData.attributes + }); +} +function applyBeforeSendSpanCallback(span, beforeSendSpan) { + const modifedSpan = beforeSendSpan(span); + if (!modifedSpan) { + spanUtils.showSpanDropWarning(); + return span; + } + return modifedSpan; +} + +exports.applyBeforeSendSpanCallback = applyBeforeSendSpanCallback; +exports.captureSpan = captureSpan; +exports.safeSetSpanJSONAttributes = safeSetSpanJSONAttributes; +//# sourceMappingURL=captureSpan.js.map + + +/***/ }), + +/***/ 45684: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const dsn = __nccwpck_require__(91582); +const envelope = __nccwpck_require__(56987); +const isBrowser = __nccwpck_require__(71287); +const randomSafeContext = __nccwpck_require__(28695); + +function createStreamedSpanEnvelope(serializedSpans, dsc, client) { + const options = client.getOptions(); + const dsn$1 = client.getDsn(); + const tunnel = options.tunnel; + const sdk = envelope.getSdkMetadataForEnvelopeHeader(options._metadata); + const headers = { + sent_at: new Date(randomSafeContext.safeDateNow()).toISOString(), + ...dscHasRequiredProps(dsc) && { trace: dsc }, + ...sdk && { sdk }, + ...!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) } + }; + const inferSetting = client.getDataCollectionOptions().userInfo ? "auto" : "never"; + const spanContainer = [ + { type: "span", item_count: serializedSpans.length, content_type: "application/vnd.sentry.items.span.v2+json" }, + { + version: 2, + ...isBrowser.isBrowser() && { + ingest_settings: { infer_ip: inferSetting, infer_user_agent: inferSetting } + }, + items: serializedSpans + } + ]; + return envelope.createEnvelope(headers, [spanContainer]); +} +function dscHasRequiredProps(dsc) { + return !!dsc.trace_id && !!dsc.public_key; +} + +exports.createStreamedSpanEnvelope = createStreamedSpanEnvelope; +//# sourceMappingURL=envelope.js.map + + +/***/ }), + +/***/ 15775: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(26925); + +function estimateSerializedSpanSizeInBytes(span) { + let weight = 156; + weight += span.name.length * 2; + weight += attributes.estimateTypedAttributesSizeInBytes(span.attributes); + if (span.links && span.links.length > 0) { + const firstLink = span.links[0]; + const attributes$1 = firstLink?.attributes; + const linkWeight = 100 + (attributes$1 ? attributes.estimateTypedAttributesSizeInBytes(attributes$1) : 0); + weight += linkWeight * span.links.length; + } + return weight; +} + +exports.estimateSerializedSpanSizeInBytes = estimateSerializedSpanSizeInBytes; +//# sourceMappingURL=estimateSize.js.map + + +/***/ }), + +/***/ 21699: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const isBrowser = __nccwpck_require__(71287); +const hasSpanStreamingEnabled = __nccwpck_require__(73642); +const spanJsonToStreamedSpan = __nccwpck_require__(20827); + +function extractGenAiSpansFromEvent(event, client) { + if (event.type !== "transaction" || !event.spans?.length || !event.sdkProcessingMetadata?.hasGenAiSpans || client.getOptions().streamGenAiSpans === false || hasSpanStreamingEnabled.hasSpanStreamingEnabled(client)) { + return void 0; + } + const genAiSpans = []; + const remainingSpans = []; + for (const span of event.spans) { + if (span.op?.startsWith("gen_ai.")) { + genAiSpans.push(spanJsonToStreamedSpan.spanJsonToSerializedStreamedSpan(span)); + } else { + remainingSpans.push(span); + } + } + if (genAiSpans.length === 0) { + return void 0; + } + event.spans = remainingSpans; + const inferSetting = client.getDataCollectionOptions().userInfo ? "auto" : "never"; + return [ + { type: "span", item_count: genAiSpans.length, content_type: "application/vnd.sentry.items.span.v2+json" }, + { + version: 2, + ...isBrowser.isBrowser() && { + ingest_settings: { infer_ip: inferSetting, infer_user_agent: inferSetting } + }, + items: genAiSpans + } + ]; +} + +exports.extractGenAiSpansFromEvent = extractGenAiSpansFromEvent; +//# sourceMappingURL=extractGenAiSpans.js.map + + +/***/ }), + +/***/ 73642: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function hasSpanStreamingEnabled(client) { + return client.getOptions().traceLifecycle === "stream"; +} + +exports.hasSpanStreamingEnabled = hasSpanStreamingEnabled; +//# sourceMappingURL=hasSpanStreamingEnabled.js.map + + +/***/ }), + +/***/ 3660: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function scopeContextsToSpanAttributes(contexts) { + const attrs = {}; + const { response, profile, cloud_resource, culture, state } = contexts; + if (response) { + if (response.status_code != null) { + attrs["http.response.status_code"] = response.status_code; + } + if (response.body_size != null) { + attrs["http.response.body.size"] = response.body_size; + } + } + if (profile) { + if (profile.profile_id) { + attrs["sentry.profile_id"] = profile.profile_id; + } + if (profile.profiler_id) { + attrs["sentry.profiler_id"] = profile.profiler_id; + } + } + if (cloud_resource) { + for (const [key, value] of Object.entries(cloud_resource)) { + if (value != null) { + attrs[key] = value; + } + } + } + if (culture) { + if (culture.locale) { + attrs["culture.locale"] = culture.locale; + } + if (culture.timezone) { + attrs["culture.timezone"] = culture.timezone; + } + } + if (state?.state && typeof state.state.type === "string") { + attrs["state.type"] = state.state.type; + } + const angular = contexts["angular"]; + if (angular) { + const version = angular["version"]; + if (typeof version === "string" || typeof version === "number") { + attrs["angular.version"] = version; + } + } + const react = contexts["react"]; + if (react) { + const version = react["version"]; + if (typeof version === "string" || typeof version === "number") { + attrs["react.version"] = version; + } + } + return attrs; +} + +exports.scopeContextsToSpanAttributes = scopeContextsToSpanAttributes; +//# sourceMappingURL=scopeContextAttributes.js.map + + +/***/ }), + +/***/ 48298: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const timer = __nccwpck_require__(85548); +const dynamicSamplingContext = __nccwpck_require__(29724); +const envelope = __nccwpck_require__(45684); +const estimateSize = __nccwpck_require__(15775); + +const MAX_SPANS_PER_ENVELOPE = 1e3; +const MAX_TRACE_WEIGHT_IN_BYTES = 5e6; +class SpanBuffer { + constructor(client, options) { + this._traceBuckets = /* @__PURE__ */ new Map(); + this._client = client; + const { maxSpanLimit, flushInterval, maxTraceWeightInBytes } = options ?? {}; + this._maxSpanLimit = maxSpanLimit && maxSpanLimit > 0 && maxSpanLimit <= MAX_SPANS_PER_ENVELOPE ? maxSpanLimit : MAX_SPANS_PER_ENVELOPE; + this._flushInterval = flushInterval && flushInterval > 0 ? flushInterval : 5e3; + this._maxTraceWeight = maxTraceWeightInBytes && maxTraceWeightInBytes > 0 ? maxTraceWeightInBytes : MAX_TRACE_WEIGHT_IN_BYTES; + this._client.on("flush", () => { + this.drain(); + }); + this._client.on("close", () => { + this._traceBuckets.forEach((bucket) => { + clearTimeout(bucket.timeout); + }); + this._traceBuckets.clear(); + }); + } + /** + * Add a span to the buffer. + */ + add(spanJSON) { + const traceId = spanJSON.trace_id; + let bucket = this._traceBuckets.get(traceId); + if (!bucket) { + bucket = { + spans: /* @__PURE__ */ new Set(), + size: 0, + timeout: timer.safeUnref( + setTimeout(() => { + this.flush(traceId); + }, this._flushInterval) + ) + }; + this._traceBuckets.set(traceId, bucket); + } + bucket.spans.add(spanJSON); + bucket.size += estimateSize.estimateSerializedSpanSizeInBytes(spanJSON); + if (bucket.spans.size >= this._maxSpanLimit || bucket.size >= this._maxTraceWeight) { + this.flush(traceId); + } + } + /** + * Drain and flush all buffered traces. + */ + drain() { + if (!this._traceBuckets.size) { + return; + } + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Flushing span tree map with ${this._traceBuckets.size} traces`); + this._traceBuckets.forEach((_, traceId) => { + this.flush(traceId); + }); + } + /** + * Flush spans of a specific trace. + * In contrast to {@link SpanBuffer.drain}, this method does not flush all traces, but only the one with the given traceId. + */ + flush(traceId) { + const bucket = this._traceBuckets.get(traceId); + if (!bucket) { + return; + } + if (!bucket.spans.size) { + this._removeTrace(traceId); + return; + } + const spans = Array.from(bucket.spans); + const segmentSpan = spans[0]?._segmentSpan; + if (!segmentSpan) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No segment span reference found on span JSON, cannot compute DSC"); + this._removeTrace(traceId); + return; + } + const dsc = dynamicSamplingContext.getDynamicSamplingContextFromSpan(segmentSpan); + const cleanedSpans = spans.map((spanJSON) => { + const { _segmentSpan, ...cleanSpanJSON } = spanJSON; + return cleanSpanJSON; + }); + const envelope$1 = envelope.createStreamedSpanEnvelope(cleanedSpans, dsc, this._client); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Sending span envelope for trace ${traceId} with ${cleanedSpans.length} spans`); + this._client.sendEnvelope(envelope$1).then(null, (reason) => { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Error while sending streamed span envelope:", reason); + }); + this._removeTrace(traceId); + } + _removeTrace(traceId) { + const bucket = this._traceBuckets.get(traceId); + if (bucket) { + clearTimeout(bucket.timeout); + } + this._traceBuckets.delete(traceId); + } +} + +exports.SpanBuffer = SpanBuffer; +//# sourceMappingURL=spanBuffer.js.map + + +/***/ }), + +/***/ 20827: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const spanUtils = __nccwpck_require__(47569); + +function spanJsonToSerializedStreamedSpan(span) { + const streamedSpan = { + trace_id: span.trace_id, + span_id: span.span_id, + parent_span_id: span.parent_span_id, + name: span.description || "", + start_timestamp: span.start_timestamp, + end_timestamp: span.timestamp || span.start_timestamp, + status: !span.status || span.status === "ok" || span.status === "cancelled" ? "ok" : "error", + is_segment: false, + attributes: { ...span.data }, + links: span.links + }; + return spanUtils.streamedSpanJsonToSerializedSpan(streamedSpan); +} + +exports.spanJsonToSerializedStreamedSpan = spanJsonToSerializedStreamedSpan; +//# sourceMappingURL=spanJsonToStreamedSpan.js.map + + /***/ }), /***/ 21119: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const SPAN_STATUS_UNSET = 0; const SPAN_STATUS_OK = 1; const SPAN_STATUS_ERROR = 2; - -/** - * Converts a HTTP status code into a sentry status with a message. - * - * @param httpStatus The HTTP response status code. - * @returns The span status or unknown_error. - */ -// https://develop.sentry.dev/sdk/event-payloads/span/ function getSpanStatusFromHttpCode(httpStatus) { if (httpStatus < 400 && httpStatus >= 100) { return { code: SPAN_STATUS_OK }; } - if (httpStatus >= 400 && httpStatus < 500) { switch (httpStatus) { case 401: - return { code: SPAN_STATUS_ERROR, message: 'unauthenticated' }; + return { code: SPAN_STATUS_ERROR, message: "unauthenticated" }; case 403: - return { code: SPAN_STATUS_ERROR, message: 'permission_denied' }; + return { code: SPAN_STATUS_ERROR, message: "permission_denied" }; case 404: - return { code: SPAN_STATUS_ERROR, message: 'not_found' }; + return { code: SPAN_STATUS_ERROR, message: "not_found" }; case 409: - return { code: SPAN_STATUS_ERROR, message: 'already_exists' }; + return { code: SPAN_STATUS_ERROR, message: "already_exists" }; case 413: - return { code: SPAN_STATUS_ERROR, message: 'failed_precondition' }; + return { code: SPAN_STATUS_ERROR, message: "failed_precondition" }; case 429: - return { code: SPAN_STATUS_ERROR, message: 'resource_exhausted' }; + return { code: SPAN_STATUS_ERROR, message: "resource_exhausted" }; case 499: - return { code: SPAN_STATUS_ERROR, message: 'cancelled' }; + return { code: SPAN_STATUS_ERROR, message: "cancelled" }; default: - return { code: SPAN_STATUS_ERROR, message: 'invalid_argument' }; + return { code: SPAN_STATUS_ERROR, message: "invalid_argument" }; } } - if (httpStatus >= 500 && httpStatus < 600) { switch (httpStatus) { case 501: - return { code: SPAN_STATUS_ERROR, message: 'unimplemented' }; + return { code: SPAN_STATUS_ERROR, message: "unimplemented" }; case 503: - return { code: SPAN_STATUS_ERROR, message: 'unavailable' }; + return { code: SPAN_STATUS_ERROR, message: "unavailable" }; case 504: - return { code: SPAN_STATUS_ERROR, message: 'deadline_exceeded' }; + return { code: SPAN_STATUS_ERROR, message: "deadline_exceeded" }; default: - return { code: SPAN_STATUS_ERROR, message: 'internal_error' }; + return { code: SPAN_STATUS_ERROR, message: "internal_error" }; } } - - return { code: SPAN_STATUS_ERROR, message: 'unknown_error' }; + return { code: SPAN_STATUS_ERROR, message: "internal_error" }; } - -/** - * Sets the Http status attributes on the current span based on the http code. - * Additionally, the span's status is updated, depending on the http code. - */ function setHttpStatus(span, httpStatus) { - span.setAttribute('http.response.status_code', httpStatus); - + span.setAttribute("http.response.status_code", httpStatus); const spanStatus = getSpanStatusFromHttpCode(httpStatus); - if (spanStatus.message !== 'unknown_error') { + if (spanStatus.message !== "unknown_error") { span.setStatus(spanStatus); } } @@ -73535,20 +33739,25 @@ exports.setHttpStatus = setHttpStatus; /***/ 97956: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const index = __nccwpck_require__(29878); const carrier = __nccwpck_require__(38080); const currentScopes = __nccwpck_require__(8131); -const index = __nccwpck_require__(29878); const debugBuild = __nccwpck_require__(14488); const semanticAttributes = __nccwpck_require__(36827); -const logger = __nccwpck_require__(38752); -const propagationContext = __nccwpck_require__(37264); -const tracing = __nccwpck_require__(15977); +const baggage = __nccwpck_require__(2135); +const debugLogger = __nccwpck_require__(41772); const handleCallbackErrors = __nccwpck_require__(77864); -const hasTracingEnabled = __nccwpck_require__(79223); +const hasSpansEnabled = __nccwpck_require__(42982); +const shouldIgnoreSpan = __nccwpck_require__(65771); +const hasSpanStreamingEnabled = __nccwpck_require__(73642); +const parseSampleRate = __nccwpck_require__(54078); +const propagationContext = __nccwpck_require__(95102); +const randomSafeContext = __nccwpck_require__(28695); const spanOnScope = __nccwpck_require__(14379); const spanUtils = __nccwpck_require__(47569); +const tracing = __nccwpck_require__(35606); const dynamicSamplingContext = __nccwpck_require__(29724); const logSpans = __nccwpck_require__(28761); const sampling = __nccwpck_require__(79478); @@ -73557,439 +33766,397 @@ const sentrySpan = __nccwpck_require__(53263); const spanstatus = __nccwpck_require__(21119); const utils = __nccwpck_require__(77989); -const SUPPRESS_TRACING_KEY = '__SENTRY_SUPPRESS_TRACING__'; - -/** - * Wraps a function with a transaction/span and finishes the span after the function is done. - * The created span is the active span and will be used as parent by other spans created inside the function - * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. - * - * If you want to create a span that is not set as active, use {@link startInactiveSpan}. - * - * You'll always get a span passed to the callback, - * it may just be a non-recording span if the span is not sampled or if tracing is disabled. - */ +const SUPPRESS_TRACING_KEY = "__SENTRY_SUPPRESS_TRACING__"; function startSpan(options, callback) { const acs = getAcs(); if (acs.startSpan) { return acs.startSpan(options, callback); } - const spanArguments = parseSentrySpanArguments(options); - const { forceTransaction, parentSpan: customParentSpan } = options; - - return currentScopes.withScope(options.scope, () => { - // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const { forceTransaction, parentSpan: customParentSpan, scope: customScope } = options; + const customForkedScope = customScope?.clone(); + return currentScopes.withScope(customForkedScope, () => { const wrapper = getActiveSpanWrapper(customParentSpan); - return wrapper(() => { const scope = currentScopes.getCurrentScope(); - const parentSpan = getParentSpan(scope); - - const shouldSkipSpan = options.onlyIfParent && !parentSpan; - const activeSpan = shouldSkipSpan - ? new sentryNonRecordingSpan.SentryNonRecordingSpan() - : createChildOrRootSpan({ - parentSpan, - spanArguments, - forceTransaction, - scope, - }); - - spanOnScope._setSpanForScope(scope, activeSpan); - + const parentSpan = getParentSpan(scope, customParentSpan); + const client = currentScopes.getClient(); + const missingRequiredParent = options.onlyIfParent && !parentSpan; + const activeSpan = missingRequiredParent ? startMissingRequiredParentSpan(scope, client) : createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope + }); + if (!spanIsIgnored(activeSpan) || !parentSpan) { + spanOnScope._setSpanForScope(scope, activeSpan); + } return handleCallbackErrors.handleCallbackErrors( () => callback(activeSpan), () => { - // Only update the span status if it hasn't been changed yet, and the span is not yet finished const { status } = spanUtils.spanToJSON(activeSpan); - if (activeSpan.isRecording() && (!status || status === 'ok')) { - activeSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'internal_error' }); + if (activeSpan.isRecording() && (!status || status === "ok")) { + activeSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); } }, - () => activeSpan.end(), + () => { + activeSpan.end(); + } ); }); }); } - -/** - * Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span - * after the function is done automatically. You'll have to call `span.end()` manually. - * - * The created span is the active span and will be used as parent by other spans created inside the function - * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. - * - * You'll always get a span passed to the callback, - * it may just be a non-recording span if the span is not sampled or if tracing is disabled. - */ function startSpanManual(options, callback) { const acs = getAcs(); if (acs.startSpanManual) { return acs.startSpanManual(options, callback); } - const spanArguments = parseSentrySpanArguments(options); - const { forceTransaction, parentSpan: customParentSpan } = options; - - return currentScopes.withScope(options.scope, () => { - // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` + const { forceTransaction, parentSpan: customParentSpan, scope: customScope } = options; + const customForkedScope = customScope?.clone(); + return currentScopes.withScope(customForkedScope, () => { const wrapper = getActiveSpanWrapper(customParentSpan); - return wrapper(() => { const scope = currentScopes.getCurrentScope(); - const parentSpan = getParentSpan(scope); - - const shouldSkipSpan = options.onlyIfParent && !parentSpan; - const activeSpan = shouldSkipSpan - ? new sentryNonRecordingSpan.SentryNonRecordingSpan() - : createChildOrRootSpan({ - parentSpan, - spanArguments, - forceTransaction, - scope, - }); - - spanOnScope._setSpanForScope(scope, activeSpan); - - function finishAndSetSpan() { - activeSpan.end(); + const parentSpan = getParentSpan(scope, customParentSpan); + const missingRequiredParent = options.onlyIfParent && !parentSpan; + const activeSpan = missingRequiredParent ? startMissingRequiredParentSpan(scope, currentScopes.getClient()) : createChildOrRootSpan({ + parentSpan, + spanArguments, + forceTransaction, + scope + }); + if (!spanIsIgnored(activeSpan) || !parentSpan) { + spanOnScope._setSpanForScope(scope, activeSpan); } - return handleCallbackErrors.handleCallbackErrors( - () => callback(activeSpan, finishAndSetSpan), + // We pass the `finish` function to the callback, so the user can finish the span manually + // this is mainly here for historic purposes because previously, we instructed users to call + // `finish` instead of `span.end()` to also clean up the scope. Nowadays, calling `span.end()` + // or `finish` has the same effect and we simply leave it here to avoid breaking user code. + () => callback(activeSpan, () => activeSpan.end()), () => { - // Only update the span status if it hasn't been changed yet, and the span is not yet finished const { status } = spanUtils.spanToJSON(activeSpan); - if (activeSpan.isRecording() && (!status || status === 'ok')) { - activeSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: 'internal_error' }); + if (activeSpan.isRecording() && (!status || status === "ok")) { + activeSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); } - }, + } ); }); }); } - -/** - * Creates a span. This span is not set as active, so will not get automatic instrumentation spans - * as children or be able to be accessed via `Sentry.getActiveSpan()`. - * - * If you want to create a span that is set as active, use {@link startSpan}. - * - * This function will always return a span, - * it may just be a non-recording span if the span is not sampled or if tracing is disabled. - */ function startInactiveSpan(options) { const acs = getAcs(); if (acs.startInactiveSpan) { return acs.startInactiveSpan(options); } - + return _startInactiveSpanImpl(options); +} +function _INTERNAL_startInactiveSpan(options) { + return _startInactiveSpanImpl(options); +} +function _startInactiveSpanImpl(options) { const spanArguments = parseSentrySpanArguments(options); const { forceTransaction, parentSpan: customParentSpan } = options; - - // If `options.scope` is defined, we use this as as a wrapper, - // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` - const wrapper = options.scope - ? (callback) => currentScopes.withScope(options.scope, callback) - : customParentSpan !== undefined - ? (callback) => withActiveSpan(customParentSpan, callback) - : (callback) => callback(); - + const wrapper = options.scope ? (callback) => currentScopes.withScope(options.scope, callback) : customParentSpan !== void 0 ? (callback) => withActiveSpan(customParentSpan, callback) : (callback) => callback(); return wrapper(() => { const scope = currentScopes.getCurrentScope(); - const parentSpan = getParentSpan(scope); - - const shouldSkipSpan = options.onlyIfParent && !parentSpan; - - if (shouldSkipSpan) { - return new sentryNonRecordingSpan.SentryNonRecordingSpan(); + const parentSpan = getParentSpan(scope, customParentSpan); + const client = currentScopes.getClient(); + const missingRequiredParent = options.onlyIfParent && !parentSpan; + if (missingRequiredParent) { + return startMissingRequiredParentSpan(scope, client); } - return createChildOrRootSpan({ parentSpan, spanArguments, forceTransaction, - scope, + scope }); }); } - -/** - * Continue a trace from `sentry-trace` and `baggage` values. - * These values can be obtained from incoming request headers, or in the browser from `` - * and `` HTML tags. - * - * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically - * be attached to the incoming trace. - */ -const continueTrace = ( - options - -, - callback, -) => { +const continueTrace = (options, callback) => { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); if (acs.continueTrace) { return acs.continueTrace(options, callback); } - - const { sentryTrace, baggage } = options; - - return currentScopes.withScope(scope => { - const propagationContext = tracing.propagationContextFromHeaders(sentryTrace, baggage); + const { sentryTrace, baggage: baggage$1 } = options; + const client = currentScopes.getClient(); + const incomingDsc = baggage.baggageHeaderToDynamicSamplingContext(baggage$1); + if (client && !tracing.shouldContinueTrace(client, incomingDsc?.org_id)) { + return startNewTrace(callback); + } + return currentScopes.withScope((scope) => { + const propagationContext = tracing.propagationContextFromHeaders(sentryTrace, baggage$1); scope.setPropagationContext(propagationContext); + spanOnScope._setSpanForScope(scope, void 0); return callback(); }); }; - -/** - * Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be - * passed `null` to start an entirely new span tree. - * - * @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed, - * spans started within the callback will not be attached to a parent span. - * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope. - * @returns the value returned from the provided callback function. - */ function withActiveSpan(span, callback) { const acs = getAcs(); if (acs.withActiveSpan) { return acs.withActiveSpan(span, callback); } - - return currentScopes.withScope(scope => { - spanOnScope._setSpanForScope(scope, span || undefined); + return currentScopes.withScope((scope) => { + spanOnScope._setSpanForScope(scope, span || void 0); return callback(scope); }); } - -/** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */ function suppressTracing(callback) { const acs = getAcs(); - if (acs.suppressTracing) { return acs.suppressTracing(callback); } - - return currentScopes.withScope(scope => { + return currentScopes.withScope((scope) => { scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: true }); - return callback(); + const res = callback(); + scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: void 0 }); + return res; }); } - -/** - * Starts a new trace for the duration of the provided callback. Spans started within the - * callback will be part of the new trace instead of a potentially previously started trace. - * - * Important: Only use this function if you want to override the default trace lifetime and - * propagation mechanism of the SDK for the duration and scope of the provided callback. - * The newly created trace will also be the root of a new distributed trace, for example if - * you make http requests within the callback. - * This function might be useful if the operation you want to instrument should not be part - * of a potentially ongoing trace. - * - * Default behavior: - * - Server-side: A new trace is started for each incoming request. - * - Browser: A new trace is started for each page our route. Navigating to a new route - * or page will automatically create a new trace. - */ +function isTracingSuppressed(scope = currentScopes.getCurrentScope()) { + const acs = getAcs(); + if (acs.isTracingSuppressed) { + return acs.isTracingSuppressed(scope); + } + return scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] === true; +} function startNewTrace(callback) { - return currentScopes.withScope(scope => { - scope.setPropagationContext({ traceId: propagationContext.generateTraceId() }); - debugBuild.DEBUG_BUILD && logger.logger.info(`Starting a new trace with id ${scope.getPropagationContext().traceId}`); + const acs = getAcs(); + if (acs.startNewTrace) { + return acs.startNewTrace(callback); + } + return currentScopes.withScope((scope) => { + scope.setPropagationContext({ + traceId: propagationContext.generateTraceId(), + sampleRand: randomSafeContext.safeMathRandom() + }); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Starting a new trace with id ${scope.getPropagationContext().traceId}`); return withActiveSpan(null, callback); }); } - +function startMissingRequiredParentSpan(scope, client) { + client?.recordDroppedEvent("no_parent_span", "span"); + const span = new sentryNonRecordingSpan.SentryNonRecordingSpan({ traceId: scope.getPropagationContext().traceId }); + utils.setCapturedScopesOnSpan(span, scope, currentScopes.getIsolationScope()); + return span; +} function createChildOrRootSpan({ parentSpan, spanArguments, forceTransaction, - scope, -} - -) { - if (!hasTracingEnabled.hasTracingEnabled()) { - return new sentryNonRecordingSpan.SentryNonRecordingSpan(); - } - + scope +}) { const isolationScope = currentScopes.getIsolationScope(); - + if (!hasSpansEnabled.hasSpansEnabled()) { + const scopePropagationContext = { ...isolationScope.getPropagationContext(), ...scope.getPropagationContext() }; + const traceId = parentSpan ? parentSpan.spanContext().traceId : scopePropagationContext.traceId; + const span2 = new sentryNonRecordingSpan.SentryNonRecordingSpan({ traceId }); + if (parentSpan && !forceTransaction) { + spanUtils.addChildSpanToSpan(parentSpan, span2); + } + utils.setCapturedScopesOnSpan(span2, scope, isolationScope); + return span2; + } + const client = currentScopes.getClient(); + if (_shouldIgnoreStreamedSpan(client, spanArguments)) { + if (!isTracingSuppressed(scope)) { + client?.recordDroppedEvent("ignored", "span"); + } + const ignoredSpan = new sentryNonRecordingSpan.SentryNonRecordingSpan({ + dropReason: "ignored", + traceId: parentSpan?.spanContext().traceId ?? scope.getPropagationContext().traceId + }); + if (parentSpan && !forceTransaction) { + spanUtils.addChildSpanToSpan(parentSpan, ignoredSpan); + } + utils.setCapturedScopesOnSpan(ignoredSpan, scope, isolationScope); + return ignoredSpan; + } let span; if (parentSpan && !forceTransaction) { - span = _startChildSpan(parentSpan, scope, spanArguments); + span = _startChildSpan(parentSpan, scope, spanArguments, isolationScope); spanUtils.addChildSpanToSpan(parentSpan, span); } else if (parentSpan) { - // If we forced a transaction but have a parent span, make sure to continue from the parent span, not the scope const dsc = dynamicSamplingContext.getDynamicSamplingContextFromSpan(parentSpan); const { traceId, spanId: parentSpanId } = parentSpan.spanContext(); const parentSampled = spanUtils.spanIsSampled(parentSpan); - span = _startRootSpan( { traceId, parentSpanId, - ...spanArguments, + ...spanArguments }, scope, - parentSampled, + isolationScope, + parentSampled ); - dynamicSamplingContext.freezeDscOnSpan(span, dsc); } else { const { traceId, dsc, parentSpanId, - sampled: parentSampled, + sampled: parentSampled } = { ...isolationScope.getPropagationContext(), - ...scope.getPropagationContext(), + ...scope.getPropagationContext() }; - span = _startRootSpan( { traceId, parentSpanId, - ...spanArguments, + ...spanArguments }, scope, - parentSampled, + isolationScope, + parentSampled ); - if (dsc) { dynamicSamplingContext.freezeDscOnSpan(span, dsc); } } - logSpans.logSpanStart(span); - - utils.setCapturedScopesOnSpan(span, scope, isolationScope); - return span; } - -/** - * This converts StartSpanOptions to SentrySpanArguments. - * For the most part (for now) we accept the same options, - * but some of them need to be transformed. - */ function parseSentrySpanArguments(options) { const exp = options.experimental || {}; const initialCtx = { isStandalone: exp.standalone, - ...options, + ...options }; - if (options.startTime) { const ctx = { ...initialCtx }; ctx.startTimestamp = spanUtils.spanTimeInputToSeconds(options.startTime); delete ctx.startTime; return ctx; } - return initialCtx; } - function getAcs() { const carrier$1 = carrier.getMainCarrier(); return index.getAsyncContextStrategy(carrier$1); } - -function _startRootSpan(spanArguments, scope, parentSampled) { +function _startRootSpan(spanArguments, scope, isolationScope, parentSampled) { const client = currentScopes.getClient(); - const options = (client && client.getOptions()) || {}; - - const { name = '', attributes } = spanArguments; - const [sampled, sampleRate] = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] - ? [false] - : sampling.sampleSpan(options, { - name, - parentSampled, - attributes, - transactionContext: { - name, - parentSampled, - }, - }); - + const options = client?.getOptions() || {}; + const { name = "" } = spanArguments; + const mutableSpanSamplingData = { spanAttributes: { ...spanArguments.attributes }, spanName: name, parentSampled }; + client?.emit("beforeSampling", mutableSpanSamplingData, { decision: false }); + const finalParentSampled = mutableSpanSamplingData.parentSampled ?? parentSampled; + const finalAttributes = mutableSpanSamplingData.spanAttributes; + const currentPropagationContext = scope.getPropagationContext(); + const _isTracingSuppressed = isTracingSuppressed(scope); + const [sampled, sampleRate, localSampleRateWasApplied] = _isTracingSuppressed ? [false] : sampling.sampleSpan( + options, + { + name, + parentSampled: finalParentSampled, + attributes: finalAttributes, + normalizedRequest: isolationScope.getScopeData().sdkProcessingMetadata.normalizedRequest, + parentSampleRate: parseSampleRate.parseSampleRate(currentPropagationContext.dsc?.sample_rate) + }, + currentPropagationContext.sampleRand + ); const rootSpan = new sentrySpan.SentrySpan({ ...spanArguments, attributes: { - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', - ...spanArguments.attributes, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom", + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate !== void 0 && localSampleRateWasApplied ? sampleRate : void 0, + ...finalAttributes }, - sampled, + sampled }); - if (sampleRate !== undefined) { - rootSpan.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate); + if (!sampled && client && !_isTracingSuppressed) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."); + client.recordDroppedEvent("sample_rate", hasSpanStreamingEnabled.hasSpanStreamingEnabled(client) ? "span" : "transaction"); } - + utils.setCapturedScopesOnSpan(rootSpan, scope, isolationScope); if (client) { - client.emit('spanStart', rootSpan); + client.emit("spanStart", rootSpan); } - return rootSpan; } - -/** - * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`. - * This inherits the sampling decision from the parent span. - */ -function _startChildSpan(parentSpan, scope, spanArguments) { +function _startChildSpan(parentSpan, scope, spanArguments, isolationScope) { const { spanId, traceId } = parentSpan.spanContext(); - const sampled = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? false : spanUtils.spanIsSampled(parentSpan); - - const childSpan = sampled - ? new sentrySpan.SentrySpan({ - ...spanArguments, - parentSpanId: spanId, - traceId, - sampled, - }) - : new sentryNonRecordingSpan.SentryNonRecordingSpan({ traceId }); - + const _isTracingSuppressed = isTracingSuppressed(scope); + const sampled = _isTracingSuppressed ? false : spanUtils.spanIsSampled(parentSpan); + const childSpan = sampled ? new sentrySpan.SentrySpan({ + ...spanArguments, + parentSpanId: spanId, + traceId, + sampled + }) : new sentryNonRecordingSpan.SentryNonRecordingSpan({ traceId }); spanUtils.addChildSpanToSpan(parentSpan, childSpan); - + utils.setCapturedScopesOnSpan(childSpan, scope, isolationScope); const client = currentScopes.getClient(); - if (client) { - client.emit('spanStart', childSpan); - // If it has an endTimestamp, it's already ended - if (spanArguments.endTimestamp) { - client.emit('spanEnd', childSpan); + if (!client) { + return childSpan; + } + if (hasSpanStreamingEnabled.hasSpanStreamingEnabled(client) && sentryNonRecordingSpan.spanIsNonRecordingSpan(childSpan)) { + if (sentryNonRecordingSpan.spanIsNonRecordingSpan(parentSpan) && parentSpan.dropReason) { + childSpan.dropReason = parentSpan.dropReason; + client.recordDroppedEvent(parentSpan.dropReason, "span"); + } else if (!_isTracingSuppressed) { + childSpan.dropReason = "sample_rate"; + client.recordDroppedEvent("sample_rate", "span"); } } - + client.emit("spanStart", childSpan); + if (spanArguments.endTimestamp) { + client.emit("spanEnd", childSpan); + client.emit("afterSpanEnd", childSpan); + } return childSpan; } - -function getParentSpan(scope) { - const span = spanOnScope._getSpanForScope(scope) ; - +function getParentSpan(scope, customParentSpan) { + if (customParentSpan) { + return customParentSpan; + } + if (customParentSpan === null) { + return void 0; + } + const span = spanOnScope._getSpanForScope(scope); if (!span) { - return undefined; + return void 0; } - const client = currentScopes.getClient(); const options = client ? client.getOptions() : {}; if (options.parentSpanIsAlwaysRootSpan) { - return spanUtils.getRootSpan(span) ; + return spanUtils.getRootSpan(span); } - return span; } - function getActiveSpanWrapper(parentSpan) { - return parentSpan !== undefined - ? (callback) => { - return withActiveSpan(parentSpan, callback); - } - : (callback) => callback(); + return parentSpan !== void 0 ? (callback) => { + return withActiveSpan(parentSpan, callback); + } : (callback) => callback(); +} +function _shouldIgnoreStreamedSpan(client, spanArguments) { + const ignoreSpans = client?.getOptions().ignoreSpans; + if (!client || !hasSpanStreamingEnabled.hasSpanStreamingEnabled(client) || !ignoreSpans?.length) { + return false; + } + return shouldIgnoreSpan.shouldIgnoreSpan( + { + description: spanArguments.name || "", + op: spanArguments.attributes?.[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP] || spanArguments.op, + attributes: spanArguments.attributes + }, + ignoreSpans + ); +} +function spanIsIgnored(span) { + return sentryNonRecordingSpan.spanIsNonRecordingSpan(span) && span.dropReason === "ignored"; } +exports.SUPPRESS_TRACING_KEY = SUPPRESS_TRACING_KEY; +exports._INTERNAL_startInactiveSpan = _INTERNAL_startInactiveSpan; exports.continueTrace = continueTrace; +exports.isTracingSuppressed = isTracingSuppressed; +exports.spanIsIgnored = spanIsIgnored; exports.startInactiveSpan = startInactiveSpan; exports.startNewTrace = startNewTrace; exports.startSpan = startSpan; @@ -74004,33 +34171,1110 @@ exports.withActiveSpan = withActiveSpan; /***/ 77989: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const object = __nccwpck_require__(16100); +const object = __nccwpck_require__(5906); +const weakRef = __nccwpck_require__(98981); -const SCOPE_ON_START_SPAN_FIELD = '_sentryScope'; -const ISOLATION_SCOPE_ON_START_SPAN_FIELD = '_sentryIsolationScope'; - -/** Store the scope & isolation scope for a span, which can the be used when it is finished. */ +const SCOPE_ON_START_SPAN_FIELD = "_sentryScope"; +const ISOLATION_SCOPE_ON_START_SPAN_FIELD = "_sentryIsolationScope"; +const OTEL_SOURCE_INFERENCE_SPAN_FIELD = /* @__PURE__ */ Symbol.for("sentry.otelSourceInference"); +const OTEL_SOURCE_EXPLICITLY_SET_SPAN_FIELD = /* @__PURE__ */ Symbol.for("sentry.otelSourceExplicitlySet"); +const TRACER_PROVIDER_SPAN_FIELD = /* @__PURE__ */ Symbol.for("sentry.tracerProviderSpan"); function setCapturedScopesOnSpan(span, scope, isolationScope) { if (span) { - object.addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope); + object.addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, weakRef.makeWeakRef(isolationScope)); object.addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope); } } - -/** - * Grabs the scope and isolation scope off a span that were active when the span was started. - */ function getCapturedScopesOnSpan(span) { + const spanWithScopes = span; return { - scope: (span )[SCOPE_ON_START_SPAN_FIELD], - isolationScope: (span )[ISOLATION_SCOPE_ON_START_SPAN_FIELD], + scope: spanWithScopes[SCOPE_ON_START_SPAN_FIELD], + isolationScope: weakRef.derefWeakRef(spanWithScopes[ISOLATION_SCOPE_ON_START_SPAN_FIELD]) }; } +function markSpanForOtelSourceInference(span) { + object.addNonEnumerableProperty(span, OTEL_SOURCE_INFERENCE_SPAN_FIELD, true); +} +function spanShouldInferOtelSource(span) { + return span[OTEL_SOURCE_INFERENCE_SPAN_FIELD] === true; +} +function markSpanSourceAsExplicit(span) { + object.addNonEnumerableProperty(span, OTEL_SOURCE_EXPLICITLY_SET_SPAN_FIELD, true); +} +function spanSourceWasExplicitlySet(span) { + return span[OTEL_SOURCE_EXPLICITLY_SET_SPAN_FIELD] === true; +} +function markSpanAsTracerProviderSpan(span) { + object.addNonEnumerableProperty(span, TRACER_PROVIDER_SPAN_FIELD, true); +} +function spanIsTracerProviderSpan(span) { + return span[TRACER_PROVIDER_SPAN_FIELD] === true; +} exports.getCapturedScopesOnSpan = getCapturedScopesOnSpan; +exports.markSpanAsTracerProviderSpan = markSpanAsTracerProviderSpan; +exports.markSpanForOtelSourceInference = markSpanForOtelSourceInference; +exports.markSpanSourceAsExplicit = markSpanSourceAsExplicit; exports.setCapturedScopesOnSpan = setCapturedScopesOnSpan; +exports.spanIsTracerProviderSpan = spanIsTracerProviderSpan; +exports.spanShouldInferOtelSource = spanShouldInferOtelSource; +exports.spanSourceWasExplicitlySet = spanSourceWasExplicitlySet; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 29792: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const toolCallSpanContextMap = /* @__PURE__ */ new Map(); +const toolDescriptionMap = /* @__PURE__ */ new Map(); +const SPAN_TO_OPERATION_NAME = /* @__PURE__ */ new Map([ + ["ai.generateText", "invoke_agent"], + ["ai.streamText", "invoke_agent"], + ["ai.generateObject", "invoke_agent"], + ["ai.streamObject", "invoke_agent"], + ["ai.generateText.doGenerate", "generate_content"], + ["ai.streamText.doStream", "generate_content"], + ["ai.generateObject.doGenerate", "generate_content"], + ["ai.streamObject.doStream", "generate_content"], + ["ai.embed.doEmbed", "embeddings"], + ["ai.embedMany.doEmbed", "embeddings"], + ["ai.rerank.doRerank", "rerank"], + ["ai.toolCall", "execute_tool"] +]); + +exports.SPAN_TO_OPERATION_NAME = SPAN_TO_OPERATION_NAME; +exports.toolCallSpanContextMap = toolCallSpanContextMap; +exports.toolDescriptionMap = toolDescriptionMap; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 72388: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const semanticAttributes = __nccwpck_require__(36827); +const utils = __nccwpck_require__(78481); +const providerSkip = __nccwpck_require__(32397); +const spanUtils = __nccwpck_require__(47569); +const constants$1 = __nccwpck_require__(7388); +const genAiAttributes = __nccwpck_require__(53989); +const constants = __nccwpck_require__(29792); +const hasSpanStreamingEnabled = __nccwpck_require__(73642); +const utils$1 = __nccwpck_require__(91407); +const vercelAiAttributes = __nccwpck_require__(55680); + +function onVercelAiSpanStart(span) { + const { data: attributes, description: name } = spanUtils.spanToJSON(span); + if (!name) { + return; + } + if (attributes[vercelAiAttributes.AI_TOOL_CALL_NAME_ATTRIBUTE] && attributes[vercelAiAttributes.AI_TOOL_CALL_ID_ATTRIBUTE] && name === "ai.toolCall") { + processToolCallSpan(span, attributes); + return; + } + if (!attributes[vercelAiAttributes.AI_OPERATION_ID_ATTRIBUTE] && !name.startsWith("ai.")) { + return; + } + if (constants.SPAN_TO_OPERATION_NAME.get(name) === "generate_content") { + providerSkip._INTERNAL_skipAiProviderWrapping([constants$1.WORKERS_AI_INTEGRATION_NAME]); + } + const client = currentScopes.getClient(); + const integration = client?.getIntegrationByName("VercelAI"); + const enableTruncation = utils.shouldEnableTruncation(integration?.options?.enableTruncation); + processGenerateSpan(span, name, attributes, enableTruncation); +} +function vercelAiEventProcessor(event) { + if (event.type === "transaction" && event.spans) { + const tokenAccumulator = /* @__PURE__ */ new Map(); + for (const span of event.spans) { + processEndedVercelAiSpan(span); + utils$1.accumulateTokensForParent(span, tokenAccumulator); + } + utils$1.applyToolDescriptionsAndTokens(event.spans, tokenAccumulator); + const trace = event.contexts?.trace; + if (trace?.op === "gen_ai.invoke_agent") { + utils$1.applyAccumulatedTokens(trace, tokenAccumulator); + } + } + return event; +} +function normalizeFinishReason(finishReason) { + if (typeof finishReason !== "string") { + return "stop"; + } + switch (finishReason) { + case "tool-calls": + return "tool_call"; + case "stop": + case "length": + case "content_filter": + case "error": + return finishReason; + default: + return finishReason; + } +} +function buildOutputMessages(attributes) { + const responseText = attributes[vercelAiAttributes.AI_RESPONSE_TEXT_ATTRIBUTE]; + const responseToolCalls = attributes[vercelAiAttributes.AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]; + const finishReason = attributes[vercelAiAttributes.AI_RESPONSE_FINISH_REASON_ATTRIBUTE]; + if (responseText == null && responseToolCalls == null) { + return; + } + const parts = []; + if (typeof responseText === "string" && responseText.length > 0) { + parts.push({ + type: "text", + content: responseText + }); + } + if (responseToolCalls != null) { + try { + const toolCalls = typeof responseToolCalls === "string" ? JSON.parse(responseToolCalls) : responseToolCalls; + if (Array.isArray(toolCalls)) { + for (const toolCall of toolCalls) { + const args = toolCall.input ?? toolCall.args; + parts.push({ + type: "tool_call", + id: toolCall.toolCallId, + name: toolCall.toolName, + // Handle undefined args: JSON.stringify(undefined) returns undefined, not a string, + // which would cause the property to be omitted from the final JSON output + arguments: typeof args === "string" ? args : JSON.stringify(args ?? {}) + }); + } + delete attributes[vercelAiAttributes.AI_RESPONSE_TOOL_CALLS_ATTRIBUTE]; + } + } catch { + } + } + if (parts.length > 0) { + const outputMessage = { + role: "assistant", + parts, + finish_reason: normalizeFinishReason(finishReason) + }; + attributes[genAiAttributes.GEN_AI_OUTPUT_MESSAGES_ATTRIBUTE] = JSON.stringify([outputMessage]); + delete attributes[vercelAiAttributes.AI_RESPONSE_TEXT_ATTRIBUTE]; + } +} +function processVercelAiSpanAttributes(attributes) { + renameAttributeKey(attributes, vercelAiAttributes.AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE, genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE); + renameAttributeKey(attributes, vercelAiAttributes.AI_USAGE_PROMPT_TOKENS_ATTRIBUTE, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE); + renameAttributeKey(attributes, vercelAiAttributes.AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE); + renameAttributeKey(attributes, "ai.usage.inputTokens", genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE); + renameAttributeKey(attributes, "ai.usage.outputTokens", genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE); + renameAttributeKey(attributes, vercelAiAttributes.AI_USAGE_TOKENS_ATTRIBUTE, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE); + renameAttributeKey(attributes, "ai.response.avgOutputTokensPerSecond", "ai.response.avgCompletionTokensPerSecond"); + const inputTokensAreCacheInclusive = Object.keys(attributes).some( + (key) => key.startsWith(vercelAiAttributes.AI_USAGE_INPUT_TOKEN_DETAILS_ATTRIBUTE_PREFIX) + ); + if (!inputTokensAreCacheInclusive && typeof attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] === "number" && typeof attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE] === "number") { + attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] = attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] + attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE]; + } + if (typeof attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] === "number") { + const outputTokens = typeof attributes[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] === "number" ? attributes[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] : 0; + attributes[genAiAttributes.GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE] = outputTokens + attributes[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]; + } + if (attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE] && Array.isArray(attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE])) { + attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE] = utils$1.convertAvailableToolsToJsonString( + attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE] + ); + } + if (attributes[vercelAiAttributes.OPERATION_NAME_ATTRIBUTE]) { + const rawOperationName = attributes[vercelAiAttributes.AI_OPERATION_ID_ATTRIBUTE] ? attributes[vercelAiAttributes.AI_OPERATION_ID_ATTRIBUTE] : attributes[vercelAiAttributes.OPERATION_NAME_ATTRIBUTE]; + const operationName = constants.SPAN_TO_OPERATION_NAME.get(rawOperationName) ?? rawOperationName; + attributes[genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE] = operationName; + delete attributes[vercelAiAttributes.OPERATION_NAME_ATTRIBUTE]; + } + renameAttributeKey(attributes, vercelAiAttributes.AI_PROMPT_MESSAGES_ATTRIBUTE, genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE); + buildOutputMessages(attributes); + renameAttributeKey(attributes, vercelAiAttributes.AI_RESPONSE_OBJECT_ATTRIBUTE, "gen_ai.response.object"); + renameAttributeKey(attributes, vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE, "gen_ai.request.available_tools"); + renameAttributeKey(attributes, vercelAiAttributes.AI_TOOL_CALL_ARGS_ATTRIBUTE, genAiAttributes.GEN_AI_TOOL_INPUT_ATTRIBUTE); + renameAttributeKey(attributes, vercelAiAttributes.AI_TOOL_CALL_RESULT_ATTRIBUTE, genAiAttributes.GEN_AI_TOOL_OUTPUT_ATTRIBUTE); + renameAttributeKey(attributes, vercelAiAttributes.AI_SCHEMA_ATTRIBUTE, "gen_ai.request.schema"); + renameAttributeKey(attributes, vercelAiAttributes.AI_MODEL_ID_ATTRIBUTE, genAiAttributes.GEN_AI_REQUEST_MODEL_ATTRIBUTE); + if (Array.isArray(attributes[vercelAiAttributes.AI_VALUES_ATTRIBUTE])) { + const parsed = attributes[vercelAiAttributes.AI_VALUES_ATTRIBUTE].map((v) => { + try { + return JSON.parse(v); + } catch { + return v; + } + }); + attributes[genAiAttributes.GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE] = parsed.length === 1 ? parsed[0] : JSON.stringify(parsed); + } + addProviderMetadataToAttributes(attributes); + for (const key of Object.keys(attributes)) { + if (Array.isArray(attributes[key])) { + attributes[key] = JSON.stringify(attributes[key]); + } + if (key.startsWith("ai.")) { + renameAttributeKey(attributes, key, `vercel.${key}`); + } + } +} +function processEndedVercelAiSpan(span) { + const { data: attributes, origin } = span; + if (origin !== "auto.vercelai.otel") { + return; + } + if (span.status && span.status !== "ok") { + span.status = "internal_error"; + } + processVercelAiSpanAttributes(attributes); +} +function processVercelAiStreamedSpan(span) { + const attributes = span.attributes; + if (attributes?.[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] !== "auto.vercelai.otel") { + return; + } + processVercelAiSpanAttributes(attributes); + if (attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP] === "gen_ai.execute_tool" && span.parent_span_id) { + const descriptions = constants.toolDescriptionMap.get(span.parent_span_id); + if (descriptions) { + const toolName = attributes[genAiAttributes.GEN_AI_TOOL_NAME_ATTRIBUTE]; + if (typeof toolName === "string") { + const desc = descriptions.get(toolName); + if (desc) { + attributes[genAiAttributes.GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE] = desc; + } + } + } + } + constants.toolDescriptionMap.delete(span.span_id); +} +function renameAttributeKey(attributes, oldKey, newKey) { + if (attributes[oldKey] != null) { + attributes[newKey] = attributes[oldKey]; + delete attributes[oldKey]; + } +} +function processToolCallSpan(span, attributes) { + span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto.vercelai.otel"); + span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP, "gen_ai.execute_tool"); + span.setAttribute(genAiAttributes.GEN_AI_OPERATION_NAME_ATTRIBUTE, "execute_tool"); + renameAttributeKey(attributes, vercelAiAttributes.AI_TOOL_CALL_NAME_ATTRIBUTE, genAiAttributes.GEN_AI_TOOL_NAME_ATTRIBUTE); + renameAttributeKey(attributes, vercelAiAttributes.AI_TOOL_CALL_ID_ATTRIBUTE, genAiAttributes.GEN_AI_TOOL_CALL_ID_ATTRIBUTE); + const toolCallId = attributes[genAiAttributes.GEN_AI_TOOL_CALL_ID_ATTRIBUTE]; + if (typeof toolCallId === "string") { + constants.toolCallSpanContextMap.set(toolCallId, span.spanContext()); + } + if (!attributes[genAiAttributes.GEN_AI_TOOL_TYPE_ATTRIBUTE]) { + span.setAttribute(genAiAttributes.GEN_AI_TOOL_TYPE_ATTRIBUTE, "function"); + } + const toolName = attributes[genAiAttributes.GEN_AI_TOOL_NAME_ATTRIBUTE]; + if (toolName) { + span.updateName(`execute_tool ${toolName}`); + } +} +function processGenerateSpan(span, name, attributes, enableTruncation) { + span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto.vercelai.otel"); + const nameWthoutAi = name.replace("ai.", ""); + span.setAttribute("ai.pipeline.name", nameWthoutAi); + span.updateName(nameWthoutAi); + const functionId = attributes[vercelAiAttributes.AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE]; + if (functionId && typeof functionId === "string") { + span.setAttribute("gen_ai.function_id", functionId); + } + utils$1.requestMessagesFromPrompt(span, attributes, enableTruncation); + if (attributes[vercelAiAttributes.AI_MODEL_ID_ATTRIBUTE] && !attributes[genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE]) { + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_MODEL_ATTRIBUTE, attributes[vercelAiAttributes.AI_MODEL_ID_ATTRIBUTE]); + } + span.setAttribute("ai.streaming", name.includes("stream")); + const operationName = constants.SPAN_TO_OPERATION_NAME.get(name); + if (operationName) { + span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP, `gen_ai.${operationName}`); + } else if (name.startsWith("ai.stream")) { + span.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP, "ai.run"); + } + if (operationName === "invoke_agent") { + if (functionId && typeof functionId === "string") { + span.updateName(`invoke_agent ${functionId}`); + } else { + span.updateName("invoke_agent"); + } + return; + } + const modelId = attributes[vercelAiAttributes.AI_MODEL_ID_ATTRIBUTE]; + if (modelId && operationName) { + span.updateName(`${operationName} ${modelId}`); + } + const client = currentScopes.getClient(); + if (client && hasSpanStreamingEnabled.hasSpanStreamingEnabled(client) && attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE] && Array.isArray(attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE])) { + const descriptions = /* @__PURE__ */ new Map(); + for (const toolStr of attributes[vercelAiAttributes.AI_PROMPT_TOOLS_ATTRIBUTE]) { + try { + const parsed = typeof toolStr === "string" ? JSON.parse(toolStr) : toolStr; + if (parsed?.name && parsed?.description) { + descriptions.set(parsed.name, parsed.description); + } + } catch { + } + } + if (descriptions.size > 0) { + const parentSpanId = spanUtils.spanToJSON(span).parent_span_id; + if (parentSpanId) { + constants.toolDescriptionMap.set(parentSpanId, descriptions); + } + } + } +} +function addVercelAiProcessors(client) { + client.on("spanStart", onVercelAiSpanStart); + client.addEventProcessor(Object.assign(vercelAiEventProcessor, { id: "VercelAiEventProcessor" })); + client.on("processSpan", (span) => { + processVercelAiStreamedSpan(span); + }); +} +function getProviderMetadataAttributes(providerMetadata) { + const attributes = {}; + if (!providerMetadata || typeof providerMetadata !== "object") { + return attributes; + } + const metadata = providerMetadata; + const openaiMetadata = metadata.openai ?? metadata.azure; + if (openaiMetadata) { + setAttributeIfDefined(attributes, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE, openaiMetadata.cachedPromptTokens); + setAttributeIfDefined(attributes, "gen_ai.usage.output_tokens.reasoning", openaiMetadata.reasoningTokens); + setAttributeIfDefined( + attributes, + "gen_ai.usage.output_tokens.prediction_accepted", + openaiMetadata.acceptedPredictionTokens + ); + setAttributeIfDefined( + attributes, + "gen_ai.usage.output_tokens.prediction_rejected", + openaiMetadata.rejectedPredictionTokens + ); + setAttributeIfDefined(attributes, genAiAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE, openaiMetadata.responseId); + } + if (metadata.anthropic) { + const cachedInputTokens = metadata.anthropic.usage?.cache_read_input_tokens ?? metadata.anthropic.cacheReadInputTokens; + setAttributeIfDefined(attributes, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE, cachedInputTokens); + const cacheWriteInputTokens = metadata.anthropic.usage?.cache_creation_input_tokens ?? metadata.anthropic.cacheCreationInputTokens; + setAttributeIfDefined(attributes, genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE, cacheWriteInputTokens); + } + if (metadata.bedrock?.usage) { + setAttributeIfDefined( + attributes, + genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE, + metadata.bedrock.usage.cacheReadInputTokens + ); + setAttributeIfDefined( + attributes, + genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE_ATTRIBUTE, + metadata.bedrock.usage.cacheWriteInputTokens + ); + } + if (metadata.deepseek) { + setAttributeIfDefined( + attributes, + genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_CACHED_ATTRIBUTE, + metadata.deepseek.promptCacheHitTokens + ); + setAttributeIfDefined(attributes, "gen_ai.usage.input_tokens.cache_miss", metadata.deepseek.promptCacheMissTokens); + } + return attributes; +} +function addProviderMetadataToAttributes(attributes) { + const providerMetadata = attributes[vercelAiAttributes.AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE]; + if (!providerMetadata) { + return; + } + try { + const derived = getProviderMetadataAttributes(JSON.parse(providerMetadata)); + for (const [key, value] of Object.entries(derived)) { + if (key === genAiAttributes.GEN_AI_CONVERSATION_ID_ATTRIBUTE && attributes[key]) { + continue; + } + attributes[key] = value; + } + } catch { + } +} +function setAttributeIfDefined(attributes, key, value) { + if (value != null) { + attributes[key] = value; + } +} + +exports.addVercelAiProcessors = addVercelAiProcessors; +exports.getProviderMetadataAttributes = getProviderMetadataAttributes; +exports.processVercelAiSpanAttributes = processVercelAiSpanAttributes; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 91407: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(78481); +const string = __nccwpck_require__(77673); +const constants = __nccwpck_require__(29792); +const vercelAiAttributes = __nccwpck_require__(55680); + +function accumulateTokensForParent(span, tokenAccumulator) { + const parentSpanId = span.parent_span_id; + if (!parentSpanId) { + return; + } + const inputTokens = span.data[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]; + const outputTokens = span.data[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]; + if (typeof inputTokens === "number" || typeof outputTokens === "number") { + const existing = tokenAccumulator.get(parentSpanId) || { inputTokens: 0, outputTokens: 0 }; + if (typeof inputTokens === "number") { + existing.inputTokens += inputTokens; + } + if (typeof outputTokens === "number") { + existing.outputTokens += outputTokens; + } + tokenAccumulator.set(parentSpanId, existing); + } +} +function applyAccumulatedTokens(spanOrTrace, tokenAccumulator) { + const accumulated = tokenAccumulator.get(spanOrTrace.span_id); + if (!accumulated || !spanOrTrace.data) { + return; + } + if (accumulated.inputTokens > 0) { + spanOrTrace.data[genAiAttributes.GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE] = accumulated.inputTokens; + } + if (accumulated.outputTokens > 0) { + spanOrTrace.data[genAiAttributes.GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE] = accumulated.outputTokens; + } + if (accumulated.inputTokens > 0 || accumulated.outputTokens > 0) { + spanOrTrace.data["gen_ai.usage.total_tokens"] = accumulated.inputTokens + accumulated.outputTokens; + } +} +function buildToolDescriptionMap(spans) { + const toolDescriptions = /* @__PURE__ */ new Map(); + for (const span of spans) { + const availableTools = span.data[genAiAttributes.GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE]; + if (typeof availableTools !== "string") { + continue; + } + try { + const tools = JSON.parse(availableTools); + for (const tool of tools) { + if (tool.name && tool.description && !toolDescriptions.has(tool.name)) { + toolDescriptions.set(tool.name, tool.description); + } + } + } catch { + } + } + return toolDescriptions; +} +function applyToolDescriptionsAndTokens(spans, tokenAccumulator) { + const toolDescriptions = buildToolDescriptionMap(spans); + for (const span of spans) { + if (span.op === "gen_ai.execute_tool") { + const toolName = span.data[genAiAttributes.GEN_AI_TOOL_NAME_ATTRIBUTE]; + if (typeof toolName === "string") { + const description = toolDescriptions.get(toolName); + if (description) { + span.data[genAiAttributes.GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE] = description; + } + } + } + if (span.op === "gen_ai.invoke_agent") { + applyAccumulatedTokens(span, tokenAccumulator); + } + } +} +function _INTERNAL_getSpanContextForToolCallId(toolCallId) { + return constants.toolCallSpanContextMap.get(toolCallId); +} +function _INTERNAL_cleanupToolCallSpanContext(toolCallId) { + constants.toolCallSpanContextMap.delete(toolCallId); +} +function convertAvailableToolsToJsonString(tools) { + const toolObjects = tools.map((tool) => { + if (typeof tool === "string") { + try { + return JSON.parse(tool); + } catch { + return tool; + } + } + return tool; + }); + return JSON.stringify(toolObjects); +} +function filterMessagesArray(input) { + return input.filter( + (m) => !!m && typeof m === "object" && "role" in m && "content" in m + ); +} +function convertUserInputToMessagesFormat(userInput) { + try { + const p = JSON.parse(userInput); + if (!!p && typeof p === "object") { + let { messages } = p; + const { prompt, system } = p; + const result = []; + if (typeof system === "string") { + result.push({ role: "system", content: system }); + } + if (typeof messages === "string") { + try { + messages = JSON.parse(messages); + } catch { + } + } + if (Array.isArray(messages)) { + result.push(...filterMessagesArray(messages)); + return result; + } + if (Array.isArray(prompt)) { + result.push(...filterMessagesArray(prompt)); + return result; + } + if (typeof prompt === "string") { + result.push({ role: "user", content: prompt }); + } + if (result.length > 0) { + return result; + } + } + } catch { + } + return []; +} +function requestMessagesFromPrompt(span, attributes, enableTruncation) { + if (typeof attributes[vercelAiAttributes.AI_PROMPT_ATTRIBUTE] === "string" && !attributes[genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE] && !attributes[vercelAiAttributes.AI_PROMPT_MESSAGES_ATTRIBUTE]) { + const userInput = attributes[vercelAiAttributes.AI_PROMPT_ATTRIBUTE]; + const messages = convertUserInputToMessagesFormat(userInput); + if (messages.length) { + const { systemInstructions, filteredMessages } = utils.extractSystemInstructions(messages); + if (systemInstructions) { + span.setAttribute(genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE, systemInstructions); + } + const filteredLength = Array.isArray(filteredMessages) ? filteredMessages.length : 0; + const messagesJson = enableTruncation ? utils.getTruncatedJsonString(filteredMessages) : string.stringify(filteredMessages); + span.setAttributes({ + [vercelAiAttributes.AI_PROMPT_ATTRIBUTE]: messagesJson, + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]: messagesJson, + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]: filteredLength + }); + } + } else if (typeof attributes[vercelAiAttributes.AI_PROMPT_MESSAGES_ATTRIBUTE] === "string") { + const originalMessagesJson = attributes[vercelAiAttributes.AI_PROMPT_MESSAGES_ATTRIBUTE]; + try { + const messages = JSON.parse(originalMessagesJson); + if (Array.isArray(messages)) { + const { systemInstructions, filteredMessages } = utils.extractSystemInstructions(messages); + if (systemInstructions) { + span.setAttribute(genAiAttributes.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE, systemInstructions); + } + const filteredLength = Array.isArray(filteredMessages) ? filteredMessages.length : 0; + const messagesJson = !enableTruncation && filteredMessages === messages ? originalMessagesJson : enableTruncation ? utils.getTruncatedJsonString(filteredMessages) : string.stringify(filteredMessages); + span.setAttributes({ + [vercelAiAttributes.AI_PROMPT_MESSAGES_ATTRIBUTE]: messagesJson, + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ATTRIBUTE]: messagesJson, + [genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE]: filteredLength + }); + } + } catch { + } + } +} + +exports._INTERNAL_cleanupToolCallSpanContext = _INTERNAL_cleanupToolCallSpanContext; +exports._INTERNAL_getSpanContextForToolCallId = _INTERNAL_getSpanContextForToolCallId; +exports.accumulateTokensForParent = accumulateTokensForParent; +exports.applyAccumulatedTokens = applyAccumulatedTokens; +exports.applyToolDescriptionsAndTokens = applyToolDescriptionsAndTokens; +exports.convertAvailableToolsToJsonString = convertAvailableToolsToJsonString; +exports.convertUserInputToMessagesFormat = convertUserInputToMessagesFormat; +exports.requestMessagesFromPrompt = requestMessagesFromPrompt; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 55680: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const OPERATION_NAME_ATTRIBUTE = "operation.name"; +const AI_OPERATION_ID_ATTRIBUTE = "ai.operationId"; +const AI_PROMPT_ATTRIBUTE = "ai.prompt"; +const AI_SCHEMA_ATTRIBUTE = "ai.schema"; +const AI_RESPONSE_OBJECT_ATTRIBUTE = "ai.response.object"; +const AI_VALUES_ATTRIBUTE = "ai.values"; +const AI_RESPONSE_TEXT_ATTRIBUTE = "ai.response.text"; +const AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = "ai.response.toolCalls"; +const AI_RESPONSE_FINISH_REASON_ATTRIBUTE = "ai.response.finishReason"; +const AI_PROMPT_MESSAGES_ATTRIBUTE = "ai.prompt.messages"; +const AI_PROMPT_TOOLS_ATTRIBUTE = "ai.prompt.tools"; +const AI_MODEL_ID_ATTRIBUTE = "ai.model.id"; +const AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE = "ai.response.providerMetadata"; +const AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE = "ai.usage.cachedInputTokens"; +const AI_USAGE_INPUT_TOKEN_DETAILS_ATTRIBUTE_PREFIX = "ai.usage.inputTokenDetails."; +const AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE = "ai.telemetry.functionId"; +const AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = "ai.usage.completionTokens"; +const AI_USAGE_PROMPT_TOKENS_ATTRIBUTE = "ai.usage.promptTokens"; +const AI_USAGE_TOKENS_ATTRIBUTE = "ai.usage.tokens"; +const AI_TOOL_CALL_NAME_ATTRIBUTE = "ai.toolCall.name"; +const AI_TOOL_CALL_ID_ATTRIBUTE = "ai.toolCall.id"; +const AI_TOOL_CALL_ARGS_ATTRIBUTE = "ai.toolCall.args"; +const AI_TOOL_CALL_RESULT_ATTRIBUTE = "ai.toolCall.result"; + +exports.AI_MODEL_ID_ATTRIBUTE = AI_MODEL_ID_ATTRIBUTE; +exports.AI_OPERATION_ID_ATTRIBUTE = AI_OPERATION_ID_ATTRIBUTE; +exports.AI_PROMPT_ATTRIBUTE = AI_PROMPT_ATTRIBUTE; +exports.AI_PROMPT_MESSAGES_ATTRIBUTE = AI_PROMPT_MESSAGES_ATTRIBUTE; +exports.AI_PROMPT_TOOLS_ATTRIBUTE = AI_PROMPT_TOOLS_ATTRIBUTE; +exports.AI_RESPONSE_FINISH_REASON_ATTRIBUTE = AI_RESPONSE_FINISH_REASON_ATTRIBUTE; +exports.AI_RESPONSE_OBJECT_ATTRIBUTE = AI_RESPONSE_OBJECT_ATTRIBUTE; +exports.AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE = AI_RESPONSE_PROVIDER_METADATA_ATTRIBUTE; +exports.AI_RESPONSE_TEXT_ATTRIBUTE = AI_RESPONSE_TEXT_ATTRIBUTE; +exports.AI_RESPONSE_TOOL_CALLS_ATTRIBUTE = AI_RESPONSE_TOOL_CALLS_ATTRIBUTE; +exports.AI_SCHEMA_ATTRIBUTE = AI_SCHEMA_ATTRIBUTE; +exports.AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE = AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE; +exports.AI_TOOL_CALL_ARGS_ATTRIBUTE = AI_TOOL_CALL_ARGS_ATTRIBUTE; +exports.AI_TOOL_CALL_ID_ATTRIBUTE = AI_TOOL_CALL_ID_ATTRIBUTE; +exports.AI_TOOL_CALL_NAME_ATTRIBUTE = AI_TOOL_CALL_NAME_ATTRIBUTE; +exports.AI_TOOL_CALL_RESULT_ATTRIBUTE = AI_TOOL_CALL_RESULT_ATTRIBUTE; +exports.AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE = AI_USAGE_CACHED_INPUT_TOKENS_ATTRIBUTE; +exports.AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = AI_USAGE_COMPLETION_TOKENS_ATTRIBUTE; +exports.AI_USAGE_INPUT_TOKEN_DETAILS_ATTRIBUTE_PREFIX = AI_USAGE_INPUT_TOKEN_DETAILS_ATTRIBUTE_PREFIX; +exports.AI_USAGE_PROMPT_TOKENS_ATTRIBUTE = AI_USAGE_PROMPT_TOKENS_ATTRIBUTE; +exports.AI_USAGE_TOKENS_ATTRIBUTE = AI_USAGE_TOKENS_ATTRIBUTE; +exports.AI_VALUES_ATTRIBUTE = AI_VALUES_ATTRIBUTE; +exports.OPERATION_NAME_ATTRIBUTE = OPERATION_NAME_ATTRIBUTE; +//# sourceMappingURL=vercel-ai-attributes.js.map + + +/***/ }), + +/***/ 7388: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const WORKERS_AI_PROVIDER_NAME = "cloudflare.workers_ai"; +const WORKERS_AI_ORIGIN = "auto.ai.cloudflare.workers_ai"; +const WORKERS_AI_INTEGRATION_NAME = "WorkersAI"; + +exports.WORKERS_AI_INTEGRATION_NAME = WORKERS_AI_INTEGRATION_NAME; +exports.WORKERS_AI_ORIGIN = WORKERS_AI_ORIGIN; +exports.WORKERS_AI_PROVIDER_NAME = WORKERS_AI_PROVIDER_NAME; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 69669: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const is = __nccwpck_require__(68370); +const spanstatus = __nccwpck_require__(21119); +const trace = __nccwpck_require__(97956); +const providerSkip = __nccwpck_require__(32397); +const utils = __nccwpck_require__(78481); +const constants = __nccwpck_require__(7388); +const streaming = __nccwpck_require__(64912); +const utils$1 = __nccwpck_require__(49879); + +function isReadableStream(value) { + return is.isObjectLike(value) && typeof value.pipeThrough === "function" && typeof value.getReader === "function"; +} +function instrumentRun(originalRun, context, options) { + return function instrumentedRun(...args) { + if (providerSkip._INTERNAL_shouldSkipAiProviderWrapping(constants.WORKERS_AI_INTEGRATION_NAME)) { + return originalRun.apply(context, args); + } + const [model, inputs, runOptions] = args; + const operationName = utils$1.getOperationName(inputs); + const requestAttributes = utils$1.extractRequestAttributes(model, inputs, operationName); + const modelName = typeof model === "string" ? model : "unknown"; + const isStreamRequested = !!inputs && typeof inputs === "object" && inputs.stream === true; + const returnsRawResponse = !!runOptions && typeof runOptions === "object" && (runOptions.returnRawResponse === true || runOptions.websocket === true); + const spanConfig = { + name: `${operationName} ${modelName}`, + op: `gen_ai.${operationName}`, + attributes: requestAttributes + }; + if (isStreamRequested && !returnsRawResponse) { + return trace.startSpanManual(spanConfig, (span) => { + const handleError = (error) => { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + span.end(); + throw error; + }; + let originalResult; + try { + originalResult = originalRun.apply(context, args); + } catch (error) { + return handleError(error); + } + if (options.recordInputs) { + utils$1.addRequestAttributes(span, inputs, operationName, utils.shouldEnableTruncation(options.enableTruncation)); + } + return originalResult.then((result) => { + if (isReadableStream(result)) { + return streaming.instrumentWorkersAiStream(result, span, options.recordOutputs); + } + utils$1.addResponseAttributes(span, result, options.recordOutputs); + span.end(); + return result; + }, handleError); + }); + } + return trace.startSpan(spanConfig, (span) => { + const originalResult = originalRun.apply(context, args); + if (options.recordInputs) { + utils$1.addRequestAttributes(span, inputs, operationName, utils.shouldEnableTruncation(options.enableTruncation)); + } + return originalResult.then((result) => { + if (!returnsRawResponse) { + utils$1.addResponseAttributes(span, result, options.recordOutputs); + } + return result; + }); + }); + }; +} +function instrumentWorkersAiClient(client, options) { + const resolvedOptions = utils.resolveAIRecordingOptions(options); + const instrumented = new Proxy(client, { + get(target, prop, receiver) { + const value = Reflect.get(target, prop, receiver); + if (prop === "run" && typeof value === "function") { + return instrumentRun(value, target, resolvedOptions); + } + return typeof value === "function" ? value.bind(target) : value; + } + }); + return instrumented; +} + +exports.instrumentWorkersAiClient = instrumentWorkersAiClient; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 64912: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const spanstatus = __nccwpck_require__(21119); +const utils$1 = __nccwpck_require__(78481); +const utils = __nccwpck_require__(49879); + +function accumulateStreamingToolCalls(toolCalls, accumulator) { + for (const toolCall of toolCalls) { + const name = toolCall.function?.name ?? toolCall.name; + const args = toolCall.function?.arguments ?? toolCall.arguments; + if (name == null && args == null) { + continue; + } + const index = toolCall.index ?? 0; + const existing = accumulator[index]; + if (!existing) { + accumulator[index] = { + index, + id: toolCall.id, + type: toolCall.type, + function: { + name, + arguments: args ?? "" + } + }; + } else if (existing.function) { + if (name && !existing.function.name) { + existing.function.name = name; + } + if (args) { + existing.function.arguments = `${existing.function.arguments ?? ""}${args}`; + } + } + } +} +function processLine(line, state, recordOutputs, toolCallAccumulator) { + const trimmed = line.trim(); + if (!trimmed.startsWith("data:")) { + return; + } + const data = trimmed.slice("data:".length).trim(); + if (!data || data === "[DONE]") { + return; + } + let parsed; + try { + parsed = JSON.parse(data); + } catch { + return; + } + if (parsed.usage) { + if (typeof parsed.usage.prompt_tokens === "number") { + state.promptTokens = parsed.usage.prompt_tokens; + } + if (typeof parsed.usage.completion_tokens === "number") { + state.completionTokens = parsed.usage.completion_tokens; + } + if (typeof parsed.usage.total_tokens === "number") { + state.totalTokens = parsed.usage.total_tokens; + } + } + if (recordOutputs && typeof parsed.response === "string") { + state.responseTexts.push(parsed.response); + } + if (recordOutputs && Array.isArray(parsed.tool_calls) && parsed.tool_calls.length > 0) { + state.toolCalls.push(...parsed.tool_calls); + } + if (Array.isArray(parsed.choices)) { + for (const choice of parsed.choices) { + if (recordOutputs && typeof choice.delta?.content === "string" && choice.delta.content) { + state.responseTexts.push(choice.delta.content); + } + if (recordOutputs && Array.isArray(choice.delta?.tool_calls)) { + accumulateStreamingToolCalls(choice.delta.tool_calls, toolCallAccumulator); + } + if (typeof choice.finish_reason === "string") { + state.finishReasons.push(choice.finish_reason); + } + } + } +} +function instrumentWorkersAiStream(stream, span, recordOutputs) { + const reader = stream.getReader(); + const decoder = new TextDecoder(); + const state = { + responseId: "", + responseModel: "", + finishReasons: [], + responseTexts: [], + toolCalls: [], + promptTokens: void 0, + completionTokens: void 0, + totalTokens: void 0 + }; + const toolCallAccumulator = {}; + let buffer = ""; + let spanEnded = false; + const finish = () => { + if (spanEnded) { + return; + } + spanEnded = true; + if (recordOutputs) { + const accumulatedToolCalls = Object.values(toolCallAccumulator); + if (accumulatedToolCalls.length > 0) { + state.toolCalls.push(...accumulatedToolCalls); + } + utils.setOutputMessagesAttribute(span, { + responseText: state.responseTexts.join(""), + toolCalls: state.toolCalls + }); + } + utils$1.endStreamSpan(span, state, recordOutputs); + }; + const flushBuffer = (isDone) => { + const lines = buffer.split("\n"); + buffer = isDone ? "" : lines.pop() ?? ""; + for (const line of lines) { + processLine(line, state, recordOutputs, toolCallAccumulator); + } + }; + return new ReadableStream({ + async pull(controller) { + try { + const { done, value } = await reader.read(); + if (done) { + buffer += decoder.decode(); + flushBuffer(true); + finish(); + controller.close(); + return; + } + buffer += decoder.decode(value, { stream: true }); + flushBuffer(false); + controller.enqueue(value); + } catch (error) { + span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); + finish(); + controller.error(error); + } + }, + async cancel(reason) { + finish(); + await reader.cancel(reason); + } + }); +} + +exports.instrumentWorkersAiStream = instrumentWorkersAiStream; +//# sourceMappingURL=streaming.js.map + + +/***/ }), + +/***/ 49879: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const semanticAttributes = __nccwpck_require__(36827); +const genAiAttributes = __nccwpck_require__(53989); +const utils = __nccwpck_require__(78481); +const string = __nccwpck_require__(77673); +const constants = __nccwpck_require__(7388); + +function getOperationName(inputs) { + if (inputs && typeof inputs === "object") { + if ("messages" in inputs || "prompt" in inputs) { + return "chat"; + } + if ("text" in inputs) { + return "embeddings"; + } + } + return "chat"; +} +function extractRequestAttributes(model, inputs, operationName) { + const attributes$1 = { + [attributes.GEN_AI_PROVIDER_NAME]: constants.WORKERS_AI_PROVIDER_NAME, + [attributes.GEN_AI_OPERATION_NAME]: operationName, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.WORKERS_AI_ORIGIN, + [attributes.GEN_AI_REQUEST_MODEL]: typeof model === "string" ? model : "unknown" + }; + if (inputs && typeof inputs === "object") { + const params = inputs; + if (typeof params.temperature === "number") { + attributes$1[attributes.GEN_AI_REQUEST_TEMPERATURE] = params.temperature; + } + if (typeof params.max_tokens === "number") { + attributes$1[attributes.GEN_AI_REQUEST_MAX_TOKENS] = params.max_tokens; + } + if (typeof params.top_p === "number") { + attributes$1[attributes.GEN_AI_REQUEST_TOP_P] = params.top_p; + } + if (typeof params.top_k === "number") { + attributes$1[attributes.GEN_AI_REQUEST_TOP_K] = params.top_k; + } + if (typeof params.frequency_penalty === "number") { + attributes$1[attributes.GEN_AI_REQUEST_FREQUENCY_PENALTY] = params.frequency_penalty; + } + if (typeof params.presence_penalty === "number") { + attributes$1[attributes.GEN_AI_REQUEST_PRESENCE_PENALTY] = params.presence_penalty; + } + if (params.stream === true) { + attributes$1[genAiAttributes.GEN_AI_REQUEST_STREAM_ATTRIBUTE] = true; + } + } + return attributes$1; +} +function addRequestAttributes(span, inputs, operationName, enableTruncation) { + if (!inputs || typeof inputs !== "object") { + return; + } + const params = inputs; + if (operationName === "embeddings") { + const text = params.text; + if (text == null || typeof text === "string" && text.length === 0 || Array.isArray(text) && text.length === 0) { + return; + } + span.setAttribute(attributes.GEN_AI_EMBEDDINGS_INPUT, typeof text === "string" ? text : JSON.stringify(text)); + return; + } + const src = params.messages ?? params.prompt; + if (src == null || Array.isArray(src) && src.length === 0) { + return; + } + const { systemInstructions, filteredMessages } = utils.extractSystemInstructions(src); + if (systemInstructions) { + span.setAttribute(attributes.GEN_AI_SYSTEM_INSTRUCTIONS, systemInstructions); + } + span.setAttribute( + attributes.GEN_AI_INPUT_MESSAGES, + enableTruncation ? utils.getTruncatedJsonString(filteredMessages) : string.stringify(filteredMessages) + ); + span.setAttribute( + genAiAttributes.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE, + Array.isArray(filteredMessages) ? filteredMessages.length : 1 + ); +} +function setOutputMessagesAttribute(span, { responseText, toolCalls }) { + const parts = []; + if (typeof responseText === "string" && responseText.length > 0) { + parts.push({ type: "text", content: responseText }); + } + if (Array.isArray(toolCalls)) { + for (const toolCall of toolCalls) { + if (!toolCall || typeof toolCall !== "object") { + continue; + } + const call = toolCall; + const name = call.function?.name ?? call.name; + const args = call.function?.arguments ?? call.arguments; + parts.push({ + type: "tool_call", + id: call.id, + name, + arguments: typeof args === "string" ? args : JSON.stringify(args ?? {}) + }); + } + } + if (parts.length > 0) { + span.setAttribute(genAiAttributes.GEN_AI_OUTPUT_MESSAGES_ATTRIBUTE, JSON.stringify([{ role: "assistant", parts }])); + } +} +function addResponseAttributes(span, result, recordOutputs) { + if (!result || typeof result !== "object" || // Raw `Response` objects (from `returnRawResponse`/`websocket`) cannot be introspected without consuming them. + typeof Response !== "undefined" && result instanceof Response) { + return; + } + const response = result; + if (response.usage) { + utils.setTokenUsageAttributes(span, response.usage.prompt_tokens, response.usage.completion_tokens); + } + if (recordOutputs) { + let responseText; + if (typeof response.response === "string") { + responseText = response.response; + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE, response.response); + } else if (response.response != null) { + responseText = JSON.stringify(response.response); + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_TEXT_ATTRIBUTE, responseText); + } + const toolCalls = Array.isArray(response.tool_calls) && response.tool_calls.length > 0 ? response.tool_calls : void 0; + if (toolCalls) { + span.setAttribute(genAiAttributes.GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE, JSON.stringify(toolCalls)); + } + setOutputMessagesAttribute(span, { responseText, toolCalls }); + } +} + +exports.addRequestAttributes = addRequestAttributes; +exports.addResponseAttributes = addResponseAttributes; +exports.extractRequestAttributes = extractRequestAttributes; +exports.getOperationName = getOperationName; +exports.setOutputMessagesAttribute = setOutputMessagesAttribute; //# sourceMappingURL=utils.js.map @@ -74039,108 +35283,83 @@ exports.setCapturedScopesOnSpan = setCapturedScopesOnSpan; /***/ 24899: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); -const envelope = __nccwpck_require__(72635); -const error = __nccwpck_require__(66322); -const logger = __nccwpck_require__(38752); -const promisebuffer = __nccwpck_require__(28058); -const ratelimit = __nccwpck_require__(78922); -const syncpromise = __nccwpck_require__(15621); +const debugLogger = __nccwpck_require__(41772); +const envelope = __nccwpck_require__(56987); +const promisebuffer = __nccwpck_require__(80503); +const ratelimit = __nccwpck_require__(6928); const DEFAULT_TRANSPORT_BUFFER_SIZE = 64; - -/** - * Creates an instance of a Sentry `Transport` - * - * @param options - * @param makeRequest - */ -function createTransport( - options, - makeRequest, - buffer = promisebuffer.makePromiseBuffer( - options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE, - ), -) { +function createTransport(options, makeRequest, buffer = promisebuffer.makePromiseBuffer( + options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE +)) { let rateLimits = {}; const flush = (timeout) => buffer.drain(timeout); - function send(envelope$1) { const filteredEnvelopeItems = []; - - // Drop rate limited items from envelope envelope.forEachEnvelopeItem(envelope$1, (item, type) => { const dataCategory = envelope.envelopeItemTypeToDataCategory(type); if (ratelimit.isRateLimited(rateLimits, dataCategory)) { - const event = getEventForEnvelopeItem(item, type); - options.recordDroppedEvent('ratelimit_backoff', dataCategory, event); + options.recordDroppedEvent("ratelimit_backoff", dataCategory); } else { filteredEnvelopeItems.push(item); } }); - - // Skip sending if envelope is empty after filtering out rate limited events if (filteredEnvelopeItems.length === 0) { - return syncpromise.resolvedSyncPromise({}); + return Promise.resolve({}); } - - const filteredEnvelope = envelope.createEnvelope(envelope$1[0], filteredEnvelopeItems ); - - // Creates client report for each item in an envelope + const filteredEnvelope = envelope.createEnvelope(envelope$1[0], filteredEnvelopeItems); const recordEnvelopeLoss = (reason) => { + if (envelope.envelopeContainsItemType(filteredEnvelope, ["client_report"])) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn(`Dropping client report. Will not send outcomes (reason: ${reason}).`); + return; + } envelope.forEachEnvelopeItem(filteredEnvelope, (item, type) => { - const event = getEventForEnvelopeItem(item, type); - options.recordDroppedEvent(reason, envelope.envelopeItemTypeToDataCategory(type), event); + options.recordDroppedEvent(reason, envelope.envelopeItemTypeToDataCategory(type)); }); }; - - const requestTask = () => - makeRequest({ body: envelope.serializeEnvelope(filteredEnvelope) }).then( - response => { - // We don't want to throw on NOK responses, but we want to at least log them - if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) { - debugBuild.DEBUG_BUILD && logger.logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); - } - - rateLimits = ratelimit.updateRateLimits(rateLimits, response); + const requestTask = () => makeRequest({ body: envelope.serializeEnvelope(filteredEnvelope) }).then( + (response) => { + if (response.statusCode === 413) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error( + "Sentry responded with status code 413. Envelope was discarded due to exceeding size limits." + ); + recordEnvelopeLoss("send_error"); return response; - }, - error => { - recordEnvelopeLoss('network_error'); - throw error; - }, - ); - - return buffer.add(requestTask).then( - result => result, - error$1 => { - if (error$1 instanceof error.SentryError) { - debugBuild.DEBUG_BUILD && logger.logger.error('Skipped sending event because buffer is full.'); - recordEnvelopeLoss('queue_overflow'); - return syncpromise.resolvedSyncPromise({}); - } else { - throw error$1; } + if (debugBuild.DEBUG_BUILD && response.statusCode !== void 0 && (response.statusCode < 200 || response.statusCode >= 300)) { + debugLogger.debug.warn(`Sentry responded with status code ${response.statusCode} to sent event.`); + } + rateLimits = ratelimit.updateRateLimits(rateLimits, response); + return response; }, + (error) => { + recordEnvelopeLoss("network_error"); + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Encountered error running transport request:", error); + throw error; + } + ); + return buffer.add(requestTask).then( + (result) => result, + (error) => { + if (error === promisebuffer.SENTRY_BUFFER_FULL_ERROR) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Skipped sending event because buffer is full."); + recordEnvelopeLoss("queue_overflow"); + return Promise.resolve({}); + } else { + throw error; + } + } ); } - return { send, - flush, + flush }; } -function getEventForEnvelopeItem(item, type) { - if (type !== 'event' && type !== 'transaction') { - return undefined; - } - - return Array.isArray(item) ? (item )[1] : undefined; -} - exports.DEFAULT_TRANSPORT_BUFFER_SIZE = DEFAULT_TRANSPORT_BUFFER_SIZE; exports.createTransport = createTransport; //# sourceMappingURL=base.js.map @@ -74151,143 +35370,103 @@ exports.createTransport = createTransport; /***/ 97281: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const api = __nccwpck_require__(88563); -const dsn = __nccwpck_require__(32540); -const envelope = __nccwpck_require__(72635); +const dsn = __nccwpck_require__(91582); +const envelope = __nccwpck_require__(56987); -/** - * Gets an event from an envelope. - * - * This is only exported for use in the tests - */ +const MULTIPLEXED_TRANSPORT_EXTRA_KEY = "MULTIPLEXED_TRANSPORT_EXTRA_KEY"; function eventFromEnvelope(env, types) { let event; - envelope.forEachEnvelopeItem(env, (item, type) => { if (types.includes(type)) { - event = Array.isArray(item) ? (item )[1] : undefined; + event = Array.isArray(item) ? item[1] : void 0; } - // bail out if we found an event return !!event; }); - return event; } - -/** - * Creates a transport that overrides the release on all events. - */ -function makeOverrideReleaseTransport( - createTransport, - release, -) { - return options => { +function makeOverrideReleaseTransport(createTransport, release) { + return (options) => { const transport = createTransport(options); - return { ...transport, send: async (envelope) => { - const event = eventFromEnvelope(envelope, ['event', 'transaction', 'profile', 'replay_event']); - + const event = eventFromEnvelope(envelope, ["event", "transaction", "profile", "replay_event"]); if (event) { event.release = release; } return transport.send(envelope); - }, + } }; }; } - -/** Overrides the DSN in the envelope header */ function overrideDsn(envelope$1, dsn) { return envelope.createEnvelope( - dsn - ? { - ...envelope$1[0], - dsn, - } - : envelope$1[0], - envelope$1[1], + dsn ? { + ...envelope$1[0], + dsn + } : envelope$1[0], + envelope$1[1] ); } - -/** - * Creates a transport that can send events to different DSNs depending on the envelope contents. - */ -function makeMultiplexedTransport( - createTransport, - matcher, -) { - return options => { +function makeMultiplexedTransport(createTransport, matcher) { + return (options) => { const fallbackTransport = createTransport(options); - const otherTransports = new Map(); - + const otherTransports = /* @__PURE__ */ new Map(); + const actualMatcher = matcher || ((args) => { + const event = args.getEvent(); + if (event?.extra?.[MULTIPLEXED_TRANSPORT_EXTRA_KEY] && Array.isArray(event.extra[MULTIPLEXED_TRANSPORT_EXTRA_KEY])) { + return event.extra[MULTIPLEXED_TRANSPORT_EXTRA_KEY]; + } + return []; + }); function getTransport(dsn$1, release) { - // We create a transport for every unique dsn/release combination as there may be code from multiple releases in - // use at the same time const key = release ? `${dsn$1}:${release}` : dsn$1; - let transport = otherTransports.get(key); - if (!transport) { const validatedDsn = dsn.dsnFromString(dsn$1); if (!validatedDsn) { - return undefined; + return void 0; } const url = api.getEnvelopeEndpointWithUrlEncodedAuth(validatedDsn, options.tunnel); - - transport = release - ? makeOverrideReleaseTransport(createTransport, release)({ ...options, url }) - : createTransport({ ...options, url }); - + transport = release ? makeOverrideReleaseTransport(createTransport, release)({ ...options, url }) : createTransport({ ...options, url }); otherTransports.set(key, transport); } - return [dsn$1, transport]; } - async function send(envelope) { function getEvent(types) { - const eventTypes = types && types.length ? types : ['event']; + const eventTypes = types?.length ? types : ["event"]; return eventFromEnvelope(envelope, eventTypes); } - - const transports = matcher({ envelope, getEvent }) - .map(result => { - if (typeof result === 'string') { - return getTransport(result, undefined); - } else { - return getTransport(result.dsn, result.release); - } - }) - .filter((t) => !!t); - - // If we have no transports to send to, use the fallback transport - // Don't override the DSN in the header for the fallback transport. '' is falsy - const transportsWithFallback = transports.length ? transports : [['', fallbackTransport]]; - - const results = (await Promise.all( - transportsWithFallback.map(([dsn, transport]) => transport.send(overrideDsn(envelope, dsn))), - )) ; - + const transports = actualMatcher({ envelope, getEvent }).map((result) => { + if (typeof result === "string") { + return getTransport(result, void 0); + } else { + return getTransport(result.dsn, result.release); + } + }).filter((t) => !!t); + const transportsWithFallback = transports.length ? transports : [["", fallbackTransport]]; + const results = await Promise.all( + transportsWithFallback.map(([dsn, transport]) => transport.send(overrideDsn(envelope, dsn))) + ); return results[0]; } - async function flush(timeout) { const allTransports = [...otherTransports.values(), fallbackTransport]; - const results = await Promise.all(allTransports.map(transport => transport.flush(timeout))); - return results.every(r => r); + const results = await Promise.all(allTransports.map((transport) => transport.flush(timeout))); + return results.every((r) => r); } - return { send, - flush, + flush }; }; } +exports.MULTIPLEXED_TRANSPORT_EXTRA_KEY = MULTIPLEXED_TRANSPORT_EXTRA_KEY; exports.eventFromEnvelope = eventFromEnvelope; exports.makeMultiplexedTransport = makeMultiplexedTransport; //# sourceMappingURL=multiplexed.js.map @@ -74298,152 +35477,115 @@ exports.makeMultiplexedTransport = makeMultiplexedTransport; /***/ 52419: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); -const envelope = __nccwpck_require__(72635); -const logger = __nccwpck_require__(38752); -const ratelimit = __nccwpck_require__(78922); +const debugLogger = __nccwpck_require__(41772); +const envelope = __nccwpck_require__(56987); +const randomSafeContext = __nccwpck_require__(28695); +const ratelimit = __nccwpck_require__(6928); +const timer = __nccwpck_require__(85548); -const MIN_DELAY = 100; // 100 ms -const START_DELAY = 5000; // 5 seconds -const MAX_DELAY = 3.6e6; // 1 hour - -/** - * Wraps a transport and stores and retries events when they fail to send. - * - * @param createTransport The transport to wrap. - */ -function makeOfflineTransport( - createTransport, -) { +const MIN_DELAY = 100; +const START_DELAY = 5e3; +const MAX_DELAY = 36e5; +function makeOfflineTransport(createTransport) { function log(...args) { - debugBuild.DEBUG_BUILD && logger.logger.info('[Offline]:', ...args); + debugBuild.DEBUG_BUILD && debugLogger.debug.log("[Offline]:", ...args); } - - return options => { + return (options) => { const transport = createTransport(options); - if (!options.createStore) { - throw new Error('No `createStore` function was provided'); + throw new Error("No `createStore` function was provided"); } - const store = options.createStore(options); - let retryDelay = START_DELAY; let flushTimer; - - function shouldQueue(env, error, retryDelay) { - // We want to drop client reports because they can be generated when we retry sending events while offline. - if (envelope.envelopeContainsItemType(env, ['client_report'])) { + function shouldQueue(env, error, retryDelay2) { + if (envelope.envelopeContainsItemType(env, ["client_report"])) { return false; } - if (options.shouldStore) { - return options.shouldStore(env, error, retryDelay); + return options.shouldStore(env, error, retryDelay2); } - return true; } - function flushIn(delay) { if (flushTimer) { - clearTimeout(flushTimer ); - } - - flushTimer = setTimeout(async () => { - flushTimer = undefined; - - const found = await store.shift(); - if (found) { - log('Attempting to send previously queued event'); - - // We should to update the sent_at timestamp to the current time. - found[0].sent_at = new Date().toISOString(); - - void send(found, true).catch(e => { - log('Failed to retry sending', e); - }); - } - }, delay) ; - - // We need to unref the timer in node.js, otherwise the node process never exit. - if (typeof flushTimer !== 'number' && flushTimer.unref) { - flushTimer.unref(); + clearTimeout(flushTimer); } + flushTimer = timer.safeUnref( + setTimeout(async () => { + flushTimer = void 0; + const found = await store.shift(); + if (found) { + log("Attempting to send previously queued event"); + found[0].sent_at = new Date(randomSafeContext.safeDateNow()).toISOString(); + void send(found, true).catch((e) => { + log("Failed to retry sending", e); + }); + } + }, delay) + ); } - function flushWithBackOff() { if (flushTimer) { return; } - flushIn(retryDelay); - retryDelay = Math.min(retryDelay * 2, MAX_DELAY); } - async function send(envelope$1, isRetry = false) { - // We queue all replay envelopes to avoid multiple replay envelopes being sent at the same time. If one fails, we - // need to retry them in order. - if (!isRetry && envelope.envelopeContainsItemType(envelope$1, ['replay_event', 'replay_recording'])) { + if (!isRetry && envelope.envelopeContainsItemType(envelope$1, ["replay_event", "replay_recording"])) { await store.push(envelope$1); flushIn(MIN_DELAY); return {}; } - try { + if (options.shouldSend && await options.shouldSend(envelope$1) === false) { + throw new Error("Envelope not sent because `shouldSend` callback returned false"); + } const result = await transport.send(envelope$1); - let delay = MIN_DELAY; - if (result) { - // If there's a retry-after header, use that as the next delay. - if (result.headers && result.headers['retry-after']) { - delay = ratelimit.parseRetryAfterHeader(result.headers['retry-after']); - } else if (result.headers && result.headers['x-sentry-rate-limits']) { - delay = 60000; // 60 seconds - } // If we have a server error, return now so we don't flush the queue. - else if ((result.statusCode || 0) >= 400) { + if (result.headers?.["retry-after"]) { + delay = ratelimit.parseRetryAfterHeader(result.headers["retry-after"]); + } else if (result.headers?.["x-sentry-rate-limits"]) { + delay = 6e4; + } else if ((result.statusCode || 0) >= 400) { return result; } } - flushIn(delay); retryDelay = START_DELAY; return result; } catch (e) { - if (await shouldQueue(envelope$1, e , retryDelay)) { - // If this envelope was a retry, we want to add it to the front of the queue so it's retried again first. + if (await shouldQueue(envelope$1, e, retryDelay)) { if (isRetry) { await store.unshift(envelope$1); } else { await store.push(envelope$1); } flushWithBackOff(); - log('Error sending. Event queued.', e ); + log("Error sending. Event queued.", e); return {}; } else { throw e; } } } - if (options.flushAtStartup) { flushWithBackOff(); } - return { send, - flush: timeout => { - // If there's no timeout, we should attempt to flush the offline queue. - if (timeout === undefined) { + flush: (timeout) => { + if (timeout === void 0) { retryDelay = START_DELAY; flushIn(MIN_DELAY); } - return transport.flush(timeout); - }, + } }; }; } @@ -74454,85 +35596,90 @@ exports.makeOfflineTransport = makeOfflineTransport; //# sourceMappingURL=offline.js.map +/***/ }), + +/***/ 54620: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function addUserAgentToTransportHeaders(options) { + const sdkMetadata = options._metadata?.sdk; + const sdkUserAgent = sdkMetadata?.name && sdkMetadata?.version ? `${sdkMetadata?.name}/${sdkMetadata?.version}` : void 0; + options.transportOptions = { + ...options.transportOptions, + headers: { + ...sdkUserAgent && { "user-agent": sdkUserAgent }, + ...options.transportOptions?.headers + } + }; +} + +exports.addUserAgentToTransportHeaders = addUserAgentToTransportHeaders; +//# sourceMappingURL=userAgent.js.map + + /***/ }), /***/ 18833: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const exports$1 = __nccwpck_require__(10779); const semanticAttributes = __nccwpck_require__(36827); -__nccwpck_require__(21834); -__nccwpck_require__(87038); -__nccwpck_require__(38752); -__nccwpck_require__(14488); -__nccwpck_require__(75872); -const normalize = __nccwpck_require__(65543); -__nccwpck_require__(15621); +const normalize = __nccwpck_require__(68446); const trace = __nccwpck_require__(97956); +const normalizationHints = __nccwpck_require__(1477); -const trpcCaptureContext = { mechanism: { handled: false, data: { function: 'trpcMiddleware' } } }; - +const trpcCaptureContext = { mechanism: { handled: false, type: "auto.rpc.trpc.middleware" } }; function captureIfError(nextResult) { - // TODO: Set span status based on what TRPCError was encountered - if ( - typeof nextResult === 'object' && - nextResult !== null && - 'ok' in nextResult && - !nextResult.ok && - 'error' in nextResult - ) { + if (typeof nextResult === "object" && nextResult !== null && "ok" in nextResult && !nextResult.ok && "error" in nextResult) { exports$1.captureException(nextResult.error, trpcCaptureContext); } } - -/** - * Sentry tRPC middleware that captures errors and creates spans for tRPC procedures. - */ function trpcMiddleware(options = {}) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - return async function (opts) { + return async function(opts) { const { path, type, next, rawInput, getRawInput } = opts; - const client = currentScopes.getClient(); - const clientOptions = client && client.getOptions(); - + const clientOptions = client?.getOptions(); + const dataCollection = client?.getDataCollectionOptions(); const trpcContext = { procedure_path: path, - procedure_type: type, + procedure_type: type }; - - if (options.attachRpcInput !== undefined ? options.attachRpcInput : clientOptions && clientOptions.sendDefaultPii) { - if (rawInput !== undefined) { + normalizationHints.setNormalizationDepthOverrideHint( + trpcContext, + 1 + // 1 for context.input + the normal normalization depth + (clientOptions?.normalizeDepth ?? 5) + // 5 is a sane depth + ); + if (options.attachRpcInput !== void 0 ? options.attachRpcInput : dataCollection?.httpBodies.includes("incomingRequest")) { + if (rawInput !== void 0) { trpcContext.input = normalize.normalize(rawInput); } - - if (getRawInput !== undefined && typeof getRawInput === 'function') { + if (getRawInput !== void 0 && typeof getRawInput === "function") { try { const rawRes = await getRawInput(); - trpcContext.input = normalize.normalize(rawRes); - } catch (err) { - // noop + } catch { } } } - - return currentScopes.withScope(scope => { - scope.setContext('trpc', trpcContext); + return currentScopes.withIsolationScope((scope) => { + scope.setContext("trpc", trpcContext); return trace.startSpanManual( { name: `trpc/${path}`, - op: 'rpc.server', + op: "rpc.server", attributes: { - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.rpc.trpc', + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "route", + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.rpc.trpc" }, + forceTransaction: !!options.forceTransaction }, - async span => { + async (span) => { try { const nextResult = await next(); captureIfError(nextResult); @@ -74543,8 +35690,8 @@ function trpcMiddleware(options = {}) { span.end(); throw e; } - }, - ) ; + } + ); }); }; } @@ -74555,71 +35702,38 @@ exports.trpcMiddleware = trpcMiddleware; /***/ }), -/***/ 29416: +/***/ 70277: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const is = __nccwpck_require__(84085); -const string = __nccwpck_require__(93529); +const is = __nccwpck_require__(68370); -/** - * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter. - */ -function applyAggregateErrorsToEvent( - exceptionFromErrorImplementation, - parser, - maxValueLimit = 250, - key, - limit, - event, - hint, -) { - if (!event.exception || !event.exception.values || !hint || !is.isInstanceOf(hint.originalException, Error)) { +function applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser, key, limit, event, hint) { + if (!event.exception?.values || !hint || !is.isError(hint.originalException)) { return; } - - // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error - const originalException = - event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined; - - // We only create exception grouping if there is an exception in the event. + const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0; if (originalException) { - event.exception.values = truncateAggregateExceptions( - aggregateExceptionsFromError( - exceptionFromErrorImplementation, - parser, - limit, - hint.originalException , - key, - event.exception.values, - originalException, - 0, - ), - maxValueLimit, + event.exception.values = aggregateExceptionsFromError( + exceptionFromErrorImplementation, + parser, + limit, + hint.originalException, + key, + event.exception.values, + originalException, + 0 ); } } - -function aggregateExceptionsFromError( - exceptionFromErrorImplementation, - parser, - limit, - error, - key, - prevExceptions, - exception, - exceptionId, -) { +function aggregateExceptionsFromError(exceptionFromErrorImplementation, parser, limit, error, key, prevExceptions, exception, exceptionId) { if (prevExceptions.length >= limit + 1) { return prevExceptions; } - let newExceptions = [...prevExceptions]; - - // Recursively call this function in order to walk down a chain of errors - if (is.isInstanceOf(error[key], Error)) { - applyExceptionGroupFieldsForParentException(exception, exceptionId); + if (is.isError(error[key])) { + applyExceptionGroupFieldsForParentException(exception, exceptionId, error); const newException = exceptionFromErrorImplementation(parser, error[key]); const newExceptionId = newExceptions.length; applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); @@ -74631,16 +35745,13 @@ function aggregateExceptionsFromError( key, [newException, ...newExceptions], newException, - newExceptionId, + newExceptionId ); } - - // This will create exception grouping for AggregateErrors - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError - if (Array.isArray(error.errors)) { + if (isExceptionGroup(error)) { error.errors.forEach((childError, i) => { - if (is.isInstanceOf(childError, Error)) { - applyExceptionGroupFieldsForParentException(exception, exceptionId); + if (is.isError(childError)) { + applyExceptionGroupFieldsForParentException(exception, exceptionId, error); const newException = exceptionFromErrorImplementation(parser, childError); const newExceptionId = newExceptions.length; applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId); @@ -74652,139 +35763,118 @@ function aggregateExceptionsFromError( key, [newException, ...newExceptions], newException, - newExceptionId, + newExceptionId ); } }); } - return newExceptions; } - -function applyExceptionGroupFieldsForParentException(exception, exceptionId) { - // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default. - exception.mechanism = exception.mechanism || { type: 'generic', handled: true }; - +function isExceptionGroup(error) { + return Array.isArray(error.errors); +} +function applyExceptionGroupFieldsForParentException(exception, exceptionId, error) { exception.mechanism = { + handled: true, + type: "auto.core.linked_errors", + ...isExceptionGroup(error) && { is_exception_group: true }, ...exception.mechanism, - ...(exception.type === 'AggregateError' && { is_exception_group: true }), - exception_id: exceptionId, + exception_id: exceptionId }; } - -function applyExceptionGroupFieldsForChildException( - exception, - source, - exceptionId, - parentId, -) { - // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default. - exception.mechanism = exception.mechanism || { type: 'generic', handled: true }; - +function applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) { exception.mechanism = { + handled: true, ...exception.mechanism, - type: 'chained', + type: "chained", source, exception_id: exceptionId, - parent_id: parentId, + parent_id: parentId }; } -/** - * Truncate the message (exception.value) of all exceptions in the event. - * Because this event processor is ran after `applyClientOptions`, - * we need to truncate the message of the added exceptions here. - */ -function truncateAggregateExceptions(exceptions, maxValueLength) { - return exceptions.map(exception => { - if (exception.value) { - exception.value = string.truncate(exception.value, maxValueLength); - } - return exception; - }); -} - exports.applyAggregateErrorsToEvent = applyAggregateErrorsToEvent; //# sourceMappingURL=aggregate-errors.js.map /***/ }), -/***/ 13231: +/***/ 32397: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const nodeStackTrace = __nccwpck_require__(70169); -const object = __nccwpck_require__(16100); -const stacktrace = __nccwpck_require__(85820); +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); -/** - * A node.js watchdog timer - * @param pollInterval The interval that we expect to get polled at - * @param anrThreshold The threshold for when we consider ANR - * @param callback The callback to call for ANR - * @returns An object with `poll` and `enabled` functions {@link WatchdogReturn} - */ -function watchdogTimer( - createTimer, - pollInterval, - anrThreshold, - callback, -) { +const SKIPPED_AI_PROVIDERS = /* @__PURE__ */ new Set(); +function _INTERNAL_skipAiProviderWrapping(modules) { + modules.forEach((module) => { + SKIPPED_AI_PROVIDERS.add(module); + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`AI provider "${module}" wrapping will be skipped`); + }); +} +function _INTERNAL_shouldSkipAiProviderWrapping(module) { + return SKIPPED_AI_PROVIDERS.has(module); +} +function _INTERNAL_clearAiProviderSkips() { + SKIPPED_AI_PROVIDERS.clear(); + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Cleared AI provider skip registrations"); +} + +exports._INTERNAL_clearAiProviderSkips = _INTERNAL_clearAiProviderSkips; +exports._INTERNAL_shouldSkipAiProviderWrapping = _INTERNAL_shouldSkipAiProviderWrapping; +exports._INTERNAL_skipAiProviderWrapping = _INTERNAL_skipAiProviderWrapping; +//# sourceMappingURL=providerSkip.js.map + + +/***/ }), + +/***/ 87507: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const nodeStackTrace = __nccwpck_require__(27068); +const stacktrace = __nccwpck_require__(22902); + +function watchdogTimer(createTimer, pollInterval, anrThreshold, callback) { const timer = createTimer(); let triggered = false; let enabled = true; - setInterval(() => { const diffMs = timer.getTimeMs(); - if (triggered === false && diffMs > pollInterval + anrThreshold) { triggered = true; if (enabled) { callback(); } } - if (diffMs < pollInterval + anrThreshold) { triggered = false; } }, 20); - return { poll: () => { timer.reset(); }, enabled: (state) => { enabled = state; - }, + } }; } - -// types copied from inspector.d.ts - -/** - * Converts Debugger.CallFrame to Sentry StackFrame - */ -function callFrameToStackFrame( - frame, - url, - getModuleFromFilename, -) { - const filename = url ? url.replace(/^file:\/\//, '') : undefined; - - // CallFrame row/col are 0 based, whereas StackFrame are 1 based - const colno = frame.location.columnNumber ? frame.location.columnNumber + 1 : undefined; - const lineno = frame.location.lineNumber ? frame.location.lineNumber + 1 : undefined; - - return object.dropUndefinedKeys({ +function callFrameToStackFrame(frame, url, getModuleFromFilename) { + const filename = url ? url.replace(/^file:\/\//, "") : void 0; + const colno = frame.location.columnNumber ? frame.location.columnNumber + 1 : void 0; + const lineno = frame.location.lineNumber ? frame.location.lineNumber + 1 : void 0; + return { filename, module: getModuleFromFilename(filename), function: frame.functionName || stacktrace.UNKNOWN_FUNCTION, colno, lineno, - in_app: filename ? nodeStackTrace.filenameIsInApp(filename) : undefined, - }); + in_app: filename ? nodeStackTrace.filenameIsInApp(filename) : void 0 + }; } exports.callFrameToStackFrame = callFrameToStackFrame; @@ -74794,116 +35884,55 @@ exports.watchdogTimer = watchdogTimer; /***/ }), -/***/ 28904: +/***/ 65064: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** Flattens a multi-dimensional array - * - * @deprecated This function is deprecated and will be removed in the next major version. - */ -function flatten(input) { - const result = []; - - const flattenHelper = (input) => { - input.forEach((el) => { - if (Array.isArray(el)) { - flattenHelper(el ); - } else { - result.push(el ); - } - }); - }; - - flattenHelper(input); - return result; +function uniq(input) { + return Array.from(new Set(input)); } -exports.flatten = flatten; +exports.uniq = uniq; //# sourceMappingURL=array.js.map /***/ }), -/***/ 86741: +/***/ 2135: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const debugBuild = __nccwpck_require__(87038); -const is = __nccwpck_require__(84085); -const logger = __nccwpck_require__(38752); - -/** - * @deprecated Use a `"baggage"` string directly - */ -const BAGGAGE_HEADER_NAME = 'baggage'; - -const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-'; +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); +const SENTRY_BAGGAGE_KEY_PREFIX = "sentry-"; const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; - -/** - * Max length of a serialized baggage string - * - * https://www.w3.org/TR/baggage/#limits - */ const MAX_BAGGAGE_STRING_LENGTH = 8192; - -/** - * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values - * from it. - * - * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks. - * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise. - */ -function baggageHeaderToDynamicSamplingContext( - // Very liberal definition of what any incoming header might look like - baggageHeader, -) { +function baggageHeaderToDynamicSamplingContext(baggageHeader) { const baggageObject = parseBaggageHeader(baggageHeader); - if (!baggageObject) { - return undefined; + return void 0; } - - // Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object. const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { - if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) { + if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) { const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); acc[nonPrefixedKey] = value; } return acc; }, {}); - - // Only return a dynamic sampling context object if there are keys in it. - // A keyless object means there were no sentry values on the header, which means that there is no DSC. if (Object.keys(dynamicSamplingContext).length > 0) { - return dynamicSamplingContext ; + return dynamicSamplingContext; } else { - return undefined; + return void 0; } } - -/** - * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-". - * - * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility - * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is - * `undefined` the function will return `undefined`. - * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext` - * was `undefined`, or if `dynamicSamplingContext` didn't contain any values. - */ -function dynamicSamplingContextToSentryBaggageHeader( - // this also takes undefined for convenience and bundle size in other places - dynamicSamplingContext, -) { +function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) { if (!dynamicSamplingContext) { - return undefined; + return void 0; } - - // Prefix all DSC keys with "sentry-" and put them into a new object const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( (acc, [dscKey, dscValue]) => { if (dscValue) { @@ -74911,24 +35940,15 @@ function dynamicSamplingContextToSentryBaggageHeader( } return acc; }, - {}, + {} ); - return objectToBaggageHeader(sentryPrefixedDSC); } - -/** - * Take a baggage header and parse it into an object. - */ -function parseBaggageHeader( - baggageHeader, -) { - if (!baggageHeader || (!is.isString(baggageHeader) && !Array.isArray(baggageHeader))) { - return undefined; +function parseBaggageHeader(baggageHeader) { + if (!baggageHeader || !is.isString(baggageHeader) && !Array.isArray(baggageHeader)) { + return void 0; } - if (Array.isArray(baggageHeader)) { - // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it return baggageHeader.reduce((acc, curr) => { const currBaggageObject = baggageHeaderToObject(curr); Object.entries(currBaggageObject).forEach(([key, value]) => { @@ -74937,86 +35957,111 @@ function parseBaggageHeader( return acc; }, {}); } - return baggageHeaderToObject(baggageHeader); } - -/** - * Will parse a baggage header, which is a simple key-value map, into a flat object. - * - * @param baggageHeader The baggage header to parse. - * @returns a flat object containing all the key-value pairs from `baggageHeader`. - */ function baggageHeaderToObject(baggageHeader) { - return baggageHeader - .split(',') - .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim()))) - .reduce((acc, [key, value]) => { - if (key && value) { - acc[key] = value; + return baggageHeader.split(",").map((baggageEntry) => { + const eqIdx = baggageEntry.indexOf("="); + if (eqIdx === -1) { + return []; + } + const key = baggageEntry.slice(0, eqIdx); + const value = baggageEntry.slice(eqIdx + 1); + return [key, value].map((keyOrValue) => { + try { + return decodeURIComponent(keyOrValue.trim()); + } catch { + return; } - return acc; - }, {}); + }); + }).reduce((acc, [key, value]) => { + if (key && value) { + acc[key] = value; + } + return acc; + }, {}); } - -/** - * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs. - * - * @param object The object to turn into a baggage header. - * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header - * is not spec compliant. - */ function objectToBaggageHeader(object) { if (Object.keys(object).length === 0) { - // An empty baggage header is not spec compliant: We return undefined. - return undefined; + return void 0; } - return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => { const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`; const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`; if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) { - debugBuild.DEBUG_BUILD && - logger.logger.warn( - `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`, - ); + debugBuild.DEBUG_BUILD && debugLogger.debug.warn( + `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.` + ); return baggageHeader; } else { return newBaggageHeader; } - }, ''); + }, ""); +} +function mergeBaggageHeaders(existing, incoming) { + if (!existing) { + return incoming; + } + const existingEntries = parseBaggageHeader(existing); + const incomingEntries = parseBaggageHeader(incoming); + if (!incomingEntries) { + return existing; + } + const merged = {}; + let hasNewSentryEntries = false; + const newSentryEntries = {}; + const newNonSentryEntries = {}; + for (const [key, value] of Object.entries(incomingEntries)) { + if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) { + newSentryEntries[key] = value; + hasNewSentryEntries = true; + } else { + newNonSentryEntries[key] = value; + } + } + if (existingEntries) { + for (const [key, value] of Object.entries(existingEntries)) { + if (!hasNewSentryEntries || !key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) { + merged[key] = value; + } + } + } + if (hasNewSentryEntries) { + Object.assign(merged, newSentryEntries); + } + for (const [key, value] of Object.entries(newNonSentryEntries)) { + merged[key] ?? (merged[key] = value); + } + return objectToBaggageHeader(merged); } -exports.BAGGAGE_HEADER_NAME = BAGGAGE_HEADER_NAME; exports.MAX_BAGGAGE_STRING_LENGTH = MAX_BAGGAGE_STRING_LENGTH; exports.SENTRY_BAGGAGE_KEY_PREFIX = SENTRY_BAGGAGE_KEY_PREFIX; exports.SENTRY_BAGGAGE_KEY_PREFIX_REGEX = SENTRY_BAGGAGE_KEY_PREFIX_REGEX; exports.baggageHeaderToDynamicSamplingContext = baggageHeaderToDynamicSamplingContext; exports.dynamicSamplingContextToSentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader; +exports.mergeBaggageHeaders = mergeBaggageHeaders; +exports.objectToBaggageHeader = objectToBaggageHeader; exports.parseBaggageHeader = parseBaggageHeader; //# sourceMappingURL=baggage.js.map /***/ }), -/***/ 56448: +/***/ 12297: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** - * Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code. - */ function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) { - // NOTE: undefined defaults to 'info' in Sentry - if (statusCode === undefined) { - return undefined; + if (statusCode === void 0) { + return void 0; } else if (statusCode >= 400 && statusCode < 500) { - return 'warning'; + return "warning"; } else if (statusCode >= 500) { - return 'error'; + return "error"; } else { - return undefined; + return void 0; } } @@ -75026,116 +36071,71 @@ exports.getBreadcrumbLogLevelFromHttpStatusCode = getBreadcrumbLogLevelFromHttpS /***/ }), -/***/ 24450: +/***/ 77387: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const is = __nccwpck_require__(84085); -const worldwide = __nccwpck_require__(10891); - -const WINDOW = worldwide.GLOBAL_OBJ ; +const is = __nccwpck_require__(68370); +const worldwide = __nccwpck_require__(90935); +const WINDOW = worldwide.GLOBAL_OBJ; const DEFAULT_MAX_STRING_LENGTH = 80; - -/** - * Given a child DOM element, returns a query-selector statement describing that - * and its ancestors - * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz] - * @returns generated DOM path - */ -function htmlTreeAsString( - elem, - options = {}, -) { +function htmlTreeAsString(elem, options = {}) { if (!elem) { - return ''; + return ""; } - - // try/catch both: - // - accessing event.target (see getsentry/raven-js#838, #768) - // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly - // - can throw an exception in some circumstances. try { - let currentElem = elem ; + let currentElem = elem; const MAX_TRAVERSE_HEIGHT = 5; const out = []; let height = 0; let len = 0; - const separator = ' > '; + const separator = " > "; const sepLength = separator.length; let nextStr; const keyAttrs = Array.isArray(options) ? options : options.keyAttrs; - const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH; - + const maxStringLength = !Array.isArray(options) && options.maxStringLength || DEFAULT_MAX_STRING_LENGTH; while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { nextStr = _htmlElementAsString(currentElem, keyAttrs); - // bail out if - // - nextStr is the 'html' element - // - the length of the string that would be created exceeds maxStringLength - // (ignore this limit if we are on the first iteration) - if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) { + if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) { break; } - out.push(nextStr); - len += nextStr.length; currentElem = currentElem.parentNode; } - return out.reverse().join(separator); - } catch (_oO) { - return ''; + } catch { + return ""; } } - -/** - * Returns a simple, query-selector representation of a DOM element - * e.g. [HTMLElement] => input#foo.btn[name=baz] - * @returns generated DOM path - */ function _htmlElementAsString(el, keyAttrs) { - const elem = el - -; - + const elem = el; const out = []; - - if (!elem || !elem.tagName) { - return ''; + if (!elem?.tagName) { + return ""; } - - // @ts-expect-error WINDOW has HTMLElement if (WINDOW.HTMLElement) { - // If using the component name annotation plugin, this value may be available on the DOM node if (elem instanceof HTMLElement && elem.dataset) { - if (elem.dataset['sentryComponent']) { - return elem.dataset['sentryComponent']; + if (elem.dataset["sentryComponent"]) { + return elem.dataset["sentryComponent"]; } - if (elem.dataset['sentryElement']) { - return elem.dataset['sentryElement']; + if (elem.dataset["sentryElement"]) { + return elem.dataset["sentryElement"]; } } } - out.push(elem.tagName.toLowerCase()); - - // Pairs of attribute keys defined in `serializeAttribute` and their values on element. - const keyAttrPairs = - keyAttrs && keyAttrs.length - ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)]) - : null; - - if (keyAttrPairs && keyAttrPairs.length) { - keyAttrPairs.forEach(keyAttrPair => { + const keyAttrPairs = keyAttrs?.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null; + if (keyAttrPairs?.length) { + keyAttrPairs.forEach((keyAttrPair) => { out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); }); } else { if (elem.id) { out.push(`#${elem.id}`); } - const className = elem.className; if (className && is.isString(className)) { const classes = className.split(/\s+/); @@ -75144,91 +36144,44 @@ function _htmlElementAsString(el, keyAttrs) { } } } - const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt']; - for (const k of allowedAttrs) { + for (const k of ["aria-label", "type", "name", "title", "alt"]) { const attr = elem.getAttribute(k); if (attr) { out.push(`[${k}="${attr}"]`); } } - - return out.join(''); + return out.join(""); } - -/** - * A safe form of location.href - */ function getLocationHref() { try { return WINDOW.document.location.href; - } catch (oO) { - return ''; + } catch { + return ""; } } - -/** - * Gets a DOM element by using document.querySelector. - * - * This wrapper will first check for the existence of the function before - * actually calling it so that we don't have to take care of this check, - * every time we want to access the DOM. - * - * Reason: DOM/querySelector is not available in all environments. - * - * We have to cast to any because utils can be consumed by a variety of environments, - * and we don't want to break TS users. If you know what element will be selected by - * `document.querySelector`, specify it as part of the generic call. For example, - * `const element = getDomElement('selector');` - * - * @param selector the selector string passed on to document.querySelector - * - * @deprecated This method is deprecated and will be removed in the next major version. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function getDomElement(selector) { - if (WINDOW.document && WINDOW.document.querySelector) { - return WINDOW.document.querySelector(selector) ; - } - return null; -} - -/** - * Given a DOM element, traverses up the tree until it finds the first ancestor node - * that has the `data-sentry-component` or `data-sentry-element` attribute with `data-sentry-component` taking - * precedence. This attribute is added at build-time by projects that have the component name annotation plugin installed. - * - * @returns a string representation of the component for the provided DOM element, or `null` if not found - */ -function getComponentName(elem) { - // @ts-expect-error WINDOW has HTMLElement +function getComponentName(elem, maxTraverseHeight = 5) { if (!WINDOW.HTMLElement) { return null; } - - let currentElem = elem ; - const MAX_TRAVERSE_HEIGHT = 5; - for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) { + let currentElem = elem; + for (let i = 0; i < maxTraverseHeight; i++) { if (!currentElem) { return null; } - if (currentElem instanceof HTMLElement) { - if (currentElem.dataset['sentryComponent']) { - return currentElem.dataset['sentryComponent']; + if (currentElem.dataset["sentryComponent"]) { + return currentElem.dataset["sentryComponent"]; } - if (currentElem.dataset['sentryElement']) { - return currentElem.dataset['sentryElement']; + if (currentElem.dataset["sentryElement"]) { + return currentElem.dataset["sentryElement"]; } } - currentElem = currentElem.parentNode; } - return null; } exports.getComponentName = getComponentName; -exports.getDomElement = getDomElement; exports.getLocationHref = getLocationHref; exports.htmlTreeAsString = htmlTreeAsString; //# sourceMappingURL=browser.js.map @@ -75236,498 +36189,69 @@ exports.htmlTreeAsString = htmlTreeAsString; /***/ }), -/***/ 89294: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const _nullishCoalesce = __nccwpck_require__(68874); - -// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f -// -// The MIT License (MIT) -// -// Copyright (c) 2012-2018 various contributors (see AUTHORS) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - - -/** - * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the - * result of an async operation. - * - * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the - * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior. - * - * Adapted from Sucrase (https://github.com/alangpierce/sucrase) - * - * @param lhs The value of the expression to the left of the `??` - * @param rhsFn A function returning the value of the expression to the right of the `??` - * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value - */ -async function _asyncNullishCoalesce(lhs, rhsFn) { - return _nullishCoalesce._nullishCoalesce(lhs, rhsFn); -} - -// Sucrase version: -// async function _asyncNullishCoalesce(lhs, rhsFn) { -// if (lhs != null) { -// return lhs; -// } else { -// return await rhsFn(); -// } -// } - -exports._asyncNullishCoalesce = _asyncNullishCoalesce; -//# sourceMappingURL=_asyncNullishCoalesce.js.map - - -/***/ }), - -/***/ 82384: +/***/ 8438: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** - * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, - * descriptors, and functions, for situations in which at least one part of the expression is async. - * - * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See - * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 - * - * @param ops Array result of expression conversion - * @returns The value of the expression - */ -async function _asyncOptionalChain(ops) { - let lastAccessLHS = undefined; - let value = ops[0]; - let i = 1; - while (i < ops.length) { - const op = ops[i] ; - const fn = ops[i + 1] ; - i += 2; - // by checking for loose equality to `null`, we catch both `null` and `undefined` - if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { - // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it - return; +const isActualPromise = (p) => p instanceof Promise && !p[kChainedCopy]; +const kChainedCopy = /* @__PURE__ */ Symbol("chained PromiseLike"); +const chainAndCopyPromiseLike = (original, onSuccess, onError) => { + const chained = original.then( + (value) => { + onSuccess(value); + return value; + }, + (err) => { + onError(err); + throw err; } - if (op === 'access' || op === 'optionalAccess') { - lastAccessLHS = value; - value = await fn(value); - } else if (op === 'call' || op === 'optionalCall') { - value = await fn((...args) => (value ).call(lastAccessLHS, ...args)); - lastAccessLHS = undefined; + ); + return isActualPromise(chained) && isActualPromise(original) ? chained : copyProps(original, chained); +}; +const copyProps = (original, chained) => { + if (!chained) return original; + let mutated = false; + for (const key in original) { + if (key in chained) continue; + mutated = true; + const value = original[key]; + if (typeof value === "function") { + Object.defineProperty(chained, key, { + value: (...args) => value.apply(original, args), + enumerable: true, + configurable: true, + writable: true + }); + } else { + chained[key] = value; } } - return value; -} + if (mutated) Object.assign(chained, { [kChainedCopy]: true }); + return chained; +}; -// Sucrase version: -// async function _asyncOptionalChain(ops) { -// let lastAccessLHS = undefined; -// let value = ops[0]; -// let i = 1; -// while (i < ops.length) { -// const op = ops[i]; -// const fn = ops[i + 1]; -// i += 2; -// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { -// return undefined; -// } -// if (op === 'access' || op === 'optionalAccess') { -// lastAccessLHS = value; -// value = await fn(value); -// } else if (op === 'call' || op === 'optionalCall') { -// value = await fn((...args) => value.call(lastAccessLHS, ...args)); -// lastAccessLHS = undefined; -// } -// } -// return value; -// } - -exports._asyncOptionalChain = _asyncOptionalChain; -//# sourceMappingURL=_asyncOptionalChain.js.map +exports.chainAndCopyPromiseLike = chainAndCopyPromiseLike; +//# sourceMappingURL=chain-and-copy-promiselike.js.map /***/ }), -/***/ 24613: +/***/ 96472: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const _asyncOptionalChain = __nccwpck_require__(82384); +const envelope = __nccwpck_require__(56987); +const time = __nccwpck_require__(66690); -// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f -// -// The MIT License (MIT) -// -// Copyright (c) 2012-2018 various contributors (see AUTHORS) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - - -/** - * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, - * descriptors, and functions, in cases where the value of the expression is to be deleted. - * - * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See - * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 - * - * @param ops Array result of expression conversion - * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable - * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which - * case `false`. - */ -async function _asyncOptionalChainDelete(ops) { - const result = (await _asyncOptionalChain._asyncOptionalChain(ops)) ; - // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case, - // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in - // which case we return whatever the `delete` returned, which will be a boolean. - return result == null ? true : (result ); -} - -// Sucrase version: -// async function asyncOptionalChainDelete(ops) { -// const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops); -// return result == null ? true : result; -// } - -exports._asyncOptionalChainDelete = _asyncOptionalChainDelete; -//# sourceMappingURL=_asyncOptionalChainDelete.js.map - - -/***/ }), - -/***/ 68874: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f -// -// The MIT License (MIT) -// -// Copyright (c) 2012-2018 various contributors (see AUTHORS) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -/** - * Polyfill for the nullish coalescing operator (`??`). - * - * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the - * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior. - * - * Adapted from Sucrase (https://github.com/alangpierce/sucrase) - * - * @param lhs The value of the expression to the left of the `??` - * @param rhsFn A function returning the value of the expression to the right of the `??` - * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value - */ -function _nullishCoalesce(lhs, rhsFn) { - // by checking for loose equality to `null`, we catch both `null` and `undefined` - return lhs != null ? lhs : rhsFn(); -} - -// Sucrase version: -// function _nullishCoalesce(lhs, rhsFn) { -// if (lhs != null) { -// return lhs; -// } else { -// return rhsFn(); -// } -// } - -exports._nullishCoalesce = _nullishCoalesce; -//# sourceMappingURL=_nullishCoalesce.js.map - - -/***/ }), - -/***/ 6752: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, - * descriptors, and functions. - * - * Adapted from Sucrase (https://github.com/alangpierce/sucrase) - * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 - * - * @param ops Array result of expression conversion - * @returns The value of the expression - */ -function _optionalChain(ops) { - let lastAccessLHS = undefined; - let value = ops[0]; - let i = 1; - while (i < ops.length) { - const op = ops[i] ; - const fn = ops[i + 1] ; - i += 2; - // by checking for loose equality to `null`, we catch both `null` and `undefined` - if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { - // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it - return; - } - if (op === 'access' || op === 'optionalAccess') { - lastAccessLHS = value; - value = fn(value); - } else if (op === 'call' || op === 'optionalCall') { - value = fn((...args) => (value ).call(lastAccessLHS, ...args)); - lastAccessLHS = undefined; - } - } - return value; -} - -// Sucrase version -// function _optionalChain(ops) { -// let lastAccessLHS = undefined; -// let value = ops[0]; -// let i = 1; -// while (i < ops.length) { -// const op = ops[i]; -// const fn = ops[i + 1]; -// i += 2; -// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { -// return undefined; -// } -// if (op === 'access' || op === 'optionalAccess') { -// lastAccessLHS = value; -// value = fn(value); -// } else if (op === 'call' || op === 'optionalCall') { -// value = fn((...args) => value.call(lastAccessLHS, ...args)); -// lastAccessLHS = undefined; -// } -// } -// return value; -// } - -exports._optionalChain = _optionalChain; -//# sourceMappingURL=_optionalChain.js.map - - -/***/ }), - -/***/ 65631: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const _optionalChain = __nccwpck_require__(6752); - -// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f -// -// The MIT License (MIT) -// -// Copyright (c) 2012-2018 various contributors (see AUTHORS) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - - -/** - * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, - * descriptors, and functions, in cases where the value of the expression is to be deleted. - * - * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See - * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15 - * - * @param ops Array result of expression conversion - * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable - * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which - * case `false`. - */ -function _optionalChainDelete(ops) { - const result = _optionalChain._optionalChain(ops) ; - // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case, - // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in - // which case we return whatever the `delete` returned, which will be a boolean. - return result == null ? true : result; -} - -// Sucrase version: -// function _optionalChainDelete(ops) { -// const result = _optionalChain(ops); -// // by checking for loose equality to `null`, we catch both `null` and `undefined` -// return result == null ? true : result; -// } - -exports._optionalChainDelete = _optionalChainDelete; -//# sourceMappingURL=_optionalChainDelete.js.map - - -/***/ }), - -/***/ 6360: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * Creates a cache that evicts keys in fifo order - * @param size {Number} - * - * @deprecated This function is deprecated and will be removed in the next major version. - */ -function makeFifoCache( - size, -) - - { - // Maintain a fifo queue of keys, we cannot rely on Object.keys as the browser may not support it. - let evictionOrder = []; - let cache = {}; - - return { - add(key, value) { - while (evictionOrder.length >= size) { - // shift is O(n) but this is small size and only happens if we are - // exceeding the cache size so it should be fine. - const evictCandidate = evictionOrder.shift(); - - if (evictCandidate !== undefined) { - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - delete cache[evictCandidate]; - } - } - - // in case we have a collision, delete the old key. - if (cache[key]) { - this.delete(key); - } - - evictionOrder.push(key); - cache[key] = value; - }, - clear() { - cache = {}; - evictionOrder = []; - }, - get(key) { - return cache[key]; - }, - size() { - return evictionOrder.length; - }, - // Delete cache key and return true if it existed, false otherwise. - delete(key) { - if (!cache[key]) { - return false; - } - - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - delete cache[key]; - - for (let i = 0; i < evictionOrder.length; i++) { - if (evictionOrder[i] === key) { - evictionOrder.splice(i, 1); - break; - } - } - - return true; - }, - }; -} - -exports.makeFifoCache = makeFifoCache; -//# sourceMappingURL=cache.js.map - - -/***/ }), - -/***/ 27962: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const envelope = __nccwpck_require__(72635); -const time = __nccwpck_require__(75872); - -/** - * Creates client report envelope - * @param discarded_events An array of discard events - * @param dsn A DSN that can be set on the header. Optional. - */ -function createClientReportEnvelope( - discarded_events, - dsn, - timestamp, -) { +function createClientReportEnvelope(discarded_events, dsn, timestamp) { const clientReportItem = [ - { type: 'client_report' }, + { type: "client_report" }, { timestamp: timestamp || time.dateTimestampInSeconds(), - discarded_events, - }, + discarded_events + } ]; return envelope.createEnvelope(dsn ? { dsn } : {}, [clientReportItem]); } @@ -75738,87 +36262,40 @@ exports.createClientReportEnvelope = createClientReportEnvelope; /***/ }), -/***/ 49298: +/***/ 34724: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** - * This code was originally copied from the 'cookie` module at v0.5.0 and was simplified for our use case. - * https://github.com/jshttp/cookie/blob/a0c84147aab6266bdb3996cf4062e93907c0b0fc/index.js - * It had the following license: - * - * (The MIT License) - * - * Copyright (c) 2012-2014 Roman Shtylman - * Copyright (c) 2015 Douglas Christopher Wilson - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * 'Software'), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * Parses a cookie string - */ function parseCookie(str) { const obj = {}; let index = 0; - while (index < str.length) { - const eqIdx = str.indexOf('=', index); - - // no more cookie pairs + const eqIdx = str.indexOf("=", index); if (eqIdx === -1) { break; } - - let endIdx = str.indexOf(';', index); - + let endIdx = str.indexOf(";", index); if (endIdx === -1) { endIdx = str.length; } else if (endIdx < eqIdx) { - // backtrack on prior semicolon - index = str.lastIndexOf(';', eqIdx - 1) + 1; + index = str.lastIndexOf(";", eqIdx - 1) + 1; continue; } - const key = str.slice(index, eqIdx).trim(); - - // only assign once - if (undefined === obj[key]) { + if (void 0 === obj[key]) { let val = str.slice(eqIdx + 1, endIdx).trim(); - - // quoted values - if (val.charCodeAt(0) === 0x22) { + if (val.charCodeAt(0) === 34) { val = val.slice(1, -1); } - try { - obj[key] = val.indexOf('%') !== -1 ? decodeURIComponent(val) : val; - } catch (e) { + obj[key] = val.indexOf("%") !== -1 ? decodeURIComponent(val) : val; + } catch { obj[key] = val; } } - index = endIdx + 1; } - return obj; } @@ -75828,110 +36305,408 @@ exports.parseCookie = parseCookie; /***/ }), -/***/ 87038: -/***/ ((__unused_webpack_module, exports) => { +/***/ 21340: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** - * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. - * - * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. - */ -const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); +const filteringSnippets = __nccwpck_require__(25681); -exports.DEBUG_BUILD = DEBUG_BUILD; -//# sourceMappingURL=debug-build.js.map +function defaultPiiToCollectionOptions(sendDefaultPii) { + return sendDefaultPii === true ? { + userInfo: true, + cookies: true, + httpHeaders: { request: true, response: true }, + httpBodies: ["incomingRequest", "outgoingRequest", "incomingResponse", "outgoingResponse"], + urlQueryParams: true, + graphQL: { document: true, variables: true }, + genAI: { inputs: true, outputs: true }, + databaseQueryData: true, + stackFrameVariables: true, + frameContextLines: 7 + // default should be 5, but ContextLines integration uses 7 + } : { + userInfo: false, + cookies: { deny: filteringSnippets.PII_HEADER_SNIPPETS }, + httpHeaders: { request: { deny: filteringSnippets.PII_HEADER_SNIPPETS }, response: { deny: filteringSnippets.PII_HEADER_SNIPPETS } }, + httpBodies: [], + urlQueryParams: { deny: filteringSnippets.PII_HEADER_SNIPPETS }, + // The GraphQL document has literal values redacted at collection time, so it was historically + // always attached regardless of `sendDefaultPii`; keep it on to preserve that behavior. + graphQL: { document: true, variables: true }, + genAI: { inputs: false, outputs: false }, + // Database query values were only sent with `sendDefaultPii: true` (e.g. Supabase gated on it), + // so map the legacy "off" state to `false`. + databaseQueryData: false, + stackFrameVariables: true, + frameContextLines: 7 + // default should be 5, but ContextLines integration uses 7 + }; +} + +exports.defaultPiiToCollectionOptions = defaultPiiToCollectionOptions; +//# sourceMappingURL=defaultPiiToCollectionOptions.js.map /***/ }), -/***/ 4263: +/***/ 48482: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const worldwide = __nccwpck_require__(10891); +const cookie = __nccwpck_require__(34724); +const filteringSnippets = __nccwpck_require__(25681); +const filterKeyValueData = __nccwpck_require__(88468); -let parsedStackResults; -let lastKeysCount; -let cachedFilenameDebugIds; - -/** - * Returns a map of filenames to debug identifiers. - */ -function getFilenameToDebugIdMap(stackParser) { - const debugIdMap = worldwide.GLOBAL_OBJ._sentryDebugIds; - if (!debugIdMap) { +function filterCookies(cookieString, behavior) { + if (behavior === false) { return {}; } + try { + const parsed = cookie.parseCookie(cookieString); + if (Object.keys(parsed).length === 0) { + return {}; + } + return filterKeyValueData.filterKeyValueData(parsed, behavior, filteringSnippets.SENSITIVE_COOKIE_NAME_SNIPPETS); + } catch { + return filteringSnippets.FILTERED_VALUE; + } +} - const debugIdKeys = Object.keys(debugIdMap); +exports.filterCookies = filterCookies; +//# sourceMappingURL=filterCookies.js.map - // If the count of registered globals hasn't changed since the last call, we - // can just return the cached result. - if (cachedFilenameDebugIds && debugIdKeys.length === lastKeysCount) { + +/***/ }), + +/***/ 88468: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const filteringSnippets = __nccwpck_require__(25681); + +function isSensitiveKey(lower, denySnippets) { + return denySnippets.some((snippet) => lower.includes(snippet)); +} +function filterKeyValueData(data, behavior, additionalDenyTerms) { + if (behavior === false) { + return {}; + } + const denySnippets = additionalDenyTerms != null ? [...filteringSnippets.SENSITIVE_KEY_SNIPPETS, ...additionalDenyTerms] : filteringSnippets.SENSITIVE_KEY_SNIPPETS; + const result = {}; + if (behavior === true) { + for (const key of Object.keys(data)) { + result[key] = isSensitiveKey(key.toLowerCase(), denySnippets) ? filteringSnippets.FILTERED_VALUE : data[key]; + } + return result; + } + if ("deny" in behavior) { + const lowerTerms2 = behavior.deny.map((t) => t.toLowerCase()); + for (const key of Object.keys(data)) { + const lower = key.toLowerCase(); + const isDenied = isSensitiveKey(lower, denySnippets) || lowerTerms2.some((term) => lower.includes(term)); + result[key] = isDenied ? filteringSnippets.FILTERED_VALUE : data[key]; + } + return result; + } + const lowerTerms = behavior.allow.map((t) => t.toLowerCase()); + for (const key of Object.keys(data)) { + const lower = key.toLowerCase(); + if (isSensitiveKey(lower, denySnippets)) { + result[key] = filteringSnippets.FILTERED_VALUE; + } else { + const isAllowed = lowerTerms.some((term) => lower.includes(term)); + result[key] = isAllowed ? data[key] : filteringSnippets.FILTERED_VALUE; + } + } + return result; +} + +exports.filterKeyValueData = filterKeyValueData; +//# sourceMappingURL=filterKeyValueData.js.map + + +/***/ }), + +/***/ 25589: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const filteringSnippets = __nccwpck_require__(25681); +const filterKeyValueData = __nccwpck_require__(88468); + +function filterQueryParams(queryString, behavior) { + if (behavior === false) { + return {}; + } + try { + const params = new URLSearchParams(queryString); + const parsed = {}; + params.forEach((value, key) => { + parsed[key] = value; + }); + if (Object.keys(parsed).length === 0) { + return {}; + } + return filterKeyValueData.filterKeyValueData(parsed, behavior); + } catch { + return filteringSnippets.FILTERED_VALUE; + } +} + +exports.filterQueryParams = filterQueryParams; +//# sourceMappingURL=filterQueryParams.js.map + + +/***/ }), + +/***/ 25681: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const FILTERED_VALUE = "[Filtered]"; +const PII_HEADER_SNIPPETS = ["forwarded", "-ip", "remote-", "via", "-user"]; +const SENSITIVE_KEY_SNIPPETS = [ + "auth", + "token", + "secret", + "session", + // for the user_session cookie + "password", + "passwd", + "pwd", + "key", + "jwt", + "bearer", + "sso", + "saml", + "csrf", + "xsrf", + "credentials", + "sid", + "identity", + // Always treat cookie headers as sensitive in case individual key-value cookie pairs cannot properly be extracted + "set-cookie", + "cookie" +]; +const SENSITIVE_COOKIE_NAME_SNIPPETS = [ + // Express / Connect default session cookie + ".sid", + // Opaque session ids (PHPSESSID, ASPSESSIONID*, BIGipServer*, *sessid*, …) + "sessid", + // Laravel etc. "remember me" tokens + "remember", + // OIDC / OAuth auxiliary (`oauth*` covered by header snippet `auth`) + "oidc", + "pkce", + "nonce", + // RFC 6265bis high-security cookie name prefixes + "__secure-", + "__host-", + // Load balancer / CDN sticky-session cookies (opaque routing tokens) + "awsalb", + "awselb", + "akamai", + // BaaS / IdP session cookies (names often omit "session") + "__stripe", + "cognito", + "firebase", + "supabase", + "sb-", + // Step-up / MFA cookies + "mfa", + "2fa" +]; + +exports.FILTERED_VALUE = FILTERED_VALUE; +exports.PII_HEADER_SNIPPETS = PII_HEADER_SNIPPETS; +exports.SENSITIVE_COOKIE_NAME_SNIPPETS = SENSITIVE_COOKIE_NAME_SNIPPETS; +exports.SENSITIVE_KEY_SNIPPETS = SENSITIVE_KEY_SNIPPETS; +//# sourceMappingURL=filtering-snippets.js.map + + +/***/ }), + +/***/ 49908: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const defaultPiiToCollectionOptions = __nccwpck_require__(21340); + +const DEFAULTS = { + userInfo: true, + cookies: true, + httpHeaders: { request: true, response: true }, + httpBodies: ["incomingRequest", "outgoingRequest", "incomingResponse", "outgoingResponse"], + urlQueryParams: true, + graphQL: { document: true, variables: true }, + genAI: { inputs: true, outputs: true }, + databaseQueryData: true, + stackFrameVariables: true, + frameContextLines: 5 +}; +function resolveDataCollectionOptions(options) { + const base = options.dataCollection != null ? DEFAULTS : defaultPiiToCollectionOptions.defaultPiiToCollectionOptions(options.sendDefaultPii); + const dc = options.dataCollection ?? {}; + return { + userInfo: dc.userInfo ?? base.userInfo, + cookies: dc.cookies ?? base.cookies, + httpHeaders: { + request: dc.httpHeaders?.request ?? base.httpHeaders.request, + response: dc.httpHeaders?.response ?? base.httpHeaders.response + }, + httpBodies: dc.httpBodies ?? base.httpBodies, + // oxlint-disable-next-line typescript/no-deprecated + urlQueryParams: dc.urlQueryParams ?? dc.queryParams ?? base.urlQueryParams, + graphQL: { + document: dc.graphQL?.document ?? base.graphQL.document, + variables: dc.graphQL?.variables ?? base.graphQL.variables + }, + genAI: { + inputs: dc.genAI?.inputs ?? base.genAI.inputs, + outputs: dc.genAI?.outputs ?? base.genAI.outputs + }, + databaseQueryData: dc.databaseQueryData ?? base.databaseQueryData, + stackFrameVariables: dc.stackFrameVariables ?? base.stackFrameVariables, + frameContextLines: dc.frameContextLines ?? base.frameContextLines + }; +} + +exports.resolveDataCollectionOptions = resolveDataCollectionOptions; +//# sourceMappingURL=resolveDataCollectionOptions.js.map + + +/***/ }), + +/***/ 18431: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function debounce(func, wait, options) { + let callbackReturnValue; + let timerId; + let maxTimerId; + const maxWait = options?.maxWait ? Math.max(options.maxWait, wait) : 0; + const setTimeoutImpl = options?.setTimeoutImpl || setTimeout; + function invokeFunc() { + cancelTimers(); + callbackReturnValue = func(); + return callbackReturnValue; + } + function cancelTimers() { + timerId !== void 0 && clearTimeout(timerId); + maxTimerId !== void 0 && clearTimeout(maxTimerId); + timerId = maxTimerId = void 0; + } + function flush() { + if (timerId !== void 0 || maxTimerId !== void 0) { + return invokeFunc(); + } + return callbackReturnValue; + } + function debounced() { + if (timerId) { + clearTimeout(timerId); + } + timerId = setTimeoutImpl(invokeFunc, wait); + if (maxWait && maxTimerId === void 0) { + maxTimerId = setTimeoutImpl(invokeFunc, maxWait); + } + return callbackReturnValue; + } + debounced.cancel = cancelTimers; + debounced.flush = flush; + return debounced; +} + +exports.debounce = debounce; +//# sourceMappingURL=debounce.js.map + + +/***/ }), + +/***/ 26859: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const stacktrace = __nccwpck_require__(22902); +const worldwide = __nccwpck_require__(90935); + +let parsedStackResults; +let lastSentryKeysCount; +let lastNativeKeysCount; +let cachedFilenameDebugIds; +function getFilenameToDebugIdMap(stackParser) { + const sentryDebugIdMap = worldwide.GLOBAL_OBJ._sentryDebugIds; + const nativeDebugIdMap = worldwide.GLOBAL_OBJ._debugIds; + if (!sentryDebugIdMap && !nativeDebugIdMap) { + return {}; + } + const sentryDebugIdKeys = sentryDebugIdMap ? Object.keys(sentryDebugIdMap) : []; + const nativeDebugIdKeys = nativeDebugIdMap ? Object.keys(nativeDebugIdMap) : []; + if (cachedFilenameDebugIds && sentryDebugIdKeys.length === lastSentryKeysCount && nativeDebugIdKeys.length === lastNativeKeysCount) { return cachedFilenameDebugIds; } - - lastKeysCount = debugIdKeys.length; - - // Build a map of filename -> debug_id. - cachedFilenameDebugIds = debugIdKeys.reduce((acc, stackKey) => { - if (!parsedStackResults) { - parsedStackResults = {}; - } - - const result = parsedStackResults[stackKey]; - - if (result) { - acc[result[0]] = result[1]; - } else { - const parsedStack = stackParser(stackKey); - - for (let i = parsedStack.length - 1; i >= 0; i--) { - const stackFrame = parsedStack[i]; - const filename = stackFrame && stackFrame.filename; - const debugId = debugIdMap[stackKey]; - - if (filename && debugId) { - acc[filename] = debugId; - parsedStackResults[stackKey] = [filename, debugId]; - break; + lastSentryKeysCount = sentryDebugIdKeys.length; + lastNativeKeysCount = nativeDebugIdKeys.length; + cachedFilenameDebugIds = {}; + if (!parsedStackResults) { + parsedStackResults = {}; + } + const processDebugIds = (debugIdKeys, debugIdMap) => { + for (const key of debugIdKeys) { + const debugId = debugIdMap[key]; + const result = parsedStackResults?.[key]; + if (result && cachedFilenameDebugIds && debugId) { + cachedFilenameDebugIds[result[0]] = debugId; + if (parsedStackResults) { + parsedStackResults[key] = [result[0], debugId]; + } + } else if (debugId) { + const parsedStack = stackParser(key); + for (let i = parsedStack.length - 1; i >= 0; i--) { + const stackFrame = parsedStack[i]; + const filename = stackFrame?.filename; + if (filename && cachedFilenameDebugIds && parsedStackResults) { + cachedFilenameDebugIds[filename] = debugId; + parsedStackResults[key] = [filename, debugId]; + break; + } } } } - - return acc; - }, {}); - + }; + if (sentryDebugIdMap) { + processDebugIds(sentryDebugIdKeys, sentryDebugIdMap); + } + if (nativeDebugIdMap) { + processDebugIds(nativeDebugIdKeys, nativeDebugIdMap); + } return cachedFilenameDebugIds; } - -/** - * Returns a list of debug images for the given resources. - */ -function getDebugImagesForResources( - stackParser, - resource_paths, -) { +function getDebugImagesForResources(stackParser, resource_paths) { const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); - if (!filenameDebugIdMap) { return []; } - const images = []; for (const path of resource_paths) { - if (path && filenameDebugIdMap[path]) { + const normalizedPath = stacktrace.normalizeStackTracePath(path); + if (normalizedPath && filenameDebugIdMap[normalizedPath]) { images.push({ - type: 'sourcemap', + type: "sourcemap", code_file: path, - debug_id: filenameDebugIdMap[path] , + debug_id: filenameDebugIdMap[normalizedPath] }); } } - return images; } @@ -75942,181 +36717,230 @@ exports.getFilenameToDebugIdMap = getFilenameToDebugIdMap; /***/ }), -/***/ 32540: +/***/ 41772: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const debugBuild = __nccwpck_require__(87038); -const logger = __nccwpck_require__(38752); +const carrier = __nccwpck_require__(38080); +const debugBuild = __nccwpck_require__(14488); +const worldwide = __nccwpck_require__(90935); -/** Regular expression used to parse a Dsn. */ -const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; - -function isValidProtocol(protocol) { - return protocol === 'http' || protocol === 'https'; +const CONSOLE_LEVELS = [ + "debug", + "info", + "warn", + "error", + "log", + "assert", + "trace" +]; +const PREFIX = "Sentry Logger "; +const originalConsoleMethods = {}; +function consoleSandbox(callback) { + if (!("console" in worldwide.GLOBAL_OBJ)) { + return callback(); + } + const console = worldwide.GLOBAL_OBJ.console; + const wrappedFuncs = {}; + const wrappedLevels = Object.keys(originalConsoleMethods); + wrappedLevels.forEach((level) => { + const originalConsoleMethod = originalConsoleMethods[level]; + wrappedFuncs[level] = console[level]; + console[level] = originalConsoleMethod; + }); + try { + return callback(); + } finally { + wrappedLevels.forEach((level) => { + console[level] = wrappedFuncs[level]; + }); + } } +function enable() { + _getLoggerSettings().enabled = true; +} +function disable() { + _getLoggerSettings().enabled = false; +} +function isEnabled() { + return _getLoggerSettings().enabled; +} +function log(...args) { + _maybeLog("log", ...args); +} +function warn(...args) { + _maybeLog("warn", ...args); +} +function error(...args) { + _maybeLog("error", ...args); +} +function _maybeLog(level, ...args) { + if (!debugBuild.DEBUG_BUILD) { + return; + } + if (isEnabled()) { + consoleSandbox(() => { + worldwide.GLOBAL_OBJ.console[level](`${PREFIX}[${level}]:`, ...args); + }); + } +} +function _getLoggerSettings() { + if (!debugBuild.DEBUG_BUILD) { + return { enabled: false }; + } + return carrier.getGlobalSingleton("loggerSettings", () => ({ enabled: false })); +} +const debug = { + /** Enable logging. */ + enable, + /** Disable logging. */ + disable, + /** Check if logging is enabled. */ + isEnabled, + /** Log a message. */ + log, + /** Log a warning. */ + warn, + /** Log an error. */ + error +}; -/** - * Renders the string representation of this Dsn. - * - * By default, this will render the public representation without the password - * component. To get the deprecated private representation, set `withPassword` - * to true. - * - * @param withPassword When set to true, the password will be included. - */ +exports.CONSOLE_LEVELS = CONSOLE_LEVELS; +exports.consoleSandbox = consoleSandbox; +exports.debug = debug; +exports.originalConsoleMethods = originalConsoleMethods; +//# sourceMappingURL=debug-logger.js.map + + +/***/ }), + +/***/ 91582: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); + +const ORG_ID_REGEX = /^o(\d+)\./; +const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/; +function isValidProtocol(protocol) { + return protocol === "http" || protocol === "https"; +} function dsnToString(dsn, withPassword = false) { const { host, path, pass, port, projectId, protocol, publicKey } = dsn; - return ( - `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` + - `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}` - ); + return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${projectId}`; } - -/** - * Parses a Dsn from a given string. - * - * @param str A Dsn as string - * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string - */ function dsnFromString(str) { const match = DSN_REGEX.exec(str); - if (!match) { - // This should be logged to the console - logger.consoleSandbox(() => { - // eslint-disable-next-line no-console + debugLogger.consoleSandbox(() => { console.error(`Invalid Sentry Dsn: ${str}`); }); - return undefined; + return void 0; } - - const [protocol, publicKey, pass = '', host = '', port = '', lastPath = ''] = match.slice(1); - let path = ''; + const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1); + let path = ""; let projectId = lastPath; - - const split = projectId.split('/'); + const split = projectId.split("/"); if (split.length > 1) { - path = split.slice(0, -1).join('/'); - projectId = split.pop() ; + path = split.slice(0, -1).join("/"); + projectId = split.pop(); } - if (projectId) { const projectMatch = projectId.match(/^\d+/); if (projectMatch) { projectId = projectMatch[0]; } } - - return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey }); + return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey }); } - function dsnFromComponents(components) { return { protocol: components.protocol, - publicKey: components.publicKey || '', - pass: components.pass || '', + publicKey: components.publicKey || "", + pass: components.pass || "", host: components.host, - port: components.port || '', - path: components.path || '', - projectId: components.projectId, + port: components.port || "", + path: components.path || "", + projectId: components.projectId }; } - function validateDsn(dsn) { if (!debugBuild.DEBUG_BUILD) { return true; } - const { port, projectId, protocol } = dsn; - - const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId']; - const hasMissingRequiredComponent = requiredComponents.find(component => { + const requiredComponents = ["protocol", "publicKey", "host", "projectId"]; + const hasMissingRequiredComponent = requiredComponents.find((component) => { if (!dsn[component]) { - logger.logger.error(`Invalid Sentry Dsn: ${component} missing`); + debugLogger.debug.error(`Invalid Sentry Dsn: ${component} missing`); return true; } return false; }); - if (hasMissingRequiredComponent) { return false; } - if (!projectId.match(/^\d+$/)) { - logger.logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); + debugLogger.debug.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); return false; } - if (!isValidProtocol(protocol)) { - logger.logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); + debugLogger.debug.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); return false; } - if (port && isNaN(parseInt(port, 10))) { - logger.logger.error(`Invalid Sentry Dsn: Invalid port ${port}`); + debugLogger.debug.error(`Invalid Sentry Dsn: Invalid port ${port}`); return false; } - return true; } - -/** - * Creates a valid Sentry Dsn object, identifying a Sentry instance and project. - * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source - */ +function extractOrgIdFromDsnHost(host) { + const match = host.match(ORG_ID_REGEX); + return match?.[1]; +} +function extractOrgIdFromClient(client) { + const options = client.getOptions(); + const { host } = client.getDsn() || {}; + let org_id; + if (options.orgId) { + org_id = String(options.orgId); + } else if (host) { + org_id = extractOrgIdFromDsnHost(host); + } + return org_id; +} function makeDsn(from) { - const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from); + const components = typeof from === "string" ? dsnFromString(from) : dsnFromComponents(from); if (!components || !validateDsn(components)) { - return undefined; + return void 0; } return components; } exports.dsnFromString = dsnFromString; exports.dsnToString = dsnToString; +exports.extractOrgIdFromClient = extractOrgIdFromClient; +exports.extractOrgIdFromDsnHost = extractOrgIdFromDsnHost; exports.makeDsn = makeDsn; //# sourceMappingURL=dsn.js.map /***/ }), -/***/ 11318: +/***/ 582: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/* - * This module exists for optimizations in the build process through rollup and terser. We define some global - * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these - * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will - * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to - * `logger` and preventing node-related code from appearing in browser bundles. - * - * Attention: - * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by - * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack) - * having issues tree-shaking these constants across package boundaries. - * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want - * users to be able to shake away expressions that it guards. - */ - -/** - * Figures out if we're building a browser bundle. - * - * @returns true if this is a browser bundle build. - */ function isBrowserBundle() { - return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__; + return typeof __SENTRY_BROWSER_BUNDLE__ !== "undefined" && !!__SENTRY_BROWSER_BUNDLE__; } - -/** - * Get source of SDK. - */ function getSDKSource() { - // This comment is used to identify this line in the CDN bundle build step and replace this with "return 'cdn';" - /* __SENTRY_SDK_SOURCE__ */ return 'npm'; + /*! __SENTRY_SDK_SOURCE__ */ + return "npm"; } exports.getSDKSource = getSDKSource; @@ -76126,258 +36950,189 @@ exports.isBrowserBundle = isBrowserBundle; /***/ }), -/***/ 72635: +/***/ 61258: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const FALSY_ENV_VALUES = /* @__PURE__ */ new Set(["false", "f", "n", "no", "off", "0"]); +const TRUTHY_ENV_VALUES = /* @__PURE__ */ new Set(["true", "t", "y", "yes", "on", "1"]); +function envToBool(value, options) { + const normalized = String(value).toLowerCase(); + if (FALSY_ENV_VALUES.has(normalized)) { + return false; + } + if (TRUTHY_ENV_VALUES.has(normalized)) { + return true; + } + return options?.strict ? null : Boolean(value); +} + +exports.FALSY_ENV_VALUES = FALSY_ENV_VALUES; +exports.TRUTHY_ENV_VALUES = TRUTHY_ENV_VALUES; +exports.envToBool = envToBool; +//# sourceMappingURL=envToBool.js.map + + +/***/ }), + +/***/ 56987: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const dsn = __nccwpck_require__(32540); -const normalize = __nccwpck_require__(65543); -const object = __nccwpck_require__(16100); -const worldwide = __nccwpck_require__(10891); +const carrier = __nccwpck_require__(38080); +const dsn = __nccwpck_require__(91582); +const normalize = __nccwpck_require__(68446); +const randomSafeContext = __nccwpck_require__(28695); +const worldwide = __nccwpck_require__(90935); -/** - * Creates an envelope. - * Make sure to always explicitly provide the generic to this function - * so that the envelope types resolve correctly. - */ function createEnvelope(headers, items = []) { - return [headers, items] ; + return [headers, items]; } - -/** - * Add an item to an envelope. - * Make sure to always explicitly provide the generic to this function - * so that the envelope types resolve correctly. - */ function addItemToEnvelope(envelope, newItem) { const [headers, items] = envelope; - return [headers, [...items, newItem]] ; + return [headers, [...items, newItem]]; } - -/** - * Convenience function to loop through the items and item types of an envelope. - * (This function was mostly created because working with envelope types is painful at the moment) - * - * If the callback returns true, the rest of the items will be skipped. - */ -function forEachEnvelopeItem( - envelope, - callback, -) { +function forEachEnvelopeItem(envelope, callback) { const envelopeItems = envelope[1]; - for (const envelopeItem of envelopeItems) { const envelopeItemType = envelopeItem[0].type; const result = callback(envelopeItem, envelopeItemType); - if (result) { return true; } } - return false; } - -/** - * Returns true if the envelope contains any of the given envelope item types - */ function envelopeContainsItemType(envelope, types) { return forEachEnvelopeItem(envelope, (_, type) => types.includes(type)); } - -/** - * Encode a string to UTF8 array. - */ function encodeUTF8(input) { - return worldwide.GLOBAL_OBJ.__SENTRY__ && worldwide.GLOBAL_OBJ.__SENTRY__.encodePolyfill - ? worldwide.GLOBAL_OBJ.__SENTRY__.encodePolyfill(input) - : new TextEncoder().encode(input); + const carrier$1 = carrier.getSentryCarrier(worldwide.GLOBAL_OBJ); + return carrier$1.encodePolyfill ? carrier$1.encodePolyfill(input) : new TextEncoder().encode(input); } - -/** - * Decode a UTF8 array to string. - */ function decodeUTF8(input) { - return worldwide.GLOBAL_OBJ.__SENTRY__ && worldwide.GLOBAL_OBJ.__SENTRY__.decodePolyfill - ? worldwide.GLOBAL_OBJ.__SENTRY__.decodePolyfill(input) - : new TextDecoder().decode(input); + const carrier$1 = carrier.getSentryCarrier(worldwide.GLOBAL_OBJ); + return carrier$1.decodePolyfill ? carrier$1.decodePolyfill(input) : new TextDecoder().decode(input); } - -/** - * Serializes an envelope. - */ function serializeEnvelope(envelope) { const [envHeaders, items] = envelope; - - // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data let parts = JSON.stringify(envHeaders); - function append(next) { - if (typeof parts === 'string') { - parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts), next]; + if (typeof parts === "string") { + parts = typeof next === "string" ? parts + next : [encodeUTF8(parts), next]; } else { - parts.push(typeof next === 'string' ? encodeUTF8(next) : next); + parts.push(typeof next === "string" ? encodeUTF8(next) : next); } } - for (const item of items) { const [itemHeaders, payload] = item; - - append(`\n${JSON.stringify(itemHeaders)}\n`); - - if (typeof payload === 'string' || payload instanceof Uint8Array) { + append(` +${JSON.stringify(itemHeaders)} +`); + if (typeof payload === "string" || payload instanceof Uint8Array) { append(payload); } else { let stringifiedPayload; try { stringifiedPayload = JSON.stringify(payload); - } catch (e) { - // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.stringify()` still - // fails, we try again after normalizing it again with infinite normalization depth. This of course has a - // performance impact but in this case a performance hit is better than throwing. + } catch { stringifiedPayload = JSON.stringify(normalize.normalize(payload)); } append(stringifiedPayload); } } - - return typeof parts === 'string' ? parts : concatBuffers(parts); + return typeof parts === "string" ? parts : concatBuffers(parts); } - function concatBuffers(buffers) { const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0); - const merged = new Uint8Array(totalLength); let offset = 0; for (const buffer of buffers) { merged.set(buffer, offset); offset += buffer.length; } - return merged; } - -/** - * Parses an envelope - */ function parseEnvelope(env) { - let buffer = typeof env === 'string' ? encodeUTF8(env) : env; - + let buffer = typeof env === "string" ? encodeUTF8(env) : env; function readBinary(length) { const bin = buffer.subarray(0, length); - // Replace the buffer with the remaining data excluding trailing newline buffer = buffer.subarray(length + 1); return bin; } - function readJson() { - let i = buffer.indexOf(0xa); - // If we couldn't find a newline, we must have found the end of the buffer + let i = buffer.indexOf(10); if (i < 0) { i = buffer.length; } - - return JSON.parse(decodeUTF8(readBinary(i))) ; + return JSON.parse(decodeUTF8(readBinary(i))); } - const envelopeHeader = readJson(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any const items = []; - while (buffer.length) { const itemHeader = readJson(); - const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined; - + const binaryLength = typeof itemHeader.length === "number" ? itemHeader.length : void 0; items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]); } - return [envelopeHeader, items]; } - -/** - * Creates envelope item for a single span - */ function createSpanEnvelopeItem(spanJson) { const spanHeaders = { - type: 'span', + type: "span" }; - return [spanHeaders, spanJson]; } - -/** - * Creates attachment envelope items - */ function createAttachmentEnvelopeItem(attachment) { - const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data) : attachment.data; - + const buffer = typeof attachment.data === "string" ? encodeUTF8(attachment.data) : attachment.data; return [ - object.dropUndefinedKeys({ - type: 'attachment', + { + type: "attachment", length: buffer.length, filename: attachment.filename, content_type: attachment.contentType, - attachment_type: attachment.attachmentType, - }), - buffer, + attachment_type: attachment.attachmentType + }, + buffer ]; } - -const ITEM_TYPE_TO_DATA_CATEGORY_MAP = { - session: 'session', - sessions: 'session', - attachment: 'attachment', - transaction: 'transaction', - event: 'error', - client_report: 'internal', - user_report: 'default', - profile: 'profile', - profile_chunk: 'profile', - replay_event: 'replay', - replay_recording: 'replay', - check_in: 'monitor', - feedback: 'feedback', - span: 'span', - statsd: 'metric_bucket', - raw_security: 'security', +const DATA_CATEGORY_OVERRIDES = { + sessions: "session", + event: "error", + client_report: "internal", + user_report: "default", + profile_chunk: "profile", + replay_event: "replay", + replay_recording: "replay", + check_in: "monitor", + raw_security: "security", + log: "log_item", + trace_metric: "metric" }; - -/** - * Maps the type of an envelope item to a data category. - */ +function _isOverriddenType(type) { + return type in DATA_CATEGORY_OVERRIDES; +} function envelopeItemTypeToDataCategory(type) { - return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type]; + return _isOverriddenType(type) ? DATA_CATEGORY_OVERRIDES[type] : type; } - -/** Extracts the minimal SDK info from the metadata or an events */ function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { - if (!metadataOrEvent || !metadataOrEvent.sdk) { + if (!metadataOrEvent?.sdk) { return; } const { name, version } = metadataOrEvent.sdk; return { name, version }; } - -/** - * Creates event envelope headers, based on event, sdk info and tunnel - * Note: This function was extracted from the core package to make it available in Replay - */ -function createEventEnvelopeHeaders( - event, - sdkInfo, - tunnel, - dsn$1, -) { - const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext; +function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn$1) { + const dynamicSamplingContext = event.sdkProcessingMetadata?.dynamicSamplingContext; return { - event_id: event.event_id , - sent_at: new Date().toISOString(), - ...(sdkInfo && { sdk: sdkInfo }), - ...(!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) }), - ...(dynamicSamplingContext && { - trace: object.dropUndefinedKeys({ ...dynamicSamplingContext }), - }), + event_id: event.event_id, + sent_at: new Date(randomSafeContext.safeDateNow()).toISOString(), + ...sdkInfo && { sdk: sdkInfo }, + ...!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) }, + ...dynamicSamplingContext && { + trace: dynamicSamplingContext + } }; } @@ -76397,19 +37152,15 @@ exports.serializeEnvelope = serializeEnvelope; /***/ }), -/***/ 66322: +/***/ 20816: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** An error emitted by Sentry SDKs and related utilities. */ class SentryError extends Error { - - constructor( - message, - logLevel = 'warn', - ) { - super(message);this.message = message; + constructor(message, logLevel = "warn") { + super(message); + this.message = message; this.logLevel = logLevel; } } @@ -76420,211 +37171,178 @@ exports.SentryError = SentryError; /***/ }), -/***/ 2781: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 26667: +/***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const is = __nccwpck_require__(84085); -const misc = __nccwpck_require__(3181); -const normalize = __nccwpck_require__(65543); -const object = __nccwpck_require__(16100); - -/** - * Extracts stack frames from the error.stack string - */ -function parseStackFrames(stackParser, error) { - return stackParser(error.stack || '', 1); +function getPossibleEventMessages(event) { + const possibleMessages = []; + if (event.message) { + possibleMessages.push(event.message); + } + try { + const lastException = event.exception.values[event.exception.values.length - 1]; + if (lastException?.value) { + possibleMessages.push(lastException.value); + if (lastException.type) { + possibleMessages.push(`${lastException.type}: ${lastException.value}`); + } + } + } catch { + } + return possibleMessages; } -/** - * Extracts stack frames from the error and builds a Sentry Exception - */ +exports.getPossibleEventMessages = getPossibleEventMessages; +//# sourceMappingURL=eventUtils.js.map + + +/***/ }), + +/***/ 16273: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const is = __nccwpck_require__(68370); +const misc = __nccwpck_require__(52619); +const normalize = __nccwpck_require__(68446); +const object = __nccwpck_require__(5906); + +function parseStackFrames(stackParser, error) { + return stackParser(error.stack || "", 1); +} +function hasSentryFetchUrlHost(error) { + return is.isError(error) && "__sentry_fetch_url_host__" in error && typeof error.__sentry_fetch_url_host__ === "string"; +} +function _enhanceErrorWithSentryInfo(error) { + if (hasSentryFetchUrlHost(error)) { + return `${error.message} (${error.__sentry_fetch_url_host__})`; + } + return error.message; +} function exceptionFromError(stackParser, error) { const exception = { type: error.name || error.constructor.name, - value: error.message, + value: _enhanceErrorWithSentryInfo(error) }; - const frames = parseStackFrames(stackParser, error); if (frames.length) { exception.stacktrace = { frames }; } - return exception; } - -/** If a plain object has a property that is an `Error`, return this error. */ function getErrorPropertyFromObject(obj) { for (const prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { const value = obj[prop]; - if (value instanceof Error) { + if (is.isError(value)) { return value; } } } - - return undefined; + return void 0; } - function getMessageForObject(exception) { - if ('name' in exception && typeof exception.name === 'string') { + if ("name" in exception && typeof exception.name === "string") { let message = `'${exception.name}' captured as exception`; - - if ('message' in exception && typeof exception.message === 'string') { + if ("message" in exception && typeof exception.message === "string") { message += ` with message '${exception.message}'`; } - return message; - } else if ('message' in exception && typeof exception.message === 'string') { + } else if ("message" in exception && typeof exception.message === "string") { return exception.message; } - const keys = object.extractExceptionKeysForMessage(exception); - - // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before - // We still want to try to get a decent message for these cases if (is.isErrorEvent(exception)) { return `Event \`ErrorEvent\` captured as exception with message \`${exception.message}\``; } - const className = getObjectClassName(exception); - - return `${ - className && className !== 'Object' ? `'${className}'` : 'Object' - } captured as exception with keys: ${keys}`; + return `${className && className !== "Object" ? `'${className}'` : "Object"} captured as exception with keys: ${keys}`; } - function getObjectClassName(obj) { try { const prototype = Object.getPrototypeOf(obj); - return prototype ? prototype.constructor.name : undefined; - } catch (e) { - // ignore errors here + return prototype ? prototype.constructor.name : void 0; + } catch { } } - -function getException( - client, - mechanism, - exception, - hint, -) { +function getException(client, mechanism, exception, hint) { if (is.isError(exception)) { - return [exception, undefined]; + return [exception, void 0]; } - - // Mutate this! mechanism.synthetic = true; - if (is.isPlainObject(exception)) { - const normalizeDepth = client && client.getOptions().normalizeDepth; - const extras = { ['__serialized__']: normalize.normalizeToSize(exception , normalizeDepth) }; - + const normalizeDepth = client?.getOptions().normalizeDepth; + const extras = { ["__serialized__"]: normalize.normalizeToSize(exception, normalizeDepth) }; const errorFromProp = getErrorPropertyFromObject(exception); if (errorFromProp) { return [errorFromProp, extras]; } - const message = getMessageForObject(exception); - const ex = (hint && hint.syntheticException) || new Error(message); - ex.message = message; - - return [ex, extras]; + const ex2 = hint?.syntheticException || new Error(message); + ex2.message = message; + return [ex2, extras]; } - - // This handles when someone does: `throw "something awesome";` - // We use synthesized Error here so we can extract a (rough) stack trace. - const ex = (hint && hint.syntheticException) || new Error(exception ); + const ex = hint?.syntheticException || new Error(exception); ex.message = `${exception}`; - - return [ex, undefined]; + return [ex, void 0]; } - -/** - * Builds and Event from a Exception - * @hidden - */ -function eventFromUnknownInput( - client, - stackParser, - exception, - hint, -) { - const providedMechanism = - hint && hint.data && (hint.data ).mechanism; +function eventFromUnknownInput(client, stackParser, exception, hint) { + const providedMechanism = hint?.data && hint.data.mechanism; const mechanism = providedMechanism || { handled: true, - type: 'generic', + type: "generic" }; - const [ex, extras] = getException(client, mechanism, exception, hint); - const event = { exception: { - values: [exceptionFromError(stackParser, ex)], - }, + values: [exceptionFromError(stackParser, ex)] + } }; - if (extras) { event.extra = extras; } - - misc.addExceptionTypeValue(event, undefined, undefined); + misc.addExceptionTypeValue(event, void 0, void 0); misc.addExceptionMechanism(event, mechanism); - return { ...event, - event_id: hint && hint.event_id, + event_id: hint?.event_id }; } - -/** - * Builds and Event from a Message - * @hidden - */ -function eventFromMessage( - stackParser, - message, - level = 'info', - hint, - attachStacktrace, -) { +function eventFromMessage(stackParser, message, level = "info", hint, attachStacktrace) { const event = { - event_id: hint && hint.event_id, - level, + event_id: hint?.event_id, + level }; - - if (attachStacktrace && hint && hint.syntheticException) { + if (attachStacktrace && hint?.syntheticException) { const frames = parseStackFrames(stackParser, hint.syntheticException); if (frames.length) { event.exception = { values: [ { value: message, - stacktrace: { frames }, - }, - ], + stacktrace: { frames } + } + ] }; misc.addExceptionMechanism(event, { synthetic: true }); } } - if (is.isParameterizedString(message)) { const { __sentry_template_string__, __sentry_template_values__ } = message; - event.logentry = { message: __sentry_template_string__, - params: __sentry_template_values__, + params: __sentry_template_values__ }; return event; } - event.message = message; return event; } +exports._enhanceErrorWithSentryInfo = _enhanceErrorWithSentryInfo; exports.eventFromMessage = eventFromMessage; exports.eventFromUnknownInput = eventFromUnknownInput; exports.exceptionFromError = exceptionFromError; @@ -76634,680 +37352,374 @@ exports.parseStackFrames = parseStackFrames; /***/ }), -/***/ 32758: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const logger = __nccwpck_require__(38752); -const object = __nccwpck_require__(16100); -const worldwide = __nccwpck_require__(10891); -const handlers = __nccwpck_require__(44639); - -/** - * Add an instrumentation handler for when a console.xxx method is called. - * - * Use at your own risk, this might break without changelog notice, only used internally. - * @hidden - */ -function addConsoleInstrumentationHandler(handler) { - const type = 'console'; - handlers.addHandler(type, handler); - handlers.maybeInstrument(type, instrumentConsole); -} - -function instrumentConsole() { - if (!('console' in worldwide.GLOBAL_OBJ)) { - return; - } - - logger.CONSOLE_LEVELS.forEach(function (level) { - if (!(level in worldwide.GLOBAL_OBJ.console)) { - return; - } - - object.fill(worldwide.GLOBAL_OBJ.console, level, function (originalConsoleMethod) { - logger.originalConsoleMethods[level] = originalConsoleMethod; - - return function (...args) { - const handlerData = { args, level }; - handlers.triggerHandlers('console', handlerData); - - const log = logger.originalConsoleMethods[level]; - log && log.apply(worldwide.GLOBAL_OBJ.console, args); - }; - }); - }); -} - -exports.addConsoleInstrumentationHandler = addConsoleInstrumentationHandler; -//# sourceMappingURL=console.js.map - - -/***/ }), - -/***/ 34670: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const is = __nccwpck_require__(84085); -const object = __nccwpck_require__(16100); -const supports = __nccwpck_require__(73872); -const time = __nccwpck_require__(75872); -const worldwide = __nccwpck_require__(10891); -const handlers = __nccwpck_require__(44639); - -/** - * Add an instrumentation handler for when a fetch request happens. - * The handler function is called once when the request starts and once when it ends, - * which can be identified by checking if it has an `endTimestamp`. - * - * Use at your own risk, this might break without changelog notice, only used internally. - * @hidden - */ -function addFetchInstrumentationHandler( - handler, - skipNativeFetchCheck, -) { - const type = 'fetch'; - handlers.addHandler(type, handler); - handlers.maybeInstrument(type, () => instrumentFetch(undefined, skipNativeFetchCheck)); -} - -/** - * Add an instrumentation handler for long-lived fetch requests, like consuming server-sent events (SSE) via fetch. - * The handler will resolve the request body and emit the actual `endTimestamp`, so that the - * span can be updated accordingly. - * - * Only used internally - * @hidden - */ -function addFetchEndInstrumentationHandler(handler) { - const type = 'fetch-body-resolved'; - handlers.addHandler(type, handler); - handlers.maybeInstrument(type, () => instrumentFetch(streamHandler)); -} - -function instrumentFetch(onFetchResolved, skipNativeFetchCheck = false) { - if (skipNativeFetchCheck && !supports.supportsNativeFetch()) { - return; - } - - object.fill(worldwide.GLOBAL_OBJ, 'fetch', function (originalFetch) { - return function (...args) { - // We capture the error right here and not in the Promise error callback because Safari (and probably other - // browsers too) will wipe the stack trace up to this point, only leaving us with this file which is useless. - - // NOTE: If you are a Sentry user, and you are seeing this stack frame, - // it means the error, that was caused by your fetch call did not - // have a stack trace, so the SDK backfilled the stack trace so - // you can see which fetch call failed. - const virtualError = new Error(); - - const { method, url } = parseFetchArgs(args); - const handlerData = { - args, - fetchData: { - method, - url, - }, - startTimestamp: time.timestampInSeconds() * 1000, - // // Adding the error to be able to fingerprint the failed fetch event in HttpClient instrumentation - virtualError, - }; - - // if there is no callback, fetch is instrumented directly - if (!onFetchResolved) { - handlers.triggerHandlers('fetch', { - ...handlerData, - }); - } - - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - return originalFetch.apply(worldwide.GLOBAL_OBJ, args).then( - async (response) => { - if (onFetchResolved) { - onFetchResolved(response); - } else { - handlers.triggerHandlers('fetch', { - ...handlerData, - endTimestamp: time.timestampInSeconds() * 1000, - response, - }); - } - - return response; - }, - (error) => { - handlers.triggerHandlers('fetch', { - ...handlerData, - endTimestamp: time.timestampInSeconds() * 1000, - error, - }); - - if (is.isError(error) && error.stack === undefined) { - // NOTE: If you are a Sentry user, and you are seeing this stack frame, - // it means the error, that was caused by your fetch call did not - // have a stack trace, so the SDK backfilled the stack trace so - // you can see which fetch call failed. - error.stack = virtualError.stack; - object.addNonEnumerableProperty(error, 'framesToPop', 1); - } - - // NOTE: If you are a Sentry user, and you are seeing this stack frame, - // it means the sentry.javascript SDK caught an error invoking your application code. - // This is expected behavior and NOT indicative of a bug with sentry.javascript. - throw error; - }, - ); - }; - }); -} - -async function resolveResponse(res, onFinishedResolving) { - if (res && res.body) { - const body = res.body; - const responseReader = body.getReader(); - - // Define a maximum duration after which we just cancel - const maxFetchDurationTimeout = setTimeout( - () => { - body.cancel().then(null, () => { - // noop - }); - }, - 90 * 1000, // 90s - ); - - let readingActive = true; - while (readingActive) { - let chunkTimeout; - try { - // abort reading if read op takes more than 5s - chunkTimeout = setTimeout(() => { - body.cancel().then(null, () => { - // noop on error - }); - }, 5000); - - // This .read() call will reject/throw when we abort due to timeouts through `body.cancel()` - const { done } = await responseReader.read(); - - clearTimeout(chunkTimeout); - - if (done) { - onFinishedResolving(); - readingActive = false; - } - } catch (error) { - readingActive = false; - } finally { - clearTimeout(chunkTimeout); - } - } - - clearTimeout(maxFetchDurationTimeout); - - responseReader.releaseLock(); - body.cancel().then(null, () => { - // noop on error - }); - } -} - -function streamHandler(response) { - // clone response for awaiting stream - let clonedResponseForResolving; - try { - clonedResponseForResolving = response.clone(); - } catch (e) { - return; - } - - // eslint-disable-next-line @typescript-eslint/no-floating-promises - resolveResponse(clonedResponseForResolving, () => { - handlers.triggerHandlers('fetch-body-resolved', { - endTimestamp: time.timestampInSeconds() * 1000, - response, - }); - }); -} - -function hasProp(obj, prop) { - return !!obj && typeof obj === 'object' && !!(obj )[prop]; -} - -function getUrlFromResource(resource) { - if (typeof resource === 'string') { - return resource; - } - - if (!resource) { - return ''; - } - - if (hasProp(resource, 'url')) { - return resource.url; - } - - if (resource.toString) { - return resource.toString(); - } - - return ''; -} - -/** - * Parses the fetch arguments to find the used Http method and the url of the request. - * Exported for tests only. - */ -function parseFetchArgs(fetchArgs) { - if (fetchArgs.length === 0) { - return { method: 'GET', url: '' }; - } - - if (fetchArgs.length === 2) { - const [url, options] = fetchArgs ; - - return { - url: getUrlFromResource(url), - method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET', - }; - } - - const arg = fetchArgs[0]; - return { - url: getUrlFromResource(arg ), - method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET', - }; -} - -exports.addFetchEndInstrumentationHandler = addFetchEndInstrumentationHandler; -exports.addFetchInstrumentationHandler = addFetchInstrumentationHandler; -exports.parseFetchArgs = parseFetchArgs; -//# sourceMappingURL=fetch.js.map - - -/***/ }), - -/***/ 97033: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const worldwide = __nccwpck_require__(10891); -const handlers = __nccwpck_require__(44639); - -let _oldOnErrorHandler = null; - -/** - * Add an instrumentation handler for when an error is captured by the global error handler. - * - * Use at your own risk, this might break without changelog notice, only used internally. - * @hidden - */ -function addGlobalErrorInstrumentationHandler(handler) { - const type = 'error'; - handlers.addHandler(type, handler); - handlers.maybeInstrument(type, instrumentError); -} - -function instrumentError() { - _oldOnErrorHandler = worldwide.GLOBAL_OBJ.onerror; - - // Note: The reason we are doing window.onerror instead of window.addEventListener('error') - // is that we are using this handler in the Loader Script, to handle buffered errors consistently - worldwide.GLOBAL_OBJ.onerror = function ( - msg, - url, - line, - column, - error, - ) { - const handlerData = { - column, - error, - line, - msg, - url, - }; - handlers.triggerHandlers('error', handlerData); - - if (_oldOnErrorHandler) { - // eslint-disable-next-line prefer-rest-params - return _oldOnErrorHandler.apply(this, arguments); - } - - return false; - }; - - worldwide.GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; -} - -exports.addGlobalErrorInstrumentationHandler = addGlobalErrorInstrumentationHandler; -//# sourceMappingURL=globalError.js.map - - -/***/ }), - -/***/ 26156: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const worldwide = __nccwpck_require__(10891); -const handlers = __nccwpck_require__(44639); - -let _oldOnUnhandledRejectionHandler = null; - -/** - * Add an instrumentation handler for when an unhandled promise rejection is captured. - * - * Use at your own risk, this might break without changelog notice, only used internally. - * @hidden - */ -function addGlobalUnhandledRejectionInstrumentationHandler( - handler, -) { - const type = 'unhandledrejection'; - handlers.addHandler(type, handler); - handlers.maybeInstrument(type, instrumentUnhandledRejection); -} - -function instrumentUnhandledRejection() { - _oldOnUnhandledRejectionHandler = worldwide.GLOBAL_OBJ.onunhandledrejection; - - // Note: The reason we are doing window.onunhandledrejection instead of window.addEventListener('unhandledrejection') - // is that we are using this handler in the Loader Script, to handle buffered rejections consistently - worldwide.GLOBAL_OBJ.onunhandledrejection = function (e) { - const handlerData = e; - handlers.triggerHandlers('unhandledrejection', handlerData); - - if (_oldOnUnhandledRejectionHandler) { - // eslint-disable-next-line prefer-rest-params - return _oldOnUnhandledRejectionHandler.apply(this, arguments); - } - - return true; - }; - - worldwide.GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; -} - -exports.addGlobalUnhandledRejectionInstrumentationHandler = addGlobalUnhandledRejectionInstrumentationHandler; -//# sourceMappingURL=globalUnhandledRejection.js.map - - -/***/ }), - -/***/ 44639: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const debugBuild = __nccwpck_require__(87038); -const logger = __nccwpck_require__(38752); -const stacktrace = __nccwpck_require__(85820); - -// We keep the handlers globally -const handlers = {}; -const instrumented = {}; - -/** Add a handler function. */ -function addHandler(type, handler) { - handlers[type] = handlers[type] || []; - (handlers[type] ).push(handler); -} - -/** - * Reset all instrumentation handlers. - * This can be used by tests to ensure we have a clean slate of instrumentation handlers. - */ -function resetInstrumentationHandlers() { - Object.keys(handlers).forEach(key => { - handlers[key ] = undefined; - }); -} - -/** Maybe run an instrumentation function, unless it was already called. */ -function maybeInstrument(type, instrumentFn) { - if (!instrumented[type]) { - instrumented[type] = true; - try { - instrumentFn(); - } catch (e) { - debugBuild.DEBUG_BUILD && logger.logger.error(`Error while instrumenting ${type}`, e); - } - } -} - -/** Trigger handlers for a given instrumentation type. */ -function triggerHandlers(type, data) { - const typeHandlers = type && handlers[type]; - if (!typeHandlers) { - return; - } - - for (const handler of typeHandlers) { - try { - handler(data); - } catch (e) { - debugBuild.DEBUG_BUILD && - logger.logger.error( - `Error while triggering instrumentation handler.\nType: ${type}\nName: ${stacktrace.getFunctionName(handler)}\nError:`, - e, - ); - } - } -} - -exports.addHandler = addHandler; -exports.maybeInstrument = maybeInstrument; -exports.resetInstrumentationHandlers = resetInstrumentationHandlers; -exports.triggerHandlers = triggerHandlers; -//# sourceMappingURL=handlers.js.map - - -/***/ }), - -/***/ 84085: +/***/ 26006: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function replaceExports(exports, exportName, wrappedConstructor) { + const original = exports[exportName]; + if (typeof original !== "function") { + return; + } + try { + exports[exportName] = wrappedConstructor; + } catch { + Object.defineProperty(exports, exportName, { + value: wrappedConstructor, + writable: true, + configurable: true, + enumerable: true + }); + } + if (exports.default === original) { + try { + exports.default = wrappedConstructor; + } catch { + Object.defineProperty(exports, "default", { + value: wrappedConstructor, + writable: true, + configurable: true, + enumerable: true + }); + } + } +} + +exports.replaceExports = replaceExports; +//# sourceMappingURL=exports.js.map + + +/***/ }), + +/***/ 65422: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const spanUtils = __nccwpck_require__(47569); + +const _INTERNAL_FLAG_BUFFER_SIZE = 100; +const _INTERNAL_MAX_FLAGS_PER_SPAN = 10; +const SPAN_FLAG_ATTRIBUTE_PREFIX = "flag.evaluation."; +function _INTERNAL_copyFlagsFromScopeToEvent(event) { + if (event.type) { + return event; + } + const scope = currentScopes.getCurrentScope(); + const flagContext = scope.getScopeData().contexts.flags; + const flagBuffer = flagContext ? flagContext.values : []; + if (!flagBuffer.length) { + return event; + } + if (event.contexts === void 0) { + event.contexts = {}; + } + event.contexts.flags = { values: [...flagBuffer] }; + return event; +} +function _INTERNAL_insertFlagToScope(name, value, maxSize = _INTERNAL_FLAG_BUFFER_SIZE) { + const scopeContexts = currentScopes.getCurrentScope().getScopeData().contexts; + if (!scopeContexts.flags) { + scopeContexts.flags = { values: [] }; + } + const flags = scopeContexts.flags.values; + _INTERNAL_insertToFlagBuffer(flags, name, value, maxSize); +} +function _INTERNAL_insertToFlagBuffer(flags, name, value, maxSize) { + if (typeof value !== "boolean") { + return; + } + if (flags.length > maxSize) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${maxSize}`); + return; + } + const index = flags.findIndex((f) => f.flag === name); + if (index !== -1) { + flags.splice(index, 1); + } + if (flags.length === maxSize) { + flags.shift(); + } + flags.push({ + flag: name, + result: value + }); +} +function _INTERNAL_addFeatureFlagToActiveSpan(name, value, maxFlagsPerSpan = _INTERNAL_MAX_FLAGS_PER_SPAN) { + if (typeof value !== "boolean") { + return; + } + const span = spanUtils.getActiveSpan(); + if (!span) { + return; + } + const attributes = spanUtils.spanToJSON(span).data; + if (`${SPAN_FLAG_ATTRIBUTE_PREFIX}${name}` in attributes) { + span.setAttribute(`${SPAN_FLAG_ATTRIBUTE_PREFIX}${name}`, value); + return; + } + const numOfAddedFlags = Object.keys(attributes).filter((key) => key.startsWith(SPAN_FLAG_ATTRIBUTE_PREFIX)).length; + if (numOfAddedFlags < maxFlagsPerSpan) { + span.setAttribute(`${SPAN_FLAG_ATTRIBUTE_PREFIX}${name}`, value); + } +} + +exports._INTERNAL_FLAG_BUFFER_SIZE = _INTERNAL_FLAG_BUFFER_SIZE; +exports._INTERNAL_MAX_FLAGS_PER_SPAN = _INTERNAL_MAX_FLAGS_PER_SPAN; +exports._INTERNAL_addFeatureFlagToActiveSpan = _INTERNAL_addFeatureFlagToActiveSpan; +exports._INTERNAL_copyFlagsFromScopeToEvent = _INTERNAL_copyFlagsFromScopeToEvent; +exports._INTERNAL_insertFlagToScope = _INTERNAL_insertFlagToScope; +exports._INTERNAL_insertToFlagBuffer = _INTERNAL_insertToFlagBuffer; +//# sourceMappingURL=featureFlags.js.map + + +/***/ }), + +/***/ 15894: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const exports$1 = __nccwpck_require__(10779); +const debugLogger = __nccwpck_require__(41772); +const vercelWaitUntil = __nccwpck_require__(70420); +const worldwide = __nccwpck_require__(90935); + +async function flushWithTimeout(timeout) { + try { + debugLogger.debug.log("Flushing events..."); + await exports$1.flush(timeout); + debugLogger.debug.log("Done flushing events"); + } catch (e) { + debugLogger.debug.log("Error while flushing events:\n", e); + } +} +async function flushIfServerless(params = {}) { + const { timeout = 2e3 } = params; + if ("cloudflareWaitUntil" in params && typeof params?.cloudflareWaitUntil === "function") { + params.cloudflareWaitUntil(flushWithTimeout(timeout)); + return; + } + if ("cloudflareCtx" in params && typeof params.cloudflareCtx?.waitUntil === "function") { + params.cloudflareCtx.waitUntil(flushWithTimeout(timeout)); + return; + } + if (worldwide.GLOBAL_OBJ[/* @__PURE__ */ Symbol.for("@vercel/request-context")]) { + vercelWaitUntil.vercelWaitUntil(flushWithTimeout(timeout)); + return; + } + if (typeof process === "undefined") { + return; + } + const isServerless = !!process.env.FUNCTIONS_WORKER_RUNTIME || // Azure Functions + !!process.env.LAMBDA_TASK_ROOT || // AWS Lambda + !!process.env.K_SERVICE || // Google Cloud Run + !!process.env.CF_PAGES || // Cloudflare Pages + !!process.env.VERCEL || !!process.env.NETLIFY; + if (isServerless) { + await flushWithTimeout(timeout); + } +} + +exports.flushIfServerless = flushIfServerless; +//# sourceMappingURL=flushIfServerless.js.map + + +/***/ }), + +/***/ 94853: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function getDefaultExport(moduleExport) { + return !!moduleExport && typeof moduleExport === "object" && "default" in moduleExport && moduleExport.default || moduleExport; +} + +exports.getDefaultExport = getDefaultExport; +//# sourceMappingURL=get-default-export.js.map + + +/***/ }), + +/***/ 77864: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const chainAndCopyPromiselike = __nccwpck_require__(8438); +const is = __nccwpck_require__(68370); + +function handleCallbackErrors(fn, onError, onFinally = () => { +}, onSuccess = () => { +}) { + let maybePromiseResult; + try { + maybePromiseResult = fn(); + } catch (e) { + onError(e); + onFinally(); + throw e; + } + return maybeHandlePromiseRejection(maybePromiseResult, onError, onFinally, onSuccess); +} +function maybeHandlePromiseRejection(value, onError, onFinally, onSuccess) { + if (is.isThenable(value)) { + return chainAndCopyPromiselike.chainAndCopyPromiseLike( + value, + (result) => { + onFinally(); + onSuccess(result); + }, + (err) => { + onError(err); + onFinally(); + } + ); + } + onFinally(); + onSuccess(value); + return value; +} + +exports.handleCallbackErrors = handleCallbackErrors; +//# sourceMappingURL=handleCallbackErrors.js.map + + +/***/ }), + +/***/ 42982: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); + +function hasSpansEnabled(maybeOptions) { + if (typeof __SENTRY_TRACING__ === "boolean" && !__SENTRY_TRACING__) { + return false; + } + const options = maybeOptions || currentScopes.getClient()?.getOptions(); + return !!options && // Note: This check is `!= null`, meaning "nullish". `0` is not "nullish", `undefined` and `null` are. (This comment was brought to you by 15 minutes of questioning life) + (options.tracesSampleRate != null || !!options.tracesSampler); +} + +exports.hasSpansEnabled = hasSpansEnabled; +//# sourceMappingURL=hasSpansEnabled.js.map + + +/***/ }), + +/***/ 61343: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function addAutoIpAddressToUser(objWithMaybeUser) { + if (objWithMaybeUser.user?.ip_address === void 0) { + objWithMaybeUser.user = { + ...objWithMaybeUser.user, + ip_address: "{{auto}}" + }; + } +} +function addAutoIpAddressToSession(session) { + if ("aggregates" in session) { + if (session.attrs?.["ip_address"] === void 0) { + session.attrs = { + ...session.attrs, + ip_address: "{{auto}}" + }; + } + } else { + if (session.ipAddress === void 0) { + session.ipAddress = "{{auto}}"; + } + } +} + +exports.addAutoIpAddressToSession = addAutoIpAddressToSession; +exports.addAutoIpAddressToUser = addAutoIpAddressToUser; +//# sourceMappingURL=ipAddress.js.map + + +/***/ }), + +/***/ 68370: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -// eslint-disable-next-line @typescript-eslint/unbound-method const objectToString = Object.prototype.toString; - -/** - * Checks whether given value's type is one of a few Error or Error-like - * {@link isError}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isError(wat) { switch (objectToString.call(wat)) { - case '[object Error]': - case '[object Exception]': - case '[object DOMException]': - case '[object WebAssembly.Exception]': + case "[object Error]": + case "[object Exception]": + case "[object DOMException]": + case "[object WebAssembly.Exception]": return true; default: return isInstanceOf(wat, Error); } } -/** - * Checks whether given value is an instance of the given built-in class. - * - * @param wat The value to be checked - * @param className - * @returns A boolean representing the result. - */ function isBuiltin(wat, className) { return objectToString.call(wat) === `[object ${className}]`; } - -/** - * Checks whether given value's type is ErrorEvent - * {@link isErrorEvent}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isErrorEvent(wat) { - return isBuiltin(wat, 'ErrorEvent'); + return isBuiltin(wat, "ErrorEvent"); } - -/** - * Checks whether given value's type is DOMError - * {@link isDOMError}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isDOMError(wat) { - return isBuiltin(wat, 'DOMError'); + return isBuiltin(wat, "DOMError"); } - -/** - * Checks whether given value's type is DOMException - * {@link isDOMException}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isDOMException(wat) { - return isBuiltin(wat, 'DOMException'); + return isBuiltin(wat, "DOMException"); } - -/** - * Checks whether given value's type is a string - * {@link isString}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isString(wat) { - return isBuiltin(wat, 'String'); + return isBuiltin(wat, "String"); } - -/** - * Checks whether given string is parameterized - * {@link isParameterizedString}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isParameterizedString(wat) { - return ( - typeof wat === 'object' && - wat !== null && - '__sentry_template_string__' in wat && - '__sentry_template_values__' in wat - ); + return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat; } - -/** - * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol) - * {@link isPrimitive}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isPrimitive(wat) { - return wat === null || isParameterizedString(wat) || (typeof wat !== 'object' && typeof wat !== 'function'); + return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function"; } - -/** - * Checks whether given value's type is an object literal, or a class instance. - * {@link isPlainObject}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isPlainObject(wat) { - return isBuiltin(wat, 'Object'); + return isBuiltin(wat, "Object"); +} +function isObjectLike(wat) { + return typeof wat === "object" && wat !== null; } - -/** - * Checks whether given value's type is an Event instance - * {@link isEvent}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isEvent(wat) { - return typeof Event !== 'undefined' && isInstanceOf(wat, Event); + return typeof Event !== "undefined" && isInstanceOf(wat, Event); } - -/** - * Checks whether given value's type is an Element instance - * {@link isElement}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isElement(wat) { - return typeof Element !== 'undefined' && isInstanceOf(wat, Element); + return typeof Element !== "undefined" && isInstanceOf(wat, Element); } - -/** - * Checks whether given value's type is an regexp - * {@link isRegExp}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isRegExp(wat) { - return isBuiltin(wat, 'RegExp'); + return isBuiltin(wat, "RegExp"); } - -/** - * Checks whether given value has a then function. - * @param wat A value to be checked. - */ function isThenable(wat) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - return Boolean(wat && wat.then && typeof wat.then === 'function'); + return Boolean(wat?.then && typeof wat.then === "function"); } - -/** - * Checks whether given value's type is a SyntheticEvent - * {@link isSyntheticEvent}. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isSyntheticEvent(wat) { - return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; + return isPlainObject(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat; } - -/** - * Checks whether given value's type is an instance of provided constructor. - * {@link isInstanceOf}. - * - * @param wat A value to be checked. - * @param base A constructor to be used in a check. - * @returns A boolean representing the result. - */ function isInstanceOf(wat, base) { try { return wat instanceof base; - } catch (_e) { + } catch { return false; } } - -/** - * Checks whether given value's type is a Vue ViewModel. - * - * @param wat A value to be checked. - * @returns A boolean representing the result. - */ function isVueViewModel(wat) { - // Not using Object.prototype.toString because in Vue 3 it would read the instance's Symbol(Symbol.toStringTag) property. - return !!(typeof wat === 'object' && wat !== null && ((wat ).__isVue || (wat )._isVue)); + return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue || wat.__v_isVNode)); +} +function isRequest(request) { + return typeof Request !== "undefined" && isInstanceOf(request, Request); } exports.isDOMError = isDOMError; @@ -77317,10 +37729,12 @@ exports.isError = isError; exports.isErrorEvent = isErrorEvent; exports.isEvent = isEvent; exports.isInstanceOf = isInstanceOf; +exports.isObjectLike = isObjectLike; exports.isParameterizedString = isParameterizedString; exports.isPlainObject = isPlainObject; exports.isPrimitive = isPrimitive; exports.isRegExp = isRegExp; +exports.isRequest = isRequest; exports.isString = isString; exports.isSyntheticEvent = isSyntheticEvent; exports.isThenable = isThenable; @@ -77330,26 +37744,20 @@ exports.isVueViewModel = isVueViewModel; /***/ }), -/***/ 52200: +/***/ 71287: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const node = __nccwpck_require__(10116); -const worldwide = __nccwpck_require__(10891); +const node = __nccwpck_require__(84934); +const worldwide = __nccwpck_require__(90935); -/** - * Returns true if we are in the browser. - */ function isBrowser() { - // eslint-disable-next-line no-restricted-globals - return typeof window !== 'undefined' && (!node.isNodeEnv() || isElectronNodeRenderer()); + return typeof window !== "undefined" && (!node.isNodeEnv() || isElectronNodeRenderer()); } - -// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them function isElectronNodeRenderer() { - const process = (worldwide.GLOBAL_OBJ ).process; - return !!process && process.type === 'renderer'; + const process = worldwide.GLOBAL_OBJ.process; + return process?.type === "renderer"; } exports.isBrowser = isBrowser; @@ -77358,174 +37766,99 @@ exports.isBrowser = isBrowser; /***/ }), -/***/ 38752: +/***/ 2554: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const debugBuild = __nccwpck_require__(87038); -const worldwide = __nccwpck_require__(10891); +const url = __nccwpck_require__(78253); -/** Prefix for logging strings */ -const PREFIX = 'Sentry Logger '; - -const CONSOLE_LEVELS = [ - 'debug', - 'info', - 'warn', - 'error', - 'log', - 'assert', - 'trace', -] ; - -/** This may be mutated by the console instrumentation. */ -const originalConsoleMethods - - = {}; - -/** JSDoc */ - -/** - * Temporarily disable sentry console instrumentations. - * - * @param callback The function to run against the original `console` messages - * @returns The results of the callback - */ -function consoleSandbox(callback) { - if (!('console' in worldwide.GLOBAL_OBJ)) { - return callback(); +function isSentryRequestUrl(url, client) { + const dsn = client?.getDsn(); + const tunnel = client?.getOptions().tunnel; + return checkDsn(url, dsn) || checkTunnel(url, tunnel); +} +function checkTunnel(url, tunnel) { + if (!tunnel) { + return false; } - - const console = worldwide.GLOBAL_OBJ.console ; - const wrappedFuncs = {}; - - const wrappedLevels = Object.keys(originalConsoleMethods) ; - - // Restore all wrapped console methods - wrappedLevels.forEach(level => { - const originalConsoleMethod = originalConsoleMethods[level] ; - wrappedFuncs[level] = console[level] ; - console[level] = originalConsoleMethod; - }); - - try { - return callback(); - } finally { - // Revert restoration to wrapped state - wrappedLevels.forEach(level => { - console[level] = wrappedFuncs[level] ; - }); + return removeTrailingSlash(url) === removeTrailingSlash(tunnel); +} +function checkDsn(url$1, dsn) { + const urlParts = url.parseStringToURLObject(url$1); + if (!urlParts || url.isURLObjectRelative(urlParts)) { + return false; } + if (!dsn) { + return false; + } + return hostnameMatchesDsnHost(urlParts.hostname, dsn.host) && /(^|&|\?)sentry_key=/.test(urlParts.search); +} +function hostnameMatchesDsnHost(hostname, dsnHost) { + return hostname === dsnHost || dsnHost.length > 0 && hostname.endsWith(`.${dsnHost}`); +} +function removeTrailingSlash(str) { + return str[str.length - 1] === "/" ? str.slice(0, -1) : str; } -function makeLogger() { - let enabled = false; - const logger = { - enable: () => { - enabled = true; - }, - disable: () => { - enabled = false; - }, - isEnabled: () => enabled, - }; - - if (debugBuild.DEBUG_BUILD) { - CONSOLE_LEVELS.forEach(name => { - logger[name] = (...args) => { - if (enabled) { - consoleSandbox(() => { - worldwide.GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args); - }); - } - }; - }); - } else { - CONSOLE_LEVELS.forEach(name => { - logger[name] = () => undefined; - }); - } - - return logger ; -} - -/** - * This is a logger singleton which either logs things or no-ops if logging is not enabled. - * The logger is a singleton on the carrier, to ensure that a consistent logger is used throughout the SDK. - */ -const logger = worldwide.getGlobalSingleton('logger', makeLogger); - -exports.CONSOLE_LEVELS = CONSOLE_LEVELS; -exports.consoleSandbox = consoleSandbox; -exports.logger = logger; -exports.originalConsoleMethods = originalConsoleMethods; -//# sourceMappingURL=logger.js.map +exports.isSentryRequestUrl = isSentryRequestUrl; +//# sourceMappingURL=isSentryRequestUrl.js.map /***/ }), -/***/ 50981: +/***/ 67080: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** A simple Least Recently Used map */ class LRUMap { - - constructor( _maxSize) {this._maxSize = _maxSize; - this._cache = new Map(); + constructor(_maxSize) { + this._maxSize = _maxSize; + this._cache = /* @__PURE__ */ new Map(); } - /** Get the current size of the cache */ - get size() { + get size() { return this._cache.size; } - /** Get an entry or undefined if it was not in the cache. Re-inserts to update the recently used order */ - get(key) { + get(key) { const value = this._cache.get(key); - if (value === undefined) { - return undefined; + if (value === void 0) { + return void 0; } - // Remove and re-insert to update the order this._cache.delete(key); this._cache.set(key, value); return value; } - /** Insert an entry and evict an older entry if we've reached maxSize */ - set(key, value) { + set(key, value) { if (this._cache.size >= this._maxSize) { - // keys() returns an iterator in insertion order so keys().next() gives us the oldest key - this._cache.delete(this._cache.keys().next().value); + const nextKey = this._cache.keys().next().value; + this._cache.delete(nextKey); } this._cache.set(key, value); } - /** Remove an entry and return the entry if it was in the cache */ - remove(key) { + remove(key) { const value = this._cache.get(key); if (value) { this._cache.delete(key); } return value; } - /** Clear all entries */ - clear() { + clear() { this._cache.clear(); } - /** Get all the keys */ - keys() { + keys() { return Array.from(this._cache.keys()); } - /** Get all the values */ - values() { + values() { const values = []; - this._cache.forEach(value => values.push(value)); + this._cache.forEach((value) => values.push(value)); return values; } } @@ -77536,193 +37869,131 @@ exports.LRUMap = LRUMap; /***/ }), -/***/ 13414: +/***/ 32003: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -/* eslint-disable @typescript-eslint/no-explicit-any */ - -/** - * Helper to decycle json objects - * - * @deprecated This function is deprecated and will be removed in the next major version. - */ -// TODO(v9): Move this function into normalize() directly -function memoBuilder() { - const hasWeakSet = typeof WeakSet === 'function'; - const inner = hasWeakSet ? new WeakSet() : []; - function memoize(obj) { - if (hasWeakSet) { - if (inner.has(obj)) { - return true; - } - inner.add(obj); - return false; - } - // eslint-disable-next-line @typescript-eslint/prefer-for-of - for (let i = 0; i < inner.length; i++) { - const value = inner[i]; - if (value === obj) { - return true; - } - } - inner.push(obj); - return false; +function merge(initialObj, mergeObj, levels = 2) { + if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) { + return mergeObj; } - - function unmemoize(obj) { - if (hasWeakSet) { - inner.delete(obj); - } else { - for (let i = 0; i < inner.length; i++) { - if (inner[i] === obj) { - inner.splice(i, 1); - break; - } - } + if (initialObj && Object.keys(mergeObj).length === 0) { + return initialObj; + } + const output = { ...initialObj }; + for (const key in mergeObj) { + if (Object.prototype.hasOwnProperty.call(mergeObj, key)) { + output[key] = merge(output[key], mergeObj[key], levels - 1); } } - return [memoize, unmemoize]; + return output; } -exports.memoBuilder = memoBuilder; -//# sourceMappingURL=memo.js.map +exports.merge = merge; +//# sourceMappingURL=merge.js.map /***/ }), -/***/ 3181: +/***/ 34314: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const object = __nccwpck_require__(16100); -const string = __nccwpck_require__(93529); -const worldwide = __nccwpck_require__(10891); +const traceData = __nccwpck_require__(7522); -/** - * UUID4 generator - * - * @returns string Generated UUID4. - */ -function uuid4() { - const gbl = worldwide.GLOBAL_OBJ ; - const crypto = gbl.crypto || gbl.msCrypto; +function getTraceMetaTags(traceData$1) { + return Object.entries(traceData$1 || traceData.getTraceData()).map(([key, value]) => ``).join(""); +} - let getRandomByte = () => Math.random() * 16; +exports.getTraceMetaTags = getTraceMetaTags; +//# sourceMappingURL=meta.js.map + + +/***/ }), + +/***/ 52619: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const object = __nccwpck_require__(5906); +const randomSafeContext = __nccwpck_require__(28695); +const string = __nccwpck_require__(77673); +const worldwide = __nccwpck_require__(90935); + +function getCrypto() { + const gbl = worldwide.GLOBAL_OBJ; + return gbl.crypto || gbl.msCrypto; +} +let emptyUuid; +function getRandomByte() { + return randomSafeContext.safeMathRandom() * 16; +} +function uuid4(crypto = getCrypto()) { try { - if (crypto && crypto.randomUUID) { - return crypto.randomUUID().replace(/-/g, ''); + if (crypto?.randomUUID) { + return randomSafeContext.withRandomSafeContext(() => crypto.randomUUID()).replace(/-/g, ""); } - if (crypto && crypto.getRandomValues) { - getRandomByte = () => { - // crypto.getRandomValues might return undefined instead of the typed array - // in old Chromium versions (e.g. 23.0.1235.0 (151422)) - // However, `typedArray` is still filled in-place. - // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray - const typedArray = new Uint8Array(1); - crypto.getRandomValues(typedArray); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - return typedArray[0]; - }; - } - } catch (_) { - // some runtimes can crash invoking crypto - // https://github.com/getsentry/sentry-javascript/issues/8935 + } catch { } - - // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523 - // Concatenating the following numbers as strings results in '10000000100040008000100000000000' - return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c => - // eslint-disable-next-line no-bitwise - ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16), + if (!emptyUuid) { + emptyUuid = "10000000100040008000" + 1e11; + } + return emptyUuid.replace( + /[018]/g, + (c) => ( + // eslint-disable-next-line no-bitwise + (c ^ (getRandomByte() & 15) >> c / 4).toString(16) + ) ); } - function getFirstException(event) { - return event.exception && event.exception.values ? event.exception.values[0] : undefined; + return event.exception?.values?.[0]; } - -/** - * Extracts either message or type+value from an event that can be used for user-facing logs - * @returns event's description - */ function getEventDescription(event) { const { message, event_id: eventId } = event; if (message) { return message; } - const firstException = getFirstException(event); if (firstException) { if (firstException.type && firstException.value) { return `${firstException.type}: ${firstException.value}`; } - return firstException.type || firstException.value || eventId || ''; + return firstException.type || firstException.value || eventId || ""; } - return eventId || ''; + return eventId || ""; } - -/** - * Adds exception values, type and value to an synthetic Exception. - * @param event The event to modify. - * @param value Value of the exception. - * @param type Type of the exception. - * @hidden - */ function addExceptionTypeValue(event, value, type) { - const exception = (event.exception = event.exception || {}); - const values = (exception.values = exception.values || []); - const firstException = (values[0] = values[0] || {}); + const exception = event.exception = event.exception || {}; + const values = exception.values = exception.values || []; + const firstException = values[0] = values[0] || {}; if (!firstException.value) { - firstException.value = value || ''; + firstException.value = value || ""; } if (!firstException.type) { - firstException.type = type || 'Error'; + firstException.type = type || "Error"; } } - -/** - * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed. - * - * @param event The event to modify. - * @param newMechanism Mechanism data to add to the event. - * @hidden - */ function addExceptionMechanism(event, newMechanism) { const firstException = getFirstException(event); if (!firstException) { return; } - - const defaultMechanism = { type: 'generic', handled: true }; + const defaultMechanism = { type: "generic", handled: true }; const currentMechanism = firstException.mechanism; firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism }; - - if (newMechanism && 'data' in newMechanism) { - const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data }; + if (newMechanism && "data" in newMechanism) { + const mergedData = { ...currentMechanism?.data, ...newMechanism.data }; firstException.mechanism.data = mergedData; } } - -// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string -const SEMVER_REGEXP = - /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; - -/** - * Represents Semantic Versioning object - */ - +const SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; function _parseInt(input) { - return parseInt(input || '', 10); + return parseInt(input || "", 10); } - -/** - * Parses input into a SemVer interface - * @param input string representation of a semver version - */ function parseSemver(input) { const match = input.match(SEMVER_REGEXP) || []; const major = _parseInt(match[1]); @@ -77730,105 +38001,46 @@ function parseSemver(input) { const patch = _parseInt(match[3]); return { buildmetadata: match[5], - major: isNaN(major) ? undefined : major, - minor: isNaN(minor) ? undefined : minor, - patch: isNaN(patch) ? undefined : patch, - prerelease: match[4], + major: isNaN(major) ? void 0 : major, + minor: isNaN(minor) ? void 0 : minor, + patch: isNaN(patch) ? void 0 : patch, + prerelease: match[4] }; } - -/** - * This function adds context (pre/post/line) lines to the provided frame - * - * @param lines string[] containing all lines - * @param frame StackFrame that will be mutated - * @param linesOfContext number of context lines we want to add pre/post - */ function addContextToFrame(lines, frame, linesOfContext = 5) { - // When there is no line number in the frame, attaching context is nonsensical and will even break grouping - if (frame.lineno === undefined) { + if (frame.lineno === void 0) { return; } - const maxLines = lines.length; const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0); - - frame.pre_context = lines - .slice(Math.max(0, sourceLine - linesOfContext), sourceLine) - .map((line) => string.snipLine(line, 0)); - - // We guard here to ensure this is not larger than the existing number of lines + frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map((line) => string.snipLine(line, 0)); const lineIndex = Math.min(maxLines - 1, sourceLine); - - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion frame.context_line = string.snipLine(lines[lineIndex], frame.colno || 0); - - frame.post_context = lines - .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext) - .map((line) => string.snipLine(line, 0)); + frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map((line) => string.snipLine(line, 0)); } - -/** - * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object - * in question), and marks it captured if not. - * - * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and - * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so - * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because - * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not - * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This - * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we - * see it. - * - * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on - * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent - * object wrapper forms so that this check will always work. However, because we need to flag the exact object which - * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification - * must be done before the exception captured. - * - * @param A thrown exception to check or flag as having been seen - * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen) - */ function checkOrSetAlreadyCaught(exception) { if (isAlreadyCaptured(exception)) { return true; } - try { - // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the - // `ExtraErrorData` integration - object.addNonEnumerableProperty(exception , '__sentry_captured__', true); - } catch (err) { - // `exception` is a primitive, so we can't mark it seen + object.addNonEnumerableProperty(exception, "__sentry_captured__", true); + } catch { } - return false; } - function isAlreadyCaptured(exception) { try { - return (exception ).__sentry_captured__; - } catch (e) {} // eslint-disable-line no-empty -} - -/** - * Checks whether the given input is already an array, and if it isn't, wraps it in one. - * - * @param maybeArray Input to turn into an array, if necessary - * @returns The input, if already an array, or an array with the input as the only element, if not - * - * @deprecated This function has been deprecated and will not be replaced. - */ -function arrayify(maybeArray) { - return Array.isArray(maybeArray) ? maybeArray : [maybeArray]; + return exception.__sentry_captured__; + } catch { + } } exports.addContextToFrame = addContextToFrame; exports.addExceptionMechanism = addExceptionMechanism; exports.addExceptionTypeValue = addExceptionTypeValue; -exports.arrayify = arrayify; exports.checkOrSetAlreadyCaught = checkOrSetAlreadyCaught; exports.getEventDescription = getEventDescription; +exports.isAlreadyCaptured = isAlreadyCaptured; exports.parseSemver = parseSemver; exports.uuid4 = uuid4; //# sourceMappingURL=misc.js.map @@ -77836,131 +38048,104 @@ exports.uuid4 = uuid4; /***/ }), -/***/ 70169: +/***/ 27068: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const stacktrace = __nccwpck_require__(85820); +const stacktrace = __nccwpck_require__(22902); -/** - * Does this filename look like it's part of the app code? - */ function filenameIsInApp(filename, isNative = false) { - const isInternal = - isNative || - (filename && - // It's not internal if it's an absolute linux path - !filename.startsWith('/') && - // It's not internal if it's an absolute windows path - !filename.match(/^[A-Z]:/) && - // It's not internal if the path is starting with a dot - !filename.startsWith('.') && - // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack - !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)); // Schema from: https://stackoverflow.com/a/3641782 - - // in_app is all that's not an internal Node function or a module within node_modules - // note that isNative appears to return true even for node core libraries - // see https://github.com/getsentry/raven-node/issues/176 - - return !isInternal && filename !== undefined && !filename.includes('node_modules/'); + const isInternal = isNative || filename && // It's not internal if it's an absolute linux path + !filename.startsWith("/") && // It's not internal if it's an absolute windows path + !filename.match(/^[A-Z]:/) && // It's not internal if the path is starting with a dot + !filename.startsWith(".") && // It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack + !filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//); + return !isInternal && filename !== void 0 && !filename.includes("node_modules/"); } - -/** Node Stack line parser */ function node(getModule) { const FILENAME_MATCH = /^\s*[-]{4,}$/; const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/; - - // eslint-disable-next-line complexity + const DATA_URI_MATCH = /at (?:async )?(.+?) \(data:(.*?),/; return (line) => { + const dataUriMatch = line.match(DATA_URI_MATCH); + if (dataUriMatch) { + return { + filename: ``, + function: dataUriMatch[1] + }; + } const lineMatch = line.match(FULL_MATCH); - if (lineMatch) { let object; let method; let functionName; let typeName; let methodName; - if (lineMatch[1]) { functionName = lineMatch[1]; - - let methodStart = functionName.lastIndexOf('.'); - if (functionName[methodStart - 1] === '.') { + let methodStart = functionName.lastIndexOf("."); + if (functionName[methodStart - 1] === ".") { methodStart--; } - if (methodStart > 0) { object = functionName.slice(0, methodStart); method = functionName.slice(methodStart + 1); - const objectEnd = object.indexOf('.Module'); + const objectEnd = object.indexOf(".Module"); if (objectEnd > 0) { functionName = functionName.slice(objectEnd + 1); object = object.slice(0, objectEnd); } } - typeName = undefined; + typeName = void 0; } - if (method) { typeName = object; methodName = method; } - - if (method === '') { - methodName = undefined; - functionName = undefined; + if (method === "") { + methodName = void 0; + functionName = void 0; } - - if (functionName === undefined) { + if (functionName === void 0) { methodName = methodName || stacktrace.UNKNOWN_FUNCTION; functionName = typeName ? `${typeName}.${methodName}` : methodName; } - - let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2]; - const isNative = lineMatch[5] === 'native'; - - // If it's a Windows path, trim the leading slash so that `/C:/foo` becomes `C:/foo` - if (filename && filename.match(/\/[A-Z]:/)) { - filename = filename.slice(1); - } - + let filename = stacktrace.normalizeStackTracePath(lineMatch[2]); + const isNative = lineMatch[5] === "native"; if (!filename && lineMatch[5] && !isNative) { filename = lineMatch[5]; } - + const maybeDecodedFilename = filename ? _safeDecodeURI(filename) : void 0; return { - filename: filename ? decodeURI(filename) : undefined, - module: getModule ? getModule(filename) : undefined, + filename: maybeDecodedFilename ?? filename, + module: maybeDecodedFilename && getModule?.(maybeDecodedFilename), function: functionName, lineno: _parseIntOrUndefined(lineMatch[3]), colno: _parseIntOrUndefined(lineMatch[4]), - in_app: filenameIsInApp(filename || '', isNative), + in_app: filenameIsInApp(filename || "", isNative) }; } - if (line.match(FILENAME_MATCH)) { return { - filename: line, + filename: line }; } - - return undefined; + return void 0; }; } - -/** - * Node.js stack line parser - * - * This is in @sentry/core so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`. - * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain - */ function nodeStackLineParser(getModule) { return [90, node(getModule)]; } - function _parseIntOrUndefined(input) { - return parseInt(input || '', 10) || undefined; + return parseInt(input || "", 10) || void 0; +} +function _safeDecodeURI(filename) { + try { + return decodeURI(filename); + } catch { + return void 0; + } } exports.filenameIsInApp = filenameIsInApp; @@ -77971,86 +38156,36 @@ exports.nodeStackLineParser = nodeStackLineParser; /***/ }), -/***/ 10116: +/***/ 84934: /***/ ((module, exports, __nccwpck_require__) => { /* module decorator */ module = __nccwpck_require__.nmd(module); -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const env = __nccwpck_require__(11318); +const env = __nccwpck_require__(582); -/** - * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something, - * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere. - */ - - -/** - * Checks whether we're in the Node.js or Browser environment - * - * @returns Answer to given question - */ function isNodeEnv() { - // explicitly check for browser bundles as those can be optimized statically - // by terser/rollup. - return ( - !env.isBrowserBundle() && - Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]' - ); + return !env.isBrowserBundle() && Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]"; } - -/** - * Requires a module which is protected against bundler minification. - * - * @param request The module path to resolve - * @deprecated This function will be removed in the next major version. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any function dynamicRequire(mod, request) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return mod.require(request); } - -/** - * Helper for dynamically loading module that should work with linked dependencies. - * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))` - * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during - * build time. `require.resolve` is also not available in any other way, so we cannot create, - * a fake helper like we do with `dynamicRequire`. - * - * We always prefer to use local package, thus the value is not returned early from each `try/catch` block. - * That is to mimic the behavior of `require.resolve` exactly. - * - * @param moduleName module name to require - * @param existingModule module to use for requiring - * @returns possibly required module - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any function loadModule(moduleName, existingModule = module) { let mod; - try { - // eslint-disable-next-line deprecation/deprecation mod = dynamicRequire(existingModule, moduleName); - } catch (e) { - // no-empty + } catch { } - if (!mod) { try { - // eslint-disable-next-line deprecation/deprecation - const { cwd } = dynamicRequire(existingModule, 'process'); - // eslint-disable-next-line deprecation/deprecation - mod = dynamicRequire(existingModule, `${cwd()}/node_modules/${moduleName}`) ; - } catch (e) { - // no-empty + const { cwd } = dynamicRequire(existingModule, "process"); + mod = dynamicRequire(existingModule, `${cwd()}/node_modules/${moduleName}`); + } catch { } } - return mod; } -exports.dynamicRequire = dynamicRequire; exports.isNodeEnv = isNodeEnv; exports.loadModule = loadModule; //# sourceMappingURL=node.js.map @@ -78058,617 +38193,338 @@ exports.loadModule = loadModule; /***/ }), -/***/ 65543: +/***/ 1477: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const is = __nccwpck_require__(84085); -const memo = __nccwpck_require__(13414); -const object = __nccwpck_require__(16100); -const stacktrace = __nccwpck_require__(85820); +const object = __nccwpck_require__(5906); -/** - * Recursively normalizes the given object. - * - * - Creates a copy to prevent original input mutation - * - Skips non-enumerable properties - * - When stringifying, calls `toJSON` if implemented - * - Removes circular references - * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format - * - Translates known global objects/classes to a string representations - * - Takes care of `Error` object serialization - * - Optionally limits depth of final output - * - Optionally limits number of properties/elements included in any single object/array - * - * @param input The object to be normalized. - * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.) - * @param maxProperties The max number of elements or properties to be included in any single array or - * object in the normalized output. - * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function normalize(input, depth = 100, maxProperties = +Infinity) { +const SENTRY_SKIP_NORMALIZATION = /* @__PURE__ */ Symbol.for("sentry.skipNormalization"); +const SENTRY_OVERRIDE_NORMALIZATION_DEPTH = /* @__PURE__ */ Symbol.for("sentry.overrideNormalizationDepth"); +function setSkipNormalizationHint(obj) { + object.addNonEnumerableProperty(obj, SENTRY_SKIP_NORMALIZATION, true); +} +function setNormalizationDepthOverrideHint(obj, depth) { + object.addNonEnumerableProperty(obj, SENTRY_OVERRIDE_NORMALIZATION_DEPTH, depth); +} +function hasSkipNormalizationHint(value) { + return Boolean(value[SENTRY_SKIP_NORMALIZATION]); +} +function getNormalizationDepthOverrideHint(value) { + const v = value[SENTRY_OVERRIDE_NORMALIZATION_DEPTH]; + return typeof v === "number" ? v : void 0; +} + +exports.getNormalizationDepthOverrideHint = getNormalizationDepthOverrideHint; +exports.hasSkipNormalizationHint = hasSkipNormalizationHint; +exports.setNormalizationDepthOverrideHint = setNormalizationDepthOverrideHint; +exports.setSkipNormalizationHint = setSkipNormalizationHint; +//# sourceMappingURL=normalizationHints.js.map + + +/***/ }), + +/***/ 68446: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const normalizationHints = __nccwpck_require__(1477); +const object = __nccwpck_require__(5906); +const stacktrace = __nccwpck_require__(22902); + +let stringifier; +function setNormalizeStringifier(newStringifier) { + stringifier = newStringifier; +} +function normalize(input, depth = 100, maxProperties = Infinity) { try { - // since we're at the outermost level, we don't provide a key - return visit('', input, depth, maxProperties); + return visit("", input, depth, maxProperties); } catch (err) { return { ERROR: `**non-serializable** (${err})` }; } } - -/** JSDoc */ -function normalizeToSize( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - object, - // Default Node.js REPL depth - depth = 3, - // 100kB, as 200kB is max payload size, so half sounds reasonable - maxSize = 100 * 1024, -) { +function normalizeToSize(object, depth = 3, maxSize = 100 * 1024) { const normalized = normalize(object, depth); - if (jsonSize(normalized) > maxSize) { return normalizeToSize(object, depth - 1, maxSize); } - - return normalized ; + return normalized; } - -/** - * Visits a node to perform normalization on it - * - * @param key The key corresponding to the given node - * @param value The node to be visited - * @param depth Optional number indicating the maximum recursion depth - * @param maxProperties Optional maximum number of properties/elements included in any single object/array - * @param memo Optional Memo class handling decycling - */ -function visit( - key, - value, - depth = +Infinity, - maxProperties = +Infinity, - // eslint-disable-next-line deprecation/deprecation - memo$1 = memo.memoBuilder(), -) { - const [memoize, unmemoize] = memo$1; - - // Get the simple cases out of the way first - if ( - value == null || // this matches null and undefined -> eqeq not eqeqeq - ['boolean', 'string'].includes(typeof value) || - (typeof value === 'number' && Number.isFinite(value)) - ) { - return value ; +function visit(key, value, depth = Infinity, maxProperties = Infinity, memo = memoBuilder()) { + const [memoize, unmemoize] = memo; + if (value == null || // this matches null and undefined -> eqeq not eqeqeq + ["boolean", "string"].includes(typeof value) || typeof value === "number" && Number.isFinite(value)) { + return value; } - const stringified = stringifyValue(key, value); - - // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`. - // Everything else will have already been serialized, so if we don't see that pattern, we're done. - if (!stringified.startsWith('[object ')) { + if (!stringified.startsWith("[object ")) { return stringified; } - - // From here on, we can assert that `value` is either an object or an array. - - // Do not normalize objects that we know have already been normalized. As a general rule, the - // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that - // have already been normalized. - if ((value )['__sentry_skip_normalization__']) { - return value ; + if (normalizationHints.hasSkipNormalizationHint(value)) { + return value; } - - // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there - // We keep a certain amount of depth. - // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state. - const remainingDepth = - typeof (value )['__sentry_override_normalization_depth__'] === 'number' - ? ((value )['__sentry_override_normalization_depth__'] ) - : depth; - - // We're also done if we've reached the max depth + const overrideDepth = normalizationHints.getNormalizationDepthOverrideHint(value); + const remainingDepth = overrideDepth !== void 0 ? overrideDepth : depth; if (remainingDepth === 0) { - // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`. - return stringified.replace('object ', ''); + return stringified.replace("object ", ""); } - - // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now. if (memoize(value)) { - return '[Circular ~]'; + return "[Circular ~]"; } - - // If the value has a `toJSON` method, we call it to extract more information - const valueWithToJSON = value ; - if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') { + const valueWithToJSON = value; + if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") { try { const jsonValue = valueWithToJSON.toJSON(); - // We need to normalize the return value of `.toJSON()` in case it has circular references - return visit('', jsonValue, remainingDepth - 1, maxProperties, memo$1); - } catch (err) { - // pass (The built-in `toJSON` failed, but we can still try to do it ourselves) + return visit("", jsonValue, remainingDepth - 1, maxProperties, memo); + } catch { } } - - // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse - // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each - // property/entry, and keep track of the number of items we add to it. - const normalized = (Array.isArray(value) ? [] : {}) ; + const normalized = Array.isArray(value) ? [] : {}; let numAdded = 0; - - // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant - // properties are non-enumerable and otherwise would get missed. - const visitable = object.convertToPlainObject(value ); - + const visitable = object.convertToPlainObject(value); for (const visitKey in visitable) { - // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration. if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { continue; } - if (numAdded >= maxProperties) { - normalized[visitKey] = '[MaxProperties ~]'; + normalized[visitKey] = "[MaxProperties ~]"; break; } - - // Recursively visit all the child nodes const visitValue = visitable[visitKey]; - normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo$1); - + normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo); numAdded++; } - - // Once we've visited all the branches, remove the parent from memo storage unmemoize(value); - - // Return accumulated values return normalized; } - -/* eslint-disable complexity */ -/** - * Stringify the given value. Handles various known special values and types. - * - * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn - * the number 1231 into "[Object Number]", nor on `null`, as it will throw. - * - * @param value The value to stringify - * @returns A stringified representation of the given value - */ -function stringifyValue( - key, - // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for - // our internal use, it'll do - value, -) { +function stringifyValue(key, value) { try { - if (key === 'domain' && value && typeof value === 'object' && (value )._events) { - return '[Domain]'; + if (stringifier) { + const stringified = stringifier(value); + if (stringified) { + return stringified; + } } - - if (key === 'domainEmitter') { - return '[DomainEmitter]'; + if (typeof global !== "undefined" && value === global) { + return "[Global]"; } - - // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first - // which won't throw if they are not present. - - if (typeof global !== 'undefined' && value === global) { - return '[Global]'; - } - - // eslint-disable-next-line no-restricted-globals - if (typeof window !== 'undefined' && value === window) { - return '[Window]'; - } - - // eslint-disable-next-line no-restricted-globals - if (typeof document !== 'undefined' && value === document) { - return '[Document]'; - } - - if (is.isVueViewModel(value)) { - return '[VueViewModel]'; - } - - // React's SyntheticEvent thingy - if (is.isSyntheticEvent(value)) { - return '[SyntheticEvent]'; - } - - if (typeof value === 'number' && !Number.isFinite(value)) { + if (typeof value === "number" && !Number.isFinite(value)) { return `[${value}]`; } - - if (typeof value === 'function') { + if (typeof value === "function") { return `[Function: ${stacktrace.getFunctionName(value)}]`; } - - if (typeof value === 'symbol') { + if (typeof value === "symbol") { return `[${String(value)}]`; } - - // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion - if (typeof value === 'bigint') { + if (typeof value === "bigint") { return `[BigInt: ${String(value)}]`; } - - // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting - // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as - // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class), - // we can make sure that only plain objects come out that way. const objName = getConstructorName(value); - - // Handle HTML Elements - if (/^HTML(\w*)Element$/.test(objName)) { - return `[HTMLElement: ${objName}]`; - } - return `[object ${objName}]`; } catch (err) { return `**non-serializable** (${err})`; } } -/* eslint-enable complexity */ - function getConstructorName(value) { const prototype = Object.getPrototypeOf(value); - - return prototype ? prototype.constructor.name : 'null prototype'; + return prototype?.constructor ? prototype.constructor.name : "null prototype"; } - -/** Calculates bytes size of input string */ function utf8Length(value) { - // eslint-disable-next-line no-bitwise return ~-encodeURI(value).split(/%..|./).length; } - -/** Calculates bytes size of input object */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any function jsonSize(value) { return utf8Length(JSON.stringify(value)); } - -/** - * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint - * across platforms and working directory. - * - * @param url The URL to be normalized. - * @param basePath The application base path. - * @returns The normalized URL. - */ function normalizeUrlToBase(url, basePath) { - const escapedBase = basePath - // Backslash to forward - .replace(/\\/g, '/') - // Escape RegExp special characters - .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'); - + const escapedBase = basePath.replace(/\\/g, "/").replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); let newUrl = url; try { newUrl = decodeURI(url); - } catch (_Oo) { - // Sometime this breaks + } catch { } - return ( - newUrl - .replace(/\\/g, '/') - .replace(/webpack:\/?/g, '') // Remove intermediate base path - // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor - .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///') - ); + return newUrl.replace(/\\/g, "/").replace(/webpack:\/?/g, "").replace(new RegExp(`(file://)?/*${escapedBase}/*`, "ig"), "app:///"); +} +function memoBuilder() { + const inner = /* @__PURE__ */ new WeakSet(); + function memoize(obj) { + if (inner.has(obj)) { + return true; + } + inner.add(obj); + return false; + } + function unmemoize(obj) { + inner.delete(obj); + } + return [memoize, unmemoize]; } exports.normalize = normalize; exports.normalizeToSize = normalizeToSize; exports.normalizeUrlToBase = normalizeUrlToBase; +exports.setNormalizeStringifier = setNormalizeStringifier; +exports.stringifyValue = stringifyValue; //# sourceMappingURL=normalize.js.map /***/ }), -/***/ 16100: +/***/ 5906: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const browser = __nccwpck_require__(24450); -const debugBuild = __nccwpck_require__(87038); -const is = __nccwpck_require__(84085); -const logger = __nccwpck_require__(38752); -const string = __nccwpck_require__(93529); +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const is = __nccwpck_require__(68370); -/** - * Replace a method in an object with a wrapped version of itself. - * - * @param source An object that contains a method to be wrapped. - * @param name The name of the method to be wrapped. - * @param replacementFactory A higher-order function that takes the original version of the given method and returns a - * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to - * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`. - * @returns void - */ function fill(source, name, replacementFactory) { if (!(name in source)) { return; } - - const original = source[name] ; - const wrapped = replacementFactory(original) ; - - // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work - // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" - if (typeof wrapped === 'function') { + const original = source[name]; + if (typeof original !== "function") { + return; + } + const wrapped = replacementFactory(original); + if (typeof wrapped === "function") { markFunctionWrapped(wrapped, original); } - try { source[name] = wrapped; - } catch (e) { - debugBuild.DEBUG_BUILD && logger.logger.log(`Failed to replace method "${name}" in object`, source); + } catch { + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Failed to replace method "${name}" in object`, source); } } - -/** - * Defines a non-enumerable property on the given object. - * - * @param obj The object on which to set the property - * @param name The name of the property to be set - * @param value The value to which to set the property - */ function addNonEnumerableProperty(obj, name, value) { try { Object.defineProperty(obj, name, { // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it - value: value, + value, writable: true, - configurable: true, + configurable: true }); - } catch (o_O) { - debugBuild.DEBUG_BUILD && logger.logger.log(`Failed to add non-enumerable property "${name}" to object`, obj); + } catch { + debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Failed to add non-enumerable property "${String(name)}" to object`, obj); } } - -/** - * Remembers the original function on the wrapped function and - * patches up the prototype. - * - * @param wrapped the wrapper function - * @param original the original function that gets wrapped - */ function markFunctionWrapped(wrapped, original) { try { const proto = original.prototype || {}; wrapped.prototype = original.prototype = proto; - addNonEnumerableProperty(wrapped, '__sentry_original__', original); - } catch (o_O) {} // eslint-disable-line no-empty + addNonEnumerableProperty(wrapped, "__sentry_original__", original); + } catch { + } +} +function wrapMethod(obj, field, wrapped, enumerable = true) { + const original = obj[field]; + if (typeof original !== "function") { + throw new Error(`Cannot wrap method: ${field} is not a function`); + } + if (getOriginalFunction(original)) { + throw new Error(`Attempting to wrap method ${field} multiple times`); + } + markFunctionWrapped(wrapped, original); + Object.defineProperty(obj, field, { + writable: true, + configurable: true, + enumerable, + value: wrapped + }); } - -/** - * This extracts the original function if available. See - * `markFunctionWrapped` for more information. - * - * @param func the function to unwrap - * @returns the unwrapped version of the function if available. - */ -// eslint-disable-next-line @typescript-eslint/ban-types function getOriginalFunction(func) { return func.__sentry_original__; } - -/** - * Encodes given object into url-friendly format - * - * @param object An object that contains serializable values - * @returns string Encoded - * - * @deprecated This function is deprecated and will be removed in the next major version of the SDK. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function urlEncode(object) { - return Object.entries(object) - .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) - .join('&'); -} - -/** - * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their - * non-enumerable properties attached. - * - * @param value Initial source that we have to transform in order for it to be usable by the serializer - * @returns An Event or Error turned into an object - or the value argument itself, when value is neither an Event nor - * an Error. - */ -function convertToPlainObject(value) - - { +function convertToPlainObject(value) { if (is.isError(value)) { return { message: value.message, name: value.name, stack: value.stack, - ...getOwnProperties(value), + ...getOwnProperties(value) }; - } else if (is.isEvent(value)) { - const newObj - - = { - type: value.type, - target: serializeEventTarget(value.target), - currentTarget: serializeEventTarget(value.currentTarget), - ...getOwnProperties(value), + } + if (is.isEvent(value)) { + const { type, target, currentTarget, detail } = value; + return { + type, + target, + currentTarget, + ...detail ? { detail } : {}, + ...getOwnProperties(value) }; - - if (typeof CustomEvent !== 'undefined' && is.isInstanceOf(value, CustomEvent)) { - newObj.detail = value.detail; - } - - return newObj; - } else { - return value; } + return value; } - -/** Creates a string representation of the target of an `Event` object */ -function serializeEventTarget(target) { - try { - return is.isElement(target) ? browser.htmlTreeAsString(target) : Object.prototype.toString.call(target); - } catch (_oO) { - return ''; - } -} - -/** Filters out all but an object's own properties */ function getOwnProperties(obj) { - if (typeof obj === 'object' && obj !== null) { - const extractedProps = {}; - for (const property in obj) { - if (Object.prototype.hasOwnProperty.call(obj, property)) { - extractedProps[property] = (obj )[property]; - } - } - return extractedProps; - } else { - return {}; + if (is.isObjectLike(obj)) { + return Object.fromEntries(Object.entries(obj)); } + return {}; } - -/** - * Given any captured exception, extract its keys and create a sorted - * and truncated list that will be used inside the event message. - * eg. `Non-error exception captured with keys: foo, bar, baz` - */ -function extractExceptionKeysForMessage(exception, maxLength = 40) { +function extractExceptionKeysForMessage(exception) { const keys = Object.keys(convertToPlainObject(exception)); keys.sort(); - - const firstKey = keys[0]; - - if (!firstKey) { - return '[object has no keys]'; - } - - if (firstKey.length >= maxLength) { - return string.truncate(firstKey, maxLength); - } - - for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) { - const serialized = keys.slice(0, includedKeys).join(', '); - if (serialized.length > maxLength) { - continue; - } - if (includedKeys === keys.length) { - return serialized; - } - return string.truncate(serialized, maxLength); - } - - return ''; + return !keys[0] ? "[object has no keys]" : keys.join(", "); } - -/** - * Given any object, return a new object having removed all fields whose value was `undefined`. - * Works recursively on objects and arrays. - * - * Attention: This function keeps circular references in the returned object. - */ function dropUndefinedKeys(inputValue) { - // This map keeps track of what already visited nodes map to. - // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular - // references as the input object. - const memoizationMap = new Map(); - - // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API + const memoizationMap = /* @__PURE__ */ new Map(); return _dropUndefinedKeys(inputValue, memoizationMap); } - function _dropUndefinedKeys(inputValue, memoizationMap) { - if (isPojo(inputValue)) { - // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object - const memoVal = memoizationMap.get(inputValue); - if (memoVal !== undefined) { - return memoVal ; - } - - const returnValue = {}; - // Store the mapping of this value in case we visit it again, in case of circular data - memoizationMap.set(inputValue, returnValue); - - for (const key of Object.getOwnPropertyNames(inputValue)) { - if (typeof inputValue[key] !== 'undefined') { - returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); - } - } - - return returnValue ; + if (inputValue === null || typeof inputValue !== "object") { + return inputValue; + } + const memoVal = memoizationMap.get(inputValue); + if (memoVal !== void 0) { + return memoVal; } - if (Array.isArray(inputValue)) { - // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object - const memoVal = memoizationMap.get(inputValue); - if (memoVal !== undefined) { - return memoVal ; - } - const returnValue = []; - // Store the mapping of this value in case we visit it again, in case of circular data memoizationMap.set(inputValue, returnValue); - - inputValue.forEach((item) => { - returnValue.push(_dropUndefinedKeys(item, memoizationMap)); + inputValue.forEach((value) => { + returnValue.push(_dropUndefinedKeys(value, memoizationMap)); }); - - return returnValue ; + return returnValue; + } + if (isPojo(inputValue)) { + const returnValue = {}; + memoizationMap.set(inputValue, returnValue); + const keys = Object.keys(inputValue); + keys.forEach((key) => { + const val = inputValue[key]; + if (val !== void 0) { + returnValue[key] = _dropUndefinedKeys(val, memoizationMap); + } + }); + return returnValue; } - return inputValue; } - function isPojo(input) { - if (!is.isPlainObject(input)) { - return false; - } - - try { - const name = (Object.getPrototypeOf(input) ).constructor.name; - return !name || name === 'Object'; - } catch (e2) { - return true; - } + const constructor = input.constructor; + return constructor === Object || constructor === void 0; } - -/** - * Ensure that something is an object. - * - * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper - * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives. - * - * @param wat The subject of the objectification - * @returns A version of `wat` which can safely be used with `Object` class methods - */ function objectify(wat) { let objectified; switch (true) { // this will catch both undefined and null - case wat == undefined: + case wat == void 0: objectified = new String(wat); break; - // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as // an object in order to wrap it. - case typeof wat === 'symbol' || typeof wat === 'bigint': + case (typeof wat === "symbol" || typeof wat === "bigint"): objectified = Object(wat); break; - // this will catch the remaining primitives: `String`, `Number`, and `Boolean` case is.isPrimitive(wat): - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - objectified = new (wat ).constructor(wat); + objectified = new wat.constructor(wat); break; - // by process of elimination, at this point we know that `wat` must already be an object default: objectified = wat; @@ -78685,50 +38541,66 @@ exports.fill = fill; exports.getOriginalFunction = getOriginalFunction; exports.markFunctionWrapped = markFunctionWrapped; exports.objectify = objectify; -exports.urlEncode = urlEncode; +exports.wrapMethod = wrapMethod; //# sourceMappingURL=object.js.map /***/ }), -/***/ 94509: +/***/ 32957: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript -// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js -// -// Copyright Joyent, Inc.and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +function parameterize(strings, ...values) { + const formatted = new String(String.raw(strings, ...values)); + formatted.__sentry_template_string__ = strings.join("\0").replace(/%/g, "%%").replace(/\0/g, "%s"); + formatted.__sentry_template_values__ = values; + return formatted; +} +const fmt = parameterize; + +exports.fmt = fmt; +exports.parameterize = parameterize; +//# sourceMappingURL=parameterize.js.map + + +/***/ }), + +/***/ 54078: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function parseSampleRate(sampleRate) { + if (typeof sampleRate === "boolean") { + return Number(sampleRate); + } + const rate = typeof sampleRate === "string" ? parseFloat(sampleRate) : sampleRate; + if (typeof rate !== "number" || isNaN(rate) || rate < 0 || rate > 1) { + return void 0; + } + return rate; +} + +exports.parseSampleRate = parseSampleRate; +//# sourceMappingURL=parseSampleRate.js.map + + +/***/ }), + +/***/ 82426: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** JSDoc */ function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 let up = 0; for (let i = parts.length - 1; i >= 0; i--) { const last = parts[i]; - if (last === '.') { + if (last === ".") { parts.splice(i, 1); - } else if (last === '..') { + } else if (last === "..") { parts.splice(i, 1); up++; } else if (up) { @@ -78736,94 +38608,59 @@ function normalizeArray(parts, allowAboveRoot) { up--; } } - - // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { - parts.unshift('..'); + parts.unshift(".."); } } - return parts; } - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. const splitPathRe = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/; -/** JSDoc */ function splitPath(filename) { - // Truncate files names greater than 1024 characters to avoid regex dos - // https://github.com/getsentry/sentry-javascript/pull/8737#discussion_r1285719172 const truncated = filename.length > 1024 ? `${filename.slice(-1024)}` : filename; const parts = splitPathRe.exec(truncated); return parts ? parts.slice(1) : []; } - -// path.resolve([from ...], to) -// posix version -/** JSDoc */ function resolve(...args) { - let resolvedPath = ''; + let resolvedPath = ""; let resolvedAbsolute = false; - for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { - const path = i >= 0 ? args[i] : '/'; - - // Skip empty entries + const path = i >= 0 ? args[i] : "/"; if (!path) { continue; } - resolvedPath = `${path}/${resolvedPath}`; - resolvedAbsolute = path.charAt(0) === '/'; + resolvedAbsolute = path.charAt(0) === "/"; } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path resolvedPath = normalizeArray( - resolvedPath.split('/').filter(p => !!p), - !resolvedAbsolute, - ).join('/'); - - return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; + resolvedPath.split("/").filter((p) => !!p), + !resolvedAbsolute + ).join("/"); + return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; } - -/** JSDoc */ function trim(arr) { let start = 0; for (; start < arr.length; start++) { - if (arr[start] !== '') { + if (arr[start] !== "") { break; } } - let end = arr.length - 1; for (; end >= 0; end--) { - if (arr[end] !== '') { + if (arr[end] !== "") { break; } } - if (start > end) { return []; } return arr.slice(start, end - start + 1); } - -// path.relative(from, to) -// posix version -/** JSDoc */ function relative(from, to) { - /* eslint-disable no-param-reassign */ from = resolve(from).slice(1); to = resolve(to).slice(1); - /* eslint-enable no-param-reassign */ - - const fromParts = trim(from.split('/')); - const toParts = trim(to.split('/')); - + const fromParts = trim(from.split("/")); + const toParts = trim(to.split("/")); const length = Math.min(fromParts.length, toParts.length); let samePartsLength = length; for (let i = 0; i < length; i++) { @@ -78832,74 +38669,48 @@ function relative(from, to) { break; } } - let outputParts = []; for (let i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); + outputParts.push(".."); } - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); + return outputParts.join("/"); } - -// path.normalize(path) -// posix version -/** JSDoc */ function normalizePath(path) { const isPathAbsolute = isAbsolute(path); - const trailingSlash = path.slice(-1) === '/'; - - // Normalize the path + const trailingSlash = path.slice(-1) === "/"; let normalizedPath = normalizeArray( - path.split('/').filter(p => !!p), - !isPathAbsolute, - ).join('/'); - + path.split("/").filter((p) => !!p), + !isPathAbsolute + ).join("/"); if (!normalizedPath && !isPathAbsolute) { - normalizedPath = '.'; + normalizedPath = "."; } if (normalizedPath && trailingSlash) { - normalizedPath += '/'; + normalizedPath += "/"; } - - return (isPathAbsolute ? '/' : '') + normalizedPath; + return (isPathAbsolute ? "/" : "") + normalizedPath; } - -// posix version -/** JSDoc */ function isAbsolute(path) { - return path.charAt(0) === '/'; + return path.charAt(0) === "/"; } - -// posix version -/** JSDoc */ function join(...args) { - return normalizePath(args.join('/')); + return normalizePath(args.join("/")); } - -/** JSDoc */ function dirname(path) { const result = splitPath(path); - const root = result[0] || ''; + const root = result[0] || ""; let dir = result[1]; - if (!root && !dir) { - // No dirname whatsoever - return '.'; + return "."; } - if (dir) { - // It has a dirname, strip trailing slash dir = dir.slice(0, dir.length - 1); } - return root + dir; } - -/** JSDoc */ function basename(path, ext) { - let f = splitPath(path)[2] || ''; + let f = splitPath(path)[2] || ""; if (ext && f.slice(ext.length * -1) === ext) { f = f.slice(0, f.length - ext.length); } @@ -78918,151 +38729,297 @@ exports.resolve = resolve; /***/ }), -/***/ 28058: +/***/ 22264: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const error = __nccwpck_require__(66322); -const syncpromise = __nccwpck_require__(15621); +const constants = __nccwpck_require__(5958); +const eventProcessors = __nccwpck_require__(45796); +const scope = __nccwpck_require__(49417); +const debugIds = __nccwpck_require__(26859); +const misc = __nccwpck_require__(52619); +const normalize = __nccwpck_require__(68446); +const scopeData = __nccwpck_require__(72332); +const string = __nccwpck_require__(77673); +const syncpromise = __nccwpck_require__(56291); +const time = __nccwpck_require__(66690); -/** - * Creates an new PromiseBuffer object with the specified limit - * @param limit max number of promises that can be stored in the buffer - */ -function makePromiseBuffer(limit) { - const buffer = []; - - function isReady() { - return limit === undefined || buffer.length < limit; +function prepareEvent(options, event, hint, scope, client, isolationScope) { + const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = options; + const prepared = { + ...event, + event_id: event.event_id || hint.event_id || misc.uuid4(), + timestamp: event.timestamp || time.dateTimestampInSeconds() + }; + const integrations = hint.integrations || options.integrations.map((i) => i.name); + applyClientOptions(prepared, options); + applyIntegrationsMetadata(prepared, integrations); + if (client) { + client.emit("applyFrameMetadata", event); } - - /** - * Remove a promise from the queue. - * - * @param task Can be any PromiseLike - * @returns Removed promise. - */ - function remove(task) { - return buffer.splice(buffer.indexOf(task), 1)[0] || Promise.resolve(undefined); + if (event.type === void 0) { + applyDebugIds(prepared, options.stackParser); } - - /** - * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment. - * - * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task: - * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor - * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By - * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer - * limit check. - * @returns The original promise. - */ - function add(taskProducer) { - if (!isReady()) { - return syncpromise.rejectedSyncPromise(new error.SentryError('Not adding Promise because buffer limit was reached.')); + const finalScope = getFinalScope(scope, hint.captureContext); + if (hint.mechanism) { + misc.addExceptionMechanism(prepared, hint.mechanism); + } + const clientEventProcessors = client ? client.getEventProcessors() : []; + const data = scopeData.getCombinedScopeData(isolationScope, finalScope); + const attachments = [...hint.attachments || [], ...data.attachments]; + if (attachments.length) { + hint.attachments = attachments; + } + scopeData.applyScopeDataToEvent(prepared, data); + const eventProcessors$1 = [ + ...clientEventProcessors, + // Run scope event processors _after_ all other processors + ...data.eventProcessors + ]; + const isInternalException = hint.data && hint.data.__sentry__ === true; + const result = isInternalException ? syncpromise.resolvedSyncPromise(prepared) : eventProcessors.notifyEventProcessors(eventProcessors$1, prepared, hint); + return result.then((evt) => { + if (evt) { + applyDebugMeta(evt); } - - // start the task and add its promise to the queue - const task = taskProducer(); - if (buffer.indexOf(task) === -1) { - buffer.push(task); + if (typeof normalizeDepth === "number" && normalizeDepth > 0) { + return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); } - void task - .then(() => remove(task)) - // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike` - // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't - // have promises, so TS has to polyfill when down-compiling.) - .then(null, () => - remove(task).then(null, () => { - // We have to add another catch here because `remove()` starts a new promise chain. - }), - ); - return task; + return evt; + }); +} +function applyClientOptions(event, options) { + const { environment, release, dist, maxValueLength } = options; + event.environment = event.environment || environment || constants.DEFAULT_ENVIRONMENT; + if (!event.release && release) { + event.release = release; } - - /** - * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first. - * - * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or - * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to - * `true`. - * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and - * `false` otherwise - */ - function drain(timeout) { - return new syncpromise.SyncPromise((resolve, reject) => { - let counter = buffer.length; - - if (!counter) { - return resolve(true); + if (!event.dist && dist) { + event.dist = dist; + } + const request = event.request; + if (request?.url && maxValueLength) { + request.url = string.truncate(request.url, maxValueLength); + } + if (maxValueLength) { + event.exception?.values?.forEach((exception) => { + if (exception.value) { + exception.value = string.truncate(exception.value, maxValueLength); } - - // wait for `timeout` ms and then resolve to `false` (if not cancelled first) - const capturedSetTimeout = setTimeout(() => { - if (timeout && timeout > 0) { - resolve(false); - } - }, timeout); - - // if all promises resolve in time, cancel the timer and resolve to `true` - buffer.forEach(item => { - void syncpromise.resolvedSyncPromise(item).then(() => { - if (!--counter) { - clearTimeout(capturedSetTimeout); - resolve(true); - } - }, reject); - }); }); } +} +function applyDebugIds(event, stackParser) { + const filenameDebugIdMap = debugIds.getFilenameToDebugIdMap(stackParser); + event.exception?.values?.forEach((exception) => { + exception.stacktrace?.frames?.forEach((frame) => { + if (frame.filename) { + frame.debug_id = filenameDebugIdMap[frame.filename]; + } + }); + }); +} +function applyDebugMeta(event) { + const filenameDebugIdMap = {}; + event.exception?.values?.forEach((exception) => { + exception.stacktrace?.frames?.forEach((frame) => { + if (frame.debug_id) { + if (frame.abs_path) { + filenameDebugIdMap[frame.abs_path] = frame.debug_id; + } else if (frame.filename) { + filenameDebugIdMap[frame.filename] = frame.debug_id; + } + delete frame.debug_id; + } + }); + }); + if (Object.keys(filenameDebugIdMap).length === 0) { + return; + } + event.debug_meta = event.debug_meta || {}; + event.debug_meta.images = event.debug_meta.images || []; + const images = event.debug_meta.images; + Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => { + images.push({ + type: "sourcemap", + code_file: filename, + debug_id + }); + }); +} +function applyIntegrationsMetadata(event, integrationNames) { + if (integrationNames.length > 0) { + event.sdk = event.sdk || {}; + event.sdk.integrations = [...event.sdk.integrations || [], ...integrationNames]; + } +} +function normalizeEvent(event, depth, maxBreadth) { + if (!event) { + return null; + } + const normalized = { + ...event, + ...event.breadcrumbs && { + breadcrumbs: event.breadcrumbs.map((b) => ({ + ...b, + ...b.data && { + data: normalize.normalize(b.data, depth, maxBreadth) + } + })) + }, + ...event.user && { + user: normalize.normalize(event.user, depth, maxBreadth) + }, + ...event.contexts && { + contexts: normalize.normalize(event.contexts, depth, maxBreadth) + }, + ...event.extra && { + extra: normalize.normalize(event.extra, depth, maxBreadth) + } + }; + if (event.contexts?.trace && normalized.contexts) { + normalized.contexts.trace = event.contexts.trace; + if (event.contexts.trace.data) { + normalized.contexts.trace.data = normalize.normalize(event.contexts.trace.data, depth, maxBreadth); + } + } + if (event.spans) { + normalized.spans = event.spans.map((span) => { + return { + ...span, + ...span.data && { + data: normalize.normalize(span.data, depth, maxBreadth) + } + }; + }); + } + if (event.contexts?.flags && normalized.contexts) { + normalized.contexts.flags = normalize.normalize(event.contexts.flags, 3, maxBreadth); + } + return normalized; +} +function getFinalScope(scope$1, captureContext) { + if (!captureContext) { + return scope$1; + } + const finalScope = scope$1 ? scope$1.clone() : new scope.Scope(); + finalScope.update(captureContext); + return finalScope; +} +function parseEventHintOrCaptureContext(hint) { + if (!hint) { + return void 0; + } + if (hintIsScopeOrFunction(hint)) { + return { captureContext: hint }; + } + if (hintIsScopeContext(hint)) { + return { + captureContext: hint + }; + } + return hint; +} +function hintIsScopeOrFunction(hint) { + return hint instanceof scope.Scope || typeof hint === "function"; +} +const captureContextKeys = [ + "user", + "level", + "extra", + "contexts", + "tags", + "fingerprint", + "propagationContext" +]; +function hintIsScopeContext(hint) { + return Object.keys(hint).some((key) => captureContextKeys.includes(key)); +} +exports.applyClientOptions = applyClientOptions; +exports.applyDebugIds = applyDebugIds; +exports.applyDebugMeta = applyDebugMeta; +exports.parseEventHintOrCaptureContext = parseEventHintOrCaptureContext; +exports.prepareEvent = prepareEvent; +//# sourceMappingURL=prepareEvent.js.map + + +/***/ }), + +/***/ 80503: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const syncpromise = __nccwpck_require__(56291); +const timer = __nccwpck_require__(85548); + +const SENTRY_BUFFER_FULL_ERROR = /* @__PURE__ */ Symbol.for("SentryBufferFullError"); +function makePromiseBuffer(limit = 100) { + const buffer = /* @__PURE__ */ new Set(); + function isReady() { + return buffer.size < limit; + } + function remove(task) { + buffer.delete(task); + } + function add(taskProducer) { + if (!isReady()) { + return syncpromise.rejectedSyncPromise(SENTRY_BUFFER_FULL_ERROR); + } + const task = taskProducer(); + buffer.add(task); + void task.then( + () => remove(task), + () => remove(task) + ); + return task; + } + function drain(timeout) { + if (!buffer.size) { + return syncpromise.resolvedSyncPromise(true); + } + const drainPromise = Promise.allSettled(Array.from(buffer)).then(() => true); + if (!timeout) { + return drainPromise; + } + const promises = [ + drainPromise, + new Promise((resolve) => timer.safeUnref(setTimeout(() => resolve(false), timeout))) + ]; + return Promise.race(promises); + } return { - $: buffer, + get $() { + return Array.from(buffer); + }, add, - drain, + drain }; } +exports.SENTRY_BUFFER_FULL_ERROR = SENTRY_BUFFER_FULL_ERROR; exports.makePromiseBuffer = makePromiseBuffer; //# sourceMappingURL=promisebuffer.js.map /***/ }), -/***/ 37264: +/***/ 95102: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const misc = __nccwpck_require__(3181); +const misc = __nccwpck_require__(52619); -/** - * Returns a new minimal propagation context. - * - * @deprecated Use `generateTraceId` and `generateSpanId` instead. - */ -function generatePropagationContext() { - return { - traceId: generateTraceId(), - spanId: generateSpanId(), - }; -} - -/** - * Generate a random, valid trace ID. - */ function generateTraceId() { return misc.uuid4(); } - -/** - * Generate a random, valid span ID. - */ function generateSpanId() { return misc.uuid4().substring(16); } -exports.generatePropagationContext = generatePropagationContext; exports.generateSpanId = generateSpanId; exports.generateTraceId = generateTraceId; //# sourceMappingURL=propagationContext.js.map @@ -79070,98 +39027,84 @@ exports.generateTraceId = generateTraceId; /***/ }), -/***/ 78922: -/***/ ((__unused_webpack_module, exports) => { +/***/ 28695: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend +const worldwide = __nccwpck_require__(90935); -const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds +let RESOLVED_RUNNER; +function withRandomSafeContext(cb) { + if (RESOLVED_RUNNER !== void 0) { + return RESOLVED_RUNNER ? RESOLVED_RUNNER(cb) : cb(); + } + const sym = /* @__PURE__ */ Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"); + const globalWithSymbol = worldwide.GLOBAL_OBJ; + if (sym in globalWithSymbol && typeof globalWithSymbol[sym] === "function") { + RESOLVED_RUNNER = globalWithSymbol[sym]; + return RESOLVED_RUNNER(cb); + } + RESOLVED_RUNNER = null; + return cb(); +} +function safeMathRandom() { + return withRandomSafeContext(() => Math.random()); +} +function safeDateNow() { + return withRandomSafeContext(() => Date.now()); +} -/** - * Extracts Retry-After value from the request header or returns default value - * @param header string representation of 'Retry-After' header - * @param now current unix timestamp - * - */ -function parseRetryAfterHeader(header, now = Date.now()) { +exports.safeDateNow = safeDateNow; +exports.safeMathRandom = safeMathRandom; +exports.withRandomSafeContext = withRandomSafeContext; +//# sourceMappingURL=randomSafeContext.js.map + + +/***/ }), + +/***/ 6928: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const randomSafeContext = __nccwpck_require__(28695); + +const DEFAULT_RETRY_AFTER = 60 * 1e3; +function parseRetryAfterHeader(header, now = randomSafeContext.safeDateNow()) { const headerDelay = parseInt(`${header}`, 10); if (!isNaN(headerDelay)) { - return headerDelay * 1000; + return headerDelay * 1e3; } - const headerDate = Date.parse(`${header}`); if (!isNaN(headerDate)) { return headerDate - now; } - return DEFAULT_RETRY_AFTER; } - -/** - * Gets the time that the given category is disabled until for rate limiting. - * In case no category-specific limit is set but a general rate limit across all categories is active, - * that time is returned. - * - * @return the time in ms that the category is disabled until or 0 if there's no active rate limit. - */ function disabledUntil(limits, dataCategory) { return limits[dataCategory] || limits.all || 0; } - -/** - * Checks if a category is rate limited - */ -function isRateLimited(limits, dataCategory, now = Date.now()) { +function isRateLimited(limits, dataCategory, now = randomSafeContext.safeDateNow()) { return disabledUntil(limits, dataCategory) > now; } - -/** - * Update ratelimits from incoming headers. - * - * @return the updated RateLimits object. - */ -function updateRateLimits( - limits, - { statusCode, headers }, - now = Date.now(), -) { +function updateRateLimits(limits, { statusCode, headers }, now = randomSafeContext.safeDateNow()) { const updatedRateLimits = { - ...limits, + ...limits }; - - // "The name is case-insensitive." - // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get - const rateLimitHeader = headers && headers['x-sentry-rate-limits']; - const retryAfterHeader = headers && headers['retry-after']; - + const rateLimitHeader = headers?.["x-sentry-rate-limits"]; + const retryAfterHeader = headers?.["retry-after"]; if (rateLimitHeader) { - /** - * rate limit headers are of the form - *

,
,.. - * where each
is of the form - * : : : : - * where - * is a delay in seconds - * is the event type(s) (error, transaction, etc) being rate limited and is of the form - * ;;... - * is what's being limited (org, project, or key) - ignored by SDK - * is an arbitrary string like "org_quota" - ignored by SDK - * Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected. - * Only present if rate limit applies to the metric_bucket data category. - */ - for (const limit of rateLimitHeader.trim().split(',')) { - const [retryAfter, categories, , , namespaces] = limit.split(':', 5) ; + for (const limit of rateLimitHeader.trim().split(",")) { + const [retryAfter, categories, , , namespaces] = limit.split(":", 5); const headerDelay = parseInt(retryAfter, 10); - const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default + const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1e3; if (!categories) { updatedRateLimits.all = now + delay; } else { - for (const category of categories.split(';')) { - if (category === 'metric_bucket') { - // namespaces will be present when category === 'metric_bucket' - if (!namespaces || namespaces.split(';').includes('custom')) { + for (const category of categories.split(";")) { + if (category === "metric_bucket") { + if (!namespaces || namespaces.split(";").includes("custom")) { updatedRateLimits[category] = now + delay; } } else { @@ -79173,9 +39116,8 @@ function updateRateLimits( } else if (retryAfterHeader) { updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); } else if (statusCode === 429) { - updatedRateLimits.all = now + 60 * 1000; + updatedRateLimits.all = now + 60 * 1e3; } - return updatedRateLimits; } @@ -79189,1951 +39131,273 @@ exports.updateRateLimits = updateRateLimits; /***/ }), -/***/ 4630: +/***/ 82141: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const cookie = __nccwpck_require__(49298); -const debugBuild = __nccwpck_require__(87038); -const is = __nccwpck_require__(84085); -const logger = __nccwpck_require__(38752); -const normalize = __nccwpck_require__(65543); -const object = __nccwpck_require__(16100); -const string = __nccwpck_require__(93529); -const url = __nccwpck_require__(44673); -const getIpAddress = __nccwpck_require__(51395); +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const defaultPiiToCollectionOptions = __nccwpck_require__(21340); +const filteringSnippets = __nccwpck_require__(25681); +const filterKeyValueData = __nccwpck_require__(88468); +const timer = __nccwpck_require__(85548); -const DEFAULT_INCLUDES = { - ip: false, - request: true, - user: true, -}; -const DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url']; -const DEFAULT_USER_INCLUDES = ['id', 'username', 'email']; - -/** - * Options deciding what parts of the request to use when enhancing an event - */ - -/** - * Extracts a complete and parameterized path from the request object and uses it to construct transaction name. - * If the parameterized transaction name cannot be extracted, we fall back to the raw URL. - * - * Additionally, this function determines and returns the transaction name source - * - * eg. GET /mountpoint/user/:id - * - * @param req A request object - * @param options What to include in the transaction name (method, path, or a custom route name to be - * used instead of the request's route) - * - * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url') - * @deprecated This method will be removed in v9. It is not in use anymore. - */ -function extractPathForTransaction( - req, - options = {}, -) { - const method = req.method && req.method.toUpperCase(); - - let path = ''; - let source = 'url'; - - // Check to see if there's a parameterized route we can use (as there is in Express) - if (options.customRoute || req.route) { - path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`; - source = 'route'; - } - - // Otherwise, just take the original URL - else if (req.originalUrl || req.url) { - path = url.stripUrlQueryAndFragment(req.originalUrl || req.url || ''); - } - - let name = ''; - if (options.method && method) { - name += method; - } - if (options.method && options.path) { - name += ' '; - } - if (options.path && path) { - name += path; - } - - return [name, source]; +const MAX_BODY_BYTE_LENGTH = 1024 * 1024; +const TEXT_CONTENT_TYPES = [ + "text/", + "application/json", + "application/x-www-form-urlencoded", + "application/xml", + "application/graphql" +]; +function getMaxBodyByteLength(maxRequestBodySize) { + if (maxRequestBodySize === "small") return 1e3; + if (maxRequestBodySize === "medium") return 1e4; + return MAX_BODY_BYTE_LENGTH; } - -function extractUserData( - user - -, - keys, -) { - const extractedUser = {}; - const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES; - - attributes.forEach(key => { - if (user && key in user) { - extractedUser[key] = user[key]; - } - }); - - return extractedUser; -} - -/** - * Normalize data from the request object, accounting for framework differences. - * - * @param req The request object from which to extract data - * @param options.include An optional array of keys to include in the normalized data. Defaults to - * DEFAULT_REQUEST_INCLUDES if not provided. - * @param options.deps Injected, platform-specific dependencies - * @returns An object containing normalized request data - * - * @deprecated Instead manually normalize the request data into a format that fits `addNormalizedRequestDataToEvent`. - */ -function extractRequestData( - req, - options - - = {}, -) { - const { include = DEFAULT_REQUEST_INCLUDES } = options; - const requestData = {}; - - // headers: - // node, express, koa, nextjs: req.headers - const headers = (req.headers || {}) - -; - // method: - // node, express, koa, nextjs: req.method - const method = req.method; - // host: - // express: req.hostname in > 4 and req.host in < 4 - // koa: req.host - // node, nextjs: req.headers.host - // Express 4 mistakenly strips off port number from req.host / req.hostname so we can't rely on them - // See: https://github.com/expressjs/express/issues/3047#issuecomment-236653223 - // Also: https://github.com/getsentry/sentry-javascript/issues/1917 - const host = headers.host || req.hostname || req.host || ''; - // protocol: - // node, nextjs: - // express, koa: req.protocol - const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http'; - // url (including path and query string): - // node, express: req.originalUrl - // koa, nextjs: req.url - const originalUrl = req.originalUrl || req.url || ''; - // absolute url - const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`; - include.forEach(key => { - switch (key) { - case 'headers': { - requestData.headers = headers; - - // Remove the Cookie header in case cookie data should not be included in the event - if (!include.includes('cookies')) { - delete (requestData.headers ).cookie; - } - - // Remove IP headers in case IP data should not be included in the event - if (!include.includes('ip')) { - getIpAddress.ipHeaderNames.forEach(ipHeaderName => { - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - delete (requestData.headers )[ipHeaderName]; - }); - } - - break; - } - case 'method': { - requestData.method = method; - break; - } - case 'url': { - requestData.url = absoluteUrl; - break; - } - case 'cookies': { - // cookies: - // node, express, koa: req.headers.cookie - // vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies - requestData.cookies = - // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can - // come off in v8 - req.cookies || (headers.cookie && cookie.parseCookie(headers.cookie)) || {}; - break; - } - case 'query_string': { - // query string: - // node: req.url (raw) - // express, koa, nextjs: req.query - requestData.query_string = extractQueryParams(req); - break; - } - case 'data': { - if (method === 'GET' || method === 'HEAD') { - break; - } - // NOTE: As of v8, request is (unless a user sets this manually) ALWAYS a http request - // Which does not have a body by default - // However, in our http instrumentation, we patch the request to capture the body and store it on the - // request as `.body` anyhow - // In v9, we may update requestData to only work with plain http requests - // body data: - // express, koa, nextjs: req.body - // - // when using node by itself, you have to read the incoming stream(see - // https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know - // where they're going to store the final result, so they'll have to capture this data themselves - const body = req.body; - if (body !== undefined) { - const stringBody = is.isString(body) - ? body - : is.isPlainObject(body) - ? JSON.stringify(normalize.normalize(body)) - : string.truncate(`${body}`, 1024); - if (stringBody) { - requestData.data = stringBody; - } - } - break; - } - default: { - if ({}.hasOwnProperty.call(req, key)) { - requestData[key] = (req )[key]; - } - } - } - }); - - return requestData; -} - -/** - * Add already normalized request data to an event. - * This mutates the passed in event. - */ -function addNormalizedRequestDataToEvent( - event, - req, - // This is non-standard data that is not part of the regular HTTP request - additionalData, - options, -) { - const include = { - ...DEFAULT_INCLUDES, - ...(options && options.include), - }; - - if (include.request) { - const includeRequest = Array.isArray(include.request) ? [...include.request] : [...DEFAULT_REQUEST_INCLUDES]; - if (include.ip) { - includeRequest.push('ip'); - } - - const extractedRequestData = extractNormalizedRequestData(req, { include: includeRequest }); - - event.request = { - ...event.request, - ...extractedRequestData, - }; - } - - if (include.user) { - const extractedUser = - additionalData.user && is.isPlainObject(additionalData.user) - ? extractUserData(additionalData.user, include.user) - : {}; - - if (Object.keys(extractedUser).length) { - event.user = { - ...extractedUser, - ...event.user, - }; - } - } - - if (include.ip) { - const ip = (req.headers && getIpAddress.getClientIPAddress(req.headers)) || additionalData.ipAddress; - if (ip) { - event.user = { - ...event.user, - ip_address: ip, - }; - } - } -} - -/** - * Add data from the given request to the given event - * - * @param event The event to which the request data will be added - * @param req Request object - * @param options.include Flags to control what data is included - * @param options.deps Injected platform-specific dependencies - * @returns The mutated `Event` object - * - * @deprecated Use `addNormalizedRequestDataToEvent` instead. - */ -function addRequestDataToEvent( - event, - req, - options, -) { - const include = { - ...DEFAULT_INCLUDES, - ...(options && options.include), - }; - - if (include.request) { - const includeRequest = Array.isArray(include.request) ? [...include.request] : [...DEFAULT_REQUEST_INCLUDES]; - if (include.ip) { - includeRequest.push('ip'); - } - - // eslint-disable-next-line deprecation/deprecation - const extractedRequestData = extractRequestData(req, { include: includeRequest }); - - event.request = { - ...event.request, - ...extractedRequestData, - }; - } - - if (include.user) { - const extractedUser = req.user && is.isPlainObject(req.user) ? extractUserData(req.user, include.user) : {}; - - if (Object.keys(extractedUser).length) { - event.user = { - ...event.user, - ...extractedUser, - }; - } - } - - // client ip: - // node, nextjs: req.socket.remoteAddress - // express, koa: req.ip - // It may also be sent by proxies as specified in X-Forwarded-For or similar headers - if (include.ip) { - const ip = (req.headers && getIpAddress.getClientIPAddress(req.headers)) || req.ip || (req.socket && req.socket.remoteAddress); - if (ip) { - event.user = { - ...event.user, - ip_address: ip, - }; - } - } - - return event; -} - -function extractQueryParams(req) { - // url (including path and query string): - // node, express: req.originalUrl - // koa, nextjs: req.url - let originalUrl = req.originalUrl || req.url || ''; - - if (!originalUrl) { - return; - } - - // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and - // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use. - if (originalUrl.startsWith('/')) { - originalUrl = `http://dogs.are.great${originalUrl}`; - } - - try { - const queryParams = req.query || new URL(originalUrl).search.slice(1); - return queryParams.length ? queryParams : undefined; - } catch (e2) { - return undefined; - } -} - -/** - * Transforms a `Headers` object that implements the `Web Fetch API` (https://developer.mozilla.org/en-US/docs/Web/API/Headers) into a simple key-value dict. - * The header keys will be lower case: e.g. A "Content-Type" header will be stored as "content-type". - */ -// TODO(v8): Make this function return undefined when the extraction fails. function winterCGHeadersToDict(winterCGHeaders) { const headers = {}; try { winterCGHeaders.forEach((value, key) => { - if (typeof value === 'string') { - // We check that value is a string even though it might be redundant to make sure prototype pollution is not possible. + if (typeof value === "string") { headers[key] = value; } }); - } catch (e) { - debugBuild.DEBUG_BUILD && - logger.logger.warn('Sentry failed extracting headers from a request object. If you see this, please file an issue.'); + } catch { } - return headers; } - -/** - * Convert common request headers to a simple dictionary. - */ function headersToDict(reqHeaders) { - const headers = Object.create(null); - + const headers = /* @__PURE__ */ Object.create(null); try { Object.entries(reqHeaders).forEach(([key, value]) => { - if (typeof value === 'string') { + if (typeof value === "string") { headers[key] = value; + } else if (typeof value === "number") { + headers[key] = String(value); } }); - } catch (e) { - debugBuild.DEBUG_BUILD && - logger.logger.warn('Sentry failed extracting headers from a request object. If you see this, please file an issue.'); + } catch { } - return headers; } - -/** - * Converts a `Request` object that implements the `Web Fetch API` (https://developer.mozilla.org/en-US/docs/Web/API/Headers) into the format that the `RequestData` integration understands. - */ function winterCGRequestToRequestData(req) { const headers = winterCGHeadersToDict(req.headers); - return { method: req.method, url: req.url, query_string: extractQueryParamsFromUrl(req.url), - headers, + headers // TODO: Can we extract body data from the request? }; } - -/** - * Convert a HTTP request object to RequestEventData to be passed as normalizedRequest. - * Instead of allowing `PolymorphicRequest` to be passed, - * we want to be more specific and generally require a http.IncomingMessage-like object. - */ -function httpRequestToRequestData(request - -) { +function isTextualContentType(contentType) { + if (!contentType) { + return false; + } + const lowerContentType = contentType.toLowerCase(); + return TEXT_CONTENT_TYPES.some((type) => lowerContentType.includes(type)); +} +async function captureBodyFromWinterCGRequest(request, isolationScope, maxRequestBodySize) { + try { + const contentType = request.headers.get("content-type"); + if (!isTextualContentType(contentType)) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Skipping body capture for non-textual content type:", contentType); + return; + } + if (!request.body) { + return; + } + const contentLength = request.headers.get("content-length"); + const maxBodySize = getMaxBodyByteLength(maxRequestBodySize); + if (contentLength) { + const length = parseInt(contentLength, 10); + if (!isNaN(length) && length > MAX_BODY_BYTE_LENGTH) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Skipping body capture: body too large", length); + return; + } + } + const clonedRequest = request.clone(); + const bodyPromise = clonedRequest.text(); + const timeoutPromise = new Promise((resolve) => { + timer.safeUnref(setTimeout(() => resolve(null), 2e3)); + }); + const body = await Promise.race([bodyPromise, timeoutPromise]); + if (body === null) { + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Timeout reading request body"); + return; + } + if (!body) { + return; + } + const encoder = new TextEncoder(); + const bytes = encoder.encode(body); + const bodyByteLength = bytes.length; + let truncatedBody; + if (bodyByteLength > maxBodySize) { + const decoder = new TextDecoder(); + truncatedBody = `${decoder.decode(bytes.slice(0, maxBodySize - 3))}...`; + } else { + truncatedBody = body; + } + isolationScope.setSDKProcessingMetadata({ normalizedRequest: { data: truncatedBody } }); + debugBuild.DEBUG_BUILD && debugLogger.debug.log("Captured request body:", bodyByteLength, "bytes"); + } catch (error) { + debugBuild.DEBUG_BUILD && debugLogger.debug.error("Error capturing request body:", error); + } +} +function httpRequestToRequestData(request) { const headers = request.headers || {}; - const host = headers.host || ''; - const protocol = request.socket && (request.socket ).encrypted ? 'https' : 'http'; - const originalUrl = request.url || ''; - const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`; - - // This is non-standard, but may be sometimes set - // It may be overwritten later by our own body handling - const data = (request ).body || undefined; - - // This is non-standard, but may be set on e.g. Next.js or Express requests - const cookies = (request ).cookies; - - return object.dropUndefinedKeys({ + const forwardedHost = typeof headers["x-forwarded-host"] === "string" ? headers["x-forwarded-host"] : void 0; + const host = forwardedHost || (typeof headers.host === "string" ? headers.host : void 0); + const forwardedProto = typeof headers["x-forwarded-proto"] === "string" ? headers["x-forwarded-proto"] : void 0; + const protocol = forwardedProto || request.protocol || (request.socket?.encrypted ? "https" : "http"); + const url = request.url || ""; + const absoluteUrl = getAbsoluteUrl({ + url, + host, + protocol + }); + const data = request.body || void 0; + const cookies = request.cookies; + return { url: absoluteUrl, method: request.method, - query_string: extractQueryParamsFromUrl(originalUrl), + query_string: extractQueryParamsFromUrl(url), headers: headersToDict(headers), cookies, - data, - }); + data + }; +} +function getAbsoluteUrl({ + url, + protocol, + host +}) { + if (url?.startsWith("http")) { + return url; + } + if (url && host) { + return `${protocol}://${host}${url}`; + } + return void 0; +} +function httpHeadersToSpanAttributes(headers, dataCollection = false, lifecycle = "request") { + const resolvedDataCollection = typeof dataCollection === "boolean" ? defaultPiiToCollectionOptions.defaultPiiToCollectionOptions(dataCollection) : dataCollection; + const headerBehavior = lifecycle === "request" ? resolvedDataCollection.httpHeaders.request : resolvedDataCollection.httpHeaders.response; + const cookieBehavior = resolvedDataCollection.cookies; + const prefix = `http.${lifecycle}.header.`; + const spanAttributes = {}; + try { + const regularHeaders = {}; + for (const [key, value] of Object.entries(headers)) { + if (value == null) { + continue; + } + const lowerKey = key.toLowerCase(); + const isCookieHeader = lowerKey === "cookie" || lowerKey === "set-cookie"; + if (isCookieHeader) { + if (cookieBehavior === false) { + continue; + } + if (typeof value === "string" && value !== "") { + const parsed = parseCookieHeader(value, lowerKey === "set-cookie"); + const filtered = filterKeyValueData.filterKeyValueData(parsed, cookieBehavior, filteringSnippets.SENSITIVE_COOKIE_NAME_SNIPPETS); + for (const [cookieKey, cookieValue] of Object.entries(filtered)) { + spanAttributes[`${prefix}${normalizeAttributeKey(lowerKey)}.${normalizeAttributeKey(cookieKey)}`] = cookieValue; + } + } else { + spanAttributes[`${prefix}${normalizeAttributeKey(lowerKey)}`] = filteringSnippets.FILTERED_VALUE; + } + } else { + if (headerBehavior === false) { + continue; + } + if (Array.isArray(value)) { + regularHeaders[lowerKey] = value.map((v) => v != null ? String(v) : v).join(";"); + } else if (typeof value === "string") { + regularHeaders[lowerKey] = value; + } + } + } + if (headerBehavior !== false) { + const filtered = filterKeyValueData.filterKeyValueData(regularHeaders, headerBehavior); + for (const [headerKey, headerValue] of Object.entries(filtered)) { + spanAttributes[`${prefix}${normalizeAttributeKey(headerKey)}`] = headerValue; + } + } + } catch { + } + return spanAttributes; +} +function normalizeAttributeKey(key) { + return key.replace(/-/g, "_"); +} +function parseCookieHeader(value, isSetCookie) { + const semicolonIndex = value.indexOf(";"); + const cookieString = isSetCookie && semicolonIndex !== -1 ? value.substring(0, semicolonIndex) : value; + const cookies = isSetCookie ? [cookieString] : cookieString.split("; "); + const result = {}; + for (const cookie of cookies) { + const equalSignIndex = cookie.indexOf("="); + const cookieKey = (equalSignIndex !== -1 ? cookie.substring(0, equalSignIndex) : cookie).toLowerCase(); + const cookieValue = equalSignIndex !== -1 ? cookie.substring(equalSignIndex + 1) : ""; + result[cookieKey] = cookieValue; + } + return result; } - -/** Extract the query params from an URL. */ function extractQueryParamsFromUrl(url) { - // url is path and query string if (!url) { return; } - try { - // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and - // hostname as the base. Since the point here is just to grab the query string, it doesn't matter what we use. - const queryParams = new URL(url, 'http://dogs.are.great').search.slice(1); - return queryParams.length ? queryParams : undefined; - } catch (e3) { - return undefined; + const queryParams = new URL(url, "http://s.io").search.slice(1); + return queryParams.length ? queryParams : void 0; + } catch { + return void 0; } } -function extractNormalizedRequestData( - normalizedRequest, - { include }, -) { - const includeKeys = include ? (Array.isArray(include) ? include : DEFAULT_REQUEST_INCLUDES) : []; - - const requestData = {}; - const headers = { ...normalizedRequest.headers }; - - if (includeKeys.includes('headers')) { - requestData.headers = headers; - - // Remove the Cookie header in case cookie data should not be included in the event - if (!include.includes('cookies')) { - delete (headers ).cookie; - } - - // Remove IP headers in case IP data should not be included in the event - if (!include.includes('ip')) { - getIpAddress.ipHeaderNames.forEach(ipHeaderName => { - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - delete (headers )[ipHeaderName]; - }); - } - } - - if (includeKeys.includes('method')) { - requestData.method = normalizedRequest.method; - } - - if (includeKeys.includes('url')) { - requestData.url = normalizedRequest.url; - } - - if (includeKeys.includes('cookies')) { - const cookies = normalizedRequest.cookies || (headers && headers.cookie ? cookie.parseCookie(headers.cookie) : undefined); - requestData.cookies = cookies || {}; - } - - if (includeKeys.includes('query_string')) { - requestData.query_string = normalizedRequest.query_string; - } - - if (includeKeys.includes('data')) { - requestData.data = normalizedRequest.data; - } - - return requestData; -} - -exports.DEFAULT_USER_INCLUDES = DEFAULT_USER_INCLUDES; -exports.addNormalizedRequestDataToEvent = addNormalizedRequestDataToEvent; -exports.addRequestDataToEvent = addRequestDataToEvent; -exports.extractPathForTransaction = extractPathForTransaction; +exports.MAX_BODY_BYTE_LENGTH = MAX_BODY_BYTE_LENGTH; +exports.captureBodyFromWinterCGRequest = captureBodyFromWinterCGRequest; exports.extractQueryParamsFromUrl = extractQueryParamsFromUrl; -exports.extractRequestData = extractRequestData; +exports.getMaxBodyByteLength = getMaxBodyByteLength; exports.headersToDict = headersToDict; +exports.httpHeadersToSpanAttributes = httpHeadersToSpanAttributes; exports.httpRequestToRequestData = httpRequestToRequestData; exports.winterCGHeadersToDict = winterCGHeadersToDict; exports.winterCGRequestToRequestData = winterCGRequestToRequestData; -//# sourceMappingURL=requestdata.js.map +//# sourceMappingURL=request.js.map /***/ }), -/***/ 25753: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * @deprecated This variable has been deprecated and will be removed in the next major version. - */ -const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug']; - -/** - * Converts a string-based level into a `SeverityLevel`, normalizing it along the way. - * - * @param level String representation of desired `SeverityLevel`. - * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level. - */ -function severityLevelFromString(level) { - return ( - level === 'warn' ? 'warning' : ['fatal', 'error', 'warning', 'log', 'info', 'debug'].includes(level) ? level : 'log' - ) ; -} - -exports.severityLevelFromString = severityLevelFromString; -exports.validSeverityLevels = validSeverityLevels; -//# sourceMappingURL=severity.js.map - - -/***/ }), - -/***/ 85820: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const STACKTRACE_FRAME_LIMIT = 50; -const UNKNOWN_FUNCTION = '?'; -// Used to sanitize webpack (error: *) wrapped stack errors -const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; -const STRIP_FRAME_REGEXP = /captureMessage|captureException/; - -/** - * Creates a stack parser with the supplied line parsers - * - * StackFrames are returned in the correct order for Sentry Exception - * frames and with Sentry SDK internal frames removed from the top and bottom - * - */ -function createStackParser(...parsers) { - const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]); - - return (stack, skipFirstLines = 0, framesToPop = 0) => { - const frames = []; - const lines = stack.split('\n'); - - for (let i = skipFirstLines; i < lines.length; i++) { - const line = lines[i] ; - // Ignore lines over 1kb as they are unlikely to be stack frames. - // Many of the regular expressions use backtracking which results in run time that increases exponentially with - // input size. Huge strings can result in hangs/Denial of Service: - // https://github.com/getsentry/sentry-javascript/issues/2286 - if (line.length > 1024) { - continue; - } - - // https://github.com/getsentry/sentry-javascript/issues/5459 - // Remove webpack (error: *) wrappers - const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line; - - // https://github.com/getsentry/sentry-javascript/issues/7813 - // Skip Error: lines - if (cleanedLine.match(/\S*Error: /)) { - continue; - } - - for (const parser of sortedParsers) { - const frame = parser(cleanedLine); - - if (frame) { - frames.push(frame); - break; - } - } - - if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) { - break; - } - } - - return stripSentryFramesAndReverse(frames.slice(framesToPop)); - }; -} - -/** - * Gets a stack parser implementation from Options.stackParser - * @see Options - * - * If options contains an array of line parsers, it is converted into a parser - */ -function stackParserFromStackParserOptions(stackParser) { - if (Array.isArray(stackParser)) { - return createStackParser(...stackParser); - } - return stackParser; -} - -/** - * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames. - * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the - * function that caused the crash is the last frame in the array. - * @hidden - */ -function stripSentryFramesAndReverse(stack) { - if (!stack.length) { - return []; - } - - const localStack = Array.from(stack); - - // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call) - if (/sentryWrapped/.test(getLastStackFrame(localStack).function || '')) { - localStack.pop(); - } - - // Reversing in the middle of the procedure allows us to just pop the values off the stack - localStack.reverse(); - - // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call) - if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || '')) { - localStack.pop(); - - // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')` - // is produced within the hub itself, making it: - // - // Sentry.captureException() - // getCurrentHub().captureException() - // - // instead of just the top `Sentry` call itself. - // This forces us to possibly strip an additional frame in the exact same was as above. - if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || '')) { - localStack.pop(); - } - } - - return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({ - ...frame, - filename: frame.filename || getLastStackFrame(localStack).filename, - function: frame.function || UNKNOWN_FUNCTION, - })); -} - -function getLastStackFrame(arr) { - return arr[arr.length - 1] || {}; -} - -const defaultFunctionName = ''; - -/** - * Safely extract function name from itself - */ -function getFunctionName(fn) { - try { - if (!fn || typeof fn !== 'function') { - return defaultFunctionName; - } - return fn.name || defaultFunctionName; - } catch (e) { - // Just accessing custom props in some Selenium environments - // can cause a "Permission denied" exception (see raven-js#495). - return defaultFunctionName; - } -} - -/** - * Get's stack frames from an event without needing to check for undefined properties. - */ -function getFramesFromEvent(event) { - const exception = event.exception; - - if (exception) { - const frames = []; - try { - // @ts-expect-error Object could be undefined - exception.values.forEach(value => { - // @ts-expect-error Value could be undefined - if (value.stacktrace.frames) { - // @ts-expect-error Value could be undefined - frames.push(...value.stacktrace.frames); - } - }); - return frames; - } catch (_oO) { - return undefined; - } - } - return undefined; -} - -exports.UNKNOWN_FUNCTION = UNKNOWN_FUNCTION; -exports.createStackParser = createStackParser; -exports.getFramesFromEvent = getFramesFromEvent; -exports.getFunctionName = getFunctionName; -exports.stackParserFromStackParserOptions = stackParserFromStackParserOptions; -exports.stripSentryFramesAndReverse = stripSentryFramesAndReverse; -//# sourceMappingURL=stacktrace.js.map - - -/***/ }), - -/***/ 93529: +/***/ 72332: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const is = __nccwpck_require__(84085); - -/** - * Truncates given string to the maximum characters count - * - * @param str An object that contains serializable values - * @param max Maximum number of characters in truncated string (0 = unlimited) - * @returns string Encoded - */ -function truncate(str, max = 0) { - if (typeof str !== 'string' || max === 0) { - return str; - } - return str.length <= max ? str : `${str.slice(0, max)}...`; -} - -/** - * This is basically just `trim_line` from - * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67 - * - * @param str An object that contains serializable values - * @param max Maximum number of characters in truncated string - * @returns string Encoded - */ -function snipLine(line, colno) { - let newLine = line; - const lineLength = newLine.length; - if (lineLength <= 150) { - return newLine; - } - if (colno > lineLength) { - // eslint-disable-next-line no-param-reassign - colno = lineLength; - } - - let start = Math.max(colno - 60, 0); - if (start < 5) { - start = 0; - } - - let end = Math.min(start + 140, lineLength); - if (end > lineLength - 5) { - end = lineLength; - } - if (end === lineLength) { - start = Math.max(end - 140, 0); - } - - newLine = newLine.slice(start, end); - if (start > 0) { - newLine = `'{snip} ${newLine}`; - } - if (end < lineLength) { - newLine += ' {snip}'; - } - - return newLine; -} - -/** - * Join values in array - * @param input array of values to be joined together - * @param delimiter string to be placed in-between values - * @returns Joined values - */ -function safeJoin(input, delimiter) { - if (!Array.isArray(input)) { - return ''; - } - - const output = []; - // eslint-disable-next-line @typescript-eslint/prefer-for-of - for (let i = 0; i < input.length; i++) { - const value = input[i]; - try { - // This is a hack to fix a Vue3-specific bug that causes an infinite loop of - // console warnings. This happens when a Vue template is rendered with - // an undeclared variable, which we try to stringify, ultimately causing - // Vue to issue another warning which repeats indefinitely. - // see: https://github.com/getsentry/sentry-javascript/pull/8981 - if (is.isVueViewModel(value)) { - output.push('[VueViewModel]'); - } else { - output.push(String(value)); - } - } catch (e) { - output.push('[value cannot be serialized]'); - } - } - - return output.join(delimiter); -} - -/** - * Checks if the given value matches a regex or string - * - * @param value The string to test - * @param pattern Either a regex or a string against which `value` will be matched - * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match - * `pattern` if it contains `pattern`. Only applies to string-type patterns. - */ -function isMatchingPattern( - value, - pattern, - requireExactStringMatch = false, -) { - if (!is.isString(value)) { - return false; - } - - if (is.isRegExp(pattern)) { - return pattern.test(value); - } - if (is.isString(pattern)) { - return requireExactStringMatch ? value === pattern : value.includes(pattern); - } - - return false; -} - -/** - * Test the given string against an array of strings and regexes. By default, string matching is done on a - * substring-inclusion basis rather than a strict equality basis - * - * @param testString The string to test - * @param patterns The patterns against which to test the string - * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to - * count. If false, `testString` will match a string pattern if it contains that pattern. - * @returns - */ -function stringMatchesSomePattern( - testString, - patterns = [], - requireExactStringMatch = false, -) { - return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch)); -} - -exports.isMatchingPattern = isMatchingPattern; -exports.safeJoin = safeJoin; -exports.snipLine = snipLine; -exports.stringMatchesSomePattern = stringMatchesSomePattern; -exports.truncate = truncate; -//# sourceMappingURL=string.js.map - - -/***/ }), - -/***/ 73872: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const debugBuild = __nccwpck_require__(87038); -const logger = __nccwpck_require__(38752); -const worldwide = __nccwpck_require__(10891); - -const WINDOW = worldwide.GLOBAL_OBJ ; - -/** - * Tells whether current environment supports ErrorEvent objects - * {@link supportsErrorEvent}. - * - * @returns Answer to the given question. - */ -function supportsErrorEvent() { - try { - new ErrorEvent(''); - return true; - } catch (e) { - return false; - } -} - -/** - * Tells whether current environment supports DOMError objects - * {@link supportsDOMError}. - * - * @returns Answer to the given question. - */ -function supportsDOMError() { - try { - // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError': - // 1 argument required, but only 0 present. - // @ts-expect-error It really needs 1 argument, not 0. - new DOMError(''); - return true; - } catch (e) { - return false; - } -} - -/** - * Tells whether current environment supports DOMException objects - * {@link supportsDOMException}. - * - * @returns Answer to the given question. - */ -function supportsDOMException() { - try { - new DOMException(''); - return true; - } catch (e) { - return false; - } -} - -/** - * Tells whether current environment supports Fetch API - * {@link supportsFetch}. - * - * @returns Answer to the given question. - */ -function supportsFetch() { - if (!('fetch' in WINDOW)) { - return false; - } - - try { - new Headers(); - new Request('http://www.example.com'); - new Response(); - return true; - } catch (e) { - return false; - } -} - -/** - * isNative checks if the given function is a native implementation - */ -// eslint-disable-next-line @typescript-eslint/ban-types -function isNativeFunction(func) { - return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); -} - -/** - * Tells whether current environment supports Fetch API natively - * {@link supportsNativeFetch}. - * - * @returns true if `window.fetch` is natively implemented, false otherwise - */ -function supportsNativeFetch() { - if (typeof EdgeRuntime === 'string') { - return true; - } - - if (!supportsFetch()) { - return false; - } - - // Fast path to avoid DOM I/O - // eslint-disable-next-line @typescript-eslint/unbound-method - if (isNativeFunction(WINDOW.fetch)) { - return true; - } - - // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension) - // so create a "pure" iframe to see if that has native fetch - let result = false; - const doc = WINDOW.document; - // eslint-disable-next-line deprecation/deprecation - if (doc && typeof (doc.createElement ) === 'function') { - try { - const sandbox = doc.createElement('iframe'); - sandbox.hidden = true; - doc.head.appendChild(sandbox); - if (sandbox.contentWindow && sandbox.contentWindow.fetch) { - // eslint-disable-next-line @typescript-eslint/unbound-method - result = isNativeFunction(sandbox.contentWindow.fetch); - } - doc.head.removeChild(sandbox); - } catch (err) { - debugBuild.DEBUG_BUILD && - logger.logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err); - } - } - - return result; -} - -/** - * Tells whether current environment supports ReportingObserver API - * {@link supportsReportingObserver}. - * - * @returns Answer to the given question. - */ -function supportsReportingObserver() { - return 'ReportingObserver' in WINDOW; -} - -/** - * Tells whether current environment supports Referrer Policy API - * {@link supportsReferrerPolicy}. - * - * @returns Answer to the given question. - */ -function supportsReferrerPolicy() { - // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default' - // (see https://caniuse.com/#feat=referrer-policy), - // it doesn't. And it throws an exception instead of ignoring this parameter... - // REF: https://github.com/getsentry/raven-js/issues/1233 - - if (!supportsFetch()) { - return false; - } - - try { - new Request('_', { - referrerPolicy: 'origin' , - }); - return true; - } catch (e) { - return false; - } -} - -exports.isNativeFunction = isNativeFunction; -exports.supportsDOMError = supportsDOMError; -exports.supportsDOMException = supportsDOMException; -exports.supportsErrorEvent = supportsErrorEvent; -exports.supportsFetch = supportsFetch; -exports.supportsNativeFetch = supportsNativeFetch; -exports.supportsReferrerPolicy = supportsReferrerPolicy; -exports.supportsReportingObserver = supportsReportingObserver; -//# sourceMappingURL=supports.js.map - - -/***/ }), - -/***/ 15621: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const is = __nccwpck_require__(84085); - -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable @typescript-eslint/no-explicit-any */ - -/** SyncPromise internal states */ -var States; (function (States) { - /** Pending */ - const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING"; - /** Resolved / OK */ - const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED"; - /** Rejected / Error */ - const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED"; -})(States || (States = {})); - -// Overloads so we can call resolvedSyncPromise without arguments and generic argument - -/** - * Creates a resolved sync promise. - * - * @param value the value to resolve the promise with - * @returns the resolved sync promise - */ -function resolvedSyncPromise(value) { - return new SyncPromise(resolve => { - resolve(value); - }); -} - -/** - * Creates a rejected sync promise. - * - * @param value the value to reject the promise with - * @returns the rejected sync promise - */ -function rejectedSyncPromise(reason) { - return new SyncPromise((_, reject) => { - reject(reason); - }); -} - -/** - * Thenable class that behaves like a Promise and follows it's interface - * but is not async internally - */ -class SyncPromise { - - constructor( - executor, - ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this); - this._state = States.PENDING; - this._handlers = []; - - try { - executor(this._resolve, this._reject); - } catch (e) { - this._reject(e); - } - } - - /** JSDoc */ - then( - onfulfilled, - onrejected, - ) { - return new SyncPromise((resolve, reject) => { - this._handlers.push([ - false, - result => { - if (!onfulfilled) { - // TODO: ¯\_(ツ)_/¯ - // TODO: FIXME - resolve(result ); - } else { - try { - resolve(onfulfilled(result)); - } catch (e) { - reject(e); - } - } - }, - reason => { - if (!onrejected) { - reject(reason); - } else { - try { - resolve(onrejected(reason)); - } catch (e) { - reject(e); - } - } - }, - ]); - this._executeHandlers(); - }); - } - - /** JSDoc */ - catch( - onrejected, - ) { - return this.then(val => val, onrejected); - } - - /** JSDoc */ - finally(onfinally) { - return new SyncPromise((resolve, reject) => { - let val; - let isRejected; - - return this.then( - value => { - isRejected = false; - val = value; - if (onfinally) { - onfinally(); - } - }, - reason => { - isRejected = true; - val = reason; - if (onfinally) { - onfinally(); - } - }, - ).then(() => { - if (isRejected) { - reject(val); - return; - } - - resolve(val ); - }); - }); - } - - /** JSDoc */ - __init() {this._resolve = (value) => { - this._setResult(States.RESOLVED, value); - };} - - /** JSDoc */ - __init2() {this._reject = (reason) => { - this._setResult(States.REJECTED, reason); - };} - - /** JSDoc */ - __init3() {this._setResult = (state, value) => { - if (this._state !== States.PENDING) { - return; - } - - if (is.isThenable(value)) { - void (value ).then(this._resolve, this._reject); - return; - } - - this._state = state; - this._value = value; - - this._executeHandlers(); - };} - - /** JSDoc */ - __init4() {this._executeHandlers = () => { - if (this._state === States.PENDING) { - return; - } - - const cachedHandlers = this._handlers.slice(); - this._handlers = []; - - cachedHandlers.forEach(handler => { - if (handler[0]) { - return; - } - - if (this._state === States.RESOLVED) { - handler[1](this._value ); - } - - if (this._state === States.REJECTED) { - handler[2](this._value); - } - - handler[0] = true; - }); - };} -} - -exports.SyncPromise = SyncPromise; -exports.rejectedSyncPromise = rejectedSyncPromise; -exports.resolvedSyncPromise = resolvedSyncPromise; -//# sourceMappingURL=syncpromise.js.map - - -/***/ }), - -/***/ 75872: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const worldwide = __nccwpck_require__(10891); - -const ONE_SECOND_IN_MS = 1000; - -/** - * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance} - * for accessing a high-resolution monotonic clock. - */ - -/** - * Returns a timestamp in seconds since the UNIX epoch using the Date API. - * - * TODO(v8): Return type should be rounded. - */ -function dateTimestampInSeconds() { - return Date.now() / ONE_SECOND_IN_MS; -} - -/** - * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not - * support the API. - * - * Wrapping the native API works around differences in behavior from different browsers. - */ -function createUnixTimestampInSecondsFunc() { - const { performance } = worldwide.GLOBAL_OBJ ; - if (!performance || !performance.now) { - return dateTimestampInSeconds; - } - - // Some browser and environments don't have a timeOrigin, so we fallback to - // using Date.now() to compute the starting time. - const approxStartingTimeOrigin = Date.now() - performance.now(); - const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin; - - // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current - // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed. - // - // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the - // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and - // correct for this. - // See: https://github.com/getsentry/sentry-javascript/issues/2590 - // See: https://github.com/mdn/content/issues/4713 - // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6 - return () => { - return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS; - }; -} - -/** - * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the - * availability of the Performance API. - * - * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is - * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The - * skew can grow to arbitrary amounts like days, weeks or months. - * See https://github.com/getsentry/sentry-javascript/issues/2590. - */ -const timestampInSeconds = createUnixTimestampInSecondsFunc(); - -/** - * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only. - * - * @deprecated This variable will be removed in the next major version. - */ -exports._browserPerformanceTimeOriginMode = void 0; - -/** - * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the - * performance API is available. - */ -const browserPerformanceTimeOrigin = (() => { - // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or - // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin - // data as reliable if they are within a reasonable threshold of the current time. - - const { performance } = worldwide.GLOBAL_OBJ ; - if (!performance || !performance.now) { - // eslint-disable-next-line deprecation/deprecation - exports._browserPerformanceTimeOriginMode = 'none'; - return undefined; - } - - const threshold = 3600 * 1000; - const performanceNow = performance.now(); - const dateNow = Date.now(); - - // if timeOrigin isn't available set delta to threshold so it isn't used - const timeOriginDelta = performance.timeOrigin - ? Math.abs(performance.timeOrigin + performanceNow - dateNow) - : threshold; - const timeOriginIsReliable = timeOriginDelta < threshold; - - // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin - // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. - // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always - // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the - // Date API. - // eslint-disable-next-line deprecation/deprecation - const navigationStart = performance.timing && performance.timing.navigationStart; - const hasNavigationStart = typeof navigationStart === 'number'; - // if navigationStart isn't available set delta to threshold so it isn't used - const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; - const navigationStartIsReliable = navigationStartDelta < threshold; - - if (timeOriginIsReliable || navigationStartIsReliable) { - // Use the more reliable time origin - if (timeOriginDelta <= navigationStartDelta) { - // eslint-disable-next-line deprecation/deprecation - exports._browserPerformanceTimeOriginMode = 'timeOrigin'; - return performance.timeOrigin; - } else { - // eslint-disable-next-line deprecation/deprecation - exports._browserPerformanceTimeOriginMode = 'navigationStart'; - return navigationStart; - } - } - - // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date. - // eslint-disable-next-line deprecation/deprecation - exports._browserPerformanceTimeOriginMode = 'dateNow'; - return dateNow; -})(); - -exports.browserPerformanceTimeOrigin = browserPerformanceTimeOrigin; -exports.dateTimestampInSeconds = dateTimestampInSeconds; -exports.timestampInSeconds = timestampInSeconds; -//# sourceMappingURL=time.js.map - - -/***/ }), - -/***/ 15977: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const baggage = __nccwpck_require__(86741); -const propagationContext = __nccwpck_require__(37264); - -// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor -- RegExp is used for readability here -const TRACEPARENT_REGEXP = new RegExp( - '^[ \\t]*' + // whitespace - '([0-9a-f]{32})?' + // trace_id - '-?([0-9a-f]{16})?' + // span_id - '-?([01])?' + // sampled - '[ \\t]*$', // whitespace -); - -/** - * Extract transaction context data from a `sentry-trace` header. - * - * @param traceparent Traceparent string - * - * @returns Object containing data from the header, or undefined if traceparent string is malformed - */ -function extractTraceparentData(traceparent) { - if (!traceparent) { - return undefined; - } - - const matches = traceparent.match(TRACEPARENT_REGEXP); - if (!matches) { - return undefined; - } - - let parentSampled; - if (matches[3] === '1') { - parentSampled = true; - } else if (matches[3] === '0') { - parentSampled = false; - } - - return { - traceId: matches[1], - parentSampled, - parentSpanId: matches[2], - }; -} - -/** - * Create a propagation context from incoming headers or - * creates a minimal new one if the headers are undefined. - */ -function propagationContextFromHeaders( - sentryTrace, - baggage$1, -) { - const traceparentData = extractTraceparentData(sentryTrace); - const dynamicSamplingContext = baggage.baggageHeaderToDynamicSamplingContext(baggage$1); - - if (!traceparentData || !traceparentData.traceId) { - return { traceId: propagationContext.generateTraceId(), spanId: propagationContext.generateSpanId() }; - } - - const { traceId, parentSpanId, parentSampled } = traceparentData; - - const virtualSpanId = propagationContext.generateSpanId(); - - return { - traceId, - parentSpanId, - spanId: virtualSpanId, - sampled: parentSampled, - dsc: dynamicSamplingContext || {}, // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it - }; -} - -/** - * Create sentry-trace header from span context values. - */ -function generateSentryTraceHeader( - traceId = propagationContext.generateTraceId(), - spanId = propagationContext.generateSpanId(), - sampled, -) { - let sampledString = ''; - if (sampled !== undefined) { - sampledString = sampled ? '-1' : '-0'; - } - return `${traceId}-${spanId}${sampledString}`; -} - -exports.TRACEPARENT_REGEXP = TRACEPARENT_REGEXP; -exports.extractTraceparentData = extractTraceparentData; -exports.generateSentryTraceHeader = generateSentryTraceHeader; -exports.propagationContextFromHeaders = propagationContextFromHeaders; -//# sourceMappingURL=tracing.js.map - - -/***/ }), - -/***/ 44673: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * Parses string form of URL into an object - * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B - * // intentionally using regex and not href parsing trick because React Native and other - * // environments where DOM might not be available - * @returns parsed URL object - */ -function parseUrl(url) { - if (!url) { - return {}; - } - - const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); - - if (!match) { - return {}; - } - - // coerce to undefined values to empty string so we don't get 'undefined' - const query = match[6] || ''; - const fragment = match[8] || ''; - return { - host: match[4], - path: match[5], - protocol: match[2], - search: query, - hash: fragment, - relative: match[5] + query + fragment, // everything minus origin - }; -} - -/** - * Strip the query string and fragment off of a given URL or path (if present) - * - * @param urlPath Full URL or path, including possible query string and/or fragment - * @returns URL or path without query string or fragment - */ -function stripUrlQueryAndFragment(urlPath) { - return (urlPath.split(/[?#]/, 1) )[0]; -} - -/** - * Returns number of URL segments of a passed string URL. - * - * @deprecated This function will be removed in the next major version. - */ -// TODO(v9): Hoist this function into the places where we use it. (as it stands only react router v6 instrumentation) -function getNumberOfUrlSegments(url) { - // split at '/' or at '\/' to split regex urls correctly - return url.split(/\\?\//).filter(s => s.length > 0 && s !== ',').length; -} - -/** - * Takes a URL object and returns a sanitized string which is safe to use as span name - * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data - */ -function getSanitizedUrlString(url) { - const { protocol, host, path } = url; - - const filteredHost = - (host && - host - // Always filter out authority - .replace(/^.*@/, '[filtered]:[filtered]@') - // Don't show standard :80 (http) and :443 (https) ports to reduce the noise - // TODO: Use new URL global if it exists - .replace(/(:80)$/, '') - .replace(/(:443)$/, '')) || - ''; - - return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`; -} - -exports.getNumberOfUrlSegments = getNumberOfUrlSegments; -exports.getSanitizedUrlString = getSanitizedUrlString; -exports.parseUrl = parseUrl; -exports.stripUrlQueryAndFragment = stripUrlQueryAndFragment; -//# sourceMappingURL=url.js.map - - -/***/ }), - -/***/ 20677: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -// Based on https://github.com/sindresorhus/escape-string-regexp but with modifications to: -// a) reduce the size by skipping the runtime type - checking -// b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 14+). -// -// MIT License -// -// Copyright (c) Sindre Sorhus (https://sindresorhus.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files(the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and -// to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of -// the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. - -/** - * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to - * `new RegExp()`. - * - * @param regexString The string to escape - * @returns An version of the string with all special regex characters escaped - */ -function escapeStringForRegex(regexString) { - // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems - // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20. - return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'); -} - -exports.escapeStringForRegex = escapeStringForRegex; -//# sourceMappingURL=escapeStringForRegex.js.map - - -/***/ }), - -/***/ 51395: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -// Vendored / modified from @sergiodxa/remix-utils - -// https://github.com/sergiodxa/remix-utils/blob/02af80e12829a53696bfa8f3c2363975cf59f55e/src/server/get-client-ip-address.ts -// MIT License - -// Copyright (c) 2021 Sergio Xalambrí - -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// The headers to check, in priority order -const ipHeaderNames = [ - 'X-Client-IP', - 'X-Forwarded-For', - 'Fly-Client-IP', - 'CF-Connecting-IP', - 'Fastly-Client-Ip', - 'True-Client-Ip', - 'X-Real-IP', - 'X-Cluster-Client-IP', - 'X-Forwarded', - 'Forwarded-For', - 'Forwarded', - 'X-Vercel-Forwarded-For', -]; - -/** - * Get the IP address of the client sending a request. - * - * It receives a Request headers object and use it to get the - * IP address from one of the following headers in order. - * - * If the IP address is valid, it will be returned. Otherwise, null will be - * returned. - * - * If the header values contains more than one IP address, the first valid one - * will be returned. - */ -function getClientIPAddress(headers) { - // This will end up being Array because of the various possible values a header - // can take - const headerValues = ipHeaderNames.map((headerName) => { - const rawValue = headers[headerName]; - const value = Array.isArray(rawValue) ? rawValue.join(';') : rawValue; - - if (headerName === 'Forwarded') { - return parseForwardedHeader(value); - } - - return value && value.split(',').map((v) => v.trim()); - }); - - // Flatten the array and filter out any falsy entries - const flattenedHeaderValues = headerValues.reduce((acc, val) => { - if (!val) { - return acc; - } - - return acc.concat(val); - }, []); - - // Find the first value which is a valid IP address, if any - const ipAddress = flattenedHeaderValues.find(ip => ip !== null && isIP(ip)); - - return ipAddress || null; -} - -function parseForwardedHeader(value) { - if (!value) { - return null; - } - - for (const part of value.split(';')) { - if (part.startsWith('for=')) { - return part.slice(4); - } - } - - return null; -} - -// -/** - * Custom method instead of importing this from `net` package, as this only exists in node - * Accepts: - * 127.0.0.1 - * 192.168.1.1 - * 192.168.1.255 - * 255.255.255.255 - * 10.1.1.1 - * 0.0.0.0 - * 2b01:cb19:8350:ed00:d0dd:fa5b:de31:8be5 - * - * Rejects: - * 1.1.1.01 - * 30.168.1.255.1 - * 127.1 - * 192.168.1.256 - * -1.2.3.4 - * 1.1.1.1. - * 3...3 - * 192.168.1.099 - */ -function isIP(str) { - const regex = - /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/; - return regex.test(str); -} - -exports.getClientIPAddress = getClientIPAddress; -exports.ipHeaderNames = ipHeaderNames; -//# sourceMappingURL=getIpAddress.js.map - - -/***/ }), - -/***/ 86017: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const worldwide = __nccwpck_require__(10891); - -// Based on https://github.com/angular/angular.js/pull/13945/files -// The MIT License - - -const WINDOW = worldwide.GLOBAL_OBJ ; - -/** - * Tells whether current environment supports History API - * {@link supportsHistory}. - * - * @returns Answer to the given question. - */ -function supportsHistory() { - // NOTE: in Chrome App environment, touching history.pushState, *even inside - // a try/catch block*, will cause Chrome to output an error to console.error - // borrowed from: https://github.com/angular/angular.js/pull/13945/files - // TODO(v9): Remove this custom check, it is pretty old and likely not needed anymore - const chromeVar = (WINDOW ).chrome; - const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime; - const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState; - - return !isChromePackagedApp && hasHistoryApi; -} - -exports.supportsHistory = supportsHistory; -//# sourceMappingURL=supportsHistory.js.map - - -/***/ }), - -/***/ 77437: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const worldwide = __nccwpck_require__(10891); - -/** - * Function that delays closing of a Vercel lambda until the provided promise is resolved. - * - * Vendored from https://www.npmjs.com/package/@vercel/functions - */ -function vercelWaitUntil(task) { - const vercelRequestContextGlobal = - // @ts-expect-error This is not typed - worldwide.GLOBAL_OBJ[Symbol.for('@vercel/request-context')]; - - const ctx = - vercelRequestContextGlobal && vercelRequestContextGlobal.get && vercelRequestContextGlobal.get() - ? vercelRequestContextGlobal.get() - : {}; - - if (ctx && ctx.waitUntil) { - ctx.waitUntil(task); - } -} - -exports.vercelWaitUntil = vercelWaitUntil; -//# sourceMappingURL=vercelWaitUntil.js.map - - -/***/ }), - -/***/ 17370: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -// This is a magic string replaced by rollup - -const SDK_VERSION = "8.54.0" ; - -exports.SDK_VERSION = SDK_VERSION; -//# sourceMappingURL=version.js.map - - -/***/ }), - -/***/ 10891: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const version = __nccwpck_require__(17370); - -/** Get's the global object for the current JavaScript runtime */ -const GLOBAL_OBJ = globalThis ; - -/** - * Returns a global singleton contained in the global `__SENTRY__[]` object. - * - * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory - * function and added to the `__SENTRY__` object. - * - * @param name name of the global singleton on __SENTRY__ - * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__` - * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value - * @returns the singleton - */ -function getGlobalSingleton(name, creator, obj) { - const gbl = (obj || GLOBAL_OBJ) ; - const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {}); - const versionedCarrier = (__SENTRY__[version.SDK_VERSION] = __SENTRY__[version.SDK_VERSION] || {}); - return versionedCarrier[name] || (versionedCarrier[name] = creator()); -} - -exports.GLOBAL_OBJ = GLOBAL_OBJ; -exports.getGlobalSingleton = getGlobalSingleton; -//# sourceMappingURL=worldwide.js.map - - -/***/ }), - -/***/ 87359: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const currentScopes = __nccwpck_require__(8131); const dynamicSamplingContext = __nccwpck_require__(29724); -const object = __nccwpck_require__(16100); const merge = __nccwpck_require__(32003); const spanUtils = __nccwpck_require__(47569); -/** - * Applies data from the scope to the event and runs all event processors on it. - */ function applyScopeDataToEvent(event, data) { const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data; - - // Apply general data applyDataToEvent(event, data); - - // We want to set the trace context for normal events only if there isn't already - // a trace context on the event. There is a product feature in place where we link - // errors with transaction and it relies on that. if (span) { applySpanToEvent(event, span); } - applyFingerprintToEvent(event, fingerprint); applyBreadcrumbsToEvent(event, breadcrumbs); applySdkMetadataToEvent(event, sdkProcessingMetadata); } - -/** Merge data of two scopes together. */ function mergeScopeData(data, mergeData) { const { extra, tags, + attributes, user, contexts, level, @@ -81144,821 +39408,107 @@ function mergeScopeData(data, mergeData) { attachments, propagationContext, transactionName, - span, + span } = mergeData; - - mergeAndOverwriteScopeData(data, 'extra', extra); - mergeAndOverwriteScopeData(data, 'tags', tags); - mergeAndOverwriteScopeData(data, 'user', user); - mergeAndOverwriteScopeData(data, 'contexts', contexts); - + mergeAndOverwriteScopeData(data, "extra", extra); + mergeAndOverwriteScopeData(data, "tags", tags); + mergeAndOverwriteScopeData(data, "attributes", attributes); + mergeAndOverwriteScopeData(data, "user", user); + mergeAndOverwriteScopeData(data, "contexts", contexts); data.sdkProcessingMetadata = merge.merge(data.sdkProcessingMetadata, sdkProcessingMetadata, 2); - if (level) { data.level = level; } - if (transactionName) { data.transactionName = transactionName; } - if (span) { data.span = span; } - if (breadcrumbs.length) { data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs]; } - if (fingerprint.length) { data.fingerprint = [...data.fingerprint, ...fingerprint]; } - if (eventProcessors.length) { data.eventProcessors = [...data.eventProcessors, ...eventProcessors]; } - if (attachments.length) { data.attachments = [...data.attachments, ...attachments]; } - data.propagationContext = { ...data.propagationContext, ...propagationContext }; } - -/** - * Merges certain scope data. Undefined values will overwrite any existing values. - * Exported only for tests. - */ -function mergeAndOverwriteScopeData - -(data, prop, mergeVal) { +function mergeAndOverwriteScopeData(data, prop, mergeVal) { data[prop] = merge.merge(data[prop], mergeVal, 1); } - +function getCombinedScopeData(isolationScope, currentScope) { + const scopeData = currentScopes.getGlobalScope().getScopeData(); + isolationScope && mergeScopeData(scopeData, isolationScope.getScopeData()); + currentScope && mergeScopeData(scopeData, currentScope.getScopeData()); + return scopeData; +} function applyDataToEvent(event, data) { const { extra, tags, user, contexts, level, transactionName } = data; - - const cleanedExtra = object.dropUndefinedKeys(extra); - if (cleanedExtra && Object.keys(cleanedExtra).length) { - event.extra = { ...cleanedExtra, ...event.extra }; + if (Object.keys(extra).length) { + event.extra = { ...extra, ...event.extra }; } - - const cleanedTags = object.dropUndefinedKeys(tags); - if (cleanedTags && Object.keys(cleanedTags).length) { - event.tags = { ...cleanedTags, ...event.tags }; + if (Object.keys(tags).length) { + event.tags = { ...tags, ...event.tags }; } - - const cleanedUser = object.dropUndefinedKeys(user); - if (cleanedUser && Object.keys(cleanedUser).length) { - event.user = { ...cleanedUser, ...event.user }; + if (Object.keys(user).length) { + event.user = { ...user, ...event.user }; } - - const cleanedContexts = object.dropUndefinedKeys(contexts); - if (cleanedContexts && Object.keys(cleanedContexts).length) { - event.contexts = { ...cleanedContexts, ...event.contexts }; + if (Object.keys(contexts).length) { + event.contexts = { ...contexts, ...event.contexts }; } - if (level) { event.level = level; } - - // transaction events get their `transaction` from the root span name - if (transactionName && event.type !== 'transaction') { + if (transactionName && event.type !== "transaction") { event.transaction = transactionName; } } - function applyBreadcrumbsToEvent(event, breadcrumbs) { - const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs]; - event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined; + const mergedBreadcrumbs = [...event.breadcrumbs || [], ...breadcrumbs]; + event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : void 0; } - function applySdkMetadataToEvent(event, sdkProcessingMetadata) { event.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, - ...sdkProcessingMetadata, + ...sdkProcessingMetadata }; } - function applySpanToEvent(event, span) { event.contexts = { trace: spanUtils.spanToTraceContext(span), - ...event.contexts, + ...event.contexts }; - event.sdkProcessingMetadata = { dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(span), - ...event.sdkProcessingMetadata, + ...event.sdkProcessingMetadata }; - const rootSpan = spanUtils.getRootSpan(span); const transactionName = spanUtils.spanToJSON(rootSpan).description; - if (transactionName && !event.transaction && event.type === 'transaction') { + if (transactionName && !event.transaction && event.type === "transaction") { event.transaction = transactionName; } } - -/** - * Applies fingerprint from the scope to the event if there's one, - * uses message if there's one instead or get rid of empty fingerprint - */ function applyFingerprintToEvent(event, fingerprint) { - // Make sure it's an array first and we actually have something in place - event.fingerprint = event.fingerprint - ? Array.isArray(event.fingerprint) - ? event.fingerprint - : [event.fingerprint] - : []; - - // If we have something on the scope, then merge it with event + event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : []; if (fingerprint) { event.fingerprint = event.fingerprint.concat(fingerprint); } - - // If we have no data at all, remove empty array default - if (event.fingerprint && !event.fingerprint.length) { + if (!event.fingerprint.length) { delete event.fingerprint; } } exports.applyScopeDataToEvent = applyScopeDataToEvent; +exports.getCombinedScopeData = getCombinedScopeData; exports.mergeAndOverwriteScopeData = mergeAndOverwriteScopeData; exports.mergeScopeData = mergeScopeData; -//# sourceMappingURL=applyScopeDataToEvent.js.map - - -/***/ }), - -/***/ 77864: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const is = __nccwpck_require__(84085); - -/** - * Wrap a callback function with error handling. - * If an error is thrown, it will be passed to the `onError` callback and re-thrown. - * - * If the return value of the function is a promise, it will be handled with `maybeHandlePromiseRejection`. - * - * If an `onFinally` callback is provided, this will be called when the callback has finished - * - so if it returns a promise, once the promise resolved/rejected, - * else once the callback has finished executing. - * The `onFinally` callback will _always_ be called, no matter if an error was thrown or not. - */ -function handleCallbackErrors - -( - fn, - onError, - // eslint-disable-next-line @typescript-eslint/no-empty-function - onFinally = () => {}, -) { - let maybePromiseResult; - try { - maybePromiseResult = fn(); - } catch (e) { - onError(e); - onFinally(); - throw e; - } - - return maybeHandlePromiseRejection(maybePromiseResult, onError, onFinally); -} - -/** - * Maybe handle a promise rejection. - * This expects to be given a value that _may_ be a promise, or any other value. - * If it is a promise, and it rejects, it will call the `onError` callback. - * Other than this, it will generally return the given value as-is. - */ -function maybeHandlePromiseRejection( - value, - onError, - onFinally, -) { - if (is.isThenable(value)) { - // @ts-expect-error - the isThenable check returns the "wrong" type here - return value.then( - res => { - onFinally(); - return res; - }, - e => { - onError(e); - onFinally(); - throw e; - }, - ); - } - - onFinally(); - return value; -} - -exports.handleCallbackErrors = handleCallbackErrors; -//# sourceMappingURL=handleCallbackErrors.js.map - - -/***/ }), - -/***/ 79223: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const currentScopes = __nccwpck_require__(8131); - -// Treeshakable guard to remove all code related to tracing - -/** - * Determines if tracing is currently enabled. - * - * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config. - */ -function hasTracingEnabled( - maybeOptions, -) { - if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) { - return false; - } - - const client = currentScopes.getClient(); - const options = maybeOptions || (client && client.getOptions()); - // eslint-disable-next-line deprecation/deprecation - return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options); -} - -exports.hasTracingEnabled = hasTracingEnabled; -//# sourceMappingURL=hasTracingEnabled.js.map - - -/***/ }), - -/***/ 2554: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * Checks whether given url points to Sentry server - * - * @param url url to verify - */ -function isSentryRequestUrl(url, client) { - const dsn = client && client.getDsn(); - const tunnel = client && client.getOptions().tunnel; - return checkDsn(url, dsn) || checkTunnel(url, tunnel); -} - -function checkTunnel(url, tunnel) { - if (!tunnel) { - return false; - } - - return removeTrailingSlash(url) === removeTrailingSlash(tunnel); -} - -function checkDsn(url, dsn) { - return dsn ? url.includes(dsn.host) : false; -} - -function removeTrailingSlash(str) { - return str[str.length - 1] === '/' ? str.slice(0, -1) : str; -} - -exports.isSentryRequestUrl = isSentryRequestUrl; -//# sourceMappingURL=isSentryRequestUrl.js.map - - -/***/ }), - -/***/ 32003: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * Shallow merge two objects. - * Does not mutate the passed in objects. - * Undefined/empty values in the merge object will overwrite existing values. - * - * By default, this merges 2 levels deep. - */ -function merge(initialObj, mergeObj, levels = 2) { - // If the merge value is not an object, or we have no merge levels left, - // we just set the value to the merge value - if (!mergeObj || typeof mergeObj !== 'object' || levels <= 0) { - return mergeObj; - } - - // If the merge object is an empty object, and the initial object is not undefined, we return the initial object - if (initialObj && mergeObj && Object.keys(mergeObj).length === 0) { - return initialObj; - } - - // Clone object - const output = { ...initialObj }; - - // Merge values into output, resursively - for (const key in mergeObj) { - if (Object.prototype.hasOwnProperty.call(mergeObj, key)) { - output[key] = merge(output[key], mergeObj[key], levels - 1); - } - } - - return output; -} - -exports.merge = merge; -//# sourceMappingURL=merge.js.map - - -/***/ }), - -/***/ 34314: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const traceData = __nccwpck_require__(7522); - -/** - * Returns a string of meta tags that represent the current trace data. - * - * You can use this to propagate a trace from your server-side rendered Html to the browser. - * This function returns up to two meta tags, `sentry-trace` and `baggage`, depending on the - * current trace data state. - * - * @example - * Usage example: - * - * ```js - * function renderHtml() { - * return ` - * - * ${getTraceMetaTags()} - * - * `; - * } - * ``` - * - */ -function getTraceMetaTags() { - return Object.entries(traceData.getTraceData()) - .map(([key, value]) => ``) - .join('\n'); -} - -exports.getTraceMetaTags = getTraceMetaTags; -//# sourceMappingURL=meta.js.map - - -/***/ }), - -/***/ 32957: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * Tagged template function which returns parameterized representation of the message - * For example: parameterize`This is a log statement with ${x} and ${y} params`, would return: - * "__sentry_template_string__": 'This is a log statement with %s and %s params', - * "__sentry_template_values__": ['first', 'second'] - * @param strings An array of string values splitted between expressions - * @param values Expressions extracted from template string - * @returns String with template information in __sentry_template_string__ and __sentry_template_values__ properties - */ -function parameterize(strings, ...values) { - const formatted = new String(String.raw(strings, ...values)) ; - formatted.__sentry_template_string__ = strings.join('\x00').replace(/%/g, '%%').replace(/\0/g, '%s'); - formatted.__sentry_template_values__ = values; - return formatted; -} - -exports.parameterize = parameterize; -//# sourceMappingURL=parameterize.js.map - - -/***/ }), - -/***/ 54078: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const debugBuild = __nccwpck_require__(14488); -const logger = __nccwpck_require__(38752); - -/** - * Parse a sample rate from a given value. - * This will either return a boolean or number sample rate, if the sample rate is valid (between 0 and 1). - * If a string is passed, we try to convert it to a number. - * - * Any invalid sample rate will return `undefined`. - */ -function parseSampleRate(sampleRate) { - if (typeof sampleRate === 'boolean') { - return Number(sampleRate); - } - - const rate = typeof sampleRate === 'string' ? parseFloat(sampleRate) : sampleRate; - if (typeof rate !== 'number' || isNaN(rate) || rate < 0 || rate > 1) { - debugBuild.DEBUG_BUILD && - logger.logger.warn( - `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify( - sampleRate, - )} of type ${JSON.stringify(typeof sampleRate)}.`, - ); - return undefined; - } - - return rate; -} - -exports.parseSampleRate = parseSampleRate; -//# sourceMappingURL=parseSampleRate.js.map - - -/***/ }), - -/***/ 22264: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const constants = __nccwpck_require__(5958); -const currentScopes = __nccwpck_require__(8131); -const eventProcessors = __nccwpck_require__(45796); -const scope = __nccwpck_require__(49417); -const debugIds = __nccwpck_require__(4263); -const misc = __nccwpck_require__(3181); -const normalize = __nccwpck_require__(65543); -const string = __nccwpck_require__(93529); -const time = __nccwpck_require__(75872); -const applyScopeDataToEvent = __nccwpck_require__(87359); - -/** - * This type makes sure that we get either a CaptureContext, OR an EventHint. - * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed: - * { user: { id: '123' }, mechanism: { handled: false } } - */ - -/** - * Adds common information to events. - * - * The information includes release and environment from `options`, - * breadcrumbs and context (extra, tags and user) from the scope. - * - * Information that is already present in the event is never overwritten. For - * nested objects, such as the context, keys are merged. - * - * @param event The original event. - * @param hint May contain additional information about the original exception. - * @param scope A scope containing event metadata. - * @returns A new event with more information. - * @hidden - */ -function prepareEvent( - options, - event, - hint, - scope, - client, - isolationScope, -) { - const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options; - const prepared = { - ...event, - event_id: event.event_id || hint.event_id || misc.uuid4(), - timestamp: event.timestamp || time.dateTimestampInSeconds(), - }; - const integrations = hint.integrations || options.integrations.map(i => i.name); - - applyClientOptions(prepared, options); - applyIntegrationsMetadata(prepared, integrations); - - if (client) { - client.emit('applyFrameMetadata', event); - } - - // Only put debug IDs onto frames for error events. - if (event.type === undefined) { - applyDebugIds(prepared, options.stackParser); - } - - // If we have scope given to us, use it as the base for further modifications. - // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. - const finalScope = getFinalScope(scope, hint.captureContext); - - if (hint.mechanism) { - misc.addExceptionMechanism(prepared, hint.mechanism); - } - - const clientEventProcessors = client ? client.getEventProcessors() : []; - - // This should be the last thing called, since we want that - // {@link Scope.addEventProcessor} gets the finished prepared event. - // Merge scope data together - const data = currentScopes.getGlobalScope().getScopeData(); - - if (isolationScope) { - const isolationData = isolationScope.getScopeData(); - applyScopeDataToEvent.mergeScopeData(data, isolationData); - } - - if (finalScope) { - const finalScopeData = finalScope.getScopeData(); - applyScopeDataToEvent.mergeScopeData(data, finalScopeData); - } - - const attachments = [...(hint.attachments || []), ...data.attachments]; - if (attachments.length) { - hint.attachments = attachments; - } - - applyScopeDataToEvent.applyScopeDataToEvent(prepared, data); - - const eventProcessors$1 = [ - ...clientEventProcessors, - // Run scope event processors _after_ all other processors - ...data.eventProcessors, - ]; - - const result = eventProcessors.notifyEventProcessors(eventProcessors$1, prepared, hint); - - return result.then(evt => { - if (evt) { - // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified - // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed. - // This should not cause any PII issues, since we're only moving data that is already on the event and not adding - // any new data - applyDebugMeta(evt); - } - - if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { - return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); - } - return evt; - }); -} - -/** - * Enhances event using the client configuration. - * It takes care of all "static" values like environment, release and `dist`, - * as well as truncating overly long values. - * - * Only exported for tests. - * - * @param event event instance to be enhanced - */ -function applyClientOptions(event, options) { - const { environment, release, dist, maxValueLength = 250 } = options; - - // empty strings do not make sense for environment, release, and dist - // so we handle them the same as if they were not provided - event.environment = event.environment || environment || constants.DEFAULT_ENVIRONMENT; - - if (!event.release && release) { - event.release = release; - } - - if (!event.dist && dist) { - event.dist = dist; - } - - if (event.message) { - event.message = string.truncate(event.message, maxValueLength); - } - - const exception = event.exception && event.exception.values && event.exception.values[0]; - if (exception && exception.value) { - exception.value = string.truncate(exception.value, maxValueLength); - } - - const request = event.request; - if (request && request.url) { - request.url = string.truncate(request.url, maxValueLength); - } -} - -/** - * Puts debug IDs into the stack frames of an error event. - */ -function applyDebugIds(event, stackParser) { - // Build a map of filename -> debug_id - const filenameDebugIdMap = debugIds.getFilenameToDebugIdMap(stackParser); - - try { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - event.exception.values.forEach(exception => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - exception.stacktrace.frames.forEach(frame => { - if (filenameDebugIdMap && frame.filename) { - frame.debug_id = filenameDebugIdMap[frame.filename]; - } - }); - }); - } catch (e) { - // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. - } -} - -/** - * Moves debug IDs from the stack frames of an error event into the debug_meta field. - */ -function applyDebugMeta(event) { - // Extract debug IDs and filenames from the stack frames on the event. - const filenameDebugIdMap = {}; - try { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - event.exception.values.forEach(exception => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - exception.stacktrace.frames.forEach(frame => { - if (frame.debug_id) { - if (frame.abs_path) { - filenameDebugIdMap[frame.abs_path] = frame.debug_id; - } else if (frame.filename) { - filenameDebugIdMap[frame.filename] = frame.debug_id; - } - delete frame.debug_id; - } - }); - }); - } catch (e) { - // To save bundle size we're just try catching here instead of checking for the existence of all the different objects. - } - - if (Object.keys(filenameDebugIdMap).length === 0) { - return; - } - - // Fill debug_meta information - event.debug_meta = event.debug_meta || {}; - event.debug_meta.images = event.debug_meta.images || []; - const images = event.debug_meta.images; - Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => { - images.push({ - type: 'sourcemap', - code_file: filename, - debug_id, - }); - }); -} - -/** - * This function adds all used integrations to the SDK info in the event. - * @param event The event that will be filled with all integrations. - */ -function applyIntegrationsMetadata(event, integrationNames) { - if (integrationNames.length > 0) { - event.sdk = event.sdk || {}; - event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames]; - } -} - -/** - * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization. - * Normalized keys: - * - `breadcrumbs.data` - * - `user` - * - `contexts` - * - `extra` - * @param event Event - * @returns Normalized event - */ -function normalizeEvent(event, depth, maxBreadth) { - if (!event) { - return null; - } - - const normalized = { - ...event, - ...(event.breadcrumbs && { - breadcrumbs: event.breadcrumbs.map(b => ({ - ...b, - ...(b.data && { - data: normalize.normalize(b.data, depth, maxBreadth), - }), - })), - }), - ...(event.user && { - user: normalize.normalize(event.user, depth, maxBreadth), - }), - ...(event.contexts && { - contexts: normalize.normalize(event.contexts, depth, maxBreadth), - }), - ...(event.extra && { - extra: normalize.normalize(event.extra, depth, maxBreadth), - }), - }; - - // event.contexts.trace stores information about a Transaction. Similarly, - // event.spans[] stores information about child Spans. Given that a - // Transaction is conceptually a Span, normalization should apply to both - // Transactions and Spans consistently. - // For now the decision is to skip normalization of Transactions and Spans, - // so this block overwrites the normalized event to add back the original - // Transaction information prior to normalization. - if (event.contexts && event.contexts.trace && normalized.contexts) { - normalized.contexts.trace = event.contexts.trace; - - // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it - if (event.contexts.trace.data) { - normalized.contexts.trace.data = normalize.normalize(event.contexts.trace.data, depth, maxBreadth); - } - } - - // event.spans[].data may contain circular/dangerous data so we need to normalize it - if (event.spans) { - normalized.spans = event.spans.map(span => { - return { - ...span, - ...(span.data && { - data: normalize.normalize(span.data, depth, maxBreadth), - }), - }; - }); - } - - // event.contexts.flags (FeatureFlagContext) stores context for our feature - // flag integrations. It has a greater nesting depth than our other typed - // Contexts, so we re-normalize with a fixed depth of 3 here. We do not want - // to skip this in case of conflicting, user-provided context. - if (event.contexts && event.contexts.flags && normalized.contexts) { - normalized.contexts.flags = normalize.normalize(event.contexts.flags, 3, maxBreadth); - } - - return normalized; -} - -function getFinalScope( - scope$1, - captureContext, -) { - if (!captureContext) { - return scope$1; - } - - const finalScope = scope$1 ? scope$1.clone() : new scope.Scope(); - finalScope.update(captureContext); - return finalScope; -} - -/** - * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`. - * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`. - */ -function parseEventHintOrCaptureContext( - hint, -) { - if (!hint) { - return undefined; - } - - // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext - if (hintIsScopeOrFunction(hint)) { - return { captureContext: hint }; - } - - if (hintIsScopeContext(hint)) { - return { - captureContext: hint, - }; - } - - return hint; -} - -function hintIsScopeOrFunction( - hint, -) { - return hint instanceof scope.Scope || typeof hint === 'function'; -} - -const captureContextKeys = [ - 'user', - 'level', - 'extra', - 'contexts', - 'tags', - 'fingerprint', - 'requestSession', - 'propagationContext', -] ; - -function hintIsScopeContext(hint) { - return Object.keys(hint).some(key => captureContextKeys.includes(key )); -} - -exports.applyClientOptions = applyClientOptions; -exports.applyDebugIds = applyDebugIds; -exports.applyDebugMeta = applyDebugMeta; -exports.parseEventHintOrCaptureContext = parseEventHintOrCaptureContext; -exports.prepareEvent = prepareEvent; -//# sourceMappingURL=prepareEvent.js.map +//# sourceMappingURL=scopeData.js.map /***/ }), @@ -81966,74 +39516,133 @@ exports.prepareEvent = prepareEvent; /***/ 24054: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const version = __nccwpck_require__(17370); +const version = __nccwpck_require__(71795); -/** - * A builder for the SDK metadata in the options for the SDK initialization. - * - * Note: This function is identical to `buildMetadata` in Remix and NextJS and SvelteKit. - * We don't extract it for bundle size reasons. - * @see https://github.com/getsentry/sentry-javascript/pull/7404 - * @see https://github.com/getsentry/sentry-javascript/pull/4196 - * - * If you make changes to this function consider updating the others as well. - * - * @param options SDK options object that gets mutated - * @param names list of package names - */ -function applySdkMetadata(options, name, names = [name], source = 'npm') { - const metadata = options._metadata || {}; - - if (!metadata.sdk) { - metadata.sdk = { - name: `sentry.javascript.${name}`, - packages: names.map(name => ({ - name: `${source}:@sentry/${name}`, - version: version.SDK_VERSION, - })), - version: version.SDK_VERSION, - }; +function applySdkMetadata(options, name, names = [name], source = "npm") { + const sdk = (options._metadata = options._metadata || {}).sdk = options._metadata.sdk || {}; + if (!sdk.name) { + sdk.name = `sentry.javascript.${name}`; + sdk.packages = names.map((name2) => ({ + name: `${source}:@sentry/${name2}`, + version: version.SDK_VERSION + })); + sdk.version = version.SDK_VERSION; } - - options._metadata = metadata; } exports.applySdkMetadata = applySdkMetadata; //# sourceMappingURL=sdkMetadata.js.map +/***/ }), + +/***/ 13367: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function severityLevelFromString(level) { + return level === "warn" ? "warning" : ["fatal", "error", "warning", "log", "info", "debug"].includes(level) ? level : "log"; +} + +exports.severityLevelFromString = severityLevelFromString; +//# sourceMappingURL=severity.js.map + + +/***/ }), + +/***/ 65771: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const string = __nccwpck_require__(77673); + +function logIgnoredSpan(droppedSpan) { + debugLogger.debug.log(`Ignoring span ${droppedSpan.op} - ${droppedSpan.description} because it matches \`ignoreSpans\`.`); +} +function shouldIgnoreSpan(span, ignoreSpans) { + if (!ignoreSpans?.length) { + return false; + } + for (const pattern of ignoreSpans) { + if (isStringOrRegExp(pattern)) { + if (span.description && string.isMatchingPattern(span.description, pattern)) { + debugBuild.DEBUG_BUILD && logIgnoredSpan(span); + return true; + } + continue; + } + const hasAttributes = !!pattern.attributes && Object.keys(pattern.attributes).length > 0; + if (!pattern.name && !pattern.op && !hasAttributes) { + continue; + } + const nameMatches = pattern.name ? span.description && string.isMatchingPattern(span.description, pattern.name) : true; + const opMatches = pattern.op ? span.op && string.isMatchingPattern(span.op, pattern.op) : true; + const attrsMatch = pattern.attributes ? Object.entries(pattern.attributes).every( + ([key, valuePattern]) => _matchesAttributeValue(span.attributes?.[key], valuePattern) + ) : true; + if (nameMatches && opMatches && attrsMatch) { + debugBuild.DEBUG_BUILD && logIgnoredSpan(span); + return true; + } + } + return false; +} +function _matchesAttributeValue(actual, pat) { + if (typeof actual === "string" && (typeof pat === "string" || pat instanceof RegExp)) { + return string.isMatchingPattern(actual, pat); + } + if (Array.isArray(actual) && Array.isArray(pat)) { + return actual.length === pat.length && actual.every((v, i) => v === pat[i]); + } + return actual === pat; +} +function reparentChildSpans(spans, dropSpan) { + const droppedSpanParentId = dropSpan.parent_span_id; + const droppedSpanId = dropSpan.span_id; + if (!droppedSpanParentId) { + return; + } + for (const span of spans) { + if (span.parent_span_id === droppedSpanId) { + span.parent_span_id = droppedSpanParentId; + } + } +} +function isStringOrRegExp(value) { + return typeof value === "string" || value instanceof RegExp; +} + +exports.reparentChildSpans = reparentChildSpans; +exports.shouldIgnoreSpan = shouldIgnoreSpan; +//# sourceMappingURL=should-ignore-span.js.map + + /***/ }), /***/ 14379: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const object = __nccwpck_require__(16100); +const object = __nccwpck_require__(5906); +const weakRef = __nccwpck_require__(98981); -const SCOPE_SPAN_FIELD = '_sentrySpan'; - -/** - * Set the active span for a given scope. - * NOTE: This should NOT be used directly, but is only used internally by the trace methods. - */ +const SCOPE_SPAN_FIELD = "_sentrySpan"; function _setSpanForScope(scope, span) { if (span) { - object.addNonEnumerableProperty(scope , SCOPE_SPAN_FIELD, span); + object.addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, weakRef.makeWeakRef(span)); } else { - // eslint-disable-next-line @typescript-eslint/no-dynamic-delete - delete (scope )[SCOPE_SPAN_FIELD]; + delete scope[SCOPE_SPAN_FIELD]; } } - -/** - * Get the active span for a given scope. - * NOTE: This should NOT be used directly, but is only used internally by the trace methods. - */ function _getSpanForScope(scope) { - return scope[SCOPE_SPAN_FIELD]; + return weakRef.derefWeakRef(scope[SCOPE_SPAN_FIELD]); } exports._getSpanForScope = _getSpanForScope; @@ -82046,38 +39655,29 @@ exports._setSpanForScope = _setSpanForScope; /***/ 47569: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const index = __nccwpck_require__(29878); +const attributes = __nccwpck_require__(26925); const carrier = __nccwpck_require__(38080); const currentScopes = __nccwpck_require__(8131); -const metricSummary = __nccwpck_require__(48306); const semanticAttributes = __nccwpck_require__(36827); const spanstatus = __nccwpck_require__(21119); -const logger = __nccwpck_require__(38752); -const object = __nccwpck_require__(16100); -const propagationContext = __nccwpck_require__(37264); -const time = __nccwpck_require__(75872); -const tracing = __nccwpck_require__(15977); +const utils = __nccwpck_require__(77989); +const object = __nccwpck_require__(5906); +const propagationContext = __nccwpck_require__(95102); +const time = __nccwpck_require__(66690); +const tracing = __nccwpck_require__(35606); +const debugLogger = __nccwpck_require__(41772); const spanOnScope = __nccwpck_require__(14379); -// These are aligned with OpenTelemetry trace flags -const TRACE_FLAG_NONE = 0x0; -const TRACE_FLAG_SAMPLED = 0x1; - -// todo(v9): Remove this once we've stopped dropping spans via `beforeSendSpan` +const TRACE_FLAG_NONE = 0; +const TRACE_FLAG_SAMPLED = 1; let hasShownSpanDropWarning = false; - -/** - * Convert a span to a trace context, which can be sent as the `trace` context in an event. - * By default, this will only include trace_id, span_id & parent_span_id. - * If `includeAllData` is true, it will also include data, op, status & origin. - */ function spanToTransactionTraceContext(span) { const { spanId: span_id, traceId: trace_id } = span.spanContext(); - const { data, op, parent_span_id, status, origin } = spanToJSON(span); - - return object.dropUndefinedKeys({ + const { data, op, parent_span_id, status, origin, links } = spanToJSON(span); + return { parent_span_id, span_id, trace_id, @@ -82085,370 +39685,1062 @@ function spanToTransactionTraceContext(span) { op, status, origin, - }); + links + }; } - -/** - * Convert a span to a trace context, which can be sent as the `trace` context in a non-transaction event. - */ function spanToTraceContext(span) { const { spanId, traceId: trace_id, isRemote } = span.spanContext(); - - // If the span is remote, we use a random/virtual span as span_id to the trace context, - // and the remote span as parent_span_id const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id; - const span_id = isRemote ? propagationContext.generateSpanId() : spanId; - - return object.dropUndefinedKeys({ + const scope = utils.getCapturedScopesOnSpan(span).scope; + const span_id = isRemote ? scope?.getPropagationContext().propagationSpanId || propagationContext.generateSpanId() : spanId; + return { parent_span_id, span_id, - trace_id, - }); + trace_id + }; } - -/** - * Convert a Span to a Sentry trace header. - */ function spanToTraceHeader(span) { const { traceId, spanId } = span.spanContext(); const sampled = spanIsSampled(span); return tracing.generateSentryTraceHeader(traceId, spanId, sampled); } - -/** - * Convert a span time input into a timestamp in seconds. - */ +function spanToTraceparentHeader(span) { + const { traceId, spanId } = span.spanContext(); + const sampled = spanIsSampled(span); + return tracing.generateTraceparentHeader(traceId, spanId, sampled); +} +function convertSpanLinksForEnvelope(links) { + if (links && links.length > 0) { + return links.map(({ context: { spanId, traceId, traceFlags, ...restContext }, attributes }) => ({ + span_id: spanId, + trace_id: traceId, + sampled: traceFlags === TRACE_FLAG_SAMPLED, + attributes, + ...restContext + })); + } else { + return void 0; + } +} +function getStreamedSpanLinks(links) { + if (links?.length) { + return links.map(({ context: { spanId, traceId, traceFlags }, attributes }) => ({ + span_id: spanId, + trace_id: traceId, + sampled: traceFlags === TRACE_FLAG_SAMPLED, + attributes + })); + } else { + return void 0; + } +} function spanTimeInputToSeconds(input) { - if (typeof input === 'number') { + if (typeof input === "number") { return ensureTimestampInSeconds(input); } - if (Array.isArray(input)) { - // See {@link HrTime} for the array-based time format return input[0] + input[1] / 1e9; } - if (input instanceof Date) { return ensureTimestampInSeconds(input.getTime()); } - return time.timestampInSeconds(); } - -/** - * Converts a timestamp to second, if it was in milliseconds, or keeps it as second. - */ function ensureTimestampInSeconds(timestamp) { const isMs = timestamp > 9999999999; - return isMs ? timestamp / 1000 : timestamp; + return isMs ? timestamp / 1e3 : timestamp; } - -/** - * Convert a span to a JSON representation. - */ -// Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json). -// This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility. -// And `spanToJSON` needs the Span class from `span.ts` to check here. function spanToJSON(span) { if (spanIsSentrySpan(span)) { return span.getSpanJSON(); } - - try { - const { spanId: span_id, traceId: trace_id } = span.spanContext(); - - // Handle a span from @opentelemetry/sdk-base-trace's `Span` class - if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) { - const { attributes, startTime, name, endTime, parentSpanId, status } = span; - - return object.dropUndefinedKeys({ - span_id, - trace_id, - data: attributes, - description: name, - parent_span_id: parentSpanId, - start_timestamp: spanTimeInputToSeconds(startTime), - // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time - timestamp: spanTimeInputToSeconds(endTime) || undefined, - status: getStatusMessage(status), - op: attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP], - origin: attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] , - _metrics_summary: metricSummary.getMetricSummaryJsonForSpan(span), - }); - } - - // Finally, at least we have `spanContext()`.... + const { spanId: span_id, traceId: trace_id } = span.spanContext(); + if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) { + const { attributes, startTime, name, endTime, status, links } = span; return { span_id, trace_id, + data: attributes, + description: name, + parent_span_id: getOtelParentSpanId(span), + start_timestamp: spanTimeInputToSeconds(startTime), + // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time + timestamp: spanTimeInputToSeconds(endTime) || void 0, + status: getStatusMessage(status), + op: attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP], + origin: attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN], + links: convertSpanLinksForEnvelope(links) }; - } catch (e) { - return {}; } + return { + span_id, + trace_id, + start_timestamp: 0, + data: {} + }; +} +function spanToStreamedSpanJSON(span) { + if (spanIsSentrySpan(span)) { + return span.getStreamedSpanJSON(); + } + const { spanId: span_id, traceId: trace_id } = span.spanContext(); + if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) { + const { attributes, startTime, name, endTime, status, links } = span; + return { + name, + span_id, + trace_id, + parent_span_id: getOtelParentSpanId(span), + start_timestamp: spanTimeInputToSeconds(startTime), + end_timestamp: spanTimeInputToSeconds(endTime), + is_segment: span === INTERNAL_getSegmentSpan(span), + status: getSimpleStatus(status), + attributes: addStatusMessageAttribute(attributes, status), + links: getStreamedSpanLinks(links) + }; + } + return { + span_id, + trace_id, + start_timestamp: 0, + name: "", + end_timestamp: 0, + status: "ok", + is_segment: span === INTERNAL_getSegmentSpan(span) + }; +} +function getOtelParentSpanId(span) { + return "parentSpanId" in span ? span.parentSpanId : "parentSpanContext" in span ? span.parentSpanContext?.spanId : void 0; +} +function streamedSpanJsonToSerializedSpan(spanJson) { + return { + ...spanJson, + attributes: attributes.serializeAttributes(spanJson.attributes), + links: spanJson.links?.map((link) => ({ + ...link, + attributes: attributes.serializeAttributes(link.attributes) + })) + }; } - function spanIsOpenTelemetrySdkTraceBaseSpan(span) { - const castSpan = span ; + const castSpan = span; return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status; } - -/** Exported only for tests. */ - -/** - * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof. - * :( So instead we approximate this by checking if it has the `getSpanJSON` method. - */ function spanIsSentrySpan(span) { - return typeof (span ).getSpanJSON === 'function'; + return typeof span.getSpanJSON === "function"; } - -/** - * Returns true if a span is sampled. - * In most cases, you should just use `span.isRecording()` instead. - * However, this has a slightly different semantic, as it also returns false if the span is finished. - * So in the case where this distinction is important, use this method. - */ function spanIsSampled(span) { - // We align our trace flags with the ones OpenTelemetry use - // So we also check for sampled the same way they do. const { traceFlags } = span.spanContext(); return traceFlags === TRACE_FLAG_SAMPLED; } - -/** Get the status message to use for a JSON representation of a span. */ function getStatusMessage(status) { if (!status || status.code === spanstatus.SPAN_STATUS_UNSET) { - return undefined; + return void 0; } - if (status.code === spanstatus.SPAN_STATUS_OK) { - return 'ok'; + return "ok"; } - - return status.message || 'unknown_error'; + return status.message || "internal_error"; } - -const CHILD_SPANS_FIELD = '_sentryChildSpans'; -const ROOT_SPAN_FIELD = '_sentryRootSpan'; - -/** - * Adds an opaque child span reference to a span. - */ +function getSimpleStatus(status) { + return !status || status.code === spanstatus.SPAN_STATUS_OK || status.code === spanstatus.SPAN_STATUS_UNSET || status.message === "cancelled" ? "ok" : "error"; +} +function addStatusMessageAttribute(attributes, status) { + const statusMessage = getSimpleStatus(status) === "error" ? status?.message : void 0; + return { + ...statusMessage && { [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_STATUS_MESSAGE]: statusMessage }, + ...attributes + }; +} +const CHILD_SPANS_FIELD = "_sentryChildSpans"; +const ROOT_SPAN_FIELD = "_sentryRootSpan"; function addChildSpanToSpan(span, childSpan) { - // We store the root span reference on the child span - // We need this for `getRootSpan()` to work const rootSpan = span[ROOT_SPAN_FIELD] || span; - object.addNonEnumerableProperty(childSpan , ROOT_SPAN_FIELD, rootSpan); - - // We store a list of child spans on the parent span - // We need this for `getSpanDescendants()` to work + object.addNonEnumerableProperty(childSpan, ROOT_SPAN_FIELD, rootSpan); + if (!spanIsSampled(span)) { + return; + } + if (!span.isRecording() && !rootSpan.isRecording()) { + return; + } if (span[CHILD_SPANS_FIELD]) { span[CHILD_SPANS_FIELD].add(childSpan); } else { - object.addNonEnumerableProperty(span, CHILD_SPANS_FIELD, new Set([childSpan])); + object.addNonEnumerableProperty(span, CHILD_SPANS_FIELD, /* @__PURE__ */ new Set([childSpan])); } } - -/** This is only used internally by Idle Spans. */ function removeChildSpanFromSpan(span, childSpan) { if (span[CHILD_SPANS_FIELD]) { span[CHILD_SPANS_FIELD].delete(childSpan); } } - -/** - * Returns an array of the given span and all of its descendants. - */ function getSpanDescendants(span) { - const resultSet = new Set(); - - function addSpanChildren(span) { - // This exit condition is required to not infinitely loop in case of a circular dependency. - if (resultSet.has(span)) { + const resultSet = /* @__PURE__ */ new Set(); + function addSpanChildren(span2) { + if (resultSet.has(span2)) { return; - // We want to ignore unsampled spans (e.g. non recording spans) - } else if (spanIsSampled(span)) { - resultSet.add(span); - const childSpans = span[CHILD_SPANS_FIELD] ? Array.from(span[CHILD_SPANS_FIELD]) : []; + } else if (spanIsSampled(span2)) { + resultSet.add(span2); + const childSpans = span2[CHILD_SPANS_FIELD] ? Array.from(span2[CHILD_SPANS_FIELD]) : []; for (const childSpan of childSpans) { addSpanChildren(childSpan); } } } - addSpanChildren(span); - return Array.from(resultSet); } - -/** - * Returns the root span of a given span. - */ -function getRootSpan(span) { +const getRootSpan = INTERNAL_getSegmentSpan; +function INTERNAL_getSegmentSpan(span) { return span[ROOT_SPAN_FIELD] || span; } - -/** - * Returns the currently active span. - */ function getActiveSpan() { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); if (acs.getActiveSpan) { return acs.getActiveSpan(); } - return spanOnScope._getSpanForScope(currentScopes.getCurrentScope()); } - -/** - * Updates the metric summary on the currently active span - */ -function updateMetricSummaryOnActiveSpan( - metricType, - sanitizedName, - value, - unit, - tags, - bucketKey, -) { - const span = getActiveSpan(); - if (span) { - metricSummary.updateMetricSummaryOnSpan(span, metricType, sanitizedName, value, unit, tags, bucketKey); - } -} - -/** - * Logs a warning once if `beforeSendSpan` is used to drop spans. - * - * todo(v9): Remove this once we've stopped dropping spans via `beforeSendSpan`. - */ function showSpanDropWarning() { if (!hasShownSpanDropWarning) { - logger.consoleSandbox(() => { - // eslint-disable-next-line no-console + debugLogger.consoleSandbox(() => { console.warn( - '[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.', + "[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`." ); }); hasShownSpanDropWarning = true; } } - -/** - * Updates the name of the given span and ensures that the span name is not - * overwritten by the Sentry SDK. - * - * Use this function instead of `span.updateName()` if you want to make sure that - * your name is kept. For some spans, for example root `http.server` spans the - * Sentry SDK would otherwise overwrite the span name with a high-quality name - * it infers when the span ends. - * - * Use this function in server code or when your span is started on the server - * and on the client (browser). If you only update a span name on the client, - * you can also use `span.updateName()` the SDK does not overwrite the name. - * - * @param span - The span to update the name of. - * @param name - The name to set on the span. - */ function updateSpanName(span, name) { span.updateName(name); span.setAttributes({ - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'custom', - [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: name, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom", + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: name }); } +exports.INTERNAL_getSegmentSpan = INTERNAL_getSegmentSpan; exports.TRACE_FLAG_NONE = TRACE_FLAG_NONE; exports.TRACE_FLAG_SAMPLED = TRACE_FLAG_SAMPLED; exports.addChildSpanToSpan = addChildSpanToSpan; +exports.addStatusMessageAttribute = addStatusMessageAttribute; +exports.convertSpanLinksForEnvelope = convertSpanLinksForEnvelope; exports.getActiveSpan = getActiveSpan; exports.getRootSpan = getRootSpan; +exports.getSimpleStatus = getSimpleStatus; exports.getSpanDescendants = getSpanDescendants; exports.getStatusMessage = getStatusMessage; +exports.getStreamedSpanLinks = getStreamedSpanLinks; exports.removeChildSpanFromSpan = removeChildSpanFromSpan; exports.showSpanDropWarning = showSpanDropWarning; exports.spanIsSampled = spanIsSampled; +exports.spanIsSentrySpan = spanIsSentrySpan; exports.spanTimeInputToSeconds = spanTimeInputToSeconds; exports.spanToJSON = spanToJSON; +exports.spanToStreamedSpanJSON = spanToStreamedSpanJSON; exports.spanToTraceContext = spanToTraceContext; exports.spanToTraceHeader = spanToTraceHeader; +exports.spanToTraceparentHeader = spanToTraceparentHeader; exports.spanToTransactionTraceContext = spanToTransactionTraceContext; -exports.updateMetricSummaryOnActiveSpan = updateMetricSummaryOnActiveSpan; +exports.streamedSpanJsonToSerializedSpan = streamedSpanJsonToSerializedSpan; exports.updateSpanName = updateSpanName; //# sourceMappingURL=spanUtils.js.map +/***/ }), + +/***/ 50664: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const MAX_SUMMARY_LENGTH = 255; +const TABLE_NAME_CHARS = /[^\s(,;)]+/; +const TABLE_NAME = TABLE_NAME_CHARS.source; +const DDL_RE = new RegExp( + `^\\s*(?(?:CREATE|DROP)\\s+(?:TABLE|INDEX)|ALTER\\s+TABLE)(?:\\s+IF\\s+(?:NOT\\s+)?EXISTS)?\\s+(?${TABLE_NAME})`, + "i" +); +const INSERT_RE = new RegExp( + `^\\s*(?INSERT|REPLACE)(?:\\s+OR\\s+(?:ROLLBACK|ABORT|FAIL|IGNORE|REPLACE))?\\s+INTO\\s+(?
${TABLE_NAME})`, + "i" +); +const UPDATE_RE = new RegExp( + `^\\s*(?UPDATE)(?:\\s+OR\\s+(?:ROLLBACK|ABORT|FAIL|IGNORE|REPLACE))?\\s+(?
${TABLE_NAME})`, + "i" +); +const DELETE_RE = new RegExp(`^\\s*(?DELETE)\\s+FROM\\s+(?
${TABLE_NAME})`, "i"); +const SELECT_RE = /^\s*\(?\s*(?SELECT)\b/i; +const PRAGMA_RE = /^\s*(?PRAGMA)\s+(?\S+)/i; +const TOKEN_RE = /\b(?:FROM|JOIN)\s+|\(\s*(SELECT)\b|\b(?:UNION|INTERSECT|EXCEPT|MINUS)\s+(?:ALL\s+)?(SELECT)\b/gi; +const QUOTED_OR_PLAIN_TABLE_RE = /^(?:"[^"]*"|'[^']*'|[^\s(,;)]+)/; +const COMMA_TABLE_RE = /^\s*,\s*((?:"[^"]*"|'[^']*'|[^\s(,;)]+))/; +const SUBQUERY_SELECT_RE = /^\(\s*(SELECT)\b/i; +function getSqlQuerySummary(query) { + if (!query) { + return void 0; + } + const pragmaMatch = PRAGMA_RE.exec(query); + if (pragmaMatch?.groups?.["operation"] && pragmaMatch.groups["command"]) { + const operation = pragmaMatch.groups["operation"]; + const command = pragmaMatch.groups["command"]; + const parenIdx = command.indexOf("("); + return truncate(`${operation} ${parenIdx >= 0 ? command.substring(0, parenIdx) : command}`); + } + const ddlMatch = DDL_RE.exec(query); + if (ddlMatch?.groups?.["operation"] && ddlMatch.groups["table"]) { + return truncate(`${ddlMatch.groups["operation"]} ${ddlMatch.groups["table"]}`); + } + const insertMatch = INSERT_RE.exec(query); + if (insertMatch?.groups?.["operation"] && insertMatch.groups["table"]) { + const parts = [insertMatch.groups["operation"], insertMatch.groups["table"]]; + const rest = query.slice(insertMatch[0].length); + const subSelect = /\b(SELECT)\b/i.exec(rest); + if (subSelect?.[1]) { + parts.push(subSelect[1]); + const selectTables = extractTableNames(rest.slice(subSelect.index)); + parts.push(...selectTables); + } + return truncate(parts.join(" ")); + } + const updateMatch = UPDATE_RE.exec(query); + if (updateMatch?.groups?.["operation"] && updateMatch.groups["table"]) { + return truncate(`${updateMatch.groups["operation"]} ${updateMatch.groups["table"]}`); + } + const deleteMatch = DELETE_RE.exec(query); + if (deleteMatch?.groups?.["operation"] && deleteMatch.groups["table"]) { + return truncate(`${deleteMatch.groups["operation"]} ${deleteMatch.groups["table"]}`); + } + const selectMatch = SELECT_RE.exec(query); + if (selectMatch?.groups?.["operation"]) { + const tables = extractTableNames(query.slice(selectMatch[0].length)); + if (tables.length > 0) { + return truncate(`${selectMatch.groups["operation"]} ${tables.join(" ")}`); + } + return selectMatch.groups["operation"]; + } + return truncate(query.trim().split(/\s+/)[0] ?? query); +} +function extractTableNames(sql) { + const tables = []; + TOKEN_RE.lastIndex = 0; + let match; + while ((match = TOKEN_RE.exec(sql)) !== null) { + if (match[1] || match[2]) { + tables.push(match[1] || match[2]); + continue; + } + const rest = sql.slice(match.index + match[0].length); + const subqueryMatch = SUBQUERY_SELECT_RE.exec(rest); + if (subqueryMatch?.[1]) { + tables.push(subqueryMatch[1]); + TOKEN_RE.lastIndex = match.index + match[0].length + subqueryMatch[0].length; + continue; + } + const tableMatch = QUOTED_OR_PLAIN_TABLE_RE.exec(rest); + if (!tableMatch) continue; + tables.push(tableMatch[0]); + let afterTable = rest.slice(tableMatch[0].length); + let commaMatch; + while ((commaMatch = COMMA_TABLE_RE.exec(afterTable)) !== null) { + if (!commaMatch[1]) break; + tables.push(commaMatch[1]); + afterTable = afterTable.slice(commaMatch[0].length); + } + } + return tables; +} +function truncate(summary) { + if (summary.length <= MAX_SUMMARY_LENGTH) { + return summary; + } + const truncated = summary.substring(0, MAX_SUMMARY_LENGTH); + const lastSpace = truncated.lastIndexOf(" "); + return lastSpace > 0 ? truncated.substring(0, lastSpace) : truncated; +} + +exports.getSqlQuerySummary = getSqlQuerySummary; +//# sourceMappingURL=sql.js.map + + +/***/ }), + +/***/ 22902: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const STACKTRACE_FRAME_LIMIT = 50; +const UNKNOWN_FUNCTION = "?"; +const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; +const STRIP_FRAME_REGEXP = /captureMessage|captureException/; +function createStackParser(...parsers) { + const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map((p) => p[1]); + return (stack, skipFirstLines = 0, framesToPop = 0) => { + const frames = []; + const lines = stack.split("\n"); + for (let i = skipFirstLines; i < lines.length; i++) { + let line = lines[i]; + if (line.length > 1024) { + line = line.slice(0, 1024); + } + const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, "$1") : line; + if (cleanedLine.includes("Error: ")) { + continue; + } + for (const parser of sortedParsers) { + const frame = parser(cleanedLine); + if (frame) { + frames.push(frame); + break; + } + } + if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) { + break; + } + } + return stripSentryFramesAndReverse(frames.slice(framesToPop)); + }; +} +function stackParserFromStackParserOptions(stackParser) { + if (Array.isArray(stackParser)) { + return createStackParser(...stackParser); + } + return stackParser; +} +function stripSentryFramesAndReverse(stack) { + if (!stack.length) { + return []; + } + const localStack = Array.from(stack); + if (/sentryWrapped/.test(getLastStackFrame(localStack).function || "")) { + localStack.pop(); + } + localStack.reverse(); + if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { + localStack.pop(); + if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { + localStack.pop(); + } + } + return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({ + ...frame, + filename: frame.filename || getLastStackFrame(localStack).filename, + function: frame.function || UNKNOWN_FUNCTION + })); +} +function getLastStackFrame(arr) { + return arr[arr.length - 1] || {}; +} +const defaultFunctionName = ""; +function getFunctionName(fn) { + try { + if (!fn || typeof fn !== "function") { + return defaultFunctionName; + } + return fn.name || defaultFunctionName; + } catch { + return defaultFunctionName; + } +} +function getFramesFromEvent(event) { + const exception = event.exception; + if (exception) { + const frames = []; + try { + exception.values.forEach((value) => { + if (value.stacktrace.frames) { + frames.push(...value.stacktrace.frames); + } + }); + return frames; + } catch { + return void 0; + } + } + return void 0; +} +function normalizeStackTracePath(path) { + let filename = path?.startsWith("file://") ? path.slice(7) : path; + if (filename?.match(/\/[A-Z]:/)) { + filename = filename.slice(1); + } + return filename; +} + +exports.UNKNOWN_FUNCTION = UNKNOWN_FUNCTION; +exports.createStackParser = createStackParser; +exports.getFramesFromEvent = getFramesFromEvent; +exports.getFunctionName = getFunctionName; +exports.normalizeStackTracePath = normalizeStackTracePath; +exports.stackParserFromStackParserOptions = stackParserFromStackParserOptions; +exports.stripSentryFramesAndReverse = stripSentryFramesAndReverse; +//# sourceMappingURL=stacktrace.js.map + + +/***/ }), + +/***/ 77673: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const is = __nccwpck_require__(68370); +const normalize = __nccwpck_require__(68446); + +function stringify(value, fallback = "[unserializable]") { + if (typeof value === "string") { + return value; + } + try { + return JSON.stringify(value); + } catch { + return typeof fallback === "function" ? fallback(value) : fallback; + } +} +function truncate(str, max = 0) { + if (typeof str !== "string" || max === 0) { + return str; + } + return str.length <= max ? str : `${str.slice(0, max)}...`; +} +function snipLine(line, colno) { + let newLine = line; + const lineLength = newLine.length; + if (lineLength <= 150) { + return newLine; + } + if (colno > lineLength) { + colno = lineLength; + } + let start = Math.max(colno - 60, 0); + if (start < 5) { + start = 0; + } + let end = Math.min(start + 140, lineLength); + if (end > lineLength - 5) { + end = lineLength; + } + if (end === lineLength) { + start = Math.max(end - 140, 0); + } + newLine = newLine.slice(start, end); + if (start > 0) { + newLine = `'{snip} ${newLine}`; + } + if (end < lineLength) { + newLine += " {snip}"; + } + return newLine; +} +function safeJoin(input, delimiter) { + if (!Array.isArray(input)) { + return ""; + } + const output = []; + for (let i = 0; i < input.length; i++) { + const value = input[i]; + if (is.isPrimitive(value)) { + output.push(String(value)); + } else if (value instanceof Error) { + output.push(value.message ? `${value.name}: ${value.message}` : value.name); + } else { + output.push(normalize.stringifyValue(void 0, value)); + } + } + return output.join(delimiter); +} +function isMatchingPattern(value, pattern, requireExactStringMatch = false) { + if (!is.isString(value)) { + return false; + } + if (is.isRegExp(pattern)) { + return pattern.test(value); + } + if (is.isString(pattern)) { + return requireExactStringMatch ? value === pattern : value.includes(pattern); + } + if (typeof pattern === "function") { + return pattern(value); + } + return false; +} +function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) { + for (const pattern of patterns) { + if (isMatchingPattern(testString, pattern, requireExactStringMatch)) { + return true; + } + } + return false; +} + +exports.isMatchingPattern = isMatchingPattern; +exports.safeJoin = safeJoin; +exports.snipLine = snipLine; +exports.stringMatchesSomePattern = stringMatchesSomePattern; +exports.stringify = stringify; +exports.truncate = truncate; +//# sourceMappingURL=string.js.map + + +/***/ }), + +/***/ 59809: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const worldwide = __nccwpck_require__(90935); + +const WINDOW = worldwide.GLOBAL_OBJ; +function supportsErrorEvent() { + try { + new ErrorEvent(""); + return true; + } catch { + return false; + } +} +function supportsDOMError() { + try { + new DOMError(""); + return true; + } catch { + return false; + } +} +function supportsDOMException() { + try { + new DOMException(""); + return true; + } catch { + return false; + } +} +function supportsHistory() { + return "history" in WINDOW && !!WINDOW.history; +} +const supportsFetch = _isFetchSupported; +function _isFetchSupported() { + if (!("fetch" in WINDOW)) { + return false; + } + try { + new Headers(); + new Request("data:,"); + new Response(); + return true; + } catch { + return false; + } +} +function isNativeFunction(func) { + return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); +} +function supportsNativeFetch() { + if (typeof EdgeRuntime === "string") { + return true; + } + if (!_isFetchSupported()) { + return false; + } + if (isNativeFunction(WINDOW.fetch)) { + return true; + } + let result = false; + const doc = WINDOW.document; + if (doc && typeof doc.createElement === "function") { + try { + const sandbox = doc.createElement("iframe"); + sandbox.hidden = true; + doc.head.appendChild(sandbox); + if (sandbox.contentWindow?.fetch) { + result = isNativeFunction(sandbox.contentWindow.fetch); + } + doc.head.removeChild(sandbox); + } catch (err) { + debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ", err); + } + } + return result; +} +function supportsReportingObserver() { + return "ReportingObserver" in WINDOW; +} +function supportsReferrerPolicy() { + if (!_isFetchSupported()) { + return false; + } + try { + new Request("_", { + referrerPolicy: "origin" + }); + return true; + } catch { + return false; + } +} + +exports.isNativeFunction = isNativeFunction; +exports.supportsDOMError = supportsDOMError; +exports.supportsDOMException = supportsDOMException; +exports.supportsErrorEvent = supportsErrorEvent; +exports.supportsFetch = supportsFetch; +exports.supportsHistory = supportsHistory; +exports.supportsNativeFetch = supportsNativeFetch; +exports.supportsReferrerPolicy = supportsReferrerPolicy; +exports.supportsReportingObserver = supportsReportingObserver; +//# sourceMappingURL=supports.js.map + + +/***/ }), + +/***/ 56291: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const is = __nccwpck_require__(68370); + +const STATE_PENDING = 0; +const STATE_RESOLVED = 1; +const STATE_REJECTED = 2; +function resolvedSyncPromise(value) { + return new SyncPromise((resolve) => { + resolve(value); + }); +} +function rejectedSyncPromise(reason) { + return new SyncPromise((_, reject) => { + reject(reason); + }); +} +class SyncPromise { + constructor(executor) { + this._state = STATE_PENDING; + this._handlers = []; + this._runExecutor(executor); + } + /** @inheritdoc */ + then(onfulfilled, onrejected) { + return new SyncPromise((resolve, reject) => { + this._handlers.push([ + false, + (result) => { + if (!onfulfilled) { + resolve(result); + } else { + try { + resolve(onfulfilled(result)); + } catch (e) { + reject(e); + } + } + }, + (reason) => { + if (!onrejected) { + reject(reason); + } else { + try { + resolve(onrejected(reason)); + } catch (e) { + reject(e); + } + } + } + ]); + this._executeHandlers(); + }); + } + /** @inheritdoc */ + catch(onrejected) { + return this.then((val) => val, onrejected); + } + /** @inheritdoc */ + finally(onfinally) { + return new SyncPromise((resolve, reject) => { + let val; + let isRejected; + return this.then( + (value) => { + isRejected = false; + val = value; + if (onfinally) { + onfinally(); + } + }, + (reason) => { + isRejected = true; + val = reason; + if (onfinally) { + onfinally(); + } + } + ).then(() => { + if (isRejected) { + reject(val); + return; + } + resolve(val); + }); + }); + } + /** Excute the resolve/reject handlers. */ + _executeHandlers() { + if (this._state === STATE_PENDING) { + return; + } + const cachedHandlers = this._handlers.slice(); + this._handlers = []; + cachedHandlers.forEach((handler) => { + if (handler[0]) { + return; + } + if (this._state === STATE_RESOLVED) { + handler[1](this._value); + } + if (this._state === STATE_REJECTED) { + handler[2](this._value); + } + handler[0] = true; + }); + } + /** Run the executor for the SyncPromise. */ + _runExecutor(executor) { + const setResult = (state, value) => { + if (this._state !== STATE_PENDING) { + return; + } + if (is.isThenable(value)) { + void value.then(resolve, reject); + return; + } + this._state = state; + this._value = value; + this._executeHandlers(); + }; + const resolve = (value) => { + setResult(STATE_RESOLVED, value); + }; + const reject = (reason) => { + setResult(STATE_REJECTED, reason); + }; + try { + executor(resolve, reject); + } catch (e) { + reject(e); + } + } +} + +exports.SyncPromise = SyncPromise; +exports.rejectedSyncPromise = rejectedSyncPromise; +exports.resolvedSyncPromise = resolvedSyncPromise; +//# sourceMappingURL=syncpromise.js.map + + +/***/ }), + +/***/ 66690: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const randomSafeContext = __nccwpck_require__(28695); +const worldwide = __nccwpck_require__(90935); + +const ONE_SECOND_IN_MS = 1e3; +function dateTimestampInSeconds() { + return randomSafeContext.safeDateNow() / ONE_SECOND_IN_MS; +} +function createUnixTimestampInSecondsFunc() { + const { performance } = worldwide.GLOBAL_OBJ; + if (!performance?.now || !performance.timeOrigin) { + return dateTimestampInSeconds; + } + const timeOrigin = performance.timeOrigin; + return () => { + return (timeOrigin + randomSafeContext.withRandomSafeContext(() => performance.now())) / ONE_SECOND_IN_MS; + }; +} +let _cachedTimestampInSeconds; +function timestampInSeconds() { + const func = _cachedTimestampInSeconds ?? (_cachedTimestampInSeconds = createUnixTimestampInSecondsFunc()); + return func(); +} +let cachedTimeOrigin = null; +function getBrowserTimeOrigin() { + const { performance } = worldwide.GLOBAL_OBJ; + if (!performance?.now) { + return void 0; + } + const threshold = 3e5; + const performanceNow = randomSafeContext.withRandomSafeContext(() => performance.now()); + const dateNow = randomSafeContext.safeDateNow(); + const timeOrigin = performance.timeOrigin; + if (typeof timeOrigin === "number") { + const timeOriginDelta = Math.abs(timeOrigin + performanceNow - dateNow); + if (timeOriginDelta < threshold) { + return timeOrigin; + } + } + const navigationStart = performance.timing?.navigationStart; + if (typeof navigationStart === "number") { + const navigationStartDelta = Math.abs(navigationStart + performanceNow - dateNow); + if (navigationStartDelta < threshold) { + return navigationStart; + } + } + return dateNow - performanceNow; +} +function browserPerformanceTimeOrigin() { + if (cachedTimeOrigin === null) { + cachedTimeOrigin = getBrowserTimeOrigin(); + } + return cachedTimeOrigin; +} + +exports.browserPerformanceTimeOrigin = browserPerformanceTimeOrigin; +exports.dateTimestampInSeconds = dateTimestampInSeconds; +exports.timestampInSeconds = timestampInSeconds; +//# sourceMappingURL=time.js.map + + +/***/ }), + +/***/ 85548: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function safeUnref(timer) { + if (typeof timer === "object" && typeof timer.unref === "function") { + timer.unref(); + } + return timer; +} + +exports.safeUnref = safeUnref; +//# sourceMappingURL=timer.js.map + + +/***/ }), + +/***/ 4002: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const SEQUENCE_ATTR_KEY = "sentry.timestamp.sequence"; +let _sequenceNumber = 0; +let _previousTimestampMs; +function getSequenceAttribute(timestampInSeconds) { + const nowMs = Math.floor(timestampInSeconds * 1e3); + if (_previousTimestampMs !== void 0 && nowMs !== _previousTimestampMs) { + _sequenceNumber = 0; + } + const value = _sequenceNumber; + _sequenceNumber++; + _previousTimestampMs = nowMs; + return { + key: SEQUENCE_ATTR_KEY, + value: { value, type: "integer" } + }; +} + +exports.getSequenceAttribute = getSequenceAttribute; +//# sourceMappingURL=timestampSequence.js.map + + +/***/ }), + +/***/ 7535: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const currentScopes = __nccwpck_require__(8131); +const dynamicSamplingContext = __nccwpck_require__(29724); +const spanUtils = __nccwpck_require__(47569); + +function _getTraceInfoFromScope(client, scope) { + if (!scope) { + return [void 0, void 0]; + } + return currentScopes.withScope(scope, () => { + const span = spanUtils.getActiveSpan(); + const traceContext = span ? spanUtils.spanToTraceContext(span) : currentScopes.getTraceContextFromScope(scope); + const dynamicSamplingContext$1 = span ? dynamicSamplingContext.getDynamicSamplingContextFromSpan(span) : dynamicSamplingContext.getDynamicSamplingContextFromScope(client, scope); + return [dynamicSamplingContext$1, traceContext]; + }); +} + +exports._getTraceInfoFromScope = _getTraceInfoFromScope; +//# sourceMappingURL=trace-info.js.map + + /***/ }), /***/ 7522: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const index = __nccwpck_require__(29878); const carrier = __nccwpck_require__(38080); const currentScopes = __nccwpck_require__(8131); const exports$1 = __nccwpck_require__(10779); -__nccwpck_require__(21834); -__nccwpck_require__(87038); -const logger = __nccwpck_require__(38752); -__nccwpck_require__(14488); -__nccwpck_require__(75872); +const debugLogger = __nccwpck_require__(41772); const spanUtils = __nccwpck_require__(47569); -const tracing = __nccwpck_require__(15977); +const hasSpansEnabled = __nccwpck_require__(42982); +const sentryNonRecordingSpan = __nccwpck_require__(36854); const dynamicSamplingContext = __nccwpck_require__(29724); -const baggage = __nccwpck_require__(86741); +const baggage = __nccwpck_require__(2135); +const tracing = __nccwpck_require__(35606); -/** - * Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation - * context) and serializes it to `sentry-trace` and `baggage` values to strings. These values can be used to propagate - * a trace via our tracing Http headers or Html `` tags. - * - * This function also applies some validation to the generated sentry-trace and baggage values to ensure that - * only valid strings are returned. - * - * @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header - * or meta tag name. - */ function getTraceData(options = {}) { - const client = currentScopes.getClient(); + const client = options.client || currentScopes.getClient(); if (!exports$1.isEnabled() || !client) { return {}; } - const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); if (acs.getTraceData) { return acs.getTraceData(options); } - - const scope = currentScopes.getCurrentScope(); + const scope = options.scope || currentScopes.getCurrentScope(); const span = options.span || spanUtils.getActiveSpan(); - const sentryTrace = span ? spanUtils.spanToTraceHeader(span) : scopeToTraceHeader(scope); - const dsc = span ? dynamicSamplingContext.getDynamicSamplingContextFromSpan(span) : dynamicSamplingContext.getDynamicSamplingContextFromScope(client, scope); - const baggage$1 = baggage.dynamicSamplingContextToSentryBaggageHeader(dsc); - - const isValidSentryTraceHeader = tracing.TRACEPARENT_REGEXP.test(sentryTrace); - if (!isValidSentryTraceHeader) { - logger.logger.warn('Invalid sentry-trace data. Cannot generate trace data'); + const isTwpPlaceholder = sentryNonRecordingSpan.spanIsNonRecordingSpan(span) && !hasSpansEnabled.hasSpansEnabled(client.getOptions()); + if (!span && currentScopes.hasExternalPropagationContext()) { return {}; } - - return { - 'sentry-trace': sentryTrace, - baggage: baggage$1, + const sentryTrace = span && !isTwpPlaceholder ? spanUtils.spanToTraceHeader(span) : scopeToTraceHeader(scope); + const dsc = span ? dynamicSamplingContext.getDynamicSamplingContextFromSpan(span) : dynamicSamplingContext.getDynamicSamplingContextFromScope(client, scope); + const baggage$1 = baggage.dynamicSamplingContextToSentryBaggageHeader(dsc); + const isValidSentryTraceHeader = tracing.TRACEPARENT_REGEXP.test(sentryTrace); + if (!isValidSentryTraceHeader) { + debugLogger.debug.warn("Invalid sentry-trace data. Cannot generate trace data"); + return {}; + } + const traceData = { + "sentry-trace": sentryTrace, + baggage: baggage$1 }; + if (options.propagateTraceparent) { + traceData.traceparent = span && !isTwpPlaceholder ? spanUtils.spanToTraceparentHeader(span) : scopeToTraceparentHeader(scope); + } + return traceData; } - -/** - * Get a sentry-trace header value for the given scope. - */ function scopeToTraceHeader(scope) { - // TODO(v9): Use generateSpanId() instead of spanId - // eslint-disable-next-line deprecation/deprecation - const { traceId, sampled, spanId } = scope.getPropagationContext(); - return tracing.generateSentryTraceHeader(traceId, spanId, sampled); + const { traceId, sampled, propagationSpanId } = scope.getPropagationContext(); + return tracing.generateSentryTraceHeader(traceId, propagationSpanId, sampled); +} +function scopeToTraceparentHeader(scope) { + const { traceId, sampled, propagationSpanId } = scope.getPropagationContext(); + return tracing.generateTraceparentHeader(traceId, propagationSpanId, sampled); } exports.getTraceData = getTraceData; @@ -82457,60 +40749,646 @@ exports.getTraceData = getTraceData; /***/ }), -/***/ 13508: +/***/ 22680: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugBuild = __nccwpck_require__(14488); +const debugLogger = __nccwpck_require__(41772); +const string = __nccwpck_require__(77673); + +const NOT_PROPAGATED_MESSAGE = "[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:"; +function shouldPropagateTraceForUrl(url, tracePropagationTargets, decisionMap) { + if (typeof url !== "string" || !tracePropagationTargets) { + return true; + } + const cachedDecision = decisionMap?.get(url); + if (cachedDecision !== void 0) { + debugBuild.DEBUG_BUILD && !cachedDecision && debugLogger.debug.log(NOT_PROPAGATED_MESSAGE, url); + return cachedDecision; + } + const decision = string.stringMatchesSomePattern(url, tracePropagationTargets); + decisionMap?.set(url, decision); + debugBuild.DEBUG_BUILD && !decision && debugLogger.debug.log(NOT_PROPAGATED_MESSAGE, url); + return decision; +} + +exports.shouldPropagateTraceForUrl = shouldPropagateTraceForUrl; +//# sourceMappingURL=tracePropagationTargets.js.map + + +/***/ }), + +/***/ 35606: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const debugLogger = __nccwpck_require__(41772); +const baggage = __nccwpck_require__(2135); +const dsn = __nccwpck_require__(91582); +const parseSampleRate = __nccwpck_require__(54078); +const propagationContext = __nccwpck_require__(95102); +const randomSafeContext = __nccwpck_require__(28695); + +const TRACEPARENT_REGEXP = new RegExp( + "^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$" + // whitespace +); +function extractTraceparentData(traceparent) { + if (!traceparent) { + return void 0; + } + const matches = traceparent.match(TRACEPARENT_REGEXP); + if (!matches) { + return void 0; + } + let parentSampled; + if (matches[3] === "1") { + parentSampled = true; + } else if (matches[3] === "0") { + parentSampled = false; + } + return { + traceId: matches[1], + parentSampled, + parentSpanId: matches[2] + }; +} +function propagationContextFromHeaders(sentryTrace, baggage$1) { + const traceparentData = extractTraceparentData(sentryTrace); + const dynamicSamplingContext = baggage.baggageHeaderToDynamicSamplingContext(baggage$1); + if (!traceparentData?.traceId) { + return { + traceId: propagationContext.generateTraceId(), + sampleRand: randomSafeContext.safeMathRandom() + }; + } + const sampleRand = getSampleRandFromTraceparentAndDsc(traceparentData, dynamicSamplingContext); + if (dynamicSamplingContext) { + dynamicSamplingContext.sample_rand = sampleRand.toString(); + } + const { traceId, parentSpanId, parentSampled } = traceparentData; + return { + traceId, + parentSpanId, + sampled: parentSampled, + dsc: dynamicSamplingContext || {}, + // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it + sampleRand + }; +} +function generateSentryTraceHeader(traceId = propagationContext.generateTraceId(), spanId = propagationContext.generateSpanId(), sampled) { + let sampledString = ""; + if (sampled !== void 0) { + sampledString = sampled ? "-1" : "-0"; + } + return `${traceId}-${spanId}${sampledString}`; +} +function generateTraceparentHeader(traceId = propagationContext.generateTraceId(), spanId = propagationContext.generateSpanId(), sampled) { + return `00-${traceId}-${spanId}-${sampled ? "01" : "00"}`; +} +function getSampleRandFromTraceparentAndDsc(traceparentData, dsc) { + const parsedSampleRand = parseSampleRate.parseSampleRate(dsc?.sample_rand); + if (parsedSampleRand !== void 0) { + return parsedSampleRand; + } + const parsedSampleRate = parseSampleRate.parseSampleRate(dsc?.sample_rate); + if (parsedSampleRate && traceparentData?.parentSampled !== void 0) { + return traceparentData.parentSampled ? ( + // Returns a sample rand with positive sampling decision [0, sampleRate) + randomSafeContext.safeMathRandom() * parsedSampleRate + ) : ( + // Returns a sample rand with negative sampling decision [sampleRate, 1) + parsedSampleRate + randomSafeContext.safeMathRandom() * (1 - parsedSampleRate) + ); + } else { + return randomSafeContext.safeMathRandom(); + } +} +function shouldContinueTrace(client, baggageOrgId) { + const clientOrgId = dsn.extractOrgIdFromClient(client); + if (baggageOrgId && clientOrgId && baggageOrgId !== clientOrgId) { + debugLogger.debug.log( + `Won't continue trace because org IDs don't match (incoming baggage: ${baggageOrgId}, SDK options: ${clientOrgId})` + ); + return false; + } + const strictTraceContinuation = client.getOptions().strictTraceContinuation || false; + if (strictTraceContinuation) { + if (baggageOrgId && !clientOrgId || !baggageOrgId && clientOrgId) { + debugLogger.debug.log( + `Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${baggageOrgId}, Sentry client: ${clientOrgId})` + ); + return false; + } + } + return true; +} + +exports.TRACEPARENT_REGEXP = TRACEPARENT_REGEXP; +exports.extractTraceparentData = extractTraceparentData; +exports.generateSentryTraceHeader = generateSentryTraceHeader; +exports.generateTraceparentHeader = generateTraceparentHeader; +exports.propagationContextFromHeaders = propagationContextFromHeaders; +exports.shouldContinueTrace = shouldContinueTrace; +//# sourceMappingURL=tracing.js.map + + +/***/ }), + +/***/ 72214: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const semanticAttributes = __nccwpck_require__(36827); + +function convertTransactionEventToSpanJson(event) { + const { trace_id, parent_span_id, span_id, status, origin, data, op } = event.contexts?.trace ?? {}; + return { + data: data ?? {}, + description: event.transaction, + op, + parent_span_id, + span_id: span_id ?? "", + start_timestamp: event.start_timestamp ?? 0, + status, + timestamp: event.timestamp, + trace_id: trace_id ?? "", + origin, + profile_id: data?.[semanticAttributes.SEMANTIC_ATTRIBUTE_PROFILE_ID], + exclusive_time: data?.[semanticAttributes.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME], + measurements: event.measurements, + is_segment: true + }; +} +function convertSpanJsonToTransactionEvent(span) { + return { + type: "transaction", + timestamp: span.timestamp, + start_timestamp: span.start_timestamp, + transaction: span.description, + contexts: { + trace: { + trace_id: span.trace_id, + span_id: span.span_id, + parent_span_id: span.parent_span_id, + op: span.op, + status: span.status, + origin: span.origin, + data: { + ...span.data, + ...span.profile_id && { [semanticAttributes.SEMANTIC_ATTRIBUTE_PROFILE_ID]: span.profile_id }, + ...span.exclusive_time && { [semanticAttributes.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: span.exclusive_time } + } + } + }, + measurements: span.measurements + }; +} + +exports.convertSpanJsonToTransactionEvent = convertSpanJsonToTransactionEvent; +exports.convertTransactionEventToSpanJson = convertTransactionEventToSpanJson; +//# sourceMappingURL=transactionEvent.js.map + + +/***/ }), + +/***/ 90792: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(88563); +const debugLogger = __nccwpck_require__(41772); +const dsn = __nccwpck_require__(91582); +const envelope = __nccwpck_require__(56987); + +async function handleTunnelRequest(options) { + const { request, allowedDsns } = options; + if (allowedDsns.length === 0) { + return new Response("Tunnel not configured", { status: 500 }); + } + const body = new Uint8Array(await request.arrayBuffer()); + let envelopeHeader; + try { + [envelopeHeader] = envelope.parseEnvelope(body); + } catch { + return new Response("Invalid envelope", { status: 400 }); + } + if (!envelopeHeader) { + return new Response("Invalid envelope: missing header", { status: 400 }); + } + const dsn$1 = envelopeHeader.dsn; + if (!dsn$1) { + return new Response("Invalid envelope: missing DSN", { status: 400 }); + } + const isAllowed = allowedDsns.some((allowed) => allowed === dsn$1); + if (!isAllowed) { + debugLogger.debug.warn(`Sentry tunnel: rejected request with unauthorized DSN (${dsn$1})`); + return new Response("DSN not allowed", { status: 403 }); + } + const dsnComponents = dsn.makeDsn(dsn$1); + if (!dsnComponents) { + debugLogger.debug.warn(`Could not extract DSN Components from: ${dsn$1}`); + return new Response("Invalid DSN", { status: 403 }); + } + const sentryIngestUrl = api.getEnvelopeEndpointWithUrlEncodedAuth(dsnComponents); + try { + return await fetch(sentryIngestUrl, { + method: "POST", + headers: { + "Content-Type": "application/x-sentry-envelope" + }, + body + }); + } catch (error) { + debugLogger.debug.error("Sentry tunnel: failed to forward envelope", error); + return new Response("Failed to forward envelope to Sentry", { status: 500 }); + } +} + +exports.handleTunnelRequest = handleTunnelRequest; +//# sourceMappingURL=tunnel.js.map + + +/***/ }), + +/***/ 78253: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const semanticAttributes = __nccwpck_require__(36827); + +const DEFAULT_BASE_URL = "thismessage:/"; +function isURLObjectRelative(url) { + return "isRelative" in url; +} +function parseStringToURLObject(url, urlBase) { + const isRelative = url.indexOf("://") <= 0 && url.indexOf("//") !== 0; + const base = urlBase ?? (isRelative ? DEFAULT_BASE_URL : void 0); + try { + if ("canParse" in URL && !URL.canParse(url, base)) { + return void 0; + } + const fullUrlObject = new URL(url, base); + if (isRelative) { + return { + isRelative, + pathname: fullUrlObject.pathname, + search: fullUrlObject.search, + hash: fullUrlObject.hash + }; + } + return fullUrlObject; + } catch { + } + return void 0; +} +function getSanitizedUrlStringFromUrlObject(url) { + if (isURLObjectRelative(url)) { + return url.pathname; + } + const newUrl = new URL(url); + newUrl.search = ""; + newUrl.hash = ""; + if (["80", "443"].includes(newUrl.port)) { + newUrl.port = ""; + } + if (newUrl.password) { + newUrl.password = "%filtered%"; + } + if (newUrl.username) { + newUrl.username = "%filtered%"; + } + return newUrl.toString(); +} +function getHttpSpanNameFromUrlObject(urlObject, kind, request, routeName) { + const method = request?.method?.toUpperCase() ?? "GET"; + const route = routeName ? routeName : urlObject ? kind === "client" ? getSanitizedUrlStringFromUrlObject(urlObject) : urlObject.pathname : "/"; + return `${method} ${route}`; +} +function getHttpSpanDetailsFromUrlObject(urlObject, kind, spanOrigin, request, routeName) { + const attributes$1 = { + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin, + [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url" + }; + if (routeName) { + attributes$1[kind === "server" ? "http.route" : "url.template"] = routeName; + attributes$1[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = "route"; + } + if (request?.method) { + attributes$1[semanticAttributes.SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD] = request.method.toUpperCase(); + } + if (urlObject) { + if (urlObject.search) { + attributes$1["url.query"] = urlObject.search; + } + if (urlObject.hash) { + attributes$1["url.fragment"] = urlObject.hash; + } + if (urlObject.pathname) { + attributes$1["url.path"] = urlObject.pathname; + if (urlObject.pathname === "/") { + attributes$1[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = "route"; + } + } + if (!isURLObjectRelative(urlObject)) { + attributes$1[attributes.URL_FULL] = urlObject.href; + if (urlObject.port) { + attributes$1["url.port"] = urlObject.port; + } + if (urlObject.protocol) { + attributes$1["url.scheme"] = urlObject.protocol; + } + if (urlObject.hostname) { + attributes$1[kind === "server" ? "server.address" : "url.domain"] = urlObject.hostname; + } + } + } + return [getHttpSpanNameFromUrlObject(urlObject, kind, request, routeName), attributes$1]; +} +function parseUrl(url) { + if (!url) { + return {}; + } + const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); + if (!match) { + return {}; + } + const query = match[6] || ""; + const fragment = match[8] || ""; + return { + host: match[4], + path: match[5], + protocol: match[2], + search: query, + hash: fragment, + relative: match[5] + query + fragment + // everything minus origin + }; +} +function stripUrlQueryAndFragment(urlPath) { + return urlPath.split(/[?#]/, 1)[0]; +} +function getSanitizedUrlString(url) { + const { protocol, host, path } = url; + const filteredHost = host?.replace(/^.*@/, "[filtered]:[filtered]@").replace(/(:80)$/, "").replace(/(:443)$/, "") || ""; + return `${protocol ? `${protocol}://` : ""}${filteredHost}${path}`; +} +function stripDataUrlContent(url, includeDataPrefix = true) { + if (url.startsWith("data:")) { + const match = url.match(/^data:([^;,]+)/); + const mimeType = match ? match[1] : "text/plain"; + const isBase64 = url.includes(";base64,"); + const dataStart = url.indexOf(","); + let dataPrefix = ""; + if (includeDataPrefix && dataStart !== -1) { + const data = url.slice(dataStart + 1); + dataPrefix = data.length > 10 ? `${data.slice(0, 10)}... [truncated]` : data; + } + return `data:${mimeType}${isBase64 ? ",base64" : ""}${dataPrefix ? `,${dataPrefix}` : ""}`; + } + return url; +} + +exports.getHttpSpanDetailsFromUrlObject = getHttpSpanDetailsFromUrlObject; +exports.getSanitizedUrlString = getSanitizedUrlString; +exports.getSanitizedUrlStringFromUrlObject = getSanitizedUrlStringFromUrlObject; +exports.isURLObjectRelative = isURLObjectRelative; +exports.parseStringToURLObject = parseStringToURLObject; +exports.parseUrl = parseUrl; +exports.stripDataUrlContent = stripDataUrlContent; +exports.stripUrlQueryAndFragment = stripUrlQueryAndFragment; +//# sourceMappingURL=url.js.map + + +/***/ }), + +/***/ 70420: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const worldwide = __nccwpck_require__(90935); + +function vercelWaitUntil(task) { + if (typeof EdgeRuntime !== "string") { + return; + } + const vercelRequestContextGlobal = ( + // @ts-expect-error This is not typed + worldwide.GLOBAL_OBJ[/* @__PURE__ */ Symbol.for("@vercel/request-context")] + ); + const ctx = vercelRequestContextGlobal?.get?.(); + if (ctx?.waitUntil) { + ctx.waitUntil(task); + } +} + +exports.vercelWaitUntil = vercelWaitUntil; +//# sourceMappingURL=vercelWaitUntil.js.map + + +/***/ }), + +/***/ 71795: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const SDK_VERSION = "10.71.0" ; + +exports.SDK_VERSION = SDK_VERSION; +//# sourceMappingURL=version.js.map + + +/***/ }), + +/***/ 98981: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const worldwide = __nccwpck_require__(90935); + +function makeWeakRef(value) { + try { + const WeakRefImpl = worldwide.GLOBAL_OBJ.WeakRef; + if (typeof WeakRefImpl === "function") { + return new WeakRefImpl(value); + } + } catch { + } + return value; +} +function derefWeakRef(ref) { + if (!ref) { + return void 0; + } + if (typeof ref === "object" && "deref" in ref && typeof ref.deref === "function") { + try { + return ref.deref(); + } catch { + return void 0; + } + } + return ref; +} + +exports.derefWeakRef = derefWeakRef; +exports.makeWeakRef = makeWeakRef; +//# sourceMappingURL=weakRef.js.map + + +/***/ }), + +/***/ 90935: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const GLOBAL_OBJ = globalThis; + +exports.GLOBAL_OBJ = GLOBAL_OBJ; +//# sourceMappingURL=worldwide.js.map + + +/***/ }), + +/***/ 19734: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function escapeStringForRegex(regexString) { + return regexString.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); +} + +exports.escapeStringForRegex = escapeStringForRegex; +//# sourceMappingURL=escapeStringForRegex.js.map + + +/***/ }), + +/***/ 70866: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ipHeaderNames = [ + "X-Client-IP", + "X-Forwarded-For", + "Fly-Client-IP", + "CF-Connecting-IP", + "Fastly-Client-Ip", + "True-Client-Ip", + "X-Real-IP", + "X-Cluster-Client-IP", + "X-Forwarded", + "Forwarded-For", + "Forwarded", + "X-Vercel-Forwarded-For" +]; +function getClientIPAddress(headers) { + const lowerCaseHeaders = {}; + for (const key of Object.keys(headers)) { + lowerCaseHeaders[key.toLowerCase()] = headers[key]; + } + const headerValues = ipHeaderNames.map((headerName) => { + const rawValue = lowerCaseHeaders[headerName.toLowerCase()]; + const value = Array.isArray(rawValue) ? rawValue.join(";") : rawValue; + if (headerName === "Forwarded") { + return parseForwardedHeader(value); + } + return value?.split(",").map((v) => v.trim()); + }); + const flattenedHeaderValues = headerValues.reduce((acc, val) => { + if (!val) { + return acc; + } + return acc.concat(val); + }, []); + const ipAddress = flattenedHeaderValues.find((ip) => ip !== null && isIP(ip)); + return ipAddress || null; +} +function parseForwardedHeader(value) { + if (!value) { + return null; + } + for (const part of value.split(";")) { + if (part.startsWith("for=")) { + return part.slice(4); + } + } + return null; +} +function isIP(str) { + const regex = /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/; + return regex.test(str); +} + +exports.getClientIPAddress = getClientIPAddress; +exports.ipHeaderNames = ipHeaderNames; +//# sourceMappingURL=getIpAddress.js.map + + +/***/ }), + +/***/ 40639: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const replacements = [ - ['january', '1'], - ['february', '2'], - ['march', '3'], - ['april', '4'], - ['may', '5'], - ['june', '6'], - ['july', '7'], - ['august', '8'], - ['september', '9'], - ['october', '10'], - ['november', '11'], - ['december', '12'], - ['jan', '1'], - ['feb', '2'], - ['mar', '3'], - ['apr', '4'], - ['may', '5'], - ['jun', '6'], - ['jul', '7'], - ['aug', '8'], - ['sep', '9'], - ['oct', '10'], - ['nov', '11'], - ['dec', '12'], - ['sunday', '0'], - ['monday', '1'], - ['tuesday', '2'], - ['wednesday', '3'], - ['thursday', '4'], - ['friday', '5'], - ['saturday', '6'], - ['sun', '0'], - ['mon', '1'], - ['tue', '2'], - ['wed', '3'], - ['thu', '4'], - ['fri', '5'], - ['sat', '6'], + ["january", "1"], + ["february", "2"], + ["march", "3"], + ["april", "4"], + ["may", "5"], + ["june", "6"], + ["july", "7"], + ["august", "8"], + ["september", "9"], + ["october", "10"], + ["november", "11"], + ["december", "12"], + ["jan", "1"], + ["feb", "2"], + ["mar", "3"], + ["apr", "4"], + ["may", "5"], + ["jun", "6"], + ["jul", "7"], + ["aug", "8"], + ["sep", "9"], + ["oct", "10"], + ["nov", "11"], + ["dec", "12"], + ["sunday", "0"], + ["monday", "1"], + ["tuesday", "2"], + ["wednesday", "3"], + ["thursday", "4"], + ["friday", "5"], + ["saturday", "6"], + ["sun", "0"], + ["mon", "1"], + ["tue", "2"], + ["wed", "3"], + ["thu", "4"], + ["fri", "5"], + ["sat", "6"] ]; - -/** - * Replaces names in cron expressions - */ function replaceCronNames(cronExpression) { return replacements.reduce( - // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor - (acc, [name, replacement]) => acc.replace(new RegExp(name, 'gi'), replacement), - cronExpression, + // oxlint-disable-next-line sdk/no-regexp-constructor + (acc, [name, replacement]) => acc.replace(new RegExp(name, "gi"), replacement), + cronExpression ); } @@ -82520,92 +41398,64 @@ exports.replaceCronNames = replaceCronNames; /***/ }), -/***/ 77499: +/***/ 69480: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const common = __nccwpck_require__(13508); +const common = __nccwpck_require__(40639); -const ERROR_TEXT = 'Automatic instrumentation of CronJob only supports crontab string'; - -/** - * Instruments the `cron` library to send a check-in event to Sentry for each job execution. - * - * ```ts - * import * as Sentry from '@sentry/node'; - * import { CronJob } from 'cron'; - * - * const CronJobWithCheckIn = Sentry.cron.instrumentCron(CronJob, 'my-cron-job'); - * - * // use the constructor - * const job = new CronJobWithCheckIn('* * * * *', () => { - * console.log('You will see this message every minute'); - * }); - * - * // or from - * const job = CronJobWithCheckIn.from({ cronTime: '* * * * *', onTick: () => { - * console.log('You will see this message every minute'); - * }); - * ``` - */ +const ERROR_TEXT = "Automatic instrumentation of CronJob only supports crontab string"; function instrumentCron(lib, monitorSlug) { let jobScheduled = false; - return new Proxy(lib, { construct(target, args) { const [cronTime, onTick, onComplete, start, timeZone, ...rest] = args; - - if (typeof cronTime !== 'string') { + if (typeof cronTime !== "string") { throw new Error(ERROR_TEXT); } - if (jobScheduled) { throw new Error(`A job named '${monitorSlug}' has already been scheduled`); } - jobScheduled = true; - const cronString = common.replaceCronNames(cronTime); - - async function monitoredTick(context, onComplete) { + async function monitoredTick(context, onComplete2) { return core.withMonitor( monitorSlug, async () => { try { - await onTick(context, onComplete); + await onTick(context, onComplete2); } catch (e) { - core.captureException(e); + core.captureException(e, { + mechanism: { + handled: false, + type: "auto.function.cron.instrumentCron" + } + }); throw e; } }, { - schedule: { type: 'crontab', value: cronString }, - timezone: timeZone || undefined, - }, + schedule: { type: "crontab", value: cronString }, + timezone: timeZone || void 0 + } ); } - return new target(cronTime, monitoredTick, onComplete, start, timeZone, ...rest); }, get(target, prop) { - if (prop === 'from') { + if (prop === "from") { return (param) => { const { cronTime, onTick, timeZone } = param; - - if (typeof cronTime !== 'string') { + if (typeof cronTime !== "string") { throw new Error(ERROR_TEXT); } - if (jobScheduled) { throw new Error(`A job named '${monitorSlug}' has already been scheduled`); } - jobScheduled = true; - const cronString = common.replaceCronNames(cronTime); - param.onTick = async (context, onComplete) => { return core.withMonitor( monitorSlug, @@ -82613,23 +41463,27 @@ function instrumentCron(lib, monitorSlug) { try { await onTick(context, onComplete); } catch (e) { - core.captureException(e); + core.captureException(e, { + mechanism: { + handled: false, + type: "auto.function.cron.instrumentCron" + } + }); throw e; } }, { - schedule: { type: 'crontab', value: cronString }, - timezone: timeZone || undefined, - }, + schedule: { type: "crontab", value: cronString }, + timezone: timeZone || void 0 + } ); }; - return target.from(param); }; } else { return target[prop]; } - }, + } }); } @@ -82639,20 +41493,19 @@ exports.instrumentCron = instrumentCron; /***/ }), -/***/ 51153: +/***/ 28607: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const cron$1 = __nccwpck_require__(77499); -const nodeCron = __nccwpck_require__(70543); -const nodeSchedule = __nccwpck_require__(45666); +const cron$1 = __nccwpck_require__(69480); +const nodeCron = __nccwpck_require__(26063); +const nodeSchedule = __nccwpck_require__(32235); -/** Methods to instrument cron libraries for Sentry check-ins */ const cron = { instrumentCron: cron$1.instrumentCron, instrumentNodeCron: nodeCron.instrumentNodeCron, - instrumentNodeSchedule: nodeSchedule.instrumentNodeSchedule, + instrumentNodeSchedule: nodeSchedule.instrumentNodeSchedule }; exports.cron = cron; @@ -82661,76 +41514,56 @@ exports.cron = cron; /***/ }), -/***/ 70543: +/***/ 26063: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const common = __nccwpck_require__(13508); +const common = __nccwpck_require__(40639); -/** - * Wraps the `node-cron` library with check-in monitoring. - * - * ```ts - * import * as Sentry from "@sentry/node"; - * import * as cron from "node-cron"; - * - * const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron); - * - * cronWithCheckIn.schedule( - * "* * * * *", - * () => { - * console.log("running a task every minute"); - * }, - * { name: "my-cron-job" }, - * ); - * ``` - */ -function instrumentNodeCron(lib) { +function instrumentNodeCron(lib, monitorConfig = {}) { return new Proxy(lib, { get(target, prop) { - if (prop === 'schedule' && target.schedule) { - // When 'get' is called for schedule, return a proxied version of the schedule function + if (prop === "schedule" && target.schedule) { return new Proxy(target.schedule, { - apply(target, thisArg, argArray) { + apply(target2, thisArg, argArray) { const [expression, callback, options] = argArray; - - if (!_optionalChain([options, 'optionalAccess', _ => _.name])) { + const name = options?.name; + const timezone = options?.timezone; + if (!name) { throw new Error('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.'); } - - async function monitoredCallback() { + const monitoredCallback = async (...args) => { return core.withMonitor( - options.name, + name, async () => { - // We have to manually catch here and capture the exception because node-cron swallows errors - // https://github.com/node-cron/node-cron/issues/399 try { - return await callback(); + return await callback(...args); } catch (e) { - core.captureException(e); + core.captureException(e, { + mechanism: { + handled: false, + type: "auto.function.node-cron.instrumentNodeCron" + } + }); throw e; } }, { - schedule: { type: 'crontab', value: common.replaceCronNames(expression) }, - timezone: _optionalChain([options, 'optionalAccess', _2 => _2.timezone]), - }, + schedule: { type: "crontab", value: common.replaceCronNames(expression) }, + timezone, + ...monitorConfig + } ); - } - - return target.apply(thisArg, [expression, monitoredCallback, options]); - }, + }; + return target2.apply(thisArg, [expression, monitoredCallback, options]); + } }); } else { return target[prop]; } - }, + } }); } @@ -82740,73 +41573,45 @@ exports.instrumentNodeCron = instrumentNodeCron; /***/ }), -/***/ 45666: +/***/ 32235: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const common = __nccwpck_require__(13508); +const common = __nccwpck_require__(40639); -/** - * Instruments the `node-schedule` library to send a check-in event to Sentry for each job execution. - * - * ```ts - * import * as Sentry from '@sentry/node'; - * import * as schedule from 'node-schedule'; - * - * const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule); - * - * const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => { - * console.log('You will see this message every minute'); - * }); - * ``` - */ function instrumentNodeSchedule(lib) { return new Proxy(lib, { get(target, prop) { - if (prop === 'scheduleJob') { - // eslint-disable-next-line @typescript-eslint/unbound-method + if (prop === "scheduleJob") { return new Proxy(target.scheduleJob, { - apply(target, thisArg, argArray) { + apply(target2, thisArg, argArray) { const [nameOrExpression, expressionOrCallback, callback] = argArray; - - if ( - typeof nameOrExpression !== 'string' || - typeof expressionOrCallback !== 'string' || - typeof callback !== 'function' - ) { + if (typeof nameOrExpression !== "string" || typeof expressionOrCallback !== "string" || typeof callback !== "function") { throw new Error( - "Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string", + "Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string" ); } - const monitorSlug = nameOrExpression; const expression = expressionOrCallback; - async function monitoredCallback() { return core.withMonitor( monitorSlug, async () => { - await _optionalChain([callback, 'optionalCall', _ => _()]); + await callback?.(); }, { - schedule: { type: 'crontab', value: common.replaceCronNames(expression) }, - }, + schedule: { type: "crontab", value: common.replaceCronNames(expression) } + } ); } - - return target.apply(thisArg, [monitorSlug, expression, monitoredCallback]); - }, + return target2.apply(thisArg, [monitorSlug, expression, monitoredCallback]); + } }); } - return target[prop]; - }, + } }); } @@ -82816,16 +41621,11 @@ exports.instrumentNodeSchedule = instrumentNodeSchedule; /***/ }), -/***/ 8421: +/***/ 20624: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** - * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. - * - * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. - */ const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); exports.DEBUG_BUILD = DEBUG_BUILD; @@ -82834,120 +41634,78 @@ exports.DEBUG_BUILD = DEBUG_BUILD; /***/ }), -/***/ 17374: +/***/ 28648: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const index = __nccwpck_require__(50289); -const nodeFetch = __nccwpck_require__(40839); -const fs = __nccwpck_require__(91776); -const console = __nccwpck_require__(61139); -const context = __nccwpck_require__(15834); -const contextlines = __nccwpck_require__(57582); -const index$1 = __nccwpck_require__(4530); -const modules = __nccwpck_require__(43791); -const onuncaughtexception = __nccwpck_require__(79100); -const onunhandledrejection = __nccwpck_require__(70694); -const index$2 = __nccwpck_require__(83835); -const express = __nccwpck_require__(89660); -const fastify = __nccwpck_require__(3372); -const graphql = __nccwpck_require__(64448); -const kafka = __nccwpck_require__(8430); -const lrumemoizer = __nccwpck_require__(47006); -const mongo = __nccwpck_require__(57036); -const mongoose = __nccwpck_require__(28975); -const mysql = __nccwpck_require__(5432); -const mysql2 = __nccwpck_require__(56910); -const redis = __nccwpck_require__(87260); -const nest = __nccwpck_require__(60876); -const postgres = __nccwpck_require__(96003); -const prisma = __nccwpck_require__(53769); -const index$3 = __nccwpck_require__(69741); -const koa = __nccwpck_require__(57910); -const connect = __nccwpck_require__(56711); -const spotlight = __nccwpck_require__(23284); -const knex = __nccwpck_require__(46350); -const tedious = __nccwpck_require__(78622); -const genericPool = __nccwpck_require__(78505); -const dataloader = __nccwpck_require__(83491); -const amqplib = __nccwpck_require__(40782); -const childProcess = __nccwpck_require__(13557); -const contextManager = __nccwpck_require__(37859); -const instrument = __nccwpck_require__(64074); -const index$4 = __nccwpck_require__(59198); -const initOtel = __nccwpck_require__(16049); -const index$5 = __nccwpck_require__(59020); -const api = __nccwpck_require__(75168); -const module$1 = __nccwpck_require__(64177); -const http = __nccwpck_require__(73009); -const client = __nccwpck_require__(49951); -const index$6 = __nccwpck_require__(51153); +const index$3 = __nccwpck_require__(68798); +const httpServerSpansIntegration = __nccwpck_require__(63939); +const httpServerIntegration = __nccwpck_require__(9237); +const SentryHttpInstrumentation = __nccwpck_require__(17075); +const index$5 = __nccwpck_require__(18285); +const undiciInstrumentation = __nccwpck_require__(84948); +const SentryNodeFetchInstrumentation = __nccwpck_require__(61611); +const contextManager = __nccwpck_require__(10402); +const logger = __nccwpck_require__(48811); +const instrument = __nccwpck_require__(17547); +const index$2 = __nccwpck_require__(88895); +const scope = __nccwpck_require__(62177); +const client = __nccwpck_require__(5789); +const ensureIsWrapped = __nccwpck_require__(23955); +const processSession = __nccwpck_require__(80397); +const opentelemetry = __nccwpck_require__(90157); +const index = __nccwpck_require__(88270); const core = __nccwpck_require__(84466); -const opentelemetry = __nccwpck_require__(78369); +const exports$1 = __nccwpck_require__(31344); +const context = __nccwpck_require__(33141); +const nodeRuntimeMetrics = __nccwpck_require__(59087); +const contextlines = __nccwpck_require__(23751); +const index$4 = __nccwpck_require__(43482); +const modules = __nccwpck_require__(82516); +const onuncaughtexception = __nccwpck_require__(93244); +const onunhandledrejection = __nccwpck_require__(68319); +const spotlight = __nccwpck_require__(27254); +const systemError = __nccwpck_require__(8651); +const childProcess = __nccwpck_require__(57342); +const winston = __nccwpck_require__(52453); +const pino = __nccwpck_require__(44906); +const console = __nccwpck_require__(48597); +const api = __nccwpck_require__(50320); +const module$1 = __nccwpck_require__(53376); +const addOriginToSpan = __nccwpck_require__(59528); +const esmLoader = __nccwpck_require__(91196); +const createMissingInstrumentationContext = __nccwpck_require__(94192); +const http = __nccwpck_require__(87973); +const index$1 = __nccwpck_require__(28607); +const nodeVersion = __nccwpck_require__(61523); -exports.httpIntegration = index.httpIntegration; -exports.nativeNodeFetchIntegration = nodeFetch.nativeNodeFetchIntegration; -exports.fsIntegration = fs.fsIntegration; -exports.consoleIntegration = console.consoleIntegration; -exports.nodeContextIntegration = context.nodeContextIntegration; -exports.contextLinesIntegration = contextlines.contextLinesIntegration; -exports.localVariablesIntegration = index$1.localVariablesIntegration; -exports.modulesIntegration = modules.modulesIntegration; -exports.onUncaughtExceptionIntegration = onuncaughtexception.onUncaughtExceptionIntegration; -exports.onUnhandledRejectionIntegration = onunhandledrejection.onUnhandledRejectionIntegration; -exports.anrIntegration = index$2.anrIntegration; -exports.disableAnrDetectionForCallback = index$2.disableAnrDetectionForCallback; -exports.expressErrorHandler = express.expressErrorHandler; -exports.expressIntegration = express.expressIntegration; -exports.setupExpressErrorHandler = express.setupExpressErrorHandler; -exports.fastifyIntegration = fastify.fastifyIntegration; -exports.setupFastifyErrorHandler = fastify.setupFastifyErrorHandler; -exports.graphqlIntegration = graphql.graphqlIntegration; -exports.kafkaIntegration = kafka.kafkaIntegration; -exports.lruMemoizerIntegration = lrumemoizer.lruMemoizerIntegration; -exports.mongoIntegration = mongo.mongoIntegration; -exports.mongooseIntegration = mongoose.mongooseIntegration; -exports.mysqlIntegration = mysql.mysqlIntegration; -exports.mysql2Integration = mysql2.mysql2Integration; -exports.redisIntegration = redis.redisIntegration; -exports.nestIntegration = nest.nestIntegration; -exports.setupNestErrorHandler = nest.setupNestErrorHandler; -exports.postgresIntegration = postgres.postgresIntegration; -exports.prismaIntegration = prisma.prismaIntegration; -exports.hapiIntegration = index$3.hapiIntegration; -exports.setupHapiErrorHandler = index$3.setupHapiErrorHandler; -exports.koaIntegration = koa.koaIntegration; -exports.setupKoaErrorHandler = koa.setupKoaErrorHandler; -exports.connectIntegration = connect.connectIntegration; -exports.setupConnectErrorHandler = connect.setupConnectErrorHandler; -exports.spotlightIntegration = spotlight.spotlightIntegration; -exports.knexIntegration = knex.knexIntegration; -exports.tediousIntegration = tedious.tediousIntegration; -exports.genericPoolIntegration = genericPool.genericPoolIntegration; -exports.dataloaderIntegration = dataloader.dataloaderIntegration; -exports.amqplibIntegration = amqplib.amqplibIntegration; -exports.childProcessIntegration = childProcess.childProcessIntegration; -exports.processThreadBreadcrumbIntegration = childProcess.processThreadBreadcrumbIntegration; +exports.httpIntegration = index$3.httpIntegration; +exports.httpServerSpansIntegration = httpServerSpansIntegration.httpServerSpansIntegration; +exports.httpServerIntegration = httpServerIntegration.httpServerIntegration; +exports.SentryHttpInstrumentation = SentryHttpInstrumentation.SentryHttpInstrumentation; +exports.instrumentHttpOutgoingRequests = SentryHttpInstrumentation.instrumentHttpOutgoingRequests; +exports.nativeNodeFetchIntegration = index$5.nativeNodeFetchIntegration; +exports.instrumentUndici = undiciInstrumentation.instrumentUndici; +exports.SentryNodeFetchInstrumentation = SentryNodeFetchInstrumentation.SentryNodeFetchInstrumentation; exports.SentryContextManager = contextManager.SentryContextManager; +exports.setupOpenTelemetryLogger = logger.setupOpenTelemetryLogger; +exports.INSTRUMENTED = instrument.INSTRUMENTED; exports.generateInstrumentOnce = instrument.generateInstrumentOnce; -exports.getDefaultIntegrations = index$4.getDefaultIntegrations; -exports.getDefaultIntegrationsWithoutPerformance = index$4.getDefaultIntegrationsWithoutPerformance; -exports.init = index$4.init; -exports.initWithoutDefaultIntegrations = index$4.initWithoutDefaultIntegrations; -exports.validateOpenTelemetrySetup = index$4.validateOpenTelemetrySetup; -exports.initOpenTelemetry = initOtel.initOpenTelemetry; -exports.preloadOpenTelemetry = initOtel.preloadOpenTelemetry; -exports.getAutoPerformanceIntegrations = index$5.getAutoPerformanceIntegrations; -exports.defaultStackParser = api.defaultStackParser; -exports.getSentryRelease = api.getSentryRelease; -exports.createGetModuleFromFilename = module$1.createGetModuleFromFilename; -exports.makeNodeTransport = http.makeNodeTransport; +exports.instrumentWhenWrapped = instrument.instrumentWhenWrapped; +exports.getDefaultIntegrations = index$2.getDefaultIntegrations; +exports.init = index$2.init; +exports.initWithoutDefaultIntegrations = index$2.initWithoutDefaultIntegrations; +exports.validateOpenTelemetrySetup = index$2.validateOpenTelemetrySetup; +exports.setIsolationScope = scope.setIsolationScope; exports.NodeClient = client.NodeClient; -exports.cron = index$6.cron; -exports.DEFAULT_USER_INCLUDES = core.DEFAULT_USER_INCLUDES; +exports.ensureIsWrapped = ensureIsWrapped.ensureIsWrapped; +exports.processSessionIntegration = processSession.processSessionIntegration; +exports.setNodeAsyncContextStrategy = opentelemetry.setOpenTelemetryContextAsyncContextStrategy; +exports.anrIntegration = index.anrIntegration; +exports.disableAnrDetectionForCallback = index.disableAnrDetectionForCallback; exports.SDK_VERSION = core.SDK_VERSION; exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = core.SEMANTIC_ATTRIBUTE_SENTRY_OP; exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN; @@ -82957,7 +41715,7 @@ exports.Scope = core.Scope; exports.addBreadcrumb = core.addBreadcrumb; exports.addEventProcessor = core.addEventProcessor; exports.addIntegration = core.addIntegration; -exports.addRequestDataToEvent = core.addRequestDataToEvent; +exports.bindScopeToEmitter = core.bindScopeToEmitter; exports.captureCheckIn = core.captureCheckIn; exports.captureConsoleIntegration = core.captureConsoleIntegration; exports.captureEvent = core.captureEvent; @@ -82966,36 +41724,42 @@ exports.captureFeedback = core.captureFeedback; exports.captureMessage = core.captureMessage; exports.captureSession = core.captureSession; exports.close = core.close; +exports.consoleLoggingIntegration = core.consoleLoggingIntegration; exports.continueTrace = core.continueTrace; +exports.createConsolaReporter = core.createConsolaReporter; exports.createTransport = core.createTransport; -exports.debugIntegration = core.debugIntegration; exports.dedupeIntegration = core.dedupeIntegration; exports.endSession = core.endSession; +exports.envToBool = core.envToBool; +exports.eventFiltersIntegration = core.eventFiltersIntegration; exports.extraErrorDataIntegration = core.extraErrorDataIntegration; -exports.extractRequestData = core.extractRequestData; +exports.featureFlagsIntegration = core.featureFlagsIntegration; exports.flush = core.flush; exports.functionToStringIntegration = core.functionToStringIntegration; exports.getActiveSpan = core.getActiveSpan; exports.getClient = core.getClient; -exports.getCurrentHub = core.getCurrentHub; exports.getCurrentScope = core.getCurrentScope; exports.getGlobalScope = core.getGlobalScope; exports.getIsolationScope = core.getIsolationScope; +exports.getRequestUrl = core.getRequestUrl; exports.getRootSpan = core.getRootSpan; exports.getSpanDescendants = core.getSpanDescendants; exports.getSpanStatusFromHttpCode = core.getSpanStatusFromHttpCode; exports.getTraceData = core.getTraceData; exports.getTraceMetaTags = core.getTraceMetaTags; exports.inboundFiltersIntegration = core.inboundFiltersIntegration; +exports.instrumentSupabaseClient = core.instrumentSupabaseClient; +exports.isEnabled = core.isEnabled; exports.isInitialized = core.isInitialized; exports.lastEventId = core.lastEventId; exports.linkedErrorsIntegration = core.linkedErrorsIntegration; -exports.metrics = core.metricsDefault; +exports.metrics = core.metrics; exports.parameterize = core.parameterize; exports.profiler = core.profiler; exports.requestDataIntegration = core.requestDataIntegration; exports.rewriteFramesIntegration = core.rewriteFramesIntegration; -exports.sessionTimingIntegration = core.sessionTimingIntegration; +exports.setAttribute = core.setAttribute; +exports.setAttributes = core.setAttributes; exports.setContext = core.setContext; exports.setCurrentClient = core.setCurrentClient; exports.setExtra = core.setExtra; @@ -83005,6 +41769,7 @@ exports.setMeasurement = core.setMeasurement; exports.setTag = core.setTag; exports.setTags = core.setTags; exports.setUser = core.setUser; +exports.spanStreamingIntegration = core.spanStreamingIntegration; exports.spanToBaggageHeader = core.spanToBaggageHeader; exports.spanToJSON = core.spanToJSON; exports.spanToTraceHeader = core.spanToTraceHeader; @@ -83013,6 +41778,7 @@ exports.startNewTrace = core.startNewTrace; exports.startSession = core.startSession; exports.startSpan = core.startSpan; exports.startSpanManual = core.startSpanManual; +exports.supabaseIntegration = core.supabaseIntegration; exports.suppressTracing = core.suppressTracing; exports.trpcMiddleware = core.trpcMiddleware; exports.updateSpanName = core.updateSpanName; @@ -83020,162 +41786,131 @@ exports.withActiveSpan = core.withActiveSpan; exports.withIsolationScope = core.withIsolationScope; exports.withMonitor = core.withMonitor; exports.withScope = core.withScope; +exports.withStreamedSpan = core.withStreamedSpan; +exports.wrapMcpServerWithSentry = core.wrapMcpServerWithSentry; exports.zodErrorsIntegration = core.zodErrorsIntegration; -exports.addOpenTelemetryInstrumentation = opentelemetry.addOpenTelemetryInstrumentation; -exports.setNodeAsyncContextStrategy = opentelemetry.setOpenTelemetryContextAsyncContextStrategy; +exports.logger = exports$1; +exports.nodeContextIntegration = context.nodeContextIntegration; +exports._INTERNAL_normalizeCollectionInterval = nodeRuntimeMetrics._INTERNAL_normalizeCollectionInterval; +exports.nodeRuntimeMetricsIntegration = nodeRuntimeMetrics.nodeRuntimeMetricsIntegration; +exports.contextLinesIntegration = contextlines.contextLinesIntegration; +exports.localVariablesIntegration = index$4.localVariablesIntegration; +exports.modulesIntegration = modules.modulesIntegration; +exports.onUncaughtExceptionIntegration = onuncaughtexception.onUncaughtExceptionIntegration; +exports.onUnhandledRejectionIntegration = onunhandledrejection.onUnhandledRejectionIntegration; +exports.spotlightIntegration = spotlight.spotlightIntegration; +exports.systemErrorIntegration = systemError.systemErrorIntegration; +exports.childProcessIntegration = childProcess.childProcessIntegration; +exports.createSentryWinstonTransport = winston.createSentryWinstonTransport; +exports.pinoIntegration = pino.pinoIntegration; +exports.consoleIntegration = console.consoleIntegration; +exports.defaultStackParser = api.defaultStackParser; +exports.getSentryRelease = api.getSentryRelease; +exports.createGetModuleFromFilename = module$1.createGetModuleFromFilename; +exports.addOriginToSpan = addOriginToSpan.addOriginToSpan; +exports.initializeEsmLoader = esmLoader.initializeEsmLoader; +exports.createMissingInstrumentationContext = createMissingInstrumentationContext.createMissingInstrumentationContext; +exports.makeNodeTransport = http.makeNodeTransport; +exports.cron = index$1.cron; +exports.NODE_VERSION = nodeVersion.NODE_VERSION; //# sourceMappingURL=index.js.map /***/ }), -/***/ 83835: +/***/ 88270: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain, - _optionalChainDelete -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const util = __nccwpck_require__(47261); const node_worker_threads = __nccwpck_require__(24086); const core = __nccwpck_require__(84466); -const nodeVersion = __nccwpck_require__(88196); -const debug = __nccwpck_require__(75915); +const nodeVersion = __nccwpck_require__(61523); +const debug = __nccwpck_require__(10992); const { isPromise } = util.types; - -// This string is a placeholder that gets overwritten with the worker code. -const base64WorkerScript = 'LyohIEBzZW50cnkvbm9kZSA4LjU0LjAgKGU5YTQ1ZmUpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyB0fWZyb20ibm9kZTppbnNwZWN0b3IiO2ltcG9ydHtwYXJlbnRQb3J0IGFzIG4sd29ya2VyRGF0YSBhcyBlfWZyb20ibm9kZTp3b3JrZXJfdGhyZWFkcyI7aW1wb3J0e3Bvc2l4IGFzIHIsc2VwIGFzIG99ZnJvbSJub2RlOnBhdGgiO2ltcG9ydCphcyBzIGZyb20ibm9kZTpodHRwIjtpbXBvcnQqYXMgaSBmcm9tIm5vZGU6aHR0cHMiO2ltcG9ydHtSZWFkYWJsZSBhcyBjfWZyb20ibm9kZTpzdHJlYW0iO2ltcG9ydHtjcmVhdGVHemlwIGFzIHV9ZnJvbSJub2RlOnpsaWIiO2ltcG9ydCphcyBhIGZyb20ibm9kZTpuZXQiO2ltcG9ydCphcyBmIGZyb20ibm9kZTp0bHMiO2NvbnN0IGg9InVuZGVmaW5lZCI9PXR5cGVvZiBfX1NFTlRSWV9ERUJVR19ffHxfX1NFTlRSWV9ERUJVR19fLHA9IjguNTQuMCIsbD1nbG9iYWxUaGlzO2Z1bmN0aW9uIGQodCxuLGUpe2NvbnN0IHI9bCxvPXIuX19TRU5UUllfXz1yLl9fU0VOVFJZX198fHt9LHM9b1twXT1vW3BdfHx7fTtyZXR1cm4gc1t0XXx8KHNbdF09bigpKX1jb25zdCBtPSJ1bmRlZmluZWQiPT10eXBlb2YgX19TRU5UUllfREVCVUdfX3x8X19TRU5UUllfREVCVUdfXyx5PVsiZGVidWciLCJpbmZvIiwid2FybiIsImVycm9yIiwibG9nIiwiYXNzZXJ0IiwidHJhY2UiXSxnPXt9O2Z1bmN0aW9uIGIodCl7aWYoISgiY29uc29sZSJpbiBsKSlyZXR1cm4gdCgpO2NvbnN0IG49bC5jb25zb2xlLGU9e30scj1PYmplY3Qua2V5cyhnKTtyLmZvckVhY2goKHQ9Pntjb25zdCByPWdbdF07ZVt0XT1uW3RdLG5bdF09cn0pKTt0cnl7cmV0dXJuIHQoKX1maW5hbGx5e3IuZm9yRWFjaCgodD0+e25bdF09ZVt0XX0pKX19Y29uc3QgXz1kKCJsb2dnZXIiLChmdW5jdGlvbigpe2xldCB0PSExO2NvbnN0IG49e2VuYWJsZTooKT0+e3Q9ITB9LGRpc2FibGU6KCk9Pnt0PSExfSxpc0VuYWJsZWQ6KCk9PnR9O3JldHVybiBtP3kuZm9yRWFjaCgoZT0+e25bZV09KC4uLm4pPT57dCYmYigoKCk9PntsLmNvbnNvbGVbZV0oYFNlbnRyeSBMb2dnZXIgWyR7ZX1dOmAsLi4ubil9KSl9fSkpOnkuZm9yRWFjaCgodD0+e25bdF09KCk9Pnt9fSkpLG59KSksdj01MCx3PSI/IixTPS9jYXB0dXJlTWVzc2FnZXxjYXB0dXJlRXhjZXB0aW9uLztmdW5jdGlvbiAkKHQpe3JldHVybiB0W3QubGVuZ3RoLTFdfHx7fX1jb25zdCBFPSI8YW5vbnltb3VzPiI7ZnVuY3Rpb24geCgpe3JldHVybiBOKGwpLGx9ZnVuY3Rpb24gTih0KXtjb25zdCBuPXQuX19TRU5UUllfXz10Ll9fU0VOVFJZX198fHt9O3JldHVybiBuLnZlcnNpb249bi52ZXJzaW9ufHxwLG5bcF09bltwXXx8e319Y29uc3QgVD1PYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO2Z1bmN0aW9uIEModCxuKXtyZXR1cm4gVC5jYWxsKHQpPT09YFtvYmplY3QgJHtufV1gfWZ1bmN0aW9uIGoodCl7cmV0dXJuIEModCwiU3RyaW5nIil9ZnVuY3Rpb24gayh0KXtyZXR1cm4gQyh0LCJPYmplY3QiKX1mdW5jdGlvbiBSKHQpe3JldHVybiBCb29sZWFuKHQmJnQudGhlbiYmImZ1bmN0aW9uIj09dHlwZW9mIHQudGhlbil9ZnVuY3Rpb24gTyh0LG4pe3RyeXtyZXR1cm4gdCBpbnN0YW5jZW9mIG59Y2F0Y2godCl7cmV0dXJuITF9fWNvbnN0IEQ9bCxBPTgwO2Z1bmN0aW9uIEkodCxuKXtjb25zdCBlPXQscj1bXTtpZighZXx8IWUudGFnTmFtZSlyZXR1cm4iIjtpZihELkhUTUxFbGVtZW50JiZlIGluc3RhbmNlb2YgSFRNTEVsZW1lbnQmJmUuZGF0YXNldCl7aWYoZS5kYXRhc2V0LnNlbnRyeUNvbXBvbmVudClyZXR1cm4gZS5kYXRhc2V0LnNlbnRyeUNvbXBvbmVudDtpZihlLmRhdGFzZXQuc2VudHJ5RWxlbWVudClyZXR1cm4gZS5kYXRhc2V0LnNlbnRyeUVsZW1lbnR9ci5wdXNoKGUudGFnTmFtZS50b0xvd2VyQ2FzZSgpKTtjb25zdCBvPW4mJm4ubGVuZ3RoP24uZmlsdGVyKCh0PT5lLmdldEF0dHJpYnV0ZSh0KSkpLm1hcCgodD0+W3QsZS5nZXRBdHRyaWJ1dGUodCldKSk6bnVsbDtpZihvJiZvLmxlbmd0aClvLmZvckVhY2goKHQ9PntyLnB1c2goYFske3RbMF19PSIke3RbMV19Il1gKX0pKTtlbHNle2UuaWQmJnIucHVzaChgIyR7ZS5pZH1gKTtjb25zdCB0PWUuY2xhc3NOYW1lO2lmKHQmJmoodCkpe2NvbnN0IG49dC5zcGxpdCgvXHMrLyk7Zm9yKGNvbnN0IHQgb2YgbilyLnB1c2goYC4ke3R9YCl9fWNvbnN0IHM9WyJhcmlhLWxhYmVsIiwidHlwZSIsIm5hbWUiLCJ0aXRsZSIsImFsdCJdO2Zvcihjb25zdCB0IG9mIHMpe2NvbnN0IG49ZS5nZXRBdHRyaWJ1dGUodCk7biYmci5wdXNoKGBbJHt0fT0iJHtufSJdYCl9cmV0dXJuIHIuam9pbigiIil9ZnVuY3Rpb24gUCh0KXtpZihmdW5jdGlvbih0KXtzd2l0Y2goVC5jYWxsKHQpKXtjYXNlIltvYmplY3QgRXJyb3JdIjpjYXNlIltvYmplY3QgRXhjZXB0aW9uXSI6Y2FzZSJbb2JqZWN0IERPTUV4Y2VwdGlvbl0iOmNhc2UiW29iamVjdCBXZWJBc3NlbWJseS5FeGNlcHRpb25dIjpyZXR1cm4hMDtkZWZhdWx0OnJldHVybiBPKHQsRXJyb3IpfX0odCkpcmV0dXJue21lc3NhZ2U6dC5tZXNzYWdlLG5hbWU6dC5uYW1lLHN0YWNrOnQuc3RhY2ssLi4uTSh0KX07aWYobj10LCJ1bmRlZmluZWQiIT10eXBlb2YgRXZlbnQmJk8obixFdmVudCkpe2NvbnN0IG49e3R5cGU6dC50eXBlLHRhcmdldDpVKHQudGFyZ2V0KSxjdXJyZW50VGFyZ2V0OlUodC5jdXJyZW50VGFyZ2V0KSwuLi5NKHQpfTtyZXR1cm4idW5kZWZpbmVkIiE9dHlwZW9mIEN1c3RvbUV2ZW50JiZPKHQsQ3VzdG9tRXZlbnQpJiYobi5kZXRhaWw9dC5kZXRhaWwpLG59cmV0dXJuIHQ7dmFyIG59ZnVuY3Rpb24gVSh0KXt0cnl7cmV0dXJuIG49dCwidW5kZWZpbmVkIiE9dHlwZW9mIEVsZW1lbnQmJk8obixFbGVtZW50KT9mdW5jdGlvbih0LG49e30pe2lmKCF0KXJldHVybiI8dW5rbm93bj4iO3RyeXtsZXQgZT10O2NvbnN0IHI9NSxvPVtdO2xldCBzPTAsaT0wO2NvbnN0IGM9IiA+ICIsdT1jLmxlbmd0aDtsZXQgYTtjb25zdCBmPUFycmF5LmlzQXJyYXkobik/bjpuLmtleUF0dHJzLGg9IUFycmF5LmlzQXJyYXkobikmJm4ubWF4U3RyaW5nTGVuZ3RofHxBO2Zvcig7ZSYmcysrPHImJihhPUkoZSxmKSwhKCJodG1sIj09PWF8fHM+MSYmaStvLmxlbmd0aCp1K2EubGVuZ3RoPj1oKSk7KW8ucHVzaChhKSxpKz1hLmxlbmd0aCxlPWUucGFyZW50Tm9kZTtyZXR1cm4gby5yZXZlcnNlKCkuam9pbihjKX1jYXRjaCh0KXtyZXR1cm4iPHVua25vd24+In19KHQpOk9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbCh0KX1jYXRjaCh0KXtyZXR1cm4iPHVua25vd24+In12YXIgbn1mdW5jdGlvbiBNKHQpe2lmKCJvYmplY3QiPT10eXBlb2YgdCYmbnVsbCE9PXQpe2NvbnN0IG49e307Zm9yKGNvbnN0IGUgaW4gdClPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodCxlKSYmKG5bZV09dFtlXSk7cmV0dXJuIG59cmV0dXJue319ZnVuY3Rpb24gTCh0KXtyZXR1cm4gQih0LG5ldyBNYXApfWZ1bmN0aW9uIEIodCxuKXtpZihmdW5jdGlvbih0KXtpZighayh0KSlyZXR1cm4hMTt0cnl7Y29uc3Qgbj1PYmplY3QuZ2V0UHJvdG90eXBlT2YodCkuY29uc3RydWN0b3IubmFtZTtyZXR1cm4hbnx8Ik9iamVjdCI9PT1ufWNhdGNoKHQpe3JldHVybiEwfX0odCkpe2NvbnN0IGU9bi5nZXQodCk7aWYodm9pZCAwIT09ZSlyZXR1cm4gZTtjb25zdCByPXt9O24uc2V0KHQscik7Zm9yKGNvbnN0IGUgb2YgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXModCkpdm9pZCAwIT09dFtlXSYmKHJbZV09Qih0W2VdLG4pKTtyZXR1cm4gcn1pZihBcnJheS5pc0FycmF5KHQpKXtjb25zdCBlPW4uZ2V0KHQpO2lmKHZvaWQgMCE9PWUpcmV0dXJuIGU7Y29uc3Qgcj1bXTtyZXR1cm4gbi5zZXQodCxyKSx0LmZvckVhY2goKHQ9PntyLnB1c2goQih0LG4pKX0pKSxyfXJldHVybiB0fWNvbnN0IEc9MWUzO2Z1bmN0aW9uIEooKXtyZXR1cm4gRGF0ZS5ub3coKS9HfWNvbnN0IFk9ZnVuY3Rpb24oKXtjb25zdHtwZXJmb3JtYW5jZTp0fT1sO2lmKCF0fHwhdC5ub3cpcmV0dXJuIEo7Y29uc3Qgbj1EYXRlLm5vdygpLXQubm93KCksZT1udWxsPT10LnRpbWVPcmlnaW4/bjp0LnRpbWVPcmlnaW47cmV0dXJuKCk9PihlK3Qubm93KCkpL0d9KCk7ZnVuY3Rpb24geigpe2NvbnN0IHQ9bCxuPXQuY3J5cHRvfHx0Lm1zQ3J5cHRvO2xldCBlPSgpPT4xNipNYXRoLnJhbmRvbSgpO3RyeXtpZihuJiZuLnJhbmRvbVVVSUQpcmV0dXJuIG4ucmFuZG9tVVVJRCgpLnJlcGxhY2UoLy0vZywiIik7biYmbi5nZXRSYW5kb21WYWx1ZXMmJihlPSgpPT57Y29uc3QgdD1uZXcgVWludDhBcnJheSgxKTtyZXR1cm4gbi5nZXRSYW5kb21WYWx1ZXModCksdFswXX0pfWNhdGNoKHQpe31yZXR1cm4oWzFlN10rMWUzKzRlMys4ZTMrMWUxMSkucmVwbGFjZSgvWzAxOF0vZywodD0+KHReKDE1JmUoKSk+PnQvNCkudG9TdHJpbmcoMTYpKSl9dmFyIEg7ZnVuY3Rpb24gVyh0KXtyZXR1cm4gbmV3IEYoKG49PntuKHQpfSkpfSgoKT0+e2NvbnN0e3BlcmZvcm1hbmNlOnR9PWw7aWYoIXR8fCF0Lm5vdylyZXR1cm47Y29uc3Qgbj0zNmU1LGU9dC5ub3coKSxyPURhdGUubm93KCksbz10LnRpbWVPcmlnaW4/TWF0aC5hYnModC50aW1lT3JpZ2luK2Utcik6bixzPW88bixpPXQudGltaW5nJiZ0LnRpbWluZy5uYXZpZ2F0aW9uU3RhcnQsYz0ibnVtYmVyIj09dHlwZW9mIGk/TWF0aC5hYnMoaStlLXIpOm47KHN8fGM8bikmJihvPD1jJiZ0LnRpbWVPcmlnaW4pfSkoKSxmdW5jdGlvbih0KXt0W3QuUEVORElORz0wXT0iUEVORElORyI7dFt0LlJFU09MVkVEPTFdPSJSRVNPTFZFRCI7dFt0LlJFSkVDVEVEPTJdPSJSRUpFQ1RFRCJ9KEh8fChIPXt9KSk7Y2xhc3MgRntjb25zdHJ1Y3Rvcih0KXtGLnByb3RvdHlwZS5fX2luaXQuY2FsbCh0aGlzKSxGLnByb3RvdHlwZS5fX2luaXQyLmNhbGwodGhpcyksRi5wcm90b3R5cGUuX19pbml0My5jYWxsKHRoaXMpLEYucHJvdG90eXBlLl9faW5pdDQuY2FsbCh0aGlzKSx0aGlzLnQ9SC5QRU5ESU5HLHRoaXMubz1bXTt0cnl7dCh0aGlzLmksdGhpcy51KX1jYXRjaCh0KXt0aGlzLnUodCl9fXRoZW4odCxuKXtyZXR1cm4gbmV3IEYoKChlLHIpPT57dGhpcy5vLnB1c2goWyExLG49PntpZih0KXRyeXtlKHQobikpfWNhdGNoKHQpe3IodCl9ZWxzZSBlKG4pfSx0PT57aWYobil0cnl7ZShuKHQpKX1jYXRjaCh0KXtyKHQpfWVsc2Ugcih0KX1dKSx0aGlzLmgoKX0pKX1jYXRjaCh0KXtyZXR1cm4gdGhpcy50aGVuKCh0PT50KSx0KX1maW5hbGx5KHQpe3JldHVybiBuZXcgRigoKG4sZSk9PntsZXQgcixvO3JldHVybiB0aGlzLnRoZW4oKG49PntvPSExLHI9bix0JiZ0KCl9KSwobj0+e289ITAscj1uLHQmJnQoKX0pKS50aGVuKCgoKT0+e28/ZShyKTpuKHIpfSkpfSkpfV9faW5pdCgpe3RoaXMuaT10PT57dGhpcy5wKEguUkVTT0xWRUQsdCl9fV9faW5pdDIoKXt0aGlzLnU9dD0+e3RoaXMucChILlJFSkVDVEVELHQpfX1fX2luaXQzKCl7dGhpcy5wPSh0LG4pPT57dGhpcy50PT09SC5QRU5ESU5HJiYoUihuKT9uLnRoZW4odGhpcy5pLHRoaXMudSk6KHRoaXMudD10LHRoaXMubD1uLHRoaXMuaCgpKSl9fV9faW5pdDQoKXt0aGlzLmg9KCk9PntpZih0aGlzLnQ9PT1ILlBFTkRJTkcpcmV0dXJuO2NvbnN0IHQ9dGhpcy5vLnNsaWNlKCk7dGhpcy5vPVtdLHQuZm9yRWFjaCgodD0+e3RbMF18fCh0aGlzLnQ9PT1ILlJFU09MVkVEJiZ0WzFdKHRoaXMubCksdGhpcy50PT09SC5SRUpFQ1RFRCYmdFsyXSh0aGlzLmwpLHRbMF09ITApfSkpfX19ZnVuY3Rpb24gSyh0KXtjb25zdCBuPVkoKSxlPXtzaWQ6eigpLGluaXQ6ITAsdGltZXN0YW1wOm4sc3RhcnRlZDpuLGR1cmF0aW9uOjAsc3RhdHVzOiJvayIsZXJyb3JzOjAsaWdub3JlRHVyYXRpb246ITEsdG9KU09OOigpPT5mdW5jdGlvbih0KXtyZXR1cm4gTCh7c2lkOmAke3Quc2lkfWAsaW5pdDp0LmluaXQsc3RhcnRlZDpuZXcgRGF0ZSgxZTMqdC5zdGFydGVkKS50b0lTT1N0cmluZygpLHRpbWVzdGFtcDpuZXcgRGF0ZSgxZTMqdC50aW1lc3RhbXApLnRvSVNPU3RyaW5nKCksc3RhdHVzOnQuc3RhdHVzLGVycm9yczp0LmVycm9ycyxkaWQ6Im51bWJlciI9PXR5cGVvZiB0LmRpZHx8InN0cmluZyI9PXR5cGVvZiB0LmRpZD9gJHt0LmRpZH1gOnZvaWQgMCxkdXJhdGlvbjp0LmR1cmF0aW9uLGFibm9ybWFsX21lY2hhbmlzbTp0LmFibm9ybWFsX21lY2hhbmlzbSxhdHRyczp7cmVsZWFzZTp0LnJlbGVhc2UsZW52aXJvbm1lbnQ6dC5lbnZpcm9ubWVudCxpcF9hZGRyZXNzOnQuaXBBZGRyZXNzLHVzZXJfYWdlbnQ6dC51c2VyQWdlbnR9fSl9KGUpfTtyZXR1cm4gdCYmVihlLHQpLGV9ZnVuY3Rpb24gVih0LG49e30pe2lmKG4udXNlciYmKCF0LmlwQWRkcmVzcyYmbi51c2VyLmlwX2FkZHJlc3MmJih0LmlwQWRkcmVzcz1uLnVzZXIuaXBfYWRkcmVzcyksdC5kaWR8fG4uZGlkfHwodC5kaWQ9bi51c2VyLmlkfHxuLnVzZXIuZW1haWx8fG4udXNlci51c2VybmFtZSkpLHQudGltZXN0YW1wPW4udGltZXN0YW1wfHxZKCksbi5hYm5vcm1hbF9tZWNoYW5pc20mJih0LmFibm9ybWFsX21lY2hhbmlzbT1uLmFibm9ybWFsX21lY2hhbmlzbSksbi5pZ25vcmVEdXJhdGlvbiYmKHQuaWdub3JlRHVyYXRpb249bi5pZ25vcmVEdXJhdGlvbiksbi5zaWQmJih0LnNpZD0zMj09PW4uc2lkLmxlbmd0aD9uLnNpZDp6KCkpLHZvaWQgMCE9PW4uaW5pdCYmKHQuaW5pdD1uLmluaXQpLCF0LmRpZCYmbi5kaWQmJih0LmRpZD1gJHtuLmRpZH1gKSwibnVtYmVyIj09dHlwZW9mIG4uc3RhcnRlZCYmKHQuc3RhcnRlZD1uLnN0YXJ0ZWQpLHQuaWdub3JlRHVyYXRpb24pdC5kdXJhdGlvbj12b2lkIDA7ZWxzZSBpZigibnVtYmVyIj09dHlwZW9mIG4uZHVyYXRpb24pdC5kdXJhdGlvbj1uLmR1cmF0aW9uO2Vsc2V7Y29uc3Qgbj10LnRpbWVzdGFtcC10LnN0YXJ0ZWQ7dC5kdXJhdGlvbj1uPj0wP246MH1uLnJlbGVhc2UmJih0LnJlbGVhc2U9bi5yZWxlYXNlKSxuLmVudmlyb25tZW50JiYodC5lbnZpcm9ubWVudD1uLmVudmlyb25tZW50KSwhdC5pcEFkZHJlc3MmJm4uaXBBZGRyZXNzJiYodC5pcEFkZHJlc3M9bi5pcEFkZHJlc3MpLCF0LnVzZXJBZ2VudCYmbi51c2VyQWdlbnQmJih0LnVzZXJBZ2VudD1uLnVzZXJBZ2VudCksIm51bWJlciI9PXR5cGVvZiBuLmVycm9ycyYmKHQuZXJyb3JzPW4uZXJyb3JzKSxuLnN0YXR1cyYmKHQuc3RhdHVzPW4uc3RhdHVzKX1mdW5jdGlvbiBaKCl7cmV0dXJuIHooKX1mdW5jdGlvbiBxKCl7cmV0dXJuIHooKS5zdWJzdHJpbmcoMTYpfWZ1bmN0aW9uIFEodCxuLGU9Mil7aWYoIW58fCJvYmplY3QiIT10eXBlb2Ygbnx8ZTw9MClyZXR1cm4gbjtpZih0JiZuJiYwPT09T2JqZWN0LmtleXMobikubGVuZ3RoKXJldHVybiB0O2NvbnN0IHI9ey4uLnR9O2Zvcihjb25zdCB0IGluIG4pT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG4sdCkmJihyW3RdPVEoclt0XSxuW3RdLGUtMSkpO3JldHVybiByfWNvbnN0IFg9Il9zZW50cnlTcGFuIjtmdW5jdGlvbiB0dCh0LG4pe24/ZnVuY3Rpb24odCxuLGUpe3RyeXtPYmplY3QuZGVmaW5lUHJvcGVydHkodCxuLHt2YWx1ZTplLHdyaXRhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMH0pfWNhdGNoKGUpe20mJl8ubG9nKGBGYWlsZWQgdG8gYWRkIG5vbi1lbnVtZXJhYmxlIHByb3BlcnR5ICIke259IiB0byBvYmplY3RgLHQpfX0odCxYLG4pOmRlbGV0ZSB0W1hdfWZ1bmN0aW9uIG50KHQpe3JldHVybiB0W1hdfWNsYXNzIGV0e2NvbnN0cnVjdG9yKCl7dGhpcy5tPSExLHRoaXMuXz1bXSx0aGlzLnY9W10sdGhpcy5TPVtdLHRoaXMuTj1bXSx0aGlzLlQ9e30sdGhpcy5DPXt9LHRoaXMuaj17fSx0aGlzLms9e30sdGhpcy5SPXt9LHRoaXMuTz17dHJhY2VJZDpaKCksc3BhbklkOnEoKX19Y2xvbmUoKXtjb25zdCB0PW5ldyBldDtyZXR1cm4gdC5TPVsuLi50aGlzLlNdLHQuQz17Li4udGhpcy5DfSx0Lmo9ey4uLnRoaXMuan0sdC5rPXsuLi50aGlzLmt9LHRoaXMuay5mbGFncyYmKHQuay5mbGFncz17dmFsdWVzOlsuLi50aGlzLmsuZmxhZ3MudmFsdWVzXX0pLHQuVD10aGlzLlQsdC5EPXRoaXMuRCx0LkE9dGhpcy5BLHQuST10aGlzLkksdC5QPXRoaXMuUCx0LnY9Wy4uLnRoaXMudl0sdC5VPXRoaXMuVSx0Lk49Wy4uLnRoaXMuTl0sdC5SPXsuLi50aGlzLlJ9LHQuTz17Li4udGhpcy5PfSx0Lk09dGhpcy5NLHQuTD10aGlzLkwsdHQodCxudCh0aGlzKSksdH1zZXRDbGllbnQodCl7dGhpcy5NPXR9c2V0TGFzdEV2ZW50SWQodCl7dGhpcy5MPXR9Z2V0Q2xpZW50KCl7cmV0dXJuIHRoaXMuTX1sYXN0RXZlbnRJZCgpe3JldHVybiB0aGlzLkx9YWRkU2NvcGVMaXN0ZW5lcih0KXt0aGlzLl8ucHVzaCh0KX1hZGRFdmVudFByb2Nlc3Nvcih0KXtyZXR1cm4gdGhpcy52LnB1c2godCksdGhpc31zZXRVc2VyKHQpe3JldHVybiB0aGlzLlQ9dHx8e2VtYWlsOnZvaWQgMCxpZDp2b2lkIDAsaXBfYWRkcmVzczp2b2lkIDAsdXNlcm5hbWU6dm9pZCAwfSx0aGlzLkEmJlYodGhpcy5BLHt1c2VyOnR9KSx0aGlzLkIoKSx0aGlzfWdldFVzZXIoKXtyZXR1cm4gdGhpcy5UfWdldFJlcXVlc3RTZXNzaW9uKCl7cmV0dXJuIHRoaXMuVX1zZXRSZXF1ZXN0U2Vzc2lvbih0KXtyZXR1cm4gdGhpcy5VPXQsdGhpc31zZXRUYWdzKHQpe3JldHVybiB0aGlzLkM9ey4uLnRoaXMuQywuLi50fSx0aGlzLkIoKSx0aGlzfXNldFRhZyh0LG4pe3JldHVybiB0aGlzLkM9ey4uLnRoaXMuQyxbdF06bn0sdGhpcy5CKCksdGhpc31zZXRFeHRyYXModCl7cmV0dXJuIHRoaXMuaj17Li4udGhpcy5qLC4uLnR9LHRoaXMuQigpLHRoaXN9c2V0RXh0cmEodCxuKXtyZXR1cm4gdGhpcy5qPXsuLi50aGlzLmosW3RdOm59LHRoaXMuQigpLHRoaXN9c2V0RmluZ2VycHJpbnQodCl7cmV0dXJuIHRoaXMuUD10LHRoaXMuQigpLHRoaXN9c2V0TGV2ZWwodCl7cmV0dXJuIHRoaXMuRD10LHRoaXMuQigpLHRoaXN9c2V0VHJhbnNhY3Rpb25OYW1lKHQpe3JldHVybiB0aGlzLkk9dCx0aGlzLkIoKSx0aGlzfXNldENvbnRleHQodCxuKXtyZXR1cm4gbnVsbD09PW4/ZGVsZXRlIHRoaXMua1t0XTp0aGlzLmtbdF09bix0aGlzLkIoKSx0aGlzfXNldFNlc3Npb24odCl7cmV0dXJuIHQ/dGhpcy5BPXQ6ZGVsZXRlIHRoaXMuQSx0aGlzLkIoKSx0aGlzfWdldFNlc3Npb24oKXtyZXR1cm4gdGhpcy5BfXVwZGF0ZSh0KXtpZighdClyZXR1cm4gdGhpcztjb25zdCBuPSJmdW5jdGlvbiI9PXR5cGVvZiB0P3QodGhpcyk6dCxbZSxyXT1uIGluc3RhbmNlb2YgcnQ/W24uZ2V0U2NvcGVEYXRhKCksbi5nZXRSZXF1ZXN0U2Vzc2lvbigpXTprKG4pP1t0LHQucmVxdWVzdFNlc3Npb25dOltdLHt0YWdzOm8sZXh0cmE6cyx1c2VyOmksY29udGV4dHM6YyxsZXZlbDp1LGZpbmdlcnByaW50OmE9W10scHJvcGFnYXRpb25Db250ZXh0OmZ9PWV8fHt9O3JldHVybiB0aGlzLkM9ey4uLnRoaXMuQywuLi5vfSx0aGlzLmo9ey4uLnRoaXMuaiwuLi5zfSx0aGlzLms9ey4uLnRoaXMuaywuLi5jfSxpJiZPYmplY3Qua2V5cyhpKS5sZW5ndGgmJih0aGlzLlQ9aSksdSYmKHRoaXMuRD11KSxhLmxlbmd0aCYmKHRoaXMuUD1hKSxmJiYodGhpcy5PPWYpLHImJih0aGlzLlU9ciksdGhpc31jbGVhcigpe3JldHVybiB0aGlzLlM9W10sdGhpcy5DPXt9LHRoaXMuaj17fSx0aGlzLlQ9e30sdGhpcy5rPXt9LHRoaXMuRD12b2lkIDAsdGhpcy5JPXZvaWQgMCx0aGlzLlA9dm9pZCAwLHRoaXMuVT12b2lkIDAsdGhpcy5BPXZvaWQgMCx0dCh0aGlzLHZvaWQgMCksdGhpcy5OPVtdLHRoaXMuc2V0UHJvcGFnYXRpb25Db250ZXh0KHt0cmFjZUlkOlooKX0pLHRoaXMuQigpLHRoaXN9YWRkQnJlYWRjcnVtYih0LG4pe2NvbnN0IGU9Im51bWJlciI9PXR5cGVvZiBuP246MTAwO2lmKGU8PTApcmV0dXJuIHRoaXM7Y29uc3Qgcj17dGltZXN0YW1wOkooKSwuLi50fTtyZXR1cm4gdGhpcy5TLnB1c2gociksdGhpcy5TLmxlbmd0aD5lJiYodGhpcy5TPXRoaXMuUy5zbGljZSgtZSksdGhpcy5NJiZ0aGlzLk0ucmVjb3JkRHJvcHBlZEV2ZW50KCJidWZmZXJfb3ZlcmZsb3ciLCJsb2dfaXRlbSIpKSx0aGlzLkIoKSx0aGlzfWdldExhc3RCcmVhZGNydW1iKCl7cmV0dXJuIHRoaXMuU1t0aGlzLlMubGVuZ3RoLTFdfWNsZWFyQnJlYWRjcnVtYnMoKXtyZXR1cm4gdGhpcy5TPVtdLHRoaXMuQigpLHRoaXN9YWRkQXR0YWNobWVudCh0KXtyZXR1cm4gdGhpcy5OLnB1c2godCksdGhpc31jbGVhckF0dGFjaG1lbnRzKCl7cmV0dXJuIHRoaXMuTj1bXSx0aGlzfWdldFNjb3BlRGF0YSgpe3JldHVybnticmVhZGNydW1iczp0aGlzLlMsYXR0YWNobWVudHM6dGhpcy5OLGNvbnRleHRzOnRoaXMuayx0YWdzOnRoaXMuQyxleHRyYTp0aGlzLmosdXNlcjp0aGlzLlQsbGV2ZWw6dGhpcy5ELGZpbmdlcnByaW50OnRoaXMuUHx8W10sZXZlbnRQcm9jZXNzb3JzOnRoaXMudixwcm9wYWdhdGlvbkNvbnRleHQ6dGhpcy5PLHNka1Byb2Nlc3NpbmdNZXRhZGF0YTp0aGlzLlIsdHJhbnNhY3Rpb25OYW1lOnRoaXMuSSxzcGFuOm50KHRoaXMpfX1zZXRTREtQcm9jZXNzaW5nTWV0YWRhdGEodCl7cmV0dXJuIHRoaXMuUj1RKHRoaXMuUix0LDIpLHRoaXN9c2V0UHJvcGFnYXRpb25Db250ZXh0KHQpe3JldHVybiB0aGlzLk89e3NwYW5JZDpxKCksLi4udH0sdGhpc31nZXRQcm9wYWdhdGlvbkNvbnRleHQoKXtyZXR1cm4gdGhpcy5PfWNhcHR1cmVFeGNlcHRpb24odCxuKXtjb25zdCBlPW4mJm4uZXZlbnRfaWQ/bi5ldmVudF9pZDp6KCk7aWYoIXRoaXMuTSlyZXR1cm4gXy53YXJuKCJObyBjbGllbnQgY29uZmlndXJlZCBvbiBzY29wZSAtIHdpbGwgbm90IGNhcHR1cmUgZXhjZXB0aW9uISIpLGU7Y29uc3Qgcj1uZXcgRXJyb3IoIlNlbnRyeSBzeW50aGV0aWNFeGNlcHRpb24iKTtyZXR1cm4gdGhpcy5NLmNhcHR1cmVFeGNlcHRpb24odCx7b3JpZ2luYWxFeGNlcHRpb246dCxzeW50aGV0aWNFeGNlcHRpb246ciwuLi5uLGV2ZW50X2lkOmV9LHRoaXMpLGV9Y2FwdHVyZU1lc3NhZ2UodCxuLGUpe2NvbnN0IHI9ZSYmZS5ldmVudF9pZD9lLmV2ZW50X2lkOnooKTtpZighdGhpcy5NKXJldHVybiBfLndhcm4oIk5vIGNsaWVudCBjb25maWd1cmVkIG9uIHNjb3BlIC0gd2lsbCBub3QgY2FwdHVyZSBtZXNzYWdlISIpLHI7Y29uc3Qgbz1uZXcgRXJyb3IodCk7cmV0dXJuIHRoaXMuTS5jYXB0dXJlTWVzc2FnZSh0LG4se29yaWdpbmFsRXhjZXB0aW9uOnQsc3ludGhldGljRXhjZXB0aW9uOm8sLi4uZSxldmVudF9pZDpyfSx0aGlzKSxyfWNhcHR1cmVFdmVudCh0LG4pe2NvbnN0IGU9biYmbi5ldmVudF9pZD9uLmV2ZW50X2lkOnooKTtyZXR1cm4gdGhpcy5NPyh0aGlzLk0uY2FwdHVyZUV2ZW50KHQsey4uLm4sZXZlbnRfaWQ6ZX0sdGhpcyksZSk6KF8ud2FybigiTm8gY2xpZW50IGNvbmZpZ3VyZWQgb24gc2NvcGUgLSB3aWxsIG5vdCBjYXB0dXJlIGV2ZW50ISIpLGUpfUIoKXt0aGlzLm18fCh0aGlzLm09ITAsdGhpcy5fLmZvckVhY2goKHQ9Pnt0KHRoaXMpfSkpLHRoaXMubT0hMSl9fWNvbnN0IHJ0PWV0O2NsYXNzIG90e2NvbnN0cnVjdG9yKHQsbil7bGV0IGUscjtlPXR8fG5ldyBydCxyPW58fG5ldyBydCx0aGlzLkc9W3tzY29wZTplfV0sdGhpcy5KPXJ9d2l0aFNjb3BlKHQpe2NvbnN0IG49dGhpcy5ZKCk7bGV0IGU7dHJ5e2U9dChuKX1jYXRjaCh0KXt0aHJvdyB0aGlzLkgoKSx0fXJldHVybiBSKGUpP2UudGhlbigodD0+KHRoaXMuSCgpLHQpKSwodD0+e3Rocm93IHRoaXMuSCgpLHR9KSk6KHRoaXMuSCgpLGUpfWdldENsaWVudCgpe3JldHVybiB0aGlzLmdldFN0YWNrVG9wKCkuY2xpZW50fWdldFNjb3BlKCl7cmV0dXJuIHRoaXMuZ2V0U3RhY2tUb3AoKS5zY29wZX1nZXRJc29sYXRpb25TY29wZSgpe3JldHVybiB0aGlzLkp9Z2V0U3RhY2tUb3AoKXtyZXR1cm4gdGhpcy5HW3RoaXMuRy5sZW5ndGgtMV19WSgpe2NvbnN0IHQ9dGhpcy5nZXRTY29wZSgpLmNsb25lKCk7cmV0dXJuIHRoaXMuRy5wdXNoKHtjbGllbnQ6dGhpcy5nZXRDbGllbnQoKSxzY29wZTp0fSksdH1IKCl7cmV0dXJuISh0aGlzLkcubGVuZ3RoPD0xKSYmISF0aGlzLkcucG9wKCl9fWZ1bmN0aW9uIHN0KCl7Y29uc3QgdD1OKHgoKSk7cmV0dXJuIHQuc3RhY2s9dC5zdGFja3x8bmV3IG90KGQoImRlZmF1bHRDdXJyZW50U2NvcGUiLCgoKT0+bmV3IHJ0KSksZCgiZGVmYXVsdElzb2xhdGlvblNjb3BlIiwoKCk9Pm5ldyBydCkpKX1mdW5jdGlvbiBpdCh0KXtyZXR1cm4gc3QoKS53aXRoU2NvcGUodCl9ZnVuY3Rpb24gY3QodCxuKXtjb25zdCBlPXN0KCk7cmV0dXJuIGUud2l0aFNjb3BlKCgoKT0+KGUuZ2V0U3RhY2tUb3AoKS5zY29wZT10LG4odCkpKSl9ZnVuY3Rpb24gdXQodCl7cmV0dXJuIHN0KCkud2l0aFNjb3BlKCgoKT0+dChzdCgpLmdldElzb2xhdGlvblNjb3BlKCkpKSl9ZnVuY3Rpb24gYXQodCl7Y29uc3Qgbj1OKHQpO3JldHVybiBuLmFjcz9uLmFjczp7d2l0aElzb2xhdGlvblNjb3BlOnV0LHdpdGhTY29wZTppdCx3aXRoU2V0U2NvcGU6Y3Qsd2l0aFNldElzb2xhdGlvblNjb3BlOih0LG4pPT51dChuKSxnZXRDdXJyZW50U2NvcGU6KCk9PnN0KCkuZ2V0U2NvcGUoKSxnZXRJc29sYXRpb25TY29wZTooKT0+c3QoKS5nZXRJc29sYXRpb25TY29wZSgpfX1mdW5jdGlvbiBmdCgpe3JldHVybiBhdCh4KCkpLmdldEN1cnJlbnRTY29wZSgpLmdldENsaWVudCgpfWNvbnN0IGh0PSJfc2VudHJ5TWV0cmljcyI7ZnVuY3Rpb24gcHQodCl7Y29uc3Qgbj10W2h0XTtpZighbilyZXR1cm47Y29uc3QgZT17fTtmb3IoY29uc3RbLFt0LHJdXW9mIG4peyhlW3RdfHwoZVt0XT1bXSkpLnB1c2goTChyKSl9cmV0dXJuIGV9Y29uc3QgbHQ9InNlbnRyeS5zb3VyY2UiLGR0PSJzZW50cnkuc2FtcGxlX3JhdGUiLG10PSJzZW50cnkub3AiLHl0PSJzZW50cnkub3JpZ2luIixndD0wLGJ0PTEsX3Q9InNlbnRyeS0iLHZ0PS9ec2VudHJ5LS87ZnVuY3Rpb24gd3QodCl7Y29uc3Qgbj1mdW5jdGlvbih0KXtpZighdHx8IWoodCkmJiFBcnJheS5pc0FycmF5KHQpKXJldHVybjtpZihBcnJheS5pc0FycmF5KHQpKXJldHVybiB0LnJlZHVjZSgoKHQsbik9Pntjb25zdCBlPVN0KG4pO3JldHVybiBPYmplY3QuZW50cmllcyhlKS5mb3JFYWNoKCgoW24sZV0pPT57dFtuXT1lfSkpLHR9KSx7fSk7cmV0dXJuIFN0KHQpfSh0KTtpZighbilyZXR1cm47Y29uc3QgZT1PYmplY3QuZW50cmllcyhuKS5yZWR1Y2UoKCh0LFtuLGVdKT0+e2lmKG4ubWF0Y2godnQpKXt0W24uc2xpY2UoX3QubGVuZ3RoKV09ZX1yZXR1cm4gdH0pLHt9KTtyZXR1cm4gT2JqZWN0LmtleXMoZSkubGVuZ3RoPjA/ZTp2b2lkIDB9ZnVuY3Rpb24gU3QodCl7cmV0dXJuIHQuc3BsaXQoIiwiKS5tYXAoKHQ9PnQuc3BsaXQoIj0iKS5tYXAoKHQ9PmRlY29kZVVSSUNvbXBvbmVudCh0LnRyaW0oKSkpKSkpLnJlZHVjZSgoKHQsW24sZV0pPT4obiYmZSYmKHRbbl09ZSksdCkpLHt9KX1jb25zdCAkdD0xO2Z1bmN0aW9uIEV0KHQpe2NvbnN0e3NwYW5JZDpuLHRyYWNlSWQ6ZSxpc1JlbW90ZTpyfT10LnNwYW5Db250ZXh0KCk7cmV0dXJuIEwoe3BhcmVudF9zcGFuX2lkOnI/bjpUdCh0KS5wYXJlbnRfc3Bhbl9pZCxzcGFuX2lkOnI/cSgpOm4sdHJhY2VfaWQ6ZX0pfWZ1bmN0aW9uIHh0KHQpe3JldHVybiJudW1iZXIiPT10eXBlb2YgdD9OdCh0KTpBcnJheS5pc0FycmF5KHQpP3RbMF0rdFsxXS8xZTk6dCBpbnN0YW5jZW9mIERhdGU/TnQodC5nZXRUaW1lKCkpOlkoKX1mdW5jdGlvbiBOdCh0KXtyZXR1cm4gdD45OTk5OTk5OTk5P3QvMWUzOnR9ZnVuY3Rpb24gVHQodCl7aWYoZnVuY3Rpb24odCl7cmV0dXJuImZ1bmN0aW9uIj09dHlwZW9mIHQuZ2V0U3BhbkpTT059KHQpKXJldHVybiB0LmdldFNwYW5KU09OKCk7dHJ5e2NvbnN0e3NwYW5JZDpuLHRyYWNlSWQ6ZX09dC5zcGFuQ29udGV4dCgpO2lmKGZ1bmN0aW9uKHQpe2NvbnN0IG49dDtyZXR1cm4hIShuLmF0dHJpYnV0ZXMmJm4uc3RhcnRUaW1lJiZuLm5hbWUmJm4uZW5kVGltZSYmbi5zdGF0dXMpfSh0KSl7Y29uc3R7YXR0cmlidXRlczpyLHN0YXJ0VGltZTpvLG5hbWU6cyxlbmRUaW1lOmkscGFyZW50U3BhbklkOmMsc3RhdHVzOnV9PXQ7cmV0dXJuIEwoe3NwYW5faWQ6bix0cmFjZV9pZDplLGRhdGE6cixkZXNjcmlwdGlvbjpzLHBhcmVudF9zcGFuX2lkOmMsc3RhcnRfdGltZXN0YW1wOnh0KG8pLHRpbWVzdGFtcDp4dChpKXx8dm9pZCAwLHN0YXR1czpDdCh1KSxvcDpyW210XSxvcmlnaW46clt5dF0sX21ldHJpY3Nfc3VtbWFyeTpwdCh0KX0pfXJldHVybntzcGFuX2lkOm4sdHJhY2VfaWQ6ZX19Y2F0Y2godCl7cmV0dXJue319fWZ1bmN0aW9uIEN0KHQpe2lmKHQmJnQuY29kZSE9PWd0KXJldHVybiB0LmNvZGU9PT1idD8ib2siOnQubWVzc2FnZXx8InVua25vd25fZXJyb3IifWNvbnN0IGp0PSJfc2VudHJ5Um9vdFNwYW4iO2Z1bmN0aW9uIGt0KHQpe3JldHVybiB0W2p0XXx8dH1jb25zdCBSdD0icHJvZHVjdGlvbiIsT3Q9Il9mcm96ZW5Ec2MiO2Z1bmN0aW9uIER0KHQpe2NvbnN0IG49ZnQoKTtpZighbilyZXR1cm57fTtjb25zdCBlPWt0KHQpLHI9ZVtPdF07aWYocilyZXR1cm4gcjtjb25zdCBvPWUuc3BhbkNvbnRleHQoKS50cmFjZVN0YXRlLHM9byYmby5nZXQoInNlbnRyeS5kc2MiKSxpPXMmJnd0KHMpO2lmKGkpcmV0dXJuIGk7Y29uc3QgYz1mdW5jdGlvbih0LG4pe2NvbnN0IGU9bi5nZXRPcHRpb25zKCkse3B1YmxpY0tleTpyfT1uLmdldERzbigpfHx7fSxvPUwoe2Vudmlyb25tZW50OmUuZW52aXJvbm1lbnR8fFJ0LHJlbGVhc2U6ZS5yZWxlYXNlLHB1YmxpY19rZXk6cix0cmFjZV9pZDp0fSk7cmV0dXJuIG4uZW1pdCgiY3JlYXRlRHNjIixvKSxvfSh0LnNwYW5Db250ZXh0KCkudHJhY2VJZCxuKSx1PVR0KGUpLGE9dS5kYXRhfHx7fSxmPWFbZHRdO251bGwhPWYmJihjLnNhbXBsZV9yYXRlPWAke2Z9YCk7Y29uc3QgaD1hW2x0XSxwPXUuZGVzY3JpcHRpb247cmV0dXJuInVybCIhPT1oJiZwJiYoYy50cmFuc2FjdGlvbj1wKSxmdW5jdGlvbih0KXtpZigiYm9vbGVhbiI9PXR5cGVvZiBfX1NFTlRSWV9UUkFDSU5HX18mJiFfX1NFTlRSWV9UUkFDSU5HX18pcmV0dXJuITE7Y29uc3Qgbj1mdCgpLGU9biYmbi5nZXRPcHRpb25zKCk7cmV0dXJuISFlJiYoZS5lbmFibGVUcmFjaW5nfHwidHJhY2VzU2FtcGxlUmF0ZSJpbiBlfHwidHJhY2VzU2FtcGxlciJpbiBlKX0oKSYmKGMuc2FtcGxlZD1TdHJpbmcoZnVuY3Rpb24odCl7Y29uc3R7dHJhY2VGbGFnczpufT10LnNwYW5Db250ZXh0KCk7cmV0dXJuIG49PT0kdH0oZSkpKSxuLmVtaXQoImNyZWF0ZURzYyIsYyxlKSxjfWZ1bmN0aW9uIEF0KHQsbj0hMSl7Y29uc3R7aG9zdDplLHBhdGg6cixwYXNzOm8scG9ydDpzLHByb2plY3RJZDppLHByb3RvY29sOmMscHVibGljS2V5OnV9PXQ7cmV0dXJuYCR7Y306Ly8ke3V9JHtuJiZvP2A6JHtvfWA6IiJ9QCR7ZX0ke3M/YDoke3N9YDoiIn0vJHtyP2Ake3J9L2A6cn0ke2l9YH1mdW5jdGlvbiBJdCh0LG49MTAwLGU9MS8wKXt0cnl7cmV0dXJuIFB0KCIiLHQsbixlKX1jYXRjaCh0KXtyZXR1cm57RVJST1I6YCoqbm9uLXNlcmlhbGl6YWJsZSoqICgke3R9KWB9fX1mdW5jdGlvbiBQdCh0LG4sZT0xLzAscj0xLzAsbz1mdW5jdGlvbigpe2NvbnN0IHQ9ImZ1bmN0aW9uIj09dHlwZW9mIFdlYWtTZXQsbj10P25ldyBXZWFrU2V0OltdO3JldHVybltmdW5jdGlvbihlKXtpZih0KXJldHVybiEhbi5oYXMoZSl8fChuLmFkZChlKSwhMSk7Zm9yKGxldCB0PTA7dDxuLmxlbmd0aDt0KyspaWYoblt0XT09PWUpcmV0dXJuITA7cmV0dXJuIG4ucHVzaChlKSwhMX0sZnVuY3Rpb24oZSl7aWYodCluLmRlbGV0ZShlKTtlbHNlIGZvcihsZXQgdD0wO3Q8bi5sZW5ndGg7dCsrKWlmKG5bdF09PT1lKXtuLnNwbGljZSh0LDEpO2JyZWFrfX1dfSgpKXtjb25zdFtzLGldPW87aWYobnVsbD09bnx8WyJib29sZWFuIiwic3RyaW5nIl0uaW5jbHVkZXModHlwZW9mIG4pfHwibnVtYmVyIj09dHlwZW9mIG4mJk51bWJlci5pc0Zpbml0ZShuKSlyZXR1cm4gbjtjb25zdCBjPWZ1bmN0aW9uKHQsbil7dHJ5e2lmKCJkb21haW4iPT09dCYmbiYmIm9iamVjdCI9PXR5cGVvZiBuJiZuLlcpcmV0dXJuIltEb21haW5dIjtpZigiZG9tYWluRW1pdHRlciI9PT10KXJldHVybiJbRG9tYWluRW1pdHRlcl0iO2lmKCJ1bmRlZmluZWQiIT10eXBlb2YgZ2xvYmFsJiZuPT09Z2xvYmFsKXJldHVybiJbR2xvYmFsXSI7aWYoInVuZGVmaW5lZCIhPXR5cGVvZiB3aW5kb3cmJm49PT13aW5kb3cpcmV0dXJuIltXaW5kb3ddIjtpZigidW5kZWZpbmVkIiE9dHlwZW9mIGRvY3VtZW50JiZuPT09ZG9jdW1lbnQpcmV0dXJuIltEb2N1bWVudF0iO2lmKCJvYmplY3QiPT10eXBlb2YoZT1uKSYmbnVsbCE9PWUmJihlLl9faXNWdWV8fGUuRikpcmV0dXJuIltWdWVWaWV3TW9kZWxdIjtpZihmdW5jdGlvbih0KXtyZXR1cm4gayh0KSYmIm5hdGl2ZUV2ZW50ImluIHQmJiJwcmV2ZW50RGVmYXVsdCJpbiB0JiYic3RvcFByb3BhZ2F0aW9uImluIHR9KG4pKXJldHVybiJbU3ludGhldGljRXZlbnRdIjtpZigibnVtYmVyIj09dHlwZW9mIG4mJiFOdW1iZXIuaXNGaW5pdGUobikpcmV0dXJuYFske259XWA7aWYoImZ1bmN0aW9uIj09dHlwZW9mIG4pcmV0dXJuYFtGdW5jdGlvbjogJHtmdW5jdGlvbih0KXt0cnl7cmV0dXJuIHQmJiJmdW5jdGlvbiI9PXR5cGVvZiB0JiZ0Lm5hbWV8fEV9Y2F0Y2godCl7cmV0dXJuIEV9fShuKX1dYDtpZigic3ltYm9sIj09dHlwZW9mIG4pcmV0dXJuYFske1N0cmluZyhuKX1dYDtpZigiYmlnaW50Ij09dHlwZW9mIG4pcmV0dXJuYFtCaWdJbnQ6ICR7U3RyaW5nKG4pfV1gO2NvbnN0IHI9ZnVuY3Rpb24odCl7Y29uc3Qgbj1PYmplY3QuZ2V0UHJvdG90eXBlT2YodCk7cmV0dXJuIG4/bi5jb25zdHJ1Y3Rvci5uYW1lOiJudWxsIHByb3RvdHlwZSJ9KG4pO3JldHVybi9eSFRNTChcdyopRWxlbWVudCQvLnRlc3Qocik/YFtIVE1MRWxlbWVudDogJHtyfV1gOmBbb2JqZWN0ICR7cn1dYH1jYXRjaCh0KXtyZXR1cm5gKipub24tc2VyaWFsaXphYmxlKiogKCR7dH0pYH12YXIgZX0odCxuKTtpZighYy5zdGFydHNXaXRoKCJbb2JqZWN0ICIpKXJldHVybiBjO2lmKG4uX19zZW50cnlfc2tpcF9ub3JtYWxpemF0aW9uX18pcmV0dXJuIG47Y29uc3QgdT0ibnVtYmVyIj09dHlwZW9mIG4uX19zZW50cnlfb3ZlcnJpZGVfbm9ybWFsaXphdGlvbl9kZXB0aF9fP24uX19zZW50cnlfb3ZlcnJpZGVfbm9ybWFsaXphdGlvbl9kZXB0aF9fOmU7aWYoMD09PXUpcmV0dXJuIGMucmVwbGFjZSgib2JqZWN0ICIsIiIpO2lmKHMobikpcmV0dXJuIltDaXJjdWxhciB+XSI7Y29uc3QgYT1uO2lmKGEmJiJmdW5jdGlvbiI9PXR5cGVvZiBhLnRvSlNPTil0cnl7cmV0dXJuIFB0KCIiLGEudG9KU09OKCksdS0xLHIsbyl9Y2F0Y2godCl7fWNvbnN0IGY9QXJyYXkuaXNBcnJheShuKT9bXTp7fTtsZXQgaD0wO2NvbnN0IHA9UChuKTtmb3IoY29uc3QgdCBpbiBwKXtpZighT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKHAsdCkpY29udGludWU7aWYoaD49cil7Zlt0XT0iW01heFByb3BlcnRpZXMgfl0iO2JyZWFrfWNvbnN0IG49cFt0XTtmW3RdPVB0KHQsbix1LTEscixvKSxoKyt9cmV0dXJuIGkobiksZn1mdW5jdGlvbiBVdCh0LG4pe2NvbnN0IGU9bi5yZXBsYWNlKC9cXC9nLCIvIikucmVwbGFjZSgvW3xcXHt9KClbXF1eJCsqPy5dL2csIlxcJCYiKTtsZXQgcj10O3RyeXtyPWRlY29kZVVSSSh0KX1jYXRjaCh0KXt9cmV0dXJuIHIucmVwbGFjZSgvXFwvZywiLyIpLnJlcGxhY2UoL3dlYnBhY2s6XC8/L2csIiIpLnJlcGxhY2UobmV3IFJlZ0V4cChgKGZpbGU6Ly8pPy8qJHtlfS8qYCwiaWciKSwiYXBwOi8vLyIpfWZ1bmN0aW9uIE10KHQsbj1bXSl7cmV0dXJuW3Qsbl19ZnVuY3Rpb24gTHQodCxuKXtjb25zdCBlPXRbMV07Zm9yKGNvbnN0IHQgb2YgZSl7aWYobih0LHRbMF0udHlwZSkpcmV0dXJuITB9cmV0dXJuITF9ZnVuY3Rpb24gQnQodCl7cmV0dXJuIGwuX19TRU5UUllfXyYmbC5fX1NFTlRSWV9fLmVuY29kZVBvbHlmaWxsP2wuX19TRU5UUllfXy5lbmNvZGVQb2x5ZmlsbCh0KToobmV3IFRleHRFbmNvZGVyKS5lbmNvZGUodCl9ZnVuY3Rpb24gR3QodCl7Y29uc3RbbixlXT10O2xldCByPUpTT04uc3RyaW5naWZ5KG4pO2Z1bmN0aW9uIG8odCl7InN0cmluZyI9PXR5cGVvZiByP3I9InN0cmluZyI9PXR5cGVvZiB0P3IrdDpbQnQociksdF06ci5wdXNoKCJzdHJpbmciPT10eXBlb2YgdD9CdCh0KTp0KX1mb3IoY29uc3QgdCBvZiBlKXtjb25zdFtuLGVdPXQ7aWYobyhgXG4ke0pTT04uc3RyaW5naWZ5KG4pfVxuYCksInN0cmluZyI9PXR5cGVvZiBlfHxlIGluc3RhbmNlb2YgVWludDhBcnJheSlvKGUpO2Vsc2V7bGV0IHQ7dHJ5e3Q9SlNPTi5zdHJpbmdpZnkoZSl9Y2F0Y2gobil7dD1KU09OLnN0cmluZ2lmeShJdChlKSl9byh0KX19cmV0dXJuInN0cmluZyI9PXR5cGVvZiByP3I6ZnVuY3Rpb24odCl7Y29uc3Qgbj10LnJlZHVjZSgoKHQsbik9PnQrbi5sZW5ndGgpLDApLGU9bmV3IFVpbnQ4QXJyYXkobik7bGV0IHI9MDtmb3IoY29uc3QgbiBvZiB0KWUuc2V0KG4scikscis9bi5sZW5ndGg7cmV0dXJuIGV9KHIpfWNvbnN0IEp0PXtzZXNzaW9uOiJzZXNzaW9uIixzZXNzaW9uczoic2Vzc2lvbiIsYXR0YWNobWVudDoiYXR0YWNobWVudCIsdHJhbnNhY3Rpb246InRyYW5zYWN0aW9uIixldmVudDoiZXJyb3IiLGNsaWVudF9yZXBvcnQ6ImludGVybmFsIix1c2VyX3JlcG9ydDoiZGVmYXVsdCIscHJvZmlsZToicHJvZmlsZSIscHJvZmlsZV9jaHVuazoicHJvZmlsZSIscmVwbGF5X2V2ZW50OiJyZXBsYXkiLHJlcGxheV9yZWNvcmRpbmc6InJlcGxheSIsY2hlY2tfaW46Im1vbml0b3IiLGZlZWRiYWNrOiJmZWVkYmFjayIsc3Bhbjoic3BhbiIsc3RhdHNkOiJtZXRyaWNfYnVja2V0IixyYXdfc2VjdXJpdHk6InNlY3VyaXR5In07ZnVuY3Rpb24gWXQodCl7aWYoIXR8fCF0LnNkaylyZXR1cm47Y29uc3R7bmFtZTpuLHZlcnNpb246ZX09dC5zZGs7cmV0dXJue25hbWU6bix2ZXJzaW9uOmV9fWZ1bmN0aW9uIHp0KHQsbixlLHIpe2NvbnN0IG89WXQoZSkscz10LnR5cGUmJiJyZXBsYXlfZXZlbnQiIT09dC50eXBlP3QudHlwZToiZXZlbnQiOyFmdW5jdGlvbih0LG4pe24mJih0LnNkaz10LnNka3x8e30sdC5zZGsubmFtZT10LnNkay5uYW1lfHxuLm5hbWUsdC5zZGsudmVyc2lvbj10LnNkay52ZXJzaW9ufHxuLnZlcnNpb24sdC5zZGsuaW50ZWdyYXRpb25zPVsuLi50LnNkay5pbnRlZ3JhdGlvbnN8fFtdLC4uLm4uaW50ZWdyYXRpb25zfHxbXV0sdC5zZGsucGFja2FnZXM9Wy4uLnQuc2RrLnBhY2thZ2VzfHxbXSwuLi5uLnBhY2thZ2VzfHxbXV0pfSh0LGUmJmUuc2RrKTtjb25zdCBpPWZ1bmN0aW9uKHQsbixlLHIpe2NvbnN0IG89dC5zZGtQcm9jZXNzaW5nTWV0YWRhdGEmJnQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhLmR5bmFtaWNTYW1wbGluZ0NvbnRleHQ7cmV0dXJue2V2ZW50X2lkOnQuZXZlbnRfaWQsc2VudF9hdDoobmV3IERhdGUpLnRvSVNPU3RyaW5nKCksLi4ubiYme3NkazpufSwuLi4hIWUmJnImJntkc246QXQocil9LC4uLm8mJnt0cmFjZTpMKHsuLi5vfSl9fX0odCxvLHIsbik7ZGVsZXRlIHQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhO3JldHVybiBNdChpLFtbe3R5cGU6c30sdF1dKX1jb25zdCBIdD0iX19TRU5UUllfU1VQUFJFU1NfVFJBQ0lOR19fIjtmdW5jdGlvbiBXdCh0KXtjb25zdCBuPWF0KHgoKSk7cmV0dXJuIG4uc3VwcHJlc3NUcmFjaW5nP24uc3VwcHJlc3NUcmFjaW5nKHQpOmZ1bmN0aW9uKC4uLnQpe2NvbnN0IG49YXQoeCgpKTtpZigyPT09dC5sZW5ndGgpe2NvbnN0W2Uscl09dDtyZXR1cm4gZT9uLndpdGhTZXRTY29wZShlLHIpOm4ud2l0aFNjb3BlKHIpfXJldHVybiBuLndpdGhTY29wZSh0WzBdKX0oKG49PihuLnNldFNES1Byb2Nlc3NpbmdNZXRhZGF0YSh7W0h0XTohMH0pLHQoKSkpKX1mdW5jdGlvbiBGdCh0LG4pe2NvbnN0e2ZpbmdlcnByaW50OmUsc3BhbjpyLGJyZWFkY3J1bWJzOm8sc2RrUHJvY2Vzc2luZ01ldGFkYXRhOnN9PW47IWZ1bmN0aW9uKHQsbil7Y29uc3R7ZXh0cmE6ZSx0YWdzOnIsdXNlcjpvLGNvbnRleHRzOnMsbGV2ZWw6aSx0cmFuc2FjdGlvbk5hbWU6Y309bix1PUwoZSk7dSYmT2JqZWN0LmtleXModSkubGVuZ3RoJiYodC5leHRyYT17Li4udSwuLi50LmV4dHJhfSk7Y29uc3QgYT1MKHIpO2EmJk9iamVjdC5rZXlzKGEpLmxlbmd0aCYmKHQudGFncz17Li4uYSwuLi50LnRhZ3N9KTtjb25zdCBmPUwobyk7ZiYmT2JqZWN0LmtleXMoZikubGVuZ3RoJiYodC51c2VyPXsuLi5mLC4uLnQudXNlcn0pO2NvbnN0IGg9TChzKTtoJiZPYmplY3Qua2V5cyhoKS5sZW5ndGgmJih0LmNvbnRleHRzPXsuLi5oLC4uLnQuY29udGV4dHN9KTtpJiYodC5sZXZlbD1pKTtjJiYidHJhbnNhY3Rpb24iIT09dC50eXBlJiYodC50cmFuc2FjdGlvbj1jKX0odCxuKSxyJiZmdW5jdGlvbih0LG4pe3QuY29udGV4dHM9e3RyYWNlOkV0KG4pLC4uLnQuY29udGV4dHN9LHQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhPXtkeW5hbWljU2FtcGxpbmdDb250ZXh0OkR0KG4pLC4uLnQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhfTtjb25zdCBlPWt0KG4pLHI9VHQoZSkuZGVzY3JpcHRpb247ciYmIXQudHJhbnNhY3Rpb24mJiJ0cmFuc2FjdGlvbiI9PT10LnR5cGUmJih0LnRyYW5zYWN0aW9uPXIpfSh0LHIpLGZ1bmN0aW9uKHQsbil7dC5maW5nZXJwcmludD10LmZpbmdlcnByaW50P0FycmF5LmlzQXJyYXkodC5maW5nZXJwcmludCk/dC5maW5nZXJwcmludDpbdC5maW5nZXJwcmludF06W10sbiYmKHQuZmluZ2VycHJpbnQ9dC5maW5nZXJwcmludC5jb25jYXQobikpO3QuZmluZ2VycHJpbnQmJiF0LmZpbmdlcnByaW50Lmxlbmd0aCYmZGVsZXRlIHQuZmluZ2VycHJpbnR9KHQsZSksZnVuY3Rpb24odCxuKXtjb25zdCBlPVsuLi50LmJyZWFkY3J1bWJzfHxbXSwuLi5uXTt0LmJyZWFkY3J1bWJzPWUubGVuZ3RoP2U6dm9pZCAwfSh0LG8pLGZ1bmN0aW9uKHQsbil7dC5zZGtQcm9jZXNzaW5nTWV0YWRhdGE9ey4uLnQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhLC4uLm59fSh0LHMpfWNvbnN0IEt0PSI3IjtjbGFzcyBWdCBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQsbj0id2FybiIpe3N1cGVyKHQpLHRoaXMubWVzc2FnZT10LHRoaXMubG9nTGV2ZWw9bn19ZnVuY3Rpb24gWnQodCl7Y29uc3Qgbj1bXTtmdW5jdGlvbiBlKHQpe3JldHVybiBuLnNwbGljZShuLmluZGV4T2YodCksMSlbMF18fFByb21pc2UucmVzb2x2ZSh2b2lkIDApfXJldHVybnskOm4sYWRkOmZ1bmN0aW9uKHIpe2lmKCEodm9pZCAwPT09dHx8bi5sZW5ndGg8dCkpcmV0dXJuIG89bmV3IFZ0KCJOb3QgYWRkaW5nIFByb21pc2UgYmVjYXVzZSBidWZmZXIgbGltaXQgd2FzIHJlYWNoZWQuIiksbmV3IEYoKCh0LG4pPT57bihvKX0pKTt2YXIgbztjb25zdCBzPXIoKTtyZXR1cm4tMT09PW4uaW5kZXhPZihzKSYmbi5wdXNoKHMpLHMudGhlbigoKCk9PmUocykpKS50aGVuKG51bGwsKCgpPT5lKHMpLnRoZW4obnVsbCwoKCk9Pnt9KSkpKSxzfSxkcmFpbjpmdW5jdGlvbih0KXtyZXR1cm4gbmV3IEYoKChlLHIpPT57bGV0IG89bi5sZW5ndGg7aWYoIW8pcmV0dXJuIGUoITApO2NvbnN0IHM9c2V0VGltZW91dCgoKCk9Pnt0JiZ0PjAmJmUoITEpfSksdCk7bi5mb3JFYWNoKCh0PT57Vyh0KS50aGVuKCgoKT0+ey0tb3x8KGNsZWFyVGltZW91dChzKSxlKCEwKSl9KSxyKX0pKX0pKX19fWNvbnN0IHF0PTZlNDtmdW5jdGlvbiBRdCh0LHtzdGF0dXNDb2RlOm4saGVhZGVyczplfSxyPURhdGUubm93KCkpe2NvbnN0IG89ey4uLnR9LHM9ZSYmZVsieC1zZW50cnktcmF0ZS1saW1pdHMiXSxpPWUmJmVbInJldHJ5LWFmdGVyIl07aWYocylmb3IoY29uc3QgdCBvZiBzLnRyaW0oKS5zcGxpdCgiLCIpKXtjb25zdFtuLGUsLCxzXT10LnNwbGl0KCI6Iiw1KSxpPXBhcnNlSW50KG4sMTApLGM9MWUzKihpc05hTihpKT82MDppKTtpZihlKWZvcihjb25zdCB0IG9mIGUuc3BsaXQoIjsiKSkibWV0cmljX2J1Y2tldCI9PT10JiZzJiYhcy5zcGxpdCgiOyIpLmluY2x1ZGVzKCJjdXN0b20iKXx8KG9bdF09citjKTtlbHNlIG8uYWxsPXIrY31lbHNlIGk/by5hbGw9citmdW5jdGlvbih0LG49RGF0ZS5ub3coKSl7Y29uc3QgZT1wYXJzZUludChgJHt0fWAsMTApO2lmKCFpc05hTihlKSlyZXR1cm4gMWUzKmU7Y29uc3Qgcj1EYXRlLnBhcnNlKGAke3R9YCk7cmV0dXJuIGlzTmFOKHIpP3F0OnItbn0oaSxyKTo0Mjk9PT1uJiYoby5hbGw9cis2ZTQpO3JldHVybiBvfWNvbnN0IFh0PTY0O2Z1bmN0aW9uIHRuKHQsbixlPVp0KHQuYnVmZmVyU2l6ZXx8WHQpKXtsZXQgcj17fTtyZXR1cm57c2VuZDpmdW5jdGlvbih0KXtjb25zdCBvPVtdO2lmKEx0KHQsKCh0LG4pPT57Y29uc3QgZT1mdW5jdGlvbih0KXtyZXR1cm4gSnRbdF19KG4pOyhmdW5jdGlvbih0LG4sZT1EYXRlLm5vdygpKXtyZXR1cm4gZnVuY3Rpb24odCxuKXtyZXR1cm4gdFtuXXx8dC5hbGx8fDB9KHQsbik+ZX0pKHIsZSl8fG8ucHVzaCh0KX0pKSwwPT09by5sZW5ndGgpcmV0dXJuIFcoe30pO2NvbnN0IHM9TXQodFswXSxvKSxpPXQ9PntMdChzLCgodCxuKT0+e30pKX07cmV0dXJuIGUuYWRkKCgoKT0+bih7Ym9keTpHdChzKX0pLnRoZW4oKHQ9Pih2b2lkIDAhPT10LnN0YXR1c0NvZGUmJih0LnN0YXR1c0NvZGU8MjAwfHx0LnN0YXR1c0NvZGU+PTMwMCkmJmgmJl8ud2FybihgU2VudHJ5IHJlc3BvbmRlZCB3aXRoIHN0YXR1cyBjb2RlICR7dC5zdGF0dXNDb2RlfSB0byBzZW50IGV2ZW50LmApLHI9UXQocix0KSx0KSksKHQ9Pnt0aHJvdyBpKCksdH0pKSkpLnRoZW4oKHQ9PnQpLCh0PT57aWYodCBpbnN0YW5jZW9mIFZ0KXJldHVybiBoJiZfLmVycm9yKCJTa2lwcGVkIHNlbmRpbmcgZXZlbnQgYmVjYXVzZSBidWZmZXIgaXMgZnVsbC4iKSxpKCksVyh7fSk7dGhyb3cgdH0pKX0sZmx1c2g6dD0+ZS5kcmFpbih0KX19Y29uc3Qgbm49L14oXFMrOlxcfFwvPykoW1xzXFNdKj8pKCg/OlwuezEsMn18W14vXFxdKz98KShcLlteLi9cXF0qfCkpKD86Wy9cXF0qKSQvO2Z1bmN0aW9uIGVuKHQpe2NvbnN0IG49ZnVuY3Rpb24odCl7Y29uc3Qgbj10Lmxlbmd0aD4xMDI0P2A8dHJ1bmNhdGVkPiR7dC5zbGljZSgtMTAyNCl9YDp0LGU9bm4uZXhlYyhuKTtyZXR1cm4gZT9lLnNsaWNlKDEpOltdfSh0KSxlPW5bMF18fCIiO2xldCByPW5bMV07cmV0dXJuIGV8fHI/KHImJihyPXIuc2xpY2UoMCxyLmxlbmd0aC0xKSksZStyKToiLiJ9ZnVuY3Rpb24gcm4odCxuPSExKXtyZXR1cm4hKG58fHQmJiF0LnN0YXJ0c1dpdGgoIi8iKSYmIXQubWF0Y2goL15bQS1aXTovKSYmIXQuc3RhcnRzV2l0aCgiLiIpJiYhdC5tYXRjaCgvXlthLXpBLVpdKFthLXpBLVowLTkuXC0rXSkqOlwvXC8vKSkmJnZvaWQgMCE9PXQmJiF0LmluY2x1ZGVzKCJub2RlX21vZHVsZXMvIil9Y29uc3Qgb249U3ltYm9sKCJBZ2VudEJhc2VJbnRlcm5hbFN0YXRlIik7Y2xhc3Mgc24gZXh0ZW5kcyBzLkFnZW50e1tvbl07b3B0aW9ucztrZWVwQWxpdmU7Y29uc3RydWN0b3IodCl7c3VwZXIodCksdGhpc1tvbl09e319aXNTZWN1cmVFbmRwb2ludCh0KXtpZih0KXtpZigiYm9vbGVhbiI9PXR5cGVvZiB0LnNlY3VyZUVuZHBvaW50KXJldHVybiB0LnNlY3VyZUVuZHBvaW50O2lmKCJzdHJpbmciPT10eXBlb2YgdC5wcm90b2NvbClyZXR1cm4iaHR0cHM6Ij09PXQucHJvdG9jb2x9Y29uc3R7c3RhY2s6bn09bmV3IEVycm9yO3JldHVybiJzdHJpbmciPT10eXBlb2YgbiYmbi5zcGxpdCgiXG4iKS5zb21lKCh0PT4tMSE9PXQuaW5kZXhPZigiKGh0dHBzLmpzOiIpfHwtMSE9PXQuaW5kZXhPZigibm9kZTpodHRwczoiKSkpfWNyZWF0ZVNvY2tldCh0LG4sZSl7Y29uc3Qgcj17Li4ubixzZWN1cmVFbmRwb2ludDp0aGlzLmlzU2VjdXJlRW5kcG9pbnQobil9O1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCgpPT50aGlzLmNvbm5lY3QodCxyKSkpLnRoZW4oKG89PntpZihvIGluc3RhbmNlb2Ygcy5BZ2VudClyZXR1cm4gby5hZGRSZXF1ZXN0KHQscik7dGhpc1tvbl0uY3VycmVudFNvY2tldD1vLHN1cGVyLmNyZWF0ZVNvY2tldCh0LG4sZSl9KSxlKX1jcmVhdGVDb25uZWN0aW9uKCl7Y29uc3QgdD10aGlzW29uXS5jdXJyZW50U29ja2V0O2lmKHRoaXNbb25dLmN1cnJlbnRTb2NrZXQ9dm9pZCAwLCF0KXRocm93IG5ldyBFcnJvcigiTm8gc29ja2V0IHdhcyByZXR1cm5lZCBpbiB0aGUgYGNvbm5lY3QoKWAgZnVuY3Rpb24iKTtyZXR1cm4gdH1nZXQgZGVmYXVsdFBvcnQoKXtyZXR1cm4gdGhpc1tvbl0uZGVmYXVsdFBvcnQ/PygiaHR0cHM6Ij09PXRoaXMucHJvdG9jb2w/NDQzOjgwKX1zZXQgZGVmYXVsdFBvcnQodCl7dGhpc1tvbl0mJih0aGlzW29uXS5kZWZhdWx0UG9ydD10KX1nZXQgcHJvdG9jb2woKXtyZXR1cm4gdGhpc1tvbl0ucHJvdG9jb2w/Pyh0aGlzLmlzU2VjdXJlRW5kcG9pbnQoKT8iaHR0cHM6IjoiaHR0cDoiKX1zZXQgcHJvdG9jb2wodCl7dGhpc1tvbl0mJih0aGlzW29uXS5wcm90b2NvbD10KX19ZnVuY3Rpb24gY24oLi4udCl7Xy5sb2coIltodHRwcy1wcm94eS1hZ2VudDpwYXJzZS1wcm94eS1yZXNwb25zZV0iLC4uLnQpfWZ1bmN0aW9uIHVuKHQpe3JldHVybiBuZXcgUHJvbWlzZSgoKG4sZSk9PntsZXQgcj0wO2NvbnN0IG89W107ZnVuY3Rpb24gcygpe2NvbnN0IGM9dC5yZWFkKCk7Yz9mdW5jdGlvbihjKXtvLnB1c2goYykscis9Yy5sZW5ndGg7Y29uc3QgdT1CdWZmZXIuY29uY2F0KG8sciksYT11LmluZGV4T2YoIlxyXG5cclxuIik7aWYoLTE9PT1hKXJldHVybiBjbigiaGF2ZSBub3QgcmVjZWl2ZWQgZW5kIG9mIEhUVFAgaGVhZGVycyB5ZXQuLi4iKSx2b2lkIHMoKTtjb25zdCBmPXUuc2xpY2UoMCxhKS50b1N0cmluZygiYXNjaWkiKS5zcGxpdCgiXHJcbiIpLGg9Zi5zaGlmdCgpO2lmKCFoKXJldHVybiB0LmRlc3Ryb3koKSxlKG5ldyBFcnJvcigiTm8gaGVhZGVyIHJlY2VpdmVkIGZyb20gcHJveHkgQ09OTkVDVCByZXNwb25zZSIpKTtjb25zdCBwPWguc3BsaXQoIiAiKSxsPSsocFsxXXx8MCksZD1wLnNsaWNlKDIpLmpvaW4oIiAiKSxtPXt9O2Zvcihjb25zdCBuIG9mIGYpe2lmKCFuKWNvbnRpbnVlO2NvbnN0IHI9bi5pbmRleE9mKCI6Iik7aWYoLTE9PT1yKXJldHVybiB0LmRlc3Ryb3koKSxlKG5ldyBFcnJvcihgSW52YWxpZCBoZWFkZXIgZnJvbSBwcm94eSBDT05ORUNUIHJlc3BvbnNlOiAiJHtufSJgKSk7Y29uc3Qgbz1uLnNsaWNlKDAscikudG9Mb3dlckNhc2UoKSxzPW4uc2xpY2UocisxKS50cmltU3RhcnQoKSxpPW1bb107InN0cmluZyI9PXR5cGVvZiBpP21bb109W2ksc106QXJyYXkuaXNBcnJheShpKT9pLnB1c2gocyk6bVtvXT1zfWNuKCJnb3QgcHJveHkgc2VydmVyIHJlc3BvbnNlOiAlbyAlbyIsaCxtKSxpKCksbih7Y29ubmVjdDp7c3RhdHVzQ29kZTpsLHN0YXR1c1RleHQ6ZCxoZWFkZXJzOm19LGJ1ZmZlcmVkOnV9KX0oYyk6dC5vbmNlKCJyZWFkYWJsZSIscyl9ZnVuY3Rpb24gaSgpe3QucmVtb3ZlTGlzdGVuZXIoImVuZCIsYyksdC5yZW1vdmVMaXN0ZW5lcigiZXJyb3IiLHUpLHQucmVtb3ZlTGlzdGVuZXIoInJlYWRhYmxlIixzKX1mdW5jdGlvbiBjKCl7aSgpLGNuKCJvbmVuZCIpLGUobmV3IEVycm9yKCJQcm94eSBjb25uZWN0aW9uIGVuZGVkIGJlZm9yZSByZWNlaXZpbmcgQ09OTkVDVCByZXNwb25zZSIpKX1mdW5jdGlvbiB1KHQpe2koKSxjbigib25lcnJvciAlbyIsdCksZSh0KX10Lm9uKCJlcnJvciIsdSksdC5vbigiZW5kIixjKSxzKCl9KSl9ZnVuY3Rpb24gYW4oLi4udCl7Xy5sb2coIltodHRwcy1wcm94eS1hZ2VudF0iLC4uLnQpfWNsYXNzIGZuIGV4dGVuZHMgc257c3RhdGljIHByb3RvY29scz1bImh0dHAiLCJodHRwcyJdO3Byb3h5O3Byb3h5SGVhZGVycztjb25uZWN0T3B0cztjb25zdHJ1Y3Rvcih0LG4pe3N1cGVyKG4pLHRoaXMub3B0aW9ucz17fSx0aGlzLnByb3h5PSJzdHJpbmciPT10eXBlb2YgdD9uZXcgVVJMKHQpOnQsdGhpcy5wcm94eUhlYWRlcnM9bj8uaGVhZGVycz8/e30sYW4oIkNyZWF0aW5nIG5ldyBIdHRwc1Byb3h5QWdlbnQgaW5zdGFuY2U6ICVvIix0aGlzLnByb3h5LmhyZWYpO2NvbnN0IGU9KHRoaXMucHJveHkuaG9zdG5hbWV8fHRoaXMucHJveHkuaG9zdCkucmVwbGFjZSgvXlxbfFxdJC9nLCIiKSxyPXRoaXMucHJveHkucG9ydD9wYXJzZUludCh0aGlzLnByb3h5LnBvcnQsMTApOiJodHRwczoiPT09dGhpcy5wcm94eS5wcm90b2NvbD80NDM6ODA7dGhpcy5jb25uZWN0T3B0cz17QUxQTlByb3RvY29sczpbImh0dHAvMS4xIl0sLi4ubj9wbihuLCJoZWFkZXJzIik6bnVsbCxob3N0OmUscG9ydDpyfX1hc3luYyBjb25uZWN0KHQsbil7Y29uc3R7cHJveHk6ZX09dGhpcztpZighbi5ob3N0KXRocm93IG5ldyBUeXBlRXJyb3IoJ05vICJob3N0IiBwcm92aWRlZCcpO2xldCByO2lmKCJodHRwczoiPT09ZS5wcm90b2NvbCl7YW4oIkNyZWF0aW5nIGB0bHMuU29ja2V0YDogJW8iLHRoaXMuY29ubmVjdE9wdHMpO2NvbnN0IHQ9dGhpcy5jb25uZWN0T3B0cy5zZXJ2ZXJuYW1lfHx0aGlzLmNvbm5lY3RPcHRzLmhvc3Q7cj1mLmNvbm5lY3Qoey4uLnRoaXMuY29ubmVjdE9wdHMsc2VydmVybmFtZTp0JiZhLmlzSVAodCk/dm9pZCAwOnR9KX1lbHNlIGFuKCJDcmVhdGluZyBgbmV0LlNvY2tldGA6ICVvIix0aGlzLmNvbm5lY3RPcHRzKSxyPWEuY29ubmVjdCh0aGlzLmNvbm5lY3RPcHRzKTtjb25zdCBvPSJmdW5jdGlvbiI9PXR5cGVvZiB0aGlzLnByb3h5SGVhZGVycz90aGlzLnByb3h5SGVhZGVycygpOnsuLi50aGlzLnByb3h5SGVhZGVyc30scz1hLmlzSVB2NihuLmhvc3QpP2BbJHtuLmhvc3R9XWA6bi5ob3N0O2xldCBpPWBDT05ORUNUICR7c306JHtuLnBvcnR9IEhUVFAvMS4xXHJcbmA7aWYoZS51c2VybmFtZXx8ZS5wYXNzd29yZCl7Y29uc3QgdD1gJHtkZWNvZGVVUklDb21wb25lbnQoZS51c2VybmFtZSl9OiR7ZGVjb2RlVVJJQ29tcG9uZW50KGUucGFzc3dvcmQpfWA7b1siUHJveHktQXV0aG9yaXphdGlvbiJdPWBCYXNpYyAke0J1ZmZlci5mcm9tKHQpLnRvU3RyaW5nKCJiYXNlNjQiKX1gfW8uSG9zdD1gJHtzfToke24ucG9ydH1gLG9bIlByb3h5LUNvbm5lY3Rpb24iXXx8KG9bIlByb3h5LUNvbm5lY3Rpb24iXT10aGlzLmtlZXBBbGl2ZT8iS2VlcC1BbGl2ZSI6ImNsb3NlIik7Zm9yKGNvbnN0IHQgb2YgT2JqZWN0LmtleXMobykpaSs9YCR7dH06ICR7b1t0XX1cclxuYDtjb25zdCBjPXVuKHIpO3Iud3JpdGUoYCR7aX1cclxuYCk7Y29uc3R7Y29ubmVjdDp1LGJ1ZmZlcmVkOmh9PWF3YWl0IGM7aWYodC5lbWl0KCJwcm94eUNvbm5lY3QiLHUpLHRoaXMuZW1pdCgicHJveHlDb25uZWN0Iix1LHQpLDIwMD09PXUuc3RhdHVzQ29kZSl7aWYodC5vbmNlKCJzb2NrZXQiLGhuKSxuLnNlY3VyZUVuZHBvaW50KXthbigiVXBncmFkaW5nIHNvY2tldCBjb25uZWN0aW9uIHRvIFRMUyIpO2NvbnN0IHQ9bi5zZXJ2ZXJuYW1lfHxuLmhvc3Q7cmV0dXJuIGYuY29ubmVjdCh7Li4ucG4obiwiaG9zdCIsInBhdGgiLCJwb3J0Iiksc29ja2V0OnIsc2VydmVybmFtZTphLmlzSVAodCk/dm9pZCAwOnR9KX1yZXR1cm4gcn1yLmRlc3Ryb3koKTtjb25zdCBwPW5ldyBhLlNvY2tldCh7d3JpdGFibGU6ITF9KTtyZXR1cm4gcC5yZWFkYWJsZT0hMCx0Lm9uY2UoInNvY2tldCIsKHQ9PnthbigiUmVwbGF5aW5nIHByb3h5IGJ1ZmZlciBmb3IgZmFpbGVkIHJlcXVlc3QiKSx0LnB1c2goaCksdC5wdXNoKG51bGwpfSkpLHB9fWZ1bmN0aW9uIGhuKHQpe3QucmVzdW1lKCl9ZnVuY3Rpb24gcG4odCwuLi5uKXtjb25zdCBlPXt9O2xldCByO2ZvcihyIGluIHQpbi5pbmNsdWRlcyhyKXx8KGVbcl09dFtyXSk7cmV0dXJuIGV9Y29uc3QgbG49MzI3Njg7ZnVuY3Rpb24gZG4odCl7cmV0dXJuIHQucmVwbGFjZSgvXltBLVpdOi8sIiIpLnJlcGxhY2UoL1xcL2csIi8iKX1jb25zdCBtbj1lO2xldCB5bixnbj0wLGJuPXt9O2Z1bmN0aW9uIF9uKHQpe21uLmRlYnVnJiZjb25zb2xlLmxvZyhgW0FOUiBXb3JrZXJdICR7dH1gKX12YXIgdm4sd24sU247Y29uc3QgJG49ZnVuY3Rpb24odCl7bGV0IG47dHJ5e249bmV3IFVSTCh0LnVybCl9Y2F0Y2gobil7cmV0dXJuIGIoKCgpPT57Y29uc29sZS53YXJuKCJbQHNlbnRyeS9ub2RlXTogSW52YWxpZCBkc24gb3IgdHVubmVsIG9wdGlvbiwgd2lsbCBub3Qgc2VuZCBhbnkgZXZlbnRzLiBUaGUgdHVubmVsIG9wdGlvbiBtdXN0IGJlIGEgZnVsbCBVUkwgd2hlbiB1c2VkLiIpfSkpLHRuKHQsKCgpPT5Qcm9taXNlLnJlc29sdmUoe30pKSl9Y29uc3QgZT0iaHR0cHM6Ij09PW4ucHJvdG9jb2wscj1mdW5jdGlvbih0LG4pe2NvbnN0e25vX3Byb3h5OmV9PXByb2Nlc3MuZW52O3JldHVybiBlJiZlLnNwbGl0KCIsIikuc29tZSgobj0+dC5ob3N0LmVuZHNXaXRoKG4pfHx0Lmhvc3RuYW1lLmVuZHNXaXRoKG4pKSk/dm9pZCAwOm59KG4sdC5wcm94eXx8KGU/cHJvY2Vzcy5lbnYuaHR0cHNfcHJveHk6dm9pZCAwKXx8cHJvY2Vzcy5lbnYuaHR0cF9wcm94eSksbz1lP2k6cyxhPXZvaWQgMCE9PXQua2VlcEFsaXZlJiZ0LmtlZXBBbGl2ZSxmPXI/bmV3IGZuKHIpOm5ldyBvLkFnZW50KHtrZWVwQWxpdmU6YSxtYXhTb2NrZXRzOjMwLHRpbWVvdXQ6MmUzfSksaD1mdW5jdGlvbih0LG4sZSl7Y29uc3R7aG9zdG5hbWU6cixwYXRobmFtZTpvLHBvcnQ6cyxwcm90b2NvbDppLHNlYXJjaDphfT1uZXcgVVJMKHQudXJsKTtyZXR1cm4gZnVuY3Rpb24oZil7cmV0dXJuIG5ldyBQcm9taXNlKCgoaCxwKT0+e1d0KCgoKT0+e2xldCBsPWZ1bmN0aW9uKHQpe3JldHVybiBuZXcgYyh7cmVhZCgpe3RoaXMucHVzaCh0KSx0aGlzLnB1c2gobnVsbCl9fSl9KGYuYm9keSk7Y29uc3QgZD17Li4udC5oZWFkZXJzfTtmLmJvZHkubGVuZ3RoPmxuJiYoZFsiY29udGVudC1lbmNvZGluZyJdPSJnemlwIixsPWwucGlwZSh1KCkpKTtjb25zdCBtPW4ucmVxdWVzdCh7bWV0aG9kOiJQT1NUIixhZ2VudDplLGhlYWRlcnM6ZCxob3N0bmFtZTpyLHBhdGg6YCR7b30ke2F9YCxwb3J0OnMscHJvdG9jb2w6aSxjYTp0LmNhQ2VydHN9LCh0PT57dC5vbigiZGF0YSIsKCgpPT57fSkpLHQub24oImVuZCIsKCgpPT57fSkpLHQuc2V0RW5jb2RpbmcoInV0ZjgiKTtjb25zdCBuPXQuaGVhZGVyc1sicmV0cnktYWZ0ZXIiXT8/bnVsbCxlPXQuaGVhZGVyc1sieC1zZW50cnktcmF0ZS1saW1pdHMiXT8/bnVsbDtoKHtzdGF0dXNDb2RlOnQuc3RhdHVzQ29kZSxoZWFkZXJzOnsicmV0cnktYWZ0ZXIiOm4sIngtc2VudHJ5LXJhdGUtbGltaXRzIjpBcnJheS5pc0FycmF5KGUpP2VbMF18fG51bGw6ZX19KX0pKTttLm9uKCJlcnJvciIscCksbC5waXBlKG0pfSkpfSkpfX0odCx0Lmh0dHBNb2R1bGU/P28sZik7cmV0dXJuIHRuKHQsaCl9KHt1cmw6KHZuPW1uLmRzbix3bj1tbi50dW5uZWwsU249bW4uc2RrTWV0YWRhdGEuc2RrLHdufHxgJHtmdW5jdGlvbih0KXtyZXR1cm5gJHtmdW5jdGlvbih0KXtjb25zdCBuPXQucHJvdG9jb2w/YCR7dC5wcm90b2NvbH06YDoiIixlPXQucG9ydD9gOiR7dC5wb3J0fWA6IiI7cmV0dXJuYCR7bn0vLyR7dC5ob3N0fSR7ZX0ke3QucGF0aD9gLyR7dC5wYXRofWA6IiJ9L2FwaS9gfSh0KX0ke3QucHJvamVjdElkfS9lbnZlbG9wZS9gfSh2bil9PyR7ZnVuY3Rpb24odCxuKXtjb25zdCBlPXtzZW50cnlfdmVyc2lvbjpLdH07cmV0dXJuIHQucHVibGljS2V5JiYoZS5zZW50cnlfa2V5PXQucHVibGljS2V5KSxuJiYoZS5zZW50cnlfY2xpZW50PWAke24ubmFtZX0vJHtuLnZlcnNpb259YCksbmV3IFVSTFNlYXJjaFBhcmFtcyhlKS50b1N0cmluZygpfSh2bixTbil9YCkscmVjb3JkRHJvcHBlZEV2ZW50OigpPT57fX0pO2FzeW5jIGZ1bmN0aW9uIEVuKCl7aWYoeW4pe19uKCJTZW5kaW5nIGFibm9ybWFsIHNlc3Npb24iKSxWKHluLHtzdGF0dXM6ImFibm9ybWFsIixhYm5vcm1hbF9tZWNoYW5pc206ImFucl9mb3JlZ3JvdW5kIn0pO2NvbnN0IHQ9ZnVuY3Rpb24odCxuLGUscil7Y29uc3Qgbz1ZdChlKTtyZXR1cm4gTXQoe3NlbnRfYXQ6KG5ldyBEYXRlKS50b0lTT1N0cmluZygpLC4uLm8mJntzZGs6b30sLi4uISFyJiZuJiZ7ZHNuOkF0KG4pfX0sWyJhZ2dyZWdhdGVzImluIHQ/W3t0eXBlOiJzZXNzaW9ucyJ9LHRdOlt7dHlwZToic2Vzc2lvbiJ9LHQudG9KU09OKCldXSl9KHluLG1uLmRzbixtbi5zZGtNZXRhZGF0YSxtbi50dW5uZWwpO19uKEpTT04uc3RyaW5naWZ5KHQpKSxhd2FpdCAkbi5zZW5kKHQpO3RyeXtuPy5wb3N0TWVzc2FnZSgic2Vzc2lvbi1lbmRlZCIpfWNhdGNoKHQpe319fWZ1bmN0aW9uIHhuKHQpe2lmKCF0KXJldHVybjtjb25zdCBuPWZ1bmN0aW9uKHQpe2lmKCF0Lmxlbmd0aClyZXR1cm5bXTtjb25zdCBuPUFycmF5LmZyb20odCk7cmV0dXJuL3NlbnRyeVdyYXBwZWQvLnRlc3QoJChuKS5mdW5jdGlvbnx8IiIpJiZuLnBvcCgpLG4ucmV2ZXJzZSgpLFMudGVzdCgkKG4pLmZ1bmN0aW9ufHwiIikmJihuLnBvcCgpLFMudGVzdCgkKG4pLmZ1bmN0aW9ufHwiIikmJm4ucG9wKCkpLG4uc2xpY2UoMCx2KS5tYXAoKHQ9Pih7Li4udCxmaWxlbmFtZTp0LmZpbGVuYW1lfHwkKG4pLmZpbGVuYW1lLGZ1bmN0aW9uOnQuZnVuY3Rpb258fHd9KSkpfSh0KTtpZihtbi5hcHBSb290UGF0aClmb3IoY29uc3QgdCBvZiBuKXQuZmlsZW5hbWUmJih0LmZpbGVuYW1lPVV0KHQuZmlsZW5hbWUsbW4uYXBwUm9vdFBhdGgpKTtyZXR1cm4gbn1hc3luYyBmdW5jdGlvbiBObih0LG4pe2lmKGduPj1tbi5tYXhBbnJFdmVudHMpcmV0dXJuO2duKz0xLGF3YWl0IEVuKCksX24oIlNlbmRpbmcgZXZlbnQiKTtjb25zdCBlPXtldmVudF9pZDp6KCksY29udGV4dHM6bW4uY29udGV4dHMscmVsZWFzZTptbi5yZWxlYXNlLGVudmlyb25tZW50Om1uLmVudmlyb25tZW50LGRpc3Q6bW4uZGlzdCxwbGF0Zm9ybToibm9kZSIsbGV2ZWw6ImVycm9yIixleGNlcHRpb246e3ZhbHVlczpbe3R5cGU6IkFwcGxpY2F0aW9uTm90UmVzcG9uZGluZyIsdmFsdWU6YEFwcGxpY2F0aW9uIE5vdCBSZXNwb25kaW5nIGZvciBhdCBsZWFzdCAke21uLmFuclRocmVzaG9sZH0gbXNgLHN0YWNrdHJhY2U6e2ZyYW1lczp4bih0KX0sbWVjaGFuaXNtOnt0eXBlOiJBTlIifX1dfSx0YWdzOm1uLnN0YXRpY1RhZ3N9O24mJmZ1bmN0aW9uKHQsbil7aWYoRnQodCxuKSwhdC5jb250ZXh0cz8udHJhY2Upe2NvbnN0e3RyYWNlSWQ6ZSxzcGFuSWQ6cixwYXJlbnRTcGFuSWQ6b309bi5wcm9wYWdhdGlvbkNvbnRleHQ7dC5jb250ZXh0cz17dHJhY2U6e3RyYWNlX2lkOmUsc3Bhbl9pZDpyLHBhcmVudF9zcGFuX2lkOm99LC4uLnQuY29udGV4dHN9fX0oZSxuKSxmdW5jdGlvbih0KXtpZigwPT09T2JqZWN0LmtleXMoYm4pLmxlbmd0aClyZXR1cm47Y29uc3Qgbj1tbi5hcHBSb290UGF0aD97fTpibjtpZihtbi5hcHBSb290UGF0aClmb3IoY29uc3RbdCxlXW9mIE9iamVjdC5lbnRyaWVzKGJuKSluW1V0KHQsbW4uYXBwUm9vdFBhdGgpXT1lO2NvbnN0IGU9bmV3IE1hcDtmb3IoY29uc3QgciBvZiB0LmV4Y2VwdGlvbj8udmFsdWVzfHxbXSlmb3IoY29uc3QgdCBvZiByLnN0YWNrdHJhY2U/LmZyYW1lc3x8W10pe2NvbnN0IHI9dC5hYnNfcGF0aHx8dC5maWxlbmFtZTtyJiZuW3JdJiZlLnNldChyLG5bcl0pfWlmKGUuc2l6ZT4wKXtjb25zdCBuPVtdO2Zvcihjb25zdFt0LHJdb2YgZS5lbnRyaWVzKCkpbi5wdXNoKHt0eXBlOiJzb3VyY2VtYXAiLGNvZGVfZmlsZTp0LGRlYnVnX2lkOnJ9KTt0LmRlYnVnX21ldGE9e2ltYWdlczpufX19KGUpO2NvbnN0IHI9enQoZSxtbi5kc24sbW4uc2RrTWV0YWRhdGEsbW4udHVubmVsKTtfbihKU09OLnN0cmluZ2lmeShyKSksYXdhaXQgJG4uc2VuZChyKSxhd2FpdCAkbi5mbHVzaCgyZTMpLGduPj1tbi5tYXhBbnJFdmVudHMmJnNldFRpbWVvdXQoKCgpPT57cHJvY2Vzcy5leGl0KDApfSksNWUzKX1sZXQgVG47aWYoX24oIlN0YXJ0ZWQiKSxtbi5jYXB0dXJlU3RhY2tUcmFjZSl7X24oIkNvbm5lY3RpbmcgdG8gZGVidWdnZXIiKTtjb25zdCBuPW5ldyB0O24uY29ubmVjdFRvTWFpblRocmVhZCgpLF9uKCJDb25uZWN0ZWQgdG8gZGVidWdnZXIiKTtjb25zdCBlPW5ldyBNYXA7bi5vbigiRGVidWdnZXIuc2NyaXB0UGFyc2VkIiwodD0+e2Uuc2V0KHQucGFyYW1zLnNjcmlwdElkLHQucGFyYW1zLnVybCl9KSksbi5vbigiRGVidWdnZXIucGF1c2VkIiwodD0+e2lmKCJvdGhlciI9PT10LnBhcmFtcy5yZWFzb24pdHJ5e19uKCJEZWJ1Z2dlciBwYXVzZWQiKTtjb25zdCBzPVsuLi50LnBhcmFtcy5jYWxsRnJhbWVzXSxpPW1uLmFwcFJvb3RQYXRoP2Z1bmN0aW9uKHQ9KHByb2Nlc3MuYXJndlsxXT9lbihwcm9jZXNzLmFyZ3ZbMV0pOnByb2Nlc3MuY3dkKCkpLG49IlxcIj09PW8pe2NvbnN0IGU9bj9kbih0KTp0O3JldHVybiB0PT57aWYoIXQpcmV0dXJuO2NvbnN0IG89bj9kbih0KTp0O2xldHtkaXI6cyxiYXNlOmksZXh0OmN9PXIucGFyc2Uobyk7Ii5qcyIhPT1jJiYiLm1qcyIhPT1jJiYiLmNqcyIhPT1jfHwoaT1pLnNsaWNlKDAsLTEqYy5sZW5ndGgpKTtjb25zdCB1PWRlY29kZVVSSUNvbXBvbmVudChpKTtzfHwocz0iLiIpO2NvbnN0IGE9cy5sYXN0SW5kZXhPZigiL25vZGVfbW9kdWxlcyIpO2lmKGE+LTEpcmV0dXJuYCR7cy5zbGljZShhKzE0KS5yZXBsYWNlKC9cLy9nLCIuIil9OiR7dX1gO2lmKHMuc3RhcnRzV2l0aChlKSl7Y29uc3QgdD1zLnNsaWNlKGUubGVuZ3RoKzEpLnJlcGxhY2UoL1wvL2csIi4iKTtyZXR1cm4gdD9gJHt0fToke3V9YDp1fXJldHVybiB1fX0obW4uYXBwUm9vdFBhdGgpOigpPT57fSxjPXMubWFwKCh0PT5mdW5jdGlvbih0LG4sZSl7Y29uc3Qgcj1uP24ucmVwbGFjZSgvXmZpbGU6XC9cLy8sIiIpOnZvaWQgMCxvPXQubG9jYXRpb24uY29sdW1uTnVtYmVyP3QubG9jYXRpb24uY29sdW1uTnVtYmVyKzE6dm9pZCAwLHM9dC5sb2NhdGlvbi5saW5lTnVtYmVyP3QubG9jYXRpb24ubGluZU51bWJlcisxOnZvaWQgMDtyZXR1cm4gTCh7ZmlsZW5hbWU6cixtb2R1bGU6ZShyKSxmdW5jdGlvbjp0LmZ1bmN0aW9uTmFtZXx8dyxjb2xubzpvLGxpbmVubzpzLGluX2FwcDpyP3JuKHIpOnZvaWQgMH0pfSh0LGUuZ2V0KHQubG9jYXRpb24uc2NyaXB0SWQpLGkpKSksdT1zZXRUaW1lb3V0KCgoKT0+e05uKGMpLnRoZW4obnVsbCwoKCk9PntfbigiU2VuZGluZyBBTlIgZXZlbnQgZmFpbGVkLiIpfSkpfSksNWUzKTtuLnBvc3QoIlJ1bnRpbWUuZXZhbHVhdGUiLHtleHByZXNzaW9uOiJnbG9iYWwuX19TRU5UUllfR0VUX1NDT1BFU19fKCk7IixzaWxlbnQ6ITAscmV0dXJuQnlWYWx1ZTohMH0sKCh0LGUpPT57dCYmX24oYEVycm9yIGV4ZWN1dGluZyBzY3JpcHQ6ICcke3QubWVzc2FnZX0nYCksY2xlYXJUaW1lb3V0KHUpO2NvbnN0IHI9ZSYmZS5yZXN1bHQ/ZS5yZXN1bHQudmFsdWU6dm9pZCAwO24ucG9zdCgiRGVidWdnZXIucmVzdW1lIiksbi5wb3N0KCJEZWJ1Z2dlci5kaXNhYmxlIiksTm4oYyxyKS50aGVuKG51bGwsKCgpPT57X24oIlNlbmRpbmcgQU5SIGV2ZW50IGZhaWxlZC4iKX0pKX0pKX1jYXRjaCh0KXt0aHJvdyBuLnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpLG4ucG9zdCgiRGVidWdnZXIuZGlzYWJsZSIpLHR9fSkpLFRuPSgpPT57dHJ5e24ucG9zdCgiRGVidWdnZXIuZW5hYmxlIiwoKCk9PntuLnBvc3QoIkRlYnVnZ2VyLnBhdXNlIil9KSl9Y2F0Y2godCl7fX19Y29uc3R7cG9sbDpDbn09ZnVuY3Rpb24odCxuLGUscil7Y29uc3Qgbz10KCk7bGV0IHM9ITEsaT0hMDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCgpPT57Y29uc3QgdD1vLmdldFRpbWVNcygpOyExPT09cyYmdD5uK2UmJihzPSEwLGkmJnIoKSksdDxuK2UmJihzPSExKX0pLDIwKSx7cG9sbDooKT0+e28ucmVzZXQoKX0sZW5hYmxlZDp0PT57aT10fX19KChmdW5jdGlvbigpe2xldCB0PXByb2Nlc3MuaHJ0aW1lKCk7cmV0dXJue2dldFRpbWVNczooKT0+e2NvbnN0W24sZV09cHJvY2Vzcy5ocnRpbWUodCk7cmV0dXJuIE1hdGguZmxvb3IoMWUzKm4rZS8xZTYpfSxyZXNldDooKT0+e3Q9cHJvY2Vzcy5ocnRpbWUoKX19fSksbW4ucG9sbEludGVydmFsLG1uLmFuclRocmVzaG9sZCwoZnVuY3Rpb24oKXtfbigiV2F0Y2hkb2cgdGltZW91dCIpLFRuPyhfbigiUGF1c2luZyBkZWJ1Z2dlciB0byBjYXB0dXJlIHN0YWNrIHRyYWNlIiksVG4oKSk6KF9uKCJDYXB0dXJpbmcgZXZlbnQgd2l0aG91dCBhIHN0YWNrIHRyYWNlIiksTm4oKS50aGVuKG51bGwsKCgpPT57X24oIlNlbmRpbmcgQU5SIGV2ZW50IGZhaWxlZCBvbiB3YXRjaGRvZyB0aW1lb3V0LiIpfSkpKX0pKTtuPy5vbigibWVzc2FnZSIsKHQ9Pnt0LnNlc3Npb24mJih5bj1LKHQuc2Vzc2lvbikpLHQuZGVidWdJbWFnZXMmJihibj10LmRlYnVnSW1hZ2VzKSxDbigpfSkpOw=='; - +const base64WorkerScript = "LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjcxLjAgKDlmY2IwNjMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyB0fWZyb20ibm9kZTppbnNwZWN0b3IiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIG4scGFyZW50UG9ydCBhcyBlfWZyb20ibm9kZTp3b3JrZXJfdGhyZWFkcyI7aW1wb3J0e3Bvc2l4IGFzIHIsc2VwIGFzIG99ZnJvbSJub2RlOnBhdGgiO2ltcG9ydCphcyBpIGZyb20ibm9kZTpodHRwIjtpbXBvcnQqYXMgcyBmcm9tIm5vZGU6aHR0cHMiO2ltcG9ydHtSZWFkYWJsZSBhcyBjfWZyb20ibm9kZTpzdHJlYW0iO2ltcG9ydHtjcmVhdGVHemlwIGFzIHV9ZnJvbSJub2RlOnpsaWIiO2ltcG9ydCphcyBhIGZyb20ibm9kZTpuZXQiO2ltcG9ydCphcyBmIGZyb20ibm9kZTp0bHMiO2NvbnN0IGg9InVuZGVmaW5lZCI9PXR5cGVvZiBfX1NFTlRSWV9ERUJVR19ffHxfX1NFTlRSWV9ERUJVR19fLHA9Z2xvYmFsVGhpcyxkPSIxMC43MS4wIjtmdW5jdGlvbiBsKCl7cmV0dXJuIGcocCkscH1mdW5jdGlvbiBnKHQpe2NvbnN0IG49dC5fX1NFTlRSWV9fPXQuX19TRU5UUllfX3x8e307cmV0dXJuIG4udmVyc2lvbj1uLnZlcnNpb258fGQsbltkXT1uW2RdfHx7fX1mdW5jdGlvbiBtKHQsbixlPXApe2NvbnN0IHI9ZS5fX1NFTlRSWV9fPWUuX19TRU5UUllfX3x8e30sbz1yW2RdPXJbZF18fHt9O3JldHVybiBvW3RdfHwob1t0XT1uKCkpfWNvbnN0IHk9e307ZnVuY3Rpb24gYih0KXtpZighKCJjb25zb2xlImluIHApKXJldHVybiB0KCk7Y29uc3Qgbj1wLmNvbnNvbGUsZT17fSxyPU9iamVjdC5rZXlzKHkpO3IuZm9yRWFjaCh0PT57Y29uc3Qgcj15W3RdO2VbdF09blt0XSxuW3RdPXJ9KTt0cnl7cmV0dXJuIHQoKX1maW5hbGx5e3IuZm9yRWFjaCh0PT57blt0XT1lW3RdfSl9fWZ1bmN0aW9uIHYoKXtyZXR1cm4gUygpLmVuYWJsZWR9ZnVuY3Rpb24gXyh0LC4uLm4pe2gmJnYoKSYmYigoKT0+e3AuY29uc29sZVt0XShgU2VudHJ5IExvZ2dlciBbJHt0fV06YCwuLi5uKX0pfWZ1bmN0aW9uIFMoKXtyZXR1cm4gaD9tKCJsb2dnZXJTZXR0aW5ncyIsKCk9Pih7ZW5hYmxlZDohMX0pKTp7ZW5hYmxlZDohMX19Y29uc3Qgdz17ZW5hYmxlOmZ1bmN0aW9uKCl7UygpLmVuYWJsZWQ9ITB9LGRpc2FibGU6ZnVuY3Rpb24oKXtTKCkuZW5hYmxlZD0hMX0saXNFbmFibGVkOnYsbG9nOmZ1bmN0aW9uKC4uLnQpe18oImxvZyIsLi4udCl9LHdhcm46ZnVuY3Rpb24oLi4udCl7Xygid2FybiIsLi4udCl9LGVycm9yOmZ1bmN0aW9uKC4uLnQpe18oImVycm9yIiwuLi50KX19LCQ9L2NhcHR1cmVNZXNzYWdlfGNhcHR1cmVFeGNlcHRpb24vO2Z1bmN0aW9uIEUodCl7cmV0dXJuIHRbdC5sZW5ndGgtMV18fHt9fWNvbnN0IHg9Ijxhbm9ueW1vdXM+Ijtjb25zdCBOPU9iamVjdC5wcm90b3R5cGUudG9TdHJpbmc7ZnVuY3Rpb24gQyh0LG4pe3JldHVybiBOLmNhbGwodCk9PT1gW29iamVjdCAke259XWB9ZnVuY3Rpb24gaih0KXtyZXR1cm4gQm9vbGVhbih0Py50aGVuJiYiZnVuY3Rpb24iPT10eXBlb2YgdC50aGVuKX1mdW5jdGlvbiBSKHQsbil7dHJ5e3JldHVybiB0IGluc3RhbmNlb2Ygbn1jYXRjaHtyZXR1cm4hMX19ZnVuY3Rpb24gQSh0KXtpZihmdW5jdGlvbih0KXtzd2l0Y2goTi5jYWxsKHQpKXtjYXNlIltvYmplY3QgRXJyb3JdIjpjYXNlIltvYmplY3QgRXhjZXB0aW9uXSI6Y2FzZSJbb2JqZWN0IERPTUV4Y2VwdGlvbl0iOmNhc2UiW29iamVjdCBXZWJBc3NlbWJseS5FeGNlcHRpb25dIjpyZXR1cm4hMDtkZWZhdWx0OnJldHVybiBSKHQsRXJyb3IpfX0odCkpcmV0dXJue21lc3NhZ2U6dC5tZXNzYWdlLG5hbWU6dC5uYW1lLHN0YWNrOnQuc3RhY2ssLi4uSSh0KX07aWYobj10LCJ1bmRlZmluZWQiIT10eXBlb2YgRXZlbnQmJlIobixFdmVudCkpe2NvbnN0e3R5cGU6bix0YXJnZXQ6ZSxjdXJyZW50VGFyZ2V0OnIsZGV0YWlsOm99PXQ7cmV0dXJue3R5cGU6bix0YXJnZXQ6ZSxjdXJyZW50VGFyZ2V0OnIsLi4ubz97ZGV0YWlsOm99Ont9LC4uLkkodCl9fXZhciBuO3JldHVybiB0fWZ1bmN0aW9uIEkodCl7cmV0dXJuIm9iamVjdCI9PXR5cGVvZihuPXQpJiZudWxsIT09bj9PYmplY3QuZnJvbUVudHJpZXMoT2JqZWN0LmVudHJpZXModCkpOnt9O3ZhciBufWxldCBPO2Z1bmN0aW9uIFQodCl7aWYodm9pZCAwIT09TylyZXR1cm4gTz9PKHQpOnQoKTtjb25zdCBuPVN5bWJvbC5mb3IoIl9fU0VOVFJZX1NBRkVfUkFORE9NX0lEX1dSQVBQRVJfXyIpLGU9cDtyZXR1cm4gbiBpbiBlJiYiZnVuY3Rpb24iPT10eXBlb2YgZVtuXT8oTz1lW25dLE8odCkpOihPPW51bGwsdCgpKX1mdW5jdGlvbiBrKCl7cmV0dXJuIFQoKCk9Pk1hdGgucmFuZG9tKCkpfWZ1bmN0aW9uIFAoKXtyZXR1cm4gVCgoKT0+RGF0ZS5ub3coKSl9Y29uc3QgRD1TeW1ib2wuZm9yKCJzZW50cnkuc2tpcE5vcm1hbGl6YXRpb24iKSxVPVN5bWJvbC5mb3IoInNlbnRyeS5vdmVycmlkZU5vcm1hbGl6YXRpb25EZXB0aCIpO2Z1bmN0aW9uIEIodCxuPTEwMCxlPTEvMCl7dHJ5e3JldHVybiBMKCIiLHQsbixlKX1jYXRjaCh0KXtyZXR1cm57RVJST1I6YCoqbm9uLXNlcmlhbGl6YWJsZSoqICgke3R9KWB9fX1mdW5jdGlvbiBMKHQsbixlPTEvMCxyPTEvMCxvPWZ1bmN0aW9uKCl7Y29uc3QgdD1uZXcgV2Vha1NldDtmdW5jdGlvbiBuKG4pe3JldHVybiEhdC5oYXMobil8fCh0LmFkZChuKSwhMSl9ZnVuY3Rpb24gZShuKXt0LmRlbGV0ZShuKX1yZXR1cm5bbixlXX0oKSl7Y29uc3RbaSxzXT1vO2lmKG51bGw9PW58fFsiYm9vbGVhbiIsInN0cmluZyJdLmluY2x1ZGVzKHR5cGVvZiBuKXx8Im51bWJlciI9PXR5cGVvZiBuJiZOdW1iZXIuaXNGaW5pdGUobikpcmV0dXJuIG47Y29uc3QgYz1mdW5jdGlvbih0LG4pe3RyeXtpZigidW5kZWZpbmVkIiE9dHlwZW9mIGdsb2JhbCYmbj09PWdsb2JhbClyZXR1cm4iW0dsb2JhbF0iO2lmKCJudW1iZXIiPT10eXBlb2YgbiYmIU51bWJlci5pc0Zpbml0ZShuKSlyZXR1cm5gWyR7bn1dYDtpZigiZnVuY3Rpb24iPT10eXBlb2YgbilyZXR1cm5gW0Z1bmN0aW9uOiAke2Z1bmN0aW9uKHQpe3RyeXtyZXR1cm4gdCYmImZ1bmN0aW9uIj09dHlwZW9mIHQmJnQubmFtZXx8eH1jYXRjaHtyZXR1cm4geH19KG4pfV1gO2lmKCJzeW1ib2wiPT10eXBlb2YgbilyZXR1cm5gWyR7U3RyaW5nKG4pfV1gO2lmKCJiaWdpbnQiPT10eXBlb2YgbilyZXR1cm5gW0JpZ0ludDogJHtTdHJpbmcobil9XWA7Y29uc3QgdD1mdW5jdGlvbih0KXtjb25zdCBuPU9iamVjdC5nZXRQcm90b3R5cGVPZih0KTtyZXR1cm4gbj8uY29uc3RydWN0b3I/bi5jb25zdHJ1Y3Rvci5uYW1lOiJudWxsIHByb3RvdHlwZSJ9KG4pO3JldHVybmBbb2JqZWN0ICR7dH1dYH1jYXRjaCh0KXtyZXR1cm5gKipub24tc2VyaWFsaXphYmxlKiogKCR7dH0pYH19KDAsbik7aWYoIWMuc3RhcnRzV2l0aCgiW29iamVjdCAiKSlyZXR1cm4gYztpZihmdW5jdGlvbih0KXtyZXR1cm4gQm9vbGVhbih0W0RdKX0obikpcmV0dXJuIG47Y29uc3QgdT1mdW5jdGlvbih0KXtjb25zdCBuPXRbVV07cmV0dXJuIm51bWJlciI9PXR5cGVvZiBuP246dm9pZCAwfShuKSxhPXZvaWQgMCE9PXU/dTplO2lmKDA9PT1hKXJldHVybiBjLnJlcGxhY2UoIm9iamVjdCAiLCIiKTtpZihpKG4pKXJldHVybiJbQ2lyY3VsYXIgfl0iO2NvbnN0IGY9bjtpZihmJiYiZnVuY3Rpb24iPT10eXBlb2YgZi50b0pTT04pdHJ5e3JldHVybiBMKCIiLGYudG9KU09OKCksYS0xLHIsbyl9Y2F0Y2h7fWNvbnN0IGg9QXJyYXkuaXNBcnJheShuKT9bXTp7fTtsZXQgcD0wO2NvbnN0IGQ9QShuKTtmb3IoY29uc3QgdCBpbiBkKXtpZighT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKGQsdCkpY29udGludWU7aWYocD49cil7aFt0XT0iW01heFByb3BlcnRpZXMgfl0iO2JyZWFrfWNvbnN0IG49ZFt0XTtoW3RdPUwodCxuLGEtMSxyLG8pLHArK31yZXR1cm4gcyhuKSxofWZ1bmN0aW9uIE0odCxuKXtjb25zdCBlPW4ucmVwbGFjZSgvXFwvZywiLyIpLnJlcGxhY2UoL1t8XFx7fSgpW1xdXiQrKj8uXS9nLCJcXCQmIik7bGV0IHI9dDt0cnl7cj1kZWNvZGVVUkkodCl9Y2F0Y2h7fXJldHVybiByLnJlcGxhY2UoL1xcL2csIi8iKS5yZXBsYWNlKC93ZWJwYWNrOlwvPy9nLCIiKS5yZXBsYWNlKG5ldyBSZWdFeHAoYChmaWxlOi8vKT8vKiR7ZX0vKmAsImlnIiksImFwcDovLy8iKX1mdW5jdGlvbiB6KHQsbj0wKXtyZXR1cm4ic3RyaW5nIiE9dHlwZW9mIHR8fDA9PT1ufHx0Lmxlbmd0aDw9bj90OmAke3Quc2xpY2UoMCxuKX0uLi5gfWxldCBGO2Z1bmN0aW9uIEcodD1mdW5jdGlvbigpe2NvbnN0IHQ9cDtyZXR1cm4gdC5jcnlwdG98fHQubXNDcnlwdG99KCkpe3RyeXtpZih0Py5yYW5kb21VVUlEKXJldHVybiBUKCgpPT50LnJhbmRvbVVVSUQoKSkucmVwbGFjZSgvLS9nLCIiKX1jYXRjaHt9cmV0dXJuIEZ8fChGPSIxMDAwMDAwMDEwMDA0MDAwODAwMDEwMDAwMDAwMDAwMCIpLEYucmVwbGFjZSgvWzAxOF0vZyx0PT4odF4oMTYqaygpJjE1KT4+dC80KS50b1N0cmluZygxNikpfWZ1bmN0aW9uIEooKXtyZXR1cm4gUCgpLzFlM31sZXQgVztmdW5jdGlvbiBZKCl7cmV0dXJuKFc/PyhXPWZ1bmN0aW9uKCl7Y29uc3R7cGVyZm9ybWFuY2U6dH09cDtpZighdD8ubm93fHwhdC50aW1lT3JpZ2luKXJldHVybiBKO2NvbnN0IG49dC50aW1lT3JpZ2luO3JldHVybigpPT4obitUKCgpPT50Lm5vdygpKSkvMWUzfSgpKSkoKX1mdW5jdGlvbiBIKHQpe2NvbnN0IG49WSgpLGU9e3NpZDpHKCksaW5pdDohMCx0aW1lc3RhbXA6bixzdGFydGVkOm4sZHVyYXRpb246MCxzdGF0dXM6Im9rIixlcnJvcnM6MCxpZ25vcmVEdXJhdGlvbjohMSx0b0pTT046KCk9PmZ1bmN0aW9uKHQpe3JldHVybntzaWQ6YCR7dC5zaWR9YCxpbml0OnQuaW5pdCxzdGFydGVkOm5ldyBEYXRlKDFlMyp0LnN0YXJ0ZWQpLnRvSVNPU3RyaW5nKCksdGltZXN0YW1wOm5ldyBEYXRlKDFlMyp0LnRpbWVzdGFtcCkudG9JU09TdHJpbmcoKSxzdGF0dXM6dC5zdGF0dXMsZXJyb3JzOnQuZXJyb3JzLGRpZDoibnVtYmVyIj09dHlwZW9mIHQuZGlkfHwic3RyaW5nIj09dHlwZW9mIHQuZGlkP2Ake3QuZGlkfWA6dm9pZCAwLGR1cmF0aW9uOnQuZHVyYXRpb24sYWJub3JtYWxfbWVjaGFuaXNtOnQuYWJub3JtYWxfbWVjaGFuaXNtLGF0dHJzOntyZWxlYXNlOnQucmVsZWFzZSxlbnZpcm9ubWVudDp0LmVudmlyb25tZW50LGlwX2FkZHJlc3M6dC5pcEFkZHJlc3MsdXNlcl9hZ2VudDp0LnVzZXJBZ2VudH19fShlKX07cmV0dXJuIHQmJksoZSx0KSxlfWZ1bmN0aW9uIEsodCxuPXt9KXtpZihuLnVzZXImJighdC5pcEFkZHJlc3MmJm4udXNlci5pcF9hZGRyZXNzJiYodC5pcEFkZHJlc3M9bi51c2VyLmlwX2FkZHJlc3MpLHQuZGlkfHxuLmRpZHx8KHQuZGlkPW4udXNlci5pZHx8bi51c2VyLmVtYWlsfHxuLnVzZXIudXNlcm5hbWUpKSx0LnRpbWVzdGFtcD1uLnRpbWVzdGFtcHx8WSgpLG4uYWJub3JtYWxfbWVjaGFuaXNtJiYodC5hYm5vcm1hbF9tZWNoYW5pc209bi5hYm5vcm1hbF9tZWNoYW5pc20pLG4uaWdub3JlRHVyYXRpb24mJih0Lmlnbm9yZUR1cmF0aW9uPW4uaWdub3JlRHVyYXRpb24pLG4uc2lkJiYodC5zaWQ9MzI9PT1uLnNpZC5sZW5ndGg/bi5zaWQ6RygpKSx2b2lkIDAhPT1uLmluaXQmJih0LmluaXQ9bi5pbml0KSwhdC5kaWQmJm4uZGlkJiYodC5kaWQ9YCR7bi5kaWR9YCksIm51bWJlciI9PXR5cGVvZiBuLnN0YXJ0ZWQmJih0LnN0YXJ0ZWQ9bi5zdGFydGVkKSx0Lmlnbm9yZUR1cmF0aW9uKXQuZHVyYXRpb249dm9pZCAwO2Vsc2UgaWYoIm51bWJlciI9PXR5cGVvZiBuLmR1cmF0aW9uKXQuZHVyYXRpb249bi5kdXJhdGlvbjtlbHNle2NvbnN0IG49dC50aW1lc3RhbXAtdC5zdGFydGVkO3QuZHVyYXRpb249bj49MD9uOjB9bi5yZWxlYXNlJiYodC5yZWxlYXNlPW4ucmVsZWFzZSksbi5lbnZpcm9ubWVudCYmKHQuZW52aXJvbm1lbnQ9bi5lbnZpcm9ubWVudCksIXQuaXBBZGRyZXNzJiZuLmlwQWRkcmVzcyYmKHQuaXBBZGRyZXNzPW4uaXBBZGRyZXNzKSwhdC51c2VyQWdlbnQmJm4udXNlckFnZW50JiYodC51c2VyQWdlbnQ9bi51c2VyQWdlbnQpLCJudW1iZXIiPT10eXBlb2Ygbi5lcnJvcnMmJih0LmVycm9ycz1uLmVycm9ycyksbi5zdGF0dXMmJih0LnN0YXR1cz1uLnN0YXR1cyl9ZnVuY3Rpb24gWih0LG4sZT0yKXtpZighbnx8Im9iamVjdCIhPXR5cGVvZiBufHxlPD0wKXJldHVybiBuO2lmKHQmJjA9PT1PYmplY3Qua2V5cyhuKS5sZW5ndGgpcmV0dXJuIHQ7Y29uc3Qgcj17Li4udH07Zm9yKGNvbnN0IHQgaW4gbilPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwobix0KSYmKHJbdF09WihyW3RdLG5bdF0sZS0xKSk7cmV0dXJuIHJ9ZnVuY3Rpb24gcSgpe3JldHVybiBHKCl9ZnVuY3Rpb24gVigpe3JldHVybiBHKCkuc3Vic3RyaW5nKDE2KX1mdW5jdGlvbiBRKHQpe2lmKHQpe2lmKCJvYmplY3QiPT10eXBlb2YgdCYmImRlcmVmImluIHQmJiJmdW5jdGlvbiI9PXR5cGVvZiB0LmRlcmVmKXRyeXtyZXR1cm4gdC5kZXJlZigpfWNhdGNoe3JldHVybn1yZXR1cm4gdH19Y29uc3QgWD0iX3NlbnRyeVNwYW4iO2Z1bmN0aW9uIHR0KHQsbil7bj9mdW5jdGlvbih0LG4sZSl7dHJ5e09iamVjdC5kZWZpbmVQcm9wZXJ0eSh0LG4se3ZhbHVlOmUsd3JpdGFibGU6ITAsY29uZmlndXJhYmxlOiEwfSl9Y2F0Y2h7aCYmdy5sb2coYEZhaWxlZCB0byBhZGQgbm9uLWVudW1lcmFibGUgcHJvcGVydHkgIiR7U3RyaW5nKG4pfSIgdG8gb2JqZWN0YCx0KX19KHQsWCxmdW5jdGlvbih0KXt0cnl7Y29uc3Qgbj1wLldlYWtSZWY7aWYoImZ1bmN0aW9uIj09dHlwZW9mIG4pcmV0dXJuIG5ldyBuKHQpfWNhdGNoe31yZXR1cm4gdH0obikpOmRlbGV0ZSB0W1hdfWZ1bmN0aW9uIG50KHQpe3JldHVybiBRKHRbWF0pfWNsYXNzIGV0e2NvbnN0cnVjdG9yKCl7dGhpcy50PSExLHRoaXMubz1bXSx0aGlzLmk9W10sdGhpcy51PVtdLHRoaXMuaD1bXSx0aGlzLnA9e30sdGhpcy5sPXt9LHRoaXMubT17fSx0aGlzLnY9e30sdGhpcy5fPXt9LHRoaXMuUz17fSx0aGlzLk49e3RyYWNlSWQ6cSgpLHNhbXBsZVJhbmQ6aygpfX1jbG9uZSgpe2NvbnN0IHQ9bmV3IGV0O3JldHVybiB0LnU9Wy4uLnRoaXMudV0sdC5sPXsuLi50aGlzLmx9LHQubT17Li4udGhpcy5tfSx0LnY9ey4uLnRoaXMudn0sdC5fPXsuLi50aGlzLl99LHRoaXMuXy5mbGFncyYmKHQuXy5mbGFncz17dmFsdWVzOlsuLi50aGlzLl8uZmxhZ3MudmFsdWVzXX0pLHQucD10aGlzLnAsdC5DPXRoaXMuQyx0Lmo9dGhpcy5qLHQuUj10aGlzLlIsdC5BPXRoaXMuQSx0Lmk9Wy4uLnRoaXMuaV0sdC5oPVsuLi50aGlzLmhdLHQuUz17Li4udGhpcy5TfSx0Lk49ey4uLnRoaXMuTn0sdC5JPXRoaXMuSSx0Lk89dGhpcy5PLHQuVD10aGlzLlQsdHQodCxudCh0aGlzKSksdH1zZXRDbGllbnQodCl7dGhpcy5JPXR9c2V0TGFzdEV2ZW50SWQodCl7dGhpcy5PPXR9Z2V0Q2xpZW50KCl7cmV0dXJuIHRoaXMuSX1sYXN0RXZlbnRJZCgpe3JldHVybiB0aGlzLk99YWRkU2NvcGVMaXN0ZW5lcih0KXt0aGlzLm8ucHVzaCh0KX1hZGRFdmVudFByb2Nlc3Nvcih0KXtyZXR1cm4gdGhpcy5pLnB1c2godCksdGhpc31zZXRVc2VyKHQpe3JldHVybiB0aGlzLnA9dHx8e2VtYWlsOnZvaWQgMCxpZDp2b2lkIDAsaXBfYWRkcmVzczp2b2lkIDAsdXNlcm5hbWU6dm9pZCAwfSx0aGlzLmomJksodGhpcy5qLHt1c2VyOnR9KSx0aGlzLmsoKSx0aGlzfWdldFVzZXIoKXtyZXR1cm4gdGhpcy5wfXNldENvbnZlcnNhdGlvbklkKHQpe3JldHVybiB0aGlzLlQ9dHx8dm9pZCAwLHRoaXMuaygpLHRoaXN9c2V0VGFncyh0KXtyZXR1cm4gdGhpcy5sPXsuLi50aGlzLmwsLi4udH0sdGhpcy5rKCksdGhpc31zZXRUYWcodCxuKXtyZXR1cm4gdGhpcy5zZXRUYWdzKHtbdF06bn0pfXNldEF0dHJpYnV0ZXModCl7cmV0dXJuIHRoaXMubT17Li4udGhpcy5tLC4uLnR9LHRoaXMuaygpLHRoaXN9c2V0QXR0cmlidXRlKHQsbil7cmV0dXJuIHRoaXMuc2V0QXR0cmlidXRlcyh7W3RdOm59KX1yZW1vdmVBdHRyaWJ1dGUodCl7cmV0dXJuIHQgaW4gdGhpcy5tJiYoZGVsZXRlIHRoaXMubVt0XSx0aGlzLmsoKSksdGhpc31zZXRFeHRyYXModCl7cmV0dXJuIHRoaXMudj17Li4udGhpcy52LC4uLnR9LHRoaXMuaygpLHRoaXN9c2V0RXh0cmEodCxuKXtyZXR1cm4gdGhpcy52PXsuLi50aGlzLnYsW3RdOm59LHRoaXMuaygpLHRoaXN9c2V0RmluZ2VycHJpbnQodCl7cmV0dXJuIHRoaXMuQT10LHRoaXMuaygpLHRoaXN9c2V0TGV2ZWwodCl7cmV0dXJuIHRoaXMuQz10LHRoaXMuaygpLHRoaXN9c2V0VHJhbnNhY3Rpb25OYW1lKHQpe3JldHVybiB0aGlzLlI9dCx0aGlzLmsoKSx0aGlzfXNldENvbnRleHQodCxuKXtyZXR1cm4gbnVsbD09PW4/ZGVsZXRlIHRoaXMuX1t0XTp0aGlzLl9bdF09bix0aGlzLmsoKSx0aGlzfXNldFNlc3Npb24odCl7cmV0dXJuIHQ/dGhpcy5qPXQ6ZGVsZXRlIHRoaXMuaix0aGlzLmsoKSx0aGlzfWdldFNlc3Npb24oKXtyZXR1cm4gdGhpcy5qfXVwZGF0ZSh0KXtpZighdClyZXR1cm4gdGhpcztjb25zdCBuPSJmdW5jdGlvbiI9PXR5cGVvZiB0P3QodGhpcyk6dCxlPW4gaW5zdGFuY2VvZiBldD9uLmdldFNjb3BlRGF0YSgpOkMobiwiT2JqZWN0Iik/dDp2b2lkIDA7Y29uc3R7dGFnczpyLGF0dHJpYnV0ZXM6byxleHRyYTppLHVzZXI6cyxjb250ZXh0czpjLGxldmVsOnUsZmluZ2VycHJpbnQ6YT1bXSxwcm9wYWdhdGlvbkNvbnRleHQ6Zixjb252ZXJzYXRpb25JZDpofT1lfHx7fTtyZXR1cm4gdGhpcy5sPXsuLi50aGlzLmwsLi4ucn0sdGhpcy5tPXsuLi50aGlzLm0sLi4ub30sdGhpcy52PXsuLi50aGlzLnYsLi4uaX0sdGhpcy5fPXsuLi50aGlzLl8sLi4uY30scyYmT2JqZWN0LmtleXMocykubGVuZ3RoJiYodGhpcy5wPXMpLHUmJih0aGlzLkM9dSksYS5sZW5ndGgmJih0aGlzLkE9YSksZiYmKHRoaXMuTj1mKSxoJiYodGhpcy5UPWgpLHRoaXN9Y2xlYXIoKXtyZXR1cm4gdGhpcy51PVtdLHRoaXMubD17fSx0aGlzLm09e30sdGhpcy52PXt9LHRoaXMucD17fSx0aGlzLl89e30sdGhpcy5DPXZvaWQgMCx0aGlzLlI9dm9pZCAwLHRoaXMuQT12b2lkIDAsdGhpcy5qPXZvaWQgMCx0aGlzLlQ9dm9pZCAwLHR0KHRoaXMsdm9pZCAwKSx0aGlzLmg9W10sdGhpcy5zZXRQcm9wYWdhdGlvbkNvbnRleHQoe3RyYWNlSWQ6cSgpLHNhbXBsZVJhbmQ6aygpfSksdGhpcy5rKCksdGhpc31hZGRCcmVhZGNydW1iKHQsbil7Y29uc3QgZT0ibnVtYmVyIj09dHlwZW9mIG4/bjoxMDA7aWYoZTw9MClyZXR1cm4gdGhpcztjb25zdCByPXt0aW1lc3RhbXA6SigpLC4uLnQsbWVzc2FnZTp0Lm1lc3NhZ2U/eih0Lm1lc3NhZ2UsMjA0OCk6dC5tZXNzYWdlfTtyZXR1cm4gdGhpcy51LnB1c2gociksdGhpcy51Lmxlbmd0aD5lJiYodGhpcy51PXRoaXMudS5zbGljZSgtZSksdGhpcy5JPy5yZWNvcmREcm9wcGVkRXZlbnQoImJ1ZmZlcl9vdmVyZmxvdyIsImxvZ19pdGVtIikpLHRoaXMuaygpLHRoaXN9Z2V0TGFzdEJyZWFkY3J1bWIoKXtyZXR1cm4gdGhpcy51W3RoaXMudS5sZW5ndGgtMV19Y2xlYXJCcmVhZGNydW1icygpe3JldHVybiB0aGlzLnU9W10sdGhpcy5rKCksdGhpc31hZGRBdHRhY2htZW50KHQpe3JldHVybiB0aGlzLmgucHVzaCh0KSx0aGlzfWNsZWFyQXR0YWNobWVudHMoKXtyZXR1cm4gdGhpcy5oPVtdLHRoaXN9Z2V0U2NvcGVEYXRhKCl7cmV0dXJue2JyZWFkY3J1bWJzOnRoaXMudSxhdHRhY2htZW50czp0aGlzLmgsY29udGV4dHM6dGhpcy5fLHRhZ3M6dGhpcy5sLGF0dHJpYnV0ZXM6dGhpcy5tLGV4dHJhOnRoaXMudix1c2VyOnRoaXMucCxsZXZlbDp0aGlzLkMsZmluZ2VycHJpbnQ6dGhpcy5BfHxbXSxldmVudFByb2Nlc3NvcnM6dGhpcy5pLHByb3BhZ2F0aW9uQ29udGV4dDp0aGlzLk4sc2RrUHJvY2Vzc2luZ01ldGFkYXRhOnRoaXMuUyx0cmFuc2FjdGlvbk5hbWU6dGhpcy5SLHNwYW46bnQodGhpcyksY29udmVyc2F0aW9uSWQ6dGhpcy5UfX1zZXRTREtQcm9jZXNzaW5nTWV0YWRhdGEodCl7cmV0dXJuIHRoaXMuUz1aKHRoaXMuUyx0LDIpLHRoaXN9c2V0UHJvcGFnYXRpb25Db250ZXh0KHQpe3JldHVybiB0aGlzLk49dCx0aGlzfWdldFByb3BhZ2F0aW9uQ29udGV4dCgpe3JldHVybiB0aGlzLk59Y2FwdHVyZUV4Y2VwdGlvbih0LG4pe2NvbnN0IGU9bj8uZXZlbnRfaWR8fEcoKTtpZighdGhpcy5JKXJldHVybiBoJiZ3Lndhcm4oIk5vIGNsaWVudCBjb25maWd1cmVkIG9uIHNjb3BlIC0gd2lsbCBub3QgY2FwdHVyZSBleGNlcHRpb24hIiksZTtjb25zdCByPW5ldyBFcnJvcigiU2VudHJ5IHN5bnRoZXRpY0V4Y2VwdGlvbiIpO3JldHVybiB0aGlzLkkuY2FwdHVyZUV4Y2VwdGlvbih0LHtvcmlnaW5hbEV4Y2VwdGlvbjp0LHN5bnRoZXRpY0V4Y2VwdGlvbjpyLC4uLm4sZXZlbnRfaWQ6ZX0sdGhpcyksZX1jYXB0dXJlTWVzc2FnZSh0LG4sZSl7Y29uc3Qgcj1lPy5ldmVudF9pZHx8RygpO2lmKCF0aGlzLkkpcmV0dXJuIGgmJncud2FybigiTm8gY2xpZW50IGNvbmZpZ3VyZWQgb24gc2NvcGUgLSB3aWxsIG5vdCBjYXB0dXJlIG1lc3NhZ2UhIikscjtjb25zdCBvPWU/LnN5bnRoZXRpY0V4Y2VwdGlvbj8/bmV3IEVycm9yKHQpO3JldHVybiB0aGlzLkkuY2FwdHVyZU1lc3NhZ2UodCxuLHtvcmlnaW5hbEV4Y2VwdGlvbjp0LHN5bnRoZXRpY0V4Y2VwdGlvbjpvLC4uLmUsZXZlbnRfaWQ6cn0sdGhpcykscn1jYXB0dXJlRXZlbnQodCxuKXtjb25zdCBlPXQuZXZlbnRfaWR8fG4/LmV2ZW50X2lkfHxHKCk7cmV0dXJuIHRoaXMuST8odGhpcy5JLmNhcHR1cmVFdmVudCh0LHsuLi5uLGV2ZW50X2lkOmV9LHRoaXMpLGUpOihoJiZ3Lndhcm4oIk5vIGNsaWVudCBjb25maWd1cmVkIG9uIHNjb3BlIC0gd2lsbCBub3QgY2FwdHVyZSBldmVudCEiKSxlKX1rKCl7dGhpcy50fHwodGhpcy50PSEwLHRoaXMuby5mb3JFYWNoKHQ9Pnt0KHRoaXMpfSksdGhpcy50PSExKX19Y29uc3QgcnQ9dD0+dCBpbnN0YW5jZW9mIFByb21pc2UmJiF0W290XSxvdD1TeW1ib2woImNoYWluZWQgUHJvbWlzZUxpa2UiKSxpdD0odCxuKT0+e2lmKCFuKXJldHVybiB0O2xldCBlPSExO2Zvcihjb25zdCByIGluIHQpe2lmKHIgaW4gbiljb250aW51ZTtlPSEwO2NvbnN0IG89dFtyXTsiZnVuY3Rpb24iPT10eXBlb2Ygbz9PYmplY3QuZGVmaW5lUHJvcGVydHkobixyLHt2YWx1ZTooLi4ubik9Pm8uYXBwbHkodCxuKSxlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMH0pOm5bcl09b31yZXR1cm4gZSYmT2JqZWN0LmFzc2lnbihuLHtbb3RdOiEwfSksbn07Y2xhc3Mgc3R7Y29uc3RydWN0b3IodCxuKXtsZXQgZSxyO2U9dHx8bmV3IGV0LHI9bnx8bmV3IGV0LHRoaXMuUD1be3Njb3BlOmV9XSx0aGlzLkQ9cn13aXRoU2NvcGUodCl7Y29uc3Qgbj10aGlzLlUoKTtsZXQgZTt0cnl7ZT10KG4pfWNhdGNoKHQpe3Rocm93IHRoaXMuQigpLHR9cmV0dXJuIGooZSk/KCh0LG4sZSk9Pntjb25zdCByPXQudGhlbih0PT4obih0KSx0KSx0PT57dGhyb3cgZSh0KSx0fSk7cmV0dXJuIHJ0KHIpJiZydCh0KT9yOml0KHQscil9KShlLCgpPT50aGlzLkIoKSwoKT0+dGhpcy5CKCkpOih0aGlzLkIoKSxlKX1nZXRDbGllbnQoKXtyZXR1cm4gdGhpcy5nZXRTdGFja1RvcCgpLmNsaWVudH1nZXRTY29wZSgpe3JldHVybiB0aGlzLmdldFN0YWNrVG9wKCkuc2NvcGV9Z2V0SXNvbGF0aW9uU2NvcGUoKXtyZXR1cm4gdGhpcy5EfWdldFN0YWNrVG9wKCl7cmV0dXJuIHRoaXMuUFt0aGlzLlAubGVuZ3RoLTFdfVUoKXtjb25zdCB0PXRoaXMuZ2V0U2NvcGUoKS5jbG9uZSgpO3JldHVybiB0aGlzLlAucHVzaCh7Y2xpZW50OnRoaXMuZ2V0Q2xpZW50KCksc2NvcGU6dH0pLHR9Qigpe3JldHVybiEodGhpcy5QLmxlbmd0aDw9MSkmJiEhdGhpcy5QLnBvcCgpfX1mdW5jdGlvbiBjdCgpe2NvbnN0IHQ9ZyhsKCkpO3JldHVybiB0LnN0YWNrPXQuc3RhY2t8fG5ldyBzdChtKCJkZWZhdWx0Q3VycmVudFNjb3BlIiwoKT0+bmV3IGV0KSxtKCJkZWZhdWx0SXNvbGF0aW9uU2NvcGUiLCgpPT5uZXcgZXQpKX1mdW5jdGlvbiB1dCh0KXtyZXR1cm4gY3QoKS53aXRoU2NvcGUodCl9ZnVuY3Rpb24gYXQodCxuKXtjb25zdCBlPWN0KCk7cmV0dXJuIGUud2l0aFNjb3BlKCgpPT4oZS5nZXRTdGFja1RvcCgpLnNjb3BlPXQsbih0KSkpfWZ1bmN0aW9uIGZ0KHQpe3JldHVybiBjdCgpLndpdGhTY29wZSgoKT0+dChjdCgpLmdldElzb2xhdGlvblNjb3BlKCkpKX1mdW5jdGlvbiBodCh0KXtjb25zdCBuPWcodCk7cmV0dXJuIG4uYWNzP24uYWNzOnt3aXRoSXNvbGF0aW9uU2NvcGU6ZnQsd2l0aFNjb3BlOnV0LHdpdGhTZXRTY29wZTphdCx3aXRoU2V0SXNvbGF0aW9uU2NvcGU6KHQsbik9PmZ0KG4pLGdldEN1cnJlbnRTY29wZTooKT0+Y3QoKS5nZXRTY29wZSgpLGdldElzb2xhdGlvblNjb3BlOigpPT5jdCgpLmdldElzb2xhdGlvblNjb3BlKCl9fWZ1bmN0aW9uIHB0KCl7cmV0dXJuIGh0KGwoKSkuZ2V0Q3VycmVudFNjb3BlKCkuZ2V0Q2xpZW50KCl9ZnVuY3Rpb24gZHQodCl7Y29uc3Qgbj10O3JldHVybntzY29wZTpuLl9zZW50cnlTY29wZSxpc29sYXRpb25TY29wZTpRKG4uX3NlbnRyeUlzb2xhdGlvblNjb3BlKX19Y29uc3QgbHQ9InNlbnRyeS0iO2Z1bmN0aW9uIGd0KHQpe2NvbnN0IG49ZnVuY3Rpb24odCl7aWYoIXR8fChuPXQsIUMobiwiU3RyaW5nIikmJiFBcnJheS5pc0FycmF5KHQpKSlyZXR1cm47dmFyIG47aWYoQXJyYXkuaXNBcnJheSh0KSlyZXR1cm4gdC5yZWR1Y2UoKHQsbik9Pntjb25zdCBlPW10KG4pO3JldHVybiBPYmplY3QuZW50cmllcyhlKS5mb3JFYWNoKChbbixlXSk9Pnt0W25dPWV9KSx0fSx7fSk7cmV0dXJuIG10KHQpfSh0KTtpZighbilyZXR1cm47Y29uc3QgZT1PYmplY3QuZW50cmllcyhuKS5yZWR1Y2UoKHQsW24sZV0pPT57aWYobi5zdGFydHNXaXRoKGx0KSl7dFtuLnNsaWNlKDcpXT1lfXJldHVybiB0fSx7fSk7cmV0dXJuIE9iamVjdC5rZXlzKGUpLmxlbmd0aD4wP2U6dm9pZCAwfWZ1bmN0aW9uIG10KHQpe3JldHVybiB0LnNwbGl0KCIsIikubWFwKHQ9Pntjb25zdCBuPXQuaW5kZXhPZigiPSIpO2lmKC0xPT09bilyZXR1cm5bXTtyZXR1cm5bdC5zbGljZSgwLG4pLHQuc2xpY2UobisxKV0ubWFwKHQ9Pnt0cnl7cmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudCh0LnRyaW0oKSl9Y2F0Y2h7cmV0dXJufX0pfSkucmVkdWNlKCh0LFtuLGVdKT0+KG4mJmUmJih0W25dPWUpLHQpLHt9KX1jb25zdCB5dD0vXm8oXGQrKVwuLztmdW5jdGlvbiBidCh0LG49ITEpe2NvbnN0e2hvc3Q6ZSxwYXRoOnIscGFzczpvLHBvcnQ6aSxwcm9qZWN0SWQ6cyxwcm90b2NvbDpjLHB1YmxpY0tleTp1fT10O3JldHVybmAke2N9Oi8vJHt1fSR7biYmbz9gOiR7b31gOiIifUAke2V9JHtpP2A6JHtpfWA6IiJ9LyR7cj9gJHtyfS9gOnJ9JHtzfWB9ZnVuY3Rpb24gdnQodCl7Y29uc3Qgbj10LmdldE9wdGlvbnMoKSx7aG9zdDplfT10LmdldERzbigpfHx7fTtsZXQgcjtyZXR1cm4gbi5vcmdJZD9yPVN0cmluZyhuLm9yZ0lkKTplJiYocj1mdW5jdGlvbih0KXtjb25zdCBuPXQubWF0Y2goeXQpO3JldHVybiBuPy5bMV19KGUpKSxyfWZ1bmN0aW9uIF90KHQpe2NvbnN0e3NwYW5JZDpuLHRyYWNlSWQ6ZSxpc1JlbW90ZTpyfT10LnNwYW5Db250ZXh0KCksbz1yP246RXQodCkucGFyZW50X3NwYW5faWQsaT1kdCh0KS5zY29wZTtyZXR1cm57cGFyZW50X3NwYW5faWQ6byxzcGFuX2lkOnI/aT8uZ2V0UHJvcGFnYXRpb25Db250ZXh0KCkucHJvcGFnYXRpb25TcGFuSWR8fFYoKTpuLHRyYWNlX2lkOmV9fWZ1bmN0aW9uIFN0KHQpe3JldHVybiB0JiZ0Lmxlbmd0aD4wP3QubWFwKCh7Y29udGV4dDp7c3BhbklkOnQsdHJhY2VJZDpuLHRyYWNlRmxhZ3M6ZSwuLi5yfSxhdHRyaWJ1dGVzOm99KT0+KHtzcGFuX2lkOnQsdHJhY2VfaWQ6bixzYW1wbGVkOjE9PT1lLGF0dHJpYnV0ZXM6bywuLi5yfSkpOnZvaWQgMH1mdW5jdGlvbiB3dCh0KXtyZXR1cm4ibnVtYmVyIj09dHlwZW9mIHQ/JHQodCk6QXJyYXkuaXNBcnJheSh0KT90WzBdK3RbMV0vMWU5OnQgaW5zdGFuY2VvZiBEYXRlPyR0KHQuZ2V0VGltZSgpKTpZKCl9ZnVuY3Rpb24gJHQodCl7cmV0dXJuIHQ+OTk5OTk5OTk5OT90LzFlMzp0fWZ1bmN0aW9uIEV0KHQpe2lmKGZ1bmN0aW9uKHQpe3JldHVybiJmdW5jdGlvbiI9PXR5cGVvZiB0LmdldFNwYW5KU09OfSh0KSlyZXR1cm4gdC5nZXRTcGFuSlNPTigpO2NvbnN0e3NwYW5JZDpuLHRyYWNlSWQ6ZX09dC5zcGFuQ29udGV4dCgpO2lmKGZ1bmN0aW9uKHQpe2NvbnN0IG49dDtyZXR1cm4hIShuLmF0dHJpYnV0ZXMmJm4uc3RhcnRUaW1lJiZuLm5hbWUmJm4uZW5kVGltZSYmbi5zdGF0dXMpfSh0KSl7Y29uc3R7YXR0cmlidXRlczpyLHN0YXJ0VGltZTpvLG5hbWU6aSxlbmRUaW1lOnMsc3RhdHVzOmMsbGlua3M6dX09dDtyZXR1cm57c3Bhbl9pZDpuLHRyYWNlX2lkOmUsZGF0YTpyLGRlc2NyaXB0aW9uOmkscGFyZW50X3NwYW5faWQ6eHQodCksc3RhcnRfdGltZXN0YW1wOnd0KG8pLHRpbWVzdGFtcDp3dChzKXx8dm9pZCAwLHN0YXR1czpOdChjKSxvcDpyWyJzZW50cnkub3AiXSxvcmlnaW46clsic2VudHJ5Lm9yaWdpbiJdLGxpbmtzOlN0KHUpfX1yZXR1cm57c3Bhbl9pZDpuLHRyYWNlX2lkOmUsc3RhcnRfdGltZXN0YW1wOjAsZGF0YTp7fX19ZnVuY3Rpb24geHQodCl7cmV0dXJuInBhcmVudFNwYW5JZCJpbiB0P3QucGFyZW50U3BhbklkOiJwYXJlbnRTcGFuQ29udGV4dCJpbiB0P3QucGFyZW50U3BhbkNvbnRleHQ/LnNwYW5JZDp2b2lkIDB9ZnVuY3Rpb24gTnQodCl7aWYodCYmMCE9PXQuY29kZSlyZXR1cm4gMT09PXQuY29kZT8ib2siOnQubWVzc2FnZXx8ImludGVybmFsX2Vycm9yIn1jb25zdCBDdD1mdW5jdGlvbih0KXtyZXR1cm4gdC5fc2VudHJ5Um9vdFNwYW58fHR9O2Z1bmN0aW9uIGp0KHQpe2lmKCJib29sZWFuIj09dHlwZW9mIF9fU0VOVFJZX1RSQUNJTkdfXyYmIV9fU0VOVFJZX1RSQUNJTkdfXylyZXR1cm4hMTtjb25zdCBuPXR8fHB0KCk/LmdldE9wdGlvbnMoKTtyZXR1cm4hKCFufHxudWxsPT1uLnRyYWNlc1NhbXBsZVJhdGUmJiFuLnRyYWNlc1NhbXBsZXIpfWNvbnN0IFJ0PVN5bWJvbC5mb3IoInNlbnRyeS5ub25SZWNvcmRpbmdTcGFuIik7ZnVuY3Rpb24gQXQodCxuKXtjb25zdCBlPW4uZ2V0T3B0aW9ucygpLHtwdWJsaWNLZXk6cn09bi5nZXREc24oKXx8e30sbz17ZW52aXJvbm1lbnQ6ZS5lbnZpcm9ubWVudHx8InByb2R1Y3Rpb24iLHJlbGVhc2U6ZS5yZWxlYXNlLHB1YmxpY19rZXk6cix0cmFjZV9pZDp0LG9yZ19pZDp2dChuKX07cmV0dXJuIG4uZW1pdCgiY3JlYXRlRHNjIixvKSxvfWZ1bmN0aW9uIEl0KHQsbil7Y29uc3QgZT1uLmdldFByb3BhZ2F0aW9uQ29udGV4dCgpO3JldHVybiBlLmRzY3x8QXQoZS50cmFjZUlkLHQpfWZ1bmN0aW9uIE90KHQpe2NvbnN0IG49cHQoKTtpZighbilyZXR1cm57fTtjb25zdCBlPUN0KHQpLHI9RXQoZSksbz1yLmRhdGEsaT1lLnNwYW5Db250ZXh0KCkudHJhY2VTdGF0ZSxzPWk/LmdldCgic2VudHJ5LnNhbXBsZV9yYXRlIik/P29bInNlbnRyeS5zYW1wbGVfcmF0ZSJdPz9vWyJzZW50cnkucHJldmlvdXNfdHJhY2Vfc2FtcGxlX3JhdGUiXTtmdW5jdGlvbiBjKHQpe3JldHVybiJudW1iZXIiIT10eXBlb2YgcyYmInN0cmluZyIhPXR5cGVvZiBzfHwodC5zYW1wbGVfcmF0ZT1gJHtzfWApLHR9Y29uc3QgdT1lLl9mcm96ZW5Ec2M7aWYodSlyZXR1cm4gYyh1KTtjb25zdCBhPWZ1bmN0aW9uKHQpe3JldHVybiEhdCYmITA9PT10W1J0XX0oZSksZj1hJiYiaWdub3JlZCI9PT1lLmRyb3BSZWFzb247aWYoYSYmKCFqdChuLmdldE9wdGlvbnMoKSl8fGYpKXtjb25zdCB0PWR0KGUpLnNjb3BlO2lmKHQpe2NvbnN0IGU9ey4uLkl0KG4sdCl9O3JldHVybiBmJiYoZS5zYW1wbGVkPSJmYWxzZSIpLGMoZSl9fWNvbnN0IGg9aT8uZ2V0KCJzZW50cnkuZHNjIikscD1oJiZndChoKTtpZihwKXJldHVybiBjKHApO2NvbnN0IGQ9QXQodC5zcGFuQ29udGV4dCgpLnRyYWNlSWQsbiksbD1vWyJzZW50cnkuc291cmNlIl0/P29bInNlbnRyeS5zZWdtZW50Lm5hbWUuc291cmNlIl0sZz1yLmRlc2NyaXB0aW9uO3JldHVybiJ1cmwiIT09bCYmZyYmKGQudHJhbnNhY3Rpb249ZyksanQoKSYmKGQuc2FtcGxlZD1TdHJpbmcoZnVuY3Rpb24odCl7Y29uc3R7dHJhY2VGbGFnczpufT10LnNwYW5Db250ZXh0KCk7cmV0dXJuIDE9PT1ufShlKSksZC5zYW1wbGVfcmFuZD1pPy5nZXQoInNlbnRyeS5zYW1wbGVfcmFuZCIpPz9kdChlKS5zY29wZT8uZ2V0UHJvcGFnYXRpb25Db250ZXh0KCkuc2FtcGxlUmFuZC50b1N0cmluZygpKSxjKGQpLG4uZW1pdCgiY3JlYXRlRHNjIixkLGUpLGR9ZnVuY3Rpb24gVHQodCxuPVtdKXtyZXR1cm5bdCxuXX1mdW5jdGlvbiBrdCh0LG4pe2NvbnN0IGU9dFsxXTtmb3IoY29uc3QgdCBvZiBlKXtpZihuKHQsdFswXS50eXBlKSlyZXR1cm4hMH1yZXR1cm4hMX1mdW5jdGlvbiBQdCh0KXtjb25zdCBuPWcocCk7cmV0dXJuIG4uZW5jb2RlUG9seWZpbGw/bi5lbmNvZGVQb2x5ZmlsbCh0KToobmV3IFRleHRFbmNvZGVyKS5lbmNvZGUodCl9ZnVuY3Rpb24gRHQodCl7Y29uc3RbbixlXT10O2xldCByPUpTT04uc3RyaW5naWZ5KG4pO2Z1bmN0aW9uIG8odCl7InN0cmluZyI9PXR5cGVvZiByP3I9InN0cmluZyI9PXR5cGVvZiB0P3IrdDpbUHQociksdF06ci5wdXNoKCJzdHJpbmciPT10eXBlb2YgdD9QdCh0KTp0KX1mb3IoY29uc3QgdCBvZiBlKXtjb25zdFtuLGVdPXQ7aWYobyhgXG4ke0pTT04uc3RyaW5naWZ5KG4pfVxuYCksInN0cmluZyI9PXR5cGVvZiBlfHxlIGluc3RhbmNlb2YgVWludDhBcnJheSlvKGUpO2Vsc2V7bGV0IHQ7dHJ5e3Q9SlNPTi5zdHJpbmdpZnkoZSl9Y2F0Y2h7dD1KU09OLnN0cmluZ2lmeShCKGUpKX1vKHQpfX1yZXR1cm4ic3RyaW5nIj09dHlwZW9mIHI/cjpmdW5jdGlvbih0KXtjb25zdCBuPXQucmVkdWNlKCh0LG4pPT50K24ubGVuZ3RoLDApLGU9bmV3IFVpbnQ4QXJyYXkobik7bGV0IHI9MDtmb3IoY29uc3QgbiBvZiB0KWUuc2V0KG4scikscis9bi5sZW5ndGg7cmV0dXJuIGV9KHIpfWNvbnN0IFV0PXtzZXNzaW9uczoic2Vzc2lvbiIsZXZlbnQ6ImVycm9yIixjbGllbnRfcmVwb3J0OiJpbnRlcm5hbCIsdXNlcl9yZXBvcnQ6ImRlZmF1bHQiLHByb2ZpbGVfY2h1bms6InByb2ZpbGUiLHJlcGxheV9ldmVudDoicmVwbGF5IixyZXBsYXlfcmVjb3JkaW5nOiJyZXBsYXkiLGNoZWNrX2luOiJtb25pdG9yIixyYXdfc2VjdXJpdHk6InNlY3VyaXR5Iixsb2c6ImxvZ19pdGVtIix0cmFjZV9tZXRyaWM6Im1ldHJpYyJ9O2Z1bmN0aW9uIEJ0KHQpe3JldHVybiBmdW5jdGlvbih0KXtyZXR1cm4gdCBpbiBVdH0odCk/VXRbdF06dH1mdW5jdGlvbiBMdCh0KXtpZighdD8uc2RrKXJldHVybjtjb25zdHtuYW1lOm4sdmVyc2lvbjplfT10LnNkaztyZXR1cm57bmFtZTpuLHZlcnNpb246ZX19ZnVuY3Rpb24gTXQodCxuLGUscil7Y29uc3Qgbz1MdChlKSxpPXQudHlwZSYmInJlcGxheV9ldmVudCIhPT10LnR5cGU/dC50eXBlOiJldmVudCI7IWZ1bmN0aW9uKHQsbil7aWYoIW4pcmV0dXJuIHQ7Y29uc3QgZT10LnNka3x8e307dC5zZGs9ey4uLmUsbmFtZTplLm5hbWV8fG4ubmFtZSx2ZXJzaW9uOmUudmVyc2lvbnx8bi52ZXJzaW9uLGludGVncmF0aW9uczpbLi4udC5zZGs/LmludGVncmF0aW9uc3x8W10sLi4ubi5pbnRlZ3JhdGlvbnN8fFtdXSxwYWNrYWdlczpbLi4udC5zZGs/LnBhY2thZ2VzfHxbXSwuLi5uLnBhY2thZ2VzfHxbXV0sc2V0dGluZ3M6dC5zZGs/LnNldHRpbmdzfHxuLnNldHRpbmdzP3suLi50LnNkaz8uc2V0dGluZ3MsLi4ubi5zZXR0aW5nc306dm9pZCAwfX0odCxlPy5zZGspO2NvbnN0IHM9ZnVuY3Rpb24odCxuLGUscil7Y29uc3Qgbz10LnNka1Byb2Nlc3NpbmdNZXRhZGF0YT8uZHluYW1pY1NhbXBsaW5nQ29udGV4dDtyZXR1cm57ZXZlbnRfaWQ6dC5ldmVudF9pZCxzZW50X2F0Om5ldyBEYXRlKFAoKSkudG9JU09TdHJpbmcoKSwuLi5uJiZ7c2RrOm59LC4uLiEhZSYmciYme2RzbjpidChyKX0sLi4ubyYme3RyYWNlOm99fX0odCxvLHIsbik7ZGVsZXRlIHQuc2RrUHJvY2Vzc2luZ01ldGFkYXRhO3JldHVybiBUdChzLFtbe3R5cGU6aX0sdF1dKX1jb25zdCB6dD0iX19TRU5UUllfU1VQUFJFU1NfVFJBQ0lOR19fIjtmdW5jdGlvbiBGdCh0KXtjb25zdCBuPWh0KGwoKSk7cmV0dXJuIG4uc3VwcHJlc3NUcmFjaW5nP24uc3VwcHJlc3NUcmFjaW5nKHQpOmZ1bmN0aW9uKC4uLnQpe2NvbnN0IG49aHQobCgpKTtpZigyPT09dC5sZW5ndGgpe2NvbnN0W2Uscl09dDtyZXR1cm4gZT9uLndpdGhTZXRTY29wZShlLHIpOm4ud2l0aFNjb3BlKHIpfXJldHVybiBuLndpdGhTY29wZSh0WzBdKX0obj0+e24uc2V0U0RLUHJvY2Vzc2luZ01ldGFkYXRhKHtbenRdOiEwfSk7Y29uc3QgZT10KCk7cmV0dXJuIG4uc2V0U0RLUHJvY2Vzc2luZ01ldGFkYXRhKHtbenRdOnZvaWQgMH0pLGV9KX1mdW5jdGlvbiBHdCh0LG4pe2NvbnN0e2ZpbmdlcnByaW50OmUsc3BhbjpyLGJyZWFkY3J1bWJzOm8sc2RrUHJvY2Vzc2luZ01ldGFkYXRhOml9PW47IWZ1bmN0aW9uKHQsbil7Y29uc3R7ZXh0cmE6ZSx0YWdzOnIsdXNlcjpvLGNvbnRleHRzOmksbGV2ZWw6cyx0cmFuc2FjdGlvbk5hbWU6Y309bjtPYmplY3Qua2V5cyhlKS5sZW5ndGgmJih0LmV4dHJhPXsuLi5lLC4uLnQuZXh0cmF9KTtPYmplY3Qua2V5cyhyKS5sZW5ndGgmJih0LnRhZ3M9ey4uLnIsLi4udC50YWdzfSk7T2JqZWN0LmtleXMobykubGVuZ3RoJiYodC51c2VyPXsuLi5vLC4uLnQudXNlcn0pO09iamVjdC5rZXlzKGkpLmxlbmd0aCYmKHQuY29udGV4dHM9ey4uLmksLi4udC5jb250ZXh0c30pO3MmJih0LmxldmVsPXMpO2MmJiJ0cmFuc2FjdGlvbiIhPT10LnR5cGUmJih0LnRyYW5zYWN0aW9uPWMpfSh0LG4pLHImJmZ1bmN0aW9uKHQsbil7dC5jb250ZXh0cz17dHJhY2U6X3QobiksLi4udC5jb250ZXh0c30sdC5zZGtQcm9jZXNzaW5nTWV0YWRhdGE9e2R5bmFtaWNTYW1wbGluZ0NvbnRleHQ6T3QobiksLi4udC5zZGtQcm9jZXNzaW5nTWV0YWRhdGF9O2NvbnN0IGU9Q3Qobikscj1FdChlKS5kZXNjcmlwdGlvbjtyJiYhdC50cmFuc2FjdGlvbiYmInRyYW5zYWN0aW9uIj09PXQudHlwZSYmKHQudHJhbnNhY3Rpb249cil9KHQsciksZnVuY3Rpb24odCxuKXt0LmZpbmdlcnByaW50PXQuZmluZ2VycHJpbnQ/QXJyYXkuaXNBcnJheSh0LmZpbmdlcnByaW50KT90LmZpbmdlcnByaW50Olt0LmZpbmdlcnByaW50XTpbXSxuJiYodC5maW5nZXJwcmludD10LmZpbmdlcnByaW50LmNvbmNhdChuKSk7dC5maW5nZXJwcmludC5sZW5ndGh8fGRlbGV0ZSB0LmZpbmdlcnByaW50fSh0LGUpLGZ1bmN0aW9uKHQsbil7Y29uc3QgZT1bLi4udC5icmVhZGNydW1ic3x8W10sLi4ubl07dC5icmVhZGNydW1icz1lLmxlbmd0aD9lOnZvaWQgMH0odCxvKSxmdW5jdGlvbih0LG4pe3Quc2RrUHJvY2Vzc2luZ01ldGFkYXRhPXsuLi50LnNka1Byb2Nlc3NpbmdNZXRhZGF0YSwuLi5ufX0odCxpKX1jbGFzcyBKdHtjb25zdHJ1Y3Rvcih0KXt0aGlzLkw9MCx0aGlzLk09W10sdGhpcy5GKHQpfXRoZW4odCxuKXtyZXR1cm4gbmV3IEp0KChlLHIpPT57dGhpcy5NLnB1c2goWyExLG49PntpZih0KXRyeXtlKHQobikpfWNhdGNoKHQpe3IodCl9ZWxzZSBlKG4pfSx0PT57aWYobil0cnl7ZShuKHQpKX1jYXRjaCh0KXtyKHQpfWVsc2Ugcih0KX1dKSx0aGlzLkcoKX0pfWNhdGNoKHQpe3JldHVybiB0aGlzLnRoZW4odD0+dCx0KX1maW5hbGx5KHQpe3JldHVybiBuZXcgSnQoKG4sZSk9PntsZXQgcixvO3JldHVybiB0aGlzLnRoZW4obj0+e289ITEscj1uLHQmJnQoKX0sbj0+e289ITAscj1uLHQmJnQoKX0pLnRoZW4oKCk9PntvP2Uocik6bihyKX0pfSl9Rygpe2lmKDA9PT10aGlzLkwpcmV0dXJuO2NvbnN0IHQ9dGhpcy5NLnNsaWNlKCk7dGhpcy5NPVtdLHQuZm9yRWFjaCh0PT57dFswXXx8KDE9PT10aGlzLkwmJnRbMV0odGhpcy5KKSwyPT09dGhpcy5MJiZ0WzJdKHRoaXMuSiksdFswXT0hMCl9KX1GKHQpe2NvbnN0IG49KHQsbik9PnswPT09dGhpcy5MJiYoaihuKT9uLnRoZW4oZSxyKToodGhpcy5MPXQsdGhpcy5KPW4sdGhpcy5HKCkpKX0sZT10PT57bigxLHQpfSxyPXQ9PntuKDIsdCl9O3RyeXt0KGUscil9Y2F0Y2godCl7cih0KX19fWNvbnN0IFd0PVN5bWJvbC5mb3IoIlNlbnRyeUJ1ZmZlckZ1bGxFcnJvciIpO2Z1bmN0aW9uIFl0KHQ9MTAwKXtjb25zdCBuPW5ldyBTZXQ7ZnVuY3Rpb24gZSh0KXtuLmRlbGV0ZSh0KX1yZXR1cm57Z2V0ICQoKXtyZXR1cm4gQXJyYXkuZnJvbShuKX0sYWRkOmZ1bmN0aW9uKHIpe2lmKCEobi5zaXplPHQpKXJldHVybiBvPVd0LG5ldyBKdCgodCxuKT0+e24obyl9KTt2YXIgbztjb25zdCBpPXIoKTtyZXR1cm4gbi5hZGQoaSksaS50aGVuKCgpPT5lKGkpLCgpPT5lKGkpKSxpfSxkcmFpbjpmdW5jdGlvbih0KXtpZighbi5zaXplKXJldHVybiBlPSEwLG5ldyBKdCh0PT57dChlKX0pO3ZhciBlO2NvbnN0IHI9UHJvbWlzZS5hbGxTZXR0bGVkKEFycmF5LmZyb20obikpLnRoZW4oKCk9PiEwKTtpZighdClyZXR1cm4gcjtjb25zdCBvPVtyLG5ldyBQcm9taXNlKG49PntyZXR1cm4ib2JqZWN0Ij09dHlwZW9mKGU9c2V0VGltZW91dCgoKT0+bighMSksdCkpJiYiZnVuY3Rpb24iPT10eXBlb2YgZS51bnJlZiYmZS51bnJlZigpLGU7dmFyIGV9KV07cmV0dXJuIFByb21pc2UucmFjZShvKX19fWZ1bmN0aW9uIEh0KHQse3N0YXR1c0NvZGU6bixoZWFkZXJzOmV9LHI9UCgpKXtjb25zdCBvPXsuLi50fSxpPWU/LlsieC1zZW50cnktcmF0ZS1saW1pdHMiXSxzPWU/LlsicmV0cnktYWZ0ZXIiXTtpZihpKWZvcihjb25zdCB0IG9mIGkudHJpbSgpLnNwbGl0KCIsIikpe2NvbnN0W24sZSwsLGldPXQuc3BsaXQoIjoiLDUpLHM9cGFyc2VJbnQobiwxMCksYz0xZTMqKGlzTmFOKHMpPzYwOnMpO2lmKGUpZm9yKGNvbnN0IHQgb2YgZS5zcGxpdCgiOyIpKSJtZXRyaWNfYnVja2V0Ij09PXQmJmkmJiFpLnNwbGl0KCI7IikuaW5jbHVkZXMoImN1c3RvbSIpfHwob1t0XT1yK2MpO2Vsc2Ugby5hbGw9citjfWVsc2Ugcz9vLmFsbD1yK2Z1bmN0aW9uKHQsbj1QKCkpe2NvbnN0IGU9cGFyc2VJbnQoYCR7dH1gLDEwKTtpZighaXNOYU4oZSkpcmV0dXJuIDFlMyplO2NvbnN0IHI9RGF0ZS5wYXJzZShgJHt0fWApO3JldHVybiBpc05hTihyKT82ZTQ6ci1ufShzLHIpOjQyOT09PW4mJihvLmFsbD1yKzZlNCk7cmV0dXJuIG99ZnVuY3Rpb24gS3QodCxuLGU9WXQodC5idWZmZXJTaXplfHw2NCkpe2xldCByPXt9O3JldHVybntzZW5kOmZ1bmN0aW9uKHQpe2NvbnN0IG89W107aWYoa3QodCwodCxuKT0+e2NvbnN0IGU9QnQobik7KGZ1bmN0aW9uKHQsbixlPVAoKSl7cmV0dXJuIGZ1bmN0aW9uKHQsbil7cmV0dXJuIHRbbl18fHQuYWxsfHwwfSh0LG4pPmV9KShyLGUpfHxvLnB1c2godCl9KSwwPT09by5sZW5ndGgpcmV0dXJuIFByb21pc2UucmVzb2x2ZSh7fSk7Y29uc3QgaT1UdCh0WzBdLG8pLHM9dD0+eyFmdW5jdGlvbih0LG4pe3JldHVybiBrdCh0LCh0LGUpPT5uLmluY2x1ZGVzKGUpKX0oaSxbImNsaWVudF9yZXBvcnQiXSk/a3QoaSwodCxuKT0+e30pOmgmJncud2FybihgRHJvcHBpbmcgY2xpZW50IHJlcG9ydC4gV2lsbCBub3Qgc2VuZCBvdXRjb21lcyAocmVhc29uOiAke3R9KS5gKX07cmV0dXJuIGUuYWRkKCgpPT5uKHtib2R5OkR0KGkpfSkudGhlbih0PT40MTM9PT10LnN0YXR1c0NvZGU/KGgmJncuZXJyb3IoIlNlbnRyeSByZXNwb25kZWQgd2l0aCBzdGF0dXMgY29kZSA0MTMuIEVudmVsb3BlIHdhcyBkaXNjYXJkZWQgZHVlIHRvIGV4Y2VlZGluZyBzaXplIGxpbWl0cy4iKSxzKCJzZW5kX2Vycm9yIiksdCk6KGgmJnZvaWQgMCE9PXQuc3RhdHVzQ29kZSYmKHQuc3RhdHVzQ29kZTwyMDB8fHQuc3RhdHVzQ29kZT49MzAwKSYmdy53YXJuKGBTZW50cnkgcmVzcG9uZGVkIHdpdGggc3RhdHVzIGNvZGUgJHt0LnN0YXR1c0NvZGV9IHRvIHNlbnQgZXZlbnQuYCkscj1IdChyLHQpLHQpLHQ9Pnt0aHJvdyBzKCJuZXR3b3JrX2Vycm9yIiksaCYmdy5lcnJvcigiRW5jb3VudGVyZWQgZXJyb3IgcnVubmluZyB0cmFuc3BvcnQgcmVxdWVzdDoiLHQpLHR9KSkudGhlbih0PT50LHQ9PntpZih0PT09V3QpcmV0dXJuIGgmJncuZXJyb3IoIlNraXBwZWQgc2VuZGluZyBldmVudCBiZWNhdXNlIGJ1ZmZlciBpcyBmdWxsLiIpLHMoInF1ZXVlX292ZXJmbG93IiksUHJvbWlzZS5yZXNvbHZlKHt9KTt0aHJvdyB0fSl9LGZsdXNoOnQ9PmUuZHJhaW4odCl9fWNvbnN0IFp0PS9eKFxTKzpcXHxcLz8pKFtcc1xTXSo/KSgoPzpcLnsxLDJ9fFteL1xcXSs/fCkoXC5bXi4vXFxdKnwpKSg/OlsvXFxdKikkLztmdW5jdGlvbiBxdCh0KXtjb25zdCBuPWZ1bmN0aW9uKHQpe2NvbnN0IG49dC5sZW5ndGg+MTAyND9gPHRydW5jYXRlZD4ke3Quc2xpY2UoLTEwMjQpfWA6dCxlPVp0LmV4ZWMobik7cmV0dXJuIGU/ZS5zbGljZSgxKTpbXX0odCksZT1uWzBdfHwiIjtsZXQgcj1uWzFdO3JldHVybiBlfHxyPyhyJiYocj1yLnNsaWNlKDAsci5sZW5ndGgtMSkpLGUrcik6Ii4ifWZ1bmN0aW9uIFZ0KHQsbj0hMSl7cmV0dXJuIShufHx0JiYhdC5zdGFydHNXaXRoKCIvIikmJiF0Lm1hdGNoKC9eW0EtWl06LykmJiF0LnN0YXJ0c1dpdGgoIi4iKSYmIXQubWF0Y2goL15bYS16QS1aXShbYS16QS1aMC05LlwtK10pKjpcL1wvLykpJiZ2b2lkIDAhPT10JiYhdC5pbmNsdWRlcygibm9kZV9tb2R1bGVzLyIpfXZhciBRdDtjb25zdCBYdD1TeW1ib2woIkFnZW50QmFzZUludGVybmFsU3RhdGUiKTtjbGFzcyB0biBleHRlbmRzKFF0PWkuQWdlbnQsUXQpe2NvbnN0cnVjdG9yKHQpe3N1cGVyKHQpLHRoaXNbWHRdPXt9fWlzU2VjdXJlRW5kcG9pbnQodCl7aWYodCl7aWYoImJvb2xlYW4iPT10eXBlb2YgdC5zZWN1cmVFbmRwb2ludClyZXR1cm4gdC5zZWN1cmVFbmRwb2ludDtpZigic3RyaW5nIj09dHlwZW9mIHQucHJvdG9jb2wpcmV0dXJuImh0dHBzOiI9PT10LnByb3RvY29sfWNvbnN0e3N0YWNrOm59PW5ldyBFcnJvcjtyZXR1cm4ic3RyaW5nIj09dHlwZW9mIG4mJm4uc3BsaXQoIlxuIikuc29tZSh0PT4tMSE9PXQuaW5kZXhPZigiKGh0dHBzLmpzOiIpfHwtMSE9PXQuaW5kZXhPZigibm9kZTpodHRwczoiKSl9Y3JlYXRlU29ja2V0KHQsbixlKXtjb25zdCByPXsuLi5uLHNlY3VyZUVuZHBvaW50OnRoaXMuaXNTZWN1cmVFbmRwb2ludChuKX07UHJvbWlzZS5yZXNvbHZlKCkudGhlbigoKT0+dGhpcy5jb25uZWN0KHQscikpLnRoZW4obz0+e2lmKG8gaW5zdGFuY2VvZiBpLkFnZW50KXJldHVybiBvLmFkZFJlcXVlc3QodCxyKTt0aGlzW1h0XS5jdXJyZW50U29ja2V0PW8sc3VwZXIuY3JlYXRlU29ja2V0KHQsbixlKX0sZSl9Y3JlYXRlQ29ubmVjdGlvbigpe2NvbnN0IHQ9dGhpc1tYdF0uY3VycmVudFNvY2tldDtpZih0aGlzW1h0XS5jdXJyZW50U29ja2V0PXZvaWQgMCwhdCl0aHJvdyBuZXcgRXJyb3IoIk5vIHNvY2tldCB3YXMgcmV0dXJuZWQgaW4gdGhlIGBjb25uZWN0KClgIGZ1bmN0aW9uIik7cmV0dXJuIHR9Z2V0IGRlZmF1bHRQb3J0KCl7cmV0dXJuIHRoaXNbWHRdLmRlZmF1bHRQb3J0Pz8oImh0dHBzOiI9PT10aGlzLnByb3RvY29sPzQ0Mzo4MCl9c2V0IGRlZmF1bHRQb3J0KHQpe3RoaXNbWHRdJiYodGhpc1tYdF0uZGVmYXVsdFBvcnQ9dCl9Z2V0IHByb3RvY29sKCl7cmV0dXJuIHRoaXNbWHRdLnByb3RvY29sPz8odGhpcy5pc1NlY3VyZUVuZHBvaW50KCk/Imh0dHBzOiI6Imh0dHA6Iil9c2V0IHByb3RvY29sKHQpe3RoaXNbWHRdJiYodGhpc1tYdF0ucHJvdG9jb2w9dCl9fWZ1bmN0aW9uIG5uKC4uLnQpe3cubG9nKCJbaHR0cHMtcHJveHktYWdlbnQ6cGFyc2UtcHJveHktcmVzcG9uc2VdIiwuLi50KX1mdW5jdGlvbiBlbih0KXtyZXR1cm4gbmV3IFByb21pc2UoKG4sZSk9PntsZXQgcj0wO2NvbnN0IG89W107ZnVuY3Rpb24gaSgpe2NvbnN0IGM9dC5yZWFkKCk7Yz9mdW5jdGlvbihjKXtvLnB1c2goYykscis9Yy5sZW5ndGg7Y29uc3QgdT1CdWZmZXIuY29uY2F0KG8sciksYT11LmluZGV4T2YoIlxyXG5cclxuIik7aWYoLTE9PT1hKXJldHVybiBubigiaGF2ZSBub3QgcmVjZWl2ZWQgZW5kIG9mIEhUVFAgaGVhZGVycyB5ZXQuLi4iKSx2b2lkIGkoKTtjb25zdCBmPXUuc3ViYXJyYXkoMCxhKS50b1N0cmluZygiYXNjaWkiKS5zcGxpdCgiXHJcbiIpLGg9Zi5zaGlmdCgpO2lmKCFoKXJldHVybiB0LmRlc3Ryb3koKSxlKG5ldyBFcnJvcigiTm8gaGVhZGVyIHJlY2VpdmVkIGZyb20gcHJveHkgQ09OTkVDVCByZXNwb25zZSIpKTtjb25zdCBwPWguc3BsaXQoIiAiKSxkPSsocFsxXXx8MCksbD1wLnNsaWNlKDIpLmpvaW4oIiAiKSxnPXt9O2Zvcihjb25zdCBuIG9mIGYpe2lmKCFuKWNvbnRpbnVlO2NvbnN0IHI9bi5pbmRleE9mKCI6Iik7aWYoLTE9PT1yKXJldHVybiB0LmRlc3Ryb3koKSxlKG5ldyBFcnJvcihgSW52YWxpZCBoZWFkZXIgZnJvbSBwcm94eSBDT05ORUNUIHJlc3BvbnNlOiAiJHtufSJgKSk7Y29uc3Qgbz1uLnNsaWNlKDAscikudG9Mb3dlckNhc2UoKSxpPW4uc2xpY2UocisxKS50cmltU3RhcnQoKSxzPWdbb107InN0cmluZyI9PXR5cGVvZiBzP2dbb109W3MsaV06QXJyYXkuaXNBcnJheShzKT9zLnB1c2goaSk6Z1tvXT1pfW5uKCJnb3QgcHJveHkgc2VydmVyIHJlc3BvbnNlOiAlbyAlbyIsaCxnKSxzKCksbih7Y29ubmVjdDp7c3RhdHVzQ29kZTpkLHN0YXR1c1RleHQ6bCxoZWFkZXJzOmd9LGJ1ZmZlcmVkOnV9KX0oYyk6dC5vbmNlKCJyZWFkYWJsZSIsaSl9ZnVuY3Rpb24gcygpe3QucmVtb3ZlTGlzdGVuZXIoImVuZCIsYyksdC5yZW1vdmVMaXN0ZW5lcigiZXJyb3IiLHUpLHQucmVtb3ZlTGlzdGVuZXIoInJlYWRhYmxlIixpKX1mdW5jdGlvbiBjKCl7cygpLG5uKCJvbmVuZCIpLGUobmV3IEVycm9yKCJQcm94eSBjb25uZWN0aW9uIGVuZGVkIGJlZm9yZSByZWNlaXZpbmcgQ09OTkVDVCByZXNwb25zZSIpKX1mdW5jdGlvbiB1KHQpe3MoKSxubigib25lcnJvciAlbyIsdCksZSh0KX10Lm9uKCJlcnJvciIsdSksdC5vbigiZW5kIixjKSxpKCl9KX1mdW5jdGlvbiBybiguLi50KXt3LmxvZygiW2h0dHBzLXByb3h5LWFnZW50XSIsLi4udCl9Y2xhc3Mgb24gZXh0ZW5kcyB0bntjb25zdHJ1Y3Rvcih0LG4pe3N1cGVyKG4pLHRoaXMub3B0aW9ucz17fSx0aGlzLnByb3h5PSJzdHJpbmciPT10eXBlb2YgdD9uZXcgVVJMKHQpOnQsdGhpcy5wcm94eUhlYWRlcnM9bj8uaGVhZGVycz8/e30scm4oIkNyZWF0aW5nIG5ldyBIdHRwc1Byb3h5QWdlbnQgaW5zdGFuY2U6ICVvIix0aGlzLnByb3h5LmhyZWYpO2NvbnN0IGU9KHRoaXMucHJveHkuaG9zdG5hbWV8fHRoaXMucHJveHkuaG9zdCkucmVwbGFjZSgvXlxbfFxdJC9nLCIiKSxyPXRoaXMucHJveHkucG9ydD9wYXJzZUludCh0aGlzLnByb3h5LnBvcnQsMTApOiJodHRwczoiPT09dGhpcy5wcm94eS5wcm90b2NvbD80NDM6ODA7dGhpcy5jb25uZWN0T3B0cz17QUxQTlByb3RvY29sczpbImh0dHAvMS4xIl0sLi4ubj9jbihuLCJoZWFkZXJzIik6bnVsbCxob3N0OmUscG9ydDpyfX1hc3luYyBjb25uZWN0KHQsbil7Y29uc3R7cHJveHk6ZX09dGhpcztpZighbi5ob3N0KXRocm93IG5ldyBUeXBlRXJyb3IoJ05vICJob3N0IiBwcm92aWRlZCcpO2xldCByO2lmKCJodHRwczoiPT09ZS5wcm90b2NvbCl7cm4oIkNyZWF0aW5nIGB0bHMuU29ja2V0YDogJW8iLHRoaXMuY29ubmVjdE9wdHMpO2NvbnN0IHQ9dGhpcy5jb25uZWN0T3B0cy5zZXJ2ZXJuYW1lfHx0aGlzLmNvbm5lY3RPcHRzLmhvc3Q7cj1mLmNvbm5lY3Qoey4uLnRoaXMuY29ubmVjdE9wdHMsc2VydmVybmFtZTp0JiZhLmlzSVAodCk/dm9pZCAwOnR9KX1lbHNlIHJuKCJDcmVhdGluZyBgbmV0LlNvY2tldGA6ICVvIix0aGlzLmNvbm5lY3RPcHRzKSxyPWEuY29ubmVjdCh0aGlzLmNvbm5lY3RPcHRzKTtjb25zdCBvPSJmdW5jdGlvbiI9PXR5cGVvZiB0aGlzLnByb3h5SGVhZGVycz90aGlzLnByb3h5SGVhZGVycygpOnsuLi50aGlzLnByb3h5SGVhZGVyc30saT1hLmlzSVB2NihuLmhvc3QpP2BbJHtuLmhvc3R9XWA6bi5ob3N0O2xldCBzPWBDT05ORUNUICR7aX06JHtuLnBvcnR9IEhUVFAvMS4xXHJcbmA7aWYoZS51c2VybmFtZXx8ZS5wYXNzd29yZCl7Y29uc3QgdD1gJHtkZWNvZGVVUklDb21wb25lbnQoZS51c2VybmFtZSl9OiR7ZGVjb2RlVVJJQ29tcG9uZW50KGUucGFzc3dvcmQpfWA7b1siUHJveHktQXV0aG9yaXphdGlvbiJdPWBCYXNpYyAke0J1ZmZlci5mcm9tKHQpLnRvU3RyaW5nKCJiYXNlNjQiKX1gfW8uSG9zdD1gJHtpfToke24ucG9ydH1gLG9bIlByb3h5LUNvbm5lY3Rpb24iXXx8KG9bIlByb3h5LUNvbm5lY3Rpb24iXT10aGlzLmtlZXBBbGl2ZT8iS2VlcC1BbGl2ZSI6ImNsb3NlIik7Zm9yKGNvbnN0IHQgb2YgT2JqZWN0LmtleXMobykpcys9YCR7dH06ICR7b1t0XX1cclxuYDtjb25zdCBjPWVuKHIpO3Iud3JpdGUoYCR7c31cclxuYCk7Y29uc3R7Y29ubmVjdDp1LGJ1ZmZlcmVkOmh9PWF3YWl0IGM7aWYodC5lbWl0KCJwcm94eUNvbm5lY3QiLHUpLHRoaXMuZW1pdCgicHJveHlDb25uZWN0Iix1LHQpLDIwMD09PXUuc3RhdHVzQ29kZSl7aWYodC5vbmNlKCJzb2NrZXQiLHNuKSxuLnNlY3VyZUVuZHBvaW50KXtybigiVXBncmFkaW5nIHNvY2tldCBjb25uZWN0aW9uIHRvIFRMUyIpO2NvbnN0IHQ9bi5zZXJ2ZXJuYW1lfHxuLmhvc3Q7cmV0dXJuIGYuY29ubmVjdCh7Li4uY24obiwiaG9zdCIsInBhdGgiLCJwb3J0Iiksc29ja2V0OnIsc2VydmVybmFtZTphLmlzSVAodCk/dm9pZCAwOnR9KX1yZXR1cm4gcn1yLmRlc3Ryb3koKTtjb25zdCBwPW5ldyBhLlNvY2tldCh7d3JpdGFibGU6ITF9KTtyZXR1cm4gcC5yZWFkYWJsZT0hMCx0Lm9uY2UoInNvY2tldCIsdD0+e3JuKCJSZXBsYXlpbmcgcHJveHkgYnVmZmVyIGZvciBmYWlsZWQgcmVxdWVzdCIpLHQucHVzaChoKSx0LnB1c2gobnVsbCl9KSxwfX1mdW5jdGlvbiBzbih0KXt0LnJlc3VtZSgpfWZ1bmN0aW9uIGNuKHQsLi4ubil7Y29uc3QgZT17fTtsZXQgcjtmb3IociBpbiB0KW4uaW5jbHVkZXMocil8fChlW3JdPXRbcl0pO3JldHVybiBlfW9uLnByb3RvY29scz1bImh0dHAiLCJodHRwcyJdO2Z1bmN0aW9uIHVuKHQpe3JldHVybiB0LnJlcGxhY2UoL15bQS1aXTovLCIiKS5yZXBsYWNlKC9cXC9nLCIvIil9Y29uc3QgYW49bjtsZXQgZm4saG49MCxwbj17fTtmdW5jdGlvbiBkbih0KXthbi5kZWJ1ZyYmY29uc29sZS5sb2coYFtBTlIgV29ya2VyXSAke3R9YCl9dmFyIGxuLGduLG1uO2NvbnN0IHluPWZ1bmN0aW9uKHQpe2xldCBuO3RyeXtuPW5ldyBVUkwodC51cmwpfWNhdGNoKG4pe3JldHVybiBiKCgpPT57Y29uc29sZS53YXJuKCJbQHNlbnRyeS9ub2RlXTogSW52YWxpZCBkc24gb3IgdHVubmVsIG9wdGlvbiwgd2lsbCBub3Qgc2VuZCBhbnkgZXZlbnRzLiBUaGUgdHVubmVsIG9wdGlvbiBtdXN0IGJlIGEgZnVsbCBVUkwgd2hlbiB1c2VkLiIpfSksS3QodCwoKT0+UHJvbWlzZS5yZXNvbHZlKHt9KSl9Y29uc3QgZT0iaHR0cHM6Ij09PW4ucHJvdG9jb2wscj1mdW5jdGlvbih0LG4pe2NvbnN0e25vX3Byb3h5OmV9PXByb2Nlc3MuZW52LHI9ZT8uc3BsaXQoIiwiKS5zb21lKG49PnQuaG9zdC5lbmRzV2l0aChuKXx8dC5ob3N0bmFtZS5lbmRzV2l0aChuKSk7cmV0dXJuIHI/dm9pZCAwOm59KG4sdC5wcm94eXx8KGU/cHJvY2Vzcy5lbnYuaHR0cHNfcHJveHk6dm9pZCAwKXx8cHJvY2Vzcy5lbnYuaHR0cF9wcm94eSksbz1lP3M6aSxhPXZvaWQgMCE9PXQua2VlcEFsaXZlJiZ0LmtlZXBBbGl2ZSxmPXI/bmV3IG9uKHIpOm5ldyBvLkFnZW50KHtrZWVwQWxpdmU6YSxtYXhTb2NrZXRzOjMwLHRpbWVvdXQ6MmUzfSksaD1mdW5jdGlvbih0LG4sZSl7Y29uc3R7aG9zdG5hbWU6cixwYXRobmFtZTpvLHBvcnQ6aSxwcm90b2NvbDpzLHNlYXJjaDphfT1uZXcgVVJMKHQudXJsKTtyZXR1cm4gZnVuY3Rpb24oZil7cmV0dXJuIG5ldyBQcm9taXNlKChoLHApPT57RnQoKCk9PntsZXQgZD1mdW5jdGlvbih0KXtyZXR1cm4gbmV3IGMoe3JlYWQoKXt0aGlzLnB1c2godCksdGhpcy5wdXNoKG51bGwpfX0pfShmLmJvZHkpO2NvbnN0IGw9ey4uLnQuaGVhZGVyc307Zi5ib2R5Lmxlbmd0aD4zMjc2OCYmKGxbImNvbnRlbnQtZW5jb2RpbmciXT0iZ3ppcCIsZD1kLnBpcGUodSgpKSk7Y29uc3QgZz1yLnN0YXJ0c1dpdGgoIlsiKSxtPW4ucmVxdWVzdCh7bWV0aG9kOiJQT1NUIixhZ2VudDplLGhlYWRlcnM6bCxob3N0bmFtZTpnP3Iuc2xpY2UoMSwtMSk6cixwYXRoOmAke299JHthfWAscG9ydDppLHByb3RvY29sOnMsY2E6dC5jYUNlcnRzfSx0PT57dC5vbigiZGF0YSIsKCk9Pnt9KSx0Lm9uKCJlbmQiLCgpPT57fSksdC5zZXRFbmNvZGluZygidXRmOCIpO2NvbnN0IG49dC5oZWFkZXJzWyJyZXRyeS1hZnRlciJdPz9udWxsLGU9dC5oZWFkZXJzWyJ4LXNlbnRyeS1yYXRlLWxpbWl0cyJdPz9udWxsO2goe3N0YXR1c0NvZGU6dC5zdGF0dXNDb2RlLGhlYWRlcnM6eyJyZXRyeS1hZnRlciI6biwieC1zZW50cnktcmF0ZS1saW1pdHMiOkFycmF5LmlzQXJyYXkoZSk/ZVswXXx8bnVsbDplfX0pfSk7bS5vbigiZXJyb3IiLHApLGQucGlwZShtKX0pfSl9fSh0LHQuaHR0cE1vZHVsZT8/byxmKTtyZXR1cm4gS3QodCxoKX0oe3VybDoobG49YW4uZHNuLGduPWFuLnR1bm5lbCxtbj1hbi5zZGtNZXRhZGF0YS5zZGssZ258fGAke2Z1bmN0aW9uKHQpe3JldHVybmAke2Z1bmN0aW9uKHQpe2NvbnN0IG49dC5wcm90b2NvbD9gJHt0LnByb3RvY29sfTpgOiIiLGU9dC5wb3J0P2A6JHt0LnBvcnR9YDoiIjtyZXR1cm5gJHtufS8vJHt0Lmhvc3R9JHtlfSR7dC5wYXRoP2AvJHt0LnBhdGh9YDoiIn0vYXBpL2B9KHQpfSR7dC5wcm9qZWN0SWR9L2VudmVsb3BlL2B9KGxuKX0/JHtmdW5jdGlvbih0LG4pe2NvbnN0IGU9e3NlbnRyeV92ZXJzaW9uOiI3In07cmV0dXJuIHQucHVibGljS2V5JiYoZS5zZW50cnlfa2V5PXQucHVibGljS2V5KSxuJiYoZS5zZW50cnlfY2xpZW50PWAke24ubmFtZX0vJHtuLnZlcnNpb259YCksbmV3IFVSTFNlYXJjaFBhcmFtcyhlKS50b1N0cmluZygpfShsbixtbil9YCl9KTthc3luYyBmdW5jdGlvbiBibigpe2lmKGZuKXtkbigiU2VuZGluZyBhYm5vcm1hbCBzZXNzaW9uIiksSyhmbix7c3RhdHVzOiJhYm5vcm1hbCIsYWJub3JtYWxfbWVjaGFuaXNtOiJhbnJfZm9yZWdyb3VuZCIscmVsZWFzZTphbi5yZWxlYXNlLGVudmlyb25tZW50OmFuLmVudmlyb25tZW50fSk7Y29uc3QgdD1mdW5jdGlvbih0LG4sZSxyKXtjb25zdCBvPUx0KGUpO3JldHVybiBUdCh7c2VudF9hdDpuZXcgRGF0ZShQKCkpLnRvSVNPU3RyaW5nKCksLi4ubyYme3NkazpvfSwuLi4hIXImJm4mJntkc246YnQobil9fSxbImFnZ3JlZ2F0ZXMiaW4gdD9be3R5cGU6InNlc3Npb25zIn0sdF06W3t0eXBlOiJzZXNzaW9uIn0sdC50b0pTT04oKV1dKX0oZm4sYW4uZHNuLGFuLnNka01ldGFkYXRhLGFuLnR1bm5lbCk7ZG4oSlNPTi5zdHJpbmdpZnkodCkpLGF3YWl0IHluLnNlbmQodCk7dHJ5e2U/LnBvc3RNZXNzYWdlKCJzZXNzaW9uLWVuZGVkIil9Y2F0Y2h7fX19ZnVuY3Rpb24gdm4odCl7aWYoIXQpcmV0dXJuO2NvbnN0IG49ZnVuY3Rpb24odCl7aWYoIXQubGVuZ3RoKXJldHVybltdO2NvbnN0IG49QXJyYXkuZnJvbSh0KTtyZXR1cm4vc2VudHJ5V3JhcHBlZC8udGVzdChFKG4pLmZ1bmN0aW9ufHwiIikmJm4ucG9wKCksbi5yZXZlcnNlKCksJC50ZXN0KEUobikuZnVuY3Rpb258fCIiKSYmKG4ucG9wKCksJC50ZXN0KEUobikuZnVuY3Rpb258fCIiKSYmbi5wb3AoKSksbi5zbGljZSgwLDUwKS5tYXAodD0+KHsuLi50LGZpbGVuYW1lOnQuZmlsZW5hbWV8fEUobikuZmlsZW5hbWUsZnVuY3Rpb246dC5mdW5jdGlvbnx8Ij8ifSkpfSh0KTtpZihhbi5hcHBSb290UGF0aClmb3IoY29uc3QgdCBvZiBuKXQuZmlsZW5hbWUmJih0LmZpbGVuYW1lPU0odC5maWxlbmFtZSxhbi5hcHBSb290UGF0aCkpO3JldHVybiBufWFzeW5jIGZ1bmN0aW9uIF9uKHQsbil7aWYoaG4+PWFuLm1heEFuckV2ZW50cylyZXR1cm47aG4rPTEsYXdhaXQgYm4oKSxkbigiU2VuZGluZyBldmVudCIpO2NvbnN0IGU9e2V2ZW50X2lkOkcoKSxjb250ZXh0czphbi5jb250ZXh0cyxyZWxlYXNlOmFuLnJlbGVhc2UsZW52aXJvbm1lbnQ6YW4uZW52aXJvbm1lbnQsZGlzdDphbi5kaXN0LHBsYXRmb3JtOiJub2RlIixsZXZlbDoiZXJyb3IiLGV4Y2VwdGlvbjp7dmFsdWVzOlt7dHlwZToiQXBwbGljYXRpb25Ob3RSZXNwb25kaW5nIix2YWx1ZTpgQXBwbGljYXRpb24gTm90IFJlc3BvbmRpbmcgZm9yIGF0IGxlYXN0ICR7YW4uYW5yVGhyZXNob2xkfSBtc2Asc3RhY2t0cmFjZTp7ZnJhbWVzOnZuKHQpfSxtZWNoYW5pc206e3R5cGU6IkFOUiJ9fV19LHRhZ3M6YW4uc3RhdGljVGFnc307biYmZnVuY3Rpb24odCxuKXtpZihHdCh0LG4pLCF0LmNvbnRleHRzPy50cmFjZSl7Y29uc3R7dHJhY2VJZDplLHBhcmVudFNwYW5JZDpyLHByb3BhZ2F0aW9uU3BhbklkOm99PW4ucHJvcGFnYXRpb25Db250ZXh0O3QuY29udGV4dHM9e3RyYWNlOnt0cmFjZV9pZDplLHNwYW5faWQ6b3x8VigpLHBhcmVudF9zcGFuX2lkOnJ9LC4uLnQuY29udGV4dHN9fX0oZSxuKSxmdW5jdGlvbih0KXtpZigwPT09T2JqZWN0LmtleXMocG4pLmxlbmd0aClyZXR1cm47Y29uc3Qgbj1hbi5hcHBSb290UGF0aD97fTpwbjtpZihhbi5hcHBSb290UGF0aClmb3IoY29uc3RbdCxlXW9mIE9iamVjdC5lbnRyaWVzKHBuKSluW00odCxhbi5hcHBSb290UGF0aCldPWU7Y29uc3QgZT1uZXcgTWFwO2Zvcihjb25zdCByIG9mIHQuZXhjZXB0aW9uPy52YWx1ZXN8fFtdKWZvcihjb25zdCB0IG9mIHIuc3RhY2t0cmFjZT8uZnJhbWVzfHxbXSl7Y29uc3Qgcj10LmFic19wYXRofHx0LmZpbGVuYW1lO3ImJm5bcl0mJmUuc2V0KHIsbltyXSl9aWYoZS5zaXplPjApe2NvbnN0IG49W107Zm9yKGNvbnN0W3Qscl1vZiBlLmVudHJpZXMoKSluLnB1c2goe3R5cGU6InNvdXJjZW1hcCIsY29kZV9maWxlOnQsZGVidWdfaWQ6cn0pO3QuZGVidWdfbWV0YT17aW1hZ2VzOm59fX0oZSk7Y29uc3Qgcj1NdChlLGFuLmRzbixhbi5zZGtNZXRhZGF0YSxhbi50dW5uZWwpO2RuKEpTT04uc3RyaW5naWZ5KHIpKSxhd2FpdCB5bi5zZW5kKHIpLGF3YWl0IHluLmZsdXNoKDJlMyksaG4+PWFuLm1heEFuckV2ZW50cyYmc2V0VGltZW91dCgoKT0+e3Byb2Nlc3MuZXhpdCgwKX0sNWUzKX1sZXQgU247aWYoZG4oIlN0YXJ0ZWQiKSxhbi5jYXB0dXJlU3RhY2tUcmFjZSl7ZG4oIkNvbm5lY3RpbmcgdG8gZGVidWdnZXIiKTtjb25zdCBuPW5ldyB0O24uY29ubmVjdFRvTWFpblRocmVhZCgpLGRuKCJDb25uZWN0ZWQgdG8gZGVidWdnZXIiKTtjb25zdCBlPW5ldyBNYXA7bi5vbigiRGVidWdnZXIuc2NyaXB0UGFyc2VkIix0PT57ZS5zZXQodC5wYXJhbXMuc2NyaXB0SWQsdC5wYXJhbXMudXJsKX0pLG4ub24oIkRlYnVnZ2VyLnBhdXNlZCIsdD0+e2lmKCJvdGhlciI9PT10LnBhcmFtcy5yZWFzb24pdHJ5e2RuKCJEZWJ1Z2dlciBwYXVzZWQiKTtjb25zdCBpPVsuLi50LnBhcmFtcy5jYWxsRnJhbWVzXSxzPWFuLmFwcFJvb3RQYXRoP2Z1bmN0aW9uKHQ9KHByb2Nlc3MuYXJndlsxXT9xdChwcm9jZXNzLmFyZ3ZbMV0pOnByb2Nlc3MuY3dkKCkpLG49IlxcIj09PW8pe2NvbnN0IGU9bj91bih0KTp0O3JldHVybiB0PT57aWYoIXQpcmV0dXJuO2NvbnN0IG89bj91bih0KTp0O2xldHtkaXI6aSxiYXNlOnMsZXh0OmN9PXIucGFyc2Uobyk7Ii5qcyIhPT1jJiYiLm1qcyIhPT1jJiYiLmNqcyIhPT1jfHwocz1zLnNsaWNlKDAsLTEqYy5sZW5ndGgpKTtjb25zdCB1PWRlY29kZVVSSUNvbXBvbmVudChzKTtpfHwoaT0iLiIpO2NvbnN0IGE9aS5sYXN0SW5kZXhPZigiL25vZGVfbW9kdWxlcyIpO2lmKGE+LTEpcmV0dXJuYCR7aS5zbGljZShhKzE0KS5yZXBsYWNlKC9cLy9nLCIuIil9OiR7dX1gO2lmKGkuc3RhcnRzV2l0aChlKSl7Y29uc3QgdD1pLnNsaWNlKGUubGVuZ3RoKzEpLnJlcGxhY2UoL1wvL2csIi4iKTtyZXR1cm4gdD9gJHt0fToke3V9YDp1fXJldHVybiB1fX0oYW4uYXBwUm9vdFBhdGgpOigpPT57fSxjPWkubWFwKHQ9PmZ1bmN0aW9uKHQsbixlKXtjb25zdCByPW4/bi5yZXBsYWNlKC9eZmlsZTpcL1wvLywiIik6dm9pZCAwLG89dC5sb2NhdGlvbi5jb2x1bW5OdW1iZXI/dC5sb2NhdGlvbi5jb2x1bW5OdW1iZXIrMTp2b2lkIDAsaT10LmxvY2F0aW9uLmxpbmVOdW1iZXI/dC5sb2NhdGlvbi5saW5lTnVtYmVyKzE6dm9pZCAwO3JldHVybntmaWxlbmFtZTpyLG1vZHVsZTplKHIpLGZ1bmN0aW9uOnQuZnVuY3Rpb25OYW1lfHwiPyIsY29sbm86byxsaW5lbm86aSxpbl9hcHA6cj9WdChyKTp2b2lkIDB9fSh0LGUuZ2V0KHQubG9jYXRpb24uc2NyaXB0SWQpLHMpKSx1PXNldFRpbWVvdXQoKCk9PntfbihjKS50aGVuKG51bGwsKCk9PntkbigiU2VuZGluZyBBTlIgZXZlbnQgZmFpbGVkLiIpfSl9LDVlMyk7bi5wb3N0KCJSdW50aW1lLmV2YWx1YXRlIix7ZXhwcmVzc2lvbjoiZ2xvYmFsLl9fU0VOVFJZX0dFVF9TQ09QRVNfXygpOyIsc2lsZW50OiEwLHJldHVybkJ5VmFsdWU6ITB9LCh0LGUpPT57dCYmZG4oYEVycm9yIGV4ZWN1dGluZyBzY3JpcHQ6ICcke3QubWVzc2FnZX0nYCksY2xlYXJUaW1lb3V0KHUpO2NvbnN0IHI9ZT8ucmVzdWx0P2UucmVzdWx0LnZhbHVlOnZvaWQgMDtuLnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpLG4ucG9zdCgiRGVidWdnZXIuZGlzYWJsZSIpLF9uKGMscikudGhlbihudWxsLCgpPT57ZG4oIlNlbmRpbmcgQU5SIGV2ZW50IGZhaWxlZC4iKX0pfSl9Y2F0Y2godCl7dGhyb3cgbi5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKSxuLnBvc3QoIkRlYnVnZ2VyLmRpc2FibGUiKSx0fX0pLFNuPSgpPT57dHJ5e24ucG9zdCgiRGVidWdnZXIuZW5hYmxlIiwoKT0+e24ucG9zdCgiRGVidWdnZXIucGF1c2UiKX0pfWNhdGNoe319fWNvbnN0e3BvbGw6d259PWZ1bmN0aW9uKHQsbixlLHIpe2NvbnN0IG89dCgpO2xldCBpPSExLHM9ITA7cmV0dXJuIHNldEludGVydmFsKCgpPT57Y29uc3QgdD1vLmdldFRpbWVNcygpOyExPT09aSYmdD5uK2UmJihpPSEwLHMmJnIoKSksdDxuK2UmJihpPSExKX0sMjApLHtwb2xsOigpPT57by5yZXNldCgpfSxlbmFibGVkOnQ9PntzPXR9fX0oZnVuY3Rpb24oKXtsZXQgdD1wcm9jZXNzLmhydGltZSgpO3JldHVybntnZXRUaW1lTXM6KCk9Pntjb25zdFtuLGVdPXByb2Nlc3MuaHJ0aW1lKHQpO3JldHVybiBNYXRoLmZsb29yKDFlMypuK2UvMWU2KX0scmVzZXQ6KCk9Pnt0PXByb2Nlc3MuaHJ0aW1lKCl9fX0sYW4ucG9sbEludGVydmFsLGFuLmFuclRocmVzaG9sZCxmdW5jdGlvbigpe2RuKCJXYXRjaGRvZyB0aW1lb3V0IiksU24/KGRuKCJQYXVzaW5nIGRlYnVnZ2VyIHRvIGNhcHR1cmUgc3RhY2sgdHJhY2UiKSxTbigpKTooZG4oIkNhcHR1cmluZyBldmVudCB3aXRob3V0IGEgc3RhY2sgdHJhY2UiKSxfbigpLnRoZW4obnVsbCwoKT0+e2RuKCJTZW5kaW5nIEFOUiBldmVudCBmYWlsZWQgb24gd2F0Y2hkb2cgdGltZW91dC4iKX0pKX0pO2U/Lm9uKCJtZXNzYWdlIix0PT57dC5zZXNzaW9uJiYoZm49SCh0LnNlc3Npb24pKSx0LmRlYnVnSW1hZ2VzJiYocG49dC5kZWJ1Z0ltYWdlcyksd24oKX0pOw=="; const DEFAULT_INTERVAL = 50; -const DEFAULT_HANG_THRESHOLD = 5000; - +const DEFAULT_HANG_THRESHOLD = 5e3; function log(message, ...args) { - core.logger.log(`[ANR] ${message}`, ...args); + core.debug.log(`[ANR] ${message}`, ...args); } - function globalWithScopeFetchFn() { return core.GLOBAL_OBJ; } - -/** Fetches merged scope data */ function getScopeData() { - const scope = core.getGlobalScope().getScopeData(); - core.mergeScopeData(scope, core.getIsolationScope().getScopeData()); - core.mergeScopeData(scope, core.getCurrentScope().getScopeData()); - - // We remove attachments because they likely won't serialize well as json + const scope = core.getCombinedScopeData(core.getIsolationScope(), core.getCurrentScope()); scope.attachments = []; - // We can't serialize event processor functions scope.eventProcessors = []; - return scope; } - -/** - * Gets contexts by calling all event processors. This shouldn't be called until all integrations are setup - */ async function getContexts(client) { - let event = { message: 'ANR' }; + let event = { message: "ANR" }; const eventHint = {}; - for (const processor of client.getEventProcessors()) { if (event === null) break; event = await processor(event, eventHint); } - - return _optionalChain([event, 'optionalAccess', _2 => _2.contexts]) || {}; + return event?.contexts || {}; } - -const INTEGRATION_NAME = 'Anr'; - +const INTEGRATION_NAME = "Anr"; const _anrIntegration = ((options = {}) => { - if (nodeVersion.NODE_VERSION.major < 16 || (nodeVersion.NODE_VERSION.major === 16 && nodeVersion.NODE_VERSION.minor < 17)) { - throw new Error('ANR detection requires Node 16.17.0 or later'); + if (nodeVersion.NODE_VERSION.major < 16 || nodeVersion.NODE_VERSION.major === 16 && nodeVersion.NODE_VERSION.minor < 17) { + throw new Error("ANR detection requires Node 16.17.0 or later"); } - let worker; let client; - - // Hookup the scope fetch function to the global object so that it can be called from the worker thread via the - // debugger when it pauses const gbl = globalWithScopeFetchFn(); gbl.__SENTRY_GET_SCOPES__ = getScopeData; - return { name: INTEGRATION_NAME, startWorker: () => { if (worker) { return; } - if (client) { worker = _startWorker(client, options); } }, stopWorker: () => { if (worker) { - // eslint-disable-next-line @typescript-eslint/no-floating-promises - worker.then(stop => { + worker.then((stop) => { stop(); - worker = undefined; + worker = void 0; }); } }, async setup(initClient) { client = initClient; - - if (options.captureStackTrace && (await debug.isDebuggerEnabled())) { - core.logger.warn('ANR captureStackTrace has been disabled because the debugger was already enabled'); + if (options.captureStackTrace && await debug.isDebuggerEnabled()) { + core.debug.warn("ANR captureStackTrace has been disabled because the debugger was already enabled"); options.captureStackTrace = false; } - - // setImmediate is used to ensure that all other integrations have had their setup called first. - // This allows us to call into all integrations to fetch the full context setImmediate(() => this.startWorker()); - }, - } ; -}) ; - -const anrIntegration = core.defineIntegration(_anrIntegration) ; - -/** - * Starts the ANR worker thread - * - * @returns A function to stop the worker - */ -async function _startWorker( - client, - integrationOptions, -) { + } + }; +}); +const anrIntegration = core.defineIntegration(_anrIntegration); +async function _startWorker(client, integrationOptions) { const dsn = client.getDsn(); - if (!dsn) { return () => { - // }; } - const contexts = await getContexts(client); - - // These will not be accurate if sent later from the worker thread - _optionalChainDelete([contexts, 'access', _3 => _3.app, 'optionalAccess', _4 => delete _4.app_memory]); - _optionalChainDelete([contexts, 'access', _5 => _5.device, 'optionalAccess', _6 => delete _6.free_memory]); - + delete contexts.app?.app_memory; + delete contexts.device?.free_memory; const initOptions = client.getOptions(); - const sdkMetadata = client.getSdkMetadata() || {}; if (sdkMetadata.sdk) { - sdkMetadata.sdk.integrations = initOptions.integrations.map(i => i.name); + sdkMetadata.sdk.integrations = initOptions.integrations.map((i) => i.name); } - const options = { - debug: core.logger.isEnabled(), + debug: core.debug.isEnabled(), dsn, tunnel: initOptions.tunnel, - environment: initOptions.environment || 'production', + environment: initOptions.environment || "production", release: initOptions.release, dist: initOptions.dist, sdkMetadata, @@ -83185,87 +41920,62 @@ async function _startWorker( captureStackTrace: !!integrationOptions.captureStackTrace, maxAnrEvents: integrationOptions.maxAnrEvents || 1, staticTags: integrationOptions.staticTags || {}, - contexts, + contexts }; - if (options.captureStackTrace) { const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); if (!inspector.url()) { inspector.open(0); } } - const worker = new node_worker_threads.Worker(new URL(`data:application/javascript;base64,${base64WorkerScript}`), { workerData: options, // We don't want any Node args to be passed to the worker execArgv: [], - env: { ...process.env, NODE_OPTIONS: undefined }, + env: { ...process.env, NODE_OPTIONS: void 0 } }); - - process.on('exit', () => { - // eslint-disable-next-line @typescript-eslint/no-floating-promises + process.on("exit", () => { worker.terminate(); }); - const timer = setInterval(() => { try { - const currentSession = core.getCurrentScope().getSession(); - // We need to copy the session object and remove the toJSON method so it can be sent to the worker - // serialized without making it a SerializedSession - const session = currentSession ? { ...currentSession, toJSON: undefined } : undefined; - // message the worker to tell it the main event loop is still running + const currentSession = core.getIsolationScope().getSession(); + const session = currentSession ? { ...currentSession, toJSON: void 0 } : void 0; worker.postMessage({ session, debugImages: core.getFilenameToDebugIdMap(initOptions.stackParser) }); - } catch (_) { - // + } catch { } }, options.pollInterval); - // Timer should not block exit timer.unref(); - - worker.on('message', (msg) => { - if (msg === 'session-ended') { - log('ANR event sent from ANR worker. Clearing session in this thread.'); - core.getCurrentScope().setSession(undefined); + worker.on("message", (msg) => { + if (msg === "session-ended") { + log("ANR event sent from ANR worker. Clearing session in this thread."); + core.getIsolationScope().setSession(void 0); } }); - - worker.once('error', (err) => { + worker.once("error", (err) => { clearInterval(timer); - log('ANR worker error', err); + log("ANR worker error", err); }); - - worker.once('exit', (code) => { + worker.once("exit", (code) => { clearInterval(timer); - log('ANR worker exit', code); + log("ANR worker exit", code); }); - - // Ensure this thread can't block app exit worker.unref(); - return () => { - // eslint-disable-next-line @typescript-eslint/no-floating-promises worker.terminate(); clearInterval(timer); }; } - -/** - * Disables ANR detection for the duration of the callback - */ function disableAnrDetectionForCallback(callback) { - const integration = _optionalChain([core.getClient, 'call', _7 => _7(), 'optionalAccess', _8 => _8.getIntegrationByName, 'call', _9 => _9(INTEGRATION_NAME)]) ; - + const integration = core.getClient()?.getIntegrationByName(INTEGRATION_NAME); if (!integration) { return callback(); } - integration.stopWorker(); - const result = callback(); if (isPromise(result)) { return result.finally(() => integration.startWorker()); } - integration.startWorker(); return result; } @@ -83278,155 +41988,189 @@ exports.disableAnrDetectionForCallback = disableAnrDetectionForCallback; /***/ }), -/***/ 13557: +/***/ 57342: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const diagnosticsChannel = __nccwpck_require__(65714); const core = __nccwpck_require__(84466); -// TODO(v9): Update this name and mention in migration docs. -const INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs'; - -/** - * Capture breadcrumbs for child processes and worker threads. - */ +const INTEGRATION_NAME = "ChildProcess"; const childProcessIntegration = core.defineIntegration((options = {}) => { return { name: INTEGRATION_NAME, - setup(_client) { - // eslint-disable-next-line deprecation/deprecation - diagnosticsChannel.channel('child_process').subscribe((event) => { - if (event && typeof event === 'object' && 'process' in event) { - captureChildProcessEvents(event.process , options); + setup() { + diagnosticsChannel.channel("child_process").subscribe((event) => { + if (core.isObjectLike(event) && "process" in event) { + captureChildProcessEvents(event.process, options); } }); - - // eslint-disable-next-line deprecation/deprecation - diagnosticsChannel.channel('worker_threads').subscribe((event) => { - if (event && typeof event === 'object' && 'worker' in event) { - captureWorkerThreadEvents(event.worker ); + diagnosticsChannel.channel("worker_threads").subscribe((event) => { + if (core.isObjectLike(event) && "worker" in event) { + captureWorkerThreadEvents(event.worker, options); } }); - }, + } }; }); - -/** - * Capture breadcrumbs for child processes and worker threads. - * - * @deprecated Use `childProcessIntegration` integration instead. Functionally they are the same. `processThreadBreadcrumbIntegration` will be removed in the next major version. - */ -const processThreadBreadcrumbIntegration = childProcessIntegration; - function captureChildProcessEvents(child, options) { let hasExited = false; let data; - - child - .on('spawn', () => { - // This is Sentry getting macOS OS context - if (child.spawnfile === '/usr/bin/sw_vers') { - hasExited = true; - return; - } - - data = { spawnfile: child.spawnfile }; - if (options.includeChildProcessArgs) { - data.spawnargs = child.spawnargs; - } - }) - .on('exit', code => { - if (!hasExited) { - hasExited = true; - - // Only log for non-zero exit codes - if (code !== null && code !== 0) { - core.addBreadcrumb({ - category: 'child_process', - message: `Child process exited with code '${code}'`, - level: 'warning', - data, - }); - } - } - }) - .on('error', error => { - if (!hasExited) { - hasExited = true; - + child.on("spawn", () => { + if (child.spawnfile === "/usr/bin/sw_vers") { + hasExited = true; + return; + } + data = { spawnfile: child.spawnfile }; + if (options.includeChildProcessArgs) { + data.spawnargs = child.spawnargs; + } + }).on("exit", (code) => { + if (!hasExited) { + hasExited = true; + if (code !== null && code !== 0) { core.addBreadcrumb({ - category: 'child_process', - message: `Child process errored with '${error.message}'`, - level: 'error', - data, + category: "child_process", + message: `Child process exited with code '${code}'`, + level: code === 0 ? "info" : "warning", + data }); } - }); -} - -function captureWorkerThreadEvents(worker) { - let threadId; - - worker - .on('online', () => { - threadId = worker.threadId; - }) - .on('error', error => { + } + }).on("error", (error) => { + if (!hasExited) { + hasExited = true; core.addBreadcrumb({ - category: 'worker_thread', - message: `Worker thread errored with '${error.message}'`, - level: 'error', - data: { threadId }, + category: "child_process", + message: `Child process errored with '${error.message}'`, + level: "error", + data }); - }); + } + }); +} +function captureWorkerThreadEvents(worker, options) { + let threadId; + worker.on("online", () => { + threadId = worker.threadId; + }).on("error", (error) => { + if (options.captureWorkerErrors !== false) { + core.captureException(error, { + mechanism: { type: "auto.child_process.worker_thread", handled: false, data: { threadId: String(threadId) } } + }); + } else { + core.addBreadcrumb({ + category: "worker_thread", + message: `Worker thread errored with '${error.message}'`, + level: "error", + data: { threadId } + }); + } + }); } exports.childProcessIntegration = childProcessIntegration; -exports.processThreadBreadcrumbIntegration = processThreadBreadcrumbIntegration; //# sourceMappingURL=childProcess.js.map /***/ }), -/***/ 61139: +/***/ 48597: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const util = __nccwpck_require__(47261); const core = __nccwpck_require__(84466); -const INTEGRATION_NAME = 'Console'; - -/** - * Capture console logs as breadcrumbs. - */ -const consoleIntegration = core.defineIntegration(() => { +const consoleIntegration = core.defineIntegration((options = {}) => { return { - name: INTEGRATION_NAME, + name: "Console", setup(client) { - core.addConsoleInstrumentationHandler(({ args, level }) => { - if (core.getClient() !== client) { - return; - } - - core.addBreadcrumb( - { - category: 'console', - level: core.severityLevelFromString(level), - message: core.truncate(util.format.apply(undefined, args), 2048), // 2KB - }, - { - input: [...args], - level, - }, - ); + if (process.env.LAMBDA_TASK_ROOT) { + core.maybeInstrument("console", instrumentConsoleLambda); + } + const core$1 = core.consoleIntegration({ + ...options, + filter: [ + ...options.filter || [], + // Deprecation on Node 26 for module.require(), which is used by IITM + "[DEP0205] DeprecationWarning" + ] }); - }, + core$1.setup?.(client); + } }; }); +function instrumentConsoleLambda() { + const consoleObj = core.GLOBAL_OBJ?.console; + if (!consoleObj) { + return; + } + core.CONSOLE_LEVELS.forEach((level) => { + if (level in consoleObj) { + patchWithDefineProperty(consoleObj, level); + } + }); +} +function patchWithDefineProperty(consoleObj, level) { + const nativeMethod = consoleObj[level]; + core.originalConsoleMethods[level] = nativeMethod; + let delegate = nativeMethod; + let savedDelegate; + let isExecuting = false; + const wrapper = function(...args) { + if (isExecuting) { + nativeMethod.apply(consoleObj, args); + return; + } + isExecuting = true; + try { + core.triggerHandlers("console", { args, level }); + delegate.apply(consoleObj, args); + } finally { + isExecuting = false; + } + }; + core.markFunctionWrapped(wrapper, nativeMethod); + const sandboxBypass = nativeMethod.bind(consoleObj); + core.originalConsoleMethods[level] = sandboxBypass; + try { + let current = wrapper; + Object.defineProperty(consoleObj, level, { + configurable: true, + enumerable: true, + get() { + return current; + }, + set(newValue) { + if (newValue === wrapper) { + if (savedDelegate !== void 0) { + delegate = savedDelegate; + savedDelegate = void 0; + } + current = wrapper; + } else if (newValue === sandboxBypass) { + savedDelegate = delegate; + current = sandboxBypass; + } else if (typeof newValue === "function" && !newValue.__sentry_original__) { + delegate = newValue; + current = wrapper; + } else { + current = newValue; + } + } + }); + } catch { + core.fill(consoleObj, level, function(originalConsoleMethod) { + core.originalConsoleMethods[level] = originalConsoleMethod; + return function(...args) { + core.triggerHandlers("console", { args, level }); + core.originalConsoleMethods[level]?.apply(this, args); + }; + }); + } +} exports.consoleIntegration = consoleIntegration; //# sourceMappingURL=console.js.map @@ -83434,14 +42178,10 @@ exports.consoleIntegration = consoleIntegration; /***/ }), -/***/ 15834: +/***/ 33141: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_child_process = __nccwpck_require__(17718); const node_fs = __nccwpck_require__(87561); @@ -83450,304 +42190,286 @@ const node_path = __nccwpck_require__(49411); const util = __nccwpck_require__(47261); const core = __nccwpck_require__(84466); -/* eslint-disable max-lines */ - const readFileAsync = util.promisify(node_fs.readFile); const readDirAsync = util.promisify(node_fs.readdir); - -// Process enhanced with methods from Node 18, 20, 22 as @types/node -// is on `14.18.0` to match minimum version requirements of the SDK - -const INTEGRATION_NAME = 'Context'; - +const INTEGRATION_NAME = "Context"; const _nodeContextIntegration = ((options = {}) => { - let cachedContext; - const _options = { app: true, os: true, device: true, culture: true, cloudResource: true, - ...options, + ...options }; - - /** Add contexts to the event. Caches the context so we only look it up once. */ - async function addContext(event) { - if (cachedContext === undefined) { - cachedContext = _getContexts(); + const appContext = _options.app ? getAppContext() : void 0; + const deviceContext = _options.device ? getDeviceContext(_options.device) : void 0; + const cultureContext = _options.culture ? getCultureContext() : void 0; + const cloudResourceContext = _options.cloudResource ? getCloudResourceContext() : void 0; + const osContextPromise = _options.os ? getOsContext() : void 0; + const cachedSpanAttributes = { + "process.runtime.engine.name": "v8", + "process.runtime.engine.version": process.versions.v8, + ...contextsToSpanAttributes({ + app: appContext, + device: deviceContext, + culture: cultureContext, + cloud_resource: cloudResourceContext + }) + }; + if (osContextPromise) { + osContextPromise.then((osCtx) => Object.assign(cachedSpanAttributes, contextsToSpanAttributes({ os: osCtx }))).catch(() => { + }); + } + const contextsPromise = (async () => { + const contexts = {}; + if (osContextPromise) { + contexts.os = await osContextPromise; } - - const updatedContext = _updateContext(await cachedContext); - + if (appContext) { + contexts.app = appContext; + } + if (deviceContext) { + contexts.device = deviceContext; + } + if (cultureContext) { + contexts.culture = cultureContext; + } + if (cloudResourceContext) { + contexts.cloud_resource = cloudResourceContext; + } + return contexts; + })(); + async function addContext(event) { + const updatedContext = _updateContext(await contextsPromise); event.contexts = { ...event.contexts, - app: { ...updatedContext.app, ..._optionalChain([event, 'access', _ => _.contexts, 'optionalAccess', _2 => _2.app]) }, - os: { ...updatedContext.os, ..._optionalChain([event, 'access', _3 => _3.contexts, 'optionalAccess', _4 => _4.os]) }, - device: { ...updatedContext.device, ..._optionalChain([event, 'access', _5 => _5.contexts, 'optionalAccess', _6 => _6.device]) }, - culture: { ...updatedContext.culture, ..._optionalChain([event, 'access', _7 => _7.contexts, 'optionalAccess', _8 => _8.culture]) }, - cloud_resource: { ...updatedContext.cloud_resource, ..._optionalChain([event, 'access', _9 => _9.contexts, 'optionalAccess', _10 => _10.cloud_resource]) }, + app: { ...updatedContext.app, ...event.contexts?.app }, + os: { ...updatedContext.os, ...event.contexts?.os }, + device: { ...updatedContext.device, ...event.contexts?.device }, + culture: { ...updatedContext.culture, ...event.contexts?.culture }, + cloud_resource: { ...updatedContext.cloud_resource, ...event.contexts?.cloud_resource } }; - return event; } - - /** Get the contexts from node. */ - async function _getContexts() { - const contexts = {}; - - if (_options.os) { - contexts.os = await getOsContext(); - } - - if (_options.app) { - contexts.app = getAppContext(); - } - - if (_options.device) { - contexts.device = getDeviceContext(_options.device); - } - - if (_options.culture) { - const culture = getCultureContext(); - - if (culture) { - contexts.culture = culture; - } - } - - if (_options.cloudResource) { - contexts.cloud_resource = getCloudResourceContext(); - } - - return contexts; - } - return { name: INTEGRATION_NAME, processEvent(event) { return addContext(event); }, + processSegmentSpan(span) { + core.safeSetSpanJSONAttributes(span, cachedSpanAttributes); + core.safeSetSpanJSONAttributes(span, getDynamicSpanAttributes(appContext, deviceContext)); + } }; -}) ; - -/** - * Capture context about the environment and the device that the client is running on, to events. - */ +}); const nodeContextIntegration = core.defineIntegration(_nodeContextIntegration); - -/** - * Updates the context with dynamic values that can change - */ function _updateContext(contexts) { - // Only update properties if they exist - - if (_optionalChain([contexts, 'optionalAccess', _11 => _11.app, 'optionalAccess', _12 => _12.app_memory])) { + if (contexts.app?.app_memory) { contexts.app.app_memory = process.memoryUsage().rss; } - - if (_optionalChain([contexts, 'optionalAccess', _13 => _13.app, 'optionalAccess', _14 => _14.free_memory]) && typeof (process ).availableMemory === 'function') { - const freeMemory = _optionalChain([(process ), 'access', _15 => _15.availableMemory, 'optionalCall', _16 => _16()]); + if (contexts.app?.free_memory && typeof process.availableMemory === "function") { + const freeMemory = process.availableMemory?.(); if (freeMemory != null) { contexts.app.free_memory = freeMemory; } } - - if (_optionalChain([contexts, 'optionalAccess', _17 => _17.device, 'optionalAccess', _18 => _18.free_memory])) { + if (contexts.device?.free_memory) { contexts.device.free_memory = os.freemem(); } - return contexts; } - -/** - * Returns the operating system context. - * - * Based on the current platform, this uses a different strategy to provide the - * most accurate OS information. Since this might involve spawning subprocesses - * or accessing the file system, this should only be executed lazily and cached. - * - * - On macOS (Darwin), this will execute the `sw_vers` utility. The context - * has a `name`, `version`, `build` and `kernel_version` set. - * - On Linux, this will try to load a distribution release from `/etc` and set - * the `name`, `version` and `kernel_version` fields. - * - On all other platforms, only a `name` and `version` will be returned. Note - * that `version` might actually be the kernel version. - */ +function contextsToSpanAttributes(contexts) { + const attrs = {}; + const { app, device, os: osCtx, culture, cloud_resource } = contexts; + if (app) { + if (app.app_start_time) { + attrs["app.start_time"] = app.app_start_time; + } + } + if (device) { + if (device.arch) { + attrs["device.archs"] = [device.arch]; + } + if (device.boot_time) { + attrs["device.boot_time"] = device.boot_time; + } + if (device.memory_size != null) { + attrs["device.memory_size"] = device.memory_size; + } + if (device.processor_count != null) { + attrs["device.processor_count"] = device.processor_count; + } + if (device.cpu_description) { + attrs["device.cpu_description"] = device.cpu_description; + } + if (device.processor_frequency != null) { + attrs["device.processor_frequency"] = device.processor_frequency; + } + } + if (osCtx) { + if (osCtx.name) { + attrs["os.name"] = osCtx.name; + } + if (osCtx.version) { + attrs["os.version"] = osCtx.version; + } + if (osCtx.kernel_version) { + attrs["os.kernel_version"] = osCtx.kernel_version; + } + if (osCtx.build) { + attrs["os.build"] = osCtx.build; + } + } + if (culture) { + if (culture.locale) { + attrs["culture.locale"] = culture.locale; + } + if (culture.timezone) { + attrs["culture.timezone"] = culture.timezone; + } + } + if (cloud_resource) { + for (const [key, value] of Object.entries(cloud_resource)) { + if (value != null) { + attrs[key] = value; + } + } + } + return attrs; +} +function getDynamicSpanAttributes(appContext, deviceContext) { + const attrs = {}; + if (appContext) { + attrs["app.memory"] = process.memoryUsage().rss; + if (typeof process.availableMemory === "function") { + const freeMemory = process.availableMemory?.(); + if (freeMemory != null) { + attrs["app.free_memory"] = freeMemory; + } + } + } + if (deviceContext?.free_memory != null) { + attrs["device.free_memory"] = os.freemem(); + } + return attrs; +} async function getOsContext() { const platformId = os.platform(); switch (platformId) { - case 'darwin': + case "darwin": return getDarwinInfo(); - case 'linux': + case "linux": return getLinuxInfo(); default: return { name: PLATFORM_NAMES[platformId] || platformId, - version: os.release(), + version: os.release() }; } } - function getCultureContext() { try { - if (typeof process.versions.icu !== 'string') { - // Node was built without ICU support + if (typeof process.versions.icu !== "string") { return; } - - // Check that node was built with full Intl support. Its possible it was built without support for non-English - // locales which will make resolvedOptions inaccurate - // - // https://nodejs.org/api/intl.html#detecting-internationalization-support - const january = new Date(9e8); - const spanish = new Intl.DateTimeFormat('es', { month: 'long' }); - if (spanish.format(january) === 'enero') { + const january = /* @__PURE__ */ new Date(9e8); + const spanish = new Intl.DateTimeFormat("es", { month: "long" }); + if (spanish.format(january) === "enero") { const options = Intl.DateTimeFormat().resolvedOptions(); - return { locale: options.locale, - timezone: options.timeZone, + timezone: options.timeZone }; } - } catch (err) { - // + } catch { } - return; } - -/** - * Get app context information from process - */ function getAppContext() { const app_memory = process.memoryUsage().rss; - const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString(); - // https://nodejs.org/api/process.html#processavailablememory + const app_start_time = new Date(Date.now() - process.uptime() * 1e3).toISOString(); const appContext = { app_start_time, app_memory }; - - if (typeof (process ).availableMemory === 'function') { - const freeMemory = _optionalChain([(process ), 'access', _19 => _19.availableMemory, 'optionalCall', _20 => _20()]); + if (typeof process.availableMemory === "function") { + const freeMemory = process.availableMemory?.(); if (freeMemory != null) { appContext.free_memory = freeMemory; } } - return appContext; } - -/** - * Gets device information from os - */ function getDeviceContext(deviceOpt) { const device = {}; - - // Sometimes os.uptime() throws due to lacking permissions: https://github.com/getsentry/sentry-javascript/issues/8202 let uptime; try { - uptime = os.uptime && os.uptime(); - } catch (e) { - // noop + uptime = os.uptime(); + } catch { } - - // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions). - // Hence, we only set boot time, if we get a valid uptime value. - // @see https://github.com/getsentry/sentry-javascript/issues/5856 - if (typeof uptime === 'number') { - device.boot_time = new Date(Date.now() - uptime * 1000).toISOString(); + if (typeof uptime === "number") { + device.boot_time = new Date(Date.now() - uptime * 1e3).toISOString(); } - device.arch = os.arch(); - if (deviceOpt === true || deviceOpt.memory) { device.memory_size = os.totalmem(); device.free_memory = os.freemem(); } - if (deviceOpt === true || deviceOpt.cpu) { const cpuInfo = os.cpus(); - const firstCpu = cpuInfo && cpuInfo[0]; + const firstCpu = cpuInfo?.[0]; if (firstCpu) { device.processor_count = cpuInfo.length; device.cpu_description = firstCpu.model; device.processor_frequency = firstCpu.speed; } } - return device; } - -/** Mapping of Node's platform names to actual OS names. */ const PLATFORM_NAMES = { - aix: 'IBM AIX', - freebsd: 'FreeBSD', - openbsd: 'OpenBSD', - sunos: 'SunOS', - win32: 'Windows', + aix: "IBM AIX", + freebsd: "FreeBSD", + openbsd: "OpenBSD", + sunos: "SunOS", + win32: "Windows", + ohos: "OpenHarmony", + android: "Android" }; - -/** Linux version file to check for a distribution. */ - -/** Mapping of linux release files located in /etc to distributions. */ const LINUX_DISTROS = [ - { name: 'fedora-release', distros: ['Fedora'] }, - { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] }, - { name: 'redhat_version', distros: ['Red Hat Linux'] }, - { name: 'SuSE-release', distros: ['SUSE Linux'] }, - { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] }, - { name: 'debian_version', distros: ['Debian'] }, - { name: 'debian_release', distros: ['Debian'] }, - { name: 'arch-release', distros: ['Arch Linux'] }, - { name: 'gentoo-release', distros: ['Gentoo Linux'] }, - { name: 'novell-release', distros: ['SUSE Linux'] }, - { name: 'alpine-release', distros: ['Alpine Linux'] }, + { name: "fedora-release", distros: ["Fedora"] }, + { name: "redhat-release", distros: ["Red Hat Linux", "Centos"] }, + { name: "redhat_version", distros: ["Red Hat Linux"] }, + { name: "SuSE-release", distros: ["SUSE Linux"] }, + { name: "lsb-release", distros: ["Ubuntu Linux", "Arch Linux"] }, + { name: "debian_version", distros: ["Debian"] }, + { name: "debian_release", distros: ["Debian"] }, + { name: "arch-release", distros: ["Arch Linux"] }, + { name: "gentoo-release", distros: ["Gentoo Linux"] }, + { name: "novell-release", distros: ["SUSE Linux"] }, + { name: "alpine-release", distros: ["Alpine Linux"] } ]; - -/** Functions to extract the OS version from Linux release files. */ -const LINUX_VERSIONS - - = { - alpine: content => content, - arch: content => matchFirst(/distrib_release=(.*)/, content), - centos: content => matchFirst(/release ([^ ]+)/, content), - debian: content => content, - fedora: content => matchFirst(/release (..)/, content), - mint: content => matchFirst(/distrib_release=(.*)/, content), - red: content => matchFirst(/release ([^ ]+)/, content), - suse: content => matchFirst(/VERSION = (.*)\n/, content), - ubuntu: content => matchFirst(/distrib_release=(.*)/, content), +const LINUX_VERSIONS = { + alpine: (content) => content, + arch: (content) => matchFirst(/distrib_release=(.*)/, content), + centos: (content) => matchFirst(/release ([^ ]+)/, content), + debian: (content) => content, + fedora: (content) => matchFirst(/release (..)/, content), + mint: (content) => matchFirst(/distrib_release=(.*)/, content), + red: (content) => matchFirst(/release ([^ ]+)/, content), + suse: (content) => matchFirst(/VERSION = (.*)\n/, content), + ubuntu: (content) => matchFirst(/distrib_release=(.*)/, content) }; - -/** - * Executes a regular expression with one capture group. - * - * @param regex A regular expression to execute. - * @param text Content to execute the RegEx on. - * @returns The captured string if matched; otherwise undefined. - */ function matchFirst(regex, text) { const match = regex.exec(text); - return match ? match[1] : undefined; + return match ? match[1] : void 0; } - -/** Loads the macOS operating system context. */ async function getDarwinInfo() { - // Default values that will be used in case no operating system information - // can be loaded. The default version is computed via heuristics from the - // kernel version, but the build ID is missing. const darwinInfo = { kernel_version: os.release(), - name: 'Mac OS X', - version: `10.${Number(os.release().split('.')[0]) - 4}`, + name: "Mac OS X", + version: `10.${Number(os.release().split(".")[0]) - 4}` }; - try { - // We try to load the actual macOS version by executing the `sw_vers` tool. - // This tool should be available on every standard macOS installation. In - // case this fails, we stick with the values computed above. - const output = await new Promise((resolve, reject) => { - node_child_process.execFile('/usr/bin/sw_vers', (error, stdout) => { + node_child_process.execFile("/usr/bin/sw_vers", (error, stdout) => { if (error) { reject(error); return; @@ -83755,143 +42477,97 @@ async function getDarwinInfo() { resolve(stdout); }); }); - darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output); darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output); darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output); - } catch (e) { - // ignore + } catch { } - return darwinInfo; } - -/** Returns a distribution identifier to look up version callbacks. */ function getLinuxDistroId(name) { - return (name.split(' ') )[0].toLowerCase(); + return name.split(" ")[0].toLowerCase(); } - -/** Loads the Linux operating system context. */ async function getLinuxInfo() { - // By default, we cannot assume anything about the distribution or Linux - // version. `os.release()` returns the kernel version and we assume a generic - // "Linux" name, which will be replaced down below. const linuxInfo = { kernel_version: os.release(), - name: 'Linux', + name: "Linux" }; - try { - // We start guessing the distribution by listing files in the /etc - // directory. This is were most Linux distributions (except Knoppix) store - // release files with certain distribution-dependent meta data. We search - // for exactly one known file defined in `LINUX_DISTROS` and exit if none - // are found. In case there are more than one file, we just stick with the - // first one. - const etcFiles = await readDirAsync('/etc'); - const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name)); + const etcFiles = await readDirAsync("/etc"); + const distroFile = LINUX_DISTROS.find((file) => etcFiles.includes(file.name)); if (!distroFile) { return linuxInfo; } - - // Once that file is known, load its contents. To make searching in those - // files easier, we lowercase the file contents. Since these files are - // usually quite small, this should not allocate too much memory and we only - // hold on to it for a very short amount of time. - const distroPath = node_path.join('/etc', distroFile.name); - const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) ).toLowerCase(); - - // Some Linux distributions store their release information in the same file - // (e.g. RHEL and Centos). In those cases, we scan the file for an - // identifier, that basically consists of the first word of the linux - // distribution name (e.g. "red" for Red Hat). In case there is no match, we - // just assume the first distribution in our list. + const distroPath = node_path.join("/etc", distroFile.name); + const contents = (await readFileAsync(distroPath, { encoding: "utf-8" })).toLowerCase(); const { distros } = distroFile; - linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0]; - - // Based on the found distribution, we can now compute the actual version - // number. This is different for every distribution, so several strategies - // are computed in `LINUX_VERSIONS`. + linuxInfo.name = distros.find((d) => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0]; const id = getLinuxDistroId(linuxInfo.name); - linuxInfo.version = _optionalChain([LINUX_VERSIONS, 'access', _21 => _21[id], 'optionalCall', _22 => _22(contents)]); - } catch (e) { - // ignore + linuxInfo.version = LINUX_VERSIONS[id]?.(contents); + } catch { } - return linuxInfo; } - -/** - * Grabs some information about hosting provider based on best effort. - */ function getCloudResourceContext() { if (process.env.VERCEL) { - // https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables return { - 'cloud.provider': 'vercel', - 'cloud.region': process.env.VERCEL_REGION, + "cloud.provider": "vercel", + "cloud.region": process.env.VERCEL_REGION }; } else if (process.env.AWS_REGION) { - // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html return { - 'cloud.provider': 'aws', - 'cloud.region': process.env.AWS_REGION, - 'cloud.platform': process.env.AWS_EXECUTION_ENV, + "cloud.provider": "aws", + "cloud.region": process.env.AWS_REGION, + "cloud.platform": process.env.AWS_EXECUTION_ENV }; } else if (process.env.GCP_PROJECT) { - // https://cloud.google.com/composer/docs/how-to/managing/environment-variables#reserved_variables return { - 'cloud.provider': 'gcp', + "cloud.provider": "gcp" }; } else if (process.env.ALIYUN_REGION_ID) { - // TODO: find where I found these environment variables - at least gc.github.com returns something return { - 'cloud.provider': 'alibaba_cloud', - 'cloud.region': process.env.ALIYUN_REGION_ID, + "cloud.provider": "alibaba_cloud", + "cloud.region": process.env.ALIYUN_REGION_ID }; } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) { - // https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#app-environment return { - 'cloud.provider': 'azure', - 'cloud.region': process.env.REGION_NAME, + "cloud.provider": "azure", + "cloud.region": process.env.REGION_NAME }; } else if (process.env.IBM_CLOUD_REGION) { - // TODO: find where I found these environment variables - at least gc.github.com returns something return { - 'cloud.provider': 'ibm_cloud', - 'cloud.region': process.env.IBM_CLOUD_REGION, + "cloud.provider": "ibm_cloud", + "cloud.region": process.env.IBM_CLOUD_REGION }; } else if (process.env.TENCENTCLOUD_REGION) { - // https://www.tencentcloud.com/document/product/583/32748 return { - 'cloud.provider': 'tencent_cloud', - 'cloud.region': process.env.TENCENTCLOUD_REGION, - 'cloud.account.id': process.env.TENCENTCLOUD_APPID, - 'cloud.availability_zone': process.env.TENCENTCLOUD_ZONE, + "cloud.provider": "tencent_cloud", + "cloud.region": process.env.TENCENTCLOUD_REGION, + "cloud.account.id": process.env.TENCENTCLOUD_APPID, + "cloud.availability_zone": process.env.TENCENTCLOUD_ZONE }; } else if (process.env.NETLIFY) { - // https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables return { - 'cloud.provider': 'netlify', + "cloud.provider": "netlify" }; } else if (process.env.FLY_REGION) { - // https://fly.io/docs/reference/runtime-environment/ return { - 'cloud.provider': 'fly.io', - 'cloud.region': process.env.FLY_REGION, + "cloud.provider": "fly.io", + "cloud.region": process.env.FLY_REGION }; } else if (process.env.DYNO) { - // https://devcenter.heroku.com/articles/dynos#local-environment-variables return { - 'cloud.provider': 'heroku', + "cloud.provider": "heroku" }; } else { - return undefined; + return void 0; } } +exports.contextsToSpanAttributes = contextsToSpanAttributes; exports.getAppContext = getAppContext; exports.getDeviceContext = getDeviceContext; +exports.getDynamicSpanAttributes = getDynamicSpanAttributes; exports.nodeContextIntegration = nodeContextIntegration; exports.readDirAsync = readDirAsync; exports.readFileAsync = readFileAsync; @@ -83900,113 +42576,71 @@ exports.readFileAsync = readFileAsync; /***/ }), -/***/ 57582: +/***/ 23751: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_fs = __nccwpck_require__(87561); const node_readline = __nccwpck_require__(51747); const core = __nccwpck_require__(84466); -const debugBuild = __nccwpck_require__(8421); +const debugBuild = __nccwpck_require__(20624); const LRU_FILE_CONTENTS_CACHE = new core.LRUMap(10); const LRU_FILE_CONTENTS_FS_READ_FAILED = new core.LRUMap(20); const DEFAULT_LINES_OF_CONTEXT = 7; -const INTEGRATION_NAME = 'ContextLines'; -// Determines the upper bound of lineno/colno that we will attempt to read. Large colno values are likely to be -// minified code while large lineno values are likely to be bundled code. -// Exported for testing purposes. -const MAX_CONTEXTLINES_COLNO = 1000; -const MAX_CONTEXTLINES_LINENO = 10000; - -/** - * Get or init map value - */ +const INTEGRATION_NAME = "ContextLines"; +const MAX_CONTEXTLINES_COLNO = 1e3; +const MAX_CONTEXTLINES_LINENO = 1e4; function emplace(map, key, contents) { const value = map.get(key); - - if (value === undefined) { + if (value === void 0) { map.set(key, contents); return contents; } - return value; } - -/** - * Determines if context lines should be skipped for a file. - * - .min.(mjs|cjs|js) files are and not useful since they dont point to the original source - * - node: prefixed modules are part of the runtime and cannot be resolved to a file - * - data: skip json, wasm and inline js https://nodejs.org/api/esm.html#data-imports - */ function shouldSkipContextLinesForFile(path) { - // Test the most common prefix and extension first. These are the ones we - // are most likely to see in user applications and are the ones we can break out of first. - if (path.startsWith('node:')) return true; - if (path.endsWith('.min.js')) return true; - if (path.endsWith('.min.cjs')) return true; - if (path.endsWith('.min.mjs')) return true; - if (path.startsWith('data:')) return true; + if (path.startsWith("node:")) return true; + if (path.endsWith(".min.js")) return true; + if (path.endsWith(".min.cjs")) return true; + if (path.endsWith(".min.mjs")) return true; + if (path.startsWith("data:")) return true; return false; } - -/** - * Determines if we should skip contextlines based off the max lineno and colno values. - */ function shouldSkipContextLinesForFrame(frame) { - if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO) return true; - if (frame.colno !== undefined && frame.colno > MAX_CONTEXTLINES_COLNO) return true; + if (frame.lineno !== void 0 && frame.lineno > MAX_CONTEXTLINES_LINENO) return true; + if (frame.colno !== void 0 && frame.colno > MAX_CONTEXTLINES_COLNO) return true; return false; } -/** - * Checks if we have all the contents that we need in the cache. - */ function rangeExistsInContentCache(file, range) { const contents = LRU_FILE_CONTENTS_CACHE.get(file); - if (contents === undefined) return false; - + if (contents === void 0) return false; for (let i = range[0]; i <= range[1]; i++) { - if (contents[i] === undefined) { + if (contents[i] === void 0) { return false; } } - return true; } - -/** - * Creates contiguous ranges of lines to read from a file. In the case where context lines overlap, - * the ranges are merged to create a single range. - */ function makeLineReaderRanges(lines, linecontext) { if (!lines.length) { return []; } - let i = 0; const line = lines[0]; - - if (typeof line !== 'number') { + if (typeof line !== "number") { return []; } - let current = makeContextRange(line, linecontext); const out = []; - // eslint-disable-next-line no-constant-condition while (true) { if (i === lines.length - 1) { out.push(current); break; } - - // If the next line falls into the current range, extend the current range to lineno + linecontext. const next = lines[i + 1]; - if (typeof next !== 'number') { + if (typeof next !== "number") { break; } if (next <= current[1]) { @@ -84015,295 +42649,179 @@ function makeLineReaderRanges(lines, linecontext) { out.push(current); current = makeContextRange(next, linecontext); } - i++; } - return out; } - -/** - * Extracts lines from a file and stores them in a cache. - */ function getContextLinesFromFile(path, ranges, output) { return new Promise((resolve, _reject) => { - // It is important *not* to have any async code between createInterface and the 'line' event listener - // as it will cause the 'line' event to - // be emitted before the listener is attached. const stream = node_fs.createReadStream(path); const lineReaded = node_readline.createInterface({ - input: stream, + input: stream }); - - // We need to explicitly destroy the stream to prevent memory leaks, - // removing the listeners on the readline interface is not enough. - // See: https://github.com/nodejs/node/issues/9002 and https://github.com/getsentry/sentry-javascript/issues/14892 function destroyStreamAndResolve() { stream.destroy(); resolve(); } - - // Init at zero and increment at the start of the loop because lines are 1 indexed. let lineNumber = 0; let currentRangeIndex = 0; const range = ranges[currentRangeIndex]; - if (range === undefined) { - // We should never reach this point, but if we do, we should resolve the promise to prevent it from hanging. + if (range === void 0) { destroyStreamAndResolve(); return; } let rangeStart = range[0]; let rangeEnd = range[1]; - - // We use this inside Promise.all, so we need to resolve the promise even if there is an error - // to prevent Promise.all from short circuiting the rest. function onStreamError(e) { - // Mark file path as failed to read and prevent multiple read attempts. LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1); - debugBuild.DEBUG_BUILD && core.logger.error(`Failed to read file: ${path}. Error: ${e}`); + debugBuild.DEBUG_BUILD && core.debug.error(`Failed to read file: ${path}. Error: ${e}`); lineReaded.close(); lineReaded.removeAllListeners(); destroyStreamAndResolve(); } - - // We need to handle the error event to prevent the process from crashing in < Node 16 - // https://github.com/nodejs/node/pull/31603 - stream.on('error', onStreamError); - lineReaded.on('error', onStreamError); - lineReaded.on('close', destroyStreamAndResolve); - - lineReaded.on('line', line => { + stream.on("error", onStreamError); + lineReaded.on("error", onStreamError); + lineReaded.on("close", destroyStreamAndResolve); + lineReaded.on("line", (line) => { lineNumber++; if (lineNumber < rangeStart) return; - - // !Warning: This mutates the cache by storing the snipped line into the cache. output[lineNumber] = core.snipLine(line, 0); - if (lineNumber >= rangeEnd) { if (currentRangeIndex === ranges.length - 1) { - // We need to close the file stream and remove listeners, else the reader will continue to run our listener; lineReaded.close(); lineReaded.removeAllListeners(); return; } currentRangeIndex++; - const range = ranges[currentRangeIndex]; - if (range === undefined) { - // This should never happen as it means we have a bug in the context. + const range2 = ranges[currentRangeIndex]; + if (range2 === void 0) { lineReaded.close(); lineReaded.removeAllListeners(); return; } - rangeStart = range[0]; - rangeEnd = range[1]; + rangeStart = range2[0]; + rangeEnd = range2[1]; } }); }); } - -/** - * Adds surrounding (context) lines of the line that an exception occurred on to the event. - * This is done by reading the file line by line and extracting the lines. The extracted lines are stored in - * a cache to prevent multiple reads of the same file. Failures to read a file are similarly cached to prevent multiple - * failing reads from happening. - */ -/* eslint-disable complexity */ async function addSourceContext(event, contextLines) { - // keep a lookup map of which files we've already enqueued to read, - // so we don't enqueue the same file multiple times which would cause multiple i/o reads const filesToLines = {}; - - if (contextLines > 0 && _optionalChain([event, 'access', _ => _.exception, 'optionalAccess', _2 => _2.values])) { + if (contextLines > 0 && event.exception?.values) { for (const exception of event.exception.values) { - if (!_optionalChain([exception, 'access', _3 => _3.stacktrace, 'optionalAccess', _4 => _4.frames, 'optionalAccess', _5 => _5.length])) { + if (!exception.stacktrace?.frames?.length) { continue; } - - // Maps preserve insertion order, so we iterate in reverse, starting at the - // outermost frame and closer to where the exception has occurred (poor mans priority) for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) { const frame = exception.stacktrace.frames[i]; - const filename = _optionalChain([frame, 'optionalAccess', _6 => _6.filename]); - - if ( - !frame || - typeof filename !== 'string' || - typeof frame.lineno !== 'number' || - shouldSkipContextLinesForFile(filename) || - shouldSkipContextLinesForFrame(frame) - ) { + const filename = frame?.filename; + if (!frame || typeof filename !== "string" || typeof frame.lineno !== "number" || shouldSkipContextLinesForFile(filename) || shouldSkipContextLinesForFrame(frame)) { continue; } - const filesToLinesOutput = filesToLines[filename]; if (!filesToLinesOutput) filesToLines[filename] = []; - // @ts-expect-error this is defined above filesToLines[filename].push(frame.lineno); } } } - const files = Object.keys(filesToLines); if (files.length == 0) { return event; } - const readlinePromises = []; for (const file of files) { - // If we failed to read this before, dont try reading it again. if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) { continue; } - const filesToLineRanges = filesToLines[file]; if (!filesToLineRanges) { continue; } - - // Sort ranges so that they are sorted by line increasing order and match how the file is read. filesToLineRanges.sort((a, b) => a - b); - // Check if the contents are already in the cache and if we can avoid reading the file again. const ranges = makeLineReaderRanges(filesToLineRanges, contextLines); - if (ranges.every(r => rangeExistsInContentCache(file, r))) { + if (ranges.every((r) => rangeExistsInContentCache(file, r))) { continue; } - const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {}); readlinePromises.push(getContextLinesFromFile(file, ranges, cache)); } - - // The promise rejections are caught in order to prevent them from short circuiting Promise.all await Promise.all(readlinePromises).catch(() => { - debugBuild.DEBUG_BUILD && core.logger.log('Failed to read one or more source files and resolve context lines'); + debugBuild.DEBUG_BUILD && core.debug.log("Failed to read one or more source files and resolve context lines"); }); - - // Perform the same loop as above, but this time we can assume all files are in the cache - // and attempt to add source context to frames. - if (contextLines > 0 && _optionalChain([event, 'access', _7 => _7.exception, 'optionalAccess', _8 => _8.values])) { + if (contextLines > 0 && event.exception?.values) { for (const exception of event.exception.values) { - if (exception.stacktrace && exception.stacktrace.frames && exception.stacktrace.frames.length > 0) { + if (exception.stacktrace?.frames && exception.stacktrace.frames.length > 0) { addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE); } } } - return event; } -/* eslint-enable complexity */ - -/** Adds context lines to frames */ -function addSourceContextToFrames( - frames, - contextLines, - cache, -) { +function addSourceContextToFrames(frames, contextLines, cache) { for (const frame of frames) { - // Only add context if we have a filename and it hasn't already been added - if (frame.filename && frame.context_line === undefined && typeof frame.lineno === 'number') { + if (frame.filename && frame.context_line === void 0 && typeof frame.lineno === "number") { const contents = cache.get(frame.filename); - if (contents === undefined) { + if (contents === void 0) { continue; } - addContextToFrame(frame.lineno, frame, contextLines, contents); } } } - -/** - * Clears the context lines from a frame, used to reset a frame to its original state - * if we fail to resolve all context lines for it. - */ function clearLineContext(frame) { delete frame.pre_context; delete frame.context_line; delete frame.post_context; } - -/** - * Resolves context lines before and after the given line number and appends them to the frame; - */ -function addContextToFrame( - lineno, - frame, - contextLines, - contents, -) { - // When there is no line number in the frame, attaching context is nonsensical and will even break grouping. - // We already check for lineno before calling this, but since StackFrame lineno ism optional, we check it again. - if (frame.lineno === undefined || contents === undefined) { - debugBuild.DEBUG_BUILD && core.logger.error('Cannot resolve context for frame with no lineno or file contents'); +function addContextToFrame(lineno, frame, contextLines, contents) { + if (frame.lineno === void 0 || contents === void 0) { + debugBuild.DEBUG_BUILD && core.debug.error("Cannot resolve context for frame with no lineno or file contents"); return; } - frame.pre_context = []; for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) { - // We always expect the start context as line numbers cannot be negative. If we dont find a line, then - // something went wrong somewhere. Clear the context and return without adding any linecontext. const line = contents[i]; - if (line === undefined) { + if (line === void 0) { clearLineContext(frame); - debugBuild.DEBUG_BUILD && core.logger.error(`Could not find line ${i} in file ${frame.filename}`); + debugBuild.DEBUG_BUILD && core.debug.error(`Could not find line ${i} in file ${frame.filename}`); return; } - frame.pre_context.push(line); } - - // We should always have the context line. If we dont, something went wrong, so we clear the context and return - // without adding any linecontext. - if (contents[lineno] === undefined) { + if (contents[lineno] === void 0) { clearLineContext(frame); - debugBuild.DEBUG_BUILD && core.logger.error(`Could not find line ${lineno} in file ${frame.filename}`); + debugBuild.DEBUG_BUILD && core.debug.error(`Could not find line ${lineno} in file ${frame.filename}`); return; } - frame.context_line = contents[lineno]; - const end = makeRangeEnd(lineno, contextLines); frame.post_context = []; for (let i = lineno + 1; i <= end; i++) { - // Since we dont track when the file ends, we cant clear the context if we dont find a line as it could - // just be that we reached the end of the file. const line = contents[i]; - if (line === undefined) { + if (line === void 0) { break; } frame.post_context.push(line); } } - -// Helper functions for generating line context ranges. They take a line number and the number of lines of context to -// include before and after the line and generate an inclusive range of indices. - -// Compute inclusive end context range function makeRangeStart(line, linecontext) { return Math.max(1, line - linecontext); } -// Compute inclusive start context range function makeRangeEnd(line, linecontext) { return line + linecontext; } -// Determine start and end indices for context range (inclusive); function makeContextRange(line, linecontext) { return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)]; } - -/** Exported only for tests, as a type-safe variant. */ const _contextLinesIntegration = ((options = {}) => { - const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT; - return { name: INTEGRATION_NAME, - processEvent(event) { + processEvent(event, _hint, client) { + const contextLines = options.frameContextLines ?? client?.getDataCollectionOptions().frameContextLines ?? DEFAULT_LINES_OF_CONTEXT; return addSourceContext(event, contextLines); - }, + } }; -}) ; - -/** - * Capture the lines before and after the frame's context. - */ +}); const contextLinesIntegration = core.defineIntegration(_contextLinesIntegration); exports.MAX_CONTEXTLINES_COLNO = MAX_CONTEXTLINES_COLNO; @@ -84316,912 +42834,525 @@ exports.contextLinesIntegration = contextLinesIntegration; /***/ }), -/***/ 91776: +/***/ 17075: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const instrumentationFs = __nccwpck_require__(99833); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); - -const INTEGRATION_NAME = 'FileSystem'; - -/** - * This integration will create spans for `fs` API operations, like reading and writing files. - * - * **WARNING:** This integration may add significant overhead to your application. Especially in scenarios with a lot of - * file I/O, like for example when running a framework dev server, including this integration can massively slow down - * your application. - * - * @param options Configuration for this integration. - */ -const fsIntegration = core.defineIntegration( - ( - options - - = {}, - ) => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationFs.FsInstrumentation({ - requireParentSpan: true, - endHook(functionName, { args, span, error }) { - span.updateName(`fs.${functionName}`); - - span.setAttributes({ - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'file', - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.file.fs', - }); - - if (options.recordErrorMessagesAsSpanAttributes) { - if (typeof args[0] === 'string' && FS_OPERATIONS_WITH_PATH_ARG.includes(functionName)) { - span.setAttribute('path_argument', args[0]); - } else if ( - typeof args[0] === 'string' && - typeof args[1] === 'string' && - FS_OPERATIONS_WITH_TARGET_PATH.includes(functionName) - ) { - span.setAttribute('target_argument', args[0]); - span.setAttribute('path_argument', args[1]); - } else if (typeof args[0] === 'string' && FS_OPERATIONS_WITH_PREFIX.includes(functionName)) { - span.setAttribute('prefix_argument', args[0]); - } else if ( - typeof args[0] === 'string' && - typeof args[1] === 'string' && - FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH.includes(functionName) - ) { - span.setAttribute('existing_path_argument', args[0]); - span.setAttribute('new_path_argument', args[1]); - } else if ( - typeof args[0] === 'string' && - typeof args[1] === 'string' && - FS_OPERATIONS_WITH_SRC_DEST.includes(functionName) - ) { - span.setAttribute('src_argument', args[0]); - span.setAttribute('dest_argument', args[1]); - } else if ( - typeof args[0] === 'string' && - typeof args[1] === 'string' && - FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH.includes(functionName) - ) { - span.setAttribute('old_path_argument', args[0]); - span.setAttribute('new_path_argument', args[1]); - } - } - - if (error && options.recordErrorMessagesAsSpanAttributes) { - span.setAttribute('fs_error', error.message); - } - }, - }), - )(); - }, - }; - }, -); - -const FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH = ['rename', 'renameSync']; -const FS_OPERATIONS_WITH_SRC_DEST = ['copyFile', 'cp', 'copyFileSync', 'cpSync']; -const FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH = ['link', 'linkSync']; -const FS_OPERATIONS_WITH_PREFIX = ['mkdtemp', 'mkdtempSync']; -const FS_OPERATIONS_WITH_TARGET_PATH = ['symlink', 'symlinkSync']; -const FS_OPERATIONS_WITH_PATH_ARG = [ - 'access', - 'appendFile', - 'chmod', - 'chown', - 'exists', - 'mkdir', - 'lchown', - 'lstat', - 'lutimes', - 'open', - 'opendir', - 'readdir', - 'readFile', - 'readlink', - 'realpath', - 'realpath.native', - 'rm', - 'rmdir', - 'stat', - 'truncate', - 'unlink', - 'utimes', - 'writeFile', - 'accessSync', - 'appendFileSync', - 'chmodSync', - 'chownSync', - 'existsSync', - 'lchownSync', - 'lstatSync', - 'lutimesSync', - 'opendirSync', - 'mkdirSync', - 'openSync', - 'readdirSync', - 'readFileSync', - 'readlinkSync', - 'realpathSync', - 'realpathSync.native', - 'rmdirSync', - 'rmSync', - 'statSync', - 'truncateSync', - 'unlinkSync', - 'utimesSync', - 'writeFileSync', -]; - -exports.fsIntegration = fsIntegration; -//# sourceMappingURL=fs.js.map - - -/***/ }), - -/***/ 59079: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const core = __nccwpck_require__(46033); +const diagnosticsChannel = __nccwpck_require__(65714); +const api = __nccwpck_require__(65163); const instrumentation = __nccwpck_require__(65584); -const core$1 = __nccwpck_require__(84466); -const debugBuild = __nccwpck_require__(8421); -const getRequestUrl = __nccwpck_require__(35126); -const getRequestInfo = __nccwpck_require__(48232); +const core = __nccwpck_require__(84466); +const constants = __nccwpck_require__(67353); +const nodeVersion = __nccwpck_require__(61523); +const node_events = __nccwpck_require__(15673); +const http = __nccwpck_require__(88849); -// We only want to capture request bodies up to 1mb. -const MAX_BODY_BYTE_LENGTH = 1024 * 1024; - -/** - * This custom HTTP instrumentation is used to isolate incoming requests and annotate them with additional information. - * It does not emit any spans. - * - * The reason this is isolated from the OpenTelemetry instrumentation is that users may overwrite this, - * which would lead to Sentry not working as expected. - * - * Important note: Contrary to other OTEL instrumentation, this one cannot be unwrapped. - * It only does minimal things though and does not emit any spans. - * - * This is heavily inspired & adapted from: - * https://github.com/open-telemetry/opentelemetry-js/blob/f8ab5592ddea5cba0a3b33bf8d74f27872c0367f/experimental/packages/opentelemetry-instrumentation-http/src/http.ts - */ -class SentryHttpInstrumentation extends instrumentation.InstrumentationBase { - constructor(config = {}) { - super('@sentry/instrumentation-http', core.VERSION, config); - } - - /** @inheritdoc */ - init() { - return [this._getHttpsInstrumentation(), this._getHttpInstrumentation()]; - } - - /** Get the instrumentation for the http module. */ - _getHttpInstrumentation() { - return new instrumentation.InstrumentationNodeModuleDefinition( - 'http', - ['*'], - (moduleExports) => { - // Patch incoming requests for request isolation - stealthWrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction()); - - // Patch outgoing requests for breadcrumbs - const patchedRequest = stealthWrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction()); - stealthWrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest)); - - return moduleExports; - }, - () => { - // no unwrap here - }, - ); - } - - /** Get the instrumentation for the https module. */ - _getHttpsInstrumentation() { - return new instrumentation.InstrumentationNodeModuleDefinition( - 'https', - ['*'], - (moduleExports) => { - // Patch incoming requests for request isolation - stealthWrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction()); - - // Patch outgoing requests for breadcrumbs - const patchedRequest = stealthWrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction()); - stealthWrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest)); - - return moduleExports; - }, - () => { - // no unwrap here - }, - ); - } - - /** - * Patch the incoming request function for request isolation. - */ - _getPatchIncomingRequestFunction() - - { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const instrumentation = this; - - return ( - original, - ) => { - return function incomingRequest( event, ...args) { - // Only traces request events - if (event !== 'request') { - return original.apply(this, [event, ...args]); - } - - instrumentation._diag.debug('http instrumentation for incoming request'); - - const isolationScope = core$1.getIsolationScope().clone(); - const request = args[0] ; - - const normalizedRequest = core$1.httpRequestToRequestData(request); - - patchRequestToCaptureBody(request, isolationScope); - - // Update the isolation scope, isolate this request - // TODO(v9): Stop setting `request`, we only rely on normalizedRequest anymore - isolationScope.setSDKProcessingMetadata({ - request, - normalizedRequest, - }); - - const client = core$1.getClient(); - // eslint-disable-next-line deprecation/deprecation - if (client && client.getOptions().autoSessionTracking) { - // eslint-disable-next-line deprecation/deprecation - isolationScope.setRequestSession({ status: 'ok' }); - } - - // attempt to update the scope's `transactionName` based on the request URL - // Ideally, framework instrumentations coming after the HttpInstrumentation - // update the transactionName once we get a parameterized route. - const httpMethod = (request.method || 'GET').toUpperCase(); - const httpTarget = core$1.stripUrlQueryAndFragment(request.url || '/'); - - const bestEffortTransactionName = `${httpMethod} ${httpTarget}`; - - isolationScope.setTransactionName(bestEffortTransactionName); - - return core$1.withIsolationScope(isolationScope, () => { - return original.apply(this, [event, ...args]); - }); - }; - }; - } - - /** - * Patch the outgoing request function for breadcrumbs. - */ - _getPatchOutgoingRequestFunction() - - { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const instrumentation = this; - - return (original) => { - return function outgoingRequest( ...args) { - instrumentation._diag.debug('http instrumentation for outgoing requests'); - - // Making a copy to avoid mutating the original args array - // We need to access and reconstruct the request options object passed to `ignoreOutgoingRequests` - // so that it matches what Otel instrumentation passes to `ignoreOutgoingRequestHook`. - // @see https://github.com/open-telemetry/opentelemetry-js/blob/7293e69c1e55ca62e15d0724d22605e61bd58952/experimental/packages/opentelemetry-instrumentation-http/src/http.ts#L756-L789 - const argsCopy = [...args]; - - const options = argsCopy.shift() ; - - const extraOptions = - typeof argsCopy[0] === 'object' && (typeof options === 'string' || options instanceof URL) - ? (argsCopy.shift() ) - : undefined; - - const { optionsParsed } = getRequestInfo.getRequestInfo(instrumentation._diag, options, extraOptions); - - const request = original.apply(this, args) ; - - request.prependListener('response', (response) => { - const _breadcrumbs = instrumentation.getConfig().breadcrumbs; - const breadCrumbsEnabled = typeof _breadcrumbs === 'undefined' ? true : _breadcrumbs; - - const _ignoreOutgoingRequests = instrumentation.getConfig().ignoreOutgoingRequests; - const shouldCreateBreadcrumb = - typeof _ignoreOutgoingRequests === 'function' - ? !_ignoreOutgoingRequests(getRequestUrl.getRequestUrl(request), optionsParsed) - : true; - - if (breadCrumbsEnabled && shouldCreateBreadcrumb) { - addRequestBreadcrumb(request, response); +const FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL = nodeVersion.NODE_VERSION.major === 22 && nodeVersion.NODE_VERSION.minor >= 12 || nodeVersion.NODE_VERSION.major === 23 && nodeVersion.NODE_VERSION.minor >= 2 || nodeVersion.NODE_VERSION.major >= 24; +function instrumentHttpOutgoingRequests(instrumentationOptions = {}) { + const { outgoingRequestApplyCustomAttributes: applyCustomAttributesOnSpan, ...options } = instrumentationOptions; + const patchOptions = { + propagateTrace: options.propagateTraceInOutgoingRequests ?? true, + applyCustomAttributesOnSpan, + ...options, + // oxlint-disable-next-line typescript/no-deprecated + spans: options.createSpansForOutgoingRequests !== false && (options.spans ?? true), + ignoreOutgoingRequests(url, request) { + return core.isTracingSuppressed() || !!options.ignoreOutgoingRequests?.(url, core.getRequestOptions(request)); + }, + outgoingRequestHook(span, request) { + options.outgoingRequestHook?.(span, request); + const originalOnce = request.once; + const newOnce = new Proxy(originalOnce, { + apply(target, thisArg, args) { + const [event] = args; + if (event !== "response") { + return target.apply(thisArg, args); } - }); - - return request; - }; - }; - } - - /** Path the outgoing get function for breadcrumbs. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - _getPatchOutgoingGetFunction(clientRequest) { - return (_original) => { - // Re-implement http.get. This needs to be done (instead of using - // getPatchOutgoingRequestFunction to patch it) because we need to - // set the trace context header before the returned http.ClientRequest is - // ended. The Node.js docs state that the only differences between - // request and get are that (1) get defaults to the HTTP GET method and - // (2) the returned request object is ended immediately. The former is - // already true (at least in supported Node versions up to v10), so we - // simply follow the latter. Ref: - // https://nodejs.org/dist/latest/docs/api/http.html#http_http_get_options_callback - // https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/instrumentations/instrumentation-http.ts#L198 - return function outgoingGetRequest(...args) { - const req = clientRequest(...args); - req.end(); - return req; - }; - }; - } -} - -/** - * This is a minimal version of `wrap` from shimmer: - * https://github.com/othiym23/shimmer/blob/master/index.js - * - * In contrast to the original implementation, this version does not allow to unwrap, - * and does not make it clear that the method is wrapped. - * This is necessary because we want to wrap the http module with our own code, - * while still allowing to use the HttpInstrumentation from OTEL. - * - * Without this, if we'd just use `wrap` from shimmer, the OTEL instrumentation would remove our wrapping, - * because it only allows any module to be wrapped a single time. - */ -function stealthWrap( - nodule, - name, - wrapper, -) { - const original = nodule[name]; - const wrapped = wrapper(original); - - defineProperty(nodule, name, wrapped); - return wrapped; -} - -// Sets a property on an object, preserving its enumerability. -function defineProperty( - obj, - name, - value, -) { - const enumerable = !!obj[name] && Object.prototype.propertyIsEnumerable.call(obj, name); - - Object.defineProperty(obj, name, { - configurable: true, - enumerable: enumerable, - writable: true, - value: value, - }); -} - -/** Add a breadcrumb for outgoing requests. */ -function addRequestBreadcrumb(request, response) { - const data = getBreadcrumbData(request); - - const statusCode = response.statusCode; - const level = core$1.getBreadcrumbLogLevelFromHttpStatusCode(statusCode); - - core$1.addBreadcrumb( - { - category: 'http', - data: { - status_code: statusCode, - ...data, - }, - type: 'http', - level, - }, - { - event: 'response', - request, - response, - }, - ); -} - -function getBreadcrumbData(request) { - try { - // `request.host` does not contain the port, but the host header does - const host = request.getHeader('host') || request.host; - const url = new URL(request.path, `${request.protocol}//${host}`); - const parsedUrl = core$1.parseUrl(url.toString()); - - const data = { - url: core$1.getSanitizedUrlString(parsedUrl), - 'http.method': request.method || 'GET', - }; - - if (parsedUrl.search) { - data['http.query'] = parsedUrl.search; - } - if (parsedUrl.hash) { - data['http.fragment'] = parsedUrl.hash; - } - - return data; - } catch (e) { - return {}; - } -} - -/** - * This method patches the request object to capture the body. - * Instead of actually consuming the streamed body ourselves, which has potential side effects, - * we monkey patch `req.on('data')` to intercept the body chunks. - * This way, we only read the body if the user also consumes the body, ensuring we do not change any behavior in unexpected ways. - */ -function patchRequestToCaptureBody(req, isolationScope) { - const chunks = []; - - function getChunksSize() { - return chunks.reduce((acc, chunk) => acc + chunk.byteLength, 0); - } - - /** - * We need to keep track of the original callbacks, in order to be able to remove listeners again. - * Since `off` depends on having the exact same function reference passed in, we need to be able to map - * original listeners to our wrapped ones. - */ - const callbackMap = new WeakMap(); - - try { - // eslint-disable-next-line @typescript-eslint/unbound-method - req.on = new Proxy(req.on, { - apply: (target, thisArg, args) => { - const [event, listener, ...restArgs] = args; - - if (event === 'data') { - const callback = new Proxy(listener, { - apply: (target, thisArg, args) => { - // If we have already read more than the max body length, we stop addiing chunks - // To avoid growing the memory indefinitely if a respons is e.g. streamed - if (getChunksSize() < MAX_BODY_BYTE_LENGTH) { - const chunk = args[0] ; - chunks.push(chunk); - } else if (debugBuild.DEBUG_BUILD) { - core$1.logger.log( - `Dropping request body chunk because it maximum body length of ${MAX_BODY_BYTE_LENGTH}b is exceeded.`, - ); - } - - return Reflect.apply(target, thisArg, args); - }, + const parentContext = api.context.active(); + const requestContext = api.trace.setSpan(parentContext, span); + return api.context.with(requestContext, () => { + return target.apply(thisArg, args); }); - - callbackMap.set(listener, callback); - - return Reflect.apply(target, thisArg, [event, callback, ...restArgs]); } - - if (event === 'end') { - const callback = new Proxy(listener, { - apply: (target, thisArg, args) => { - try { - const body = Buffer.concat(chunks).toString('utf-8'); - - if (body) { - const normalizedRequest = { data: body } ; - isolationScope.setSDKProcessingMetadata({ normalizedRequest }); - } - } catch (e2) { - // ignore errors here - } - - return Reflect.apply(target, thisArg, args); - }, - }); - - callbackMap.set(listener, callback); - - return Reflect.apply(target, thisArg, [event, callback, ...restArgs]); - } - - return Reflect.apply(target, thisArg, args); - }, - }); - - // Ensure we also remove callbacks correctly - // eslint-disable-next-line @typescript-eslint/unbound-method - req.off = new Proxy(req.off, { - apply: (target, thisArg, args) => { - const [, listener] = args; - - const callback = callbackMap.get(listener); - if (callback) { - callbackMap.delete(listener); - - const modifiedArgs = args.slice(); - modifiedArgs[1] = callback; - return Reflect.apply(target, thisArg, modifiedArgs); - } - - return Reflect.apply(target, thisArg, args); - }, - }); - } catch (e3) { - // ignore errors if we can't patch stuff + }); + request.once = newOnce; + }, + outgoingResponseHook(span, response) { + options.outgoingResponseHook?.(span, response); + }, + errorMonitor: node_events.errorMonitor, + // Pass these in to detect OTel double-wrapping if we're enabling spans + http + }; + if (FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL) { + instrumentHttpOutgoingRequestsViaChannel(patchOptions); + } else { + instrumentHttpOutgoingRequestsViaMonkeyPatching(patchOptions); + } +} +let _currentListener; +function instrumentHttpOutgoingRequestsViaChannel(options) { + const { [core.HTTP_ON_CLIENT_REQUEST]: onHttpClientRequestCreated } = core.getHttpClientSubscriptions(options); + if (_currentListener) { + diagnosticsChannel.unsubscribe(core.HTTP_ON_CLIENT_REQUEST, _currentListener); + } + diagnosticsChannel.subscribe(core.HTTP_ON_CLIENT_REQUEST, onHttpClientRequestCreated); + _currentListener = onHttpClientRequestCreated; +} +function instrumentHttpOutgoingRequestsViaMonkeyPatching(options) { + core.patchHttpModuleClient(http, options); +} +class SentryHttpInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(constants.INSTRUMENTATION_NAME, core.SDK_VERSION, config); + } + /** @inheritdoc */ + init() { + instrumentHttpOutgoingRequests(this.getConfig()); } } exports.SentryHttpInstrumentation = SentryHttpInstrumentation; +exports.instrumentHttpOutgoingRequests = instrumentHttpOutgoingRequests; //# sourceMappingURL=SentryHttpInstrumentation.js.map /***/ }), -/***/ 50289: +/***/ 67353: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const INSTRUMENTATION_NAME = "@sentry/instrumentation-http"; + +exports.INSTRUMENTATION_NAME = INSTRUMENTATION_NAME; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 9237: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +const diagnosticsChannel = __nccwpck_require__(65714); const api = __nccwpck_require__(65163); -const instrumentationHttp = __nccwpck_require__(50611); const core = __nccwpck_require__(84466); -const opentelemetry = __nccwpck_require__(78369); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); -const getRequestUrl = __nccwpck_require__(35126); -const SentryHttpInstrumentation = __nccwpck_require__(59079); +const debugBuild = __nccwpck_require__(20624); -const INTEGRATION_NAME = 'Http'; - -const INSTRUMENTATION_NAME = '@opentelemetry_sentry-patched/instrumentation-http'; - -const instrumentSentryHttp = instrument.generateInstrumentOnce - -(`${INTEGRATION_NAME}.sentry`, options => { - return new SentryHttpInstrumentation.SentryHttpInstrumentation({ - breadcrumbs: _optionalChain([options, 'optionalAccess', _ => _.breadcrumbs]), - ignoreOutgoingRequests: _optionalChain([options, 'optionalAccess', _2 => _2.ignoreOutgoingRequests]), - }); -}); - -const instrumentOtelHttp = instrument.generateInstrumentOnce(INTEGRATION_NAME, config => { - const instrumentation = new instrumentationHttp.HttpInstrumentation(config); - - // We want to update the logger namespace so we can better identify what is happening here - try { - instrumentation['_diag'] = api.diag.createComponentLogger({ - namespace: INSTRUMENTATION_NAME, - }); - // @ts-expect-error We are writing a read-only property here... - instrumentation.instrumentationName = INSTRUMENTATION_NAME; - } catch (e) { - // ignore errors here... - } - - return instrumentation; -}); - -/** - * Instrument the HTTP and HTTPS modules. - */ -const instrumentHttp = (options = {}) => { - // This is the "regular" OTEL instrumentation that emits spans - if (options.spans !== false) { - const instrumentationConfig = getConfigWithDefaults(options); - instrumentOtelHttp(instrumentationConfig); - } - - // This is the Sentry-specific instrumentation that isolates requests & creates breadcrumbs - // Note that this _has_ to be wrapped after the OTEL instrumentation, - // otherwise the isolation will not work correctly - instrumentSentryHttp(options); -}; - -/** - * The http integration instruments Node's internal http and https modules. - * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span. - */ -const httpIntegration = core.defineIntegration((options = {}) => { +const HTTP_SERVER_INSTRUMENTED_KEY = api.createContextKey("sentry_http_server_instrumented"); +const INTEGRATION_NAME = "Http.Server"; +function addStartSpanCallback(request, callback) { + core.addNonEnumerableProperty(request, "_startSpanCallback", new WeakRef(callback)); +} +const _httpServerIntegration = ((options = {}) => { + const _options = { + sessions: options.sessions ?? true, + sessionFlushingDelayMS: options.sessionFlushingDelayMS ?? 6e4, + maxRequestBodySize: options.maxRequestBodySize ?? "medium", + // Server spans are created by `httpServerSpansIntegration` via the + // `httpServerRequest` client event + `_startSpanCallback`, not by the + // core subscription helper. Explicitly opt out so the helper does not + // double-create spans when the client has tracing enabled. + spans: false, + // Cast: core uses HttpIncomingMessage; node consumers pass + // RequestOptions-typed callbacks. + // The two are structurally compatible for the fields the callback reads + // (url, method, headers). + ignoreRequestBody: options.ignoreRequestBody, + /** + * Hook called by core's `instrumentServer` to wrap the upstream + * `emit('request')` call. + * + * We use it to extract OTel context from request headers and re-enter + * the OTel context before the framework sees the request, so subsequent + * spans (eg from `httpServerSpansIntegration`) attach to the right trace. + */ + wrapServerEmitRequest(request, response, normalizedRequest, next) { + const client = core.getClient(); + if (!client) return next(); + if (api.context.active().getValue(HTTP_SERVER_INSTRUMENTED_KEY)) { + return next(); + } + const ctx = api.propagation.extract(api.context.active(), normalizedRequest.headers).setValue(HTTP_SERVER_INSTRUMENTED_KEY, true); + api.context.with(ctx, () => { + client.emit("httpServerRequest", request, response, normalizedRequest); + const callback = request._startSpanCallback?.deref(); + if (callback) { + callback(() => { + next(); + return true; + }); + } else { + next(); + } + }); + } + }; return { name: INTEGRATION_NAME, setupOnce() { - instrumentHttp(options); + const { [core.HTTP_ON_SERVER_REQUEST]: onHttpServerRequestStart } = core.getHttpServerSubscriptions(_options); + diagnosticsChannel.subscribe(core.HTTP_ON_SERVER_REQUEST, onHttpServerRequestStart); }, + afterAllSetup(client) { + if (debugBuild.DEBUG_BUILD && client.getIntegrationByName("Http")) { + core.debug.warn( + "It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`." + ); + } + } + }; +}); +const httpServerIntegration = _httpServerIntegration; + +exports.recordRequestSession = core.recordRequestSession; +exports.addStartSpanCallback = addStartSpanCallback; +exports.httpServerIntegration = httpServerIntegration; +//# sourceMappingURL=httpServerIntegration.js.map + + +/***/ }), + +/***/ 63939: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const node_events = __nccwpck_require__(15673); +const api = __nccwpck_require__(65163); +const core$1 = __nccwpck_require__(89736); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(20624); +const httpServerIntegration = __nccwpck_require__(9237); + +const INTEGRATION_NAME = "Http.ServerSpans"; +const _httpServerSpansIntegration = ((options = {}) => { + const ignoreStaticAssets = options.ignoreStaticAssets ?? true; + const ignoreIncomingRequests = options.ignoreIncomingRequests; + const ignoreStatusCodes = options.ignoreStatusCodes ?? [ + [401, 404], + // 300 and 304 are possibly valid status codes we do not want to filter + [301, 303], + [305, 399] + ]; + const { onSpanCreated } = options; + const { requestHook, responseHook, applyCustomAttributesOnSpan } = options.instrumentation ?? {}; + return { + name: INTEGRATION_NAME, + setup(client) { + if (typeof __SENTRY_TRACING__ !== "undefined" && !__SENTRY_TRACING__) { + return; + } + client.on("httpServerRequest", (_request, _response, normalizedRequest) => { + const request = _request; + const response = _response; + const startSpan = (next) => { + if (shouldIgnoreSpansForIncomingRequest(request, { + ignoreStaticAssets, + ignoreIncomingRequests + })) { + debugBuild.DEBUG_BUILD && core.debug.log(INTEGRATION_NAME, "Skipping span creation for incoming request", request.url); + return next(); + } + const fullUrl = normalizedRequest.url || request.url || "/"; + const urlObj = core.parseStringToURLObject(fullUrl); + const headers = request.headers; + const userAgent = headers["user-agent"]; + const ips = headers["x-forwarded-for"]; + const httpVersion = request.httpVersion; + const host = headers.host; + const hostname = host?.replace(/^(.*)(:[0-9]{1,5})/, "$1") || "localhost"; + const scheme = fullUrl.startsWith("https") ? "https" : "http"; + const method = normalizedRequest.method || request.method?.toUpperCase() || "GET"; + const httpTargetWithoutQueryFragment = urlObj ? urlObj.pathname : core.stripUrlQueryAndFragment(fullUrl); + const bestEffortTransactionName = `${method} ${httpTargetWithoutQueryFragment}`; + const span = core.startInactiveSpan({ + name: bestEffortTransactionName, + kind: core.SPAN_KIND.SERVER, + attributes: { + // Sentry specific attributes + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.server", + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.http", + [attributes.SENTRY_HTTP_PREFETCH]: isKnownPrefetchRequest(request) || void 0, + [attributes.URL_FULL]: urlObj && !core.isURLObjectRelative(urlObj) ? urlObj.href : void 0, + [attributes.URL_PATH]: urlObj?.pathname ?? httpTargetWithoutQueryFragment, + // Old Semantic Conventions attributes - added for compatibility with what `@opentelemetry/instrumentation-http` output before + /* eslint-disable typescript/no-deprecated */ + [attributes.HTTP_URL]: fullUrl, + [attributes.HTTP_METHOD]: normalizedRequest.method, + [attributes.HTTP_TARGET]: urlObj ? `${urlObj.pathname}${urlObj.search}` : httpTargetWithoutQueryFragment, + [attributes.HTTP_HOST]: host, + [attributes.NET_HOST_NAME]: hostname, + [attributes.HTTP_CLIENT_IP]: typeof ips === "string" ? ips.split(",")[0] : void 0, + [attributes.HTTP_USER_AGENT]: userAgent, + [attributes.HTTP_SCHEME]: scheme, + [attributes.HTTP_FLAVOR]: httpVersion, + [attributes.NET_TRANSPORT]: httpVersion?.toUpperCase() === "QUIC" ? "ip_udp" : "ip_tcp", + /* eslint-enable typescript/no-deprecated */ + ...getRequestContentLengthAttribute(request), + ...core.httpHeadersToSpanAttributes(normalizedRequest.headers || {}, client.getDataCollectionOptions()) + } + }); + requestHook?.(span, request); + responseHook?.(span, response); + applyCustomAttributesOnSpan?.(span, request, response); + onSpanCreated?.(span, request, response); + const rpcMetadata = { type: core$1.RPCType.HTTP, span }; + return core.withActiveSpan(span, () => { + return api.context.with(core$1.setRPCMetadata(api.context.active(), rpcMetadata), () => { + core.bindScopeToEmitter(request); + core.bindScopeToEmitter(response); + let isEnded = false; + function endSpan(status) { + if (isEnded) { + return; + } + isEnded = true; + const newAttributes = getIncomingRequestAttributesOnResponse(request, response, rpcMetadata); + span.setAttributes(newAttributes); + span.setStatus(status); + span.end(); + const route = newAttributes["http.route"]; + if (route) { + core.getIsolationScope().setTransactionName(`${request.method?.toUpperCase() || "GET"} ${route}`); + } + } + response.on("close", () => { + endSpan(core.getSpanStatusFromHttpCode(response.statusCode)); + }); + response.on(node_events.errorMonitor, () => { + const httpStatus = core.getSpanStatusFromHttpCode(response.statusCode); + endSpan(httpStatus.code === core.SPAN_STATUS_ERROR ? httpStatus : { code: core.SPAN_STATUS_ERROR }); + }); + return next(); + }); + }); + }; + httpServerIntegration.addStartSpanCallback(request, startSpan); + }); + }, + processEvent(event) { + if (event.type === "transaction") { + const statusCode = event.contexts?.trace?.data?.["http.response.status_code"]; + if (typeof statusCode === "number") { + if (shouldFilterStatusCode(statusCode, ignoreStatusCodes)) { + debugBuild.DEBUG_BUILD && core.debug.log("Dropping transaction due to status code", statusCode); + return null; + } + event.contexts = { + ...event.contexts, + response: { + ...event.contexts?.response, + status_code: statusCode + } + }; + } + } + return event; + }, + afterAllSetup(client) { + if (!debugBuild.DEBUG_BUILD) { + return; + } + if (client.getIntegrationByName("Http")) { + core.debug.warn( + "It seems that you have manually added `httpServerSpansIntegration` while `httpIntegration` is also present. Make sure to remove `httpIntegration` when adding `httpServerSpansIntegration`." + ); + } + if (!client.getIntegrationByName("Http.Server")) { + core.debug.error( + "It seems that you have manually added `httpServerSpansIntegration` without adding `httpServerIntegration`. This is a requiement for spans to be created - please add the `httpServerIntegration` integration." + ); + } + } + }; +}); +const httpServerSpansIntegration = _httpServerSpansIntegration; +function isKnownPrefetchRequest(req) { + return req.headers["next-router-prefetch"] === "1"; +} +function isStaticAssetRequest(urlPath) { + const path = core.stripUrlQueryAndFragment(urlPath); + if (path.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) { + return true; + } + if (path.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) { + return true; + } + return false; +} +function shouldIgnoreSpansForIncomingRequest(request, { + ignoreStaticAssets, + ignoreIncomingRequests +}) { + if (core.isTracingSuppressed()) { + return true; + } + const urlPath = request.url; + const method = request.method?.toUpperCase(); + if (method === "OPTIONS" || method === "HEAD" || !urlPath) { + return true; + } + if (ignoreStaticAssets && method === "GET" && isStaticAssetRequest(urlPath)) { + return true; + } + if (ignoreIncomingRequests?.(urlPath, request)) { + return true; + } + return false; +} +function getRequestContentLengthAttribute(request) { + const length = getContentLength(request.headers); + if (length == null) { + return {}; + } + if (isCompressed(request.headers)) { + return { + ["http.request_content_length"]: length + }; + } else { + return { + ["http.request_content_length_uncompressed"]: length + }; + } +} +function getContentLength(headers) { + const contentLengthHeader = headers["content-length"]; + if (contentLengthHeader === void 0) return null; + const contentLength = parseInt(contentLengthHeader, 10); + if (isNaN(contentLength)) return null; + return contentLength; +} +function isCompressed(headers) { + const encoding = headers["content-encoding"]; + return !!encoding && encoding !== "identity"; +} +function getIncomingRequestAttributesOnResponse(request, response, rpcMetadata) { + const { socket } = request; + const { statusCode, statusMessage } = response; + const newAttributes = { + [attributes.HTTP_RESPONSE_STATUS_CODE]: statusCode, + // eslint-disable-next-line typescript/no-deprecated + [attributes.HTTP_STATUS_CODE]: statusCode, + "http.status_text": statusMessage?.toUpperCase() + }; + if (socket) { + const { localAddress, localPort, remoteAddress, remotePort } = socket; + newAttributes[attributes.NET_HOST_IP] = localAddress; + newAttributes[attributes.NET_HOST_PORT] = localPort; + newAttributes[attributes.NET_PEER_IP] = remoteAddress; + newAttributes[attributes.NET_PEER_PORT] = remotePort; + } + newAttributes[attributes.HTTP_STATUS_CODE] = statusCode; + newAttributes["http.status_text"] = (statusMessage || "").toUpperCase(); + if (rpcMetadata?.type === core$1.RPCType.HTTP && rpcMetadata.route !== void 0) { + const routeName = rpcMetadata.route; + newAttributes[attributes.HTTP_ROUTE] = routeName; + } + return newAttributes; +} +function shouldFilterStatusCode(statusCode, dropForStatusCodes) { + return dropForStatusCodes.some((code) => { + if (typeof code === "number") { + return code === statusCode; + } + const [min, max] = code; + return statusCode >= min && statusCode <= max; + }); +} + +exports.httpServerSpansIntegration = httpServerSpansIntegration; +exports.isStaticAssetRequest = isStaticAssetRequest; +//# sourceMappingURL=httpServerSpansIntegration.js.map + + +/***/ }), + +/***/ 68798: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const httpServerIntegration = __nccwpck_require__(9237); +const httpServerSpansIntegration = __nccwpck_require__(63939); +const SentryHttpInstrumentation = __nccwpck_require__(17075); + +const INTEGRATION_NAME = "Http"; +Object.assign(SentryHttpInstrumentation.instrumentHttpOutgoingRequests, { + id: `${INTEGRATION_NAME}.sentry` +}); +const httpIntegration = core.defineIntegration((options = {}) => { + const spans = options.spans ?? false; + const disableIncomingRequestSpans = options.disableIncomingRequestSpans ?? false; + const enabledServerSpans = spans && !disableIncomingRequestSpans; + const serverOptions = { + sessions: options.trackIncomingRequestsAsSessions, + sessionFlushingDelayMS: options.sessionFlushingDelayMS, + ignoreRequestBody: options.ignoreIncomingRequestBody, + maxRequestBodySize: options.maxIncomingRequestBodySize + }; + const serverSpansOptions = { + ignoreIncomingRequests: options.ignoreIncomingRequests, + ignoreStaticAssets: options.ignoreStaticAssets, + ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes + }; + const httpInstrumentationOptions = { + breadcrumbs: options.breadcrumbs, + propagateTraceInOutgoingRequests: options.tracePropagation ?? true, + ignoreOutgoingRequests: options.ignoreOutgoingRequests, + spans + }; + const server = httpServerIntegration.httpServerIntegration(serverOptions); + const serverSpans = httpServerSpansIntegration.httpServerSpansIntegration(serverSpansOptions); + return { + name: INTEGRATION_NAME, + setup(client) { + if (enabledServerSpans) { + serverSpans.setup(client); + } + }, + setupOnce() { + server.setupOnce(); + SentryHttpInstrumentation.instrumentHttpOutgoingRequests(httpInstrumentationOptions); + }, + processEvent(event) { + return serverSpans.processEvent(event); + } }; }); -/** - * Determines if @param req is a ClientRequest, meaning the request was created within the express app - * and it's an outgoing request. - * Checking for properties instead of using `instanceOf` to avoid importing the request classes. - */ -function _isClientRequest(req) { - return 'outputData' in req && 'outputSize' in req && !('client' in req) && !('statusCode' in req); -} - -/** - * Detects if an incoming request is a prefetch request. - */ -function isKnownPrefetchRequest(req) { - // Currently only handles Next.js prefetch requests but may check other frameworks in the future. - return req.headers['next-router-prefetch'] === '1'; -} - -function getConfigWithDefaults(options = {}) { - const instrumentationConfig = { - ..._optionalChain([options, 'access', _3 => _3.instrumentation, 'optionalAccess', _4 => _4._experimentalConfig]), - - disableIncomingRequestInstrumentation: options.disableIncomingRequestSpans, - - ignoreOutgoingRequestHook: request => { - const url = getRequestUrl.getRequestUrl(request); - - if (!url) { - return false; - } - - const _ignoreOutgoingRequests = options.ignoreOutgoingRequests; - if (_ignoreOutgoingRequests && _ignoreOutgoingRequests(url, request)) { - return true; - } - - return false; - }, - - ignoreIncomingRequestHook: request => { - // request.url is the only property that holds any information about the url - // it only consists of the URL path and query string (if any) - const urlPath = request.url; - - const method = _optionalChain([request, 'access', _5 => _5.method, 'optionalAccess', _6 => _6.toUpperCase, 'call', _7 => _7()]); - // We do not capture OPTIONS/HEAD requests as transactions - if (method === 'OPTIONS' || method === 'HEAD') { - return true; - } - - const _ignoreIncomingRequests = options.ignoreIncomingRequests; - if (urlPath && _ignoreIncomingRequests && _ignoreIncomingRequests(urlPath, request)) { - return true; - } - - return false; - }, - - requireParentforOutgoingSpans: false, - requireParentforIncomingSpans: false, - requestHook: (span, req) => { - addOriginToSpan.addOriginToSpan(span, 'auto.http.otel.http'); - if (!_isClientRequest(req) && isKnownPrefetchRequest(req)) { - span.setAttribute('sentry.http.prefetch', true); - } - - _optionalChain([options, 'access', _8 => _8.instrumentation, 'optionalAccess', _9 => _9.requestHook, 'optionalCall', _10 => _10(span, req)]); - }, - responseHook: (span, res) => { - const client = opentelemetry.getClient(); - - if ( - client && - // eslint-disable-next-line deprecation/deprecation - client.getOptions().autoSessionTracking !== false && - options.trackIncomingRequestsAsSessions !== false - ) { - setImmediate(() => { - client['_captureRequestSession'](); - }); - } - - _optionalChain([options, 'access', _11 => _11.instrumentation, 'optionalAccess', _12 => _12.responseHook, 'optionalCall', _13 => _13(span, res)]); - }, - applyCustomAttributesOnSpan: ( - span, - request, - response, - ) => { - _optionalChain([options, 'access', _14 => _14.instrumentation, 'optionalAccess', _15 => _15.applyCustomAttributesOnSpan, 'optionalCall', _16 => _16(span, request, response)]); - }, - } ; - - return instrumentationConfig; -} - exports.httpIntegration = httpIntegration; -exports.instrumentOtelHttp = instrumentOtelHttp; -exports.instrumentSentryHttp = instrumentSentryHttp; //# sourceMappingURL=index.js.map /***/ }), -/***/ 48232: +/***/ 97988: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const url = __nccwpck_require__(57310); +const core = __nccwpck_require__(84466); -/** - * Makes sure options is an url object - * return an object with default value and parsed options - * @param logger component logger - * @param options original options for the request - * @param [extraOptions] additional options for the request - */ -const getRequestInfo = ( - logger, - options, - extraOptions, - -) => { - let pathname; - let origin; - let optionsParsed; - let invalidUrl = false; - if (typeof options === 'string') { - try { - const convertedOptions = stringUrlToHttpOptions(options); - optionsParsed = convertedOptions; - pathname = convertedOptions.pathname || '/'; - } catch (e) { - invalidUrl = true; - logger.verbose( - 'Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:', - e, - ); - // for backward compatibility with how url.parse() behaved. - optionsParsed = { - path: options, - }; - pathname = optionsParsed.path || '/'; - } - - origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`; - if (extraOptions !== undefined) { - Object.assign(optionsParsed, extraOptions); - } - } else if (options instanceof url.URL) { - optionsParsed = { - protocol: options.protocol, - hostname: - typeof options.hostname === 'string' && options.hostname.startsWith('[') - ? options.hostname.slice(1, -1) - : options.hostname, - path: `${options.pathname || ''}${options.search || ''}`, - }; - if (options.port !== '') { - optionsParsed.port = Number(options.port); - } - if (options.username || options.password) { - optionsParsed.auth = `${options.username}:${options.password}`; - } - pathname = options.pathname; - origin = options.origin; - if (extraOptions !== undefined) { - Object.assign(optionsParsed, extraOptions); - } - } else { - optionsParsed = Object.assign({ protocol: options.host ? 'http:' : undefined }, options); - - const hostname = - optionsParsed.host || - (optionsParsed.port != null ? `${optionsParsed.hostname}${optionsParsed.port}` : optionsParsed.hostname); - origin = `${optionsParsed.protocol || 'http:'}//${hostname}`; - - pathname = (options ).pathname; - if (!pathname && optionsParsed.path) { - try { - const parsedUrl = new URL(optionsParsed.path, origin); - pathname = parsedUrl.pathname || '/'; - } catch (e) { - pathname = '/'; - } - } - } - - // some packages return method in lowercase.. - // ensure upperCase for consistency - const method = optionsParsed.method ? optionsParsed.method.toUpperCase() : 'GET'; - - return { origin, pathname, method, optionsParsed, invalidUrl }; -}; - -/** - * Mimics Node.js conversion of URL strings to RequestOptions expected by - * `http.request` and `https.request` APIs. - * - * See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437 - * - * @param stringUrl - * @throws TypeError if the URL is not valid. - */ -function stringUrlToHttpOptions(stringUrl) { - // This is heavily inspired by Node.js handling of the same situation, trying - // to follow it as closely as possible while keeping in mind that we only - // deal with string URLs, not URL objects. - const { hostname, pathname, port, username, password, search, protocol, hash, href, origin, host } = new URL( - stringUrl, - ); - - const options - - = { - protocol: protocol, - hostname: hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname, - hash: hash, - search: search, - pathname: pathname, - path: `${pathname || ''}${search || ''}`, - href: href, - origin: origin, - host: host, - }; - if (port !== '') { - options.port = Number(port); - } - if (username || password) { - options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(password)}`; - } - return options; +function filterFrameVariables(vars, behavior) { + return core._INTERNAL_filterKeyValueData(vars, behavior); } - -exports.getRequestInfo = getRequestInfo; -//# sourceMappingURL=getRequestInfo.js.map - - -/***/ }), - -/***/ 58108: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** - * The key used to store the local variables on the error object. - */ -const LOCAL_VARIABLES_KEY = '__SENTRY_ERROR_LOCAL_VARIABLES__'; - -/** - * Creates a rate limiter that will call the disable callback when the rate limit is reached and the enable callback - * when a timeout has occurred. - * @param maxPerSecond Maximum number of calls per second - * @param enable Callback to enable capture - * @param disable Callback to disable capture - * @returns A function to call to increment the rate limiter count - */ -function createRateLimiter( - maxPerSecond, - enable, - disable, -) { +const LOCAL_VARIABLES_KEY = "__SENTRY_ERROR_LOCAL_VARIABLES__"; +function createRateLimiter(maxPerSecond, enable, disable) { let count = 0; let retrySeconds = 5; let disabledTimeout = 0; - setInterval(() => { if (disabledTimeout === 0) { if (count > maxPerSecond) { retrySeconds *= 2; disable(retrySeconds); - - // Cap at one day if (retrySeconds > 86400) { retrySeconds = 86400; } @@ -85229,34 +43360,26 @@ function createRateLimiter( } } else { disabledTimeout -= 1; - if (disabledTimeout === 0) { enable(); } } - count = 0; - }, 1000).unref(); - + }, 1e3).unref(); return () => { count += 1; }; } - -// Add types for the exception event data - -/** Could this be an anonymous function? */ function isAnonymous(name) { - return name !== undefined && (name.length === 0 || name === '?' || name === ''); + return name !== void 0 && (name.length === 0 || name === "?" || name === ""); } - -/** Do the function names appear to match? */ function functionNamesMatch(a, b) { - return a === b || (isAnonymous(a) && isAnonymous(b)); + return a === b || `Object.${a}` === b || a === `Object.${b}` || isAnonymous(a) && isAnonymous(b); } exports.LOCAL_VARIABLES_KEY = LOCAL_VARIABLES_KEY; exports.createRateLimiter = createRateLimiter; +exports.filterFrameVariables = filterFrameVariables; exports.functionNamesMatch = functionNamesMatch; exports.isAnonymous = isAnonymous; //# sourceMappingURL=common.js.map @@ -85264,14 +43387,14 @@ exports.isAnonymous = isAnonymous; /***/ }), -/***/ 4530: +/***/ 43482: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const nodeVersion = __nccwpck_require__(88196); -const localVariablesAsync = __nccwpck_require__(92596); -const localVariablesSync = __nccwpck_require__(58079); +const nodeVersion = __nccwpck_require__(61523); +const localVariablesAsync = __nccwpck_require__(26793); +const localVariablesSync = __nccwpck_require__(82866); const localVariablesIntegration = (options = {}) => { return nodeVersion.NODE_VERSION.major < 19 ? localVariablesSync.localVariablesSyncIntegration(options) : localVariablesAsync.localVariablesAsyncIntegration(options); @@ -85283,152 +43406,111 @@ exports.localVariablesIntegration = localVariablesIntegration; /***/ }), -/***/ 92596: +/***/ 26793: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_worker_threads = __nccwpck_require__(24086); const core = __nccwpck_require__(84466); -const debug = __nccwpck_require__(75915); -const common = __nccwpck_require__(58108); - -// This string is a placeholder that gets overwritten with the worker code. -const base64WorkerScript = 'LyohIEBzZW50cnkvbm9kZSA4LjU0LjAgKGU5YTQ1ZmUpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPSI4LjU0LjAiLG89Z2xvYmFsVGhpcztjb25zdCBpPSJ1bmRlZmluZWQiPT10eXBlb2YgX19TRU5UUllfREVCVUdfX3x8X19TRU5UUllfREVCVUdfXyxhPVsiZGVidWciLCJpbmZvIiwid2FybiIsImVycm9yIiwibG9nIiwiYXNzZXJ0IiwidHJhY2UiXSxzPXt9O2Z1bmN0aW9uIGMoZSl7aWYoISgiY29uc29sZSJpbiBvKSlyZXR1cm4gZSgpO2NvbnN0IHQ9by5jb25zb2xlLG49e30saT1PYmplY3Qua2V5cyhzKTtpLmZvckVhY2goKGU9Pntjb25zdCBvPXNbZV07bltlXT10W2VdLHRbZV09b30pKTt0cnl7cmV0dXJuIGUoKX1maW5hbGx5e2kuZm9yRWFjaCgoZT0+e3RbZV09bltlXX0pKX19IWZ1bmN0aW9uKGUsdCxpKXtjb25zdCBhPW8scz1hLl9fU0VOVFJZX189YS5fX1NFTlRSWV9ffHx7fSxjPXNbbl09c1tuXXx8e307Y1tlXXx8KGNbZV09dCgpKX0oImxvZ2dlciIsKGZ1bmN0aW9uKCl7bGV0IGU9ITE7Y29uc3QgdD17ZW5hYmxlOigpPT57ZT0hMH0sZGlzYWJsZTooKT0+e2U9ITF9LGlzRW5hYmxlZDooKT0+ZX07cmV0dXJuIGk/YS5mb3JFYWNoKChuPT57dFtuXT0oLi4udCk9PntlJiZjKCgoKT0+e28uY29uc29sZVtuXShgU2VudHJ5IExvZ2dlciBbJHtufV06YCwuLi50KX0pKX19KSk6YS5mb3JFYWNoKChlPT57dFtlXT0oKT0+e319KSksdH0pKTtjb25zdCByPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgdT10O2Z1bmN0aW9uIGwoLi4uZSl7dS5kZWJ1ZyYmYygoKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpKX1hc3luYyBmdW5jdGlvbiBmKGUsdCxuLG8pe2NvbnN0IGk9YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtvW25dPWkucmVzdWx0LmZpbHRlcigoZT0+Imxlbmd0aCIhPT1lLm5hbWUmJiFpc05hTihwYXJzZUludChlLm5hbWUsMTApKSkpLnNvcnQoKChlLHQpPT5wYXJzZUludChlLm5hbWUsMTApLXBhcnNlSW50KHQubmFtZSwxMCkpKS5tYXAoKGU9PmUudmFsdWU/LnZhbHVlKSl9YXN5bmMgZnVuY3Rpb24gZyhlLHQsbixvKXtjb25zdCBpPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSk7b1tuXT1pLnJlc3VsdC5tYXAoKGU9PltlLm5hbWUsZS52YWx1ZT8udmFsdWVdKSkucmVkdWNlKCgoZSxbdCxuXSk9PihlW3RdPW4sZSkpLHt9KX1mdW5jdGlvbiBkKGUsdCl7ZS52YWx1ZSYmKCJ2YWx1ZSJpbiBlLnZhbHVlP3ZvaWQgMD09PWUudmFsdWUudmFsdWV8fG51bGw9PT1lLnZhbHVlLnZhbHVlP3RbZS5uYW1lXT1gPCR7ZS52YWx1ZS52YWx1ZX0+YDp0W2UubmFtZV09ZS52YWx1ZS52YWx1ZToiZGVzY3JpcHRpb24iaW4gZS52YWx1ZSYmImZ1bmN0aW9uIiE9PWUudmFsdWUudHlwZT90W2UubmFtZV09YDwke2UudmFsdWUuZGVzY3JpcHRpb259PmA6InVuZGVmaW5lZCI9PT1lLnZhbHVlLnR5cGUmJih0W2UubmFtZV09Ijx1bmRlZmluZWQ+IikpfWFzeW5jIGZ1bmN0aW9uIGIoZSx0KXtjb25zdCBuPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSksbz17fTtmb3IoY29uc3QgdCBvZiBuLnJlc3VsdClpZih0Py52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10Py52YWx1ZS5jbGFzc05hbWUpe2NvbnN0IG49dC52YWx1ZS5vYmplY3RJZDthd2FpdCBmKGUsbix0Lm5hbWUsbyl9ZWxzZSBpZih0Py52YWx1ZT8ub2JqZWN0SWQmJiJPYmplY3QiPT09dD8udmFsdWU/LmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGcoZSxuLHQubmFtZSxvKX1lbHNlIHQ/LnZhbHVlJiZkKHQsbyk7cmV0dXJuIG99bGV0IHA7KGFzeW5jIGZ1bmN0aW9uKCl7Y29uc3QgdD1uZXcgZTt0LmNvbm5lY3RUb01haW5UaHJlYWQoKSxsKCJDb25uZWN0ZWQgdG8gbWFpbiB0aHJlYWQiKTtsZXQgbj0hMTt0Lm9uKCJEZWJ1Z2dlci5yZXN1bWVkIiwoKCk9PntuPSExfSkpLHQub24oIkRlYnVnZ2VyLnBhdXNlZCIsKGU9PntuPSEwLGFzeW5jIGZ1bmN0aW9uKGUse3JlYXNvbjp0LGRhdGE6e29iamVjdElkOm59LGNhbGxGcmFtZXM6b30pe2lmKCJleGNlcHRpb24iIT09dCYmInByb21pc2VSZWplY3Rpb24iIT09dClyZXR1cm47aWYocD8uKCksbnVsbD09bilyZXR1cm47Y29uc3QgaT1bXTtmb3IobGV0IHQ9MDt0PG8ubGVuZ3RoO3QrKyl7Y29uc3R7c2NvcGVDaGFpbjpuLGZ1bmN0aW9uTmFtZTphLHRoaXM6c309b1t0XSxjPW4uZmluZCgoZT0+ImxvY2FsIj09PWUudHlwZSkpLHI9Imdsb2JhbCIhPT1zLmNsYXNzTmFtZSYmcy5jbGFzc05hbWU/YCR7cy5jbGFzc05hbWV9LiR7YX1gOmE7aWYodm9pZCAwPT09Yz8ub2JqZWN0Lm9iamVjdElkKWlbdF09e2Z1bmN0aW9uOnJ9O2Vsc2V7Y29uc3Qgbj1hd2FpdCBiKGUsYy5vYmplY3Qub2JqZWN0SWQpO2lbdF09e2Z1bmN0aW9uOnIsdmFyczpufX19YXdhaXQgZS5wb3N0KCJSdW50aW1lLmNhbGxGdW5jdGlvbk9uIix7ZnVuY3Rpb25EZWNsYXJhdGlvbjpgZnVuY3Rpb24oKSB7IHRoaXMuJHtyfSA9IHRoaXMuJHtyfSB8fCAke0pTT04uc3RyaW5naWZ5KGkpfTsgfWAsc2lsZW50OiEwLG9iamVjdElkOm59KSxhd2FpdCBlLnBvc3QoIlJ1bnRpbWUucmVsZWFzZU9iamVjdCIse29iamVjdElkOm59KX0odCxlLnBhcmFtcykudGhlbigoYXN5bmMoKT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9KSwoYXN5bmMgZT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9KSl9KSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBvPSExIT09dS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6bz8iYWxsIjoidW5jYXVnaHQifSksbyl7Y29uc3QgZT11Lm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO3A9ZnVuY3Rpb24oZSx0LG4pe2xldCBvPTAsaT01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCgpPT57MD09PWE/bz5lJiYoaSo9MixuKGkpLGk+ODY0MDAmJihpPTg2NDAwKSxhPWkpOihhLT0xLDA9PT1hJiZ0KCkpLG89MH0pLDFlMykudW5yZWYoKSwoKT0+e28rPTF9fShlLChhc3luYygpPT57bCgiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9KSwoYXN5bmMgZT0+e2woYFJhdGUtbGltaXQgZXhjZWVkZWQuIERpc2FibGluZyBjYXB0dXJpbmcgb2YgY2F1Z2h0IGV4Y2VwdGlvbnMgZm9yICR7ZX0gc2Vjb25kcy5gKSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6InVuY2F1Z2h0In0pfSkpfX0pKCkuY2F0Y2goKGU9PntsKCJGYWlsZWQgdG8gc3RhcnQgZGVidWdnZXIiLGUpfSkpLHNldEludGVydmFsKCgoKT0+e30pLDFlNCk7'; +const debug = __nccwpck_require__(10992); +const common = __nccwpck_require__(97988); +const base64WorkerScript = "LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjcxLjAgKDlmY2IwNjMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs="; function log(...args) { - core.logger.log('[LocalVariables]', ...args); + core.debug.log("[LocalVariables]", ...args); } - -/** - * Adds local variables to exception frames - */ -const localVariablesAsyncIntegration = core.defineIntegration((( - integrationOptions = {}, -) => { - function addLocalVariablesToException(exception, localVariables) { - // Filter out frames where the function name is `new Promise` since these are in the error.stack frames - // but do not appear in the debugger call frames - const frames = (_optionalChain([exception, 'access', _ => _.stacktrace, 'optionalAccess', _2 => _2.frames]) || []).filter(frame => frame.function !== 'new Promise'); - +const localVariablesAsyncIntegration = core.defineIntegration(((integrationOptions = {}) => { + function addLocalVariablesToException(exception, localVariables, behavior) { + if (behavior === false) { + return; + } + const frames = (exception.stacktrace?.frames || []).filter((frame) => frame.function !== "new Promise"); for (let i = 0; i < frames.length; i++) { - // Sentry frames are in reverse order const frameIndex = frames.length - i - 1; - const frameLocalVariables = localVariables[i]; const frame = frames[frameIndex]; - if (!frame || !frameLocalVariables) { - // Drop out if we run out of frames to match up break; } - if ( // We need to have vars to add - frameLocalVariables.vars === undefined || - // We're not interested in frames that are not in_app because the vars are not relevant - frame.in_app === false || - // The function names need to match + frameLocalVariables.vars === void 0 || // Only skip out-of-app frames if includeOutOfAppFrames is not true + frame.in_app === false && integrationOptions.includeOutOfAppFrames !== true || // The function names need to match !common.functionNamesMatch(frame.function, frameLocalVariables.function) ) { continue; } - - frame.vars = frameLocalVariables.vars; + frame.vars = common.filterFrameVariables(frameLocalVariables.vars, behavior); } } - function addLocalVariablesToEvent(event, hint) { - if ( - hint.originalException && - typeof hint.originalException === 'object' && - common.LOCAL_VARIABLES_KEY in hint.originalException && - Array.isArray(hint.originalException[common.LOCAL_VARIABLES_KEY]) - ) { - for (const exception of _optionalChain([event, 'access', _3 => _3.exception, 'optionalAccess', _4 => _4.values]) || []) { - addLocalVariablesToException(exception, hint.originalException[common.LOCAL_VARIABLES_KEY]); + if (hint.originalException && typeof hint.originalException === "object" && common.LOCAL_VARIABLES_KEY in hint.originalException && Array.isArray(hint.originalException[common.LOCAL_VARIABLES_KEY])) { + const behavior = core.getClient()?.getDataCollectionOptions().stackFrameVariables ?? true; + for (const exception of event.exception?.values || []) { + addLocalVariablesToException(exception, hint.originalException[common.LOCAL_VARIABLES_KEY], behavior); } - - hint.originalException[common.LOCAL_VARIABLES_KEY] = undefined; + hint.originalException[common.LOCAL_VARIABLES_KEY] = void 0; } - return event; } - async function startInspector() { - // We load inspector dynamically because on some platforms Node is built without inspector support const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); if (!inspector.url()) { inspector.open(0); } } - function startWorker(options) { const worker = new node_worker_threads.Worker(new URL(`data:application/javascript;base64,${base64WorkerScript}`), { workerData: options, // We don't want any Node args to be passed to the worker execArgv: [], - env: { ...process.env, NODE_OPTIONS: undefined }, + env: { ...process.env, NODE_OPTIONS: void 0 } }); - - process.on('exit', () => { - // eslint-disable-next-line @typescript-eslint/no-floating-promises + process.on("exit", () => { worker.terminate(); }); - - worker.once('error', (err) => { - log('Worker error', err); + worker.once("error", (err) => { + log("Worker error", err); }); - - worker.once('exit', (code) => { - log('Worker exit', code); + worker.once("exit", (code) => { + log("Worker exit", code); }); - - // Ensure this thread can't block app exit worker.unref(); } - return { - name: 'LocalVariablesAsync', + name: "LocalVariablesAsync", async setup(client) { const clientOptions = client.getOptions(); - if (!clientOptions.includeLocalVariables) { return; } - if (await debug.isDebuggerEnabled()) { - core.logger.warn('Local variables capture has been disabled because the debugger was already enabled'); + core.debug.warn("Local variables capture has been disabled because the debugger was already enabled"); return; } - const options = { ...integrationOptions, - debug: core.logger.isEnabled(), + debug: core.debug.isEnabled() }; - startInspector().then( () => { try { startWorker(options); } catch (e) { - core.logger.error('Failed to start worker', e); + core.debug.error("Failed to start worker", e); } }, - e => { - core.logger.error('Failed to start inspector', e); - }, + (e) => { + core.debug.error("Failed to start inspector", e); + } ); }, processEvent(event, hint) { return addLocalVariablesToEvent(event, hint); - }, + } }; -}) ); +})); exports.base64WorkerScript = base64WorkerScript; exports.localVariablesAsyncIntegration = localVariablesAsyncIntegration; @@ -85437,47 +43519,30 @@ exports.localVariablesAsyncIntegration = localVariablesAsyncIntegration; /***/ }), -/***/ 58079: +/***/ 82866: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const nodeVersion = __nccwpck_require__(88196); -const debug = __nccwpck_require__(75915); -const common = __nccwpck_require__(58108); +const nodeVersion = __nccwpck_require__(61523); +const debug = __nccwpck_require__(10992); +const common = __nccwpck_require__(97988); -/** Creates a unique hash from stack frames */ function hashFrames(frames) { - if (frames === undefined) { + if (frames === void 0) { return; } - - // Only hash the 10 most recent frames (ie. the last 10) - return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, ''); + return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, ""); } - -/** - * We use the stack parser to create a unique hash from the exception stack trace - * This is used to lookup vars when the exception passes through the event processor - */ function hashFromStack(stackParser, stack) { - if (stack === undefined) { - return undefined; + if (stack === void 0) { + return void 0; } - return hashFrames(stackParser(stack, 1)); } - -/** Creates a container for callbacks to be called sequentially */ function createCallbackList(complete) { - // A collection of callbacks to be executed last to first let callbacks = []; - let completedCalled = false; function checkedComplete(result) { callbacks = []; @@ -85487,101 +43552,73 @@ function createCallbackList(complete) { completedCalled = true; complete(result); } - - // complete should be called last callbacks.push(checkedComplete); - function add(fn) { callbacks.push(fn); } - function next(result) { const popped = callbacks.pop() || checkedComplete; - try { popped(result); - } catch (_) { - // If there is an error, we still want to call the complete callback + } catch { checkedComplete(result); } } - return { add, next }; } - -/** - * Promise API is available as `Experimental` and in Node 19 only. - * - * Callback-based API is `Stable` since v14 and `Experimental` since v8. - * Because of that, we are creating our own `AsyncSession` class. - * - * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api - * https://nodejs.org/docs/latest-v14.x/api/inspector.html - */ -class AsyncSession { +class AsyncSession { /** Throws if inspector API is not available */ - constructor( _session) {this._session = _session; - // + constructor(_session) { + this._session = _session; } - - static async create(orDefault) { + static async create(orDefault) { if (orDefault) { return orDefault; } - const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); return new AsyncSession(new inspector.Session()); } - /** @inheritdoc */ - configureAndConnect(onPause, captureAll) { + configureAndConnect(onPause, captureAll) { this._session.connect(); - - this._session.on('Debugger.paused', event => { + this._session.on("Debugger.paused", (event) => { onPause(event, () => { - // After the pause work is complete, resume execution or the exception context memory is leaked - this._session.post('Debugger.resume'); + this._session.post("Debugger.resume"); }); }); - - this._session.post('Debugger.enable'); - this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' }); + this._session.post("Debugger.enable"); + this._session.post("Debugger.setPauseOnExceptions", { state: captureAll ? "all" : "uncaught" }); } - - setPauseOnExceptions(captureAll) { - this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' }); + setPauseOnExceptions(captureAll) { + this._session.post("Debugger.setPauseOnExceptions", { state: captureAll ? "all" : "uncaught" }); } - /** @inheritdoc */ - getLocalVariables(objectId, complete) { - this._getProperties(objectId, props => { + getLocalVariables(objectId, complete) { + this._getProperties(objectId, (props) => { const { add, next } = createCallbackList(complete); - for (const prop of props) { - if (_optionalChain([prop, 'optionalAccess', _2 => _2.value, 'optionalAccess', _3 => _3.objectId]) && _optionalChain([prop, 'optionalAccess', _4 => _4.value, 'access', _5 => _5.className]) === 'Array') { + if (prop.value?.objectId && prop.value.className === "Array") { const id = prop.value.objectId; - add(vars => this._unrollArray(id, prop.name, vars, next)); - } else if (_optionalChain([prop, 'optionalAccess', _6 => _6.value, 'optionalAccess', _7 => _7.objectId]) && _optionalChain([prop, 'optionalAccess', _8 => _8.value, 'optionalAccess', _9 => _9.className]) === 'Object') { + add((vars) => this._unrollArray(id, prop.name, vars, next)); + } else if (prop.value?.objectId && prop.value.className === "Object") { const id = prop.value.objectId; - add(vars => this._unrollObject(id, prop.name, vars, next)); - } else if (_optionalChain([prop, 'optionalAccess', _10 => _10.value])) { - add(vars => this._unrollOther(prop, vars, next)); + add((vars) => this._unrollObject(id, prop.name, vars, next)); + } else if (prop.value) { + add((vars) => this._unrollOther(prop, vars, next)); } } - next({}); }); } - /** * Gets all the PropertyDescriptors of an object */ - _getProperties(objectId, next) { + _getProperties(objectId, next) { this._session.post( - 'Runtime.getProperties', + "Runtime.getProperties", { objectId, - ownProperties: true, + ownProperties: true }, (err, params) => { if (err) { @@ -85589,249 +43626,179 @@ class AsyncSession { } else { next(params.result); } - }, + } ); } - /** * Unrolls an array property */ - _unrollArray(objectId, name, vars, next) { - this._getProperties(objectId, props => { - vars[name] = props - .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10))) - .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10)) - .map(v => _optionalChain([v, 'optionalAccess', _11 => _11.value, 'optionalAccess', _12 => _12.value])); - + _unrollArray(objectId, name, vars, next) { + this._getProperties(objectId, (props) => { + vars[name] = props.filter((v) => v.name !== "length" && !isNaN(parseInt(v.name, 10))).sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10)).map((v) => v.value?.value); next(vars); }); } - /** * Unrolls an object property */ - _unrollObject(objectId, name, vars, next) { - this._getProperties(objectId, props => { - vars[name] = props - .map(v => [v.name, _optionalChain([v, 'optionalAccess', _13 => _13.value, 'optionalAccess', _14 => _14.value])]) - .reduce((obj, [key, val]) => { - obj[key] = val; - return obj; - }, {} ); - + _unrollObject(objectId, name, vars, next) { + this._getProperties(objectId, (props) => { + vars[name] = props.map((v) => [v.name, v.value?.value]).reduce((obj, [key, val]) => { + obj[key] = val; + return obj; + }, {}); next(vars); }); } - /** * Unrolls other properties */ - _unrollOther(prop, vars, next) { + _unrollOther(prop, vars, next) { if (prop.value) { - if ('value' in prop.value) { - if (prop.value.value === undefined || prop.value.value === null) { + if ("value" in prop.value) { + if (prop.value.value === void 0 || prop.value.value === null) { vars[prop.name] = `<${prop.value.value}>`; } else { vars[prop.name] = prop.value.value; } - } else if ('description' in prop.value && prop.value.type !== 'function') { + } else if ("description" in prop.value && prop.value.type !== "function") { vars[prop.name] = `<${prop.value.description}>`; - } else if (prop.value.type === 'undefined') { - vars[prop.name] = ''; + } else if (prop.value.type === "undefined") { + vars[prop.name] = ""; } } - next(vars); } } - -const INTEGRATION_NAME = 'LocalVariables'; - -/** - * Adds local variables to exception frames - */ -const _localVariablesSyncIntegration = (( - options = {}, - sessionOverride, -) => { +const INTEGRATION_NAME = "LocalVariables"; +const _localVariablesSyncIntegration = ((options = {}, sessionOverride) => { const cachedFrames = new core.LRUMap(20); let rateLimiter; let shouldProcessEvent = false; - - function addLocalVariablesToException(exception) { - const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _15 => _15.stacktrace, 'optionalAccess', _16 => _16.frames])); - - if (hash === undefined) { + function addLocalVariablesToException(exception, behavior) { + const hash = hashFrames(exception.stacktrace?.frames); + if (hash === void 0) { return; } - - // Check if we have local variables for an exception that matches the hash - // remove is identical to get but also removes the entry from the cache const cachedFrame = cachedFrames.remove(hash); - - if (cachedFrame === undefined) { + if (cachedFrame === void 0 || behavior === false) { return; } - - // Filter out frames where the function name is `new Promise` since these are in the error.stack frames - // but do not appear in the debugger call frames - const frames = (_optionalChain([exception, 'access', _17 => _17.stacktrace, 'optionalAccess', _18 => _18.frames]) || []).filter(frame => frame.function !== 'new Promise'); - + const frames = (exception.stacktrace?.frames || []).filter((frame) => frame.function !== "new Promise"); for (let i = 0; i < frames.length; i++) { - // Sentry frames are in reverse order const frameIndex = frames.length - i - 1; - const cachedFrameVariable = cachedFrame[i]; const frameVariable = frames[frameIndex]; - - // Drop out if we run out of frames to match up if (!frameVariable || !cachedFrameVariable) { break; } - if ( // We need to have vars to add - cachedFrameVariable.vars === undefined || - // We're not interested in frames that are not in_app because the vars are not relevant - frameVariable.in_app === false || - // The function names need to match + cachedFrameVariable.vars === void 0 || // Only skip out-of-app frames if includeOutOfAppFrames is not true + frameVariable.in_app === false && options.includeOutOfAppFrames !== true || // The function names need to match !common.functionNamesMatch(frameVariable.function, cachedFrameVariable.function) ) { continue; } - - frameVariable.vars = cachedFrameVariable.vars; + frameVariable.vars = common.filterFrameVariables(cachedFrameVariable.vars, behavior); } } - function addLocalVariablesToEvent(event) { - for (const exception of _optionalChain([event, 'optionalAccess', _19 => _19.exception, 'optionalAccess', _20 => _20.values]) || []) { - addLocalVariablesToException(exception); + for (const exception of event.exception?.values || []) { + addLocalVariablesToException(exception, core.getClient()?.getDataCollectionOptions().stackFrameVariables ?? true); } - return event; } - - return { - name: INTEGRATION_NAME, - async setupOnce() { - const client = core.getClient(); - const clientOptions = _optionalChain([client, 'optionalAccess', _21 => _21.getOptions, 'call', _22 => _22()]); - - if (!_optionalChain([clientOptions, 'optionalAccess', _23 => _23.includeLocalVariables])) { - return; - } - - // Only setup this integration if the Node version is >= v18 - // https://github.com/getsentry/sentry-javascript/issues/7697 - const unsupportedNodeVersion = nodeVersion.NODE_MAJOR < 18; - - if (unsupportedNodeVersion) { - core.logger.log('The `LocalVariables` integration is only supported on Node >= v18.'); - return; - } - - if (await debug.isDebuggerEnabled()) { - core.logger.warn('Local variables capture has been disabled because the debugger was already enabled'); - return; - } - - AsyncSession.create(sessionOverride).then( - session => { - function handlePaused( - stackParser, - { params: { reason, data, callFrames } }, - complete, - ) { - if (reason !== 'exception' && reason !== 'promiseRejection') { - complete(); - return; - } - - _optionalChain([rateLimiter, 'optionalCall', _24 => _24()]); - - // data.description contains the original error.stack - const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _25 => _25.description])); - - if (exceptionHash == undefined) { - complete(); - return; - } - - const { add, next } = createCallbackList(frames => { - cachedFrames.set(exceptionHash, frames); - complete(); + let setupPromise; + async function setup() { + const client = core.getClient(); + const clientOptions = client?.getOptions(); + if (!clientOptions?.includeLocalVariables) { + return; + } + const unsupportedNodeVersion = nodeVersion.NODE_MAJOR < 18; + if (unsupportedNodeVersion) { + core.debug.log("The `LocalVariables` integration is only supported on Node >= v18."); + return; + } + if (await debug.isDebuggerEnabled()) { + core.debug.warn("Local variables capture has been disabled because the debugger was already enabled"); + return; + } + try { + const session = await AsyncSession.create(sessionOverride); + const handlePaused = (stackParser, { params: { reason, data, callFrames } }, complete) => { + if (reason !== "exception" && reason !== "promiseRejection") { + complete(); + return; + } + rateLimiter?.(); + const exceptionHash = hashFromStack(stackParser, data.description); + if (exceptionHash == void 0) { + complete(); + return; + } + const { add, next } = createCallbackList((frames) => { + cachedFrames.set(exceptionHash, frames); + complete(); + }); + for (let i = 0; i < Math.min(callFrames.length, 5); i++) { + const { scopeChain, functionName, this: obj } = callFrames[i]; + const localScope = scopeChain.find((scope) => scope.type === "local"); + const fn = obj.className === "global" || !obj.className ? functionName : `${obj.className}.${functionName}`; + if (localScope?.object.objectId === void 0) { + add((frames) => { + frames[i] = { function: fn }; + next(frames); }); - - // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack - // For this reason we only attempt to get local variables for the first 5 frames - for (let i = 0; i < Math.min(callFrames.length, 5); i++) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const { scopeChain, functionName, this: obj } = callFrames[i]; - - const localScope = scopeChain.find(scope => scope.type === 'local'); - - // obj.className is undefined in ESM modules - const fn = - obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`; - - if (_optionalChain([localScope, 'optionalAccess', _26 => _26.object, 'access', _27 => _27.objectId]) === undefined) { - add(frames => { - frames[i] = { function: fn }; - next(frames); - }); - } else { - const id = localScope.object.objectId; - add(frames => - _optionalChain([session, 'optionalAccess', _28 => _28.getLocalVariables, 'call', _29 => _29(id, vars => { - frames[i] = { function: fn, vars }; - next(frames); - })]), - ); - } - } - - next([]); - } - - const captureAll = options.captureAllExceptions !== false; - - session.configureAndConnect( - (ev, complete) => - handlePaused(clientOptions.stackParser, ev , complete), - captureAll, - ); - - if (captureAll) { - const max = options.maxExceptionsPerSecond || 50; - - rateLimiter = common.createRateLimiter( - max, - () => { - core.logger.log('Local variables rate-limit lifted.'); - _optionalChain([session, 'optionalAccess', _30 => _30.setPauseOnExceptions, 'call', _31 => _31(true)]); - }, - seconds => { - core.logger.log( - `Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${seconds} seconds.`, - ); - _optionalChain([session, 'optionalAccess', _32 => _32.setPauseOnExceptions, 'call', _33 => _33(false)]); - }, + } else { + const id = localScope.object.objectId; + add( + (frames) => session.getLocalVariables(id, (vars) => { + frames[i] = { function: fn, vars }; + next(frames); + }) ); } - - shouldProcessEvent = true; - }, - error => { - core.logger.log('The `LocalVariables` integration failed to start.', error); - }, + } + next([]); + }; + const captureAll = options.captureAllExceptions !== false; + session.configureAndConnect( + (ev, complete) => handlePaused(clientOptions.stackParser, ev, complete), + captureAll ); + if (captureAll) { + const max = options.maxExceptionsPerSecond || 50; + rateLimiter = common.createRateLimiter( + max, + () => { + core.debug.log("Local variables rate-limit lifted."); + session.setPauseOnExceptions(true); + }, + (seconds) => { + core.debug.log( + `Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${seconds} seconds.` + ); + session.setPauseOnExceptions(false); + } + ); + } + shouldProcessEvent = true; + } catch (error) { + core.debug.log("The `LocalVariables` integration failed to start.", error); + } + } + return { + name: INTEGRATION_NAME, + setupOnce() { + setupPromise = setup(); }, - processEvent(event) { + async processEvent(event) { + await setupPromise; if (shouldProcessEvent) { return addLocalVariablesToEvent(event); } - return event; }, // These are entirely for testing @@ -85840,13 +43807,9 @@ const _localVariablesSyncIntegration = (( }, _getFirstCachedFrame() { return cachedFrames.values()[0]; - }, + } }; -}) ; - -/** - * Adds local variables to exception frames. - */ +}); const localVariablesSyncIntegration = core.defineIntegration(_localVariablesSyncIntegration); exports.createCallbackList = createCallbackList; @@ -85858,120 +43821,104 @@ exports.localVariablesSyncIntegration = localVariablesSyncIntegration; /***/ }), -/***/ 43791: +/***/ 82516: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_fs = __nccwpck_require__(87561); const node_path = __nccwpck_require__(49411); const core = __nccwpck_require__(84466); -const debugBuild = __nccwpck_require__(8421); -const commonjs = __nccwpck_require__(38743); let moduleCache; - -const INTEGRATION_NAME = 'Modules'; - -const _modulesIntegration = (() => { - // This integration only works in CJS contexts - if (!commonjs.isCjs()) { - debugBuild.DEBUG_BUILD && - core.logger.warn( - 'modulesIntegration only works in CommonJS (CJS) environments. Remove this integration if you are using ESM.', - ); - return { - name: INTEGRATION_NAME, - }; +const INTEGRATION_NAME = "Modules"; +function getServerModules() { + if (typeof __SENTRY_SERVER_MODULES__ !== "undefined") { + return __SENTRY_SERVER_MODULES__; } - + return core.GLOBAL_OBJ.__SENTRY_SERVER_MODULES__ ?? {}; +} +const _modulesIntegration = (() => { return { name: INTEGRATION_NAME, processEvent(event) { event.modules = { ...event.modules, - ..._getModules(), + ..._getModules() }; - return event; }, + getModules: _getModules }; -}) ; - -/** - * Add node modules / packages to the event. - * - * Only works in CommonJS (CJS) environments. - */ -const modulesIntegration = core.defineIntegration(_modulesIntegration); - -/** Extract information about paths */ -function getPaths() { +}); +const modulesIntegration = _modulesIntegration; +function getRequireCachePaths() { try { - return require.cache ? Object.keys(require.cache ) : []; - } catch (e) { + return require.cache ? Object.keys(require.cache) : []; + } catch { return []; } } - -/** Extract information about package.json modules */ -function collectModules() - - { - const mainPaths = (require.main && require.main.paths) || []; - const paths = getPaths(); - const infos - - = {}; - const seen - - = {}; - - paths.forEach(path => { +function collectModules() { + return { + ...getServerModules(), + ...getModulesFromPackageJson(), + ...collectRequireModules() + }; +} +function collectRequireModules() { + const mainPaths = require.main?.paths || []; + const paths = getRequireCachePaths(); + const infos = {}; + const seen = /* @__PURE__ */ new Set(); + paths.forEach((path) => { let dir = path; - - /** Traverse directories upward in the search of package.json file */ const updir = () => { const orig = dir; dir = node_path.dirname(orig); - - if (!dir || orig === dir || seen[orig]) { - return undefined; + if (!dir || orig === dir || seen.has(orig)) { + return void 0; } if (mainPaths.indexOf(dir) < 0) { return updir(); } - - const pkgfile = node_path.join(orig, 'package.json'); - seen[orig] = true; - + const pkgfile = node_path.join(orig, "package.json"); + seen.add(orig); if (!node_fs.existsSync(pkgfile)) { return updir(); } - try { - const info = JSON.parse(node_fs.readFileSync(pkgfile, 'utf8')) - -; + const info = JSON.parse(node_fs.readFileSync(pkgfile, "utf8")); infos[info.name] = info.version; - } catch (_oO) { - // no-empty + } catch { } }; - updir(); }); - return infos; } - -/** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */ function _getModules() { if (!moduleCache) { moduleCache = collectModules(); } return moduleCache; } +function getPackageJson() { + try { + const filePath = node_path.join(process.cwd(), "package.json"); + const packageJson = JSON.parse(node_fs.readFileSync(filePath, "utf8")); + return packageJson; + } catch { + return {}; + } +} +function getModulesFromPackageJson() { + const packageJson = getPackageJson(); + return { + ...packageJson.dependencies, + ...packageJson.devDependencies + }; +} exports.modulesIntegration = modulesIntegration; //# sourceMappingURL=modules.js.map @@ -85979,239 +43926,664 @@ exports.modulesIntegration = modulesIntegration; /***/ }), -/***/ 40839: +/***/ 61611: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const instrumentation = __nccwpck_require__(65584); -const instrumentationUndici = __nccwpck_require__(8076); const core = __nccwpck_require__(84466); -const opentelemetry = __nccwpck_require__(78369); +const diagch = __nccwpck_require__(67643); +const nodeVersion = __nccwpck_require__(61523); +const outgoingFetchRequest = __nccwpck_require__(28847); -const _nativeNodeFetchIntegration = ((options = {}) => { - const _breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs; - const _ignoreOutgoingRequests = options.ignoreOutgoingRequests; - - return { - name: 'NodeFetch', - setupOnce() { - const propagationDecisionMap = new core.LRUMap(100); - - const instrumentation$1 = new instrumentationUndici.UndiciInstrumentation({ - requireParentforSpans: false, - ignoreRequestHook: request => { - const url = getAbsoluteUrl(request.origin, request.path); - const shouldIgnore = _ignoreOutgoingRequests && url && _ignoreOutgoingRequests(url); - - if (shouldIgnore) { - return true; - } - - // If tracing is disabled, we still want to propagate traces - // So we do that manually here, matching what the instrumentation does otherwise - if (!core.hasTracingEnabled()) { - const tracePropagationTargets = _optionalChain([core.getClient, 'call', _2 => _2(), 'optionalAccess', _3 => _3.getOptions, 'call', _4 => _4(), 'access', _5 => _5.tracePropagationTargets]); - const addedHeaders = opentelemetry.shouldPropagateTraceForUrl(url, tracePropagationTargets, propagationDecisionMap) - ? core.getTraceData() - : {}; - - const requestHeaders = request.headers; - if (Array.isArray(requestHeaders)) { - Object.entries(addedHeaders).forEach(headers => requestHeaders.push(...headers)); - } else { - request.headers += Object.entries(addedHeaders) - .map(([k, v]) => `${k}: ${v}\r\n`) - .join(''); - } - - // Prevent starting a span for this request - return true; - } - - return false; - }, - startSpanHook: () => { - return { - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.node_fetch', - }; - }, - responseHook: (_, { request, response }) => { - if (_breadcrumbs) { - addRequestBreadcrumb(request, response); - } - }, - }); - - instrumentation.registerInstrumentations({ instrumentations: [instrumentation$1] }); - }, - }; -}) ; - -const nativeNodeFetchIntegration = core.defineIntegration(_nativeNodeFetchIntegration); - -/** Add a breadcrumb for outgoing requests. */ -function addRequestBreadcrumb(request, response) { - const data = getBreadcrumbData(request); - const statusCode = response.statusCode; - const level = core.getBreadcrumbLogLevelFromHttpStatusCode(statusCode); - - core.addBreadcrumb( - { - category: 'http', - data: { - status_code: statusCode, - ...data, - }, - type: 'http', - level, - }, - { - event: 'response', - request, - response, - }, - ); -} - -function getBreadcrumbData(request) { - try { - const url = new URL(request.path, request.origin); - const parsedUrl = core.parseUrl(url.toString()); - - const data = { - url: core.getSanitizedUrlString(parsedUrl), - 'http.method': request.method || 'GET', - }; - - if (parsedUrl.search) { - data['http.query'] = parsedUrl.search; +class SentryNodeFetchInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("@sentry/instrumentation-node-fetch", core.SDK_VERSION, config); + this._channelSubs = []; + this._propagationDecisionMap = new core.LRUMap(100); + this._ignoreOutgoingRequestsMap = /* @__PURE__ */ new WeakMap(); + } + /** No need to instrument files/modules. */ + init() { + return void 0; + } + /** Disable the instrumentation. */ + disable() { + super.disable(); + this._channelSubs.forEach((sub) => sub.unsubscribe()); + this._channelSubs = []; + } + /** Enable the instrumentation. */ + enable() { + super.enable(); + this._channelSubs = this._channelSubs || []; + if (this._channelSubs.length > 0) { + return; } - if (parsedUrl.hash) { - data['http.fragment'] = parsedUrl.hash; + this._subscribeToChannel("undici:request:create", this._onRequestCreated.bind(this)); + this._subscribeToChannel("undici:request:headers", this._onResponseHeaders.bind(this)); + } + /** + * This method is called when a request is created. + * You can still mutate the request here before it is sent. + */ + _onRequestCreated({ request }) { + const config = this.getConfig(); + const enabled = config.enabled !== false; + if (!enabled) { + return; } - - return data; - } catch (e) { - return {}; + const shouldIgnore = this._shouldIgnoreOutgoingRequest(request); + this._ignoreOutgoingRequestsMap.set(request, shouldIgnore); + if (shouldIgnore) { + return; + } + if (config.tracePropagation !== false) { + outgoingFetchRequest.addTracePropagationHeadersToFetchRequest(request, this._propagationDecisionMap); + } + } + /** + * This method is called when a response is received. + */ + _onResponseHeaders({ request, response }) { + const config = this.getConfig(); + const enabled = config.enabled !== false; + if (!enabled) { + return; + } + const _breadcrumbs = config.breadcrumbs; + const breadCrumbsEnabled = typeof _breadcrumbs === "undefined" ? true : _breadcrumbs; + const shouldIgnore = this._ignoreOutgoingRequestsMap.get(request); + if (breadCrumbsEnabled && !shouldIgnore) { + outgoingFetchRequest.addFetchRequestBreadcrumb(request, response); + } + } + /** Subscribe to a diagnostics channel. */ + _subscribeToChannel(diagnosticChannel, onMessage) { + const useNewSubscribe = nodeVersion.NODE_MAJOR > 18 || nodeVersion.NODE_MAJOR === 18 && nodeVersion.NODE_MINOR >= 19; + let unsubscribe; + if (useNewSubscribe) { + diagch.subscribe?.(diagnosticChannel, onMessage); + unsubscribe = () => diagch.unsubscribe?.(diagnosticChannel, onMessage); + } else { + const channel = diagch.channel(diagnosticChannel); + channel.subscribe(onMessage); + unsubscribe = () => channel.unsubscribe(onMessage); + } + this._channelSubs.push({ + name: diagnosticChannel, + unsubscribe + }); + } + /** + * Check if the given outgoing request should be ignored. + */ + _shouldIgnoreOutgoingRequest(request) { + if (core.isTracingSuppressed()) { + return true; + } + const url = outgoingFetchRequest.getAbsoluteUrl(request.origin, request.path); + const ignoreOutgoingRequests = this.getConfig().ignoreOutgoingRequests; + if (typeof ignoreOutgoingRequests !== "function" || !url) { + return false; + } + return ignoreOutgoingRequests(url); } } -// Matching the behavior of the base instrumentation -function getAbsoluteUrl(origin, path = '/') { - const url = `${origin}`; - - if (url.endsWith('/') && path.startsWith('/')) { - return `${url}${path.slice(1)}`; - } - - if (!url.endsWith('/') && !path.startsWith('/')) { - return `${url}/${path.slice(1)}`; - } - - return `${url}${path}`; -} - -exports.nativeNodeFetchIntegration = nativeNodeFetchIntegration; -//# sourceMappingURL=node-fetch.js.map +exports.SentryNodeFetchInstrumentation = SentryNodeFetchInstrumentation; +//# sourceMappingURL=SentryNodeFetchInstrumentation.js.map /***/ }), -/***/ 79100: +/***/ 18285: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const debugBuild = __nccwpck_require__(8421); -const errorhandling = __nccwpck_require__(73380); +const undiciInstrumentation = __nccwpck_require__(84948); -const INTEGRATION_NAME = 'OnUncaughtException'; - -/** - * Add a global exception handler. - */ -const onUncaughtExceptionIntegration = core.defineIntegration((options = {}) => { - const optionsWithDefaults = { - exitEvenIfOtherHandlersAreRegistered: false, - ...options, +const _nativeNodeFetchIntegration = ((options = {}) => { + return { + name: "NodeFetch", + setupOnce() { + undiciInstrumentation.instrumentUndici(options); + } }; +}); +const nativeNodeFetchIntegration = core.defineIntegration(_nativeNodeFetchIntegration); +exports.nativeNodeFetchIntegration = nativeNodeFetchIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 84948: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagch = __nccwpck_require__(67643); +const url = __nccwpck_require__(57310); +const core = __nccwpck_require__(84466); +const outgoingFetchRequest = __nccwpck_require__(28847); +const attributes = __nccwpck_require__(88264); +const debugBuild = __nccwpck_require__(20624); + +const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original"; +const _channelSubs = []; +const spanFromReq = /* @__PURE__ */ new WeakMap(); +const ignoreRequestMap = /* @__PURE__ */ new WeakMap(); +const propagationDecisionMap = new core.LRUMap(100); +function instrumentUndici(config = {}) { + if (_channelSubs.length) { + return; + } + subscribeToChannel("undici:request:create", (message) => onRequestCreated(config, message)); + subscribeToChannel( + "undici:client:sendHeaders", + (message) => onRequestHeaders(config, message) + ); + subscribeToChannel("undici:request:headers", (message) => onResponseHeaders(config, message)); + subscribeToChannel("undici:request:trailers", (message) => onDone(message)); + subscribeToChannel("undici:request:error", (message) => onError(message)); +} +function safeExecute(fn, onError2) { + try { + return fn(); + } catch (error) { + onError2(error); + return void 0; + } +} +function subscribeToChannel(diagnosticChannel, onMessage) { + const [major = 0, minor = 0] = process.version.replace("v", "").split(".").map((n) => Number(n)); + const useNewSubscribe = major > 18 || major === 18 && minor >= 19; + if (useNewSubscribe) { + _channelSubs.push(diagch.subscribe?.(diagnosticChannel, onMessage)); + } else { + _channelSubs.push(diagch.channel(diagnosticChannel).subscribe(onMessage)); + } +} +function parseRequestHeaders(request) { + const result = /* @__PURE__ */ new Map(); + if (Array.isArray(request.headers)) { + for (let i = 0; i < request.headers.length; i += 2) { + const key = request.headers[i]; + const value = request.headers[i + 1]; + if (typeof key === "string" && value !== void 0) { + result.set(key.toLowerCase(), value); + } + } + } else if (typeof request.headers === "string") { + const headers = request.headers.split("\r\n"); + for (const line of headers) { + if (!line) { + continue; + } + const colonIndex = line.indexOf(":"); + if (colonIndex === -1) { + continue; + } + const key = line.substring(0, colonIndex).toLowerCase(); + const value = line.substring(colonIndex + 1).trim(); + const allValues = result.get(key); + if (allValues && Array.isArray(allValues)) { + allValues.push(value); + } else if (allValues) { + result.set(key, [allValues, value]); + } else { + result.set(key, value); + } + } + } + return result; +} +function onRequestCreated(config, { request }) { + const url$1 = getAbsoluteUrl(request.origin, request.path); + const ignoredByCallback = safeExecute( + () => !!config.ignoreOutgoingRequests?.(url$1), + (e) => e && debugBuild.DEBUG_BUILD && core.debug.error("caught ignoreOutgoingRequests error: ", e) + ); + const ignoreForBreadcrumbs = core.isTracingSuppressed() || !!ignoredByCallback; + ignoreRequestMap.set(request, ignoreForBreadcrumbs); + if (!config.spans) { + if (config.tracePropagation !== false && !ignoreForBreadcrumbs) { + outgoingFetchRequest.addTracePropagationHeadersToFetchRequest(request, propagationDecisionMap); + } + return; + } + if (request.method === "CONNECT" || ignoredByCallback) { + return; + } + let requestUrl; + try { + requestUrl = new url.URL(request.path, request.origin); + } catch (err) { + debugBuild.DEBUG_BUILD && core.debug.warn("could not determine url.full:", err); + return; + } + const urlScheme = requestUrl.protocol.replace(":", ""); + const requestMethod = getRequestMethod(request.method); + const attributes$1 = { + [attributes.HTTP_REQUEST_METHOD]: requestMethod, + [ATTR_HTTP_REQUEST_METHOD_ORIGINAL]: request.method, + [attributes.URL_FULL]: requestUrl.toString(), + [attributes.URL_PATH]: requestUrl.pathname, + [attributes.URL_QUERY]: requestUrl.search, + [attributes.URL_SCHEME]: urlScheme, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.node_fetch" + }; + if (url$1.startsWith("data:")) { + const sanitizedUrl = core.stripDataUrlContent(url$1); + attributes$1["http.url"] = sanitizedUrl; + attributes$1[attributes.URL_FULL] = sanitizedUrl; + attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME] = `${request.method || "GET"} ${sanitizedUrl}`; + } + const schemePorts = { https: "443", http: "80" }; + const serverAddress = requestUrl.hostname; + const serverPort = requestUrl.port || schemePorts[urlScheme]; + attributes$1[attributes.SERVER_ADDRESS] = serverAddress; + if (serverPort && !isNaN(Number(serverPort))) { + attributes$1[attributes.SERVER_PORT] = Number(serverPort); + } + const headersMap = parseRequestHeaders(request); + const userAgentValues = headersMap.get("user-agent"); + if (userAgentValues) { + const userAgent = Array.isArray(userAgentValues) ? userAgentValues[userAgentValues.length - 1] : userAgentValues; + attributes$1[attributes.USER_AGENT_ORIGINAL] = userAgent; + } + const client = core.getClient(); + const span = core.startInactiveSpan({ + name: requestMethod === "_OTHER" ? "HTTP" : requestMethod, + kind: core.SPAN_KIND.CLIENT, + attributes: attributes$1, + onlyIfParent: !client || !core.hasSpanStreamingEnabled(client) + }); + safeExecute( + () => config.requestHook?.(span, request), + (e) => e && debugBuild.DEBUG_BUILD && core.debug.error("caught requestHook error: ", e) + ); + outgoingFetchRequest.addTracePropagationHeadersToFetchRequest(request, propagationDecisionMap, span); + spanFromReq.set(request, span); +} +function onRequestHeaders(config, { request, socket }) { + const span = spanFromReq.get(request); + if (!span) { + return; + } + const { remoteAddress, remotePort } = socket; + const spanAttributes = { + [attributes.NETWORK_PEER_ADDRESS]: remoteAddress, + [attributes.NETWORK_PEER_PORT]: remotePort + }; + if (config.headersToSpanAttributes?.requestHeaders) { + const headersToAttribs = new Set(config.headersToSpanAttributes.requestHeaders.map((n) => n.toLowerCase())); + const headersMap = parseRequestHeaders(request); + for (const [name, value] of headersMap.entries()) { + if (headersToAttribs.has(name)) { + const attrValue = Array.isArray(value) ? value : [value]; + spanAttributes[`http.request.header.${name}`] = attrValue; + } + } + } + span.setAttributes(spanAttributes); +} +function onResponseHeaders(config, { request, response }) { + const breadcrumbsEnabled = config.breadcrumbs !== false; + if (breadcrumbsEnabled && !ignoreRequestMap.get(request)) { + outgoingFetchRequest.addFetchRequestBreadcrumb(request, response); + } + const span = spanFromReq.get(request); + if (!span) { + return; + } + const spanAttributes = { + [attributes.HTTP_RESPONSE_STATUS_CODE]: response.statusCode + }; + safeExecute( + () => config.responseHook?.(span, { request, response }), + (e) => e && debugBuild.DEBUG_BUILD && core.debug.error("caught responseHook error: ", e) + ); + if (config.headersToSpanAttributes?.responseHeaders) { + const headersToAttribs = /* @__PURE__ */ new Set(); + config.headersToSpanAttributes?.responseHeaders.forEach((name) => headersToAttribs.add(name.toLowerCase())); + for (let idx = 0; idx < response.headers.length; idx = idx + 2) { + const nameBuf = response.headers[idx]; + const valueBuf = response.headers[idx + 1]; + if (nameBuf === void 0 || valueBuf === void 0) { + continue; + } + const name = nameBuf.toString().toLowerCase(); + const value = valueBuf; + if (headersToAttribs.has(name)) { + const attrName = `http.response.header.${name}`; + if (!Object.prototype.hasOwnProperty.call(spanAttributes, attrName)) { + spanAttributes[attrName] = [value.toString()]; + } else { + spanAttributes[attrName].push(value.toString()); + } + } + } + } + span.setAttributes(spanAttributes); + if (response.statusCode >= 400) { + span.setStatus(core.getSpanStatusFromHttpCode(response.statusCode)); + } +} +function onDone({ request }) { + const span = spanFromReq.get(request); + if (!span) { + return; + } + span.end(); + spanFromReq.delete(request); +} +function onError({ request, error }) { + const span = spanFromReq.get(request); + if (!span) { + return; + } + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: error.message + }); + span.end(); + spanFromReq.delete(request); +} +function getRequestMethod(original) { + const knownMethods = { + CONNECT: true, + OPTIONS: true, + HEAD: true, + GET: true, + POST: true, + PUT: true, + PATCH: true, + DELETE: true, + TRACE: true, + // QUERY from https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/ + QUERY: true + }; + if (original.toUpperCase() in knownMethods) { + return original.toUpperCase(); + } + return "_OTHER"; +} +function getAbsoluteUrl(origin, path = "/") { + const url = `${origin}`; + if (url.endsWith("/") && path.startsWith("/")) { + return `${url}${path.slice(1)}`; + } + if (!url.endsWith("/") && !path.startsWith("/")) { + return `${url}/${path}`; + } + return `${url}${path}`; +} + +exports.instrumentUndici = instrumentUndici; +//# sourceMappingURL=undici-instrumentation.js.map + + +/***/ }), + +/***/ 59087: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const perf_hooks = __nccwpck_require__(4074); +const core = __nccwpck_require__(84466); + +const INTEGRATION_NAME = "NodeRuntimeMetrics"; +const DEFAULT_INTERVAL_MS = 3e4; +const MIN_COLLECTION_INTERVAL_MS = 1e3; +const EVENT_LOOP_DELAY_RESOLUTION_MS = 10; +function _INTERNAL_normalizeCollectionInterval(rawInterval, integrationName, defaultInterval) { + if (!Number.isFinite(rawInterval)) { + console.warn( + `[Sentry] ${integrationName}: collectionIntervalMs (${rawInterval}) is invalid. Using default of ${defaultInterval}ms.` + ); + return defaultInterval; + } + if (rawInterval < MIN_COLLECTION_INTERVAL_MS) { + console.warn( + `[Sentry] ${integrationName}: collectionIntervalMs (${rawInterval}) is below the minimum of ${MIN_COLLECTION_INTERVAL_MS}ms. Using minimum of ${MIN_COLLECTION_INTERVAL_MS}ms.` + ); + return MIN_COLLECTION_INTERVAL_MS; + } + return rawInterval; +} +const nodeRuntimeMetricsIntegration = core.defineIntegration((options = {}) => { + const collectionIntervalMs = _INTERNAL_normalizeCollectionInterval( + options.collectionIntervalMs ?? DEFAULT_INTERVAL_MS, + INTEGRATION_NAME, + DEFAULT_INTERVAL_MS + ); + const collect = { + // Default on + cpuUtilization: true, + memHeapUsed: true, + memHeapTotal: true, + memRss: true, + eventLoopDelayP50: true, + eventLoopDelayP99: true, + eventLoopUtilization: true, + uptime: true, + // Default off + cpuTime: false, + memExternal: false, + eventLoopDelayMin: false, + eventLoopDelayMax: false, + eventLoopDelayMean: false, + eventLoopDelayP90: false, + ...options.collect + }; + const needsEventLoopDelay = collect.eventLoopDelayP99 || collect.eventLoopDelayMin || collect.eventLoopDelayMax || collect.eventLoopDelayMean || collect.eventLoopDelayP50 || collect.eventLoopDelayP90; + const needsCpu = collect.cpuUtilization || collect.cpuTime; + let intervalId; + let prevCpuUsage; + let prevElu; + let prevFlushTime = 0; + let eventLoopDelayHistogram; + const resolutionNs = EVENT_LOOP_DELAY_RESOLUTION_MS * 1e6; + const nsToS = (ns) => Math.max(0, (ns - resolutionNs) / 1e9); + const METRIC_ATTRIBUTES = { attributes: { "sentry.origin": "auto.node.runtime_metrics" } }; + const METRIC_ATTRIBUTES_BYTE = { unit: "byte", attributes: { "sentry.origin": "auto.node.runtime_metrics" } }; + const METRIC_ATTRIBUTES_SECOND = { unit: "second", attributes: { "sentry.origin": "auto.node.runtime_metrics" } }; + function collectMetrics() { + const now = core._INTERNAL_safeDateNow(); + const elapsed = now - prevFlushTime; + if (needsCpu && prevCpuUsage !== void 0) { + const delta = process.cpuUsage(prevCpuUsage); + if (collect.cpuTime) { + core.metrics.gauge("node.runtime.cpu.user", delta.user / 1e6, METRIC_ATTRIBUTES_SECOND); + core.metrics.gauge("node.runtime.cpu.system", delta.system / 1e6, METRIC_ATTRIBUTES_SECOND); + } + if (collect.cpuUtilization && elapsed > 0) { + core.metrics.gauge( + "node.runtime.cpu.utilization", + (delta.user + delta.system) / (elapsed * 1e3), + METRIC_ATTRIBUTES + ); + } + prevCpuUsage = process.cpuUsage(); + } + if (collect.memRss || collect.memHeapUsed || collect.memHeapTotal || collect.memExternal) { + const mem = process.memoryUsage(); + if (collect.memRss) { + core.metrics.gauge("node.runtime.mem.rss", mem.rss, METRIC_ATTRIBUTES_BYTE); + } + if (collect.memHeapUsed) { + core.metrics.gauge("node.runtime.mem.heap_used", mem.heapUsed, METRIC_ATTRIBUTES_BYTE); + } + if (collect.memHeapTotal) { + core.metrics.gauge("node.runtime.mem.heap_total", mem.heapTotal, METRIC_ATTRIBUTES_BYTE); + } + if (collect.memExternal) { + core.metrics.gauge("node.runtime.mem.external", mem.external, METRIC_ATTRIBUTES_BYTE); + core.metrics.gauge("node.runtime.mem.array_buffers", mem.arrayBuffers, METRIC_ATTRIBUTES_BYTE); + } + } + if (needsEventLoopDelay && eventLoopDelayHistogram) { + if (collect.eventLoopDelayMin) { + core.metrics.gauge( + "node.runtime.event_loop.delay.min", + nsToS(eventLoopDelayHistogram.min), + METRIC_ATTRIBUTES_SECOND + ); + } + if (collect.eventLoopDelayMax) { + core.metrics.gauge( + "node.runtime.event_loop.delay.max", + nsToS(eventLoopDelayHistogram.max), + METRIC_ATTRIBUTES_SECOND + ); + } + if (collect.eventLoopDelayMean) { + core.metrics.gauge( + "node.runtime.event_loop.delay.mean", + nsToS(eventLoopDelayHistogram.mean), + METRIC_ATTRIBUTES_SECOND + ); + } + if (collect.eventLoopDelayP50) { + core.metrics.gauge( + "node.runtime.event_loop.delay.p50", + nsToS(eventLoopDelayHistogram.percentile(50)), + METRIC_ATTRIBUTES_SECOND + ); + } + if (collect.eventLoopDelayP90) { + core.metrics.gauge( + "node.runtime.event_loop.delay.p90", + nsToS(eventLoopDelayHistogram.percentile(90)), + METRIC_ATTRIBUTES_SECOND + ); + } + if (collect.eventLoopDelayP99) { + core.metrics.gauge( + "node.runtime.event_loop.delay.p99", + nsToS(eventLoopDelayHistogram.percentile(99)), + METRIC_ATTRIBUTES_SECOND + ); + } + eventLoopDelayHistogram.reset(); + } + if (collect.eventLoopUtilization && prevElu !== void 0) { + const currentElu = perf_hooks.performance.eventLoopUtilization(); + const delta = perf_hooks.performance.eventLoopUtilization(currentElu, prevElu); + core.metrics.gauge("node.runtime.event_loop.utilization", delta.utilization, METRIC_ATTRIBUTES); + prevElu = currentElu; + } + if (collect.uptime && elapsed > 0) { + core.metrics.count("node.runtime.process.uptime", elapsed / 1e3, METRIC_ATTRIBUTES_SECOND); + } + prevFlushTime = now; + } return { name: INTEGRATION_NAME, - setup(client) { - global.process.on('uncaughtException', makeErrorHandler(client, optionsWithDefaults)); - }, + setup() { + if (needsEventLoopDelay) { + eventLoopDelayHistogram?.disable(); + try { + eventLoopDelayHistogram = perf_hooks.monitorEventLoopDelay({ resolution: EVENT_LOOP_DELAY_RESOLUTION_MS }); + eventLoopDelayHistogram.enable(); + } catch { + eventLoopDelayHistogram = void 0; + } + } + if (needsCpu) { + prevCpuUsage = process.cpuUsage(); + } + if (collect.eventLoopUtilization) { + prevElu = perf_hooks.performance.eventLoopUtilization(); + } + prevFlushTime = core._INTERNAL_safeDateNow(); + if (intervalId) { + clearInterval(intervalId); + } + intervalId = core._INTERNAL_safeUnref(setInterval(collectMetrics, collectionIntervalMs)); + } }; }); -/** Exported only for tests */ +exports._INTERNAL_normalizeCollectionInterval = _INTERNAL_normalizeCollectionInterval; +exports.nodeRuntimeMetricsIntegration = nodeRuntimeMetricsIntegration; +//# sourceMappingURL=nodeRuntimeMetrics.js.map + + +/***/ }), + +/***/ 93244: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const worker_threads = __nccwpck_require__(71267); +const debugBuild = __nccwpck_require__(20624); +const errorhandling = __nccwpck_require__(61138); + +const INTEGRATION_NAME = "OnUncaughtException"; +const onUncaughtExceptionIntegration = core.defineIntegration((options = {}) => { + const optionsWithDefaults = { + exitEvenIfOtherHandlersAreRegistered: false, + ...options + }; + return { + name: INTEGRATION_NAME, + setup(client) { + if (!worker_threads.isMainThread) { + return; + } + global.process.on("uncaughtException", makeErrorHandler(client, optionsWithDefaults)); + } + }; +}); function makeErrorHandler(client, options) { - const timeout = 2000; + const timeout = 2e3; let caughtFirstError = false; let caughtSecondError = false; let calledFatalError = false; let firstError; - const clientOptions = client.getOptions(); - return Object.assign( (error) => { let onFatalError = errorhandling.logAndExitProcess; - if (options.onFatalError) { onFatalError = options.onFatalError; } else if (clientOptions.onFatalError) { - onFatalError = clientOptions.onFatalError ; + onFatalError = clientOptions.onFatalError; } - - // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not - // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust - // exit behaviour of the SDK accordingly: - // - If other listeners are attached, do not exit. - // - If the only listener attached is ours, exit. - const userProvidedListenersCount = (global.process.listeners('uncaughtException') ).filter( - listener => { - // There are 3 listeners we ignore: - return ( - // as soon as we're using domains this listener is attached by node itself - listener.name !== 'domainUncaughtExceptionClear' && - // the handler we register for tracing - listener.tag !== 'sentry_tracingErrorCallback' && - // the handler we register in this integration - (listener )._errorHandler !== true - ); - }, - ).length; - + const userProvidedListenersCount = global.process.listeners("uncaughtException").filter((listener) => { + return ( + // as soon as we're using domains this listener is attached by node itself + listener.name !== "domainUncaughtExceptionClear" && // the handler we register in this integration + listener._errorHandler !== true + ); + }).length; const processWouldExit = userProvidedListenersCount === 0; const shouldApplyFatalHandlingLogic = options.exitEvenIfOtherHandlersAreRegistered || processWouldExit; - if (!caughtFirstError) { - // this is the first uncaught error and the ultimate reason for shutting down - // we want to do absolutely everything possible to ensure it gets captured - // also we want to make sure we don't go recursion crazy if more errors happen after this one firstError = error; caughtFirstError = true; - if (core.getClient() === client) { core.captureException(error, { originalException: error, captureContext: { - level: 'fatal', + level: "fatal" }, mechanism: { handled: false, - type: 'onuncaughtexception', - }, + type: "auto.node.onuncaughtexception" + } }); } - if (!calledFatalError && shouldApplyFatalHandlingLogic) { calledFatalError = true; onFatalError(error); @@ -86219,40 +44591,23 @@ function makeErrorHandler(client, options) { } else { if (shouldApplyFatalHandlingLogic) { if (calledFatalError) { - // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down - debugBuild.DEBUG_BUILD && - core.logger.warn( - 'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown', - ); + debugBuild.DEBUG_BUILD && core.debug.warn( + "uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown" + ); errorhandling.logAndExitProcess(error); } else if (!caughtSecondError) { - // two cases for how we can hit this branch: - // - capturing of first error blew up and we just caught the exception from that - // - quit trying to capture, proceed with shutdown - // - a second independent error happened while waiting for first error to capture - // - want to avoid causing premature shutdown before first error capture finishes - // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff - // so let's instead just delay a bit before we proceed with our action here - // in case 1, we just wait a bit unnecessarily but ultimately do the same thing - // in case 2, the delay hopefully made us wait long enough for the capture to finish - // two potential nonideal outcomes: - // nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError - // nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error - // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError) - // we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish caughtSecondError = true; setTimeout(() => { if (!calledFatalError) { - // it was probably case 1, let's treat err as the sendErr and call onFatalError calledFatalError = true; onFatalError(firstError, error); } - }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc + }, timeout); } } } }, - { _errorHandler: true }, + { _errorHandler: true } ); } @@ -86263,87 +44618,96 @@ exports.onUncaughtExceptionIntegration = onUncaughtExceptionIntegration; /***/ }), -/***/ 70694: +/***/ 68319: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const errorhandling = __nccwpck_require__(73380); - -const INTEGRATION_NAME = 'OnUnhandledRejection'; +const errorhandling = __nccwpck_require__(61138); +const INTEGRATION_NAME = "OnUnhandledRejection"; +const DEFAULT_IGNORES = [ + { + name: "AI_NoOutputGeneratedError" + // When stream aborts in Vercel AI SDK V5, Vercel flush() fails with an error + }, + { + name: "AbortError" + // When stream aborts in Vercel AI SDK V6 + } +]; const _onUnhandledRejectionIntegration = ((options = {}) => { - const mode = options.mode || 'warn'; - + const opts = { + mode: options.mode ?? "warn", + ignore: [...DEFAULT_IGNORES, ...options.ignore ?? []] + }; return { name: INTEGRATION_NAME, setup(client) { - global.process.on('unhandledRejection', makeUnhandledPromiseHandler(client, { mode })); - }, + global.process.on("unhandledRejection", makeUnhandledPromiseHandler(client, opts)); + } }; -}) ; - -/** - * Add a global promise rejection handler. - */ +}); const onUnhandledRejectionIntegration = core.defineIntegration(_onUnhandledRejectionIntegration); - -/** - * Send an exception with reason - * @param reason string - * @param promise promise - * - * Exported only for tests. - */ -function makeUnhandledPromiseHandler( - client, - options, -) { - return function sendUnhandledPromise(reason, promise) { +function extractErrorInfo(reason) { + if (!core.isObjectLike(reason)) { + return { name: "", message: String(reason ?? "") }; + } + const errorLike = reason; + const name = typeof errorLike.name === "string" ? errorLike.name : ""; + const message = typeof errorLike.message === "string" ? errorLike.message : String(reason); + return { name, message }; +} +function isMatchingReason(matcher, errorInfo) { + const nameMatches = matcher.name === void 0 || core.isMatchingPattern(errorInfo.name, matcher.name, true); + const messageMatches = matcher.message === void 0 || core.isMatchingPattern(errorInfo.message, matcher.message); + return nameMatches && messageMatches; +} +function matchesIgnore(list, reason) { + const errorInfo = extractErrorInfo(reason); + return list.some((matcher) => isMatchingReason(matcher, errorInfo)); +} +function makeUnhandledPromiseHandler(client, options) { + return function sendUnhandledPromise(reason, _promise) { if (core.getClient() !== client) { return; } - - core.captureException(reason, { - originalException: promise, - captureContext: { - extra: { unhandledPromiseRejection: true }, - }, - mechanism: { - handled: false, - type: 'onunhandledrejection', - }, + if (matchesIgnore(options.ignore ?? [], reason)) { + return; + } + const level = options.mode === "strict" ? "fatal" : "error"; + const activeSpanForError = core.isObjectLike(reason) ? reason._sentry_active_span : void 0; + const activeSpanWrapper = activeSpanForError ? (fn) => core.withActiveSpan(activeSpanForError, fn) : (fn) => fn(); + activeSpanWrapper(() => { + core.captureException(reason, { + originalException: reason, + captureContext: { + extra: { unhandledPromiseRejection: true }, + level + }, + mechanism: { + handled: false, + type: "auto.node.onunhandledrejection" + } + }); }); - - handleRejection(reason, options); + handleRejection(reason, options.mode); }; } - -/** - * Handler for `mode` option - */ -function handleRejection(reason, options) { - // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240 - const rejectionWarning = - 'This error originated either by ' + - 'throwing inside of an async function without a catch block, ' + - 'or by rejecting a promise which was not handled with .catch().' + - ' The promise rejected with the reason:'; - - /* eslint-disable no-console */ - if (options.mode === 'warn') { +function handleRejection(reason, mode) { + const rejectionWarning = "This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:"; + if (mode === "warn") { core.consoleSandbox(() => { console.warn(rejectionWarning); - console.error(reason && typeof reason === 'object' && 'stack' in reason ? reason.stack : reason); + console.error(core.isObjectLike(reason) && "stack" in reason ? reason.stack : reason); }); - } else if (options.mode === 'strict') { + } else if (mode === "strict") { core.consoleSandbox(() => { console.warn(rejectionWarning); }); errorhandling.logAndExitProcess(reason); } - /* eslint-enable no-console */ } exports.makeUnhandledPromiseHandler = makeUnhandledPromiseHandler; @@ -86353,3086 +44717,495 @@ exports.onUnhandledRejectionIntegration = onUnhandledRejectionIntegration; /***/ }), -/***/ 23284: +/***/ 44906: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); + +const SENTRY_TRACK_SYMBOL = /* @__PURE__ */ Symbol("sentry-track-pino-logger"); +function getPinoKey(logger, symbolName, defaultKey) { + const symbols = Object.getOwnPropertySymbols(logger); + const symbolString = `Symbol(${symbolName})`; + for (const sym of symbols) { + if (sym.toString() === symbolString) { + const value = logger[sym]; + return typeof value === "string" ? value : defaultKey; + } + } + return defaultKey; +} +const DEFAULT_OPTIONS = { + error: { levels: [], handled: true }, + log: { levels: ["trace", "debug", "info", "warn", "error", "fatal"] } +}; +function stripIgnoredFields(result) { + const { level, time, pid, hostname, ...rest } = result; + return rest; +} +const _pinoIntegration = core.defineIntegration((userOptions = {}) => { + const options = { + autoInstrument: userOptions.autoInstrument !== false, + error: { ...DEFAULT_OPTIONS.error, ...userOptions.error }, + log: { ...DEFAULT_OPTIONS.log, ...userOptions.log } + }; + function shouldTrackLogger(logger) { + const override = logger[SENTRY_TRACK_SYMBOL]; + return override === "track" || override !== "ignore" && options.autoInstrument; + } + return { + name: "Pino", + setup: (client) => { + const enableLogs = !!client.getOptions().enableLogs; + const integratedChannel = diagnosticsChannel.tracingChannel("pino_asJson"); + function onPinoStart(self, args, result) { + if (!shouldTrackLogger(self)) { + return; + } + const resultObj = stripIgnoredFields(result); + const [captureObj, message, levelNumber] = args; + const level = self?.levels?.labels?.[levelNumber] || "info"; + const messageKey = getPinoKey(self, "pino.messageKey", "msg"); + const logMessage = message || resultObj?.[messageKey] || ""; + if (enableLogs && options.log.levels.includes(level)) { + const attributes = { + ...resultObj, + "sentry.origin": "auto.log.pino", + "pino.logger.level": levelNumber + }; + core._INTERNAL_captureLog({ level, message: logMessage, attributes }); + } + if (options.error.levels.includes(level)) { + const errorKey = getPinoKey(self, "pino.errorKey", "err"); + const pinoContext = {}; + for (const [key, value] of Object.entries(resultObj)) { + if (key !== errorKey && key !== messageKey) { + pinoContext[key] = value; + } + } + if (logMessage) { + pinoContext[messageKey] = logMessage; + } + const captureContext = { + level: core.severityLevelFromString(level), + contexts: { pino: pinoContext } + }; + core.withScope((scope) => { + scope.addEventProcessor((event) => { + event.logger = "pino"; + core.addExceptionMechanism(event, { + handled: options.error.handled, + type: "auto.log.pino" + }); + return event; + }); + const error = captureObj[errorKey]; + if (error) { + core.captureException(error, captureContext); + return; + } + core.captureMessage(logMessage, captureContext); + }); + } + } + integratedChannel.end.subscribe((data) => { + const { + instance, + arguments: args, + result + } = data; + onPinoStart(instance, args, JSON.parse(result)); + }); + } + }; +}); +const pinoIntegration = Object.assign(_pinoIntegration, { + trackLogger(logger) { + if (core.isObjectLike(logger) && "levels" in logger) { + logger[SENTRY_TRACK_SYMBOL] = "track"; + } + }, + untrackLogger(logger) { + if (core.isObjectLike(logger) && "levels" in logger) { + logger[SENTRY_TRACK_SYMBOL] = "ignore"; + } + } +}); + +exports.pinoIntegration = pinoIntegration; +//# sourceMappingURL=pino.js.map + + +/***/ }), + +/***/ 80397: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +const INTEGRATION_NAME = "ProcessSession"; +const processSessionIntegration = core.defineIntegration(() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + core.startSession(); + process.on("beforeExit", () => { + const session = core.getIsolationScope().getSession(); + if (session?.status !== "ok") { + core.endSession(); + } + }); + } + }; +}); + +exports.processSessionIntegration = processSessionIntegration; +//# sourceMappingURL=processSession.js.map + + +/***/ }), + +/***/ 27254: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const http = __nccwpck_require__(88849); const core = __nccwpck_require__(84466); -const INTEGRATION_NAME = 'Spotlight'; - +const INTEGRATION_NAME = "Spotlight"; const _spotlightIntegration = ((options = {}) => { const _options = { - sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream', + sidecarUrl: options.sidecarUrl || "http://localhost:8969/stream" }; - return { name: INTEGRATION_NAME, setup(client) { - if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') { - core.logger.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?"); + try { + if (process.env.NODE_ENV && process.env.NODE_ENV !== "development") { + core.debug.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?"); + } + } catch { } connectToSpotlight(client, _options); - }, + } }; -}) ; - -/** - * Use this integration to send errors and transactions to Spotlight. - * - * Learn more about spotlight at https://spotlightjs.com - * - * Important: This integration only works with Node 18 or newer. - */ +}); const spotlightIntegration = core.defineIntegration(_spotlightIntegration); - function connectToSpotlight(client, options) { const spotlightUrl = parseSidecarUrl(options.sidecarUrl); if (!spotlightUrl) { return; } - let failedRequests = 0; - - client.on('beforeEnvelope', (envelope) => { + client.on("beforeEnvelope", (envelope) => { if (failedRequests > 3) { - core.logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests'); + core.debug.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests"); return; } - const serializedEnvelope = core.serializeEnvelope(envelope); - - const request = getNativeHttpRequest(); - const req = request( - { - method: 'POST', - path: spotlightUrl.pathname, - hostname: spotlightUrl.hostname, - port: spotlightUrl.port, - headers: { - 'Content-Type': 'application/x-sentry-envelope', + core.suppressTracing(() => { + const req = http.request( + { + method: "POST", + path: spotlightUrl.pathname, + hostname: spotlightUrl.hostname, + port: spotlightUrl.port, + headers: { + "Content-Type": "application/x-sentry-envelope" + } }, - }, - res => { - if (res.statusCode && res.statusCode >= 200 && res.statusCode < 400) { - // Reset failed requests counter on success - failedRequests = 0; + (res) => { + if (res.statusCode && res.statusCode >= 200 && res.statusCode < 400) { + failedRequests = 0; + } + res.on("data", () => { + }); + res.on("end", () => { + }); + res.setEncoding("utf8"); } - res.on('data', () => { - // Drain socket - }); - - res.on('end', () => { - // Drain socket - }); - res.setEncoding('utf8'); - }, - ); - - req.on('error', () => { - failedRequests++; - core.logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar'); + ); + req.on("error", () => { + failedRequests++; + core.debug.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar"); + }); + req.write(serializedEnvelope); + req.end(); }); - req.write(serializedEnvelope); - req.end(); }); } - function parseSidecarUrl(url) { try { return new URL(`${url}`); - } catch (e) { - core.logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`); - return undefined; + } catch { + core.debug.warn(`[Spotlight] Invalid sidecar URL: ${url}`); + return void 0; } } -/** - * We want to get an unpatched http request implementation to avoid capturing our own calls. - */ -function getNativeHttpRequest() { - const { request } = http; - if (isWrapped(request)) { - return request.__sentry_original__; - } - - return request; -} - -function isWrapped(impl) { - return '__sentry_original__' in impl; -} - exports.INTEGRATION_NAME = INTEGRATION_NAME; -exports.getNativeHttpRequest = getNativeHttpRequest; exports.spotlightIntegration = spotlightIntegration; //# sourceMappingURL=spotlight.js.map /***/ }), -/***/ 40782: +/***/ 8651: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const instrumentationAmqplib = __nccwpck_require__(46524); +const util = __nccwpck_require__(47261); const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); -const INTEGRATION_NAME = 'Amqplib'; - -const config = { - consumeEndHook: (span) => { - addOriginToSpan.addOriginToSpan(span, 'auto.amqplib.otel.consumer'); - }, - publishHook: (span) => { - addOriginToSpan.addOriginToSpan(span, 'auto.amqplib.otel.publisher'); - }, -}; - -const instrumentAmqplib = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationAmqplib.AmqplibInstrumentation(config)); - -const _amqplibIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentAmqplib(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [amqplib](https://www.npmjs.com/package/amqplib) library. - * - * For more information, see the [`amqplibIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/amqplib/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.amqplibIntegration()], - * }); - * ``` - */ -const amqplibIntegration = core.defineIntegration(_amqplibIntegration); - -exports.amqplibIntegration = amqplibIntegration; -exports.instrumentAmqplib = instrumentAmqplib; -//# sourceMappingURL=amqplib.js.map - - -/***/ }), - -/***/ 56711: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationConnect = __nccwpck_require__(20575); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const ensureIsWrapped = __nccwpck_require__(90556); - -const INTEGRATION_NAME = 'Connect'; - -const instrumentConnect = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationConnect.ConnectInstrumentation()); - -const _connectIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentConnect(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for [Connect](https://github.com/senchalabs/connect/). - * - * If you also want to capture errors, you need to call `setupConnectErrorHandler(app)` after you initialize your connect app. - * - * For more information, see the [connect documentation](https://docs.sentry.io/platforms/javascript/guides/connect/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.connectIntegration()], - * }) - * ``` - */ -const connectIntegration = core.defineIntegration(_connectIntegration); - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function connectErrorMiddleware(err, req, res, next) { - core.captureException(err); - next(err); +const INTEGRATION_NAME = "NodeSystemError"; +function isSystemError(error) { + if (!(error instanceof Error)) { + return false; + } + if (!("errno" in error) || typeof error.errno !== "number") { + return false; + } + if (typeof util.getSystemErrorMap !== "function") { + return false; + } + return util.getSystemErrorMap().has(error.errno); } - -/** - * Add a Connect middleware to capture errors to Sentry. - * - * @param app The Connect app to attach the error handler to - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * const connect = require("connect"); - * - * const app = connect(); - * - * Sentry.setupConnectErrorHandler(app); - * - * // Add you connect routes here - * - * app.listen(3000); - * ``` - */ -const setupConnectErrorHandler = (app) => { - app.use(connectErrorMiddleware); - - // Sadly, ConnectInstrumentation has no requestHook, so we need to add the attributes here - // We register this hook in this method, because if we register it in the integration `setup`, - // it would always run even for users that are not even using connect - const client = core.getClient(); - if (client) { - client.on('spanStart', span => { - addConnectSpanAttributes(span); - }); - } - - ensureIsWrapped.ensureIsWrapped(app.use, 'connect'); -}; - -function addConnectSpanAttributes(span) { - const attributes = core.spanToJSON(span).data || {}; - - // this is one of: middleware, request_handler - const type = attributes['connect.type']; - - // If this is already set, or we have no connect span, no need to process again... - if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { - return; - } - - span.setAttributes({ - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.connect', - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.connect`, - }); - - // Also update the name, we don't need to "middleware - " prefix - const name = attributes['connect.name']; - if (typeof name === 'string') { - span.updateName(name); - } -} - -exports.connectIntegration = connectIntegration; -exports.instrumentConnect = instrumentConnect; -exports.setupConnectErrorHandler = setupConnectErrorHandler; -//# sourceMappingURL=connect.js.map - - -/***/ }), - -/***/ 83491: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationDataloader = __nccwpck_require__(20698); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); - -const INTEGRATION_NAME = 'Dataloader'; - -const instrumentDataloader = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationDataloader.DataloaderInstrumentation({ - requireParentSpan: true, - }), -); - -const _dataloaderIntegration = (() => { +const systemErrorIntegration = core.defineIntegration((options = {}) => { return { name: INTEGRATION_NAME, - setupOnce() { - instrumentDataloader(); - }, - - setup(client) { - client.on('spanStart', span => { - const spanJSON = core.spanToJSON(span); - if (_optionalChain([spanJSON, 'access', _ => _.description, 'optionalAccess', _2 => _2.startsWith, 'call', _3 => _3('dataloader')])) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.dataloader'); - } - - // These are all possible dataloader span descriptions - // Still checking for the future versions - // in case they add support for `clear` and `prime` - if ( - spanJSON.description === 'dataloader.load' || - spanJSON.description === 'dataloader.loadMany' || - spanJSON.description === 'dataloader.batch' - ) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'cache.get'); - // TODO: We can try adding `key` to the `data` attribute upstream. - // Or alternatively, we can add `requestHook` to the dataloader instrumentation. - } - }); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [dataloader](https://www.npmjs.com/package/dataloader) library. - * - * For more information, see the [`dataloaderIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/dataloader/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.dataloaderIntegration()], - * }); - * ``` - */ -const dataloaderIntegration = core.defineIntegration(_dataloaderIntegration); - -exports.dataloaderIntegration = dataloaderIntegration; -exports.instrumentDataloader = instrumentDataloader; -//# sourceMappingURL=dataloader.js.map - - -/***/ }), - -/***/ 89660: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationExpress = __nccwpck_require__(82267); -const core = __nccwpck_require__(84466); -const debugBuild = __nccwpck_require__(8421); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); -const ensureIsWrapped = __nccwpck_require__(90556); - -const INTEGRATION_NAME = 'Express'; - -const instrumentExpress = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationExpress.ExpressInstrumentation({ - requestHook(span) { - addOriginToSpan.addOriginToSpan(span, 'auto.http.otel.express'); - - const attributes = core.spanToJSON(span).data || {}; - // this is one of: middleware, request_handler, router - const type = attributes['express.type']; - - if (type) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.express`); - } - - // Also update the name, we don't need to "middleware - " prefix - const name = attributes['express.name']; - if (typeof name === 'string') { - span.updateName(name); - } - }, - spanNameHook(info, defaultName) { - if (core.getIsolationScope() === core.getDefaultIsolationScope()) { - debugBuild.DEBUG_BUILD && - core.logger.warn('Isolation scope is still default isolation scope - skipping setting transactionName'); - return defaultName; - } - if (info.layerType === 'request_handler') { - // type cast b/c Otel unfortunately types info.request as any :( - const req = info.request ; - const method = req.method ? req.method.toUpperCase() : 'GET'; - core.getIsolationScope().setTransactionName(`${method} ${info.route}`); - } - return defaultName; - }, - }), -); - -const _expressIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentExpress(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for [Express](https://expressjs.com/). - * - * If you also want to capture errors, you need to call `setupExpressErrorHandler(app)` after you set up your Express server. - * - * For more information, see the [express documentation](https://docs.sentry.io/platforms/javascript/guides/express/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.expressIntegration()], - * }) - * ``` - */ -const expressIntegration = core.defineIntegration(_expressIntegration); - -/** - * An Express-compatible error handler. - */ -function expressErrorHandler(options) { - return function sentryErrorMiddleware( - error, - request, - res, - next, - ) { - // Ensure we use the express-enhanced request here, instead of the plain HTTP one - // When an error happens, the `expressRequestHandler` middleware does not run, so we set it here too - core.getIsolationScope().setSDKProcessingMetadata({ request }); - - const shouldHandleError = _optionalChain([options, 'optionalAccess', _ => _.shouldHandleError]) || defaultShouldHandleError; - - if (shouldHandleError(error)) { - const client = core.getClient(); - // eslint-disable-next-line deprecation/deprecation - if (client && client.getOptions().autoSessionTracking) { - // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the - // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only - // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be - // running in SessionAggregates mode - const isSessionAggregatesMode = client['_sessionFlusher'] !== undefined; - if (isSessionAggregatesMode) { - // eslint-disable-next-line deprecation/deprecation - const requestSession = core.getIsolationScope().getRequestSession(); - // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a - // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within - // the bounds of a request, and if so the status is updated - if (requestSession && requestSession.status !== undefined) { - requestSession.status = 'crashed'; - } - } + processEvent: (event, hint, client) => { + if (!isSystemError(hint.originalException)) { + return event; } - - const eventId = core.captureException(error, { mechanism: { type: 'middleware', handled: false } }); - (res ).sentry = eventId; - next(error); - - return; - } - - next(error); - }; -} - -function expressRequestHandler() { - return function sentryRequestMiddleware( - request, - _res, - next, - ) { - // Ensure we use the express-enhanced request here, instead of the plain HTTP one - core.getIsolationScope().setSDKProcessingMetadata({ request }); - - next(); - }; -} - -/** - * Add an Express error handler to capture errors to Sentry. - * - * The error handler must be before any other middleware and after all controllers. - * - * @param app The Express instances - * @param options {ExpressHandlerOptions} Configuration options for the handler - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * const express = require("express"); - * - * const app = express(); - * - * // Add your routes, etc. - * - * // Add this after all routes, - * // but before any and other error-handling middlewares are defined - * Sentry.setupExpressErrorHandler(app); - * - * app.listen(3000); - * ``` - */ -function setupExpressErrorHandler( - app, - options, -) { - app.use(expressRequestHandler()); - app.use(expressErrorHandler(options)); - ensureIsWrapped.ensureIsWrapped(app.use, 'express'); -} - -function getStatusCodeFromResponse(error) { - const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode); - return statusCode ? parseInt(statusCode , 10) : 500; -} - -/** Returns true if response code is internal server error */ -function defaultShouldHandleError(error) { - const status = getStatusCodeFromResponse(error); - return status >= 500; -} - -exports.expressErrorHandler = expressErrorHandler; -exports.expressIntegration = expressIntegration; -exports.instrumentExpress = instrumentExpress; -exports.setupExpressErrorHandler = setupExpressErrorHandler; -//# sourceMappingURL=express.js.map - - -/***/ }), - -/***/ 3372: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationFastify = __nccwpck_require__(62344); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const ensureIsWrapped = __nccwpck_require__(90556); - -// We inline the types we care about here - -const INTEGRATION_NAME = 'Fastify'; - -const instrumentFastify = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationFastify.FastifyInstrumentation({ - requestHook(span) { - addFastifySpanAttributes(span); - }, - }), -); - -const _fastifyIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentFastify(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/). - * - * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server. - * - * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.fastifyIntegration()], - * }) - * ``` - */ -const fastifyIntegration = core.defineIntegration(_fastifyIntegration); - -/** - * Add an Fastify error handler to capture errors to Sentry. - * - * @param fastify The Fastify instance to which to add the error handler - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * const Fastify = require("fastify"); - * - * const app = Fastify(); - * - * Sentry.setupFastifyErrorHandler(app); - * - * // Add your routes, etc. - * - * app.listen({ port: 3000 }); - * ``` - */ -function setupFastifyErrorHandler(fastify) { - const plugin = Object.assign( - function (fastify, _options, done) { - fastify.addHook('onError', async (_request, _reply, error) => { - core.captureException(error); - }); - - // registering `onRequest` hook here instead of using Otel `onRequest` callback b/c `onRequest` hook - // is ironically called in the fastify `preHandler` hook which is called later in the lifecycle: - // https://fastify.dev/docs/latest/Reference/Lifecycle/ - fastify.addHook('onRequest', async (request, _reply) => { - const reqWithRouteInfo = request ; - - // Taken from Otel Fastify instrumentation: - // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L94-L96 - const routeName = _optionalChain([reqWithRouteInfo, 'access', _ => _.routeOptions, 'optionalAccess', _2 => _2.url]) || reqWithRouteInfo.routerPath; - const method = reqWithRouteInfo.method || 'GET'; - - core.getIsolationScope().setTransactionName(`${method} ${routeName}`); - }); - - done(); - }, - { - [Symbol.for('skip-override')]: true, - [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler', - }, - ); - - fastify.register(plugin); - - // Sadly, middleware spans do not go through `requestHook`, so we handle those here - // We register this hook in this method, because if we register it in the integration `setup`, - // it would always run even for users that are not even using fastify - const client = core.getClient(); - if (client) { - client.on('spanStart', span => { - addFastifySpanAttributes(span); - }); - } - - ensureIsWrapped.ensureIsWrapped(fastify.addHook, 'fastify'); -} - -function addFastifySpanAttributes(span) { - const attributes = core.spanToJSON(span).data || {}; - - // this is one of: middleware, request_handler - const type = attributes['fastify.type']; - - // If this is already set, or we have no fastify span, no need to process again... - if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { - return; - } - - span.setAttributes({ - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify', - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`, - }); - - // Also update the name, we don't need to "middleware - " prefix - const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name']; - if (typeof name === 'string') { - // Also remove `fastify -> ` prefix - span.updateName(name.replace(/^fastify -> /, '')); - } -} - -exports.fastifyIntegration = fastifyIntegration; -exports.instrumentFastify = instrumentFastify; -exports.setupFastifyErrorHandler = setupFastifyErrorHandler; -//# sourceMappingURL=fastify.js.map - - -/***/ }), - -/***/ 78505: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationGenericPool = __nccwpck_require__(36933); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); - -const INTEGRATION_NAME = 'GenericPool'; - -const instrumentGenericPool = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationGenericPool.GenericPoolInstrumentation({})); - -const _genericPoolIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentGenericPool(); - }, - - setup(client) { - client.on('spanStart', span => { - const spanJSON = core.spanToJSON(span); - - const spanDescription = spanJSON.description; - - // typo in emitted span for version <= 0.38.0 of @opentelemetry/instrumentation-generic-pool - const isGenericPoolSpan = - spanDescription === 'generic-pool.aquire' || spanDescription === 'generic-pool.acquire'; - - if (isGenericPoolSpan) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.generic_pool'); - } - }); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [generic-pool](https://www.npmjs.com/package/generic-pool) library. - * - * For more information, see the [`genericPoolIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/genericpool/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.genericPoolIntegration()], - * }); - * ``` - */ -const genericPoolIntegration = core.defineIntegration(_genericPoolIntegration); - -exports.genericPoolIntegration = genericPoolIntegration; -exports.instrumentGenericPool = instrumentGenericPool; -//# sourceMappingURL=genericPool.js.map - - -/***/ }), - -/***/ 64448: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationGraphql = __nccwpck_require__(96794); -const core = __nccwpck_require__(84466); -const opentelemetry = __nccwpck_require__(78369); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); - -const INTEGRATION_NAME = 'Graphql'; - -const instrumentGraphql = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - (_options = {}) => { - const options = getOptionsWithDefaults(_options); - - return new instrumentationGraphql.GraphQLInstrumentation({ - ...options, - responseHook(span) { - addOriginToSpan.addOriginToSpan(span, 'auto.graphql.otel.graphql'); - - const attributes = core.spanToJSON(span).data || {}; - - // If operation.name is not set, we fall back to use operation.type only - const operationType = attributes['graphql.operation.type']; - const operationName = attributes['graphql.operation.name']; - - if (options.useOperationNameForRootSpan && operationType) { - const rootSpan = core.getRootSpan(span); - - // We guard to only do this on http.server spans - - const rootSpanAttributes = core.spanToJSON(rootSpan).data || {}; - - const existingOperations = rootSpanAttributes[opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION] || []; - - const newOperation = operationName ? `${operationType} ${operationName}` : `${operationType}`; - - // We keep track of each operation on the root span - // This can either be a string, or an array of strings (if there are multiple operations) - if (Array.isArray(existingOperations)) { - existingOperations.push(newOperation); - rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, existingOperations); - } else if (existingOperations) { - rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, [existingOperations, newOperation]); - } else { - rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, newOperation); - } - } - }, - }); - }, -); - -const _graphqlIntegration = ((options = {}) => { - return { - name: INTEGRATION_NAME, - setupOnce() { - // We set defaults here, too, because otherwise we'd update the instrumentation config - // to the config without defaults, as `generateInstrumentOnce` automatically calls `setConfig(options)` - // when being called the second time - instrumentGraphql(getOptionsWithDefaults(options)); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [graphql](https://www.npmjs.com/package/graphql) library. - * - * For more information, see the [`graphqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/graphql/). - * - * @param {GraphqlOptions} options Configuration options for the GraphQL integration. - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.graphqlIntegration()], - * }); - */ -const graphqlIntegration = core.defineIntegration(_graphqlIntegration); - -function getOptionsWithDefaults(options) { - return { - ignoreResolveSpans: true, - ignoreTrivialResolveSpans: true, - useOperationNameForRootSpan: true, - ...options, - }; -} - -exports.graphqlIntegration = graphqlIntegration; -exports.instrumentGraphql = instrumentGraphql; -//# sourceMappingURL=graphql.js.map - - -/***/ }), - -/***/ 69741: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationHapi = __nccwpck_require__(25435); -const core = __nccwpck_require__(84466); -const debugBuild = __nccwpck_require__(8421); -const instrument = __nccwpck_require__(64074); -const ensureIsWrapped = __nccwpck_require__(90556); - -const INTEGRATION_NAME = 'Hapi'; - -const instrumentHapi = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationHapi.HapiInstrumentation()); - -const _hapiIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentHapi(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for [Hapi](https://hapi.dev/). - * - * If you also want to capture errors, you need to call `setupHapiErrorHandler(server)` after you set up your server. - * - * For more information, see the [hapi documentation](https://docs.sentry.io/platforms/javascript/guides/hapi/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.hapiIntegration()], - * }) - * ``` - */ -const hapiIntegration = core.defineIntegration(_hapiIntegration); - -function isErrorEvent(event) { - return event && (event ).error !== undefined; -} - -function sendErrorToSentry(errorData) { - core.captureException(errorData, { - mechanism: { - type: 'hapi', - handled: false, - data: { - function: 'hapiErrorPlugin', - }, - }, - }); -} - -const hapiErrorPlugin = { - name: 'SentryHapiErrorPlugin', - version: core.SDK_VERSION, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - register: async function (serverArg) { - const server = serverArg ; - - server.events.on({ name: 'request', channels: ['error'] }, (request, event) => { - if (core.getIsolationScope() !== core.getDefaultIsolationScope()) { - const route = request.route; - if (route && route.path) { - core.getIsolationScope().setTransactionName(`${_optionalChain([route, 'access', _ => _.method, 'optionalAccess', _2 => _2.toUpperCase, 'call', _3 => _3()]) || 'GET'} ${route.path}`); - } - } else { - debugBuild.DEBUG_BUILD && - core.logger.warn('Isolation scope is still the default isolation scope - skipping setting transactionName'); - } - - if (isErrorEvent(event)) { - sendErrorToSentry(event.error); - } - }); - }, -}; - -/** - * Add a Hapi plugin to capture errors to Sentry. - * - * @param server The Hapi server to attach the error handler to - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * const Hapi = require('@hapi/hapi'); - * - * const init = async () => { - * const server = Hapi.server(); - * - * // all your routes here - * - * await Sentry.setupHapiErrorHandler(server); - * - * await server.start(); - * }; - * ``` - */ -async function setupHapiErrorHandler(server) { - await server.register(hapiErrorPlugin); - - // Sadly, middleware spans do not go through `requestHook`, so we handle those here - // We register this hook in this method, because if we register it in the integration `setup`, - // it would always run even for users that are not even using hapi - const client = core.getClient(); - if (client) { - client.on('spanStart', span => { - addHapiSpanAttributes(span); - }); - } - - // eslint-disable-next-line @typescript-eslint/unbound-method - ensureIsWrapped.ensureIsWrapped(server.register, 'hapi'); -} - -function addHapiSpanAttributes(span) { - const attributes = core.spanToJSON(span).data || {}; - - // this is one of: router, plugin, server.ext - const type = attributes['hapi.type']; - - // If this is already set, or we have no Hapi span, no need to process again... - if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { - return; - } - - span.setAttributes({ - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.hapi', - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.hapi`, - }); -} - -exports.hapiErrorPlugin = hapiErrorPlugin; -exports.hapiIntegration = hapiIntegration; -exports.instrumentHapi = instrumentHapi; -exports.setupHapiErrorHandler = setupHapiErrorHandler; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 59020: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const index$2 = __nccwpck_require__(50289); -const amqplib = __nccwpck_require__(40782); -const connect = __nccwpck_require__(56711); -const express = __nccwpck_require__(89660); -const fastify = __nccwpck_require__(3372); -const genericPool = __nccwpck_require__(78505); -const graphql = __nccwpck_require__(64448); -const index = __nccwpck_require__(69741); -const kafka = __nccwpck_require__(8430); -const koa = __nccwpck_require__(57910); -const lrumemoizer = __nccwpck_require__(47006); -const mongo = __nccwpck_require__(57036); -const mongoose = __nccwpck_require__(28975); -const mysql = __nccwpck_require__(5432); -const mysql2 = __nccwpck_require__(56910); -const nest = __nccwpck_require__(60876); -const postgres = __nccwpck_require__(96003); -const redis = __nccwpck_require__(87260); -const tedious = __nccwpck_require__(78622); -const index$1 = __nccwpck_require__(65595); - -/** - * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required. - */ -function getAutoPerformanceIntegrations() { - return [ - express.expressIntegration(), - fastify.fastifyIntegration(), - graphql.graphqlIntegration(), - mongo.mongoIntegration(), - mongoose.mongooseIntegration(), - mysql.mysqlIntegration(), - mysql2.mysql2Integration(), - redis.redisIntegration(), - postgres.postgresIntegration(), - // For now, we do not include prisma by default because it has ESM issues - // See https://github.com/prisma/prisma/issues/23410 - // TODO v8: Figure out a better solution for this, maybe only disable in ESM mode? - // prismaIntegration(), - // eslint-disable-next-line deprecation/deprecation - nest.nestIntegration(), - index.hapiIntegration(), - koa.koaIntegration(), - connect.connectIntegration(), - tedious.tediousIntegration(), - genericPool.genericPoolIntegration(), - kafka.kafkaIntegration(), - amqplib.amqplibIntegration(), - lrumemoizer.lruMemoizerIntegration(), - index$1.vercelAIIntegration(), - ]; -} - -/** - * Get a list of methods to instrument OTEL, when preload instrumentation. - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function getOpenTelemetryInstrumentationToPreload() { - return [ - index$2.instrumentOtelHttp, - express.instrumentExpress, - connect.instrumentConnect, - fastify.instrumentFastify, - index.instrumentHapi, - kafka.instrumentKafka, - koa.instrumentKoa, - lrumemoizer.instrumentLruMemoizer, - // eslint-disable-next-line deprecation/deprecation - nest.instrumentNest, - mongo.instrumentMongo, - mongoose.instrumentMongoose, - mysql.instrumentMysql, - mysql2.instrumentMysql2, - postgres.instrumentPostgres, - index.instrumentHapi, - graphql.instrumentGraphql, - redis.instrumentRedis, - tedious.instrumentTedious, - genericPool.instrumentGenericPool, - amqplib.instrumentAmqplib, - index$1.instrumentVercelAi, - ]; -} - -exports.getAutoPerformanceIntegrations = getAutoPerformanceIntegrations; -exports.getOpenTelemetryInstrumentationToPreload = getOpenTelemetryInstrumentationToPreload; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 8430: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationKafkajs = __nccwpck_require__(82331); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); - -const INTEGRATION_NAME = 'Kafka'; - -const instrumentKafka = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationKafkajs.KafkaJsInstrumentation({ - consumerHook(span) { - addOriginToSpan.addOriginToSpan(span, 'auto.kafkajs.otel.consumer'); - }, - producerHook(span) { - addOriginToSpan.addOriginToSpan(span, 'auto.kafkajs.otel.producer'); - }, - }), -); - -const _kafkaIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentKafka(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library. - * - * For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.kafkaIntegration()], - * }); - */ -const kafkaIntegration = core.defineIntegration(_kafkaIntegration); - -exports.instrumentKafka = instrumentKafka; -exports.kafkaIntegration = kafkaIntegration; -//# sourceMappingURL=kafka.js.map - - -/***/ }), - -/***/ 46350: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationKnex = __nccwpck_require__(12083); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); - -const INTEGRATION_NAME = 'Knex'; - -const instrumentKnex = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => new instrumentationKnex.KnexInstrumentation({ requireParentSpan: true }), -); - -const _knexIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentKnex(); - }, - - setup(client) { - client.on('spanStart', span => { - const { data } = core.spanToJSON(span); - // knex.version is always set in the span data - // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138 - if (data && 'knex.version' in data) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex'); - } - }); - }, - }; -}) ; - -/** - * Knex integration - * - * Capture tracing data for [Knex](https://knexjs.org/). - * - * @example - * ```javascript - * import * as Sentry from '@sentry/node'; - * - * Sentry.init({ - * integrations: [Sentry.knexIntegration()], - * }); - * ``` - */ -const knexIntegration = core.defineIntegration(_knexIntegration); - -exports.instrumentKnex = instrumentKnex; -exports.knexIntegration = knexIntegration; -//# sourceMappingURL=knex.js.map - - -/***/ }), - -/***/ 57910: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationKoa = __nccwpck_require__(68168); -const semanticConventions = __nccwpck_require__(67275); -const core = __nccwpck_require__(84466); -const debugBuild = __nccwpck_require__(8421); -const instrument = __nccwpck_require__(64074); -const ensureIsWrapped = __nccwpck_require__(90556); - -const INTEGRATION_NAME = 'Koa'; - -const instrumentKoa = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationKoa.KoaInstrumentation({ - requestHook(span, info) { - addKoaSpanAttributes(span); - - if (core.getIsolationScope() === core.getDefaultIsolationScope()) { - debugBuild.DEBUG_BUILD && core.logger.warn('Isolation scope is default isolation scope - skipping setting transactionName'); - return; - } - const attributes = core.spanToJSON(span).data; - const route = attributes && attributes[semanticConventions.ATTR_HTTP_ROUTE]; - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - const method = _optionalChain([info, 'optionalAccess', _ => _.context, 'optionalAccess', _2 => _2.request, 'optionalAccess', _3 => _3.method, 'optionalAccess', _4 => _4.toUpperCase, 'call', _5 => _5()]) || 'GET'; - if (route) { - core.getIsolationScope().setTransactionName(`${method} ${route}`); - } - }, - }), -); - -const _koaIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentKoa(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for [Koa](https://koajs.com/). - * - * If you also want to capture errors, you need to call `setupKoaErrorHandler(app)` after you set up your Koa server. - * - * For more information, see the [koa documentation](https://docs.sentry.io/platforms/javascript/guides/koa/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.koaIntegration()], - * }) - * ``` - */ -const koaIntegration = core.defineIntegration(_koaIntegration); - -/** - * Add an Koa error handler to capture errors to Sentry. - * - * The error handler must be before any other middleware and after all controllers. - * - * @param app The Express instances - * @param options {ExpressHandlerOptions} Configuration options for the handler - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * const Koa = require("koa"); - * - * const app = new Koa(); - * - * Sentry.setupKoaErrorHandler(app); - * - * // Add your routes, etc. - * - * app.listen(3000); - * ``` - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const setupKoaErrorHandler = (app) => { - app.use(async (ctx, next) => { - try { - await next(); - } catch (error) { - core.captureException(error); - throw error; - } - }); - - ensureIsWrapped.ensureIsWrapped(app.use, 'koa'); -}; - -function addKoaSpanAttributes(span) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.http.otel.koa'); - - const attributes = core.spanToJSON(span).data || {}; - - // this is one of: middleware, router - const type = attributes['koa.type']; - - if (type) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.koa`); - } - - // Also update the name - const name = attributes['koa.name']; - if (typeof name === 'string') { - // Somehow, name is sometimes `''` for middleware spans - // See: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2220 - span.updateName(name || '< unknown >'); - } -} - -exports.instrumentKoa = instrumentKoa; -exports.koaIntegration = koaIntegration; -exports.setupKoaErrorHandler = setupKoaErrorHandler; -//# sourceMappingURL=koa.js.map - - -/***/ }), - -/***/ 47006: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationLruMemoizer = __nccwpck_require__(7362); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); - -const INTEGRATION_NAME = 'LruMemoizer'; - -const instrumentLruMemoizer = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationLruMemoizer.LruMemoizerInstrumentation()); - -const _lruMemoizerIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentLruMemoizer(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [lru-memoizer](https://www.npmjs.com/package/lru-memoizer) library. - * - * For more information, see the [`lruMemoizerIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/lrumemoizer/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.lruMemoizerIntegration()], - * }); - */ -const lruMemoizerIntegration = core.defineIntegration(_lruMemoizerIntegration); - -exports.instrumentLruMemoizer = instrumentLruMemoizer; -exports.lruMemoizerIntegration = lruMemoizerIntegration; -//# sourceMappingURL=lrumemoizer.js.map - - -/***/ }), - -/***/ 57036: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationMongodb = __nccwpck_require__(25625); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); - -const INTEGRATION_NAME = 'Mongo'; - -const instrumentMongo = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationMongodb.MongoDBInstrumentation({ - dbStatementSerializer: _defaultDbStatementSerializer, - responseHook(span) { - addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.mongo'); - }, - }), -); - -/** - * Replaces values in document with '?', hiding PII and helping grouping. - */ -function _defaultDbStatementSerializer(commandObj) { - const resultObj = _scrubStatement(commandObj); - return JSON.stringify(resultObj); -} - -function _scrubStatement(value) { - if (Array.isArray(value)) { - return value.map(element => _scrubStatement(element)); - } - - if (isCommandObj(value)) { - const initial = {}; - return Object.entries(value) - .map(([key, element]) => [key, _scrubStatement(element)]) - .reduce((prev, current) => { - if (isCommandEntry(current)) { - prev[current[0]] = current[1]; - } - return prev; - }, initial); - } - - // A value like string or number, possible contains PII, scrub it - return '?'; -} - -function isCommandObj(value) { - return typeof value === 'object' && value !== null && !isBuffer(value); -} - -function isBuffer(value) { - let isBuffer = false; - if (typeof Buffer !== 'undefined') { - isBuffer = Buffer.isBuffer(value); - } - return isBuffer; -} - -function isCommandEntry(value) { - return Array.isArray(value); -} - -const _mongoIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentMongo(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [mongodb](https://www.npmjs.com/package/mongodb) library. - * - * For more information, see the [`mongoIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongo/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.mongoIntegration()], - * }); - * ``` - */ -const mongoIntegration = core.defineIntegration(_mongoIntegration); - -exports._defaultDbStatementSerializer = _defaultDbStatementSerializer; -exports.instrumentMongo = instrumentMongo; -exports.mongoIntegration = mongoIntegration; -//# sourceMappingURL=mongo.js.map - - -/***/ }), - -/***/ 28975: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationMongoose = __nccwpck_require__(17168); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); - -const INTEGRATION_NAME = 'Mongoose'; - -const instrumentMongoose = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationMongoose.MongooseInstrumentation({ - responseHook(span) { - addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.mongoose'); - }, - }), -); - -const _mongooseIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentMongoose(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [mongoose](https://www.npmjs.com/package/mongoose) library. - * - * For more information, see the [`mongooseIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongoose/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.mongooseIntegration()], - * }); - * ``` - */ -const mongooseIntegration = core.defineIntegration(_mongooseIntegration); - -exports.instrumentMongoose = instrumentMongoose; -exports.mongooseIntegration = mongooseIntegration; -//# sourceMappingURL=mongoose.js.map - - -/***/ }), - -/***/ 5432: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationMysql = __nccwpck_require__(80144); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); - -const INTEGRATION_NAME = 'Mysql'; - -const instrumentMysql = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationMysql.MySQLInstrumentation({})); - -const _mysqlIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentMysql(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [mysql](https://www.npmjs.com/package/mysql) library. - * - * For more information, see the [`mysqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.mysqlIntegration()], - * }); - * ``` - */ -const mysqlIntegration = core.defineIntegration(_mysqlIntegration); - -exports.instrumentMysql = instrumentMysql; -exports.mysqlIntegration = mysqlIntegration; -//# sourceMappingURL=mysql.js.map - - -/***/ }), - -/***/ 56910: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationMysql2 = __nccwpck_require__(79651); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); - -const INTEGRATION_NAME = 'Mysql2'; - -const instrumentMysql2 = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationMysql2.MySQL2Instrumentation({ - responseHook(span) { - addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.mysql2'); - }, - }), -); - -const _mysql2Integration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentMysql2(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library. - * - * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.mysqlIntegration()], - * }); - * ``` - */ -const mysql2Integration = core.defineIntegration(_mysql2Integration); - -exports.instrumentMysql2 = instrumentMysql2; -exports.mysql2Integration = mysql2Integration; -//# sourceMappingURL=mysql2.js.map - - -/***/ }), - -/***/ 34445: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _nullishCoalesce -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const core = __nccwpck_require__(84466); - -const sentryPatched = 'sentryPatched'; - -/** - * Helper checking if a concrete target class is already patched. - * - * We already guard duplicate patching with isWrapped. However, isWrapped checks whether a file has been patched, whereas we use this check for concrete target classes. - * This check might not be necessary, but better to play it safe. - */ -function isPatched(target) { - if (target.sentryPatched) { - return true; - } - - core.addNonEnumerableProperty(target, sentryPatched, true); - return false; -} - -/** - * Returns span options for nest middleware spans. - */ -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -function getMiddlewareSpanOptions(target, name = undefined) { - const span_name = _nullishCoalesce(name, () => ( target.name)); // fallback to class name if no name is provided - - return { - name: span_name, - attributes: { - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'middleware.nestjs', - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.middleware.nestjs', - }, - }; -} - -/** - * Returns span options for nest event spans. - */ -function getEventSpanOptions(event) - - { - return { - name: `event ${event}`, - attributes: { - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'event.nestjs', - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.event.nestjs', - }, - forceTransaction: true, - }; -} - -/** - * Adds instrumentation to a js observable and attaches the span to an active parent span. - */ -function instrumentObservable(observable, activeSpan) { - if (activeSpan) { - // eslint-disable-next-line @typescript-eslint/unbound-method - observable.subscribe = new Proxy(observable.subscribe, { - apply: (originalSubscribe, thisArgSubscribe, argsSubscribe) => { - return core.withActiveSpan(activeSpan, () => { - const subscription = originalSubscribe.apply(thisArgSubscribe, argsSubscribe); - subscription.add(() => activeSpan.end()); - return subscription; - }); - }, - }); - } -} - -/** - * Proxies the next() call in a nestjs middleware to end the span when it is called. - */ -function getNextProxy(next, span, prevSpan) { - return new Proxy(next, { - apply: (originalNext, thisArgNext, argsNext) => { - span.end(); - - if (prevSpan) { - return core.withActiveSpan(prevSpan, () => { - return Reflect.apply(originalNext, thisArgNext, argsNext); - }); - } else { - return Reflect.apply(originalNext, thisArgNext, argsNext); - } - }, - }); -} - -exports.getEventSpanOptions = getEventSpanOptions; -exports.getMiddlewareSpanOptions = getMiddlewareSpanOptions; -exports.getNextProxy = getNextProxy; -exports.instrumentObservable = instrumentObservable; -exports.isPatched = isPatched; -//# sourceMappingURL=helpers.js.map - - -/***/ }), - -/***/ 60876: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationNestjsCore = __nccwpck_require__(81551); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const sentryNestEventInstrumentation = __nccwpck_require__(41018); -const sentryNestInstrumentation = __nccwpck_require__(57786); - -const INTEGRATION_NAME = 'Nest'; - -const instrumentNestCore = instrument.generateInstrumentOnce('Nest-Core', () => { - return new instrumentationNestjsCore.NestInstrumentation(); -}); - -const instrumentNestCommon = instrument.generateInstrumentOnce('Nest-Common', () => { - return new sentryNestInstrumentation.SentryNestInstrumentation(); -}); - -const instrumentNestEvent = instrument.generateInstrumentOnce('Nest-Event', () => { - return new sentryNestEventInstrumentation.SentryNestEventInstrumentation(); -}); - -const instrumentNest = Object.assign( - () => { - instrumentNestCore(); - instrumentNestCommon(); - instrumentNestEvent(); - }, - { id: INTEGRATION_NAME }, -); - -/** - * Integration capturing tracing data for NestJS. - * - * @deprecated The `nestIntegration` is deprecated. Instead, use the NestJS SDK directly (`@sentry/nestjs`), or use the `nestIntegration` export from `@sentry/nestjs`. - */ -const nestIntegration = core.defineIntegration(() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentNest(); - }, - }; -}); - -/** - * Setup an error handler for Nest. - * - * @deprecated `setupNestErrorHandler` is deprecated. - * Instead use the `@sentry/nestjs` package, which has more functional APIs for capturing errors. - * See the [`@sentry/nestjs` Setup Guide](https://docs.sentry.io/platforms/javascript/guides/nestjs/) for how to set up the Sentry NestJS SDK. - */ -function setupNestErrorHandler(app, baseFilter) { - core.consoleSandbox(() => { - // eslint-disable-next-line no-console - console.warn( - '[Sentry] Warning: You used the `setupNestErrorHandler()` method to set up Sentry error monitoring. This function is deprecated and will be removed in the next major version. Instead, it is recommended to use the `@sentry/nestjs` package. To set up the NestJS SDK see: https://docs.sentry.io/platforms/javascript/guides/nestjs/', - ); - }); - - // Sadly, NestInstrumentation has no requestHook, so we need to add the attributes here - // We register this hook in this method, because if we register it in the integration `setup`, - // it would always run even for users that are not even using Nest.js - const client = core.getClient(); - if (client) { - client.on('spanStart', span => { - addNestSpanAttributes(span); - }); - } - - app.useGlobalInterceptors({ - intercept(context, next) { - if (core.getIsolationScope() === core.getDefaultIsolationScope()) { - core.logger.warn('Isolation scope is still the default isolation scope, skipping setting transactionName.'); - return next.handle(); - } - - if (context.getType() === 'http') { - // getRequest() returns either a FastifyRequest or ExpressRequest, depending on the used adapter - const req = context.switchToHttp().getRequest(); - if ('routeOptions' in req && req.routeOptions && req.routeOptions.url) { - // fastify case - core.getIsolationScope().setTransactionName(`${_optionalChain([req, 'access', _ => _.method, 'optionalAccess', _2 => _2.toUpperCase, 'call', _3 => _3()]) || 'GET'} ${req.routeOptions.url}`); - } else if ('route' in req && req.route && req.route.path) { - // express case - core.getIsolationScope().setTransactionName(`${_optionalChain([req, 'access', _4 => _4.method, 'optionalAccess', _5 => _5.toUpperCase, 'call', _6 => _6()]) || 'GET'} ${req.route.path}`); - } - } - - return next.handle(); - }, - }); - - const wrappedFilter = new Proxy(baseFilter, { - get(target, prop, receiver) { - if (prop === 'catch') { - const originalCatch = Reflect.get(target, prop, receiver); - - return (exception, host) => { - const exceptionIsObject = typeof exception === 'object' && exception !== null; - const exceptionStatusCode = exceptionIsObject && 'status' in exception ? exception.status : null; - const exceptionErrorProperty = exceptionIsObject && 'error' in exception ? exception.error : null; - - /* - Don't report expected NestJS control flow errors - - `HttpException` errors will have a `status` property - - `RpcException` errors will have an `error` property - */ - if (exceptionStatusCode !== null || exceptionErrorProperty !== null) { - return originalCatch.apply(target, [exception, host]); - } - - core.captureException(exception); - return originalCatch.apply(target, [exception, host]); - }; - } - return Reflect.get(target, prop, receiver); - }, - }); - - app.useGlobalFilters(wrappedFilter); -} - -function addNestSpanAttributes(span) { - const attributes = core.spanToJSON(span).data || {}; - - // this is one of: app_creation, request_context, handler - const type = attributes['nestjs.type']; - - // If this is already set, or we have no nest.js span, no need to process again... - if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { - return; - } - - span.setAttributes({ - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.nestjs', - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.nestjs`, - }); -} - -exports.instrumentNest = instrumentNest; -exports.nestIntegration = nestIntegration; -exports.setupNestErrorHandler = setupNestErrorHandler; -//# sourceMappingURL=nest.js.map - - -/***/ }), - -/***/ 41018: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const core$1 = __nccwpck_require__(46033); -const instrumentation = __nccwpck_require__(65584); -const core = __nccwpck_require__(84466); -const helpers = __nccwpck_require__(34445); - -const supportedVersions = ['>=2.0.0']; - -/** - * Custom instrumentation for nestjs event-emitter - * - * This hooks into the `OnEvent` decorator, which is applied on event handlers. - */ -class SentryNestEventInstrumentation extends instrumentation.InstrumentationBase { - static __initStatic() {this.COMPONENT = '@nestjs/event-emitter';} - static __initStatic2() {this.COMMON_ATTRIBUTES = { - component: SentryNestEventInstrumentation.COMPONENT, - };} - - constructor(config = {}) { - super('sentry-nestjs-event', core.SDK_VERSION, config); - } - - /** - * Initializes the instrumentation by defining the modules to be patched. - */ - init() { - const moduleDef = new instrumentation.InstrumentationNodeModuleDefinition( - SentryNestEventInstrumentation.COMPONENT, - supportedVersions, - ); - - moduleDef.files.push(this._getOnEventFileInstrumentation(supportedVersions)); - return moduleDef; - } - - /** - * Wraps the @OnEvent decorator. - */ - _getOnEventFileInstrumentation(versions) { - return new instrumentation.InstrumentationNodeModuleFile( - '@nestjs/event-emitter/dist/decorators/on-event.decorator.js', - versions, - (moduleExports) => { - if (core$1.isWrapped(moduleExports.OnEvent)) { - this._unwrap(moduleExports, 'OnEvent'); - } - this._wrap(moduleExports, 'OnEvent', this._createWrapOnEvent()); - return moduleExports; - }, - (moduleExports) => { - this._unwrap(moduleExports, 'OnEvent'); - }, - ); - } - - /** - * Creates a wrapper function for the @OnEvent decorator. - */ - _createWrapOnEvent() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function wrapOnEvent(original) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function wrappedOnEvent(event, options) { - const eventName = Array.isArray(event) - ? event.join(',') - : typeof event === 'string' || typeof event === 'symbol' - ? event.toString() - : ''; - - // Get the original decorator result - const decoratorResult = original(event, options); - - // Return a new decorator function that wraps the handler - return function (target, propertyKey, descriptor) { - if (!descriptor.value || typeof descriptor.value !== 'function' || target.__SENTRY_INTERNAL__) { - return decoratorResult(target, propertyKey, descriptor); - } - - // Get the original handler - const originalHandler = descriptor.value; - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - const handlerName = originalHandler.name || propertyKey; - - // Instrument the handler - // eslint-disable-next-line @typescript-eslint/no-explicit-any - descriptor.value = async function (...args) { - return core.startSpan(helpers.getEventSpanOptions(eventName), async () => { - try { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - const result = await originalHandler.apply(this, args); - return result; - } catch (error) { - // exceptions from event handlers are not caught by global error filter - core.captureException(error); - throw error; - } - }); - }; - - // Preserve the original function name - Object.defineProperty(descriptor.value, 'name', { - value: handlerName, - configurable: true, - }); - - // Apply the original decorator - return decoratorResult(target, propertyKey, descriptor); - }; + const error = hint.originalException; + const errorContext = { + ...error }; - }; - } -} SentryNestEventInstrumentation.__initStatic(); SentryNestEventInstrumentation.__initStatic2(); - -exports.SentryNestEventInstrumentation = SentryNestEventInstrumentation; -//# sourceMappingURL=sentry-nest-event-instrumentation.js.map - - -/***/ }), - -/***/ 57786: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _nullishCoalesce, - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const core$1 = __nccwpck_require__(46033); -const instrumentation = __nccwpck_require__(65584); -const core = __nccwpck_require__(84466); -const helpers = __nccwpck_require__(34445); - -const supportedVersions = ['>=8.0.0 <11']; - -/** - * Custom instrumentation for nestjs. - * - * This hooks into - * 1. @Injectable decorator, which is applied on class middleware, interceptors and guards. - * 2. @Catch decorator, which is applied on exception filters. - */ -class SentryNestInstrumentation extends instrumentation.InstrumentationBase { - static __initStatic() {this.COMPONENT = '@nestjs/common';} - static __initStatic2() {this.COMMON_ATTRIBUTES = { - component: SentryNestInstrumentation.COMPONENT, - };} - - constructor(config = {}) { - super('sentry-nestjs', core.SDK_VERSION, config); - } - - /** - * Initializes the instrumentation by defining the modules to be patched. - */ - init() { - const moduleDef = new instrumentation.InstrumentationNodeModuleDefinition(SentryNestInstrumentation.COMPONENT, supportedVersions); - - moduleDef.files.push( - this._getInjectableFileInstrumentation(supportedVersions), - this._getCatchFileInstrumentation(supportedVersions), - ); - return moduleDef; - } - - /** - * Wraps the @Injectable decorator. - */ - _getInjectableFileInstrumentation(versions) { - return new instrumentation.InstrumentationNodeModuleFile( - '@nestjs/common/decorators/core/injectable.decorator.js', - versions, - (moduleExports) => { - if (core$1.isWrapped(moduleExports.Injectable)) { - this._unwrap(moduleExports, 'Injectable'); - } - this._wrap(moduleExports, 'Injectable', this._createWrapInjectable()); - return moduleExports; - }, - (moduleExports) => { - this._unwrap(moduleExports, 'Injectable'); - }, - ); - } - - /** - * Wraps the @Catch decorator. - */ - _getCatchFileInstrumentation(versions) { - return new instrumentation.InstrumentationNodeModuleFile( - '@nestjs/common/decorators/core/catch.decorator.js', - versions, - (moduleExports) => { - if (core$1.isWrapped(moduleExports.Catch)) { - this._unwrap(moduleExports, 'Catch'); - } - this._wrap(moduleExports, 'Catch', this._createWrapCatch()); - return moduleExports; - }, - (moduleExports) => { - this._unwrap(moduleExports, 'Catch'); - }, - ); - } - - /** - * Creates a wrapper function for the @Injectable decorator. - */ - _createWrapInjectable() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function wrapInjectable(original) { - return function wrappedInjectable(options) { - return function (target) { - // patch middleware - if (typeof target.prototype.use === 'function' && !target.__SENTRY_INTERNAL__) { - // patch only once - if (helpers.isPatched(target)) { - return original(options)(target); - } - - target.prototype.use = new Proxy(target.prototype.use, { - apply: (originalUse, thisArgUse, argsUse) => { - const [req, res, next, ...args] = argsUse; - - // Check that we can reasonably assume that the target is a middleware. - // Without these guards, instrumentation will fail if a function named 'use' on a service, which is - // decorated with @Injectable, is called. - if (!req || !res || !next || typeof next !== 'function') { - return originalUse.apply(thisArgUse, argsUse); - } - - const prevSpan = core.getActiveSpan(); - - return core.startSpanManual(helpers.getMiddlewareSpanOptions(target), (span) => { - // proxy next to end span on call - const nextProxy = helpers.getNextProxy(next, span, prevSpan); - return originalUse.apply(thisArgUse, [req, res, nextProxy, args]); - }); - }, - }); - } - - // patch guards - if (typeof target.prototype.canActivate === 'function' && !target.__SENTRY_INTERNAL__) { - // patch only once - if (helpers.isPatched(target)) { - return original(options)(target); - } - - target.prototype.canActivate = new Proxy(target.prototype.canActivate, { - apply: (originalCanActivate, thisArgCanActivate, argsCanActivate) => { - const context = argsCanActivate[0]; - - if (!context) { - return originalCanActivate.apply(thisArgCanActivate, argsCanActivate); - } - - return core.startSpan(helpers.getMiddlewareSpanOptions(target), () => { - return originalCanActivate.apply(thisArgCanActivate, argsCanActivate); - }); - }, - }); - } - - // patch pipes - if (typeof target.prototype.transform === 'function' && !target.__SENTRY_INTERNAL__) { - if (helpers.isPatched(target)) { - return original(options)(target); - } - - target.prototype.transform = new Proxy(target.prototype.transform, { - apply: (originalTransform, thisArgTransform, argsTransform) => { - const value = argsTransform[0]; - const metadata = argsTransform[1]; - - if (!value || !metadata) { - return originalTransform.apply(thisArgTransform, argsTransform); - } - - return core.startSpan(helpers.getMiddlewareSpanOptions(target), () => { - return originalTransform.apply(thisArgTransform, argsTransform); - }); - }, - }); - } - - // patch interceptors - if (typeof target.prototype.intercept === 'function' && !target.__SENTRY_INTERNAL__) { - if (helpers.isPatched(target)) { - return original(options)(target); - } - - target.prototype.intercept = new Proxy(target.prototype.intercept, { - apply: (originalIntercept, thisArgIntercept, argsIntercept) => { - const context = argsIntercept[0]; - const next = argsIntercept[1]; - - const parentSpan = core.getActiveSpan(); - let afterSpan; - - // Check that we can reasonably assume that the target is an interceptor. - if (!context || !next || typeof next.handle !== 'function') { - return originalIntercept.apply(thisArgIntercept, argsIntercept); - } - - return core.startSpanManual(helpers.getMiddlewareSpanOptions(target), (beforeSpan) => { - // eslint-disable-next-line @typescript-eslint/unbound-method - next.handle = new Proxy(next.handle, { - apply: (originalHandle, thisArgHandle, argsHandle) => { - beforeSpan.end(); - - if (parentSpan) { - return core.withActiveSpan(parentSpan, () => { - const handleReturnObservable = Reflect.apply(originalHandle, thisArgHandle, argsHandle); - - if (!context._sentryInterceptorInstrumented) { - core.addNonEnumerableProperty(context, '_sentryInterceptorInstrumented', true); - afterSpan = core.startInactiveSpan( - helpers.getMiddlewareSpanOptions(target, 'Interceptors - After Route'), - ); - } - - return handleReturnObservable; - }); - } else { - const handleReturnObservable = Reflect.apply(originalHandle, thisArgHandle, argsHandle); - - if (!context._sentryInterceptorInstrumented) { - core.addNonEnumerableProperty(context, '_sentryInterceptorInstrumented', true); - afterSpan = core.startInactiveSpan(helpers.getMiddlewareSpanOptions(target, 'Interceptors - After Route')); - } - - return handleReturnObservable; - } - }, - }); - - let returnedObservableInterceptMaybePromise; - - try { - returnedObservableInterceptMaybePromise = originalIntercept.apply(thisArgIntercept, argsIntercept); - } catch (e) { - _optionalChain([beforeSpan, 'optionalAccess', _ => _.end, 'call', _2 => _2()]); - _optionalChain([afterSpan, 'optionalAccess', _3 => _3.end, 'call', _4 => _4()]); - throw e; - } - - if (!afterSpan) { - return returnedObservableInterceptMaybePromise; - } - - // handle async interceptor - if (core.isThenable(returnedObservableInterceptMaybePromise)) { - return returnedObservableInterceptMaybePromise.then( - observable => { - helpers.instrumentObservable(observable, _nullishCoalesce(afterSpan, () => ( parentSpan))); - return observable; - }, - e => { - _optionalChain([beforeSpan, 'optionalAccess', _5 => _5.end, 'call', _6 => _6()]); - _optionalChain([afterSpan, 'optionalAccess', _7 => _7.end, 'call', _8 => _8()]); - throw e; - }, - ); - } - - // handle sync interceptor - if (typeof returnedObservableInterceptMaybePromise.subscribe === 'function') { - helpers.instrumentObservable(returnedObservableInterceptMaybePromise, _nullishCoalesce(afterSpan, () => ( parentSpan))); - } - - return returnedObservableInterceptMaybePromise; - }); - }, - }); - } - - return original(options)(target); - }; + if (!client.getDataCollectionOptions().userInfo && options.includePaths !== true) { + delete errorContext.path; + delete errorContext.dest; + } + event.contexts = { + ...event.contexts, + node_system_error: errorContext }; - }; - } - - /** - * Creates a wrapper function for the @Catch decorator. Used to instrument exception filters. - */ - _createWrapCatch() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return function wrapCatch(original) { - return function wrappedCatch(...exceptions) { - return function (target) { - if (typeof target.prototype.catch === 'function' && !target.__SENTRY_INTERNAL__) { - // patch only once - if (helpers.isPatched(target)) { - return original(...exceptions)(target); - } - - target.prototype.catch = new Proxy(target.prototype.catch, { - apply: (originalCatch, thisArgCatch, argsCatch) => { - const exception = argsCatch[0]; - const host = argsCatch[1]; - - if (!exception || !host) { - return originalCatch.apply(thisArgCatch, argsCatch); - } - - return core.startSpan(helpers.getMiddlewareSpanOptions(target), () => { - return originalCatch.apply(thisArgCatch, argsCatch); - }); - }, - }); + for (const exception of event.exception?.values || []) { + if (exception.value) { + if (error.path && exception.value.includes(error.path)) { + exception.value = exception.value.replace(`'${error.path}'`, "").trim(); } - - return original(...exceptions)(target); - }; - }; - }; - } -}SentryNestInstrumentation.__initStatic();SentryNestInstrumentation.__initStatic2(); - -exports.SentryNestInstrumentation = SentryNestInstrumentation; -//# sourceMappingURL=sentry-nest-instrumentation.js.map - - -/***/ }), - -/***/ 96003: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationPg = __nccwpck_require__(31758); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); - -const INTEGRATION_NAME = 'Postgres'; - -const instrumentPostgres = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - () => - new instrumentationPg.PgInstrumentation({ - requireParentSpan: true, - requestHook(span) { - addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.postgres'); - }, - }), -); - -const _postgresIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentPostgres(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [pg](https://www.npmjs.com/package/pg) library. - * - * For more information, see the [`postgresIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/postgres/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.postgresIntegration()], - * }); - * ``` - */ -const postgresIntegration = core.defineIntegration(_postgresIntegration); - -exports.instrumentPostgres = instrumentPostgres; -exports.postgresIntegration = postgresIntegration; -//# sourceMappingURL=postgres.js.map - - -/***/ }), - -/***/ 53769: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const prismaInstrumentation = __nccwpck_require__(50976); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); - -const INTEGRATION_NAME = 'Prisma'; - -const EsmInteropPrismaInstrumentation = - // @ts-expect-error We need to do the following for interop reasons - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - _optionalChain([prismaInstrumentation, 'access', _ => _.default, 'optionalAccess', _2 => _2.PrismaInstrumentation]) || prismaInstrumentation.PrismaInstrumentation; - -function isPrismaV5TracingHelper(helper) { - return !!helper && typeof helper === 'object' && 'createEngineSpan' in helper; -} - -class SentryPrismaInteropInstrumentation extends EsmInteropPrismaInstrumentation { - constructor() { - super(); - } - - enable() { - super.enable(); - - // The PrismaIntegration (super class) defines a global variable `global["PRISMA_INSTRUMENTATION"]` when `enable()` is called. This global variable holds a "TracingHelper" which Prisma uses internally to create tracing data. It's their way of not depending on OTEL with their main package. The sucky thing is, prisma broke the interface of the tracing helper with the v6 major update. This means that if you use Prisma 6 with the v5 instrumentation (or vice versa) Prisma just blows up, because tries to call methods on the helper that no longer exist. - // Because we actually want to use the v6 instrumentation and not blow up in Prisma 5 user's faces, what we're doing here is backfilling the v5 method (`createEngineSpan`) with a noop so that no longer crashes when it attempts to call that function. - // We still won't fully emit all the spans, but this could potentially be implemented in the future. - const prismaInstrumentationObject = (globalThis ).PRISMA_INSTRUMENTATION; - const prismaTracingHelper = - prismaInstrumentationObject && - typeof prismaInstrumentationObject === 'object' && - 'helper' in prismaInstrumentationObject - ? prismaInstrumentationObject.helper - : undefined; - - let emittedWarning = false; - - if (isPrismaV5TracingHelper(prismaTracingHelper)) { - (prismaTracingHelper ).dispatchEngineSpans = () => { - core.consoleSandbox(() => { - if (!emittedWarning) { - emittedWarning = true; - // eslint-disable-next-line no-console - console.warn( - '[Sentry] This version (v8) of the Sentry SDK does not support tracing with Prisma version 6 out of the box. To trace Prisma version 6, pass a `prismaInstrumentation` for version 6 to the Sentry `prismaIntegration`. Read more: https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/', - ); - } - }); - }; - } - } -} - -const instrumentPrisma = instrument.generateInstrumentOnce( - INTEGRATION_NAME, - options => { - // Use a passed instrumentation instance to support older Prisma versions - if (_optionalChain([options, 'optionalAccess', _3 => _3.prismaInstrumentation])) { - return options.prismaInstrumentation; - } - - return new SentryPrismaInteropInstrumentation(); - }, -); - -/** - * Adds Sentry tracing instrumentation for the [Prisma](https://www.npmjs.com/package/prisma) ORM. - * For more information, see the [`prismaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/). - * - * Make sure `previewFeatures = ["tracing"]` is added to the generator block in your Prisma schema. - * - * ```prisma - * generator client { - * provider = "prisma-client-js" - * previewFeatures = ["tracing"] - * } - * ``` - * - * NOTE: By default, this integration works with Prisma version 5. - * To get performance instrumentation for other Prisma versions, - * 1. Install the `@prisma/instrumentation` package with the desired version. - * 1. Pass a `new PrismaInstrumentation()` instance as exported from `@prisma/instrumentation` to the `prismaInstrumentation` option of this integration: - * - * ```js - * import { PrismaInstrumentation } from '@prisma/instrumentation' - * - * Sentry.init({ - * integrations: [ - * prismaIntegration({ - * // Override the default instrumentation that Sentry uses - * prismaInstrumentation: new PrismaInstrumentation() - * }) - * ] - * }) - * ``` - * - * The passed instrumentation instance will override the default instrumentation instance the integration would use, while the `prismaIntegration` will still ensure data compatibility for the various Prisma versions. - */ -const prismaIntegration = core.defineIntegration( - ({ - prismaInstrumentation, - } - - = {}) => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentPrisma({ prismaInstrumentation }); - }, - setup(client) { - client.on('spanStart', span => { - const spanJSON = core.spanToJSON(span); - if (_optionalChain([spanJSON, 'access', _4 => _4.description, 'optionalAccess', _5 => _5.startsWith, 'call', _6 => _6('prisma:')])) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.prisma'); - } - - // Make sure we use the query text as the span name, for ex. SELECT * FROM "User" WHERE "id" = $1 - if (spanJSON.description === 'prisma:engine:db_query' && _optionalChain([spanJSON, 'access', _7 => _7.data, 'optionalAccess', _8 => _8['db.query.text']])) { - span.updateName(spanJSON.data['db.query.text'] ); - } - - // In Prisma v5.22+, the `db.system` attribute is automatically set - // On older versions, this is missing, so we add it here - if (spanJSON.description === 'prisma:engine:db_query' && !_optionalChain([spanJSON, 'access', _9 => _9.data, 'optionalAccess', _10 => _10['db.system']])) { - span.setAttribute('db.system', 'prisma'); - } - }); - }, - }; - }, -); - -exports.instrumentPrisma = instrumentPrisma; -exports.prismaIntegration = prismaIntegration; -//# sourceMappingURL=prisma.js.map - - -/***/ }), - -/***/ 87260: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationIoredis = __nccwpck_require__(45038); -const instrumentationRedis4 = __nccwpck_require__(53291); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const redisCache = __nccwpck_require__(94795); - -const INTEGRATION_NAME = 'Redis'; - -let _redisOptions = {}; - -const cacheResponseHook = (span, redisCommand, cmdArgs, response) => { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis'); - - const safeKey = redisCache.getCacheKeySafely(redisCommand, cmdArgs); - const cacheOperation = redisCache.getCacheOperation(redisCommand); - - if ( - !safeKey || - !cacheOperation || - !_optionalChain([_redisOptions, 'optionalAccess', _ => _.cachePrefixes]) || - !redisCache.shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes) - ) { - // not relevant for cache - return; - } - - // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199 - // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/ - const networkPeerAddress = _optionalChain([core.spanToJSON, 'call', _2 => _2(span), 'access', _3 => _3.data, 'optionalAccess', _4 => _4['net.peer.name']]); - const networkPeerPort = _optionalChain([core.spanToJSON, 'call', _5 => _5(span), 'access', _6 => _6.data, 'optionalAccess', _7 => _7['net.peer.port']]); - if (networkPeerPort && networkPeerAddress) { - span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort }); - } - - const cacheItemSize = redisCache.calculateCacheItemSize(response); - - if (cacheItemSize) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize); - } - - if (redisCache.isInCommands(redisCache.GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0); - } - - span.setAttributes({ - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation, - [core.SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey, - }); - - const spanDescription = safeKey.join(', '); - - span.updateName(core.truncate(spanDescription, 1024)); -}; - -const instrumentIORedis = instrument.generateInstrumentOnce('IORedis', () => { - return new instrumentationIoredis.IORedisInstrumentation({ - responseHook: cacheResponseHook, - }); -}); - -const instrumentRedis4 = instrument.generateInstrumentOnce('Redis-4', () => { - return new instrumentationRedis4.RedisInstrumentation({ - responseHook: cacheResponseHook, - }); -}); - -/** To be able to preload all Redis OTel instrumentations with just one ID ("Redis"), all the instrumentations are generated in this one function */ -const instrumentRedis = Object.assign( - () => { - instrumentIORedis(); - instrumentRedis4(); - - // todo: implement them gradually - // new LegacyRedisInstrumentation({}), - }, - { id: INTEGRATION_NAME }, -); - -const _redisIntegration = ((options = {}) => { - return { - name: INTEGRATION_NAME, - setupOnce() { - _redisOptions = options; - instrumentRedis(); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and - * [ioredis](https://www.npmjs.com/package/ioredis) libraries. - * - * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.redisIntegration()], - * }); - * ``` - */ -const redisIntegration = core.defineIntegration(_redisIntegration); - -exports.instrumentRedis = instrumentRedis; -exports.redisIntegration = redisIntegration; -//# sourceMappingURL=redis.js.map - - -/***/ }), - -/***/ 78622: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const instrumentationTedious = __nccwpck_require__(70450); -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); - -const TEDIUS_INSTRUMENTED_METHODS = new Set([ - 'callProcedure', - 'execSql', - 'execSqlBatch', - 'execBulkLoad', - 'prepare', - 'execute', -]); - -const INTEGRATION_NAME = 'Tedious'; - -const instrumentTedious = instrument.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationTedious.TediousInstrumentation({})); - -const _tediousIntegration = (() => { - return { - name: INTEGRATION_NAME, - setupOnce() { - instrumentTedious(); - }, - - setup(client) { - client.on('spanStart', span => { - const { description, data } = core.spanToJSON(span); - // Tedius integration always set a span name and `db.system` attribute to `mssql`. - if (!description || _optionalChain([data, 'optionalAccess', _ => _['db.system']]) !== 'mssql') { - return; - } - - const operation = _optionalChain([description, 'optionalAccess', _2 => _2.split, 'call', _3 => _3(' '), 'access', _4 => _4[0]]) || ''; - if (TEDIUS_INSTRUMENTED_METHODS.has(operation)) { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.tedious'); - } - }); - }, - }; -}) ; - -/** - * Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library. - * - * For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.tediousIntegration()], - * }); - * ``` - */ -const tediousIntegration = core.defineIntegration(_tediousIntegration); - -exports.instrumentTedious = instrumentTedious; -exports.tediousIntegration = tediousIntegration; -//# sourceMappingURL=tedious.js.map - - -/***/ }), - -/***/ 65595: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const core = __nccwpck_require__(84466); -const instrument = __nccwpck_require__(64074); -const addOriginToSpan = __nccwpck_require__(37980); -const instrumentation = __nccwpck_require__(15477); - -/* eslint-disable complexity */ - -const instrumentVercelAi = instrument.generateInstrumentOnce('vercelAI', () => new instrumentation.SentryVercelAiInstrumentation({})); - -const _vercelAIIntegration = (() => { - return { - name: 'vercelAI', - setupOnce() { - instrumentVercelAi(); - }, - processEvent(event) { - if (event.type === 'transaction' && _optionalChain([event, 'access', _ => _.spans, 'optionalAccess', _2 => _2.length])) { - for (const span of event.spans) { - const { data: attributes, description: name } = span; - - if (!attributes || !name || span.origin !== 'auto.vercelai.otel') { - continue; - } - - // attributes around token usage can only be set on span finish - span.data = span.data || {}; - - if (attributes['ai.usage.completionTokens'] != undefined) { - span.data['ai.completion_tokens.used'] = attributes['ai.usage.completionTokens']; - } - if (attributes['ai.usage.promptTokens'] != undefined) { - span.data['ai.prompt_tokens.used'] = attributes['ai.usage.promptTokens']; - } - if ( - attributes['ai.usage.completionTokens'] != undefined && - attributes['ai.usage.promptTokens'] != undefined - ) { - span.data['ai.total_tokens.used'] = - attributes['ai.usage.completionTokens'] + attributes['ai.usage.promptTokens']; + if (error.dest && exception.value.includes(error.dest)) { + exception.value = exception.value.replace(`'${error.dest}'`, "").trim(); } } } - return event; - }, - setup(client) { - client.on('spanStart', span => { - if (!instrumentation.sentryVercelAiPatched) { - return; - } - - const { data: attributes, description: name } = core.spanToJSON(span); - - if (!attributes || !name) { - return; - } - - // The id of the model - const aiModelId = attributes['ai.model.id']; - - // the provider of the model - const aiModelProvider = attributes['ai.model.provider']; - - // both of these must be defined for the integration to work - if (!aiModelId || !aiModelProvider) { - return; - } - - let isPipelineSpan = false; - - switch (name) { - case 'ai.generateText': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.generateText'); - isPipelineSpan = true; - break; - } - case 'ai.generateText.doGenerate': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doGenerate'); - break; - } - case 'ai.streamText': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.streamText'); - isPipelineSpan = true; - break; - } - case 'ai.streamText.doStream': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doStream'); - break; - } - case 'ai.generateObject': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.generateObject'); - isPipelineSpan = true; - break; - } - case 'ai.generateObject.doGenerate': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doGenerate'); - break; - } - case 'ai.streamObject': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.streamObject'); - isPipelineSpan = true; - break; - } - case 'ai.streamObject.doStream': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run.doStream'); - break; - } - case 'ai.embed': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.embed'); - isPipelineSpan = true; - break; - } - case 'ai.embed.doEmbed': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.embeddings'); - break; - } - case 'ai.embedMany': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.pipeline.embedMany'); - isPipelineSpan = true; - break; - } - case 'ai.embedMany.doEmbed': { - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.embeddings'); - break; - } - case 'ai.toolCall': - case 'ai.stream.firstChunk': - case 'ai.stream.finish': - span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'ai.run'); - break; - } - - addOriginToSpan.addOriginToSpan(span, 'auto.vercelai.otel'); - - const nameWthoutAi = name.replace('ai.', ''); - span.setAttribute('ai.pipeline.name', nameWthoutAi); - span.updateName(nameWthoutAi); - - // If a Telemetry name is set and it is a pipeline span, use that as the operation name - if (attributes['ai.telemetry.functionId'] && isPipelineSpan) { - span.updateName(attributes['ai.telemetry.functionId']); - span.setAttribute('ai.pipeline.name', attributes['ai.telemetry.functionId']); - } - - if (attributes['ai.prompt']) { - span.setAttribute('ai.input_messages', attributes['ai.prompt']); - } - if (attributes['ai.model.id']) { - span.setAttribute('ai.model_id', attributes['ai.model.id']); - } - span.setAttribute('ai.streaming', name.includes('stream')); - }); - }, + } }; -}) ; +}); -/** - * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library. - * - * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry). - * - * @example - * ```javascript - * const Sentry = require('@sentry/node'); - * - * Sentry.init({ - * integrations: [Sentry.vercelAIIntegration()], - * }); - * ``` - * - * By default this integration adds tracing support to all `ai` function calls. If you need to disable - * collecting spans for a specific call, you can do so by setting `experimental_telemetry.isEnabled` to - * `false` in the first argument of the function call. - * - * ```javascript - * const result = await generateText({ - * model: openai('gpt-4-turbo'), - * experimental_telemetry: { isEnabled: false }, - * }); - * ``` - * - * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each - * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs` - * to `true`. - * - * ```javascript - * const result = await generateText({ - * model: openai('gpt-4-turbo'), - * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true }, - * }); - */ -const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration); - -exports.instrumentVercelAi = instrumentVercelAi; -exports.vercelAIIntegration = vercelAIIntegration; -//# sourceMappingURL=index.js.map +exports.systemErrorIntegration = systemErrorIntegration; +//# sourceMappingURL=systemError.js.map /***/ }), -/***/ 15477: +/***/ 52453: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(20624); +const capture = __nccwpck_require__(97190); + +const DEFAULT_CAPTURED_LEVELS = ["trace", "debug", "info", "warn", "error", "fatal"]; +const LEVEL_SYMBOL = /* @__PURE__ */ Symbol.for("level"); +const MESSAGE_SYMBOL = /* @__PURE__ */ Symbol.for("message"); +const SPLAT_SYMBOL = /* @__PURE__ */ Symbol.for("splat"); +function createSentryWinstonTransport(TransportClass, sentryWinstonOptions) { + class SentryWinstonTransport extends TransportClass { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + constructor(options) { + super(options); + this._levels = new Set(sentryWinstonOptions?.levels ?? DEFAULT_CAPTURED_LEVELS); + } + /** + * Forwards a winston log to the Sentry SDK. + */ + log(info, callback) { + try { + setImmediate(() => { + this.emit("logged", info); + }); + if (!core.isObjectLike(info)) { + return; + } + const levelFromSymbol = info[LEVEL_SYMBOL]; + const { level, message, timestamp, ...attributes } = info; + attributes[LEVEL_SYMBOL] = void 0; + attributes[MESSAGE_SYMBOL] = void 0; + attributes[SPLAT_SYMBOL] = void 0; + const customLevel = sentryWinstonOptions?.customLevelMap?.[levelFromSymbol]; + const winstonLogLevel = WINSTON_LEVEL_TO_LOG_SEVERITY_LEVEL_MAP[levelFromSymbol]; + const logSeverityLevel = customLevel ?? winstonLogLevel ?? "info"; + if (this._levels.has(logSeverityLevel)) { + capture.captureLog(logSeverityLevel, message, { + ...attributes, + "sentry.origin": "auto.log.winston" + }); + } else if (!customLevel && !winstonLogLevel) { + debugBuild.DEBUG_BUILD && core.debug.log( + `Winston log level ${levelFromSymbol} is not captured by Sentry. Please add ${levelFromSymbol} to the "customLevelMap" option of the Sentry Winston transport.` + ); + } + } catch { + } + if (callback) { + callback(); + } + } + } + return SentryWinstonTransport; +} +const WINSTON_LEVEL_TO_LOG_SEVERITY_LEVEL_MAP = { + // npm + silly: "trace", + // npm and syslog + debug: "debug", + // npm + verbose: "debug", + // npm + http: "debug", + // npm and syslog + info: "info", + // syslog + notice: "info", + // npm + warn: "warn", + // syslog + warning: "warn", + // npm and syslog + error: "error", + // syslog + emerg: "fatal", + // syslog + alert: "fatal", + // syslog + crit: "fatal" +}; + +exports.createSentryWinstonTransport = createSentryWinstonTransport; +//# sourceMappingURL=winston.js.map + + +/***/ }), + +/***/ 97190: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const util = __nccwpck_require__(47261); const core = __nccwpck_require__(84466); -// List of patched methods -// From: https://sdk.vercel.ai/docs/ai-sdk-core/telemetry#collected-data -const INSTRUMENTED_METHODS = [ - 'generateText', - 'streamText', - 'generateObject', - 'streamObject', - 'embed', - 'embedMany', -] ; - -exports.sentryVercelAiPatched = false; - -/** - * This detects is added by the Sentry Vercel AI Integration to detect if the integration should - * be enabled. - * - * It also patches the `ai` module to enable Vercel AI telemetry automatically for all methods. - */ -class SentryVercelAiInstrumentation extends instrumentation.InstrumentationBase { - constructor(config = {}) { - super('@sentry/instrumentation-vercel-ai', core.SDK_VERSION, config); - } - - /** - * Initializes the instrumentation by defining the modules to be patched. - */ - init() { - const module = new instrumentation.InstrumentationNodeModuleDefinition('ai', ['>=3.0.0 <5'], this._patch.bind(this)); - return module; - } - - /** - * Patches module exports to enable Vercel AI telemetry. - */ - _patch(moduleExports) { - exports.sentryVercelAiPatched = true; - - function generatePatch(name) { - return (...args) => { - const existingExperimentalTelemetry = args[0].experimental_telemetry || {}; - const isEnabled = existingExperimentalTelemetry.isEnabled; - - // if `isEnabled` is not explicitly set to `true` or `false`, enable telemetry - // but disable capturing inputs and outputs by default - if (isEnabled === undefined) { - args[0].experimental_telemetry = { - isEnabled: true, - recordInputs: false, - recordOutputs: false, - ...existingExperimentalTelemetry, - }; - } - - // @ts-expect-error we know that the method exists - return moduleExports[name].apply(this, args); - }; - } - - const patchedModuleExports = INSTRUMENTED_METHODS.reduce((acc, curr) => { - acc[curr] = generatePatch(curr); - return acc; - }, {} ); - - return { ...moduleExports, ...patchedModuleExports }; +function captureLog(level, ...args) { + const [messageOrMessageTemplate, paramsOrAttributes, maybeAttributesOrMetadata, maybeMetadata] = args; + if (Array.isArray(paramsOrAttributes)) { + const attributes = { ...maybeAttributesOrMetadata }; + attributes["sentry.message.template"] = messageOrMessageTemplate; + paramsOrAttributes.forEach((param, index) => { + attributes[`sentry.message.parameter.${index}`] = param; + }); + const message = util.format(messageOrMessageTemplate, ...paramsOrAttributes); + core._INTERNAL_captureLog({ level, message, attributes }, maybeMetadata?.scope); + } else { + core._INTERNAL_captureLog( + { level, message: messageOrMessageTemplate, attributes: paramsOrAttributes }, + // type-casting here because from the type definitions we know that `maybeAttributesOrMetadata` is a metadata object (or undefined) + maybeAttributesOrMetadata?.scope ?? maybeMetadata?.scope + ); } } -exports.SentryVercelAiInstrumentation = SentryVercelAiInstrumentation; -//# sourceMappingURL=instrumentation.js.map +exports.captureLog = captureLog; +//# sourceMappingURL=capture.js.map /***/ }), -/***/ 88196: +/***/ 31344: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const capture = __nccwpck_require__(97190); +const core = __nccwpck_require__(84466); + +function trace(...args) { + capture.captureLog("trace", ...args); +} +function debug(...args) { + capture.captureLog("debug", ...args); +} +function info(...args) { + capture.captureLog("info", ...args); +} +function warn(...args) { + capture.captureLog("warn", ...args); +} +function error(...args) { + capture.captureLog("error", ...args); +} +function fatal(...args) { + capture.captureLog("fatal", ...args); +} + +exports.fmt = core.fmt; +exports.debug = debug; +exports.error = error; +exports.fatal = fatal; +exports.info = info; +exports.trace = trace; +exports.warn = warn; +//# sourceMappingURL=exports.js.map + + +/***/ }), + +/***/ 61523: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const NODE_VERSION = core.parseSemver(process.versions.node) ; +const NODE_VERSION = core.parseSemver(process.versions.node); const NODE_MAJOR = NODE_VERSION.major; +const NODE_MINOR = NODE_VERSION.minor; exports.NODE_MAJOR = NODE_MAJOR; +exports.NODE_MINOR = NODE_MINOR; exports.NODE_VERSION = NODE_VERSION; //# sourceMappingURL=nodeVersion.js.map /***/ }), -/***/ 37859: +/***/ 10402: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const contextAsyncHooks = __nccwpck_require__(81616); -const opentelemetry = __nccwpck_require__(78369); +const opentelemetry = __nccwpck_require__(90157); -/** - * This is a custom ContextManager for OpenTelemetry, which extends the default AsyncLocalStorageContextManager. - * It ensures that we create a new hub per context, so that the OTEL Context & the Sentry Hub are always in sync. - * - * Note that we currently only support AsyncHooks with this, - * but since this should work for Node 14+ anyhow that should be good enough. - */ -const SentryContextManager = opentelemetry.wrapContextManagerClass(contextAsyncHooks.AsyncLocalStorageContextManager); +const SentryContextManager = opentelemetry.SentryAsyncLocalStorageContextManager; exports.SentryContextManager = SentryContextManager; //# sourceMappingURL=contextManager.js.map @@ -89440,172 +45213,189 @@ exports.SentryContextManager = SentryContextManager; /***/ }), -/***/ 64074: +/***/ 17547: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const instrumentation = __nccwpck_require__(65584); -/** Exported only for tests. */ const INSTRUMENTED = {}; - -/** - * Instrument an OpenTelemetry instrumentation once. - * This will skip running instrumentation again if it was already instrumented. - */ -function generateInstrumentOnce( - name, - creator, -) { +function generateInstrumentOnce(name, creatorOrClass, optionsCallback) { + if (optionsCallback) { + return _generateInstrumentOnceWithOptions( + name, + creatorOrClass, + optionsCallback + ); + } + return _generateInstrumentOnce(name, creatorOrClass); +} +function _generateInstrumentOnce(name, creator) { return Object.assign( (options) => { const instrumented = INSTRUMENTED[name]; if (instrumented) { - // If options are provided, ensure we update them if (options) { instrumented.setConfig(options); } - return; + return instrumented; } - const instrumentation$1 = creator(options); INSTRUMENTED[name] = instrumentation$1; - instrumentation.registerInstrumentations({ - instrumentations: [instrumentation$1], + instrumentations: [instrumentation$1] }); + return instrumentation$1; }, - { id: name }, + { id: name } ); } +function _generateInstrumentOnceWithOptions(name, instrumentationClass, optionsCallback) { + return Object.assign( + (_options) => { + const options = optionsCallback(_options); + const instrumented = INSTRUMENTED[name]; + if (instrumented) { + instrumented.setConfig(options); + return instrumented; + } + const instrumentation$1 = new instrumentationClass(options); + INSTRUMENTED[name] = instrumentation$1; + instrumentation.registerInstrumentations({ + instrumentations: [instrumentation$1] + }); + return instrumentation$1; + }, + { id: name } + ); +} +function instrumentWhenWrapped(instrumentation) { + let isWrapped = false; + let callbacks = []; + if (!hasWrap(instrumentation)) { + isWrapped = true; + } else { + const originalWrap = instrumentation["_wrap"]; + instrumentation["_wrap"] = (...args) => { + isWrapped = true; + callbacks.forEach((callback) => callback()); + callbacks = []; + return originalWrap(...args); + }; + } + const registerCallback = (callback) => { + if (isWrapped) { + callback(); + } else { + callbacks.push(callback); + } + }; + return registerCallback; +} +function hasWrap(instrumentation) { + return typeof instrumentation["_wrap"] === "function"; +} exports.INSTRUMENTED = INSTRUMENTED; exports.generateInstrumentOnce = generateInstrumentOnce; +exports.instrumentWhenWrapped = instrumentWhenWrapped; //# sourceMappingURL=instrument.js.map /***/ }), -/***/ 88503: +/***/ 48811: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _nullishCoalesce -} = __nccwpck_require__(84466); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -Object.defineProperty(exports, "__esModule", ({ value: true })); +const api = __nccwpck_require__(65163); +const core = __nccwpck_require__(84466); + +function setupOpenTelemetryLogger() { + api.diag.disable(); + api.diag.setLogger( + { + error: core.debug.error, + warn: core.debug.warn, + info: core.debug.log, + debug: core.debug.log, + verbose: core.debug.log + }, + api.DiagLogLevel.DEBUG + ); +} + +exports.setupOpenTelemetryLogger = setupOpenTelemetryLogger; +//# sourceMappingURL=logger.js.map + + +/***/ }), + +/***/ 15337: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const http = __nccwpck_require__(88849); __nccwpck_require__(22286); -/** -* This code was originally forked from https://github.com/TooTallNate/proxy-agents/tree/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7 -* With the following LICENSE: -* -* (The MIT License) -* -* Copyright (c) 2013 Nathan Rajlich * -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* 'Software'), to deal in the Software without restriction, including -* without limitation the rights to use, copy, modify, merge, publish, -* distribute, sublicense, and/or sell copies of the Software, and to -* permit persons to whom the Software is furnished to do so, subject to -* the following conditions:* -* -* The above copyright notice and this permission notice shall be -* included in all copies or substantial portions of the Software.* -* -* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -const INTERNAL = Symbol('AgentBaseInternalState'); - -class Agent extends http.Agent { - - // Set by `http.Agent` - missing from `@types/node` - +var _a; +const INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState"); +class Agent extends (_a = http.Agent, _a) { constructor(opts) { super(opts); this[INTERNAL] = {}; } - /** * Determine whether this is an `http` or `https` request. */ isSecureEndpoint(options) { if (options) { - // First check the `secureEndpoint` property explicitly, since this - // means that a parent `Agent` is "passing through" to this instance. - if (typeof (options ).secureEndpoint === 'boolean') { + if (typeof options.secureEndpoint === "boolean") { return options.secureEndpoint; } - - // If no explicit `secure` endpoint, check if `protocol` property is - // set. This will usually be the case since using a full string URL - // or `URL` instance should be the most common usage. - if (typeof options.protocol === 'string') { - return options.protocol === 'https:'; + if (typeof options.protocol === "string") { + return options.protocol === "https:"; } } - - // Finally, if no `protocol` property was set, then fall back to - // checking the stack trace of the current call stack, and try to - // detect the "https" module. const { stack } = new Error(); - if (typeof stack !== 'string') return false; - return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); + if (typeof stack !== "string") return false; + return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1); } - createSocket(req, options, cb) { const connectOpts = { ...options, - secureEndpoint: this.isSecureEndpoint(options), + secureEndpoint: this.isSecureEndpoint(options) }; - Promise.resolve() - .then(() => this.connect(req, connectOpts)) - .then(socket => { - if (socket instanceof http.Agent) { - // @ts-expect-error `addRequest()` isn't defined in `@types/node` - return socket.addRequest(req, connectOpts); - } - this[INTERNAL].currentSocket = socket; - // @ts-expect-error `createSocket()` isn't defined in `@types/node` - super.createSocket(req, options, cb); - }, cb); + Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => { + if (socket instanceof http.Agent) { + return socket.addRequest(req, connectOpts); + } + this[INTERNAL].currentSocket = socket; + super.createSocket(req, options, cb); + }, cb); } - createConnection() { const socket = this[INTERNAL].currentSocket; - this[INTERNAL].currentSocket = undefined; + this[INTERNAL].currentSocket = void 0; if (!socket) { - throw new Error('No socket was returned in the `connect()` function'); + throw new Error("No socket was returned in the `connect()` function"); } return socket; } - get defaultPort() { - return _nullishCoalesce(this[INTERNAL].defaultPort, () => ( (this.protocol === 'https:' ? 443 : 80))); + return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); } - set defaultPort(v) { if (this[INTERNAL]) { this[INTERNAL].defaultPort = v; } } - get protocol() { - return _nullishCoalesce(this[INTERNAL].protocol, () => ( (this.isSecureEndpoint() ? 'https:' : 'http:'))); + return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); } - set protocol(v) { if (this[INTERNAL]) { this[INTERNAL].protocol = v; @@ -89619,176 +45409,110 @@ exports.Agent = Agent; /***/ }), -/***/ 62941: +/***/ 82063: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _nullishCoalesce, - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const net = __nccwpck_require__(87503); const tls = __nccwpck_require__(31764); const core = __nccwpck_require__(84466); -const base = __nccwpck_require__(88503); -const parseProxyResponse = __nccwpck_require__(13317); +const base = __nccwpck_require__(15337); +const parseProxyResponse = __nccwpck_require__(60286); -function debug(...args) { - core.logger.log('[https-proxy-agent]', ...args); +function debugLog(...args) { + core.debug.log("[https-proxy-agent]", ...args); } - -/** - * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to - * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests. - * - * Outgoing HTTP requests are first tunneled through the proxy server using the - * `CONNECT` HTTP request method to establish a connection to the proxy server, - * and then the proxy server connects to the destination target and issues the - * HTTP request from the proxy server. - * - * `https:` requests have their socket connection upgraded to TLS once - * the connection to the proxy server has been established. - */ class HttpsProxyAgent extends base.Agent { - static __initStatic() {this.protocols = ['http', 'https']; } - constructor(proxy, opts) { super(opts); this.options = {}; - this.proxy = typeof proxy === 'string' ? new URL(proxy) : proxy; - this.proxyHeaders = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _2 => _2.headers]), () => ( {})); - debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href); - - // Trim off the brackets from IPv6 addresses - const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ''); - const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === 'https:' ? 443 : 80; + this.proxy = typeof proxy === "string" ? new URL(proxy) : proxy; + this.proxyHeaders = opts?.headers ?? {}; + debugLog("Creating new HttpsProxyAgent instance: %o", this.proxy.href); + const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); + const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; this.connectOpts = { // Attempt to negotiate http/1.1 for proxy servers that support http/2 - ALPNProtocols: ['http/1.1'], - ...(opts ? omit(opts, 'headers') : null), + ALPNProtocols: ["http/1.1"], + ...opts ? omit(opts, "headers") : null, host, - port, + port }; } - /** * Called when the node-core HTTP client library is creating a * new HTTP request. */ async connect(req, opts) { const { proxy } = this; - if (!opts.host) { throw new TypeError('No "host" provided'); } - - // Create a socket connection to the proxy server. let socket; - if (proxy.protocol === 'https:') { - debug('Creating `tls.Socket`: %o', this.connectOpts); + if (proxy.protocol === "https:") { + debugLog("Creating `tls.Socket`: %o", this.connectOpts); const servername = this.connectOpts.servername || this.connectOpts.host; socket = tls.connect({ ...this.connectOpts, - servername: servername && net.isIP(servername) ? undefined : servername, + servername: servername && net.isIP(servername) ? void 0 : servername }); } else { - debug('Creating `net.Socket`: %o', this.connectOpts); + debugLog("Creating `net.Socket`: %o", this.connectOpts); socket = net.connect(this.connectOpts); } - - const headers = - typeof this.proxyHeaders === 'function' ? this.proxyHeaders() : { ...this.proxyHeaders }; + const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host; - let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`; - - // Inject the `Proxy-Authorization` header if necessary. + let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r +`; if (proxy.username || proxy.password) { const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - headers.Host = `${host}:${opts.port}`; - - if (!headers['Proxy-Connection']) { - headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close'; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } for (const name of Object.keys(headers)) { - payload += `${name}: ${headers[name]}\r\n`; + payload += `${name}: ${headers[name]}\r +`; } - const proxyResponsePromise = parseProxyResponse.parseProxyResponse(socket); - - socket.write(`${payload}\r\n`); - + socket.write(`${payload}\r +`); const { connect, buffered } = await proxyResponsePromise; - req.emit('proxyConnect', connect); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore Not EventEmitter in Node types - this.emit('proxyConnect', connect, req); - + req.emit("proxyConnect", connect); + this.emit("proxyConnect", connect, req); if (connect.statusCode === 200) { - req.once('socket', resume); - + req.once("socket", resume); if (opts.secureEndpoint) { - // The proxy is connecting to a TLS server, so upgrade - // this socket connection to a TLS connection. - debug('Upgrading socket connection to TLS'); + debugLog("Upgrading socket connection to TLS"); const servername = opts.servername || opts.host; return tls.connect({ - ...omit(opts, 'host', 'path', 'port'), + ...omit(opts, "host", "path", "port"), socket, - servername: net.isIP(servername) ? undefined : servername, + servername: net.isIP(servername) ? void 0 : servername }); } - return socket; } - - // Some other status code that's not 200... need to re-play the HTTP - // header "data" events onto the socket once the HTTP machinery is - // attached so that the node core `http` can parse and handle the - // error status code. - - // Close the original socket, and a new "fake" socket is returned - // instead, so that the proxy doesn't get the HTTP request - // written to it (which may contain `Authorization` headers or other - // sensitive data). - // - // See: https://hackerone.com/reports/541502 socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); fakeSocket.readable = true; - - // Need to wait for the "socket" event to re-play the "data" events. - req.once('socket', (s) => { - debug('Replaying proxy buffer for failed request'); - // Replay the "buffered" Buffer onto the fake `socket`, since at - // this point the HTTP module machinery has been hooked up for - // the user. + req.once("socket", (s) => { + debugLog("Replaying proxy buffer for failed request"); s.push(buffered); s.push(null); }); - return fakeSocket; } -}HttpsProxyAgent.__initStatic(); - +} +HttpsProxyAgent.protocols = ["http", "https"]; function resume(socket) { socket.resume(); } - -function omit( - obj, - ...keys -) - - { - const ret = {} - -; +function omit(obj, ...keys) { + const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { @@ -89804,77 +45528,63 @@ exports.HttpsProxyAgent = HttpsProxyAgent; /***/ }), -/***/ 13317: +/***/ 60286: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -function debug(...args) { - core.logger.log('[https-proxy-agent:parse-proxy-response]', ...args); +function debugLog(...args) { + core.debug.log("[https-proxy-agent:parse-proxy-response]", ...args); } - function parseProxyResponse(socket) { return new Promise((resolve, reject) => { - // we need to buffer any HTTP traffic that happens with the proxy before we get - // the CONNECT response, so that if the response is anything other than an "200" - // response code, then we can re-play the "data" events on the socket once the - // HTTP parser is hooked up... let buffersLength = 0; const buffers = []; - function read() { const b = socket.read(); if (b) ondata(b); - else socket.once('readable', read); + else socket.once("readable", read); } - function cleanup() { - socket.removeListener('end', onend); - socket.removeListener('error', onerror); - socket.removeListener('readable', read); + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("readable", read); } - function onend() { cleanup(); - debug('onend'); - reject(new Error('Proxy connection ended before receiving CONNECT response')); + debugLog("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); } - function onerror(err) { cleanup(); - debug('onerror %o', err); + debugLog("onerror %o", err); reject(err); } - function ondata(b) { buffers.push(b); buffersLength += b.length; - const buffered = Buffer.concat(buffers, buffersLength); - const endOfHeaders = buffered.indexOf('\r\n\r\n'); - + const endOfHeaders = buffered.indexOf("\r\n\r\n"); if (endOfHeaders === -1) { - // keep buffering - debug('have not received end of HTTP headers yet...'); + debugLog("have not received end of HTTP headers yet..."); read(); return; } - - const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n'); + const headerParts = buffered.subarray(0, endOfHeaders).toString("ascii").split("\r\n"); const firstLine = headerParts.shift(); if (!firstLine) { socket.destroy(); - return reject(new Error('No header received from proxy CONNECT response')); + return reject(new Error("No header received from proxy CONNECT response")); } - const firstLineParts = firstLine.split(' '); + const firstLineParts = firstLine.split(" "); const statusCode = +(firstLineParts[1] || 0); - const statusText = firstLineParts.slice(2).join(' '); + const statusText = firstLineParts.slice(2).join(" "); const headers = {}; for (const header of headerParts) { if (!header) continue; - const firstColon = header.indexOf(':'); + const firstColon = header.indexOf(":"); if (firstColon === -1) { socket.destroy(); return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); @@ -89882,7 +45592,7 @@ function parseProxyResponse(socket) { const key = header.slice(0, firstColon).toLowerCase(); const value = header.slice(firstColon + 1).trimStart(); const current = headers[key]; - if (typeof current === 'string') { + if (typeof current === "string") { headers[key] = [current, value]; } else if (Array.isArray(current)) { current.push(value); @@ -89890,21 +45600,19 @@ function parseProxyResponse(socket) { headers[key] = value; } } - debug('got proxy server response: %o %o', firstLine, headers); + debugLog("got proxy server response: %o %o", firstLine, headers); cleanup(); resolve({ connect: { statusCode, statusText, - headers, + headers }, - buffered, + buffered }); } - - socket.on('error', onerror); - socket.on('end', onend); - + socket.on("error", onerror); + socket.on("end", onend); read(); }); } @@ -89915,121 +45623,65 @@ exports.parseProxyResponse = parseProxyResponse; /***/ }), -/***/ 75168: +/***/ 50320: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const module$1 = __nccwpck_require__(64177); +const module$1 = __nccwpck_require__(53376); -/** - * Returns a release dynamically from environment variables. - */ -// eslint-disable-next-line complexity function getSentryRelease(fallback) { - // Always read first as Sentry takes this as precedence if (process.env.SENTRY_RELEASE) { return process.env.SENTRY_RELEASE; } - - // This supports the variable that sentry-webpack-plugin injects - if (core.GLOBAL_OBJ.SENTRY_RELEASE && core.GLOBAL_OBJ.SENTRY_RELEASE.id) { + if (core.GLOBAL_OBJ.SENTRY_RELEASE?.id) { return core.GLOBAL_OBJ.SENTRY_RELEASE.id; } - - // This list is in approximate alpha order, separated into 3 categories: - // 1. Git providers - // 2. CI providers with specific environment variables (has the provider name in the variable name) - // 3. CI providers with generic environment variables (checked for last to prevent possible false positives) - - const possibleReleaseNameOfGitProvider = + const possibleReleaseNameOfGitProvider = ( // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables - process.env['GITHUB_SHA'] || - // GitLab CI - https://docs.gitlab.com/ee/ci/variables/predefined_variables.html - process.env['CI_MERGE_REQUEST_SOURCE_BRANCH_SHA'] || - process.env['CI_BUILD_REF'] || - process.env['CI_COMMIT_SHA'] || - // Bitbucket - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/ - process.env['BITBUCKET_COMMIT']; - - const possibleReleaseNameOfCiProvidersWithSpecificEnvVar = - // AppVeyor - https://www.appveyor.com/docs/environment-variables/ - process.env['APPVEYOR_PULL_REQUEST_HEAD_COMMIT'] || - process.env['APPVEYOR_REPO_COMMIT'] || - // AWS CodeBuild - https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html - process.env['CODEBUILD_RESOLVED_SOURCE_VERSION'] || - // AWS Amplify - https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html - process.env['AWS_COMMIT_ID'] || - // Azure Pipelines - https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml - process.env['BUILD_SOURCEVERSION'] || - // Bitrise - https://devcenter.bitrise.io/builds/available-environment-variables/ - process.env['GIT_CLONE_COMMIT_HASH'] || - // Buddy CI - https://buddy.works/docs/pipelines/environment-variables#default-environment-variables - process.env['BUDDY_EXECUTION_REVISION'] || - // Builtkite - https://buildkite.com/docs/pipelines/environment-variables - process.env['BUILDKITE_COMMIT'] || - // CircleCI - https://circleci.com/docs/variables/ - process.env['CIRCLE_SHA1'] || - // Cirrus CI - https://cirrus-ci.org/guide/writing-tasks/#environment-variables - process.env['CIRRUS_CHANGE_IN_REPO'] || - // Codefresh - https://codefresh.io/docs/docs/codefresh-yaml/variables/ - process.env['CF_REVISION'] || - // Codemagic - https://docs.codemagic.io/yaml-basic-configuration/environment-variables/ - process.env['CM_COMMIT'] || - // Cloudflare Pages - https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables - process.env['CF_PAGES_COMMIT_SHA'] || - // Drone - https://docs.drone.io/pipeline/environment/reference/ - process.env['DRONE_COMMIT_SHA'] || - // Flightcontrol - https://www.flightcontrol.dev/docs/guides/flightcontrol/environment-variables#built-in-environment-variables - process.env['FC_GIT_COMMIT_SHA'] || - // Heroku #1 https://devcenter.heroku.com/articles/heroku-ci - process.env['HEROKU_TEST_RUN_COMMIT_VERSION'] || - // Heroku #2 https://docs.sentry.io/product/integrations/deployment/heroku/#configure-releases - process.env['HEROKU_SLUG_COMMIT'] || - // Railway - https://docs.railway.app/reference/variables#git-variables - process.env['RAILWAY_GIT_COMMIT_SHA'] || - // Render - https://render.com/docs/environment-variables - process.env['RENDER_GIT_COMMIT'] || - // Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables - process.env['SEMAPHORE_GIT_SHA'] || - // TravisCI - https://docs.travis-ci.com/user/environment-variables/#default-environment-variables - process.env['TRAVIS_PULL_REQUEST_SHA'] || - // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables - process.env['VERCEL_GIT_COMMIT_SHA'] || - process.env['VERCEL_GITHUB_COMMIT_SHA'] || - process.env['VERCEL_GITLAB_COMMIT_SHA'] || - process.env['VERCEL_BITBUCKET_COMMIT_SHA'] || - // Zeit (now known as Vercel) - process.env['ZEIT_GITHUB_COMMIT_SHA'] || - process.env['ZEIT_GITLAB_COMMIT_SHA'] || - process.env['ZEIT_BITBUCKET_COMMIT_SHA']; - - const possibleReleaseNameOfCiProvidersWithGenericEnvVar = - // CloudBees CodeShip - https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables - process.env['CI_COMMIT_ID'] || - // Coolify - https://coolify.io/docs/knowledge-base/environment-variables - process.env['SOURCE_COMMIT'] || - // Heroku #3 https://devcenter.heroku.com/changelog-items/630 - process.env['SOURCE_VERSION'] || - // Jenkins - https://plugins.jenkins.io/git/#environment-variables - process.env['GIT_COMMIT'] || - // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata - process.env['COMMIT_REF'] || - // TeamCity - https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html - process.env['BUILD_VCS_NUMBER'] || - // Woodpecker CI - https://woodpecker-ci.org/docs/usage/environment - process.env['CI_COMMIT_SHA']; - - return ( - possibleReleaseNameOfGitProvider || - possibleReleaseNameOfCiProvidersWithSpecificEnvVar || - possibleReleaseNameOfCiProvidersWithGenericEnvVar || - fallback + process.env["GITHUB_SHA"] || // GitLab CI - https://docs.gitlab.com/ee/ci/variables/predefined_variables.html + process.env["CI_MERGE_REQUEST_SOURCE_BRANCH_SHA"] || process.env["CI_BUILD_REF"] || process.env["CI_COMMIT_SHA"] || // Bitbucket - https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/ + process.env["BITBUCKET_COMMIT"] ); + const possibleReleaseNameOfCiProvidersWithSpecificEnvVar = ( + // AppVeyor - https://www.appveyor.com/docs/environment-variables/ + process.env["APPVEYOR_PULL_REQUEST_HEAD_COMMIT"] || process.env["APPVEYOR_REPO_COMMIT"] || // AWS CodeBuild - https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html + process.env["CODEBUILD_RESOLVED_SOURCE_VERSION"] || // AWS Amplify - https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html + process.env["AWS_COMMIT_ID"] || // Azure Pipelines - https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml + process.env["BUILD_SOURCEVERSION"] || // Bitrise - https://devcenter.bitrise.io/builds/available-environment-variables/ + process.env["GIT_CLONE_COMMIT_HASH"] || // Buddy CI - https://buddy.works/docs/pipelines/environment-variables#default-environment-variables + process.env["BUDDY_EXECUTION_REVISION"] || // Builtkite - https://buildkite.com/docs/pipelines/environment-variables + process.env["BUILDKITE_COMMIT"] || // CircleCI - https://circleci.com/docs/variables/ + process.env["CIRCLE_SHA1"] || // Cirrus CI - https://cirrus-ci.org/guide/writing-tasks/#environment-variables + process.env["CIRRUS_CHANGE_IN_REPO"] || // Codefresh - https://codefresh.io/docs/docs/codefresh-yaml/variables/ + process.env["CF_REVISION"] || // Codemagic - https://docs.codemagic.io/yaml-basic-configuration/environment-variables/ + process.env["CM_COMMIT"] || // Cloudflare Pages - https://developers.cloudflare.com/pages/platform/build-configuration/#environment-variables + process.env["CF_PAGES_COMMIT_SHA"] || // Drone - https://docs.drone.io/pipeline/environment/reference/ + process.env["DRONE_COMMIT_SHA"] || // Flightcontrol - https://www.flightcontrol.dev/docs/guides/flightcontrol/environment-variables#built-in-environment-variables + process.env["FC_GIT_COMMIT_SHA"] || // Heroku #1 https://devcenter.heroku.com/articles/heroku-ci + process.env["HEROKU_TEST_RUN_COMMIT_VERSION"] || // Heroku #2 https://devcenter.heroku.com/articles/dyno-metadata#dyno-metadata + process.env["HEROKU_BUILD_COMMIT"] || // Heroku #3 (deprecated by Heroku, kept for backward compatibility) + process.env["HEROKU_SLUG_COMMIT"] || // Railway - https://docs.railway.app/reference/variables#git-variables + process.env["RAILWAY_GIT_COMMIT_SHA"] || // Render - https://render.com/docs/environment-variables + process.env["RENDER_GIT_COMMIT"] || // Semaphore CI - https://docs.semaphoreci.com/ci-cd-environment/environment-variables + process.env["SEMAPHORE_GIT_SHA"] || // TravisCI - https://docs.travis-ci.com/user/environment-variables/#default-environment-variables + process.env["TRAVIS_PULL_REQUEST_SHA"] || // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables + process.env["VERCEL_GIT_COMMIT_SHA"] || process.env["VERCEL_GITHUB_COMMIT_SHA"] || process.env["VERCEL_GITLAB_COMMIT_SHA"] || process.env["VERCEL_BITBUCKET_COMMIT_SHA"] || // Zeit (now known as Vercel) + process.env["ZEIT_GITHUB_COMMIT_SHA"] || process.env["ZEIT_GITLAB_COMMIT_SHA"] || process.env["ZEIT_BITBUCKET_COMMIT_SHA"] + ); + const possibleReleaseNameOfCiProvidersWithGenericEnvVar = ( + // CloudBees CodeShip - https://docs.cloudbees.com/docs/cloudbees-codeship/latest/pro-builds-and-configuration/environment-variables + process.env["CI_COMMIT_ID"] || // Coolify - https://coolify.io/docs/knowledge-base/environment-variables + process.env["SOURCE_COMMIT"] || // Heroku #3 https://devcenter.heroku.com/changelog-items/630 + process.env["SOURCE_VERSION"] || // Jenkins - https://plugins.jenkins.io/git/#environment-variables + process.env["GIT_COMMIT"] || // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata + process.env["COMMIT_REF"] || // TeamCity - https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html + process.env["BUILD_VCS_NUMBER"] || // Woodpecker CI - https://woodpecker-ci.org/docs/usage/environment + process.env["CI_COMMIT_SHA"] + ); + return possibleReleaseNameOfGitProvider || possibleReleaseNameOfCiProvidersWithSpecificEnvVar || possibleReleaseNameOfCiProvidersWithGenericEnvVar || fallback; } - -/** Node.js stack parser */ const defaultStackParser = core.createStackParser(core.nodeStackLineParser(module$1.createGetModuleFromFilename())); exports.defaultStackParser = defaultStackParser; @@ -90039,97 +45691,92 @@ exports.getSentryRelease = getSentryRelease; /***/ }), -/***/ 49951: +/***/ 5789: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _nullishCoalesce, - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const os = __nccwpck_require__(70612); const api = __nccwpck_require__(65163); const instrumentation = __nccwpck_require__(65584); const core = __nccwpck_require__(84466); -const opentelemetry = __nccwpck_require__(78369); +const opentelemetry = __nccwpck_require__(90157); const worker_threads = __nccwpck_require__(71267); -const debugBuild = __nccwpck_require__(8421); +const debugBuild = __nccwpck_require__(20624); -const DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS = 60000; // 60s was chosen arbitrarily - -/** A client for using Sentry with Node & OpenTelemetry. */ +const DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS = 6e4; class NodeClient extends core.ServerRuntimeClient { - - constructor(options) { + constructor(options) { + const serverName = options.includeServerName === false ? void 0 : options.serverName || global.process.env.SENTRY_NAME || os.hostname(); const clientOptions = { ...options, - platform: 'node', - runtime: { name: 'node', version: global.process.version }, - serverName: options.serverName || global.process.env.SENTRY_NAME || os.hostname(), + platform: "node", + // Use provided runtime or default to 'node' with current process version + runtime: options.runtime || { name: "node", version: global.process.version }, + serverName }; - if (options.openTelemetryInstrumentations) { instrumentation.registerInstrumentations({ - instrumentations: options.openTelemetryInstrumentations, + instrumentations: options.openTelemetryInstrumentations }); } - - core.applySdkMetadata(clientOptions, 'node'); - - core.logger.log( - `Initializing Sentry: process: ${process.pid}, thread: ${worker_threads.isMainThread ? 'main' : `worker-${worker_threads.threadId}`}.`, - ); - + core.applySdkMetadata(clientOptions, "node"); + core.debug.log(`Initializing Sentry: process: ${process.pid}, thread: ${worker_threads.isMainThread ? "main" : `worker-${worker_threads.threadId}`}.`); super(clientOptions); + if (this.getOptions().enableLogs) { + this._logOnExitFlushListener = () => { + core._INTERNAL_flushLogsBuffer(this); + }; + if (serverName) { + this.on("beforeCaptureLog", (log) => { + log.attributes = { + ...log.attributes, + "server.address": serverName + }; + }); + } + process.on("beforeExit", this._logOnExitFlushListener); + } + core._INTERNAL_setDeferSegmentSpanCapture(this); } - /** Get the OTEL tracer. */ - get tracer() { + get tracer() { if (this._tracer) { return this._tracer; } - - const name = '@sentry/node'; + const name = "@sentry/node"; const version = core.SDK_VERSION; const tracer = api.trace.getTracer(name, version); this._tracer = tracer; - return tracer; } - - // Eslint ignore explanation: This is already documented in super. - // eslint-disable-next-line jsdoc/require-jsdoc - async flush(timeout) { - const provider = this.traceProvider; - const spanProcessor = _optionalChain([provider, 'optionalAccess', _ => _.activeSpanProcessor]); - - if (spanProcessor) { - await spanProcessor.forceFlush(); - } - + /** @inheritDoc */ + // @ts-expect-error - PromiseLike is a subset of Promise + async flush(timeout) { + await this.traceProvider?.forceFlush(); if (this.getOptions().sendClientReports) { this._flushOutcomes(); } - return super.flush(timeout); } - - // Eslint ignore explanation: This is already documented in super. - // eslint-disable-next-line jsdoc/require-jsdoc - close(timeout) { + /** @inheritDoc */ + // @ts-expect-error - PromiseLike is a subset of Promise + async close(timeout) { if (this._clientReportInterval) { clearInterval(this._clientReportInterval); } - if (this._clientReportOnExitFlushListener) { - process.off('beforeExit', this._clientReportOnExitFlushListener); + process.off("beforeExit", this._clientReportOnExitFlushListener); } - - return super.close(timeout); + if (this._logOnExitFlushListener) { + process.off("beforeExit", this._logOnExitFlushListener); + } + const allEventsSent = await super.close(timeout); + if (this.traceProvider) { + await this.traceProvider.shutdown(); + } + return allEventsSent; } - /** * Will start tracking client reports for this client. * @@ -90145,32 +45792,29 @@ class NodeClient extends core.ServerRuntimeClient { // over again would also result in memory leaks. // Note: We have experimented with using `FinalizationRegisty` to clear the interval when the client is garbage // collected, but it did not work, because the cleanup function never got called. - startClientReportTracking() { + startClientReportTracking() { const clientOptions = this.getOptions(); if (clientOptions.sendClientReports) { this._clientReportOnExitFlushListener = () => { this._flushOutcomes(); }; - this._clientReportInterval = setInterval(() => { - debugBuild.DEBUG_BUILD && core.logger.log('Flushing client reports based on interval.'); + debugBuild.DEBUG_BUILD && core.debug.log("Flushing client reports based on interval."); this._flushOutcomes(); - }, _nullishCoalesce(clientOptions.clientReportFlushInterval, () => ( DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS))) - // Unref is critical for not preventing the process from exiting because the interval is active. - .unref(); - - process.on('beforeExit', this._clientReportOnExitFlushListener); + }, clientOptions.clientReportFlushInterval ?? DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS).unref(); + process.on("beforeExit", this._clientReportOnExitFlushListener); } } - + /** @inheritDoc */ + _setupIntegrations() { + core._INTERNAL_clearAiProviderSkips(); + super._setupIntegrations(); + } /** Custom implementation for OTEL, so we can handle scope-span linking. */ - _getTraceInfoFromScope( - scope, - ) { + _getTraceInfoFromScope(scope) { if (!scope) { - return [undefined, undefined]; + return [void 0, void 0]; } - return opentelemetry.getTraceContextForScope(this, scope); } } @@ -90181,297 +45825,214 @@ exports.NodeClient = NodeClient; /***/ }), -/***/ 59198: +/***/ 91196: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const opentelemetry = __nccwpck_require__(78369); -const debugBuild = __nccwpck_require__(8421); -const childProcess = __nccwpck_require__(13557); -const console$1 = __nccwpck_require__(61139); -const context = __nccwpck_require__(15834); -const contextlines = __nccwpck_require__(57582); -const index = __nccwpck_require__(50289); -const index$1 = __nccwpck_require__(4530); -const modules = __nccwpck_require__(43791); -const nodeFetch = __nccwpck_require__(40839); -const onuncaughtexception = __nccwpck_require__(79100); -const onunhandledrejection = __nccwpck_require__(70694); -const spotlight = __nccwpck_require__(23284); -const index$2 = __nccwpck_require__(59020); -const http = __nccwpck_require__(73009); -const commonjs = __nccwpck_require__(38743); -const envToBool = __nccwpck_require__(5606); -const api = __nccwpck_require__(75168); -const client = __nccwpck_require__(49951); -const initOtel = __nccwpck_require__(16049); +const importInTheMiddle = __nccwpck_require__(36151); +const moduleModule = __nccwpck_require__(98188); +const detection = __nccwpck_require__(63992); -function getCjsOnlyIntegrations() { - return commonjs.isCjs() ? [modules.modulesIntegration()] : []; +var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; +function initializeEsmLoader() { + if (!detection.supportsEsmLoaderHooks()) { + return; + } + if (!core.GLOBAL_OBJ._sentryEsmLoaderHookRegistered) { + core.GLOBAL_OBJ._sentryEsmLoaderHookRegistered = true; + try { + const { addHookMessagePort } = importInTheMiddle.createAddHookMessageChannel(); + moduleModule.register("import-in-the-middle/hook.mjs", (typeof document === 'undefined' ? (__nccwpck_require__(57310).pathToFileURL)(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('sdk/esmLoader.js', document.baseURI).href)), { + data: { addHookMessagePort, include: [] }, + transferList: [addHookMessagePort] + }); + } catch (error) { + core.debug.warn("Failed to register 'import-in-the-middle' hook", error); + } + } } -/** - * Get default integrations, excluding performance. - */ -function getDefaultIntegrationsWithoutPerformance() { +exports.initializeEsmLoader = initializeEsmLoader; +//# sourceMappingURL=esmLoader.js.map + + +/***/ }), + +/***/ 88895: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(90157); +const debugBuild = __nccwpck_require__(20624); +const childProcess = __nccwpck_require__(57342); +const context = __nccwpck_require__(33141); +const contextlines = __nccwpck_require__(23751); +const index = __nccwpck_require__(68798); +const index$2 = __nccwpck_require__(43482); +const modules = __nccwpck_require__(82516); +const index$1 = __nccwpck_require__(18285); +const onuncaughtexception = __nccwpck_require__(93244); +const onunhandledrejection = __nccwpck_require__(68319); +const processSession = __nccwpck_require__(80397); +const spotlight = __nccwpck_require__(27254); +const console$1 = __nccwpck_require__(48597); +const systemError = __nccwpck_require__(8651); +const http = __nccwpck_require__(87973); +const spotlight$1 = __nccwpck_require__(28737); +const api = __nccwpck_require__(50320); +const client = __nccwpck_require__(5789); +const esmLoader = __nccwpck_require__(91196); + +function getDefaultIntegrations() { return [ // Common + // TODO(v11): Replace with `eventFiltersIntegration` once we remove the deprecated `inboundFiltersIntegration` + // eslint-disable-next-line typescript/no-deprecated core.inboundFiltersIntegration(), core.functionToStringIntegration(), core.linkedErrorsIntegration(), core.requestDataIntegration(), + systemError.systemErrorIntegration(), + core.conversationIdIntegration(), // Native Wrappers console$1.consoleIntegration(), index.httpIntegration(), - nodeFetch.nativeNodeFetchIntegration(), + index$1.nativeNodeFetchIntegration(), // Global Handlers onuncaughtexception.onUncaughtExceptionIntegration(), onunhandledrejection.onUnhandledRejectionIntegration(), // Event Info contextlines.contextLinesIntegration(), - index$1.localVariablesIntegration(), + index$2.localVariablesIntegration(), context.nodeContextIntegration(), childProcess.childProcessIntegration(), - ...getCjsOnlyIntegrations(), + processSession.processSessionIntegration(), + modules.modulesIntegration() ]; } - -/** Get the default integrations for the Node SDK. */ -function getDefaultIntegrations(options) { - return [ - ...getDefaultIntegrationsWithoutPerformance(), - // We only add performance integrations if tracing is enabled - // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added - // This means that generally request isolation will work (because that is done by httpIntegration) - // But `transactionName` will not be set automatically - ...(shouldAddPerformanceIntegrations(options) ? index$2.getAutoPerformanceIntegrations() : []), - ]; -} - -function shouldAddPerformanceIntegrations(options) { - if (!core.hasTracingEnabled(options)) { - return false; - } - - // We want to ensure `tracesSampleRate` is not just undefined/null here - // eslint-disable-next-line deprecation/deprecation - return options.enableTracing || options.tracesSampleRate != null || 'tracesSampler' in options; -} - -/** - * Initialize Sentry for Node. - */ function init(options = {}) { return _init(options, getDefaultIntegrations); } - -/** - * Initialize Sentry for Node, without any integrations added by default. - */ function initWithoutDefaultIntegrations(options = {}) { return _init(options, () => []); } - -/** - * Initialize Sentry for Node, without performance instrumentation. - */ -function _init( - _options = {}, - getDefaultIntegrationsImpl, -) { +function _init(_options = {}, getDefaultIntegrationsImpl) { const options = getClientOptions(_options, getDefaultIntegrationsImpl); - if (options.debug === true) { if (debugBuild.DEBUG_BUILD) { - core.logger.enable(); + core.debug.enable(); } else { - // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped core.consoleSandbox(() => { - // eslint-disable-next-line no-console - console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.'); + console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."); }); } } - - if (!commonjs.isCjs() && options.registerEsmLoaderHooks !== false) { - initOtel.maybeInitializeEsmLoader(options.registerEsmLoaderHooks === true ? undefined : options.registerEsmLoaderHooks); + if (options.registerEsmLoaderHooks !== false) { + esmLoader.initializeEsmLoader(); } - - opentelemetry.setOpenTelemetryContextAsyncContextStrategy(); - + opentelemetry.setOpenTelemetryContextAsyncContextStrategy(options); const scope = core.getCurrentScope(); scope.update(options.initialScope); - if (options.spotlight && !options.integrations.some(({ name }) => name === spotlight.INTEGRATION_NAME)) { options.integrations.push( spotlight.spotlightIntegration({ - sidecarUrl: typeof options.spotlight === 'string' ? options.spotlight : undefined, - }), + sidecarUrl: typeof options.spotlight === "string" ? options.spotlight : void 0 + }) ); } - + core.applySdkMetadata(options, "node-core"); const client$1 = new client.NodeClient(options); - // The client is on the current scope, from where it generally is inherited core.getCurrentScope().setClient(client$1); - client$1.init(); - - core.logger.log(`Running in ${commonjs.isCjs() ? 'CommonJS' : 'ESM'} mode.`); - - // TODO(V9): Remove this code since all of the logic should be in an integration - // eslint-disable-next-line deprecation/deprecation - if (options.autoSessionTracking) { - startSessionTracking(); - } - + core.debug.log(`SDK initialized from CommonJS`); client$1.startClientReportTracking(); - updateScopeFromEnvVariables(); - - // If users opt-out of this, they _have_ to set up OpenTelemetry themselves - // There is no way to use this SDK without OpenTelemetry! - if (!options.skipOpenTelemetrySetup) { - initOtel.initOpenTelemetry(client$1, { - spanProcessors: options.openTelemetrySpanProcessors, - }); - validateOpenTelemetrySetup(); - } - opentelemetry.enhanceDscWithOpenTelemetryRootSpanName(client$1); opentelemetry.setupEventContextTrace(client$1); - + if (process.env.VERCEL) { + process.on("SIGTERM", async () => { + await client$1.flush(200); + }); + } return client$1; } - -/** - * Validate that your OpenTelemetry setup is correct. - */ function validateOpenTelemetrySetup() { if (!debugBuild.DEBUG_BUILD) { return; } - const setup = opentelemetry.openTelemetrySetupCheck(); - - const required = ['SentryContextManager', 'SentryPropagator']; - - if (core.hasTracingEnabled()) { - required.push('SentrySpanProcessor'); + const required = ["SentryContextManager", "SentryPropagator"]; + const hasSentryTracerProvider = setup.includes("SentryTracerProvider"); + if (core.hasSpansEnabled() && !hasSentryTracerProvider) { + required.push("SentrySpanProcessor"); } - for (const k of required) { if (!setup.includes(k)) { - core.logger.error( - `You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.`, + core.debug.error( + `You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.` ); } } - - if (!setup.includes('SentrySampler')) { - core.logger.warn( - 'You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.', + if (!hasSentryTracerProvider && !setup.includes("SentrySampler")) { + core.debug.warn( + "You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`." ); } } - -function getClientOptions( - options, - getDefaultIntegrationsImpl, -) { +function getClientOptions(options, getDefaultIntegrationsImpl) { const release = getRelease(options.release); - - const autoSessionTracking = - typeof release !== 'string' - ? false - : // eslint-disable-next-line deprecation/deprecation - options.autoSessionTracking === undefined - ? true - : // eslint-disable-next-line deprecation/deprecation - options.autoSessionTracking; - - if (options.spotlight == null) { - const spotlightEnv = envToBool.envToBool(process.env.SENTRY_SPOTLIGHT, { strict: true }); - if (spotlightEnv == null) { - options.spotlight = process.env.SENTRY_SPOTLIGHT; - } else { - options.spotlight = spotlightEnv; - } - } - + const spotlight = spotlight$1.getSpotlightConfig(options.spotlight); const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate); - - const baseOptions = core.dropUndefinedKeys({ - transport: http.makeNodeTransport, - dsn: process.env.SENTRY_DSN, - environment: process.env.SENTRY_ENVIRONMENT, - sendClientReports: true, - }); - - const overwriteOptions = core.dropUndefinedKeys({ - release, - autoSessionTracking, - tracesSampleRate, - }); - const mergedOptions = { - ...baseOptions, ...options, - ...overwriteOptions, - }; - - if (options.defaultIntegrations === undefined) { - options.defaultIntegrations = getDefaultIntegrationsImpl(mergedOptions); - } - - const clientOptions = { - ...mergedOptions, + dsn: options.dsn ?? process.env.SENTRY_DSN, + environment: options.environment ?? process.env.SENTRY_ENVIRONMENT, + sendClientReports: options.sendClientReports ?? true, + transport: options.transport ?? http.makeNodeTransport, stackParser: core.stackParserFromStackParserOptions(options.stackParser || api.defaultStackParser), - integrations: core.getIntegrationsToSetup({ - defaultIntegrations: options.defaultIntegrations, - integrations: options.integrations, - }), + release, + tracesSampleRate, + spotlight, + debug: core.envToBool(options.debug ?? process.env.SENTRY_DEBUG) + }; + const integrations = options.integrations; + const defaultIntegrations = options.defaultIntegrations ?? getDefaultIntegrationsImpl(mergedOptions); + const resolvedIntegrations = core.getIntegrationsToSetup({ + defaultIntegrations, + integrations + }); + return { + ...mergedOptions, + integrations: resolvedIntegrations }; - - return clientOptions; } - function getRelease(release) { - if (release !== undefined) { + if (release !== void 0) { return release; } - const detectedRelease = api.getSentryRelease(); - if (detectedRelease !== undefined) { + if (detectedRelease !== void 0) { return detectedRelease; } - - return undefined; + return void 0; } - function getTracesSampleRate(tracesSampleRate) { - if (tracesSampleRate !== undefined) { + if (tracesSampleRate !== void 0) { return tracesSampleRate; } - const sampleRateFromEnv = process.env.SENTRY_TRACES_SAMPLE_RATE; if (!sampleRateFromEnv) { - return undefined; + return void 0; } - const parsed = parseFloat(sampleRateFromEnv); - return isFinite(parsed) ? parsed : undefined; + return isFinite(parsed) ? parsed : void 0; } - -/** - * Update scope and propagation context based on environmental variables. - * - * See https://github.com/getsentry/rfcs/blob/main/text/0071-continue-trace-over-process-boundaries.md - * for more details. - */ function updateScopeFromEnvVariables() { - if (envToBool.envToBool(process.env.SENTRY_USE_ENVIRONMENT) !== false) { + if (core.envToBool(process.env.SENTRY_USE_ENVIRONMENT) !== false) { const sentryTraceEnv = process.env.SENTRY_TRACE; const baggageEnv = process.env.SENTRY_BAGGAGE; const propagationContext = core.propagationContextFromHeaders(sentryTraceEnv, baggageEnv); @@ -90479,37 +46040,7 @@ function updateScopeFromEnvVariables() { } } -/** - * Enable automatic Session Tracking for the node process. - */ -function startSessionTracking() { - const client = core.getClient(); - // eslint-disable-next-line deprecation/deprecation - if (client && client.getOptions().autoSessionTracking) { - client.initSessionFlusher(); - } - - core.startSession(); - - // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because - // The 'beforeExit' event is not emitted for conditions causing explicit termination, - // such as calling process.exit() or uncaught exceptions. - // Ref: https://nodejs.org/api/process.html#process_event_beforeexit - process.on('beforeExit', () => { - const session = core.getIsolationScope().getSession(); - - // Only call endSession, if the Session exists on Scope and SessionStatus is not a - // Terminal Status i.e. Exited or Crashed because - // "When a session is moved away from ok it must not be updated anymore." - // Ref: https://develop.sentry.dev/sdk/sessions/ - if (session && session.status !== 'ok') { - core.endSession(); - } - }); -} - exports.getDefaultIntegrations = getDefaultIntegrations; -exports.getDefaultIntegrationsWithoutPerformance = getDefaultIntegrationsWithoutPerformance; exports.init = init; exports.initWithoutDefaultIntegrations = initWithoutDefaultIntegrations; exports.validateOpenTelemetrySetup = validateOpenTelemetrySetup; @@ -90518,357 +46049,124 @@ exports.validateOpenTelemetrySetup = validateOpenTelemetrySetup; /***/ }), -/***/ 16049: +/***/ 62177: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const moduleModule = __nccwpck_require__(98188); const api = __nccwpck_require__(65163); -const resources = __nccwpck_require__(3871); -const sdkTraceBase = __nccwpck_require__(29253); -const semanticConventions = __nccwpck_require__(67275); -const core = __nccwpck_require__(84466); -const opentelemetry = __nccwpck_require__(78369); -const importInTheMiddle = __nccwpck_require__(36151); -const debugBuild = __nccwpck_require__(8421); -const index = __nccwpck_require__(59020); -const contextManager = __nccwpck_require__(37859); -const commonjs = __nccwpck_require__(38743); +const opentelemetry = __nccwpck_require__(90157); -var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; -// About 277h - this must fit into new Array(len)! -const MAX_MAX_SPAN_WAIT_DURATION = 1000000; - -/** - * Initialize OpenTelemetry for Node. - */ -function initOpenTelemetry(client, options = {}) { - if (client.getOptions().debug) { - setupOpenTelemetryLogger(); - } - - const provider = setupOtel(client, options); - client.traceProvider = provider; -} - -function getRegisterOptions(esmHookConfig) { - // TODO(v9): Make onlyIncludeInstrumentedModules: true the default behavior. - if (_optionalChain([esmHookConfig, 'optionalAccess', _ => _.onlyIncludeInstrumentedModules])) { - const { addHookMessagePort } = importInTheMiddle.createAddHookMessageChannel(); - // If the user supplied include, we need to use that as a starting point or use an empty array to ensure no modules - // are wrapped if they are not hooked - // eslint-disable-next-line deprecation/deprecation - return { data: { addHookMessagePort, include: esmHookConfig.include || [] }, transferList: [addHookMessagePort] }; - } - - return { data: esmHookConfig }; -} - -/** Initialize the ESM loader. */ -function maybeInitializeEsmLoader(esmHookConfig) { - const [nodeMajor = 0, nodeMinor = 0] = process.versions.node.split('.').map(Number); - - // Register hook was added in v20.6.0 and v18.19.0 - if (nodeMajor >= 22 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) { - // We need to work around using import.meta.url directly because jest complains about it. - const importMetaUrl = - typeof (typeof document === 'undefined' ? (__nccwpck_require__(57310).pathToFileURL)(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('sdk/initOtel.js', document.baseURI).href)) !== 'undefined' ? (typeof document === 'undefined' ? (__nccwpck_require__(57310).pathToFileURL)(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('sdk/initOtel.js', document.baseURI).href)) : undefined; - - if (!core.GLOBAL_OBJ._sentryEsmLoaderHookRegistered && importMetaUrl) { - try { - // @ts-expect-error register is available in these versions - moduleModule.default.register('import-in-the-middle/hook.mjs', importMetaUrl, getRegisterOptions(esmHookConfig)); - core.GLOBAL_OBJ._sentryEsmLoaderHookRegistered = true; - } catch (error) { - core.logger.warn('Failed to register ESM hook', error); - } - } - } else { - core.consoleSandbox(() => { - // eslint-disable-next-line no-console - console.warn( - '[Sentry] You are using Node.js in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.', - ); - }); +function setIsolationScope(isolationScope) { + const scopes = opentelemetry.getScopesFromContext(api.context.active()); + if (scopes) { + scopes.isolationScope = isolationScope; } } -/** - * Preload OpenTelemetry for Node. - * This can be used to preload instrumentation early, but set up Sentry later. - * By preloading the OTEL instrumentation wrapping still happens early enough that everything works. - */ -function preloadOpenTelemetry(options = {}) { - const { debug } = options; - - if (debug) { - core.logger.enable(); - setupOpenTelemetryLogger(); - } - - if (!commonjs.isCjs()) { - maybeInitializeEsmLoader(options.registerEsmLoaderHooks); - } - - // These are all integrations that we need to pre-load to ensure they are set up before any other code runs - getPreloadMethods(options.integrations).forEach(fn => { - fn(); - - if (debug) { - core.logger.log(`[Sentry] Preloaded ${fn.id} instrumentation`); - } - }); -} - -function getPreloadMethods(integrationNames) { - const instruments = index.getOpenTelemetryInstrumentationToPreload(); - - if (!integrationNames) { - return instruments; - } - - return instruments.filter(instrumentation => integrationNames.includes(instrumentation.id)); -} - -/** Just exported for tests. */ -function setupOtel(client, options = {}) { - // Create and configure NodeTracerProvider - const provider = new sdkTraceBase.BasicTracerProvider({ - sampler: new opentelemetry.SentrySampler(client), - resource: new resources.Resource({ - [semanticConventions.ATTR_SERVICE_NAME]: 'node', - // eslint-disable-next-line deprecation/deprecation - [semanticConventions.SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry', - [semanticConventions.ATTR_SERVICE_VERSION]: core.SDK_VERSION, - }), - forceFlushTimeoutMillis: 500, - spanProcessors: [ - new opentelemetry.SentrySpanProcessor({ - timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration), - }), - ...(options.spanProcessors || []), - ], - }); - - // Initialize the provider - provider.register({ - propagator: new opentelemetry.SentryPropagator(), - contextManager: new contextManager.SentryContextManager(), - }); - - return provider; -} - -/** Just exported for tests. */ -function _clampSpanProcessorTimeout(maxSpanWaitDuration) { - if (maxSpanWaitDuration == null) { - return undefined; - } - - // We guard for a max. value here, because we create an array with this length - // So if this value is too large, this would fail - if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) { - debugBuild.DEBUG_BUILD && - core.logger.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`); - return MAX_MAX_SPAN_WAIT_DURATION; - } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) { - debugBuild.DEBUG_BUILD && core.logger.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.'); - return undefined; - } - - return maxSpanWaitDuration; -} - -/** - * Setup the OTEL logger to use our own logger. - */ -function setupOpenTelemetryLogger() { - const otelLogger = new Proxy(core.logger , { - get(target, prop, receiver) { - const actualProp = prop === 'verbose' ? 'debug' : prop; - return Reflect.get(target, actualProp, receiver); - }, - }); - - // Disable diag, to ensure this works even if called multiple times - api.diag.disable(); - api.diag.setLogger(otelLogger, api.DiagLogLevel.DEBUG); -} - -exports._clampSpanProcessorTimeout = _clampSpanProcessorTimeout; -exports.initOpenTelemetry = initOpenTelemetry; -exports.maybeInitializeEsmLoader = maybeInitializeEsmLoader; -exports.preloadOpenTelemetry = preloadOpenTelemetry; -exports.setupOtel = setupOtel; -//# sourceMappingURL=initOtel.js.map +exports.setIsolationScope = setIsolationScope; +//# sourceMappingURL=scope.js.map /***/ }), -/***/ 73009: +/***/ 87973: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _nullishCoalesce -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const http = __nccwpck_require__(88849); const https = __nccwpck_require__(22286); const node_stream = __nccwpck_require__(84492); const node_zlib = __nccwpck_require__(65628); const core = __nccwpck_require__(84466); -const index = __nccwpck_require__(62941); +const index = __nccwpck_require__(82063); -// Estimated maximum size for reasonable standalone event const GZIP_THRESHOLD = 1024 * 32; - -/** - * Gets a stream from a Uint8Array or string - * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0 - */ function streamFromBody(body) { return new node_stream.Readable({ read() { this.push(body); this.push(null); - }, + } }); } - -/** - * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry. - */ function makeNodeTransport(options) { let urlSegments; - try { urlSegments = new URL(options.url); - } catch (e) { + } catch (_e) { core.consoleSandbox(() => { - // eslint-disable-next-line no-console console.warn( - '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.', + "[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used." ); }); return core.createTransport(options, () => Promise.resolve({})); } - - const isHttps = urlSegments.protocol === 'https:'; - - // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy` - // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy` + const isHttps = urlSegments.protocol === "https:"; const proxy = applyNoProxyOption( urlSegments, - options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy, + options.proxy || (isHttps ? process.env.https_proxy : void 0) || process.env.http_proxy ); - const nativeHttpModule = isHttps ? https : http; - const keepAlive = options.keepAlive === undefined ? false : options.keepAlive; - - // TODO(v9): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node - // versions(>= 8) as they had memory leaks when using it: #2555 - const agent = proxy - ? (new index.HttpsProxyAgent(proxy) ) - : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 }); - - const requestExecutor = createRequestExecutor(options, _nullishCoalesce(options.httpModule, () => ( nativeHttpModule)), agent); + const keepAlive = options.keepAlive === void 0 ? false : options.keepAlive; + const agent = proxy ? new index.HttpsProxyAgent(proxy) : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2e3 }); + const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent); return core.createTransport(options, requestExecutor); } - -/** - * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion. - * - * @param transportUrl The URL the transport intends to send events to. - * @param proxy The client configured proxy. - * @returns A proxy the transport should use. - */ function applyNoProxyOption(transportUrlSegments, proxy) { const { no_proxy } = process.env; - - const urlIsExemptFromProxy = - no_proxy && - no_proxy - .split(',') - .some( - exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption), - ); - + const urlIsExemptFromProxy = no_proxy?.split(",").some( + (exemption) => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption) + ); if (urlIsExemptFromProxy) { - return undefined; + return void 0; } else { return proxy; } } - -/** - * Creates a RequestExecutor to be used with `createTransport`. - */ -function createRequestExecutor( - options, - httpModule, - agent, -) { +function createRequestExecutor(options, httpModule, agent) { const { hostname, pathname, port, protocol, search } = new URL(options.url); return function makeRequest(request) { return new Promise((resolve, reject) => { - // This ensures we do not generate any spans in OpenTelemetry for the transport core.suppressTracing(() => { let body = streamFromBody(request.body); - const headers = { ...options.headers }; - if (request.body.length > GZIP_THRESHOLD) { - headers['content-encoding'] = 'gzip'; + headers["content-encoding"] = "gzip"; body = body.pipe(node_zlib.createGzip()); } - + const hostnameIsIPv6 = hostname.startsWith("["); const req = httpModule.request( { - method: 'POST', + method: "POST", agent, headers, - hostname, + // Remove "[" and "]" from IPv6 hostnames + hostname: hostnameIsIPv6 ? hostname.slice(1, -1) : hostname, path: `${pathname}${search}`, port, protocol, - ca: options.caCerts, + ca: options.caCerts }, - res => { - res.on('data', () => { - // Drain socket + (res) => { + res.on("data", () => { }); - - res.on('end', () => { - // Drain socket + res.on("end", () => { }); - - res.setEncoding('utf8'); - - // "Key-value pairs of header names and values. Header names are lower-cased." - // https://nodejs.org/api/http.html#http_message_headers - const retryAfterHeader = _nullishCoalesce(res.headers['retry-after'], () => ( null)); - const rateLimitsHeader = _nullishCoalesce(res.headers['x-sentry-rate-limits'], () => ( null)); - + res.setEncoding("utf8"); + const retryAfterHeader = res.headers["retry-after"] ?? null; + const rateLimitsHeader = res.headers["x-sentry-rate-limits"] ?? null; resolve({ statusCode: res.statusCode, headers: { - 'retry-after': retryAfterHeader, - 'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) - ? rateLimitsHeader[0] || null - : rateLimitsHeader, - }, + "retry-after": retryAfterHeader, + "x-sentry-rate-limits": Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] || null : rateLimitsHeader + } }); - }, + } ); - - req.on('error', reject); + req.on("error", reject); body.pipe(req); }); }); @@ -90881,14 +46179,13 @@ exports.makeNodeTransport = makeNodeTransport; /***/ }), -/***/ 37980: +/***/ 59528: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -/** Adds an origin to an OTEL Span. */ function addOriginToSpan(span, origin) { span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin); } @@ -90899,33 +46196,19 @@ exports.addOriginToSpan = addOriginToSpan; /***/ }), -/***/ 38743: +/***/ 94192: /***/ ((__unused_webpack_module, exports) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** Detect CommonJS. */ -function isCjs() { - return "function" !== 'undefined'; -} - -exports.isCjs = isCjs; -//# sourceMappingURL=commonjs.js.map - - -/***/ }), - -/***/ 60309: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const commonjs = __nccwpck_require__(38743); - -const createMissingInstrumentationContext = (pkg) => ({ - package: pkg, - 'javascript.is_cjs': commonjs.isCjs(), -}); +const createMissingInstrumentationContext = (pkg) => { + let isCjs; + isCjs = true; + return { + package: pkg, + "javascript.is_cjs": isCjs + }; +}; exports.createMissingInstrumentationContext = createMissingInstrumentationContext; //# sourceMappingURL=createMissingInstrumentationContext.js.map @@ -90933,27 +46216,21 @@ exports.createMissingInstrumentationContext = createMissingInstrumentationContex /***/ }), -/***/ 75915: +/***/ 10992: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); let cachedDebuggerEnabled; - -/** - * Was the debugger enabled when this function was first called? - */ async function isDebuggerEnabled() { - if (cachedDebuggerEnabled === undefined) { + if (cachedDebuggerEnabled === void 0) { try { - // Node can be built without inspector support const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); cachedDebuggerEnabled = !!inspector.url(); - } catch (_) { + } catch { cachedDebuggerEnabled = false; } } - return cachedDebuggerEnabled; } @@ -90963,49 +46240,44 @@ exports.isDebuggerEnabled = isDebuggerEnabled; /***/ }), -/***/ 90556: +/***/ 63992: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var { - _optionalChain -} = __nccwpck_require__(84466); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -Object.defineProperty(exports, "__esModule", ({ value: true })); +__nccwpck_require__(84466); +__nccwpck_require__(61523); -const core$1 = __nccwpck_require__(46033); +function supportsEsmLoaderHooks() { + { + return false; + } +} + +exports.supportsEsmLoaderHooks = supportsEsmLoaderHooks; +//# sourceMappingURL=detection.js.map + + +/***/ }), + +/***/ 23955: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); const core = __nccwpck_require__(84466); -const commonjs = __nccwpck_require__(38743); -const createMissingInstrumentationContext = __nccwpck_require__(60309); +const createMissingInstrumentationContext = __nccwpck_require__(94192); -/** - * Checks and warns if a framework isn't wrapped by opentelemetry. - */ -function ensureIsWrapped( - maybeWrappedFunction, - name, -) { - const client = core.getClient(); - if ( - !_optionalChain([client, 'optionalAccess', _ => _.getOptions, 'call', _2 => _2(), 'access', _3 => _3.disableInstrumentationWarnings]) && - !core$1.isWrapped(maybeWrappedFunction) && - core.isEnabled() && - core.hasTracingEnabled() - ) { +function ensureIsWrapped(maybeWrappedFunction, name) { + const clientOptions = core.getClient()?.getOptions(); + if (!clientOptions?.disableInstrumentationWarnings && !(instrumentation.isWrapped(maybeWrappedFunction) || typeof core.getOriginalFunction(maybeWrappedFunction) === "function") && core.isEnabled() && core.hasSpansEnabled(clientOptions)) { core.consoleSandbox(() => { - if (commonjs.isCjs()) { - // eslint-disable-next-line no-console - console.warn( - `[Sentry] ${name} is not instrumented. This is likely because you required/imported ${name} before calling \`Sentry.init()\`.`, - ); - } else { - // eslint-disable-next-line no-console - console.warn( - `[Sentry] ${name} is not instrumented. Please make sure to initialize Sentry in a separate file that you \`--import\` when running node, see: https://docs.sentry.io/platforms/javascript/guides/${name}/install/esm/.`, - ); - } - }); - - core.getGlobalScope().setContext('missing_instrumentation', createMissingInstrumentationContext.createMissingInstrumentationContext(name)); + console.warn( + `[Sentry] ${name} is not instrumented. This is likely because you required/imported ${name} before calling \`Sentry.init()\`.` + ); + }); + core.getGlobalScope().setContext("missing_instrumentation", createMissingInstrumentationContext.createMissingInstrumentationContext(name)); } } @@ -91015,86 +46287,37 @@ exports.ensureIsWrapped = ensureIsWrapped; /***/ }), -/***/ 5606: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const FALSY_ENV_VALUES = new Set(['false', 'f', 'n', 'no', 'off', '0']); -const TRUTHY_ENV_VALUES = new Set(['true', 't', 'y', 'yes', 'on', '1']); - -/** - * A helper function which casts an ENV variable value to `true` or `false` using the constants defined above. - * In strict mode, it may return `null` if the value doesn't match any of the predefined values. - * - * @param value The value of the env variable - * @param options -- Only has `strict` key for now, which requires a strict match for `true` in TRUTHY_ENV_VALUES - * @returns true/false if the lowercase value matches the predefined values above. If not, null in strict mode, - * and Boolean(value) in loose mode. - */ -function envToBool(value, options) { - const normalized = String(value).toLowerCase(); - - if (FALSY_ENV_VALUES.has(normalized)) { - return false; - } - - if (TRUTHY_ENV_VALUES.has(normalized)) { - return true; - } - - return options && options.strict ? null : Boolean(value); -} - -exports.FALSY_ENV_VALUES = FALSY_ENV_VALUES; -exports.TRUTHY_ENV_VALUES = TRUTHY_ENV_VALUES; -exports.envToBool = envToBool; -//# sourceMappingURL=envToBool.js.map - - -/***/ }), - -/***/ 73380: +/***/ 61138: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); -const debugBuild = __nccwpck_require__(8421); +const debugBuild = __nccwpck_require__(20624); -const DEFAULT_SHUTDOWN_TIMEOUT = 2000; - -/** - * @hidden - */ +const DEFAULT_SHUTDOWN_TIMEOUT = 2e3; function logAndExitProcess(error) { core.consoleSandbox(() => { - // eslint-disable-next-line no-console console.error(error); }); - const client = core.getClient(); - - if (client === undefined) { - debugBuild.DEBUG_BUILD && core.logger.warn('No NodeClient was defined, we are exiting the process now.'); + if (client === void 0) { + debugBuild.DEBUG_BUILD && core.debug.warn("No NodeClient was defined, we are exiting the process now."); global.process.exit(1); return; } - const options = client.getOptions(); - const timeout = - (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) || - DEFAULT_SHUTDOWN_TIMEOUT; + const timeout = options?.shutdownTimeout && options.shutdownTimeout > 0 ? options.shutdownTimeout : DEFAULT_SHUTDOWN_TIMEOUT; client.close(timeout).then( (result) => { if (!result) { - debugBuild.DEBUG_BUILD && core.logger.warn('We reached the timeout for emptying the request buffer, still exiting now!'); + debugBuild.DEBUG_BUILD && core.debug.warn("We reached the timeout for emptying the request buffer, still exiting now!"); } global.process.exit(1); }, - error => { - debugBuild.DEBUG_BUILD && core.logger.error(error); - }, + (error2) => { + debugBuild.DEBUG_BUILD && core.debug.error(error2); + } ); } @@ -91104,88 +46327,40 @@ exports.logAndExitProcess = logAndExitProcess; /***/ }), -/***/ 35126: -/***/ ((__unused_webpack_module, exports) => { - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/** Build a full URL from request options. */ -function getRequestUrl(requestOptions) { - const protocol = requestOptions.protocol || ''; - const hostname = requestOptions.hostname || requestOptions.host || ''; - // Don't log standard :80 (http) and :443 (https) ports to reduce the noise - // Also don't add port if the hostname already includes a port - const port = - !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname) - ? '' - : `:${requestOptions.port}`; - const path = requestOptions.path ? requestOptions.path : '/'; - return `${protocol}//${hostname}${port}${path}`; -} - -exports.getRequestUrl = getRequestUrl; -//# sourceMappingURL=getRequestUrl.js.map - - -/***/ }), - -/***/ 64177: +/***/ 53376: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_path = __nccwpck_require__(49411); const core = __nccwpck_require__(84466); -/** normalizes Windows paths */ function normalizeWindowsPath(path) { - return path - .replace(/^[A-Z]:/, '') // remove Windows-style prefix - .replace(/\\/g, '/'); // replace all `\` instances with `/` + return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/"); } - -/** Creates a function that gets the module name from a filename */ -function createGetModuleFromFilename( - basePath = process.argv[1] ? core.dirname(process.argv[1]) : process.cwd(), - isWindows = node_path.sep === '\\', -) { +function createGetModuleFromFilename(basePath = process.argv[1] ? core.dirname(process.argv[1]) : process.cwd(), isWindows = node_path.sep === "\\") { const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath; - return (filename) => { if (!filename) { return; } - const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename; - - // eslint-disable-next-line prefer-const let { dir, base: file, ext } = node_path.posix.parse(normalizedFilename); - - if (ext === '.js' || ext === '.mjs' || ext === '.cjs') { + if (ext === ".js" || ext === ".mjs" || ext === ".cjs") { file = file.slice(0, ext.length * -1); } - - // The file name might be URI-encoded which we want to decode to - // the original file name. const decodedFile = decodeURIComponent(file); - if (!dir) { - // No dirname whatsoever - dir = '.'; + dir = "."; } - - const n = dir.lastIndexOf('/node_modules'); + const n = dir.lastIndexOf("/node_modules"); if (n > -1) { - return `${dir.slice(n + 14).replace(/\//g, '.')}:${decodedFile}`; + return `${dir.slice(n + 14).replace(/\//g, ".")}:${decodedFile}`; } - - // Let's see if it's a part of the main module - // To be a part of main module, it has to share the same base if (dir.startsWith(normalizedBase)) { - const moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, '.'); + const moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, "."); return moduleName ? `${moduleName}:${decodedFile}` : decodedFile; } - return decodedFile; }; } @@ -91196,76 +46371,10188 @@ exports.createGetModuleFromFilename = createGetModuleFromFilename; /***/ }), -/***/ 94795: -/***/ ((__unused_webpack_module, exports) => { +/***/ 28847: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -Object.defineProperty(exports, "__esModule", ({ value: true })); +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -const SINGLE_ARG_COMMANDS = ['get', 'set', 'setex']; +const core = __nccwpck_require__(84466); -const GET_COMMANDS = ['get', 'mget']; -const SET_COMMANDS = ['set', 'setex']; -// todo: del, expire - -/** Checks if a given command is in the list of redis commands. - * Useful because commands can come in lowercase or uppercase (depending on the library). */ -function isInCommands(redisCommands, command) { - return redisCommands.includes(command.toLowerCase()); -} - -/** Determine cache operation based on redis statement */ -function getCacheOperation( - command, -) { - if (isInCommands(GET_COMMANDS, command)) { - return 'cache.get'; - } else if (isInCommands(SET_COMMANDS, command)) { - return 'cache.put'; +const SENTRY_TRACE_HEADER = "sentry-trace"; +const SENTRY_BAGGAGE_HEADER = "baggage"; +const W3C_TRACEPARENT_HEADER = "traceparent"; +function addTracePropagationHeadersToFetchRequest(request, propagationDecisionMap, span) { + const url = getAbsoluteUrl(request.origin, request.path); + const { tracePropagationTargets, propagateTraceparent } = core.getClient()?.getOptions() || {}; + if (!core.shouldPropagateTraceForUrl(url, tracePropagationTargets, propagationDecisionMap)) { + return; + } + const spanForTraceHeaders = span && core.spanIsIgnored(span) && core.getActiveSpan() ? void 0 : span; + const addedHeaders = spanForTraceHeaders ? core.withActiveSpan(spanForTraceHeaders, () => core.getTraceData({ propagateTraceparent })) : core.getTraceData({ propagateTraceparent }); + if (!addedHeaders) { + return; + } + const { "sentry-trace": sentryTrace, baggage, traceparent } = addedHeaders; + const requestHeaders = Array.isArray(request.headers) ? normalizeUndiciHeaderPairs(request.headers) : stringToArrayHeaders(request.headers); + _deduplicateArrayHeader(requestHeaders, SENTRY_TRACE_HEADER); + _deduplicateArrayHeader(requestHeaders, SENTRY_BAGGAGE_HEADER); + if (propagateTraceparent) { + _deduplicateArrayHeader(requestHeaders, W3C_TRACEPARENT_HEADER); + } + const hasExistingSentryTraceHeader = _findExistingHeaderIndex(requestHeaders, SENTRY_TRACE_HEADER) !== -1; + if (!hasExistingSentryTraceHeader) { + if (sentryTrace) { + requestHeaders.push(SENTRY_TRACE_HEADER, sentryTrace); + } + if (traceparent && _findExistingHeaderIndex(requestHeaders, "traceparent") === -1) { + requestHeaders.push("traceparent", traceparent); + } + const existingBaggageIndex = _findExistingHeaderIndex(requestHeaders, SENTRY_BAGGAGE_HEADER); + if (baggage && existingBaggageIndex === -1) { + requestHeaders.push(SENTRY_BAGGAGE_HEADER, baggage); + } else if (baggage) { + const existingBaggageValue = requestHeaders[existingBaggageIndex + 1]; + const merged = core.mergeBaggageHeaders(existingBaggageValue, baggage); + if (merged) { + requestHeaders[existingBaggageIndex + 1] = merged; + } + } + } + if (Array.isArray(request.headers)) { + request.headers.splice(0, request.headers.length, ...requestHeaders); } else { - return undefined; + request.headers = arrayToStringHeaders(requestHeaders); + } +} +function normalizeUndiciHeaderPairs(headers) { + const out = []; + for (let i = 0; i < headers.length; i++) { + const entry = headers[i]; + if (i % 2 === 0) { + out.push(typeof entry === "string" ? entry : String(entry)); + } else { + out.push(Array.isArray(entry) ? entry.join(", ") : entry ?? ""); + } + } + return out; +} +function stringToArrayHeaders(requestHeaders) { + const headersArray = requestHeaders.split("\r\n"); + const headers = []; + for (const header of headersArray) { + try { + const colonIndex = header.indexOf(":"); + if (colonIndex === -1) { + continue; + } + const key = header.slice(0, colonIndex).trim(); + const value = header.slice(colonIndex + 1).trim(); + if (key) { + headers.push(key, value); + } + } catch { + core.debug.warn(`Failed to convert string request header to array header: ${header}`); + } + } + return headers; +} +function arrayToStringHeaders(headers) { + const headerPairs = []; + for (let i = 0; i < headers.length; i += 2) { + const key = headers[i]; + const value = headers[i + 1]; + if (!key || value == null) { + continue; + } + headerPairs.push(`${key}: ${value}`); + } + if (!headerPairs.length) { + return ""; + } + return headerPairs.join("\r\n").concat("\r\n"); +} +function _deduplicateArrayHeader(headers, headerName) { + let firstIndex = -1; + for (let i = 0; i < headers.length; i += 2) { + if (headers[i] !== headerName) { + continue; + } + if (firstIndex === -1) { + firstIndex = i; + continue; + } + const firstHeaderValue = headers[firstIndex + 1]; + if (headerName === SENTRY_BAGGAGE_HEADER && firstHeaderValue) { + const merged = core.mergeBaggageHeaders(headers[i + 1], firstHeaderValue); + if (merged) { + headers[firstIndex + 1] = merged; + } + } + headers.splice(i, 2); + i -= 2; + } +} +function _findExistingHeaderIndex(headers, name) { + return headers.findIndex((header, i) => i % 2 === 0 && header === name); +} +function addFetchRequestBreadcrumb(request, response) { + const data = getBreadcrumbData(request); + const statusCode = response.statusCode; + const level = core.getBreadcrumbLogLevelFromHttpStatusCode(statusCode); + core.addBreadcrumb( + { + category: "http", + data: { + status_code: statusCode, + ...data + }, + type: "http", + level + }, + { + event: "response", + request, + response + } + ); +} +function getBreadcrumbData(request) { + try { + const url = getAbsoluteUrl(request.origin, request.path); + const parsedUrl = core.parseUrl(url); + const data = { + url: core.getSanitizedUrlString(parsedUrl), + "http.method": request.method || "GET" + }; + if (parsedUrl.search) { + data["http.query"] = parsedUrl.search; + } + if (parsedUrl.hash) { + data["http.fragment"] = parsedUrl.hash; + } + return data; + } catch { + return {}; + } +} +function getAbsoluteUrl(origin, path = "/") { + try { + const url = new URL(path, origin); + return url.toString(); + } catch { + const url = `${origin}`; + if (url.endsWith("/") && path.startsWith("/")) { + return `${url}${path.slice(1)}`; + } + if (!url.endsWith("/") && !path.startsWith("/")) { + return `${url}/${path}`; + } + return `${url}${path}`; } } -function keyHasPrefix(key, prefixes) { - return prefixes.some(prefix => key.startsWith(prefix)); +exports.addFetchRequestBreadcrumb = addFetchRequestBreadcrumb; +exports.addTracePropagationHeadersToFetchRequest = addTracePropagationHeadersToFetchRequest; +exports.getAbsoluteUrl = getAbsoluteUrl; +//# sourceMappingURL=outgoingFetchRequest.js.map + + +/***/ }), + +/***/ 28737: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +function getSpotlightConfig(optionsSpotlight) { + if (optionsSpotlight === false) { + return false; + } + if (typeof optionsSpotlight === "string") { + return optionsSpotlight; + } + const envBool = core.envToBool(process.env.SENTRY_SPOTLIGHT, { strict: true }); + const envUrl = envBool === null && process.env.SENTRY_SPOTLIGHT ? process.env.SENTRY_SPOTLIGHT : void 0; + return optionsSpotlight === true ? envUrl ?? true : envBool ?? envUrl; } -/** Safely converts a redis key to a string (comma-separated if there are multiple keys) */ +exports.getSpotlightConfig = getSpotlightConfig; +//# sourceMappingURL=spotlight.js.map + + +/***/ }), + +/***/ 8421: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + +exports.DEBUG_BUILD = DEBUG_BUILD; +//# sourceMappingURL=debug-build.js.map + + +/***/ }), + +/***/ 17374: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const http = __nccwpck_require__(92447); +const nodeFetch = __nccwpck_require__(40839); +const index$6 = __nccwpck_require__(75448); +const express = __nccwpck_require__(89660); +const index$5 = __nccwpck_require__(7401); +const index$a = __nccwpck_require__(55238); +const index$d = __nccwpck_require__(33627); +const index$i = __nccwpck_require__(33555); +const index$j = __nccwpck_require__(17574); +const index$k = __nccwpck_require__(68850); +const index$m = __nccwpck_require__(61697); +const index$l = __nccwpck_require__(62188); +const index$p = __nccwpck_require__(42045); +const index$o = __nccwpck_require__(73894); +const postgresjs = __nccwpck_require__(28739); +const serverUtils = __nccwpck_require__(93362); +const index$b = __nccwpck_require__(69741); +const index$c = __nccwpck_require__(55331); +const index$f = __nccwpck_require__(88562); +const index$3 = __nccwpck_require__(80322); +const index$e = __nccwpck_require__(80895); +const index$q = __nccwpck_require__(66804); +const index$7 = __nccwpck_require__(88204); +const index$4 = __nccwpck_require__(64071); +const index = __nccwpck_require__(98562); +const index$r = __nccwpck_require__(65595); +const index$n = __nccwpck_require__(33879); +const index$1 = __nccwpck_require__(88363); +const index$9 = __nccwpck_require__(63374); +const index$g = __nccwpck_require__(63467); +const index$h = __nccwpck_require__(61016); +const launchDarkly = __nccwpck_require__(86985); +const openFeature = __nccwpck_require__(45421); +const statsig = __nccwpck_require__(99396); +const unleash = __nccwpck_require__(87833); +const growthbook = __nccwpck_require__(33714); +const firebase = __nccwpck_require__(94852); +const index$2 = __nccwpck_require__(59198); +const experimentalUseDiagnosticsChannelInjection = __nccwpck_require__(68478); +const diagnosticsChannelInjection = __nccwpck_require__(65678); +const initOtel = __nccwpck_require__(16049); +const index$8 = __nccwpck_require__(59020); +const opentelemetry = __nccwpck_require__(90157); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + + + +exports.httpIntegration = http.httpIntegration; +exports.nativeNodeFetchIntegration = nodeFetch.nativeNodeFetchIntegration; +exports.fsIntegration = index$6.fsIntegration; +exports.expressIntegration = express.expressIntegration; +exports.setupExpressErrorHandler = express.setupExpressErrorHandler; +exports.fastifyIntegration = index$5.fastifyIntegration; +exports.setupFastifyErrorHandler = index$5.setupFastifyErrorHandler; +exports.graphqlIntegration = index$a.graphqlIntegration; +exports.kafkaIntegration = index$d.kafkaIntegration; +exports.lruMemoizerIntegration = index$i.lruMemoizerIntegration; +exports.mongoIntegration = index$j.mongoIntegration; +exports.mongooseIntegration = index$k.mongooseIntegration; +exports.mysqlIntegration = index$m.mysqlIntegration; +exports.mysql2Integration = index$l.mysql2Integration; +exports.redisIntegration = index$p.redisIntegration; +exports.postgresIntegration = index$o.postgresIntegration; +exports.postgresJsIntegration = postgresjs.postgresJsIntegration; +exports.prismaIntegration = serverUtils.prismaIntegration; +exports.hapiIntegration = index$b.hapiIntegration; +exports.setupHapiErrorHandler = index$b.setupHapiErrorHandler; +exports.honoIntegration = index$c.honoIntegration; +exports.setupHonoErrorHandler = index$c.setupHonoErrorHandler; +exports.koaIntegration = index$f.koaIntegration; +exports.setupKoaErrorHandler = index$f.setupKoaErrorHandler; +exports.connectIntegration = index$3.connectIntegration; +exports.setupConnectErrorHandler = index$3.setupConnectErrorHandler; +exports.knexIntegration = index$e.knexIntegration; +exports.tediousIntegration = index$q.tediousIntegration; +exports.genericPoolIntegration = index$7.genericPoolIntegration; +exports.dataloaderIntegration = index$4.dataloaderIntegration; +exports.amqplibIntegration = index.amqplibIntegration; +exports.vercelAIIntegration = index$r.vercelAIIntegration; +exports.openAIIntegration = index$n.openAIIntegration; +exports.anthropicAIIntegration = index$1.anthropicAIIntegration; +exports.googleGenAIIntegration = index$9.googleGenAIIntegration; +exports.langChainIntegration = index$g.langChainIntegration; +exports.langGraphIntegration = index$h.langGraphIntegration; +exports.buildLaunchDarklyFlagUsedHandler = launchDarkly.buildLaunchDarklyFlagUsedHandlerShim; +exports.launchDarklyIntegration = launchDarkly.launchDarklyIntegrationShim; +exports.OpenFeatureIntegrationHook = openFeature.OpenFeatureIntegrationHookShim; +exports.openFeatureIntegration = openFeature.openFeatureIntegrationShim; +exports.statsigIntegration = statsig.statsigIntegrationShim; +exports.unleashIntegration = unleash.unleashIntegrationShim; +exports.growthbookIntegration = growthbook.growthbookIntegrationShim; +exports.firebaseIntegration = firebase.firebaseIntegration; +exports.applyDiagnosticsChannelInjectionIntegrations = index$2.applyDiagnosticsChannelInjectionIntegrations; +exports.getDefaultIntegrations = index$2.getDefaultIntegrations; +exports.getDefaultIntegrationsWithoutPerformance = index$2.getDefaultIntegrationsWithoutPerformance; +exports.init = index$2.init; +exports.initWithoutDefaultIntegrations = index$2.initWithoutDefaultIntegrations; +exports.diagnosticsChannelInjectionIntegrations = experimentalUseDiagnosticsChannelInjection.diagnosticsChannelInjectionIntegrations; +exports.experimentalUseDiagnosticsChannelInjection = experimentalUseDiagnosticsChannelInjection.experimentalUseDiagnosticsChannelInjection; +exports.isDiagnosticsChannelInjectionEnabled = diagnosticsChannelInjection.isDiagnosticsChannelInjectionEnabled; +exports.initOpenTelemetry = initOtel.initOpenTelemetry; +exports.preloadOpenTelemetry = initOtel.preloadOpenTelemetry; +exports.getAutoPerformanceIntegrations = index$8.getAutoPerformanceIntegrations; +exports.setNodeAsyncContextStrategy = opentelemetry.setOpenTelemetryContextAsyncContextStrategy; +exports.SDK_VERSION = core.SDK_VERSION; +exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = core.SEMANTIC_ATTRIBUTE_SENTRY_OP; +exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE; +exports.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE; +exports.Scope = core.Scope; +exports.addBreadcrumb = core.addBreadcrumb; +exports.addEventProcessor = core.addEventProcessor; +exports.addIntegration = core.addIntegration; +exports.bindScopeToEmitter = core.bindScopeToEmitter; +exports.captureCheckIn = core.captureCheckIn; +exports.captureConsoleIntegration = core.captureConsoleIntegration; +exports.captureEvent = core.captureEvent; +exports.captureException = core.captureException; +exports.captureFeedback = core.captureFeedback; +exports.captureMessage = core.captureMessage; +exports.captureSession = core.captureSession; +exports.close = core.close; +exports.consoleLoggingIntegration = core.consoleLoggingIntegration; +exports.continueTrace = core.continueTrace; +exports.createConsolaReporter = core.createConsolaReporter; +exports.createLangChainCallbackHandler = core.createLangChainCallbackHandler; +exports.createTransport = core.createTransport; +exports.dedupeIntegration = core.dedupeIntegration; +exports.endSession = core.endSession; +exports.eventFiltersIntegration = core.eventFiltersIntegration; +exports.expressErrorHandler = core.expressErrorHandler; +exports.extraErrorDataIntegration = core.extraErrorDataIntegration; +exports.featureFlagsIntegration = core.featureFlagsIntegration; +exports.flush = core.flush; +exports.functionToStringIntegration = core.functionToStringIntegration; +exports.getActiveSpan = core.getActiveSpan; +exports.getClient = core.getClient; +exports.getCurrentScope = core.getCurrentScope; +exports.getGlobalScope = core.getGlobalScope; +exports.getIsolationScope = core.getIsolationScope; +exports.getRootSpan = core.getRootSpan; +exports.getSpanDescendants = core.getSpanDescendants; +exports.getSpanStatusFromHttpCode = core.getSpanStatusFromHttpCode; +exports.getTraceData = core.getTraceData; +exports.getTraceMetaTags = core.getTraceMetaTags; +exports.httpHeadersToSpanAttributes = core.httpHeadersToSpanAttributes; +exports.inboundFiltersIntegration = core.inboundFiltersIntegration; +exports.instrumentAnthropicAiClient = core.instrumentAnthropicAiClient; +exports.instrumentGoogleGenAIClient = core.instrumentGoogleGenAIClient; +exports.instrumentLangChainEmbeddings = core.instrumentLangChainEmbeddings; +exports.instrumentLangGraph = core.instrumentLangGraph; +exports.instrumentOpenAiClient = core.instrumentOpenAiClient; +exports.instrumentStateGraph = core.instrumentStateGraph; +exports.instrumentStateGraphCompile = core.instrumentStateGraphCompile; +exports.instrumentSupabaseClient = core.instrumentSupabaseClient; +exports.isEnabled = core.isEnabled; +exports.isInitialized = core.isInitialized; +exports.lastEventId = core.lastEventId; +exports.linkedErrorsIntegration = core.linkedErrorsIntegration; +exports.parameterize = core.parameterize; +exports.profiler = core.profiler; +exports.requestDataIntegration = core.requestDataIntegration; +exports.rewriteFramesIntegration = core.rewriteFramesIntegration; +exports.setAttribute = core.setAttribute; +exports.setAttributes = core.setAttributes; +exports.setContext = core.setContext; +exports.setConversationId = core.setConversationId; +exports.setCurrentClient = core.setCurrentClient; +exports.setExtra = core.setExtra; +exports.setExtras = core.setExtras; +exports.setHttpStatus = core.setHttpStatus; +exports.setMeasurement = core.setMeasurement; +exports.setTag = core.setTag; +exports.setTags = core.setTags; +exports.setUser = core.setUser; +exports.spanStreamingIntegration = core.spanStreamingIntegration; +exports.spanToBaggageHeader = core.spanToBaggageHeader; +exports.spanToJSON = core.spanToJSON; +exports.spanToTraceHeader = core.spanToTraceHeader; +exports.startInactiveSpan = core.startInactiveSpan; +exports.startNewTrace = core.startNewTrace; +exports.startSession = core.startSession; +exports.startSpan = core.startSpan; +exports.startSpanManual = core.startSpanManual; +exports.supabaseIntegration = core.supabaseIntegration; +exports.suppressTracing = core.suppressTracing; +exports.trpcMiddleware = core.trpcMiddleware; +exports.updateSpanName = core.updateSpanName; +exports.winterCGHeadersToDict = core.winterCGHeadersToDict; +exports.withActiveSpan = core.withActiveSpan; +exports.withIsolationScope = core.withIsolationScope; +exports.withMonitor = core.withMonitor; +exports.withScope = core.withScope; +exports.wrapMcpServerWithSentry = core.wrapMcpServerWithSentry; +exports.zodErrorsIntegration = core.zodErrorsIntegration; +exports.NODE_VERSION = nodeCore.NODE_VERSION; +exports.NodeClient = nodeCore.NodeClient; +exports.SentryContextManager = nodeCore.SentryContextManager; +exports._INTERNAL_normalizeCollectionInterval = nodeCore._INTERNAL_normalizeCollectionInterval; +exports.anrIntegration = nodeCore.anrIntegration; +exports.childProcessIntegration = nodeCore.childProcessIntegration; +exports.consoleIntegration = nodeCore.consoleIntegration; +exports.contextLinesIntegration = nodeCore.contextLinesIntegration; +exports.createGetModuleFromFilename = nodeCore.createGetModuleFromFilename; +exports.createSentryWinstonTransport = nodeCore.createSentryWinstonTransport; +exports.cron = nodeCore.cron; +exports.defaultStackParser = nodeCore.defaultStackParser; +exports.disableAnrDetectionForCallback = nodeCore.disableAnrDetectionForCallback; +exports.generateInstrumentOnce = nodeCore.generateInstrumentOnce; +exports.getSentryRelease = nodeCore.getSentryRelease; +exports.httpServerIntegration = nodeCore.httpServerIntegration; +exports.httpServerSpansIntegration = nodeCore.httpServerSpansIntegration; +exports.localVariablesIntegration = nodeCore.localVariablesIntegration; +exports.logger = nodeCore.logger; +exports.makeNodeTransport = nodeCore.makeNodeTransport; +exports.metrics = nodeCore.metrics; +exports.modulesIntegration = nodeCore.modulesIntegration; +exports.nodeContextIntegration = nodeCore.nodeContextIntegration; +exports.nodeRuntimeMetricsIntegration = nodeCore.nodeRuntimeMetricsIntegration; +exports.onUncaughtExceptionIntegration = nodeCore.onUncaughtExceptionIntegration; +exports.onUnhandledRejectionIntegration = nodeCore.onUnhandledRejectionIntegration; +exports.pinoIntegration = nodeCore.pinoIntegration; +exports.processSessionIntegration = nodeCore.processSessionIntegration; +exports.spotlightIntegration = nodeCore.spotlightIntegration; +exports.systemErrorIntegration = nodeCore.systemErrorIntegration; +exports.validateOpenTelemetrySetup = nodeCore.validateOpenTelemetrySetup; +exports.withStreamedSpan = nodeCore.withStreamedSpan; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 33714: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +const growthbookIntegrationShim = core.growthbookIntegration; + +exports.growthbookIntegrationShim = growthbookIntegrationShim; +//# sourceMappingURL=growthbook.js.map + + +/***/ }), + +/***/ 86985: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +const launchDarklyIntegrationShim = core.defineIntegration((_options) => { + if (!core.isBrowser()) { + core.consoleSandbox(() => { + console.warn("The launchDarklyIntegration() can only be used in the browser."); + }); + } + return { + name: "LaunchDarkly" + }; +}); +function buildLaunchDarklyFlagUsedHandlerShim() { + if (!core.isBrowser()) { + core.consoleSandbox(() => { + console.warn("The buildLaunchDarklyFlagUsedHandler() can only be used in the browser."); + }); + } + return { + name: "sentry-flag-auditor", + type: "flag-used", + synchronous: true, + method: () => null + }; +} + +exports.buildLaunchDarklyFlagUsedHandlerShim = buildLaunchDarklyFlagUsedHandlerShim; +exports.launchDarklyIntegrationShim = launchDarklyIntegrationShim; +//# sourceMappingURL=launchDarkly.js.map + + +/***/ }), + +/***/ 45421: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +const openFeatureIntegrationShim = core.defineIntegration((_options) => { + if (!core.isBrowser()) { + core.consoleSandbox(() => { + console.warn("The openFeatureIntegration() can only be used in the browser."); + }); + } + return { + name: "OpenFeature" + }; +}); +class OpenFeatureIntegrationHookShim { + /** + * + */ + constructor() { + if (!core.isBrowser()) { + core.consoleSandbox(() => { + console.warn("The OpenFeatureIntegrationHook can only be used in the browser."); + }); + } + } + /** + * + */ + after() { + } + /** + * + */ + error() { + } +} + +exports.OpenFeatureIntegrationHookShim = OpenFeatureIntegrationHookShim; +exports.openFeatureIntegrationShim = openFeatureIntegrationShim; +//# sourceMappingURL=openFeature.js.map + + +/***/ }), + +/***/ 99396: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +const statsigIntegrationShim = core.defineIntegration((_options) => { + if (!core.isBrowser()) { + core.consoleSandbox(() => { + console.warn("The statsigIntegration() can only be used in the browser."); + }); + } + return { + name: "Statsig" + }; +}); + +exports.statsigIntegrationShim = statsigIntegrationShim; +//# sourceMappingURL=statsig.js.map + + +/***/ }), + +/***/ 87833: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +const unleashIntegrationShim = core.defineIntegration((_options) => { + if (!core.isBrowser()) { + core.consoleSandbox(() => { + console.warn("The unleashIntegration() can only be used in the browser."); + }); + } + return { + name: "Unleash" + }; +}); + +exports.unleashIntegrationShim = unleashIntegrationShim; +//# sourceMappingURL=unleash.js.map + + +/***/ }), + +/***/ 75448: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const instrumentation = __nccwpck_require__(3158); + +const INTEGRATION_NAME = "FileSystem"; +const fsIntegration = core.defineIntegration((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentation.enableFsInstrumentation(options); + } + }; +}); + +exports.fsIntegration = fsIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 21554: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const PROMISE_FUNCTIONS = [ + "access", + "appendFile", + "chmod", + "chown", + "copyFile", + "cp", + // added in v16 + "lchown", + "link", + "lstat", + "lutimes", + // added in v12 + "mkdir", + "mkdtemp", + "open", + "opendir", + // added in v12 + "readdir", + "readFile", + "readlink", + "realpath", + "rename", + "rm", + // added in v14 + "rmdir", + "stat", + "symlink", + "truncate", + "unlink", + "utimes", + "writeFile" + // 'lchmod', // only implemented on macOS +]; +const CALLBACK_FUNCTIONS = [ + "access", + "appendFile", + "chmod", + "chown", + "copyFile", + "cp", + // added in v16 + "exists", + // deprecated, inconsistent cb signature, handling separately when patching + "lchown", + "link", + "lstat", + "lutimes", + // added in v12 + "mkdir", + "mkdtemp", + "open", + "opendir", + // added in v12 + "readdir", + "readFile", + "readlink", + "realpath", + "realpath.native", + "rename", + "rm", + // added in v14 + "rmdir", + "stat", + "symlink", + "truncate", + "unlink", + "utimes", + "writeFile" + // 'close', // functions on file descriptor + // 'fchmod', // functions on file descriptor + // 'fchown', // functions on file descriptor + // 'fdatasync', // functions on file descriptor + // 'fstat', // functions on file descriptor + // 'fsync', // functions on file descriptor + // 'ftruncate', // functions on file descriptor + // 'futimes', // functions on file descriptor + // 'lchmod', // only implemented on macOS + // 'read', // functions on file descriptor + // 'readv', // functions on file descriptor + // 'write', // functions on file descriptor + // 'writev', // functions on file descriptor +]; +const SYNC_FUNCTIONS = [ + "accessSync", + "appendFileSync", + "chmodSync", + "chownSync", + "copyFileSync", + "cpSync", + // added in v16 + "existsSync", + "lchownSync", + "linkSync", + "lstatSync", + "lutimesSync", + // added in v12 + "mkdirSync", + "mkdtempSync", + "opendirSync", + // added in v12 + "openSync", + "readdirSync", + "readFileSync", + "readlinkSync", + "realpathSync", + "realpathSync.native", + "renameSync", + "rmdirSync", + "rmSync", + // added in v14 + "statSync", + "symlinkSync", + "truncateSync", + "unlinkSync", + "utimesSync", + "writeFileSync" + // 'closeSync', // functions on file descriptor + // 'fchmodSync', // functions on file descriptor + // 'fchownSync', // functions on file descriptor + // 'fdatasyncSync', // functions on file descriptor + // 'fstatSync', // functions on file descriptor + // 'fsyncSync', // functions on file descriptor + // 'ftruncateSync', // functions on file descriptor + // 'futimesSync', // functions on file descriptor + // 'lchmodSync', // only implemented on macOS + // 'readSync', // functions on file descriptor + // 'readvSync', // functions on file descriptor + // 'writeSync', // functions on file descriptor + // 'writevSync', // functions on file descriptor +]; + +exports.CALLBACK_FUNCTIONS = CALLBACK_FUNCTIONS; +exports.PROMISE_FUNCTIONS = PROMISE_FUNCTIONS; +exports.SYNC_FUNCTIONS = SYNC_FUNCTIONS; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 3158: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const fs = __nccwpck_require__(57147); +const util = __nccwpck_require__(73837); +const constants = __nccwpck_require__(21554); +const utils = __nccwpck_require__(57173); + +const SPAN_ORIGIN = "auto.file.fs"; +const SPAN_OP = "file"; +const FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH = ["rename", "renameSync"]; +const FS_OPERATIONS_WITH_SRC_DEST = ["copyFile", "cp", "copyFileSync", "cpSync"]; +const FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH = ["link", "linkSync"]; +const FS_OPERATIONS_WITH_PREFIX = ["mkdtemp", "mkdtempSync"]; +const FS_OPERATIONS_WITH_TARGET_PATH = ["symlink", "symlinkSync"]; +const FS_OPERATIONS_WITH_PATH_ARG = [ + "access", + "appendFile", + "chmod", + "chown", + "exists", + "mkdir", + "lchown", + "lstat", + "lutimes", + "open", + "opendir", + "readdir", + "readFile", + "readlink", + "realpath", + "realpath.native", + "rm", + "rmdir", + "stat", + "truncate", + "unlink", + "utimes", + "writeFile", + "accessSync", + "appendFileSync", + "chmodSync", + "chownSync", + "existsSync", + "lchownSync", + "lstatSync", + "lutimesSync", + "opendirSync", + "mkdirSync", + "openSync", + "readdirSync", + "readFileSync", + "readlinkSync", + "realpathSync", + "realpathSync.native", + "rmdirSync", + "rmSync", + "statSync", + "truncateSync", + "unlinkSync", + "utimesSync", + "writeFileSync" +]; +function getSpanAttributes(functionName, args, config) { + const attributes = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: SPAN_OP, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: SPAN_ORIGIN + }; + if (!config.recordFilePaths) { + return attributes; + } + if (typeof args[0] === "string" && FS_OPERATIONS_WITH_PATH_ARG.includes(functionName)) { + attributes["path_argument"] = args[0]; + } else if (typeof args[0] === "string" && typeof args[1] === "string") { + if (FS_OPERATIONS_WITH_TARGET_PATH.includes(functionName)) { + attributes["target_argument"] = args[0]; + attributes["path_argument"] = args[1]; + } else if (FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH.includes(functionName)) { + attributes["existing_path_argument"] = args[0]; + attributes["new_path_argument"] = args[1]; + } else if (FS_OPERATIONS_WITH_SRC_DEST.includes(functionName)) { + attributes["src_argument"] = args[0]; + attributes["dest_argument"] = args[1]; + } else if (FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH.includes(functionName)) { + attributes["old_path_argument"] = args[0]; + attributes["new_path_argument"] = args[1]; + } + } else if (typeof args[0] === "string" && FS_OPERATIONS_WITH_PREFIX.includes(functionName)) { + attributes["prefix_argument"] = args[0]; + } + return attributes; +} +function patchedFunctionWithOriginalProperties(patchedFunction, original) { + return Object.assign(patchedFunction, original); +} +const _patched = /* @__PURE__ */ new WeakMap(); +function _patchMethod(obj, name, wrapper) { + const original = obj[name]; + if (typeof original !== "function") return; + let patched = _patched.get(obj); + if (!patched) { + patched = /* @__PURE__ */ new Set(); + _patched.set(obj, patched); + } + if (patched.has(name)) return; + patched.add(name); + obj[name] = wrapper(original); +} +function _patchSyncFunction(functionName, original, config) { + const patchedFunction = function(...args) { + const attributes = getSpanAttributes(functionName, args, config); + return core.startSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes }, (span) => { + try { + return core.suppressTracing(() => original.apply(this, args)); + } catch (error) { + recordError(span, error, config); + throw error; + } + }); + }; + return patchedFunctionWithOriginalProperties(patchedFunction, original); +} +function _patchCallbackFunction(functionName, original, config) { + const patchedFunction = function(...args) { + const lastIdx = args.length - 1; + const cb = args[lastIdx]; + if (typeof cb !== "function") { + return original.apply(this, args); + } + const attributes = getSpanAttributes(functionName, args, config); + const span = core.startInactiveSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes }); + const parentSpan = core.getActiveSpan(); + args[lastIdx] = function(...cbArgs) { + const error = cbArgs[0]; + if (error) { + recordError(span, error, config); + } + span.end(); + if (parentSpan) { + return core.withActiveSpan(parentSpan, () => cb.apply(this, cbArgs)); + } + return cb.apply(this, cbArgs); + }; + try { + return core.suppressTracing(() => original.apply(this, args)); + } catch (error) { + recordError(span, error, config); + span.end(); + throw error; + } + }; + return patchedFunctionWithOriginalProperties(patchedFunction, original); +} +function _patchExistsCallbackFunction(original, config) { + const functionName = "exists"; + const patchedFunction = function(...args) { + const lastIdx = args.length - 1; + const cb = args[lastIdx]; + if (typeof cb !== "function") { + return original.apply(this, args); + } + const attributes = getSpanAttributes(functionName, args, config); + const span = core.startInactiveSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes }); + const parentSpan = core.getActiveSpan(); + args[lastIdx] = function(...cbArgs) { + span.end(); + if (parentSpan) { + return core.withActiveSpan(parentSpan, () => cb.apply(this, cbArgs)); + } + return cb.apply(this, cbArgs); + }; + try { + return core.suppressTracing(() => original.apply(this, args)); + } catch (error) { + recordError(span, error, config); + span.end(); + throw error; + } + }; + const functionWithOriginalProperties = patchedFunctionWithOriginalProperties(patchedFunction, original); + const promisified = function(path) { + return new Promise((resolve) => functionWithOriginalProperties(path, resolve)); + }; + Object.defineProperty(promisified, "name", { value: functionName }); + Object.defineProperty(functionWithOriginalProperties, util.promisify.custom, { + value: promisified + }); + return functionWithOriginalProperties; +} +function _patchPromiseFunction(functionName, original, config) { + const patchedFunction = async function(...args) { + const attributes = getSpanAttributes(functionName, args, config); + return core.startSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes }, async (span) => { + try { + return await core.suppressTracing(() => original.apply(this, args)); + } catch (error) { + recordError(span, error, config); + throw error; + } + }); + }; + return patchedFunctionWithOriginalProperties(patchedFunction, original); +} +function enableFsInstrumentation(config = {}) { + for (const fName of constants.SYNC_FUNCTIONS) { + const { objectToPatch, functionNameToPatch } = utils.indexFs(fs, fName); + _patchMethod(objectToPatch, functionNameToPatch, (original) => _patchSyncFunction(fName, original, config)); + } + for (const fName of constants.CALLBACK_FUNCTIONS) { + const { objectToPatch, functionNameToPatch } = utils.indexFs(fs, fName); + if (fName === "exists") { + _patchMethod(objectToPatch, functionNameToPatch, (original) => _patchExistsCallbackFunction(original, config)); + } else { + _patchMethod(objectToPatch, functionNameToPatch, (original) => _patchCallbackFunction(fName, original, config)); + } + } + const fsPromises = fs.promises; + for (const fName of constants.PROMISE_FUNCTIONS) { + _patchMethod(fsPromises, fName, (original) => _patchPromiseFunction(fName, original, config)); + } +} +function recordError(span, error, config) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" }); + if (config.recordErrorMessagesAsSpanAttributes && error instanceof Error) { + span.setAttribute("fs_error", error.message); + } +} + +exports.enableFsInstrumentation = enableFsInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 57173: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function splitTwoLevels(functionName) { + const memberParts = functionName.split("."); + if (memberParts.length > 1) { + if (memberParts.length !== 2) throw Error(`Invalid member function name ${functionName}`); + return memberParts; + } else { + return [functionName]; + } +} +function indexFs(fs, member) { + if (!member) throw new Error(JSON.stringify({ member })); + const splitResult = splitTwoLevels(member); + const [functionName1, functionName2] = splitResult; + if (functionName2) { + return { + objectToPatch: fs[functionName1], + functionNameToPatch: functionName2 + }; + } else { + return { + objectToPatch: fs, + functionNameToPatch: functionName1 + }; + } +} + +exports.indexFs = indexFs; +exports.splitTwoLevels = splitTwoLevels; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 92447: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const attributes = __nccwpck_require__(88264); + +const INTEGRATION_NAME = "Http"; +const instrumentSentryHttp = Object.assign(nodeCore.instrumentHttpOutgoingRequests, { + id: `${INTEGRATION_NAME}.sentry` +}); +const httpIntegration = core.defineIntegration((options = {}) => { + const spans = options.spans ?? true; + const disableIncomingRequestSpans = options.disableIncomingRequestSpans; + const enableServerSpans = spans && !disableIncomingRequestSpans; + const serverOptions = { + sessions: options.trackIncomingRequestsAsSessions, + sessionFlushingDelayMS: options.sessionFlushingDelayMS, + ignoreRequestBody: options.ignoreIncomingRequestBody, + maxRequestBodySize: options.maxIncomingRequestBodySize + }; + const serverSpansOptions = { + ignoreIncomingRequests: options.ignoreIncomingRequests, + ignoreStaticAssets: options.ignoreStaticAssets, + ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes, + instrumentation: options.instrumentation, + onSpanCreated: options.incomingRequestSpanHook + }; + const server = nodeCore.httpServerIntegration(serverOptions); + const serverSpans = nodeCore.httpServerSpansIntegration(serverSpansOptions); + return { + name: INTEGRATION_NAME, + setup(client) { + const clientOptions = client.getOptions(); + if (enableServerSpans && core.hasSpansEnabled(clientOptions)) { + serverSpans.setup(client); + } + }, + setupOnce() { + server.setupOnce(); + const sentryHttpInstrumentationOptions = { + breadcrumbs: options.breadcrumbs, + spans, + propagateTraceInOutgoingRequests: options.tracePropagation ?? true, + createSpansForOutgoingRequests: spans, + ignoreOutgoingRequests: options.ignoreOutgoingRequests, + outgoingRequestHook: (span, request) => { + const url = core.getRequestUrlFromClientRequest(request); + if (url.startsWith("data:")) { + const sanitizedUrl = core.stripDataUrlContent(url); + span.setAttribute("http.url", sanitizedUrl); + span.setAttribute(attributes.URL_FULL, sanitizedUrl); + span.updateName(`${request.method || "GET"} ${sanitizedUrl}`); + } + options.instrumentation?.requestHook?.(span, request); + }, + outgoingResponseHook: options.instrumentation?.responseHook, + outgoingRequestApplyCustomAttributes: options.instrumentation?.applyCustomAttributesOnSpan + }; + nodeCore.instrumentHttpOutgoingRequests(sentryHttpInstrumentationOptions); + }, + processEvent(event) { + return serverSpans.processEvent(event); + } + }; +}); + +exports.httpIntegration = httpIntegration; +exports.instrumentSentryHttp = instrumentSentryHttp; +//# sourceMappingURL=http.js.map + + +/***/ }), + +/***/ 40839: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const nodeCore = __nccwpck_require__(28648); +const core = __nccwpck_require__(84466); + +const _nativeNodeFetchIntegration = ((options = {}) => { + return { + name: "NodeFetch", + setupOnce() { + const clientOptions = core.getClient()?.getOptions(); + nodeCore.instrumentUndici({ + ...options, + spans: _shouldInstrumentSpans(options, clientOptions) + }); + } + }; +}); +const nativeNodeFetchIntegration = core.defineIntegration(_nativeNodeFetchIntegration); +function _shouldInstrumentSpans(options, clientOptions = {}) { + return options.spans ?? (!clientOptions.skipOpenTelemetrySetup && core.hasSpansEnabled(clientOptions)); +} + +exports.nativeNodeFetchIntegration = nativeNodeFetchIntegration; +//# sourceMappingURL=node-fetch.js.map + + +/***/ }), + +/***/ 43683: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const path = __nccwpck_require__(71017); + +class InstrumentationNodeModuleFile { + constructor(name, supportedVersions, patch, unpatch) { + this.name = path.normalize(name); + this.supportedVersions = supportedVersions; + this.patch = patch; + this.unpatch = unpatch; + } +} + +exports.InstrumentationNodeModuleFile = InstrumentationNodeModuleFile; +//# sourceMappingURL=InstrumentationNodeModuleFile.js.map + + +/***/ }), + +/***/ 98562: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const instrumentation = __nccwpck_require__(65754); + +const INTEGRATION_NAME = "Amqplib"; +const instrumentAmqplib = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.AmqplibInstrumentation()); +const _amqplibIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentAmqplib(); + } + }; +}); +const amqplibIntegration = core.defineIntegration(_amqplibIntegration); + +exports.amqplibIntegration = amqplibIntegration; +exports.instrumentAmqplib = instrumentAmqplib; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 65754: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const patches = __nccwpck_require__(64213); +const types = __nccwpck_require__(22080); + +const PACKAGE_NAME = "@sentry/instrumentation-amqplib"; +const supportedVersions = [">=0.5.5 <2"]; +class AmqplibInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + const channelModelModuleFile = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "amqplib/lib/channel_model.js", + supportedVersions, + this.patchChannelModel.bind(this), + this.unpatchChannelModel.bind(this) + ); + const callbackModelModuleFile = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "amqplib/lib/callback_model.js", + supportedVersions, + this.patchChannelModel.bind(this), + this.unpatchChannelModel.bind(this) + ); + const connectModuleFile = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "amqplib/lib/connect.js", + supportedVersions, + this.patchConnect.bind(this), + this.unpatchConnect.bind(this) + ); + const module = new instrumentation.InstrumentationNodeModuleDefinition("amqplib", supportedVersions, void 0, void 0, [ + channelModelModuleFile, + connectModuleFile, + callbackModelModuleFile + ]); + return module; + } + patchConnect(moduleExports) { + const unpatchedExports = this.unpatchConnect(moduleExports); + if (!instrumentation.isWrapped(unpatchedExports.connect)) { + this._wrap(unpatchedExports, "connect", patches.getConnectPatch); + } + return unpatchedExports; + } + unpatchConnect(moduleExports) { + if (instrumentation.isWrapped(moduleExports.connect)) { + this._unwrap(moduleExports, "connect"); + } + return moduleExports; + } + patchChannelModel(moduleExports) { + if (!instrumentation.isWrapped(moduleExports.Channel.prototype.publish)) { + this._wrap(moduleExports.Channel.prototype, "publish", patches.getPublishPatch); + } + if (!instrumentation.isWrapped(moduleExports.Channel.prototype.consume)) { + this._wrap(moduleExports.Channel.prototype, "consume", patches.getConsumePatch); + } + if (!instrumentation.isWrapped(moduleExports.Channel.prototype.ack)) { + this._wrap(moduleExports.Channel.prototype, "ack", patches.getAckPatch(false, types.EndOperation.Ack)); + } + if (!instrumentation.isWrapped(moduleExports.Channel.prototype.nack)) { + this._wrap(moduleExports.Channel.prototype, "nack", patches.getAckPatch(true, types.EndOperation.Nack)); + } + if (!instrumentation.isWrapped(moduleExports.Channel.prototype.reject)) { + this._wrap(moduleExports.Channel.prototype, "reject", patches.getAckPatch(true, types.EndOperation.Reject)); + } + if (!instrumentation.isWrapped(moduleExports.Channel.prototype.ackAll)) { + this._wrap(moduleExports.Channel.prototype, "ackAll", patches.getAckAllPatch(false, types.EndOperation.AckAll)); + } + if (!instrumentation.isWrapped(moduleExports.Channel.prototype.nackAll)) { + this._wrap(moduleExports.Channel.prototype, "nackAll", patches.getAckAllPatch(true, types.EndOperation.NackAll)); + } + if (!instrumentation.isWrapped(moduleExports.Channel.prototype.emit)) { + this._wrap(moduleExports.Channel.prototype, "emit", patches.getChannelEmitPatch); + } + if (!instrumentation.isWrapped(moduleExports.ConfirmChannel.prototype.publish)) { + this._wrap(moduleExports.ConfirmChannel.prototype, "publish", patches.getConfirmedPublishPatch); + } + return moduleExports; + } + unpatchChannelModel(moduleExports) { + if (instrumentation.isWrapped(moduleExports.Channel.prototype.publish)) { + this._unwrap(moduleExports.Channel.prototype, "publish"); + } + if (instrumentation.isWrapped(moduleExports.Channel.prototype.consume)) { + this._unwrap(moduleExports.Channel.prototype, "consume"); + } + if (instrumentation.isWrapped(moduleExports.Channel.prototype.ack)) { + this._unwrap(moduleExports.Channel.prototype, "ack"); + } + if (instrumentation.isWrapped(moduleExports.Channel.prototype.nack)) { + this._unwrap(moduleExports.Channel.prototype, "nack"); + } + if (instrumentation.isWrapped(moduleExports.Channel.prototype.reject)) { + this._unwrap(moduleExports.Channel.prototype, "reject"); + } + if (instrumentation.isWrapped(moduleExports.Channel.prototype.ackAll)) { + this._unwrap(moduleExports.Channel.prototype, "ackAll"); + } + if (instrumentation.isWrapped(moduleExports.Channel.prototype.nackAll)) { + this._unwrap(moduleExports.Channel.prototype, "nackAll"); + } + if (instrumentation.isWrapped(moduleExports.Channel.prototype.emit)) { + this._unwrap(moduleExports.Channel.prototype, "emit"); + } + if (instrumentation.isWrapped(moduleExports.ConfirmChannel.prototype.publish)) { + this._unwrap(moduleExports.ConfirmChannel.prototype, "publish"); + } + return moduleExports; + } +} + +exports.AmqplibInstrumentation = AmqplibInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 64213: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const types = __nccwpck_require__(22080); +const utils = __nccwpck_require__(39783); + +const CONSUME_TIMEOUT_MS = 1e3 * 60; +function endConsumerSpan(message, isRejected, operation, requeue) { + const storedSpan = message[utils.MESSAGE_STORED_SPAN]; + if (!storedSpan) { + return; + } + if (isRejected !== false) { + storedSpan.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: operation !== types.EndOperation.ChannelClosed && operation !== types.EndOperation.ChannelError ? `${operation} called on message${requeue === true ? " with requeue" : requeue === false ? " without requeue" : ""}` : operation + }); + } + storedSpan.end(); + message[utils.MESSAGE_STORED_SPAN] = void 0; +} +function endAllSpansOnChannel(channel, isRejected, operation, requeue) { + const spansNotEnded = channel[utils.CHANNEL_SPANS_NOT_ENDED] ?? []; + spansNotEnded.forEach((msgDetails) => { + endConsumerSpan(msgDetails.msg, isRejected, operation, requeue); + }); + channel[utils.CHANNEL_SPANS_NOT_ENDED] = []; +} +function checkConsumeTimeoutOnChannel(channel) { + const currentTime = core.timestampInSeconds(); + const spansNotEnded = channel[utils.CHANNEL_SPANS_NOT_ENDED] ?? []; + let i; + for (i = 0; i < spansNotEnded.length; i++) { + const currMessage = spansNotEnded[i]; + const timeFromConsumeMs = (currentTime - currMessage.timeOfConsume) * 1e3; + if (timeFromConsumeMs < CONSUME_TIMEOUT_MS) { + break; + } + endConsumerSpan(currMessage.msg, null, types.EndOperation.InstrumentationTimeout, true); + } + spansNotEnded.splice(0, i); +} +function getConnectPatch(original) { + return function patchedConnect(url, socketOptions, openCallback) { + return original.call(this, url, socketOptions, function(err, conn) { + if (err == null) { + const urlAttributes = utils.getConnectionAttributesFromUrl(url); + const serverAttributes = utils.getConnectionAttributesFromServer(conn); + conn[utils.CONNECTION_ATTRIBUTES] = { + ...urlAttributes, + ...serverAttributes + }; + } + openCallback.apply(this, arguments); + }); + }; +} +function getChannelEmitPatch(original) { + return function emit(eventName) { + if (eventName === "close") { + endAllSpansOnChannel(this, true, types.EndOperation.ChannelClosed, void 0); + const activeTimer = this[utils.CHANNEL_CONSUME_TIMEOUT_TIMER]; + if (activeTimer) { + clearInterval(activeTimer); + } + this[utils.CHANNEL_CONSUME_TIMEOUT_TIMER] = void 0; + } else if (eventName === "error") { + endAllSpansOnChannel(this, true, types.EndOperation.ChannelError, void 0); + } + return original.apply(this, arguments); + }; +} +function getAckAllPatch(isRejected, endOperation) { + return (original) => function ackAll(requeueOrEmpty) { + endAllSpansOnChannel(this, isRejected, endOperation, requeueOrEmpty); + return original.apply(this, arguments); + }; +} +function getAckPatch(isRejected, endOperation) { + return (original) => function ack(message, allUpToOrRequeue, requeue) { + const channel = this; + const requeueResolved = endOperation === types.EndOperation.Reject ? allUpToOrRequeue : requeue; + const spansNotEnded = channel[utils.CHANNEL_SPANS_NOT_ENDED] ?? []; + const msgIndex = spansNotEnded.findIndex((msgDetails) => msgDetails.msg === message); + if (msgIndex < 0) { + endConsumerSpan(message, isRejected, endOperation, requeueResolved); + } else if (endOperation !== types.EndOperation.Reject && allUpToOrRequeue) { + for (let i = 0; i <= msgIndex; i++) { + endConsumerSpan(spansNotEnded[i].msg, isRejected, endOperation, requeueResolved); + } + spansNotEnded.splice(0, msgIndex + 1); + } else { + endConsumerSpan(message, isRejected, endOperation, requeueResolved); + spansNotEnded.splice(msgIndex, 1); + } + return original.apply(this, arguments); + }; +} +function getConsumePatch(original) { + return function consume(queue, onMessage, options) { + const channel = this; + if (!Object.prototype.hasOwnProperty.call(channel, utils.CHANNEL_SPANS_NOT_ENDED)) { + const timer = setInterval(() => { + checkConsumeTimeoutOnChannel(channel); + }, CONSUME_TIMEOUT_MS); + timer.unref(); + channel[utils.CHANNEL_CONSUME_TIMEOUT_TIMER] = timer; + channel[utils.CHANNEL_SPANS_NOT_ENDED] = []; + } + const patchedOnMessage = function(msg) { + if (!msg) { + return onMessage.call(this, msg); + } + const headers = msg.properties.headers ?? {}; + const sentryTrace = utils.getHeaderAsString(headers, "sentry-trace"); + const baggage = utils.getHeaderAsString(headers, "baggage"); + core.continueTrace({ sentryTrace, baggage }, () => { + const span = utils.startConsumeSpan(queue, msg, channel); + if (!options?.noAck) { + channel[utils.CHANNEL_SPANS_NOT_ENDED].push({ msg, timeOfConsume: core.timestampInSeconds() }); + msg[utils.MESSAGE_STORED_SPAN] = span; + } + core.withActiveSpan(span, () => { + onMessage.call(this, msg); + }); + if (options?.noAck) { + span.end(); + } + }); + }; + const callArgs = Array.prototype.slice.call(arguments); + callArgs[1] = patchedOnMessage; + return original.apply(this, callArgs); + }; +} +function getConfirmedPublishPatch(original) { + return function confirmedPublish(exchange, routingKey, content, options, callback) { + const channel = this; + const { span, modifiedOptions } = utils.startPublishSpan(exchange, routingKey, channel, options); + const patchedOnConfirm = function(err, ok) { + try { + core.withActiveSpan(span, () => { + callback?.call(this, err, ok); + }); + } finally { + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "message confirmation has been nack'ed" }); + } + span.end(); + } + }; + const argumentsCopy = [...arguments]; + argumentsCopy[3] = modifiedOptions; + argumentsCopy[4] = patchedOnConfirm; + channel[utils.CHANNEL_IS_CONFIRM_PUBLISHING] = true; + try { + return original.apply(this, argumentsCopy); + } finally { + channel[utils.CHANNEL_IS_CONFIRM_PUBLISHING] = false; + } + }; +} +function getPublishPatch(original) { + return function publish(exchange, routingKey, content, options) { + if (this[utils.CHANNEL_IS_CONFIRM_PUBLISHING]) { + return original.apply(this, arguments); + } + const channel = this; + const { span, modifiedOptions } = utils.startPublishSpan(exchange, routingKey, channel, options); + const argumentsCopy = [...arguments]; + argumentsCopy[3] = modifiedOptions; + const originalRes = original.apply(this, argumentsCopy); + span.end(); + return originalRes; + }; +} + +exports.getAckAllPatch = getAckAllPatch; +exports.getAckPatch = getAckPatch; +exports.getChannelEmitPatch = getChannelEmitPatch; +exports.getConfirmedPublishPatch = getConfirmedPublishPatch; +exports.getConnectPatch = getConnectPatch; +exports.getConsumePatch = getConsumePatch; +exports.getPublishPatch = getPublishPatch; +//# sourceMappingURL=patches.js.map + + +/***/ }), + +/***/ 91002: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_MESSAGING_OPERATION = "messaging.operation"; +const ATTR_MESSAGING_DESTINATION = "messaging.destination"; +const ATTR_MESSAGING_DESTINATION_KIND = "messaging.destination_kind"; +const ATTR_MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key"; +const ATTR_MESSAGING_PROTOCOL = "messaging.protocol"; +const ATTR_MESSAGING_PROTOCOL_VERSION = "messaging.protocol_version"; +const ATTR_MESSAGING_URL = "messaging.url"; +const OLD_ATTR_MESSAGING_MESSAGE_ID = "messaging.message_id"; +const ATTR_MESSAGING_CONVERSATION_ID = "messaging.conversation_id"; +const MESSAGING_DESTINATION_KIND_VALUE_TOPIC = "topic"; +const MESSAGING_OPERATION_VALUE_PROCESS = "process"; + +exports.ATTR_MESSAGING_CONVERSATION_ID = ATTR_MESSAGING_CONVERSATION_ID; +exports.ATTR_MESSAGING_DESTINATION = ATTR_MESSAGING_DESTINATION; +exports.ATTR_MESSAGING_DESTINATION_KIND = ATTR_MESSAGING_DESTINATION_KIND; +exports.ATTR_MESSAGING_OPERATION = ATTR_MESSAGING_OPERATION; +exports.ATTR_MESSAGING_PROTOCOL = ATTR_MESSAGING_PROTOCOL; +exports.ATTR_MESSAGING_PROTOCOL_VERSION = ATTR_MESSAGING_PROTOCOL_VERSION; +exports.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY = ATTR_MESSAGING_RABBITMQ_ROUTING_KEY; +exports.ATTR_MESSAGING_URL = ATTR_MESSAGING_URL; +exports.MESSAGING_DESTINATION_KIND_VALUE_TOPIC = MESSAGING_DESTINATION_KIND_VALUE_TOPIC; +exports.MESSAGING_OPERATION_VALUE_PROCESS = MESSAGING_OPERATION_VALUE_PROCESS; +exports.OLD_ATTR_MESSAGING_MESSAGE_ID = OLD_ATTR_MESSAGING_MESSAGE_ID; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 22080: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var EndOperation = /* @__PURE__ */ ((EndOperation2) => { + EndOperation2["AutoAck"] = "auto ack"; + EndOperation2["Ack"] = "ack"; + EndOperation2["AckAll"] = "ackAll"; + EndOperation2["Reject"] = "reject"; + EndOperation2["Nack"] = "nack"; + EndOperation2["NackAll"] = "nackAll"; + EndOperation2["ChannelClosed"] = "channel closed"; + EndOperation2["ChannelError"] = "channel error"; + EndOperation2["InstrumentationTimeout"] = "instrumentation timeout"; + return EndOperation2; +})(EndOperation || {}); + +exports.EndOperation = EndOperation; +//# sourceMappingURL=types.js.map + + +/***/ }), + +/***/ 39783: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const semconv = __nccwpck_require__(91002); + +const PUBLISHER_ORIGIN = "auto.amqplib.otel.publisher"; +const CONSUMER_ORIGIN = "auto.amqplib.otel.consumer"; +const MESSAGE_STORED_SPAN = /* @__PURE__ */ Symbol("opentelemetry.amqplib.message.stored-span"); +const CHANNEL_SPANS_NOT_ENDED = /* @__PURE__ */ Symbol("opentelemetry.amqplib.channel.spans-not-ended"); +const CHANNEL_CONSUME_TIMEOUT_TIMER = /* @__PURE__ */ Symbol( + "opentelemetry.amqplib.channel.consumer-timeout-timer" +); +const CONNECTION_ATTRIBUTES = /* @__PURE__ */ Symbol("opentelemetry.amqplib.connection.attributes"); +const CHANNEL_IS_CONFIRM_PUBLISHING = /* @__PURE__ */ Symbol("sentry.amqplib.channel.is-confirm-publishing"); +const normalizeExchange = (exchangeName) => exchangeName !== "" ? exchangeName : ""; +const censorPassword = (url) => { + return url.replace(/:[^:@/]*@/, ":***@"); +}; +const getPort = (portFromUrl, resolvedProtocol) => { + return portFromUrl || (resolvedProtocol === "AMQP" ? 5672 : 5671); +}; +const getProtocol = (protocolFromUrl) => { + const resolvedProtocol = protocolFromUrl || "amqp"; + const noEndingColon = resolvedProtocol.endsWith(":") ? resolvedProtocol.substring(0, resolvedProtocol.length - 1) : resolvedProtocol; + return noEndingColon.toUpperCase(); +}; +const getHostname = (hostnameFromUrl) => { + return hostnameFromUrl || "localhost"; +}; +const getConnectionAttributesFromServer = (conn) => { + const product = conn.serverProperties.product?.toLowerCase?.(); + if (product) { + return { + [attributes.MESSAGING_SYSTEM]: product + }; + } else { + return {}; + } +}; +const getConnectionAttributesFromUrl = (url) => { + const attributes$1 = { + [semconv.ATTR_MESSAGING_PROTOCOL_VERSION]: "0.9.1" + // this is the only protocol supported by the instrumented library + }; + const resolvedUrl = url || "amqp://localhost"; + if (typeof resolvedUrl === "object") { + const connectOptions = resolvedUrl; + const protocol = getProtocol(connectOptions?.protocol); + attributes$1[semconv.ATTR_MESSAGING_PROTOCOL] = protocol; + attributes$1[attributes.NET_PEER_NAME] = getHostname(connectOptions?.hostname); + attributes$1[attributes.NET_PEER_PORT] = getPort(connectOptions.port, protocol); + } else { + const censoredUrl = censorPassword(resolvedUrl); + attributes$1[semconv.ATTR_MESSAGING_URL] = censoredUrl; + try { + const urlParts = new URL(censoredUrl); + const protocol = getProtocol(urlParts.protocol); + attributes$1[semconv.ATTR_MESSAGING_PROTOCOL] = protocol; + attributes$1[attributes.NET_PEER_NAME] = getHostname(urlParts.hostname); + attributes$1[attributes.NET_PEER_PORT] = getPort(urlParts.port ? parseInt(urlParts.port) : void 0, protocol); + } catch { + } + } + return attributes$1; +}; +function getHeaderAsString(headers, key) { + const value = headers?.[key]; + if (value == null) { + return void 0; + } + return Array.isArray(value) ? String(value[0]) : String(value); +} +function startPublishSpan(exchange, routingKey, channel, options) { + const normalizedExchange = normalizeExchange(exchange); + const span = core.startInactiveSpan({ + name: `publish ${normalizedExchange}`, + kind: api.SpanKind.PRODUCER, + attributes: { + ...channel.connection[CONNECTION_ATTRIBUTES], + [semconv.ATTR_MESSAGING_DESTINATION]: exchange, + [semconv.ATTR_MESSAGING_DESTINATION_KIND]: semconv.MESSAGING_DESTINATION_KIND_VALUE_TOPIC, + [semconv.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey, + [semconv.OLD_ATTR_MESSAGING_MESSAGE_ID]: options?.messageId, + [semconv.ATTR_MESSAGING_CONVERSATION_ID]: options?.correlationId, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PUBLISHER_ORIGIN + } + }); + const modifiedOptions = options ?? {}; + modifiedOptions.headers = modifiedOptions.headers ?? {}; + const traceData = core.getTraceData({ span }); + if (traceData["sentry-trace"]) { + modifiedOptions.headers["sentry-trace"] = traceData["sentry-trace"]; + } + if (traceData.baggage) { + modifiedOptions.headers["baggage"] = traceData.baggage; + } + return { span, modifiedOptions }; +} +function startConsumeSpan(queue, msg, channel) { + return core.startInactiveSpan({ + name: `${queue} process`, + kind: api.SpanKind.CONSUMER, + attributes: { + ...channel?.connection?.[CONNECTION_ATTRIBUTES], + [semconv.ATTR_MESSAGING_DESTINATION]: msg.fields?.exchange, + [semconv.ATTR_MESSAGING_DESTINATION_KIND]: semconv.MESSAGING_DESTINATION_KIND_VALUE_TOPIC, + [semconv.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: msg.fields?.routingKey, + [semconv.ATTR_MESSAGING_OPERATION]: semconv.MESSAGING_OPERATION_VALUE_PROCESS, + [semconv.OLD_ATTR_MESSAGING_MESSAGE_ID]: msg?.properties.messageId, + [semconv.ATTR_MESSAGING_CONVERSATION_ID]: msg?.properties.correlationId, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: CONSUMER_ORIGIN + } + }); +} + +exports.CHANNEL_CONSUME_TIMEOUT_TIMER = CHANNEL_CONSUME_TIMEOUT_TIMER; +exports.CHANNEL_IS_CONFIRM_PUBLISHING = CHANNEL_IS_CONFIRM_PUBLISHING; +exports.CHANNEL_SPANS_NOT_ENDED = CHANNEL_SPANS_NOT_ENDED; +exports.CONNECTION_ATTRIBUTES = CONNECTION_ATTRIBUTES; +exports.MESSAGE_STORED_SPAN = MESSAGE_STORED_SPAN; +exports.getConnectionAttributesFromServer = getConnectionAttributesFromServer; +exports.getConnectionAttributesFromUrl = getConnectionAttributesFromUrl; +exports.getHeaderAsString = getHeaderAsString; +exports.normalizeExchange = normalizeExchange; +exports.startConsumeSpan = startConsumeSpan; +exports.startPublishSpan = startPublishSpan; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 88363: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const instrumentation = __nccwpck_require__(10993); + +const instrumentAnthropicAi = nodeCore.generateInstrumentOnce( + core.ANTHROPIC_AI_INTEGRATION_NAME, + (options) => new instrumentation.SentryAnthropicAiInstrumentation(options) +); +const _anthropicAIIntegration = ((options = {}) => { + return { + name: core.ANTHROPIC_AI_INTEGRATION_NAME, + options, + setupOnce() { + instrumentAnthropicAi(options); + } + }; +}); +const anthropicAIIntegration = core.defineIntegration(_anthropicAIIntegration); + +exports.anthropicAIIntegration = anthropicAIIntegration; +exports.instrumentAnthropicAi = instrumentAnthropicAi; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 10993: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); + +const supportedVersions = [">=0.19.2 <1.0.0"]; +class SentryAnthropicAiInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("@sentry/instrumentation-anthropic-ai", core.SDK_VERSION, config); + } + /** + * Initializes the instrumentation by defining the modules to be patched. + */ + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition( + "@anthropic-ai/sdk", + supportedVersions, + this._patch.bind(this) + ); + return module; + } + /** + * Core patch logic applying instrumentation to the Anthropic AI client constructor. + */ + _patch(exports) { + const Original = exports.Anthropic; + const config = this.getConfig(); + const WrappedAnthropic = function(...args) { + if (core._INTERNAL_shouldSkipAiProviderWrapping(core.ANTHROPIC_AI_INTEGRATION_NAME)) { + return Reflect.construct(Original, args); + } + const instance = Reflect.construct(Original, args); + return core.instrumentAnthropicAiClient(instance, config); + }; + Object.setPrototypeOf(WrappedAnthropic, Original); + Object.setPrototypeOf(WrappedAnthropic.prototype, Original.prototype); + for (const key of Object.getOwnPropertyNames(Original)) { + if (!["length", "name", "prototype"].includes(key)) { + const descriptor = Object.getOwnPropertyDescriptor(Original, key); + if (descriptor) { + Object.defineProperty(WrappedAnthropic, key, descriptor); + } + } + } + try { + exports.Anthropic = WrappedAnthropic; + } catch { + Object.defineProperty(exports, "Anthropic", { + value: WrappedAnthropic, + writable: true, + configurable: true, + enumerable: true + }); + } + if (exports.default === Original) { + try { + exports.default = WrappedAnthropic; + } catch { + Object.defineProperty(exports, "default", { + value: WrappedAnthropic, + writable: true, + configurable: true, + enumerable: true + }); + } + } + return exports; + } +} + +exports.SentryAnthropicAiInstrumentation = SentryAnthropicAiInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 80322: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(17048); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "Connect"; +const instrumentConnect = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.ConnectInstrumentation()); +const _connectIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentConnect(); + } + }; +}); +const connectIntegration = core.defineIntegration(_connectIntegration); +function connectErrorMiddleware(err, req, res, next) { + core.captureException(err, { + mechanism: { + handled: false, + type: "auto.middleware.connect" + } + }); + next(err); +} +const setupConnectErrorHandler = (app) => { + app.use(connectErrorMiddleware); + nodeCore.ensureIsWrapped(app.use, "connect"); +}; + +exports.connectIntegration = connectIntegration; +exports.instrumentConnect = instrumentConnect; +exports.setupConnectErrorHandler = setupConnectErrorHandler; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 17414: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => { + AttributeNames2["CONNECT_TYPE"] = "connect.type"; + AttributeNames2["CONNECT_NAME"] = "connect.name"; + return AttributeNames2; +})(AttributeNames || {}); +var ConnectTypes = /* @__PURE__ */ ((ConnectTypes2) => { + ConnectTypes2["MIDDLEWARE"] = "middleware"; + ConnectTypes2["REQUEST_HANDLER"] = "request_handler"; + return ConnectTypes2; +})(ConnectTypes || {}); + +exports.AttributeNames = AttributeNames; +exports.ConnectTypes = ConnectTypes; +//# sourceMappingURL=AttributeNames.js.map + + +/***/ }), + +/***/ 17048: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const AttributeNames = __nccwpck_require__(17414); +const core = __nccwpck_require__(84466); +const setHttpServerSpanRouteAttribute = __nccwpck_require__(63790); +const instrumentation = __nccwpck_require__(65584); +const attributes = __nccwpck_require__(88264); +const utils = __nccwpck_require__(28866); + +const PACKAGE_NAME = "@sentry/instrumentation-connect"; +const ANONYMOUS_NAME = "anonymous"; +class ConnectInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition("connect", [">=3.0.0 <4"], (moduleExports) => { + return this._patchConstructor(moduleExports); + }) + ]; + } + _patchApp(patchedApp) { + if (!instrumentation.isWrapped(patchedApp.use)) { + this._wrap(patchedApp, "use", this._patchUse.bind(this)); + } + if (!instrumentation.isWrapped(patchedApp.handle)) { + this._wrap(patchedApp, "handle", this._patchHandle.bind(this)); + } + } + _patchConstructor(original) { + const patchApp = this._patchApp.bind(this); + return function(...args) { + const app = Reflect.apply(original, this, args); + patchApp(app); + return app; + }; + } + _patchNext(next, span, finishSpan) { + return function nextFunction(err) { + if (core.isError(err)) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" }); + } + const result = next.apply(this, [err]); + finishSpan(); + return result; + }; + } + _startSpan(routeName, middleWare) { + const connectType = routeName ? AttributeNames.ConnectTypes.REQUEST_HANDLER : AttributeNames.ConnectTypes.MIDDLEWARE; + const connectName = routeName || middleWare.name || ANONYMOUS_NAME; + return core.startInactiveSpan({ + name: connectName, + op: `${connectType}.connect`, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.connect", + [attributes.HTTP_ROUTE]: routeName.length > 0 ? routeName : "/", + [AttributeNames.AttributeNames.CONNECT_TYPE]: connectType, + [AttributeNames.AttributeNames.CONNECT_NAME]: connectName + } + }); + } + _patchMiddleware(routeName, middleWare) { + const isEnabled = this.isEnabled.bind(this); + const startSpan = this._startSpan.bind(this); + const patchNext = this._patchNext.bind(this); + const isErrorMiddleware = middleWare.length === 4; + function patchedMiddleware() { + if (!isEnabled()) { + return Reflect.apply(middleWare, this, arguments); + } + const [reqArgIdx, resArgIdx, nextArgIdx] = isErrorMiddleware ? [1, 2, 3] : [0, 1, 2]; + const req = arguments[reqArgIdx]; + const res = arguments[resArgIdx]; + const next = arguments[nextArgIdx]; + utils.replaceCurrentStackRoute(req, routeName); + if (routeName) { + setHttpServerSpanRouteAttribute.setHttpServerSpanRouteAttribute(utils.generateRoute(req)); + } + const span = startSpan(routeName, middleWare); + let spanFinished = false; + function finishSpan() { + if (!spanFinished) { + spanFinished = true; + span.end(); + } + res.removeListener("close", finishSpan); + } + res.addListener("close", finishSpan); + arguments[nextArgIdx] = patchNext(next, span, finishSpan); + try { + return Reflect.apply(middleWare, this, arguments); + } catch (e) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" }); + finishSpan(); + throw e; + } + } + Object.defineProperty(patchedMiddleware, "length", { + value: middleWare.length, + writable: false, + configurable: true + }); + return patchedMiddleware; + } + _patchUse(original) { + const patchMiddleware = this._patchMiddleware.bind(this); + return function(...args) { + const middleWare = args[args.length - 1]; + const routeName = args[args.length - 2] || ""; + args[args.length - 1] = patchMiddleware(routeName, middleWare); + return original.apply(this, args); + }; + } + _patchHandle(original) { + const patchOut = this._patchOut.bind(this); + return function() { + const [reqIdx, outIdx] = [0, 2]; + const req = arguments[reqIdx]; + const out = arguments[outIdx]; + const completeStack = utils.addNewStackLayer(req); + if (typeof out === "function") { + arguments[outIdx] = patchOut(out, completeStack); + } + return Reflect.apply(original, this, arguments); + }; + } + _patchOut(out, completeStack) { + return function nextFunction(...args) { + completeStack(); + return Reflect.apply(out, this, args); + }; + } +} + +exports.ConnectInstrumentation = ConnectInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 17959: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const _LAYERS_STORE_PROPERTY = /* @__PURE__ */ Symbol( + "opentelemetry.instrumentation-connect.request-route-stack" +); + +exports._LAYERS_STORE_PROPERTY = _LAYERS_STORE_PROPERTY; +//# sourceMappingURL=internal-types.js.map + + +/***/ }), + +/***/ 28866: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const internalTypes = __nccwpck_require__(17959); +const debugBuild = __nccwpck_require__(8421); + +const addNewStackLayer = (request) => { + if (Array.isArray(request[internalTypes._LAYERS_STORE_PROPERTY]) === false) { + Object.defineProperty(request, internalTypes._LAYERS_STORE_PROPERTY, { + enumerable: false, + value: [] + }); + } + request[internalTypes._LAYERS_STORE_PROPERTY].push("/"); + const stackLength = request[internalTypes._LAYERS_STORE_PROPERTY].length; + return () => { + if (stackLength === request[internalTypes._LAYERS_STORE_PROPERTY].length) { + request[internalTypes._LAYERS_STORE_PROPERTY].pop(); + } else { + debugBuild.DEBUG_BUILD && core.debug.warn("Connect: Trying to pop the stack multiple time"); + } + }; +}; +const replaceCurrentStackRoute = (request, newRoute) => { + if (newRoute) { + request[internalTypes._LAYERS_STORE_PROPERTY].splice(-1, 1, newRoute); + } +}; +const generateRoute = (request) => { + return request[internalTypes._LAYERS_STORE_PROPERTY].reduce((acc, sub) => acc.replace(/\/+$/, "") + sub); +}; + +exports.addNewStackLayer = addNewStackLayer; +exports.generateRoute = generateRoute; +exports.replaceCurrentStackRoute = replaceCurrentStackRoute; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 64071: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const orchestrion = __nccwpck_require__(21496); +const instrumentation = __nccwpck_require__(63926); + +const INTEGRATION_NAME = "Dataloader"; +const instrumentDataloader = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.DataloaderInstrumentation()); +const _dataloaderIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (orchestrion.isOrchestrionInjected()) { + orchestrion.dataloaderChannelIntegration().setupOnce?.(); + } else { + instrumentDataloader(); + } + } + }; +}); +const dataloaderIntegration = core.defineIntegration(_dataloaderIntegration); + +exports.dataloaderIntegration = dataloaderIntegration; +exports.instrumentDataloader = instrumentDataloader; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 63926: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); + +const MODULE_NAME = "dataloader"; +const PACKAGE_NAME = "@sentry/instrumentation-dataloader"; +const ORIGIN = "auto.db.otel.dataloader"; +function isModule(module) { + return module[Symbol.toStringTag] === "Module"; +} +function extractModuleExports(module) { + return isModule(module) ? module.default : module; +} +function getSpanName(dataloader, operation) { + const dataloaderName = dataloader.name; + if (dataloaderName) { + return `${MODULE_NAME}.${operation} ${dataloaderName}`; + } + return `${MODULE_NAME}.${operation}`; +} +function getSpanOp(operation) { + if (operation === "load" || operation === "loadMany" || operation === "batch") { + return "cache.get"; + } + return void 0; +} +function getCacheKey(keyArg) { + if (Array.isArray(keyArg)) { + return keyArg.map((key) => String(key)); + } + return keyArg == null ? void 0 : [String(keyArg)]; +} +class DataloaderInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + MODULE_NAME, + [">=2.0.0 <3"], + (module) => { + const dataloader = extractModuleExports(module); + this._patchLoad(dataloader.prototype); + this._patchLoadMany(dataloader.prototype); + this._patchPrime(dataloader.prototype); + this._patchClear(dataloader.prototype); + this._patchClearAll(dataloader.prototype); + return this._getPatchedConstructor(dataloader); + }, + (module) => { + const dataloader = extractModuleExports(module); + ["load", "loadMany", "prime", "clear", "clearAll"].forEach((method) => { + if (instrumentation.isWrapped(dataloader.prototype[method])) { + this._unwrap(dataloader.prototype, method); + } + }); + } + ) + ]; + } + _wrapBatchLoadFn(batchLoadFn) { + const instrumentation = this; + return function patchedBatchLoadFn(...args) { + if (!instrumentation.isEnabled()) { + return batchLoadFn.call(this, ...args); + } + return core.startSpan( + { + name: getSpanName(this, "batch"), + links: this._batch?.spanLinks, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: getSpanOp("batch"), + [attributes.CACHE_KEY]: getCacheKey(args[0]) + }, + onlyIfParent: true + }, + () => batchLoadFn.apply(this, args) + ); + }; + } + _getPatchedConstructor(constructor) { + const instrumentation$1 = this; + const prototype = constructor.prototype; + if (!instrumentation$1.isEnabled()) { + return constructor; + } + function PatchedDataloader(...args) { + if (typeof args[0] === "function") { + if (instrumentation.isWrapped(args[0])) { + instrumentation$1._unwrap(args, 0); + } + args[0] = instrumentation$1._wrapBatchLoadFn(args[0]); + } + return constructor.apply(this, args); + } + PatchedDataloader.prototype = prototype; + return PatchedDataloader; + } + _patchLoad(proto) { + if (instrumentation.isWrapped(proto.load)) { + this._unwrap(proto, "load"); + } + this._wrap(proto, "load", this._getPatchedLoad.bind(this)); + } + _getPatchedLoad(original) { + return function patchedLoad(...args) { + return core.startSpan( + { + name: getSpanName(this, "load"), + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: getSpanOp("load"), + [attributes.CACHE_KEY]: getCacheKey(args[0]) + }, + onlyIfParent: true + }, + (span) => { + const result = original.call(this, ...args); + if (this._batch && span.isRecording()) { + if (!this._batch.spanLinks) { + this._batch.spanLinks = []; + } + this._batch.spanLinks.push({ context: span.spanContext() }); + } + return result; + } + ); + }; + } + _patchLoadMany(proto) { + if (instrumentation.isWrapped(proto.loadMany)) { + this._unwrap(proto, "loadMany"); + } + this._wrap(proto, "loadMany", this._getPatchedLoadMany.bind(this)); + } + _getPatchedLoadMany(original) { + return function patchedLoadMany(...args) { + return core.startSpan( + { + name: getSpanName(this, "loadMany"), + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: getSpanOp("loadMany"), + [attributes.CACHE_KEY]: getCacheKey(args[0]) + }, + onlyIfParent: true + }, + () => original.call(this, ...args) + ); + }; + } + _patchPrime(proto) { + if (instrumentation.isWrapped(proto.prime)) { + this._unwrap(proto, "prime"); + } + this._wrap(proto, "prime", this._getPatchedPrime.bind(this)); + } + _getPatchedPrime(original) { + return function patchedPrime(...args) { + return core.startSpan( + { + name: getSpanName(this, "prime"), + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: getSpanOp("prime") + }, + onlyIfParent: true + }, + () => original.call(this, ...args) + ); + }; + } + _patchClear(proto) { + if (instrumentation.isWrapped(proto.clear)) { + this._unwrap(proto, "clear"); + } + this._wrap(proto, "clear", this._getPatchedClear.bind(this)); + } + _getPatchedClear(original) { + return function patchedClear(...args) { + return core.startSpan( + { + name: getSpanName(this, "clear"), + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: getSpanOp("clear") + }, + onlyIfParent: true + }, + () => original.call(this, ...args) + ); + }; + } + _patchClearAll(proto) { + if (instrumentation.isWrapped(proto.clearAll)) { + this._unwrap(proto, "clearAll"); + } + this._wrap(proto, "clearAll", this._getPatchedClearAll.bind(this)); + } + _getPatchedClearAll(original) { + return function patchedClearAll(...args) { + return core.startSpan( + { + name: getSpanName(this, "clearAll"), + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: getSpanOp("clearAll") + }, + onlyIfParent: true + }, + () => original.call(this, ...args) + ); + }; + } +} + +exports.DataloaderInstrumentation = DataloaderInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 89660: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const nodeCore = __nccwpck_require__(28648); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(8421); +const setHttpServerSpanRouteAttribute = __nccwpck_require__(63790); + +const INTEGRATION_NAME = "Express"; +const SUPPORTED_VERSIONS = [">=4.0.0 <6"]; +function setupExpressErrorHandler(app, options) { + core.setupExpressErrorHandler(app, options); + nodeCore.ensureIsWrapped(app.use, "express"); +} +const instrumentExpress = nodeCore.generateInstrumentOnce( + INTEGRATION_NAME, + (options) => new ExpressInstrumentation(options) +); +class ExpressInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("sentry-express", core.SDK_VERSION, config); + } + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition( + "express", + SUPPORTED_VERSIONS, + (express) => { + try { + core.patchExpressModule(express, () => ({ + ...this.getConfig(), + onRouteResolved(route) { + if (route) { + setHttpServerSpanRouteAttribute.setHttpServerSpanRouteAttribute(route); + } + } + })); + } catch (e) { + debugBuild.DEBUG_BUILD && core.debug.error("Failed to patch express module:", e); + } + return express; + }, + // we do not ever actually unpatch in our SDKs + (express) => express + ); + return module; + } +} +const _expressIntegration = ((options) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentExpress(options); + } + }; +}); +const expressIntegration = core.defineIntegration(_expressIntegration); + +exports.expressErrorHandler = core.expressErrorHandler; +exports.ExpressInstrumentation = ExpressInstrumentation; +exports.expressIntegration = expressIntegration; +exports.instrumentExpress = instrumentExpress; +exports.setupExpressErrorHandler = setupExpressErrorHandler; +//# sourceMappingURL=express.js.map + + +/***/ }), + +/***/ 7401: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const instrumentation = __nccwpck_require__(52016); +const serverUtils = __nccwpck_require__(93362); + +const INTEGRATION_NAME = "Fastify"; +const instrumentFastifyV3 = nodeCore.generateInstrumentOnce( + `${INTEGRATION_NAME}.v3`, + () => new instrumentation.FastifyInstrumentationV3() +); +function getFastifyIntegration() { + const client = core.getClient(); + if (!client) { + return void 0; + } else { + return client.getIntegrationByName(INTEGRATION_NAME); + } +} +const _fastifyIntegration = ((options) => { + const parentIntegration = serverUtils.fastifyIntegration(options); + return core.extendIntegration(parentIntegration, { + setupOnce() { + instrumentFastifyV3(); + } + }); +}); +const fastifyIntegration = core.defineIntegration( + (options = {}) => _fastifyIntegration(options) +); +function setupFastifyErrorHandler(fastify, options) { + if (options?.shouldHandleError) { + getFastifyIntegration()?.setShouldHandleError(options.shouldHandleError); + } + const plugin = Object.assign( + function(fastify2, _options, done) { + fastify2.addHook("onError", async (request, reply, error) => { + serverUtils.handleFastifyError.call(serverUtils.handleFastifyError, error, request, reply, "onError-hook"); + }); + done(); + }, + { + [/* @__PURE__ */ Symbol.for("skip-override")]: true, + [/* @__PURE__ */ Symbol.for("fastify.display-name")]: "sentry-fastify-error-handler" + } + ); + fastify.register(plugin); +} + +exports.instrumentFastify = serverUtils.instrumentFastify; +exports.fastifyIntegration = fastifyIntegration; +exports.instrumentFastifyV3 = instrumentFastifyV3; +exports.setupFastifyErrorHandler = setupFastifyErrorHandler; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 3681: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const spanRequestSymbol = /* @__PURE__ */ Symbol("opentelemetry.instrumentation.fastify.request_active_span"); + +exports.spanRequestSymbol = spanRequestSymbol; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 99534: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => { + AttributeNames2["FASTIFY_NAME"] = "fastify.name"; + AttributeNames2["FASTIFY_TYPE"] = "fastify.type"; + AttributeNames2["HOOK_NAME"] = "hook.name"; + AttributeNames2["PLUGIN_NAME"] = "plugin.name"; + return AttributeNames2; +})(AttributeNames || {}); +var FastifyTypes = /* @__PURE__ */ ((FastifyTypes2) => { + FastifyTypes2["MIDDLEWARE"] = "middleware"; + FastifyTypes2["REQUEST_HANDLER"] = "request_handler"; + return FastifyTypes2; +})(FastifyTypes || {}); +var FastifyNames = /* @__PURE__ */ ((FastifyNames2) => { + FastifyNames2["MIDDLEWARE"] = "middleware"; + FastifyNames2["REQUEST_HANDLER"] = "request handler"; + return FastifyNames2; +})(FastifyNames || {}); + +exports.AttributeNames = AttributeNames; +exports.FastifyNames = FastifyNames; +exports.FastifyTypes = FastifyTypes; +//# sourceMappingURL=AttributeNames.js.map + + +/***/ }), + +/***/ 52016: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const instrumentation = __nccwpck_require__(65584); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const setHttpServerSpanRouteAttribute = __nccwpck_require__(63790); +const AttributeNames = __nccwpck_require__(99534); +const utils = __nccwpck_require__(59595); + +const PACKAGE_NAME = "@sentry/instrumentation-fastify-v3"; +const ANONYMOUS_NAME = "anonymous"; +const hooksNamesToWrap = /* @__PURE__ */ new Set([ + "onTimeout", + "onRequest", + "preParsing", + "preValidation", + "preSerialization", + "preHandler", + "onSend", + "onResponse", + "onError" +]); +class FastifyInstrumentationV3 extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition("fastify", [">=3.0.0 <3.21.0"], (moduleExports) => { + return this._patchConstructor(moduleExports); + }) + ]; + } + _hookOnRequest() { + const instrumentation = this; + return function onRequest(request, reply, done) { + if (!instrumentation.isEnabled()) { + return done(); + } + instrumentation._wrap(reply, "send", instrumentation._patchSend()); + const anyRequest = request; + const routeName = anyRequest.routeOptions ? anyRequest.routeOptions.url : request.routerPath; + if (routeName) { + setHttpServerSpanRouteAttribute.setHttpServerSpanRouteAttribute(routeName); + } + const method = request.method || "GET"; + core.getIsolationScope().setTransactionName(`${method} ${routeName}`); + done(); + }; + } + _wrapHandler(pluginName, hookName, original, syncFunctionWithDone) { + const instrumentation = this; + this._diag.debug("Patching fastify route.handler function"); + return function(...args) { + if (!instrumentation.isEnabled()) { + return original.apply(this, args); + } + const name = original.name || pluginName || ANONYMOUS_NAME; + const spanName = `${AttributeNames.FastifyNames.MIDDLEWARE} - ${name}`; + const reply = args[1]; + const span = utils.startSpan(reply, instrumentation.tracer, spanName, { + [AttributeNames.AttributeNames.FASTIFY_TYPE]: AttributeNames.FastifyTypes.MIDDLEWARE, + [AttributeNames.AttributeNames.PLUGIN_NAME]: pluginName, + [AttributeNames.AttributeNames.HOOK_NAME]: hookName + }); + const origDone = syncFunctionWithDone && args[args.length - 1]; + if (origDone) { + args[args.length - 1] = function(...doneArgs) { + utils.endSpan(reply); + origDone.apply(this, doneArgs); + }; + } + return api.context.with(api.trace.setSpan(api.context.active(), span), () => { + return utils.safeExecuteInTheMiddleMaybePromise( + () => { + return original.apply(this, args); + }, + (err) => { + if (err instanceof Error) { + span.setStatus({ + code: api.SpanStatusCode.ERROR, + message: err.message + }); + span.recordException(err); + } + if (!syncFunctionWithDone) { + utils.endSpan(reply); + } + } + ); + }); + }; + } + _wrapAddHook() { + const instrumentation = this; + this._diag.debug("Patching fastify server.addHook function"); + return function(original) { + return function wrappedAddHook(...args) { + const name = args[0]; + const handler = args[1]; + const pluginName = this.pluginName; + if (!hooksNamesToWrap.has(name)) { + return original.apply(this, args); + } + const syncFunctionWithDone = typeof args[args.length - 1] === "function" && handler.constructor.name !== "AsyncFunction"; + return original.apply(this, [ + name, + instrumentation._wrapHandler(pluginName, name, handler, syncFunctionWithDone) + ]); + }; + }; + } + _patchConstructor(moduleExports) { + const instrumentation = this; + function fastify(...args) { + const app = moduleExports.fastify.apply(this, args); + app.addHook("onRequest", instrumentation._hookOnRequest()); + app.addHook("preHandler", instrumentation._hookPreHandler()); + instrumentClient(); + instrumentation._wrap(app, "addHook", instrumentation._wrapAddHook()); + return app; + } + if (moduleExports.errorCodes !== void 0) { + fastify.errorCodes = moduleExports.errorCodes; + } + fastify.fastify = fastify; + fastify.default = fastify; + return fastify; + } + _patchSend() { + const instrumentation$1 = this; + this._diag.debug("Patching fastify reply.send function"); + return function patchSend(original) { + return function send(...args) { + const maybeError = args[0]; + if (!instrumentation$1.isEnabled()) { + return original.apply(this, args); + } + return instrumentation.safeExecuteInTheMiddle( + () => { + return original.apply(this, args); + }, + (err) => { + if (!err && maybeError instanceof Error) { + err = maybeError; + } + utils.endSpan(this, err); + } + ); + }; + }; + } + _hookPreHandler() { + const instrumentation$1 = this; + this._diag.debug("Patching fastify preHandler function"); + return function preHandler(request, reply, done) { + if (!instrumentation$1.isEnabled()) { + return done(); + } + const anyRequest = request; + const handler = anyRequest.routeOptions?.handler || anyRequest.context?.handler; + const handlerName = handler?.name.startsWith("bound ") ? handler.name.substring(6) : handler?.name; + const spanName = `${AttributeNames.FastifyNames.REQUEST_HANDLER} - ${handlerName || this.pluginName || ANONYMOUS_NAME}`; + const spanAttributes = { + [AttributeNames.AttributeNames.PLUGIN_NAME]: this.pluginName, + [AttributeNames.AttributeNames.FASTIFY_TYPE]: AttributeNames.FastifyTypes.REQUEST_HANDLER, + // eslint-disable-next-line typescript/no-deprecated + [attributes.HTTP_ROUTE]: anyRequest.routeOptions ? anyRequest.routeOptions.url : request.routerPath + }; + if (handlerName) { + spanAttributes[AttributeNames.AttributeNames.FASTIFY_NAME] = handlerName; + } + const span = utils.startSpan(reply, instrumentation$1.tracer, spanName, spanAttributes); + addFastifyV3SpanAttributes(span); + const { requestHook } = instrumentation$1.getConfig(); + if (requestHook) { + instrumentation.safeExecuteInTheMiddle( + () => requestHook(span, { request }), + (e) => { + if (e) { + instrumentation$1._diag.error("request hook failed", e); + } + }, + true + ); + } + return api.context.with(api.trace.setSpan(api.context.active(), span), () => { + done(); + }); + }; + } +} +function instrumentClient() { + const client = core.getClient(); + if (client) { + client.on("spanStart", (span) => { + addFastifyV3SpanAttributes(span); + }); + } +} +function addFastifyV3SpanAttributes(span) { + const attributes = core.spanToJSON(span).data; + const type = attributes["fastify.type"]; + if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { + return; + } + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.fastify", + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify` + }); + const name = attributes["fastify.name"] || attributes["plugin.name"] || attributes["hook.name"]; + if (typeof name === "string") { + const updatedName = name.replace(/^fastify -> /, "").replace(/^@fastify\/otel -> /, ""); + span.updateName(updatedName); + } +} + +exports.FastifyInstrumentationV3 = FastifyInstrumentationV3; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 59595: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const constants = __nccwpck_require__(3681); + +function startSpan(reply, tracer, spanName, spanAttributes = {}) { + const span = tracer.startSpan(spanName, { attributes: spanAttributes }); + const spans = reply[constants.spanRequestSymbol] || []; + spans.push(span); + Object.defineProperty(reply, constants.spanRequestSymbol, { + enumerable: false, + configurable: true, + value: spans + }); + return span; +} +function endSpan(reply, err) { + const spans = reply[constants.spanRequestSymbol] || []; + if (!spans.length) { + return; + } + spans.forEach((span) => { + if (err) { + span.setStatus({ + code: api.SpanStatusCode.ERROR, + message: err.message + }); + span.recordException(err); + } + span.end(); + }); + delete reply[constants.spanRequestSymbol]; +} +function safeExecuteInTheMiddleMaybePromise(execute, onFinish, preventThrowingError) { + let error; + let result = void 0; + try { + result = execute(); + if (isPromise(result)) { + result.then( + (res) => onFinish(void 0, res), + (err) => onFinish(err) + ); + } + } catch (e) { + error = e; + } finally { + if (!isPromise(result)) { + onFinish(error, result); + if (error && true) { + throw error; + } + } + return result; + } +} +function isPromise(val) { + return typeof val === "object" && val && typeof Object.getOwnPropertyDescriptor(val, "then")?.value === "function" || false; +} + +exports.endSpan = endSpan; +exports.safeExecuteInTheMiddleMaybePromise = safeExecuteInTheMiddleMaybePromise; +exports.startSpan = startSpan; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 94852: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const firebaseInstrumentation = __nccwpck_require__(40528); + +const INTEGRATION_NAME = "Firebase"; +const instrumentFirebase = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new firebaseInstrumentation.FirebaseInstrumentation()); +const _firebaseIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentFirebase(); + } + }; +}); +const firebaseIntegration = core.defineIntegration(_firebaseIntegration); + +exports.firebaseIntegration = firebaseIntegration; +exports.instrumentFirebase = instrumentFirebase; +//# sourceMappingURL=firebase.js.map + + +/***/ }), + +/***/ 40528: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const firestore = __nccwpck_require__(59374); +const functions = __nccwpck_require__(57943); + +const firestoreSupportedVersions = [">=3.0.0 <5"]; +const functionsSupportedVersions = [">=6.0.0 <7"]; +class FirebaseInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("@sentry/instrumentation-firebase", core.SDK_VERSION, config); + } + /** + * + * @protected + */ + // eslint-disable-next-line @typescript-eslint/naming-convention + init() { + const modules = []; + modules.push(firestore.patchFirestore(firestoreSupportedVersions, this._wrap, this._unwrap)); + modules.push(functions.patchFunctions(functionsSupportedVersions, this._wrap, this._unwrap)); + return modules; + } +} + +exports.FirebaseInstrumentation = FirebaseInstrumentation; +//# sourceMappingURL=firebaseInstrumentation.js.map + + +/***/ }), + +/***/ 59374: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const net = __nccwpck_require__(87503); +const instrumentation = __nccwpck_require__(65584); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); + +function patchFirestore(firestoreSupportedVersions, wrap, unwrap) { + const moduleFirestoreCJS = new instrumentation.InstrumentationNodeModuleDefinition( + "@firebase/firestore", + firestoreSupportedVersions, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (moduleExports) => wrapMethods(moduleExports, wrap, unwrap) + ); + const files = [ + "@firebase/firestore/dist/lite/index.node.cjs.js", + "@firebase/firestore/dist/lite/index.node.mjs.js", + "@firebase/firestore/dist/lite/index.rn.esm2017.js", + "@firebase/firestore/dist/lite/index.cjs.js" + ]; + for (const file of files) { + moduleFirestoreCJS.files.push( + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + file, + firestoreSupportedVersions, + (moduleExports) => wrapMethods(moduleExports, wrap, unwrap), + (moduleExports) => unwrapMethods(moduleExports, unwrap) + ) + ); + } + return moduleFirestoreCJS; +} +function wrapMethods(moduleExports, wrap, unwrap) { + unwrapMethods(moduleExports, unwrap); + wrap(moduleExports, "addDoc", patchAddDoc()); + wrap(moduleExports, "getDocs", patchGetDocs()); + wrap(moduleExports, "setDoc", patchSetDoc()); + wrap(moduleExports, "deleteDoc", patchDeleteDoc()); + return moduleExports; +} +function unwrapMethods(moduleExports, unwrap) { + for (const method of ["addDoc", "getDocs", "setDoc", "deleteDoc"]) { + if (instrumentation.isWrapped(moduleExports[method])) { + unwrap(moduleExports, method); + } + } + return moduleExports; +} +function patchAddDoc() { + return function addDoc(original) { + return function(reference, data) { + return startFirestoreSpan("addDoc", reference, () => original(reference, data)); + }; + }; +} +function patchDeleteDoc() { + return function deleteDoc(original) { + return function(reference) { + return startFirestoreSpan("deleteDoc", reference.parent || reference, () => original(reference)); + }; + }; +} +function patchGetDocs() { + return function getDocs(original) { + return function(reference) { + return startFirestoreSpan("getDocs", reference, () => original(reference)); + }; + }; +} +function patchSetDoc() { + return function setDoc(original) { + return function(reference, data, options) { + return startFirestoreSpan("setDoc", reference.parent || reference, () => { + return typeof options !== "undefined" ? original(reference, data, options) : original(reference, data); + }); + }; + }; +} +function startFirestoreSpan(spanName, reference, callback) { + return core.startSpan( + { + name: `${spanName} ${reference.path}`, + op: "db.query", + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.firebase.otel.firestore", + [attributes.DB_OPERATION_NAME]: spanName, + ...buildAttributes(reference) + } + }, + callback + ); +} +function getPortAndAddress(settings) { + let address; + let port; + if (typeof settings.host === "string") { + if (settings.host.startsWith("[")) { + if (settings.host.endsWith("]")) { + address = settings.host.replace(/^\[|\]$/g, ""); + } else if (settings.host.includes("]:")) { + const lastColonIndex = settings.host.lastIndexOf(":"); + if (lastColonIndex !== -1) { + address = settings.host.slice(1, lastColonIndex).replace(/^\[|\]$/g, ""); + port = settings.host.slice(lastColonIndex + 1); + } + } + } else { + if (net.isIPv6(settings.host)) { + address = settings.host; + } else { + const lastColonIndex = settings.host.lastIndexOf(":"); + if (lastColonIndex !== -1) { + address = settings.host.slice(0, lastColonIndex); + port = settings.host.slice(lastColonIndex + 1); + } else { + address = settings.host; + } + } + } + } + return { + address, + port: port ? parseInt(port, 10) : void 0 + }; +} +function buildAttributes(reference) { + const firestoreApp = reference.firestore.app; + const firestoreOptions = firestoreApp.options; + const json = reference.firestore.toJSON() || {}; + const settings = json.settings || {}; + const attributes$1 = { + [attributes.DB_COLLECTION_NAME]: reference.path, + [attributes.DB_NAMESPACE]: firestoreApp.name, + [attributes.DB_SYSTEM_NAME]: "firebase.firestore", + "firebase.firestore.type": reference.type, + "firebase.firestore.options.projectId": firestoreOptions.projectId, + "firebase.firestore.options.appId": firestoreOptions.appId, + "firebase.firestore.options.messagingSenderId": firestoreOptions.messagingSenderId, + "firebase.firestore.options.storageBucket": firestoreOptions.storageBucket + }; + const { address, port } = getPortAndAddress(settings); + if (address) { + attributes$1[attributes.SERVER_ADDRESS] = address; + } + if (port) { + attributes$1[attributes.SERVER_PORT] = port; + } + return attributes$1; +} + +exports.getPortAndAddress = getPortAndAddress; +exports.patchFirestore = patchFirestore; +//# sourceMappingURL=firestore.js.map + + +/***/ }), + +/***/ 57943: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const core = __nccwpck_require__(84466); + +function patchFunctions(functionsSupportedVersions, wrap, unwrap) { + const moduleFunctionsCJS = new instrumentation.InstrumentationNodeModuleDefinition("firebase-functions", functionsSupportedVersions); + const modulesToInstrument = [ + { name: "firebase-functions/lib/v2/providers/https.js", triggerType: "function" }, + { name: "firebase-functions/lib/v2/providers/firestore.js", triggerType: "firestore" }, + { name: "firebase-functions/lib/v2/providers/scheduler.js", triggerType: "scheduler" }, + { name: "firebase-functions/lib/v2/storage.js", triggerType: "storage" } + ]; + modulesToInstrument.forEach(({ name, triggerType }) => { + moduleFunctionsCJS.files.push( + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + name, + functionsSupportedVersions, + (moduleExports) => wrapCommonFunctions(moduleExports, wrap, unwrap, triggerType), + (moduleExports) => unwrapCommonFunctions(moduleExports, unwrap) + ) + ); + }); + return moduleFunctionsCJS; +} +function patchV2Functions(triggerType) { + return function v2FunctionsWrapper(original) { + return function(...args) { + const handler = typeof args[0] === "function" ? args[0] : args[1]; + const documentOrOptions = typeof args[0] === "function" ? void 0 : args[0]; + if (!handler) { + return original.call(this, ...args); + } + const wrappedHandler = async function(...handlerArgs) { + const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || "unknown"; + const attributes = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.firebase.otel.functions", + "faas.name": functionName, + "faas.trigger": triggerType, + "faas.provider": "firebase" + }; + if (process.env.GCLOUD_PROJECT) { + attributes["cloud.project_id"] = process.env.GCLOUD_PROJECT; + } + if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) { + attributes["cloud.event_source"] = process.env.EVENTARC_CLOUD_EVENT_SOURCE; + } + return core.startSpanManual( + { + name: `firebase.function.${triggerType}`, + op: "http.request", + kind: core.SPAN_KIND.SERVER, + attributes + }, + async (span) => { + try { + const result = await handler.apply(this, handlerArgs); + span.end(); + return result; + } catch (error) { + span.setStatus({ code: core.SPAN_STATUS_ERROR }); + core.captureException(error, { + mechanism: { + type: "auto.firebase.otel.functions", + handled: false + } + }); + span.end(); + await core.flush(2e3); + throw error; + } + } + ); + }; + if (documentOrOptions) { + return original.call(this, documentOrOptions, wrappedHandler); + } else { + return original.call(this, wrappedHandler); + } + }; + }; +} +function wrapCommonFunctions(moduleExports, wrap, unwrap, triggerType) { + unwrapCommonFunctions(moduleExports, unwrap); + switch (triggerType) { + case "function": + wrap(moduleExports, "onRequest", patchV2Functions("http.request")); + wrap(moduleExports, "onCall", patchV2Functions("http.call")); + break; + case "firestore": + wrap(moduleExports, "onDocumentCreated", patchV2Functions("firestore.document.created")); + wrap(moduleExports, "onDocumentUpdated", patchV2Functions("firestore.document.updated")); + wrap(moduleExports, "onDocumentDeleted", patchV2Functions("firestore.document.deleted")); + wrap(moduleExports, "onDocumentWritten", patchV2Functions("firestore.document.written")); + wrap(moduleExports, "onDocumentCreatedWithAuthContext", patchV2Functions("firestore.document.created")); + wrap(moduleExports, "onDocumentUpdatedWithAuthContext", patchV2Functions("firestore.document.updated")); + wrap(moduleExports, "onDocumentDeletedWithAuthContext", patchV2Functions("firestore.document.deleted")); + wrap(moduleExports, "onDocumentWrittenWithAuthContext", patchV2Functions("firestore.document.written")); + break; + case "scheduler": + wrap(moduleExports, "onSchedule", patchV2Functions("scheduler.scheduled")); + break; + case "storage": + wrap(moduleExports, "onObjectFinalized", patchV2Functions("storage.object.finalized")); + wrap(moduleExports, "onObjectArchived", patchV2Functions("storage.object.archived")); + wrap(moduleExports, "onObjectDeleted", patchV2Functions("storage.object.deleted")); + wrap(moduleExports, "onObjectMetadataUpdated", patchV2Functions("storage.object.metadataUpdated")); + break; + } + return moduleExports; +} +function unwrapCommonFunctions(moduleExports, unwrap) { + const methods = [ + "onSchedule", + "onRequest", + "onCall", + "onObjectFinalized", + "onObjectArchived", + "onObjectDeleted", + "onObjectMetadataUpdated", + "onDocumentCreated", + "onDocumentUpdated", + "onDocumentDeleted", + "onDocumentWritten", + "onDocumentCreatedWithAuthContext", + "onDocumentUpdatedWithAuthContext", + "onDocumentDeletedWithAuthContext", + "onDocumentWrittenWithAuthContext" + ]; + for (const method of methods) { + if (instrumentation.isWrapped(moduleExports[method])) { + unwrap(moduleExports, method); + } + } + return moduleExports; +} + +exports.patchFunctions = patchFunctions; +exports.patchV2Functions = patchV2Functions; +//# sourceMappingURL=functions.js.map + + +/***/ }), + +/***/ 88204: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(42360); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "GenericPool"; +const instrumentGenericPool = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.GenericPoolInstrumentation({})); +const _genericPoolIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentGenericPool(); + } + }; +}); +const genericPoolIntegration = core.defineIntegration(_genericPoolIntegration); + +exports.genericPoolIntegration = genericPoolIntegration; +exports.instrumentGenericPool = instrumentGenericPool; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 42360: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); + +const MODULE_NAME = "generic-pool"; +const PACKAGE_NAME = "@sentry/instrumentation-generic-pool"; +class GenericPoolInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + // only used for v2 - v2.3) + this._isDisabled = false; + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + MODULE_NAME, + [">=3.0.0 <4"], + (moduleExports) => { + const Pool = moduleExports.Pool; + if (instrumentation.isWrapped(Pool.prototype.acquire)) { + this._unwrap(Pool.prototype, "acquire"); + } + this._wrap(Pool.prototype, "acquire", this._acquirePatcher.bind(this)); + return moduleExports; + }, + (moduleExports) => { + const Pool = moduleExports.Pool; + this._unwrap(Pool.prototype, "acquire"); + return moduleExports; + } + ), + new instrumentation.InstrumentationNodeModuleDefinition( + MODULE_NAME, + [">=2.4.0 <3"], + (moduleExports) => { + const Pool = moduleExports.Pool; + if (instrumentation.isWrapped(Pool.prototype.acquire)) { + this._unwrap(Pool.prototype, "acquire"); + } + this._wrap(Pool.prototype, "acquire", this._acquireWithCallbacksPatcher.bind(this)); + return moduleExports; + }, + (moduleExports) => { + const Pool = moduleExports.Pool; + this._unwrap(Pool.prototype, "acquire"); + return moduleExports; + } + ), + new instrumentation.InstrumentationNodeModuleDefinition( + MODULE_NAME, + [">=2.0.0 <2.4"], + (moduleExports) => { + this._isDisabled = false; + if (instrumentation.isWrapped(moduleExports.Pool)) { + this._unwrap(moduleExports, "Pool"); + } + this._wrap(moduleExports, "Pool", this._poolWrapper.bind(this)); + return moduleExports; + }, + (moduleExports) => { + this._isDisabled = true; + return moduleExports; + } + ) + ]; + } + _acquirePatcher(original) { + return function wrapped_acquire(...args) { + return core.startSpan( + { + name: "generic-pool.acquire", + attributes: { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.generic_pool" } + }, + () => { + return original.call(this, ...args); + } + ); + }; + } + _poolWrapper(original) { + const wrap = this._wrap.bind(this); + const acquireWithCallbacksPatcher = this._acquireWithCallbacksPatcher.bind(this); + return function wrapped_pool(...args) { + const pool = original.apply(this, args); + wrap(pool, "acquire", acquireWithCallbacksPatcher); + return pool; + }; + } + _acquireWithCallbacksPatcher(original) { + const isDisabled = () => this._isDisabled; + return function wrapped_acquire(cb, priority) { + if (isDisabled()) { + return original.call(this, cb, priority); + } + return core.startSpanManual( + { + name: "generic-pool.acquire", + attributes: { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.generic_pool" } + }, + (span) => { + original.call( + this, + (err, client) => { + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" }); + } + span.end(); + if (cb) { + cb(err, client); + } + }, + priority + ); + } + ); + }; + } +} + +exports.GenericPoolInstrumentation = GenericPoolInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 63374: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const instrumentation = __nccwpck_require__(24640); + +const instrumentGoogleGenAI = nodeCore.generateInstrumentOnce( + core.GOOGLE_GENAI_INTEGRATION_NAME, + (options) => new instrumentation.SentryGoogleGenAiInstrumentation(options) +); +const _googleGenAIIntegration = ((options = {}) => { + return { + name: core.GOOGLE_GENAI_INTEGRATION_NAME, + setupOnce() { + instrumentGoogleGenAI(options); + } + }; +}); +const googleGenAIIntegration = core.defineIntegration(_googleGenAIIntegration); + +exports.googleGenAIIntegration = googleGenAIIntegration; +exports.instrumentGoogleGenAI = instrumentGoogleGenAI; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 24640: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const core = __nccwpck_require__(84466); + +const supportedVersions = [">=0.10.0 <2"]; +class SentryGoogleGenAiInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("@sentry/instrumentation-google-genai", core.SDK_VERSION, config); + } + /** + * Initializes the instrumentation by defining the modules to be patched. + */ + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition( + "@google/genai", + supportedVersions, + (exports) => this._patch(exports), + (exports) => exports, + // In CJS, @google/genai re-exports from (dist/node/index.cjs) file. + // Patching only the root module sometimes misses the real implementation or + // gets overwritten when that file is loaded. We add a file-level patch so that + // _patch runs again on the concrete implementation + [ + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "@google/genai/dist/node/index.cjs", + supportedVersions, + (exports) => this._patch(exports), + (exports) => exports + ) + ] + ); + return module; + } + /** + * Core patch logic applying instrumentation to the Google GenAI client constructor. + */ + _patch(exports) { + const Original = exports.GoogleGenAI; + const config = this.getConfig(); + if (typeof Original !== "function") { + return exports; + } + const WrappedGoogleGenAI = function(...args) { + if (core._INTERNAL_shouldSkipAiProviderWrapping(core.GOOGLE_GENAI_INTEGRATION_NAME)) { + return Reflect.construct(Original, args); + } + const instance = Reflect.construct(Original, args); + return core.instrumentGoogleGenAIClient(instance, config); + }; + Object.setPrototypeOf(WrappedGoogleGenAI, Original); + Object.setPrototypeOf(WrappedGoogleGenAI.prototype, Original.prototype); + for (const key of Object.getOwnPropertyNames(Original)) { + if (!["length", "name", "prototype"].includes(key)) { + const descriptor = Object.getOwnPropertyDescriptor(Original, key); + if (descriptor) { + Object.defineProperty(WrappedGoogleGenAI, key, descriptor); + } + } + } + core.replaceExports(exports, "GoogleGenAI", WrappedGoogleGenAI); + return exports; + } +} + +exports.SentryGoogleGenAiInstrumentation = SentryGoogleGenAiInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 55238: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(31126); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const serverUtils = __nccwpck_require__(93362); + +const INTEGRATION_NAME = "Graphql"; +const instrumentGraphql = nodeCore.generateInstrumentOnce( + INTEGRATION_NAME, + instrumentation.GraphQLInstrumentation, + (_options) => getOptionsWithDefaults(_options) +); +const _graphqlIntegration = ((options = {}) => { + return core.extendIntegration(serverUtils.graphqlIntegration(getOptionsWithDefaults(options)), { + name: INTEGRATION_NAME, + setupOnce() { + instrumentGraphql(getOptionsWithDefaults(options)); + } + }); +}); +const graphqlIntegration = core.defineIntegration(_graphqlIntegration); +function getOptionsWithDefaults(options) { + return { + ignoreResolveSpans: true, + ignoreTrivialResolveSpans: true, + useOperationNameForRootSpan: true, + ...options + }; +} + +exports.graphqlIntegration = graphqlIntegration; +exports.instrumentGraphql = instrumentGraphql; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 76322: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var AllowedOperationTypes = /* @__PURE__ */ ((AllowedOperationTypes2) => { + AllowedOperationTypes2["QUERY"] = "query"; + AllowedOperationTypes2["MUTATION"] = "mutation"; + AllowedOperationTypes2["SUBSCRIPTION"] = "subscription"; + return AllowedOperationTypes2; +})(AllowedOperationTypes || {}); +var TokenKind = /* @__PURE__ */ ((TokenKind2) => { + TokenKind2["SOF"] = ""; + TokenKind2["EOF"] = ""; + TokenKind2["BANG"] = "!"; + TokenKind2["DOLLAR"] = "$"; + TokenKind2["AMP"] = "&"; + TokenKind2["PAREN_L"] = "("; + TokenKind2["PAREN_R"] = ")"; + TokenKind2["SPREAD"] = "..."; + TokenKind2["COLON"] = ":"; + TokenKind2["EQUALS"] = "="; + TokenKind2["AT"] = "@"; + TokenKind2["BRACKET_L"] = "["; + TokenKind2["BRACKET_R"] = "]"; + TokenKind2["BRACE_L"] = "{"; + TokenKind2["PIPE"] = "|"; + TokenKind2["BRACE_R"] = "}"; + TokenKind2["NAME"] = "Name"; + TokenKind2["INT"] = "Int"; + TokenKind2["FLOAT"] = "Float"; + TokenKind2["STRING"] = "String"; + TokenKind2["BLOCK_STRING"] = "BlockString"; + TokenKind2["COMMENT"] = "Comment"; + return TokenKind2; +})(TokenKind || {}); +var SpanNames = /* @__PURE__ */ ((SpanNames2) => { + SpanNames2["EXECUTE"] = "graphql.execute"; + SpanNames2["PARSE"] = "graphql.parse"; + SpanNames2["RESOLVE"] = "graphql.resolve"; + SpanNames2["VALIDATE"] = "graphql.validate"; + SpanNames2["SCHEMA_VALIDATE"] = "graphql.validateSchema"; + SpanNames2["SCHEMA_PARSE"] = "graphql.parseSchema"; + return SpanNames2; +})(SpanNames || {}); + +exports.AllowedOperationTypes = AllowedOperationTypes; +exports.SpanNames = SpanNames; +exports.TokenKind = TokenKind; +//# sourceMappingURL=enum.js.map + + +/***/ }), + +/***/ 25091: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => { + AttributeNames2["SOURCE"] = "graphql.source"; + AttributeNames2["FIELD_NAME"] = "graphql.field.name"; + AttributeNames2["FIELD_PATH"] = "graphql.field.path"; + AttributeNames2["FIELD_TYPE"] = "graphql.field.type"; + AttributeNames2["PARENT_NAME"] = "graphql.parent.name"; + AttributeNames2["OPERATION_TYPE"] = "graphql.operation.type"; + AttributeNames2["OPERATION_NAME"] = "graphql.operation.name"; + return AttributeNames2; +})(AttributeNames || {}); + +exports.AttributeNames = AttributeNames; +//# sourceMappingURL=AttributeNames.js.map + + +/***/ }), + +/***/ 31126: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const _enum = __nccwpck_require__(76322); +const AttributeNames = __nccwpck_require__(25091); +const symbols = __nccwpck_require__(6478); +const internalTypes = __nccwpck_require__(8677); +const utils = __nccwpck_require__(69468); +const core = __nccwpck_require__(84466); +const opentelemetry = __nccwpck_require__(90157); + +const PACKAGE_NAME = "@sentry/instrumentation-graphql"; +const ORIGIN = "auto.graphql.otel.graphql"; +const DEFAULT_CONFIG = { + ignoreResolveSpans: false +}; +const supportedVersions = [">=14.0.0 <17"]; +class GraphQLInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, { ...DEFAULT_CONFIG, ...config }); + } + setConfig(config = {}) { + super.setConfig({ ...DEFAULT_CONFIG, ...config }); + } + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition("graphql", supportedVersions); + module.files.push(this._addPatchingExecute()); + module.files.push(this._addPatchingParser()); + module.files.push(this._addPatchingValidate()); + return module; + } + _addPatchingExecute() { + return new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "graphql/execution/execute.js", + supportedVersions, + // cannot make it work with appropriate type as execute function has 2 + //types and/cannot import function but only types + (moduleExports) => { + if (instrumentation.isWrapped(moduleExports.execute)) { + this._unwrap(moduleExports, "execute"); + } + this._wrap(moduleExports, "execute", this._patchExecute(moduleExports.defaultFieldResolver)); + return moduleExports; + }, + (moduleExports) => { + if (moduleExports) { + this._unwrap(moduleExports, "execute"); + } + } + ); + } + _addPatchingParser() { + return new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "graphql/language/parser.js", + supportedVersions, + (moduleExports) => { + if (instrumentation.isWrapped(moduleExports.parse)) { + this._unwrap(moduleExports, "parse"); + } + this._wrap(moduleExports, "parse", this._patchParse()); + return moduleExports; + }, + (moduleExports) => { + if (moduleExports) { + this._unwrap(moduleExports, "parse"); + } + } + ); + } + _addPatchingValidate() { + return new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "graphql/validation/validate.js", + supportedVersions, + (moduleExports) => { + if (instrumentation.isWrapped(moduleExports.validate)) { + this._unwrap(moduleExports, "validate"); + } + this._wrap(moduleExports, "validate", this._patchValidate()); + return moduleExports; + }, + (moduleExports) => { + if (moduleExports) { + this._unwrap(moduleExports, "validate"); + } + } + ); + } + _patchExecute(defaultFieldResolved) { + const instrumentation$1 = this; + return function execute(original) { + return function patchExecute() { + let processedArgs; + if (arguments.length >= 2) { + const args = arguments; + processedArgs = instrumentation$1._wrapExecuteArgs( + args[0], + args[1], + args[2], + args[3], + args[4], + args[5], + args[6], + args[7], + defaultFieldResolved + ); + } else { + const args = arguments[0]; + processedArgs = instrumentation$1._wrapExecuteArgs( + args.schema, + args.document, + args.rootValue, + args.contextValue, + args.variableValues, + args.operationName, + args.fieldResolver, + args.typeResolver, + defaultFieldResolved + ); + } + const operation = utils.getOperation(processedArgs.document, processedArgs.operationName); + const span = instrumentation$1._createExecuteSpan(operation, processedArgs); + processedArgs.contextValue[symbols.OTEL_GRAPHQL_DATA_SYMBOL] = { + source: processedArgs.document ? processedArgs.document || processedArgs.document[symbols.OTEL_GRAPHQL_DATA_SYMBOL] : void 0, + span, + fields: {} + }; + return core.withActiveSpan(span, () => { + return instrumentation.safeExecuteInTheMiddle( + () => { + return original.apply(this, [processedArgs]); + }, + (err, result) => { + instrumentation$1._handleExecutionResult(span, err, result); + } + ); + }); + }; + }; + } + _handleExecutionResult(span, err, result) { + if (result === void 0 || err) { + utils.endSpan(span, err); + return; + } + if (utils.isPromise(result)) { + result.then( + (resultData) => { + this._updateSpanFromResult(span, resultData); + utils.endSpan(span); + }, + (error) => { + utils.endSpan(span, error); + } + ); + } else { + this._updateSpanFromResult(span, result); + utils.endSpan(span); + } + } + /** + * Applies Sentry-specific span mutations based on the GraphQL execution result: + * - Marks the execute span as errored if the result contains errors (and no status was set yet) + * - Optionally renames the containing root span to include the GraphQL operation name(s) + */ + _updateSpanFromResult(span, result) { + if (result.errors?.length && !core.spanToJSON(span).status) { + span.setStatus({ code: core.SPAN_STATUS_ERROR }); + } + if (!this.getConfig().useOperationNameForRootSpan) { + return; + } + const attributes = core.spanToJSON(span).data; + const operationType = attributes[AttributeNames.AttributeNames.OPERATION_TYPE]; + const operationName = attributes[AttributeNames.AttributeNames.OPERATION_NAME]; + if (!operationType) { + return; + } + const rootSpan = core.getRootSpan(span); + const rootSpanAttributes = core.spanToJSON(rootSpan).data; + const existingOperations = rootSpanAttributes[opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION] || []; + const newOperation = operationName ? `${operationType} ${operationName}` : `${operationType}`; + if (Array.isArray(existingOperations)) { + existingOperations.push(newOperation); + rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, existingOperations); + } else if (typeof existingOperations === "string") { + rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, [existingOperations, newOperation]); + } else { + rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, newOperation); + } + if (!core.spanToJSON(rootSpan).data["original-description"]) { + rootSpan.setAttribute("original-description", core.spanToJSON(rootSpan).description); + } + rootSpan.updateName( + `${core.spanToJSON(rootSpan).data["original-description"]} (${getGraphqlOperationNamesFromAttribute( + existingOperations + )})` + ); + } + _patchParse() { + const instrumentation = this; + return function parse(original) { + return function patchParse(source, options) { + return instrumentation._parse(this, original, source, options); + }; + }; + } + _patchValidate() { + const instrumentation = this; + return function validate(original) { + return function patchValidate(schema, documentAST, rules, options, typeInfo) { + return instrumentation._validate(this, original, schema, documentAST, rules, typeInfo, options); + }; + }; + } + _parse(obj, original, source, options) { + const span = core.startInactiveSpan({ name: _enum.SpanNames.PARSE }); + return core.withActiveSpan(span, () => { + return instrumentation.safeExecuteInTheMiddle( + () => { + return original.call(obj, source, options); + }, + (err, result) => { + if (result) { + const operation = utils.getOperation(result); + if (!operation) { + span.updateName(_enum.SpanNames.SCHEMA_PARSE); + } else if (result.loc) { + utils.addSpanSource(span, result.loc); + } + } + utils.endSpan(span, err); + } + ); + }); + } + _validate(obj, original, schema, documentAST, rules, typeInfo, options) { + const span = core.startInactiveSpan({ name: _enum.SpanNames.VALIDATE }); + return core.withActiveSpan(span, () => { + return instrumentation.safeExecuteInTheMiddle( + () => { + return original.call(obj, schema, documentAST, rules, options, typeInfo); + }, + (err, _errors) => { + if (!documentAST.loc) { + span.updateName(_enum.SpanNames.SCHEMA_VALIDATE); + } + utils.endSpan(span, err); + } + ); + }); + } + _createExecuteSpan(operation, processedArgs) { + const span = core.startInactiveSpan({ + name: _enum.SpanNames.EXECUTE, + attributes: { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN } + }); + if (operation) { + const { operation: operationType, name: nameNode } = operation; + span.setAttribute(AttributeNames.AttributeNames.OPERATION_TYPE, operationType); + const operationName = nameNode?.value; + if (operationName) { + span.setAttribute(AttributeNames.AttributeNames.OPERATION_NAME, operationName); + span.updateName(`${operationType} ${operationName}`); + } else { + span.updateName(operationType); + } + } else { + let operationName = " "; + if (processedArgs.operationName) { + operationName = ` "${processedArgs.operationName}" `; + } + operationName = internalTypes.OPERATION_NOT_SUPPORTED.replace("$operationName$", operationName); + span.setAttribute(AttributeNames.AttributeNames.OPERATION_NAME, operationName); + } + if (processedArgs.document?.loc) { + utils.addSpanSource(span, processedArgs.document.loc); + } + return span; + } + _wrapExecuteArgs(schema, document, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver, defaultFieldResolved) { + if (!contextValue) { + contextValue = {}; + } + if (contextValue[symbols.OTEL_GRAPHQL_DATA_SYMBOL] || this.getConfig().ignoreResolveSpans) { + return { + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver + }; + } + const isUsingDefaultResolver = fieldResolver == null; + const fieldResolverForExecute = fieldResolver ?? defaultFieldResolved; + fieldResolver = utils.wrapFieldResolver(() => this.getConfig(), fieldResolverForExecute, isUsingDefaultResolver); + if (schema) { + utils.wrapFields(schema.getQueryType(), () => this.getConfig()); + utils.wrapFields(schema.getMutationType(), () => this.getConfig()); + } + return { + schema, + document, + rootValue, + contextValue, + variableValues, + operationName, + fieldResolver, + typeResolver + }; + } +} +function getGraphqlOperationNamesFromAttribute(attr) { + if (Array.isArray(attr)) { + const sorted = attr.slice().sort(); + if (sorted.length <= 5) { + return sorted.join(", "); + } else { + return `${sorted.slice(0, 5).join(", ")}, +${sorted.length - 5}`; + } + } + return `${attr}`; +} + +exports.GraphQLInstrumentation = GraphQLInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 8677: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const OPERATION_NOT_SUPPORTED = "Operation$operationName$not supported"; + +exports.OPERATION_NOT_SUPPORTED = OPERATION_NOT_SUPPORTED; +//# sourceMappingURL=internal-types.js.map + + +/***/ }), + +/***/ 6478: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const OTEL_PATCHED_SYMBOL = /* @__PURE__ */ Symbol.for("opentelemetry.patched"); +const OTEL_GRAPHQL_DATA_SYMBOL = /* @__PURE__ */ Symbol.for("opentelemetry.graphql_data"); + +exports.OTEL_GRAPHQL_DATA_SYMBOL = OTEL_GRAPHQL_DATA_SYMBOL; +exports.OTEL_PATCHED_SYMBOL = OTEL_PATCHED_SYMBOL; +//# sourceMappingURL=symbols.js.map + + +/***/ }), + +/***/ 69468: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const _enum = __nccwpck_require__(76322); +const AttributeNames = __nccwpck_require__(25091); +const symbols = __nccwpck_require__(6478); + +const OPERATION_VALUES = Object.values(_enum.AllowedOperationTypes); +const isPromise = (value) => { + return typeof value?.then === "function"; +}; +function addSpanSource(span, loc, start, end) { + if (core.getClient()?.getDataCollectionOptions().graphQL.document === true) { + const source = getSourceFromLocation(loc, start, end); + span.setAttribute(AttributeNames.AttributeNames.SOURCE, source); + } +} +function createFieldIfNotExists(contextValue, info, path) { + let field = getField(contextValue, path); + if (field) { + return { field, spanAdded: false }; + } + const parentSpan = getParentFieldSpan(contextValue, path); + field = { + span: createResolverSpan(contextValue, info, path, parentSpan) + }; + addField(contextValue, path, field); + return { field, spanAdded: true }; +} +function createResolverSpan(contextValue, info, path, parentSpan) { + const attributes = { + [AttributeNames.AttributeNames.FIELD_NAME]: info.fieldName, + [AttributeNames.AttributeNames.FIELD_PATH]: path.join("."), + [AttributeNames.AttributeNames.FIELD_TYPE]: info.returnType.toString(), + [AttributeNames.AttributeNames.PARENT_NAME]: info.parentType.name + }; + const span = core.startInactiveSpan({ + name: `${_enum.SpanNames.RESOLVE} ${attributes[AttributeNames.AttributeNames.FIELD_PATH]}`, + attributes, + parentSpan + }); + const document = contextValue[symbols.OTEL_GRAPHQL_DATA_SYMBOL].source; + const fieldNode = info.fieldNodes.find((fieldNode2) => fieldNode2.kind === "Field"); + if (fieldNode) { + addSpanSource(span, document.loc, fieldNode.loc?.start, fieldNode.loc?.end); + } + return span; +} +function endSpan(span, error) { + if (error) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: error.message }); + } + span.end(); +} +function getOperation(document, operationName) { + if (!document || !Array.isArray(document.definitions)) { + return void 0; + } + if (operationName) { + return document.definitions.filter((definition) => OPERATION_VALUES.indexOf(definition?.operation) !== -1).find((definition) => operationName === definition?.name?.value); + } else { + return document.definitions.find((definition) => OPERATION_VALUES.indexOf(definition?.operation) !== -1); + } +} +function addField(contextValue, path, field) { + return contextValue[symbols.OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join(".")] = field; +} +function getField(contextValue, path) { + return contextValue[symbols.OTEL_GRAPHQL_DATA_SYMBOL].fields[path.join(".")]; +} +function getParentFieldSpan(contextValue, path) { + for (let i = path.length - 1; i > 0; i--) { + const field = getField(contextValue, path.slice(0, i)); + if (field) { + return field.span; + } + } + return getRootSpan(contextValue); +} +function getRootSpan(contextValue) { + return contextValue[symbols.OTEL_GRAPHQL_DATA_SYMBOL].span; +} +function pathToArray(path) { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(String(curr.key)); + curr = curr.prev; + } + return flattened.reverse(); +} +function repeatBreak(i) { + return repeatChar("\n", i); +} +function repeatSpace(i) { + return repeatChar(" ", i); +} +function repeatChar(char, to) { + let text = ""; + for (let i = 0; i < to; i++) { + text += char; + } + return text; +} +const KindsToBeRemoved = [_enum.TokenKind.FLOAT, _enum.TokenKind.STRING, _enum.TokenKind.INT, _enum.TokenKind.BLOCK_STRING]; +function getSourceFromLocation(loc, inputStart, inputEnd) { + let source = ""; + if (loc?.startToken) { + const start = typeof inputStart === "number" ? inputStart : loc.start; + const end = typeof inputEnd === "number" ? inputEnd : loc.end; + let next = loc.startToken.next; + let previousLine = 1; + while (next) { + if (next.start < start) { + next = next.next; + previousLine = next?.line; + continue; + } + if (next.end > end) { + next = next.next; + previousLine = next?.line; + continue; + } + let value = next.value || next.kind; + let space = ""; + if (KindsToBeRemoved.indexOf(next.kind) >= 0) { + value = "*"; + } + if (next.kind === _enum.TokenKind.STRING) { + value = `"${value}"`; + } + if (next.kind === _enum.TokenKind.EOF) { + value = ""; + } + if (next.line > previousLine) { + source += repeatBreak(next.line - previousLine); + previousLine = next.line; + space = repeatSpace(next.column - 1); + } else { + if (next.line === next.prev?.line) { + space = repeatSpace(next.start - (next.prev?.end || 0)); + } + } + source += space + value; + if (next) { + next = next.next; + } + } + } + return source; +} +function wrapFields(type, getConfig) { + if (!type || type[symbols.OTEL_PATCHED_SYMBOL]) { + return; + } + const fields = type.getFields(); + type[symbols.OTEL_PATCHED_SYMBOL] = true; + Object.keys(fields).forEach((key) => { + const field = fields[key]; + if (!field) { + return; + } + if (field.resolve) { + field.resolve = wrapFieldResolver(getConfig, field.resolve); + } + if (field.type) { + const unwrappedTypes = unwrapType(field.type); + for (const unwrappedType of unwrappedTypes) { + wrapFields(unwrappedType, getConfig); + } + } + }); +} +function unwrapType(type) { + if ("ofType" in type) { + return unwrapType(type.ofType); + } + if (isGraphQLUnionType(type)) { + return type.getTypes(); + } + if (isGraphQLObjectType(type)) { + return [type]; + } + return []; +} +function isGraphQLUnionType(type) { + return "getTypes" in type && typeof type.getTypes === "function"; +} +function isGraphQLObjectType(type) { + return "getFields" in type && typeof type.getFields === "function"; +} +const handleResolveSpanError = (resolveSpan, err, shouldEndSpan) => { + if (!shouldEndSpan) { + return; + } + resolveSpan.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: err.message + }); + resolveSpan.end(); +}; +const handleResolveSpanSuccess = (resolveSpan, shouldEndSpan) => { + if (!shouldEndSpan) { + return; + } + resolveSpan.end(); +}; +function wrapFieldResolver(getConfig, fieldResolver, isDefaultResolver = false) { + if (wrappedFieldResolver[symbols.OTEL_PATCHED_SYMBOL] || typeof fieldResolver !== "function") { + return fieldResolver; + } + function wrappedFieldResolver(source, args, contextValue, info) { + if (!fieldResolver) { + return void 0; + } + const config = getConfig(); + if (config.ignoreTrivialResolveSpans && isDefaultResolver && (core.isObjectLike(source) || typeof source === "function")) { + const property = source[info.fieldName]; + if (typeof property !== "function") { + return fieldResolver.call(this, source, args, contextValue, info); + } + } + if (!contextValue[symbols.OTEL_GRAPHQL_DATA_SYMBOL]) { + return fieldResolver.call(this, source, args, contextValue, info); + } + const path = pathToArray(info?.path); + const { field, spanAdded } = createFieldIfNotExists(contextValue, info, path); + const span = field.span; + const shouldEndSpan = spanAdded; + return core.withActiveSpan(span, () => { + try { + const res = fieldResolver.call(this, source, args, contextValue, info); + if (isPromise(res)) { + return res.then( + (r) => { + handleResolveSpanSuccess(span, shouldEndSpan); + return r; + }, + (err) => { + handleResolveSpanError(span, err, shouldEndSpan); + throw err; + } + ); + } else { + handleResolveSpanSuccess(span, shouldEndSpan); + return res; + } + } catch (err) { + handleResolveSpanError(span, err, shouldEndSpan); + throw err; + } + }); + } + wrappedFieldResolver[symbols.OTEL_PATCHED_SYMBOL] = true; + return wrappedFieldResolver; +} + +exports.addSpanSource = addSpanSource; +exports.endSpan = endSpan; +exports.getOperation = getOperation; +exports.getSourceFromLocation = getSourceFromLocation; +exports.isPromise = isPromise; +exports.wrapFieldResolver = wrapFieldResolver; +exports.wrapFields = wrapFields; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 69741: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(90912); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const debugBuild = __nccwpck_require__(8421); + +const INTEGRATION_NAME = "Hapi"; +const instrumentHapi = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.HapiInstrumentation()); +const _hapiIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentHapi(); + } + }; +}); +const hapiIntegration = core.defineIntegration(_hapiIntegration); +function isErrorEvent(event) { + return !!(event && typeof event === "object" && "error" in event && event.error); +} +function sendErrorToSentry(errorData) { + core.captureException(errorData, { + mechanism: { + type: "auto.function.hapi", + handled: false + } + }); +} +const hapiErrorPlugin = { + name: "SentryHapiErrorPlugin", + version: core.SDK_VERSION, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + register: async function(serverArg) { + const server = serverArg; + server.events.on({ name: "request", channels: ["error"] }, (request, event) => { + if (core.getIsolationScope() !== core.getDefaultIsolationScope()) { + const route = request.route; + if (route.path) { + core.getIsolationScope().setTransactionName(`${route.method.toUpperCase()} ${route.path}`); + } + } else { + debugBuild.DEBUG_BUILD && core.debug.warn("Isolation scope is still the default isolation scope - skipping setting transactionName"); + } + if (isErrorEvent(event)) { + sendErrorToSentry(event.error); + } + }); + } +}; +async function setupHapiErrorHandler(server) { + await server.register(hapiErrorPlugin); + nodeCore.ensureIsWrapped(server.register, "hapi"); +} + +exports.hapiErrorPlugin = hapiErrorPlugin; +exports.hapiIntegration = hapiIntegration; +exports.instrumentHapi = instrumentHapi; +exports.setupHapiErrorHandler = setupHapiErrorHandler; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 55509: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => { + AttributeNames2["HAPI_TYPE"] = "hapi.type"; + AttributeNames2["PLUGIN_NAME"] = "hapi.plugin.name"; + AttributeNames2["EXT_TYPE"] = "server.ext.type"; + return AttributeNames2; +})(AttributeNames || {}); + +exports.AttributeNames = AttributeNames; +//# sourceMappingURL=AttributeNames.js.map + + +/***/ }), + +/***/ 90912: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const setHttpServerSpanRouteAttribute = __nccwpck_require__(63790); +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const AttributeNames = __nccwpck_require__(55509); +const internalTypes = __nccwpck_require__(69871); +const utils = __nccwpck_require__(96125); + +const PACKAGE_NAME = "@sentry/instrumentation-hapi"; +class HapiInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return new instrumentation.InstrumentationNodeModuleDefinition( + internalTypes.HapiComponentName, + [">=17.0.0 <22"], + (module) => { + const moduleExports = module[Symbol.toStringTag] === "Module" ? module.default : module; + if (!instrumentation.isWrapped(moduleExports.server)) { + this._wrap(moduleExports, "server", this._getServerPatch.bind(this)); + } + if (!instrumentation.isWrapped(moduleExports.Server)) { + this._wrap(moduleExports, "Server", this._getServerPatch.bind(this)); + } + return moduleExports; + }, + (module) => { + const moduleExports = module[Symbol.toStringTag] === "Module" ? module.default : module; + this._massUnwrap([moduleExports], ["server", "Server"]); + } + ); + } + /** + * Patches the Hapi.server and Hapi.Server functions in order to instrument + * the server.route, server.ext, and server.register functions via calls to the + * @function _getServerRoutePatch, @function _getServerExtPatch, and + * @function _getServerRegisterPatch functions + * @param original - the original Hapi Server creation function + */ + _getServerPatch(original) { + const instrumentation = this; + const self = this; + return function server(opts) { + const newServer = original.apply(this, [opts]); + self._wrap(newServer, "route", (originalRouter) => { + return instrumentation._getServerRoutePatch.bind(instrumentation)(originalRouter); + }); + self._wrap(newServer, "ext", (originalExtHandler) => { + return instrumentation._getServerExtPatch.bind(instrumentation)(originalExtHandler); + }); + self._wrap(newServer, "register", instrumentation._getServerRegisterPatch.bind(instrumentation)); + return newServer; + }; + } + /** + * Patches the plugin register function used by the Hapi Server. This function + * goes through each plugin that is being registered and adds instrumentation + * via a call to the @function _wrapRegisterHandler function. + * @param {RegisterFunction} original - the original register function which + * registers each plugin on the server + */ + _getServerRegisterPatch(original) { + const instrumentation = this; + return function register(pluginInput, options) { + if (Array.isArray(pluginInput)) { + for (const pluginObj of pluginInput) { + const plugin = utils.getPluginFromInput(pluginObj); + instrumentation._wrapRegisterHandler(plugin); + } + } else { + const plugin = utils.getPluginFromInput(pluginInput); + instrumentation._wrapRegisterHandler(plugin); + } + return original.apply(this, [pluginInput, options]); + }; + } + /** + * Patches the Server.ext function which adds extension methods to the specified + * point along the request lifecycle. This function accepts the full range of + * accepted input into the standard Hapi `server.ext` function. For each extension, + * it adds instrumentation to the handler via a call to the @function _wrapExtMethods + * function. + * @param original - the original ext function which adds the extension method to the server + * @param {string} [pluginName] - if present, represents the name of the plugin responsible + * for adding this server extension. Else, signifies that the extension was added directly + */ + _getServerExtPatch(original, pluginName) { + const instrumentation = this; + return function ext(...args) { + if (Array.isArray(args[0])) { + const eventsList = args[0]; + for (let i = 0; i < eventsList.length; i++) { + const eventObj = eventsList[i]; + if (utils.isLifecycleExtType(eventObj.type)) { + const lifecycleEventObj = eventObj; + const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, eventObj.type, pluginName); + lifecycleEventObj.method = handler; + eventsList[i] = lifecycleEventObj; + } + } + return original.apply(this, args); + } else if (utils.isDirectExtInput(args)) { + const extInput = args; + const method = extInput[1]; + const handler = instrumentation._wrapExtMethods(method, extInput[0], pluginName); + return original.apply(this, [extInput[0], handler, extInput[2]]); + } else if (utils.isLifecycleExtEventObj(args[0])) { + const lifecycleEventObj = args[0]; + const handler = instrumentation._wrapExtMethods(lifecycleEventObj.method, lifecycleEventObj.type, pluginName); + lifecycleEventObj.method = handler; + return original.call(this, lifecycleEventObj); + } + return original.apply(this, args); + }; + } + /** + * Patches the Server.route function. This function accepts either one or an array + * of Hapi.ServerRoute objects and adds instrumentation on each route via a call to + * the @function _wrapRouteHandler function. + * @param {HapiServerRouteInputMethod} original - the original route function which adds + * the route to the server + * @param {string} [pluginName] - if present, represents the name of the plugin responsible + * for adding this server route. Else, signifies that the route was added directly + */ + _getServerRoutePatch(original, pluginName) { + const instrumentation = this; + return function route(route) { + if (Array.isArray(route)) { + for (let i = 0; i < route.length; i++) { + const newRoute = instrumentation._wrapRouteHandler.call(instrumentation, route[i], pluginName); + route[i] = newRoute; + } + } else { + route = instrumentation._wrapRouteHandler.call(instrumentation, route, pluginName); + } + return original.apply(this, [route]); + }; + } + /** + * Wraps newly registered plugins to add instrumentation to the plugin's clone of + * the original server. Specifically, wraps the server.route and server.ext functions + * via calls to @function _getServerRoutePatch and @function _getServerExtPatch + * @param {Hapi.Plugin} plugin - the new plugin which is being instrumented + */ + _wrapRegisterHandler(plugin) { + const instrumentation = this; + const pluginName = utils.getPluginName(plugin); + const oldRegister = plugin.register; + const self = this; + const newRegisterHandler = function(server, options) { + self._wrap(server, "route", (original) => { + return instrumentation._getServerRoutePatch.bind(instrumentation)(original, pluginName); + }); + self._wrap(server, "ext", (originalExtHandler) => { + return instrumentation._getServerExtPatch.bind(instrumentation)(originalExtHandler, pluginName); + }); + return oldRegister.call(this, server, options); + }; + plugin.register = newRegisterHandler; + } + /** + * Wraps request extension methods to add instrumentation to each new extension handler. + * Patches each individual extension in order to create the + * span and propagate context. It does not create spans when there is no parent span. + * @param {PatchableExtMethod | PatchableExtMethod[]} method - the request extension + * handler which is being instrumented + * @param {Hapi.ServerRequestExtType} extPoint - the point in the Hapi request lifecycle + * which this extension targets + * @param {string} [pluginName] - if present, represents the name of the plugin responsible + * for adding this server route. Else, signifies that the route was added directly + */ + _wrapExtMethods(method, extPoint, pluginName) { + const instrumentation = this; + if (method instanceof Array) { + for (let i = 0; i < method.length; i++) { + method[i] = instrumentation._wrapExtMethods(method[i], extPoint); + } + return method; + } else if (utils.isPatchableExtMethod(method)) { + if (method[internalTypes.handlerPatched] === true) return method; + method[internalTypes.handlerPatched] = true; + const newHandler = function(...params) { + if (api.trace.getSpan(api.context.active()) === void 0) { + return method.apply(this, params); + } + const metadata = utils.getExtMetadata(extPoint, pluginName, method.name); + return core.startSpan( + { + name: metadata.name, + op: `${metadata.attributes[AttributeNames.AttributeNames.HAPI_TYPE]}.hapi`, + attributes: { + ...metadata.attributes, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.hapi" + } + }, + () => method.apply(void 0, params) + ); + }; + return newHandler; + } + return method; + } + /** + * Patches each individual route handler method in order to create the + * span and propagate context. It does not create spans when there is no parent span. + * @param {PatchableServerRoute} route - the route handler which is being instrumented + * @param {string} [pluginName] - if present, represents the name of the plugin responsible + * for adding this server route. Else, signifies that the route was added directly + */ + _wrapRouteHandler(route, pluginName) { + if (route[internalTypes.handlerPatched] === true) return route; + route[internalTypes.handlerPatched] = true; + const wrapHandler = (oldHandler) => { + return function(...params) { + if (api.trace.getSpan(api.context.active()) === void 0) { + return oldHandler.call(this, ...params); + } + setHttpServerSpanRouteAttribute.setHttpServerSpanRouteAttribute(route.path); + const metadata = utils.getRouteMetadata(route, pluginName); + return core.startSpan( + { + name: metadata.name, + op: `${metadata.attributes[AttributeNames.AttributeNames.HAPI_TYPE]}.hapi`, + attributes: { + ...metadata.attributes, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.hapi" + } + }, + () => oldHandler.call(this, ...params) + ); + }; + }; + if (typeof route.handler === "function") { + route.handler = wrapHandler(route.handler); + } else if (typeof route.options === "function") { + const oldOptions = route.options; + route.options = function(server) { + const options = oldOptions(server); + if (typeof options.handler === "function") { + options.handler = wrapHandler(options.handler); + } + return options; + }; + } else if (typeof route.options?.handler === "function") { + route.options.handler = wrapHandler(route.options.handler); + } + return route; + } +} + +exports.HapiInstrumentation = HapiInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 69871: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const HapiComponentName = "@hapi/hapi"; +const handlerPatched = /* @__PURE__ */ Symbol("hapi-handler-patched"); +const HapiLayerType = { + ROUTER: "router", + PLUGIN: "plugin", + EXT: "server.ext" +}; +const HapiLifecycleMethodNames = /* @__PURE__ */ new Set([ + "onPreAuth", + "onCredentials", + "onPostAuth", + "onPreHandler", + "onPostHandler", + "onPreResponse", + "onRequest" +]); + +exports.HapiComponentName = HapiComponentName; +exports.HapiLayerType = HapiLayerType; +exports.HapiLifecycleMethodNames = HapiLifecycleMethodNames; +exports.handlerPatched = handlerPatched; +//# sourceMappingURL=internal-types.js.map + + +/***/ }), + +/***/ 96125: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const internalTypes = __nccwpck_require__(69871); +const AttributeNames = __nccwpck_require__(55509); + +function getPluginName(plugin) { + if (plugin.name) { + return plugin.name; + } else { + return plugin.pkg.name; + } +} +const isLifecycleExtType = (variableToCheck) => { + return typeof variableToCheck === "string" && internalTypes.HapiLifecycleMethodNames.has(variableToCheck); +}; +const isLifecycleExtEventObj = (variableToCheck) => { + const event = variableToCheck?.type; + return event !== void 0 && isLifecycleExtType(event); +}; +const isDirectExtInput = (variableToCheck) => { + return Array.isArray(variableToCheck) && variableToCheck.length <= 3 && isLifecycleExtType(variableToCheck[0]) && typeof variableToCheck[1] === "function"; +}; +const isPatchableExtMethod = (variableToCheck) => { + return !Array.isArray(variableToCheck); +}; +const getRouteMetadata = (route, pluginName) => { + const attributes$1 = { + [attributes.HTTP_ROUTE]: route.path, + // eslint-disable-next-line typescript/no-deprecated + [attributes.HTTP_METHOD]: route.method + }; + let name; + if (pluginName) { + attributes$1[AttributeNames.AttributeNames.HAPI_TYPE] = internalTypes.HapiLayerType.PLUGIN; + attributes$1[AttributeNames.AttributeNames.PLUGIN_NAME] = pluginName; + name = `${pluginName}: route - ${route.path}`; + } else { + attributes$1[AttributeNames.AttributeNames.HAPI_TYPE] = internalTypes.HapiLayerType.ROUTER; + name = `route - ${route.path}`; + } + return { attributes: attributes$1, name }; +}; +const getExtMetadata = (extPoint, pluginName, methodName) => { + let baseName = `ext - ${extPoint}`; + if (methodName && methodName !== "method") { + baseName = `ext - ${extPoint} - ${methodName}`; + } + if (pluginName) { + return { + attributes: { + [AttributeNames.AttributeNames.EXT_TYPE]: extPoint, + [AttributeNames.AttributeNames.HAPI_TYPE]: internalTypes.HapiLayerType.EXT, + [AttributeNames.AttributeNames.PLUGIN_NAME]: pluginName + }, + name: `${pluginName}: ${baseName}` + }; + } + return { + attributes: { + [AttributeNames.AttributeNames.EXT_TYPE]: extPoint, + [AttributeNames.AttributeNames.HAPI_TYPE]: internalTypes.HapiLayerType.EXT + }, + name: baseName + }; +}; +const getPluginFromInput = (pluginObj) => { + if ("plugin" in pluginObj) { + if ("plugin" in pluginObj.plugin) { + return pluginObj.plugin.plugin; + } + return pluginObj.plugin; + } + return pluginObj; +}; + +exports.getExtMetadata = getExtMetadata; +exports.getPluginFromInput = getPluginFromInput; +exports.getPluginName = getPluginName; +exports.getRouteMetadata = getRouteMetadata; +exports.isDirectExtInput = isDirectExtInput; +exports.isLifecycleExtEventObj = isLifecycleExtEventObj; +exports.isLifecycleExtType = isLifecycleExtType; +exports.isPatchableExtMethod = isPatchableExtMethod; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 64762: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const AttributeNames = { + HONO_TYPE: "hono.type", + HONO_NAME: "hono.name" +}; +const HonoTypes = { + MIDDLEWARE: "middleware", + REQUEST_HANDLER: "request_handler" +}; + +exports.AttributeNames = AttributeNames; +exports.HonoTypes = HonoTypes; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 55331: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const debugBuild = __nccwpck_require__(8421); +const constants = __nccwpck_require__(64762); +const instrumentation = __nccwpck_require__(86629); + +const INTEGRATION_NAME = "Hono"; +function addHonoSpanAttributes(span) { + const attributes$1 = core.spanToJSON(span).data; + const type = attributes$1[constants.AttributeNames.HONO_TYPE]; + if (attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) { + return; + } + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.hono", + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.hono` + }); + const name = attributes$1[constants.AttributeNames.HONO_NAME]; + if (typeof name === "string") { + span.updateName(name); + } + if (core.getIsolationScope() === core.getDefaultIsolationScope()) { + debugBuild.DEBUG_BUILD && core.debug.warn("Isolation scope is default isolation scope - skipping setting transactionName"); + return; + } + const route = attributes$1[attributes.HTTP_ROUTE]; + const method = attributes$1[attributes.HTTP_REQUEST_METHOD]; + if (typeof route === "string" && typeof method === "string") { + core.getIsolationScope().setTransactionName(`${method} ${route}`); + } +} +const instrumentHono = nodeCore.generateInstrumentOnce( + INTEGRATION_NAME, + () => new instrumentation.HonoInstrumentation({ + responseHook: (span) => { + addHonoSpanAttributes(span); + } + }) +); +const _honoIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentHono(); + } + }; +}); +const honoIntegration = core.defineIntegration(_honoIntegration); +function honoRequestHandler() { + return async function sentryRequestMiddleware(context, next) { + const normalizedRequest = core.httpRequestToRequestData(context.req); + core.getIsolationScope().setSDKProcessingMetadata({ normalizedRequest }); + await next(); + }; +} +function defaultShouldHandleError(context) { + const statusCode = context.res.status; + return statusCode >= 500; +} +function honoErrorHandler(options) { + return async function sentryErrorMiddleware(context, next) { + await next(); + const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError; + if (shouldHandleError(context)) { + context.res.sentry = core.captureException(context.error, { + mechanism: { + type: "auto.middleware.hono", + handled: false + } + }); + } + }; +} +function setupHonoErrorHandler(app, options) { + app.use(honoRequestHandler()); + app.use(honoErrorHandler(options)); + nodeCore.ensureIsWrapped(app.use, "hono"); +} + +exports.honoIntegration = honoIntegration; +exports.instrumentHono = instrumentHono; +exports.setupHonoErrorHandler = setupHonoErrorHandler; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 86629: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const constants = __nccwpck_require__(64762); + +const PACKAGE_NAME = "@sentry/instrumentation-hono"; +const PACKAGE_VERSION = "0.0.1"; +class HonoInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, PACKAGE_VERSION, config); + } + /** + * Initialize the instrumentation. + */ + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition("hono", [">=4.0.0 <5"], (moduleExports) => this._patch(moduleExports)) + ]; + } + /** + * Patches the module exports to instrument Hono. + */ + _patch(moduleExports) { + const instrumentation = this; + class WrappedHono extends moduleExports.Hono { + constructor(...args) { + super(...args); + instrumentation._wrap(this, "get", instrumentation._patchHandler()); + instrumentation._wrap(this, "post", instrumentation._patchHandler()); + instrumentation._wrap(this, "put", instrumentation._patchHandler()); + instrumentation._wrap(this, "delete", instrumentation._patchHandler()); + instrumentation._wrap(this, "options", instrumentation._patchHandler()); + instrumentation._wrap(this, "patch", instrumentation._patchHandler()); + instrumentation._wrap(this, "all", instrumentation._patchHandler()); + instrumentation._wrap(this, "on", instrumentation._patchOnHandler()); + instrumentation._wrap(this, "use", instrumentation._patchMiddlewareHandler()); + } + } + try { + moduleExports.Hono = WrappedHono; + } catch { + return { ...moduleExports, Hono: WrappedHono }; + } + return moduleExports; + } + /** + * Patches the route handler to instrument it. + */ + _patchHandler() { + const instrumentation = this; + return function(original) { + return function wrappedHandler(...args) { + if (typeof args[0] === "string") { + const path = args[0]; + if (args.length === 1) { + return original.apply(this, [path]); + } + const handlers = args.slice(1); + return original.apply(this, [ + path, + ...handlers.map((handler) => instrumentation._wrapHandler(handler)) + ]); + } + return original.apply( + this, + args.map((handler) => instrumentation._wrapHandler(handler)) + ); + }; + }; + } + /** + * Patches the 'on' handler to instrument it. + */ + _patchOnHandler() { + const instrumentation = this; + return function(original) { + return function wrappedHandler(...args) { + const handlers = args.slice(2); + return original.apply(this, [ + ...args.slice(0, 2), + ...handlers.map((handler) => instrumentation._wrapHandler(handler)) + ]); + }; + }; + } + /** + * Patches the middleware handler to instrument it. + */ + _patchMiddlewareHandler() { + const instrumentation = this; + return function(original) { + return function wrappedHandler(...args) { + if (typeof args[0] === "string") { + const path = args[0]; + if (args.length === 1) { + return original.apply(this, [path]); + } + const handlers = args.slice(1); + return original.apply(this, [ + path, + ...handlers.map((handler) => instrumentation._wrapHandler(handler)) + ]); + } + return original.apply( + this, + args.map((handler) => instrumentation._wrapHandler(handler)) + ); + }; + }; + } + /** + * Wraps a handler or middleware handler to apply instrumentation. + */ + _wrapHandler(handler) { + const instrumentation = this; + return function(c, next) { + if (!instrumentation.isEnabled()) { + return handler.apply(this, [c, next]); + } + const path = c.req.path; + const span = instrumentation.tracer.startSpan(path); + return api.context.with(api.trace.setSpan(api.context.active(), span), () => { + return instrumentation._safeExecute( + () => { + const result = handler.apply(this, [c, next]); + if (core.isThenable(result)) { + return result.then((result2) => { + const type = instrumentation._determineHandlerType(result2); + span.setAttributes({ + [constants.AttributeNames.HONO_TYPE]: type, + [constants.AttributeNames.HONO_NAME]: type === constants.HonoTypes.REQUEST_HANDLER ? path : handler.name || "anonymous" + }); + instrumentation.getConfig().responseHook?.(span); + return result2; + }); + } else { + const type = instrumentation._determineHandlerType(result); + span.setAttributes({ + [constants.AttributeNames.HONO_TYPE]: type, + [constants.AttributeNames.HONO_NAME]: type === constants.HonoTypes.REQUEST_HANDLER ? path : handler.name || "anonymous" + }); + instrumentation.getConfig().responseHook?.(span); + return result; + } + }, + () => span.end(), + (error) => { + instrumentation._handleError(span, error); + span.end(); + } + ); + }); + }; + } + /** + * Safely executes a function and handles errors. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + _safeExecute(execute, onSuccess, onFailure) { + try { + const result = execute(); + if (core.isThenable(result)) { + result.then( + () => onSuccess(), + (error) => onFailure(error) + ); + } else { + onSuccess(); + } + return result; + } catch (error) { + onFailure(error); + throw error; + } + } + /** + * Determines the handler type based on the result. + * @param result + * @private + */ + _determineHandlerType(result) { + return result === void 0 ? constants.HonoTypes.MIDDLEWARE : constants.HonoTypes.REQUEST_HANDLER; + } + /** + * Handles errors by setting the span status and recording the exception. + */ + _handleError(span, error) { + if (error instanceof Error) { + span.setStatus({ + code: api.SpanStatusCode.ERROR, + message: error.message + }); + span.recordException(error); + } + } +} + +exports.HonoInstrumentation = HonoInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 59020: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const serverUtils = __nccwpck_require__(93362); +const http = __nccwpck_require__(92447); +const index$g = __nccwpck_require__(98562); +const index$k = __nccwpck_require__(88363); +const index = __nccwpck_require__(80322); +const express = __nccwpck_require__(89660); +const index$1 = __nccwpck_require__(7401); +const firebase = __nccwpck_require__(94852); +const index$f = __nccwpck_require__(88204); +const index$l = __nccwpck_require__(63374); +const index$c = __nccwpck_require__(55238); +const index$2 = __nccwpck_require__(69741); +const index$3 = __nccwpck_require__(55331); +const index$4 = __nccwpck_require__(33627); +const index$5 = __nccwpck_require__(88562); +const index$h = __nccwpck_require__(63467); +const index$m = __nccwpck_require__(61016); +const index$6 = __nccwpck_require__(33555); +const index$7 = __nccwpck_require__(17574); +const index$8 = __nccwpck_require__(68850); +const index$9 = __nccwpck_require__(61697); +const index$a = __nccwpck_require__(62188); +const index$j = __nccwpck_require__(33879); +const index$b = __nccwpck_require__(73894); +const postgresjs = __nccwpck_require__(28739); +const index$d = __nccwpck_require__(42045); +const index$e = __nccwpck_require__(66804); +const index$i = __nccwpck_require__(65595); + +function getAutoPerformanceIntegrations() { + return [ + express.expressIntegration(), + index$1.fastifyIntegration(), + index$c.graphqlIntegration(), + // eslint-disable-next-line typescript/no-deprecated + index$3.honoIntegration(), + index$7.mongoIntegration(), + index$8.mongooseIntegration(), + index$9.mysqlIntegration(), + index$a.mysql2Integration(), + index$d.redisIntegration(), + index$b.postgresIntegration(), + serverUtils.prismaIntegration(), + index$2.hapiIntegration(), + index$5.koaIntegration(), + index.connectIntegration(), + index$e.tediousIntegration(), + index$f.genericPoolIntegration(), + index$4.kafkaIntegration(), + index$g.amqplibIntegration(), + index$6.lruMemoizerIntegration(), + // AI providers + // LangChain must come first to disable AI provider integrations before they instrument + index$h.langChainIntegration(), + index$m.langGraphIntegration(), + index$i.vercelAIIntegration(), + index$j.openAIIntegration(), + index$k.anthropicAIIntegration(), + index$l.googleGenAIIntegration(), + postgresjs.postgresJsIntegration(), + firebase.firebaseIntegration() + ]; +} +function getOpenTelemetryInstrumentationToPreload() { + return [ + http.instrumentSentryHttp, + express.instrumentExpress, + index.instrumentConnect, + index$1.instrumentFastifyV3, + index$2.instrumentHapi, + index$3.instrumentHono, + index$4.instrumentKafka, + index$5.instrumentKoa, + index$6.instrumentLruMemoizer, + index$7.instrumentMongo, + index$8.instrumentMongoose, + index$9.instrumentMysql, + index$a.instrumentMysql2, + index$b.instrumentPostgres, + index$2.instrumentHapi, + index$c.instrumentGraphql, + index$d.instrumentRedis, + index$e.instrumentTedious, + index$f.instrumentGenericPool, + index$g.instrumentAmqplib, + index$h.instrumentLangChain, + index$i.instrumentVercelAi, + index$j.instrumentOpenAi, + postgresjs.instrumentPostgresJs, + firebase.instrumentFirebase, + index$k.instrumentAnthropicAi, + index$l.instrumentGoogleGenAI, + index$m.instrumentLangGraph + ]; +} + +exports.getAutoPerformanceIntegrations = getAutoPerformanceIntegrations; +exports.getOpenTelemetryInstrumentationToPreload = getOpenTelemetryInstrumentationToPreload; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 33627: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(47867); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "Kafka"; +const instrumentKafka = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.KafkaJsInstrumentation()); +const _kafkaIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentKafka(); + } + }; +}); +const kafkaIntegration = core.defineIntegration(_kafkaIntegration); + +exports.instrumentKafka = instrumentKafka; +exports.kafkaIntegration = kafkaIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 47867: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const semconv = __nccwpck_require__(82873); +const utils = __nccwpck_require__(96384); + +const PACKAGE_NAME = "@sentry/instrumentation-kafkajs"; +class KafkaJsInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + const unpatch = (moduleExports) => { + if (instrumentation.isWrapped(moduleExports?.Kafka?.prototype.producer)) { + this._unwrap(moduleExports.Kafka.prototype, "producer"); + } + if (instrumentation.isWrapped(moduleExports?.Kafka?.prototype.consumer)) { + this._unwrap(moduleExports.Kafka.prototype, "consumer"); + } + }; + const module = new instrumentation.InstrumentationNodeModuleDefinition( + "kafkajs", + [">=0.3.0 <3"], + (moduleExports) => { + unpatch(moduleExports); + this._wrap(moduleExports?.Kafka?.prototype, "producer", this._getProducerPatch()); + this._wrap(moduleExports?.Kafka?.prototype, "consumer", this._getConsumerPatch()); + return moduleExports; + }, + unpatch + ); + return module; + } + _getConsumerPatch() { + const instrumentation$1 = this; + return (original) => { + return function consumer(...args) { + const newConsumer = original.apply(this, args); + if (instrumentation.isWrapped(newConsumer.run)) { + instrumentation$1._unwrap(newConsumer, "run"); + } + instrumentation$1._wrap(newConsumer, "run", instrumentation$1._getConsumerRunPatch()); + return newConsumer; + }; + }; + } + _getProducerPatch() { + const instrumentation$1 = this; + return (original) => { + return function consumer(...args) { + const newProducer = original.apply(this, args); + if (instrumentation.isWrapped(newProducer.sendBatch)) { + instrumentation$1._unwrap(newProducer, "sendBatch"); + } + instrumentation$1._wrap(newProducer, "sendBatch", instrumentation$1._getSendBatchPatch()); + if (instrumentation.isWrapped(newProducer.send)) { + instrumentation$1._unwrap(newProducer, "send"); + } + instrumentation$1._wrap(newProducer, "send", instrumentation$1._getSendPatch()); + if (instrumentation.isWrapped(newProducer.transaction)) { + instrumentation$1._unwrap(newProducer, "transaction"); + } + instrumentation$1._wrap(newProducer, "transaction", instrumentation$1._getProducerTransactionPatch()); + return newProducer; + }; + }; + } + _getConsumerRunPatch() { + const instrumentation$1 = this; + return (original) => { + return function run(...args) { + const config = args[0]; + if (config?.eachMessage) { + if (instrumentation.isWrapped(config.eachMessage)) { + instrumentation$1._unwrap(config, "eachMessage"); + } + instrumentation$1._wrap(config, "eachMessage", instrumentation$1._getConsumerEachMessagePatch()); + } + if (config?.eachBatch) { + if (instrumentation.isWrapped(config.eachBatch)) { + instrumentation$1._unwrap(config, "eachBatch"); + } + instrumentation$1._wrap(config, "eachBatch", instrumentation$1._getConsumerEachBatchPatch()); + } + return original.call(this, config); + }; + }; + } + _getConsumerEachMessagePatch() { + return (original) => { + return function eachMessage(...args) { + const payload = args[0]; + const sentryTrace = utils.getHeaderAsString(payload.message.headers, "sentry-trace"); + const baggage = utils.getHeaderAsString(payload.message.headers, "baggage"); + return core.continueTrace({ sentryTrace, baggage }, () => { + const span = utils.startConsumerSpan({ + topic: payload.topic, + message: payload.message, + operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS, + attributes: { + [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition) + } + }); + const eachMessagePromise = core.withActiveSpan(span, () => { + return original.apply(this, args); + }); + return utils.endSpansOnPromise([span], eachMessagePromise); + }); + }; + }; + } + _getConsumerEachBatchPatch() { + return (original) => { + return function eachBatch(...args) { + const payload = args[0]; + const receivingSpan = core.startNewTrace( + () => utils.startConsumerSpan({ + topic: payload.batch.topic, + message: void 0, + operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE, + attributes: { + [attributes.MESSAGING_BATCH_MESSAGE_COUNT]: payload.batch.messages.length, + [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition) + } + }) + ); + return core.withActiveSpan(receivingSpan, () => { + const spans = [receivingSpan]; + payload.batch.messages.forEach((message) => { + spans.push( + utils.startConsumerSpan({ + topic: payload.batch.topic, + message, + operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS, + links: utils.getLinksFromHeaders(message.headers), + attributes: { + [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition) + } + }) + ); + }); + const batchMessagePromise = original.apply(this, args); + return utils.endSpansOnPromise(spans, batchMessagePromise); + }); + }; + }; + } + _getProducerTransactionPatch() { + const instrumentation = this; + return (original) => { + return function transaction(...args) { + const transactionSpan = core.startInactiveSpan({ name: "transaction" }); + const transactionPromise = original.apply(this, args); + transactionPromise.then((transaction2) => { + const originalSend = transaction2.send; + transaction2.send = function send(...args2) { + return core.withActiveSpan(transactionSpan, () => { + const patched = instrumentation._getSendPatch()(originalSend); + return patched.apply(this, args2).catch((err) => { + transactionSpan.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: err?.message + }); + throw err; + }); + }); + }; + const originalSendBatch = transaction2.sendBatch; + transaction2.sendBatch = function sendBatch(...args2) { + return core.withActiveSpan(transactionSpan, () => { + const patched = instrumentation._getSendBatchPatch()(originalSendBatch); + return patched.apply(this, args2).catch((err) => { + transactionSpan.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: err?.message + }); + throw err; + }); + }); + }; + const originalCommit = transaction2.commit; + transaction2.commit = function commit(...args2) { + const originCommitPromise = originalCommit.apply(this, args2).then(() => { + transactionSpan.setStatus({ code: core.SPAN_STATUS_OK }); + }); + return utils.endSpansOnPromise([transactionSpan], originCommitPromise); + }; + const originalAbort = transaction2.abort; + transaction2.abort = function abort(...args2) { + const originAbortPromise = originalAbort.apply(this, args2); + return utils.endSpansOnPromise([transactionSpan], originAbortPromise); + }; + }).catch((err) => { + transactionSpan.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: err?.message + }); + transactionSpan.end(); + }); + return transactionPromise; + }; + }; + } + _getSendBatchPatch() { + return (original) => { + return function sendBatch(...args) { + const batch = args[0]; + const messages = batch.topicMessages || []; + const spans = []; + messages.forEach((topicMessage) => { + topicMessage.messages.forEach((message) => { + spans.push(utils.startProducerSpan(topicMessage.topic, message)); + }); + }); + const origSendResult = original.apply(this, args); + return utils.endSpansOnPromise(spans, origSendResult); + }; + }; + } + _getSendPatch() { + return (original) => { + return function send(...args) { + const record = args[0]; + const spans = record.messages.map((message) => { + return utils.startProducerSpan(record.topic, message); + }); + const origSendResult = original.apply(this, args); + return utils.endSpansOnPromise(spans, origSendResult); + }; + }; + } +} + +exports.KafkaJsInstrumentation = KafkaJsInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 82873: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id"; +const ATTR_MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key"; +const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone"; +const ATTR_MESSAGING_KAFKA_OFFSET = "messaging.kafka.offset"; +const MESSAGING_OPERATION_TYPE_VALUE_PROCESS = "process"; +const MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = "receive"; +const MESSAGING_OPERATION_TYPE_VALUE_SEND = "send"; +const MESSAGING_SYSTEM_VALUE_KAFKA = "kafka"; +const ERROR_TYPE_VALUE_OTHER = "_OTHER"; + +exports.ATTR_MESSAGING_DESTINATION_PARTITION_ID = ATTR_MESSAGING_DESTINATION_PARTITION_ID; +exports.ATTR_MESSAGING_KAFKA_MESSAGE_KEY = ATTR_MESSAGING_KAFKA_MESSAGE_KEY; +exports.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE; +exports.ATTR_MESSAGING_KAFKA_OFFSET = ATTR_MESSAGING_KAFKA_OFFSET; +exports.ERROR_TYPE_VALUE_OTHER = ERROR_TYPE_VALUE_OTHER; +exports.MESSAGING_OPERATION_TYPE_VALUE_PROCESS = MESSAGING_OPERATION_TYPE_VALUE_PROCESS; +exports.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = MESSAGING_OPERATION_TYPE_VALUE_RECEIVE; +exports.MESSAGING_OPERATION_TYPE_VALUE_SEND = MESSAGING_OPERATION_TYPE_VALUE_SEND; +exports.MESSAGING_SYSTEM_VALUE_KAFKA = MESSAGING_SYSTEM_VALUE_KAFKA; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 96384: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const semconv = __nccwpck_require__(82873); + +const PRODUCER_ORIGIN = "auto.kafkajs.otel.producer"; +const CONSUMER_ORIGIN = "auto.kafkajs.otel.consumer"; +function getHeaderAsString(headers, key) { + const value = headers?.[key]; + if (value == null) { + return void 0; + } + return Array.isArray(value) ? value[0]?.toString() : value.toString(); +} +function getLinksFromHeaders(headers) { + const sentryTrace = getHeaderAsString(headers, "sentry-trace"); + if (!sentryTrace) { + return void 0; + } + const { traceId, parentSpanId, sampled } = core.propagationContextFromHeaders( + sentryTrace, + getHeaderAsString(headers, "baggage") + ); + if (!parentSpanId) { + return void 0; + } + return [ + { + context: { + traceId, + spanId: parentSpanId, + isRemote: true, + traceFlags: sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE + } + } + ]; +} +function startConsumerSpan({ topic, message, operationType, links, attributes: attributes$1 }) { + const operationName = operationType === semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? "poll" : operationType; + return core.startInactiveSpan({ + name: `${operationName} ${topic}`, + kind: operationType === semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? core.SPAN_KIND.CLIENT : core.SPAN_KIND.CONSUMER, + links, + attributes: { + ...attributes$1, + [attributes.MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA, + [attributes.MESSAGING_DESTINATION_NAME]: topic, + [attributes.MESSAGING_OPERATION_TYPE]: operationType, + [attributes.MESSAGING_OPERATION_NAME]: operationName, + [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message?.key ? String(message.key) : void 0, + [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message?.key && message.value === null ? true : void 0, + [semconv.ATTR_MESSAGING_KAFKA_OFFSET]: message?.offset, + // Mirror the upstream behavior of only tagging per-message processing spans (not the batch + // receiving span, which carries no message) with the auto origin. + ...message ? { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: CONSUMER_ORIGIN } : {} + } + }); +} +function startProducerSpan(topic, message) { + const span = core.startInactiveSpan({ + name: `send ${topic}`, + kind: core.SPAN_KIND.PRODUCER, + attributes: { + [attributes.MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA, + [attributes.MESSAGING_DESTINATION_NAME]: topic, + [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message.key ? String(message.key) : void 0, + [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message.key && message.value === null ? true : void 0, + [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: message.partition !== void 0 ? String(message.partition) : void 0, + [attributes.MESSAGING_OPERATION_NAME]: "send", + [attributes.MESSAGING_OPERATION_TYPE]: semconv.MESSAGING_OPERATION_TYPE_VALUE_SEND, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRODUCER_ORIGIN + } + }); + message.headers = message.headers ?? {}; + const traceData = core.getTraceData({ span }); + if (traceData["sentry-trace"]) { + message.headers["sentry-trace"] = traceData["sentry-trace"]; + } + if (traceData.baggage) { + message.headers["baggage"] = traceData.baggage; + } + return span; +} +function endSpansOnPromise(spans, sendPromise) { + return Promise.resolve(sendPromise).catch((reason) => { + let errorMessage; + let errorType = semconv.ERROR_TYPE_VALUE_OTHER; + if (typeof reason === "string" || reason === void 0) { + errorMessage = reason; + } else if (typeof reason === "object" && Object.prototype.hasOwnProperty.call(reason, "message")) { + errorMessage = reason.message; + errorType = reason.constructor.name; + } + spans.forEach((span) => { + span.setAttribute(attributes.ERROR_TYPE, errorType); + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: errorMessage + }); + }); + throw reason; + }).finally(() => { + spans.forEach((span) => span.end()); + }); +} + +exports.endSpansOnPromise = endSpansOnPromise; +exports.getHeaderAsString = getHeaderAsString; +exports.getLinksFromHeaders = getLinksFromHeaders; +exports.startConsumerSpan = startConsumerSpan; +exports.startProducerSpan = startProducerSpan; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 80895: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(96247); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const orchestrion = __nccwpck_require__(21496); + +const INTEGRATION_NAME = "Knex"; +const instrumentKnex = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.KnexInstrumentation()); +const _knexIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (orchestrion.isOrchestrionInjected()) { + orchestrion.knexChannelIntegration().setupOnce?.(); + } else { + instrumentKnex(); + } + } + }; +}); +const knexIntegration = core.defineIntegration(_knexIntegration); + +exports.instrumentKnex = instrumentKnex; +exports.knexIntegration = knexIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 96247: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const semconv = __nccwpck_require__(18192); +const utils = __nccwpck_require__(56132); + +const PACKAGE_NAME = "@sentry/instrumentation-knex"; +const ORIGIN = "auto.db.otel.knex"; +const MODULE_NAME = "knex"; +const SUPPORTED_VERSIONS = [ + // use "lib/execution" for runner.js, "lib" for client.js as basepath, latest tested 0.95.6 + ">=0.22.0 <4", + // use "lib" as basepath + ">=0.10.0 <0.18.0", + ">=0.19.0 <0.22.0", + // use "src" as basepath + ">=0.18.0 <0.19.0" +]; +const MAX_QUERY_LENGTH = 1022; +const parentSpanSymbol = /* @__PURE__ */ Symbol("sentry.instrumentation-knex.parent-span"); +class KnexInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition(MODULE_NAME, SUPPORTED_VERSIONS); + module.files.push( + this._getClientNodeModuleFileInstrumentation("src"), + this._getClientNodeModuleFileInstrumentation("lib"), + this._getRunnerNodeModuleFileInstrumentation("src"), + this._getRunnerNodeModuleFileInstrumentation("lib"), + this._getRunnerNodeModuleFileInstrumentation("lib/execution") + ); + return module; + } + _getRunnerNodeModuleFileInstrumentation(basePath) { + return new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + `knex/${basePath}/runner.js`, + SUPPORTED_VERSIONS, + (Runner, moduleVersion) => { + this._ensureWrapped(Runner.prototype, "query", this._createQueryWrapper(moduleVersion)); + return Runner; + }, + (Runner) => { + this._unwrap(Runner.prototype, "query"); + return Runner; + } + ); + } + _getClientNodeModuleFileInstrumentation(basePath) { + return new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + `knex/${basePath}/client.js`, + SUPPORTED_VERSIONS, + (Client) => { + this._ensureWrapped(Client.prototype, "queryBuilder", this._storeContext.bind(this)); + this._ensureWrapped(Client.prototype, "schemaBuilder", this._storeContext.bind(this)); + this._ensureWrapped(Client.prototype, "raw", this._storeContext.bind(this)); + return Client; + }, + (Client) => { + this._unwrap(Client.prototype, "queryBuilder"); + this._unwrap(Client.prototype, "schemaBuilder"); + this._unwrap(Client.prototype, "raw"); + return Client; + } + ); + } + _createQueryWrapper(moduleVersion) { + return function wrapQuery(original) { + return function wrapped_logging_method(query) { + const config = this.client.config; + const table = utils.extractTableName(this.builder); + const operation = query?.method; + const connectionString = config?.connection?.connectionString; + const name = config?.connection?.filename || config?.connection?.database || utils.extractDatabaseFromConnectionString(connectionString); + const attributes$1 = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + "knex.version": moduleVersion, + [attributes.DB_SYSTEM]: utils.mapSystem(this.client.driverName), + [semconv.ATTR_DB_SQL_TABLE]: table, + [attributes.DB_OPERATION]: operation, + [attributes.DB_USER]: config?.connection?.user, + [attributes.DB_NAME]: name, + [attributes.NET_PEER_NAME]: config?.connection?.host ?? utils.extractHostFromConnectionString(connectionString), + [attributes.NET_PEER_PORT]: config?.connection?.port ?? utils.extractPortFromConnectionString(connectionString), + [attributes.NET_TRANSPORT]: config?.connection?.filename === ":memory:" ? "inproc" : void 0, + [attributes.DB_STATEMENT]: utils.limitLength(query?.sql, MAX_QUERY_LENGTH) + }; + const parentSpan = this.builder[parentSpanSymbol] || core.getActiveSpan(); + const args = arguments; + return core.startSpan( + { + name: utils.getName(name, operation, table), + kind: core.SPAN_KIND.CLIENT, + attributes: attributes$1, + parentSpan, + onlyIfParent: true + }, + (span) => ( + // `Runner.query` returns a real, already-executing Promise, so it is safe to let + // `startSpan` await it and auto-end the span. + original.apply(this, args).catch((err) => { + const formatter = utils.getFormatter(this); + const fullQuery = formatter(query.sql, query.bindings || []); + const message = err.message.replace(`${fullQuery} - `, ""); + span.setStatus({ code: core.SPAN_STATUS_ERROR, message }); + throw err; + }) + ) + ); + }; + }; + } + _storeContext(original) { + return function wrapped_logging_method() { + const builder = original.apply(this, arguments); + Object.defineProperty(builder, parentSpanSymbol, { + value: core.getActiveSpan() + }); + return builder; + }; + } + _ensureWrapped(obj, methodName, wrapper) { + if (instrumentation.isWrapped(obj[methodName])) { + this._unwrap(obj, methodName); + } + this._wrap(obj, methodName, wrapper); + } +} + +exports.KnexInstrumentation = KnexInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 18192: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_DB_SQL_TABLE = "db.sql.table"; +const DB_SYSTEM_NAME_VALUE_SQLITE = "sqlite"; +const DB_SYSTEM_NAME_VALUE_POSTGRESQL = "postgresql"; + +exports.ATTR_DB_SQL_TABLE = ATTR_DB_SQL_TABLE; +exports.DB_SYSTEM_NAME_VALUE_POSTGRESQL = DB_SYSTEM_NAME_VALUE_POSTGRESQL; +exports.DB_SYSTEM_NAME_VALUE_SQLITE = DB_SYSTEM_NAME_VALUE_SQLITE; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 56132: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const semconv = __nccwpck_require__(18192); + +const getFormatter = (runner) => { + if (runner) { + if (runner.client) { + if (runner.client._formatQuery) { + return runner.client._formatQuery.bind(runner.client); + } else if (runner.client.SqlString) { + return runner.client.SqlString.format.bind(runner.client.SqlString); + } + } + if (runner.builder) { + return runner.builder.toString.bind(runner.builder); + } + } + return () => ""; +}; +const systemMap = /* @__PURE__ */ new Map([ + ["sqlite3", semconv.DB_SYSTEM_NAME_VALUE_SQLITE], + ["pg", semconv.DB_SYSTEM_NAME_VALUE_POSTGRESQL] +]); +const mapSystem = (knexSystem) => { + return systemMap.get(knexSystem) || knexSystem; +}; +const getName = (db, operation, table) => { + if (operation) { + if (table) { + return `${operation} ${db}.${table}`; + } + return `${operation} ${db}`; + } + return db; +}; +const limitLength = (str, maxLength) => { + if (typeof str === "string" && typeof maxLength === "number" && 0 < maxLength && maxLength < str.length) { + return `${str.substring(0, maxLength)}..`; + } + return str; +}; +const extractDatabaseFromConnectionString = (connectionString) => { + if (!connectionString) return void 0; + try { + const db = new URL(connectionString).pathname?.replace(/^\//, ""); + return db || void 0; + } catch { + return void 0; + } +}; +const extractHostFromConnectionString = (connectionString) => { + if (!connectionString) return void 0; + try { + return new URL(connectionString).hostname || void 0; + } catch { + return void 0; + } +}; +const extractPortFromConnectionString = (connectionString) => { + if (!connectionString) return void 0; + try { + const port = new URL(connectionString).port; + return port ? parseInt(port, 10) : void 0; + } catch { + return void 0; + } +}; +const extractTableName = (builder) => { + const table = builder?._single?.table; + if (typeof table === "object") { + return extractTableName(table); + } + return table; +}; + +exports.extractDatabaseFromConnectionString = extractDatabaseFromConnectionString; +exports.extractHostFromConnectionString = extractHostFromConnectionString; +exports.extractPortFromConnectionString = extractPortFromConnectionString; +exports.extractTableName = extractTableName; +exports.getFormatter = getFormatter; +exports.getName = getName; +exports.limitLength = limitLength; +exports.mapSystem = mapSystem; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 88562: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(22064); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "Koa"; +const instrumentKoa = nodeCore.generateInstrumentOnce( + INTEGRATION_NAME, + instrumentation.KoaInstrumentation, + (options = {}) => { + return { + ignoreLayersType: options.ignoreLayersType + }; + } +); +const _koaIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentKoa(options); + } + }; +}); +const koaIntegration = core.defineIntegration(_koaIntegration); +const setupKoaErrorHandler = (app) => { + app.use(async (ctx, next) => { + try { + await next(); + } catch (error) { + core.captureException(error, { + mechanism: { + handled: false, + type: "auto.middleware.koa" + } + }); + throw error; + } + }); + nodeCore.ensureIsWrapped(app.use, "koa"); +}; + +exports.instrumentKoa = instrumentKoa; +exports.koaIntegration = koaIntegration; +exports.setupKoaErrorHandler = setupKoaErrorHandler; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 96378: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => { + AttributeNames2["KOA_TYPE"] = "koa.type"; + AttributeNames2["KOA_NAME"] = "koa.name"; + return AttributeNames2; +})(AttributeNames || {}); + +exports.AttributeNames = AttributeNames; +//# sourceMappingURL=AttributeNames.js.map + + +/***/ }), + +/***/ 22064: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const instrumentation = __nccwpck_require__(65584); +const types = __nccwpck_require__(36051); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const utils = __nccwpck_require__(7959); +const setHttpServerSpanRouteAttribute = __nccwpck_require__(63790); +const debugBuild = __nccwpck_require__(8421); +const AttributeNames = __nccwpck_require__(96378); +const internalTypes = __nccwpck_require__(10771); + +const PACKAGE_NAME = "@sentry/instrumentation-koa"; +class KoaInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return new instrumentation.InstrumentationNodeModuleDefinition( + "koa", + [">=2.0.0 <4"], + (module) => { + const moduleExports = module[Symbol.toStringTag] === "Module" ? module.default : module; + if (moduleExports == null) { + return moduleExports; + } + if (instrumentation.isWrapped(moduleExports.prototype.use)) { + this._unwrap(moduleExports.prototype, "use"); + } + this._wrap(moduleExports.prototype, "use", this._getKoaUsePatch.bind(this)); + return module; + }, + (module) => { + const moduleExports = module[Symbol.toStringTag] === "Module" ? module.default : module; + if (moduleExports && instrumentation.isWrapped(moduleExports.prototype.use)) { + this._unwrap(moduleExports.prototype, "use"); + } + } + ); + } + /** + * Patches the Koa.use function in order to instrument each original + * middleware layer which is introduced + * @param {KoaMiddleware} middleware - the original middleware function + */ + _getKoaUsePatch(original) { + const patchRouterDispatch = this._patchRouterDispatch.bind(this); + const patchLayer = this._patchLayer.bind(this); + return function use(middlewareFunction) { + const patchedFunction = middlewareFunction.router ? patchRouterDispatch(middlewareFunction) : patchLayer(middlewareFunction, false); + return original.apply(this, [patchedFunction]); + }; + } + /** + * Patches the dispatch function used by @koa/router. This function + * goes through each routed middleware and adds instrumentation via a call + * to the @function _patchLayer function. + * @param {KoaMiddleware} dispatchLayer - the original dispatch function which dispatches + * routed middleware + */ + _patchRouterDispatch(dispatchLayer) { + const router = dispatchLayer.router; + const routesStack = router?.stack ?? []; + for (const pathLayer of routesStack) { + const path = pathLayer.path; + const pathStack = pathLayer.stack; + for (let j = 0; j < pathStack.length; j++) { + const routedMiddleware = pathStack[j]; + pathStack[j] = this._patchLayer(routedMiddleware, true, path); + } + } + return dispatchLayer; + } + /** + * Patches each individual @param middlewareLayer function in order to create the + * span and propagate context. It does not create spans when there is no parent span. + * @param {KoaMiddleware} middlewareLayer - the original middleware function. + * @param {boolean} isRouter - tracks whether the original middleware function + * was dispatched by the router originally + * @param {string?} layerPath - if present, provides additional data from the + * router about the routed path which the middleware is attached to + */ + _patchLayer(middlewareLayer, isRouter, layerPath) { + const layerType = isRouter ? types.KoaLayerType.ROUTER : types.KoaLayerType.MIDDLEWARE; + if (middlewareLayer[internalTypes.kLayerPatched] === true || utils.isLayerIgnored(layerType, this.getConfig())) return middlewareLayer; + if (middlewareLayer.constructor.name === "GeneratorFunction" || middlewareLayer.constructor.name === "AsyncGeneratorFunction") { + return middlewareLayer; + } + middlewareLayer[internalTypes.kLayerPatched] = true; + return (context, next) => { + const parent = api.trace.getSpan(api.context.active()); + if (parent === void 0) { + return middlewareLayer(context, next); + } + const metadata = utils.getMiddlewareMetadata(context, middlewareLayer, isRouter, layerPath); + if (context._matchedRoute) { + setHttpServerSpanRouteAttribute.setHttpServerSpanRouteAttribute(context._matchedRoute.toString()); + } + const koaName = metadata.attributes[AttributeNames.AttributeNames.KOA_NAME]; + const name = typeof koaName === "string" ? koaName || "< unknown >" : metadata.name; + return core.startSpan( + { + name, + op: `${layerType}.koa`, + attributes: { + ...metadata.attributes, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.koa" + } + }, + () => { + const route = metadata.attributes[attributes.HTTP_ROUTE]; + if (core.getIsolationScope() === core.getDefaultIsolationScope()) { + debugBuild.DEBUG_BUILD && core.debug.warn("Isolation scope is default isolation scope - skipping setting transactionName"); + } else if (route) { + const method = context.request?.method?.toUpperCase() || "GET"; + core.getIsolationScope().setTransactionName(`${method} ${route}`); + } + return middlewareLayer(context, next); + } + ); + }; + } +} + +exports.KoaInstrumentation = KoaInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 10771: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const kLayerPatched = /* @__PURE__ */ Symbol("koa-layer-patched"); + +exports.kLayerPatched = kLayerPatched; +//# sourceMappingURL=internal-types.js.map + + +/***/ }), + +/***/ 36051: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var KoaLayerType = /* @__PURE__ */ ((KoaLayerType2) => { + KoaLayerType2["ROUTER"] = "router"; + KoaLayerType2["MIDDLEWARE"] = "middleware"; + return KoaLayerType2; +})(KoaLayerType || {}); + +exports.KoaLayerType = KoaLayerType; +//# sourceMappingURL=types.js.map + + +/***/ }), + +/***/ 7959: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const types = __nccwpck_require__(36051); +const AttributeNames = __nccwpck_require__(96378); +const attributes = __nccwpck_require__(88264); + +const getMiddlewareMetadata = (context, layer, isRouter, layerPath) => { + if (isRouter) { + return { + attributes: { + [AttributeNames.AttributeNames.KOA_NAME]: layerPath?.toString(), + // TODO(v11): remove, replaced by http.route + [AttributeNames.AttributeNames.KOA_TYPE]: types.KoaLayerType.ROUTER, + [attributes.HTTP_ROUTE]: layerPath?.toString() + }, + name: context._matchedRouteName || `router - ${layerPath}` + }; + } else { + return { + attributes: { + [AttributeNames.AttributeNames.KOA_NAME]: layer.name ?? "middleware", + // TODO(v11): remove, replaced by code.function.name + [AttributeNames.AttributeNames.KOA_TYPE]: types.KoaLayerType.MIDDLEWARE, + [attributes.CODE_FUNCTION_NAME]: layer.name ?? "middleware" + }, + name: `middleware - ${layer.name}` + }; + } +}; +const isLayerIgnored = (type, config) => { + return !!(Array.isArray(config?.ignoreLayersType) && config?.ignoreLayersType?.includes(type)); +}; + +exports.getMiddlewareMetadata = getMiddlewareMetadata; +exports.isLayerIgnored = isLayerIgnored; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 63467: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const instrumentation = __nccwpck_require__(18906); + +const instrumentLangChain = nodeCore.generateInstrumentOnce( + core.LANGCHAIN_INTEGRATION_NAME, + (options) => new instrumentation.SentryLangChainInstrumentation(options) +); +const _langChainIntegration = ((options = {}) => { + return { + name: core.LANGCHAIN_INTEGRATION_NAME, + setupOnce() { + instrumentLangChain(options); + } + }; +}); +const langChainIntegration = core.defineIntegration(_langChainIntegration); + +exports.instrumentLangChain = instrumentLangChain; +exports.langChainIntegration = langChainIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 18906: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const core = __nccwpck_require__(84466); + +const supportedVersions = [">=0.1.0 <2.0.0"]; +function wrapRunnableMethod(originalMethod, sentryHandler, _methodName) { + return new Proxy(originalMethod, { + apply(target, thisArg, args) { + const optionsIndex = 1; + let options = args[optionsIndex]; + if (!options || typeof options !== "object" || Array.isArray(options)) { + options = {}; + args[optionsIndex] = options; + } + options.callbacks = core._INTERNAL_mergeLangChainCallbackHandler(options.callbacks, sentryHandler); + return Reflect.apply(target, thisArg, args); + } + }); +} +class SentryLangChainInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("@sentry/instrumentation-langchain", core.SDK_VERSION, config); + } + /** + * Initializes the instrumentation by defining the modules to be patched. + * We patch the BaseChatModel class methods to inject callbacks + * + * We hook into provider packages (@langchain/anthropic, @langchain/openai, etc.) + * because @langchain/core is often bundled and not loaded as a separate module + */ + init() { + const modules = []; + const providerPackages = [ + "@langchain/anthropic", + "@langchain/openai", + "@langchain/google-genai", + "@langchain/mistralai", + "@langchain/google-vertexai", + "@langchain/groq" + ]; + for (const packageName of providerPackages) { + modules.push( + new instrumentation.InstrumentationNodeModuleDefinition( + packageName, + supportedVersions, + this._patch.bind(this), + (exports) => exports, + [ + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + `${packageName}/dist/index.cjs`, + supportedVersions, + this._patch.bind(this), + (exports) => exports + ) + ] + ) + ); + } + modules.push( + new instrumentation.InstrumentationNodeModuleDefinition( + "langchain", + supportedVersions, + this._patch.bind(this), + (exports) => exports, + [ + // To catch the CJS build that contains ConfigurableModel / initChatModel for v1 + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "langchain/dist/chat_models/universal.cjs", + supportedVersions, + this._patch.bind(this), + (exports) => exports + ) + ] + ) + ); + return modules; + } + /** + * Core patch logic - patches chat model and embedding methods + * This is called when a LangChain provider package is loaded + */ + _patch(exports) { + core._INTERNAL_skipAiProviderWrapping([ + core.OPENAI_INTEGRATION_NAME, + core.ANTHROPIC_AI_INTEGRATION_NAME, + core.GOOGLE_GENAI_INTEGRATION_NAME + ]); + const config = this.getConfig(); + const sentryHandler = core.createLangChainCallbackHandler(config); + this._patchRunnableMethods(exports, sentryHandler); + this._patchEmbeddingsMethods(exports, config); + return exports; + } + /** + * Patches chat model methods (invoke, stream, batch) to inject Sentry callbacks + * Finds a chat model class from the provider package exports and patches its prototype methods + */ + _patchRunnableMethods(exports, sentryHandler) { + const knownChatModelNames = [ + "ChatAnthropic", + "ChatOpenAI", + "ChatGoogleGenerativeAI", + "ChatMistralAI", + "ChatVertexAI", + "ChatGroq", + "ConfigurableModel" + ]; + const exportsToPatch = exports.universal_exports ?? exports; + const chatModelClass = Object.values(exportsToPatch).find((exp) => { + return typeof exp === "function" && knownChatModelNames.includes(exp.name); + }); + if (!chatModelClass) { + return; + } + const targetProto = chatModelClass.prototype; + if (targetProto.__sentry_patched__) { + return; + } + targetProto.__sentry_patched__ = true; + const methodsToPatch = ["invoke", "stream", "batch"]; + for (const methodName of methodsToPatch) { + const method = targetProto[methodName]; + if (typeof method === "function") { + targetProto[methodName] = wrapRunnableMethod( + method, + sentryHandler); + } + } + } + /** + * Patches embedding class methods (embedQuery, embedDocuments) to create Sentry spans. + * + * Unlike chat models which use LangChain's callback system, the Embeddings base class + * has no callback support. We wrap the methods directly on the prototype. + * + * Instruments any exported class whose prototype has both embedQuery and embedDocuments as functions. + */ + _patchEmbeddingsMethods(exports, options) { + const exportsToPatch = exports.universal_exports ?? exports; + for (const exp of Object.values(exportsToPatch)) { + if (typeof exp !== "function" || !exp.prototype) { + continue; + } + const proto = exp.prototype; + if (typeof proto.embedQuery !== "function" || typeof proto.embedDocuments !== "function") { + continue; + } + if (proto.__sentry_patched__) { + continue; + } + proto.__sentry_patched__ = true; + core.instrumentLangChainEmbeddings(proto, options); + } + } +} + +exports.SentryLangChainInstrumentation = SentryLangChainInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 61016: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const instrumentation = __nccwpck_require__(39315); + +const instrumentLangGraph = nodeCore.generateInstrumentOnce( + core.LANGGRAPH_INTEGRATION_NAME, + (options) => new instrumentation.SentryLangGraphInstrumentation(options) +); +const _langGraphIntegration = ((options = {}) => { + return { + name: core.LANGGRAPH_INTEGRATION_NAME, + setupOnce() { + instrumentLangGraph(options); + } + }; +}); +const langGraphIntegration = core.defineIntegration(_langGraphIntegration); + +exports.instrumentLangGraph = instrumentLangGraph; +exports.langGraphIntegration = langGraphIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 39315: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const core = __nccwpck_require__(84466); + +const supportedVersions = [">=0.0.0 <2.0.0"]; +class SentryLangGraphInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("@sentry/instrumentation-langgraph", core.SDK_VERSION, config); + } + /** + * Initializes the instrumentation by defining the modules to be patched. + */ + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + "@langchain/langgraph", + supportedVersions, + this._patch.bind(this), + (exports) => exports, + [ + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + /** + * In CJS, LangGraph packages re-export from dist/index.cjs files. + * Patching only the root module sometimes misses the real implementation or + * gets overwritten when that file is loaded. We add a file-level patch so that + * _patch runs again on the concrete implementation + */ + "@langchain/langgraph/dist/index.cjs", + supportedVersions, + this._patch.bind(this), + (exports) => exports + ), + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + /** + * In CJS, the prebuilt submodule re-exports from dist/prebuilt/index.cjs. + * We add a file-level patch under the main module so that CJS require() + * of @langchain/langgraph/prebuilt gets patched. + */ + "@langchain/langgraph/dist/prebuilt/index.cjs", + supportedVersions, + this._patch.bind(this), + (exports) => exports + ) + ] + ), + new instrumentation.InstrumentationNodeModuleDefinition( + "@langchain/langgraph/prebuilt", + supportedVersions, + this._patch.bind(this), + (exports) => exports, + [ + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + /** + * In CJS, the prebuilt submodule re-exports from dist/prebuilt/index.cjs. + * We add file-level patches so _patch runs on the concrete implementation. + */ + "@langchain/langgraph/dist/prebuilt/index.cjs", + supportedVersions, + this._patch.bind(this), + (exports) => exports + ) + ] + ) + ]; + } + /** + * Core patch logic applying instrumentation to the LangGraph module. + */ + _patch(exports) { + const client = core.getClient(); + const genAI = client?.getDataCollectionOptions().genAI; + const options = { + ...this.getConfig(), + recordInputs: this.getConfig().recordInputs ?? genAI?.inputs ?? false, + recordOutputs: this.getConfig().recordOutputs ?? genAI?.outputs ?? false + }; + if (exports.StateGraph && typeof exports.StateGraph === "function") { + core.instrumentStateGraph(exports.StateGraph.prototype, options); + } + if (exports.createReactAgent && typeof exports.createReactAgent === "function") { + const originalCreateReactAgent = exports.createReactAgent; + Object.defineProperty(exports, "createReactAgent", { + value: core.instrumentCreateReactAgent(originalCreateReactAgent, options), + writable: true, + enumerable: true, + configurable: true + }); + } + return exports; + } +} + +exports.SentryLangGraphInstrumentation = SentryLangGraphInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 33555: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(97612); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "LruMemoizer"; +const instrumentLruMemoizer = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.LruMemoizerInstrumentation()); +const _lruMemoizerIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentLruMemoizer(); + } + }; +}); +const lruMemoizerIntegration = core.defineIntegration(_lruMemoizerIntegration); + +exports.instrumentLruMemoizer = instrumentLruMemoizer; +exports.lruMemoizerIntegration = lruMemoizerIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 97612: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); + +const PACKAGE_NAME = "@sentry/instrumentation-lru-memoizer"; +class LruMemoizerInstrumentation extends instrumentation.InstrumentationBase { + constructor() { + super(PACKAGE_NAME, core.SDK_VERSION, {}); + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + "lru-memoizer", + [">=1.3 <4"], + (moduleExports) => { + const asyncMemoizer = function(...args) { + const origMemoizer = moduleExports.apply(this, args); + return function(...memoizerArgs) { + const origCallback = memoizerArgs.pop(); + const scope = core.getCurrentScope(); + const callbackWithContext = typeof origCallback === "function" ? function(...callbackArgs) { + return core.withScope(scope, () => origCallback.apply(this, callbackArgs)); + } : origCallback; + return origMemoizer.apply(this, [...memoizerArgs, callbackWithContext]); + }; + }; + return Object.assign(asyncMemoizer, { sync: moduleExports.sync }); + }, + void 0 + // no need to disable as this instrumentation does not create any spans + ) + ]; + } +} + +exports.LruMemoizerInstrumentation = LruMemoizerInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 17574: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(69223); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "Mongo"; +const instrumentMongo = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.MongoDBInstrumentation()); +const _mongoIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentMongo(); + } + }; +}); +const mongoIntegration = core.defineIntegration(_mongoIntegration); + +exports.instrumentMongo = instrumentMongo; +exports.mongoIntegration = mongoIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 69223: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const patches = __nccwpck_require__(92681); + +const PACKAGE_NAME = "@sentry/instrumentation-mongodb"; +class MongoDBInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + const { v3PatchConnection, v3UnpatchConnection } = this._getV3ConnectionPatches(); + const { v4PatchConnectionCallback, v4PatchConnectionPromise, v4UnpatchConnection } = this._getV4ConnectionPatches(); + const { v4PatchConnectionPool, v4UnpatchConnectionPool } = this._getV4ConnectionPoolPatches(); + return [ + new instrumentation.InstrumentationNodeModuleDefinition("mongodb", [">=3.3.0 <4"], void 0, void 0, [ + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "mongodb/lib/core/wireprotocol/index.js", + [">=3.3.0 <4"], + v3PatchConnection, + v3UnpatchConnection + ) + ]), + new instrumentation.InstrumentationNodeModuleDefinition("mongodb", [">=4.0.0 <8"], void 0, void 0, [ + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "mongodb/lib/cmap/connection.js", + [">=4.0.0 <6.4"], + v4PatchConnectionCallback, + v4UnpatchConnection + ), + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "mongodb/lib/cmap/connection.js", + [">=6.4.0 <8"], + v4PatchConnectionPromise, + v4UnpatchConnection + ), + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "mongodb/lib/cmap/connection_pool.js", + [">=4.0.0 <6.4"], + v4PatchConnectionPool, + v4UnpatchConnectionPool + ) + ]) + ]; + } + _getV3ConnectionPatches() { + return { + v3PatchConnection: (moduleExports) => { + if (instrumentation.isWrapped(moduleExports.insert)) { + this._unwrap(moduleExports, "insert"); + } + this._wrap(moduleExports, "insert", patches.getV3PatchOperation("insert")); + if (instrumentation.isWrapped(moduleExports.remove)) { + this._unwrap(moduleExports, "remove"); + } + this._wrap(moduleExports, "remove", patches.getV3PatchOperation("remove")); + if (instrumentation.isWrapped(moduleExports.update)) { + this._unwrap(moduleExports, "update"); + } + this._wrap(moduleExports, "update", patches.getV3PatchOperation("update")); + if (instrumentation.isWrapped(moduleExports.command)) { + this._unwrap(moduleExports, "command"); + } + this._wrap(moduleExports, "command", patches.getV3PatchCommand()); + if (instrumentation.isWrapped(moduleExports.query)) { + this._unwrap(moduleExports, "query"); + } + this._wrap(moduleExports, "query", patches.getV3PatchFind()); + if (instrumentation.isWrapped(moduleExports.getMore)) { + this._unwrap(moduleExports, "getMore"); + } + this._wrap(moduleExports, "getMore", patches.getV3PatchCursor()); + return moduleExports; + }, + v3UnpatchConnection: (moduleExports) => { + if (moduleExports === void 0) return; + this._unwrap(moduleExports, "insert"); + this._unwrap(moduleExports, "remove"); + this._unwrap(moduleExports, "update"); + this._unwrap(moduleExports, "command"); + this._unwrap(moduleExports, "query"); + this._unwrap(moduleExports, "getMore"); + } + }; + } + _getV4ConnectionPoolPatches() { + return { + v4PatchConnectionPool: (moduleExports) => { + const poolPrototype = moduleExports.ConnectionPool.prototype; + if (instrumentation.isWrapped(poolPrototype.checkOut)) { + this._unwrap(poolPrototype, "checkOut"); + } + this._wrap(poolPrototype, "checkOut", patches.getV4ConnectionPoolCheckOut()); + return moduleExports; + }, + v4UnpatchConnectionPool: (moduleExports) => { + if (moduleExports === void 0) return; + this._unwrap(moduleExports.ConnectionPool.prototype, "checkOut"); + } + }; + } + _getV4ConnectionPatches() { + return { + v4PatchConnectionCallback: (moduleExports) => { + if (instrumentation.isWrapped(moduleExports.Connection.prototype.command)) { + this._unwrap(moduleExports.Connection.prototype, "command"); + } + this._wrap(moduleExports.Connection.prototype, "command", patches.getV4PatchCommandCallback()); + return moduleExports; + }, + v4PatchConnectionPromise: (moduleExports) => { + if (instrumentation.isWrapped(moduleExports.Connection.prototype.command)) { + this._unwrap(moduleExports.Connection.prototype, "command"); + } + this._wrap(moduleExports.Connection.prototype, "command", patches.getV4PatchCommandPromise()); + return moduleExports; + }, + v4UnpatchConnection: (moduleExports) => { + if (moduleExports === void 0) return; + this._unwrap(moduleExports.Connection.prototype, "command"); + } + }; + } +} + +exports.MongoDBInstrumentation = MongoDBInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 92681: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const utils = __nccwpck_require__(51018); +const serverUtils = __nccwpck_require__(93362); + +function getV3PatchOperation(operationName) { + return (original) => { + return function patchedServerCommand(server, ns, ops, options, callback) { + const resultHandler = typeof options === "function" ? options : callback; + if (utils.shouldSkipInstrumentation() || typeof resultHandler !== "function" || typeof ops !== "object") { + if (typeof options === "function") { + return original.call(this, server, ns, ops, options); + } else { + return original.call(this, server, ns, ops, options, callback); + } + } + const span = serverUtils.startMongoSpan(utils.getV3SpanAttributes(ns, server, ops[0], operationName)); + const patchedCallback = utils.patchEnd(span, resultHandler); + if (typeof options === "function") { + return original.call(this, server, ns, ops, patchedCallback); + } else { + return original.call(this, server, ns, ops, options, patchedCallback); + } + }; + }; +} +function getV3PatchCommand() { + return (original) => { + return function patchedServerCommand(server, ns, cmd, options, callback) { + const resultHandler = typeof options === "function" ? options : callback; + if (utils.shouldSkipInstrumentation() || typeof resultHandler !== "function" || typeof cmd !== "object") { + if (typeof options === "function") { + return original.call(this, server, ns, cmd, options); + } else { + return original.call(this, server, ns, cmd, options, callback); + } + } + const operationName = serverUtils.getV3CommandOperation(cmd); + const span = serverUtils.startMongoSpan(utils.getV3SpanAttributes(ns, server, cmd, operationName)); + const patchedCallback = utils.patchEnd(span, resultHandler); + if (typeof options === "function") { + return original.call(this, server, ns, cmd, patchedCallback); + } else { + return original.call(this, server, ns, cmd, options, patchedCallback); + } + }; + }; +} +function getV4PatchCommandCallback() { + return (original) => { + return function patchedV4ServerCommand(ns, cmd, options, callback) { + const resultHandler = callback; + const commandType = Object.keys(cmd)[0]; + if (typeof cmd !== "object" || cmd.ismaster || cmd.hello) { + return original.call(this, ns, cmd, options, callback); + } + let span = void 0; + if (!utils.shouldSkipInstrumentation()) { + span = serverUtils.startMongoSpan(utils.getV4SpanAttributes(this, ns, cmd, commandType)); + } + const patchedCallback = utils.patchEnd(span, resultHandler); + return original.call(this, ns, cmd, options, patchedCallback); + }; + }; +} +function getV4PatchCommandPromise() { + return (original) => { + return function patchedV4ServerCommand(...args) { + const [ns, cmd] = args; + const commandType = Object.keys(cmd)[0]; + const resultHandler = () => void 0; + if (typeof cmd !== "object" || cmd.ismaster || cmd.hello) { + return original.apply(this, args); + } + let span = void 0; + if (!utils.shouldSkipInstrumentation()) { + span = serverUtils.startMongoSpan(utils.getV4SpanAttributes(this, ns, cmd, commandType)); + } + const patchedCallback = utils.patchEnd(span, resultHandler); + const result = original.apply(this, args); + result.then( + (res) => patchedCallback(null, res), + (err) => patchedCallback(err) + ); + return result; + }; + }; +} +function getV3PatchFind() { + return (original) => { + return function patchedServerCommand(server, ns, cmd, cursorState, options, callback) { + const resultHandler = typeof options === "function" ? options : callback; + if (utils.shouldSkipInstrumentation() || typeof resultHandler !== "function" || typeof cmd !== "object") { + if (typeof options === "function") { + return original.call(this, server, ns, cmd, cursorState, options); + } else { + return original.call(this, server, ns, cmd, cursorState, options, callback); + } + } + const span = serverUtils.startMongoSpan(utils.getV3SpanAttributes(ns, server, cmd, "find")); + const patchedCallback = utils.patchEnd(span, resultHandler); + if (typeof options === "function") { + return original.call(this, server, ns, cmd, cursorState, patchedCallback); + } else { + return original.call(this, server, ns, cmd, cursorState, options, patchedCallback); + } + }; + }; +} +function getV3PatchCursor() { + return (original) => { + return function patchedServerCommand(server, ns, cursorState, batchSize, options, callback) { + const resultHandler = typeof options === "function" ? options : callback; + if (utils.shouldSkipInstrumentation() || typeof resultHandler !== "function") { + if (typeof options === "function") { + return original.call(this, server, ns, cursorState, batchSize, options); + } else { + return original.call(this, server, ns, cursorState, batchSize, options, callback); + } + } + const span = serverUtils.startMongoSpan(utils.getV3SpanAttributes(ns, server, cursorState.cmd, "getMore")); + const patchedCallback = utils.patchEnd(span, resultHandler); + if (typeof options === "function") { + return original.call(this, server, ns, cursorState, batchSize, patchedCallback); + } else { + return original.call(this, server, ns, cursorState, batchSize, options, patchedCallback); + } + }; + }; +} +function getV4ConnectionPoolCheckOut() { + return (original) => { + return function patchedCheckout(callback) { + const parentSpan = core.getActiveSpan(); + return original.call(this, function(...args) { + return core.withActiveSpan(parentSpan ?? null, () => callback.apply(this, args)); + }); + }; + }; +} + +exports.getV3PatchCommand = getV3PatchCommand; +exports.getV3PatchCursor = getV3PatchCursor; +exports.getV3PatchFind = getV3PatchFind; +exports.getV3PatchOperation = getV3PatchOperation; +exports.getV4ConnectionPoolCheckOut = getV4ConnectionPoolCheckOut; +exports.getV4PatchCommandCallback = getV4PatchCommandCallback; +exports.getV4PatchCommandPromise = getV4PatchCommandPromise; +//# sourceMappingURL=patches.js.map + + +/***/ }), + +/***/ 51018: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const serverUtils = __nccwpck_require__(93362); + +const ORIGIN = "auto.db.otel.mongo"; +function getV4SpanAttributes(connectionCtx, ns, command, operation) { + return serverUtils.getV4SpanAttributes(connectionCtx, ns, command, operation, ORIGIN); +} +function getV3SpanAttributes(ns, topology, command, operation) { + return serverUtils.getV3SpanAttributes(ns, topology, command, operation, ORIGIN); +} +function patchEnd(span, resultHandler) { + const parentSpan = core.getActiveSpan(); + let spanEnded = false; + return function patchedEnd(...args) { + if (!spanEnded) { + spanEnded = true; + const error = args[0]; + if (span) { + if (error instanceof Error) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: error.message }); + } + span.end(); + } + } + return core.withActiveSpan(parentSpan ?? null, () => resultHandler.apply(this, args)); + }; +} +function shouldSkipInstrumentation() { + return !core.getActiveSpan(); +} + +exports.getV3CommandOperation = serverUtils.getV3CommandOperation; +exports.startMongoSpan = serverUtils.startMongoSpan; +exports.getV3SpanAttributes = getV3SpanAttributes; +exports.getV4SpanAttributes = getV4SpanAttributes; +exports.patchEnd = patchEnd; +exports.shouldSkipInstrumentation = shouldSkipInstrumentation; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 68850: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const mongoose = __nccwpck_require__(92648); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const serverUtils = __nccwpck_require__(93362); + +const INTEGRATION_NAME = "Mongoose"; +const instrumentMongoose = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new mongoose.MongooseInstrumentation()); +const _mongooseIntegration = (() => { + return core.extendIntegration(serverUtils.mongooseIntegration(), { + name: INTEGRATION_NAME, + setupOnce() { + instrumentMongoose(); + } + }); +}); +const mongooseIntegration = core.defineIntegration(_mongooseIntegration); + +exports.instrumentMongoose = instrumentMongoose; +exports.mongooseIntegration = mongooseIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 92648: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const serverUtils = __nccwpck_require__(93362); +const utils = __nccwpck_require__(41571); + +const PACKAGE_NAME = "@sentry/instrumentation-mongoose"; +const ORIGIN = "auto.db.otel.mongoose"; +const contextCaptureFunctionsCommon = [ + "deleteOne", + "deleteMany", + "find", + "findOne", + "estimatedDocumentCount", + "countDocuments", + "distinct", + "where", + "$where", + "findOneAndUpdate", + "findOneAndDelete", + "findOneAndReplace" +]; +const contextCaptureFunctions6 = ["remove", "count", "findOneAndRemove", ...contextCaptureFunctionsCommon]; +const contextCaptureFunctions7 = ["count", "findOneAndRemove", ...contextCaptureFunctionsCommon]; +const contextCaptureFunctions8 = [...contextCaptureFunctionsCommon]; +function getContextCaptureFunctions(moduleVersion) { + if (!moduleVersion) { + return contextCaptureFunctionsCommon; + } else if (moduleVersion.startsWith("6.") || moduleVersion.startsWith("5.")) { + return contextCaptureFunctions6; + } else if (moduleVersion.startsWith("7.")) { + return contextCaptureFunctions7; + } else { + return contextCaptureFunctions8; + } +} +function instrumentRemove(moduleVersion) { + return moduleVersion && (moduleVersion.startsWith("5.") || moduleVersion.startsWith("6.")) || false; +} +function needsDocumentMethodPatch(moduleVersion) { + if (!moduleVersion || !moduleVersion.startsWith("8.")) { + return false; + } + const minor = parseInt(moduleVersion.split(".")[1], 10); + return minor >= 21; +} +const _STORED_PARENT_SPAN = /* @__PURE__ */ Symbol("stored-parent-span"); +const _ALREADY_INSTRUMENTED = /* @__PURE__ */ Symbol("already-instrumented"); +class MongooseInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition( + "mongoose", + // mongoose >= 9.7.0 publishes via diagnostics_channel and is instrumented by + // `subscribeMongooseDiagnosticChannels` instead, so this IITM patcher must not + // overlap it — otherwise every operation would emit two mongoose spans. + [">=5.9.7 <9.7.0"], + this.patch.bind(this), + this.unpatch.bind(this) + ); + return module; + } + patch(module, moduleVersion) { + const moduleExports = module[Symbol.toStringTag] === "Module" && module.default ? module.default : module; + this._wrap(moduleExports.Model.prototype, "save", this.patchOnModelMethods("save")); + moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save; + if (instrumentRemove(moduleVersion)) { + this._wrap(moduleExports.Model.prototype, "remove", this.patchOnModelMethods("remove")); + } + if (needsDocumentMethodPatch(moduleVersion)) { + this._wrap(moduleExports.Model.prototype, "updateOne", this._patchDocumentUpdateMethods("updateOne")); + this._wrap(moduleExports.Model.prototype, "deleteOne", this._patchDocumentUpdateMethods("deleteOne")); + } + this._wrap(moduleExports.Query.prototype, "exec", this.patchQueryExec()); + this._wrap(moduleExports.Aggregate.prototype, "exec", this.patchAggregateExec()); + const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion); + contextCaptureFunctions.forEach((funcName) => { + this._wrap(moduleExports.Query.prototype, funcName, this.patchAndCaptureSpanContext(funcName)); + }); + this._wrap(moduleExports.Model, "aggregate", this.patchModelAggregate()); + this._wrap(moduleExports.Model, "insertMany", this.patchModelStatic("insertMany")); + this._wrap(moduleExports.Model, "bulkWrite", this.patchModelStatic("bulkWrite")); + return moduleExports; + } + unpatch(module, moduleVersion) { + const moduleExports = module[Symbol.toStringTag] === "Module" && module.default ? module.default : module; + const contextCaptureFunctions = getContextCaptureFunctions(moduleVersion); + this._unwrap(moduleExports.Model.prototype, "save"); + moduleExports.Model.prototype.$save = moduleExports.Model.prototype.save; + if (instrumentRemove(moduleVersion)) { + this._unwrap(moduleExports.Model.prototype, "remove"); + } + if (needsDocumentMethodPatch(moduleVersion)) { + this._unwrap(moduleExports.Model.prototype, "updateOne"); + this._unwrap(moduleExports.Model.prototype, "deleteOne"); + } + this._unwrap(moduleExports.Query.prototype, "exec"); + this._unwrap(moduleExports.Aggregate.prototype, "exec"); + contextCaptureFunctions.forEach((funcName) => { + this._unwrap(moduleExports.Query.prototype, funcName); + }); + this._unwrap(moduleExports.Model, "aggregate"); + this._unwrap(moduleExports.Model, "insertMany"); + this._unwrap(moduleExports.Model, "bulkWrite"); + } + patchAggregateExec() { + const self = this; + return (originalAggregate) => { + return function exec(callback) { + const parentSpan = this[_STORED_PARENT_SPAN]; + const span = serverUtils.startMongooseLegacySpan({ + collection: this._model.collection, + modelName: this._model?.modelName, + operation: "aggregate", + origin: ORIGIN, + parentSpan + }); + return self._handleResponse(span, originalAggregate, this, arguments, callback); + }; + }; + } + patchQueryExec() { + const self = this; + return (originalExec) => { + return function exec(callback) { + if (this[_ALREADY_INSTRUMENTED]) { + return originalExec.apply(this, arguments); + } + const parentSpan = this[_STORED_PARENT_SPAN]; + const span = serverUtils.startMongooseLegacySpan({ + collection: this.mongooseCollection, + modelName: this.model.modelName, + operation: this.op, + origin: ORIGIN, + parentSpan + }); + return self._handleResponse(span, originalExec, this, arguments, callback); + }; + }; + } + patchOnModelMethods(op) { + const self = this; + return (originalOnModelFunction) => { + return function method(options, callback) { + const span = serverUtils.startMongooseLegacySpan({ + collection: this.constructor.collection, + modelName: this.constructor.modelName, + operation: op, + origin: ORIGIN + }); + if (options instanceof Function) { + callback = options; + } + return self._handleResponse(span, originalOnModelFunction, this, arguments, callback); + }; + }; + } + // Patch document instance methods (doc.updateOne/deleteOne) for Mongoose 8.21.0+. + _patchDocumentUpdateMethods(op) { + const self = this; + return (originalMethod) => { + return function method(update, options, callback) { + let actualCallback = callback; + if (typeof update === "function") { + actualCallback = update; + } else if (typeof options === "function") { + actualCallback = options; + } + const span = serverUtils.startMongooseLegacySpan({ + collection: this.constructor.collection, + modelName: this.constructor.modelName, + operation: op, + origin: ORIGIN + }); + const result = self._handleResponse(span, originalMethod, this, arguments, actualCallback); + if (result && typeof result === "object") { + result[_ALREADY_INSTRUMENTED] = true; + } + return result; + }; + }; + } + patchModelStatic(op) { + const self = this; + return (original) => { + return function patchedStatic(docsOrOps, options, callback) { + if (typeof options === "function") { + callback = options; + } + const span = serverUtils.startMongooseLegacySpan({ + collection: this.collection, + modelName: this.modelName, + operation: op, + origin: ORIGIN + }); + return self._handleResponse(span, original, this, arguments, callback); + }; + }; + } + // we want to capture the otel span on the object which is calling exec. + // in the special case of aggregate, we need have no function to path + // on the Aggregate object to capture the context on, so we patch + // the aggregate of Model, and set the context on the Aggregate object + patchModelAggregate() { + return (original) => { + return function captureSpanContext() { + const currentSpan = core.getActiveSpan(); + const aggregate = original.apply(this, arguments); + if (aggregate) aggregate[_STORED_PARENT_SPAN] = currentSpan; + return aggregate; + }; + }; + } + patchAndCaptureSpanContext(_funcName) { + return (original) => { + return function captureSpanContext() { + this[_STORED_PARENT_SPAN] = core.getActiveSpan(); + return original.apply(this, arguments); + }; + }; + } + _handleResponse(span, exec, originalThis, args, callback) { + return core.withActiveSpan(span, () => { + if (callback instanceof Function) { + return utils.handleCallbackResponse(callback, exec, originalThis, span, args); + } else { + const response = exec.apply(originalThis, args); + return utils.handlePromiseResponse(response, span); + } + }); + } +} + +exports.MongooseInstrumentation = MongooseInstrumentation; +exports._ALREADY_INSTRUMENTED = _ALREADY_INSTRUMENTED; +exports._STORED_PARENT_SPAN = _STORED_PARENT_SPAN; +//# sourceMappingURL=mongoose.js.map + + +/***/ }), + +/***/ 41571: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +function setErrorStatus(span, error) { + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: `${error.message} ${error.code ? ` +Mongoose Error Code: ${error.code}` : ""}` + }); +} +function handlePromiseResponse(execResponse, span) { + if (!(execResponse instanceof Promise)) { + span.end(); + return execResponse; + } + return execResponse.catch((err) => { + setErrorStatus(span, err); + throw err; + }).finally(() => span.end()); +} +function handleCallbackResponse(callback, exec, originalThis, span, args) { + let callbackArgumentIndex = 0; + if (args.length === 2) { + callbackArgumentIndex = 1; + } else if (args.length === 3) { + callbackArgumentIndex = 2; + } + args[callbackArgumentIndex] = (err, response) => { + if (err) { + setErrorStatus(span, err); + } + span.end(); + return callback(err, response); + }; + return exec.apply(originalThis, args); +} + +exports.handleCallbackResponse = handleCallbackResponse; +exports.handlePromiseResponse = handlePromiseResponse; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 61697: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(76752); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "Mysql"; +const instrumentMysql = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.MySQLInstrumentation({})); +const _mysqlIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentMysql(); + } + }; +}); +const mysqlIntegration = core.defineIntegration(_mysqlIntegration); + +exports.instrumentMysql = instrumentMysql; +exports.mysqlIntegration = mysqlIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 76752: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const semconv = __nccwpck_require__(40328); +const utils = __nccwpck_require__(37631); + +const PACKAGE_NAME = "@sentry/instrumentation-mysql"; +const ORIGIN = "auto.db.otel.mysql"; +class MySQLInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + "mysql", + [">=2.0.0 <3"], + (moduleExports) => { + if (instrumentation.isWrapped(moduleExports.createConnection)) { + this._unwrap(moduleExports, "createConnection"); + } + this._wrap(moduleExports, "createConnection", this._patchCreateConnection()); + if (instrumentation.isWrapped(moduleExports.createPool)) { + this._unwrap(moduleExports, "createPool"); + } + this._wrap(moduleExports, "createPool", this._patchCreatePool()); + if (instrumentation.isWrapped(moduleExports.createPoolCluster)) { + this._unwrap(moduleExports, "createPoolCluster"); + } + this._wrap(moduleExports, "createPoolCluster", this._patchCreatePoolCluster()); + return moduleExports; + }, + (moduleExports) => { + if (moduleExports === void 0) return; + this._unwrap(moduleExports, "createConnection"); + this._unwrap(moduleExports, "createPool"); + this._unwrap(moduleExports, "createPoolCluster"); + } + ) + ]; + } + // global export function + _patchCreateConnection() { + return (originalCreateConnection) => { + const thisPlugin = this; + return function createConnection(_connectionUri) { + const originalResult = originalCreateConnection(...arguments); + thisPlugin._wrap(originalResult, "query", thisPlugin._patchQuery(originalResult)); + return originalResult; + }; + }; + } + // global export function + _patchCreatePool() { + return (originalCreatePool) => { + const thisPlugin = this; + return function createPool(_config) { + const pool = originalCreatePool(...arguments); + thisPlugin._wrap(pool, "query", thisPlugin._patchQuery(pool)); + thisPlugin._wrap(pool, "getConnection", thisPlugin._patchGetConnection(pool)); + return pool; + }; + }; + } + // global export function + _patchCreatePoolCluster() { + return (originalCreatePoolCluster) => { + const thisPlugin = this; + return function createPool(_config) { + const cluster = originalCreatePoolCluster(...arguments); + thisPlugin._wrap(cluster, "getConnection", thisPlugin._patchGetConnection(cluster)); + return cluster; + }; + }; + } + // method on cluster or pool + _patchGetConnection(pool) { + return (originalGetConnection) => { + const thisPlugin = this; + return function getConnection(arg1, arg2, arg3) { + if (!thisPlugin["_enabled"]) { + thisPlugin._unwrap(pool, "getConnection"); + return originalGetConnection.apply(pool, arguments); + } + if (arguments.length === 1 && typeof arg1 === "function") { + const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg1); + return originalGetConnection.call(pool, patchFn); + } + if (arguments.length === 2 && typeof arg2 === "function") { + const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg2); + return originalGetConnection.call(pool, arg1, patchFn); + } + if (arguments.length === 3 && typeof arg3 === "function") { + const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg3); + return originalGetConnection.call(pool, arg1, arg2, patchFn); + } + return originalGetConnection.apply(pool, arguments); + }; + }; + } + _getConnectionCallbackPatchFn(cb) { + const thisPlugin = this; + const scope = core.getCurrentScope(); + return function(err, connection) { + if (connection) { + if (!instrumentation.isWrapped(connection.query)) { + thisPlugin._wrap(connection, "query", thisPlugin._patchQuery(connection)); + } + } + if (typeof cb === "function") { + core.withScope(scope, () => cb.call(this, err, connection)); + } + }; + } + _patchQuery(connection) { + return (originalQuery) => { + const thisPlugin = this; + return function query(query, _valuesOrCallback, _callback) { + if (!thisPlugin["_enabled"]) { + thisPlugin._unwrap(connection, "query"); + return originalQuery.apply(connection, arguments); + } + const { host, port, database, user } = utils.getConfig(connection.config); + const portNumber = parseInt(String(port), 10); + const attributes$1 = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_MYSQL, + [semconv.ATTR_DB_CONNECTION_STRING]: utils.getJDBCString(host, port, database), + [attributes.DB_NAME]: database, + [attributes.DB_USER]: user, + [attributes.DB_STATEMENT]: utils.getDbQueryText(query), + [attributes.NET_PEER_NAME]: host + }; + if (!isNaN(portNumber)) { + attributes$1[attributes.NET_PEER_PORT] = portNumber; + } + const span = core.startInactiveSpan({ + name: utils.getSpanName(query), + kind: core.SPAN_KIND.CLIENT, + attributes: attributes$1 + }); + const cbIndex = Array.from(arguments).findIndex((arg) => typeof arg === "function"); + const scope = core.getCurrentScope(); + if (cbIndex === -1) { + const streamableQuery = core.withActiveSpan(span, () => { + return originalQuery.apply(connection, arguments); + }); + core.bindScopeToEmitter(streamableQuery, scope); + return streamableQuery.on("error", (err) => { + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: err.message + }); + }).on("end", () => { + span.end(); + }); + } else { + thisPlugin._wrap(arguments, cbIndex, thisPlugin._patchCallbackQuery(span, scope)); + return core.withActiveSpan(span, () => { + return originalQuery.apply(connection, arguments); + }); + } + }; + }; + } + _patchCallbackQuery(span, scope) { + return (originalCallback) => { + return function(err, _results, _fields) { + if (err) { + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: err.message + }); + } + span.end(); + return core.withScope(scope, () => originalCallback(...arguments)); + }; + }; + } +} + +exports.MySQLInstrumentation = MySQLInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 40328: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +const DB_SYSTEM_VALUE_MYSQL = "mysql"; + +exports.ATTR_DB_CONNECTION_STRING = ATTR_DB_CONNECTION_STRING; +exports.DB_SYSTEM_VALUE_MYSQL = DB_SYSTEM_VALUE_MYSQL; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 37631: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function getConfig(config) { + const resolved = config?.connectionConfig || config || {}; + const { host, port, database, user } = resolved; + return { host, port, database, user }; +} +function getJDBCString(host, port, database) { + let jdbcString = `jdbc:mysql://${host || "localhost"}`; + if (typeof port === "number") { + jdbcString += `:${port}`; + } + if (typeof database === "string") { + jdbcString += `/${database}`; + } + return jdbcString; +} +function getDbQueryText(query) { + if (typeof query === "string") { + return query; + } else { + return query.sql; + } +} +function getSpanName(query) { + const rawQuery = typeof query === "object" ? query.sql : query; + const firstSpace = rawQuery?.indexOf(" "); + if (typeof firstSpace === "number" && firstSpace !== -1) { + return rawQuery?.substring(0, firstSpace); + } + return rawQuery; +} + +exports.getConfig = getConfig; +exports.getDbQueryText = getDbQueryText; +exports.getJDBCString = getJDBCString; +exports.getSpanName = getSpanName; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 62188: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(81456); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const serverUtils = __nccwpck_require__(93362); + +const INTEGRATION_NAME = "Mysql2"; +const instrumentMysql2 = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.MySQL2Instrumentation()); +const _mysql2Integration = (() => { + return core.extendIntegration(serverUtils.mysql2Integration(), { + name: INTEGRATION_NAME, + setupOnce() { + instrumentMysql2(); + } + }); +}); +const mysql2Integration = core.defineIntegration(_mysql2Integration); + +exports.instrumentMysql2 = instrumentMysql2; +exports.mysql2Integration = mysql2Integration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 81456: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const semconv = __nccwpck_require__(93689); +const utils = __nccwpck_require__(40114); + +const PACKAGE_NAME = "@sentry/instrumentation-mysql2"; +const ORIGIN = "auto.db.otel.mysql2"; +const supportedVersions = [">=1.4.2 <3.20.0"]; +class MySQL2Instrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + let format; + function setFormatFunction(moduleExports) { + if (!format && moduleExports.format) { + format = moduleExports.format; + } + } + const patch = (ConnectionPrototype) => { + if (instrumentation.isWrapped(ConnectionPrototype.query)) { + this._unwrap(ConnectionPrototype, "query"); + } + this._wrap(ConnectionPrototype, "query", this._patchQuery(format)); + if (instrumentation.isWrapped(ConnectionPrototype.execute)) { + this._unwrap(ConnectionPrototype, "execute"); + } + this._wrap(ConnectionPrototype, "execute", this._patchQuery(format)); + }; + const unpatch = (ConnectionPrototype) => { + this._unwrap(ConnectionPrototype, "query"); + this._unwrap(ConnectionPrototype, "execute"); + }; + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + "mysql2", + supportedVersions, + (moduleExports) => { + setFormatFunction(moduleExports); + return moduleExports; + }, + () => { + }, + [ + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "mysql2/promise.js", + supportedVersions, + (moduleExports) => { + setFormatFunction(moduleExports); + return moduleExports; + }, + () => { + } + ), + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "mysql2/lib/connection.js", + supportedVersions, + (moduleExports) => { + const ConnectionPrototype = utils.getConnectionPrototypeToInstrument(moduleExports); + patch(ConnectionPrototype); + return moduleExports; + }, + (moduleExports) => { + if (moduleExports === void 0) return; + const ConnectionPrototype = utils.getConnectionPrototypeToInstrument(moduleExports); + unpatch(ConnectionPrototype); + } + ) + ] + ) + ]; + } + _patchQuery(format) { + const thisPlugin = this; + return (originalQuery) => { + return function query(query, _valuesOrCallback, _callback) { + let values; + if (Array.isArray(_valuesOrCallback)) { + values = _valuesOrCallback; + } else if (arguments[2]) { + values = [_valuesOrCallback]; + } + const attributes$1 = { + ...utils.getConnectionAttributes(this.config), + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_MYSQL, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_STATEMENT]: utils.getQueryText(query, format, values), + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }; + const span = core.startInactiveSpan({ + name: utils.getSpanName(query), + kind: core.SPAN_KIND.CLIENT, + attributes: attributes$1 + }); + const endSpan = utils.once((err) => { + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message }); + } + span.end(); + }); + if (arguments.length === 1) { + if (typeof query.onResult === "function") { + thisPlugin._wrap(query, "onResult", thisPlugin._patchCallbackQuery(endSpan)); + } + const streamableQuery = originalQuery.apply(this, arguments); + streamableQuery.once("error", (err) => { + endSpan(err); + }).once("result", () => { + endSpan(); + }); + return streamableQuery; + } + if (typeof arguments[1] === "function") { + thisPlugin._wrap(arguments, 1, thisPlugin._patchCallbackQuery(endSpan)); + } else if (typeof arguments[2] === "function") { + thisPlugin._wrap(arguments, 2, thisPlugin._patchCallbackQuery(endSpan)); + } + return originalQuery.apply(this, arguments); + }; + }; + } + _patchCallbackQuery(endSpan) { + return (originalCallback) => { + return function(...args) { + endSpan(args[0]); + return originalCallback(...args); + }; + }; + } +} + +exports.MySQL2Instrumentation = MySQL2Instrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 93689: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +const DB_SYSTEM_VALUE_MYSQL = "mysql"; + +exports.ATTR_DB_CONNECTION_STRING = ATTR_DB_CONNECTION_STRING; +exports.DB_SYSTEM_VALUE_MYSQL = DB_SYSTEM_VALUE_MYSQL; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 40114: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const semconv = __nccwpck_require__(93689); + +function getConnectionAttributes(config) { + const { host, port, database, user } = getConfig(config); + const attrs = { + [semconv.ATTR_DB_CONNECTION_STRING]: getJDBCString(host, port, database), + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_NAME]: database, + [attributes.DB_USER]: user, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_NAME]: host + }; + const portNumber = parseInt(port, 10); + if (!isNaN(portNumber)) { + attrs[attributes.NET_PEER_PORT] = portNumber; + } + return attrs; +} +function getConfig(config) { + const { host, port, database, user } = config?.connectionConfig || config || {}; + return { host, port, database, user }; +} +function getJDBCString(host, port, database) { + let jdbcString = `jdbc:mysql://${host || "localhost"}`; + if (typeof port === "number") { + jdbcString += `:${port}`; + } + if (typeof database === "string") { + jdbcString += `/${database}`; + } + return jdbcString; +} +function getQueryText(query, format, values) { + const [querySql, queryValues] = typeof query === "string" ? [query, values] : [query.sql, hasValues(query) ? values || query.values : values]; + try { + if (format && queryValues) { + return format(querySql, queryValues); + } else { + return querySql; + } + } catch { + return "Could not determine the query due to an error in formatting"; + } +} +function hasValues(obj) { + return "values" in obj; +} +function getSpanName(query) { + const rawQuery = typeof query === "object" ? query.sql : query; + const firstSpace = rawQuery?.indexOf(" "); + if (typeof firstSpace === "number" && firstSpace !== -1) { + return rawQuery?.substring(0, firstSpace); + } + return rawQuery; +} +const once = (fn) => { + let called = false; + return (...args) => { + if (called) return; + called = true; + return fn(...args); + }; +}; +function getConnectionPrototypeToInstrument(connection) { + const connectionPrototype = connection.prototype; + const basePrototype = Object.getPrototypeOf(connectionPrototype); + if (typeof basePrototype?.query === "function" && typeof basePrototype?.execute === "function") { + return basePrototype; + } + return connectionPrototype; +} + +exports.getConnectionAttributes = getConnectionAttributes; +exports.getConnectionPrototypeToInstrument = getConnectionPrototypeToInstrument; +exports.getQueryText = getQueryText; +exports.getSpanName = getSpanName; +exports.once = once; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 33879: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const instrumentation = __nccwpck_require__(1685); + +const instrumentOpenAi = nodeCore.generateInstrumentOnce( + core.OPENAI_INTEGRATION_NAME, + (options) => new instrumentation.SentryOpenAiInstrumentation(options) +); +const _openAiIntegration = ((options = {}) => { + return { + name: core.OPENAI_INTEGRATION_NAME, + setupOnce() { + instrumentOpenAi(options); + } + }; +}); +const openAIIntegration = core.defineIntegration(_openAiIntegration); + +exports.instrumentOpenAi = instrumentOpenAi; +exports.openAIIntegration = openAIIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 1685: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); + +const supportedVersions = [">=4.0.0 <7"]; +class SentryOpenAiInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("@sentry/instrumentation-openai", core.SDK_VERSION, config); + } + /** + * Initializes the instrumentation by defining the modules to be patched. + */ + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition("openai", supportedVersions, this._patch.bind(this)); + return module; + } + /** + * Core patch logic applying instrumentation to the OpenAI and AzureOpenAI client constructors. + */ + _patch(exports) { + let result = exports; + result = this._patchClient(result, "OpenAI"); + result = this._patchClient(result, "AzureOpenAI"); + return result; + } + /** + * Patch logic applying instrumentation to the specified client constructor. + */ + _patchClient(exports, exportKey) { + const Original = exports[exportKey]; + if (!Original) { + return exports; + } + const config = this.getConfig(); + const WrappedOpenAI = function(...args) { + if (core._INTERNAL_shouldSkipAiProviderWrapping(core.OPENAI_INTEGRATION_NAME)) { + return Reflect.construct(Original, args); + } + const instance = Reflect.construct(Original, args); + return core.instrumentOpenAiClient(instance, config); + }; + Object.setPrototypeOf(WrappedOpenAI, Original); + Object.setPrototypeOf(WrappedOpenAI.prototype, Original.prototype); + for (const key of Object.getOwnPropertyNames(Original)) { + if (!["length", "name", "prototype"].includes(key)) { + const descriptor = Object.getOwnPropertyDescriptor(Original, key); + if (descriptor) { + Object.defineProperty(WrappedOpenAI, key, descriptor); + } + } + } + try { + exports[exportKey] = WrappedOpenAI; + } catch { + Object.defineProperty(exports, exportKey, { + value: WrappedOpenAI, + writable: true, + configurable: true, + enumerable: true + }); + } + if (exports.default === Original) { + try { + exports.default = WrappedOpenAI; + } catch { + Object.defineProperty(exports, "default", { + value: WrappedOpenAI, + writable: true, + configurable: true, + enumerable: true + }); + } + } + return exports; + } +} + +exports.SentryOpenAiInstrumentation = SentryOpenAiInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 73894: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(83031); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "Postgres"; +const instrumentPostgres = nodeCore.generateInstrumentOnce( + INTEGRATION_NAME, + instrumentation.PgInstrumentation, + (options) => ({ + ignoreConnectSpans: options?.ignoreConnectSpans ?? false + }) +); +const _postgresIntegration = ((options) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentPostgres(options); + } + }; +}); +const postgresIntegration = core.defineIntegration(_postgresIntegration); + +exports.instrumentPostgres = instrumentPostgres; +exports.postgresIntegration = postgresIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 41831: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => { + AttributeNames2["PG_PLAN"] = "db.postgresql.plan"; + AttributeNames2["IDLE_TIMEOUT_MILLIS"] = "db.postgresql.idle.timeout.millis"; + AttributeNames2["MAX_CLIENT"] = "db.postgresql.max.client"; + return AttributeNames2; +})(AttributeNames || {}); + +exports.AttributeNames = AttributeNames; +//# sourceMappingURL=AttributeNames.js.map + + +/***/ }), + +/***/ 71947: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +var SpanNames = /* @__PURE__ */ ((SpanNames2) => { + SpanNames2["QUERY_PREFIX"] = "pg.query"; + SpanNames2["CONNECT"] = "pg.connect"; + SpanNames2["POOL_CONNECT"] = "pg-pool.connect"; + return SpanNames2; +})(SpanNames || {}); + +exports.SpanNames = SpanNames; +//# sourceMappingURL=SpanNames.js.map + + +/***/ }), + +/***/ 83031: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const SpanNames = __nccwpck_require__(71947); +const utils = __nccwpck_require__(83467); + +const PACKAGE_NAME = "@sentry/instrumentation-pg"; +function extractModuleExports(module) { + return module[Symbol.toStringTag] === "Module" ? module.default : module; +} +function bindCallbackToSpan(parentSpan, callback) { + return function(...args) { + return core.withActiveSpan(parentSpan, () => callback.apply(this, args)); + }; +} +class PgInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + const SUPPORTED_PG_VERSIONS = [">=8.0.3 <9"]; + const SUPPORTED_PG_POOL_VERSIONS = [">=2.0.0 <4"]; + const modulePgNativeClient = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "pg/lib/native/client.js", + SUPPORTED_PG_VERSIONS, + this._patchPgClient.bind(this), + this._unpatchPgClient.bind(this) + ); + const modulePgClient = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + "pg/lib/client.js", + SUPPORTED_PG_VERSIONS, + this._patchPgClient.bind(this), + this._unpatchPgClient.bind(this) + ); + const modulePG = new instrumentation.InstrumentationNodeModuleDefinition( + "pg", + SUPPORTED_PG_VERSIONS, + (module) => { + const moduleExports = extractModuleExports(module); + this._patchPgClient(moduleExports.Client); + return module; + }, + (module) => { + const moduleExports = extractModuleExports(module); + this._unpatchPgClient(moduleExports.Client); + return module; + }, + [modulePgClient, modulePgNativeClient] + ); + const modulePGPool = new instrumentation.InstrumentationNodeModuleDefinition( + "pg-pool", + SUPPORTED_PG_POOL_VERSIONS, + (module) => { + const moduleExports = extractModuleExports(module); + if (instrumentation.isWrapped(moduleExports.prototype.connect)) { + this._unwrap(moduleExports.prototype, "connect"); + } + this._wrap(moduleExports.prototype, "connect", this._getPoolConnectPatch()); + return moduleExports; + }, + (module) => { + const moduleExports = extractModuleExports(module); + if (instrumentation.isWrapped(moduleExports.prototype.connect)) { + this._unwrap(moduleExports.prototype, "connect"); + } + } + ); + return [modulePG, modulePGPool]; + } + _patchPgClient(module) { + if (!module) { + return; + } + const moduleExports = extractModuleExports(module); + if (instrumentation.isWrapped(moduleExports.prototype.query)) { + this._unwrap(moduleExports.prototype, "query"); + } + if (instrumentation.isWrapped(moduleExports.prototype.connect)) { + this._unwrap(moduleExports.prototype, "connect"); + } + this._wrap(moduleExports.prototype, "query", this._getClientQueryPatch()); + this._wrap(moduleExports.prototype, "connect", this._getClientConnectPatch()); + return module; + } + _unpatchPgClient(module) { + const moduleExports = extractModuleExports(module); + if (instrumentation.isWrapped(moduleExports.prototype.query)) { + this._unwrap(moduleExports.prototype, "query"); + } + if (instrumentation.isWrapped(moduleExports.prototype.connect)) { + this._unwrap(moduleExports.prototype, "connect"); + } + return module; + } + _getClientConnectPatch() { + const plugin = this; + return (original) => { + return function connect(callback) { + if (utils.shouldSkipInstrumentation() || plugin.getConfig().ignoreConnectSpans) { + return original.call(this, callback); + } + const span = core.startInactiveSpan({ + name: SpanNames.SpanNames.CONNECT, + kind: core.SPAN_KIND.CLIENT, + attributes: utils.getSemanticAttributesFromConnection(this) + }); + let cb = callback; + if (cb) { + const parentSpan = core.getActiveSpan(); + cb = utils.patchClientConnectCallback(span, cb); + if (parentSpan) { + cb = bindCallbackToSpan(parentSpan, cb); + } + } + const connectResult = core.withActiveSpan(span, () => { + return original.call(this, cb); + }); + return handleConnectResult(span, connectResult); + }; + }; + } + _getClientQueryPatch() { + return (original) => { + this._diag.debug("Patching pg.Client.prototype.query"); + return function query(...args) { + if (utils.shouldSkipInstrumentation()) { + return original.apply(this, args); + } + const arg0 = args[0]; + const firstArgIsString = typeof arg0 === "string"; + const firstArgIsQueryObjectWithText = utils.isObjectWithTextString(arg0); + const queryConfig = firstArgIsString ? { + text: arg0, + values: Array.isArray(args[1]) ? args[1] : void 0 + } : firstArgIsQueryObjectWithText ? { + ...arg0, + name: arg0.name, + text: arg0.text, + values: arg0.values ?? (Array.isArray(args[1]) ? args[1] : void 0) + } : void 0; + const span = utils.handleConfigQuery.call(this, queryConfig); + if (args.length > 0) { + const parentSpan = core.getActiveSpan(); + if (typeof args[args.length - 1] === "function") { + args[args.length - 1] = utils.patchCallback(span, args[args.length - 1]); + if (parentSpan) { + args[args.length - 1] = bindCallbackToSpan(parentSpan, args[args.length - 1]); + } + } else if (typeof queryConfig?.callback === "function") { + let callback = utils.patchCallback(span, queryConfig.callback); + if (parentSpan) { + callback = bindCallbackToSpan(parentSpan, callback); + } + args[0].callback = callback; + } + } + let result; + try { + result = original.apply(this, args); + } catch (e) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: utils.getErrorMessage(e) }); + span.end(); + throw e; + } + if (result instanceof Promise) { + return result.then((result2) => { + span.end(); + return result2; + }).catch((error) => { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: utils.getErrorMessage(error) }); + span.end(); + return Promise.reject(error); + }); + } + return result; + }; + }; + } + _getPoolConnectPatch() { + const plugin = this; + return (originalConnect) => { + return function connect(callback) { + if (utils.shouldSkipInstrumentation() || plugin.getConfig().ignoreConnectSpans) { + return originalConnect.call(this, callback); + } + const span = core.startInactiveSpan({ + name: SpanNames.SpanNames.POOL_CONNECT, + kind: core.SPAN_KIND.CLIENT, + attributes: utils.getSemanticAttributesFromPoolConnection(this.options) + }); + let cb = callback; + if (cb) { + const parentSpan = core.getActiveSpan(); + cb = utils.patchCallbackPGPool(span, cb); + if (parentSpan) { + cb = bindCallbackToSpan(parentSpan, cb); + } + } + const connectResult = core.withActiveSpan(span, () => { + return originalConnect.call(this, cb); + }); + return handleConnectResult(span, connectResult); + }; + }; + } +} +function handleConnectResult(span, connectResult) { + if (!(connectResult instanceof Promise)) { + return connectResult; + } + const connectResultPromise = connectResult; + return connectResultPromise.then((result) => { + span.end(); + return result; + }).catch((error) => { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: utils.getErrorMessage(error) }); + span.end(); + return Promise.reject(error); + }); +} + +exports.PgInstrumentation = PgInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 85435: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +const DB_SYSTEM_VALUE_POSTGRESQL = "postgresql"; + +exports.ATTR_DB_CONNECTION_STRING = ATTR_DB_CONNECTION_STRING; +exports.DB_SYSTEM_VALUE_POSTGRESQL = DB_SYSTEM_VALUE_POSTGRESQL; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 83467: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const AttributeNames = __nccwpck_require__(41831); +const SpanNames = __nccwpck_require__(71947); +const semconv = __nccwpck_require__(85435); +const attributes = __nccwpck_require__(88264); + +const ORIGIN = "auto.db.otel.postgres"; +function getQuerySpanName(dbName, queryConfig) { + if (!queryConfig) return SpanNames.SpanNames.QUERY_PREFIX; + const command = typeof queryConfig.name === "string" && queryConfig.name ? queryConfig.name : parseNormalizedOperationName(queryConfig.text); + return `${SpanNames.SpanNames.QUERY_PREFIX}:${command}${dbName ? ` ${dbName}` : ""}`; +} +function parseNormalizedOperationName(queryText) { + const trimmedQuery = queryText.trim(); + const indexOfFirstSpace = trimmedQuery.indexOf(" "); + let sqlCommand = indexOfFirstSpace === -1 ? trimmedQuery : trimmedQuery.slice(0, indexOfFirstSpace); + sqlCommand = sqlCommand.toUpperCase(); + return sqlCommand.endsWith(";") ? sqlCommand.slice(0, -1) : sqlCommand; +} +function parseAndMaskConnectionString(connectionString) { + try { + const url = new URL(connectionString); + url.username = ""; + url.password = ""; + return url.toString(); + } catch { + return "postgresql://localhost:5432/"; + } +} +function getConnectionString(params) { + if ("connectionString" in params && params.connectionString) { + return parseAndMaskConnectionString(params.connectionString); + } + const host = params.host || "localhost"; + const port = params.port || 5432; + const database = params.database || ""; + return `postgresql://${host}:${port}/${database}`; +} +function getPort(port) { + if (Number.isInteger(port)) { + return port; + } + return void 0; +} +function getSemanticAttributesFromConnection(params) { + return { + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_POSTGRESQL, + [attributes.DB_NAME]: params.database, + [semconv.ATTR_DB_CONNECTION_STRING]: getConnectionString(params), + [attributes.DB_USER]: params.user, + [attributes.NET_PEER_NAME]: params.host, + // required + [attributes.NET_PEER_PORT]: getPort(params.port) + }; +} +function getSemanticAttributesFromPoolConnection(params) { + let url; + try { + url = params.connectionString ? new URL(params.connectionString) : void 0; + } catch { + url = void 0; + } + return { + [AttributeNames.AttributeNames.IDLE_TIMEOUT_MILLIS]: params.idleTimeoutMillis, + [AttributeNames.AttributeNames.MAX_CLIENT]: params.maxClient, + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_POSTGRESQL, + [attributes.DB_NAME]: url?.pathname.slice(1) ?? params.database, + [semconv.ATTR_DB_CONNECTION_STRING]: getConnectionString(params), + [attributes.NET_PEER_NAME]: url?.hostname ?? params.host, + [attributes.NET_PEER_PORT]: Number(url?.port) || getPort(params.port), + [attributes.DB_USER]: url?.username ?? params.user + }; +} +function shouldSkipInstrumentation() { + return core.getActiveSpan() === void 0; +} +function handleConfigQuery(queryConfig) { + const { connectionParameters } = this; + const dbName = connectionParameters.database; + const spanName = getQuerySpanName(dbName, queryConfig); + const span = core.startInactiveSpan({ + name: spanName, + kind: core.SPAN_KIND.CLIENT, + attributes: { + ...getSemanticAttributesFromConnection(connectionParameters), + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + } + }); + if (!queryConfig) { + return span; + } + if (queryConfig.text) { + span.setAttribute(attributes.DB_STATEMENT, queryConfig.text); + } + if (typeof queryConfig.name === "string") { + span.setAttribute(AttributeNames.AttributeNames.PG_PLAN, queryConfig.name); + } + return span; +} +function patchCallback(span, cb) { + return function patchedCallback(err, res) { + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message }); + } + span.end(); + cb.call(this, err, res); + }; +} +function patchCallbackPGPool(span, cb) { + return function patchedCallback(err, res, done) { + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message }); + } + span.end(); + cb.call(this, err, res, done); + }; +} +function patchClientConnectCallback(span, cb) { + return function patchedClientConnectCallback(...args) { + const err = args[0]; + if (err instanceof Error) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message }); + } + span.end(); + cb.apply(this, args); + }; +} +function getErrorMessage(e) { + return typeof e === "object" && e !== null && "message" in e ? String(e.message) : void 0; +} +function isObjectWithTextString(it) { + return typeof it === "object" && typeof it?.text === "string"; +} + +exports.ORIGIN = ORIGIN; +exports.getConnectionString = getConnectionString; +exports.getErrorMessage = getErrorMessage; +exports.getQuerySpanName = getQuerySpanName; +exports.getSemanticAttributesFromConnection = getSemanticAttributesFromConnection; +exports.getSemanticAttributesFromPoolConnection = getSemanticAttributesFromPoolConnection; +exports.handleConfigQuery = handleConfigQuery; +exports.isObjectWithTextString = isObjectWithTextString; +exports.parseAndMaskConnectionString = parseAndMaskConnectionString; +exports.parseNormalizedOperationName = parseNormalizedOperationName; +exports.patchCallback = patchCallback; +exports.patchCallbackPGPool = patchCallbackPGPool; +exports.patchClientConnectCallback = patchClientConnectCallback; +exports.shouldSkipInstrumentation = shouldSkipInstrumentation; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 28739: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const instrumentation = __nccwpck_require__(65584); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const debugBuild = __nccwpck_require__(8421); + +const INTEGRATION_NAME = "PostgresJs"; +const SUPPORTED_VERSIONS = [">=3.0.0 <4"]; +const ATTR_DB_RESPONSE_STATUS_CODE = "db.response.status_code"; +const SQL_OPERATION_REGEX = /^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i; +const QUERY_FROM_INSTRUMENTED_SQL = /* @__PURE__ */ Symbol.for("sentry.query.from.instrumented.sql"); +const instrumentPostgresJs = nodeCore.generateInstrumentOnce( + INTEGRATION_NAME, + (options) => new PostgresJsInstrumentation({ + requireParentSpan: options?.requireParentSpan ?? true, + requestHook: options?.requestHook + }) +); +class PostgresJsInstrumentation extends instrumentation.InstrumentationBase { + constructor(config) { + super("sentry-postgres-js", core.SDK_VERSION, config); + } + /** + * Initializes the instrumentation by patching the postgres module. + * Uses two complementary approaches: + * 1. Main function wrapper: instruments sql instances created AFTER instrumentation is set up (CJS + ESM) + * 2. Query.prototype patch: fallback for sql instances created BEFORE instrumentation (CJS only) + */ + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition( + "postgres", + SUPPORTED_VERSIONS, + (exports) => { + try { + return this._patchPostgres(exports); + } catch (e) { + debugBuild.DEBUG_BUILD && core.debug.error("Failed to patch postgres module:", e); + return exports; + } + }, + (exports) => exports + ); + ["src", "cf/src", "cjs/src"].forEach((path) => { + module.files.push( + new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + `postgres/${path}/query.js`, + SUPPORTED_VERSIONS, + this._patchQueryPrototype.bind(this), + this._unpatchQueryPrototype.bind(this) + ) + ); + }); + return module; + } + /** + * Patches the postgres module by wrapping the main export function. + * This intercepts the creation of sql instances and instruments them. + */ + _patchPostgres(exports) { + const isFunction = typeof exports === "function"; + const Original = isFunction ? exports : exports.default; + if (typeof Original !== "function") { + debugBuild.DEBUG_BUILD && core.debug.warn("postgres module does not export a function. Skipping instrumentation."); + return exports; + } + const self = this; + const WrappedPostgres = function(...args) { + const sql = Reflect.construct(Original, args); + if (!sql || typeof sql !== "function") { + debugBuild.DEBUG_BUILD && core.debug.warn("postgres() did not return a valid instance"); + return sql; + } + const config = self.getConfig(); + return core.instrumentPostgresJsSql(sql, { + requireParentSpan: config.requireParentSpan, + requestHook: config.requestHook + }); + }; + Object.setPrototypeOf(WrappedPostgres, Original); + Object.setPrototypeOf(WrappedPostgres.prototype, Original.prototype); + for (const key of Object.getOwnPropertyNames(Original)) { + if (!["length", "name", "prototype"].includes(key)) { + const descriptor = Object.getOwnPropertyDescriptor(Original, key); + if (descriptor) { + Object.defineProperty(WrappedPostgres, key, descriptor); + } + } + } + if (isFunction) { + return WrappedPostgres; + } else { + core.replaceExports(exports, "default", WrappedPostgres); + return exports; + } + } + /** + * Determines whether a span should be created based on the current context. + * If `requireParentSpan` is set to true in the configuration, a span will + * only be created if there is a parent span available. + */ + _shouldCreateSpans() { + const config = this.getConfig(); + const hasParentSpan = api.trace.getSpan(api.context.active()) !== void 0; + return hasParentSpan || !config.requireParentSpan; + } + /** + * Extracts DB operation name from SQL query and sets it on the span. + */ + _setOperationName(span, sanitizedQuery, command) { + if (command) { + span.setAttribute(attributes.DB_OPERATION_NAME, command); + return; + } + const operationMatch = sanitizedQuery?.match(SQL_OPERATION_REGEX); + if (operationMatch?.[1]) { + span.setAttribute(attributes.DB_OPERATION_NAME, operationMatch[1].toUpperCase()); + } + } + /** + * Reconstructs the full SQL query from template strings with PostgreSQL placeholders. + * + * For sql`SELECT * FROM users WHERE id = ${123} AND name = ${'foo'}`: + * strings = ["SELECT * FROM users WHERE id = ", " AND name = ", ""] + * returns: "SELECT * FROM users WHERE id = $1 AND name = $2" + */ + _reconstructQuery(strings) { + if (!strings?.length) { + return void 0; + } + if (strings.length === 1) { + return strings[0] || void 0; + } + return strings.reduce((acc, str, i) => i === 0 ? str : `${acc}$${i}${str}`, ""); + } + /** + * Sanitize SQL query as per the OTEL semantic conventions + * https://opentelemetry.io/docs/specs/semconv/database/database-spans/#sanitization-of-dbquerytext + * + * PostgreSQL $n placeholders are preserved per OTEL spec - they're parameterized queries, + * not sensitive literals. Only actual values (strings, numbers, booleans) are sanitized. + */ + _sanitizeSqlQuery(sqlQuery) { + if (!sqlQuery) { + return "Unknown SQL Query"; + } + return sqlQuery.replace(/--.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/;\s*$/, "").replace(/\s+/g, " ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi, "?").replace(/\bB'[01]*'/gi, "?").replace(/'(?:[^']|'')*'/g, "?").replace(/\b0x[0-9A-Fa-f]+/gi, "?").replace(/\b(?:TRUE|FALSE)\b/gi, "?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g, "?").replace(/-?\b\d+\.\d+\b/g, "?").replace(/-?\.\d+\b/g, "?").replace(/(? { + nodeCore.addOriginToSpan(span, "auto.db.postgresjs"); + span.setAttributes({ + [attributes.DB_SYSTEM_NAME]: "postgres", + [attributes.DB_QUERY_TEXT]: sanitizedSqlQuery + }); + const config = self.getConfig(); + const { requestHook } = config; + if (requestHook) { + instrumentation.safeExecuteInTheMiddle( + () => requestHook(span, sanitizedSqlQuery, void 0), + (e) => { + if (e) { + span.setAttribute("sentry.hook.error", "requestHook failed"); + debugBuild.DEBUG_BUILD && core.debug.error(`Error in requestHook for ${INTEGRATION_NAME} integration:`, e); + } + }, + true + ); + } + const originalResolve = this.resolve; + this.resolve = new Proxy(originalResolve, { + apply: (resolveTarget, resolveThisArg, resolveArgs) => { + try { + self._setOperationName(span, sanitizedSqlQuery, resolveArgs?.[0]?.command); + span.end(); + } catch (e) { + debugBuild.DEBUG_BUILD && core.debug.error("Error ending span in resolve callback:", e); + } + return Reflect.apply(resolveTarget, resolveThisArg, resolveArgs); + } + }); + const originalReject = this.reject; + this.reject = new Proxy(originalReject, { + apply: (rejectTarget, rejectThisArg, rejectArgs) => { + try { + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: rejectArgs?.[0]?.message || "unknown_error" + }); + span.setAttribute(ATTR_DB_RESPONSE_STATUS_CODE, rejectArgs?.[0]?.code || "unknown"); + span.setAttribute(attributes.ERROR_TYPE, rejectArgs?.[0]?.name || "unknown"); + self._setOperationName(span, sanitizedSqlQuery); + span.end(); + } catch (e) { + debugBuild.DEBUG_BUILD && core.debug.error("Error ending span in reject callback:", e); + } + return Reflect.apply(rejectTarget, rejectThisArg, rejectArgs); + } + }); + try { + return originalHandle.apply(this, args); + } catch (e) { + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: e instanceof Error ? e.message : "unknown_error" + }); + span.end(); + throw e; + } + } + ); + }; + moduleExports.Query.prototype.handle.__sentry_original__ = originalHandle; + return moduleExports; + } + /** + * Restores the original Query.prototype.handle method. + */ + _unpatchQueryPrototype(moduleExports) { + if (moduleExports.Query.prototype.handle.__sentry_original__) { + moduleExports.Query.prototype.handle = moduleExports.Query.prototype.handle.__sentry_original__; + } + return moduleExports; + } +} +const _postgresJsIntegration = ((options) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentPostgresJs(options); + } + }; +}); +const postgresJsIntegration = core.defineIntegration(_postgresJsIntegration); + +exports.PostgresJsInstrumentation = PostgresJsInstrumentation; +exports.instrumentPostgresJs = instrumentPostgresJs; +exports.postgresJsIntegration = postgresJsIntegration; +//# sourceMappingURL=postgresjs.js.map + + +/***/ }), + +/***/ 35701: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const redisCache = __nccwpck_require__(94795); + +exports._redisOptions = {}; +function setRedisOptions(options) { + exports._redisOptions = options; +} +const cacheResponseHook = (span, redisCommand, cmdArgs, response) => { + const safeKey = redisCache.getCacheKeySafely(redisCommand, cmdArgs); + const cacheOperation = redisCache.getCacheOperation(redisCommand); + if (!safeKey || !cacheOperation || !exports._redisOptions.cachePrefixes || !redisCache.shouldConsiderForCache(redisCommand, safeKey, exports._redisOptions.cachePrefixes)) { + return; + } + const spanData = core.spanToJSON(span).data; + const networkPeerAddress = spanData["net.peer.name"] ?? spanData["server.address"]; + const networkPeerPort = spanData["net.peer.port"] ?? spanData["server.port"]; + if (networkPeerPort && networkPeerAddress) { + span.setAttributes({ "network.peer.address": networkPeerAddress, "network.peer.port": networkPeerPort }); + } + const cacheItemSize = redisCache.isInCommands(redisCache.REMOVE_COMMANDS, redisCommand) ? void 0 : redisCache.calculateCacheItemSize(response); + if (cacheItemSize) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize); + } + if (redisCache.isInCommands(redisCache.GET_COMMANDS, redisCommand) && cacheItemSize !== void 0) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0); + } + span.setAttributes({ + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation, + [core.SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey + }); + const spanDescription = safeKey.join(", "); + span.updateName( + exports._redisOptions.maxCacheKeyLength ? core.truncate(spanDescription, exports._redisOptions.maxCacheKeyLength) : spanDescription + ); +}; + +exports.cacheResponseHook = cacheResponseHook; +exports.setRedisOptions = setRedisOptions; +//# sourceMappingURL=cache.js.map + + +/***/ }), + +/***/ 42045: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const dc = __nccwpck_require__(65714); +const serverUtils = __nccwpck_require__(93362); +const nodeCore = __nccwpck_require__(28648); +const diagnosticsChannelInjection = __nccwpck_require__(65678); +const cache = __nccwpck_require__(35701); +const ioredisInstrumentation = __nccwpck_require__(42834); +const redisInstrumentation = __nccwpck_require__(76918); + +const INTEGRATION_NAME = "Redis"; +const instrumentIORedis = nodeCore.generateInstrumentOnce(`${INTEGRATION_NAME}.IORedis`, () => { + return new ioredisInstrumentation.IORedisInstrumentation({ + responseHook: cache.cacheResponseHook + }); +}); +const instrumentRedisModule = nodeCore.generateInstrumentOnce(`${INTEGRATION_NAME}.Redis`, () => { + return new redisInstrumentation.RedisInstrumentation({ + responseHook: cache.cacheResponseHook + }); +}); +const instrumentRedis = Object.assign( + () => { + if (!diagnosticsChannelInjection.isDiagnosticsChannelInjectionEnabled() || !dc.tracingChannel) { + instrumentIORedis(); + instrumentRedisModule(); + } + }, + { id: INTEGRATION_NAME } +); +const _redisIntegration = ((options = {}) => { + return core.extendIntegration(serverUtils.redisIntegration({ responseHook: cache.cacheResponseHook }), { + name: INTEGRATION_NAME, + setupOnce() { + cache.setRedisOptions(options); + instrumentRedis(); + } + }); +}); +const redisIntegration = core.defineIntegration(_redisIntegration); + +Object.defineProperty(exports, "_redisOptions", ({ + enumerable: true, + get: () => cache._redisOptions +})); +exports.cacheResponseHook = cache.cacheResponseHook; +exports.instrumentRedis = instrumentRedis; +exports.redisIntegration = redisIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 42834: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const serverUtils = __nccwpck_require__(93362); +const semconv = __nccwpck_require__(82582); + +const PACKAGE_NAME = "@sentry/instrumentation-ioredis"; +const ORIGIN = "auto.db.otel.redis"; +const SUPPORTED_VERSIONS = [">=2.0.0 <5.11.0"]; +function endSpan(span, err) { + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message }); + } + span.end(); +} +class IORedisInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + "ioredis", + SUPPORTED_VERSIONS, + (module) => { + const moduleExports = module[Symbol.toStringTag] === "Module" && module.default ? module.default : module; + if (instrumentation.isWrapped(moduleExports.prototype.sendCommand)) { + this._unwrap(moduleExports.prototype, "sendCommand"); + } + this._wrap(moduleExports.prototype, "sendCommand", this._patchSendCommand()); + if (instrumentation.isWrapped(moduleExports.prototype.connect)) { + this._unwrap(moduleExports.prototype, "connect"); + } + this._wrap(moduleExports.prototype, "connect", this._patchConnection()); + return module; + }, + (module) => { + if (module === void 0) return; + const moduleExports = module[Symbol.toStringTag] === "Module" && module.default ? module.default : module; + this._unwrap(moduleExports.prototype, "sendCommand"); + this._unwrap(moduleExports.prototype, "connect"); + } + ) + ]; + } + _patchSendCommand() { + const instrumentation = this; + return (original) => { + return function(...args) { + const cmd = args[0]; + if (args.length < 1 || typeof cmd !== "object" || !core.getActiveSpan()) { + return original.apply(this, args); + } + const { host, port } = this.options; + const attributes$1 = { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_REDIS, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_STATEMENT]: serverUtils.defaultDbStatementSerializer(cmd.name, cmd.args), + [semconv.ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_NAME]: host, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_PORT]: port, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }; + const span = core.startInactiveSpan({ name: cmd.name, kind: core.SPAN_KIND.CLIENT, attributes: attributes$1 }); + try { + const result = original.apply(this, args); + const origResolve = cmd.resolve; + cmd.resolve = function(response) { + instrumentation._callResponseHook(span, cmd, response); + endSpan(span, null); + origResolve(response); + }; + const origReject = cmd.reject; + cmd.reject = function(err) { + endSpan(span, err); + origReject(err); + }; + return result; + } catch (error) { + endSpan(span, error); + throw error; + } + }; + }; + } + _patchConnection() { + return (original) => { + return function(...args) { + if (!core.getActiveSpan()) { + return original.apply(this, args); + } + const { host, port } = this.options; + const attributes$1 = { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_REDIS, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_STATEMENT]: "connect", + [semconv.ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_NAME]: host, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_PORT]: port, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }; + const span = core.startInactiveSpan({ name: "connect", kind: core.SPAN_KIND.CLIENT, attributes: attributes$1 }); + try { + const result = original.apply(this, args); + if (result instanceof Promise) { + return result.then( + (value) => { + endSpan(span, null); + return value; + }, + (error) => { + endSpan(span, error); + return Promise.reject(error); + } + ); + } + endSpan(span, null); + return result; + } catch (error) { + endSpan(span, error); + throw error; + } + }; + }; + } + _callResponseHook(span, cmd, response) { + const { responseHook } = this.getConfig(); + if (!responseHook) { + return; + } + try { + responseHook(span, cmd.name, cmd.args, response); + } catch { + } + } +} + +exports.IORedisInstrumentation = IORedisInstrumentation; +//# sourceMappingURL=ioredis-instrumentation.js.map + + +/***/ }), + +/***/ 76918: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const serverUtils = __nccwpck_require__(93362); +const debugBuild = __nccwpck_require__(8421); +const InstrumentationNodeModuleFile = __nccwpck_require__(43683); +const semconv = __nccwpck_require__(82582); + +const PACKAGE_NAME = "@sentry/instrumentation-redis"; +const ORIGIN = "auto.db.otel.redis"; +const OTEL_OPEN_SPANS = /* @__PURE__ */ Symbol("opentelemetry.instrumentation.redis.open_spans"); +const MULTI_COMMAND_OPTIONS = /* @__PURE__ */ Symbol("opentelemetry.instrumentation.redis.multi_command_options"); +function endSpan(span, err) { + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message }); + } + span.end(); +} +function runResponseHook(responseHook, span, commandName, commandArgs, response) { + if (!responseHook) { + return; + } + try { + responseHook(span, commandName, commandArgs, response); + } catch { + } +} +function removeCredentialsFromDBConnectionStringAttribute(url) { + if (typeof url !== "string" || !url) { + return void 0; + } + try { + const u = new URL(url); + u.searchParams.delete("user_pwd"); + u.username = ""; + u.password = ""; + return u.href; + } catch (err) { + debugBuild.DEBUG_BUILD && core.debug.error("failed to sanitize redis connection url", err); + } + return void 0; +} +function getClientAttributes(options) { + return { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_REDIS, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_NAME]: options?.socket?.host, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_PORT]: options?.socket?.port, + [semconv.ATTR_DB_CONNECTION_STRING]: removeCredentialsFromDBConnectionStringAttribute(options?.url), + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }; +} +const _RedisInstrumentationV2_V3 = class _RedisInstrumentationV2_V3 extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + "redis", + [">=2.6.0 <4"], + (moduleExports) => { + if (instrumentation.isWrapped(moduleExports.RedisClient.prototype["internal_send_command"])) { + this._unwrap(moduleExports.RedisClient.prototype, "internal_send_command"); + } + this._wrap(moduleExports.RedisClient.prototype, "internal_send_command", this._getPatchInternalSendCommand()); + return moduleExports; + }, + (moduleExports) => { + if (moduleExports === void 0) return; + this._unwrap(moduleExports.RedisClient.prototype, "internal_send_command"); + } + ) + ]; + } + _getPatchInternalSendCommand() { + const instrumentation = this; + return function internal_send_command(original) { + return function internal_send_command_trace(cmd) { + if (arguments.length !== 1 || typeof cmd !== "object") { + return original.apply(this, arguments); + } + const attributes$1 = { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_REDIS, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_STATEMENT]: serverUtils.defaultDbStatementSerializer(cmd.command, cmd.args), + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }; + if (this.connection_options) { + attributes$1[attributes.NET_PEER_NAME] = this.connection_options.host; + attributes$1[attributes.NET_PEER_PORT] = this.connection_options.port; + } + if (this.address) { + attributes$1[semconv.ATTR_DB_CONNECTION_STRING] = `redis://${this.address}`; + } + const span = core.startInactiveSpan({ + name: `${_RedisInstrumentationV2_V3.COMPONENT}-${cmd.command}`, + kind: core.SPAN_KIND.CLIENT, + attributes: attributes$1 + }); + const originalCallback = arguments[0].callback; + if (originalCallback) { + const parentSpan = core.getActiveSpan(); + arguments[0].callback = function callback(err, reply) { + runResponseHook(instrumentation.getConfig().responseHook, span, cmd.command, cmd.args, reply); + endSpan(span, err); + return core.withActiveSpan(parentSpan ?? null, () => originalCallback.apply(this, arguments)); + }; + } + try { + return original.apply(this, arguments); + } catch (rethrow) { + endSpan(span, rethrow); + throw rethrow; + } + }; + }; + } +}; +_RedisInstrumentationV2_V3.COMPONENT = "redis"; +let RedisInstrumentationV2_V3 = _RedisInstrumentationV2_V3; +const _RedisInstrumentationV4_V5 = class _RedisInstrumentationV4_V5 extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return [ + this._getInstrumentationNodeModuleDefinition("@redis/client"), + this._getInstrumentationNodeModuleDefinition("@node-redis/client") + ]; + } + _getInstrumentationNodeModuleDefinition(basePackageName) { + const commanderModuleFile = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + `${basePackageName}/dist/lib/commander.js`, + ["^1.0.0"], + (moduleExports, moduleVersion) => { + const transformCommandArguments = moduleExports.transformCommandArguments; + if (!transformCommandArguments) { + debugBuild.DEBUG_BUILD && core.debug.error("internal instrumentation error, missing transformCommandArguments function"); + return moduleExports; + } + const functionToPatch = moduleVersion?.startsWith("1.0.") ? "extendWithCommands" : "attachCommands"; + if (instrumentation.isWrapped(moduleExports?.[functionToPatch])) { + this._unwrap(moduleExports, functionToPatch); + } + this._wrap(moduleExports, functionToPatch, this._getPatchExtendWithCommands(transformCommandArguments)); + return moduleExports; + }, + (moduleExports) => { + if (instrumentation.isWrapped(moduleExports?.extendWithCommands)) { + this._unwrap(moduleExports, "extendWithCommands"); + } + if (instrumentation.isWrapped(moduleExports?.attachCommands)) { + this._unwrap(moduleExports, "attachCommands"); + } + } + ); + const multiCommanderModule = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + `${basePackageName}/dist/lib/client/multi-command.js`, + ["^1.0.0", ">=5.0.0 <5.12.0"], + (moduleExports) => { + const redisClientMultiCommandPrototype = moduleExports?.default?.prototype; + if (instrumentation.isWrapped(redisClientMultiCommandPrototype?.exec)) { + this._unwrap(redisClientMultiCommandPrototype, "exec"); + } + this._wrap(redisClientMultiCommandPrototype, "exec", this._getPatchMultiCommandsExec()); + if (instrumentation.isWrapped(redisClientMultiCommandPrototype?.execAsPipeline)) { + this._unwrap(redisClientMultiCommandPrototype, "execAsPipeline"); + } + this._wrap(redisClientMultiCommandPrototype, "execAsPipeline", this._getPatchMultiCommandsExec()); + if (instrumentation.isWrapped(redisClientMultiCommandPrototype?.addCommand)) { + this._unwrap(redisClientMultiCommandPrototype, "addCommand"); + } + this._wrap(redisClientMultiCommandPrototype, "addCommand", this._getPatchMultiCommandsAddCommand()); + return moduleExports; + }, + (moduleExports) => { + const redisClientMultiCommandPrototype = moduleExports?.default?.prototype; + if (instrumentation.isWrapped(redisClientMultiCommandPrototype?.exec)) { + this._unwrap(redisClientMultiCommandPrototype, "exec"); + } + if (instrumentation.isWrapped(redisClientMultiCommandPrototype?.execAsPipeline)) { + this._unwrap(redisClientMultiCommandPrototype, "execAsPipeline"); + } + if (instrumentation.isWrapped(redisClientMultiCommandPrototype?.addCommand)) { + this._unwrap(redisClientMultiCommandPrototype, "addCommand"); + } + } + ); + const clientIndexModule = new InstrumentationNodeModuleFile.InstrumentationNodeModuleFile( + `${basePackageName}/dist/lib/client/index.js`, + ["^1.0.0", ">=5.0.0 <5.12.0"], + (moduleExports) => { + const redisClientPrototype = moduleExports?.default?.prototype; + if (redisClientPrototype?.multi) { + if (instrumentation.isWrapped(redisClientPrototype?.multi)) { + this._unwrap(redisClientPrototype, "multi"); + } + this._wrap(redisClientPrototype, "multi", this._getPatchRedisClientMulti()); + } + if (redisClientPrototype?.MULTI) { + if (instrumentation.isWrapped(redisClientPrototype?.MULTI)) { + this._unwrap(redisClientPrototype, "MULTI"); + } + this._wrap(redisClientPrototype, "MULTI", this._getPatchRedisClientMulti()); + } + if (instrumentation.isWrapped(redisClientPrototype?.sendCommand)) { + this._unwrap(redisClientPrototype, "sendCommand"); + } + this._wrap(redisClientPrototype, "sendCommand", this._getPatchRedisClientSendCommand()); + if (instrumentation.isWrapped(redisClientPrototype?.connect)) { + this._unwrap(redisClientPrototype, "connect"); + } + this._wrap(redisClientPrototype, "connect", this._getPatchedClientConnect()); + return moduleExports; + }, + (moduleExports) => { + const redisClientPrototype = moduleExports?.default?.prototype; + if (instrumentation.isWrapped(redisClientPrototype?.multi)) { + this._unwrap(redisClientPrototype, "multi"); + } + if (instrumentation.isWrapped(redisClientPrototype?.MULTI)) { + this._unwrap(redisClientPrototype, "MULTI"); + } + if (instrumentation.isWrapped(redisClientPrototype?.sendCommand)) { + this._unwrap(redisClientPrototype, "sendCommand"); + } + if (instrumentation.isWrapped(redisClientPrototype?.connect)) { + this._unwrap(redisClientPrototype, "connect"); + } + } + ); + return new instrumentation.InstrumentationNodeModuleDefinition( + basePackageName, + ["^1.0.0", ">=5.0.0 <5.12.0"], + (moduleExports) => moduleExports, + () => { + }, + [commanderModuleFile, multiCommanderModule, clientIndexModule] + ); + } + _getPatchExtendWithCommands(transformCommandArguments) { + const plugin = this; + return function extendWithCommandsPatchWrapper(original) { + return function extendWithCommandsPatch(config) { + if (config?.BaseClass?.name !== "RedisClient") { + return original.apply(this, arguments); + } + const origExecutor = config.executor; + config.executor = function(command, args) { + const redisCommandArguments = transformCommandArguments(command, args).args; + return plugin._traceClientCommand(origExecutor, this, arguments, redisCommandArguments); + }; + return original.apply(this, arguments); + }; + }; + } + _getPatchMultiCommandsExec() { + const plugin = this; + return function execPatchWrapper(original) { + return function execPatch() { + const execRes = original.apply(this, arguments); + if (typeof execRes?.then !== "function") { + debugBuild.DEBUG_BUILD && core.debug.error("non-promise result when patching exec/execAsPipeline"); + return execRes; + } + return execRes.then((redisRes) => { + const openSpans = this[OTEL_OPEN_SPANS]; + plugin._endSpansWithRedisReplies(openSpans, redisRes); + return redisRes; + }).catch((err) => { + const openSpans = this[OTEL_OPEN_SPANS]; + if (!openSpans) { + debugBuild.DEBUG_BUILD && core.debug.error("cannot find open spans to end for multi/pipeline"); + } else { + const replies = err.constructor.name === "MultiErrorReply" ? err.replies : new Array(openSpans.length).fill(err); + plugin._endSpansWithRedisReplies(openSpans, replies); + } + return Promise.reject(err); + }); + }; + }; + } + _getPatchMultiCommandsAddCommand() { + const plugin = this; + return function addCommandWrapper(original) { + return function addCommandPatch(args) { + return plugin._traceClientCommand(original, this, arguments, args); + }; + }; + } + _getPatchRedisClientMulti() { + return function multiPatchWrapper(original) { + return function multiPatch() { + const multiRes = original.apply(this, arguments); + multiRes[MULTI_COMMAND_OPTIONS] = this.options; + return multiRes; + }; + }; + } + _getPatchRedisClientSendCommand() { + const plugin = this; + return function sendCommandWrapper(original) { + return function sendCommandPatch(args) { + return plugin._traceClientCommand(original, this, arguments, args); + }; + }; + } + _getPatchedClientConnect() { + return function connectWrapper(original) { + return function patchedConnect() { + const attributes = getClientAttributes(this.options); + const span = core.startInactiveSpan({ + name: `${_RedisInstrumentationV4_V5.COMPONENT}-connect`, + kind: core.SPAN_KIND.CLIENT, + attributes + }); + const res = core.withActiveSpan(span, () => original.apply(this)); + return res.then( + (result) => { + span.end(); + return result; + }, + (error) => { + endSpan(span, error); + return Promise.reject(error); + } + ); + }; + }; + } + _traceClientCommand(origFunction, origThis, origArguments, redisCommandArguments) { + const clientOptions = origThis.options || origThis[MULTI_COMMAND_OPTIONS]; + const commandName = redisCommandArguments[0]; + const commandArgs = redisCommandArguments.slice(1); + const attributes$1 = getClientAttributes(clientOptions); + const dbStatement = serverUtils.defaultDbStatementSerializer(commandName, commandArgs); + if (dbStatement != null) { + attributes$1[attributes.DB_STATEMENT] = dbStatement; + } + const span = core.startInactiveSpan({ + name: `${_RedisInstrumentationV4_V5.COMPONENT}-${commandName}`, + kind: core.SPAN_KIND.CLIENT, + attributes: attributes$1 + }); + const res = core.withActiveSpan(span, () => origFunction.apply(origThis, origArguments)); + if (res instanceof Promise) { + res.then( + (redisRes) => { + this._endSpanWithResponse(span, commandName, commandArgs, redisRes, void 0); + }, + (err) => { + this._endSpanWithResponse(span, commandName, commandArgs, null, err); + } + ); + } else { + const redisClientMultiCommand = res; + redisClientMultiCommand[OTEL_OPEN_SPANS] = redisClientMultiCommand[OTEL_OPEN_SPANS] || []; + redisClientMultiCommand[OTEL_OPEN_SPANS].push({ + span, + commandName, + commandArgs + }); + } + return res; + } + _endSpansWithRedisReplies(openSpans, replies) { + if (!openSpans) { + debugBuild.DEBUG_BUILD && core.debug.error("cannot find open spans to end for redis multi/pipeline"); + return; + } + if (replies.length !== openSpans.length) { + debugBuild.DEBUG_BUILD && core.debug.error("number of multi command spans does not match response from redis"); + return; + } + for (let i = 0; i < openSpans.length; i++) { + const { span, commandName, commandArgs } = openSpans[i]; + const currCommandRes = replies[i]; + const [res, err] = currCommandRes instanceof Error ? [null, currCommandRes] : [currCommandRes, void 0]; + this._endSpanWithResponse(span, commandName, commandArgs, res, err); + } + } + _endSpanWithResponse(span, commandName, commandArgs, response, error) { + if (!error) { + runResponseHook(this.getConfig().responseHook, span, commandName, commandArgs, response); + } + endSpan(span, error); + } +}; +_RedisInstrumentationV4_V5.COMPONENT = "redis"; +let RedisInstrumentationV4_V5 = _RedisInstrumentationV4_V5; +class RedisInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + this.initialized = false; + this.instrumentationV2_V3 = new RedisInstrumentationV2_V3(this.getConfig()); + this.instrumentationV4_V5 = new RedisInstrumentationV4_V5(this.getConfig()); + this.initialized = true; + } + setConfig(config = {}) { + super.setConfig(config); + if (!this.initialized) { + return; + } + this.instrumentationV2_V3.setConfig(config); + this.instrumentationV4_V5.setConfig(config); + } + init() { + } + getModuleDefinitions() { + return [...this.instrumentationV2_V3.getModuleDefinitions(), ...this.instrumentationV4_V5.getModuleDefinitions()]; + } + setTracerProvider(tracerProvider) { + super.setTracerProvider(tracerProvider); + if (!this.initialized) { + return; + } + this.instrumentationV2_V3.setTracerProvider(tracerProvider); + this.instrumentationV4_V5.setTracerProvider(tracerProvider); + } + enable() { + super.enable(); + if (!this.initialized) { + return; + } + this.instrumentationV2_V3.enable(); + this.instrumentationV4_V5.enable(); + } + disable() { + super.disable(); + if (!this.initialized) { + return; + } + this.instrumentationV2_V3.disable(); + this.instrumentationV4_V5.disable(); + } +} + +exports.RedisInstrumentation = RedisInstrumentation; +//# sourceMappingURL=redis-instrumentation.js.map + + +/***/ }), + +/***/ 82582: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +const DB_SYSTEM_VALUE_REDIS = "redis"; + +exports.ATTR_DB_CONNECTION_STRING = ATTR_DB_CONNECTION_STRING; +exports.DB_SYSTEM_VALUE_REDIS = DB_SYSTEM_VALUE_REDIS; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 66804: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(3087); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); + +const INTEGRATION_NAME = "Tedious"; +const instrumentTedious = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.TediousInstrumentation({})); +const _tediousIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentTedious(); + } + }; +}); +const tediousIntegration = core.defineIntegration(_tediousIntegration); + +exports.instrumentTedious = instrumentTedious; +exports.tediousIntegration = tediousIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 3087: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const events = __nccwpck_require__(82361); +const instrumentation = __nccwpck_require__(65584); +const attributes = __nccwpck_require__(88264); +const semconv = __nccwpck_require__(98397); +const utils = __nccwpck_require__(85009); +const core = __nccwpck_require__(84466); + +const PACKAGE_NAME = "@sentry/instrumentation-tedious"; +const CURRENT_DATABASE = /* @__PURE__ */ Symbol("opentelemetry.instrumentation-tedious.current-database"); +const PATCHED_METHODS = ["callProcedure", "execSql", "execSqlBatch", "execBulkLoad", "prepare", "execute"]; +function setDatabase(databaseName) { + Object.defineProperty(this, CURRENT_DATABASE, { + value: databaseName, + writable: true + }); +} +const _TediousInstrumentation = class _TediousInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super(PACKAGE_NAME, core.SDK_VERSION, config); + } + init() { + return [ + new instrumentation.InstrumentationNodeModuleDefinition( + _TediousInstrumentation.COMPONENT, + [">=1.11.0 <20"], + (moduleExports) => { + const ConnectionPrototype = moduleExports.Connection.prototype; + for (const method of PATCHED_METHODS) { + if (instrumentation.isWrapped(ConnectionPrototype[method])) { + this._unwrap(ConnectionPrototype, method); + } + this._wrap(ConnectionPrototype, method, this._patchQuery(method)); + } + if (instrumentation.isWrapped(ConnectionPrototype.connect)) { + this._unwrap(ConnectionPrototype, "connect"); + } + this._wrap(ConnectionPrototype, "connect", this._patchConnect); + return moduleExports; + }, + (moduleExports) => { + if (moduleExports === void 0) return; + const ConnectionPrototype = moduleExports.Connection.prototype; + for (const method of PATCHED_METHODS) { + this._unwrap(ConnectionPrototype, method); + } + this._unwrap(ConnectionPrototype, "connect"); + } + ) + ]; + } + _patchConnect(original) { + return function patchedConnect() { + setDatabase.call(this, this.config?.options?.database); + this.removeListener("databaseChange", setDatabase); + this.on("databaseChange", setDatabase); + this.once("end", () => { + this.removeListener("databaseChange", setDatabase); + }); + return original.apply(this, arguments); + }; + } + _patchQuery(operation) { + return (originalMethod) => { + const thisPlugin = this; + function patchedMethod(request) { + if (!(request instanceof events.EventEmitter)) { + thisPlugin._diag.warn(`Unexpected invocation of patched ${operation} method. Span not recorded`); + return originalMethod.apply(this, arguments); + } + let procCount = 0; + let statementCount = 0; + const incrementStatementCount = () => statementCount++; + const incrementProcCount = () => procCount++; + const databaseName = this[CURRENT_DATABASE]; + const sql = ((request2) => { + if (request2.sqlTextOrProcedure === "sp_prepare" && request2.parametersByName?.stmt?.value) { + return request2.parametersByName.stmt.value; + } + return request2.sqlTextOrProcedure; + })(request); + const attributes$1 = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.tedious", + // eslint-disable-next-line typescript/no-deprecated + [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_MSSQL, + // eslint-disable-next-line typescript/no-deprecated + [attributes.DB_NAME]: databaseName, + // >=4 uses `authentication` object; older versions just userName and password pair + // eslint-disable-next-line typescript/no-deprecated + [attributes.DB_USER]: this.config?.userName ?? this.config?.authentication?.options?.userName, + // eslint-disable-next-line typescript/no-deprecated + [attributes.DB_STATEMENT]: sql, + // eslint-disable-next-line typescript/no-deprecated + [semconv.ATTR_DB_SQL_TABLE]: request.table, + // eslint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_NAME]: this.config?.server, + // eslint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_PORT]: this.config?.options?.port + }; + const span = core.startInactiveSpan({ + name: utils.getSpanName(operation, databaseName, sql, request.table), + kind: core.SPAN_KIND.CLIENT, + attributes: attributes$1 + }); + const endSpan = utils.once((err) => { + request.removeListener("done", incrementStatementCount); + request.removeListener("doneInProc", incrementStatementCount); + request.removeListener("doneProc", incrementProcCount); + request.removeListener("error", endSpan); + this.removeListener("end", endSpan); + span.setAttribute("tedious.procedure_count", procCount); + span.setAttribute("tedious.statement_count", statementCount); + if (err) { + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: err.message + }); + } + span.end(); + }); + request.on("done", incrementStatementCount); + request.on("doneInProc", incrementStatementCount); + request.on("doneProc", incrementProcCount); + request.once("error", endSpan); + this.on("end", endSpan); + if (typeof request.callback === "function") { + thisPlugin._wrap(request, "callback", thisPlugin._patchCallbackQuery(endSpan)); + } else { + thisPlugin._diag.error("Expected request.callback to be a function"); + } + return core.withActiveSpan(span, () => originalMethod.apply(this, arguments)); + } + Object.defineProperty(patchedMethod, "length", { + value: originalMethod.length, + writable: false + }); + return patchedMethod; + }; + } + _patchCallbackQuery(endSpan) { + return (originalCallback) => { + return function(err, _rowCount, _rows) { + endSpan(err); + return originalCallback.apply(this, arguments); + }; + }; + } +}; +_TediousInstrumentation.COMPONENT = "tedious"; +let TediousInstrumentation = _TediousInstrumentation; + +exports.TediousInstrumentation = TediousInstrumentation; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 98397: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_DB_SQL_TABLE = "db.sql.table"; +const DB_SYSTEM_VALUE_MSSQL = "mssql"; + +exports.ATTR_DB_SQL_TABLE = ATTR_DB_SQL_TABLE; +exports.DB_SYSTEM_VALUE_MSSQL = DB_SYSTEM_VALUE_MSSQL; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 85009: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +function getSpanName(operation, db, sql, bulkLoadTable) { + if (operation === "execBulkLoad" && bulkLoadTable && db) { + return `${operation} ${bulkLoadTable} ${db}`; + } + if (operation === "callProcedure") { + if (db) { + return `${operation} ${sql} ${db}`; + } + return `${operation} ${sql}`; + } + if (db) { + return `${operation} ${db}`; + } + return `${operation}`; +} +const once = (fn) => { + let called = false; + return (...args) => { + if (called) return; + called = true; + return fn(...args); + }; +}; + +exports.getSpanName = getSpanName; +exports.once = once; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 28025: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const INTEGRATION_NAME = "VercelAI"; + +exports.INTEGRATION_NAME = INTEGRATION_NAME; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 65595: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const serverUtils = __nccwpck_require__(93362); +const constants = __nccwpck_require__(28025); +const instrumentation = __nccwpck_require__(15477); + +const instrumentVercelAi = nodeCore.generateInstrumentOnce(constants.INTEGRATION_NAME, () => new instrumentation.SentryVercelAiInstrumentation({})); +function shouldForceIntegration(client) { + const modules = client.getIntegrationByName("Modules"); + return !!modules?.getModules?.()?.ai; +} +const _vercelAIIntegration = ((options = {}) => { + let instrumentation; + const parentIntegration = serverUtils.vercelAiIntegration(options); + return core.extendIntegration(parentIntegration, { + options, + setupOnce() { + instrumentation = instrumentVercelAi(); + }, + afterAllSetup(client) { + const shouldForce = options.force ?? shouldForceIntegration(client); + if (shouldForce) { + core.addVercelAiProcessors(client); + } else { + instrumentation?.callWhenPatched(() => core.addVercelAiProcessors(client)); + } + } + }); +}); +const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration); + +exports.instrumentVercelAi = instrumentVercelAi; +exports.vercelAIIntegration = vercelAIIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 15477: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const constants = __nccwpck_require__(28025); + +const SUPPORTED_VERSIONS = [">=3.0.0 <7"]; +const INSTRUMENTED_METHODS = [ + "generateText", + "streamText", + "generateObject", + "streamObject", + "embed", + "embedMany", + "rerank" +]; +function isToolError(obj) { + if (typeof obj !== "object" || obj === null) { + return false; + } + const candidate = obj; + return "type" in candidate && "error" in candidate && "toolName" in candidate && "toolCallId" in candidate && candidate.type === "tool-error" && candidate.error instanceof Error; +} +function processToolCallResults(result) { + if (typeof result !== "object" || result === null || !("content" in result)) { + return; + } + const resultObj = result; + if (!Array.isArray(resultObj.content)) { + return; + } + captureToolErrors(resultObj.content); + cleanupToolCallSpanContexts(resultObj.content); +} +function captureToolErrors(content) { + for (const item of content) { + if (!isToolError(item)) { + continue; + } + const spanContext = core._INTERNAL_getSpanContextForToolCallId(item.toolCallId); + if (spanContext) { + core.withScope((scope) => { + scope.setContext("trace", { + trace_id: spanContext.traceId, + span_id: spanContext.spanId + }); + scope.setTag("vercel.ai.tool.name", item.toolName); + scope.setTag("vercel.ai.tool.callId", item.toolCallId); + scope.setLevel("error"); + core.captureException(item.error, { + mechanism: { + type: "auto.vercelai.otel", + handled: false + } + }); + }); + } else { + core.withScope((scope) => { + scope.setTag("vercel.ai.tool.name", item.toolName); + scope.setTag("vercel.ai.tool.callId", item.toolCallId); + scope.setLevel("error"); + core.captureException(item.error, { + mechanism: { + type: "auto.vercelai.otel", + handled: false + } + }); + }); + } + } +} +function cleanupToolCallSpanContexts(content) { + for (const item of content) { + if (typeof item === "object" && item !== null && "toolCallId" in item && typeof item.toolCallId === "string") { + core._INTERNAL_cleanupToolCallSpanContext(item.toolCallId); + } + } +} +function determineRecordingSettings(integrationRecordingOptions, methodTelemetryOptions, telemetryExplicitlyEnabled, defaultInputsEnabled, defaultOutputsEnabled) { + const recordInputs = integrationRecordingOptions?.recordInputs !== void 0 ? integrationRecordingOptions.recordInputs : methodTelemetryOptions.recordInputs !== void 0 ? methodTelemetryOptions.recordInputs : telemetryExplicitlyEnabled === true ? true : defaultInputsEnabled; + const recordOutputs = integrationRecordingOptions?.recordOutputs !== void 0 ? integrationRecordingOptions.recordOutputs : methodTelemetryOptions.recordOutputs !== void 0 ? methodTelemetryOptions.recordOutputs : telemetryExplicitlyEnabled === true ? true : defaultOutputsEnabled; + return { recordInputs, recordOutputs }; +} +class SentryVercelAiInstrumentation extends instrumentation.InstrumentationBase { + constructor(config = {}) { + super("@sentry/instrumentation-vercel-ai", core.SDK_VERSION, config); + this._isPatched = false; + this._callbacks = []; + } + /** + * Initializes the instrumentation by defining the modules to be patched. + */ + init() { + const module = new instrumentation.InstrumentationNodeModuleDefinition("ai", SUPPORTED_VERSIONS, this._patch.bind(this)); + return module; + } + /** + * Call the provided callback when the module is patched. + * If it has already been patched, the callback will be called immediately. + */ + callWhenPatched(callback) { + if (this._isPatched) { + callback(); + } else { + this._callbacks.push(callback); + } + } + /** + * Patches module exports to enable Vercel AI telemetry. + */ + _patch(moduleExports) { + this._isPatched = true; + this._callbacks.forEach((callback) => callback()); + this._callbacks = []; + const generatePatch = (originalMethod) => { + return new Proxy(originalMethod, { + apply: (target, thisArg, args) => { + const existingExperimentalTelemetry = args[0].experimental_telemetry || {}; + const isEnabled = existingExperimentalTelemetry.isEnabled; + const client = core.getClient(); + const integration = client?.getIntegrationByName(constants.INTEGRATION_NAME); + const integrationOptions = integration?.options; + const genAI = integration ? client?.getDataCollectionOptions().genAI : void 0; + const { recordInputs, recordOutputs } = determineRecordingSettings( + integrationOptions, + existingExperimentalTelemetry, + isEnabled, + Boolean(genAI?.inputs), + Boolean(genAI?.outputs) + ); + args[0].experimental_telemetry = { + ...existingExperimentalTelemetry, + isEnabled: isEnabled !== void 0 ? isEnabled : true, + recordInputs, + recordOutputs + }; + return core.handleCallbackErrors( + () => Reflect.apply(target, thisArg, args), + (error) => { + if (error && typeof error === "object") { + core.addNonEnumerableProperty(error, "_sentry_active_span", core.getActiveSpan()); + } + }, + () => { + }, + (result) => { + processToolCallResults(result); + } + ); + } + }); + }; + if (Object.prototype.toString.call(moduleExports) === "[object Module]") { + for (const method of INSTRUMENTED_METHODS) { + if (moduleExports[method] != null) { + moduleExports[method] = generatePatch(moduleExports[method]); + } + } + return moduleExports; + } else { + const patchedModuleExports = INSTRUMENTED_METHODS.reduce((acc, curr) => { + if (moduleExports[curr] != null) { + acc[curr] = generatePatch(moduleExports[curr]); + } + return acc; + }, {}); + return { ...moduleExports, ...patchedModuleExports }; + } + } +} + +exports.SentryVercelAiInstrumentation = SentryVercelAiInstrumentation; +exports.cleanupToolCallSpanContexts = cleanupToolCallSpanContexts; +exports.determineRecordingSettings = determineRecordingSettings; +exports.processToolCallResults = processToolCallResults; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 65678: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +let loader; +let cached; +function setDiagnosticsChannelInjectionLoader(load) { + loader = load; +} +function isDiagnosticsChannelInjectionEnabled() { + return !!loader; +} +function resolveDiagnosticsChannelInjection() { + if (!loader) { + return void 0; + } + return cached ?? (cached = loader()); +} + +exports.isDiagnosticsChannelInjectionEnabled = isDiagnosticsChannelInjectionEnabled; +exports.resolveDiagnosticsChannelInjection = resolveDiagnosticsChannelInjection; +exports.setDiagnosticsChannelInjectionLoader = setDiagnosticsChannelInjectionLoader; +//# sourceMappingURL=diagnosticsChannelInjection.js.map + + +/***/ }), + +/***/ 68478: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const orchestrion = __nccwpck_require__(21496); +const register = __nccwpck_require__(63503); +const cache = __nccwpck_require__(35701); +const diagnosticsChannelInjection = __nccwpck_require__(65678); + +function diagnosticsChannelInjectionIntegrations() { + return orchestrion.channelIntegrations; +} +function experimentalUseDiagnosticsChannelInjection(options) { + diagnosticsChannelInjection.setDiagnosticsChannelInjectionLoader(() => { + const integrations = Object.values(orchestrion.channelIntegrations).map((createIntegration) => createIntegration()); + const replacedOtelIntegrationNames = integrations.map((i) => i.name); + return { + // ioredis and redis are wired separately (not in `channelIntegrations`): they need the node + // redis cache `responseHook` and only partially replace the composite OTel `Redis` integration, + // so they're kept OUT of `replacedOtelIntegrationNames` — `Redis` must stay (batch + >=5.11 native DC). + integrations: [ + ...integrations, + orchestrion.ioredisChannelIntegration({ responseHook: cache.cacheResponseHook }), + orchestrion.redisChannelIntegration({ responseHook: cache.cacheResponseHook }) + ], + replacedOtelIntegrationNames, + register: () => register.registerDiagnosticsChannelInjection(options), + detect: orchestrion.detectOrchestrionSetup + }; + }); +} + +exports.diagnosticsChannelInjectionIntegrations = diagnosticsChannelInjectionIntegrations; +exports.experimentalUseDiagnosticsChannelInjection = experimentalUseDiagnosticsChannelInjection; +//# sourceMappingURL=experimentalUseDiagnosticsChannelInjection.js.map + + +/***/ }), + +/***/ 59198: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const http = __nccwpck_require__(92447); +const nodeFetch = __nccwpck_require__(40839); +const index = __nccwpck_require__(59020); +const diagnosticsChannelInjection = __nccwpck_require__(65678); +const initOtel = __nccwpck_require__(16049); + +function getDefaultIntegrationsWithoutPerformance() { + const nodeCoreIntegrations = nodeCore.getDefaultIntegrations(); + return nodeCoreIntegrations.filter((integration) => integration.name !== "Http" && integration.name !== "NodeFetch").concat(http.httpIntegration(), nodeFetch.nativeNodeFetchIntegration()); +} +function getDefaultIntegrations(options) { + return [ + ...getDefaultIntegrationsWithoutPerformance(), + // We only add performance integrations if tracing is enabled + // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added + // This means that generally request isolation will work (because that is done by httpIntegration) + // But `transactionName` will not be set automatically + ...core.hasSpansEnabled(options) ? index.getAutoPerformanceIntegrations() : [] + ]; +} +function applyDiagnosticsChannelInjectionIntegrations(integrations, options) { + if (diagnosticsChannelInjection.isDiagnosticsChannelInjectionEnabled() && core.hasSpansEnabled(options)) { + const diagnosticsChannelInjection$1 = diagnosticsChannelInjection.resolveDiagnosticsChannelInjection(); + if (diagnosticsChannelInjection$1) { + const replaced = new Set(diagnosticsChannelInjection$1.replacedOtelIntegrationNames); + return [...integrations.filter((i) => !replaced.has(i.name)), ...diagnosticsChannelInjection$1.integrations]; + } + } + return integrations; +} +function init(options = {}) { + return _init(options, getDefaultIntegrations); +} +function _init(options = {}, getDefaultIntegrationsImpl) { + core.applySdkMetadata(options, "node"); + const diagnosticsChannelInjection$1 = diagnosticsChannelInjection.isDiagnosticsChannelInjectionEnabled() && core.hasSpansEnabled(options) ? diagnosticsChannelInjection.resolveDiagnosticsChannelInjection() : void 0; + if (diagnosticsChannelInjection$1) { + diagnosticsChannelInjection$1.register(); + } + let defaultIntegrations = options.defaultIntegrations ?? getDefaultIntegrationsImpl(options); + if (diagnosticsChannelInjection$1 && Array.isArray(defaultIntegrations) && defaultIntegrations.length > 0) { + const replaced = new Set(diagnosticsChannelInjection$1.replacedOtelIntegrationNames); + defaultIntegrations = [ + ...defaultIntegrations.filter((integration) => !replaced.has(integration.name)), + ...diagnosticsChannelInjection$1.integrations + ]; + } + const client = nodeCore.init({ + ...options, + defaultIntegrations + }); + if (client && !options.skipOpenTelemetrySetup) { + initOtel.initOpenTelemetry(client, { + spanProcessors: options.openTelemetrySpanProcessors + }); + nodeCore.validateOpenTelemetrySetup(); + } + if (diagnosticsChannelInjection$1) { + diagnosticsChannelInjection$1.detect(); + } + return client; +} +function initWithoutDefaultIntegrations(options = {}) { + return _init(options, () => []); +} + +exports.applyDiagnosticsChannelInjectionIntegrations = applyDiagnosticsChannelInjectionIntegrations; +exports.getDefaultIntegrations = getDefaultIntegrations; +exports.getDefaultIntegrationsWithoutPerformance = getDefaultIntegrationsWithoutPerformance; +exports.init = init; +exports.initWithoutDefaultIntegrations = initWithoutDefaultIntegrations; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 16049: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const api = __nccwpck_require__(65163); +const sdkTraceBase = __nccwpck_require__(88266); +const core = __nccwpck_require__(84466); +const nodeCore = __nccwpck_require__(28648); +const opentelemetry = __nccwpck_require__(90157); +const debugBuild = __nccwpck_require__(8421); +const index = __nccwpck_require__(59020); + +const MAX_MAX_SPAN_WAIT_DURATION = 1e6; +const OTEL_API_GLOBAL_KEY = /* @__PURE__ */ Symbol.for("opentelemetry.js.api.1"); +function registerGlobalTracerProvider(provider) { + if (api.trace.setGlobalTracerProvider(provider)) { + return true; + } + const otelGlobal = globalThis; + const registry = otelGlobal[OTEL_API_GLOBAL_KEY]; + if (registry && !registry.trace) { + debugBuild.DEBUG_BUILD && core.debug.warn( + "Replaced a pre-existing OpenTelemetry API registry that was created by a different @opentelemetry/api version and would have blocked tracing. If you want to manage OpenTelemetry yourself, set `skipOpenTelemetrySetup: true` in `Sentry.init()`." + ); + otelGlobal[OTEL_API_GLOBAL_KEY] = void 0; + if (!api.trace.setGlobalTracerProvider(provider)) { + return false; + } + const recreatedRegistry = otelGlobal[OTEL_API_GLOBAL_KEY]; + if (recreatedRegistry) { + const { propagation: _propagation, context: _context, ...carriedOverSlots } = registry; + otelGlobal[OTEL_API_GLOBAL_KEY] = { ...carriedOverSlots, ...recreatedRegistry }; + } + return true; + } + return false; +} +function initOpenTelemetry(client, options = {}) { + if (client.getOptions().debug) { + nodeCore.setupOpenTelemetryLogger(); + } + const [provider, asyncLocalStorageLookup] = setupOtel(client, options); + client.traceProvider = provider; + client.asyncLocalStorageLookup = asyncLocalStorageLookup; +} +function preloadOpenTelemetry(options = {}) { + const { debug } = options; + if (debug) { + core.debug.enable(); + } + nodeCore.initializeEsmLoader(); + getPreloadMethods(options.integrations).forEach((fn) => { + fn(); + if (debug) { + core.debug.log(`[Sentry] Preloaded ${fn.id} instrumentation`); + } + }); +} +function getPreloadMethods(integrationNames) { + const instruments = index.getOpenTelemetryInstrumentationToPreload(); + if (!integrationNames) { + return instruments; + } + return instruments.filter((instrumentation) => { + const id = instrumentation.id; + return integrationNames.some((integrationName) => id === integrationName || id.startsWith(`${integrationName}.`)); + }); +} +function setupOtel(client, options = {}) { + const shouldUseBasicTracerProvider = client.getOptions().openTelemetryBasicTracerProvider || !!options.spanProcessors?.length; + if (!shouldUseBasicTracerProvider) { + return setupSentryTracerProvider(client); + } + const provider = new sdkTraceBase.BasicTracerProvider({ + sampler: new opentelemetry.SentrySampler(client), + resource: opentelemetry.getSentryResource("node"), + forceFlushTimeoutMillis: 500, + spanProcessors: [ + new opentelemetry.SentrySpanProcessor({ + timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration), + client + }), + ...options.spanProcessors || [] + ] + }); + registerGlobalTracerProvider(provider); + api.propagation.setGlobalPropagator(new opentelemetry.SentryPropagator()); + const ctxManager = new nodeCore.SentryContextManager(); + api.context.setGlobalContextManager(ctxManager); + return [provider, ctxManager.getAsyncLocalStorageLookup()]; +} +function setupSentryTracerProvider(client) { + const provider = new opentelemetry.SentryTracerProvider({ resource: opentelemetry.getSentryResource("node") }); + if (!registerGlobalTracerProvider(provider)) { + debugBuild.DEBUG_BUILD && core.debug.warn( + "Could not register SentryTracerProvider because another OpenTelemetry tracer provider is already registered." + ); + return [void 0, void 0]; + } + opentelemetry.setIsSetup("SentryTracerProvider"); + api.propagation.setGlobalPropagator(new opentelemetry.SentryPropagator()); + const ctxManager = new nodeCore.SentryContextManager(); + api.context.setGlobalContextManager(ctxManager); + client.on("spanEnd", (span) => { + opentelemetry.applyOtelSpanData(span, { finalizeStatus: true }); + }); + if (core.hasSpanStreamingEnabled(client)) { + client.on("preprocessSpan", opentelemetry.backfillStreamedSpanDataFromOtel); + } + client.on("preprocessEvent", (event) => { + if (event.type !== "transaction") { + return; + } + event.contexts = { + ...event.contexts, + otel: { + resource: provider.resource?.attributes, + ...event.contexts?.otel + } + }; + }); + return [provider, ctxManager.getAsyncLocalStorageLookup()]; +} +function _clampSpanProcessorTimeout(maxSpanWaitDuration) { + if (maxSpanWaitDuration == null) { + return void 0; + } + if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) { + debugBuild.DEBUG_BUILD && core.debug.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`); + return MAX_MAX_SPAN_WAIT_DURATION; + } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) { + debugBuild.DEBUG_BUILD && core.debug.warn("`maxSpanWaitDuration` must be a positive number, using default value instead."); + return void 0; + } + return maxSpanWaitDuration; +} + +exports._clampSpanProcessorTimeout = _clampSpanProcessorTimeout; +exports.initOpenTelemetry = initOpenTelemetry; +exports.preloadOpenTelemetry = preloadOpenTelemetry; +exports.setupOtel = setupOtel; +//# sourceMappingURL=initOtel.js.map + + +/***/ }), + +/***/ 94795: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const SINGLE_ARG_COMMANDS = ["get", "set", "setex"]; +const GET_COMMANDS = ["get", "mget"]; +const SET_COMMANDS = ["set", "setex"]; +const REMOVE_COMMANDS = ["del", "unlink"]; +function isInCommands(redisCommands, command) { + return redisCommands.includes(command.toLowerCase()); +} +function getCacheOperation(command) { + if (isInCommands(GET_COMMANDS, command)) { + return "cache.get"; + } else if (isInCommands(SET_COMMANDS, command)) { + return "cache.put"; + } else if (isInCommands(REMOVE_COMMANDS, command)) { + return "cache.remove"; + } else { + return void 0; + } +} +function keyHasPrefix(key, prefixes) { + return prefixes.some((prefix) => key.startsWith(prefix)); +} function getCacheKeySafely(redisCommand, cmdArgs) { try { if (cmdArgs.length === 0) { - return undefined; + return void 0; } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any const processArg = (arg) => { - if (typeof arg === 'string' || typeof arg === 'number' || Buffer.isBuffer(arg)) { + if (typeof arg === "string" || typeof arg === "number" || Buffer.isBuffer(arg)) { return [arg.toString()]; } else if (Array.isArray(arg)) { - return flatten(arg.map(arg => processArg(arg))); + return flatten(arg.map((arg2) => processArg(arg2))); } else { - return ['']; + return [""]; } }; - const firstArg = cmdArgs[0]; if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && firstArg != null) { return processArg(firstArg); } - - return flatten(cmdArgs.map(arg => processArg(arg))); - } catch (e) { - return undefined; + return flatten(cmdArgs.map((arg) => processArg(arg))); + } catch { + return void 0; } } - -/** Determines whether a redis operation should be considered as "cache operation" by checking if a key is prefixed. - * We only support certain commands (such as 'set', 'get', 'mget'). */ function shouldConsiderForCache(redisCommand, keys, prefixes) { if (!getCacheOperation(redisCommand)) { return false; } - for (const key of keys) { if (keyHasPrefix(key, prefixes)) { return true; @@ -91273,50 +56560,40 @@ function shouldConsiderForCache(redisCommand, keys, prefixes) { } return false; } - -/** Calculates size based on the cache response value */ function calculateCacheItemSize(response) { const getSize = (value) => { try { if (Buffer.isBuffer(value)) return value.byteLength; - else if (typeof value === 'string') return value.length; - else if (typeof value === 'number') return value.toString().length; - else if (value === null || value === undefined) return 0; + else if (typeof value === "string") return value.length; + else if (typeof value === "number") return value.toString().length; + else if (value === null || value === void 0) return 0; return JSON.stringify(value).length; - } catch (e) { - return undefined; + } catch { + return void 0; } }; - - return Array.isArray(response) - ? response.reduce((acc, curr) => { - const size = getSize(curr); - return typeof size === 'number' ? (acc !== undefined ? acc + size : size) : acc; - }, 0) - : getSize(response); + return Array.isArray(response) ? response.reduce((acc, curr) => { + const size = getSize(curr); + return typeof size === "number" ? acc !== void 0 ? acc + size : size : acc; + }, 0) : getSize(response); } - -// TODO(v9): This is inlined from core so we can deprecate `flatten`. -// It's usage can be replaced with `Array.flat` in v9. - function flatten(input) { const result = []; - - const flattenHelper = (input) => { - input.forEach((el) => { + const flattenHelper = (input2) => { + input2.forEach((el) => { if (Array.isArray(el)) { - flattenHelper(el ); + flattenHelper(el); } else { - result.push(el ); + result.push(el); } }); }; - flattenHelper(input); return result; } exports.GET_COMMANDS = GET_COMMANDS; +exports.REMOVE_COMMANDS = REMOVE_COMMANDS; exports.SET_COMMANDS = SET_COMMANDS; exports.calculateCacheItemSize = calculateCacheItemSize; exports.getCacheKeySafely = getCacheKeySafely; @@ -91328,3620 +56605,491 @@ exports.shouldConsiderForCache = shouldConsiderForCache; /***/ }), -/***/ 59084: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExportResultCode = void 0; -var ExportResultCode; -(function (ExportResultCode) { - ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; -})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); -//# sourceMappingURL=ExportResult.js.map - -/***/ }), - -/***/ 52356: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = ','; -// Name of the http header used to propagate the baggage -exports.BAGGAGE_HEADER = 'baggage'; -// Maximum number of name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; -// Maximum number of bytes per a single name-value pair allowed by w3c spec -exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; -// Maximum total length of all name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; -//# sourceMappingURL=constants.js.map - -/***/ }), - -/***/ 73116: +/***/ 63790: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CBaggagePropagator = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(65489); -const constants_1 = __nccwpck_require__(52356); -const utils_1 = __nccwpck_require__(96634); -/** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ - */ -class W3CBaggagePropagator { - inject(context, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context); - if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context)) - return; - const keyPairs = (0, utils_1.getKeyPairs)(baggage) - .filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }) - .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs); - if (headerValue.length > 0) { - setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - } - extract(context, 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; - const baggage = {}; - if (baggageString.length === 0) { - return context; - } - const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); - pairs.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; - } - return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; - } -} -exports.W3CBaggagePropagator = W3CBaggagePropagator; -//# sourceMappingURL=W3CBaggagePropagator.js.map - -/***/ }), - -/***/ 96634: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const api_1 = __nccwpck_require__(65163); -const constants_1 = __nccwpck_require__(52356); -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)}`; - // include opaque metadata if provided - // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation - if (value.metadata !== undefined) { - 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) { - if (typeof value !== 'string' || value.length === 0) - return {}; - return value - .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) - .map(entry => { - return parsePairKeyValue(entry); - }) - .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) - .reduce((headers, keyPair) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - headers[keyPair.key] = keyPair.value; - return headers; - }, {}); -} -exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 14164: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 - */ -class AnchoredClock { - /** - * 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; -//# sourceMappingURL=anchored-clock.js.map - -/***/ }), - -/***/ 44414: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0; -const api_1 = __nccwpck_require__(65163); -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) { - // null/undefined elements are allowed - if (element == null) - continue; - if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; - continue; - } - // encountered an invalid primitive - 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; -} -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 82498: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; -const logging_error_handler_1 = __nccwpck_require__(22191); -/** The global error handler delegate */ -let delegateHandler = (0, 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 (_a) { } // eslint-disable-line no-empty -} -exports.globalErrorHandler = globalErrorHandler; -//# sourceMappingURL=global-error-handler.js.map - -/***/ }), - -/***/ 12409: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBinary = void 0; -function intValue(charCode) { - // 0-9 - if (charCode >= 48 && charCode <= 57) { - return charCode - 48; - } - // a-f - if (charCode >= 97 && charCode <= 102) { - return charCode - 87; - } - // A-F - 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; -//# sourceMappingURL=hex-to-binary.js.map - -/***/ }), - -/***/ 22191: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loggingErrorHandler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * 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; -} -//# sourceMappingURL=logging-error-handler.js.map - -/***/ }), - -/***/ 15699: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = __nccwpck_require__(64237); -const NANOSECOND_DIGITS = 9; -const NANOSECOND_DIGITS_IN_MILLIS = 6; -const MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS); -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 / 1000; - // Decimals only. - const seconds = Math.trunc(epochSeconds); - // Round sub-nanosecond accuracy to nanosecond. - const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS); - return [seconds, nanos]; -} -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) { - const timeOrigin = millisToHrTime(getTimeOrigin()); - const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); - return addHrTimes(timeOrigin, now); -} -exports.hrTime = hrTime; -/** - * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time - */ -function timeInputToHrTime(time) { - // process.hrtime - if (isTimeInputHrTime(time)) { - return time; - } - else if (typeof time === 'number') { - // Must be a performance.now() if it's smaller than process start time. - if (time < getTimeOrigin()) { - return hrTime(time); - } - else { - // epoch milliseconds or performance.timeOrigin - 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]; - // overflow - if (nanos < 0) { - seconds -= 1; - // negate - 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); - const date = new Date(time[0] * 1000).toISOString(); - return date.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]]; - // Nanoseconds - if (out[1] >= SECOND_TO_NANOSECONDS) { - out[1] -= SECOND_TO_NANOSECONDS; - out[0] += 1; - } - return out; -} -exports.addHrTimes = addHrTimes; -//# sourceMappingURL=time.js.map - -/***/ }), - -/***/ 46033: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.TraceIdRatioBasedSampler = exports.ParentBasedSampler = exports.AlwaysOnSampler = exports.AlwaysOffSampler = 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.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = exports.baggageUtils = exports.ExportResultCode = exports.hexToBinary = 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.isAttributeKey = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; -exports.internal = exports.VERSION = exports.BindOnceFuture = exports.isWrapped = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.TracesSamplerValues = exports.merge = exports.parseEnvironment = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ENVIRONMENT = void 0; -var W3CBaggagePropagator_1 = __nccwpck_require__(73116); -Object.defineProperty(exports, "W3CBaggagePropagator", ({ enumerable: true, get: function () { return W3CBaggagePropagator_1.W3CBaggagePropagator; } })); -var anchored_clock_1 = __nccwpck_require__(14164); -Object.defineProperty(exports, "AnchoredClock", ({ enumerable: true, get: function () { return anchored_clock_1.AnchoredClock; } })); -var attributes_1 = __nccwpck_require__(44414); -Object.defineProperty(exports, "isAttributeKey", ({ enumerable: true, get: function () { return attributes_1.isAttributeKey; } })); -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 = __nccwpck_require__(82498); -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 = __nccwpck_require__(22191); -Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); -var time_1 = __nccwpck_require__(15699); -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 hex_to_binary_1 = __nccwpck_require__(12409); -Object.defineProperty(exports, "hexToBinary", ({ enumerable: true, get: function () { return hex_to_binary_1.hexToBinary; } })); -var ExportResult_1 = __nccwpck_require__(59084); -Object.defineProperty(exports, "ExportResultCode", ({ enumerable: true, get: function () { return ExportResult_1.ExportResultCode; } })); -const utils_1 = __nccwpck_require__(96634); -exports.baggageUtils = { - getKeyPairs: utils_1.getKeyPairs, - serializeKeyPairs: utils_1.serializeKeyPairs, - parseKeyPairsIntoRecord: utils_1.parseKeyPairsIntoRecord, - parsePairKeyValue: utils_1.parsePairKeyValue, -}; -var platform_1 = __nccwpck_require__(64237); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return platform_1.RandomIdGenerator; } })); -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, "getEnv", ({ enumerable: true, get: function () { return platform_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return platform_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return platform_1.hexToBase64; } })); -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 = __nccwpck_require__(27514); -Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); -var W3CTraceContextPropagator_1 = __nccwpck_require__(45146); -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 = __nccwpck_require__(28981); -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 AlwaysOffSampler_1 = __nccwpck_require__(70416); -Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); -var AlwaysOnSampler_1 = __nccwpck_require__(58338); -Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); -var ParentBasedSampler_1 = __nccwpck_require__(96631); -Object.defineProperty(exports, "ParentBasedSampler", ({ enumerable: true, get: function () { return ParentBasedSampler_1.ParentBasedSampler; } })); -var TraceIdRatioBasedSampler_1 = __nccwpck_require__(68339); -Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); -var suppress_tracing_1 = __nccwpck_require__(65489); -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 = __nccwpck_require__(97990); -Object.defineProperty(exports, "TraceState", ({ enumerable: true, get: function () { return TraceState_1.TraceState; } })); -var environment_1 = __nccwpck_require__(51763); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_ENVIRONMENT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_ENVIRONMENT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT; } })); -Object.defineProperty(exports, "DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT", ({ enumerable: true, get: function () { return environment_1.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT; } })); -Object.defineProperty(exports, "parseEnvironment", ({ enumerable: true, get: function () { return environment_1.parseEnvironment; } })); -var merge_1 = __nccwpck_require__(5715); -Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); -var sampling_1 = __nccwpck_require__(60343); -Object.defineProperty(exports, "TracesSamplerValues", ({ enumerable: true, get: function () { return sampling_1.TracesSamplerValues; } })); -var timeout_1 = __nccwpck_require__(86560); -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 = __nccwpck_require__(28561); -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 wrap_1 = __nccwpck_require__(94858); -Object.defineProperty(exports, "isWrapped", ({ enumerable: true, get: function () { return wrap_1.isWrapped; } })); -var callback_1 = __nccwpck_require__(17166); -Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); -var version_1 = __nccwpck_require__(41187); -Object.defineProperty(exports, "VERSION", ({ enumerable: true, get: function () { return version_1.VERSION; } })); -const exporter_1 = __nccwpck_require__(40459); -exports.internal = { - _export: exporter_1._export, -}; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 40459: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._export = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(65489); -/** - * @internal - * Shared functionality used by Exporters while exporting data, including suppression of Traces. - */ -function _export(exporter, arg) { - return new Promise(resolve => { - // prevent downstream exporter calls from generating spans - api_1.context.with((0, suppress_tracing_1.suppressTracing)(api_1.context.active()), () => { - exporter.export(arg, (result) => { - resolve(result); - }); - }); - }); -} -exports._export = _export; -//# sourceMappingURL=exporter.js.map - -/***/ }), - -/***/ 73125: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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 = 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; -//# sourceMappingURL=validators.js.map - -/***/ }), - -/***/ 64237: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.otperformance = exports.hexToBase64 = exports.getEnvWithoutDefaults = exports.getEnv = exports._globalThis = exports.SDK_INFO = exports.RandomIdGenerator = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -var node_1 = __nccwpck_require__(89061); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return node_1.RandomIdGenerator; } })); -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, "getEnv", ({ enumerable: true, get: function () { return node_1.getEnv; } })); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return node_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return node_1.hexToBase64; } })); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return node_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 31399: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = void 0; -const SPAN_ID_BYTES = 8; -const TRACE_ID_BYTES = 16; -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - */ -class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.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++) { - // unsigned right shift drops decimal part of the number - // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE - SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); - } - // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated - 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); - }; -} -//# sourceMappingURL=RandomIdGenerator.js.map - -/***/ }), - -/***/ 43901: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEnvWithoutDefaults = exports.getEnv = void 0; -const environment_1 = __nccwpck_require__(51763); -/** - * Gets the environment variables - */ -function getEnv() { - const processEnv = (0, environment_1.parseEnvironment)(process.env); - return Object.assign({}, environment_1.DEFAULT_ENVIRONMENT, processEnv); -} -exports.getEnv = getEnv; -function getEnvWithoutDefaults() { - return (0, environment_1.parseEnvironment)(process.env); -} -exports.getEnvWithoutDefaults = getEnvWithoutDefaults; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 15351: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 55759: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBase64 = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -const hex_to_binary_1 = __nccwpck_require__(12409); -function hexToBase64(hexStr) { - return Buffer.from((0, hex_to_binary_1.hexToBinary)(hexStr)).toString('base64'); -} -exports.hexToBase64 = hexToBase64; -//# sourceMappingURL=hex-to-base64.js.map - -/***/ }), - -/***/ 89061: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = exports.SDK_INFO = exports.otperformance = exports.RandomIdGenerator = exports.hexToBase64 = exports._globalThis = exports.getEnv = exports.getEnvWithoutDefaults = void 0; -var environment_1 = __nccwpck_require__(43901); -Object.defineProperty(exports, "getEnvWithoutDefaults", ({ enumerable: true, get: function () { return environment_1.getEnvWithoutDefaults; } })); -Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return environment_1.getEnv; } })); -var globalThis_1 = __nccwpck_require__(15351); -Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return globalThis_1._globalThis; } })); -var hex_to_base64_1 = __nccwpck_require__(55759); -Object.defineProperty(exports, "hexToBase64", ({ enumerable: true, get: function () { return hex_to_base64_1.hexToBase64; } })); -var RandomIdGenerator_1 = __nccwpck_require__(31399); -Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); -var performance_1 = __nccwpck_require__(72076); -Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return performance_1.otperformance; } })); -var sdk_info_1 = __nccwpck_require__(16237); -Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); -var timer_util_1 = __nccwpck_require__(25003); -Object.defineProperty(exports, "unrefTimer", ({ enumerable: true, get: function () { return timer_util_1.unrefTimer; } })); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 72076: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.otperformance = void 0; -const perf_hooks_1 = __nccwpck_require__(4074); -exports.otperformance = perf_hooks_1.performance; -//# sourceMappingURL=performance.js.map - -/***/ }), - -/***/ 16237: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SDK_INFO = void 0; -const version_1 = __nccwpck_require__(41187); -const semantic_conventions_1 = __nccwpck_require__(67275); -/** Constants describing the SDK in use */ -exports.SDK_INFO = { - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_NAME]: 'opentelemetry', - [semantic_conventions_1.SEMRESATTRS_PROCESS_RUNTIME_NAME]: 'node', - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TELEMETRYSDKLANGUAGEVALUES_NODEJS, - [semantic_conventions_1.SEMRESATTRS_TELEMETRY_SDK_VERSION]: version_1.VERSION, -}; -//# sourceMappingURL=sdk-info.js.map - -/***/ }), - -/***/ 25003: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -function unrefTimer(timer) { - timer.unref(); -} -exports.unrefTimer = unrefTimer; -//# sourceMappingURL=timer-util.js.map - -/***/ }), - -/***/ 27514: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompositePropagator = void 0; -const api_1 = __nccwpck_require__(65163); -/** Combines multiple propagators into a single propagator. */ -class CompositePropagator { - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ - constructor(config = {}) { - var _a; - this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; - this._fields = Array.from(new Set(this._propagators - // older propagators may not have fields function, null check to be sure - .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, carrier, setter) { - for (const propagator of this._propagators) { - try { - propagator.inject(context, 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, 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); - } - fields() { - // return a new array so our fields cannot be modified - return this._fields.slice(); - } -} -exports.CompositePropagator = CompositePropagator; -//# sourceMappingURL=composite.js.map - -/***/ }), - -/***/ 97990: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceState = void 0; -const validators_1 = __nccwpck_require__(73125); -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. - */ -class TraceState { - constructor(rawTraceState) { - this._internalState = new Map(); - if (rawTraceState) - this._parse(rawTraceState); - } - set(key, value) { - // TODO: Benchmark the different approaches(map vs list) and - // use the faster one. - 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() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { - const listMember = part.trim(); // Optional Whitespace (OWS) handling - 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); - } - else { - // TODO: Consider to add warning log - } - } - return agg; - }, new Map()); - // Because of the reverse() requirement, trunc must be done after map is created - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { - this._internalState = new Map(Array.from(this._internalState.entries()) - .reverse() // Use reverse same as original tracestate parse chain - .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; -//# sourceMappingURL=TraceState.js.map - -/***/ }), - -/***/ 45146: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; -const api_1 = __nccwpck_require__(65163); -const suppress_tracing_1 = __nccwpck_require__(65489); -const TraceState_1 = __nccwpck_require__(97990); -exports.TRACE_PARENT_HEADER = 'traceparent'; -exports.TRACE_STATE_HEADER = 'tracestate'; -const VERSION = '00'; -const VERSION_PART = '(?!ff)[\\da-f]{2}'; -const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; -const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; -const FLAGS_PART = '[\\da-f]{2}'; -const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\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; - // According to the specification the implementation should be compatible - // with future versions. If there are more parts, we only reject it if it's using version 00 - // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent - 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/ - */ -class W3CTraceContextPropagator { - inject(context, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context); - if (!spanContext || - (0, suppress_tracing_1.isTracingSuppressed)(context) || - !(0, api_1.isSpanContextValid)(spanContext)) - return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) { - setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } - } - extract(context, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) - return context; - const traceParent = Array.isArray(traceParentHeader) - ? traceParentHeader[0] - : traceParentHeader; - if (typeof traceParent !== 'string') - return context; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) - return context; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - // If more than one `tracestate` header is found, we merge them into a - // single header. - const state = Array.isArray(traceStateHeader) - ? traceStateHeader.join(',') - : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); - } - return api_1.trace.setSpanContext(context, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; - } -} -exports.W3CTraceContextPropagator = W3CTraceContextPropagator; -//# sourceMappingURL=W3CTraceContextPropagator.js.map - -/***/ }), - -/***/ 28981: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; -const api_1 = __nccwpck_require__(65163); -const RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA'); -var RPCType; -(function (RPCType) { - RPCType["HTTP"] = "http"; -})(RPCType = exports.RPCType || (exports.RPCType = {})); -function setRPCMetadata(context, meta) { - return context.setValue(RPC_METADATA_KEY, meta); -} -exports.setRPCMetadata = setRPCMetadata; -function deleteRPCMetadata(context) { - return context.deleteValue(RPC_METADATA_KEY); -} -exports.deleteRPCMetadata = deleteRPCMetadata; -function getRPCMetadata(context) { - return context.getValue(RPC_METADATA_KEY); -} -exports.getRPCMetadata = getRPCMetadata; -//# sourceMappingURL=rpc-metadata.js.map - -/***/ }), - -/***/ 70416: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOffSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples no traces. - */ -class AlwaysOffSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return 'AlwaysOffSampler'; - } -} -exports.AlwaysOffSampler = AlwaysOffSampler; -//# sourceMappingURL=AlwaysOffSampler.js.map - -/***/ }), - -/***/ 58338: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOnSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples all traces. - */ -class AlwaysOnSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, - }; - } - toString() { - return 'AlwaysOnSampler'; - } -} -exports.AlwaysOnSampler = AlwaysOnSampler; -//# sourceMappingURL=AlwaysOnSampler.js.map - -/***/ }), - -/***/ 96631: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ParentBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -const global_error_handler_1 = __nccwpck_require__(82498); -const AlwaysOffSampler_1 = __nccwpck_require__(70416); -const AlwaysOnSampler_1 = __nccwpck_require__(58338); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ -class ParentBasedSampler { - constructor(config) { - var _a, _b, _c, _d; - this._root = config.root; - if (!this._root) { - (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured')); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context); - if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { - return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } -} -exports.ParentBasedSampler = ParentBasedSampler; -//# sourceMappingURL=ParentBasedSampler.js.map - -/***/ }), - -/***/ 68339: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceIdRatioBasedSampler = void 0; -const api_1 = __nccwpck_require__(65163); -/** - * @deprecated Use the one defined in @opentelemetry/sdk-trace-base instead. - * Sampler that samples a given fraction of traces based of trace id deterministically. - */ -class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); - } - shouldSample(context, traceId) { - return { - decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound - ? api_1.SamplingDecision.RECORD_AND_SAMPLED - : api_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 < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } -} -exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -//# sourceMappingURL=TraceIdRatioBasedSampler.js.map - -/***/ }), - -/***/ 65489: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; -const api_1 = __nccwpck_require__(65163); -const SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); -function suppressTracing(context) { - return context.setValue(SUPPRESS_TRACING_KEY, true); -} -exports.suppressTracing = suppressTracing; -function unsuppressTracing(context) { - return context.deleteValue(SUPPRESS_TRACING_KEY); -} -exports.unsuppressTracing = unsuppressTracing; -function isTracingSuppressed(context) { - return context.getValue(SUPPRESS_TRACING_KEY) === true; -} -exports.isTracingSuppressed = isTracingSuppressed; -//# sourceMappingURL=suppress-tracing.js.map - -/***/ }), - -/***/ 17166: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BindOnceFuture = void 0; -const promise_1 = __nccwpck_require__(30380); -/** - * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked. - */ -class BindOnceFuture { - constructor(_callback, _that) { - this._callback = _callback; - this._that = _that; - this._isCalled = false; - this._deferred = new promise_1.Deferred(); - } - 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; -//# sourceMappingURL=callback.js.map - -/***/ }), - -/***/ 51763: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; -const api_1 = __nccwpck_require__(65163); -const sampling_1 = __nccwpck_require__(60343); -const DEFAULT_LIST_SEPARATOR = ','; -/** - * Environment interface to define all names - */ -const ENVIRONMENT_BOOLEAN_KEYS = ['OTEL_SDK_DISABLED']; -function isEnvVarABoolean(key) { - return (ENVIRONMENT_BOOLEAN_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_NUMBERS_KEYS = [ - 'OTEL_BSP_EXPORT_TIMEOUT', - 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BSP_MAX_QUEUE_SIZE', - 'OTEL_BSP_SCHEDULE_DELAY', - 'OTEL_BLRP_EXPORT_TIMEOUT', - 'OTEL_BLRP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BLRP_MAX_QUEUE_SIZE', - 'OTEL_BLRP_SCHEDULE_DELAY', - 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_LINK_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT', - 'OTEL_EXPORTER_OTLP_TIMEOUT', - 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT', - 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT', - 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT', - 'OTEL_EXPORTER_JAEGER_AGENT_PORT', -]; -function isEnvVarANumber(key) { - return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_LISTS_KEYS = [ - 'OTEL_NO_PATCH_MODULES', - 'OTEL_PROPAGATORS', - 'OTEL_SEMCONV_STABILITY_OPT_IN', -]; -function isEnvVarAList(key) { - return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; -} -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; -exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT = 128; -exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT = 128; -/** - * Default environment variables - */ -exports.DEFAULT_ENVIRONMENT = { - OTEL_SDK_DISABLED: false, - CONTAINER_NAME: '', - ECS_CONTAINER_METADATA_URI_V4: '', - ECS_CONTAINER_METADATA_URI: '', - HOSTNAME: '', - KUBERNETES_SERVICE_HOST: '', - NAMESPACE: '', - OTEL_BSP_EXPORT_TIMEOUT: 30000, - OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BSP_MAX_QUEUE_SIZE: 2048, - OTEL_BSP_SCHEDULE_DELAY: 5000, - OTEL_BLRP_EXPORT_TIMEOUT: 30000, - OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BLRP_MAX_QUEUE_SIZE: 2048, - OTEL_BLRP_SCHEDULE_DELAY: 5000, - OTEL_EXPORTER_JAEGER_AGENT_HOST: '', - OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832, - OTEL_EXPORTER_JAEGER_ENDPOINT: '', - OTEL_EXPORTER_JAEGER_PASSWORD: '', - OTEL_EXPORTER_JAEGER_USER: '', - OTEL_EXPORTER_OTLP_ENDPOINT: '', - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_HEADERS: '', - OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', - OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', - OTEL_EXPORTER_OTLP_LOGS_HEADERS: '', - OTEL_EXPORTER_OTLP_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000, - OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 10000, - OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', - OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, - OTEL_NO_PATCH_MODULES: [], - OTEL_PROPAGATORS: ['tracecontext', 'baggage'], - OTEL_RESOURCE_ATTRIBUTES: '', - OTEL_SERVICE_NAME: '', - OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_EVENT_COUNT_LIMIT: 128, - OTEL_SPAN_LINK_COUNT_LIMIT: 128, - OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: exports.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT, - OTEL_TRACES_EXPORTER: '', - OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, - OTEL_TRACES_SAMPLER_ARG: '', - OTEL_LOGS_EXPORTER: '', - OTEL_EXPORTER_OTLP_INSECURE: '', - OTEL_EXPORTER_OTLP_TRACES_INSECURE: '', - OTEL_EXPORTER_OTLP_METRICS_INSECURE: '', - OTEL_EXPORTER_OTLP_LOGS_INSECURE: '', - OTEL_EXPORTER_OTLP_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_COMPRESSION: '', - OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '', - OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: '', - OTEL_EXPORTER_OTLP_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: '', - OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: '', - OTEL_EXPORTER_OTLP_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: 'http/protobuf', - OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: 'cumulative', - OTEL_SEMCONV_STABILITY_OPT_IN: [], -}; -/** - * @param key - * @param environment - * @param values - */ -function parseBoolean(key, environment, values) { - if (typeof values[key] === 'undefined') { - return; - } - const value = String(values[key]); - // support case-insensitive "true" - environment[key] = value.toLowerCase() === 'true'; -} -/** - * Parses a variable as number with number validation - * @param name - * @param environment - * @param values - * @param min - * @param max - */ -function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { - if (typeof values[name] !== 'undefined') { - const value = Number(values[name]); - if (!isNaN(value)) { - if (value < min) { - environment[name] = min; - } - else if (value > max) { - environment[name] = max; - } - else { - environment[name] = value; - } - } - } -} -/** - * Parses list-like strings from input into output. - * @param name - * @param environment - * @param values - * @param separator - */ -function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { - const givenValue = input[name]; - if (typeof givenValue === 'string') { - output[name] = givenValue.split(separator).map(v => v.trim()); - } -} -// The support string -> DiagLogLevel mappings -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, -}; -/** - * Environmentally sets log level if valid log level string is provided - * @param key - * @param environment - * @param values - */ -function setLogLevelFromEnv(key, environment, values) { - const value = values[key]; - if (typeof value === 'string') { - const theLevel = logLevelMap[value.toUpperCase()]; - if (theLevel != null) { - environment[key] = theLevel; - } - } -} -/** - * Parses environment values - * @param values - */ -function parseEnvironment(values) { - const environment = {}; - for (const env in exports.DEFAULT_ENVIRONMENT) { - const key = env; - switch (key) { - case 'OTEL_LOG_LEVEL': - setLogLevelFromEnv(key, environment, values); - break; - default: - if (isEnvVarABoolean(key)) { - parseBoolean(key, environment, values); - } - else if (isEnvVarANumber(key)) { - parseNumber(key, environment, values); - } - else if (isEnvVarAList(key)) { - parseStringList(key, environment, values); - } - else { - const value = values[key]; - if (typeof value !== 'undefined' && value !== null) { - environment[key] = String(value); - } - } - } - } - return environment; -} -exports.parseEnvironment = parseEnvironment; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 20253: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPlainObject = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/** - * 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 funcProto = Function.prototype; -const funcToString = funcProto.toString; -const objectCtorString = funcToString.call(Object); -const getPrototype = overArg(Object.getPrototypeOf, Object); -const objectProto = Object.prototype; -const hasOwnProperty = objectProto.hasOwnProperty; -const symToStringTag = Symbol ? Symbol.toStringTag : undefined; -const nativeObjectToString = objectProto.toString; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function (arg) { - return func(transform(arg)); - }; -} -/** - * 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 = getPrototype(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 === undefined ? 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] = undefined; - unmasked = true; - } - catch (e) { - // silence - } - 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); -} -//# sourceMappingURL=lodash.merge.js.map - -/***/ }), - -/***/ 5715: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.merge = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -const lodash_merge_1 = __nccwpck_require__(20253); -const MAX_LEVEL = 20; -/** - * Merges objects together - * @param args - objects / values to be merged - */ -function merge(...args) { - let result = args.shift(); - const objects = 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 undefined; - } - 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] = takeValue(twoValue); - 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; -} -//# sourceMappingURL=merge.js.map - -/***/ }), - -/***/ 30380: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Deferred = void 0; -class Deferred { - 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; -//# sourceMappingURL=promise.js.map - -/***/ }), - -/***/ 60343: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TracesSamplerValues = void 0; -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 = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); -//# sourceMappingURL=sampling.js.map - -/***/ }), - -/***/ 86560: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.callWithTimeout = exports.TimeoutError = void 0; -/** - * Error that is thrown on timeouts. - */ -class TimeoutError extends Error { - constructor(message) { - super(message); - // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: - // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work - 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; -//# sourceMappingURL=timeout.js.map - -/***/ }), - -/***/ 28561: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isUrlIgnored = exports.urlMatches = void 0; -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -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; -//# sourceMappingURL=url.js.map - -/***/ }), - -/***/ 94858: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWrapped = void 0; -/** - * Checks if certain function has been already wrapped - * @param func - */ -function isWrapped(func) { - return (typeof func === 'function' && - typeof func.__original === 'function' && - typeof func.__unwrap === 'function' && - func.__wrapped === true); -} -exports.isWrapped = isWrapped; -//# sourceMappingURL=wrap.js.map - -/***/ }), - -/***/ 41187: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry 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 - * - * https://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. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.30.1'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 78369: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -var { - _optionalChain -} = __nccwpck_require__(84466); - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -const semanticConventions = __nccwpck_require__(67275); const core = __nccwpck_require__(84466); + +function setHttpServerSpanRouteAttribute(route) { + const activeSpan = core.getActiveSpan(); + if (!activeSpan) { + return; + } + const rootSpan = core.getRootSpan(activeSpan); + if (!rootSpan) { + return; + } + if (core.spanToJSON(rootSpan).data[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] !== "http.server") { + return; + } + rootSpan.setAttribute("http.route", route); +} + +exports.setHttpServerSpanRouteAttribute = setHttpServerSpanRouteAttribute; +//# sourceMappingURL=setHttpServerSpanRouteAttribute.js.map + + +/***/ }), + +/***/ 79271: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + const api = __nccwpck_require__(65163); -const core$1 = __nccwpck_require__(46033); -const sdkTraceBase = __nccwpck_require__(29253); -const instrumentation = __nccwpck_require__(65584); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const sdkTraceBase = __nccwpck_require__(88266); +const core$1 = __nccwpck_require__(89736); -/** If this attribute is true, it means that the parent is a remote span. */ -const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = 'sentry.parentIsRemote'; +const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = "sentry.parentIsRemote"; +const SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = "sentry.graphql.operation"; -// These are not standardized yet, but used by the graphql instrumentation -const SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = 'sentry.graphql.operation'; - -/** - * Check if a given span has attributes. - * This is necessary because the base `Span` type does not have attributes, - * so in places where we are passed a generic span, we need to check if we want to access them. - */ -function spanHasAttributes( - span, -) { - const castSpan = span ; - return !!castSpan.attributes && typeof castSpan.attributes === 'object'; +function getParentSpanId(span) { + if ("parentSpanId" in span) { + return span.parentSpanId; + } else if ("parentSpanContext" in span) { + return span.parentSpanContext?.spanId; + } + return void 0; } -/** - * Check if a given span has a kind. - * This is necessary because the base `Span` type does not have a kind, - * so in places where we are passed a generic span, we need to check if we want to access it. - */ +function spanHasAttributes(span) { + const castSpan = span; + return core.isObjectLike(castSpan.attributes); +} function spanHasKind(span) { - const castSpan = span ; - return typeof castSpan.kind === 'number'; + const castSpan = span; + return typeof castSpan.kind === "number"; } - -/** - * Check if a given span has a status. - * This is necessary because the base `Span` type does not have a status, - * so in places where we are passed a generic span, we need to check if we want to access it. - */ -function spanHasStatus( - span, -) { - const castSpan = span ; +function spanHasStatus(span) { + const castSpan = span; return !!castSpan.status; } - -/** - * Check if a given span has a name. - * This is necessary because the base `Span` type does not have a name, - * so in places where we are passed a generic span, we need to check if we want to access it. - */ function spanHasName(span) { - const castSpan = span ; + const castSpan = span; return !!castSpan.name; } - -/** - * Check if a given span has a kind. - * This is necessary because the base `Span` type does not have a kind, - * so in places where we are passed a generic span, we need to check if we want to access it. - */ -function spanHasParentId( - span, -) { - const castSpan = span ; - return !!castSpan.parentSpanId; +function spanHasParentId(span) { + const castSpan = span; + return !!getParentSpanId(castSpan); } - -/** - * Check if a given span has events. - * This is necessary because the base `Span` type does not have events, - * so in places where we are passed a generic span, we need to check if we want to access it. - */ -function spanHasEvents( - span, -) { - const castSpan = span ; +function spanHasEvents(span) { + const castSpan = span; return Array.isArray(castSpan.events); } -/** - * Get sanitizied request data from an OTEL span. - */ function getRequestSpanData(span) { - // The base `Span` type has no `attributes`, so we need to guard here against that if (!spanHasAttributes(span)) { return {}; } - - // eslint-disable-next-line deprecation/deprecation - const maybeUrlAttribute = (span.attributes[semanticConventions.ATTR_URL_FULL] || span.attributes[semanticConventions.SEMATTRS_HTTP_URL]) - -; - + const maybeUrlAttribute = span.attributes[attributes.URL_FULL] || span.attributes[attributes.HTTP_URL]; const data = { url: maybeUrlAttribute, - // eslint-disable-next-line deprecation/deprecation - 'http.method': (span.attributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD] || span.attributes[semanticConventions.SEMATTRS_HTTP_METHOD]) - -, + // eslint-disable-next-line typescript/no-deprecated + "http.method": span.attributes[attributes.HTTP_REQUEST_METHOD] || span.attributes[attributes.HTTP_METHOD] }; - - // Default to GET if URL is set but method is not - if (!data['http.method'] && data.url) { - data['http.method'] = 'GET'; + if (!data["http.method"] && data.url) { + data["http.method"] = "GET"; } - try { - if (typeof maybeUrlAttribute === 'string') { + if (typeof maybeUrlAttribute === "string") { const url = core.parseUrl(maybeUrlAttribute); - data.url = core.getSanitizedUrlString(url); - if (url.search) { - data['http.query'] = url.search; + data["http.query"] = url.search; } if (url.hash) { - data['http.fragment'] = url.hash; + data["http.fragment"] = url.hash; } } - } catch (e) { - // ignore + } catch { } - return data; } -function _optionalChain$6(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } - -// Typescript complains if we do not use `...args: any[]` for the mixin, with: -// A mixin class must have a constructor with a single rest parameter of type 'any[]'.ts(2545) -/* eslint-disable @typescript-eslint/no-explicit-any */ - -/** - * Wrap an Client with things we need for OpenTelemetry support. - * - * Usage: - * const OpenTelemetryClient = getWrappedClientClass(NodeClient); - * const client = new OpenTelemetryClient(options); - */ -function wrapClientClass - -(ClientClass) { - class OpenTelemetryClient extends ClientClass { - - constructor(...args) { +function wrapClientClass(ClientClass) { + class OpenTelemetryClient extends ClientClass { + constructor(...args) { super(...args); } - /** Get the OTEL tracer. */ - get tracer() { + get tracer() { if (this._tracer) { return this._tracer; } - - const name = '@sentry/opentelemetry'; + const name = "@sentry/opentelemetry"; const version = core.SDK_VERSION; const tracer = api.trace.getTracer(name, version); this._tracer = tracer; - return tracer; } - /** * @inheritDoc */ - async flush(timeout) { + async flush(timeout) { const provider = this.traceProvider; - const spanProcessor = _optionalChain$6([provider, 'optionalAccess', _ => _.activeSpanProcessor]); - - if (spanProcessor) { - await spanProcessor.forceFlush(); - } - + await provider?.forceFlush(); return super.flush(timeout); } } - - return OpenTelemetryClient ; + return OpenTelemetryClient; } -/* eslint-enable @typescript-eslint/no-explicit-any */ -/** - * Get the span kind from a span. - * For whatever reason, this is not public API on the generic "Span" type, - * so we need to check if we actually have a `SDKTraceBaseSpan` where we can fetch this from. - * Otherwise, we fall back to `SpanKind.INTERNAL`. - */ function getSpanKind(span) { if (spanHasKind(span)) { return span.kind; } - return api.SpanKind.INTERNAL; } -const SENTRY_TRACE_HEADER = 'sentry-trace'; -const SENTRY_BAGGAGE_HEADER = 'baggage'; +const SENTRY_TRACE_HEADER = "sentry-trace"; +const SENTRY_BAGGAGE_HEADER = "baggage"; +const SENTRY_TRACE_STATE_DSC = "sentry.dsc"; +const SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = "sentry.sampled_not_recording"; +const SENTRY_TRACE_STATE_URL = "sentry.url"; +const SENTRY_TRACE_STATE_SAMPLE_RAND = "sentry.sample_rand"; +const SENTRY_TRACE_STATE_SAMPLE_RATE = "sentry.sample_rate"; +const SENTRY_TRACE_STATE_CHILD_IGNORED = "sentry.ignored"; +const SENTRY_TRACE_STATE_SEGMENT_IGNORED = "sentry.segment_ignored"; +const SENTRY_SCOPES_CONTEXT_KEY = api.createContextKey("sentry_scopes"); +const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY = api.createContextKey("sentry_fork_isolation_scope"); +const SENTRY_FORK_SET_SCOPE_CONTEXT_KEY = api.createContextKey("sentry_fork_set_scope"); +const SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY = api.createContextKey("sentry_fork_set_isolation_scope"); -const SENTRY_TRACE_STATE_DSC = 'sentry.dsc'; -const SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = 'sentry.sampled_not_recording'; -const SENTRY_TRACE_STATE_URL = 'sentry.url'; - -const SENTRY_SCOPES_CONTEXT_KEY = api.createContextKey('sentry_scopes'); - -const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY = api.createContextKey('sentry_fork_isolation_scope'); - -const SENTRY_FORK_SET_SCOPE_CONTEXT_KEY = api.createContextKey('sentry_fork_set_scope'); - -const SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY = api.createContextKey('sentry_fork_set_isolation_scope'); - -const SCOPE_CONTEXT_FIELD = '_scopeContext'; - -/** - * Try to get the current scopes from the given OTEL context. - * This requires a Context Manager that was wrapped with getWrappedContextManager. - */ +const SCOPE_CONTEXT_FIELD = "_scopeContext"; function getScopesFromContext(context) { - return context.getValue(SENTRY_SCOPES_CONTEXT_KEY) ; + return context.getValue(SENTRY_SCOPES_CONTEXT_KEY); } - -/** - * Set the current scopes on an OTEL context. - * This will return a forked context with the Propagation Context set. - */ function setScopesOnContext(context, scopes) { return context.setValue(SENTRY_SCOPES_CONTEXT_KEY, scopes); } - -/** - * Set the context on the scope so we can later look it up. - * We need this to get the context from the scope in the `trace` functions. - */ function setContextOnScope(scope, context) { - core.addNonEnumerableProperty(scope, SCOPE_CONTEXT_FIELD, context); + core.addNonEnumerableProperty(scope, SCOPE_CONTEXT_FIELD, core.makeWeakRef(context)); } - -/** - * Get the context related to a scope. - * TODO v8: Use this for the `trace` functions. - * */ function getContextFromScope(scope) { - return (scope )[SCOPE_CONTEXT_FIELD]; + return core.derefWeakRef(scope[SCOPE_CONTEXT_FIELD]); } -/** - * - * @param otelSpan Checks whether a given OTEL Span is an http request to sentry. - * @returns boolean - */ function isSentryRequestSpan(span) { if (!spanHasAttributes(span)) { return false; } - - const { attributes } = span; - - // `ATTR_URL_FULL` is the new attribute, but we still support the old one, `ATTR_HTTP_URL`, for now. - // eslint-disable-next-line deprecation/deprecation - const httpUrl = attributes[semanticConventions.SEMATTRS_HTTP_URL] || attributes[semanticConventions.ATTR_URL_FULL]; - + const { attributes: attributes$1 } = span; + const httpUrl = attributes$1[attributes.HTTP_URL] || attributes$1[attributes.URL_FULL]; if (!httpUrl) { return false; } - return core.isSentryRequestUrl(httpUrl.toString(), core.getClient()); } -function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } - -/** - * OpenTelemetry only knows about SAMPLED or NONE decision, - * but for us it is important to differentiate between unset and unsampled. - * - * Both of these are identified as `traceFlags === TracegFlags.NONE`, - * but we additionally look at a special trace state to differentiate between them. - */ function getSamplingDecision(spanContext) { const { traceFlags, traceState } = spanContext; - - const sampledNotRecording = traceState ? traceState.get(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING) === '1' : false; - - // If trace flag is `SAMPLED`, we interpret this as sampled - // If it is `NONE`, it could mean either it was sampled to be not recorder, or that it was not sampled at all - // For us this is an important difference, sow e look at the SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING - // to identify which it is + const sampledNotRecording = traceState ? traceState.get(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING) === "1" : false; if (traceFlags === api.TraceFlags.SAMPLED) { return true; } - if (sampledNotRecording) { return false; } - - // Fall back to DSC as a last resort, that may also contain `sampled`... - const dscString = traceState ? traceState.get(SENTRY_TRACE_STATE_DSC) : undefined; - const dsc = dscString ? core.baggageHeaderToDynamicSamplingContext(dscString) : undefined; - - if (_optionalChain$5([dsc, 'optionalAccess', _ => _.sampled]) === 'true') { + const dscString = traceState ? traceState.get(SENTRY_TRACE_STATE_DSC) : void 0; + const dsc = dscString ? core.baggageHeaderToDynamicSamplingContext(dscString) : void 0; + if (dsc?.sampled === "true") { return true; } - if (_optionalChain$5([dsc, 'optionalAccess', _2 => _2.sampled]) === 'false') { + if (dsc?.sampled === "false") { return false; } - - return undefined; + return void 0; +} +function getSampledForPropagation(span, client) { + const spanContext = span.spanContext(); + const rootSpan = core.getRootSpan(span); + const samplingDecision = getSamplingDecision(spanContext); + if (samplingDecision !== void 0) { + return samplingDecision; + } + if (core.spanIsIgnored(rootSpan)) { + return false; + } + if (!core.hasSpansEnabled(client?.getOptions()) || spanContext.isRemote || !core.spanIsSentrySpan(rootSpan)) { + return void 0; + } + return core.spanIsSampled(span); } -/** - * Infer the op & description for a set of name, attributes and kind of a span. - */ -function inferSpanData(spanName, attributes, kind) { - // if http.method exists, this is an http request span - // eslint-disable-next-line deprecation/deprecation - const httpMethod = attributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD] || attributes[semanticConventions.SEMATTRS_HTTP_METHOD]; +function inferSpanData(spanName, attributes$1, kind) { + const httpMethod = attributes$1[attributes.HTTP_REQUEST_METHOD] || attributes$1[attributes.HTTP_METHOD]; if (httpMethod) { - return descriptionForHttpMethod({ attributes, name: spanName, kind }, httpMethod); + return descriptionForHttpMethod({ attributes: attributes$1, name: spanName, kind }, httpMethod); } - - // eslint-disable-next-line deprecation/deprecation - const dbSystem = attributes[semanticConventions.SEMATTRS_DB_SYSTEM]; - const opIsCache = - typeof attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'string' && - attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP].startsWith('cache.'); - - // If db.type exists then this is a database call span - // If the Redis DB is used as a cache, the span description should not be changed + const dbSystem = attributes$1[attributes.DB_SYSTEM_NAME] || attributes$1[attributes.DB_SYSTEM]; + const opIsCache = typeof attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] === "string" && attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_OP].startsWith("cache."); if (dbSystem && !opIsCache) { - return descriptionForDbSystem({ attributes, name: spanName }); + return descriptionForDbSystem({ attributes: attributes$1, name: spanName }); } - - const customSourceOrRoute = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom' ? 'custom' : 'route'; - - // If rpc.service exists then this is a rpc call span. - // eslint-disable-next-line deprecation/deprecation - const rpcService = attributes[semanticConventions.SEMATTRS_RPC_SERVICE]; + const customSourceOrRoute = attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === "custom" ? "custom" : "route"; + const rpcService = attributes$1[attributes.RPC_SERVICE]; if (rpcService) { return { - ...getUserUpdatedNameAndSource(spanName, attributes, 'route'), - op: 'rpc', + ...getUserUpdatedNameAndSource(spanName, attributes$1, "route"), + op: "rpc" }; } - - // If messaging.system exists then this is a messaging system span. - // eslint-disable-next-line deprecation/deprecation - const messagingSystem = attributes[semanticConventions.SEMATTRS_MESSAGING_SYSTEM]; + const messagingSystem = attributes$1[attributes.MESSAGING_SYSTEM]; if (messagingSystem) { return { - ...getUserUpdatedNameAndSource(spanName, attributes, customSourceOrRoute), - op: 'message', + ...getUserUpdatedNameAndSource(spanName, attributes$1, customSourceOrRoute), + op: "message" }; } - - // If faas.trigger exists then this is a function as a service span. - // eslint-disable-next-line deprecation/deprecation - const faasTrigger = attributes[semanticConventions.SEMATTRS_FAAS_TRIGGER]; + const faasTrigger = attributes$1[attributes.FAAS_TRIGGER]; if (faasTrigger) { return { - ...getUserUpdatedNameAndSource(spanName, attributes, customSourceOrRoute), - op: faasTrigger.toString(), + ...getUserUpdatedNameAndSource(spanName, attributes$1, customSourceOrRoute), + op: faasTrigger.toString() }; } - - return { op: undefined, description: spanName, source: 'custom' }; + return { op: void 0, description: spanName, source: "custom" }; } - -/** - * Extract better op/description from an otel span. - * - * Does not overwrite the span name if the source is already set to custom to ensure - * that user-updated span names are preserved. In this case, we only adjust the op but - * leave span description and source unchanged. - * - * Based on https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/7422ce2a06337f68a59b552b8c5a2ac125d6bae5/exporter/sentryexporter/sentry_exporter.go#L306 - */ function parseSpanDescription(span) { - const attributes = spanHasAttributes(span) ? span.attributes : {}; - const name = spanHasName(span) ? span.name : ''; + let attributes; + let name; + if (spanHasAttributes(span)) { + attributes = span.attributes; + name = spanHasName(span) ? span.name : ""; + } else { + const json = typeof span.spanContext === "function" ? core.spanToJSON(span) : void 0; + attributes = json?.data || {}; + name = spanHasName(span) ? span.name : json?.description || ""; + } const kind = getSpanKind(span); - return inferSpanData(name, attributes, kind); } - -function descriptionForDbSystem({ attributes, name }) { - // if we already have a custom name, we don't overwrite it but only set the op - const userDefinedName = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; - if (typeof userDefinedName === 'string') { +function descriptionForDbSystem({ attributes: attributes$1, name }) { + const userDefinedName = attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + if (typeof userDefinedName === "string") { return { - op: 'db', + op: "db", description: userDefinedName, - source: (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ) || 'custom', + source: attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] || "custom" }; } - - // if we already have the source set to custom, we don't overwrite the span description but only set the op - if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') { - return { op: 'db', description: name, source: 'custom' }; + if (attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === "custom") { + return { op: "db", description: name, source: "custom" }; } - - // Use DB statement (Ex "SELECT * FROM table") if possible as description. - // eslint-disable-next-line deprecation/deprecation - const statement = attributes[semanticConventions.SEMATTRS_DB_STATEMENT]; - + const statement = attributes$1[attributes.DB_STATEMENT]; const description = statement ? statement.toString() : name; - - return { op: 'db', description, source: 'task' }; + return { op: "db", description, source: "task" }; } - -/** Only exported for tests. */ -function descriptionForHttpMethod( - { name, kind, attributes }, - httpMethod, -) { - const opParts = ['http']; - +function descriptionForHttpMethod({ name, kind, attributes }, httpMethod) { + const opParts = ["http"]; switch (kind) { case api.SpanKind.CLIENT: - opParts.push('client'); + opParts.push("client"); break; case api.SpanKind.SERVER: - opParts.push('server'); + opParts.push("server"); break; } - - // Spans for HTTP requests we have determined to be prefetch requests will have a `.prefetch` postfix in the op - if (attributes['sentry.http.prefetch']) { - opParts.push('prefetch'); + if (attributes["sentry.http.prefetch"]) { + opParts.push("prefetch"); } - const { urlPath, url, query, fragment, hasRoute } = getSanitizedUrl(attributes, kind); - if (!urlPath) { - return { ...getUserUpdatedNameAndSource(name, attributes), op: opParts.join('.') }; + return { ...getUserUpdatedNameAndSource(name, attributes), op: opParts.join(".") }; } - const graphqlOperationsAttribute = attributes[SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION]; - - // Ex. GET /api/users const baseDescription = `${httpMethod} ${urlPath}`; - - // When the http span has a graphql operation, append it to the description - // We add these in the graphqlIntegration - const inferredDescription = graphqlOperationsAttribute - ? `${baseDescription} (${getGraphqlOperationNamesFromAttribute(graphqlOperationsAttribute)})` - : baseDescription; - - // If `httpPath` is a root path, then we can categorize the transaction source as route. - const inferredSource = hasRoute || urlPath === '/' ? 'route' : 'url'; - + const inferredDescription = graphqlOperationsAttribute ? `${baseDescription} (${getGraphqlOperationNamesFromAttribute(graphqlOperationsAttribute)})` : baseDescription; + const inferredSource = hasRoute || urlPath === "/" ? "route" : "url"; const data = {}; - if (url) { data.url = url; } if (query) { - data['http.query'] = query; + data["http.query"] = query.slice(1); } if (fragment) { - data['http.fragment'] = fragment; + data["http.fragment"] = fragment.slice(1); } - - // If the span kind is neither client nor server, we use the original name - // this infers that somebody manually started this span, in which case we don't want to overwrite the name const isClientOrServerKind = kind === api.SpanKind.CLIENT || kind === api.SpanKind.SERVER; - - // If the span is an auto-span (=it comes from one of our instrumentations), - // we always want to infer the name - // this is necessary because some of the auto-instrumentation we use uses kind=INTERNAL - const origin = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] || 'manual'; - const isManualSpan = !`${origin}`.startsWith('auto'); - - // If users (or in very rare occasions we) set the source to custom, we don't overwrite the name - const alreadyHasCustomSource = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom'; + const origin = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] || "manual"; + const isManualSpan = !`${origin}`.startsWith("auto"); + const alreadyHasCustomSource = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === "custom"; const customSpanName = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; - - const useInferredDescription = - !alreadyHasCustomSource && customSpanName == null && (isClientOrServerKind || !isManualSpan); - - const { description, source } = useInferredDescription - ? { description: inferredDescription, source: inferredSource } - : getUserUpdatedNameAndSource(name, attributes); - + const useInferredDescription = !alreadyHasCustomSource && customSpanName == null && (isClientOrServerKind || !isManualSpan); + const { description, source } = useInferredDescription ? { description: inferredDescription, source: inferredSource } : getUserUpdatedNameAndSource(name, attributes); return { - op: opParts.join('.'), + op: opParts.join("."), description, source, - data, + data }; } - function getGraphqlOperationNamesFromAttribute(attr) { if (Array.isArray(attr)) { const sorted = attr.slice().sort(); - - // Up to 5 items, we just add all of them if (sorted.length <= 5) { - return sorted.join(', '); + return sorted.join(", "); } else { - // Else, we add the first 5 and the diff of other operations - return `${sorted.slice(0, 5).join(', ')}, +${sorted.length - 5}`; + return `${sorted.slice(0, 5).join(", ")}, +${sorted.length - 5}`; } } - return `${attr}`; } - -/** Exported for tests only */ -function getSanitizedUrl( - attributes, - kind, -) - - { - // This is the relative path of the URL, e.g. /sub - // eslint-disable-next-line deprecation/deprecation - const httpTarget = attributes[semanticConventions.SEMATTRS_HTTP_TARGET]; - // This is the full URL, including host & query params etc., e.g. https://example.com/sub?foo=bar - // eslint-disable-next-line deprecation/deprecation - const httpUrl = attributes[semanticConventions.SEMATTRS_HTTP_URL] || attributes[semanticConventions.ATTR_URL_FULL]; - // This is the normalized route name - may not always be available! - const httpRoute = attributes[semanticConventions.ATTR_HTTP_ROUTE]; - - const parsedUrl = typeof httpUrl === 'string' ? core.parseUrl(httpUrl) : undefined; - const url = parsedUrl ? core.getSanitizedUrlString(parsedUrl) : undefined; - const query = parsedUrl && parsedUrl.search ? parsedUrl.search : undefined; - const fragment = parsedUrl && parsedUrl.hash ? parsedUrl.hash : undefined; - - if (typeof httpRoute === 'string') { +function getSanitizedUrl(attributes$1, kind) { + const httpTarget = attributes$1[attributes.HTTP_TARGET]; + const httpUrl = attributes$1[attributes.HTTP_URL] || attributes$1[attributes.URL_FULL]; + const httpRoute = attributes$1[attributes.HTTP_ROUTE]; + const parsedUrl = typeof httpUrl === "string" ? core.parseUrl(httpUrl) : void 0; + const url = parsedUrl ? core.getSanitizedUrlString(parsedUrl) : void 0; + const query = parsedUrl?.search || void 0; + const fragment = parsedUrl?.hash || void 0; + if (typeof httpRoute === "string") { return { urlPath: httpRoute, url, query, fragment, hasRoute: true }; } - - if (kind === api.SpanKind.SERVER && typeof httpTarget === 'string') { + if (kind === api.SpanKind.SERVER && typeof httpTarget === "string") { return { urlPath: core.stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false }; } - if (parsedUrl) { return { urlPath: url, url, query, fragment, hasRoute: false }; } - - // fall back to target even for client spans, if no URL is present - if (typeof httpTarget === 'string') { + if (typeof httpTarget === "string") { return { urlPath: core.stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false }; } - - return { urlPath: undefined, url, query, fragment, hasRoute: false }; + return { urlPath: void 0, url, query, fragment, hasRoute: false }; } - -/** - * Because Otel instrumentation sometimes mutates span names via `span.updateName`, the only way - * to ensure that a user-set span name is preserved is to store it as a tmp attribute on the span. - * We delete this attribute once we're done with it when preparing the event envelope. - * - * This temp attribute always takes precedence over the original name. - * - * We also need to take care of setting the correct source. Users can always update the source - * after updating the name, so we need to respect that. - * - * @internal exported only for testing - */ -function getUserUpdatedNameAndSource( - originalName, - attributes, - fallbackSource = 'custom', -) - - { - const source = (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ) || fallbackSource; +function getUserUpdatedNameAndSource(originalName, attributes, fallbackSource = "custom") { + const source = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] || fallbackSource; const description = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; - - if (description && typeof description === 'string') { + if (description && typeof description === "string") { return { description, - source, + source }; } - return { description: originalName, source }; } -/** - * Setup a DSC handler on the passed client, - * ensuring that the transaction name is inferred from the span correctly. - */ function enhanceDscWithOpenTelemetryRootSpanName(client) { - client.on('createDsc', (dsc, rootSpan) => { + client.on("createDsc", (dsc, rootSpan) => { if (!rootSpan) { return; } - - // We want to overwrite the transaction on the DSC that is created by default in core - // The reason for this is that we want to infer the span name, not use the initial one - // Otherwise, we'll get names like "GET" instead of e.g. "GET /foo" - // `parseSpanDescription` takes the attributes of the span into account for the name - // This mutates the passed-in DSC - const jsonSpan = core.spanToJSON(rootSpan); - const attributes = jsonSpan.data || {}; + const attributes = jsonSpan.data; const source = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; - - const { description } = spanHasName(rootSpan) ? parseSpanDescription(rootSpan) : { description: undefined }; - if (source !== 'url' && description) { - dsc.transaction = description; + const sampled = getSampledForPropagation(rootSpan, client); + if (sampled === false) { + delete dsc.transaction; + } else if (jsonSpan.description) { + const { description } = parseSpanDescription(rootSpan); + if (source !== "url" && description) { + dsc.transaction = description; + } } - - // Also ensure sampling decision is correctly inferred - // In core, we use `spanIsSampled`, which just looks at the trace flags - // but in OTEL, we use a slightly more complex logic to be able to differntiate between unsampled and deferred sampling - if (core.hasTracingEnabled()) { - const sampled = getSamplingDecision(rootSpan.spanContext()); - dsc.sampled = sampled == undefined ? undefined : String(sampled); + if (core.hasSpansEnabled()) { + dsc.sampled = sampled == void 0 ? void 0 : String(sampled); } }); } -/** - * Generate a TraceState for the given data. - */ -function makeTraceState({ - dsc, - sampled, -} - -) { - // We store the DSC as OTEL trace state on the span context - const dscString = dsc ? core.dynamicSamplingContextToSentryBaggageHeader(dsc) : undefined; - - const traceStateBase = new core$1.TraceState(); - - const traceStateWithDsc = dscString ? traceStateBase.set(SENTRY_TRACE_STATE_DSC, dscString) : traceStateBase; - - // We also specifically want to store if this is sampled to be not recording, - // or unsampled (=could be either sampled or not) - return sampled === false ? traceStateWithDsc.set(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING, '1') : traceStateWithDsc; -} - -/** - * Generates a SpanContext that represents a PropagationContext. - * This can be set on a `context` to make this a (virtual) active span. - * - * @deprecated This function is deprecated and will be removed in the next major version. - */ -function generateSpanContextForPropagationContext(propagationContext) { - // We store the DSC as OTEL trace state on the span context - const traceState = makeTraceState({ - dsc: propagationContext.dsc, - sampled: propagationContext.sampled, - }); - - const spanContext = { - traceId: propagationContext.traceId, - // TODO: Do not create an invalid span context here - spanId: propagationContext.parentSpanId || '', - isRemote: true, - traceFlags: propagationContext.sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE, - traceState, - }; - - return spanContext; -} - -/** - * Returns the currently active span. - */ function getActiveSpan() { return api.trace.getActiveSpan(); } -/** - * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code. - * - * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking. - */ const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); -const setupElements = new Set(); +class TraceState { + constructor() { + this._internalState = /* @__PURE__ */ new Map(); + } + /** @inheritDoc */ + set(key, value) { + const next = this._clone(); + if (next._internalState.has(key)) { + next._internalState.delete(key); + } + next._internalState.set(key, value); + return next; + } + /** @inheritDoc */ + unset(key) { + const next = this._clone(); + next._internalState.delete(key); + return next; + } + /** @inheritDoc */ + get(key) { + return this._internalState.get(key); + } + /** @inheritDoc */ + serialize() { + return Array.from(this._internalState.keys()).reverse().map((key) => `${key}=${this._internalState.get(key)}`).join(","); + } + _clone() { + const next = new TraceState(); + next._internalState = new Map(this._internalState); + return next; + } +} -/** Get all the OpenTelemetry elements that have been set up. */ +function makeTraceState({ + dsc, + sampled +}) { + const dscString = dsc ? core.dynamicSamplingContextToSentryBaggageHeader(dsc) : void 0; + const traceStateBase = new TraceState(); + const traceStateWithDsc = dscString ? traceStateBase.set(SENTRY_TRACE_STATE_DSC, dscString) : traceStateBase; + return sampled === false ? traceStateWithDsc.set(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING, "1") : traceStateWithDsc; +} + +const setupElements = /* @__PURE__ */ new Set(); function openTelemetrySetupCheck() { return Array.from(setupElements); } - -/** Mark an OpenTelemetry element as setup. */ function setIsSetup(element) { setupElements.add(element); } -function _optionalChain$4(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } - -/** Get the Sentry propagation context from a span context. */ -function getPropagationContextFromSpan(span) { - const spanContext = span.spanContext(); - const { traceId, spanId, traceState } = spanContext; - - // When we have a dsc trace state, it means this came from the incoming trace - // Then this takes presedence over the root span - const dscString = traceState ? traceState.get(SENTRY_TRACE_STATE_DSC) : undefined; - const traceStateDsc = dscString ? core.baggageHeaderToDynamicSamplingContext(dscString) : undefined; - - const parentSpanId = spanHasParentId(span) ? span.parentSpanId : undefined; - const sampled = getSamplingDecision(spanContext); - - // No trace state? --> Take DSC from root span - const dsc = traceStateDsc || core.getDynamicSamplingContextFromSpan(core.getRootSpan(span)); - - return { - traceId, - spanId, - sampled, - parentSpanId, - dsc, - }; -} - -/** - * Injects and extracts `sentry-trace` and `baggage` headers from carriers. - */ class SentryPropagator extends core$1.W3CBaggagePropagator { - /** A map of URLs that have already been checked for if they match tracePropagationTargets. */ - - constructor() { + constructor() { super(); - setIsSetup('SentryPropagator'); - - // We're caching results so we don't have to recompute regexp every time we create a request. + setIsSetup("SentryPropagator"); this._urlMatchesTargetsMap = new core.LRUMap(100); } - /** * @inheritDoc */ - inject(context, carrier, setter) { - if (core$1.isTracingSuppressed(context)) { - DEBUG_BUILD && core.logger.log('[Tracing] Not injecting trace data for url because tracing is suppressed.'); + inject(context2, carrier, setter) { + if (core$1.isTracingSuppressed(context2)) { + DEBUG_BUILD && core.debug.log("[Tracing] Not injecting trace data for url because tracing is suppressed."); return; } - - const activeSpan = api.trace.getSpan(context); + const activeSpan = api.trace.getSpan(context2); const url = activeSpan && getCurrentURL(activeSpan); - - const tracePropagationTargets = _optionalChain$4([core.getClient, 'call', _ => _(), 'optionalAccess', _2 => _2.getOptions, 'call', _3 => _3(), 'optionalAccess', _4 => _4.tracePropagationTargets]); - if (!shouldPropagateTraceForUrl(url, tracePropagationTargets, this._urlMatchesTargetsMap)) { - DEBUG_BUILD && - core.logger.log( - '[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:', - url, - ); + const { tracePropagationTargets, propagateTraceparent } = core.getClient()?.getOptions() || {}; + if (!core.shouldPropagateTraceForUrl(url, tracePropagationTargets, this._urlMatchesTargetsMap)) { + DEBUG_BUILD && core.debug.log("[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:", url); return; } - const existingBaggageHeader = getExistingBaggage(carrier); - let baggage = api.propagation.getBaggage(context) || api.propagation.createBaggage({}); - - const { dynamicSamplingContext, traceId, spanId, sampled } = getInjectionData(context); - + const existingSentryTraceHeader = getExistingSentryTrace(carrier); + let baggage = api.propagation.getBaggage(context2) || api.propagation.createBaggage({}); + const { dynamicSamplingContext, traceId, spanId, sampled } = getInjectionData(context2); if (existingBaggageHeader) { const baggageEntries = core.parseBaggageHeader(existingBaggageHeader); - if (baggageEntries) { Object.entries(baggageEntries).forEach(([key, value]) => { + if (!existingSentryTraceHeader && key.startsWith(core.SENTRY_BAGGAGE_KEY_PREFIX)) { + return; + } baggage = baggage.setEntry(key, { value }); }); } } - - if (dynamicSamplingContext) { + if (!existingSentryTraceHeader && dynamicSamplingContext) { baggage = Object.entries(dynamicSamplingContext).reduce((b, [dscKey, dscValue]) => { if (dscValue) { return b.setEntry(`${core.SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`, { value: dscValue }); @@ -94949,440 +57097,271 @@ class SentryPropagator extends core$1.W3CBaggagePropagator { return b; }, baggage); } - - // We also want to avoid setting the default OTEL trace ID, if we get that for whatever reason - if (traceId && traceId !== api.INVALID_TRACEID) { + if (!existingSentryTraceHeader && traceId && traceId !== api.INVALID_TRACEID) { setter.set(carrier, SENTRY_TRACE_HEADER, core.generateSentryTraceHeader(traceId, spanId, sampled)); + if (propagateTraceparent) { + setter.set(carrier, "traceparent", core.generateTraceparentHeader(traceId, spanId, sampled)); + } } - - super.inject(api.propagation.setBaggage(context, baggage), carrier, setter); + super.inject(api.propagation.setBaggage(context2, baggage), carrier, setter); } - /** * @inheritDoc */ - extract(context, carrier, getter) { + extract(context2, carrier, getter) { const maybeSentryTraceHeader = getter.get(carrier, SENTRY_TRACE_HEADER); const baggage = getter.get(carrier, SENTRY_BAGGAGE_HEADER); - - const sentryTrace = maybeSentryTraceHeader - ? Array.isArray(maybeSentryTraceHeader) - ? maybeSentryTraceHeader[0] - : maybeSentryTraceHeader - : undefined; - - // Add remote parent span context - // If there is no incoming trace, this will return the context as-is - return ensureScopesOnContext(getContextWithRemoteActiveSpan(context, { sentryTrace, baggage })); + const sentryTrace = maybeSentryTraceHeader ? Array.isArray(maybeSentryTraceHeader) ? maybeSentryTraceHeader[0] : maybeSentryTraceHeader : void 0; + return ensureScopesOnContext(getContextWithRemoteActiveSpan(context2, { sentryTrace, baggage })); } - /** * @inheritDoc */ - fields() { - return [SENTRY_TRACE_HEADER, SENTRY_BAGGAGE_HEADER]; + fields() { + return [SENTRY_TRACE_HEADER, SENTRY_BAGGAGE_HEADER, "traceparent"]; } } - -const NOT_PROPAGATED_MESSAGE = - '[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:'; - -/** - * Check if a given URL should be propagated to or not. - * If no url is defined, or no trace propagation targets are defined, this will always return `true`. - * You can also optionally provide a decision map, to cache decisions and avoid repeated regex lookups. - */ -function shouldPropagateTraceForUrl( - url, - tracePropagationTargets, - decisionMap, -) { - if (typeof url !== 'string' || !tracePropagationTargets) { - return true; - } - - const cachedDecision = _optionalChain$4([decisionMap, 'optionalAccess', _5 => _5.get, 'call', _6 => _6(url)]); - if (cachedDecision !== undefined) { - DEBUG_BUILD && !cachedDecision && core.logger.log(NOT_PROPAGATED_MESSAGE, url); - return cachedDecision; - } - - const decision = core.stringMatchesSomePattern(url, tracePropagationTargets); - _optionalChain$4([decisionMap, 'optionalAccess', _7 => _7.set, 'call', _8 => _8(url, decision)]); - - DEBUG_BUILD && !decision && core.logger.log(NOT_PROPAGATED_MESSAGE, url); - return decision; -} - -/** - * Get propagation injection data for the given context. - */ -function getInjectionData(context) - - { - const span = api.trace.getSpan(context); - - // If we have a remote span, the spanId should be considered as the parentSpanId, not spanId itself - // Instead, we use a virtual (generated) spanId for propagation - if (span && span.spanContext().isRemote) { +function getInjectionData(context2, options = {}) { + const span = api.trace.getSpan(context2); + if (span?.spanContext().isRemote) { const spanContext = span.spanContext(); - const dynamicSamplingContext = core.getDynamicSamplingContextFromSpan(span); - + const dynamicSamplingContext2 = core.getDynamicSamplingContextFromSpan(span); return { - dynamicSamplingContext, + dynamicSamplingContext: dynamicSamplingContext2, traceId: spanContext.traceId, - // Because this is a remote span, we do not want to propagate this directly - // As otherwise things may be attached "directly" to an unrelated span - spanId: core.generateSpanId(), - sampled: getSamplingDecision(spanContext), + spanId: void 0, + sampled: getSamplingDecision(spanContext) + // TODO: Do we need to change something here? }; } - - // If we have a local span, we just use this if (span) { const spanContext = span.spanContext(); - const dynamicSamplingContext = core.getDynamicSamplingContextFromSpan(span); - + const dynamicSamplingContext2 = core.getDynamicSamplingContextFromSpan(span); return { - dynamicSamplingContext, + dynamicSamplingContext: dynamicSamplingContext2, traceId: spanContext.traceId, spanId: spanContext.spanId, - sampled: getSamplingDecision(spanContext), + sampled: getSampledForPropagation(span, options.client) }; } - - // Else we try to use the propagation context from the scope - // The only scenario where this should happen is when we neither have a span, nor an incoming trace - const scope = _optionalChain$4([getScopesFromContext, 'call', _9 => _9(context), 'optionalAccess', _10 => _10.scope]) || core.getCurrentScope(); - const client = core.getClient(); - + const scope = options.scope || getScopesFromContext(context2)?.scope || core.getCurrentScope(); + const client = options.client || core.getClient(); const propagationContext = scope.getPropagationContext(); - const dynamicSamplingContext = client ? core.getDynamicSamplingContextFromScope(client, scope) : undefined; + const dynamicSamplingContext = client ? core.getDynamicSamplingContextFromScope(client, scope) : void 0; return { dynamicSamplingContext, traceId: propagationContext.traceId, - // TODO(v9): Use generateSpanId() instead - // eslint-disable-next-line deprecation/deprecation - spanId: propagationContext.spanId, - sampled: propagationContext.sampled, + spanId: propagationContext.propagationSpanId, + sampled: propagationContext.sampled }; } - -function getContextWithRemoteActiveSpan( - ctx, - { sentryTrace, baggage }, -) { +function getContextWithRemoteActiveSpan(ctx, { sentryTrace, baggage }) { const propagationContext = core.propagationContextFromHeaders(sentryTrace, baggage); - const { traceId, parentSpanId, sampled, dsc } = propagationContext; - - // We only want to set the virtual span if we are continuing a concrete trace - // Otherwise, we ignore the incoming trace here, e.g. if we have no trace headers - if (!parentSpanId) { + const client = core.getClient(); + const incomingDsc = core.baggageHeaderToDynamicSamplingContext(baggage); + if (!parentSpanId || client && !core.shouldContinueTrace(client, incomingDsc?.org_id)) { return ctx; } - const spanContext = generateRemoteSpanContext({ traceId, spanId: parentSpanId, sampled, - dsc, + dsc }); - return api.trace.setSpanContext(ctx, spanContext); } - -/** - * Takes trace strings and propagates them as a remote active span. - * This should be used in addition to `continueTrace` in OTEL-powered environments. - */ -function continueTraceAsRemoteSpan( - ctx, - options, - callback, -) { +function continueTraceAsRemoteSpan(ctx, options, callback) { const ctxWithSpanContext = ensureScopesOnContext(getContextWithRemoteActiveSpan(ctx, options)); - return api.context.with(ctxWithSpanContext, callback); } - function ensureScopesOnContext(ctx) { - // If there are no scopes yet on the context, ensure we have them const scopes = getScopesFromContext(ctx); const newScopes = { // If we have no scope here, this is most likely either the root context or a context manually derived from it // In this case, we want to fork the current scope, to ensure we do not pollute the root scope scope: scopes ? scopes.scope : core.getCurrentScope().clone(), - isolationScope: scopes ? scopes.isolationScope : core.getIsolationScope(), + isolationScope: scopes ? scopes.isolationScope : core.getIsolationScope() }; - return setScopesOnContext(ctx, newScopes); } - -/** Try to get the existing baggage header so we can merge this in. */ function getExistingBaggage(carrier) { try { - const baggage = (carrier )[SENTRY_BAGGAGE_HEADER]; - return Array.isArray(baggage) ? baggage.join(',') : baggage; - } catch (e) { - return undefined; + const baggage = carrier[SENTRY_BAGGAGE_HEADER]; + return Array.isArray(baggage) ? baggage.join(",") : baggage; + } catch { + return void 0; + } +} +function getExistingSentryTrace(carrier) { + try { + return carrier[SENTRY_TRACE_HEADER]; + } catch { + return void 0; } } - -/** - * It is pretty tricky to get access to the outgoing request URL of a request in the propagator. - * As we only have access to the context of the span to be sent and the carrier (=headers), - * but the span may be unsampled and thus have no attributes. - * - * So we use the following logic: - * 1. If we have an active span, we check if it has a URL attribute. - * 2. Else, if the active span has no URL attribute (e.g. it is unsampled), we check a special trace state (which we set in our sampler). - */ function getCurrentURL(span) { const spanData = core.spanToJSON(span).data; - // `ATTR_URL_FULL` is the new attribute, but we still support the old one, `SEMATTRS_HTTP_URL`, for now. - // eslint-disable-next-line deprecation/deprecation - const urlAttribute = _optionalChain$4([spanData, 'optionalAccess', _11 => _11[semanticConventions.SEMATTRS_HTTP_URL]]) || _optionalChain$4([spanData, 'optionalAccess', _12 => _12[semanticConventions.ATTR_URL_FULL]]); - if (urlAttribute) { + const urlAttribute = spanData[attributes.HTTP_URL] || spanData[attributes.URL_FULL]; + if (typeof urlAttribute === "string") { return urlAttribute; } - - // Also look at the traceState, which we may set in the sampler even for unsampled spans - const urlTraceState = _optionalChain$4([span, 'access', _13 => _13.spanContext, 'call', _14 => _14(), 'access', _15 => _15.traceState, 'optionalAccess', _16 => _16.get, 'call', _17 => _17(SENTRY_TRACE_STATE_URL)]); + const urlTraceState = span.spanContext().traceState?.get(SENTRY_TRACE_STATE_URL); if (urlTraceState) { return urlTraceState; } - - return undefined; + return void 0; } - function generateRemoteSpanContext({ spanId, traceId, sampled, - dsc, -} - -) { - // We store the DSC as OTEL trace state on the span context + dsc +}) { const traceState = makeTraceState({ dsc, - sampled, + sampled }); - const spanContext = { traceId, spanId, isRemote: true, traceFlags: sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE, - traceState, + traceState }; - return spanContext; } -/** - * Wraps a function with a transaction/span and finishes the span after the function is done. - * The created span is the active span and will be used as parent by other spans created inside the function - * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. - * - * If you want to create a span that is not set as active, use {@link startInactiveSpan}. - * - * You'll always get a span passed to the callback, - * it may just be a non-recording span if the span is not sampled or if tracing is disabled. - */ -function startSpan(options, callback) { +function _startSpan(options, callback, autoEnd) { const tracer = getTracer(); - const { name, parentSpan: customParentSpan } = options; - - // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` const wrapper = getActiveSpanWrapper(customParentSpan); - return wrapper(() => { const activeCtx = getContext(options.scope, options.forceTransaction); - const shouldSkipSpan = options.onlyIfParent && !api.trace.getSpan(activeCtx); - const ctx = shouldSkipSpan ? core$1.suppressTracing(activeCtx) : activeCtx; - + const missingRequiredParent = options.onlyIfParent && !api.trace.getSpan(activeCtx); + const ctx = missingRequiredParent ? core$1.suppressTracing(activeCtx) : activeCtx; + if (missingRequiredParent) { + core.getClient()?.recordDroppedEvent("no_parent_span", "span"); + } const spanOptions = getSpanOptions(options); - - return tracer.startActiveSpan(name, spanOptions, ctx, span => { + if (!core.hasSpansEnabled()) { + const suppressedCtx = core$1.isTracingSuppressed(ctx) ? ctx : core$1.suppressTracing(ctx); + return api.context.with(suppressedCtx, () => { + return tracer.startActiveSpan(name, spanOptions, suppressedCtx, (span) => { + patchSpanEnd(span); + return api.context.with(activeCtx, () => { + return core.handleCallbackErrors( + () => callback(span), + () => { + if (core.spanToJSON(span).status === void 0) { + span.setStatus({ code: api.SpanStatusCode.ERROR }); + } + }, + autoEnd ? () => span.end() : void 0 + ); + }); + }); + }); + } + return tracer.startActiveSpan(name, spanOptions, ctx, (span) => { + patchSpanEnd(span); return core.handleCallbackErrors( () => callback(span), () => { - // Only set the span status to ERROR when there wasn't any status set before, in order to avoid stomping useful span statuses - if (core.spanToJSON(span).status === undefined) { + if (core.spanToJSON(span).status === void 0) { span.setStatus({ code: api.SpanStatusCode.ERROR }); } }, - () => span.end(), + autoEnd ? () => span.end() : void 0 ); }); }); } - -/** - * Similar to `Sentry.startSpan`. Wraps a function with a span, but does not finish the span - * after the function is done automatically. You'll have to call `span.end()` manually. - * - * The created span is the active span and will be used as parent by other spans created inside the function - * and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active. - * - * You'll always get a span passed to the callback, - * it may just be a non-recording span if the span is not sampled or if tracing is disabled. - */ -function startSpanManual( - options, - callback, -) { - const tracer = getTracer(); - - const { name, parentSpan: customParentSpan } = options; - - // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` - const wrapper = getActiveSpanWrapper(customParentSpan); - - return wrapper(() => { - const activeCtx = getContext(options.scope, options.forceTransaction); - const shouldSkipSpan = options.onlyIfParent && !api.trace.getSpan(activeCtx); - const ctx = shouldSkipSpan ? core$1.suppressTracing(activeCtx) : activeCtx; - - const spanOptions = getSpanOptions(options); - - return tracer.startActiveSpan(name, spanOptions, ctx, span => { - return core.handleCallbackErrors( - () => callback(span, () => span.end()), - () => { - // Only set the span status to ERROR when there wasn't any status set before, in order to avoid stomping useful span statuses - if (core.spanToJSON(span).status === undefined) { - span.setStatus({ code: api.SpanStatusCode.ERROR }); - } - }, - ); - }); - }); +function startSpan(options, callback) { + return _startSpan(options, callback, true); +} +function startSpanManual(options, callback) { + return _startSpan(options, (span) => callback(span, () => span.end()), false); } - -/** - * Creates a span. This span is not set as active, so will not get automatic instrumentation spans - * as children or be able to be accessed via `Sentry.getActiveSpan()`. - * - * If you want to create a span that is set as active, use {@link startSpan}. - * - * This function will always return a span, - * it may just be a non-recording span if the span is not sampled or if tracing is disabled. - */ function startInactiveSpan(options) { const tracer = getTracer(); - const { name, parentSpan: customParentSpan } = options; - - // If `options.parentSpan` is defined, we want to wrap the callback in `withActiveSpan` const wrapper = getActiveSpanWrapper(customParentSpan); - return wrapper(() => { const activeCtx = getContext(options.scope, options.forceTransaction); - const shouldSkipSpan = options.onlyIfParent && !api.trace.getSpan(activeCtx); - const ctx = shouldSkipSpan ? core$1.suppressTracing(activeCtx) : activeCtx; - + const missingRequiredParent = options.onlyIfParent && !api.trace.getSpan(activeCtx); + let ctx = missingRequiredParent ? core$1.suppressTracing(activeCtx) : activeCtx; + if (missingRequiredParent) { + core.getClient()?.recordDroppedEvent("no_parent_span", "span"); + } const spanOptions = getSpanOptions(options); - + if (!core.hasSpansEnabled()) { + ctx = core$1.isTracingSuppressed(ctx) ? ctx : core$1.suppressTracing(ctx); + } const span = tracer.startSpan(name, spanOptions, ctx); - + patchSpanEnd(span); return span; }); } - -/** - * Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be - * passed `null` to start an entirely new span tree. - * - * @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed, - * spans started within the callback will be root spans. - * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope. - * @returns the value returned from the provided callback function. - */ function withActiveSpan(span, callback) { const newContextWithActiveSpan = span ? api.trace.setSpan(api.context.active(), span) : api.trace.deleteSpan(api.context.active()); return api.context.with(newContextWithActiveSpan, () => callback(core.getCurrentScope())); } - function getTracer() { const client = core.getClient(); - return (client && client.tracer) || api.trace.getTracer('@sentry/opentelemetry', core.SDK_VERSION); + return client?.tracer || api.trace.getTracer("@sentry/opentelemetry", core.SDK_VERSION); } - function getSpanOptions(options) { - const { startTime, attributes, kind, op } = options; - - // OTEL expects timestamps in ms, not seconds - const fixedStartTime = typeof startTime === 'number' ? ensureTimestampInMilliseconds(startTime) : startTime; - + const { startTime, attributes, kind, op, links } = options; + const fixedStartTime = typeof startTime === "number" ? ensureTimestampInMilliseconds(startTime) : startTime; return { - attributes: op - ? { - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, - ...attributes, - } - : attributes, + attributes: op ? { + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, + ...attributes + } : attributes, kind, - startTime: fixedStartTime, + links, + startTime: fixedStartTime }; } - function ensureTimestampInMilliseconds(timestamp) { const isMs = timestamp < 9999999999; - return isMs ? timestamp * 1000 : timestamp; + return isMs ? timestamp * 1e3 : timestamp; +} +function patchSpanEnd(span) { + const originalEnd = span.end.bind(span); + span.end = (endTime) => { + return originalEnd(typeof endTime === "number" ? ensureTimestampInMilliseconds(endTime) : endTime); + }; } - function getContext(scope, forceTransaction) { const ctx = getContextForScope(scope); const parentSpan = api.trace.getSpan(ctx); - - // In the case that we have no parent span, we start a new trace - // Note that if we continue a trace, we'll always have a remote parent span here anyhow if (!parentSpan) { return ctx; } - - // If we don't want to force a transaction, and we have a parent span, all good, we just return as-is! if (!forceTransaction) { return ctx; } - - // Else, if we do have a parent span but want to force a transaction, we have to simulate a "root" context - - // Else, we need to do two things: - // 1. Unset the parent span from the context, so we'll create a new root span - // 2. Ensure the propagation context is correct, so we'll continue from the parent span const ctxWithoutSpan = api.trace.deleteSpan(ctx); - const { spanId, traceId } = parentSpan.spanContext(); const sampled = getSamplingDecision(parentSpan.spanContext()); - - // In this case, when we are forcing a transaction, we want to treat this like continuing an incoming trace - // so we set the traceState according to the root span const rootSpan = core.getRootSpan(parentSpan); const dsc = core.getDynamicSamplingContextFromSpan(rootSpan); - const traceState = makeTraceState({ dsc, - sampled, + sampled }); - const spanOptions = { traceId, spanId, isRemote: true, traceFlags: sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE, - traceState, + traceState }; - const ctxWithSpanContext = api.trace.setSpanContext(ctxWithoutSpan, spanOptions); - return ctxWithSpanContext; } - function getContextForScope(scope) { if (scope) { const ctx = getContextFromScope(scope); @@ -95390,183 +57369,1104 @@ function getContextForScope(scope) { return ctx; } } - return api.context.active(); } - -/** - * Continue a trace from `sentry-trace` and `baggage` values. - * These values can be obtained from incoming request headers, or in the browser from `` - * and `` HTML tags. - * - * Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically - * be attached to the incoming trace. - * - * This is a custom version of `continueTrace` that is used in OTEL-powered environments. - * It propagates the trace as a remote span, in addition to setting it on the propagation context. - */ function continueTrace(options, callback) { return continueTraceAsRemoteSpan(api.context.active(), options, callback); } - -/** - * Get the trace context for a given scope. - * We have a custom implemention here because we need an OTEL-specific way to get the span from a scope. - */ -function getTraceContextForScope( - client, - scope, -) { +function startNewTrace(callback) { + const traceId = core.generateTraceId(); + const spanId = core.generateSpanId(); + const spanContext = { + traceId, + spanId, + isRemote: true, + traceFlags: api.TraceFlags.NONE + }; + const ctxWithTrace = api.trace.setSpanContext(api.context.active(), spanContext); + return api.context.with(ctxWithTrace, () => { + core.getCurrentScope().setPropagationContext({ + traceId, + sampleRand: core._INTERNAL_safeMathRandom() + }); + return callback(); + }); +} +function getTraceContextForScope(client, scope) { const ctx = getContextFromScope(scope); const span = ctx && api.trace.getSpan(ctx); - const traceContext = span ? core.spanToTraceContext(span) : core.getTraceContextFromScope(scope); - - const dynamicSamplingContext = span - ? core.getDynamicSamplingContextFromSpan(span) - : core.getDynamicSamplingContextFromScope(client, scope); + const dynamicSamplingContext = span ? core.getDynamicSamplingContextFromSpan(span) : core.getDynamicSamplingContextFromScope(client, scope); return [dynamicSamplingContext, traceContext]; } - function getActiveSpanWrapper(parentSpan) { - return parentSpan !== undefined - ? (callback) => { - return withActiveSpan(parentSpan, callback); - } - : (callback) => callback(); + return parentSpan !== void 0 ? (callback) => { + return withActiveSpan(parentSpan, callback); + } : (callback) => callback(); } -/** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */ function suppressTracing(callback) { const ctx = core$1.suppressTracing(api.context.active()); return api.context.with(ctx, callback); } +function isTracingSuppressed(scope) { + const ctx = scope ? getContextFromScope(scope) : api.context.active(); + return ctx ? core$1.isTracingSuppressed(ctx) : false; +} -/** Ensure the `trace` context is set on all events. */ function setupEventContextTrace(client) { - client.on('preprocessEvent', event => { + client.on("preprocessEvent", (event) => { const span = getActiveSpan(); - // For transaction events, this is handled separately - // Because the active span may not be the span that is actually the transaction event - if (!span || event.type === 'transaction') { + if (!span || event.type === "transaction") { return; } - - // If event has already set `trace` context, use that one. event.contexts = { trace: core.spanToTraceContext(span), - ...event.contexts, + ...event.contexts }; - const rootSpan = core.getRootSpan(span); - event.sdkProcessingMetadata = { dynamicSamplingContext: core.getDynamicSamplingContextFromSpan(rootSpan), - ...event.sdkProcessingMetadata, + ...event.sdkProcessingMetadata }; - return event; }); } -/** - * Otel-specific implementation of `getTraceData`. - * @see `@sentry/core` version of `getTraceData` for more information - */ -function getTraceData({ span } = {}) { - let ctx = api.context.active(); - - if (span) { - const { scope } = core.getCapturedScopesOnSpan(span); - // fall back to current context if for whatever reason we can't find the one of the span - ctx = (scope && getContextFromScope(scope)) || api.trace.setSpan(api.context.active(), span); +function buildContextWithSentryScopes(context, activeContext) { + const span = api.trace.getSpan(context); + let effectiveContext; + if (span?.spanContext().traceState?.get(SENTRY_TRACE_STATE_CHILD_IGNORED) === "1") { + const contextWithoutSpan = api.trace.deleteSpan(context); + const parentSpan = api.trace.getSpan(activeContext); + effectiveContext = parentSpan ? api.trace.setSpan(contextWithoutSpan, parentSpan) : contextWithoutSpan; + } else { + effectiveContext = context; } - - const { traceId, spanId, sampled, dynamicSamplingContext } = getInjectionData(ctx); - - return { - 'sentry-trace': core.generateSentryTraceHeader(traceId, spanId, sampled), - baggage: core.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext), - }; + const currentScopes = getScopesFromContext(effectiveContext); + const currentScope = currentScopes?.scope || core.getCurrentScope(); + const currentIsolationScope = currentScopes?.isolationScope || core.getIsolationScope(); + const shouldForkIsolationScope = effectiveContext.getValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY) === true; + const scope = effectiveContext.getValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY); + const isolationScope = effectiveContext.getValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY); + const newCurrentScope = scope || currentScope.clone(); + const newIsolationScope = isolationScope || (shouldForkIsolationScope ? currentIsolationScope.clone() : currentIsolationScope); + const scopes = { scope: newCurrentScope, isolationScope: newIsolationScope }; + const ctx1 = setScopesOnContext(effectiveContext, scopes); + const ctx2 = ctx1.deleteValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY).deleteValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY).deleteValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY); + setContextOnScope(newCurrentScope, ctx2); + return ctx2; } -/** - * Sets the async context strategy to use follow the OTEL context under the hood. - * We handle forking a hub inside of our custom OTEL Context Manager (./otelContextManager.ts) - */ -function setOpenTelemetryContextAsyncContextStrategy() { +function wrapContextManagerClass(ContextManagerClass) { + class SentryContextManager extends ContextManagerClass { + constructor(...args) { + super(...args); + setIsSetup("SentryContextManager"); + } + /** + * Overwrite with() of the original AsyncLocalStorageContextManager + * to ensure we also create new scopes per context. + */ + with(context, fn, thisArg, ...args) { + const ctx2 = buildContextWithSentryScopes(context, this.active()); + return super.with(ctx2, fn, thisArg, ...args); + } + /** + * Gets underlying AsyncLocalStorage and symbol to allow lookup of scope. + */ + getAsyncLocalStorageLookup() { + return { + // @ts-expect-error This is on the base class, but not part of the interface + asyncLocalStorage: this._asyncLocalStorage, + contextSymbol: SENTRY_SCOPES_CONTEXT_KEY + }; + } + } + return SentryContextManager; +} + +function groupSpansWithParents(spans) { + const nodeMap = /* @__PURE__ */ new Map(); + for (const span of spans) { + createOrUpdateSpanNodeAndRefs(nodeMap, span); + } + return Array.from(nodeMap, function([_id, spanNode]) { + return spanNode; + }); +} +function getLocalParentId(span) { + const parentIsRemote = span.attributes[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE] === true; + return !parentIsRemote ? getParentSpanId(span) : void 0; +} +function createOrUpdateSpanNodeAndRefs(nodeMap, span) { + const id = span.spanContext().spanId; + const parentId = getLocalParentId(span); + if (!parentId) { + createOrUpdateNode(nodeMap, { id, span, children: [] }); + return; + } + const parentNode = createOrGetParentNode(nodeMap, parentId); + const node = createOrUpdateNode(nodeMap, { id, span, parentNode, children: [] }); + parentNode.children.push(node); +} +function createOrGetParentNode(nodeMap, id) { + const existing = nodeMap.get(id); + if (existing) { + return existing; + } + return createOrUpdateNode(nodeMap, { id, children: [] }); +} +function createOrUpdateNode(nodeMap, spanNode) { + const existing = nodeMap.get(spanNode.id); + if (existing?.span) { + return existing; + } + if (existing && !existing.span) { + existing.span = spanNode.span; + existing.parentNode = spanNode.parentNode; + return existing; + } + nodeMap.set(spanNode.id, spanNode); + return spanNode; +} + +const canonicalGrpcErrorCodesMap = { + "1": "cancelled", + "2": "unknown_error", + "3": "invalid_argument", + "4": "deadline_exceeded", + "5": "not_found", + "6": "already_exists", + "7": "permission_denied", + "8": "resource_exhausted", + "9": "failed_precondition", + "10": "aborted", + "11": "out_of_range", + "12": "unimplemented", + "13": "internal_error", + "14": "unavailable", + "15": "data_loss", + "16": "unauthenticated" +}; +const isStatusErrorMessageValid = (message) => { + return Object.values(canonicalGrpcErrorCodesMap).includes(message); +}; +function mapStatus(span) { + const attributes = spanHasAttributes(span) ? span.attributes : {}; + const status = spanHasStatus(span) ? span.status : void 0; + if (status) { + if (status.code === api.SpanStatusCode.OK) { + return { code: core.SPAN_STATUS_OK }; + } else if (status.code === api.SpanStatusCode.ERROR) { + if (typeof status.message === "undefined") { + const inferredStatus2 = inferStatusFromAttributes(attributes); + if (inferredStatus2) { + return inferredStatus2; + } + } + if (status.message && isStatusErrorMessageValid(status.message)) { + return { code: core.SPAN_STATUS_ERROR, message: status.message }; + } else { + return { code: core.SPAN_STATUS_ERROR, message: "internal_error" }; + } + } + } + const inferredStatus = inferStatusFromAttributes(attributes); + if (inferredStatus) { + return inferredStatus; + } + if (status?.code === api.SpanStatusCode.UNSET) { + return { code: core.SPAN_STATUS_OK }; + } else { + return { code: core.SPAN_STATUS_ERROR, message: "unknown_error" }; + } +} +function inferStatusFromAttributes(attributes$1) { + const httpCodeAttribute = attributes$1[attributes.HTTP_RESPONSE_STATUS_CODE] || attributes$1[attributes.HTTP_STATUS_CODE]; + const grpcCodeAttribute = attributes$1[attributes.RPC_GRPC_STATUS_CODE]; + const numberHttpCode = typeof httpCodeAttribute === "number" ? httpCodeAttribute : typeof httpCodeAttribute === "string" ? parseInt(httpCodeAttribute) : void 0; + if (typeof numberHttpCode === "number") { + return core.getSpanStatusFromHttpCode(numberHttpCode); + } + if (typeof grpcCodeAttribute === "string") { + return { code: core.SPAN_STATUS_ERROR, message: canonicalGrpcErrorCodesMap[grpcCodeAttribute] || "unknown_error" }; + } + return void 0; +} + +const MAX_SPAN_COUNT = 1e3; +const DEFAULT_TIMEOUT = 300; +const SENT_SPANS_MAX_SIZE = 1e4; +class SentrySpanExporter { + constructor(options) { + this._finishedSpanBucketSize = options?.timeout || DEFAULT_TIMEOUT; + this._finishedSpanBuckets = new Array(this._finishedSpanBucketSize).fill(void 0); + this._lastCleanupTimestampInS = Math.floor(core._INTERNAL_safeDateNow() / 1e3); + this._spansToBucketEntry = /* @__PURE__ */ new WeakMap(); + this._sentSpans = new core.LRUMap(SENT_SPANS_MAX_SIZE); + this._debouncedFlush = core.debounce(this.flush.bind(this), 1, { maxWait: 100 }); + } + /** + * Export a single span. + * This is called by the span processor whenever a span is ended. + */ + export(span) { + const currentTimestampInS = Math.floor(core._INTERNAL_safeDateNow() / 1e3); + if (this._lastCleanupTimestampInS !== currentTimestampInS) { + let droppedSpanCount = 0; + this._finishedSpanBuckets.forEach((bucket, i) => { + if (bucket && bucket.timestampInS <= currentTimestampInS - this._finishedSpanBucketSize) { + droppedSpanCount += bucket.spans.size; + this._finishedSpanBuckets[i] = void 0; + } + }); + if (droppedSpanCount > 0) { + DEBUG_BUILD && core.debug.log( + `SpanExporter dropped ${droppedSpanCount} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.` + ); + } + this._lastCleanupTimestampInS = currentTimestampInS; + } + const currentBucketIndex = currentTimestampInS % this._finishedSpanBucketSize; + const currentBucket = this._finishedSpanBuckets[currentBucketIndex] || { + timestampInS: currentTimestampInS, + spans: /* @__PURE__ */ new Set() + }; + this._finishedSpanBuckets[currentBucketIndex] = currentBucket; + currentBucket.spans.add(span); + this._spansToBucketEntry.set(span, currentBucket); + const localParentId = getLocalParentId(span); + if (!localParentId || this._sentSpans.get(localParentId)) { + this._debouncedFlush(); + } + } + /** + * Try to flush any pending spans immediately. + * This is called internally by the exporter (via _debouncedFlush), + * but can also be triggered externally if we force-flush. + */ + flush() { + const finishedSpans = this._finishedSpanBuckets.flatMap((bucket) => bucket ? Array.from(bucket.spans) : []); + const sentSpans = this._maybeSend(finishedSpans); + const sentSpanCount = sentSpans.size; + const remainingOpenSpanCount = finishedSpans.length - sentSpanCount; + DEBUG_BUILD && core.debug.log( + `SpanExporter exported ${sentSpanCount} spans, ${remainingOpenSpanCount} spans are waiting for their parent spans to finish` + ); + for (const span of sentSpans) { + this._sentSpans.set(span.spanContext().spanId, 1); + const bucketEntry = this._spansToBucketEntry.get(span); + if (bucketEntry) { + bucketEntry.spans.delete(span); + } + } + this._debouncedFlush.cancel(); + } + /** + * Clear the exporter. + * This is called when the span processor is shut down. + */ + clear() { + this._finishedSpanBuckets = this._finishedSpanBuckets.fill(void 0); + this._sentSpans.clear(); + this._debouncedFlush.cancel(); + } + /** + * Send the given spans, but only if they are part of a finished transaction. + * + * Returns the sent spans. + * Spans remain unsent when their parent span is not yet finished. + * This will happen regularly, as child spans are generally finished before their parents. + * But it _could_ also happen because, for whatever reason, a parent span was lost. + * In this case, we'll eventually need to clean this up. + */ + _maybeSend(spans) { + const grouped = groupSpansWithParents(spans); + const sentSpans = /* @__PURE__ */ new Set(); + const rootNodes = this._getCompletedRootNodes(grouped); + for (const root of rootNodes) { + const span = root.span; + sentSpans.add(span); + const transactionEvent = createTransactionForOtelSpan(span); + if (root.parentNode && this._sentSpans.get(root.parentNode.id)) { + const traceData = transactionEvent.contexts?.trace?.data; + if (traceData) { + traceData["sentry.parent_span_already_sent"] = true; + } + } + const spans2 = transactionEvent.spans || []; + let hasGenAiSpans = false; + for (const child of root.children) { + if (createAndFinishSpanForOtelSpan(child, spans2, sentSpans)) { + hasGenAiSpans = true; + } + } + transactionEvent.spans = spans2.length > MAX_SPAN_COUNT ? spans2.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT) : spans2; + if (hasGenAiSpans) { + transactionEvent.sdkProcessingMetadata = { + ...transactionEvent.sdkProcessingMetadata, + hasGenAiSpans: true + }; + } + const measurements = core.timedEventsToMeasurements(span.events); + if (measurements) { + transactionEvent.measurements = measurements; + } + core.captureEvent(transactionEvent); + } + return sentSpans; + } + /** Check if a node is a completed root node or a node whose parent has already been sent */ + _nodeIsCompletedRootNodeOrHasSentParent(node) { + return !!node.span && (!node.parentNode || !!this._sentSpans.get(node.parentNode.id)); + } + /** Get all completed root nodes from a list of nodes */ + _getCompletedRootNodes(nodes) { + return nodes.filter((node) => this._nodeIsCompletedRootNodeOrHasSentParent(node)); + } +} +function parseSpan(span) { + const attributes = span.attributes; + const origin = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]; + const op = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]; + const source = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; + return { origin, op, source }; +} +function createTransactionForOtelSpan(span) { + const { op, description, data, origin = "manual", source } = getSpanData(span); + const capturedSpanScopes = core.getCapturedScopesOnSpan(span); + const sampleRate = span.attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; + const attributes$1 = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source, + [core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, + ...data, + ...removeSentryAttributes(span.attributes) + }; + const { links } = span; + const { traceId: trace_id, spanId: span_id } = span.spanContext(); + const parent_span_id = getParentSpanId(span); + const status = mapStatus(span); + const traceContext = { + parent_span_id, + span_id, + trace_id, + data: attributes$1, + origin, + op, + status: core.getStatusMessage(status), + // As per protocol, span status is allowed to be undefined + links: core.convertSpanLinksForEnvelope(links) + }; + const statusCode = attributes$1[attributes.HTTP_RESPONSE_STATUS_CODE]; + const responseContext = typeof statusCode === "number" ? { response: { status_code: statusCode } } : void 0; + const transactionEvent = { + contexts: { + trace: traceContext, + otel: { + resource: span.resource.attributes + }, + ...responseContext + }, + spans: [], + start_timestamp: core.spanTimeInputToSeconds(span.startTime), + timestamp: core.spanTimeInputToSeconds(span.endTime), + transaction: description, + type: "transaction", + sdkProcessingMetadata: { + capturedSpanScope: capturedSpanScopes.scope, + capturedSpanIsolationScope: capturedSpanScopes.isolationScope, + sampleRate, + dynamicSamplingContext: core.getDynamicSamplingContextFromSpan(span) + }, + ...source && { + transaction_info: { + source + } + } + }; + return transactionEvent; +} +function createAndFinishSpanForOtelSpan(node, spans, sentSpans) { + const span = node.span; + if (span) { + sentSpans.add(span); + } + const shouldDrop = !span; + if (shouldDrop) { + let hasGenAiSpans2 = false; + node.children.forEach((child) => { + if (createAndFinishSpanForOtelSpan(child, spans, sentSpans)) { + hasGenAiSpans2 = true; + } + }); + return hasGenAiSpans2; + } + const span_id = span.spanContext().spanId; + const trace_id = span.spanContext().traceId; + const parentSpanId = getParentSpanId(span); + const { attributes, startTime, endTime, links } = span; + const { op, description, data, origin = "manual" } = getSpanData(span); + const allData = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, + ...removeSentryAttributes(attributes), + ...data + }; + const status = mapStatus(span); + const spanJSON = { + span_id, + trace_id, + data: allData, + description, + parent_span_id: parentSpanId, + start_timestamp: core.spanTimeInputToSeconds(startTime), + // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time + timestamp: core.spanTimeInputToSeconds(endTime) || void 0, + status: core.getStatusMessage(status), + // As per protocol, span status is allowed to be undefined + op, + origin, + measurements: core.timedEventsToMeasurements(span.events), + links: core.convertSpanLinksForEnvelope(links) + }; + spans.push(spanJSON); + let hasGenAiSpans = !!op?.startsWith("gen_ai."); + node.children.forEach((child) => { + if (createAndFinishSpanForOtelSpan(child, spans, sentSpans)) { + hasGenAiSpans = true; + } + }); + return hasGenAiSpans; +} +function getSpanData(span) { + const { op: definedOp, source: definedSource, origin } = parseSpan(span); + const { op: inferredOp, description, source: inferredSource, data: inferredData } = parseSpanDescription(span); + const op = definedOp || inferredOp; + const source = definedSource || inferredSource; + const data = { ...inferredData, ...getData(span) }; + return { + op, + description, + source, + origin, + data + }; +} +function removeSentryAttributes(data) { + const cleanedData = { ...data }; + delete cleanedData[core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; + delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE]; + delete cleanedData[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; + return cleanedData; +} +function getData(span) { + const attributes$1 = span.attributes; + const data = {}; + if (span.kind !== api.SpanKind.INTERNAL) { + data["otel.kind"] = api.SpanKind[span.kind]; + } + const maybeHttpStatusCodeAttribute = attributes$1[attributes.HTTP_STATUS_CODE]; + if (maybeHttpStatusCodeAttribute) { + data[attributes.HTTP_RESPONSE_STATUS_CODE] = maybeHttpStatusCodeAttribute; + } + const requestData = getRequestSpanData(span); + if (requestData.url) { + data.url = requestData.url; + } + if (requestData["http.query"]) { + data["http.query"] = requestData["http.query"].slice(1); + } + if (requestData["http.fragment"]) { + data["http.fragment"] = requestData["http.fragment"].slice(1); + } + return data; +} + +function backfillStreamedSpanDataFromOtel(spanJSON, hint) { + const attributes$1 = spanJSON.attributes ?? {}; + const kind = hint?.spanKind ?? core.SPAN_KIND.INTERNAL; + const { op, description, source, data } = inferSpanData(spanJSON.name, attributes$1, kind); + spanJSON.name = description; + core.safeSetSpanJSONAttributes(spanJSON, { + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, + [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source, + // If nothing in the chain previously set an origin, we now default it to 'manual' + // For transactions, this is done in the SpanExporter. + // TODO (v11): Remove this again once we fully moved away from OTel's TracerProvider. + // at this point, we use `SentrySpan` everywhere, which defaults its origin to 'manual'. + [attributes.SENTRY_ORIGIN]: "manual", + ...data + }); + if (kind !== core.SPAN_KIND.INTERNAL) { + core.safeSetSpanJSONAttributes(spanJSON, { + "otel.kind": core.spanKindToName(kind) + }); + } +} + +class SentrySpanProcessor { + constructor(options) { + this._unsubscribePreprocessSpan = void 0; + setIsSetup("SentrySpanProcessor"); + this._exporter = new SentrySpanExporter(options); + this._client = options?.client ?? core.getClient(); + if (this._client && core.hasSpanStreamingEnabled(this._client)) { + this._unsubscribePreprocessSpan = this._client.on("preprocessSpan", backfillStreamedSpanDataFromOtel); + } + } + /** + * @inheritDoc + */ + async forceFlush() { + this._exporter.flush(); + } + /** + * @inheritDoc + */ + async shutdown() { + this._unsubscribePreprocessSpan?.(); + this._exporter.clear(); + } + /** + * @inheritDoc + */ + onStart(span, parentContext) { + const parentSpan = api.trace.getSpan(parentContext); + let scopes = getScopesFromContext(parentContext); + if (parentSpan && !parentSpan.spanContext().isRemote) { + core.addChildSpanToSpan(parentSpan, span); + } + if (parentSpan?.spanContext().isRemote) { + span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE, true); + } + if (parentContext === api.ROOT_CONTEXT) { + scopes = { + scope: core.getDefaultCurrentScope(), + isolationScope: core.getDefaultIsolationScope() + }; + } + if (scopes) { + core.setCapturedScopesOnSpan(span, scopes.scope, scopes.isolationScope); + } + core.logSpanStart(span); + this._client?.emit("spanStart", span); + } + /** @inheritDoc */ + onEnd(span) { + core.logSpanEnd(span); + this._client?.emit("spanEnd", span); + if (this._client && core.hasSpanStreamingEnabled(this._client)) { + this._client.emit("afterSpanEnd", span); + } else { + this._exporter.export(span); + } + } +} + +class SentrySampler { + constructor(client) { + this._client = client; + this._isSpanStreaming = core.hasSpanStreamingEnabled(client); + setIsSetup("SentrySampler"); + } + /** @inheritDoc */ + shouldSample(context, traceId, spanName, spanKind, spanAttributes, _links) { + const options = this._client.getOptions(); + const { ignoreSpans } = options; + const parentSpan = getValidSpan(context); + const parentContext = parentSpan?.spanContext(); + if (!core.hasSpansEnabled(options)) { + return wrapSamplingDecision({ decision: void 0, context, spanAttributes }); + } + const maybeSpanHttpMethod = spanAttributes[attributes.HTTP_METHOD] || spanAttributes[attributes.HTTP_REQUEST_METHOD]; + if (spanKind === api.SpanKind.CLIENT && maybeSpanHttpMethod && (!parentSpan || parentContext?.isRemote)) { + if (!this._isSpanStreaming) { + this._client.recordDroppedEvent("no_parent_span", "span"); + return wrapSamplingDecision({ decision: void 0, context, spanAttributes }); + } + } + const parentSampled = parentSpan ? getParentSampled(parentSpan, traceId, spanName) : void 0; + const isRootSpan = !parentSpan || parentContext?.isRemote; + if (!isRootSpan) { + if (this._isSpanStreaming) { + if (parentSampled) { + if (ignoreSpans?.length) { + const { description: inferredChildName, op: childOp } = inferSpanData(spanName, spanAttributes, spanKind); + if (core.shouldIgnoreSpan( + { + description: inferredChildName, + op: spanAttributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] ?? childOp, + attributes: spanAttributes + }, + ignoreSpans + )) { + this._client.recordDroppedEvent("ignored", "span"); + return wrapSamplingDecision({ + decision: sdkTraceBase.SamplingDecision.NOT_RECORD, + context, + spanAttributes, + ignoredChildSpan: true + }); + } + } + } + if (!parentSampled) { + const parentSegmentIgnored = parentContext?.traceState?.get(SENTRY_TRACE_STATE_SEGMENT_IGNORED) === "1"; + this._client.recordDroppedEvent(parentSegmentIgnored ? "ignored" : "sample_rate", "span"); + } + } + return wrapSamplingDecision({ + decision: parentSampled ? sdkTraceBase.SamplingDecision.RECORD_AND_SAMPLED : sdkTraceBase.SamplingDecision.NOT_RECORD, + context, + spanAttributes + }); + } + const { + description: inferredSpanName, + data: inferredAttributes, + op + } = inferSpanData(spanName, spanAttributes, spanKind); + const mergedAttributes = { + ...inferredAttributes, + ...spanAttributes + }; + if (op) { + mergedAttributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] = op; + } + if (this._isSpanStreaming && ignoreSpans?.length && core.shouldIgnoreSpan( + { + description: inferredSpanName, + op: mergedAttributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] ?? op, + attributes: mergedAttributes + }, + ignoreSpans + )) { + this._client.recordDroppedEvent("ignored", "span"); + return wrapSamplingDecision({ + decision: sdkTraceBase.SamplingDecision.NOT_RECORD, + context, + spanAttributes, + ignoredSegmentSpan: true + }); + } + const mutableSamplingDecision = { decision: true }; + this._client.emit( + "beforeSampling", + { + spanAttributes: mergedAttributes, + spanName: inferredSpanName, + parentSampled, + parentContext + }, + mutableSamplingDecision + ); + if (!mutableSamplingDecision.decision) { + return wrapSamplingDecision({ decision: void 0, context, spanAttributes }); + } + const { isolationScope } = getScopesFromContext(context) ?? {}; + const dscString = parentContext?.traceState ? parentContext.traceState.get(SENTRY_TRACE_STATE_DSC) : void 0; + const dsc = dscString ? core.baggageHeaderToDynamicSamplingContext(dscString) : void 0; + const sampleRand = core.parseSampleRate(dsc?.sample_rand) ?? core._INTERNAL_safeMathRandom(); + const [sampled, sampleRate, localSampleRateWasApplied] = core.sampleSpan( + options, + { + name: inferredSpanName, + attributes: mergedAttributes, + normalizedRequest: isolationScope?.getScopeData().sdkProcessingMetadata.normalizedRequest, + parentSampled, + parentSampleRate: core.parseSampleRate(dsc?.sample_rate) + }, + sampleRand + ); + const method = `${maybeSpanHttpMethod}`.toUpperCase(); + if (method === "OPTIONS" || method === "HEAD") { + DEBUG_BUILD && core.debug.log(`[Tracing] Not sampling span because HTTP method is '${method}' for ${spanName}`); + return wrapSamplingDecision({ + decision: sdkTraceBase.SamplingDecision.NOT_RECORD, + context, + spanAttributes, + sampleRand, + downstreamTraceSampleRate: 0 + // we don't want to sample anything in the downstream trace either + }); + } + if (!sampled && // We check for `parentSampled === undefined` because we only want to record client reports for spans that are trace roots (ie. when there was incoming trace) + parentSampled === void 0) { + DEBUG_BUILD && core.debug.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."); + this._client.recordDroppedEvent("sample_rate", this._isSpanStreaming ? "span" : "transaction"); + } + return { + ...wrapSamplingDecision({ + decision: sampled ? sdkTraceBase.SamplingDecision.RECORD_AND_SAMPLED : sdkTraceBase.SamplingDecision.NOT_RECORD, + context, + spanAttributes, + sampleRand, + downstreamTraceSampleRate: localSampleRateWasApplied ? sampleRate : void 0 + }), + attributes: { + // We set the sample rate on the span when a local sample rate was applied to better understand how traces were sampled in Sentry + [core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: localSampleRateWasApplied ? sampleRate : void 0 + } + }; + } + /** Returns the sampler name or short description with the configuration. */ + toString() { + return "SentrySampler"; + } +} +function getParentSampled(parentSpan, traceId, spanName) { + const parentContext = parentSpan.spanContext(); + if (api.isSpanContextValid(parentContext) && parentContext.traceId === traceId) { + if (parentContext.isRemote) { + const parentSampled2 = getSamplingDecision(parentSpan.spanContext()); + DEBUG_BUILD && core.debug.log(`[Tracing] Inheriting remote parent's sampled decision for ${spanName}: ${parentSampled2}`); + return parentSampled2; + } + const parentSampled = getSamplingDecision(parentContext); + DEBUG_BUILD && core.debug.log(`[Tracing] Inheriting parent's sampled decision for ${spanName}: ${parentSampled}`); + return parentSampled; + } + return void 0; +} +function wrapSamplingDecision({ + decision, + context, + spanAttributes, + sampleRand, + downstreamTraceSampleRate, + ignoredChildSpan, + ignoredSegmentSpan +}) { + let traceState = getBaseTraceState(context, spanAttributes); + if (downstreamTraceSampleRate !== void 0) { + traceState = traceState.set(SENTRY_TRACE_STATE_SAMPLE_RATE, `${downstreamTraceSampleRate}`); + } + if (sampleRand !== void 0) { + traceState = traceState.set(SENTRY_TRACE_STATE_SAMPLE_RAND, `${sampleRand}`); + } + if (ignoredChildSpan) { + traceState = traceState.set(SENTRY_TRACE_STATE_CHILD_IGNORED, "1"); + } + if (ignoredSegmentSpan) { + traceState = traceState.set(SENTRY_TRACE_STATE_SEGMENT_IGNORED, "1"); + } + if (decision == void 0) { + return { decision: sdkTraceBase.SamplingDecision.NOT_RECORD, traceState }; + } + if (decision === sdkTraceBase.SamplingDecision.NOT_RECORD) { + return { decision, traceState: traceState.set(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING, "1") }; + } + return { decision, traceState }; +} +function getBaseTraceState(context, spanAttributes) { + const parentSpan = api.trace.getSpan(context); + const parentContext = parentSpan?.spanContext(); + let traceState = parentContext?.traceState || new TraceState(); + const url = spanAttributes[attributes.HTTP_URL] || spanAttributes[attributes.URL_FULL]; + if (url && typeof url === "string") { + traceState = traceState.set(SENTRY_TRACE_STATE_URL, url); + } + return traceState; +} +function getValidSpan(context) { + const span = api.trace.getSpan(context); + return span && api.isSpanContextValid(span.spanContext()) ? span : void 0; +} + +function applyOtelSpanData(span, options = {}) { + const spanJSON = core.spanToJSON(span); + const attributes = spanJSON.data; + const kind = span.kind ?? api.SpanKind.INTERNAL; + const mayInferSource = core.spanShouldInferOtelSource(span); + const hasCustomSpanName = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME] !== void 0; + const canInferSource = mayInferSource && !hasCustomSpanName && !core.spanSourceWasExplicitlySet(span); + const attributesForInference = canInferSource && attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === "custom" ? { ...attributes, [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: void 0 } : attributes; + const inferred = inferSpanData(spanJSON.description || "", attributesForInference, kind); + if (kind !== api.SpanKind.INTERNAL && attributes["otel.kind"] === void 0) { + span.setAttribute("otel.kind", api.SpanKind[kind]); + } + if (inferred.op && attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] === void 0) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, inferred.op); + } + const shouldApplyInferredSource = inferred.source !== void 0 && inferred.source !== "custom" && (options.finalizeStatus || inferred.source !== "url") && (spanJSON.parent_span_id === void 0 || kind === api.SpanKind.SERVER); + if (shouldApplyInferredSource && (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === void 0 || canInferSource)) { + span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, inferred.source); + } + if (inferred.data) { + Object.entries(inferred.data).forEach(([key, value]) => { + if (value !== void 0 && attributes[key] === void 0) { + span.setAttribute(key, value); + } + }); + } + if (options.finalizeStatus) { + applyOtelCompatibilityAttributes(span, attributes); + const client = core.getClient(); + applyOtelSpanStatus(span, attributes, spanJSON.status, !!client && core.hasSpanStreamingEnabled(client)); + } + if (mayInferSource && inferred.description !== spanJSON.description && (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] !== "custom" || canInferSource)) { + span.updateName(inferred.description); + } +} +function applyOtelSpanKind(span, kind) { + core.addNonEnumerableProperty(span, "kind", kind ?? api.SpanKind.INTERNAL); +} +function applyOtelSpanStatus(span, attributes, status, spanStreamingEnabled) { + if (status === void 0) { + span.setStatus(inferStatusFromAttributes(attributes) || { code: core.SPAN_STATUS_OK }); + return; + } + if (!spanStreamingEnabled && status !== "ok" && !isStatusErrorMessageValid(status)) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" }); + } +} +function applyOtelCompatibilityAttributes(span, attributes$1) { + const legacyHttpStatusCode = attributes$1[attributes.HTTP_STATUS_CODE]; + if (attributes$1[attributes.HTTP_RESPONSE_STATUS_CODE] === void 0 && legacyHttpStatusCode !== void 0) { + span.setAttribute(attributes.HTTP_RESPONSE_STATUS_CODE, legacyHttpStatusCode); + attributes$1[attributes.HTTP_RESPONSE_STATUS_CODE] = legacyHttpStatusCode; + } +} + +class SentryTracer { + /** @inheritdoc */ + startSpan(name, options = {}, ctx) { + const parentContext = ctx || api.context.active(); + const parentSpan = options.root ? void 0 : api.trace.getSpan(parentContext); + if (core$1.isTracingSuppressed(parentContext)) { + return this._createNonRecordingSpan(parentSpan); + } + const span = this._startSentrySpan(name, options, parentSpan, ctx !== void 0); + core.markSpanAsTracerProviderSpan(span); + applyOtelSpanKind(span, options.kind); + if (options.attributes?.[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === void 0) { + core.markSpanForOtelSourceInference(span); + } + applyOtelSpanData(span); + return span; + } + startActiveSpan(name, optionsOrFn, contextOrFn, fn) { + const options = typeof optionsOrFn === "function" ? {} : optionsOrFn; + const ctx = typeof contextOrFn === "function" || contextOrFn === void 0 ? api.context.active() : contextOrFn; + const callback = typeof optionsOrFn === "function" ? optionsOrFn : typeof contextOrFn === "function" ? contextOrFn : fn; + const span = this.startSpan(name, options, ctx); + const capturedIsolationScope = core.getCapturedScopesOnSpan(span).isolationScope; + const withCapturedIsolationScope = (contextToFork) => capturedIsolationScope ? contextToFork.setValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY, capturedIsolationScope) : contextToFork; + if (core.spanIsIgnored(span) && api.trace.getSpan(ctx)) { + return api.context.with(withCapturedIsolationScope(ctx), () => callback(span)); + } + return api.context.with(withCapturedIsolationScope(api.trace.setSpan(ctx, span)), () => { + core._INTERNAL_setSpanForScope(core.getCurrentScope(), span); + return callback(span); + }); + } + _startSentrySpan(name, options, parentSpan, hasExplicitContext) { + const sentryOptions = { + name, + attributes: options.attributes, + links: options.links, + startTime: options.startTime + }; + if (options.root) { + return core.startNewTrace(() => core._INTERNAL_startInactiveSpan({ ...sentryOptions, parentSpan: null })); + } + if (parentSpan?.spanContext().isRemote) { + return this._startRootSpanWithRemoteParent(sentryOptions, parentSpan); + } + if (parentSpan) { + return core._INTERNAL_startInactiveSpan({ ...sentryOptions, parentSpan }); + } + return core.startNewTrace( + () => core._INTERNAL_startInactiveSpan({ + ...sentryOptions, + parentSpan: hasExplicitContext ? null : void 0 + }) + ); + } + _startRootSpanWithRemoteParent(options, parentSpan) { + const { spanId, traceId, traceState } = parentSpan.spanContext(); + const dsc = core.getDynamicSamplingContextFromSpan(parentSpan); + const sampleRand = typeof dsc.sample_rand === "string" ? Number(dsc.sample_rand) : void 0; + const hasIncomingDsc = !!traceState?.get(SENTRY_TRACE_STATE_DSC); + return core.withScope((scope) => { + scope.setPropagationContext({ + traceId, + parentSpanId: spanId, + sampled: getSamplingDecision(parentSpan.spanContext()), + dsc: hasIncomingDsc ? dsc : void 0, + sampleRand: typeof sampleRand === "number" && !Number.isNaN(sampleRand) ? sampleRand : core._INTERNAL_safeMathRandom() + }); + core._INTERNAL_setSpanForScope(scope, void 0); + return core._INTERNAL_startInactiveSpan({ ...options, parentSpan: null }); + }); + } + _createNonRecordingSpan(parentSpan) { + const span = new core.SentryNonRecordingSpan({ traceId: parentSpan?.spanContext().traceId }); + if (parentSpan) { + core.addChildSpanToSpan(parentSpan, span); + } + core.setCapturedScopesOnSpan(span, core.getCurrentScope(), core.getIsolationScope()); + return span; + } +} + +class SentryTracerProvider { + constructor(options = {}) { + this._tracers = /* @__PURE__ */ new Map(); + this.resource = options.resource; + } + /** @inheritdoc */ + getTracer(name, version, options) { + const key = JSON.stringify([name, version, options]); + const cachedTracer = this._tracers.get(key); + if (cachedTracer) { + return cachedTracer; + } + const tracer = new SentryTracer(); + this._tracers.set(key, tracer); + return tracer; + } + /** Compatibility with SDK tracer providers. */ + forceFlush() { + return Promise.resolve(); + } + /** Compatibility with SDK tracer providers. */ + shutdown() { + return Promise.resolve(); + } +} + +const ATTR_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language"; +const ATTR_TELEMETRY_SDK_NAME = "telemetry.sdk.name"; +const ATTR_TELEMETRY_SDK_VERSION = "telemetry.sdk.version"; +const SEMRESATTRS_SERVICE_NAMESPACE = "service.namespace"; +class SentryResource { + constructor(attributes) { + this._attributes = attributes; + } + get attributes() { + return this._attributes; + } + merge(other) { + if (!other) { + return this; + } + return new SentryResource({ ...this._attributes, ...other.attributes }); + } + getRawAttributes() { + return Object.entries(this._attributes); + } +} +function parseOtelResourceAttributes(raw) { + if (!raw) { + return {}; + } + const result = {}; + for (const pair of raw.split(",")) { + const eq = pair.indexOf("="); + if (eq === -1) { + continue; + } + const key = pair.substring(0, eq).trim(); + const value = pair.substring(eq + 1).trim(); + if (key) { + try { + result[key] = decodeURIComponent(value); + } catch { + result[key] = value; + } + } + } + return result; +} +function getSentryResource(serviceNameFallback) { + const env = typeof process !== "undefined" ? process.env : {}; + const otelServiceName = env.OTEL_SERVICE_NAME; + const otelResourceAttrs = parseOtelResourceAttributes(env.OTEL_RESOURCE_ATTRIBUTES); + return new SentryResource({ + // Lowest priority: Sentry defaults + // eslint-disable-next-line typescript/no-deprecated + [SEMRESATTRS_SERVICE_NAMESPACE]: "sentry", + [attributes.SERVICE_NAME]: serviceNameFallback, + // OTEL_RESOURCE_ATTRIBUTES overrides defaults (including service.name and service.namespace) + ...otelResourceAttrs, + // OTEL_SERVICE_NAME explicitly overrides service.name + ...otelServiceName ? { [attributes.SERVICE_NAME]: otelServiceName } : {}, + // Highest priority: Sentry SDK telemetry attrs (cannot be overridden by env vars) + [attributes.SERVICE_VERSION]: core.SDK_VERSION, + [ATTR_TELEMETRY_SDK_LANGUAGE]: core$1.SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE], + [ATTR_TELEMETRY_SDK_NAME]: core$1.SDK_INFO[ATTR_TELEMETRY_SDK_NAME], + [ATTR_TELEMETRY_SDK_VERSION]: core$1.SDK_INFO[ATTR_TELEMETRY_SDK_VERSION] + }); +} + +function getTraceData({ + span, + scope, + client, + propagateTraceparent +} = {}) { + let ctx = (scope && getContextFromScope(scope)) ?? api.context.active(); + if (span) { + const { scope: scope2 } = core.getCapturedScopesOnSpan(span); + ctx = scope2 && getContextFromScope(scope2) || api.trace.setSpan(api.context.active(), span); + } + const { traceId, spanId, sampled, dynamicSamplingContext } = getInjectionData(ctx, { scope, client }); + const traceData = { + "sentry-trace": core.generateSentryTraceHeader(traceId, spanId, sampled), + baggage: core.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) + }; + if (propagateTraceparent) { + traceData.traceparent = core.generateTraceparentHeader(traceId, spanId, sampled); + } + return traceData; +} + +function setOpenTelemetryContextAsyncContextStrategy(options) { function getScopes() { const ctx = api.context.active(); const scopes = getScopesFromContext(ctx); - if (scopes) { return scopes; } - - // fallback behavior: - // if, for whatever reason, we can't find scopes on the context here, we have to fix this somehow return { scope: core.getDefaultCurrentScope(), - isolationScope: core.getDefaultIsolationScope(), + isolationScope: core.getDefaultIsolationScope() }; } - function withScope(callback) { const ctx = api.context.active(); - - // We depend on the otelContextManager to handle the context/hub - // We set the `SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY` context value, which is picked up by - // the OTEL context manager, which uses the presence of this key to determine if it should - // fork the isolation scope, or not - // as by default, we don't want to fork this, unless triggered explicitly by `withScope` return api.context.with(ctx, () => { return callback(getCurrentScope()); }); } - function withSetScope(scope, callback) { - const ctx = api.context.active(); - - // We depend on the otelContextManager to handle the context/hub - // We set the `SENTRY_FORK_SET_SCOPE_CONTEXT_KEY` context value, which is picked up by - // the OTEL context manager, which picks up this scope as the current scope + const ctx = getContextFromScope(scope) || api.context.active(); return api.context.with(ctx.setValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY, scope), () => { return callback(scope); }); } - function withIsolationScope(callback) { const ctx = api.context.active(); - - // We depend on the otelContextManager to handle the context/hub - // We set the `SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY` context value, which is picked up by - // the OTEL context manager, which uses the presence of this key to determine if it should - // fork the isolation scope, or not return api.context.with(ctx.setValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY, true), () => { return callback(getIsolationScope()); }); } - function withSetIsolationScope(isolationScope, callback) { const ctx = api.context.active(); - - // We depend on the otelContextManager to handle the context/hub - // We set the `SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY` context value, which is picked up by - // the OTEL context manager, which uses the presence of this key to determine if it should - // fork the isolation scope, or not return api.context.with(ctx.setValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY, isolationScope), () => { return callback(getIsolationScope()); }); } - function getCurrentScope() { return getScopes().scope; } - function getIsolationScope() { return getScopes().isolationScope; } - core.setAsyncContextStrategy({ withScope, withSetScope, @@ -95579,938 +58479,40 @@ function setOpenTelemetryContextAsyncContextStrategy() { startInactiveSpan, getActiveSpan, suppressTracing, + isTracingSuppressed, getTraceData, continueTrace, + startNewTrace, // The types here don't fully align, because our own `Span` type is narrower // than the OTEL one - but this is OK for here, as we now we'll only have OTEL spans passed around - withActiveSpan: withActiveSpan , + withActiveSpan, + getTracingChannelBinding: options?.getTracingChannelBinding }); } -function _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } - -/** - * Wrap an OpenTelemetry ContextManager in a way that ensures the context is kept in sync with the Sentry Scope. - * - * Usage: - * import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'; - * const SentryContextManager = wrapContextManagerClass(AsyncLocalStorageContextManager); - * const contextManager = new SentryContextManager(); - */ -function wrapContextManagerClass( - ContextManagerClass, -) { - /** - * This is a custom ContextManager for OpenTelemetry, which extends the default AsyncLocalStorageContextManager. - * It ensures that we create new scopes per context, so that the OTEL Context & the Sentry Scope are always in sync. - * - * Note that we currently only support AsyncHooks with this, - * but since this should work for Node 14+ anyhow that should be good enough. - */ - - // @ts-expect-error TS does not like this, but we know this is fine - class SentryContextManager extends ContextManagerClass { - constructor(...args) { - super(...args); - setIsSetup('SentryContextManager'); - } - /** - * Overwrite with() of the original AsyncLocalStorageContextManager - * to ensure we also create new scopes per context. - */ - with( - context, - fn, - thisArg, - ...args - ) { - const currentScopes = getScopesFromContext(context); - const currentScope = _optionalChain$3([currentScopes, 'optionalAccess', _ => _.scope]) || core.getCurrentScope(); - const currentIsolationScope = _optionalChain$3([currentScopes, 'optionalAccess', _2 => _2.isolationScope]) || core.getIsolationScope(); - - const shouldForkIsolationScope = context.getValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY) === true; - const scope = context.getValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY) ; - const isolationScope = context.getValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY) ; - - const newCurrentScope = scope || currentScope.clone(); - const newIsolationScope = - isolationScope || (shouldForkIsolationScope ? currentIsolationScope.clone() : currentIsolationScope); - const scopes = { scope: newCurrentScope, isolationScope: newIsolationScope }; - - const ctx1 = setScopesOnContext(context, scopes); - - // Remove the unneeded values again - const ctx2 = ctx1 - .deleteValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY) - .deleteValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY) - .deleteValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY); - - setContextOnScope(newCurrentScope, ctx2); - - return super.with(ctx2, fn, thisArg, ...args); - } - } - - return SentryContextManager ; -} - -/** - * This function runs through a list of OTEL Spans, and wraps them in an `SpanNode` - * where each node holds a reference to their parent node. - */ -function groupSpansWithParents(spans) { - const nodeMap = new Map(); - - for (const span of spans) { - createOrUpdateSpanNodeAndRefs(nodeMap, span); - } - - return Array.from(nodeMap, function ([_id, spanNode]) { - return spanNode; - }); -} - -/** - * This returns the _local_ parent ID - `parentId` on the span may point to a remote span. - */ -function getLocalParentId(span) { - const parentIsRemote = span.attributes[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE] === true; - // If the parentId is the trace parent ID, we pretend it's undefined - // As this means the parent exists somewhere else - return !parentIsRemote ? span.parentSpanId : undefined; -} - -function createOrUpdateSpanNodeAndRefs(nodeMap, span) { - const id = span.spanContext().spanId; - const parentId = getLocalParentId(span); - - if (!parentId) { - createOrUpdateNode(nodeMap, { id, span, children: [] }); - return; - } - - // Else make sure to create parent node as well - // Note that the parent may not know it's parent _yet_, this may be updated in a later pass - const parentNode = createOrGetParentNode(nodeMap, parentId); - const node = createOrUpdateNode(nodeMap, { id, span, parentNode, children: [] }); - parentNode.children.push(node); -} - -function createOrGetParentNode(nodeMap, id) { - const existing = nodeMap.get(id); - - if (existing) { - return existing; - } - - return createOrUpdateNode(nodeMap, { id, children: [] }); -} - -function createOrUpdateNode(nodeMap, spanNode) { - const existing = nodeMap.get(spanNode.id); - - // If span is already set, nothing to do here - if (existing && existing.span) { - return existing; - } - - // If it exists but span is not set yet, we update it - if (existing && !existing.span) { - existing.span = spanNode.span; - existing.parentNode = spanNode.parentNode; - return existing; - } - - // Else, we create a new one... - nodeMap.set(spanNode.id, spanNode); - return spanNode; -} - -// canonicalCodesGrpcMap maps some GRPC codes to Sentry's span statuses. See description in grpc documentation. -const canonicalGrpcErrorCodesMap = { - '1': 'cancelled', - '2': 'unknown_error', - '3': 'invalid_argument', - '4': 'deadline_exceeded', - '5': 'not_found', - '6': 'already_exists', - '7': 'permission_denied', - '8': 'resource_exhausted', - '9': 'failed_precondition', - '10': 'aborted', - '11': 'out_of_range', - '12': 'unimplemented', - '13': 'internal_error', - '14': 'unavailable', - '15': 'data_loss', - '16': 'unauthenticated', -} ; - -const isStatusErrorMessageValid = (message) => { - return Object.values(canonicalGrpcErrorCodesMap).includes(message ); -}; - -/** - * Get a Sentry span status from an otel span. - */ -function mapStatus(span) { - const attributes = spanHasAttributes(span) ? span.attributes : {}; - const status = spanHasStatus(span) ? span.status : undefined; - - if (status) { - // Since span status OK is not set by default, we give it priority: https://opentelemetry.io/docs/concepts/signals/traces/#span-status - if (status.code === api.SpanStatusCode.OK) { - return { code: core.SPAN_STATUS_OK }; - // If the span is already marked as erroneous we return that exact status - } else if (status.code === api.SpanStatusCode.ERROR) { - if (typeof status.message === 'undefined') { - const inferredStatus = inferStatusFromAttributes(attributes); - if (inferredStatus) { - return inferredStatus; - } - } - - if (status.message && isStatusErrorMessageValid(status.message)) { - return { code: core.SPAN_STATUS_ERROR, message: status.message }; - } else { - return { code: core.SPAN_STATUS_ERROR, message: 'unknown_error' }; - } - } - } - - // If the span status is UNSET, we try to infer it from HTTP or GRPC status codes. - const inferredStatus = inferStatusFromAttributes(attributes); - - if (inferredStatus) { - return inferredStatus; - } - - // We default to setting the spans status to ok. - if (status && status.code === api.SpanStatusCode.UNSET) { - return { code: core.SPAN_STATUS_OK }; - } else { - return { code: core.SPAN_STATUS_ERROR, message: 'unknown_error' }; - } -} - -function inferStatusFromAttributes(attributes) { - // If the span status is UNSET, we try to infer it from HTTP or GRPC status codes. - - // eslint-disable-next-line deprecation/deprecation - const httpCodeAttribute = attributes[semanticConventions.ATTR_HTTP_RESPONSE_STATUS_CODE] || attributes[semanticConventions.SEMATTRS_HTTP_STATUS_CODE]; - // eslint-disable-next-line deprecation/deprecation - const grpcCodeAttribute = attributes[semanticConventions.SEMATTRS_RPC_GRPC_STATUS_CODE]; - - const numberHttpCode = - typeof httpCodeAttribute === 'number' - ? httpCodeAttribute - : typeof httpCodeAttribute === 'string' - ? parseInt(httpCodeAttribute) - : undefined; - - if (typeof numberHttpCode === 'number') { - return core.getSpanStatusFromHttpCode(numberHttpCode); - } - - if (typeof grpcCodeAttribute === 'string') { - return { code: core.SPAN_STATUS_ERROR, message: canonicalGrpcErrorCodesMap[grpcCodeAttribute] || 'unknown_error' }; - } - - return undefined; -} - -function _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } - -const MAX_SPAN_COUNT = 1000; -const DEFAULT_TIMEOUT = 300; // 5 min - -/** - * A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions. - */ -class SentrySpanExporter { - - /* - * A quick explanation on the buckets: We do bucketing of finished spans for efficiency. This span exporter is - * accumulating spans until a root span is encountered and then it flushes all the spans that are descendants of that - * root span. Because it is totally in the realm of possibilities that root spans are never finished, and we don't - * want to accumulate spans indefinitely in memory, we need to periodically evacuate spans. Naively we could simply - * store the spans in an array and each time a new span comes in we could iterate through the entire array and - * evacuate all spans that have an end-timestamp that is older than our limit. This could get quite expensive because - * we would have to iterate a potentially large number of spans every time we evacuate. We want to avoid these large - * bursts of computation. - * - * Instead we go for a bucketing approach and put spans into buckets, based on what second - * (modulo the time limit) the span was put into the exporter. With buckets, when we decide to evacuate, we can - * iterate through the bucket entries instead, which have an upper bound of items, making the evacuation much more - * efficient. Cleaning up also becomes much more efficient since it simply involves de-referencing a bucket within the - * bucket array, and letting garbage collection take care of the rest. - */ - - constructor(options - -) { - this._finishedSpanBucketSize = _optionalChain$2([options, 'optionalAccess', _ => _.timeout]) || DEFAULT_TIMEOUT; - this._finishedSpanBuckets = new Array(this._finishedSpanBucketSize).fill(undefined); - this._lastCleanupTimestampInS = Math.floor(Date.now() / 1000); - this._spansToBucketEntry = new WeakMap(); - } - - /** Export a single span. */ - export(span) { - const currentTimestampInS = Math.floor(Date.now() / 1000); - - if (this._lastCleanupTimestampInS !== currentTimestampInS) { - let droppedSpanCount = 0; - this._finishedSpanBuckets.forEach((bucket, i) => { - if (bucket && bucket.timestampInS <= currentTimestampInS - this._finishedSpanBucketSize) { - droppedSpanCount += bucket.spans.size; - this._finishedSpanBuckets[i] = undefined; - } - }); - if (droppedSpanCount > 0) { - DEBUG_BUILD && - core.logger.log( - `SpanExporter dropped ${droppedSpanCount} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`, - ); - } - this._lastCleanupTimestampInS = currentTimestampInS; - } - - const currentBucketIndex = currentTimestampInS % this._finishedSpanBucketSize; - const currentBucket = this._finishedSpanBuckets[currentBucketIndex] || { - timestampInS: currentTimestampInS, - spans: new Set(), - }; - this._finishedSpanBuckets[currentBucketIndex] = currentBucket; - currentBucket.spans.add(span); - this._spansToBucketEntry.set(span, currentBucket); - - // If the span doesn't have a local parent ID (it's a root span), we're gonna flush all the ended spans - if (!getLocalParentId(span)) { - this._clearTimeout(); - - // If we got a parent span, we try to send the span tree - // Wait a tick for this, to ensure we avoid race conditions - this._flushTimeout = setTimeout(() => { - this.flush(); - }, 1); - } - } - - /** Try to flush any pending spans immediately. */ - flush() { - this._clearTimeout(); - - const finishedSpans = []; - this._finishedSpanBuckets.forEach(bucket => { - if (bucket) { - finishedSpans.push(...bucket.spans); - } - }); - - const sentSpans = maybeSend(finishedSpans); - - const sentSpanCount = sentSpans.size; - - const remainingOpenSpanCount = finishedSpans.length - sentSpanCount; - - DEBUG_BUILD && - core.logger.log( - `SpanExporter exported ${sentSpanCount} spans, ${remainingOpenSpanCount} spans are waiting for their parent spans to finish`, - ); - - sentSpans.forEach(span => { - const bucketEntry = this._spansToBucketEntry.get(span); - if (bucketEntry) { - bucketEntry.spans.delete(span); - } - }); - } - - /** Clear the exporter. */ - clear() { - this._finishedSpanBuckets = this._finishedSpanBuckets.fill(undefined); - this._clearTimeout(); - } - - /** Clear the flush timeout. */ - _clearTimeout() { - if (this._flushTimeout) { - clearTimeout(this._flushTimeout); - this._flushTimeout = undefined; - } - } -} - -/** - * Send the given spans, but only if they are part of a finished transaction. - * - * Returns the sent spans. - * Spans remain unsent when their parent span is not yet finished. - * This will happen regularly, as child spans are generally finished before their parents. - * But it _could_ also happen because, for whatever reason, a parent span was lost. - * In this case, we'll eventually need to clean this up. - */ -function maybeSend(spans) { - const grouped = groupSpansWithParents(spans); - const sentSpans = new Set(); - - const rootNodes = getCompletedRootNodes(grouped); - - rootNodes.forEach(root => { - const span = root.span; - sentSpans.add(span); - const transactionEvent = createTransactionForOtelSpan(span); - - // We'll recursively add all the child spans to this array - const spans = transactionEvent.spans || []; - - root.children.forEach(child => { - createAndFinishSpanForOtelSpan(child, spans, sentSpans); - }); - - // spans.sort() mutates the array, but we do not use this anymore after this point - // so we can safely mutate it here - transactionEvent.spans = - spans.length > MAX_SPAN_COUNT - ? spans.sort((a, b) => a.start_timestamp - b.start_timestamp).slice(0, MAX_SPAN_COUNT) - : spans; - - const measurements = core.timedEventsToMeasurements(span.events); - if (measurements) { - transactionEvent.measurements = measurements; - } - - core.captureEvent(transactionEvent); - }); - - return sentSpans; -} - -function nodeIsCompletedRootNode(node) { - return !!node.span && !node.parentNode; -} - -function getCompletedRootNodes(nodes) { - return nodes.filter(nodeIsCompletedRootNode); -} - -function parseSpan(span) { - const attributes = span.attributes; - - const origin = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] ; - const op = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] ; - const source = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ; - - return { origin, op, source }; -} - -/** Exported only for tests. */ -function createTransactionForOtelSpan(span) { - const { op, description, data, origin = 'manual', source } = getSpanData(span); - const capturedSpanScopes = core.getCapturedScopesOnSpan(span ); - - const sampleRate = span.attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE] ; - - const attributes = core.dropUndefinedKeys({ - [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source, - [core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate, - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, - ...data, - ...removeSentryAttributes(span.attributes), - }); - - const { traceId: trace_id, spanId: span_id } = span.spanContext(); - - // If parentSpanIdFromTraceState is defined at all, we want it to take precedence - // In that case, an empty string should be interpreted as "no parent span id", - // even if `span.parentSpanId` is set - // this is the case when we are starting a new trace, where we have a virtual span based on the propagationContext - // We only want to continue the traceId in this case, but ignore the parent span - const parent_span_id = span.parentSpanId; - - const status = mapStatus(span); - - const traceContext = core.dropUndefinedKeys({ - parent_span_id, - span_id, - trace_id, - data: attributes, - origin, - op, - status: core.getStatusMessage(status), // As per protocol, span status is allowed to be undefined - }); - - const statusCode = attributes[semanticConventions.ATTR_HTTP_RESPONSE_STATUS_CODE]; - const responseContext = typeof statusCode === 'number' ? { response: { status_code: statusCode } } : undefined; - - const transactionEvent = core.dropUndefinedKeys({ - contexts: { - trace: traceContext, - otel: { - resource: span.resource.attributes, - }, - ...responseContext, - }, - spans: [], - start_timestamp: core.spanTimeInputToSeconds(span.startTime), - timestamp: core.spanTimeInputToSeconds(span.endTime), - transaction: description, - type: 'transaction', - sdkProcessingMetadata: { - ...core.dropUndefinedKeys({ - capturedSpanScope: capturedSpanScopes.scope, - capturedSpanIsolationScope: capturedSpanScopes.isolationScope, - sampleRate, - dynamicSamplingContext: core.getDynamicSamplingContextFromSpan(span ), - }), - }, - ...(source && { - transaction_info: { - source, - }, - }), - _metrics_summary: core.getMetricSummaryJsonForSpan(span ), - }); - - return transactionEvent; -} - -function createAndFinishSpanForOtelSpan(node, spans, sentSpans) { - const span = node.span; - - if (span) { - sentSpans.add(span); - } - - const shouldDrop = !span; - - // If this span should be dropped, we still want to create spans for the children of this - if (shouldDrop) { - node.children.forEach(child => { - createAndFinishSpanForOtelSpan(child, spans, sentSpans); - }); - return; - } - - const span_id = span.spanContext().spanId; - const trace_id = span.spanContext().traceId; - - const { attributes, startTime, endTime, parentSpanId } = span; - - const { op, description, data, origin = 'manual' } = getSpanData(span); - const allData = core.dropUndefinedKeys({ - [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, - [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op, - ...removeSentryAttributes(attributes), - ...data, - }); - - const status = mapStatus(span); - - const spanJSON = core.dropUndefinedKeys({ - span_id, - trace_id, - data: allData, - description, - parent_span_id: parentSpanId, - start_timestamp: core.spanTimeInputToSeconds(startTime), - // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time - timestamp: core.spanTimeInputToSeconds(endTime) || undefined, - status: core.getStatusMessage(status), // As per protocol, span status is allowed to be undefined - op, - origin, - _metrics_summary: core.getMetricSummaryJsonForSpan(span ), - measurements: core.timedEventsToMeasurements(span.events), - }); - - spans.push(spanJSON); - - node.children.forEach(child => { - createAndFinishSpanForOtelSpan(child, spans, sentSpans); - }); -} - -function getSpanData(span) - - { - const { op: definedOp, source: definedSource, origin } = parseSpan(span); - const { op: inferredOp, description, source: inferredSource, data: inferredData } = parseSpanDescription(span); - - const op = definedOp || inferredOp; - const source = definedSource || inferredSource; - - const data = { ...inferredData, ...getData(span) }; - - return { - op, - description, - source, - origin, - data, - }; -} - -/** - * Remove custom `sentry.` attributes we do not need to send. - * These are more carrier attributes we use inside of the SDK, we do not need to send them to the API. - */ -function removeSentryAttributes(data) { - const cleanedData = { ...data }; - - /* eslint-disable @typescript-eslint/no-dynamic-delete */ - delete cleanedData[core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]; - delete cleanedData[SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE]; - delete cleanedData[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; - /* eslint-enable @typescript-eslint/no-dynamic-delete */ - - return cleanedData; -} - -function getData(span) { - const attributes = span.attributes; - const data = {}; - - if (span.kind !== api.SpanKind.INTERNAL) { - data['otel.kind'] = api.SpanKind[span.kind]; - } - - // eslint-disable-next-line deprecation/deprecation - const maybeHttpStatusCodeAttribute = attributes[semanticConventions.SEMATTRS_HTTP_STATUS_CODE]; - if (maybeHttpStatusCodeAttribute) { - data[semanticConventions.ATTR_HTTP_RESPONSE_STATUS_CODE] = maybeHttpStatusCodeAttribute ; - } - - const requestData = getRequestSpanData(span); - - if (requestData.url) { - data.url = requestData.url; - } - - if (requestData['http.query']) { - data['http.query'] = requestData['http.query'].slice(1); - } - if (requestData['http.fragment']) { - data['http.fragment'] = requestData['http.fragment'].slice(1); - } - - return data; -} - -function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } - -function onSpanStart(span, parentContext) { - // This is a reliable way to get the parent span - because this is exactly how the parent is identified in the OTEL SDK - const parentSpan = api.trace.getSpan(parentContext); - - let scopes = getScopesFromContext(parentContext); - - // We need access to the parent span in order to be able to move up the span tree for breadcrumbs - if (parentSpan && !parentSpan.spanContext().isRemote) { - core.addChildSpanToSpan(parentSpan, span); - } - - // We need this in the span exporter - if (parentSpan && parentSpan.spanContext().isRemote) { - span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE, true); - } - - // The root context does not have scopes stored, so we check for this specifically - // As fallback we attach the global scopes - if (parentContext === api.ROOT_CONTEXT) { - scopes = { - scope: core.getDefaultCurrentScope(), - isolationScope: core.getDefaultIsolationScope(), - }; - } - - // We need the scope at time of span creation in order to apply it to the event when the span is finished - if (scopes) { - core.setCapturedScopesOnSpan(span, scopes.scope, scopes.isolationScope); - } - - core.logSpanStart(span); - - const client = core.getClient(); - _optionalChain$1([client, 'optionalAccess', _ => _.emit, 'call', _2 => _2('spanStart', span)]); -} - -function onSpanEnd(span) { - core.logSpanEnd(span); - - const client = core.getClient(); - _optionalChain$1([client, 'optionalAccess', _3 => _3.emit, 'call', _4 => _4('spanEnd', span)]); -} - -/** - * Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via - * the Sentry SDK. - */ -class SentrySpanProcessor { - - constructor(options) { - setIsSetup('SentrySpanProcessor'); - this._exporter = new SentrySpanExporter(options); - } - - /** - * @inheritDoc - */ - async forceFlush() { - this._exporter.flush(); - } - - /** - * @inheritDoc - */ - async shutdown() { - this._exporter.clear(); - } - - /** - * @inheritDoc - */ - onStart(span, parentContext) { - onSpanStart(span, parentContext); - } - - /** @inheritDoc */ - onEnd(span) { - onSpanEnd(span); - - this._exporter.export(span); - } -} - -/** - * A custom OTEL sampler that uses Sentry sampling rates to make its decision - */ -class SentrySampler { - - constructor(client) { - this._client = client; - setIsSetup('SentrySampler'); - } - - /** @inheritDoc */ - shouldSample( - context, - traceId, - spanName, - spanKind, - spanAttributes, - _links, - ) { - const options = this._client.getOptions(); - - const parentSpan = getValidSpan(context); - const parentContext = _optionalChain([parentSpan, 'optionalAccess', _ => _.spanContext, 'call', _2 => _2()]); - - if (!core.hasTracingEnabled(options)) { - return wrapSamplingDecision({ decision: undefined, context, spanAttributes }); - } - - // `ATTR_HTTP_REQUEST_METHOD` is the new attribute, but we still support the old one, `SEMATTRS_HTTP_METHOD`, for now. - // eslint-disable-next-line deprecation/deprecation - const maybeSpanHttpMethod = spanAttributes[semanticConventions.SEMATTRS_HTTP_METHOD] || spanAttributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD]; - - // If we have a http.client span that has no local parent, we never want to sample it - // but we want to leave downstream sampling decisions up to the server - if (spanKind === api.SpanKind.CLIENT && maybeSpanHttpMethod && (!parentSpan || _optionalChain([parentContext, 'optionalAccess', _3 => _3.isRemote]))) { - return wrapSamplingDecision({ decision: undefined, context, spanAttributes }); - } - - const parentSampled = parentSpan ? getParentSampled(parentSpan, traceId, spanName) : undefined; - - // We want to pass the inferred name & attributes to the sampler method - const { - description: inferredSpanName, - data: inferredAttributes, - op, - } = inferSpanData(spanName, spanAttributes, spanKind); - - const mergedAttributes = { - ...inferredAttributes, - ...spanAttributes, - }; - - if (op) { - mergedAttributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] = op; - } - - const mutableSamplingDecision = { decision: true }; - this._client.emit( - 'beforeSampling', - { - spanAttributes: mergedAttributes, - spanName: inferredSpanName, - parentSampled: parentSampled, - parentContext: parentContext, - }, - mutableSamplingDecision, - ); - if (!mutableSamplingDecision.decision) { - return wrapSamplingDecision({ decision: undefined, context, spanAttributes }); - } - - const [sampled, sampleRate] = core.sampleSpan(options, { - name: inferredSpanName, - attributes: mergedAttributes, - transactionContext: { - name: inferredSpanName, - parentSampled, - }, - parentSampled, - }); - - const attributes = { - [core.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate, - }; - - const method = `${maybeSpanHttpMethod}`.toUpperCase(); - if (method === 'OPTIONS' || method === 'HEAD') { - DEBUG_BUILD && core.logger.log(`[Tracing] Not sampling span because HTTP method is '${method}' for ${spanName}`); - - return { - ...wrapSamplingDecision({ decision: sdkTraceBase.SamplingDecision.NOT_RECORD, context, spanAttributes }), - attributes, - }; - } - - if (!sampled) { - return { - ...wrapSamplingDecision({ decision: sdkTraceBase.SamplingDecision.NOT_RECORD, context, spanAttributes }), - attributes, - }; - } - return { - ...wrapSamplingDecision({ decision: sdkTraceBase.SamplingDecision.RECORD_AND_SAMPLED, context, spanAttributes }), - attributes, - }; - } - - /** Returns the sampler name or short description with the configuration. */ - toString() { - return 'SentrySampler'; - } -} - -function getParentRemoteSampled(parentSpan) { - const traceId = parentSpan.spanContext().traceId; - const traceparentData = getPropagationContextFromSpan(parentSpan); - - // Only inherit sampled if `traceId` is the same - return traceparentData && traceId === traceparentData.traceId ? traceparentData.sampled : undefined; -} - -function getParentSampled(parentSpan, traceId, spanName) { - const parentContext = parentSpan.spanContext(); - - // Only inherit sample rate if `traceId` is the same - // Note for testing: `isSpanContextValid()` checks the format of the traceId/spanId, so we need to pass valid ones - if (api.isSpanContextValid(parentContext) && parentContext.traceId === traceId) { - if (parentContext.isRemote) { - const parentSampled = getParentRemoteSampled(parentSpan); - DEBUG_BUILD && - core.logger.log(`[Tracing] Inheriting remote parent's sampled decision for ${spanName}: ${parentSampled}`); - return parentSampled; - } - - const parentSampled = getSamplingDecision(parentContext); - DEBUG_BUILD && core.logger.log(`[Tracing] Inheriting parent's sampled decision for ${spanName}: ${parentSampled}`); - return parentSampled; - } - - return undefined; -} - -/** - * Wrap a sampling decision with data that Sentry needs to work properly with it. - * If you pass `decision: undefined`, it will be treated as `NOT_RECORDING`, but in contrast to passing `NOT_RECORDING` - * it will not propagate this decision to downstream Sentry SDKs. - */ -function wrapSamplingDecision({ - decision, - context, - spanAttributes, -}) { - const traceState = getBaseTraceState(context, spanAttributes); - - // If the decision is undefined, we treat it as NOT_RECORDING, but we don't propagate this decision to downstream SDKs - // Which is done by not setting `SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING` traceState - if (decision == undefined) { - return { decision: sdkTraceBase.SamplingDecision.NOT_RECORD, traceState }; - } - - if (decision === sdkTraceBase.SamplingDecision.NOT_RECORD) { - return { decision, traceState: traceState.set(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING, '1') }; - } - - return { decision, traceState }; -} - -function getBaseTraceState(context, spanAttributes) { - const parentSpan = api.trace.getSpan(context); - const parentContext = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.spanContext, 'call', _5 => _5()]); - - let traceState = _optionalChain([parentContext, 'optionalAccess', _6 => _6.traceState]) || new core$1.TraceState(); - - // We always keep the URL on the trace state, so we can access it in the propagator - // `ATTR_URL_FULL` is the new attribute, but we still support the old one, `ATTR_HTTP_URL`, for now. - // eslint-disable-next-line deprecation/deprecation - const url = spanAttributes[semanticConventions.SEMATTRS_HTTP_URL] || spanAttributes[semanticConventions.ATTR_URL_FULL]; - if (url && typeof url === 'string') { - traceState = traceState.set(SENTRY_TRACE_STATE_URL, url); - } - - return traceState; -} - -/** - * If the active span is invalid, we want to ignore it as parent. - * This aligns with how otel tracers and default samplers handle these cases. - */ -function getValidSpan(context) { - const span = api.trace.getSpan(context); - return span && api.isSpanContextValid(span.spanContext()) ? span : undefined; -} - -/** - * This method takes an OpenTelemetry instrumentation or - * array of instrumentations and registers them with OpenTelemetry. - * - * @deprecated This method will be removed in the next major version of the SDK. - * Use the `openTelemetryInstrumentations` option in `Sentry.init()` or your custom Sentry Client instead. - */ -function addOpenTelemetryInstrumentation(...instrumentations) { - instrumentation.registerInstrumentations({ - instrumentations, - }); -} - -exports.getClient = core.getClient; -exports.getCurrentHubShim = core.getCurrentHubShim; -exports.getDynamicSamplingContextFromSpan = core.getDynamicSamplingContextFromSpan; exports.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION; +exports.SENTRY_SCOPES_CONTEXT_KEY = SENTRY_SCOPES_CONTEXT_KEY; +exports.SENTRY_TRACE_STATE_CHILD_IGNORED = SENTRY_TRACE_STATE_CHILD_IGNORED; exports.SentryPropagator = SentryPropagator; exports.SentrySampler = SentrySampler; exports.SentrySpanProcessor = SentrySpanProcessor; -exports.addOpenTelemetryInstrumentation = addOpenTelemetryInstrumentation; +exports.SentryTracerProvider = SentryTracerProvider; +exports.applyOtelSpanData = applyOtelSpanData; +exports.backfillStreamedSpanDataFromOtel = backfillStreamedSpanDataFromOtel; +exports.buildContextWithSentryScopes = buildContextWithSentryScopes; exports.continueTrace = continueTrace; exports.enhanceDscWithOpenTelemetryRootSpanName = enhanceDscWithOpenTelemetryRootSpanName; -exports.generateSpanContextForPropagationContext = generateSpanContextForPropagationContext; exports.getActiveSpan = getActiveSpan; -exports.getPropagationContextFromSpan = getPropagationContextFromSpan; exports.getRequestSpanData = getRequestSpanData; exports.getScopesFromContext = getScopesFromContext; +exports.getSentryResource = getSentryResource; exports.getSpanKind = getSpanKind; exports.getTraceContextForScope = getTraceContextForScope; exports.isSentryRequestSpan = isSentryRequestSpan; exports.openTelemetrySetupCheck = openTelemetrySetupCheck; +exports.setIsSetup = setIsSetup; exports.setOpenTelemetryContextAsyncContextStrategy = setOpenTelemetryContextAsyncContextStrategy; exports.setupEventContextTrace = setupEventContextTrace; -exports.shouldPropagateTraceForUrl = shouldPropagateTraceForUrl; exports.spanHasAttributes = spanHasAttributes; exports.spanHasEvents = spanHasEvents; exports.spanHasKind = spanHasKind; @@ -96525,393 +58527,10704 @@ exports.withActiveSpan = withActiveSpan; exports.wrapClientClass = wrapClientClass; exports.wrapContextManagerClass = wrapContextManagerClass; exports.wrapSamplingDecision = wrapSamplingDecision; +//# sourceMappingURL=asyncContextStrategy-volGaYqZ.js.map + + +/***/ }), + +/***/ 90157: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const asyncContextStrategy = __nccwpck_require__(79271); +const core = __nccwpck_require__(84466); +const api = __nccwpck_require__(65163); +const node_async_hooks = __nccwpck_require__(92761); +const node_events = __nccwpck_require__(15673); + +const ADD_LISTENER_METHODS = ["addListener", "on", "once", "prependListener", "prependOnceListener"]; +class SentryAsyncLocalStorageContextManager { + constructor() { + this._kOtListeners = /* @__PURE__ */ Symbol("OtListeners"); + this._wrapped = false; + asyncContextStrategy.setIsSetup("SentryContextManager"); + this._asyncLocalStorage = core.getAsyncContextStrategy(core.getMainCarrier()).getTracingChannelBinding?.()?.asyncLocalStorage ?? new node_async_hooks.AsyncLocalStorage(); + } + active() { + return this._asyncLocalStorage.getStore() ?? api.ROOT_CONTEXT; + } + with(context, fn, thisArg, ...args) { + const ctx2 = asyncContextStrategy.buildContextWithSentryScopes(context, this.active()); + const cb = thisArg == null ? fn : fn.bind(thisArg); + return this._asyncLocalStorage.run(ctx2, cb, ...args); + } + enable() { + return this; + } + disable() { + this._asyncLocalStorage.disable(); + return this; + } + bind(context, target) { + if (target instanceof node_events.EventEmitter) { + return this._bindEventEmitter(context, target); + } + if (typeof target === "function") { + return this._bindFunction(context, target); + } + return target; + } + /** + * Gets underlying AsyncLocalStorage and symbol to allow lookup of scope. + * This is Sentry-specific. + */ + getAsyncLocalStorageLookup() { + return { + asyncLocalStorage: this._asyncLocalStorage, + contextSymbol: asyncContextStrategy.SENTRY_SCOPES_CONTEXT_KEY + }; + } + _bindFunction(context, target) { + const managerWith = this.with.bind(this); + const contextWrapper = function(...args) { + return managerWith(context, () => target.apply(this, args)); + }; + Object.defineProperty(contextWrapper, "length", { + enumerable: false, + configurable: true, + writable: false, + value: target.length + }); + return contextWrapper; + } + _bindEventEmitter(context, ee) { + if (this._getPatchMap(ee) !== void 0) { + return ee; + } + this._createPatchMap(ee); + for (const methodName of ADD_LISTENER_METHODS) { + if (ee[methodName] === void 0) continue; + ee[methodName] = this._patchAddListener( + ee, + ee[methodName], + context + ); + } + if (typeof ee.removeListener === "function") { + ee.removeListener = this._patchRemoveListener(ee, ee.removeListener); + } + if (typeof ee.off === "function") { + ee.off = this._patchRemoveListener(ee, ee.off); + } + if (typeof ee.removeAllListeners === "function") { + ee.removeAllListeners = this._patchRemoveAllListeners( + ee, + // oxlint-disable-next-line @typescript-eslint/unbound-method + ee.removeAllListeners + ); + } + return ee; + } + _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); + }; + } + _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 (event !== void 0 && map[event] !== void 0) { + delete map[event]; + } + } + return original.apply(this, arguments); + }; + } + _patchAddListener(ee, original, context) { + const contextManager = this; + return function(event, listener) { + 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, listener); + listeners.set(listener, patchedListener); + contextManager._wrapped = true; + try { + return original.call(this, event, patchedListener); + } finally { + contextManager._wrapped = false; + } + }; + } + _createPatchMap(ee) { + const map = /* @__PURE__ */ Object.create(null); + ee[this._kOtListeners] = map; + return map; + } + _getPatchMap(ee) { + return ee[this._kOtListeners]; + } +} + +function setNodeOpenTelemetryContextAsyncContextStrategy(options) { + asyncContextStrategy.setOpenTelemetryContextAsyncContextStrategy({ + getTracingChannelBinding: !options?.skipOpenTelemetrySetup ? getDefaultAsyncLocalStorageFactory() : getCustomAsyncLocalStorageFactory() + }); +} +function getDefaultAsyncLocalStorageFactory() { + const defaultAsyncLocalStorage = new node_async_hooks.AsyncLocalStorage(); + return () => { + return { + asyncLocalStorage: defaultAsyncLocalStorage, + getStoreWithActiveSpan + }; + }; +} +function getCustomAsyncLocalStorageFactory() { + return () => { + try { + const contextManager = api.context._getContextManager(); + const asyncLocalStorage = contextManager?.getAsyncLocalStorageLookup().asyncLocalStorage; + return asyncLocalStorage ? { + asyncLocalStorage, + getStoreWithActiveSpan + } : void 0; + } catch { + return void 0; + } + }; +} +function getStoreWithActiveSpan(span) { + const activeContext = api.context.active(); + const isIgnoredChild = core.spanIsIgnored(span) && core.getRootSpan(span) !== span || span.spanContext().traceState?.get(asyncContextStrategy.SENTRY_TRACE_STATE_CHILD_IGNORED) === "1"; + return isIgnoredChild ? activeContext : api.trace.setSpan(activeContext, span); +} + +exports.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = asyncContextStrategy.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION; +exports.SentryPropagator = asyncContextStrategy.SentryPropagator; +exports.SentrySampler = asyncContextStrategy.SentrySampler; +exports.SentrySpanProcessor = asyncContextStrategy.SentrySpanProcessor; +exports.SentryTracerProvider = asyncContextStrategy.SentryTracerProvider; +exports.applyOtelSpanData = asyncContextStrategy.applyOtelSpanData; +exports.backfillStreamedSpanDataFromOtel = asyncContextStrategy.backfillStreamedSpanDataFromOtel; +exports.continueTrace = asyncContextStrategy.continueTrace; +exports.enhanceDscWithOpenTelemetryRootSpanName = asyncContextStrategy.enhanceDscWithOpenTelemetryRootSpanName; +exports.getActiveSpan = asyncContextStrategy.getActiveSpan; +exports.getRequestSpanData = asyncContextStrategy.getRequestSpanData; +exports.getScopesFromContext = asyncContextStrategy.getScopesFromContext; +exports.getSentryResource = asyncContextStrategy.getSentryResource; +exports.getSpanKind = asyncContextStrategy.getSpanKind; +exports.getTraceContextForScope = asyncContextStrategy.getTraceContextForScope; +exports.isSentryRequestSpan = asyncContextStrategy.isSentryRequestSpan; +exports.openTelemetrySetupCheck = asyncContextStrategy.openTelemetrySetupCheck; +exports.setIsSetup = asyncContextStrategy.setIsSetup; +exports.setupEventContextTrace = asyncContextStrategy.setupEventContextTrace; +exports.spanHasAttributes = asyncContextStrategy.spanHasAttributes; +exports.spanHasEvents = asyncContextStrategy.spanHasEvents; +exports.spanHasKind = asyncContextStrategy.spanHasKind; +exports.spanHasName = asyncContextStrategy.spanHasName; +exports.spanHasParentId = asyncContextStrategy.spanHasParentId; +exports.spanHasStatus = asyncContextStrategy.spanHasStatus; +exports.startInactiveSpan = asyncContextStrategy.startInactiveSpan; +exports.startSpan = asyncContextStrategy.startSpan; +exports.startSpanManual = asyncContextStrategy.startSpanManual; +exports.suppressTracing = asyncContextStrategy.suppressTracing; +exports.withActiveSpan = asyncContextStrategy.withActiveSpan; +exports.wrapClientClass = asyncContextStrategy.wrapClientClass; +exports.wrapContextManagerClass = asyncContextStrategy.wrapContextManagerClass; +exports.wrapSamplingDecision = asyncContextStrategy.wrapSamplingDecision; +exports.getClient = core.getClient; +exports.getDynamicSamplingContextFromSpan = core.getDynamicSamplingContextFromSpan; +exports.shouldPropagateTraceForUrl = core.shouldPropagateTraceForUrl; +exports.withStreamedSpan = core.withStreamedSpan; +exports.SentryAsyncLocalStorageContextManager = SentryAsyncLocalStorageContextManager; +exports.setOpenTelemetryContextAsyncContextStrategy = setNodeOpenTelemetryContextAsyncContextStrategy; //# sourceMappingURL=index.js.map /***/ }), -/***/ 37289: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 64112: +/***/ ((__unused_webpack_module, exports) => { -"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); + +exports.DEBUG_BUILD = DEBUG_BUILD; +//# sourceMappingURL=debug-build.js.map -var util = __nccwpck_require__(73837); +/***/ }), -var ParseError = __nccwpck_require__(558); -var ascii = __nccwpck_require__(32789); +/***/ 91837: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -var isDelimiter = ascii.isDelimiter; -var isTokenChar = ascii.isTokenChar; -var isExtended = ascii.isExtended; -var isPrint = ascii.isPrint; +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/** - * Unescape a string. - * - * @param {string} str The string to unescape. - * @returns {string} A new unescaped string. - * @private - */ -function decode(str) { - return str.replace(/\\(.)/g, '$1'); +const attributes = __nccwpck_require__(88264); +const op = __nccwpck_require__(83678); +const core = __nccwpck_require__(84466); +const tracingChannel = __nccwpck_require__(91484); +const utils = __nccwpck_require__(11103); + +const GRAPHQL_DC_CHANNEL_PARSE = "graphql:parse"; +const GRAPHQL_DC_CHANNEL_VALIDATE = "graphql:validate"; +const GRAPHQL_DC_CHANNEL_EXECUTE = "graphql:execute"; +const GRAPHQL_DC_CHANNEL_SUBSCRIBE = "graphql:subscribe"; +const GRAPHQL_DC_CHANNEL_RESOLVE = "graphql:resolve"; +const ORIGIN = "auto.graphql.diagnostic_channel"; +const SPAN_NAME_PARSE = "graphql.parse"; +const SPAN_NAME_VALIDATE = "graphql.validate"; +const SPAN_NAME_EXECUTE = "graphql.execute"; +const SPAN_NAME_SUBSCRIBE = "graphql.subscribe"; +const SPAN_NAME_RESOLVE = "graphql.resolve"; +const GRAPHQL_FIELD_NAME = "graphql.field.name"; +const GRAPHQL_FIELD_PATH = "graphql.field.path"; +const GRAPHQL_FIELD_TYPE = "graphql.field.type"; +const GRAPHQL_PARENT_NAME = "graphql.parent.name"; +function subscribeGraphqlDiagnosticChannels(tracingChannel, options = {}) { + const ignoreResolveSpans = options.ignoreResolveSpans !== false; + const ignoreTrivialResolveSpans = options.ignoreTrivialResolveSpans !== false; + const useOperationNameForRootSpan = options.useOperationNameForRootSpan !== false; + setupParseChannel(tracingChannel); + setupValidateChannel(tracingChannel); + setupOperationChannel(tracingChannel, GRAPHQL_DC_CHANNEL_EXECUTE, SPAN_NAME_EXECUTE, useOperationNameForRootSpan); + setupOperationChannel(tracingChannel, GRAPHQL_DC_CHANNEL_SUBSCRIBE, SPAN_NAME_SUBSCRIBE, useOperationNameForRootSpan); + if (!ignoreResolveSpans) { + setupResolveChannel(tracingChannel, ignoreTrivialResolveSpans); + } +} +function setupParseChannel(tracingChannel$1) { + tracingChannel.bindTracingChannelToSpan( + tracingChannel$1(GRAPHQL_DC_CHANNEL_PARSE), + () => core.startInactiveSpan({ + name: SPAN_NAME_PARSE, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op.WEB_SERVER_GRAPHQL_SPAN_OP + } + }) + ); +} +function setupValidateChannel(tracingChannel$1) { + tracingChannel.bindTracingChannelToSpan( + tracingChannel$1(GRAPHQL_DC_CHANNEL_VALIDATE), + (data) => { + return core.startInactiveSpan({ + name: SPAN_NAME_VALIDATE, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op.WEB_SERVER_GRAPHQL_SPAN_OP, + [attributes.GRAPHQL_DOCUMENT]: utils.collectGraphqlDocument(data.document) + } + }); + }, + { + beforeSpanEnd: (span, data) => { + if (Array.isArray(data.result) && data.result.length > 0) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "invalid_argument" }); + } + } + } + ); +} +function setupOperationChannel(tracingChannel$1, channelName, fallbackName, useOperationNameForRootSpan) { + tracingChannel.bindTracingChannelToSpan( + tracingChannel$1(channelName), + (data) => { + const span = core.startInactiveSpan({ + name: utils.getOperationSpanName(data.operationType, data.operationName, fallbackName), + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op.WEB_SERVER_GRAPHQL_SPAN_OP, + [attributes.GRAPHQL_OPERATION_TYPE]: data.operationType, + [attributes.GRAPHQL_OPERATION_NAME]: data.operationName || void 0, + [attributes.GRAPHQL_DOCUMENT]: utils.collectGraphqlDocument(data.document) + } + }); + if (useOperationNameForRootSpan && data.operationType) { + utils.renameRootSpanWithOperation(span, data.operationType, data.operationName); + } + return span; + }, + { + beforeSpanEnd: (span, data) => { + if (utils.hasResultErrors(data.result)) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" }); + } + } + } + ); +} +function setupResolveChannel(tracingChannel$1, ignoreTrivialResolveSpans) { + tracingChannel.bindTracingChannelToSpan(tracingChannel$1(GRAPHQL_DC_CHANNEL_RESOLVE), (data) => { + if (ignoreTrivialResolveSpans && data.isDefaultResolver) { + return void 0; + } + return core.startInactiveSpan({ + name: `${SPAN_NAME_RESOLVE} ${data.fieldPath}`, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op.WEB_SERVER_GRAPHQL_SPAN_OP, + [GRAPHQL_FIELD_NAME]: data.fieldName, + [GRAPHQL_FIELD_PATH]: data.fieldPath, + [GRAPHQL_FIELD_TYPE]: data.fieldType, + [GRAPHQL_PARENT_NAME]: data.parentType + } + }); + }); } -/** - * Build an error message when an unexpected character is found. - * - * @param {string} header The header field value. - * @param {number} position The position of the unexpected character. - * @returns {string} The error message. - * @private - */ -function unexpectedCharacterMessage(header, position) { - return util.format( - "Unexpected character '%s' at index %d", - header.charAt(position), - position +exports.GRAPHQL_DC_CHANNEL_EXECUTE = GRAPHQL_DC_CHANNEL_EXECUTE; +exports.GRAPHQL_DC_CHANNEL_PARSE = GRAPHQL_DC_CHANNEL_PARSE; +exports.GRAPHQL_DC_CHANNEL_RESOLVE = GRAPHQL_DC_CHANNEL_RESOLVE; +exports.GRAPHQL_DC_CHANNEL_SUBSCRIBE = GRAPHQL_DC_CHANNEL_SUBSCRIBE; +exports.GRAPHQL_DC_CHANNEL_VALIDATE = GRAPHQL_DC_CHANNEL_VALIDATE; +exports.subscribeGraphqlDiagnosticChannels = subscribeGraphqlDiagnosticChannels; +//# sourceMappingURL=graphql-dc-subscriber.js.map + + +/***/ }), + +/***/ 40708: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const diagnosticsChannel = __nccwpck_require__(65714); +const graphqlDcSubscriber = __nccwpck_require__(91837); + +const _graphqlIntegration = ((options = {}) => { + return { + name: "Graphql", + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + graphqlDcSubscriber.subscribeGraphqlDiagnosticChannels(diagnosticsChannel.tracingChannel, options); + }); + } + }; +}); +const graphqlIntegration = core.defineIntegration(_graphqlIntegration); + +exports.graphqlIntegration = graphqlIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 11103: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); + +const ORIGINAL_DESCRIPTION_ATTRIBUTE = "original-description"; +const REDACTED_LITERAL_KINDS = /* @__PURE__ */ new Set(["Int", "Float", "String", "BlockString"]); +function renameRootSpanWithOperation(span, operationType, operationName) { + const rootSpan = core.getRootSpan(span); + if (rootSpan === span) { + return; + } + const rootSpanJson = core.spanToJSON(rootSpan); + const newOperation = operationName ? `${operationType} ${operationName}` : operationType; + const existingOperations = rootSpanJson.data[attributes.SENTRY_GRAPHQL_OPERATION]; + let operations; + if (Array.isArray(existingOperations)) { + operations = [...existingOperations, newOperation]; + } else if (typeof existingOperations === "string") { + operations = [existingOperations, newOperation]; + } else { + operations = newOperation; + } + rootSpan.setAttribute(attributes.SENTRY_GRAPHQL_OPERATION, operations); + const originalDescription = rootSpanJson.data[ORIGINAL_DESCRIPTION_ATTRIBUTE] ?? rootSpanJson.description; + if (!rootSpanJson.data[ORIGINAL_DESCRIPTION_ATTRIBUTE]) { + rootSpan.setAttribute(ORIGINAL_DESCRIPTION_ATTRIBUTE, originalDescription); + } + rootSpan.updateName(`${originalDescription} (${getGraphqlOperationNamesFromAttribute(operations)})`); +} +function getGraphqlOperationNamesFromAttribute(attr) { + if (Array.isArray(attr)) { + const sorted = attr.slice().sort(); + if (sorted.length <= 5) { + return sorted.join(", "); + } + return `${sorted.slice(0, 5).join(", ")}, +${sorted.length - 5}`; + } + return attr; +} +function getOperationSpanName(operationType, operationName, fallbackName) { + if (operationType && operationName) { + return `${operationType} ${operationName}`; + } + if (operationType) { + return operationType; + } + return fallbackName; +} +function hasResultErrors(result) { + if (core.isObjectLike(result) && "errors" in result) { + const errors = result.errors; + return Array.isArray(errors) && errors.length > 0; + } + return false; +} +function redactGraphqlDocument(document) { + const loc = document?.loc; + const body = loc?.source?.body; + if (typeof body !== "string" || !loc?.startToken) { + return void 0; + } + try { + const ranges = []; + for (let token = loc.startToken; token; token = token.next) { + if (REDACTED_LITERAL_KINDS.has(token.kind)) { + ranges.push({ start: token.start, end: token.end, kind: token.kind }); + } + } + let out = body; + for (let i = ranges.length - 1; i >= 0; i--) { + const { start, end, kind } = ranges[i]; + const replacement = kind === "String" || kind === "BlockString" ? '"*"' : "*"; + out = out.slice(0, start) + replacement + out.slice(end); + } + return out; + } catch { + return void 0; + } +} +function collectGraphqlDocument(document) { + if (core.getClient()?.getDataCollectionOptions().graphQL.document !== true) { + return void 0; + } + return redactGraphqlDocument(document); +} + +exports.collectGraphqlDocument = collectGraphqlDocument; +exports.getOperationSpanName = getOperationSpanName; +exports.hasResultErrors = hasResultErrors; +exports.renameRootSpanWithOperation = renameRootSpanWithOperation; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 93362: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const index$1 = __nccwpck_require__(40708); +const index$3 = __nccwpck_require__(36685); +const mongodbSpan = __nccwpck_require__(68095); +const index$4 = __nccwpck_require__(25804); +const index$2 = __nccwpck_require__(70068); +const index$5 = __nccwpck_require__(82500); +const redisStatementSerializer = __nccwpck_require__(57915); +const tracingChannel = __nccwpck_require__(91484); +const index$6 = __nccwpck_require__(17611); +const index = __nccwpck_require__(11170); +const mongooseLegacySpan = __nccwpck_require__(21385); + + + +exports.graphqlIntegration = index$1.graphqlIntegration; +exports.mongooseIntegration = index$3.mongooseIntegration; +exports.getV3CommandOperation = mongodbSpan.getV3CommandOperation; +exports.getV3SpanAttributes = mongodbSpan.getV3SpanAttributes; +exports.getV4SpanAttributes = mongodbSpan.getV4SpanAttributes; +exports.startMongoSpan = mongodbSpan.startMongoSpan; +exports.mysql2Integration = index$4.mysql2Integration; +exports.instrumentPrisma = index$2.instrumentPrisma; +exports.prismaIntegration = index$2.prismaIntegration; +exports.redisIntegration = index$5.redisIntegration; +exports.defaultDbStatementSerializer = redisStatementSerializer.defaultDbStatementSerializer; +exports.bindTracingChannelToSpan = tracingChannel.bindTracingChannelToSpan; +exports.vercelAiIntegration = index$6.vercelAiIntegration; +exports.fastifyIntegration = index.fastifyIntegration; +exports.handleFastifyError = index.handleFastifyError; +exports.instrumentFastify = index.instrumentFastify; +exports.startMongooseLegacySpan = mongooseLegacySpan.startMongooseLegacySpan; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 89210: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Amqplib"; +const PUBLISHER_ORIGIN = "auto.amqplib.orchestrion.publisher"; +const CONSUMER_ORIGIN = "auto.amqplib.orchestrion.consumer"; +const ATTR_MESSAGING_OPERATION = "messaging.operation"; +const ATTR_MESSAGING_DESTINATION = "messaging.destination"; +const ATTR_MESSAGING_DESTINATION_KIND = "messaging.destination_kind"; +const ATTR_MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key"; +const ATTR_MESSAGING_PROTOCOL = "messaging.protocol"; +const ATTR_MESSAGING_PROTOCOL_VERSION_LEGACY = "messaging.protocol_version"; +const ATTR_MESSAGING_URL = "messaging.url"; +const ATTR_MESSAGING_MESSAGE_ID = "messaging.message_id"; +const ATTR_MESSAGING_CONVERSATION_ID_LEGACY = "messaging.conversation_id"; +const ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY = "messaging.rabbitmq.destination.routing_key"; +const ATTR_MESSAGING_CONVERSATION_ID = "messaging.message.conversation_id"; +const MESSAGING_DESTINATION_KIND_VALUE_TOPIC = "topic"; +const MESSAGING_OPERATION_VALUE_PROCESS = "process"; +const MESSAGING_OPERATION_VALUE_SEND = "send"; +const CONSUME_TIMEOUT_MS = 1e3 * 60; +const END_OP = { + Ack: "ack", + AckAll: "ackAll", + Reject: "reject", + Nack: "nack", + NackAll: "nackAll", + ChannelClosed: "channel closed", + ChannelError: "channel error", + InstrumentationTimeout: "instrumentation timeout" +}; +const MESSAGE_STORED_SPAN = /* @__PURE__ */ Symbol("sentry.amqplib.message.stored-span"); +const CHANNEL_SPANS_NOT_ENDED = /* @__PURE__ */ Symbol("sentry.amqplib.channel.spans-not-ended"); +const CHANNEL_CONSUME_TIMEOUT_TIMER = /* @__PURE__ */ Symbol("sentry.amqplib.channel.consume-timeout-timer"); +const CHANNEL_CONSUMER_INFO = /* @__PURE__ */ Symbol("sentry.amqplib.channel.consumer-info"); +const CHANNEL_IS_CONFIRM_PUBLISHING = /* @__PURE__ */ Symbol("sentry.amqplib.channel.is-confirm-publishing"); +const CONNECTION_ATTRIBUTES = /* @__PURE__ */ Symbol("sentry.amqplib.connection.attributes"); +const NOOP = () => { +}; +let subscribed = false; +const _amqplibChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel || subscribed) { + return; + } + subscribed = true; + debugBuild.DEBUG_BUILD && core.debug.log("[orchestrion:amqplib] subscribing to amqplib tracing channels"); + core.waitForTracingChannelBinding(() => { + subscribeConnect(); + subscribePublish(); + subscribeConfirmPublish(); + subscribeConsume(); + subscribeDispatch(); + subscribeSettle(); + }); + } + }; +}); +function subscribePublish() { + tracingChannel.bindTracingChannelToSpan(diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_PUBLISH), (data) => { + if (data.self?.[CHANNEL_IS_CONFIRM_PUBLISHING]) { + return void 0; + } + return startPublishSpan(data); + }); +} +function subscribeConfirmPublish() { + const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_CONFIRM_PUBLISH); + tracingChannel.bindTracingChannelToSpan(channel, (data) => { + if (data.self) { + data.self[CHANNEL_IS_CONFIRM_PUBLISHING] = true; + } + return startPublishSpan(data); + }); + channel.end.subscribe((message) => { + const self = message.self; + if (self) { + self[CHANNEL_IS_CONFIRM_PUBLISHING] = false; + } + }); +} +function subscribeConsume() { + const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_CONSUME); + channel.start.subscribe(NOOP); + channel.asyncEnd.subscribe((message) => { + const data = message; + const consumerChannel = data.self; + const result = data.result; + const consumerTag = result?.consumerTag; + if (!consumerChannel || !consumerTag) { + return; + } + ensureChannelState(consumerChannel); + const queueArg = data.arguments[0]; + const queue = typeof queueArg === "string" ? queueArg : ""; + const options = data.arguments[2]; + consumerChannel[CHANNEL_CONSUMER_INFO]?.set(consumerTag, { noAck: !!options?.noAck, queue }); + }); +} +function subscribeDispatch() { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_DISPATCH), + (data) => { + const channel = data.self; + const fields = data.arguments[0]; + const msg = data.arguments[1]; + if (!channel || !msg) { + return void 0; + } + ensureChannelState(channel); + const info = fields?.consumerTag ? channel[CHANNEL_CONSUMER_INFO]?.get(fields.consumerTag) : void 0; + const queue = info?.queue ?? msg.fields?.routingKey ?? ""; + const noAck = info?.noAck ?? false; + const headers = msg.properties?.headers; + const sentryTrace = getHeaderAsString(headers, "sentry-trace"); + const baggage = getHeaderAsString(headers, "baggage"); + const span = core.continueTrace({ sentryTrace, baggage }, () => startConsumeSpan(queue, msg, channel)); + if (!noAck) { + channel[CHANNEL_SPANS_NOT_ENDED]?.push({ msg, timeOfConsume: core.timestampInSeconds() }); + msg[MESSAGE_STORED_SPAN] = span; + } + data._sentryNoAck = noAck; + return span; + }, + { + // Manual-ack consumers: the span outlives the dispatch call and is ended by ack/nack/reject + // (or timeout/close), so take ownership and don't let the helper end it here. noAck consumers + // have no settle call, so let the helper end the span when dispatch returns. + deferSpanEnd({ data }) { + return !data._sentryNoAck; + } + } + ); +} +function subscribeSettle() { + diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_ACK).start.subscribe((message) => handleAck(message, false, END_OP.Ack)); + diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_NACK).start.subscribe((message) => handleAck(message, true, END_OP.Nack)); + diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_REJECT).start.subscribe((message) => handleAck(message, true, END_OP.Reject)); + diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_ACK_ALL).start.subscribe((message) => { + const data = message; + if (data.self) { + endAllSpansOnChannel(data.self, false, END_OP.AckAll, void 0); + } + }); + diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_NACK_ALL).start.subscribe((message) => { + const data = message; + if (data.self) { + endAllSpansOnChannel(data.self, true, END_OP.NackAll, data.arguments[0]); + } + }); +} +function subscribeConnect() { + const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.AMQPLIB_CONNECT); + channel.start.subscribe(NOOP); + channel.asyncEnd.subscribe((message) => { + const data = message; + const conn = data.result; + if (!conn || typeof conn !== "object") { + return; + } + conn[CONNECTION_ATTRIBUTES] = { + ...getConnectionAttributesFromUrl(data.arguments?.[0]), + ...getConnectionAttributesFromServer(conn) + }; + }); +} +function handleAck(data, isRejected, endOperation) { + const channel = data.self; + if (!channel) { + return; + } + const message = data.arguments[0]; + if (!message) { + return; + } + const allUpToOrRequeue = data.arguments[1]; + const requeue = data.arguments[2]; + const requeueResolved = endOperation === END_OP.Reject ? allUpToOrRequeue : requeue; + const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? []; + const msgIndex = spansNotEnded.findIndex((msgDetails) => msgDetails.msg === message); + if (msgIndex < 0) { + endConsumerSpan(message, isRejected, endOperation, requeueResolved); + } else if (endOperation !== END_OP.Reject && allUpToOrRequeue) { + for (let i = 0; i <= msgIndex; i++) { + endConsumerSpan(spansNotEnded[i].msg, isRejected, endOperation, requeueResolved); + } + spansNotEnded.splice(0, msgIndex + 1); + } else { + endConsumerSpan(message, isRejected, endOperation, requeueResolved); + spansNotEnded.splice(msgIndex, 1); + } +} +function ensureChannelState(channel) { + if (Object.prototype.hasOwnProperty.call(channel, CHANNEL_SPANS_NOT_ENDED)) { + return; + } + channel[CHANNEL_SPANS_NOT_ENDED] = []; + channel[CHANNEL_CONSUMER_INFO] = /* @__PURE__ */ new Map(); + const timer = setInterval(() => checkConsumeTimeoutOnChannel(channel), CONSUME_TIMEOUT_MS); + timer.unref?.(); + channel[CHANNEL_CONSUME_TIMEOUT_TIMER] = timer; + if (typeof channel.on === "function") { + channel.on("close", () => { + endAllSpansOnChannel(channel, true, END_OP.ChannelClosed, void 0); + clearConsumeTimeoutTimer(channel); + }); + channel.on("error", () => { + endAllSpansOnChannel(channel, true, END_OP.ChannelError, void 0); + clearConsumeTimeoutTimer(channel); + }); + } +} +function clearConsumeTimeoutTimer(channel) { + const activeTimer = channel[CHANNEL_CONSUME_TIMEOUT_TIMER]; + if (activeTimer) { + clearInterval(activeTimer); + channel[CHANNEL_CONSUME_TIMEOUT_TIMER] = void 0; + } +} +function checkConsumeTimeoutOnChannel(channel) { + const currentTime = core.timestampInSeconds(); + const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? []; + let i; + for (i = 0; i < spansNotEnded.length; i++) { + const currMessage = spansNotEnded[i]; + const timeFromConsumeMs = (currentTime - currMessage.timeOfConsume) * 1e3; + if (timeFromConsumeMs < CONSUME_TIMEOUT_MS) { + break; + } + endConsumerSpan(currMessage.msg, null, END_OP.InstrumentationTimeout, true); + } + spansNotEnded.splice(0, i); +} +function endAllSpansOnChannel(channel, isRejected, operation, requeue) { + const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? []; + spansNotEnded.forEach((msgDetails) => { + endConsumerSpan(msgDetails.msg, isRejected, operation, requeue); + }); + channel[CHANNEL_SPANS_NOT_ENDED] = []; +} +function endConsumerSpan(message, isRejected, operation, requeue) { + const storedSpan = message[MESSAGE_STORED_SPAN]; + if (!storedSpan) { + return; + } + if (isRejected !== false) { + storedSpan.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: operation !== END_OP.ChannelClosed && operation !== END_OP.ChannelError ? `${operation} called on message${requeue === true ? " with requeue" : requeue === false ? " without requeue" : ""}` : operation + }); + } + storedSpan.end(); + message[MESSAGE_STORED_SPAN] = void 0; +} +function startPublishSpan(data) { + const exchangeArg = data.arguments[0]; + const routingKeyArg = data.arguments[1]; + const exchange = typeof exchangeArg === "string" ? exchangeArg : ""; + const routingKey = typeof routingKeyArg === "string" ? routingKeyArg : ""; + let options = data.arguments[3]; + const span = core.startInactiveSpan({ + name: `publish ${normalizeExchange(exchange)}`, + op: "message", + kind: core.SPAN_KIND.PRODUCER, + attributes: { + ...getStoredConnectionAttributes(data.self), + [ATTR_MESSAGING_DESTINATION]: exchange, + // TODO(v11) remove this attribute + [attributes.MESSAGING_DESTINATION_NAME]: exchange, + [ATTR_MESSAGING_DESTINATION_KIND]: MESSAGING_DESTINATION_KIND_VALUE_TOPIC, + // TODO(v11) remove this attribute + [ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey, + // TODO(v11) remove this attribute + [ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY]: routingKey, + [attributes.MESSAGING_OPERATION_TYPE]: MESSAGING_OPERATION_VALUE_SEND, + [ATTR_MESSAGING_MESSAGE_ID]: options?.messageId, + // todo(v11) remove this attribute + [attributes.MESSAGING_MESSAGE_ID]: options?.messageId, + [ATTR_MESSAGING_CONVERSATION_ID_LEGACY]: options?.correlationId, + // todo(v11) remove this attribute + [ATTR_MESSAGING_CONVERSATION_ID]: options?.correlationId, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PUBLISHER_ORIGIN + } + }); + if (!options || typeof options !== "object") { + options = {}; + data.arguments[3] = options; + } + const headers = options.headers && typeof options.headers === "object" ? options.headers : options.headers = {}; + const traceData = core.getTraceData({ span }); + if (traceData["sentry-trace"]) { + headers["sentry-trace"] = traceData["sentry-trace"]; + } + if (traceData.baggage) { + headers["baggage"] = traceData.baggage; + } + return span; +} +function startConsumeSpan(queue, msg, channel) { + return core.startInactiveSpan({ + name: `${queue} process`, + op: "message", + kind: core.SPAN_KIND.CONSUMER, + attributes: { + ...getStoredConnectionAttributes(channel), + [ATTR_MESSAGING_DESTINATION]: msg.fields?.exchange, + // TODO(v11) remove this attribute + [attributes.MESSAGING_DESTINATION_NAME]: msg.fields?.exchange, + [ATTR_MESSAGING_DESTINATION_KIND]: MESSAGING_DESTINATION_KIND_VALUE_TOPIC, + // TODO(v11) remove this attribute + [ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: msg.fields?.routingKey, + // TODO(v11) remove this attribute + [ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY]: msg.fields?.routingKey, + [ATTR_MESSAGING_OPERATION]: MESSAGING_OPERATION_VALUE_PROCESS, + // TODO(v11) remove this attribute + [attributes.MESSAGING_OPERATION_TYPE]: MESSAGING_OPERATION_VALUE_PROCESS, + [ATTR_MESSAGING_MESSAGE_ID]: msg.properties?.messageId, + // todo(v11) remove this attribute + [attributes.MESSAGING_MESSAGE_ID]: msg.properties?.messageId, + [ATTR_MESSAGING_CONVERSATION_ID_LEGACY]: msg.properties?.correlationId, + // todo(v11) remove this attribute + [ATTR_MESSAGING_CONVERSATION_ID]: msg.properties?.correlationId, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: CONSUMER_ORIGIN + } + }); +} +function getStoredConnectionAttributes(channel) { + const connection = channel?.connection; + const stored = connection?.[CONNECTION_ATTRIBUTES]; + if (stored) { + return stored; + } + const product = connection?.serverProperties?.product ?? connection?.connection?.serverProperties?.product; + if (typeof product === "string" && product) { + return { [attributes.MESSAGING_SYSTEM]: product.toLowerCase() }; + } + return {}; +} +function getConnectionAttributesFromServer(conn) { + const product = conn.serverProperties?.product ?? conn.connection?.serverProperties?.product; + if (typeof product === "string" && product) { + return { [attributes.MESSAGING_SYSTEM]: product.toLowerCase() }; + } + return {}; +} +function getConnectionAttributesFromUrl(url) { + const attributes$1 = { + // The only protocol supported by the instrumented library. + [ATTR_MESSAGING_PROTOCOL_VERSION_LEGACY]: "0.9.1", + // TODO(v11): remove this attribute + [attributes.NETWORK_PROTOCOL_VERSION]: "0.9.1" + }; + const resolvedUrl = url || "amqp://localhost"; + if (typeof resolvedUrl === "object") { + const connectOptions = resolvedUrl; + const protocol = getProtocol(connectOptions.protocol); + const hostname = getHostname(connectOptions.hostname); + const port = getPort(connectOptions.port, protocol); + attributes$1[ATTR_MESSAGING_PROTOCOL] = protocol; + attributes$1[attributes.NETWORK_PROTOCOL_NAME] = protocol; + attributes$1[attributes.SERVER_ADDRESS] = hostname; + attributes$1[attributes.SERVER_PORT] = port; + attributes$1[attributes.NET_PEER_NAME] = hostname; + attributes$1[attributes.NET_PEER_PORT] = port; + } else if (typeof resolvedUrl === "string") { + const censoredUrl = censorPassword(resolvedUrl); + attributes$1[ATTR_MESSAGING_URL] = censoredUrl; + attributes$1[attributes.URL_FULL] = censoredUrl; + try { + const urlParts = new URL(censoredUrl); + const protocol = getProtocol(urlParts.protocol); + const hostname = getHostname(urlParts.hostname); + const port = getPort(urlParts.port ? parseInt(urlParts.port, 10) : void 0, protocol); + attributes$1[ATTR_MESSAGING_PROTOCOL] = protocol; + attributes$1[attributes.NETWORK_PROTOCOL_NAME] = protocol; + attributes$1[attributes.SERVER_ADDRESS] = hostname; + attributes$1[attributes.SERVER_PORT] = port; + attributes$1[attributes.NET_PEER_NAME] = hostname; + attributes$1[attributes.NET_PEER_PORT] = port; + } catch { + } + } + return attributes$1; +} +function normalizeExchange(exchangeName) { + return exchangeName !== "" ? exchangeName : ""; +} +function censorPassword(url) { + return url.replace(/:[^:@/]*@/, ":***@"); +} +function getPort(portFromUrl, resolvedProtocol) { + return portFromUrl || (resolvedProtocol === "AMQP" ? 5672 : 5671); +} +function getProtocol(protocolFromUrl) { + const resolvedProtocol = protocolFromUrl || "amqp"; + const noEndingColon = resolvedProtocol.endsWith(":") ? resolvedProtocol.substring(0, resolvedProtocol.length - 1) : resolvedProtocol; + return noEndingColon.toUpperCase(); +} +function getHostname(hostnameFromUrl) { + return hostnameFromUrl || "localhost"; +} +function getHeaderAsString(headers, key) { + const value = headers?.[key]; + if (value == null) { + return void 0; + } + return Array.isArray(value) ? String(value[0]) : String(value); +} +const amqplibChannelIntegration = core.defineIntegration(_amqplibChannelIntegration); + +exports.amqplibChannelIntegration = amqplibChannelIntegration; +//# sourceMappingURL=amqplib.js.map + + +/***/ }), + +/***/ 9977: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Anthropic_AI"; +const ORIGIN = "auto.ai.orchestrion.anthropic"; +const INSTRUMENTED_CHANNELS = [ + { channel: channels.CHANNELS.ANTHROPIC_CHAT, operation: "chat", methodPath: "messages.create", stream: "async-iterable" }, + { channel: channels.CHANNELS.ANTHROPIC_MODELS, operation: "models", methodPath: "models.retrieve", stream: "none" }, + { + channel: channels.CHANNELS.ANTHROPIC_MESSAGES_STREAM, + operation: "chat", + methodPath: "messages.stream", + stream: "message-stream" + } +]; +let subscribed = false; +const _anthropicChannelIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel || subscribed) { + return; + } + subscribed = true; + core.waitForTracingChannelBinding(() => { + for (const { channel, operation, methodPath, stream } of INSTRUMENTED_CHANNELS) { + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:anthropic] subscribing to channel "${channel}"`); + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channel), + (data) => createGenAiSpan(data, operation, methodPath, options), + { + beforeSpanEnd: (span, data) => { + core.addAnthropicResponseAttributes( + span, + data.result, + core.resolveAIRecordingOptions(options).recordOutputs + ); + }, + deferSpanEnd: ({ span, data }) => wrapStreamResult(span, data, stream, options) + } + ); + } + }); + } + }; +}); +function createGenAiSpan(data, operation, methodPath, options) { + const args = data.arguments ?? []; + if (core._INTERNAL_shouldSkipAiProviderWrapping(INTEGRATION_NAME)) { + return void 0; + } + const requestOptions = args[1]; + if (requestOptions?.headers?.["X-Stainless-Helper-Method"] === "stream") { + return void 0; + } + const params = typeof args[0] === "object" && args[0] !== null ? args[0] : void 0; + const { recordInputs } = core.resolveAIRecordingOptions(options); + const enableTruncation = core.shouldEnableTruncation(options.enableTruncation); + const attributes = core.extractAnthropicRequestAttributes(args, methodPath, operation); + const model = attributes[core.GEN_AI_REQUEST_MODEL_ATTRIBUTE] || "unknown"; + attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = ORIGIN; + const span = core.startInactiveSpan({ + name: `${operation} ${model}`, + op: `gen_ai.${operation}`, + attributes + }); + if (recordInputs && params) { + core.addAnthropicRequestAttributes(span, params, enableTruncation); + } + return span; +} +function isAsyncIterable(value) { + return !!value && typeof value[Symbol.asyncIterator] === "function"; +} +function isMessageStream(value) { + return !!value && typeof value.on === "function"; +} +function wrapStreamResult(span, data, stream, options) { + const { recordOutputs } = core.resolveAIRecordingOptions(options); + const result = data.result; + if (stream === "async-iterable" && isAsyncIterable(result)) { + const iterate = result[Symbol.asyncIterator].bind(result); + const instrumented = core.instrumentAsyncIterableStream({ [Symbol.asyncIterator]: iterate }, span, recordOutputs); + result[Symbol.asyncIterator] = () => instrumented; + return true; + } + if (stream === "message-stream" && isMessageStream(result)) { + core.instrumentMessageStream(result, span, recordOutputs); + return true; + } + return false; +} +const anthropicChannelIntegration = core.defineIntegration(_anthropicChannelIntegration); + +exports.anthropicChannelIntegration = anthropicChannelIntegration; +//# sourceMappingURL=anthropic.js.map + + +/***/ }), + +/***/ 42831: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const AWS_SDK_ORIGIN = "auto.aws.orchestrion.aws_sdk"; +const DB_SYSTEM_VALUE_DYNAMODB = "dynamodb"; +const ATTR_MESSAGING_DESTINATION_KIND = "messaging.destination_kind"; +const MESSAGING_DESTINATION_KIND_VALUE_TOPIC = "topic"; +const GEN_AI_OPERATION_NAME_VALUE_CHAT = "chat"; +const GEN_AI_SYSTEM_VALUE_AWS_BEDROCK = "aws.bedrock"; + +exports.ATTR_MESSAGING_DESTINATION_KIND = ATTR_MESSAGING_DESTINATION_KIND; +exports.AWS_SDK_ORIGIN = AWS_SDK_ORIGIN; +exports.DB_SYSTEM_VALUE_DYNAMODB = DB_SYSTEM_VALUE_DYNAMODB; +exports.GEN_AI_OPERATION_NAME_VALUE_CHAT = GEN_AI_OPERATION_NAME_VALUE_CHAT; +exports.GEN_AI_SYSTEM_VALUE_AWS_BEDROCK = GEN_AI_SYSTEM_VALUE_AWS_BEDROCK; +exports.MESSAGING_DESTINATION_KIND_VALUE_TOPIC = MESSAGING_DESTINATION_KIND_VALUE_TOPIC; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 45112: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); +const constants = __nccwpck_require__(42831); +const ServicesExtensions = __nccwpck_require__(83438); +const utils = __nccwpck_require__(3240); + +const INTEGRATION_NAME = "Aws"; +function safe(fn) { + try { + return fn(); + } catch (error) { + debugBuild.DEBUG_BUILD && core.debug.warn("[orchestrion:aws-sdk] error building span", error); + return void 0; + } +} +function setMetadataAttributes(span, metadata) { + if (!metadata) { + return; + } + if (metadata.requestId) { + span.setAttribute(attributes._AWS_REQUEST_ID, metadata.requestId); + } + if (metadata.httpStatusCode) { + span.setAttribute(attributes.HTTP_STATUS_CODE, metadata.httpStatusCode); + } + if (metadata.extendedRequestId) { + span.setAttribute(attributes.AWS_REQUEST_EXTENDED_ID, metadata.extendedRequestId); + } +} +const _awsChannelIntegration = (() => { + const servicesExtensions = new ServicesExtensions.ServicesExtensions(); + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + const getSpan = (data) => safe(() => { + const command = data.arguments[0]; + const commandName = command?.constructor?.name; + if (!command || !commandName) { + return void 0; + } + const clientConfig = data.self?.config; + const serviceName = clientConfig?.serviceId ?? // `clientName` isn't available at the `send` boundary; fall back to the client's + // constructor name (e.g. `S3Client` -> `S3`). `serviceId` is set for all AWS clients. + utils.removeSuffixFromStringIfExists(data.self?.constructor?.name || "AWS", "Client"); + if (!command.input) { + command.input = {}; + } + const normalizedRequest = utils.normalizeV3Request(serviceName, commandName, command.input, void 0); + const requestMetadata = servicesExtensions.requestPreSpanHook(normalizedRequest); + const span = core.startInactiveSpan({ + name: requestMetadata.spanName ?? `${normalizedRequest.serviceName}.${normalizedRequest.commandName}`, + kind: requestMetadata.spanKind ?? core.SPAN_KIND.CLIENT, + // `rpc` matches what the exporter infers from `rpc.service` for the OTel aws-sdk spans; + // service extensions override it where inference yields a different op (DynamoDB: `db`). + op: requestMetadata.spanOp || "rpc", + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.AWS_SDK_ORIGIN, + ...utils.extractAttributesFromNormalizedRequest(normalizedRequest), + ...requestMetadata.spanAttributes + } + }); + data._sentryNormalizedRequest = normalizedRequest; + data._sentryRequestMetadata = requestMetadata; + let regionResult; + try { + regionResult = clientConfig?.region?.(); + } catch { + } + const regionHolder = { + settled: false, + promise: Promise.resolve(regionResult).then((region) => { + if (region) { + normalizedRequest.region = region; + span.setAttribute(attributes.CLOUD_REGION, region); + } + }).catch(() => { + }).finally(() => { + regionHolder.settled = true; + }) + }; + data._sentryRegion = regionHolder; + safe(() => servicesExtensions.requestPostSpanHook(normalizedRequest, span)); + return span; + }); + const opts = { + deferSpanEnd({ span, data, end }) { + const normalizedRequest = data._sentryNormalizedRequest; + const requestMetadata = data._sentryRequestMetadata; + if (!normalizedRequest) { + return false; + } + const failed = "error" in data; + safe(() => { + if (failed) { + const err = data.error; + const errMetadata = err?.$metadata; + setMetadataAttributes(span, { + requestId: err?.RequestId ?? errMetadata?.requestId, + httpStatusCode: errMetadata?.httpStatusCode, + extendedRequestId: err?.extendedRequestId ?? errMetadata?.extendedRequestId + }); + return; + } + const output = data.result; + setMetadataAttributes(span, output?.$metadata); + const normalizedResponse = { + data: output, + request: normalizedRequest, + requestId: output?.$metadata?.requestId + }; + servicesExtensions.responseHook(normalizedResponse, span); + }); + if (requestMetadata?.isStream && !failed) { + return true; + } + const region = data._sentryRegion; + if (region && !region.settled) { + void region.promise.then(() => end()); + return true; + } + return false; + } + }; + const awsSendChannels = [ + channels.CHANNELS.AWS_SMITHY_CORE_SEND, + channels.CHANNELS.AWS_SMITHY_CLIENT_SEND, + channels.CHANNELS.AWS_SDK_SMITHY_CLIENT_SEND + ]; + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:aws-sdk] subscribing to channels "${awsSendChannels.join('", "')}"`); + core.waitForTracingChannelBinding(() => { + for (const channelName of awsSendChannels) { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channelName), + getSpan, + opts + ); + } + }); + } + }; +}); +const awsChannelIntegration = core.defineIntegration(_awsChannelIntegration); + +exports.awsChannelIntegration = awsChannelIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 90483: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); + +const MAX_MESSAGE_ATTRIBUTES = 10; +const SENTRY_TRACE_HEADER = "sentry-trace"; +const BAGGAGE_HEADER = "baggage"; +const PROPAGATION_FIELDS = [SENTRY_TRACE_HEADER, BAGGAGE_HEADER]; +function injectPropagationContext(attributesMap, traceData) { + const attributes = attributesMap ?? {}; + const headerKeys = Object.keys(traceData); + if (Object.keys(attributes).length + headerKeys.length <= MAX_MESSAGE_ATTRIBUTES) { + for (const key of headerKeys) { + const value = traceData[key]; + if (value) { + attributes[key] = { DataType: "String", StringValue: value }; + } + } + } else { + debugBuild.DEBUG_BUILD && core.debug.warn( + "[orchestrion:aws-sdk] cannot set trace propagation on SQS/SNS message due to maximum amount of MessageAttributes" + ); + } + return attributes; +} +function extractPropagationHeaders(message) { + const carrier = message.MessageAttributes ?? {}; + const sentryTrace = carrier[SENTRY_TRACE_HEADER]?.StringValue ?? carrier[SENTRY_TRACE_HEADER]?.Value; + if (!sentryTrace) { + return void 0; + } + return { + sentryTrace, + baggage: carrier[BAGGAGE_HEADER]?.StringValue ?? carrier[BAGGAGE_HEADER]?.Value + }; +} +function addPropagationFieldsToAttributeNames(messageAttributeNames = []) { + return core.uniq([...messageAttributeNames, ...PROPAGATION_FIELDS]); +} + +exports.MAX_MESSAGE_ATTRIBUTES = MAX_MESSAGE_ATTRIBUTES; +exports.addPropagationFieldsToAttributeNames = addPropagationFieldsToAttributeNames; +exports.extractPropagationHeaders = extractPropagationHeaders; +exports.injectPropagationContext = injectPropagationContext; +//# sourceMappingURL=MessageAttributes.js.map + + +/***/ }), + +/***/ 83438: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const bedrockRuntime = __nccwpck_require__(68034); +const dynamodb = __nccwpck_require__(23914); +const kinesis = __nccwpck_require__(77843); +const lambda = __nccwpck_require__(3307); +const s3 = __nccwpck_require__(31309); +const secretsmanager = __nccwpck_require__(83431); +const sns = __nccwpck_require__(8443); +const sqs = __nccwpck_require__(42998); +const stepfunctions = __nccwpck_require__(25065); + +class ServicesExtensions { + constructor() { + // Per-service extensions, keyed by the client's `serviceId` (e.g. `'S3'`). Services without a + // registered extension still get the base rpc span from the subscriber. + this._services = /* @__PURE__ */ new Map([ + ["SecretsManager", new secretsmanager.SecretsManagerServiceExtension()], + ["SFN", new stepfunctions.StepFunctionsServiceExtension()], + ["SQS", new sqs.SqsServiceExtension()], + ["SNS", new sns.SnsServiceExtension()], + ["DynamoDB", new dynamodb.DynamodbServiceExtension()], + ["Lambda", new lambda.LambdaServiceExtension()], + ["S3", new s3.S3ServiceExtension()], + ["Kinesis", new kinesis.KinesisServiceExtension()], + ["BedrockRuntime", new bedrockRuntime.BedrockRuntimeServiceExtension()] + ]); + } + requestPreSpanHook(request) { + const serviceExtension = this._services.get(request.serviceName); + if (!serviceExtension) { + return {}; + } + return serviceExtension.requestPreSpanHook(request); + } + requestPostSpanHook(request, span) { + const serviceExtension = this._services.get(request.serviceName); + serviceExtension?.requestPostSpanHook?.(request, span); + } + responseHook(response, span) { + const serviceExtension = this._services.get(response.request.serviceName); + serviceExtension?.responseHook?.(response, span); + } +} + +exports.ServicesExtensions = ServicesExtensions; +//# sourceMappingURL=ServicesExtensions.js.map + + +/***/ }), + +/***/ 68034: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const debugBuild = __nccwpck_require__(64112); +const constants = __nccwpck_require__(42831); + +const textDecoder = new TextDecoder(); +class BedrockRuntimeServiceExtension { + requestPreSpanHook(request) { + switch (request.commandName) { + case "Converse": + return this._requestPreSpanHookConverse(request, false); + case "ConverseStream": + return this._requestPreSpanHookConverse(request, true); + case "InvokeModel": + return this._requestPreSpanHookInvokeModel(request, false); + case "InvokeModelWithResponseStream": + return this._requestPreSpanHookInvokeModel(request, true); + } + return {}; + } + responseHook(response, span) { + const commandName = response.request.commandName; + if (!span.isRecording()) { + if (commandName === "ConverseStream" || commandName === "InvokeModelWithResponseStream") { + span.end(); + } + return; + } + switch (commandName) { + case "Converse": + return this._responseHookConverse(response, span); + case "ConverseStream": + return this._responseHookConverseStream(response, span); + case "InvokeModel": + return this._responseHookInvokeModel(response, span); + case "InvokeModelWithResponseStream": + return this._responseHookInvokeModelWithResponseStream(response, span); + } + } + _requestPreSpanHookConverse(request, isStream) { + let spanName = constants.GEN_AI_OPERATION_NAME_VALUE_CHAT; + const spanAttributes = { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.GEN_AI_SYSTEM]: constants.GEN_AI_SYSTEM_VALUE_AWS_BEDROCK, + [attributes.GEN_AI_OPERATION_NAME]: constants.GEN_AI_OPERATION_NAME_VALUE_CHAT + }; + const modelId = request.commandInput.modelId; + if (modelId) { + spanAttributes[attributes.GEN_AI_REQUEST_MODEL] = modelId; + if (spanName) { + spanName += ` ${modelId}`; + } + } + const inferenceConfig = request.commandInput.inferenceConfig; + if (inferenceConfig) { + const { maxTokens, temperature, topP, stopSequences } = inferenceConfig; + if (maxTokens !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_MAX_TOKENS] = maxTokens; + } + if (temperature !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TEMPERATURE] = temperature; + } + if (topP !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TOP_P] = topP; + } + if (stopSequences !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_STOP_SEQUENCES] = stopSequences; + } + } + return { + spanName, + isStream, + spanAttributes + }; + } + _requestPreSpanHookInvokeModel(request, isStream) { + const spanAttributes = { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.GEN_AI_SYSTEM]: constants.GEN_AI_SYSTEM_VALUE_AWS_BEDROCK + }; + const modelId = request.commandInput?.modelId; + if (modelId) { + spanAttributes[attributes.GEN_AI_REQUEST_MODEL] = modelId; + } + if (request.commandInput?.body) { + const requestBody = JSON.parse(request.commandInput.body); + if (modelId.includes("amazon.titan")) { + if (requestBody.textGenerationConfig?.temperature !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TEMPERATURE] = requestBody.textGenerationConfig.temperature; + } + if (requestBody.textGenerationConfig?.topP !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TOP_P] = requestBody.textGenerationConfig.topP; + } + if (requestBody.textGenerationConfig?.maxTokenCount !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_MAX_TOKENS] = requestBody.textGenerationConfig.maxTokenCount; + } + if (requestBody.textGenerationConfig?.stopSequences !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_STOP_SEQUENCES] = requestBody.textGenerationConfig.stopSequences; + } + } else if (modelId.includes("amazon.nova")) { + if (requestBody.inferenceConfig?.temperature !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TEMPERATURE] = requestBody.inferenceConfig.temperature; + } + if (requestBody.inferenceConfig?.top_p !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TOP_P] = requestBody.inferenceConfig.top_p; + } + if (requestBody.inferenceConfig?.max_new_tokens !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_MAX_TOKENS] = requestBody.inferenceConfig.max_new_tokens; + } + if (requestBody.inferenceConfig?.stopSequences !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_STOP_SEQUENCES] = requestBody.inferenceConfig.stopSequences; + } + } else if (modelId.includes("anthropic.claude")) { + if (requestBody.max_tokens !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_MAX_TOKENS] = requestBody.max_tokens; + } + if (requestBody.temperature !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TEMPERATURE] = requestBody.temperature; + } + if (requestBody.top_p !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TOP_P] = requestBody.top_p; + } + if (requestBody.stop_sequences !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_STOP_SEQUENCES] = requestBody.stop_sequences; + } + } else if (modelId.includes("meta.llama")) { + if (requestBody.max_gen_len !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_MAX_TOKENS] = requestBody.max_gen_len; + } + if (requestBody.temperature !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TEMPERATURE] = requestBody.temperature; + } + if (requestBody.top_p !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TOP_P] = requestBody.top_p; + } + } else if (modelId.includes("cohere.command-r")) { + if (requestBody.max_tokens !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_MAX_TOKENS] = requestBody.max_tokens; + } + if (requestBody.temperature !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TEMPERATURE] = requestBody.temperature; + } + if (requestBody.p !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TOP_P] = requestBody.p; + } + if (requestBody.message !== void 0) { + spanAttributes[attributes.GEN_AI_USAGE_INPUT_TOKENS] = Math.ceil(requestBody.message.length / 6); + } + if (requestBody.stop_sequences !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_STOP_SEQUENCES] = requestBody.stop_sequences; + } + } else if (modelId.includes("cohere.command")) { + if (requestBody.max_tokens !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_MAX_TOKENS] = requestBody.max_tokens; + } + if (requestBody.temperature !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TEMPERATURE] = requestBody.temperature; + } + if (requestBody.p !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TOP_P] = requestBody.p; + } + if (requestBody.prompt !== void 0) { + spanAttributes[attributes.GEN_AI_USAGE_INPUT_TOKENS] = Math.ceil(requestBody.prompt.length / 6); + } + if (requestBody.stop_sequences !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_STOP_SEQUENCES] = requestBody.stop_sequences; + } + } else if (modelId.includes("mistral")) { + if (requestBody.prompt !== void 0) { + spanAttributes[attributes.GEN_AI_USAGE_INPUT_TOKENS] = Math.ceil(requestBody.prompt.length / 6); + } + if (requestBody.max_tokens !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_MAX_TOKENS] = requestBody.max_tokens; + } + if (requestBody.temperature !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TEMPERATURE] = requestBody.temperature; + } + if (requestBody.top_p !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_TOP_P] = requestBody.top_p; + } + if (requestBody.stop !== void 0) { + spanAttributes[attributes.GEN_AI_REQUEST_STOP_SEQUENCES] = requestBody.stop; + } + } + } + return { + isStream, + spanAttributes + }; + } + _responseHookConverse(response, span) { + const { stopReason, usage } = response.data; + setStopReason(span, stopReason); + setUsage(span, usage); + } + _responseHookConverseStream(response, span) { + response.data.stream = wrapConverseStreamResponse(response.data.stream, span); + } + _responseHookInvokeModel(response, span) { + const currentModelId = response.request.commandInput?.modelId; + if (response.data?.body) { + const decodedResponseBody = textDecoder.decode(response.data.body); + const responseBody = JSON.parse(decodedResponseBody); + if (currentModelId.includes("amazon.titan")) { + if (responseBody.inputTextTokenCount !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, responseBody.inputTextTokenCount); + } + if (responseBody.results?.[0]?.tokenCount !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, responseBody.results[0].tokenCount); + } + if (responseBody.results?.[0]?.completionReason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [responseBody.results[0].completionReason]); + } + } else if (currentModelId.includes("amazon.nova")) { + if (responseBody.usage !== void 0) { + if (responseBody.usage.inputTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, responseBody.usage.inputTokens); + } + if (responseBody.usage.outputTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, responseBody.usage.outputTokens); + } + } + if (responseBody.stopReason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [responseBody.stopReason]); + } + } else if (currentModelId.includes("anthropic.claude")) { + if (responseBody.usage?.input_tokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, responseBody.usage.input_tokens); + } + if (responseBody.usage?.output_tokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, responseBody.usage.output_tokens); + } + if (responseBody.stop_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [responseBody.stop_reason]); + } + } else if (currentModelId.includes("meta.llama")) { + if (responseBody.prompt_token_count !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, responseBody.prompt_token_count); + } + if (responseBody.generation_token_count !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, responseBody.generation_token_count); + } + if (responseBody.stop_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [responseBody.stop_reason]); + } + } else if (currentModelId.includes("cohere.command-r")) { + if (responseBody.text !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, Math.ceil(responseBody.text.length / 6)); + } + if (responseBody.finish_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [responseBody.finish_reason]); + } + } else if (currentModelId.includes("cohere.command")) { + if (responseBody.generations?.[0]?.text !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, Math.ceil(responseBody.generations[0].text.length / 6)); + } + if (responseBody.generations?.[0]?.finish_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [responseBody.generations[0].finish_reason]); + } + } else if (currentModelId.includes("mistral")) { + if (responseBody.outputs?.[0]?.text !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, Math.ceil(responseBody.outputs[0].text.length / 6)); + } + if (responseBody.outputs?.[0]?.stop_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [responseBody.outputs[0].stop_reason]); + } + } + } + } + _responseHookInvokeModelWithResponseStream(response, span) { + const stream = response.data?.body; + const modelId = response.request.commandInput?.modelId; + if (!stream || !modelId) { + return; + } + const recordAttributes = resolveStreamRecorder(modelId); + response.data.body = (async function* () { + try { + for await (const chunk of stream) { + if (recordAttributes) { + const parsedChunk = parseChunk(chunk?.chunk?.bytes); + if (parsedChunk) { + recordAttributes(parsedChunk, span); + } + } + yield chunk; + } + } finally { + span.end(); + } + })(); + } +} +function resolveStreamRecorder(modelId) { + if (modelId.includes("amazon.titan")) return recordTitanAttributes; + if (modelId.includes("anthropic.claude")) return recordClaudeAttributes; + if (modelId.includes("amazon.nova")) return recordNovaAttributes; + if (modelId.includes("meta.llama")) return recordLlamaAttributes; + if (modelId.includes("cohere.command-r")) return recordCohereRAttributes; + if (modelId.includes("cohere.command")) return recordCohereAttributes; + if (modelId.includes("mistral")) return recordMistralAttributes; + return void 0; +} +async function* wrapConverseStreamResponse(stream, span) { + try { + let usage; + for await (const item of stream) { + setStopReason(span, item.messageStop?.stopReason); + usage = item.metadata?.usage; + yield item; + } + setUsage(span, usage); + } finally { + span.end(); + } +} +function setStopReason(span, stopReason) { + if (stopReason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [stopReason]); + } +} +function setUsage(span, usage) { + if (usage) { + const { inputTokens, outputTokens } = usage; + if (inputTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, inputTokens); + } + if (outputTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, outputTokens); + } + } +} +function parseChunk(bytes) { + if (!bytes || !(bytes instanceof Uint8Array)) { + return null; + } + try { + const str = Buffer.from(bytes).toString("utf-8"); + return JSON.parse(str); + } catch (err) { + debugBuild.DEBUG_BUILD && core.debug.warn("[orchestrion:aws-sdk] failed to parse streamed bedrock chunk", err); + return null; + } +} +function recordNovaAttributes(parsedChunk, span) { + if (parsedChunk.metadata?.usage !== void 0) { + if (parsedChunk.metadata?.usage.inputTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, parsedChunk.metadata.usage.inputTokens); + } + if (parsedChunk.metadata?.usage.outputTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, parsedChunk.metadata.usage.outputTokens); + } + } + if (parsedChunk.messageStop?.stopReason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [parsedChunk.messageStop.stopReason]); + } +} +function recordClaudeAttributes(parsedChunk, span) { + if (parsedChunk.message?.usage?.input_tokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, parsedChunk.message.usage.input_tokens); + } + if (parsedChunk.message?.usage?.output_tokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, parsedChunk.message.usage.output_tokens); + } + if (parsedChunk.delta?.stop_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [parsedChunk.delta.stop_reason]); + } +} +function recordTitanAttributes(parsedChunk, span) { + if (parsedChunk.inputTextTokenCount !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, parsedChunk.inputTextTokenCount); + } + if (parsedChunk.totalOutputTextTokenCount !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, parsedChunk.totalOutputTextTokenCount); + } + if (parsedChunk.completionReason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [parsedChunk.completionReason]); + } +} +function recordLlamaAttributes(parsedChunk, span) { + if (parsedChunk.prompt_token_count !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, parsedChunk.prompt_token_count); + } + if (parsedChunk.generation_token_count !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, parsedChunk.generation_token_count); + } + if (parsedChunk.stop_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [parsedChunk.stop_reason]); + } +} +function recordMistralAttributes(parsedChunk, span) { + if (parsedChunk.outputs?.[0]?.text !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, Math.ceil(parsedChunk.outputs[0].text.length / 6)); + } + if (parsedChunk.outputs?.[0]?.stop_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [parsedChunk.outputs[0].stop_reason]); + } +} +function recordCohereAttributes(parsedChunk, span) { + if (parsedChunk.generations?.[0]?.text !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, Math.ceil(parsedChunk.generations[0].text.length / 6)); + } + if (parsedChunk.generations?.[0]?.finish_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [parsedChunk.generations[0].finish_reason]); + } +} +function recordCohereRAttributes(parsedChunk, span) { + if (parsedChunk.text !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, Math.ceil(parsedChunk.text.length / 6)); + } + if (parsedChunk.finish_reason !== void 0) { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, [parsedChunk.finish_reason]); + } +} + +exports.BedrockRuntimeServiceExtension = BedrockRuntimeServiceExtension; +//# sourceMappingURL=bedrock-runtime.js.map + + +/***/ }), + +/***/ 23914: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const constants = __nccwpck_require__(42831); + +function toArray(values) { + return Array.isArray(values) ? values : [values]; +} +class DynamodbServiceExtension { + requestPreSpanHook(normalizedRequest) { + const operation = normalizedRequest.commandName; + const tableName = normalizedRequest.commandInput?.TableName; + const spanAttributes = {}; + spanAttributes[attributes.DB_SYSTEM] = constants.DB_SYSTEM_VALUE_DYNAMODB; + spanAttributes[attributes.DB_NAME] = tableName; + spanAttributes[attributes.DB_OPERATION] = operation; + if (normalizedRequest.commandInput?.TableName) { + spanAttributes[attributes.AWS_DYNAMODB_TABLE_NAMES] = [normalizedRequest.commandInput.TableName]; + } else if (normalizedRequest.commandInput?.RequestItems) { + spanAttributes[attributes.AWS_DYNAMODB_TABLE_NAMES] = Object.keys(normalizedRequest.commandInput.RequestItems); + } + if (operation === "CreateTable" || operation === "UpdateTable") { + if (normalizedRequest.commandInput?.ProvisionedThroughput) { + spanAttributes[attributes.AWS_DYNAMODB_PROVISIONED_READ_CAPACITY] = normalizedRequest.commandInput.ProvisionedThroughput.ReadCapacityUnits; + spanAttributes[attributes.AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY] = normalizedRequest.commandInput.ProvisionedThroughput.WriteCapacityUnits; + } + } + if (operation === "GetItem" || operation === "Scan" || operation === "Query") { + if (normalizedRequest.commandInput?.ConsistentRead) { + spanAttributes[attributes.AWS_DYNAMODB_CONSISTENT_READ] = normalizedRequest.commandInput.ConsistentRead; + } + } + if (operation === "Query" || operation === "Scan") { + if (normalizedRequest.commandInput?.ProjectionExpression) { + spanAttributes[attributes.AWS_DYNAMODB_PROJECTION] = normalizedRequest.commandInput.ProjectionExpression; + } + } + if (operation === "CreateTable") { + if (normalizedRequest.commandInput?.GlobalSecondaryIndexes) { + spanAttributes[attributes.AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES] = toArray( + normalizedRequest.commandInput.GlobalSecondaryIndexes + ).map((x) => JSON.stringify(x)); + } + if (normalizedRequest.commandInput?.LocalSecondaryIndexes) { + spanAttributes[attributes.AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES] = toArray( + normalizedRequest.commandInput.LocalSecondaryIndexes + ).map((x) => JSON.stringify(x)); + } + } + if (operation === "ListTables" || operation === "Query" || operation === "Scan") { + if (normalizedRequest.commandInput?.Limit) { + spanAttributes[attributes.AWS_DYNAMODB_LIMIT] = normalizedRequest.commandInput.Limit; + } + } + if (operation === "ListTables") { + if (normalizedRequest.commandInput?.ExclusiveStartTableName) { + spanAttributes[attributes.AWS_DYNAMODB_EXCLUSIVE_START_TABLE] = normalizedRequest.commandInput.ExclusiveStartTableName; + } + } + if (operation === "Query") { + if (normalizedRequest.commandInput?.ScanIndexForward) { + spanAttributes[attributes.AWS_DYNAMODB_SCAN_FORWARD] = normalizedRequest.commandInput.ScanIndexForward; + } + if (normalizedRequest.commandInput?.IndexName) { + spanAttributes[attributes.AWS_DYNAMODB_INDEX_NAME] = normalizedRequest.commandInput.IndexName; + } + if (normalizedRequest.commandInput?.Select) { + spanAttributes[attributes.AWS_DYNAMODB_SELECT] = normalizedRequest.commandInput.Select; + } + } + if (operation === "Scan") { + if (normalizedRequest.commandInput?.Segment) { + spanAttributes[attributes.AWS_DYNAMODB_SEGMENT] = normalizedRequest.commandInput?.Segment; + } + if (normalizedRequest.commandInput?.TotalSegments) { + spanAttributes[attributes.AWS_DYNAMODB_TOTAL_SEGMENTS] = normalizedRequest.commandInput?.TotalSegments; + } + if (normalizedRequest.commandInput?.IndexName) { + spanAttributes[attributes.AWS_DYNAMODB_INDEX_NAME] = normalizedRequest.commandInput.IndexName; + } + if (normalizedRequest.commandInput?.Select) { + spanAttributes[attributes.AWS_DYNAMODB_SELECT] = normalizedRequest.commandInput.Select; + } + } + if (operation === "UpdateTable") { + if (normalizedRequest.commandInput?.AttributeDefinitions) { + spanAttributes[attributes.AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS] = toArray( + normalizedRequest.commandInput.AttributeDefinitions + ).map((x) => JSON.stringify(x)); + } + if (normalizedRequest.commandInput?.GlobalSecondaryIndexUpdates) { + spanAttributes[attributes.AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES] = toArray( + normalizedRequest.commandInput.GlobalSecondaryIndexUpdates + ).map((x) => JSON.stringify(x)); + } + } + return { + spanAttributes, + spanKind: core.SPAN_KIND.CLIENT, + // Matches what the exporter infers from `db.system` for the OTel DynamoDB spans. + spanOp: "db" + }; + } + responseHook(response, span) { + if (response.data?.ConsumedCapacity) { + span.setAttribute( + attributes.AWS_DYNAMODB_CONSUMED_CAPACITY, + toArray(response.data.ConsumedCapacity).map((x) => JSON.stringify(x)) + ); + } + if (response.data?.ItemCollectionMetrics) { + span.setAttribute( + attributes.AWS_DYNAMODB_ITEM_COLLECTION_METRICS, + toArray(response.data.ItemCollectionMetrics).map((x) => JSON.stringify(x)) + ); + } + if (response.data?.TableNames) { + span.setAttribute(attributes.AWS_DYNAMODB_TABLE_COUNT, response.data?.TableNames.length); + } + if (response.data?.Count) { + span.setAttribute(attributes.AWS_DYNAMODB_COUNT, response.data?.Count); + } + if (response.data?.ScannedCount) { + span.setAttribute(attributes.AWS_DYNAMODB_SCANNED_COUNT, response.data?.ScannedCount); + } + } +} + +exports.DynamodbServiceExtension = DynamodbServiceExtension; +//# sourceMappingURL=dynamodb.js.map + + +/***/ }), + +/***/ 77843: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); + +class KinesisServiceExtension { + requestPreSpanHook(request) { + const streamName = request.commandInput?.StreamName; + const spanAttributes = {}; + if (streamName) { + spanAttributes[attributes._AWS_KINESIS_STREAM_NAME] = streamName; + } + return { + spanAttributes, + spanKind: core.SPAN_KIND.CLIENT + }; + } +} + +exports.KinesisServiceExtension = KinesisServiceExtension; +//# sourceMappingURL=kinesis.js.map + + +/***/ }), + +/***/ 3307: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const debugBuild = __nccwpck_require__(64112); + +const INVOKE_COMMAND = "Invoke"; +class LambdaServiceExtension { + requestPreSpanHook(request) { + const functionName = request.commandInput?.FunctionName; + const spanAttributes = {}; + let spanName; + if (request.commandName === INVOKE_COMMAND) { + spanAttributes[attributes.FAAS_INVOKED_NAME] = functionName; + spanAttributes[attributes.FAAS_INVOKED_PROVIDER] = "aws"; + spanName = `${functionName} ${INVOKE_COMMAND}`; + } + return { + spanAttributes, + spanKind: core.SPAN_KIND.CLIENT, + spanName + }; + } + requestPostSpanHook(request, span) { + if (request.commandName === INVOKE_COMMAND && request.commandInput) { + request.commandInput.ClientContext = injectLambdaPropagationContext(request.commandInput.ClientContext, span); + } + } + responseHook(response, span) { + if (response.request.commandName === INVOKE_COMMAND) { + span.setAttribute(attributes.FAAS_EXECUTION, response.requestId); + if (response.request.region) { + span.setAttribute(attributes.FAAS_INVOKED_REGION, response.request.region); + } + } + } +} +function injectLambdaPropagationContext(clientContext, span) { + try { + const propagatedContext = core.getTraceData({ span }); + const parsedClientContext = clientContext ? JSON.parse(Buffer.from(clientContext, "base64").toString("utf8")) : {}; + const updatedClientContext = { + ...parsedClientContext, + custom: { + ...parsedClientContext.custom, + ...propagatedContext + } + }; + const encodedClientContext = Buffer.from(JSON.stringify(updatedClientContext)).toString("base64"); + if (encodedClientContext.length > 3583) { + debugBuild.DEBUG_BUILD && core.debug.warn( + "[orchestrion:aws-sdk] cannot set trace propagation on lambda invoke parameters due to ClientContext length limitations." + ); + return clientContext; + } + return encodedClientContext; + } catch (e) { + debugBuild.DEBUG_BUILD && core.debug.log("[orchestrion:aws-sdk] failed to set trace propagation on lambda ClientContext", e); + return clientContext; + } +} + +exports.LambdaServiceExtension = LambdaServiceExtension; +//# sourceMappingURL=lambda.js.map + + +/***/ }), + +/***/ 31309: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); + +class S3ServiceExtension { + requestPreSpanHook(request) { + const bucketName = request.commandInput?.Bucket; + const spanAttributes = {}; + if (bucketName) { + spanAttributes[attributes.AWS_S3_BUCKET] = bucketName; + } + return { + spanAttributes, + spanKind: core.SPAN_KIND.CLIENT + }; + } +} + +exports.S3ServiceExtension = S3ServiceExtension; +//# sourceMappingURL=s3.js.map + + +/***/ }), + +/***/ 83431: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); + +class SecretsManagerServiceExtension { + requestPreSpanHook(request) { + const secretId = request.commandInput?.SecretId; + const spanAttributes = {}; + if (typeof secretId === "string" && secretId.startsWith("arn:aws:secretsmanager:")) { + spanAttributes[attributes.AWS_SECRETSMANAGER_SECRET_ARN] = secretId; + } + return { + spanAttributes, + spanKind: core.SPAN_KIND.CLIENT + }; + } + responseHook(response, span) { + const secretArn = response.data?.ARN; + if (secretArn) { + span.setAttribute(attributes.AWS_SECRETSMANAGER_SECRET_ARN, secretArn); + } + } +} + +exports.SecretsManagerServiceExtension = SecretsManagerServiceExtension; +//# sourceMappingURL=secretsmanager.js.map + + +/***/ }), + +/***/ 8443: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const constants = __nccwpck_require__(42831); +const MessageAttributes = __nccwpck_require__(90483); + +class SnsServiceExtension { + requestPreSpanHook(request) { + let spanKind = core.SPAN_KIND.CLIENT; + let spanName = `SNS ${request.commandName}`; + const spanAttributes = { + [attributes.MESSAGING_SYSTEM]: "aws.sns" + }; + if (request.commandName === "Publish") { + spanKind = core.SPAN_KIND.PRODUCER; + spanAttributes[constants.ATTR_MESSAGING_DESTINATION_KIND] = constants.MESSAGING_DESTINATION_KIND_VALUE_TOPIC; + const { TopicArn, TargetArn, PhoneNumber } = request.commandInput; + const destinationName = extractDestinationName(TopicArn, TargetArn, PhoneNumber); + spanAttributes[attributes.MESSAGING_DESTINATION] = destinationName; + spanAttributes[attributes.MESSAGING_DESTINATION_NAME] = TopicArn || TargetArn || PhoneNumber || "unknown"; + spanName = `${PhoneNumber ? "phone_number" : destinationName} send`; + } + const topicArn = request.commandInput?.TopicArn; + if (topicArn) { + spanAttributes[attributes.AWS_SNS_TOPIC_ARN] = topicArn; + } + return { + spanAttributes, + spanKind, + spanName + }; + } + requestPostSpanHook(request, span) { + if (request.commandName === "Publish") { + const origMessageAttributes = request.commandInput.MessageAttributes ?? {}; + request.commandInput.MessageAttributes = MessageAttributes.injectPropagationContext(origMessageAttributes, core.getTraceData({ span })); + } + } + responseHook(response, span) { + const topicArn = response.data?.TopicArn; + if (topicArn) { + span.setAttribute(attributes.AWS_SNS_TOPIC_ARN, topicArn); + } + } +} +function extractDestinationName(topicArn, targetArn, phoneNumber) { + if (topicArn || targetArn) { + const arn = topicArn ?? targetArn; + try { + return arn.substring(arn.lastIndexOf(":") + 1); + } catch { + return arn; + } + } else if (phoneNumber) { + return phoneNumber; + } else { + return "unknown"; + } +} + +exports.SnsServiceExtension = SnsServiceExtension; +//# sourceMappingURL=sns.js.map + + +/***/ }), + +/***/ 42998: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const MessageAttributes = __nccwpck_require__(90483); + +class SqsServiceExtension { + requestPreSpanHook(request) { + const queueUrl = extractQueueUrl(request.commandInput); + const queueName = extractQueueNameFromUrl(queueUrl); + let spanKind = core.SPAN_KIND.CLIENT; + let spanName; + const spanAttributes = { + [attributes.MESSAGING_SYSTEM]: "aws_sqs", + [attributes.MESSAGING_DESTINATION_NAME]: queueName, + [attributes.URL_FULL]: queueUrl + }; + switch (request.commandName) { + case "ReceiveMessage": + { + spanKind = core.SPAN_KIND.CONSUMER; + spanName = `${queueName} receive`; + spanAttributes[attributes.MESSAGING_OPERATION_TYPE] = "receive"; + request.commandInput.MessageAttributeNames = MessageAttributes.addPropagationFieldsToAttributeNames( + request.commandInput.MessageAttributeNames + ); + } + break; + case "SendMessage": + case "SendMessageBatch": + spanKind = core.SPAN_KIND.PRODUCER; + spanName = `${queueName} send`; + break; + } + return { + spanAttributes, + spanKind, + spanName + }; + } + requestPostSpanHook(request, span) { + switch (request.commandName) { + case "SendMessage": + { + const origMessageAttributes = request.commandInput.MessageAttributes ?? {}; + request.commandInput.MessageAttributes = MessageAttributes.injectPropagationContext( + origMessageAttributes, + core.getTraceData({ span }) + ); + } + break; + case "SendMessageBatch": + { + const entries = request.commandInput?.Entries; + if (Array.isArray(entries)) { + const traceData = core.getTraceData({ span }); + entries.forEach((messageParams) => { + messageParams.MessageAttributes = MessageAttributes.injectPropagationContext( + messageParams.MessageAttributes ?? {}, + traceData + ); + }); + } + } + break; + } + } + responseHook(response, span) { + switch (response.request.commandName) { + case "SendMessage": + span.setAttribute(attributes.MESSAGING_MESSAGE_ID, response?.data?.MessageId); + break; + case "SendMessageBatch": + break; + case "ReceiveMessage": { + const messages = response?.data?.Messages || []; + span.setAttribute(attributes.MESSAGING_BATCH_MESSAGE_COUNT, messages.length); + for (const message of messages) { + linkReceivedMessageToProducer(span, message); + } + break; + } + } + } +} +function linkReceivedMessageToProducer(span, message) { + const headers = MessageAttributes.extractPropagationHeaders(message); + if (!headers) { + return; + } + const { parentSpanId, traceId, sampled } = core.propagationContextFromHeaders(headers.sentryTrace, headers.baggage); + if (traceId && parentSpanId) { + span.addLink({ + context: { + traceId, + spanId: parentSpanId, + traceFlags: sampled ? 1 : 0 + }, + attributes: { + [attributes.MESSAGING_MESSAGE_ID]: message.MessageId + } + }); + } +} +function extractQueueUrl(commandInput) { + return commandInput?.QueueUrl; +} +function extractQueueNameFromUrl(queueUrl) { + if (!queueUrl) return void 0; + const segments = queueUrl.split("/"); + if (segments.length === 0) return void 0; + return segments[segments.length - 1]; +} + +exports.SqsServiceExtension = SqsServiceExtension; +//# sourceMappingURL=sqs.js.map + + +/***/ }), + +/***/ 25065: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); + +class StepFunctionsServiceExtension { + requestPreSpanHook(request) { + const stateMachineArn = request.commandInput?.stateMachineArn; + const activityArn = request.commandInput?.activityArn; + const spanAttributes = {}; + if (stateMachineArn) { + spanAttributes[attributes.AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN] = stateMachineArn; + } + if (activityArn) { + spanAttributes[attributes.AWS_STEP_FUNCTIONS_ACTIVITY_ARN] = activityArn; + } + return { + spanAttributes, + spanKind: core.SPAN_KIND.CLIENT + }; + } +} + +exports.StepFunctionsServiceExtension = StepFunctionsServiceExtension; +//# sourceMappingURL=stepfunctions.js.map + + +/***/ }), + +/***/ 3240: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); + +function removeSuffixFromStringIfExists(str, suffixToRemove) { + const suffixLength = suffixToRemove.length; + return str?.slice(-suffixLength) === suffixToRemove ? str.slice(0, -suffixLength) : str; +} +function normalizeV3Request(serviceName, commandNameWithSuffix, commandInput, region) { + return { + serviceName: serviceName?.replace(/\s+/g, ""), + commandName: removeSuffixFromStringIfExists(commandNameWithSuffix, "Command"), + commandInput, + region + }; +} +function extractAttributesFromNormalizedRequest(normalizedRequest) { + return { + // oxlint-disable-next-line typescript/no-deprecated -- old-semconv rpc.system, matched to the OTel aws-sdk integration + [attributes.RPC_SYSTEM]: "aws-api", + [attributes.RPC_METHOD]: normalizedRequest.commandName, + [attributes.RPC_SERVICE]: normalizedRequest.serviceName, + [attributes.CLOUD_REGION]: normalizedRequest.region + }; +} + +exports.extractAttributesFromNormalizedRequest = extractAttributesFromNormalizedRequest; +exports.normalizeV3Request = normalizeV3Request; +exports.removeSuffixFromStringIfExists = removeSuffixFromStringIfExists; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 57893: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Dataloader"; +const MODULE_NAME = "dataloader"; +const ORIGIN = "auto.db.orchestrion.dataloader"; +const CACHE_GET_OP = "cache.get"; +const WRAPPED = /* @__PURE__ */ Symbol("sentry.dataloader.wrapped"); +function getSpanName(loader, operation) { + const name = loader?.name; + return name ? `${MODULE_NAME}.${operation} ${name}` : `${MODULE_NAME}.${operation}`; +} +function getCacheKey(keyArg) { + if (Array.isArray(keyArg)) { + return keyArg.map((key) => String(key)); + } + return keyArg == null ? void 0 : [String(keyArg)]; +} +function makeSpanOptions(loader, operation, keyArg) { + const isCacheGet = operation === "load" || operation === "loadMany" || operation === "batch"; + return { + name: getSpanName(loader, operation), + // Every direct operation (`load`/`loadMany`/`prime`/`clear`/`clearAll`) is a client call, matching + // the vendored OTel instrumentation. The `batch` runs off a deferred tick with no obvious network + // peer, so it gets no kind. + kind: operation === "batch" ? void 0 : core.SPAN_KIND.CLIENT, + op: isCacheGet ? CACHE_GET_OP : void 0, + onlyIfParent: true, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [attributes.CACHE_KEY]: isCacheGet ? getCacheKey(keyArg) : void 0 + } + }; +} +const _dataloaderChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log("[orchestrion:dataloader] subscribing to dataloader tracing channels"); + core.waitForTracingChannelBinding(() => { + subscribeConstruct(); + subscribeLoad(); + subscribeSimpleOperation(channels.CHANNELS.DATALOADER_LOAD_MANY, "loadMany"); + subscribeSimpleOperation(channels.CHANNELS.DATALOADER_PRIME, "prime"); + subscribeSimpleOperation(channels.CHANNELS.DATALOADER_CLEAR, "clear"); + subscribeSimpleOperation(channels.CHANNELS.DATALOADER_CLEAR_ALL, "clearAll"); + }); + } + }; +}); +function subscribeConstruct() { + diagnosticsChannel.tracingChannel(channels.CHANNELS.DATALOADER_CONSTRUCT).start.subscribe((message) => { + const data = message; + const batchLoadFn = data.arguments[0]; + if (typeof batchLoadFn !== "function" || batchLoadFn[WRAPPED]) { + return; + } + const original = batchLoadFn; + const wrapped = function(...args) { + return core.startSpan( + { ...makeSpanOptions(this, "batch", args[0]), links: this._batch?.spanLinks }, + () => original.apply(this, args) + ); + }; + wrapped[WRAPPED] = true; + data.arguments[0] = wrapped; + }); +} +function subscribeLoad() { + const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.DATALOADER_LOAD); + tracingChannel.bindTracingChannelToSpan(channel, (data) => startInactiveSpanFor(data.self, "load", data.arguments[0]), { + requiresParentSpan: true + }); + channel.end.subscribe((message) => { + const data = message; + const span = data._sentrySpan; + const batch = data.self?._batch; + if (span && batch && span.isRecording()) { + (batch.spanLinks ?? (batch.spanLinks = [])).push({ context: span.spanContext() }); + } + }); +} +function subscribeSimpleOperation(channelName, operation) { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channelName), + (data) => startInactiveSpanFor(data.self, operation, data.arguments[0]), + { requiresParentSpan: true } + ); +} +function startInactiveSpanFor(loader, operation, keyArg) { + return core.startInactiveSpan(makeSpanOptions(loader, operation, keyArg)); +} +const dataloaderChannelIntegration = core.defineIntegration(_dataloaderChannelIntegration); + +exports.dataloaderChannelIntegration = dataloaderChannelIntegration; +//# sourceMappingURL=dataloader.js.map + + +/***/ }), + +/***/ 7436: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const instrumentation = __nccwpck_require__(47720); + +const INTEGRATION_NAME = "Express"; +const _expressChannelIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + instrumentation.instrumentExpress(options, diagnosticsChannel.tracingChannel); + }); + } + }; +}); +const expressChannelIntegration = core.defineIntegration(_expressChannelIntegration); + +exports.expressChannelIntegration = expressChannelIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 47720: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); +const route = __nccwpck_require__(83161); + +const ORIGIN = "auto.http.express"; +const ATTR_EXPRESS_NAME = "express.name"; +const ATTR_EXPRESS_TYPE = "express.type"; +const NOOP = () => { +}; +let _isInstrumented = false; +function instrumentExpress(options, tracingChannel$1) { + if (_isInstrumented) { + return; + } + _isInstrumented = true; + for (const channelName of [channels.CHANNELS.EXPRESS_REGISTER, channels.CHANNELS.ROUTER_REGISTER]) { + tracingChannel$1(channelName).subscribe({ + start: NOOP, + asyncStart: NOOP, + asyncEnd: NOOP, + error: NOOP, + end: captureRegisteredLayerPath + }); + } + for (const channelName of [channels.CHANNELS.EXPRESS_HANDLE, channels.CHANNELS.ROUTER_HANDLE]) { + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:express] subscribing to channel "${channelName}"`); + const channel = tracingChannel$1(channelName); + tracingChannel.bindTracingChannelToSpan(channel, (data) => getSpanForLayer(data, options), { + beforeSpanEnd(_span, data) { + data._sentryCleanup?.(); + } + }); + channel.subscribe({ + start: NOOP, + asyncEnd: NOOP, + end: NOOP, + error: NOOP, + asyncStart: popLayerPathForLayer + }); + } +} +function captureRegisteredLayerPath(data) { + const stack = data.self?.stack; + if (!Array.isArray(stack)) { + return; + } + const layer = stack[stack.length - 1]; + if (layer) { + route.setLayerRegisteredPath(layer, route.getLayerPath(data.arguments ?? [])); + } +} +function popLayerPathForLayer(data) { + if (!data._sentryStoredLayer) { + return; + } + data._sentryStoredLayer = false; + const req = data.arguments?.[0]; + if (req) { + route.popLayerPath(req); + } +} +function getSpanForLayer(data, options) { + const layer = data.self; + const args = data.arguments; + if (!layer || !Array.isArray(args)) { + return void 0; + } + if (layer.handle?.length === 4) { + return void 0; + } + if (layer.method && !layer.route) { + return void 0; + } + const req = args[0]; + const res = args[1]; + if (!req) { + return void 0; + } + if (!core.getActiveSpan()) { + return void 0; + } + const type = getLayerType(layer); + const registeredPath = route.getLayerRegisteredPath(layer); + if (registeredPath != null) { + route.pushLayerPath(req, registeredPath); + data._sentryStoredLayer = true; + } + const constructedRoute = type === "request_handler" ? route.getConstructedRoute(req) : void 0; + const matchedRoute = type === "request_handler" && constructedRoute != null ? route.getActualMatchedRoute(req, constructedRoute) : void 0; + const name = type === "request_handler" ? constructedRoute || "request handler" : type === "router" ? layer.path ?? "/" : layer.name ?? ""; + if (matchedRoute) { + setHttpServerSpanRoute(matchedRoute); + } + if (type === "request_handler" && constructedRoute) { + const isolationScope = core.getIsolationScope(); + if (isolationScope !== core.getDefaultIsolationScope()) { + const method = typeof req.method === "string" ? req.method.toUpperCase() : "GET"; + isolationScope.setTransactionName(`${method} ${constructedRoute}`); + } else { + debugBuild.DEBUG_BUILD && core.debug.warn( + "[orchestrion:express] Isolation scope is still default isolation scope - skipping transaction name" + ); + } + } + if (isLayerIgnored(name, type, options)) { + return void 0; + } + const span = core.startInactiveSpan({ + name, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.express`, + [ATTR_EXPRESS_NAME]: name, + [ATTR_EXPRESS_TYPE]: type, + ...matchedRoute ? { [attributes.HTTP_ROUTE]: matchedRoute } : {} + } + }); + if (res && typeof res.once === "function") { + const onFinish = () => { + span.end(); + }; + res.once("finish", onFinish); + data._sentryCleanup = () => res.removeListener("finish", onFinish); + } + return span; +} +function getLayerType(layer) { + if (layer.name === "router") { + return "router"; + } + if (layer.name === "bound dispatch" || layer.name === "handle") { + return "request_handler"; + } + return "middleware"; +} +function setHttpServerSpanRoute(route) { + const activeSpan = core.getActiveSpan(); + const rootSpan = activeSpan && core.getRootSpan(activeSpan); + if (!rootSpan) { + return; + } + if (core.spanToJSON(rootSpan).data[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] !== "http.server") { + return; + } + rootSpan.setAttribute(attributes.HTTP_ROUTE, route); +} +function isLayerIgnored(name, type, options) { + const { ignoreLayers, ignoreLayersType } = options; + if (Array.isArray(ignoreLayersType) && ignoreLayersType.includes(type)) { + return true; + } + if (!Array.isArray(ignoreLayers)) { + return false; + } + try { + return core.stringMatchesSomePattern(name, ignoreLayers, true); + } catch { + return false; + } +} + +exports.instrumentExpress = instrumentExpress; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 83161: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const layerRegisteredPaths = /* @__PURE__ */ new WeakMap(); +function setLayerRegisteredPath(layer, path) { + layerRegisteredPaths.set(layer, path); +} +function getLayerRegisteredPath(layer) { + return layerRegisteredPaths.get(layer); +} +const requestLayerPaths = /* @__PURE__ */ new WeakMap(); +function getStore(req) { + let store = requestLayerPaths.get(req); + if (!store) { + store = []; + requestLayerPaths.set(req, store); + } + return store; +} +function pushLayerPath(req, path) { + getStore(req).push(path); +} +function popLayerPath(req) { + getStore(req).pop(); +} +function getLayerPath(args) { + const firstArg = args[0]; + if (Array.isArray(firstArg)) { + return firstArg.map((segment) => extractLayerPathSegment(segment) ?? "").join(","); + } + return extractLayerPathSegment(firstArg); +} +function extractLayerPathSegment(segment) { + return typeof segment === "string" ? segment : segment instanceof RegExp || typeof segment === "number" ? String(segment) : void 0; +} +function getConstructedRoute(req) { + const layersStore = getStore(req); + let constructedRoute = ""; + for (const path of layersStore) { + if (path === "/" || path === "/*") { + continue; + } + constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ? path : `/${path}`; + } + return constructedRoute.replace(/\/{2,}/g, "/"); +} +function getActualMatchedRoute(req, constructedRoute) { + const layersStore = getStore(req); + if (layersStore.length === 0) { + return void 0; + } + const originalUrl = typeof req.originalUrl === "string" ? req.originalUrl : ""; + if (layersStore.every((path) => path === "/")) { + return originalUrl === "/" ? "/" : void 0; + } + if (constructedRoute === "*") { + return constructedRoute; + } + if (constructedRoute.includes("/") && (constructedRoute.includes(",") || constructedRoute.includes("\\") || constructedRoute.includes("*") || constructedRoute.includes("["))) { + return constructedRoute; + } + const normalizedRoute = constructedRoute.startsWith("/") ? constructedRoute : `/${constructedRoute}`; + const isValidRoute = normalizedRoute.length > 0 && (originalUrl === normalizedRoute || originalUrl.startsWith(normalizedRoute) || isRoutePattern(normalizedRoute)); + return isValidRoute ? normalizedRoute : void 0; +} +function isRoutePattern(route) { + return route.includes(":") || route.includes("*"); +} + +exports.getActualMatchedRoute = getActualMatchedRoute; +exports.getConstructedRoute = getConstructedRoute; +exports.getLayerPath = getLayerPath; +exports.getLayerRegisteredPath = getLayerRegisteredPath; +exports.popLayerPath = popLayerPath; +exports.pushLayerPath = pushLayerPath; +exports.setLayerRegisteredPath = setLayerRegisteredPath; +//# sourceMappingURL=route.js.map + + +/***/ }), + +/***/ 12872: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const debugBuild = __nccwpck_require__(64112); +const core = __nccwpck_require__(84466); +const utils = __nccwpck_require__(86335); + +function getFastifyIntegration() { + const client = core.getClient(); + return client?.getIntegrationByName(utils.INTEGRATION_NAME); +} +function subscribeToFastifyErrorChannel() { + diagnosticsChannel.subscribe("tracing:fastify.request.handler:error", (message) => { + const { error, request, reply } = message; + handleFastifyError.call(handleFastifyError, error, request, reply, "diagnostics-channel"); + }); +} +function handleFastifyError(error, request, reply, handlerOrigin) { + const shouldHandleError = getFastifyIntegration()?.getShouldHandleError() || utils.defaultShouldHandleError; + if (handlerOrigin === "diagnostics-channel") { + this.diagnosticsChannelExists = true; + } + if (this.diagnosticsChannelExists && handlerOrigin === "onError-hook") { + debugBuild.DEBUG_BUILD && core.debug.warn( + "Fastify error handler was already registered via diagnostics channel.", + "You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options." + ); + return; + } + if (shouldHandleError(error, request, reply)) { + core.captureException(error, { + mechanism: { + handled: false, + type: "auto.function.fastify" + } + }); + } +} + +exports.handleFastifyError = handleFastifyError; +exports.subscribeToFastifyErrorChannel = subscribeToFastifyErrorChannel; +//# sourceMappingURL=errors.js.map + + +/***/ }), + +/***/ 11170: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const instrumentation = __nccwpck_require__(97670); +const utils = __nccwpck_require__(86335); +const errors = __nccwpck_require__(12872); + +const _fastifyIntegration = (({ shouldHandleError } = {}) => { + let _shouldHandleError; + return { + name: utils.INTEGRATION_NAME, + setupOnce() { + _shouldHandleError = shouldHandleError || utils.defaultShouldHandleError; + errors.subscribeToFastifyErrorChannel(); + instrumentation.instrumentFastify(); + }, + getShouldHandleError() { + return _shouldHandleError; + }, + setShouldHandleError(shouldHandleError2) { + _shouldHandleError = shouldHandleError2; + } + }; +}); +const fastifyIntegration = core.defineIntegration(_fastifyIntegration); +const instrumentFastify = instrumentation.instrumentFastify; +const handleFastifyError = errors.handleFastifyError; + +exports.fastifyIntegration = fastifyIntegration; +exports.handleFastifyError = handleFastifyError; +exports.instrumentFastify = instrumentFastify; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 97670: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); + +const PACKAGE_NAME = "@sentry/instrumentation-fastify"; +const SUPPORTED_VERSIONS = ">=3.21.0 <6"; +const ORIGIN = "auto.http.otel.fastify"; +const HOOK_OP = "hook.fastify"; +const REQUEST_HANDLER_OP = "request_handler.fastify"; +const FASTIFY_HOOKS = [ + "onRequest", + "preParsing", + "preValidation", + "preHandler", + "preSerialization", + "onSend", + "onResponse", + "onError" +]; +const ATTRIBUTE_HOOK_NAME = "hook.name"; +const ATTRIBUTE_FASTIFY_TYPE = "fastify.type"; +const ATTRIBUTE_HOOK_CALLBACK_NAME = "hook.callback.name"; +const ATTRIBUTE_FASTIFY_ROOT = "fastify.root"; +const HOOK_TYPE_ROUTE = "route-hook"; +const HOOK_TYPE_INSTANCE = "hook"; +const HOOK_TYPE_HANDLER = "request-handler"; +const ANONYMOUS_FUNCTION_NAME = "anonymous"; +const kRequestSpan = /* @__PURE__ */ Symbol("sentry fastify request span"); +const kAddHookOriginal = /* @__PURE__ */ Symbol("sentry fastify addHook original"); +const kSetNotFoundOriginal = /* @__PURE__ */ Symbol("sentry fastify setNotFoundHandler original"); +function getRequestRouteUrl(request) { + return request.routeOptions?.url ?? request.routerPath; +} +function getRequestRouteConfig(request) { + return request.routeOptions?.config ?? request.routeConfig; +} +function isFastifyRequest(arg) { + return core.isObjectLike(arg) && !!arg.method && !!arg.url && (!!arg.routeOptions || "routerPath" in arg); +} +function fastifyOtelPlugin(instance, _opts, done) { + instance.decorate(kAddHookOriginal, instance.addHook); + instance.decorate(kSetNotFoundOriginal, instance.setNotFoundHandler); + instance.decorateRequest("opentelemetry", function opentelemetry() { + return { span: this[kRequestSpan] }; + }); + instance.decorateRequest(kRequestSpan, null); + instance.addHook("onRoute", otelWireRoute); + instance.addHook("onRequest", startRequestSpanHook); + instance.addHook("onResponse", finalizeNotFoundSpanHook); + instance.addHook = addHookPatched; + instance.setNotFoundHandler = setNotFoundHandlerPatched; + done(); +} +const pluginSymbols = fastifyOtelPlugin; +pluginSymbols[/* @__PURE__ */ Symbol.for("skip-override")] = true; +pluginSymbols[/* @__PURE__ */ Symbol.for("fastify.display-name")] = PACKAGE_NAME; +pluginSymbols[/* @__PURE__ */ Symbol.for("plugin-meta")] = { + fastify: SUPPORTED_VERSIONS, + name: PACKAGE_NAME +}; +function otelWireRoute(routeOptions) { + if (routeOptions.config?.otel === false) { + return; + } + for (const hook of FASTIFY_HOOKS) { + const handlerLike = routeOptions[hook]; + if (typeof handlerLike === "function") { + routeOptions[hook] = handlerWrapper( + handlerLike, + hook, + routeHookAttributes(this.pluginName, hook, handlerLike, routeOptions.url) + ); + } else if (Array.isArray(handlerLike)) { + routeOptions[hook] = handlerLike.map( + (handler) => handlerWrapper(handler, hook, routeHookAttributes(this.pluginName, hook, handler, routeOptions.url)) + ); + } + } + routeOptions.onSend = appendRouteHook(routeOptions.onSend, finalizeResponseSpanHook); + routeOptions.onError = appendRouteHook(routeOptions.onError, recordErrorInSpanHook); + routeOptions.handler = handlerWrapper(routeOptions.handler, "handler", { + [ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - route-handler`, + [ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_HANDLER, + [attributes.HTTP_ROUTE]: routeOptions.url, + [ATTRIBUTE_HOOK_CALLBACK_NAME]: routeOptions.handler.name.length > 0 ? routeOptions.handler.name : ANONYMOUS_FUNCTION_NAME + }); +} +function routeHookAttributes(pluginName, hook, handler, url) { + return { + [ATTRIBUTE_HOOK_NAME]: `${pluginName} - route -> ${hook}`, + [ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_ROUTE, + [attributes.HTTP_ROUTE]: url, + [ATTRIBUTE_HOOK_CALLBACK_NAME]: handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME + }; +} +function appendRouteHook(existing, hook) { + if (existing == null) { + return hook; + } + return Array.isArray(existing) ? [...existing, hook] : [existing, hook]; +} +function startRequestSpanHook(request, _reply, hookDone) { + if (getRequestRouteConfig(request)?.otel === false) { + return hookDone(); + } + const attributes$1 = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [ATTRIBUTE_FASTIFY_ROOT]: PACKAGE_NAME, + [attributes.HTTP_REQUEST_METHOD]: request.method, + [attributes.URL_PATH]: request.url + }; + const route = getRequestRouteUrl(request); + if (route != null) { + attributes$1[attributes.HTTP_ROUTE] = route; + const activeSpan = core.getActiveSpan(); + const rootSpan = activeSpan && core.getRootSpan(activeSpan); + if (rootSpan && core.spanToJSON(rootSpan).data[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] === "http.server") { + rootSpan.setAttribute(attributes.HTTP_ROUTE, route); + } + } + const requestSpan = core.startInactiveSpan({ name: "request", op: REQUEST_HANDLER_OP, attributes: attributes$1 }); + request[kRequestSpan] = requestSpan; + core.withActiveSpan(requestSpan, () => { + hookDone(); + }); +} +function finalizeNotFoundSpanHook(request, reply, hookDone) { + const span = request[kRequestSpan]; + if (span != null) { + span.setAttributes({ [attributes.HTTP_RESPONSE_STATUS_CODE]: reply.statusCode }); + span.end(); + } + request[kRequestSpan] = null; + hookDone(); +} +function finalizeResponseSpanHook(request, reply, payload, hookDone) { + const span = request[kRequestSpan]; + if (span != null) { + if (reply.statusCode >= 500) { + span.setStatus({ code: core.SPAN_STATUS_ERROR }); + } + span.setAttributes({ [attributes.HTTP_RESPONSE_STATUS_CODE]: reply.statusCode }); + span.end(); + } + request[kRequestSpan] = null; + hookDone(null, payload); +} +function recordErrorInSpanHook(request, _reply, error, hookDone) { + const span = request[kRequestSpan]; + if (span != null) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: error.message }); + } + hookDone(); +} +function addHookPatched(name, hook) { + const addHookOriginal = this[kAddHookOriginal]; + if (FASTIFY_HOOKS.includes(name)) { + return addHookOriginal.call( + this, + name, + handlerWrapper(hook, name, { + [ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - ${name}`, + [ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE, + [ATTRIBUTE_HOOK_CALLBACK_NAME]: hook.name?.length > 0 ? hook.name : ANONYMOUS_FUNCTION_NAME + }) + ); + } + return addHookOriginal.call(this, name, hook); +} +function setNotFoundHandlerPatched(hooks, handler) { + const setNotFoundHandlerOriginal = this[kSetNotFoundOriginal]; + if (typeof hooks === "function") { + setNotFoundHandlerOriginal.call( + this, + handlerWrapper(hooks, "notFoundHandler", { + [ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - not-found-handler`, + [ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE, + [ATTRIBUTE_HOOK_CALLBACK_NAME]: hooks.name?.length > 0 ? hooks.name : ANONYMOUS_FUNCTION_NAME + }) + ); + return; + } + if (hooks.preValidation != null) { + hooks.preValidation = handlerWrapper(hooks.preValidation, "notFoundHandler - preValidation", { + [ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - not-found-handler - preValidation`, + [ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE, + [ATTRIBUTE_HOOK_CALLBACK_NAME]: hooks.preValidation.name?.length > 0 ? hooks.preValidation.name : ANONYMOUS_FUNCTION_NAME + }); + } + if (hooks.preHandler != null) { + hooks.preHandler = handlerWrapper(hooks.preHandler, "notFoundHandler - preHandler", { + [ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - not-found-handler - preHandler`, + [ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE, + [ATTRIBUTE_HOOK_CALLBACK_NAME]: hooks.preHandler.name?.length > 0 ? hooks.preHandler.name : ANONYMOUS_FUNCTION_NAME + }); + } + if (handler == null) { + setNotFoundHandlerOriginal.call(this, hooks); + return; + } + setNotFoundHandlerOriginal.call( + this, + hooks, + handlerWrapper(handler, "notFoundHandler", { + [ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - not-found-handler`, + [ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE, + [ATTRIBUTE_HOOK_CALLBACK_NAME]: handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME + }) + ); +} +function getRequestFromArgs(args) { + for (const arg of args) { + if (isFastifyRequest(arg)) { + return arg; + } + } + return null; +} +function handlerWrapper(handler, hookName, spanAttributes = {}) { + return function handlerWrapped(...args) { + const request = getRequestFromArgs(args); + if (request === null || getRequestRouteConfig(request)?.otel === false) { + return handler.call(this, ...args); + } + const parentSpan = request[kRequestSpan] ?? void 0; + const handlerName = handler.name?.length > 0 ? handler.name : this.pluginName ?? ANONYMOUS_FUNCTION_NAME; + const hookType = spanAttributes[ATTRIBUTE_FASTIFY_TYPE]; + const op = hookType === HOOK_TYPE_INSTANCE ? HOOK_OP : hookType === HOOK_TYPE_HANDLER ? REQUEST_HANDLER_OP : void 0; + const name = op ? stripFastifyPrefix(spanAttributes[ATTRIBUTE_HOOK_NAME]) : `${hookName} - ${handlerName}`; + return core.startSpan( + { + name, + op, + attributes: { + ...spanAttributes, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }, + parentSpan + }, + () => handler.call(this, ...args) + ); + }; +} +function stripFastifyPrefix(hookName = "") { + return hookName.replace(/^fastify -> /, "").replace(/^@fastify\/otel -> /, "").replace(/^@sentry\/instrumentation-fastify -> /, ""); +} +function instrumentOnRequest(fastify) { + fastify.addHook("onRequest", async (request, _reply) => { + const routeName = getRequestRouteUrl(request); + const method = request.method || "GET"; + core.getIsolationScope().setTransactionName(`${method} ${routeName}`); + }); +} +let _isInstrumented = false; +const instrumentFastify = Object.assign( + function instrumentFastify2() { + if (_isInstrumented) { + return; + } + _isInstrumented = true; + diagnosticsChannel.subscribe("fastify.initialization", (message) => { + const fastifyInstance = message.fastify; + fastifyInstance?.register(fastifyOtelPlugin).after((err) => { + if (err) { + debugBuild.DEBUG_BUILD && core.debug.error("Failed to setup Fastify instrumentation", err); + } else if (fastifyInstance) { + instrumentOnRequest(fastifyInstance); + } + }); + }); + }, + { id: "Fastify.v5" } +); + +exports.instrumentFastify = instrumentFastify; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 86335: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const INTEGRATION_NAME = "Fastify"; +function defaultShouldHandleError(_error, _request, reply) { + const statusCode = reply.statusCode; + return statusCode >= 500 || statusCode <= 299; +} + +exports.INTEGRATION_NAME = INTEGRATION_NAME; +exports.defaultShouldHandleError = defaultShouldHandleError; +//# sourceMappingURL=utils.js.map + + +/***/ }), + +/***/ 45155: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const net = __nccwpck_require__(87503); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); + +function startFirestoreSpan(spanName, reference) { + return core.startInactiveSpan({ + name: `${spanName} ${reference.path}`, + op: "db.query", + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.firebase.orchestrion.firestore", + [attributes.DB_OPERATION_NAME]: spanName, + ...buildAttributes(reference) + } + }); +} +function getPortAndAddress(settings) { + let address; + let port; + if (typeof settings.host === "string") { + if (settings.host.startsWith("[")) { + if (settings.host.endsWith("]")) { + address = settings.host.replace(/^\[|\]$/g, ""); + } else if (settings.host.includes("]:")) { + const lastColonIndex = settings.host.lastIndexOf(":"); + if (lastColonIndex !== -1) { + address = settings.host.slice(1, lastColonIndex).replace(/^\[|\]$/g, ""); + port = settings.host.slice(lastColonIndex + 1); + } + } + } else { + if (net.isIPv6(settings.host)) { + address = settings.host; + } else { + const lastColonIndex = settings.host.lastIndexOf(":"); + if (lastColonIndex !== -1) { + address = settings.host.slice(0, lastColonIndex); + port = settings.host.slice(lastColonIndex + 1); + } else { + address = settings.host; + } + } + } + } + return { + address, + port: port ? parseInt(port, 10) : void 0 + }; +} +function buildAttributes(reference) { + const firestoreApp = reference.firestore.app; + const firestoreOptions = firestoreApp.options; + const settings = reference.firestore.toJSON()?.settings || {}; + const attributes$1 = { + [attributes.DB_COLLECTION_NAME]: reference.path, + [attributes.DB_NAMESPACE]: firestoreApp.name, + [attributes.DB_SYSTEM_NAME]: "firebase.firestore", + "firebase.firestore.type": reference.type, + "firebase.firestore.options.projectId": firestoreOptions.projectId, + "firebase.firestore.options.appId": firestoreOptions.appId, + "firebase.firestore.options.messagingSenderId": firestoreOptions.messagingSenderId, + "firebase.firestore.options.storageBucket": firestoreOptions.storageBucket + }; + const { address, port } = getPortAndAddress(settings); + if (address) { + attributes$1[attributes.SERVER_ADDRESS] = address; + } + if (port) { + attributes$1[attributes.SERVER_PORT] = port; + } + return attributes$1; +} + +exports.getPortAndAddress = getPortAndAddress; +exports.startFirestoreSpan = startFirestoreSpan; +//# sourceMappingURL=firestore.js.map + + +/***/ }), + +/***/ 44681: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); + +const FUNCTIONS_ORIGIN = "auto.firebase.orchestrion.functions"; +const WRAPPED = "__sentryFirebaseWrapped"; +function wrapFunctionsRegistration(data, triggerType) { + const args = data.arguments; + if (!Array.isArray(args) || args.length === 0) { + return; + } + const handlerIndex = typeof args[0] === "function" ? 0 : 1; + const handler = args[handlerIndex]; + if (typeof handler !== "function" || handler[WRAPPED]) { + return; + } + args[handlerIndex] = wrapHandler(handler, triggerType); +} +function wrapHandler(handler, triggerType) { + const wrapped = async function(...handlerArgs) { + const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || "unknown"; + const attributes$1 = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: FUNCTIONS_ORIGIN, + [attributes.FAAS_NAME]: functionName, + [attributes.FAAS_TRIGGER]: triggerType, + "faas.provider": "firebase" + }; + if (process.env.GCLOUD_PROJECT) { + attributes$1["cloud.project_id"] = process.env.GCLOUD_PROJECT; + } + if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) { + attributes$1["cloud.event_source"] = process.env.EVENTARC_CLOUD_EVENT_SOURCE; + } + return core.startSpanManual( + { + name: `firebase.function.${triggerType}`, + op: "function.firebase", + kind: core.SPAN_KIND.SERVER, + attributes: attributes$1 + }, + async (span) => { + try { + const result = await handler.apply(this, handlerArgs); + span.end(); + return result; + } catch (error) { + span.setStatus({ code: core.SPAN_STATUS_ERROR }); + core.captureException(error, { + mechanism: { + type: FUNCTIONS_ORIGIN, + handled: false + } + }); + span.end(); + await core.flush(2e3); + throw error; + } + } + ); + }; + wrapped[WRAPPED] = true; + return wrapped; +} + +exports.wrapFunctionsRegistration = wrapFunctionsRegistration; +//# sourceMappingURL=functions.js.map + + +/***/ }), + +/***/ 14736: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const instrumentation = __nccwpck_require__(84785); + +const INTEGRATION_NAME = "Firebase"; +const _firebaseChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + instrumentation.instrumentFirebase(); + }); + } + }; +}); +const firebaseChannelIntegration = core.defineIntegration(_firebaseChannelIntegration); + +exports.firebaseChannelIntegration = firebaseChannelIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 84785: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); +const firestore = __nccwpck_require__(45155); +const functions = __nccwpck_require__(44681); + +const FIRESTORE_OPERATIONS = [ + { channel: channels.CHANNELS.FIREBASE_FIRESTORE_ADD_DOC, spanName: "addDoc", useParent: false }, + { channel: channels.CHANNELS.FIREBASE_FIRESTORE_GET_DOCS, spanName: "getDocs", useParent: false }, + { channel: channels.CHANNELS.FIREBASE_FIRESTORE_SET_DOC, spanName: "setDoc", useParent: true }, + { channel: channels.CHANNELS.FIREBASE_FIRESTORE_DELETE_DOC, spanName: "deleteDoc", useParent: true } +]; +const FUNCTIONS_TRIGGERS = [ + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_HTTP_REQUEST, triggerType: "http.request" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_HTTP_CALL, triggerType: "http.call" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_CREATED, triggerType: "firestore.document.created" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_UPDATED, triggerType: "firestore.document.updated" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_DELETED, triggerType: "firestore.document.deleted" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_WRITTEN, triggerType: "firestore.document.written" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_SCHEDULER, triggerType: "scheduler.scheduled" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_STORAGE_FINALIZED, triggerType: "storage.object.finalized" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_STORAGE_ARCHIVED, triggerType: "storage.object.archived" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_STORAGE_DELETED, triggerType: "storage.object.deleted" }, + { channel: channels.CHANNELS.FIREBASE_FUNCTIONS_STORAGE_METADATA_UPDATED, triggerType: "storage.object.metadataUpdated" } +]; +const NOOP = () => { +}; +function safe(fn) { + try { + return fn(); + } catch (error) { + debugBuild.DEBUG_BUILD && core.debug.warn("[orchestrion:firebase] error handling channel event", error); + return void 0; + } +} +function instrumentFirebase() { + for (const { channel, spanName, useParent } of FIRESTORE_OPERATIONS) { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channel), + (data) => safe(() => { + const reference = data.arguments[0]; + if (!reference) { + return void 0; + } + const spanReference = useParent ? reference.parent || reference : reference; + return firestore.startFirestoreSpan(spanName, spanReference); + }) + ); + } + for (const { channel, triggerType } of FUNCTIONS_TRIGGERS) { + diagnosticsChannel.tracingChannel(channel).subscribe({ + start: (data) => void safe(() => functions.wrapFunctionsRegistration(data, triggerType)), + end: NOOP, + asyncStart: NOOP, + asyncEnd: NOOP, + error: NOOP + }); + } +} + +exports.instrumentFirebase = instrumentFirebase; +//# sourceMappingURL=instrumentation.js.map + + +/***/ }), + +/***/ 42995: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "GenericPool"; +const _genericPoolChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => instrumentGenericPool()); + } + }; +}); +const genericPoolChannelIntegration = core.defineIntegration(_genericPoolChannelIntegration); +function instrumentGenericPool() { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.GENERIC_POOL_ACQUIRE), + () => core.startInactiveSpan({ + name: "generic-pool.acquire", + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.orchestrion.generic_pool" + } + }) ); } -/** - * Parse the `Forwarded` header field value into an array of objects. - * - * @param {string} header The header field value. - * @returns {Object[]} - * @public - */ -function parse(header) { - var mustUnescape = false; - var isEscaping = false; - var inQuotes = false; - var forwarded = {}; - var output = []; - var start = -1; - var end = -1; - var parameter; - var code; +exports.genericPoolChannelIntegration = genericPoolChannelIntegration; +//# sourceMappingURL=generic-pool.js.map - for (var i = 0; i < header.length; i++) { - code = header.charCodeAt(i); - if (parameter === undefined) { - if ( - i !== 0 && - start === -1 && - (code === 0x20/*' '*/ || code === 0x09/*'\t'*/) - ) { +/***/ }), + +/***/ 3638: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Google_GenAI"; +const ORIGIN = "auto.ai.orchestrion.google_genai"; +const INSTRUMENTED_CHANNELS = [ + { channel: channels.CHANNELS.GOOGLE_GENAI_GENERATE_CONTENT, operation: "generate_content" }, + { channel: channels.CHANNELS.GOOGLE_GENAI_EMBED_CONTENT, operation: "embeddings" }, + { channel: channels.CHANNELS.GOOGLE_GENAI_CHAT, operation: "chat" } +]; +let subscribed = false; +const _googleGenAIChannelIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel || subscribed) { + return; + } + subscribed = true; + core.waitForTracingChannelBinding(() => { + for (const { channel, operation } of INSTRUMENTED_CHANNELS) { + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:google-genai] subscribing to channel "${channel}"`); + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channel), + (data) => createGenAiSpan(data, operation, options), + { + beforeSpanEnd: (span, data) => { + if (operation !== "embeddings") { + core.addGoogleGenAIResponseAttributes( + span, + data.result, + core.resolveAIRecordingOptions(options).recordOutputs + ); + } + }, + deferSpanEnd: ({ span, data }) => wrapStreamResult(span, data, options) + } + ); + } + }); + } + }; +}); +function createGenAiSpan(data, operation, options) { + if (core._INTERNAL_shouldSkipAiProviderWrapping(INTEGRATION_NAME)) { + return void 0; + } + if (operation !== "chat") { + const activeSpan = core.getActiveSpan(); + if (activeSpan) { + const { op, origin } = core.spanToJSON(activeSpan); + if (origin === ORIGIN && op === "gen_ai.chat") { + return void 0; + } + } + } + const args = data.arguments ?? []; + const params = args[0]; + const { recordInputs } = core.resolveAIRecordingOptions(options); + const enableTruncation = core.shouldEnableTruncation(options.enableTruncation); + const attributes = core.extractGoogleGenAIRequestAttributes(operation, params, data.self); + const model = attributes[core.GEN_AI_REQUEST_MODEL_ATTRIBUTE] || "unknown"; + attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = ORIGIN; + const span = core.startInactiveSpan({ + name: `${operation} ${model}`, + op: `gen_ai.${operation}`, + attributes + }); + if (recordInputs && params) { + core.addGoogleGenAIRequestAttributes(span, params, operation, enableTruncation); + } + return span; +} +function isAsyncIterable(value) { + return !!value && typeof value[Symbol.asyncIterator] === "function"; +} +function wrapStreamResult(span, data, options) { + const result = data.result; + if (!isAsyncIterable(result)) { + return false; + } + const { recordOutputs } = core.resolveAIRecordingOptions(options); + const iterate = result[Symbol.asyncIterator].bind(result); + const instrumented = core.instrumentGoogleGenAIStream({ [Symbol.asyncIterator]: iterate }, span, recordOutputs ?? false); + result[Symbol.asyncIterator] = () => instrumented; + return true; +} +const googleGenAIChannelIntegration = core.defineIntegration(_googleGenAIChannelIntegration); + +exports.googleGenAIChannelIntegration = googleGenAIChannelIntegration; +//# sourceMappingURL=google-genai.js.map + + +/***/ }), + +/***/ 1098: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ORIGIN = "auto.graphql.diagnostic_channel"; +const SPAN_NAME_PARSE = "graphql.parse"; +const SPAN_NAME_VALIDATE = "graphql.validate"; +const SPAN_NAME_EXECUTE = "graphql.execute"; +const SPAN_NAME_RESOLVE = "graphql.resolve"; +const GRAPHQL_FIELD_NAME = "graphql.field.name"; +const GRAPHQL_FIELD_PATH = "graphql.field.path"; +const GRAPHQL_FIELD_TYPE = "graphql.field.type"; +const GRAPHQL_PARENT_NAME = "graphql.parent.name"; +const GRAPHQL_DATA_SYMBOL = /* @__PURE__ */ Symbol.for("opentelemetry.graphql_data"); +const GRAPHQL_PATCHED_SYMBOL = /* @__PURE__ */ Symbol.for("opentelemetry.patched"); + +exports.GRAPHQL_DATA_SYMBOL = GRAPHQL_DATA_SYMBOL; +exports.GRAPHQL_FIELD_NAME = GRAPHQL_FIELD_NAME; +exports.GRAPHQL_FIELD_PATH = GRAPHQL_FIELD_PATH; +exports.GRAPHQL_FIELD_TYPE = GRAPHQL_FIELD_TYPE; +exports.GRAPHQL_PARENT_NAME = GRAPHQL_PARENT_NAME; +exports.GRAPHQL_PATCHED_SYMBOL = GRAPHQL_PATCHED_SYMBOL; +exports.ORIGIN = ORIGIN; +exports.SPAN_NAME_EXECUTE = SPAN_NAME_EXECUTE; +exports.SPAN_NAME_PARSE = SPAN_NAME_PARSE; +exports.SPAN_NAME_RESOLVE = SPAN_NAME_RESOLVE; +exports.SPAN_NAME_VALIDATE = SPAN_NAME_VALIDATE; +//# sourceMappingURL=constants.js.map + + +/***/ }), + +/***/ 34663: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const index = __nccwpck_require__(40708); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); +const spans = __nccwpck_require__(68349); + +const INTEGRATION_NAME = "Graphql"; +function getOptionsWithDefaults(options) { + return { + ignoreResolveSpans: options.ignoreResolveSpans !== false, + ignoreTrivialResolveSpans: options.ignoreTrivialResolveSpans !== false, + useOperationNameForRootSpan: options.useOperationNameForRootSpan !== false + }; +} +function safe(fn) { + try { + return fn(); + } catch (error) { + debugBuild.DEBUG_BUILD && core.debug.warn("[orchestrion:graphql] error building span", error); + return void 0; + } +} +const _graphqlChannelIntegration = ((options = {}) => { + const config = getOptionsWithDefaults(options); + const getConfig = () => config; + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.GRAPHQL_PARSE), + () => safe(() => spans.startParseSpan()) + ); + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.GRAPHQL_VALIDATE), + (data) => safe(() => spans.startValidateSpan(data.arguments[1])), + { beforeSpanEnd: (span, data) => void safe(() => spans.finalizeValidateSpan(span, data.result)) } + ); + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.GRAPHQL_EXECUTE), + (data) => safe(() => spans.startExecuteSpan(data.arguments, data.self, config, getConfig)), + { beforeSpanEnd: (span, data) => void safe(() => spans.finalizeExecuteSpan(span, data.result)) } + ); + }); + } + }; +}); +const graphqlChannelIntegration = core.defineIntegration(_graphqlChannelIntegration); +const graphqlDiagnosticsChannelIntegration = (options) => { + const orchestrion = graphqlChannelIntegration(options); + return core.extendIntegration(index.graphqlIntegration(options), { + name: INTEGRATION_NAME, + setupOnce: () => orchestrion.setupOnce?.() + }); +}; + +exports.graphqlChannelIntegration = graphqlChannelIntegration; +exports.graphqlDiagnosticsChannelIntegration = graphqlDiagnosticsChannelIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 93702: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const op = __nccwpck_require__(83678); +const core = __nccwpck_require__(84466); +const constants = __nccwpck_require__(1098); + +function isPromise(value) { + return typeof value?.then === "function"; +} +function wrapFields(type, getConfig) { + if (!type || type[constants.GRAPHQL_PATCHED_SYMBOL]) { + return; + } + type[constants.GRAPHQL_PATCHED_SYMBOL] = true; + const fields = type.getFields(); + Object.keys(fields).forEach((key) => { + const field = fields[key]; + if (!field) { + return; + } + if (field.resolve) { + field.resolve = wrapFieldResolver(getConfig, field.resolve); + } + if (field.type) { + for (const unwrappedType of unwrapType(field.type)) { + wrapFields(unwrappedType, getConfig); + } + } + }); +} +function wrapFieldResolver(getConfig, fieldResolver, isDefaultResolver = false) { + if (typeof fieldResolver !== "function" || fieldResolver[constants.GRAPHQL_PATCHED_SYMBOL]) { + return fieldResolver; + } + function wrappedFieldResolver(source, args, rawContextValue, info) { + if (!fieldResolver) { + return void 0; + } + const contextValue = rawContextValue ?? {}; + const config = getConfig(); + if (config.ignoreTrivialResolveSpans && isDefaultResolver && (core.isObjectLike(source) || typeof source === "function")) { + const property = source[info.fieldName]; + if (typeof property !== "function") { + return fieldResolver.call(this, source, args, contextValue, info); + } + } + if (!contextValue[constants.GRAPHQL_DATA_SYMBOL]) { + return fieldResolver.call(this, source, args, contextValue, info); + } + const path = pathToArray(info.path); + const { field, spanAdded } = createFieldIfNotExists(contextValue, info, path); + const span = field.span; + return core.withActiveSpan(span, () => { + try { + const res = fieldResolver.call(this, source, args, contextValue, info); + if (isPromise(res)) { + return res.then( + (r) => { + endResolveSpan(span, spanAdded); + return r; + }, + (err) => { + endResolveSpan(span, spanAdded, err); + throw err; + } + ); + } + endResolveSpan(span, spanAdded); + return res; + } catch (err) { + endResolveSpan(span, spanAdded, err); + throw err; + } + }); + } + wrappedFieldResolver[constants.GRAPHQL_PATCHED_SYMBOL] = true; + return wrappedFieldResolver; +} +function endResolveSpan(span, shouldEndSpan, error) { + if (!shouldEndSpan) { + return; + } + if (error) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: error.message }); + } + span.end(); +} +function createFieldIfNotExists(contextValue, info, path) { + const existing = getField(contextValue, path); + if (existing) { + return { field: existing, spanAdded: false }; + } + const field = { span: createResolverSpan(info, path, getParentFieldSpan(contextValue, path)) }; + addField(contextValue, path, field); + return { field, spanAdded: true }; +} +function createResolverSpan(info, path, parentSpan) { + const attributes = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op.WEB_SERVER_GRAPHQL_SPAN_OP, + [constants.GRAPHQL_FIELD_NAME]: info.fieldName, + [constants.GRAPHQL_FIELD_PATH]: path.join("."), + [constants.GRAPHQL_FIELD_TYPE]: info.returnType.toString(), + [constants.GRAPHQL_PARENT_NAME]: info.parentType.name + }; + return core.startInactiveSpan({ name: `${constants.SPAN_NAME_RESOLVE} ${path.join(".")}`, attributes, parentSpan }); +} +function addField(contextValue, path, field) { + const data = contextValue[constants.GRAPHQL_DATA_SYMBOL]; + if (data) { + data.fields[path.join(".")] = field; + } +} +function getField(contextValue, path) { + return contextValue[constants.GRAPHQL_DATA_SYMBOL]?.fields[path.join(".")]; +} +function getParentFieldSpan(contextValue, path) { + for (let i = path.length - 1; i > 0; i--) { + const field = getField(contextValue, path.slice(0, i)); + if (field) { + return field.span; + } + } + return contextValue[constants.GRAPHQL_DATA_SYMBOL]?.span; +} +function pathToArray(path) { + const flattened = []; + let curr = path; + while (curr) { + flattened.push(String(curr.key)); + curr = curr.prev; + } + return flattened.reverse(); +} +function unwrapType(type) { + if ("ofType" in type && type.ofType) { + return unwrapType(type.ofType); + } + if (isGraphQLUnionType(type)) { + return type.getTypes(); + } + if (isGraphQLObjectType(type)) { + return [type]; + } + return []; +} +function isGraphQLUnionType(type) { + return "getTypes" in type && typeof type.getTypes === "function"; +} +function isGraphQLObjectType(type) { + return "getFields" in type && typeof type.getFields === "function"; +} +function getOperation(document, operationName) { + const definitions = document?.definitions; + if (!definitions || !Array.isArray(definitions)) { + return void 0; + } + const isOperation = (def) => !!def?.operation && ["query", "mutation", "subscription"].indexOf(def.operation) !== -1; + if (operationName) { + return definitions.filter(isOperation).find((def) => operationName === def?.name?.value); + } + return definitions.find(isOperation); +} + +exports.getOperation = getOperation; +exports.wrapFieldResolver = wrapFieldResolver; +exports.wrapFields = wrapFields; +//# sourceMappingURL=resolvers.js.map + + +/***/ }), + +/***/ 68349: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const op = __nccwpck_require__(83678); +const core = __nccwpck_require__(84466); +const utils = __nccwpck_require__(11103); +const constants = __nccwpck_require__(1098); +const resolvers = __nccwpck_require__(93702); + +const BASE_ATTRIBUTES = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: constants.ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: op.WEB_SERVER_GRAPHQL_SPAN_OP +}; +function startParseSpan() { + return core.startInactiveSpan({ name: constants.SPAN_NAME_PARSE, attributes: { ...BASE_ATTRIBUTES } }); +} +function startValidateSpan(documentAST) { + return core.startInactiveSpan({ + name: constants.SPAN_NAME_VALIDATE, + attributes: { ...BASE_ATTRIBUTES, [attributes.GRAPHQL_DOCUMENT]: utils.collectGraphqlDocument(documentAST) } + }); +} +function finalizeValidateSpan(span, result) { + if (Array.isArray(result) && result.length > 0) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "invalid_argument" }); + } +} +function normalizeExecuteArgs(argsArray) { + if (argsArray.length >= 2) { + return { + schema: argsArray[0 /* SCHEMA */], + document: argsArray[1 /* DOCUMENT */], + contextValue: argsArray[3 /* CONTEXT_VALUE */] ?? {}, + operationName: argsArray[5 /* OPERATION_NAME */], + fieldResolver: argsArray[6 /* FIELD_RESOLVER */], + writeBack: (contextValue, fieldResolver) => { + argsArray[3 /* CONTEXT_VALUE */] = contextValue; + argsArray[6 /* FIELD_RESOLVER */] = fieldResolver; + } + }; + } + const obj = argsArray[0] ?? {}; + return { + schema: obj.schema, + document: obj.document, + contextValue: obj.contextValue ?? {}, + operationName: obj.operationName, + fieldResolver: obj.fieldResolver, + writeBack: (contextValue, fieldResolver) => { + obj.contextValue = contextValue; + obj.fieldResolver = fieldResolver; + } + }; +} +function startExecuteSpan(argsArray, self, config, getConfig) { + const args = normalizeExecuteArgs(argsArray); + const { schema, document } = args; + let { contextValue, fieldResolver } = args; + const alreadyInstrumented = !!contextValue[constants.GRAPHQL_DATA_SYMBOL]; + if (!config.ignoreResolveSpans && !alreadyInstrumented) { + const isUsingDefaultResolver = fieldResolver == null; + const defaultFieldResolver = self?.defaultFieldResolver; + const fieldResolverForExecute = fieldResolver ?? defaultFieldResolver; + if (fieldResolverForExecute) { + fieldResolver = resolvers.wrapFieldResolver(getConfig, fieldResolverForExecute, isUsingDefaultResolver); + } + if (schema) { + resolvers.wrapFields(schema.getQueryType(), getConfig); + resolvers.wrapFields(schema.getMutationType(), getConfig); + } + } + const operation = resolvers.getOperation(document, args.operationName); + const operationType = operation?.operation; + const operationName = operation?.name?.value ?? args.operationName ?? void 0; + const span = core.startInactiveSpan({ + name: utils.getOperationSpanName(operationType, operationName || void 0, constants.SPAN_NAME_EXECUTE), + attributes: { + ...BASE_ATTRIBUTES, + [attributes.GRAPHQL_OPERATION_TYPE]: operationType, + [attributes.GRAPHQL_OPERATION_NAME]: operationName || void 0, + [attributes.GRAPHQL_DOCUMENT]: utils.collectGraphqlDocument(document) + } + }); + if (config.useOperationNameForRootSpan && operationType) { + utils.renameRootSpanWithOperation(span, operationType, operationName || void 0); + } + contextValue[constants.GRAPHQL_DATA_SYMBOL] = { source: document, span, fields: {} }; + args.writeBack(contextValue, fieldResolver); + return span; +} +function finalizeExecuteSpan(span, result) { + if (utils.hasResultErrors(result)) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" }); + } +} + +exports.finalizeExecuteSpan = finalizeExecuteSpan; +exports.finalizeValidateSpan = finalizeValidateSpan; +exports.startExecuteSpan = startExecuteSpan; +exports.startParseSpan = startParseSpan; +exports.startValidateSpan = startValidateSpan; +//# sourceMappingURL=spans.js.map + + +/***/ }), + +/***/ 52351: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const LIFECYCLE_EXT_POINTS = [ + "onPreAuth", + "onCredentials", + "onPostAuth", + "onPreHandler", + "onPostHandler", + "onPreResponse", + "onRequest" +]; +const handlerPatched = /* @__PURE__ */ Symbol("hapi-handler-patched"); +const HapiLayerType = { + ROUTER: "router", + PLUGIN: "plugin", + EXT: "server.ext" +}; +const HapiLifecycleMethodNames = new Set(LIFECYCLE_EXT_POINTS); +var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => { + AttributeNames2["HAPI_TYPE"] = "hapi.type"; + AttributeNames2["PLUGIN_NAME"] = "hapi.plugin.name"; + AttributeNames2["EXT_TYPE"] = "server.ext.type"; + return AttributeNames2; +})(AttributeNames || {}); + +exports.AttributeNames = AttributeNames; +exports.HapiLayerType = HapiLayerType; +exports.HapiLifecycleMethodNames = HapiLifecycleMethodNames; +exports.handlerPatched = handlerPatched; +//# sourceMappingURL=hapi-types.js.map + + +/***/ }), + +/***/ 44143: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const hapiTypes = __nccwpck_require__(52351); + +function setHttpServerSpanRouteAttribute(route) { + const activeSpan = core.getActiveSpan(); + if (!activeSpan) { + return; + } + const rootSpan = core.getRootSpan(activeSpan); + if (!rootSpan) { + return; + } + if (core.spanToJSON(rootSpan).data[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] !== "http.server") { + return; + } + rootSpan.setAttribute(attributes.HTTP_ROUTE, route); +} +const isLifecycleExtType = (variableToCheck) => { + return typeof variableToCheck === "string" && hapiTypes.HapiLifecycleMethodNames.has(variableToCheck); +}; +const isLifecycleExtEventObj = (variableToCheck) => { + const event = variableToCheck?.type; + return event !== void 0 && isLifecycleExtType(event); +}; +const isDirectExtInput = (variableToCheck) => { + return Array.isArray(variableToCheck) && variableToCheck.length <= 3 && isLifecycleExtType(variableToCheck[0]) && typeof variableToCheck[1] === "function"; +}; +const isPatchableExtMethod = (variableToCheck) => { + return !Array.isArray(variableToCheck); +}; +const getRouteMetadata = (route, pluginName) => { + const attributes$1 = { + [attributes.HTTP_ROUTE]: route.path, + // eslint-disable-next-line typescript/no-deprecated -- TODO(v11): Replace deprecated attributes + [attributes.HTTP_METHOD]: route.method + }; + let name; + if (pluginName) { + attributes$1[hapiTypes.AttributeNames.HAPI_TYPE] = hapiTypes.HapiLayerType.PLUGIN; + attributes$1[hapiTypes.AttributeNames.PLUGIN_NAME] = pluginName; + name = `${pluginName}: route - ${route.path}`; + } else { + attributes$1[hapiTypes.AttributeNames.HAPI_TYPE] = hapiTypes.HapiLayerType.ROUTER; + name = `route - ${route.path}`; + } + return { attributes: attributes$1, name }; +}; +const getExtMetadata = (extPoint, pluginName, methodName) => { + let baseName = `ext - ${extPoint}`; + if (methodName && methodName !== "method") { + baseName = `ext - ${extPoint} - ${methodName}`; + } + if (pluginName) { + return { + attributes: { + [hapiTypes.AttributeNames.EXT_TYPE]: extPoint, + [hapiTypes.AttributeNames.HAPI_TYPE]: hapiTypes.HapiLayerType.EXT, + [hapiTypes.AttributeNames.PLUGIN_NAME]: pluginName + }, + name: `${pluginName}: ${baseName}` + }; + } + return { + attributes: { + [hapiTypes.AttributeNames.EXT_TYPE]: extPoint, + [hapiTypes.AttributeNames.HAPI_TYPE]: hapiTypes.HapiLayerType.EXT + }, + name: baseName + }; +}; +function startMetadataSpan(metadata, original) { + return core.startSpan( + { + name: metadata.name, + op: `${metadata.attributes[hapiTypes.AttributeNames.HAPI_TYPE]}.hapi`, + attributes: { + ...metadata.attributes, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.orchestrion.hapi" + } + }, + original + ); +} +function wrapRouteHandler(route, pluginName) { + if (route[hapiTypes.handlerPatched] === true) return route; + route[hapiTypes.handlerPatched] = true; + const wrapHandler = (oldHandler) => { + return function(...params) { + if (!core.getActiveSpan()) { + return oldHandler.call(this, ...params); + } + setHttpServerSpanRouteAttribute(route.path); + const metadata = getRouteMetadata(route, pluginName); + return startMetadataSpan(metadata, () => oldHandler.call(this, ...params)); + }; + }; + if (typeof route.handler === "function") { + route.handler = wrapHandler(route.handler); + } else if (typeof route.options === "function") { + const oldOptions = route.options; + route.options = function(server) { + const options = oldOptions(server); + if (typeof options.handler === "function") { + options.handler = wrapHandler(options.handler); + } + return options; + }; + } else if (typeof route.options?.handler === "function") { + route.options.handler = wrapHandler(route.options.handler); + } + return route; +} +function wrapExtMethods(method, extPoint, pluginName) { + if (Array.isArray(method)) { + for (let i = 0; i < method.length; i++) { + method[i] = wrapExtMethods(method[i], extPoint); + } + return method; + } else if (isPatchableExtMethod(method)) { + if (method[hapiTypes.handlerPatched] === true) return method; + method[hapiTypes.handlerPatched] = true; + const newHandler = function(...params) { + if (!core.getActiveSpan()) { + return method.apply(this, params); + } + const metadata = getExtMetadata(extPoint, pluginName, method.name); + return startMetadataSpan(metadata, () => method.apply(void 0, params)); + }; + newHandler[hapiTypes.handlerPatched] = true; + return newHandler; + } + return method; +} +function wrapRouteArguments(args, pluginName) { + const route = args[0]; + if (Array.isArray(route)) { + for (let i = 0; i < route.length; i++) { + route[i] = wrapRouteHandler(route[i], pluginName); + } + } else { + args[0] = wrapRouteHandler(route, pluginName); + } +} +function wrapExtArguments(args, pluginName) { + if (Array.isArray(args[0])) { + const eventsList = args[0]; + for (let i = 0; i < eventsList.length; i++) { + const eventObj = eventsList[i]; + if (isLifecycleExtType(eventObj.type)) { + const lifecycleEventObj = eventObj; + const handler = wrapExtMethods(lifecycleEventObj.method, eventObj.type, pluginName); + lifecycleEventObj.method = handler; + eventsList[i] = lifecycleEventObj; + } + } + return; + } else if (isDirectExtInput(args)) { + const extInput = args; + const method = extInput[1]; + const handler = wrapExtMethods(method, extInput[0], pluginName); + args[1] = handler; + return; + } else if (isLifecycleExtEventObj(args[0])) { + const lifecycleEventObj = args[0]; + const handler = wrapExtMethods(lifecycleEventObj.method, lifecycleEventObj.type, pluginName); + lifecycleEventObj.method = handler; + } +} + +exports.getExtMetadata = getExtMetadata; +exports.getRouteMetadata = getRouteMetadata; +exports.wrapExtArguments = wrapExtArguments; +exports.wrapRouteArguments = wrapRouteArguments; +//# sourceMappingURL=hapi-utils.js.map + + +/***/ }), + +/***/ 83216: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const hapiUtils = __nccwpck_require__(44143); + +const INTEGRATION_NAME = "Hapi"; +const _hapiChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:hapi] subscribing to channels "${channels.CHANNELS.HAPI_ROUTE}" / "${channels.CHANNELS.HAPI_EXT}"`); + diagnosticsChannel.tracingChannel(channels.CHANNELS.HAPI_ROUTE).subscribe({ + start(rawCtx) { + const ctx = rawCtx; + hapiUtils.wrapRouteArguments(ctx.arguments, ctx.self?.realm?.plugin); + }, + end() { + }, + asyncStart() { + }, + asyncEnd() { + }, + error() { + } + }); + diagnosticsChannel.tracingChannel(channels.CHANNELS.HAPI_EXT).subscribe({ + start(rawCtx) { + const ctx = rawCtx; + hapiUtils.wrapExtArguments(ctx.arguments, ctx.self?.realm?.plugin); + }, + end() { + }, + asyncStart() { + }, + asyncEnd() { + }, + error() { + } + }); + } + }; +}); +const hapiChannelIntegration = core.defineIntegration(_hapiChannelIntegration); + +exports.hapiChannelIntegration = hapiChannelIntegration; +//# sourceMappingURL=hapi.js.map + + +/***/ }), + +/***/ 48453: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const redisStatementSerializer = __nccwpck_require__(57915); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "IORedis"; +const ORIGIN = "auto.db.orchestrion.redis"; +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +function getConnectionOptions(self) { + return { host: self?.options?.host, port: self?.options?.port }; +} +function connectionAttributes(host, port) { + return { + [attributes.DB_SYSTEM]: "redis", + [ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`, + [attributes.NET_PEER_NAME]: host, + [attributes.NET_PEER_PORT]: port, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }; +} +const tracedCommands = /* @__PURE__ */ new WeakSet(); +function startIORedisCommandSpan(data) { + const command = data.arguments?.[0]; + if (!command || typeof command !== "object") { + return void 0; + } + if (tracedCommands.has(command)) { + return void 0; + } + tracedCommands.add(command); + const { host, port } = getConnectionOptions(data.self); + const statement = redisStatementSerializer.defaultDbStatementSerializer(command.name, command.args ?? []); + return core.startInactiveSpan({ + name: statement, + op: "db", + attributes: { ...connectionAttributes(host, port), [attributes.DB_STATEMENT]: statement } + }); +} +const _ioredisChannelIntegration = ((options = {}) => { + const responseHook = options.responseHook; + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:ioredis] subscribing to "${channels.CHANNELS.IOREDIS_COMMAND}"/"${channels.CHANNELS.IOREDIS_CONNECT}"`); + const commandChannel = diagnosticsChannel.tracingChannel( + channels.CHANNELS.IOREDIS_COMMAND + ); + const connectChannel = diagnosticsChannel.tracingChannel( + channels.CHANNELS.IOREDIS_CONNECT + ); + core.waitForTracingChannelBinding(() => { + tracingChannel.bindTracingChannelToSpan(commandChannel, startIORedisCommandSpan, { + // ioredis' `requireParentSpan` default: only create a span under an active span. + requiresParentSpan: true, + beforeSpanEnd(span, data) { + if ("error" in data || !responseHook) { + return; + } + const command = data.arguments?.[0]; + if (command) { + runResponseHook(responseHook, span, command, data.result); + } + } + }); + tracingChannel.bindTracingChannelToSpan( + connectChannel, + (data) => { + const { host, port } = getConnectionOptions(data.self); + return core.startInactiveSpan({ + name: "connect", + op: "db", + attributes: { ...connectionAttributes(host, port), [attributes.DB_STATEMENT]: "connect" } + }); + }, + { requiresParentSpan: true } + ); + }); + } + }; +}); +function runResponseHook(hook, span, command, result) { + try { + hook(span, command.name, command.args, result); + } catch { + } +} +const ioredisChannelIntegration = core.defineIntegration(_ioredisChannelIntegration); + +exports.ioredisChannelIntegration = ioredisChannelIntegration; +exports.startIORedisCommandSpan = startIORedisCommandSpan; +//# sourceMappingURL=ioredis.js.map + + +/***/ }), + +/***/ 35485: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const semconv = __nccwpck_require__(82099); +const spans = __nccwpck_require__(49544); + +const consumerCallbackWrapped = /* @__PURE__ */ Symbol("sentry-kafkajs-consumer-callback-wrapped"); +function isWrappedConsumerCallback(fn) { + return typeof fn === "function" && fn[consumerCallbackWrapped] === true; +} +function wrapEachMessage(original) { + const wrapped = function eachMessage(payload) { + const sentryTrace = spans.getHeaderAsString(payload.message.headers, "sentry-trace"); + const baggage = spans.getHeaderAsString(payload.message.headers, "baggage"); + return core.continueTrace({ sentryTrace, baggage }, () => { + const span = spans.startConsumerSpan({ + topic: payload.topic, + message: payload.message, + operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS, + attributes: { + [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition) + } + }); + const promise = core.withActiveSpan(span, () => original.call(this, payload)); + return spans.endSpansOnPromise([span], promise); + }); + }; + wrapped[consumerCallbackWrapped] = true; + return wrapped; +} +function wrapEachBatch(original) { + const wrapped = function eachBatch(payload) { + const receivingSpan = core.startNewTrace( + () => spans.startConsumerSpan({ + topic: payload.batch.topic, + message: void 0, + operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE, + attributes: { + [attributes.MESSAGING_BATCH_MESSAGE_COUNT]: payload.batch.messages.length, + [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition) + } + }) + ); + return core.withActiveSpan(receivingSpan, () => { + const spans$1 = [receivingSpan]; + payload.batch.messages.forEach((message) => { + spans$1.push( + spans.startConsumerSpan({ + topic: payload.batch.topic, + message, + operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS, + links: spans.getLinksFromHeaders(message.headers), + attributes: { + [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition) + } + }) + ); + }); + const promise = original.call(this, payload); + return spans.endSpansOnPromise(spans$1, promise); + }); + }; + wrapped[consumerCallbackWrapped] = true; + return wrapped; +} + +exports.isWrappedConsumerCallback = isWrappedConsumerCallback; +exports.wrapEachBatch = wrapEachBatch; +exports.wrapEachMessage = wrapEachMessage; +//# sourceMappingURL=consumer.js.map + + +/***/ }), + +/***/ 46810: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const consumer = __nccwpck_require__(35485); +const spans = __nccwpck_require__(49544); + +const INTEGRATION_NAME = "Kafka"; +function subscribeToProducer() { + const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.KAFKAJS_SEND_BATCH); + const subscribers = { + start(ctx) { + const spans$1 = []; + (ctx.arguments[0]?.topicMessages ?? []).forEach((topicMessage) => { + topicMessage.messages.forEach((message) => { + spans$1.push(spans.startProducerSpan(topicMessage.topic, message)); + }); + }); + ctx._sentrySpans = spans$1; + }, + error(ctx) { + if (ctx._sentrySpans) { + spans.applyErrorToSpans(ctx._sentrySpans, ctx.error); + } + }, + asyncEnd(ctx) { + ctx._sentrySpans?.forEach((span) => span.end()); + } + }; + channel.subscribe(subscribers); +} +function subscribeToConsumer() { + const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.KAFKAJS_CONSUMER_RUN); + const subscribers = { + start(ctx) { + const config = ctx.arguments[0]; + if (!config || typeof config !== "object") { + return; + } + if (typeof config.eachMessage === "function" && !consumer.isWrappedConsumerCallback(config.eachMessage)) { + config.eachMessage = consumer.wrapEachMessage(config.eachMessage); + } + if (typeof config.eachBatch === "function" && !consumer.isWrappedConsumerCallback(config.eachBatch)) { + config.eachBatch = consumer.wrapEachBatch(config.eachBatch); + } + } + }; + channel.subscribe(subscribers); +} +const _kafkajsChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log( + `[orchestrion:kafkajs] subscribing to channels "${channels.CHANNELS.KAFKAJS_SEND_BATCH}", "${channels.CHANNELS.KAFKAJS_CONSUMER_RUN}"` + ); + subscribeToProducer(); + subscribeToConsumer(); + } + }; +}); +const kafkajsChannelIntegration = core.defineIntegration(_kafkajsChannelIntegration); + +exports.kafkajsChannelIntegration = kafkajsChannelIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 82099: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const ATTR_MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id"; +const ATTR_MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key"; +const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone"; +const ATTR_MESSAGING_KAFKA_OFFSET = "messaging.kafka.offset"; +const MESSAGING_OPERATION_TYPE_VALUE_PROCESS = "process"; +const MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = "receive"; +const MESSAGING_OPERATION_TYPE_VALUE_SEND = "send"; +const MESSAGING_SYSTEM_VALUE_KAFKA = "kafka"; +const ERROR_TYPE_VALUE_OTHER = "_OTHER"; + +exports.ATTR_MESSAGING_DESTINATION_PARTITION_ID = ATTR_MESSAGING_DESTINATION_PARTITION_ID; +exports.ATTR_MESSAGING_KAFKA_MESSAGE_KEY = ATTR_MESSAGING_KAFKA_MESSAGE_KEY; +exports.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE; +exports.ATTR_MESSAGING_KAFKA_OFFSET = ATTR_MESSAGING_KAFKA_OFFSET; +exports.ERROR_TYPE_VALUE_OTHER = ERROR_TYPE_VALUE_OTHER; +exports.MESSAGING_OPERATION_TYPE_VALUE_PROCESS = MESSAGING_OPERATION_TYPE_VALUE_PROCESS; +exports.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = MESSAGING_OPERATION_TYPE_VALUE_RECEIVE; +exports.MESSAGING_OPERATION_TYPE_VALUE_SEND = MESSAGING_OPERATION_TYPE_VALUE_SEND; +exports.MESSAGING_SYSTEM_VALUE_KAFKA = MESSAGING_SYSTEM_VALUE_KAFKA; +//# sourceMappingURL=semconv.js.map + + +/***/ }), + +/***/ 49544: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const semconv = __nccwpck_require__(82099); + +const PRODUCER_ORIGIN = "auto.kafkajs.orchestrion.producer"; +const CONSUMER_ORIGIN = "auto.kafkajs.orchestrion.consumer"; +const TRACE_FLAG_SAMPLED = 1; +const TRACE_FLAG_NONE = 0; +function getHeaderAsString(headers, key) { + const value = headers?.[key]; + if (value == null) { + return void 0; + } + return Array.isArray(value) ? value[0]?.toString() : value.toString(); +} +function getLinksFromHeaders(headers) { + const sentryTrace = getHeaderAsString(headers, "sentry-trace"); + if (!sentryTrace) { + return void 0; + } + const { traceId, parentSpanId, sampled } = core.propagationContextFromHeaders( + sentryTrace, + getHeaderAsString(headers, "baggage") + ); + if (!parentSpanId) { + return void 0; + } + return [ + { + context: { + traceId, + spanId: parentSpanId, + isRemote: true, + traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE + } + } + ]; +} +function startConsumerSpan({ topic, message, operationType, links, attributes: attributes$1 }) { + const operationName = operationType === semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? "poll" : operationType; + return core.startInactiveSpan({ + name: `${operationName} ${topic}`, + // todo(v11): Use https://getsentry.github.io/sentry-conventions/ops/#messaging + op: "message", + kind: operationType === semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? core.SPAN_KIND.CLIENT : core.SPAN_KIND.CONSUMER, + links, + attributes: { + ...attributes$1, + [attributes.MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA, + [attributes.MESSAGING_DESTINATION_NAME]: topic, + [attributes.MESSAGING_OPERATION_TYPE]: operationType, + [attributes.MESSAGING_OPERATION_NAME]: operationName, + [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message?.key ? String(message.key) : void 0, + [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message?.key && message.value === null ? true : void 0, + [semconv.ATTR_MESSAGING_KAFKA_OFFSET]: message?.offset, + // Mirror the upstream behavior of only tagging per-message processing spans (not the batch + // receiving span, which carries no message) with the auto origin. + ...message ? { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: CONSUMER_ORIGIN } : {} + } + }); +} +function startProducerSpan(topic, message) { + const span = core.startInactiveSpan({ + name: `send ${topic}`, + op: "message", + kind: core.SPAN_KIND.PRODUCER, + attributes: { + [attributes.MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA, + [attributes.MESSAGING_DESTINATION_NAME]: topic, + [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message.key ? String(message.key) : void 0, + [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message.key && message.value === null ? true : void 0, + [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: message.partition !== void 0 ? String(message.partition) : void 0, + [attributes.MESSAGING_OPERATION_NAME]: "send", + [attributes.MESSAGING_OPERATION_TYPE]: semconv.MESSAGING_OPERATION_TYPE_VALUE_SEND, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRODUCER_ORIGIN + } + }); + message.headers = message.headers ?? {}; + const traceData = core.getTraceData({ span }); + if (traceData["sentry-trace"]) { + message.headers["sentry-trace"] = traceData["sentry-trace"]; + } + if (traceData.baggage) { + message.headers["baggage"] = traceData.baggage; + } + return span; +} +function applyErrorToSpans(spans, reason) { + let errorMessage; + let errorType = semconv.ERROR_TYPE_VALUE_OTHER; + if (typeof reason === "string" || reason === void 0) { + errorMessage = reason; + } else if (typeof reason === "object" && reason !== null && Object.prototype.hasOwnProperty.call(reason, "message")) { + errorMessage = reason.message; + errorType = reason.constructor.name; + } + spans.forEach((span) => { + span.setAttribute(attributes.ERROR_TYPE, errorType); + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: errorMessage }); + }); +} +function endSpansOnPromise(spans, promise) { + return Promise.resolve(promise).catch((reason) => { + applyErrorToSpans(spans, reason); + throw reason; + }).finally(() => { + spans.forEach((span) => span.end()); + }); +} + +exports.applyErrorToSpans = applyErrorToSpans; +exports.endSpansOnPromise = endSpansOnPromise; +exports.getHeaderAsString = getHeaderAsString; +exports.getLinksFromHeaders = getLinksFromHeaders; +exports.startConsumerSpan = startConsumerSpan; +exports.startProducerSpan = startProducerSpan; +//# sourceMappingURL=spans.js.map + + +/***/ }), + +/***/ 68060: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Knex"; +const ORIGIN = "auto.db.orchestrion.knex"; +const MAX_QUERY_LENGTH = 1021; +const ATTR_DB_SQL_TABLE = "db.sql.table"; +const DB_SYSTEM_SQLITE = "sqlite"; +const DB_SYSTEM_POSTGRESQL = "postgresql"; +const parentSpanSymbol = /* @__PURE__ */ Symbol("sentry.orchestrion.knex.parent-span"); +const _knexChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:knex] subscribing to channel "${channels.CHANNELS.KNEX_QUERY}"`); + core.waitForTracingChannelBinding(() => { + subscribeBuilder(channels.CHANNELS.KNEX_QUERY_BUILDER); + subscribeBuilder(channels.CHANNELS.KNEX_SCHEMA_BUILDER); + subscribeBuilder(channels.CHANNELS.KNEX_RAW); + subscribeQuery(); + }); + } + }; +}); +function subscribeBuilder(channelName) { + diagnosticsChannel.tracingChannel(channelName).end.subscribe((message) => { + const builder = message.result; + if (!builder || typeof builder !== "object" || parentSpanSymbol in builder) { + return; + } + const activeSpan = core.getActiveSpan(); + if (!activeSpan) { + return; + } + Object.defineProperty(builder, parentSpanSymbol, { value: activeSpan }); + }); +} +function subscribeQuery() { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.KNEX_QUERY), + (data) => { + const runner = data.self; + const builder = runner?.builder; + const parentSpan = builder?.[parentSpanSymbol] ?? core.getActiveSpan(); + if (!parentSpan) { + return void 0; + } + const query = data.arguments[0]; + const client = runner?.client; + const connection = client?.config?.connection; + const connectionString = connection?.connectionString; + const table = extractTableName(builder); + const operation = query?.method; + const name = connection?.filename || connection?.database || extractDatabaseFromConnectionString(connectionString); + const attributes$1 = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + "knex.version": data.moduleVersion, + [attributes.DB_SYSTEM]: mapSystem(client?.driverName), + [ATTR_DB_SQL_TABLE]: table, + [attributes.DB_OPERATION]: operation, + [attributes.DB_USER]: connection?.user, + [attributes.DB_NAME]: name, + [attributes.NET_PEER_NAME]: connection?.host ?? extractHostFromConnectionString(connectionString), + [attributes.NET_PEER_PORT]: connection?.port ?? extractPortFromConnectionString(connectionString), + [attributes.NET_TRANSPORT]: connection?.filename === ":memory:" ? "inproc" : void 0, + [attributes.DB_STATEMENT]: query?.sql != null ? core.truncate(query.sql, MAX_QUERY_LENGTH) : void 0 + }; + return core.startInactiveSpan({ + name: getName(name, operation, table) ?? "knex.query", + kind: core.SPAN_KIND.CLIENT, + op: "db", + parentSpan, + attributes: attributes$1 + }); + }, + { + beforeSpanEnd(span, data) { + if ("error" in data) { + const message = cleanErrorMessage(data); + if (message !== void 0) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message }); + } + } + } + } + ); +} +function cleanErrorMessage(data) { + const error = data.error; + if (!error || typeof error !== "object" || typeof error.message !== "string") { + return void 0; + } + const rawMessage = error.message; + const query = data.arguments[0]; + if (!query?.sql) { + return rawMessage; + } + try { + const formatter = getFormatter(data.self); + const fullQuery = formatter(query.sql, query.bindings || []); + return rawMessage.replace(`${fullQuery} - `, ""); + } catch { + return rawMessage; + } +} +function getFormatter(runner) { + if (runner) { + const client = runner.client; + if (client) { + if (client._formatQuery) { + return client._formatQuery.bind(client); + } else if (client.SqlString) { + return client.SqlString.format.bind(client.SqlString); + } + } + if (runner.builder?.toString) { + return runner.builder.toString.bind(runner.builder); + } + } + return () => ""; +} +function mapSystem(driverName) { + if (driverName === "sqlite3") { + return DB_SYSTEM_SQLITE; + } + if (driverName === "pg") { + return DB_SYSTEM_POSTGRESQL; + } + return driverName; +} +function getName(db, operation, table) { + if (operation && db) { + return table ? `${operation} ${db}.${table}` : `${operation} ${db}`; + } + return db; +} +function extractTableName(builder) { + const table = builder?._single?.table; + if (table && typeof table === "object") { + return extractTableName(table); + } + return typeof table === "string" ? table : void 0; +} +function extractDatabaseFromConnectionString(connectionString) { + if (!connectionString) { + return void 0; + } + try { + const db = new URL(connectionString).pathname?.replace(/^\//, ""); + return db || void 0; + } catch { + return void 0; + } +} +function extractHostFromConnectionString(connectionString) { + if (!connectionString) { + return void 0; + } + try { + return new URL(connectionString).hostname || void 0; + } catch { + return void 0; + } +} +function extractPortFromConnectionString(connectionString) { + if (!connectionString) { + return void 0; + } + try { + const port = new URL(connectionString).port; + return port ? parseInt(port, 10) : void 0; + } catch { + return void 0; + } +} +const knexChannelIntegration = core.defineIntegration(_knexChannelIntegration); + +exports.knexChannelIntegration = knexChannelIntegration; +//# sourceMappingURL=knex.js.map + + +/***/ }), + +/***/ 38679: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); + +const INTEGRATION_NAME = "Koa"; +const ORIGIN = "auto.http.orchestrion.koa"; +const LAYER_TYPE = { + ROUTER: "router", + MIDDLEWARE: "middleware" +}; +const kLayerPatched = /* @__PURE__ */ Symbol("sentry.koa.layer-patched"); +let subscribed = false; +const _koaChannelIntegration = ((options = {}) => { + const ignoreLayersType = options.ignoreLayersType ?? []; + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel || subscribed) { + return; + } + subscribed = true; + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:koa] subscribing to channel "${channels.CHANNELS.KOA_USE}"`); + diagnosticsChannel.tracingChannel(channels.CHANNELS.KOA_USE).subscribe({ + start(rawCtx) { + handleUse(rawCtx, ignoreLayersType); + }, + end() { + }, + asyncStart() { + }, + asyncEnd() { + }, + error() { + } + }); + } + }; +}); +function handleUse(ctx, ignoreLayersType) { + const middleware = ctx.arguments[0]; + if (typeof middleware === "function") { + ctx.arguments[0] = patchUse(middleware, ignoreLayersType); + } +} +function patchUse(middleware, ignoreLayersType) { + return middleware.router ? patchRouterDispatch(middleware, ignoreLayersType) : patchLayer(middleware, false, ignoreLayersType); +} +function patchRouterDispatch(dispatchLayer, ignoreLayersType) { + const router = dispatchLayer.router; + const routesStack = router?.stack ?? []; + for (const pathLayer of routesStack) { + const path = pathLayer.path; + const pathStack = pathLayer.stack; + pathStack.forEach((routedMiddleware, j) => { + pathStack[j] = patchLayer(routedMiddleware, true, ignoreLayersType, path); + }); + } + return dispatchLayer; +} +function patchLayer(middlewareLayer, isRouter, ignoreLayersType, layerPath) { + const layerType = isRouter ? LAYER_TYPE.ROUTER : LAYER_TYPE.MIDDLEWARE; + if (middlewareLayer[kLayerPatched] === true || ignoreLayersType.includes(layerType)) { + return middlewareLayer; + } + if (middlewareLayer.constructor.name === "GeneratorFunction" || middlewareLayer.constructor.name === "AsyncGeneratorFunction") { + return middlewareLayer; + } + middlewareLayer[kLayerPatched] = true; + return (context, next) => { + if (!core.getActiveSpan()) { + return middlewareLayer(context, next); + } + const metadata = getMiddlewareMetadata(context, middlewareLayer, isRouter, layerPath); + if (context._matchedRoute) { + setHttpServerSpanRouteAttribute(context._matchedRoute.toString()); + } + const koaName = metadata.attributes[attributes.KOA_NAME]; + const name = typeof koaName === "string" ? koaName || "< unknown >" : metadata.name; + return core.startSpan( + { + name, + op: `${layerType}.koa`, + attributes: { + ...metadata.attributes, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + } + }, + () => { + const route = metadata.attributes[attributes.HTTP_ROUTE]; + if (core.getIsolationScope() === core.getDefaultIsolationScope()) { + debugBuild.DEBUG_BUILD && core.debug.warn("Isolation scope is default isolation scope - skipping setting transactionName"); + } else if (route) { + const method = context.request?.method?.toUpperCase() || "GET"; + core.getIsolationScope().setTransactionName(`${method} ${route}`); + } + return middlewareLayer(context, next); + } + ); + }; +} +function getMiddlewareMetadata(context, layer, isRouter, layerPath) { + if (isRouter) { + return { + attributes: { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.KOA_NAME]: layerPath?.toString(), + // TODO(v11): remove, replaced by http.route + [attributes.KOA_TYPE]: LAYER_TYPE.ROUTER, + [attributes.HTTP_ROUTE]: layerPath?.toString() + }, + name: context._matchedRouteName || `router - ${layerPath}` + }; + } + return { + attributes: { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.KOA_NAME]: layer.name || "middleware", + // TODO(v11): remove, replaced by code.function.name + [attributes.KOA_TYPE]: LAYER_TYPE.MIDDLEWARE, + [attributes.CODE_FUNCTION_NAME]: layer.name || "middleware" + }, + name: `middleware - ${layer.name}` + }; +} +function setHttpServerSpanRouteAttribute(route) { + const activeSpan = core.getActiveSpan(); + if (!activeSpan) { + return; + } + const rootSpan = core.getRootSpan(activeSpan); + if (!rootSpan) { + return; + } + if (core.spanToJSON(rootSpan).data[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] !== "http.server") { + return; + } + rootSpan.setAttribute(attributes.HTTP_ROUTE, route); +} +const koaChannelIntegration = core.defineIntegration(_koaChannelIntegration); + +exports.koaChannelIntegration = koaChannelIntegration; +//# sourceMappingURL=koa.js.map + + +/***/ }), + +/***/ 10304: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const langchain = __nccwpck_require__(84153); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = core.LANGCHAIN_INTEGRATION_NAME; +const SKIPPED_PROVIDERS = [core.OPENAI_INTEGRATION_NAME, core.ANTHROPIC_AI_INTEGRATION_NAME, core.GOOGLE_GENAI_INTEGRATION_NAME]; +let subscribed = false; +function markProvidersSkipped() { + core._INTERNAL_skipAiProviderWrapping(SKIPPED_PROVIDERS); +} +const _langChainChannelIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel || subscribed) { + return; + } + subscribed = true; + const sentryHandler = core.createLangChainCallbackHandler(options); + const injectHandler = (message) => { + markProvidersSkipped(); + const args = message.arguments; + if (!Array.isArray(args)) { + return; + } + let callOptions = args[1]; + if (!callOptions || typeof callOptions !== "object" || Array.isArray(callOptions)) { + callOptions = {}; + args[1] = callOptions; + } + callOptions.callbacks = core._INTERNAL_mergeLangChainCallbackHandler(callOptions.callbacks, sentryHandler); + }; + for (const channelName of [channels.CHANNELS.LANGCHAIN_CHAT_MODEL_INVOKE, channels.CHANNELS.LANGCHAIN_CHAT_MODEL_STREAM]) { + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:langchain] subscribing to channel "${channelName}"`); + diagnosticsChannel.tracingChannel(channelName).start.subscribe(injectHandler); + } + core.waitForTracingChannelBinding(() => { + for (const channelName of langchain.langchainEmbeddingsChannels) { + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:langchain] subscribing to channel "${channelName}"`); + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channelName), + (data) => createEmbeddingsSpan(data, options), + { captureError: () => ({ mechanism: { handled: false, type: "auto.ai.langchain" } }) } + ); + } + }); + } + }; +}); +function createEmbeddingsSpan(data, options) { + markProvidersSkipped(); + const input = (data.arguments ?? [])[0]; + return core.startInactiveSpan(core._INTERNAL_getLangChainEmbeddingsSpanOptions(data.self, input, options)); +} +const langChainChannelIntegration = core.defineIntegration(_langChainChannelIntegration); + +exports.langChainChannelIntegration = langChainChannelIntegration; +//# sourceMappingURL=langchain.js.map + + +/***/ }), + +/***/ 24129: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = core.LANGGRAPH_INTEGRATION_NAME; +let subscribed = false; +let insideCreateReactAgent = false; +const _langGraphChannelIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel || subscribed) { + return; + } + subscribed = true; + const resolvedOptions = core.resolveAIRecordingOptions(options); + const sentryHandler = core.createLangChainCallbackHandler(resolvedOptions); + core.waitForTracingChannelBinding(() => { + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:langgraph] subscribing to channel "${channels.CHANNELS.LANGGRAPH_STATE_GRAPH_COMPILE}"`); + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.LANGGRAPH_STATE_GRAPH_COMPILE), + (data) => { + if (insideCreateReactAgent) { + return void 0; + } + const compileOptions = getFirstArgObject(data.arguments); + const name = typeof compileOptions?.name === "string" ? compileOptions.name : void 0; + return core.startInactiveSpan(core._INTERNAL_getLangGraphCreateAgentSpanOptions(name)); + }, + { + beforeSpanEnd: (_span, data) => { + wrapCompiledGraphInvoke( + data.result, + getFirstArgObject(data.arguments) ?? {}, + resolvedOptions, + null, + sentryHandler + ); + } + } + ); + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:langgraph] subscribing to channel "${channels.CHANNELS.LANGGRAPH_CREATE_REACT_AGENT}"`); + const reactAgentChannel = diagnosticsChannel.tracingChannel( + channels.CHANNELS.LANGGRAPH_CREATE_REACT_AGENT + ); + reactAgentChannel.start.subscribe((message) => { + insideCreateReactAgent = true; + try { + const { arguments: args } = message; + const params = getFirstArgObject(args); + if (params && Array.isArray(params.tools) && params.tools.length > 0) { + core.wrapToolsWithSpans(params.tools, resolvedOptions, core.extractAgentNameFromParams(args) ?? void 0); + } + } catch (error) { + debugBuild.DEBUG_BUILD && core.debug.error("[orchestrion:langgraph] failed to wrap createReactAgent tools", error); + } + }); + reactAgentChannel.end.subscribe((message) => { + insideCreateReactAgent = false; + const { arguments: args, result } = message; + const agentName = core.extractAgentNameFromParams(args) ?? void 0; + const compileOptions = agentName ? { name: agentName } : {}; + wrapCompiledGraphInvoke(result, compileOptions, resolvedOptions, core.extractLLMFromParams(args), sentryHandler); + }); + reactAgentChannel.error.subscribe(() => { + insideCreateReactAgent = false; + }); + }); + } + }; +}); +function getFirstArgObject(args) { + const first = (args ?? [])[0]; + return typeof first === "object" && first !== null ? first : void 0; +} +function wrapCompiledGraphInvoke(graph, compileOptions, options, llm, sentryHandler) { + if (!graph || typeof graph !== "object") { + return; + } + const compiledGraph = graph; + const originalInvoke = compiledGraph.invoke; + if (typeof originalInvoke === "function") { + compiledGraph.invoke = core.instrumentCompiledGraphInvoke( + originalInvoke.bind(compiledGraph), + compiledGraph, + compileOptions, + options, + llm, + sentryHandler + ); + } +} +const langGraphChannelIntegration = core.defineIntegration(_langGraphChannelIntegration); + +exports.langGraphChannelIntegration = langGraphChannelIntegration; +//# sourceMappingURL=langgraph.js.map + + +/***/ }), + +/***/ 38465: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "LruMemoizer"; +const _lruMemoizerChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:lru-memoizer] subscribing to channel "${channels.CHANNELS.LRU_MEMOIZER_LOAD}"`); + core.waitForTracingChannelBinding(() => { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.LRU_MEMOIZER_LOAD), + // We only want the helper's caller-context restore for the callback lru-memoizer fires from a detached `setImmediate`. + () => void 0 + ); + }); + } + }; +}); +const lruMemoizerChannelIntegration = core.defineIntegration(_lruMemoizerChannelIntegration); + +exports.lruMemoizerChannelIntegration = lruMemoizerChannelIntegration; +//# sourceMappingURL=lru-memoizer.js.map + + +/***/ }), + +/***/ 66394: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const mongodbSpan = __nccwpck_require__(68095); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Mongo"; +const ORIGIN = "auto.db.orchestrion.mongo"; +const V3_DEDICATED_COMMANDS = /* @__PURE__ */ new Set(["insert", "update", "delete", "find", "getMore", "killCursors"]); +const _mongodbChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + subscribeV4Command(); + subscribeV4Checkout(); + subscribeV3Wireprotocol(); + }); + } + }; +}); +function subscribeV4Command() { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.MONGODB_COMMAND), + (data) => { + const args = data.arguments ?? []; + const ns = args[0]; + const cmd = args[1]; + if (!ns || !cmd || typeof cmd !== "object" || cmd.ismaster || cmd.hello) { + return void 0; + } + const operation = Object.keys(cmd)[0]; + return mongodbSpan.startMongoSpan(mongodbSpan.getV4SpanAttributes(data.self, ns, cmd, operation, ORIGIN)); + }, + // Matches otel's `shouldSkipInstrumentation`: only trace when there is + // an active parent span, to avoid emitting orphaned mongodb spans. + { requiresParentSpan: true } + ); +} +function subscribeV4Checkout() { + tracingChannel.bindTracingChannelToSpan(diagnosticsChannel.tracingChannel(channels.CHANNELS.MONGODB_CHECKOUT), () => void 0); +} +function subscribeV3Wireprotocol() { + for (const operation of ["insert", "update", "remove"]) { + const channel = operation === "insert" ? channels.CHANNELS.MONGODB_V3_INSERT : operation === "update" ? channels.CHANNELS.MONGODB_V3_UPDATE : channels.CHANNELS.MONGODB_V3_REMOVE; + bindV3(channel, (args) => ({ + topology: args[0], + ns: args[1], + command: args[2]?.[0], + operation + })); + } + bindV3(channels.CHANNELS.MONGODB_V3_COMMAND, (args) => { + const command = args[2]; + const type = command ? Object.keys(command)[0] : void 0; + if (type && V3_DEDICATED_COMMANDS.has(type)) { + return void 0; + } + return { + topology: args[0], + ns: args[1], + command, + operation: command ? mongodbSpan.getV3CommandOperation(command) : void 0 + }; + }); + bindV3(channels.CHANNELS.MONGODB_V3_QUERY, (args) => ({ + topology: args[0], + ns: args[1], + command: args[2], + operation: "find" + })); + bindV3(channels.CHANNELS.MONGODB_V3_GET_MORE, (args) => ({ + topology: args[0], + ns: args[1], + command: args[2]?.cmd, + operation: "getMore" + })); +} +function bindV3(channelName, extract) { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channelName), + (data) => { + const args = data.arguments; + if (!args) { + return void 0; + } + const info = extract(args); + if (!info || typeof info.ns !== "string") { + return void 0; + } + return mongodbSpan.startMongoSpan(mongodbSpan.getV3SpanAttributes(info.ns, info.topology, info.command, info.operation, ORIGIN)); + }, + { requiresParentSpan: true } + ); +} +const mongodbChannelIntegration = core.defineIntegration(_mongodbChannelIntegration); + +exports.mongodbChannelIntegration = mongodbChannelIntegration; +//# sourceMappingURL=mongodb.js.map + + +/***/ }), + +/***/ 57377: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const mongooseDcSubscriber = __nccwpck_require__(54426); +const mongooseLegacySpan = __nccwpck_require__(21385); +const channels = __nccwpck_require__(64252); +const mongoose = __nccwpck_require__(93876); +const debugBuild = __nccwpck_require__(64112); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Mongoose"; +const ORIGIN = "auto.db.orchestrion.mongoose"; +const STORED_PARENT_SPAN = /* @__PURE__ */ new WeakMap(); +let orchestrionSubscribed = false; +const _mongooseChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + mongooseDcSubscriber.subscribeMongooseDiagnosticChannels(diagnosticsChannel.tracingChannel); + subscribeOrchestrionMongooseChannels(); + }); + } + }; +}); +function subscribeOrchestrionMongooseChannels() { + if (orchestrionSubscribed) { + return; + } + orchestrionSubscribed = true; + debugBuild.DEBUG_BUILD && core.debug.log("[orchestrion:mongoose] subscribing to injected channels"); + for (const channelName of mongoose.MONGOOSE_CONTEXT_CAPTURE_CHANNELS) { + channel(channelName).subscribe({ + start(message) { + stashParentSpan(message.self); + } + }); + } + channel(channels.CHANNELS.MONGOOSE_MODEL_AGGREGATE).subscribe({ + end(message) { + const result = message.result; + if (result && typeof result === "object") { + stashParentSpan(result); + } + } + }); + bindExecSpan(channels.CHANNELS.MONGOOSE_QUERY_EXEC, (self) => { + const query = self; + return startSpan( + query.mongooseCollection, + query.model?.modelName, + query.op ?? "exec", + STORED_PARENT_SPAN.get(self) + ); + }); + bindExecSpan(channels.CHANNELS.MONGOOSE_AGGREGATE_EXEC, (self) => { + const model = self._model; + return startSpan(model?.collection, model?.modelName, "aggregate", STORED_PARENT_SPAN.get(self)); + }); + bindExecSpan(channels.CHANNELS.MONGOOSE_MODEL_SAVE, (self) => { + const ctor = self.constructor; + return startSpan(ctor.collection, ctor.modelName, "save"); + }); + bindExecSpan(channels.CHANNELS.MONGOOSE_MODEL_REMOVE, (self) => { + const ctor = self.constructor; + return startSpan(ctor.collection, ctor.modelName, "remove"); + }); + bindExecSpan(channels.CHANNELS.MONGOOSE_MODEL_INSERT_MANY, (self) => { + const model = self; + return startSpan(model.collection, model.modelName, "insertMany"); + }); + bindExecSpan(channels.CHANNELS.MONGOOSE_MODEL_BULK_WRITE, (self) => { + const model = self; + return startSpan(model.collection, model.modelName, "bulkWrite"); + }); +} +function startSpan(collection, modelName, operation, parentSpan) { + return mongooseLegacySpan.startMongooseLegacySpan({ collection, modelName, operation, origin: ORIGIN, parentSpan }); +} +function channel(channelName) { + return diagnosticsChannel.tracingChannel( + channelName + ); +} +function bindExecSpan(channelName, getSpan) { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channelName), + (data) => { + const self = data.self; + if (!self) { + return void 0; + } + return getSpan(self); + } + ); +} +function stashParentSpan(self) { + const active = core.getActiveSpan(); + if (self && active) { + STORED_PARENT_SPAN.set(self, active); + } +} +const mongooseChannelIntegration = core.defineIntegration(_mongooseChannelIntegration); + +exports.mongooseChannelIntegration = mongooseChannelIntegration; +//# sourceMappingURL=mongoose.js.map + + +/***/ }), + +/***/ 84664: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Mysql"; +const ATTR_DB_SYSTEM = "db.system"; +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +const ATTR_DB_NAME = "db.name"; +const ATTR_DB_USER = "db.user"; +const ATTR_DB_STATEMENT = "db.statement"; +const ATTR_NET_PEER_NAME = "net.peer.name"; +const ATTR_NET_PEER_PORT = "net.peer.port"; +const _mysqlChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:mysql] subscribing to channel "${channels.CHANNELS.MYSQL_QUERY}"`); + core.waitForTracingChannelBinding(() => { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.MYSQL_QUERY), + (data) => { + const sql = extractSql(data.arguments[0]); + const { host, port, database, user } = getConnectionConfig(data.self); + const portNumber = typeof port === "string" ? parseInt(port, 10) : port; + const portIsNumber = typeof portNumber === "number" && !isNaN(portNumber); + data._sentryCallerScope = core.getCurrentScope(); + return core.startInactiveSpan({ + name: sql ?? "mysql.query", + kind: core.SPAN_KIND.CLIENT, + op: "db", + attributes: { + [ATTR_DB_SYSTEM]: "mysql", + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.orchestrion.mysql", + [ATTR_DB_CONNECTION_STRING]: getJDBCString(host, portIsNumber ? portNumber : void 0, database), + ...database ? { [ATTR_DB_NAME]: database } : {}, + ...user ? { [ATTR_DB_USER]: user } : {}, + ...sql ? { [ATTR_DB_STATEMENT]: sql } : {}, + ...host ? { [ATTR_NET_PEER_NAME]: host } : {}, + ...portIsNumber ? { [ATTR_NET_PEER_PORT]: portNumber } : {} + } + }); + }, + { + // No-callback `query(sql)` returns a streamable `Query` emitter as `result`; it settles on the + // emitter's `'end'`/`'error'`, not the channel, so defer ending to those. + deferSpanEnd({ data, end }) { + const result = data.result; + if (!result || typeof result !== "object" || !hasOnMethod(result)) { + return false; + } + const callerScope = data._sentryCallerScope; + if (callerScope) { + core.bindScopeToEmitter(result, callerScope); + } + result.on("error", (err) => end(err)); + result.on("end", () => end()); + return true; + } + } + ); + }); + } + }; +}); +function hasOnMethod(obj) { + return "on" in obj && typeof obj.on === "function"; +} +function extractSql(firstArg) { + if (typeof firstArg === "string") { + return firstArg; + } + if (core.isObjectLike(firstArg) && "sql" in firstArg) { + const sql = firstArg.sql; + return typeof sql === "string" ? sql : void 0; + } + return void 0; +} +function getConnectionConfig(connection) { + const config = connection?.config?.connectionConfig ?? connection?.config ?? {}; + return { + host: config.host, + port: config.port, + database: config.database, + user: config.user + }; +} +function getJDBCString(host, port, database) { + let s = `jdbc:mysql://${host || "localhost"}`; + if (typeof port === "number") { + s += `:${port}`; + } + if (database) { + s += `/${database}`; + } + return s; +} +const mysqlChannelIntegration = core.defineIntegration(_mysqlChannelIntegration); + +exports.mysqlChannelIntegration = mysqlChannelIntegration; +//# sourceMappingURL=mysql.js.map + + +/***/ }), + +/***/ 53764: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const mysql2DcSubscriber = __nccwpck_require__(59178); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); +const attributes = __nccwpck_require__(88264); + +const INTEGRATION_NAME = "Mysql2"; +const ORIGIN = "auto.db.orchestrion.mysql2"; +const DB_SYSTEM_VALUE_MYSQL = "mysql"; +function instrumentMysql2() { + mysql2DcSubscriber.subscribeMysql2DiagnosticChannels(diagnosticsChannel.tracingChannel); + subscribeQueryChannel(channels.CHANNELS.MYSQL2_QUERY); + subscribeQueryChannel(channels.CHANNELS.MYSQL2_EXECUTE); +} +function subscribeQueryChannel(channelName) { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channelName), + (data) => { + const statement = getQueryText(data.arguments); + return core.startInactiveSpan({ + name: statement ?? "mysql2.query", + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db", + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_SYSTEM]: DB_SYSTEM_VALUE_MYSQL, + ...getConnectionAttributes(data.self?.config), + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_STATEMENT]: statement || void 0 + } + }); + }, + { requiresParentSpan: true } + ); +} +function getQueryText(args) { + return extractSql(args[0]); +} +function extractSql(firstArg) { + if (typeof firstArg === "string") { + return firstArg; + } + if (core.isObjectLike(firstArg) && "sql" in firstArg) { + const sql = firstArg.sql; + return typeof sql === "string" ? sql : void 0; + } + return void 0; +} +function getConnectionAttributes(config) { + const { host, port, database, user } = config?.connectionConfig ?? config ?? {}; + const portNumber = typeof port === "string" ? parseInt(port, 10) : port; + const portIsNumber = typeof portNumber === "number" && !isNaN(portNumber); + return { + // oxlint-disable-next-line typescript/no-deprecated + [attributes.DB_NAME]: database || void 0, + [attributes.DB_USER]: user || void 0, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_NAME]: host || void 0, + // oxlint-disable-next-line typescript/no-deprecated + [attributes.NET_PEER_PORT]: portIsNumber ? portNumber : void 0 + }; +} +const _mysql2ChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + instrumentMysql2(); + }); + } + }; +}); +const mysql2ChannelIntegration = core.defineIntegration(_mysql2ChannelIntegration); + +exports.mysql2ChannelIntegration = mysql2ChannelIntegration; +//# sourceMappingURL=mysql2.js.map + + +/***/ }), + +/***/ 26102: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "OpenAI"; +const ORIGIN = "auto.ai.orchestrion.openai"; +const INSTRUMENTED_CHANNELS = [ + { channel: channels.CHANNELS.OPENAI_CHAT, operation: "chat" }, + { channel: channels.CHANNELS.OPENAI_EMBEDDINGS, operation: "embeddings" } +]; +let subscribed = false; +const _openaiChannelIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel || subscribed) { + return; + } + subscribed = true; + core.waitForTracingChannelBinding(() => { + for (const { channel, operation } of INSTRUMENTED_CHANNELS) { + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:openai] subscribing to channel "${channel}"`); + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channel), + (data) => createGenAiSpan(data, operation, options), + { + beforeSpanEnd: (span, data) => { + core.addOpenAiResponseAttributes(span, data.result, core.resolveAIRecordingOptions(options).recordOutputs); + }, + // Streaming: the result is a `Stream` consumed later, so instrument it and let it end the span. + deferSpanEnd: ({ span, data }) => wrapStreamResult(span, data, options) + } + ); + } + }); + } + }; +}); +function createGenAiSpan(data, operation, options) { + if (core._INTERNAL_shouldSkipAiProviderWrapping(INTEGRATION_NAME)) { + return void 0; + } + const args = data.arguments ?? []; + const params = args[0]; + const { recordInputs } = core.resolveAIRecordingOptions(options); + const enableTruncation = core.shouldEnableTruncation(options.enableTruncation); + const attributes = core.extractOpenAiRequestAttributes(args, operation); + attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = ORIGIN; + const model = params?.model || "unknown"; + const span = core.startInactiveSpan({ + name: `${operation} ${model}`, + op: `gen_ai.${operation}`, + attributes + }); + if (recordInputs && params) { + core.addOpenAiRequestAttributes(span, params, operation, enableTruncation); + } + return span; +} +function isAsyncIterable(value) { + return !!value && typeof value[Symbol.asyncIterator] === "function"; +} +function wrapStreamResult(span, data, options) { + const result = data.result; + if (!isAsyncIterable(result)) { + return false; + } + const { recordOutputs } = core.resolveAIRecordingOptions(options); + const iterate = result[Symbol.asyncIterator].bind(result); + const instrumented = core.instrumentOpenAiStream({ [Symbol.asyncIterator]: iterate }, span, recordOutputs ?? false); + result[Symbol.asyncIterator] = () => instrumented; + return true; +} +const openaiChannelIntegration = core.defineIntegration(_openaiChannelIntegration); + +exports.openaiChannelIntegration = openaiChannelIntegration; +//# sourceMappingURL=openai.js.map + + +/***/ }), + +/***/ 21379: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "PostgresJs"; +const ORIGIN = "auto.db.orchestrion.postgresjs"; +const DB_RESPONSE_STATUS_CODE = "db.response.status_code"; +const NOOP = () => { +}; +const QUERY_FROM_INSTRUMENTED_SQL = /* @__PURE__ */ Symbol.for("sentry.query.from.instrumented.sql"); +const QUERY_SPAN = /* @__PURE__ */ Symbol("sentryPostgresJsSpan"); +const CONNECTION_ATTRS_SET = /* @__PURE__ */ Symbol("sentryPostgresJsConnectionAttrsSet"); +const SPAN_ENDED = /* @__PURE__ */ Symbol("sentryPostgresJsSpanEnded"); +const connectionContexts = /* @__PURE__ */ new WeakMap(); +const endpointRegistry = []; +function registerEndpoint(context) { + const alreadyKnown = endpointRegistry.some( + (e) => e.ATTR_SERVER_ADDRESS === context.ATTR_SERVER_ADDRESS && e.ATTR_SERVER_PORT === context.ATTR_SERVER_PORT && e.ATTR_DB_NAMESPACE === context.ATTR_DB_NAMESPACE + ); + if (!alreadyKnown) { + endpointRegistry.push(context); + } +} +function resolveSingleEndpoint() { + return endpointRegistry.length === 1 ? endpointRegistry[0] : void 0; +} +function recordConnectionFromChannel(message) { + const connection = message.result; + const options = message.arguments?.[0]; + if (!connection || typeof connection !== "object" || !options) { + return; + } + const context = core._INTERNAL_buildPostgresConnectionContext(options); + connectionContexts.set(connection, context); + registerEndpoint(context); +} +function setConnectionAttributes(span, query, context) { + const queryRecord = query; + if (queryRecord[CONNECTION_ATTRS_SET]) { + return; + } + queryRecord[CONNECTION_ATTRS_SET] = true; + core._INTERNAL_setPostgresConnectionAttributes(span, context); +} +function attachConnectionAttributesFromChannel(message) { + const connection = message.self; + const query = message.arguments?.[0]; + if (!connection || !query) { + return; + } + const span = query[QUERY_SPAN]; + const context = connectionContexts.get(connection); + if (span && context) { + setConnectionAttributes(span, query, context); + } +} +function wrapQuerySettlement(data, span, sanitizedSqlQuery) { + const query = data.self; + if (!query) { + return; + } + const markEnded = () => { + data[SPAN_ENDED] = true; + }; + const originalResolve = query.resolve; + if (typeof originalResolve === "function") { + query.resolve = function(...resolveArgs) { + markEnded(); + try { + const command = resolveArgs[0]?.command; + core._INTERNAL_setPostgresOperationName(span, sanitizedSqlQuery, command); + span.end(); + } catch (e) { + debugBuild.DEBUG_BUILD && core.debug.error("[orchestrion:postgresjs] error ending span in resolve:", e); + } + return originalResolve.apply(this, resolveArgs); + }; + } + const originalReject = query.reject; + if (typeof originalReject === "function") { + query.reject = function(...rejectArgs) { + markEnded(); + try { + const err = rejectArgs[0]; + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err?.message || "unknown_error" }); + span.setAttribute(DB_RESPONSE_STATUS_CODE, err?.code || "unknown"); + span.setAttribute(attributes.ERROR_TYPE, err?.name || "unknown"); + core._INTERNAL_setPostgresOperationName(span, sanitizedSqlQuery); + span.end(); + } catch (e) { + debugBuild.DEBUG_BUILD && core.debug.error("[orchestrion:postgresjs] error ending span in reject:", e); + } + return originalReject.apply(this, rejectArgs); + }; + } +} +const _postgresJsChannelIntegration = ((options = {}) => { + const { requireParentSpan, requestHook } = options; + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:postgresjs] subscribing to "${channels.CHANNELS.POSTGRESJS_HANDLE}"`); + diagnosticsChannel.tracingChannel(channels.CHANNELS.POSTGRESJS_CONNECTION).subscribe({ + start: NOOP, + asyncStart: NOOP, + asyncEnd: NOOP, + error: NOOP, + end: recordConnectionFromChannel + }); + diagnosticsChannel.tracingChannel(channels.CHANNELS.POSTGRESJS_EXECUTE).subscribe({ + end: NOOP, + asyncStart: NOOP, + asyncEnd: NOOP, + error: NOOP, + start: attachConnectionAttributesFromChannel + }); + diagnosticsChannel.tracingChannel(channels.CHANNELS.POSTGRESJS_CONNECT).subscribe({ + end: NOOP, + asyncStart: NOOP, + asyncEnd: NOOP, + error: NOOP, + start: attachConnectionAttributesFromChannel + }); + core.waitForTracingChannelBinding(() => { + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channels.CHANNELS.POSTGRESJS_HANDLE), + (data) => { + const query = data.self; + if (!query) { + return void 0; + } + if (query.executed === true || query[QUERY_FROM_INSTRUMENTED_SQL]) { + return void 0; + } + const fullQuery = core._INTERNAL_reconstructPostgresQuery(query.strings); + const sanitizedSqlQuery = core._INTERNAL_sanitizeSqlQuery(fullQuery); + const span = core.startInactiveSpan({ + name: sanitizedSqlQuery || "postgresjs.query", + op: "db", + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [attributes.DB_SYSTEM_NAME]: "postgres", + [attributes.DB_QUERY_TEXT]: sanitizedSqlQuery + } + }); + query[QUERY_SPAN] = span; + const context = resolveSingleEndpoint(); + if (context) { + setConnectionAttributes(span, query, context); + } + if (requestHook) { + try { + requestHook(span, sanitizedSqlQuery, context); + } catch (e) { + span.setAttribute("sentry.hook.error", "requestHook failed"); + debugBuild.DEBUG_BUILD && core.debug.error("[orchestrion:postgresjs] error in requestHook:", e); + } + } + wrapQuerySettlement(data, span, sanitizedSqlQuery); + return span; + }, + { + requiresParentSpan: requireParentSpan !== false, + deferSpanEnd({ data }) { + if (data[SPAN_ENDED]) { + return true; + } + if ("error" in data) { + return false; + } + return true; + } + } + ); + }); + } + }; +}); +const postgresJsChannelIntegration = core.defineIntegration(_postgresJsChannelIntegration); + +exports.postgresJsChannelIntegration = postgresJsChannelIntegration; +//# sourceMappingURL=postgres-js.js.map + + +/***/ }), + +/***/ 70562: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "Postgres"; +const ORIGIN = "auto.db.orchestrion.postgres"; +const ATTR_DB_SYSTEM = "db.system"; +const ATTR_DB_NAME = "db.name"; +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +const ATTR_DB_USER = "db.user"; +const ATTR_DB_STATEMENT = "db.statement"; +const ATTR_NET_PEER_NAME = "net.peer.name"; +const ATTR_NET_PEER_PORT = "net.peer.port"; +const ATTR_PG_PLAN = "db.postgresql.plan"; +const ATTR_PG_IDLE_TIMEOUT = "db.postgresql.idle.timeout.millis"; +const ATTR_PG_MAX_CLIENT = "db.postgresql.max.client"; +const DB_SYSTEM_POSTGRESQL = "postgresql"; +const SPAN_QUERY_FALLBACK = "pg.query"; +const SPAN_CONNECT = "pg.connect"; +const SPAN_POOL_CONNECT = "pg-pool.connect"; +const _postgresChannelIntegration = ((options = {}) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + subscribeQueryLikeChannel(channels.CHANNELS.PG_QUERY, querySpanOptions, { deferStreamedResult: true }); + if (!options.ignoreConnectSpans) { + subscribeQueryLikeChannel(channels.CHANNELS.PG_CONNECT, connectSpanOptions); + subscribeQueryLikeChannel(channels.CHANNELS.PGPOOL_CONNECT, poolConnectSpanOptions); + } + }); + } + }; +}); +function subscribeQueryLikeChannel(channelName, getSpanOptions, { deferStreamedResult = false } = {}) { + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:pg] subscribing to channel "${channelName}"`); + tracingChannel.bindTracingChannelToSpan( + diagnosticsChannel.tracingChannel(channelName), + (data) => { + data._sentryCallerScope = core.getCurrentScope(); + return core.startInactiveSpan({ ...getSpanOptions(data), kind: core.SPAN_KIND.CLIENT }); + }, + // `connect`/`pool-connect` resolve with a persistent `Client` (itself an + // `EventEmitter`), which is NOT a streamed result. Deferring their span + // to that emitter's `'end'`/`'error'` would keep it open for the whole + // connection lifetime, so it never ends in time and is dropped. Only + // `query` can return a streamable `Submittable`, so only it defers. + deferStreamedResult ? { + // Only instrument under an active span, leaving the context untouched otherwise + // (e.g. connects issued during app startup). + requiresParentSpan: true, + // Streamable `Submittable` (e.g. `client.query(new Query())`) + // returns an emitter that orchestrion stores on `ctx.result` while + // firing no async events; the query isn't done until the emitter + // emits `'end'`/`'error'`. Defer ending to those events for that + // path; the callback, promise, and sync-throw paths carry no + // emitter, so the helper ends the span as usual. + deferSpanEnd({ data, end }) { + const result = data.result; + if (!result || typeof result !== "object" || !hasOnMethod(result)) { + return false; + } + const callerScope = data._sentryCallerScope; + if (callerScope) { + core.bindScopeToEmitter(result, callerScope); + } + result.on("error", (err) => end(err)); + result.on("end", () => end()); + return true; + } + } : { requiresParentSpan: true } + ); +} +function querySpanOptions(ctx) { + const params = ctx.self?.connectionParameters ?? {}; + const queryConfig = extractQueryConfig(ctx.arguments); + return { + // The description is the SQL statement + name: queryConfig?.text ?? SPAN_QUERY_FALLBACK, + op: "db", + attributes: { + ...getConnectionAttributes(params), + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [ATTR_DB_STATEMENT]: queryConfig?.text || void 0, + [ATTR_PG_PLAN]: typeof queryConfig?.name === "string" ? queryConfig.name : void 0 + } + }; +} +function connectSpanOptions(ctx) { + const params = ctx.self?.connectionParameters ?? {}; + return { name: SPAN_CONNECT, op: "db", attributes: getConnectionAttributes(params) }; +} +function poolConnectSpanOptions(ctx) { + const opts = ctx.self?.options ?? {}; + return { name: SPAN_POOL_CONNECT, op: "db", attributes: getPoolConnectionAttributes(opts) }; +} +function hasOnMethod(obj) { + return "on" in obj && typeof obj.on === "function"; +} +function extractQueryConfig(args) { + const arg0 = args[0]; + if (typeof arg0 === "string") { + return { text: arg0 }; + } + if (core.isObjectLike(arg0) && typeof arg0.text === "string") { + const obj = arg0; + return { text: obj.text, name: obj.name }; + } + return void 0; +} +function getConnectionAttributes(params) { + return { + [ATTR_DB_SYSTEM]: DB_SYSTEM_POSTGRESQL, + [ATTR_DB_CONNECTION_STRING]: getConnectionString(params), + [ATTR_DB_NAME]: params.database, + [ATTR_DB_USER]: params.user, + [ATTR_NET_PEER_NAME]: params.host, + [ATTR_NET_PEER_PORT]: Number.isInteger(params.port) ? params.port : void 0 + }; +} +function getPoolConnectionAttributes(opts) { + let url; + try { + url = opts.connectionString ? new URL(opts.connectionString) : void 0; + } catch { + url = void 0; + } + const database = url?.pathname.slice(1) || opts.database; + const host = url?.hostname || opts.host; + const port = Number(url?.port) || (Number.isInteger(opts.port) ? opts.port : void 0); + const user = url?.username || opts.user; + return { + [ATTR_DB_SYSTEM]: DB_SYSTEM_POSTGRESQL, + [ATTR_DB_CONNECTION_STRING]: getConnectionString(opts), + [ATTR_PG_IDLE_TIMEOUT]: opts.idleTimeoutMillis, + [ATTR_PG_MAX_CLIENT]: opts.max, + [ATTR_DB_NAME]: database, + [ATTR_NET_PEER_PORT]: port, + // these two come from a url parse and slice, can be '' + [ATTR_NET_PEER_NAME]: host || void 0, + [ATTR_DB_USER]: user || void 0 + }; +} +function getConnectionString(params) { + if (params.connectionString) { + try { + const url = new URL(params.connectionString); + url.username = ""; + url.password = ""; + return url.toString(); + } catch { + return "postgresql://localhost:5432/"; + } + } + const host = params.host || "localhost"; + const port = params.port || 5432; + const database = params.database || ""; + return `postgresql://${host}:${port}/${database}`; +} +const postgresChannelIntegration = core.defineIntegration(_postgresChannelIntegration); + +exports.postgresChannelIntegration = postgresChannelIntegration; +//# sourceMappingURL=postgres.js.map + + +/***/ }), + +/***/ 49871: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const diagnosticsChannel = __nccwpck_require__(65714); +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const redisStatementSerializer = __nccwpck_require__(57915); +const tracingChannel = __nccwpck_require__(91484); + +const INTEGRATION_NAME = "RedisChannel"; +const ORIGIN = "auto.db.orchestrion.redis"; +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +const DB_SYSTEM_VALUE_REDIS = "redis"; +function endSpan(span, err) { + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err instanceof Error ? err.message : String(err) }); + } + span.end(); +} +function runResponseHook(hook, span, command, args, result) { + if (!hook) { + return; + } + try { + hook(span, command, args, result); + } catch { + } +} +function stripCommandOptions(args) { + const first = args[0]; + if (core.isObjectLike(first) && Object.getOwnPropertySymbols(first).length > 0) { + return args.slice(1); + } + return args; +} +function removeCredentialsFromConnectionString(url) { + if (typeof url !== "string" || !url) { + return void 0; + } + try { + const parsed = new URL(url); + parsed.searchParams.delete("user_pwd"); + parsed.username = ""; + parsed.password = ""; + return parsed.href; + } catch { + return void 0; + } +} +function nodeRedisAttributes(options) { + return { + [attributes.DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS, + [attributes.NET_PEER_NAME]: options?.socket?.host, + [attributes.NET_PEER_PORT]: options?.socket?.port, + [ATTR_DB_CONNECTION_STRING]: removeCredentialsFromConnectionString(options?.url), + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }; +} +function startCommandSpan(commandName, commandArgs, attributes$1) { + return core.startInactiveSpan({ + name: `redis-${commandName}`, + kind: core.SPAN_KIND.CLIENT, + attributes: { + ...attributes$1, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db", + [attributes.DB_STATEMENT]: redisStatementSerializer.defaultDbStatementSerializer(commandName, commandArgs) + } + }); +} +function subscribeLegacyRedisCommand(responseHook) { + const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.REDIS_COMMAND); + const noop = () => { + }; + channel.subscribe({ + end: noop, + asyncStart: noop, + asyncEnd: noop, + start(data) { + const command = data.arguments?.[0]; + if (!command || typeof command !== "object") { + return; + } + const originalCallback = command.callback; + if (typeof originalCallback !== "function") { + return; + } + const client = data.self; + const attributes$1 = { + [attributes.DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN + }; + attributes$1[attributes.NET_PEER_NAME] = client?.connection_options?.host; + attributes$1[attributes.NET_PEER_PORT] = client?.connection_options?.port; + if (client?.address) { + attributes$1[ATTR_DB_CONNECTION_STRING] = `redis://${client.address}`; + } + const span = startCommandSpan(command.command, command.args ?? [], attributes$1); + data._sentrySpan = span; + const parentSpan = core.getActiveSpan(); + command.callback = function(err, reply) { + if (!err) { + runResponseHook(responseHook, span, command.command, command.args ?? [], reply); + } + endSpan(span, err); + const args = arguments; + return core.withActiveSpan(parentSpan ?? null, () => originalCallback.apply(this, args)); + }; + }, + error(data) { + const span = data._sentrySpan; + if (span) { + endSpan(span, data.error); + } + } + }); +} +function bindNodeRedisCommandChannel(channelName, getWireArgs, responseHook) { + const channel = diagnosticsChannel.tracingChannel(channelName); + tracingChannel.bindTracingChannelToSpan( + channel, + (data) => { + const wireArgs = getWireArgs(data); + if (!wireArgs?.length) { + return void 0; + } + const commandName = String(wireArgs[0]); + const options = data.self?.options; + return startCommandSpan(commandName, wireArgs.slice(1), nodeRedisAttributes(options)); + }, + { + beforeSpanEnd(span, data) { + if ("error" in data || !responseHook) { + return; + } + const wireArgs = getWireArgs(data); + if (wireArgs?.length) { + runResponseHook(responseHook, span, String(wireArgs[0]), wireArgs.slice(1), data.result); + } + } + } + ); +} +function getSendCommandArgs(data) { + const args = data.arguments?.[0]; + return Array.isArray(args) ? args : void 0; +} +function getExecutorArgs(data) { + const command = data.arguments?.[0]; + const jsArgs = data.arguments?.[1]; + if (typeof command?.transformArguments !== "function" || !Array.isArray(jsArgs)) { + return void 0; + } + try { + return command.transformArguments(...stripCommandOptions(jsArgs)); + } catch { + return void 0; + } +} +function bindNodeRedisConnectChannel() { + const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.NODE_REDIS_CONNECT); + tracingChannel.bindTracingChannelToSpan(channel, (data) => { + const options = data.self?.options; + return core.startInactiveSpan({ + name: "redis-connect", + kind: core.SPAN_KIND.CLIENT, + attributes: { ...nodeRedisAttributes(options), [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db" } + }); + }); +} +function bindNodeRedisBatchChannel(channelName, getOperation) { + const channel = diagnosticsChannel.tracingChannel(channelName); + tracingChannel.bindTracingChannelToSpan(channel, (data) => { + const commands = data.arguments?.[0]; + const size = Array.isArray(commands) ? commands.length : void 0; + const socket = data.self?.options?.socket; + return core.startInactiveSpan({ + name: getOperation(data), + kind: core.SPAN_KIND.CLIENT, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db.redis", + [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_VALUE_REDIS, + ...size && size > 1 ? { [attributes.DB_OPERATION_BATCH_SIZE]: size } : {}, + ...socket?.host != null ? { [attributes.SERVER_ADDRESS]: socket.host } : {}, + ...socket?.port != null ? { [attributes.SERVER_PORT]: socket.port } : {} + } + }); + }); +} +const _redisChannelIntegration = ((options = {}) => { + const responseHook = options.responseHook; + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:redis] subscribing to "${channels.CHANNELS.REDIS_COMMAND}" and node-redis channels`); + subscribeLegacyRedisCommand(responseHook); + core.waitForTracingChannelBinding(() => { + bindNodeRedisCommandChannel(channels.CHANNELS.NODE_REDIS_COMMAND, getSendCommandArgs, responseHook); + bindNodeRedisCommandChannel(channels.CHANNELS.NODE_REDIS_EXECUTOR, getExecutorArgs, responseHook); + bindNodeRedisConnectChannel(); + bindNodeRedisBatchChannel(channels.CHANNELS.NODE_REDIS_MULTI, () => "MULTI"); + bindNodeRedisBatchChannel(channels.CHANNELS.NODE_REDIS_PIPELINE, () => "PIPELINE"); + bindNodeRedisBatchChannel( + channels.CHANNELS.NODE_REDIS_BATCH, + (data) => data.arguments?.[2] !== void 0 ? "MULTI" : "PIPELINE" + ); + }); + } + }; +}); +const redisChannelIntegration = core.defineIntegration(_redisChannelIntegration); + +exports.redisChannelIntegration = redisChannelIntegration; +//# sourceMappingURL=redis.js.map + + +/***/ }), + +/***/ 49281: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const node_events = __nccwpck_require__(15673); +const diagnosticsChannel = __nccwpck_require__(65714); +const core = __nccwpck_require__(84466); +const attributes = __nccwpck_require__(88264); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); + +const INTEGRATION_NAME = "Tedious"; +const ORIGIN = "auto.db.orchestrion.tedious"; +const DB_SYSTEM_VALUE_MSSQL = "mssql"; +const ATTR_DB_SQL_TABLE = "db.sql.table"; +const currentDatabaseSymbol = /* @__PURE__ */ Symbol("sentry.orchestrion.tedious.current-database"); +function setDatabase(databaseName) { + Object.defineProperty(this, currentDatabaseSymbol, { value: databaseName, writable: true, configurable: true }); +} +function removeDatabaseListener() { + this.removeListener("databaseChange", setDatabase); +} +function subscribeConnect() { + diagnosticsChannel.tracingChannel(channels.CHANNELS.TEDIOUS_CONNECT).start.subscribe((message) => { + const connection = message.self; + if (!connection) { + return; + } + setDatabase.call(connection, connection.config?.options?.database); + connection.removeListener("databaseChange", setDatabase); + connection.on("databaseChange", setDatabase); + connection.removeListener("end", removeDatabaseListener); + connection.once("end", removeDatabaseListener); + }); +} +function subscribeQuery(channelName, operation) { + diagnosticsChannel.tracingChannel(channelName).start.subscribe((message) => { + const data = message; + const connection = data.self; + const request = data.arguments[0]; + if (!connection || !(request instanceof node_events.EventEmitter)) { + return; + } + let procCount = 0; + let statementCount = 0; + const incrementStatementCount = () => { + statementCount++; + }; + const incrementProcCount = () => { + procCount++; + }; + const databaseName = connection[currentDatabaseSymbol]; + const sql = extractSql(request); + const attributes$1 = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [attributes.DB_SYSTEM]: DB_SYSTEM_VALUE_MSSQL, + [attributes.DB_NAME]: databaseName, + // `>=4` uses the `authentication` object; older versions expose `userName` directly. + [attributes.DB_USER]: connection.config?.userName ?? connection.config?.authentication?.options?.userName, + [attributes.DB_STATEMENT]: sql, + [ATTR_DB_SQL_TABLE]: request.table, + [attributes.NET_PEER_NAME]: connection.config?.server, + [attributes.NET_PEER_PORT]: connection.config?.options?.port + }; + const span = core.startInactiveSpan({ + name: getSpanName(operation, databaseName, sql, request.table), + kind: core.SPAN_KIND.CLIENT, + op: "db", + attributes: attributes$1 + }); + const endSpan = once((err) => { + request.removeListener("done", incrementStatementCount); + request.removeListener("doneInProc", incrementStatementCount); + request.removeListener("doneProc", incrementProcCount); + request.removeListener("error", endSpan); + connection.removeListener("end", endSpan); + span.setAttribute("tedious.procedure_count", procCount); + span.setAttribute("tedious.statement_count", statementCount); + if (err) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message }); + } + span.end(); + }); + request.on("done", incrementStatementCount); + request.on("doneInProc", incrementStatementCount); + request.on("doneProc", incrementProcCount); + request.once("error", endSpan); + connection.on("end", endSpan); + if (typeof request.callback === "function") { + const originalCallback = request.callback; + request.callback = function(...args) { + endSpan(args[0]); + return originalCallback.apply(this, args); + }; + } + }); +} +function extractSql(request) { + if (request.sqlTextOrProcedure === "sp_prepare" && request.parametersByName?.stmt?.value != null) { + const value = request.parametersByName.stmt.value; + return typeof value === "string" ? value : void 0; + } + return request.sqlTextOrProcedure; +} +function getSpanName(operation, db, sql, bulkLoadTable) { + if (operation === "execBulkLoad" && bulkLoadTable && db) { + return `${operation} ${bulkLoadTable} ${db}`; + } + if (operation === "callProcedure") { + return db ? `${operation} ${sql} ${db}` : `${operation} ${sql}`; + } + return db ? `${operation} ${db}` : operation; +} +function once(fn) { + let called = false; + return (...args) => { + if (called) { + return; + } + called = true; + fn(...args); + }; +} +const _tediousChannelIntegration = (() => { + return { + name: INTEGRATION_NAME, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:tedious] subscribing to channel "${channels.CHANNELS.TEDIOUS_EXEC_SQL}"`); + core.waitForTracingChannelBinding(() => { + subscribeConnect(); + subscribeQuery(channels.CHANNELS.TEDIOUS_EXEC_SQL, "execSql"); + subscribeQuery(channels.CHANNELS.TEDIOUS_EXEC_SQL_BATCH, "execSqlBatch"); + subscribeQuery(channels.CHANNELS.TEDIOUS_CALL_PROCEDURE, "callProcedure"); + subscribeQuery(channels.CHANNELS.TEDIOUS_EXEC_BULK_LOAD, "execBulkLoad"); + subscribeQuery(channels.CHANNELS.TEDIOUS_PREPARE, "prepare"); + subscribeQuery(channels.CHANNELS.TEDIOUS_EXECUTE, "execute"); + }); + } + }; +}); +const tediousChannelIntegration = core.defineIntegration(_tediousChannelIntegration); + +exports.tediousChannelIntegration = tediousChannelIntegration; +//# sourceMappingURL=tedious.js.map + + +/***/ }), + +/***/ 48215: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const index = __nccwpck_require__(17611); +const diagnosticsChannel = __nccwpck_require__(65714); +const vercelAiOrchestrionSubscriber = __nccwpck_require__(53209); + +const _vercelAiChannelIntegration = ((options = {}) => { + const parentIntegration = index.vercelAiIntegration(options); + return core.extendIntegration(parentIntegration, { + options, + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + vercelAiOrchestrionSubscriber.subscribeVercelAiOrchestrionChannels(diagnosticsChannel.tracingChannel, options); + }); + } + }); +}); +const vercelAiChannelIntegration = core.defineIntegration(_vercelAiChannelIntegration); + +exports.vercelAiChannelIntegration = vercelAiChannelIntegration; +//# sourceMappingURL=vercel-ai.js.map + + +/***/ }), + +/***/ 68095: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +const ATTR_DB_SYSTEM = "db.system"; +const ATTR_DB_NAME = "db.name"; +const ATTR_DB_OPERATION = "db.operation"; +const ATTR_DB_STATEMENT = "db.statement"; +const ATTR_DB_MONGODB_COLLECTION = "db.mongodb.collection"; +const ATTR_DB_CONNECTION_STRING = "db.connection_string"; +const ATTR_NET_PEER_NAME = "net.peer.name"; +const ATTR_NET_PEER_PORT = "net.peer.port"; +const DB_SYSTEM_VALUE_MONGODB = "mongodb"; +function serializeDbStatement(commandObj) { + return JSON.stringify(scrubStatement(commandObj)); +} +function scrubStatement(value) { + if (Array.isArray(value)) { + return value.map((element) => scrubStatement(element)); + } + if (isCommandObj(value)) { + const initial = {}; + return Object.entries(value).map(([key, element]) => [key, scrubStatement(element)]).reduce((prev, current) => { + if (isCommandEntry(current)) { + prev[current[0]] = current[1]; + } + return prev; + }, initial); + } + return "?"; +} +function isCommandObj(value) { + return core.isObjectLike(value) && !isBuffer(value); +} +function isBuffer(value) { + return typeof Buffer !== "undefined" && Buffer.isBuffer(value); +} +function isCommandEntry(value) { + return Array.isArray(value); +} +function getV4SpanAttributes(connectionCtx, ns, command, operation, origin) { + let host; + let port; + if (connectionCtx) { + const hostParts = typeof connectionCtx.address === "string" ? connectionCtx.address.split(":") : ""; + if (hostParts.length === 2) { + host = hostParts[0]; + port = hostParts[1]; + } + } + let commandObj; + if (command?.documents?.[0]) { + commandObj = command.documents[0]; + } else if (command?.cursors) { + commandObj = command.cursors; + } else { + commandObj = command; + } + return getSpanAttributes(ns.db, ns.collection, host, port, commandObj, operation, origin); +} +function getSpanAttributes(dbName, dbCollection, host, port, commandObj, operation, origin) { + const attributes = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin, + [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_MONGODB, + [ATTR_DB_NAME]: dbName, + [ATTR_DB_MONGODB_COLLECTION]: dbCollection, + [ATTR_DB_OPERATION]: operation, + [ATTR_DB_CONNECTION_STRING]: `mongodb://${host}:${port}/${dbName}` + }; + if (host && port) { + attributes[ATTR_NET_PEER_NAME] = host; + const portNumber = parseInt(port, 10); + if (!isNaN(portNumber)) { + attributes[ATTR_NET_PEER_PORT] = portNumber; + } + } + if (commandObj) { + try { + attributes[ATTR_DB_STATEMENT] = serializeDbStatement(commandObj); + } catch { + } + } + return attributes; +} +function getV3CommandOperation(command) { + if (command.createIndexes !== void 0) { + return "createIndexes"; + } else if (command.findandmodify !== void 0) { + return "findAndModify"; + } else if (command.ismaster !== void 0) { + return "isMaster"; + } else if (command.count !== void 0) { + return "count"; + } else if (command.aggregate !== void 0) { + return "aggregate"; + } + return void 0; +} +function getV3SpanAttributes(ns, topology, command, operation, origin) { + let host; + let port; + if (topology?.s) { + host = topology.s.options?.host ?? topology.s.host; + port = (topology.s.options?.port ?? topology.s.port)?.toString(); + if (host == null || port == null) { + const address = topology.description?.address; + if (address) { + const segments = address.split(":"); + host = segments[0]; + port = segments[1]; + } + } + } + const [dbName, dbCollection] = ns.toString().split("."); + const commandObj = command?.query ?? command?.q ?? command; + return getSpanAttributes(dbName, dbCollection, host, port, commandObj, operation, origin); +} +function startMongoSpan(attributes) { + return core.startInactiveSpan({ + name: `mongodb.${attributes[ATTR_DB_OPERATION] || "command"}`, + op: "db", + kind: core.SPAN_KIND.CLIENT, + attributes + }); +} + +exports.getSpanAttributes = getSpanAttributes; +exports.getV3CommandOperation = getV3CommandOperation; +exports.getV3SpanAttributes = getV3SpanAttributes; +exports.getV4SpanAttributes = getV4SpanAttributes; +exports.serializeDbStatement = serializeDbStatement; +exports.startMongoSpan = startMongoSpan; +//# sourceMappingURL=mongodb-span.js.map + + +/***/ }), + +/***/ 36685: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const diagnosticsChannel = __nccwpck_require__(65714); +const mongooseDcSubscriber = __nccwpck_require__(54426); + +const _mongooseIntegration = (() => { + return { + name: "Mongoose", + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + mongooseDcSubscriber.subscribeMongooseDiagnosticChannels(diagnosticsChannel.tracingChannel); + }); + } + }; +}); +const mongooseIntegration = core.defineIntegration(_mongooseIntegration); + +exports.mongooseIntegration = mongooseIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 54426: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const tracingChannel = __nccwpck_require__(91484); + +const MONGOOSE_DC_CHANNEL_QUERY = "mongoose:query"; +const MONGOOSE_DC_CHANNEL_AGGREGATE = "mongoose:aggregate"; +const MONGOOSE_DC_CHANNEL_MODEL_SAVE = "mongoose:model:save"; +const MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = "mongoose:model:insertMany"; +const MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = "mongoose:model:bulkWrite"; +const MONGOOSE_DC_CHANNEL_CURSOR_NEXT = "mongoose:cursor:next"; +const ORIGIN = "auto.db.mongoose.diagnostic_channel"; +const DB_SYSTEM_NAME_VALUE_MONGODB = "mongodb"; +const MAX_REDACTION_DEPTH = 10; +let subscribed = false; +function subscribeMongooseDiagnosticChannels(tracingChannel) { + if (subscribed) { + return; + } + subscribed = true; + try { + setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_QUERY); + setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_AGGREGATE); + setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_SAVE); + setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY); + setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE); + setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_CURSOR_NEXT); + } catch { + debugBuild.DEBUG_BUILD && core.debug.log("Mongoose node:diagnostics_channel subscription failed."); + } +} +function setupChannel(tracingChannel$1, channelName) { + tracingChannel.bindTracingChannelToSpan(tracingChannel$1(channelName), (data) => { + const collection = data.collection; + const queryText = redactMongoQuery(data.args?.pipeline ?? data.args?.filter); + const batchSize = getBatchSize(data); + return core.startInactiveSpan({ + name: collection ? `mongoose.${collection}.${data.operation}` : `mongoose.${data.operation}`, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db", + [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MONGODB, + [attributes.DB_OPERATION_NAME]: data.operation, + [attributes.DB_COLLECTION_NAME]: collection ?? void 0, + [attributes.DB_NAMESPACE]: data.database ?? void 0, + [attributes.DB_QUERY_TEXT]: queryText ?? void 0, + [attributes.DB_OPERATION_BATCH_SIZE]: batchSize ?? void 0, + [attributes.SERVER_ADDRESS]: data.serverAddress ?? void 0, + [attributes.SERVER_PORT]: data.serverPort ?? void 0 + } + }); + }); +} +function getBatchSize(data) { + const args = data.args; + const batch = data.operation === "insertMany" ? args?.docs : data.operation === "bulkWrite" ? args?.ops : void 0; + return Array.isArray(batch) && batch.length > 1 ? batch.length : void 0; +} +function redactMongoQuery(value) { + if (value == null) { + return void 0; + } + try { + const redacted = redactValue(value, 0); + const text = JSON.stringify(redacted); + return text == null || text === "{}" || text === "[]" ? void 0 : text; + } catch { + return void 0; + } +} +function redactValue(value, depth) { + if (depth > MAX_REDACTION_DEPTH) { + return "?"; + } + if (Array.isArray(value)) { + return value.map((item) => redactValue(item, depth + 1)); + } + if (core.isObjectLike(value)) { + const out = {}; + for (const key of Object.keys(value)) { + out[key] = redactValue(value[key], depth + 1); + } + return out; + } + return "?"; +} + +exports.MONGOOSE_DC_CHANNEL_AGGREGATE = MONGOOSE_DC_CHANNEL_AGGREGATE; +exports.MONGOOSE_DC_CHANNEL_CURSOR_NEXT = MONGOOSE_DC_CHANNEL_CURSOR_NEXT; +exports.MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE; +exports.MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY; +exports.MONGOOSE_DC_CHANNEL_MODEL_SAVE = MONGOOSE_DC_CHANNEL_MODEL_SAVE; +exports.MONGOOSE_DC_CHANNEL_QUERY = MONGOOSE_DC_CHANNEL_QUERY; +exports.subscribeMongooseDiagnosticChannels = subscribeMongooseDiagnosticChannels; +//# sourceMappingURL=mongoose-dc-subscriber.js.map + + +/***/ }), + +/***/ 21385: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +const ATTR_DB_MONGODB_COLLECTION = "db.mongodb.collection"; +const ATTR_DB_NAME = "db.name"; +const ATTR_DB_USER = "db.user"; +const ATTR_NET_PEER_NAME = "net.peer.name"; +const ATTR_NET_PEER_PORT = "net.peer.port"; +const ATTR_DB_OPERATION = "db.operation"; +const ATTR_DB_SYSTEM = "db.system"; +function startMongooseLegacySpan({ + collection, + modelName, + operation, + origin, + parentSpan +}) { + const attributes = { + [ATTR_DB_MONGODB_COLLECTION]: collection?.name, + [ATTR_DB_NAME]: collection?.conn?.name, + [ATTR_DB_USER]: collection?.conn?.user, + [ATTR_NET_PEER_NAME]: collection?.conn?.host, + [ATTR_NET_PEER_PORT]: collection?.conn?.port, + [ATTR_DB_OPERATION]: operation, + [ATTR_DB_SYSTEM]: "mongoose", + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin + }; + return core.startInactiveSpan({ + name: `mongoose.${modelName}.${operation}`, + // Set this explicitly, for platforms lacking `inferDbSpanData` + op: "db", + kind: core.SPAN_KIND.CLIENT, + attributes, + parentSpan + }); +} + +exports.startMongooseLegacySpan = startMongooseLegacySpan; +//# sourceMappingURL=mongoose-legacy-span.js.map + + +/***/ }), + +/***/ 25804: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const diagnosticsChannel = __nccwpck_require__(65714); +const mysql2DcSubscriber = __nccwpck_require__(59178); + +const _mysql2Integration = (() => { + return { + name: "Mysql2", + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + mysql2DcSubscriber.subscribeMysql2DiagnosticChannels(diagnosticsChannel.tracingChannel); + }); + } + }; +}); +const mysql2Integration = core.defineIntegration(_mysql2Integration); + +exports.mysql2Integration = mysql2Integration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 59178: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const tracingChannel = __nccwpck_require__(91484); + +const MYSQL2_DC_CHANNEL_QUERY = "mysql2:query"; +const MYSQL2_DC_CHANNEL_EXECUTE = "mysql2:execute"; +const MYSQL2_DC_CHANNEL_CONNECT = "mysql2:connect"; +const MYSQL2_DC_CHANNEL_POOL_CONNECT = "mysql2:pool:connect"; +const ORIGIN = "auto.db.mysql2.diagnostic_channel"; +const DB_SYSTEM_NAME_VALUE_MYSQL = "mysql"; +const SQL_OPERATION_RE = /^\s*(\w+)/; +function subscribeMysql2DiagnosticChannels(tracingChannel) { + setupQueryChannel(tracingChannel, MYSQL2_DC_CHANNEL_QUERY); + setupQueryChannel(tracingChannel, MYSQL2_DC_CHANNEL_EXECUTE); + setupConnectChannel(tracingChannel, MYSQL2_DC_CHANNEL_CONNECT, "mysql2.connect"); + setupConnectChannel(tracingChannel, MYSQL2_DC_CHANNEL_POOL_CONNECT, "mysql2.pool.connect"); +} +function setupQueryChannel(tracingChannel$1, channelName) { + tracingChannel.bindTracingChannelToSpan( + tracingChannel$1(channelName), + (data) => { + const queryText = data.query ? core._INTERNAL_sanitizeSqlQuery(data.query) : void 0; + const operation = queryText?.match(SQL_OPERATION_RE)?.[1]?.toUpperCase(); + return core.startInactiveSpan({ + name: queryText || "mysql2.query", + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db", + [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MYSQL, + [attributes.DB_QUERY_TEXT]: queryText, + [attributes.DB_OPERATION_NAME]: operation, + [attributes.DB_NAMESPACE]: data.database || void 0, + [attributes.SERVER_ADDRESS]: data.serverAddress, + [attributes.SERVER_PORT]: data.serverPort + } + }); + }, + { requiresParentSpan: true } + ); +} +function setupConnectChannel(tracingChannel$1, channelName, spanName) { + tracingChannel.bindTracingChannelToSpan( + tracingChannel$1(channelName), + (data) => { + return core.startInactiveSpan({ + name: spanName, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db", + [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MYSQL, + [attributes.DB_NAMESPACE]: data.database || void 0, + [attributes.SERVER_ADDRESS]: data.serverAddress, + [attributes.SERVER_PORT]: data.serverPort + } + }); + }, + { requiresParentSpan: true } + ); +} + +exports.MYSQL2_DC_CHANNEL_CONNECT = MYSQL2_DC_CHANNEL_CONNECT; +exports.MYSQL2_DC_CHANNEL_EXECUTE = MYSQL2_DC_CHANNEL_EXECUTE; +exports.MYSQL2_DC_CHANNEL_POOL_CONNECT = MYSQL2_DC_CHANNEL_POOL_CONNECT; +exports.MYSQL2_DC_CHANNEL_QUERY = MYSQL2_DC_CHANNEL_QUERY; +exports.subscribeMysql2DiagnosticChannels = subscribeMysql2DiagnosticChannels; +//# sourceMappingURL=mysql2-dc-subscriber.js.map + + +/***/ }), + +/***/ 64252: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const amqplib = __nccwpck_require__(61162); +const anthropicAi = __nccwpck_require__(25258); +const awsSdk = __nccwpck_require__(16567); +const dataloader = __nccwpck_require__(57510); +const express = __nccwpck_require__(82638); +const firebase = __nccwpck_require__(64243); +const genericPool = __nccwpck_require__(70334); +const googleGenai = __nccwpck_require__(83693); +const graphql = __nccwpck_require__(67440); +const hapi = __nccwpck_require__(88534); +const ioredis = __nccwpck_require__(91901); +const kafkajs = __nccwpck_require__(85192); +const knex = __nccwpck_require__(79512); +const koa = __nccwpck_require__(84317); +const langchain = __nccwpck_require__(84153); +const langgraph = __nccwpck_require__(21036); +const lruMemoizer = __nccwpck_require__(58446); +const mongodb = __nccwpck_require__(45961); +const mongoose = __nccwpck_require__(93876); +const mysql2 = __nccwpck_require__(17884); +const mysql = __nccwpck_require__(77690); +const nestjs = __nccwpck_require__(30904); +const openai = __nccwpck_require__(51627); +const pg = __nccwpck_require__(57980); +const postgres = __nccwpck_require__(23900); +const redis = __nccwpck_require__(935); +const remix = __nccwpck_require__(5614); +const tedious = __nccwpck_require__(52715); +const vercelAi = __nccwpck_require__(67449); + +const CHANNELS = { + ...amqplib.amqplibChannels, + ...anthropicAi.anthropicAiChannels, + ...awsSdk.awsSdkChannels, + ...dataloader.dataloaderChannels, + ...express.expressChannels, + ...firebase.firebaseChannels, + ...genericPool.genericPoolChannels, + ...googleGenai.googleGenAiChannels, + ...graphql.graphqlChannels, + ...hapi.hapiChannels, + ...ioredis.ioredisChannels, + ...kafkajs.kafkajsChannels, + ...knex.knexChannels, + ...koa.koaChannels, + ...langchain.langchainChannels, + ...langgraph.langgraphChannels, + ...lruMemoizer.lruMemoizerChannels, + ...mongodb.mongodbChannels, + ...mongoose.mongooseChannels, + ...mysql2.mysql2Channels, + ...mysql.mysqlChannels, + ...nestjs.nestjsChannels, + ...openai.openaiChannels, + ...pg.pgChannels, + ...postgres.postgresJsChannels, + ...redis.redisChannels, + ...remix.remixChannels, + ...tedious.tediousChannels, + ...vercelAi.vercelAiChannels +}; + +exports.CHANNELS = CHANNELS; +//# sourceMappingURL=channels.js.map + + +/***/ }), + +/***/ 61162: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const module$1 = { name: "amqplib", versionRange: ">=0.5.5 <2" }; +const amqplibConfig = [ + // Producer span + trace-header injection. `sendToQueue` delegates to `publish`, so it's covered. + { + channelName: "publish", + module: { ...module$1, filePath: "lib/channel_model.js" }, + functionQuery: { className: "Channel", methodName: "publish", kind: "Sync" } + }, + // Confirm-channel producer span; the trailing broker-confirm callback ends the span when the + // broker acks/nacks. It internally calls `super.publish`, so the subscriber guards against the + // base `publish` channel double-instrumenting. + { + channelName: "confirmPublish", + module: { ...module$1, filePath: "lib/channel_model.js" }, + functionQuery: { className: "ConfirmChannel", methodName: "publish", kind: "Callback" } + }, + // Records `consumerTag -> { noAck, queue }` so the per-message dispatch hook knows how to name and + // when to end the consumer span. + { + channelName: "consume", + module: { ...module$1, filePath: "lib/channel_model.js" }, + functionQuery: { className: "Channel", methodName: "consume", kind: "Async" } + }, + // Per delivered message: creates the consumer span and runs the user callback under it. + { + channelName: "dispatch", + module: { ...module$1, filePath: "lib/channel.js" }, + functionQuery: { className: "BaseChannel", methodName: "dispatchMessage", kind: "Sync" } + }, + // End the consumer span when the user settles the message. + { + channelName: "ack", + module: { ...module$1, filePath: "lib/channel_model.js" }, + functionQuery: { className: "Channel", methodName: "ack", kind: "Sync" } + }, + { + channelName: "nack", + module: { ...module$1, filePath: "lib/channel_model.js" }, + functionQuery: { className: "Channel", methodName: "nack", kind: "Sync" } + }, + { + channelName: "reject", + module: { ...module$1, filePath: "lib/channel_model.js" }, + functionQuery: { className: "Channel", methodName: "reject", kind: "Sync" } + }, + { + channelName: "ackAll", + module: { ...module$1, filePath: "lib/channel_model.js" }, + functionQuery: { className: "Channel", methodName: "ackAll", kind: "Sync" } + }, + { + channelName: "nackAll", + module: { ...module$1, filePath: "lib/channel_model.js" }, + functionQuery: { className: "Channel", methodName: "nackAll", kind: "Sync" } + }, + // Stashes connection attributes (url/host/port/protocol/server product) on the connection object + // for span-time reads via `channel.connection`. + { + channelName: "connect", + module: { ...module$1, filePath: "lib/connect.js" }, + functionQuery: { functionName: "connect", kind: "Callback" } + } +]; +const amqplibChannels = { + AMQPLIB_PUBLISH: "orchestrion:amqplib:publish", + AMQPLIB_CONFIRM_PUBLISH: "orchestrion:amqplib:confirmPublish", + AMQPLIB_CONSUME: "orchestrion:amqplib:consume", + AMQPLIB_DISPATCH: "orchestrion:amqplib:dispatch", + AMQPLIB_ACK: "orchestrion:amqplib:ack", + AMQPLIB_NACK: "orchestrion:amqplib:nack", + AMQPLIB_REJECT: "orchestrion:amqplib:reject", + AMQPLIB_ACK_ALL: "orchestrion:amqplib:ackAll", + AMQPLIB_NACK_ALL: "orchestrion:amqplib:nackAll", + AMQPLIB_CONNECT: "orchestrion:amqplib:connect" +}; +const amqplibSubscribeInjection = subscribeInjection.toSubscribeInjections(amqplibConfig); + +exports.amqplibChannels = amqplibChannels; +exports.amqplibConfig = amqplibConfig; +exports.amqplibSubscribeInjection = amqplibSubscribeInjection; +//# sourceMappingURL=amqplib.js.map + + +/***/ }), + +/***/ 25258: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const anthropicAiConfig = [ + // One entry each for CJS/ESM + ...["resources/messages/messages.js", "resources/messages/messages.mjs"].flatMap( + (filePath) => ["create", "countTokens"].map((methodName) => ({ + channelName: "chat", + module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath }, + functionQuery: { className: "Messages", methodName, kind: "Auto" } + })) + ), + ...["resources/completions.js", "resources/completions.mjs"].map((filePath) => ({ + channelName: "chat", + module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath }, + functionQuery: { className: "Completions", methodName: "create", kind: "Auto" } + })), + ...["resources/beta/messages/messages.js", "resources/beta/messages/messages.mjs"].map((filePath) => ({ + channelName: "chat", + module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath }, + functionQuery: { className: "Messages", methodName: "create", kind: "Auto" } + })), + ...["resources/models.js", "resources/models.mjs"].map((filePath) => ({ + channelName: "models", + module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath }, + functionQuery: { className: "Models", methodName: "retrieve", kind: "Auto" } + })), + // `messages.stream()` returns a synchronous emitter, not a promise, so `kind: 'Sync'` is required: + // `Auto`'s promise wrapper never publishes `end` for a non-thenable return, so the span would never end. + ...["resources/messages/messages.js", "resources/messages/messages.mjs"].map((filePath) => ({ + channelName: "messages-stream", + module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath }, + functionQuery: { className: "Messages", methodName: "stream", kind: "Sync" } + })) +]; +const anthropicAiChannels = { + ANTHROPIC_CHAT: "orchestrion:@anthropic-ai/sdk:chat", + ANTHROPIC_MODELS: "orchestrion:@anthropic-ai/sdk:models", + ANTHROPIC_MESSAGES_STREAM: "orchestrion:@anthropic-ai/sdk:messages-stream" +}; +const anthropicAiSubscribeInjection = subscribeInjection.toSubscribeInjections(anthropicAiConfig); + +exports.anthropicAiChannels = anthropicAiChannels; +exports.anthropicAiConfig = anthropicAiConfig; +exports.anthropicAiSubscribeInjection = anthropicAiSubscribeInjection; +//# sourceMappingURL=anthropic-ai.js.map + + +/***/ }), + +/***/ 16567: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const awsSdkConfig = [ + { + channelName: "send", + module: { name: "@smithy/core", versionRange: ">=3.24.0 <4", filePath: "dist-cjs/submodules/client/index.js" }, + functionQuery: { className: "Client", methodName: "send", kind: "Async" } + }, + { + channelName: "send", + module: { name: "@smithy/smithy-client", versionRange: ">=1.0.3 <5", filePath: "dist-cjs/index.js" }, + functionQuery: { className: "Client", methodName: "send", kind: "Async" } + }, + { + channelName: "send", + module: { name: "@aws-sdk/smithy-client", versionRange: "^3.1.0", filePath: "dist-cjs/index.js" }, + functionQuery: { className: "Client", methodName: "send", kind: "Async" } + } +]; +const awsSdkChannels = { + AWS_SMITHY_CORE_SEND: "orchestrion:@smithy/core:send", + AWS_SMITHY_CLIENT_SEND: "orchestrion:@smithy/smithy-client:send", + AWS_SDK_SMITHY_CLIENT_SEND: "orchestrion:@aws-sdk/smithy-client:send" +}; +const awsSdkSubscribeInjection = subscribeInjection.toSubscribeInjections(awsSdkConfig); + +exports.awsSdkChannels = awsSdkChannels; +exports.awsSdkConfig = awsSdkConfig; +exports.awsSdkSubscribeInjection = awsSdkSubscribeInjection; +//# sourceMappingURL=aws-sdk.js.map + + +/***/ }), + +/***/ 57510: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const module$1 = { name: "dataloader", versionRange: ">=2.0.0 <3", filePath: "index.js" }; +const dataloaderConfig = [ + // Wrap the constructor so the subscriber can wrap the user's `batchLoadFn` (arg 0). The batch span + // is opened when that wrapped function actually runs (on the deferred dispatch tick), mirroring the + // vendored OTel instrumentation which also wraps `batchLoadFn` at construction time. + { + channelName: "construct", + module: module$1, + functionQuery: { functionName: "DataLoader", kind: "Sync" } + }, + // `load`/`loadMany` return Promises, so they're `Async`: the span ends on `asyncEnd` (when the + // load resolves), capturing the real latency and enclosing the deferred `batch` span — matching the + // vendored OTel `startSpan`. `prime`/`clear`/`clearAll` return `this` synchronously, so they stay `Sync`. + { + channelName: "load", + module: module$1, + functionQuery: { expressionName: "load", kind: "Async" } + }, + { + channelName: "loadMany", + module: module$1, + functionQuery: { expressionName: "loadMany", kind: "Async" } + }, + { + channelName: "prime", + module: module$1, + functionQuery: { expressionName: "prime", kind: "Sync" } + }, + { + channelName: "clear", + module: module$1, + functionQuery: { expressionName: "clear", kind: "Sync" } + }, + { + channelName: "clearAll", + module: module$1, + functionQuery: { expressionName: "clearAll", kind: "Sync" } + } +]; +const dataloaderChannels = { + DATALOADER_CONSTRUCT: "orchestrion:dataloader:construct", + DATALOADER_LOAD: "orchestrion:dataloader:load", + DATALOADER_LOAD_MANY: "orchestrion:dataloader:loadMany", + DATALOADER_PRIME: "orchestrion:dataloader:prime", + DATALOADER_CLEAR: "orchestrion:dataloader:clear", + DATALOADER_CLEAR_ALL: "orchestrion:dataloader:clearAll" +}; +const dataloaderSubscribeInjection = subscribeInjection.toSubscribeInjections(dataloaderConfig); + +exports.dataloaderChannels = dataloaderChannels; +exports.dataloaderConfig = dataloaderConfig; +exports.dataloaderSubscribeInjection = dataloaderSubscribeInjection; +//# sourceMappingURL=dataloader.js.map + + +/***/ }), + +/***/ 82638: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const expressConfig = [ + // Express funnels every middleware/route handler through a single method on + // its routing `Layer`, so instrumenting that one method covers the whole + // request pipeline. The `expressChannelIntegration` opens one span per layer + // invocation. Both are `Layer.prototype. = function (req, res, next)` + // prototype assignments (not `class` methods), so `expressionName` (matching + // the assignment's `left.property.name`) is used. `Callback`: the handler's + // last argument is `next`, so the transform ends the traced operation when + // `next` is invoked (and publishes `error` when it's called with an error). + // + // Express v4 ships its own router in `express/lib/router/layer.js`. + { + channelName: "handle", + module: { name: "express", versionRange: ">=4.0.0 <5", filePath: "lib/router/layer.js" }, + // v4's method is `Layer.prototype.handle_request = function handle(...)` — + // match the assigned property name, not the function name. + functionQuery: { expressionName: "handle_request", kind: "Callback" } + }, + // Express v5 delegates routing to the standalone `router` package. + { + channelName: "handle", + module: { name: "router", versionRange: ">=2.0.0 <3", filePath: "lib/layer.js" }, + functionQuery: { expressionName: "handleRequest", kind: "Callback" } + }, + // Layer *registration* methods. `Router.prototype.route`/`.use` are called + // once per registered route/middleware (including internally by `app.get`/ + // `app.use`), so subscribing here lets us record each layer's registered path + // *pattern* — which the handler path (`req.baseUrl`) can't recover for + // parameterized mounts. `Sync`: these return synchronously and, unlike a + // handler, `use`'s trailing function argument is a registration payload, not a + // callback — so `Callback` would misclassify it and never fire `end`. + // + // `route` and `use` share one `register` channel because the subscriber handles + // them identically, saving a channel per module. + // + // Express v4 ships its own router in `express/lib/router/index.js`. + { + channelName: "register", + module: { name: "express", versionRange: ">=4.0.0 <5", filePath: "lib/router/index.js" }, + functionQuery: { expressionName: "route", kind: "Sync" } + }, + { + channelName: "register", + module: { name: "express", versionRange: ">=4.0.0 <5", filePath: "lib/router/index.js" }, + functionQuery: { expressionName: "use", kind: "Sync" } + }, + // Express v5 delegates routing to the standalone `router` package. + { + channelName: "register", + module: { name: "router", versionRange: ">=2.0.0 <3", filePath: "index.js" }, + functionQuery: { expressionName: "route", kind: "Sync" } + }, + { + channelName: "register", + module: { name: "router", versionRange: ">=2.0.0 <3", filePath: "index.js" }, + functionQuery: { expressionName: "use", kind: "Sync" } + } +]; +const expressChannels = { + // Express v4 runs each layer's handler through `Layer.prototype.handle_request` + // in the `express` module. + EXPRESS_HANDLE: "orchestrion:express:handle", + // Express v5 delegates routing to the standalone `router` package, where the + // equivalent method is `Layer.prototype.handleRequest`. + ROUTER_HANDLE: "orchestrion:router:handle", + // Layer *registration* (`Router.prototype.route`/`.use`), used to capture each + // layer's registered path pattern so the matched route can be reconstructed + // with its parameters intact (`req.baseUrl` only exposes the resolved prefix). + EXPRESS_REGISTER: "orchestrion:express:register", + ROUTER_REGISTER: "orchestrion:router:register" +}; +const expressSubscribeInjection = subscribeInjection.toSubscribeInjections(expressConfig); + +exports.expressChannels = expressChannels; +exports.expressConfig = expressConfig; +exports.expressSubscribeInjection = expressSubscribeInjection; +//# sourceMappingURL=express.js.map + + +/***/ }), + +/***/ 64243: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const FIRESTORE_VERSION_RANGE = ">=3.0.0 <5"; +const FIRESTORE_FILE = /dist\/lite\/(index|common-[^/]+)\.node\.(cjs\.js|mjs)$/; +const FIRESTORE_OPERATIONS = [ + { functionName: "addDoc", channelName: "add-doc" }, + { functionName: "getDocs", channelName: "get-docs" }, + { functionName: "setDoc", channelName: "set-doc" }, + { functionName: "deleteDoc", channelName: "delete-doc" } +]; +const FUNCTIONS_VERSION_RANGE = ">=6.0.0 <7"; +const FUNCTIONS_TRIGGERS = [ + { file: "lib/v2/providers/https.js", functionName: "onRequest", channelName: "http-request" }, + { file: "lib/v2/providers/https.js", functionName: "onCall", channelName: "http-call" }, + { file: "lib/v2/providers/firestore.js", functionName: "onDocumentCreated", channelName: "firestore-created" }, + { + file: "lib/v2/providers/firestore.js", + functionName: "onDocumentCreatedWithAuthContext", + channelName: "firestore-created" + }, + { file: "lib/v2/providers/firestore.js", functionName: "onDocumentUpdated", channelName: "firestore-updated" }, + { + file: "lib/v2/providers/firestore.js", + functionName: "onDocumentUpdatedWithAuthContext", + channelName: "firestore-updated" + }, + { file: "lib/v2/providers/firestore.js", functionName: "onDocumentDeleted", channelName: "firestore-deleted" }, + { + file: "lib/v2/providers/firestore.js", + functionName: "onDocumentDeletedWithAuthContext", + channelName: "firestore-deleted" + }, + { file: "lib/v2/providers/firestore.js", functionName: "onDocumentWritten", channelName: "firestore-written" }, + { + file: "lib/v2/providers/firestore.js", + functionName: "onDocumentWrittenWithAuthContext", + channelName: "firestore-written" + }, + { file: "lib/v2/providers/scheduler.js", functionName: "onSchedule", channelName: "scheduler" }, + { file: "lib/v2/providers/storage.js", functionName: "onObjectFinalized", channelName: "storage-finalized" }, + { file: "lib/v2/providers/storage.js", functionName: "onObjectArchived", channelName: "storage-archived" }, + { file: "lib/v2/providers/storage.js", functionName: "onObjectDeleted", channelName: "storage-deleted" }, + { + file: "lib/v2/providers/storage.js", + functionName: "onObjectMetadataUpdated", + channelName: "storage-metadata-updated" + } +]; +const firebaseConfig = [ + ...FIRESTORE_OPERATIONS.map(({ functionName, channelName }) => ({ + channelName, + module: { name: "@firebase/firestore", versionRange: FIRESTORE_VERSION_RANGE, filePath: FIRESTORE_FILE }, + functionQuery: { functionName, kind: "Auto" } + })), + ...FUNCTIONS_TRIGGERS.map(({ file, functionName, channelName }) => ({ + channelName, + module: { name: "firebase-functions", versionRange: FUNCTIONS_VERSION_RANGE, filePath: file }, + functionQuery: { functionName, kind: "Sync" } + })) +]; +const firebaseChannels = { + FIREBASE_FIRESTORE_ADD_DOC: "orchestrion:@firebase/firestore:add-doc", + FIREBASE_FIRESTORE_GET_DOCS: "orchestrion:@firebase/firestore:get-docs", + FIREBASE_FIRESTORE_SET_DOC: "orchestrion:@firebase/firestore:set-doc", + FIREBASE_FIRESTORE_DELETE_DOC: "orchestrion:@firebase/firestore:delete-doc", + FIREBASE_FUNCTIONS_HTTP_REQUEST: "orchestrion:firebase-functions:http-request", + FIREBASE_FUNCTIONS_HTTP_CALL: "orchestrion:firebase-functions:http-call", + FIREBASE_FUNCTIONS_FIRESTORE_CREATED: "orchestrion:firebase-functions:firestore-created", + FIREBASE_FUNCTIONS_FIRESTORE_UPDATED: "orchestrion:firebase-functions:firestore-updated", + FIREBASE_FUNCTIONS_FIRESTORE_DELETED: "orchestrion:firebase-functions:firestore-deleted", + FIREBASE_FUNCTIONS_FIRESTORE_WRITTEN: "orchestrion:firebase-functions:firestore-written", + FIREBASE_FUNCTIONS_SCHEDULER: "orchestrion:firebase-functions:scheduler", + FIREBASE_FUNCTIONS_STORAGE_FINALIZED: "orchestrion:firebase-functions:storage-finalized", + FIREBASE_FUNCTIONS_STORAGE_ARCHIVED: "orchestrion:firebase-functions:storage-archived", + FIREBASE_FUNCTIONS_STORAGE_DELETED: "orchestrion:firebase-functions:storage-deleted", + FIREBASE_FUNCTIONS_STORAGE_METADATA_UPDATED: "orchestrion:firebase-functions:storage-metadata-updated" +}; +const firebaseSubscribeInjection = subscribeInjection.toSubscribeInjections(firebaseConfig); + +exports.firebaseChannels = firebaseChannels; +exports.firebaseConfig = firebaseConfig; +exports.firebaseSubscribeInjection = firebaseSubscribeInjection; +//# sourceMappingURL=firebase.js.map + + +/***/ }), + +/***/ 70334: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const genericPoolConfig = [ + { + channelName: "acquire", + module: { name: "generic-pool", versionRange: ">=3.0.0 <4", filePath: "lib/Pool.js" }, + functionQuery: { className: "Pool", methodName: "acquire", kind: "Auto" } + }, + { + channelName: "acquire", + module: { name: "generic-pool", versionRange: ">=2.4.0 <3", filePath: "lib/generic-pool.js" }, + functionQuery: { expressionName: "acquire", kind: "Callback" } + } +]; +const genericPoolChannels = { + GENERIC_POOL_ACQUIRE: "orchestrion:generic-pool:acquire" +}; +const genericPoolSubscribeInjection = subscribeInjection.toSubscribeInjections(genericPoolConfig); + +exports.genericPoolChannels = genericPoolChannels; +exports.genericPoolConfig = genericPoolConfig; +exports.genericPoolSubscribeInjection = genericPoolSubscribeInjection; +//# sourceMappingURL=generic-pool.js.map + + +/***/ }), + +/***/ 83693: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const NODE_DIST_FILES = ["dist/node/index.js", "dist/node/index.mjs", "dist/node/index.cjs"]; +const googleGenAiConfig = [ + // `generateContent`/`generateContentStream` are arrow properties assigned in the constructor, not class + // methods, so they need `expressionName` rather than `className`/`methodName`. + ...NODE_DIST_FILES.flatMap( + (filePath) => ["generateContent", "generateContentStream"].map((expressionName) => ({ + channelName: "generate-content", + module: { name: "@google/genai", versionRange: ">=0.10.0 <2", filePath }, + functionQuery: { expressionName, kind: "Auto" } + })) + ), + // `embedContent` and the `Chat` methods are real class methods. + ...NODE_DIST_FILES.map((filePath) => ({ + channelName: "embed-content", + module: { name: "@google/genai", versionRange: ">=0.10.0 <2", filePath }, + functionQuery: { className: "Models", methodName: "embedContent", kind: "Auto" } + })), + // `sendMessage`/`sendMessageStream` internally delegate to `Models.generateContent(Stream)`; the + // subscriber suppresses that nested `generate-content` event so a chat call yields a single span. + ...NODE_DIST_FILES.flatMap( + (filePath) => ["sendMessage", "sendMessageStream"].map((methodName) => ({ + channelName: "chat", + module: { name: "@google/genai", versionRange: ">=0.10.0 <2", filePath }, + functionQuery: { className: "Chat", methodName, kind: "Auto" } + })) + ) +]; +const googleGenAiChannels = { + GOOGLE_GENAI_GENERATE_CONTENT: "orchestrion:@google/genai:generate-content", + GOOGLE_GENAI_EMBED_CONTENT: "orchestrion:@google/genai:embed-content", + GOOGLE_GENAI_CHAT: "orchestrion:@google/genai:chat" +}; +const googleGenAiSubscribeInjection = subscribeInjection.toSubscribeInjections(googleGenAiConfig); + +exports.googleGenAiChannels = googleGenAiChannels; +exports.googleGenAiConfig = googleGenAiConfig; +exports.googleGenAiSubscribeInjection = googleGenAiSubscribeInjection; +//# sourceMappingURL=google-genai.js.map + + +/***/ }), + +/***/ 67440: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const graphqlConfig = [ + { + channelName: "parse", + module: { name: "graphql", versionRange: ">=14.0.0 <17", filePath: "language/parser.js" }, + functionQuery: { functionName: "parse", kind: "Sync" } + }, + { + channelName: "validate", + module: { name: "graphql", versionRange: ">=14.0.0 <17", filePath: "validation/validate.js" }, + functionQuery: { functionName: "validate", kind: "Sync" } + }, + { + channelName: "execute", + module: { name: "graphql", versionRange: ">=14.0.0 <17", filePath: "execution/execute.js" }, + functionQuery: { functionName: "execute", kind: "Auto" } + } +]; +const graphqlChannels = { + GRAPHQL_PARSE: "orchestrion:graphql:parse", + GRAPHQL_VALIDATE: "orchestrion:graphql:validate", + GRAPHQL_EXECUTE: "orchestrion:graphql:execute" +}; +const graphqlSubscribeInjection = subscribeInjection.toSubscribeInjections(graphqlConfig); + +exports.graphqlChannels = graphqlChannels; +exports.graphqlConfig = graphqlConfig; +exports.graphqlSubscribeInjection = graphqlSubscribeInjection; +//# sourceMappingURL=graphql.js.map + + +/***/ }), + +/***/ 88534: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const hapiConfig = [ + // hapi's `route`/`ext` live on an anonymous class (`internals.Server = class {}`), + // so `{className}` can't match — `{methodName}` targets them in lib/server.js. Both + // are synchronous void methods, so `Sync` suffices: we only use `start` to swap + // handlers in `ctx.arguments`. Shape verified across the whole range. + { + channelName: "route", + module: { name: "@hapi/hapi", versionRange: ">=17.0.0 <22.0.0", filePath: "lib/server.js" }, + functionQuery: { methodName: "route", kind: "Sync" } + }, + { + channelName: "ext", + module: { name: "@hapi/hapi", versionRange: ">=17.0.0 <22.0.0", filePath: "lib/server.js" }, + functionQuery: { methodName: "ext", kind: "Sync" } + } +]; +const hapiChannels = { + HAPI_ROUTE: "orchestrion:@hapi/hapi:route", + HAPI_EXT: "orchestrion:@hapi/hapi:ext" +}; +const hapiSubscribeInjection = subscribeInjection.toSubscribeInjections(hapiConfig); + +exports.hapiChannels = hapiChannels; +exports.hapiConfig = hapiConfig; +exports.hapiSubscribeInjection = hapiSubscribeInjection; +//# sourceMappingURL=hapi.js.map + + +/***/ }), + +/***/ 75149: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const awsSdk = __nccwpck_require__(16567); +const amqplib = __nccwpck_require__(61162); +const anthropicAi = __nccwpck_require__(25258); +const dataloader = __nccwpck_require__(57510); +const express = __nccwpck_require__(82638); +const firebase = __nccwpck_require__(64243); +const genericPool = __nccwpck_require__(70334); +const googleGenai = __nccwpck_require__(83693); +const graphql = __nccwpck_require__(67440); +const hapi = __nccwpck_require__(88534); +const ioredis = __nccwpck_require__(91901); +const kafkajs = __nccwpck_require__(85192); +const knex = __nccwpck_require__(79512); +const koa = __nccwpck_require__(84317); +const langchain = __nccwpck_require__(84153); +const langgraph = __nccwpck_require__(21036); +const lruMemoizer = __nccwpck_require__(58446); +const mongodb = __nccwpck_require__(45961); +const mongoose = __nccwpck_require__(93876); +const mysql2 = __nccwpck_require__(17884); +const mysql = __nccwpck_require__(77690); +const nestjs = __nccwpck_require__(30904); +const openai = __nccwpck_require__(51627); +const pg = __nccwpck_require__(57980); +const postgres = __nccwpck_require__(23900); +const redis = __nccwpck_require__(935); +const remix = __nccwpck_require__(5614); +const tedious = __nccwpck_require__(52715); +const vercelAi = __nccwpck_require__(67449); + +const SENTRY_INSTRUMENTATIONS = [ + ...amqplib.amqplibConfig, + ...anthropicAi.anthropicAiConfig, + ...awsSdk.awsSdkConfig, + ...dataloader.dataloaderConfig, + ...express.expressConfig, + ...firebase.firebaseConfig, + ...genericPool.genericPoolConfig, + ...googleGenai.googleGenAiConfig, + ...graphql.graphqlConfig, + ...hapi.hapiConfig, + ...ioredis.ioredisConfig, + ...kafkajs.kafkajsConfig, + ...knex.knexConfig, + ...koa.koaConfig, + ...langchain.langchainConfig, + ...langgraph.langgraphConfig, + ...lruMemoizer.lruMemoizerConfig, + ...mongodb.mongodbConfig, + ...mongoose.mongooseConfig, + ...mysql2.mysql2Config, + ...mysql.mysqlConfig, + ...nestjs.nestjsConfig, + ...openai.openaiConfig, + ...pg.pgConfig, + ...postgres.postgresJsConfig, + ...redis.redisConfig, + ...remix.remixConfig, + ...tedious.tediousConfig, + ...vercelAi.vercelAiConfig +]; +const SUBSCRIBE_INJECTIONS = [ + ...amqplib.amqplibSubscribeInjection, + ...anthropicAi.anthropicAiSubscribeInjection, + ...awsSdk.awsSdkSubscribeInjection, + ...dataloader.dataloaderSubscribeInjection, + ...express.expressSubscribeInjection, + ...firebase.firebaseSubscribeInjection, + ...genericPool.genericPoolSubscribeInjection, + ...googleGenai.googleGenAiSubscribeInjection, + ...graphql.graphqlSubscribeInjection, + ...hapi.hapiSubscribeInjection, + ...ioredis.ioredisSubscribeInjection, + ...kafkajs.kafkajsSubscribeInjection, + ...knex.knexSubscribeInjection, + ...koa.koaSubscribeInjection, + ...langchain.langchainSubscribeInjection, + ...langgraph.langgraphSubscribeInjection, + ...lruMemoizer.lruMemoizerSubscribeInjection, + ...mongodb.mongodbSubscribeInjection, + ...mongoose.mongooseSubscribeInjection, + ...mysql2.mysql2SubscribeInjection, + ...mysql.mysqlSubscribeInjection, + ...nestjs.nestjsSubscribeInjection, + ...openai.openaiSubscribeInjection, + ...pg.pgSubscribeInjection, + ...postgres.postgresJsSubscribeInjection, + ...redis.redisSubscribeInjection, + ...remix.remixSubscribeInjection, + ...tedious.tediousSubscribeInjection, + ...vercelAi.vercelAiSubscribeInjection +]; +function instrumentedModuleNames(instrumentations = []) { + return [ + ...core.uniq([...SENTRY_INSTRUMENTATIONS, ...instrumentations].map((i) => i.module.name)), + // Additional things that need to be bundled but are not covered by the above + // Remix needs to bundle this so @remix-run/server-runtime is _also_ bundled + "@remix-run/node" + ]; +} +const INSTRUMENTED_MODULE_NAMES = instrumentedModuleNames(); +function withoutInstrumentedExternals(external, moduleNames = INSTRUMENTED_MODULE_NAMES) { + if (!external) { + return void 0; + } + return external.filter((entry) => !moduleNames.some((name) => entry === name || entry.startsWith(`${name}/`))); +} + +exports.INSTRUMENTED_MODULE_NAMES = INSTRUMENTED_MODULE_NAMES; +exports.SENTRY_INSTRUMENTATIONS = SENTRY_INSTRUMENTATIONS; +exports.SUBSCRIBE_INJECTIONS = SUBSCRIBE_INJECTIONS; +exports.instrumentedModuleNames = instrumentedModuleNames; +exports.withoutInstrumentedExternals = withoutInstrumentedExternals; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 91901: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const ioredisConfig = [ + // ioredis `<5.11.0` (>=5.11.0 publishes its own `ioredis:*` diagnostics_channel) + ...["lib/redis.js", "built/redis.js", "built/redis/index.js"].flatMap((filePath) => [ + { + channelName: "command", + module: { name: "ioredis", versionRange: ">=2.0.0 <5.0.0", filePath }, + functionQuery: { expressionName: "sendCommand", kind: "Async" } + }, + { + channelName: "connect", + module: { name: "ioredis", versionRange: ">=2.0.0 <5.0.0", filePath }, + functionQuery: { expressionName: "connect", kind: "Async" } + } + ]), + { + channelName: "command", + module: { name: "ioredis", versionRange: ">=5.0.0 <5.11.0", filePath: "built/Redis.js" }, + functionQuery: { className: "Redis", methodName: "sendCommand", kind: "Async" } + }, + { + channelName: "connect", + module: { name: "ioredis", versionRange: ">=5.0.0 <5.11.0", filePath: "built/Redis.js" }, + functionQuery: { className: "Redis", methodName: "connect", kind: "Async" } + } +]; +const ioredisChannels = { + IOREDIS_COMMAND: "orchestrion:ioredis:command", + IOREDIS_CONNECT: "orchestrion:ioredis:connect" +}; +const ioredisSubscribeInjection = subscribeInjection.toSubscribeInjections(ioredisConfig); + +exports.ioredisChannels = ioredisChannels; +exports.ioredisConfig = ioredisConfig; +exports.ioredisSubscribeInjection = ioredisSubscribeInjection; +//# sourceMappingURL=ioredis.js.map + + +/***/ }), + +/***/ 85192: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const kafkajsConfig = [ + { + channelName: "send_batch", + module: { name: "kafkajs", versionRange: ">=2.0.0 <3", filePath: "src/producer/messageProducer.js" }, + // `const sendBatch = async (...) => {...}` — `expressionName` matches the `const` assignment. + // We instrument ONLY `sendBatch`: `send` funnels into it internally, so `producer.send`, + // `producer.sendBatch` and their transactional variants all flow through this one channel. + // Instrumenting `send` too would double-count spans. + functionQuery: { expressionName: "sendBatch", kind: "Async" } + }, + { + channelName: "consumer_run", + module: { name: "kafkajs", versionRange: ">=2.0.0 <3", filePath: "src/consumer/index.js" }, + // `const run = async (config) => {...}` — matched by `expressionName`. We don't span `run` itself: + // the `start` subscriber swaps `config.eachMessage`/`eachBatch` (on `ctx.arguments[0]`) for + // span-creating wrappers before the original runs. This works because the transform re-reads + // `ctx.arguments` when invoking the original. + functionQuery: { expressionName: "run", kind: "Async" } + } +]; +const kafkajsChannels = { + KAFKAJS_SEND_BATCH: "orchestrion:kafkajs:send_batch", + KAFKAJS_CONSUMER_RUN: "orchestrion:kafkajs:consumer_run" +}; +const kafkajsSubscribeInjection = subscribeInjection.toSubscribeInjections(kafkajsConfig); + +exports.kafkajsChannels = kafkajsChannels; +exports.kafkajsConfig = kafkajsConfig; +exports.kafkajsSubscribeInjection = kafkajsSubscribeInjection; +//# sourceMappingURL=kafkajs.js.map + + +/***/ }), + +/***/ 79512: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const MODULE_NAME = "knex"; +const RUNNER_FILES = [ + { filePath: "lib/execution/runner.js", versionRange: ">=0.22.0 <4" }, + { filePath: "lib/runner.js", versionRange: ">=0.10.0 <0.22.0" }, + { filePath: "src/runner.js", versionRange: ">=0.18.0 <0.19.0" } +]; +const CLIENT_FILES = [ + { filePath: "lib/client.js", versionRange: ">=0.10.0 <4" }, + { filePath: "src/client.js", versionRange: ">=0.18.0 <0.19.0" } +]; +const CLIENT_METHODS = ["queryBuilder", "schemaBuilder", "raw"]; +function runnerQuery(filePath, versionRange) { + return { + channelName: "query", + module: { name: MODULE_NAME, versionRange, filePath }, + functionQuery: { className: "Runner", methodName: "query", kind: "Async" } + }; +} +function clientMethod(methodName, filePath, versionRange) { + return { + channelName: methodName, + module: { name: MODULE_NAME, versionRange, filePath }, + functionQuery: { className: "Client", methodName, kind: "Sync" } + }; +} +const knexConfig = [ + ...RUNNER_FILES.map(({ filePath, versionRange }) => runnerQuery(filePath, versionRange)), + ...CLIENT_FILES.flatMap( + ({ filePath, versionRange }) => CLIENT_METHODS.map((methodName) => clientMethod(methodName, filePath, versionRange)) + ) +]; +const knexChannels = { + KNEX_QUERY: "orchestrion:knex:query", + KNEX_QUERY_BUILDER: "orchestrion:knex:queryBuilder", + KNEX_SCHEMA_BUILDER: "orchestrion:knex:schemaBuilder", + KNEX_RAW: "orchestrion:knex:raw" +}; +const knexSubscribeInjection = subscribeInjection.toSubscribeInjections(knexConfig); + +exports.knexChannels = knexChannels; +exports.knexConfig = knexConfig; +exports.knexSubscribeInjection = knexSubscribeInjection; +//# sourceMappingURL=knex.js.map + + +/***/ }), + +/***/ 84317: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const koaConfig = [ + { + channelName: "use", + module: { name: "koa", versionRange: ">=2.0.0 <4", filePath: "lib/application.js" }, + functionQuery: { className: "Application", methodName: "use", kind: "Sync" } + } +]; +const koaChannels = { + KOA_USE: "orchestrion:koa:use" +}; +const koaSubscribeInjection = subscribeInjection.toSubscribeInjections(koaConfig); + +exports.koaChannels = koaChannels; +exports.koaConfig = koaConfig; +exports.koaSubscribeInjection = koaSubscribeInjection; +//# sourceMappingURL=koa.js.map + + +/***/ }), + +/***/ 84153: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const chatModelConfig = ["dist/language_models/chat_models.cjs", "dist/language_models/chat_models.js"].flatMap( + (filePath) => { + const module = { name: "@langchain/core", versionRange: ">=0.1.0 <2.0.0", filePath }; + return [ + { + channelName: "chatModelInvoke", + module, + functionQuery: { className: "BaseChatModel", methodName: "invoke", kind: "Async" } + }, + { + channelName: "chatModelStream", + module, + functionQuery: { className: "BaseChatModel", methodName: "_streamIterator", kind: "Async" } + } + ]; + } +); +const EMBED_QUERY = "embedQuery"; +const EMBED_DOCUMENTS = "embedDocuments"; +const EMBEDDINGS_PROVIDERS = [ + { name: "@langchain/openai", versionRange: ">=0.1.0 <2.0.0", methods: [EMBED_QUERY, EMBED_DOCUMENTS] }, + { name: "@langchain/google-genai", versionRange: ">=0.1.0 <3.0.0", methods: [EMBED_QUERY, EMBED_DOCUMENTS] }, + { name: "@langchain/mistralai", versionRange: ">=0.1.0 <2.0.0", methods: [EMBED_QUERY, EMBED_DOCUMENTS] }, + // `@langchain/google-vertexai` inherits its embed methods from this shared base. The base's + // `embedQuery` delegates to `embedDocuments`, so hooking only `embedDocuments` still traces both + // entry points as a single span each, instead of emitting a nested duplicate for `embedQuery`. + { name: "@langchain/google-common", versionRange: ">=0.1.0 <3.0.0", methods: [EMBED_DOCUMENTS] } +]; +const embeddingsConfig = EMBEDDINGS_PROVIDERS.flatMap( + ({ name, versionRange, methods }) => ["dist/embeddings.cjs", "dist/embeddings.js"].flatMap( + (filePath) => methods.map((method) => ({ + channelName: method, + module: { name, versionRange, filePath }, + functionQuery: { methodName: method, kind: "Async" } + })) + ) +); +const langchainConfig = [...chatModelConfig, ...embeddingsConfig]; +const langchainEmbeddingsChannels = EMBEDDINGS_PROVIDERS.flatMap( + ({ name, methods }) => methods.map((method) => `orchestrion:${name}:${method}`) +); +const langchainChannels = { + LANGCHAIN_CHAT_MODEL_INVOKE: "orchestrion:@langchain/core:chatModelInvoke", + LANGCHAIN_CHAT_MODEL_STREAM: "orchestrion:@langchain/core:chatModelStream" +}; +const langchainSubscribeInjection = subscribeInjection.toSubscribeInjections(langchainConfig); + +exports.langchainChannels = langchainChannels; +exports.langchainConfig = langchainConfig; +exports.langchainEmbeddingsChannels = langchainEmbeddingsChannels; +exports.langchainSubscribeInjection = langchainSubscribeInjection; +//# sourceMappingURL=langchain.js.map + + +/***/ }), + +/***/ 21036: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const module$1 = (filePath) => ({ + name: "@langchain/langgraph", + versionRange: ">=0.0.0 <2.0.0", + filePath +}); +const compileConfig = ["dist/graph/state.cjs", "dist/graph/state.js"].map((filePath) => ({ + channelName: "stateGraphCompile", + module: module$1(filePath), + functionQuery: { className: "StateGraph", methodName: "compile", kind: "Sync" } +})); +const createReactAgentConfig = ["dist/prebuilt/react_agent_executor.cjs", "dist/prebuilt/react_agent_executor.js"].map( + (filePath) => ({ + channelName: "createReactAgent", + module: module$1(filePath), + functionQuery: { functionName: "createReactAgent", kind: "Sync" } + }) +); +const langgraphConfig = [...compileConfig, ...createReactAgentConfig]; +const langgraphChannels = { + LANGGRAPH_STATE_GRAPH_COMPILE: "orchestrion:@langchain/langgraph:stateGraphCompile", + LANGGRAPH_CREATE_REACT_AGENT: "orchestrion:@langchain/langgraph:createReactAgent" +}; +const langgraphSubscribeInjection = subscribeInjection.toSubscribeInjections(langgraphConfig); + +exports.langgraphChannels = langgraphChannels; +exports.langgraphConfig = langgraphConfig; +exports.langgraphSubscribeInjection = langgraphSubscribeInjection; +//# sourceMappingURL=langgraph.js.map + + +/***/ }), + +/***/ 58446: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const lruMemoizerConfig = [ + { + channelName: "load", + // `>=2.1.0` only: the named `function memoizedFunction()` the selector targets exists from 2.1.0 + module: { name: "lru-memoizer", versionRange: ">=2.1.0 <4", filePath: "lib/async.js" }, + functionQuery: { functionName: "memoizedFunction", kind: "Callback" } + } +]; +const lruMemoizerChannels = { + LRU_MEMOIZER_LOAD: "orchestrion:lru-memoizer:load" +}; +const lruMemoizerSubscribeInjection = subscribeInjection.toSubscribeInjections(lruMemoizerConfig); + +exports.lruMemoizerChannels = lruMemoizerChannels; +exports.lruMemoizerConfig = lruMemoizerConfig; +exports.lruMemoizerSubscribeInjection = lruMemoizerSubscribeInjection; +//# sourceMappingURL=lru-memoizer.js.map + + +/***/ }), + +/***/ 45961: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const module$1 = { name: "mongodb" }; +const mongodbConfig = [ + // Band 1: mongodb >= 6.4 — promise-based command. + // `methodName`-only (no `className`): the code-transformer's `className` matcher throws on classes + // containing ES2022 `static {}` blocks (mongodb 7.x's `Connection`/`ConnectionPool` have them — see + // `transformer-bug.md`), and `methodName` alone matches exactly the base method across all versions. + { + channelName: "command", + module: { ...module$1, versionRange: ">=6.4.0 <8", filePath: "lib/cmap/connection.js" }, + functionQuery: { methodName: "command", kind: "Async" } + }, + // Band 2: mongodb >= 4.0 < 6.4 — callback-based command (same `command` channel, different kind). + { + channelName: "command", + module: { ...module$1, versionRange: ">=4.0.0 <6.4", filePath: "lib/cmap/connection.js" }, + functionQuery: { methodName: "command", kind: "Callback" } + }, + // Band 2: the pool runs the checkout callback in a detached async context, so the operation's + // `command()` (invoked inside it) loses the caller's active span. Hooking `checkOut` re-propagates + // that context to the callback (the subscriber creates no span — see `getSpan` returning undefined). + // Only needed < 6.4; from 6.4 `checkOut` is promise-based and the context survives natively. + { + channelName: "checkout", + module: { ...module$1, versionRange: ">=4.0.0 <6.4", filePath: "lib/cmap/connection_pool.js" }, + functionQuery: { methodName: "checkOut", kind: "Callback" } + }, + // Band 3: mongodb >= 3.3 < 4 — the driver had no unified `command`; each operation is a separate + // `lib/core/wireprotocol` function, all callback-style. `insert`/`update`/`remove` are named + // function expressions in the `index.js` `module.exports` object (matched by `expressionName`); + // `command`/`query`/`getMore` are single-function modules (matched by `functionName`). + ...["insert", "update", "remove"].map((op) => ({ + channelName: `v3_${op}`, + module: { ...module$1, versionRange: ">=3.3.0 <4", filePath: "lib/core/wireprotocol/index.js" }, + functionQuery: { expressionName: op, kind: "Callback" } + })), + { + channelName: "v3_command", + module: { ...module$1, versionRange: ">=3.3.0 <4", filePath: "lib/core/wireprotocol/command.js" }, + functionQuery: { functionName: "command", kind: "Callback" } + }, + { + channelName: "v3_query", + module: { ...module$1, versionRange: ">=3.3.0 <4", filePath: "lib/core/wireprotocol/query.js" }, + functionQuery: { functionName: "query", kind: "Callback" } + }, + { + channelName: "v3_get_more", + module: { ...module$1, versionRange: ">=3.3.0 <4", filePath: "lib/core/wireprotocol/get_more.js" }, + functionQuery: { functionName: "getMore", kind: "Callback" } + } +]; +const mongodbChannels = { + MONGODB_COMMAND: "orchestrion:mongodb:command", + MONGODB_CHECKOUT: "orchestrion:mongodb:checkout", + MONGODB_V3_INSERT: "orchestrion:mongodb:v3_insert", + MONGODB_V3_UPDATE: "orchestrion:mongodb:v3_update", + MONGODB_V3_REMOVE: "orchestrion:mongodb:v3_remove", + MONGODB_V3_COMMAND: "orchestrion:mongodb:v3_command", + MONGODB_V3_QUERY: "orchestrion:mongodb:v3_query", + MONGODB_V3_GET_MORE: "orchestrion:mongodb:v3_get_more" +}; +const mongodbSubscribeInjection = subscribeInjection.toSubscribeInjections(mongodbConfig); + +exports.mongodbChannels = mongodbChannels; +exports.mongodbConfig = mongodbConfig; +exports.mongodbSubscribeInjection = mongodbSubscribeInjection; +//# sourceMappingURL=mongodb.js.map + + +/***/ }), + +/***/ 93876: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const module$1 = { name: "mongoose", versionRange: ">=5.9.7 <9.7.0" }; +const CONTEXT_CAPTURE_QUERY_METHODS = [ + "find", + "findOne", + "deleteOne", + "deleteMany", + "estimatedDocumentCount", + "countDocuments", + "distinct", + "where", + "$where", + "findOneAndUpdate", + "findOneAndDelete", + "findOneAndReplace", + // 5/6/7 only (removed in 8), inert in recent versions + "remove", + "count", + "findOneAndRemove" +]; +const mongooseConfig = [ + // Query execution + // the span for most read/write operations. `op`, collection and model are + // read off the `Query` at exec time. + { + channelName: "query_exec", + module: { ...module$1, filePath: "lib/query.js" }, + functionQuery: { expressionName: "exec", kind: "Auto" } + }, + // Aggregation pipeline execution. + { + channelName: "aggregate_exec", + module: { ...module$1, filePath: "lib/aggregate.js" }, + functionQuery: { expressionName: "exec", kind: "Auto" } + }, + // `doc.save()` (and its `$save` alias, which mongoose points at `save` on + // require. the alias picks up the transformed body automatically, so no + // separate entry is needed). + { + channelName: "model_save", + module: { ...module$1, filePath: "lib/model.js" }, + functionQuery: { expressionName: "save", kind: "Auto" } + }, + // Static batch operations. + { + channelName: "model_insert_many", + module: { ...module$1, filePath: "lib/model.js" }, + functionQuery: { expressionName: "insertMany", kind: "Auto" } + }, + { + channelName: "model_bulk_write", + module: { ...module$1, filePath: "lib/model.js" }, + functionQuery: { expressionName: "bulkWrite", kind: "Auto" } + }, + // `doc.remove()` (a document method, deprecated in 6 and removed in 7) + // `expressionName: 'remove'` also matches the sibling `Model.remove` + // *static* in this file, which no matcher can tell apart from the prototype + // method; that static is deprecated and would just produce a redundant span + // so the collision is accepted rather than dropping the doc-method span. + { + channelName: "model_remove", + module: { ...module$1, filePath: "lib/model.js" }, + functionQuery: { expressionName: "remove", kind: "Auto" } + }, + // NOTE: document `updateOne`/`deleteOne` (mongoose 8.21+) are deliberately + // NOT hooked here. The vendored OTel/IITM patcher wraps + // `Model.prototype.updateOne`/`deleteOne`, but those delegate to + // `Query.exec`, which the `query_exec` channel above already instruments + // (its `this.op` is the right operation). Verified by the `mongoose-v8` + // suite against a real mongoose 8.21+ under orchestrion. A dedicated hook + // is also not possible cleanly: `expressionName: 'updateOne'` in + // `lib/model.js` can't be told apart from the same-named `Model.updateOne` + // *static* (the common query-builder form), so hooking it would double-span + // every `Model.updateOne(...)` call. + // + // `Model.aggregate()` builds an `Aggregate` with no method to hook for + // context capture, so hook the static itself and stash the active span + // on the returned aggregate. `Sync`: it returns the aggregate. + { + channelName: "model_aggregate", + module: { ...module$1, filePath: "lib/model.js" }, + functionQuery: { expressionName: "aggregate", kind: "Sync" } + }, + ...CONTEXT_CAPTURE_QUERY_METHODS.map((methodName) => ({ + channelName: `ctx_${methodName}`, + module: { ...module$1, filePath: "lib/query.js" }, + functionQuery: { expressionName: methodName, kind: "Sync" } + })) +]; +const mongooseChannels = { + MONGOOSE_QUERY_EXEC: "orchestrion:mongoose:query_exec", + MONGOOSE_AGGREGATE_EXEC: "orchestrion:mongoose:aggregate_exec", + MONGOOSE_MODEL_SAVE: "orchestrion:mongoose:model_save", + MONGOOSE_MODEL_INSERT_MANY: "orchestrion:mongoose:model_insert_many", + MONGOOSE_MODEL_BULK_WRITE: "orchestrion:mongoose:model_bulk_write", + MONGOOSE_MODEL_REMOVE: "orchestrion:mongoose:model_remove", + MONGOOSE_MODEL_AGGREGATE: "orchestrion:mongoose:model_aggregate" +}; +const MONGOOSE_CONTEXT_CAPTURE_CHANNELS = CONTEXT_CAPTURE_QUERY_METHODS.map( + (methodName) => `orchestrion:mongoose:ctx_${methodName}` +); +const mongooseSubscribeInjection = subscribeInjection.toSubscribeInjections(mongooseConfig); + +exports.MONGOOSE_CONTEXT_CAPTURE_CHANNELS = MONGOOSE_CONTEXT_CAPTURE_CHANNELS; +exports.mongooseChannels = mongooseChannels; +exports.mongooseConfig = mongooseConfig; +exports.mongooseSubscribeInjection = mongooseSubscribeInjection; +//# sourceMappingURL=mongoose.js.map + + +/***/ }), + +/***/ 77690: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const mysqlConfig = [ + { + channelName: "query", + module: { name: "mysql", versionRange: ">=2.0.0 <3", filePath: "lib/Connection.js" }, + functionQuery: { expressionName: "query", kind: "Auto" } + } +]; +const mysqlChannels = { + MYSQL_QUERY: "orchestrion:mysql:query" +}; +const mysqlSubscribeInjection = subscribeInjection.toSubscribeInjections(mysqlConfig); + +exports.mysqlChannels = mysqlChannels; +exports.mysqlConfig = mysqlConfig; +exports.mysqlSubscribeInjection = mysqlSubscribeInjection; +//# sourceMappingURL=mysql.js.map + + +/***/ }), + +/***/ 17884: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const mysql2Config = [ + { + channelName: "query", + module: { name: "mysql2", versionRange: ">=1.4.2 <3.11.5", filePath: "lib/connection.js" }, + functionQuery: { className: "Connection", methodName: "query", kind: "Callback" } + }, + { + channelName: "execute", + module: { name: "mysql2", versionRange: ">=1.4.2 <3.11.5", filePath: "lib/connection.js" }, + functionQuery: { className: "Connection", methodName: "execute", kind: "Callback" } + }, + { + channelName: "query", + module: { name: "mysql2", versionRange: ">=3.11.5 <3.20.0", filePath: "lib/base/connection.js" }, + functionQuery: { className: "BaseConnection", methodName: "query", kind: "Callback" } + }, + { + channelName: "execute", + module: { name: "mysql2", versionRange: ">=3.11.5 <3.20.0", filePath: "lib/base/connection.js" }, + functionQuery: { className: "BaseConnection", methodName: "execute", kind: "Callback" } + } +]; +const mysql2Channels = { + MYSQL2_QUERY: "orchestrion:mysql2:query", + MYSQL2_EXECUTE: "orchestrion:mysql2:execute" +}; +const mysql2SubscribeInjection = subscribeInjection.toSubscribeInjections(mysql2Config); + +exports.mysql2Channels = mysql2Channels; +exports.mysql2Config = mysql2Config; +exports.mysql2SubscribeInjection = mysql2SubscribeInjection; +//# sourceMappingURL=mysql2.js.map + + +/***/ }), + +/***/ 30904: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +function astQueryInstrumentation(config) { + return config; +} +const nestjsConfig = [ + { + channelName: "nestFactoryCreate", + module: { name: "@nestjs/core", versionRange: ">=8.0.0 <12", filePath: "nest-factory.js" }, + functionQuery: { className: "NestFactoryStatic", methodName: "create", kind: "Async" } + }, + { + channelName: "routerExecutionContextCreate", + module: { name: "@nestjs/core", versionRange: ">=8.0.0 <12", filePath: "router/router-execution-context.js" }, + functionQuery: { className: "RouterExecutionContext", methodName: "create", kind: "Sync" } + }, + astQueryInstrumentation({ + // `@nestjs/common/decorators/core/injectable.decorator.js`: + // `function Injectable(options) { return (target) => { ... }; }` + // The inner decorator arrow is anonymous + returned, so only a raw + // `astQuery` can target it. The subscriber's `start` receives the + // decorated class as `arguments[0]` and patches its prototype + // use/canActivate/transform/intercept methods, reproducing the + // vendored `SentryNestInstrumentation` middleware/guard/pipe/interceptor + // spans. No span on the decorator itself, so `kind: 'Sync'`. + channelName: "injectableDecorator", + module: { + name: "@nestjs/common", + versionRange: ">=8.0.0 <12", + filePath: "decorators/core/injectable.decorator.js" + }, + astQuery: 'FunctionDeclaration[id.name="Injectable"] ReturnStatement > ArrowFunctionExpression', + functionQuery: { kind: "Sync" } + }), + astQueryInstrumentation({ + // `@nestjs/common/decorators/core/catch.decorator.js`: + // `function Catch(...exceptions) { return (target) => { ... }; }` + // Same anonymous-returned-arrow shape as `Injectable`. The subscriber's + // `start` patches the exception filter's prototype `catch` method to + // open an `exception_filter` span. + // + // Mirrors the vendored `SentryNestInstrumentation` `@Catch` wrap. + channelName: "catchDecorator", + module: { name: "@nestjs/common", versionRange: ">=8.0.0 <12", filePath: "decorators/core/catch.decorator.js" }, + astQuery: 'FunctionDeclaration[id.name="Catch"] ReturnStatement > ArrowFunctionExpression', + functionQuery: { kind: "Sync" } + }), + // @nestjs/schedule @Cron/@Interval/@Timeout: + // `function Cron(...) { return applyDecorators(...); }` + // The returned decorator has no inline arrow to target, so we match the + // factory function and reassign `data.result` in `end` to wrap the + // decorator it returns (which rewrites the user handler `descriptor.value` + // with isolation-scope + error capture). + // Mirrors `SentryNestScheduleInstrumentation`, whose supported range we + // match so opting in doesn't drop coverage the OTel path had. The compiled + // `function Cron(...)` declaration is unchanged across 2.x–5.x. + { + channelName: "cronDecorator", + module: { name: "@nestjs/schedule", versionRange: ">=2.0.0", filePath: "dist/decorators/cron.decorator.js" }, + functionQuery: { functionName: "Cron", kind: "Sync" } + }, + { + channelName: "intervalDecorator", + module: { name: "@nestjs/schedule", versionRange: ">=2.0.0", filePath: "dist/decorators/interval.decorator.js" }, + functionQuery: { functionName: "Interval", kind: "Sync" } + }, + { + channelName: "timeoutDecorator", + module: { name: "@nestjs/schedule", versionRange: ">=2.0.0", filePath: "dist/decorators/timeout.decorator.js" }, + functionQuery: { functionName: "Timeout", kind: "Sync" } + }, + { + // @nestjs/event-emitter @OnEvent: + // `const OnEvent = (event, options) => { + // const decoratorFactory = (t, k, d) => {...}; return decoratorFactory; + // }` + // `OnEvent` is an arrow assigned to a const, so `expressionName`. `end` + // reassigns `data.result` to wrap the returned decorator, which rewrites + // the handler to open an `event.nestjs` span. + // Mirrors `SentryNestEventInstrumentation`; the `const OnEvent = (...) =>` + // shape is unchanged across 2.x–3.x. + channelName: "onEventDecorator", + module: { + name: "@nestjs/event-emitter", + versionRange: ">=2.0.0", + filePath: "dist/decorators/on-event.decorator.js" + }, + functionQuery: { expressionName: "OnEvent", kind: "Sync" } + }, + { + // @nestjs/bullmq @Processor: + // `function Processor(...) { return (target) => {...}; }` + // The factory arg carries the queue name, so we match the factory and + // reassign `data.result` in `end` to wrap the returned class decorator + // (which patches `target.prototype.process`). + // Mirrors `SentryNestBullMQInstrumentation`; the `function Processor(...)` + // declaration is unchanged across + // 10.x–11.x. + channelName: "processorDecorator", + module: { + name: "@nestjs/bullmq", + versionRange: ">=10.0.0", + filePath: "dist/decorators/processor.decorator.js" + }, + functionQuery: { functionName: "Processor", kind: "Sync" } + } +]; +const nestjsChannels = { + NESTJS_APP_CREATION: "orchestrion:@nestjs/core:nestFactoryCreate", + NESTJS_ROUTER_CONTEXT: "orchestrion:@nestjs/core:routerExecutionContextCreate", + NESTJS_INJECTABLE: "orchestrion:@nestjs/common:injectableDecorator", + NESTJS_CATCH: "orchestrion:@nestjs/common:catchDecorator", + NESTJS_SCHEDULE_CRON: "orchestrion:@nestjs/schedule:cronDecorator", + NESTJS_SCHEDULE_INTERVAL: "orchestrion:@nestjs/schedule:intervalDecorator", + NESTJS_SCHEDULE_TIMEOUT: "orchestrion:@nestjs/schedule:timeoutDecorator", + NESTJS_ONEVENT: "orchestrion:@nestjs/event-emitter:onEventDecorator", + NESTJS_PROCESSOR: "orchestrion:@nestjs/bullmq:processorDecorator" +}; +const nestjsSubscribeInjection = subscribeInjection.toSubscribeInjections(nestjsConfig); + +exports.nestjsChannels = nestjsChannels; +exports.nestjsConfig = nestjsConfig; +exports.nestjsSubscribeInjection = nestjsSubscribeInjection; +//# sourceMappingURL=nestjs.js.map + + +/***/ }), + +/***/ 51627: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const openaiConfig = [ + // OpenAI chat completions. `Completions.create` returns a thenable `APIPromise` with no callback arg, + // so `kind: 'Auto'` resolves to `wrapPromise`. openai ships dual CJS/ESM and the matcher compares + // `filePath` exactly, hence one entry per built file (`.js` for `require`, `.mjs` for `import`). + ...["resources/chat/completions/completions.js", "resources/chat/completions/completions.mjs"].map((filePath) => ({ + channelName: "chat", + module: { name: "openai", versionRange: ">=4.0.0 <7", filePath }, + functionQuery: { className: "Completions", methodName: "create", kind: "Auto" } + })), + // OpenAI responses API — same `create(body, options)` shape as chat completions. + ...["resources/responses/responses.js", "resources/responses/responses.mjs"].map((filePath) => ({ + channelName: "chat", + module: { name: "openai", versionRange: ">=4.0.0 <7", filePath }, + functionQuery: { className: "Responses", methodName: "create", kind: "Auto" } + })), + // OpenAI embeddings API — same `create(body, options)` shape as chat completions. + ...["resources/embeddings.js", "resources/embeddings.mjs"].map((filePath) => ({ + channelName: "embeddings", + module: { name: "openai", versionRange: ">=4.0.0 <7", filePath }, + functionQuery: { className: "Embeddings", methodName: "create", kind: "Auto" } + })), + // OpenAI conversations API — same `create(body, options)` shape as chat completions. + ...["resources/conversations/conversations.js", "resources/conversations/conversations.mjs"].map((filePath) => ({ + channelName: "chat", + module: { name: "openai", versionRange: ">=4.0.0 <7", filePath }, + functionQuery: { className: "Conversations", methodName: "create", kind: "Auto" } + })) +]; +const openaiChannels = { + // Chat completions, the responses API, and the conversations API all report a `chat` operation with + // identical span handling, so they share one channel. + OPENAI_CHAT: "orchestrion:openai:chat", + OPENAI_EMBEDDINGS: "orchestrion:openai:embeddings" +}; +const openaiSubscribeInjection = subscribeInjection.toSubscribeInjections(openaiConfig); + +exports.openaiChannels = openaiChannels; +exports.openaiConfig = openaiConfig; +exports.openaiSubscribeInjection = openaiSubscribeInjection; +//# sourceMappingURL=openai.js.map + + +/***/ }), + +/***/ 57980: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const pgConfig = [ + // `pg` (node-postgres). + // instruments `Client.prototype.query`/`connect` (both the JS and native + // clients) plus `pg-pool`'s `Pool.prototype.connect`. + // `Auto` covers the callback, promise, and streamable-`Submittable` + // call shapes (like mysql). + // `pg/lib/client.js` is `class Client { query() {...} connect() {...} }`, + // so `className`+`methodName` matches directly. + { + channelName: "query", + module: { name: "pg", versionRange: ">=8.0.3 <9", filePath: "lib/client.js" }, + functionQuery: { className: "Client", methodName: "query", kind: "Auto" } + }, + { + channelName: "connect", + module: { name: "pg", versionRange: ">=8.0.3 <9", filePath: "lib/client.js" }, + functionQuery: { className: "Client", methodName: "connect", kind: "Auto" } + }, + // The native client (`pg/lib/native/client.js`) is a constructor function, + // not a class. + // `Client.prototype.query = function (config, values, callback) {...}` + // so it needs `expressionName` (the mysql shape), publishing to the SAME + // `orchestrion:pg:query`/`:connect` channels as the JS client. + { + channelName: "query", + module: { name: "pg", versionRange: ">=8.0.3 <9", filePath: "lib/native/client.js" }, + functionQuery: { expressionName: "query", kind: "Auto" } + }, + { + channelName: "connect", + module: { name: "pg", versionRange: ">=8.0.3 <9", filePath: "lib/native/client.js" }, + functionQuery: { expressionName: "connect", kind: "Auto" } + }, + // `pg-pool` is `class Pool extends EventEmitter { connect(cb) {...} }`. + { + channelName: "connect", + module: { name: "pg-pool", versionRange: ">=2.0.0 <4", filePath: "index.js" }, + functionQuery: { className: "Pool", methodName: "connect", kind: "Auto" } + } +]; +const pgChannels = { + PG_QUERY: "orchestrion:pg:query", + PG_CONNECT: "orchestrion:pg:connect", + PGPOOL_CONNECT: "orchestrion:pg-pool:connect" +}; +const pgSubscribeInjection = subscribeInjection.toSubscribeInjections(pgConfig); + +exports.pgChannels = pgChannels; +exports.pgConfig = pgConfig; +exports.pgSubscribeInjection = pgSubscribeInjection; +//# sourceMappingURL=pg.js.map + + +/***/ }), + +/***/ 23900: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const postgresJsInstrumentationConfig = (dir) => [ + // `Query.prototype.handle` (`class Query extends Promise`) is the single + // funnel every query passes through (`then`/`catch`/`finally`/`.execute()`/ + // `.forEach()`/cursor all call it), guarded by `this.executed`. `Async` + // because `handle` is `async`. + { + channelName: "handle", + module: { name: "postgres", versionRange: ">=3.0.0 <4", filePath: `${dir}/query.js` }, + functionQuery: { className: "Query", methodName: "handle", kind: "Async" } + }, + // `function Connection(options, ...)` (default export of `connection.js`) + // returns the connection object; used to build the endpoint registry that + // resolves `server.address`/`server.port`/`db.namespace`. + { + channelName: "connection", + module: { name: "postgres", versionRange: ">=3.0.0 <4", filePath: `${dir}/connection.js` }, + functionQuery: { functionName: "Connection", kind: "Sync" } + }, + // The nested `function execute(q)` inside `Connection`; the per-connection + // hook that attaches connection attributes to the query's span. + { + channelName: "execute", + module: { name: "postgres", versionRange: ">=3.0.0 <4", filePath: `${dir}/connection.js` }, + functionQuery: { functionName: "execute", kind: "Sync" } + }, + // The connection object's `connect(query)` method. Matched by `methodName` + // (an object-literal method): `functionName` would hit the unrelated + // socket-level `async function connect()` in the same file. `self` is the + // connection object and `arguments[0]` the query, so the first query that + // opens a connection (dispatched via a bare `execute` with no `self`) still + // gets connection attributes in multi-endpoint apps. + { + channelName: "connect", + module: { name: "postgres", versionRange: ">=3.0.0 <4", filePath: `${dir}/connection.js` }, + functionQuery: { methodName: "connect", kind: "Sync" } + } +]; +const postgresJsConfig = ["src", "cjs/src"].flatMap(postgresJsInstrumentationConfig); +const postgresJsChannels = { + POSTGRESJS_HANDLE: "orchestrion:postgres:handle", + POSTGRESJS_CONNECTION: "orchestrion:postgres:connection", + POSTGRESJS_EXECUTE: "orchestrion:postgres:execute", + POSTGRESJS_CONNECT: "orchestrion:postgres:connect" +}; +const postgresJsSubscribeInjection = subscribeInjection.toSubscribeInjections(postgresJsConfig); + +exports.postgresJsChannels = postgresJsChannels; +exports.postgresJsConfig = postgresJsConfig; +exports.postgresJsSubscribeInjection = postgresJsSubscribeInjection; +//# sourceMappingURL=postgres.js.map + + +/***/ }), + +/***/ 935: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const redisConfig = [ + // redis `>=2.6.0 <4` (standalone `redis`). `internal_send_command` is an + // anonymous prototype assignment (`expressionName`); it settles via the nested + // `command_obj.callback`, so `kind: 'Sync'` and the subscriber wraps that callback. + { + channelName: "command", + module: { name: "redis", versionRange: ">=2.6.0 <4", filePath: "index.js" }, + functionQuery: { expressionName: "internal_send_command", kind: "Sync" } + }, + // node-redis v4 (`@redis/client` v1). The real chokepoint (private `#sendCommand`) + // isn't matchable, so wrap both public entry points: `commandsExecutor` (friendly + // commands) and `sendCommand` (direct calls). They never overlap, so no double span. + { + channelName: "executor", + module: { name: "@redis/client", versionRange: "^1.0.0", filePath: "dist/lib/client/index.js" }, + functionQuery: { className: "RedisClient", methodName: "commandsExecutor", kind: "Async" } + }, + { + channelName: "command", + module: { name: "@redis/client", versionRange: "^1.0.0", filePath: "dist/lib/client/index.js" }, + functionQuery: { className: "RedisClient", methodName: "sendCommand", kind: "Async" } + }, + { + channelName: "connect", + module: { name: "@redis/client", versionRange: "^1.0.0", filePath: "dist/lib/client/index.js" }, + functionQuery: { className: "RedisClient", methodName: "connect", kind: "Async" } + }, + // node-redis `>=5.0.0 <5.12.0` (`@redis/client` v5; >=5.12.0 has its own + // `node-redis:*` diagnostics_channel, see `redis-dc-subscriber.ts`). Friendly + // commands route through the public `sendCommand`, so it covers them all — no + // `executor` entry (would double-count). + { + channelName: "command", + module: { name: "@redis/client", versionRange: ">=5.0.0 <5.12.0", filePath: "dist/lib/client/index.js" }, + functionQuery: { className: "RedisClient", methodName: "sendCommand", kind: "Async" } + }, + { + channelName: "connect", + module: { name: "@redis/client", versionRange: ">=5.0.0 <5.12.0", filePath: "dist/lib/client/index.js" }, + functionQuery: { className: "RedisClient", methodName: "connect", kind: "Async" } + }, + // Batch (multi/pipeline) — one span per `exec`. Batched commands bypass `sendCommand`, + // so they go through the client's batch executors, which receive the queued commands + // array (→ batch size). v5 splits MULTI/PIPELINE into two methods; v4's single + // `multiExecutor` is MULTI when a `chainId` arg is present, PIPELINE otherwise. + { + channelName: "multi", + module: { name: "@redis/client", versionRange: ">=5.0.0 <5.12.0", filePath: "dist/lib/client/index.js" }, + functionQuery: { className: "RedisClient", methodName: "_executeMulti", kind: "Async" } + }, + { + channelName: "pipeline", + module: { name: "@redis/client", versionRange: ">=5.0.0 <5.12.0", filePath: "dist/lib/client/index.js" }, + functionQuery: { className: "RedisClient", methodName: "_executePipeline", kind: "Async" } + }, + { + channelName: "batch", + module: { name: "@redis/client", versionRange: "^1.0.0", filePath: "dist/lib/client/index.js" }, + functionQuery: { className: "RedisClient", methodName: "multiExecutor", kind: "Async" } + } +]; +const redisChannels = { + REDIS_COMMAND: "orchestrion:redis:command", + NODE_REDIS_COMMAND: "orchestrion:@redis/client:command", + NODE_REDIS_EXECUTOR: "orchestrion:@redis/client:executor", + NODE_REDIS_CONNECT: "orchestrion:@redis/client:connect", + NODE_REDIS_MULTI: "orchestrion:@redis/client:multi", + NODE_REDIS_PIPELINE: "orchestrion:@redis/client:pipeline", + NODE_REDIS_BATCH: "orchestrion:@redis/client:batch" +}; +const redisSubscribeInjection = subscribeInjection.toSubscribeInjections(redisConfig); + +exports.redisChannels = redisChannels; +exports.redisConfig = redisConfig; +exports.redisSubscribeInjection = redisSubscribeInjection; +//# sourceMappingURL=redis.js.map + + +/***/ }), + +/***/ 5614: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const remixInstrumentationConfig = (dir) => [ + // `createRequestHandler` returns `async function requestHandler(request, loadContext)` — the main + // server span. We target the returned handler (so the span wraps each request, not the one-time + // handler construction). It's a *named function expression*, which name-based `functionQuery` + // can't match (that only sees declarations), so we select it with `astQuery`; `functionQuery` + // then just carries the behaviour (`kind: 'Async'`). + { + channelName: "requestHandler", + module: { name: "@remix-run/server-runtime", versionRange: ">=2.0.0 <3", filePath: `${dir}/server.js` }, + astQuery: 'FunctionExpression[id.name="requestHandler"]', + functionQuery: { kind: "Async" } + }, + // Sync; the subscriber reads its result to set `http.route` on the active request span. + { + channelName: "matchServerRoutes", + module: { name: "@remix-run/server-runtime", versionRange: ">=2.0.0 <3", filePath: `${dir}/routeMatching.js` }, + functionQuery: { functionName: "matchServerRoutes", kind: "Sync" } + }, + // Remix >= 2.9.0 + { + channelName: "callRouteLoader", + module: { name: "@remix-run/server-runtime", versionRange: ">=2.9.0 <3", filePath: `${dir}/data.js` }, + functionQuery: { functionName: "callRouteLoader", kind: "Async" } + }, + { + channelName: "callRouteAction", + module: { name: "@remix-run/server-runtime", versionRange: ">=2.9.0 <3", filePath: `${dir}/data.js` }, + functionQuery: { functionName: "callRouteAction", kind: "Async" } + }, + // Remix 2.0.0 – 2.8.x: the same functions were suffixed `…RR`. Same channels as above. + { + channelName: "callRouteLoader", + module: { name: "@remix-run/server-runtime", versionRange: ">=2.0.0 <2.9.0", filePath: `${dir}/data.js` }, + functionQuery: { functionName: "callRouteLoaderRR", kind: "Async" } + }, + { + channelName: "callRouteAction", + module: { name: "@remix-run/server-runtime", versionRange: ">=2.0.0 <2.9.0", filePath: `${dir}/data.js` }, + functionQuery: { functionName: "callRouteActionRR", kind: "Async" } + } +]; +const remixConfig = ["dist", "dist/esm"].flatMap(remixInstrumentationConfig); +const remixChannels = { + REMIX_REQUEST_HANDLER: "orchestrion:@remix-run/server-runtime:requestHandler", + REMIX_MATCH_SERVER_ROUTES: "orchestrion:@remix-run/server-runtime:matchServerRoutes", + REMIX_CALL_ROUTE_LOADER: "orchestrion:@remix-run/server-runtime:callRouteLoader", + REMIX_CALL_ROUTE_ACTION: "orchestrion:@remix-run/server-runtime:callRouteAction" +}; +const remixSubscribeInjection = subscribeInjection.toSubscribeInjections(remixConfig); + +exports.remixChannels = remixChannels; +exports.remixConfig = remixConfig; +exports.remixSubscribeInjection = remixSubscribeInjection; +//# sourceMappingURL=remix.js.map + + +/***/ }), + +/***/ 34224: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const SUBSCRIBE_TRANSFORM_NAME = "sentrySubscribeOrchestrionChannel"; +function toSubscribeInjections(configs) { + const seen = /* @__PURE__ */ new Set(); + const injections = []; + for (const { module } of configs) { + const key = `${module.name}\0${module.versionRange}\0${String(module.filePath)}`; + if (seen.has(key)) { + continue; + } + seen.add(key); + injections.push({ + channelName: module.name, + module, + astQuery: "Program", + transform: SUBSCRIBE_TRANSFORM_NAME + }); + } + return injections; +} + +exports.SUBSCRIBE_TRANSFORM_NAME = SUBSCRIBE_TRANSFORM_NAME; +exports.toSubscribeInjections = toSubscribeInjections; +//# sourceMappingURL=subscribe-injection.js.map + + +/***/ }), + +/***/ 52715: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const MODULE_NAME = "tedious"; +const FILE_PATH = "lib/connection.js"; +const VERSION_RANGE = ">=1.11.0 <20"; +const METHODS = ["connect", "execSql", "execSqlBatch", "callProcedure", "execBulkLoad", "prepare", "execute"]; +const tediousConfig = METHODS.map((methodName) => ({ + channelName: methodName, + module: { name: MODULE_NAME, versionRange: VERSION_RANGE, filePath: FILE_PATH }, + functionQuery: { className: "Connection", methodName, kind: "Sync" } +})); +const tediousChannels = { + TEDIOUS_CONNECT: "orchestrion:tedious:connect", + TEDIOUS_EXEC_SQL: "orchestrion:tedious:execSql", + TEDIOUS_EXEC_SQL_BATCH: "orchestrion:tedious:execSqlBatch", + TEDIOUS_CALL_PROCEDURE: "orchestrion:tedious:callProcedure", + TEDIOUS_EXEC_BULK_LOAD: "orchestrion:tedious:execBulkLoad", + TEDIOUS_PREPARE: "orchestrion:tedious:prepare", + TEDIOUS_EXECUTE: "orchestrion:tedious:execute" +}; +const tediousSubscribeInjection = subscribeInjection.toSubscribeInjections(tediousConfig); + +exports.tediousChannels = tediousChannels; +exports.tediousConfig = tediousConfig; +exports.tediousSubscribeInjection = tediousSubscribeInjection; +//# sourceMappingURL=tedious.js.map + + +/***/ }), + +/***/ 67449: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const subscribeInjection = __nccwpck_require__(34224); + +const vercelAiConfig = [ + // Vercel AI v6: mirror the v7 native `ai:telemetry` channel by injecting + // channels into the top-level entry points. `resolveLanguageModel` is wrapped + // not to span it, but so the subscriber can monkey-patch `doGenerate`/ + // `doStream` on the returned model (the only way to span the model call, + // which is an inline call with no injectable definition in `ai`). + // `streamText` returns its result synchronously (streaming is lazy), so it's + // `Sync`; the subscriber binds the span via `bindTracingChannelToSpan`, which + // ends it when the (synchronous) call returns. + // The majority of entrypoints are present in all versions we support + ...vercelAiEntries(">=4.0.0 <7.0.0", "generateText", "generateText", "Async"), + ...vercelAiEntries(">=4.0.0 <7.0.0", "streamText", "streamText", "Sync"), + ...vercelAiEntries(">=4.0.0 <7.0.0", "generateObject", "generateObject", "Async"), + ...vercelAiEntries(">=4.0.0 <7.0.0", "embed", "embed", "Async"), + ...vercelAiEntries(">=4.0.0 <7.0.0", "embedMany", "embedMany", "Async"), + // The following entry is only present in v5 and later + ...vercelAiEntries(">=5.0.0 <7.0.0", "resolveLanguageModel", "resolveLanguageModel", "Sync"), + // The following entry is only present in v6 and later + ...vercelAiEntries(">=6.0.0 <7.0.0", "executeToolCall", "executeToolCall", "Async") +]; +const vercelAiChannels = { + // Vercel AI (`ai`): orchestrion injects these so the same channel-based + // integration that consumes `ai`'s native `ai:telemetry` channel (v7) can + // also instrument v4/v5/v6. Each maps to a top-level function in `ai`'s bundle. + // All three versions share the same channel names (the subscriber is version-agnostic); + // `VERCEL_AI_EXECUTE_TOOL_CALL` is v6-only (v4/v5 have no `executeToolCall` export) and + // `VERCEL_AI_RESOLVE_LANGUAGE_MODEL` is v5/v6-only (v4 has no such chokepoint). + VERCEL_AI_GENERATE_TEXT: "orchestrion:ai:generateText", + VERCEL_AI_STREAM_TEXT: "orchestrion:ai:streamText", + VERCEL_AI_GENERATE_OBJECT: "orchestrion:ai:generateObject", + VERCEL_AI_EMBED: "orchestrion:ai:embed", + VERCEL_AI_EMBED_MANY: "orchestrion:ai:embedMany", + VERCEL_AI_EXECUTE_TOOL_CALL: "orchestrion:ai:executeToolCall", + VERCEL_AI_RESOLVE_LANGUAGE_MODEL: "orchestrion:ai:resolveLanguageModel" +}; +function vercelAiEntries(versionRange, channelName, functionName, kind) { + return ["dist/index.js", "dist/index.mjs"].map((filePath) => ({ + channelName, + module: { name: "ai", versionRange, filePath }, + functionQuery: { functionName, kind } + })); +} +const vercelAiSubscribeInjection = subscribeInjection.toSubscribeInjections(vercelAiConfig); + +exports.vercelAiChannels = vercelAiChannels; +exports.vercelAiConfig = vercelAiConfig; +exports.vercelAiSubscribeInjection = vercelAiSubscribeInjection; +//# sourceMappingURL=vercel-ai.js.map + + +/***/ }), + +/***/ 19966: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +function isOrchestrionInjected() { + return !!core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__; +} +function detectOrchestrionSetup() { + const { runtime, bundler } = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__ ?? {}; + if (!runtime && !bundler) { + core.debug.warn( + "[Sentry] No diagnostics-channel injection detected. Channel-based integrations will not record spans. Make sure the diagnostics channels are injected via the runtime `--import` hook or a bundler plugin before the instrumented modules load." + ); + return; + } + core.debug.log( + runtime ? `[Sentry] Runtime hook registered, injected libraries=${JSON.stringify(runtime)}` : "[Sentry] Runtime hook not registered" + ); + core.debug.log( + bundler ? `[Sentry] Bundler plugin ran, injected libraries=${JSON.stringify(bundler)}` : "[Sentry] Bundler plugin did not run" + ); +} + +exports.detectOrchestrionSetup = detectOrchestrionSetup; +exports.isOrchestrionInjected = isOrchestrionInjected; +//# sourceMappingURL=detect.js.map + + +/***/ }), + +/***/ 21496: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const amqplib = __nccwpck_require__(89210); +const anthropic = __nccwpck_require__(9977); +const index = __nccwpck_require__(45112); +const dataloader = __nccwpck_require__(57893); +const genericPool = __nccwpck_require__(42995); +const googleGenai = __nccwpck_require__(3638); +const index$3 = __nccwpck_require__(34663); +const hapi = __nccwpck_require__(83216); +const koa = __nccwpck_require__(38679); +const ioredis = __nccwpck_require__(48453); +const index$4 = __nccwpck_require__(46810); +const knex = __nccwpck_require__(68060); +const langchain = __nccwpck_require__(10304); +const langgraph = __nccwpck_require__(24129); +const lruMemoizer = __nccwpck_require__(38465); +const mongodb = __nccwpck_require__(66394); +const mongoose = __nccwpck_require__(57377); +const mysql = __nccwpck_require__(84664); +const mysql2 = __nccwpck_require__(53764); +const openai = __nccwpck_require__(26102); +const postgres = __nccwpck_require__(70562); +const postgresJs = __nccwpck_require__(21379); +const tedious = __nccwpck_require__(49281); +const vercelAi = __nccwpck_require__(48215); +const index$1 = __nccwpck_require__(7436); +const index$2 = __nccwpck_require__(14736); +const detect = __nccwpck_require__(19966); +const registerChannelIntegration = __nccwpck_require__(85295); +const nestjs = __nccwpck_require__(30904); +const remix = __nccwpck_require__(5614); +const redis = __nccwpck_require__(49871); + +const channelIntegrations = { + postgresIntegration: postgres.postgresChannelIntegration, + postgresJsIntegration: postgresJs.postgresJsChannelIntegration, + mongoIntegration: mongodb.mongodbChannelIntegration, + mysqlIntegration: mysql.mysqlChannelIntegration, + mysql2Integration: mysql2.mysql2ChannelIntegration, + genericPoolIntegration: genericPool.genericPoolChannelIntegration, + mongooseIntegration: mongoose.mongooseChannelIntegration, + lruMemoizerIntegration: lruMemoizer.lruMemoizerChannelIntegration, + openaiIntegration: openai.openaiChannelIntegration, + anthropicIntegration: anthropic.anthropicChannelIntegration, + googleGenAIIntegration: googleGenai.googleGenAIChannelIntegration, + langChainIntegration: langchain.langChainChannelIntegration, + langGraphIntegration: langgraph.langGraphChannelIntegration, + vercelAiIntegration: vercelAi.vercelAiChannelIntegration, + amqplibIntegration: amqplib.amqplibChannelIntegration, + hapiIntegration: hapi.hapiChannelIntegration, + koaIntegration: koa.koaChannelIntegration, + expressIntegration: index$1.expressChannelIntegration, + graphqlIntegration: index$3.graphqlDiagnosticsChannelIntegration, + kafkajsIntegration: index$4.kafkajsChannelIntegration, + tediousIntegration: tedious.tediousChannelIntegration, + awsIntegration: index.awsChannelIntegration, + firebaseIntegration: index$2.firebaseChannelIntegration +}; + +exports.amqplibChannelIntegration = amqplib.amqplibChannelIntegration; +exports.anthropicChannelIntegration = anthropic.anthropicChannelIntegration; +exports.awsChannelIntegration = index.awsChannelIntegration; +exports.dataloaderChannelIntegration = dataloader.dataloaderChannelIntegration; +exports.genericPoolChannelIntegration = genericPool.genericPoolChannelIntegration; +exports.googleGenAIChannelIntegration = googleGenai.googleGenAIChannelIntegration; +exports.graphqlChannelIntegration = index$3.graphqlChannelIntegration; +exports.hapiChannelIntegration = hapi.hapiChannelIntegration; +exports.koaChannelIntegration = koa.koaChannelIntegration; +exports.ioredisChannelIntegration = ioredis.ioredisChannelIntegration; +exports.kafkajsChannelIntegration = index$4.kafkajsChannelIntegration; +exports.knexChannelIntegration = knex.knexChannelIntegration; +exports.langChainChannelIntegration = langchain.langChainChannelIntegration; +exports.langGraphChannelIntegration = langgraph.langGraphChannelIntegration; +exports.lruMemoizerChannelIntegration = lruMemoizer.lruMemoizerChannelIntegration; +exports.mongodbChannelIntegration = mongodb.mongodbChannelIntegration; +exports.mongooseChannelIntegration = mongoose.mongooseChannelIntegration; +exports.mysqlChannelIntegration = mysql.mysqlChannelIntegration; +exports.mysql2ChannelIntegration = mysql2.mysql2ChannelIntegration; +exports.openaiChannelIntegration = openai.openaiChannelIntegration; +exports.postgresChannelIntegration = postgres.postgresChannelIntegration; +exports.postgresJsChannelIntegration = postgresJs.postgresJsChannelIntegration; +exports.tediousChannelIntegration = tedious.tediousChannelIntegration; +exports.vercelAiChannelIntegration = vercelAi.vercelAiChannelIntegration; +exports.expressChannelIntegration = index$1.expressChannelIntegration; +exports.firebaseChannelIntegration = index$2.firebaseChannelIntegration; +exports.detectOrchestrionSetup = detect.detectOrchestrionSetup; +exports.isOrchestrionInjected = detect.isOrchestrionInjected; +exports.registerOrchestrionChannelIntegration = registerChannelIntegration.registerOrchestrionChannelIntegration; +exports.nestjsChannels = nestjs.nestjsChannels; +exports.remixChannels = remix.remixChannels; +exports.redisChannelIntegration = redis.redisChannelIntegration; +exports.channelIntegrations = channelIntegrations; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 85295: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +function registerOrchestrionChannelIntegration(name, integrationFn) { + var _a; + const marker = (_a = core.GLOBAL_OBJ).__SENTRY_ORCHESTRION__ ?? (_a.__SENTRY_ORCHESTRION__ = {}); + (marker.integrations ?? (marker.integrations = /* @__PURE__ */ new Map())).set(name, integrationFn); + core.getClient()?.addIntegration(integrationFn()); +} + +exports.registerOrchestrionChannelIntegration = registerOrchestrionChannelIntegration; +//# sourceMappingURL=registerChannelIntegration.js.map + + +/***/ }), + +/***/ 63503: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const Module = __nccwpck_require__(82033); +const node_url = __nccwpck_require__(41041); +const node_worker_threads = __nccwpck_require__(24086); +const index = __nccwpck_require__(75149); + +function hasStableSyncModuleHooks(denoVersionString) { + const parseVersion = (v) => v.split(".").map((n) => parseInt(n, 10)); + const nodeVersion = parseVersion(process.versions.node ?? "0.0.0"); + const denoVersion = parseVersion(denoVersionString ?? "0.0.0"); + return (nodeVersion[0] ?? 0) > 25 || nodeVersion[0] === 25 && (nodeVersion[1] ?? 0) >= 1 || nodeVersion[0] === 24 && (nodeVersion[1] ?? 0) >= 13 || (denoVersion[0] ?? 0) > 2 || denoVersion[0] === 2 && (denoVersion[1] ?? 0) >= 8; +} +function registerDiagnosticsChannelInjection(options) { + if (!node_worker_threads.isMainThread && !node_worker_threads.parentPort) { + return; + } + if (core.GLOBAL_OBJ?.__SENTRY_ORCHESTRION__?.runtime) { + return; + } + const globalAny = globalThis; + const stableSyncHooks = hasStableSyncModuleHooks(globalAny.Deno?.version?.deno); + let thisModuleUrl; + thisModuleUrl = node_url.pathToFileURL(__filename).href; + let nodeRequire; + nodeRequire = require; + const tracingHooksDir = options?.tracingHooksDir; + const requireFromHooksDir = tracingHooksDir ? Module.createRequire(thisModuleUrl) : void 0; + const mod = Module; + try { + const { setDiagnosticsHook } = requireFromHooksDir ? requireFromHooksDir(`${tracingHooksDir}/lib/diagnostics.js`) : nodeRequire("@apm-js-collab/tracing-hooks/lib/diagnostics.js"); + const onDiagnostics = ({ moduleName, error }) => { + if (error) { + core.debug.warn(`[orchestrion] failed to inject diagnostics-channel into ${moduleName}:`, error); + } else { + core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__ = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__ || {}; + core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime || []; + core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime.push(moduleName); + } + }; + setDiagnosticsHook(onDiagnostics); + if (typeof mod.registerHooks === "function" && stableSyncHooks) { + const { initialize, resolve, load } = requireFromHooksDir ? requireFromHooksDir(`${tracingHooksDir}/hook-sync.mjs`) : nodeRequire("@apm-js-collab/tracing-hooks/hook-sync.mjs"); + initialize({ instrumentations: index.SENTRY_INSTRUMENTATIONS }); + mod.registerHooks({ resolve, load }); + core.debug.log("Registered diagnostics-channel injection via Module.registerHooks()"); + } else if (typeof mod.register === "function" && !globalAny.Bun && !globalAny.Deno) { + const hookSpecifier = tracingHooksDir ? node_url.pathToFileURL(`${tracingHooksDir}/hook.mjs`).href : "@apm-js-collab/tracing-hooks/hook.mjs"; + const { port1, port2 } = new node_worker_threads.MessageChannel(); + port1.on("message", onDiagnostics); + port1.unref(); + mod.register(hookSpecifier, { + parentURL: thisModuleUrl, + data: { instrumentations: index.SENTRY_INSTRUMENTATIONS, diagnosticsPort: port2 }, + transferList: [port2] + }); + const ModulePatch = requireFromHooksDir && tracingHooksDir ? requireFromHooksDir(tracingHooksDir) : nodeRequire("@apm-js-collab/tracing-hooks"); + new ModulePatch({ instrumentations: index.SENTRY_INSTRUMENTATIONS }).patch(); + core.debug.log("Registered diagnostics-channel injection via Module.register()"); + } else { + core.debug.warn("No available Node API to register diagnostics-channel injection hooks; skipping."); + return; + } + } catch (error) { + core.debug.warn( + "Failed to register diagnostics-channel injection hooks; channel-based integrations will not record spans.", + error + ); + return; + } + core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__ = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__ || {}; + core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime || []; +} + +exports.registerDiagnosticsChannelInjection = registerDiagnosticsChannelInjection; +//# sourceMappingURL=register.js.map + + +/***/ }), + +/***/ 67722: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const majorVersion = "7"; +const GLOBAL_INSTRUMENTATION_KEY = "PRISMA_INSTRUMENTATION"; +const GLOBAL_VERSIONED_INSTRUMENTATION_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`; +const globalThisWithPrismaInstrumentation = globalThis; +function setGlobalTracingHelper(helper) { + const globalValue = { helper }; + globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = globalValue; + globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = globalValue; +} + +exports.setGlobalTracingHelper = setGlobalTracingHelper; +//# sourceMappingURL=global.js.map + + +/***/ }), + +/***/ 70068: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const global = __nccwpck_require__(67722); +const tracingHelper = __nccwpck_require__(16770); + +const INTEGRATION_NAME = "Prisma"; +function instrumentPrisma(options) { + global.setGlobalTracingHelper( + new tracingHelper.ActiveTracingHelper({ + ignoreSpanTypes: options?.instrumentationConfig?.ignoreSpanTypes ?? [] + }) + ); +} +const _prismaIntegration = ((options) => { + return { + name: INTEGRATION_NAME, + setupOnce() { + instrumentPrisma(options); + } + }; +}); +const prismaIntegration = core.defineIntegration(_prismaIntegration); + +exports.instrumentPrisma = instrumentPrisma; +exports.prismaIntegration = prismaIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 16770: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const attributes = __nccwpck_require__(88264); + +const showAllTraces = (() => { + try { + return process.env.PRISMA_SHOW_ALL_TRACES === "true"; + } catch { + return false; + } +})(); +const nonSampledTraceParent = `00-10-10-00`; +const PRISMA_ORIGIN = "auto.db.otel.prisma"; +const MAX_TRACKED_PRISMA_SPANS = 1e3; +const prismaSpanRegistry = new core.LRUMap(MAX_TRACKED_PRISMA_SPANS); +const pendingEngineSpans = []; +function registerPrismaSpan(id, span) { + prismaSpanRegistry.set(id, span); +} +function buildSpanAttributes(name, attributes$1) { + const merged = { + ...attributes$1, + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRISMA_ORIGIN + }; + if (name === "prisma:engine:db_query" && merged[attributes.DB_SYSTEM] == null) { + merged[attributes.DB_SYSTEM] = "prisma"; + } + return merged; +} +function buildSpanName(name, attributes) { + const queryText = attributes["db.query.text"]; + if ((name === "prisma:engine:db_query" || name === "prisma:client:db_query") && typeof queryText === "string") { + return queryText; + } + return name; +} +function createResolvedEngineSpans() { + let createdSpan = true; + while (createdSpan) { + createdSpan = false; + for (let i = pendingEngineSpans.length - 1; i >= 0; i--) { + const engineSpan = pendingEngineSpans[i]; + const parentSpan = prismaSpanRegistry.get(engineSpan.parent_span_id); + if (!parentSpan) { continue; } - - if (isTokenChar(code)) { - if (start === -1) start = i; - } else if (code === 0x3D/*'='*/ && start !== -1) { - parameter = header.slice(start, i).toLowerCase(); - start = -1; - } else { - throw new ParseError(unexpectedCharacterMessage(header, i), header); - } - } else { - if (isEscaping && (code === 0x09 || isPrint(code) || isExtended(code))) { - isEscaping = false; - } else if (isTokenChar(code)) { - if (end !== -1) { - throw new ParseError(unexpectedCharacterMessage(header, i), header); - } - - if (start === -1) start = i; - } else if (isDelimiter(code) || isExtended(code)) { - if (inQuotes) { - if (code === 0x22/*'"'*/) { - inQuotes = false; - end = i; - } else if (code === 0x5C/*'\'*/) { - if (start === -1) start = i; - isEscaping = mustUnescape = true; - } else if (start === -1) { - start = i; - } - } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3D) { - inQuotes = true; - } else if ( - (code === 0x2C/*','*/|| code === 0x3B/*';'*/) && - (start !== -1 || end !== -1) - ) { - if (start !== -1) { - if (end === -1) end = i; - forwarded[parameter] = mustUnescape - ? decode(header.slice(start, end)) - : header.slice(start, end); - } else { - forwarded[parameter] = ''; - } - - if (code === 0x2C) { - output.push(forwarded); - forwarded = {}; - } - - parameter = undefined; - start = end = -1; - } else { - throw new ParseError(unexpectedCharacterMessage(header, i), header); - } - } else if (code === 0x20 || code === 0x09) { - if (end !== -1) continue; - - if (inQuotes) { - if (start === -1) start = i; - } else if (start !== -1) { - end = i; - } else { - throw new ParseError(unexpectedCharacterMessage(header, i), header); - } - } else { - throw new ParseError(unexpectedCharacterMessage(header, i), header); - } - } - } - - if ( - parameter === undefined || - inQuotes || - (start === -1 && end === -1) || - code === 0x20 || - code === 0x09 - ) { - throw new ParseError('Unexpected end of input', header); - } - - if (start !== -1) { - if (end === -1) end = i; - forwarded[parameter] = mustUnescape - ? decode(header.slice(start, end)) - : header.slice(start, end); - } else { - forwarded[parameter] = ''; - } - - output.push(forwarded); - return output; -} - -module.exports = parse; - - -/***/ }), - -/***/ 32789: -/***/ ((module) => { - -"use strict"; - - -/** - * Check if a character is a delimiter as defined in section 3.2.6 of RFC 7230. - * - * - * @param {number} code The code of the character to check. - * @returns {boolean} `true` if the character is a delimiter, else `false`. - * @public - */ -function isDelimiter(code) { - return code === 0x22 // '"' - || code === 0x28 // '(' - || code === 0x29 // ')' - || code === 0x2C // ',' - || code === 0x2F // '/' - || code >= 0x3A && code <= 0x40 // ':', ';', '<', '=', '>', '?' '@' - || code >= 0x5B && code <= 0x5D // '[', '\', ']' - || code === 0x7B // '{' - || code === 0x7D; // '}' -} - -/** - * Check if a character is allowed in a token as defined in section 3.2.6 - * of RFC 7230. - * - * @param {number} code The code of the character to check. - * @returns {boolean} `true` if the character is allowed, else `false`. - * @public - */ -function isTokenChar(code) { - return code === 0x21 // '!' - || code >= 0x23 && code <= 0x27 // '#', '$', '%', '&', ''' - || code === 0x2A // '*' - || code === 0x2B // '+' - || code === 0x2D // '-' - || code === 0x2E // '.' - || code >= 0x30 && code <= 0x39 // 0-9 - || code >= 0x41 && code <= 0x5A // A-Z - || code >= 0x5E && code <= 0x7A // '^', '_', '`', a-z - || code === 0x7C // '|' - || code === 0x7E; // '~' -} - -/** - * Check if a character is a printable ASCII character. - * - * @param {number} code The code of the character to check. - * @returns {boolean} `true` if `code` is in the %x20-7E range, else `false`. - * @public - */ -function isPrint(code) { - return code >= 0x20 && code <= 0x7E; -} - -/** - * Check if a character is an extended ASCII character. - * - * @param {number} code The code of the character to check. - * @returns {boolean} `true` if `code` is in the %x80-FF range, else `false`. - * @public - */ -function isExtended(code) { - return code >= 0x80 && code <= 0xFF; -} - -module.exports = { - isDelimiter: isDelimiter, - isTokenChar: isTokenChar, - isExtended: isExtended, - isPrint: isPrint -}; - - -/***/ }), - -/***/ 558: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var util = __nccwpck_require__(73837); - -/** - * An error thrown by the parser on unexpected input. - * - * @constructor - * @param {string} message The error message. - * @param {string} input The unexpected input. - * @public - */ -function ParseError(message, input) { - Error.captureStackTrace(this, ParseError); - - this.name = this.constructor.name; - this.message = message; - this.input = input; -} - -util.inherits(ParseError, Error); - -module.exports = ParseError; - - -/***/ }), - -/***/ 19320: -/***/ ((module) => { - -"use strict"; - - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var toStr = Object.prototype.toString; -var max = Math.max; -var funcType = '[object Function]'; - -var concatty = function concatty(a, b) { - var arr = []; - - for (var i = 0; i < a.length; i += 1) { - arr[i] = a[i]; - } - for (var j = 0; j < b.length; j += 1) { - arr[j + a.length] = b[j]; - } - - return arr; -}; - -var slicy = function slicy(arrLike, offset) { - var arr = []; - for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { - arr[j] = arrLike[i]; - } - return arr; -}; - -var joiny = function (arr, joiner) { - var str = ''; - for (var i = 0; i < arr.length; i += 1) { - str += arr[i]; - if (i + 1 < arr.length) { - str += joiner; - } - } - return str; -}; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.apply(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slicy(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - concatty(args, arguments) - ); - if (Object(result) === result) { - return result; - } - return this; - } - return target.apply( - that, - concatty(args, arguments) + const attributes = buildSpanAttributes(engineSpan.name, engineSpan.attributes); + const span = core.startInactiveSpan({ + name: buildSpanName(engineSpan.name, attributes), + attributes, + kind: engineSpan.kind === "client" ? core.SPAN_KIND.CLIENT : core.SPAN_KIND.INTERNAL, + startTime: engineSpan.start_time, + parentSpan + }); + registerPrismaSpan(engineSpan.span_id, span); + if (engineSpan.links) { + span.addLinks( + engineSpan.links.flatMap((link) => { + const linkedSpan = prismaSpanRegistry.get(link.span_id); + return linkedSpan ? [{ context: linkedSpan.spanContext() }] : []; + }) ); - + } + span.end(engineSpan.end_time); + pendingEngineSpans.splice(i, 1); + createdSpan = true; + } + } +} +class ActiveTracingHelper { + constructor({ ignoreSpanTypes }) { + this.ignoreSpanTypes = ignoreSpanTypes; + } + isEnabled() { + return true; + } + getTraceParent(span) { + const spanContext = (span ?? core.getActiveSpan())?.spanContext(); + if (spanContext) { + return `00-${spanContext.traceId}-${spanContext.spanId}-0${spanContext.traceFlags}`; + } + return nonSampledTraceParent; + } + dispatchEngineSpans(spans) { + const linkIds = /* @__PURE__ */ new Map(); + const roots = spans.filter((span) => span.parentId === null); + for (const root of roots) { + dispatchEngineSpan(root, spans, linkIds, this.ignoreSpanTypes); + } + } + /** + * Prisma v5 broke the tracing helper interface with the v6 major, replacing `createEngineSpan` with + * `dispatchEngineSpans`. We implement the v6/v7 interface (`dispatchEngineSpans`) but also keep this + * v5-only method so the same helper doesn't blow up in Prisma 5 users' faces, minting v5 engine spans + * through Sentry's span APIs instead of crashing. + */ + createEngineSpan(engineSpanEvent) { + pendingEngineSpans.push(...engineSpanEvent.spans); + createResolvedEngineSpans(); + const overflow = pendingEngineSpans.length - MAX_TRACKED_PRISMA_SPANS; + if (overflow > 0) { + debugBuild.DEBUG_BUILD && core.debug.log(`[Prisma] Dropping ${overflow} unresolved v5 engine span(s) whose parent was never registered.`); + pendingEngineSpans.splice(0, overflow); + } + } + getActiveContext() { + return core.getActiveSpan(); + } + runInChildSpan(nameOrOptions, callback) { + const options = typeof nameOrOptions === "string" ? { name: nameOrOptions } : nameOrOptions; + if (options.internal && !showAllTraces) { + return callback(); + } + const name = `prisma:client:${options.name}`; + if (shouldIgnoreSpan(name, this.ignoreSpanTypes)) { + return callback(); + } + const parentSpan = core.getActiveSpan(); + const attributes = buildSpanAttributes(name, options.attributes); + const spanOptions = { + name: buildSpanName(name, attributes), + attributes, + kind: options.kind, + links: options.links, + startTime: options.startTime, + parentSpan }; - - var boundLength = max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs[i] = '$' + i; + if (options.active === false) { + const span = core.startInactiveSpan(spanOptions); + registerPrismaSpan(span.spanContext().spanId, span); + return endSpan(span, () => callback(span, parentSpan)); } - - bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; + return core.startSpanManual(spanOptions, (span) => { + registerPrismaSpan(span.spanContext().spanId, span); + return endSpan(span, () => callback(span, parentSpan)); + }); + } +} +function dispatchEngineSpan(engineSpan, allSpans, linkIds, ignoreSpanTypes) { + if (shouldIgnoreSpan(engineSpan.name, ignoreSpanTypes)) { + return; + } + const attributes = buildSpanAttributes(engineSpan.name, engineSpan.attributes); + core.startSpanManual( + { + name: buildSpanName(engineSpan.name, attributes), + attributes, + kind: engineSpan.kind === "client" ? core.SPAN_KIND.CLIENT : core.SPAN_KIND.INTERNAL, + startTime: engineSpan.startTime + }, + (span) => { + linkIds.set(engineSpan.id, span.spanContext().spanId); + if (engineSpan.links) { + span.addLinks( + engineSpan.links.flatMap((link) => { + const linkedId = linkIds.get(link); + if (!linkedId) { + return []; + } + return { + context: { + spanId: linkedId, + traceId: span.spanContext().traceId, + traceFlags: span.spanContext().traceFlags + } + }; + }) + ); + } + const children = allSpans.filter((s) => s.parentId === engineSpan.id); + for (const child of children) { + dispatchEngineSpan(child, allSpans, linkIds, ignoreSpanTypes); + } + span.end(engineSpan.endTime); } + ); +} +function endSpan(span, run) { + let result; + try { + result = run(); + } catch (reason) { + span.end(); + throw reason; + } + if (isPromiseLike(result)) { + return result.then( + (value) => { + span.end(); + return value; + }, + (reason) => { + span.end(); + throw reason; + } + ); + } + span.end(); + return result; +} +function isPromiseLike(value) { + return value != null && typeof value["then"] === "function"; +} +function shouldIgnoreSpan(spanName, ignoreSpanTypes) { + return ignoreSpanTypes.some((pattern) => typeof pattern === "string" ? pattern === spanName : pattern.test(spanName)); +} - return bound; -}; +exports.ActiveTracingHelper = ActiveTracingHelper; +//# sourceMappingURL=tracing-helper.js.map /***/ }), -/***/ 88334: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +/***/ 82500: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const diagnosticsChannel = __nccwpck_require__(65714); +const redisDcSubscriber = __nccwpck_require__(87042); + +const _redisIntegration = ((options = {}) => { + return { + name: "Redis", + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + redisDcSubscriber.subscribeRedisDiagnosticChannels(diagnosticsChannel.tracingChannel, options.responseHook); + }); + } + }; +}); +const redisIntegration = core.defineIntegration(_redisIntegration); + +exports.redisIntegration = redisIntegration; +//# sourceMappingURL=index.js.map -var implementation = __nccwpck_require__(19320); +/***/ }), -module.exports = Function.prototype.bind || implementation; +/***/ 87042: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const core = __nccwpck_require__(84466); +const tracingChannel = __nccwpck_require__(91484); + +const REDIS_DC_CHANNEL_COMMAND = "node-redis:command"; +const REDIS_DC_CHANNEL_BATCH = "node-redis:batch"; +const REDIS_DC_CHANNEL_CONNECT = "node-redis:connect"; +const IOREDIS_DC_CHANNEL_COMMAND = "ioredis:command"; +const IOREDIS_DC_CHANNEL_CONNECT = "ioredis:connect"; +const ORIGIN = "auto.db.redis.diagnostic_channel"; +const DB_SYSTEM_NAME_VALUE_REDIS = "redis"; +function subscribeRedisDiagnosticChannels(tracingChannel, responseHook) { + setupCommandChannel( + tracingChannel, + REDIS_DC_CHANNEL_COMMAND, + (data) => data.args.slice(1), + responseHook + ); + setupBatchChannel( + tracingChannel, + REDIS_DC_CHANNEL_BATCH, + (data) => data.batchMode === "PIPELINE" ? "PIPELINE" : "MULTI" + ); + setupConnectChannel(tracingChannel, REDIS_DC_CHANNEL_CONNECT); + setupCommandChannel(tracingChannel, IOREDIS_DC_CHANNEL_COMMAND, (data) => data.args, responseHook); + setupConnectChannel(tracingChannel, IOREDIS_DC_CHANNEL_CONNECT); +} +function setupCommandChannel(tracingChannel$1, channelName, getCommandArgs, responseHook) { + tracingChannel.bindTracingChannelToSpan( + tracingChannel$1(channelName), + (data) => { + const args = getCommandArgs(data); + const statement = args.length ? `${data.command} ${args.join(" ")}` : data.command; + return core.startInactiveSpan({ + name: `redis-${data.command}`, + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db.redis", + [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_REDIS, + [attributes.DB_QUERY_TEXT]: statement, + ...data.serverAddress != null ? { [attributes.SERVER_ADDRESS]: data.serverAddress } : {}, + ...data.serverPort != null ? { [attributes.SERVER_PORT]: data.serverPort } : {} + } + }); + }, + { + beforeSpanEnd(span, data) { + if ("error" in data) return; + runResponseHook(responseHook, span, data.command, getCommandArgs(data), data.result); + } + } + ); +} +function setupBatchChannel(tracingChannel$1, channelName, getOperationName) { + tracingChannel.bindTracingChannelToSpan(tracingChannel$1(channelName), (data) => { + return core.startInactiveSpan({ + name: getOperationName(data), + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db.redis", + [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_REDIS, + // should only include batch size greater than 1, + // or else it isn't properly considered a "batch" + ...Number(data.batchSize) > 1 ? { [attributes.DB_OPERATION_BATCH_SIZE]: data.batchSize } : {}, + ...data.serverAddress != null ? { [attributes.SERVER_ADDRESS]: data.serverAddress } : {}, + ...data.serverPort != null ? { [attributes.SERVER_PORT]: data.serverPort } : {} + } + }); + }); +} +function setupConnectChannel(tracingChannel$1, channelName) { + tracingChannel.bindTracingChannelToSpan(tracingChannel$1(channelName), (data) => { + return core.startInactiveSpan({ + name: "redis-connect", + attributes: { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db.redis.connect", + [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_REDIS, + ...data.serverAddress != null ? { [attributes.SERVER_ADDRESS]: data.serverAddress } : {}, + ...data.serverPort != null ? { [attributes.SERVER_PORT]: data.serverPort } : {} + } + }); + }); +} +function runResponseHook(hook, span, command, args, result) { + if (!hook) return; + try { + hook(span, command, args, result); + } catch { + } +} + +exports.IOREDIS_DC_CHANNEL_COMMAND = IOREDIS_DC_CHANNEL_COMMAND; +exports.IOREDIS_DC_CHANNEL_CONNECT = IOREDIS_DC_CHANNEL_CONNECT; +exports.REDIS_DC_CHANNEL_BATCH = REDIS_DC_CHANNEL_BATCH; +exports.REDIS_DC_CHANNEL_COMMAND = REDIS_DC_CHANNEL_COMMAND; +exports.REDIS_DC_CHANNEL_CONNECT = REDIS_DC_CHANNEL_CONNECT; +exports.subscribeRedisDiagnosticChannels = subscribeRedisDiagnosticChannels; +//# sourceMappingURL=redis-dc-subscriber.js.map + + +/***/ }), + +/***/ 57915: +/***/ ((__unused_webpack_module, exports) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const serializationSubsets = [ + { + regex: /^ECHO/i, + args: 0 + }, + { + regex: /^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i, + args: 1 + }, + { + regex: /^(HSET|HMSET|LSET|LINSERT)/i, + args: 2 + }, + { + regex: /^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i, + args: -1 + } +]; +const defaultDbStatementSerializer = (cmdName, cmdArgs) => { + if (Array.isArray(cmdArgs) && cmdArgs.length) { + const nArgsToSerialize = serializationSubsets.find(({ regex }) => regex.test(cmdName))?.args ?? 0; + const argsToSerialize = nArgsToSerialize >= 0 ? cmdArgs.slice(0, nArgsToSerialize) : cmdArgs.slice(); + if (cmdArgs.length > argsToSerialize.length) { + argsToSerialize.push(`[${cmdArgs.length - nArgsToSerialize} other arguments]`); + } + return `${cmdName} ${argsToSerialize.join(" ")}`; + } + return cmdName; +}; + +exports.defaultDbStatementSerializer = defaultDbStatementSerializer; +//# sourceMappingURL=redis-statement-serializer.js.map + + +/***/ }), + +/***/ 91484: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const attributes = __nccwpck_require__(88264); + +const NOOP = () => { +}; +function bindTracingChannelToSpan(channel, getSpan, opts) { + const handle = bindSpanToChannelStore(channel, getSpan, opts); + const beforeSpanEnd = opts?.beforeSpanEnd; + const deferSpanEnd = opts?.deferSpanEnd; + const getErrorHint = (e) => { + if (typeof opts?.captureError === "function") { + return opts.captureError(e); + } + return { + mechanism: { + type: "auto.diagnostic_channels.bind_span", + handled: false + } + }; + }; + const annotateSpanError = (span, error) => { + if (opts?.captureError) { + core.captureException(error, getErrorHint(error)); + } + const { message, attributes } = getErrorInfo(error); + span.setStatus({ code: core.SPAN_STATUS_ERROR, message }); + span.setAttributes(attributes); + }; + const makeDeferredEnd = (span, data) => { + let ended = false; + return (error) => { + if (ended) { + return; + } + ended = true; + if (error !== void 0) { + annotateSpanError(span, error); + } + endBoundSpan(data, beforeSpanEnd); + }; + }; + const subscribers = { + start: NOOP, + asyncStart: NOOP, + end(data) { + if ("error" in data || "result" in data) { + const span = data._sentrySpan; + if (span && deferSpanEnd?.({ span, data, end: makeDeferredEnd(span, data) })) { + return; + } + endBoundSpan(data, beforeSpanEnd); + } + }, + error(data) { + const span = data._sentrySpan; + if (!span) { + return; + } + annotateSpanError(span, data.error); + }, + asyncEnd(data) { + const span = data._sentrySpan; + if (span && deferSpanEnd?.({ span, data, end: makeDeferredEnd(span, data) })) { + return; + } + endBoundSpan(data, beforeSpanEnd); + } + }; + handle.channel.subscribe(subscribers); + return { + channel: handle.channel, + unbind: () => { + handle.channel.unsubscribe(subscribers); + handle.unbind(); + } + }; +} +function bindSpanToChannelStore(channel, getSpan, opts) { + const binding = core.getAsyncContextStrategy(core.getMainCarrier()).getTracingChannelBinding?.(); + if (!binding) { + debugBuild.DEBUG_BUILD && core.debug.log("[TracingChannel] Could not access async context binding."); + return { + channel, + unbind: NOOP + }; + } + const asyncLocalStorage = binding.asyncLocalStorage; + channel.start.bindStore(asyncLocalStorage, (data) => { + data._sentryCallerStore = asyncLocalStorage.getStore(); + const shouldGetSpan = !opts?.requiresParentSpan || core.getActiveSpan(); + const span = shouldGetSpan ? getSpan(data) : void 0; + if (!span) { + return data._sentryCallerStore; + } + data._sentrySpan = span; + return binding.getStoreWithActiveSpan(span); + }); + channel.asyncStart.bindStore(asyncLocalStorage, (data) => { + return data._sentryCallerStore; + }); + return { + channel, + unbind: () => { + channel.start.unbindStore(asyncLocalStorage); + channel.asyncStart.unbindStore(asyncLocalStorage); + } + }; +} +function endBoundSpan(data, beforeSpanEnd) { + const span = data._sentrySpan; + if (!span) { + return; + } + beforeSpanEnd?.(span, data); + span.end(); +} +function getErrorInfo(error) { + const errorIsObject = core.isObjectLike(error); + const raw = errorIsObject ? "message" in error ? error.message : void 0 : error; + const message = raw ? String(raw) : void 0; + const type = errorIsObject && "name" in error ? String(error.name) : "unknown"; + return { + message, + attributes: { + [attributes.ERROR_TYPE]: type + } + }; +} + +exports.bindTracingChannelToSpan = bindTracingChannelToSpan; +//# sourceMappingURL=tracing-channel.js.map + + +/***/ }), + +/***/ 17611: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const vercelAiDcSubscriber = __nccwpck_require__(47635); +const diagnosticsChannel = __nccwpck_require__(65714); + +const _vercelAiIntegration = ((options = {}) => { + return { + name: "VercelAI", + setupOnce() { + if (!diagnosticsChannel.tracingChannel) { + return; + } + core.waitForTracingChannelBinding(() => { + vercelAiDcSubscriber.subscribeVercelAiTracingChannel(diagnosticsChannel.tracingChannel, options); + }); + } + }; +}); +const vercelAiIntegration = core.defineIntegration(_vercelAiIntegration); + +exports.vercelAiIntegration = vercelAiIntegration; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 12840: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); + +function asString(value) { + return typeof value === "string" ? value : void 0; +} +function asNumber(value) { + return typeof value === "number" && !isNaN(value) ? value : void 0; +} +function sum(a, b) { + return a === void 0 && b === void 0 ? void 0 : (a ?? 0) + (b ?? 0); +} +function isReadableStream(value) { + return core.isObjectLike(value) && typeof value.pipeThrough === "function" && typeof value.getReader === "function"; +} +function tapModelCallStream(stream, onFinal, onError) { + const reader = stream.getReader(); + const state = { toolCalls: [] }; + let text = ""; + let settled = false; + const finalize = () => { + if (settled) { + return; + } + settled = true; + if (text) { + state.text = text; + } + onFinal(state); + }; + const fail = (error) => { + if (settled) { + return; + } + settled = true; + onError(error); + }; + return new ReadableStream({ + async pull(controller) { + try { + const { done, value } = await reader.read(); + if (done) { + finalize(); + controller.close(); + return; + } + text += accumulateChunk(state, value) ?? ""; + controller.enqueue(value); + } catch (error) { + fail(error); + controller.error(error); + } + }, + cancel(reason) { + finalize(); + return reader.cancel(reason); + } + }); +} +function accumulateChunk(state, chunk) { + if (!core.isObjectLike(chunk)) { + return void 0; + } + const { + type, + delta, + textDelta, + id, + modelId, + toolCallId, + toolName, + input, + args, + finishReason, + usage, + providerMetadata + } = chunk; + switch (type) { + case "text-delta": { + const textChunk = delta ?? textDelta; + return typeof textChunk === "string" ? textChunk : void 0; + } + case "tool-call": + state.toolCalls.push({ toolCallId, toolName, input: input ?? args }); + return void 0; + case "response-metadata": + if (typeof id === "string") { + state.responseId = id; + } + if (typeof modelId === "string") { + state.responseModel = modelId; + } + return void 0; + case "finish": + state.finishReason = finishReason; + state.usage = usage; + if (providerMetadata !== void 0) { + state.providerMetadata = providerMetadata; + } + return void 0; + default: + return void 0; + } +} + +exports.asNumber = asNumber; +exports.asString = asString; +exports.isReadableStream = isReadableStream; +exports.sum = sum; +exports.tapModelCallStream = tapModelCallStream; +//# sourceMappingURL=util.js.map + + +/***/ }), + +/***/ 47635: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const attributes = __nccwpck_require__(88264); +const op = __nccwpck_require__(83678); +const core = __nccwpck_require__(84466); +const tracingChannel = __nccwpck_require__(91484); +const util = __nccwpck_require__(12840); + +const AI_SDK_TELEMETRY_TRACING_CHANNEL = "ai:telemetry"; +const ORIGIN = "auto.vercelai.channel"; +const GEN_AI_TOOL_CALL_ID_ATTRIBUTE = "gen_ai.tool.call.id"; +const GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE = "gen_ai.tool.description"; +const GEN_AI_EMBEDDINGS_OPERATION = "embeddings"; +const GEN_AI_RERANK_OPERATION = "rerank"; +const GEN_AI_GENERATE_CONTENT_OPERATION = "generate_content"; +const WORKERS_AI_INTEGRATION_NAME = "WorkersAI"; +const VERCEL_AI_OPERATION_ID_ATTRIBUTE = "vercel.ai.operationId"; +const VERCEL_AI_MODEL_PROVIDER_ATTRIBUTE = "vercel.ai.model.provider"; +const VERCEL_AI_SETTINGS_MAX_RETRIES_ATTRIBUTE = "vercel.ai.settings.maxRetries"; +const operationIdByCallId = /* @__PURE__ */ new Map(); +const toolDescriptionsByCallId = /* @__PURE__ */ new Map(); +const invokeAgentSpanByCallId = /* @__PURE__ */ new Map(); +const ROOT_OPERATION_TYPES = /* @__PURE__ */ new Set([ + "generateText", + "streamText", + "generateObject", + "embed", + "embedMany", + "rerank" +]); +function clearOperationId(data) { + if (!ROOT_OPERATION_TYPES.has(data.type)) { + return; + } + const callId = util.asString(data.event.callId); + if (callId) { + clearOperationCallId(callId); + } +} +function clearOperationCallId(callId) { + operationIdByCallId.delete(callId); + toolDescriptionsByCallId.delete(callId); + invokeAgentSpanByCallId.delete(callId); +} +function recordToolDescriptions(callId, tools) { + if (!callId || !Array.isArray(tools)) { + return; + } + let descriptions = toolDescriptionsByCallId.get(callId); + for (const tool of tools) { + if (core.isObjectLike(tool) && typeof tool.name === "string" && typeof tool.description === "string") { + descriptions = descriptions ?? /* @__PURE__ */ new Map(); + if (!descriptions.has(tool.name)) { + descriptions.set(tool.name, tool.description); + } + } + } + if (descriptions) { + toolDescriptionsByCallId.set(callId, descriptions); + } +} +function resolveToolDescription(callId, toolName, tools) { + const fromMap = callId ? toolDescriptionsByCallId.get(callId)?.get(toolName) : void 0; + if (fromMap) { + return fromMap; + } + if (Array.isArray(tools)) { + const match = tools.find((tool) => core.isObjectLike(tool) && tool.name === toolName); + return core.isObjectLike(match) ? util.asString(match.description) : void 0; + } + if (core.isObjectLike(tools)) { + const tool = tools[toolName]; + return core.isObjectLike(tool) ? util.asString(tool.description) : void 0; + } + return void 0; +} +function subscribeVercelAiTracingChannel(tracingChannel$1, options = {}) { + tracingChannel.bindTracingChannelToSpan( + tracingChannel$1(AI_SDK_TELEMETRY_TRACING_CHANNEL), + (data) => createSpanFromMessage(data, options), + { + // The helper ends the span; we enrich it from the settled result first (tokens, output messages, + // finish reasons, response model/id, provider metadata) and drop the per-operation `callId` maps. + beforeSpanEnd: (span, data) => { + enrichSpanOnEnd(span, data, options); + clearOperationId(data); + }, + // A streamed model call resolves before its stream is drained, so we tap the stream, keep the + // span open, and end it (via `end`) once the final usage/finish/output chunks arrive. + deferSpanEnd: ({ data, end }) => deferStreamedModelCallEnd(data, options, end) + } + ); +} +function deferStreamedModelCallEnd(data, options, end) { + if (data.type !== "languageModelCall" || !core.isObjectLike(data.result)) { + return false; + } + const result = data.result; + const stream = result.stream; + if (!util.isReadableStream(stream)) { + return false; + } + const callId = util.asString(data.event.callId); + const { recordOutputs } = getRecordingOptions(data.event, options); + result.stream = util.tapModelCallStream( + stream, + (final) => { + data.result = { ...result, ...streamedResultToChannelResult(final) }; + end(); + enrichInvokeAgentFromStream(callId, final, recordOutputs); + }, + (error) => end(error) + ); + return true; +} +function streamedResultToChannelResult(final) { + const content = []; + if (final.text) { + content.push({ type: "text", text: final.text }); + } + for (const toolCall of final.toolCalls) { + content.push({ type: "tool-call", ...toolCall }); + } + return { + content, + ...final.usage !== void 0 ? { usage: final.usage } : {}, + ...final.finishReason !== void 0 ? { finishReason: final.finishReason } : {}, + ...final.providerMetadata !== void 0 ? { providerMetadata: final.providerMetadata } : {}, + ...final.responseId || final.responseModel ? { + response: { + ...final.responseId ? { id: final.responseId } : {}, + ...final.responseModel ? { modelId: final.responseModel } : {} + } + } : {} + }; +} +function enrichInvokeAgentFromStream(callId, final, recordOutputs) { + const span = callId ? invokeAgentSpanByCallId.get(callId) : void 0; + if (!span) { + return; + } + const usage = core.isObjectLike(final.usage) ? final.usage : void 0; + if (usage) { + const input = tokenCount(usage.inputTokens) ?? tokenCount(usage.promptTokens) ?? tokenCount(usage.tokens); + const output = tokenCount(usage.outputTokens) ?? tokenCount(usage.completionTokens); + addTokensToSpan(span, attributes.GEN_AI_USAGE_INPUT_TOKENS, input); + addTokensToSpan(span, attributes.GEN_AI_USAGE_OUTPUT_TOKENS, output); + addTokensToSpan(span, attributes.GEN_AI_USAGE_TOTAL_TOKENS, tokenCount(usage.totalTokens) ?? util.sum(input, output)); + } + if (recordOutputs) { + const parts = partsFromTextAndToolCalls(final.text, final.toolCalls); + const outputMessages = buildOutputMessages(parts, getFinishReason({ finishReason: final.finishReason })); + if (outputMessages) { + span.setAttribute(attributes.GEN_AI_OUTPUT_MESSAGES, outputMessages); + } + } +} +function addTokensToSpan(span, attribute, value) { + if (value === void 0) { + return; + } + const current = core.spanToJSON(span).data[attribute]; + span.setAttribute(attribute, (typeof current === "number" ? current : 0) + value); +} +function createSpanFromMessage(data, channelOptions) { + const { type, event } = data; + if (type === "step" || !event || typeof event !== "object") { + return void 0; + } + const { recordInputs, enableTruncation } = getRecordingOptions(event, channelOptions); + const provider = util.asString(event.provider); + const modelId = util.asString(event.modelId); + const callId = util.asString(event.callId); + const maxRetries = util.asNumber(event.maxRetries); + if (recordInputs) { + recordToolDescriptions(callId, event.tools); + } + const baseAttributes = { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + ...provider ? { [attributes.GEN_AI_SYSTEM]: provider, [VERCEL_AI_MODEL_PROVIDER_ATTRIBUTE]: provider } : {}, + ...modelId ? { [attributes.GEN_AI_REQUEST_MODEL]: modelId } : {}, + ...maxRetries !== void 0 ? { [VERCEL_AI_SETTINGS_MAX_RETRIES_ATTRIBUTE]: maxRetries } : {} + }; + switch (type) { + case "generateText": + case "streamText": + case "generateObject": + return buildInvokeAgentSpan(event, baseAttributes, recordInputs, enableTruncation, callId, type === "streamText"); + case "languageModelCall": + core._INTERNAL_skipAiProviderWrapping([WORKERS_AI_INTEGRATION_NAME]); + return buildModelCallSpan(event, baseAttributes, recordInputs, enableTruncation, callId, modelId); + case "executeTool": + return buildToolSpan(event, recordInputs); + case "embed": + case "embedMany": { + const input = type === "embedMany" ? event.values : event.value; + return startGenAiSpan(GEN_AI_EMBEDDINGS_OPERATION, modelId, { + ...baseAttributes, + ...recordInputs && input !== void 0 ? { [attributes.GEN_AI_EMBEDDINGS_INPUT]: core.stringify(input) } : {} + }); + } + case "rerank": + return startGenAiSpan(GEN_AI_RERANK_OPERATION, modelId, baseAttributes); + default: + return void 0; + } +} +function startGenAiSpan(operation, suffix, attributes$1) { + return core.startInactiveSpan({ + name: suffix ? `${operation} ${suffix}` : operation, + op: `gen_ai.${operation}`, + attributes: { [attributes.GEN_AI_OPERATION_NAME]: operation, ...attributes$1 } + }); +} +function buildInvokeAgentSpan(event, baseAttributes, recordInputs, enableTruncation, callId, isStream) { + const functionId = util.asString(event.functionId); + const operationId = util.asString(event.operationId) ?? (isStream ? "ai.streamText" : "ai.generateText"); + if (callId) { + operationIdByCallId.set(callId, { operationId, isStream }); + } + const span = startGenAiSpan(op.GEN_AI_INVOKE_AGENT_SPAN_OP, functionId, { + ...baseAttributes, + [VERCEL_AI_OPERATION_ID_ATTRIBUTE]: operationId, + [attributes.GEN_AI_RESPONSE_STREAMING]: isStream, + ...functionId ? { [attributes.GEN_AI_FUNCTION_ID]: functionId } : {}, + ...recordInputs ? buildInputMessageAttributes(event, enableTruncation) : {} + }); + if (isStream && callId) { + invokeAgentSpanByCallId.set(callId, span); + } + return span; +} +function buildModelCallSpan(event, baseAttributes, recordInputs, enableTruncation, callId, modelId) { + const parent = callId ? operationIdByCallId.get(callId) : void 0; + const operationId = parent ? `${parent.operationId}.${parent.isStream ? "doStream" : "doGenerate"}` : "ai.generateText.doGenerate"; + return startGenAiSpan(GEN_AI_GENERATE_CONTENT_OPERATION, modelId, { + ...baseAttributes, + [VERCEL_AI_OPERATION_ID_ATTRIBUTE]: operationId, + ...recordInputs ? buildInputMessageAttributes(event, enableTruncation) : {}, + ...recordInputs && Array.isArray(event.tools) ? { [attributes.GEN_AI_REQUEST_AVAILABLE_TOOLS]: core.stringify(event.tools) } : {} + }); +} +function buildToolSpan(event, recordInputs) { + const toolCall = core.isObjectLike(event.toolCall) ? event.toolCall : {}; + const toolName = util.asString(toolCall.toolName); + const toolCallId = util.asString(event.toolCallId) ?? util.asString(toolCall.toolCallId); + const toolInput = toolCall.input ?? toolCall.args; + const description = recordInputs && toolName ? resolveToolDescription(util.asString(event.callId), toolName, event.tools) : void 0; + return startGenAiSpan(op.GEN_AI_EXECUTE_TOOL_SPAN_OP, toolName, { + [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN, + [attributes.GEN_AI_TOOL_TYPE]: "function", + ...toolName ? { [attributes.GEN_AI_TOOL_NAME]: toolName } : {}, + ...toolCallId ? { [GEN_AI_TOOL_CALL_ID_ATTRIBUTE]: toolCallId } : {}, + ...description ? { [GEN_AI_TOOL_DESCRIPTION_ATTRIBUTE]: description } : {}, + ...recordInputs && toolInput !== void 0 ? { [attributes.GEN_AI_TOOL_INPUT]: core.stringify(toolInput) } : {} + }); +} +function enrichSpanOnEnd(span, data, channelOptions) { + const { type, result } = data; + if (!core.isObjectLike(result)) { + return; + } + const { recordOutputs } = getRecordingOptions(data.event, channelOptions); + if (type === "executeTool") { + if (recordOutputs) { + span.setAttribute(attributes.GEN_AI_TOOL_OUTPUT, core.stringify(result.output ?? result)); + } + const output = core.isObjectLike(result.output) ? result.output : void 0; + if (output?.type === "tool-error") { + captureToolError(span, data, output.error); + } + return; + } + const usage = core.isObjectLike(result.usage) ? result.usage : void 0; + if (usage) { + const inputTokens = tokenCount(usage.inputTokens) ?? tokenCount(usage.promptTokens) ?? tokenCount(usage.tokens); + const outputTokens = tokenCount(usage.outputTokens) ?? tokenCount(usage.completionTokens); + const totalTokens = tokenCount(usage.totalTokens) ?? util.sum(inputTokens, outputTokens); + if (inputTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_INPUT_TOKENS, inputTokens); + } + if (outputTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_OUTPUT_TOKENS, outputTokens); + } + if (totalTokens !== void 0) { + span.setAttribute(attributes.GEN_AI_USAGE_TOTAL_TOKENS, totalTokens); + } + } + const finishReason = getFinishReason(result); + if (finishReason && type === "languageModelCall") { + span.setAttribute(attributes.GEN_AI_RESPONSE_FINISH_REASONS, core.stringify([finishReason])); + } + const response = core.isObjectLike(result.response) ? result.response : void 0; + const responseId = util.asString(response?.id) ?? util.asString(result.responseId); + if (responseId) { + span.setAttribute(attributes.GEN_AI_RESPONSE_ID, responseId); + } + const responseModel = util.asString(response?.modelId) ?? util.asString(data.event.modelId); + if (responseModel) { + span.setAttribute(attributes.GEN_AI_RESPONSE_MODEL, responseModel); + } + const providerMetadata = result.providerMetadata; + const providerAttributes = core.getProviderMetadataAttributes(providerMetadata); + if (core.GEN_AI_CONVERSATION_ID_ATTRIBUTE in providerAttributes && core.spanToJSON(span).data[core.GEN_AI_CONVERSATION_ID_ATTRIBUTE]) { + delete providerAttributes[core.GEN_AI_CONVERSATION_ID_ATTRIBUTE]; + } + span.setAttributes(providerAttributes); + if (recordOutputs) { + const parts = type === "languageModelCall" && Array.isArray(result.content) ? partsFromContent(result.content) : partsFromTextAndToolCalls(result.text, result.toolCalls); + const outputMessages = buildOutputMessages(parts, finishReason); + if (outputMessages) { + span.setAttribute(attributes.GEN_AI_OUTPUT_MESSAGES, outputMessages); + } + } +} +function normalizeFinishReason(finishReason) { + return finishReason === "tool-calls" ? "tool_call" : finishReason ?? "stop"; +} +function getFinishReason(result) { + const finishReason = result.finishReason; + if (typeof finishReason === "string") { + return finishReason; + } + return core.isObjectLike(finishReason) ? util.asString(finishReason.unified) : void 0; +} +function tokenCount(value) { + return util.asNumber(value) ?? (core.isObjectLike(value) ? util.asNumber(value.total) : void 0); +} +function buildOutputMessages(parts, finishReason) { + if (!parts.length) { + return void 0; + } + return core.stringify([{ role: "assistant", parts, finish_reason: normalizeFinishReason(finishReason) }]); +} +function toolCallPart(toolCall) { + const args = toolCall.input ?? toolCall.args; + return { + type: "tool_call", + id: util.asString(toolCall.toolCallId), + name: util.asString(toolCall.toolName), + arguments: typeof args === "string" ? args : core.stringify(args ?? {}) + }; +} +function partsFromContent(content) { + const parts = []; + for (const item of content) { + if (!core.isObjectLike(item)) { + continue; + } + if (item.type === "text" && typeof item.text === "string") { + parts.push({ type: "text", content: item.text }); + } else if (item.type === "tool-call") { + parts.push(toolCallPart(item)); + } + } + return parts; +} +function partsFromTextAndToolCalls(text, toolCalls) { + const parts = []; + if (typeof text === "string" && text.length) { + parts.push({ type: "text", content: text }); + } + if (Array.isArray(toolCalls)) { + for (const toolCall of toolCalls) { + if (core.isObjectLike(toolCall)) { + parts.push(toolCallPart(toolCall)); + } + } + } + return parts; +} +function captureToolError(span, data, error) { + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: error instanceof Error ? error.message : "tool_error" + }); + const toolCall = core.isObjectLike(data.event.toolCall) ? data.event.toolCall : {}; + const toolName = util.asString(toolCall.toolName); + const toolCallId = util.asString(data.event.toolCallId) ?? util.asString(toolCall.toolCallId); + core.withScope((scope) => { + scope.setContext("trace", core.spanToTraceContext(span)); + if (toolName) { + scope.setTag("vercel.ai.tool.name", toolName); + } + if (toolCallId) { + scope.setTag("vercel.ai.tool.callId", toolCallId); + } + scope.setLevel("error"); + core.captureException( + error instanceof Error ? error : new Error(typeof error === "string" ? error : "Tool execution failed"), + { + mechanism: { type: "auto.vercelai.channel", handled: false } + } + ); + }); +} +function getRecordingOptions(event, channelOptions) { + const genAI = core.getClient()?.getDataCollectionOptions().genAI; + return { + recordInputs: resolveRecording(channelOptions.recordInputs, event.recordInputs, genAI?.inputs), + recordOutputs: resolveRecording(channelOptions.recordOutputs, event.recordOutputs, genAI?.outputs), + enableTruncation: core.shouldEnableTruncation(channelOptions.enableTruncation) + }; +} +function resolveRecording(integrationOption, perCallOption, globalDefault) { + if (typeof integrationOption === "boolean") { + return integrationOption; + } + if (typeof perCallOption === "boolean") { + return perCallOption; + } + return globalDefault === true; +} +function buildInputMessageAttributes(event, enableTruncation) { + const attributes$1 = {}; + const instructions = util.asString(event.instructions); + if (instructions) { + attributes$1[core.GEN_AI_SYSTEM_INSTRUCTIONS_ATTRIBUTE] = core.stringify([{ type: "text", content: instructions }]); + } + const messages = event.messages ?? event.prompt; + if (messages !== void 0) { + attributes$1[attributes.GEN_AI_INPUT_MESSAGES] = enableTruncation ? core.getTruncatedJsonString(messages) : core.stringify(messages); + attributes$1[core.GEN_AI_INPUT_MESSAGES_ORIGINAL_LENGTH_ATTRIBUTE] = Array.isArray(messages) ? messages.length : 1; + } + return attributes$1; +} + +exports.captureToolError = captureToolError; +exports.clearOperationCallId = clearOperationCallId; +exports.clearOperationId = clearOperationId; +exports.createSpanFromMessage = createSpanFromMessage; +exports.enrichSpanOnEnd = enrichSpanOnEnd; +exports.streamedResultToChannelResult = streamedResultToChannelResult; +exports.subscribeVercelAiTracingChannel = subscribeVercelAiTracingChannel; +//# sourceMappingURL=vercel-ai-dc-subscriber.js.map + + +/***/ }), + +/***/ 53209: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); + +const core = __nccwpck_require__(84466); +const debugBuild = __nccwpck_require__(64112); +const channels = __nccwpck_require__(64252); +const tracingChannel = __nccwpck_require__(91484); +const vercelAiDcSubscriber = __nccwpck_require__(47635); +const util = __nccwpck_require__(12840); + +const PATCHED = /* @__PURE__ */ Symbol("SentryVercelAiModelPatched"); +const TOOL_PATCHED = /* @__PURE__ */ Symbol("SentryVercelAiToolPatched"); +let callIdCounter = 0; +function nextCallId() { + return `v6-${++callIdCounter}`; +} +const messages = /* @__PURE__ */ new WeakMap(); +const operationSpans = /* @__PURE__ */ new WeakSet(); +const toolCallSpans = /* @__PURE__ */ new WeakSet(); +const callIdBySpan = /* @__PURE__ */ new WeakMap(); +const recordingBySpan = /* @__PURE__ */ new WeakMap(); +const operationErrorInfoBySpan = /* @__PURE__ */ new WeakMap(); +const suppressedTelemetry = /* @__PURE__ */ new WeakSet(); +let subscribed = false; +function subscribeVercelAiOrchestrionChannels(tracingChannel, options = {}) { + if (subscribed) { + return; + } + subscribed = true; + try { + bindOperation(tracingChannel, channels.CHANNELS.VERCEL_AI_GENERATE_TEXT, buildTextMessage("generateText"), options); + bindOperation(tracingChannel, channels.CHANNELS.VERCEL_AI_STREAM_TEXT, buildTextMessage("streamText"), options); + bindOperation(tracingChannel, channels.CHANNELS.VERCEL_AI_GENERATE_OBJECT, buildTextMessage("generateObject"), options); + bindOperation( + tracingChannel, + channels.CHANNELS.VERCEL_AI_EMBED, + (callOptions, telemetry) => ({ + type: "embed", + event: { + callId: nextCallId(), + ...modelFields(callOptions.model), + maxRetries: callOptions.maxRetries, + value: callOptions.value, + ...recording(telemetry) + } + }), + options + ); + bindOperation( + tracingChannel, + channels.CHANNELS.VERCEL_AI_EMBED_MANY, + // `embedMany` takes a `values` array (vs `embed`'s single `value`); the shared core reads it as the + // embeddings input, matching the OTel path's batch `ai.embedMany` span. + (callOptions, telemetry) => ({ + type: "embedMany", + event: { + callId: nextCallId(), + ...modelFields(callOptions.model), + maxRetries: callOptions.maxRetries, + values: callOptions.values, + ...recording(telemetry) + } + }), + options + ); + bindOperation( + tracingChannel, + channels.CHANNELS.VERCEL_AI_EXECUTE_TOOL_CALL, + (callOptions, telemetry) => ({ + type: "executeTool", + // v6 carries the tool definitions on the executeToolCall args (a record keyed by name); + // the shared core reads the matching tool's `description` for the span. + event: { + callId: nextCallId(), + toolCall: callOptions.toolCall, + tools: callOptions.tools, + ...recording(telemetry) + } + }), + options + ); + subscribeResolveLanguageModel(tracingChannel, channels.CHANNELS.VERCEL_AI_RESOLVE_LANGUAGE_MODEL, options); + } catch { + debugBuild.DEBUG_BUILD && core.debug.log("Vercel AI orchestrion channel subscription failed."); + } +} +function bindOperation(tracingChannel$1, channelName, build, options) { + const channel = tracingChannel$1(channelName); + const buildOperationSpan = (data) => { + const callOptions = core.isObjectLike(data.arguments[0]) ? data.arguments[0] : {}; + const telemetry = core.isObjectLike(callOptions.experimental_telemetry) ? callOptions.experimental_telemetry : {}; + if (telemetry.isEnabled === false && !suppressedTelemetry.has(telemetry)) { + return void 0; + } + const message = build(callOptions, telemetry); + suppressNativeTelemetry(callOptions, telemetry); + const callSiteSpan = core.getActiveSpan(); + const span = vercelAiDcSubscriber.createSpanFromMessage(message, options); + if (span) { + messages.set(data, message); + operationSpans.add(span); + const isV4 = core.isObjectLike(callOptions.model) && callOptions.model.specificationVersion === "v1"; + operationErrorInfoBySpan.set(span, { callSiteSpan, toolErrorsBubbleToCaller: isV4 }); + if (message.type === "executeTool") { + toolCallSpans.add(span); + } + const callId = util.asString(message.event.callId); + if (callId) { + callIdBySpan.set(span, callId); + } + recordingBySpan.set(span, recording(telemetry)); + if (core.isObjectLike(callOptions.tools)) { + patchOperationTools(callOptions.tools, options); + } + if (isV4) { + patchModelMethods(callOptions.model, options); + } + } + return span; + }; + tracingChannel.bindTracingChannelToSpan( + channel, + (data) => buildOperationSpan(data), + { + beforeSpanEnd: (span, data) => { + const message = messages.get(data); + if (!message) { + return; + } + if ("error" in data) { + const callSiteSpan = operationErrorInfoBySpan.get(span)?.callSiteSpan; + if (callSiteSpan && core.isObjectLike(data.error)) { + core.addNonEnumerableProperty(data.error, "_sentry_active_span", callSiteSpan); + } + } else { + message.result = message.type === "executeTool" ? { output: data.result } : data.result; + vercelAiDcSubscriber.enrichSpanOnEnd(span, message, options); + } + if (message.type !== "streamText") { + vercelAiDcSubscriber.clearOperationId(message); + } + messages.delete(data); + }, + // `streamText` returns synchronously, so its operation span would otherwise end before the stream + // drains — losing the aggregate usage/output. Defer the end and await the result's completion + // promises (`totalUsage`/`text`/…, which resolve on drain), mirroring how v7's channel defers the + // operation span on the SDK's total-usage promise. + deferSpanEnd: ({ data, end }) => deferStreamTextOperationEnd(data, end) + } + ); +} +function deferStreamTextOperationEnd(data, end) { + if (messages.get(data)?.type !== "streamText" || "error" in data || !isStreamingResult(data.result)) { + return false; + } + const streamResult = data.result; + void (async () => { + try { + const [usage, text, toolCalls, finishReason, response] = await Promise.all([ + streamResult.totalUsage ?? streamResult.usage, + streamResult.text, + streamResult.toolCalls, + streamResult.finishReason, + streamResult.response + ]); + data.result = { usage, text, toolCalls, finishReason, response }; + end(); + } catch (error) { + end(error); + } + })(); + return true; +} +function isStreamingResult(result) { + return core.isObjectLike(result) && (isThenable(result.totalUsage) || isThenable(result.usage)); +} +function isThenable(value) { + return core.isObjectLike(value) && typeof value.then === "function"; +} +function suppressNativeTelemetry(callOptions, telemetry) { + if (telemetry.isEnabled !== true) { + return; + } + const suppressed = { ...telemetry, isEnabled: false }; + suppressedTelemetry.add(suppressed); + callOptions.experimental_telemetry = suppressed; +} +function subscribeResolveLanguageModel(tracingChannel, channelName, options) { + tracingChannel(channelName).subscribe({ + end(rawCtx) { + const ctx = rawCtx; + if (!core.isObjectLike(ctx.result)) { + return; + } + patchModelMethods(ctx.result, options); + }, + start() { + }, + asyncStart() { + }, + asyncEnd() { + }, + error() { + } + }); +} +function resolveModelCallParent() { + const active = core.getActiveSpan(); + return active && operationSpans.has(active) ? active : void 0; +} +function patchModelMethods(model, options) { + if (model[PATCHED]) { + return; + } + model[PATCHED] = true; + patchModelMethod(model, "doGenerate", options); + patchModelMethod(model, "doStream", options); +} +function patchModelMethod(model, method, options) { + const original = model[method]; + if (typeof original !== "function") { + return; + } + model[method] = function(...args) { + const parent = resolveModelCallParent(); + if (!parent) { + return Promise.resolve(original.apply(this, args)); + } + const callArgs = core.isObjectLike(args[0]) ? args[0] : {}; + const callId = callIdBySpan.get(parent); + const message = { + type: "languageModelCall", + event: { + callId, + provider: model.provider, + modelId: model.modelId, + // v4 nests the tool list under `mode.tools` (the `LanguageModelV1` call shape); v5+ passes a + // top-level `tools` array. Reading both keeps `available_tools` populated on the model-call span. + tools: callArgs.tools ?? (core.isObjectLike(callArgs.mode) ? callArgs.mode.tools : void 0), + messages: callArgs.prompt, + // Inherit the enclosing operation's per-call recording flags so inputs/tools/outputs are recorded on + // the model-call span whenever they are on the parent `invoke_agent` span. + ...recordingBySpan.get(parent) + } + }; + const span = core.withActiveSpan(parent, () => vercelAiDcSubscriber.createSpanFromMessage(message, options)); + if (!span) { + return Promise.resolve(original.apply(this, args)); + } + const clearStreamCallId = () => { + if (method === "doStream" && callId) { + vercelAiDcSubscriber.clearOperationCallId(callId); + } + }; + const failSpan = (error) => { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: error instanceof Error ? error.message : "unknown_error" }); + span.end(); + clearStreamCallId(); + throw error; + }; + try { + const result = Promise.resolve(original.apply(this, args)); + return result.then((value) => { + if (method === "doStream" && core.isObjectLike(value) && util.isReadableStream(value.stream)) { + value.stream = util.tapModelCallStream( + value.stream, + (final) => { + message.result = { ...value, ...vercelAiDcSubscriber.streamedResultToChannelResult(final) }; + vercelAiDcSubscriber.enrichSpanOnEnd(span, message, options); + span.end(); + clearStreamCallId(); + }, + (error) => { + span.setStatus({ + code: core.SPAN_STATUS_ERROR, + message: error instanceof Error ? error.message : "unknown_error" + }); + span.end(); + clearStreamCallId(); + } + ); + return value; + } + message.result = value; + vercelAiDcSubscriber.enrichSpanOnEnd(span, message, options); + span.end(); + clearStreamCallId(); + return value; + }, failSpan); + } catch (error) { + return failSpan(error); + } + }; +} +function patchOperationTools(tools, options) { + try { + for (const [toolName, tool] of Object.entries(tools)) { + if (core.isObjectLike(tool)) { + patchToolExecute(toolName, tool, tools, options); + } + } + } catch { + debugBuild.DEBUG_BUILD && core.debug.log("Vercel AI orchestrion tool patching failed."); + } +} +function patchToolExecute(toolName, tool, tools, options) { + const original = tool.execute; + if (typeof original !== "function" || tool[TOOL_PATCHED]) { + return; + } + tool[TOOL_PATCHED] = true; + tool.execute = function(input, ...rest) { + const parent = resolveModelCallParent(); + if (!parent || toolCallSpans.has(parent)) { + return original.apply(this, [input, ...rest]); + } + const callOptions = core.isObjectLike(rest[0]) ? rest[0] : {}; + const message = { + type: "executeTool", + event: { + callId: callIdBySpan.get(parent), + toolCall: { toolName, toolCallId: util.asString(callOptions.toolCallId), input }, + // The `tools` record (keyed by name) lets the shared core backfill the tool's `description`. + tools, + // Inherit the enclosing operation's per-call recording flags so tool inputs/outputs are recorded + // whenever they are on the parent `invoke_agent` span. + ...recordingBySpan.get(parent) + } + }; + const span = core.withActiveSpan(parent, () => vercelAiDcSubscriber.createSpanFromMessage(message, options)); + if (!span) { + return original.apply(this, [input, ...rest]); + } + const failSpan = (error) => { + if (operationErrorInfoBySpan.get(parent)?.toolErrorsBubbleToCaller) { + span.setStatus({ code: core.SPAN_STATUS_ERROR, message: error instanceof Error ? error.message : "tool_error" }); + } else { + vercelAiDcSubscriber.captureToolError(span, message, error); + } + span.end(); + throw error; + }; + try { + const result = Promise.resolve(original.apply(this, [input, ...rest])); + return result.then((value) => { + message.result = { output: value }; + vercelAiDcSubscriber.enrichSpanOnEnd(span, message, options); + span.end(); + return value; + }, failSpan); + } catch (error) { + return failSpan(error); + } + }; +} +function buildTextMessage(type) { + return (options, telemetry) => ({ + type, + event: { + callId: nextCallId(), + operationId: `ai.${type}`, + functionId: util.asString(telemetry.functionId), + ...modelFields(options.model), + maxRetries: options.maxRetries, + // The `ai` SDK takes the system prompt as a top-level `system` option (all of v4/v5/v6); the + // shared core lifts `event.instructions` into the system-instructions attribute, matching v7's + // native channel (which carries it as a distinct field rather than inside the messages array). + instructions: util.asString(options.system), + // Normalize to the message-array shape the shared core (and v7's channel) expects: a bare string + // `prompt` becomes a single user message, matching the SDK's own normalization. + messages: normalizePromptMessages(options), + ...recording(telemetry) + } + }); +} +function normalizePromptMessages(options) { + if (Array.isArray(options.messages)) { + return options.messages; + } + if (typeof options.prompt === "string") { + return [{ role: "user", content: options.prompt }]; + } + return options.messages ?? options.prompt; +} +function recording(telemetry) { + const enabledDefault = telemetry.isEnabled === true ? true : void 0; + return { + recordInputs: telemetry.recordInputs ?? enabledDefault, + recordOutputs: telemetry.recordOutputs ?? enabledDefault + }; +} +function modelFields(model) { + return { provider: modelField(model, "provider"), modelId: modelField(model, "modelId") }; +} +function modelField(model, field) { + return core.isObjectLike(model) ? util.asString(model[field]) : void 0; +} + +exports.subscribeVercelAiOrchestrionChannels = subscribeVercelAiOrchestrionChannels; +//# sourceMappingURL=vercel-ai-orchestrion-subscriber.js.map /***/ }), @@ -96940,19 +69253,44 @@ module.exports = (flag, argv = process.argv) => { // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. const path = __nccwpck_require__(71017) -const parse = __nccwpck_require__(97751) +const moduleDetailsFromPath = __nccwpck_require__(97751) const { fileURLToPath } = __nccwpck_require__(57310) const { MessageChannel } = __nccwpck_require__(71267) +let { isBuiltin } = __nccwpck_require__(98188) +if (!isBuiltin) { + isBuiltin = () => true +} + const { importHooks, specifiers, toHook } = __nccwpck_require__(37174) +/** + * Checks turbopack specifiers separately (for Next.js 16+). + * + * If turbopack is used, specifiers will have an additional hash appended to the end. + * Something like "ai" might become "ai-5e7181a616786b24". This only happens in Next.js 16+. + * Just checking if the baseDir ends with this new specifier won't match, as the baseDir still has the plain package. + * + * This logic isolates a new check for checking the actual name in the case turbopack is being used. + * + * @param specifier {string} + * @param baseDir {string} + */ +function isTurbopackSpecifier (specifier, baseDir) { + const usingTurbopack = process.env.TURBOPACK ?? process.argv.includes('--turbo') + if (!usingTurbopack) return false + + const specifierWithoutTurbopackHash = specifier.slice(0, specifier.lastIndexOf('-')) + return baseDir.endsWith(specifierWithoutTurbopackHash) +} + function addHook (hook) { importHooks.push(hook) - toHook.forEach(([name, namespace]) => hook(name, namespace)) + toHook.forEach(([name, namespace, specifier]) => hook(name, namespace, specifier)) } function removeHook (hook) { @@ -96965,7 +69303,12 @@ function removeHook (hook) { function callHookFn (hookFn, namespace, name, baseDir) { const newDefault = hookFn(namespace, name, baseDir) if (newDefault && newDefault !== namespace) { - namespace.default = newDefault + // Only ESM modules that actually export `default` can have it reassigned. + // Some hooks return a value unconditionally; avoid crashing when the module + // has no default export (see issue #188). + if ('default' in namespace) { + namespace.default = newDefault + } } } @@ -97054,37 +69397,59 @@ function Hook (modules, options, hookFn) { sendModulesToLoader(modules) } - this._iitmHook = (name, namespace) => { - const filename = name - const isBuiltin = name.startsWith('node:') - let baseDir + this._iitmHook = (name, namespace, specifier) => { + const loadUrl = name + const isNodeUrl = loadUrl.startsWith('node:') + let filePath, baseDir - if (isBuiltin) { - name = name.replace(/^node:/, '') - } else { - if (name.startsWith('file://')) { - try { - name = fileURLToPath(name) - } catch (e) {} + if (isNodeUrl) { + // Normalize builtin module name to *not* have 'node:' prefix, unless + // required, as it is for 'node:test' and some others. `module.isBuiltin` + // is available in all Node.js versions that have node:-only modules. + const unprefixed = name.slice(5) + if (isBuiltin(unprefixed)) { + name = unprefixed } - const details = parse(name) - if (details) { - name = details.name - baseDir = details.basedir + } else if (loadUrl.startsWith('file://')) { + const stackTraceLimit = Error.stackTraceLimit + Error.stackTraceLimit = 0 + try { + filePath = fileURLToPath(name) + name = filePath + } catch (e) {} + Error.stackTraceLimit = stackTraceLimit + + if (filePath) { + const details = moduleDetailsFromPath(filePath) + if (details) { + name = details.name + baseDir = details.basedir + } } } if (modules) { - for (const moduleName of modules) { - if (moduleName === name) { - if (baseDir) { - if (internals) { - name = name + path.sep + path.relative(baseDir, fileURLToPath(filename)) - } else { - if (!baseDir.endsWith(specifiers.get(filename))) continue - } + for (const matchArg of modules) { + if (filePath && matchArg === filePath) { + // abspath match + callHookFn(hookFn, namespace, filePath, undefined) + } else if (matchArg === name) { + if (!baseDir) { + // built-in module (or unexpected non file:// name?) + callHookFn(hookFn, namespace, name, baseDir) + } else if (baseDir.endsWith(specifiers.get(loadUrl)) || isTurbopackSpecifier(specifiers.get(loadUrl), baseDir)) { + // An import of the top-level module (e.g. `import 'ioredis'`). + // Note: Slight behaviour difference from RITM. RITM uses + // `require.resolve(name)` to see if filename is the module + // main file, which will catch `require('ioredis/built/index.js')`. + // The check here will not catch `import 'ioredis/built/index.js'`. + callHookFn(hookFn, namespace, name, baseDir) + } else if (internals) { + const internalPath = name + path.sep + path.relative(baseDir, filePath) + callHookFn(hookFn, namespace, internalPath, baseDir) } - callHookFn(hookFn, namespace, name, baseDir) + } else if (matchArg === specifier) { + callHookFn(hookFn, namespace, specifier, baseDir) } } } else { @@ -97123,7 +69488,14 @@ const toHook = [] const proxyHandler = { set (target, name, value) { - return setters.get(target)[name](value) + const set = setters.get(target) + const setter = set && set[name] + if (typeof setter === 'function') { + return setter(value) + } + // If a module doesn't export the property being assigned (e.g. no default + // export), there is no setter to call. Don't crash userland code. + return true }, get (target, name) { @@ -97143,7 +69515,12 @@ const proxyHandler = { throw new Error('Getters/setters are not supported for exports property descriptors.') } - return setters.get(target)[property](descriptor.value) + const set = setters.get(target) + const setter = set && set[property] + if (typeof setter === 'function') { + return setter(descriptor.value) + } + return true } } @@ -97152,11 +69529,147 @@ function register (name, namespace, set, get, specifier) { setters.set(namespace, set) getters.set(namespace, get) const proxy = new Proxy(namespace, proxyHandler) - importHooks.forEach(hook => hook(name, proxy)) - toHook.push([name, proxy]) + importHooks.forEach(hook => hook(name, proxy, specifier)) + toHook.push([name, proxy, specifier]) +} + +// Delays (ms) for re-reading exports that were still in their temporal dead zone +// when the wrapper first ran (circular imports). Retried on a microtask first, +// then at these intervals; unref'd so best-effort retries never hold the process +// open. Frozen once at module load rather than rebuilt per wrapper. +const RETRY_DELAYS = [0, 10, 50] + +/** + * Per-wrapped-module state a generated wrapper builds once to expose its exports + * through iitm's proxy. Each wrapper holds a local binding per export plus + * `write`/`read` closures over it; `bind` seeds that binding from the real + * module and installs the proxy's `set`/`get` for the name, and `flush` resolves + * any export that was undefined (circular import) once it becomes available. + * + * This is the boilerplate the wrapper used to inline in full per module. Hoisting + * it here compiles it once instead of once per wrapped module and keeps the + * per-export bind call site monomorphic. + */ +class ModuleBinder { + // Mimics a Module namespace object (https://tc39.es/ecma262/#sec-module-namespace-objects). + namespace = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }) + set = {} + get = {} + #overridden = Object.create(null) + #pending = [] + + /** + * Seeds `key` from `source` and installs its proxy accessors. A value that is + * undefined or throws `ReferenceError` (temporal dead zone during a circular + * import) is deferred to `flush`; any other throw propagates. + * + * @param {string} key The export name. + * @param {object} source The real module namespace to read the value from. + * @param {(value: unknown) => void} write Assigns the wrapper's local binding. + * @param {() => unknown} read Reads the wrapper's local binding. + * @param {boolean} useFallback Fall back to `source.default` (the synthetic + * `module.exports` name a builtin does not expose on its ESM namespace). + * @returns {void} + */ + bind (key, source, write, read, useFallback) { + const readSource = useFallback + ? () => source[key] ?? source.default + : () => source[key] + this.#overridden[key] = false + let deferred = false + try { + const value = readSource() + write(value) + this.namespace[key] = value + } catch (error) { + if (!(error instanceof ReferenceError)) throw error + deferred = true + } + if (deferred || read() === undefined) { + this.#pending.push(this.#makeUpdater(key, readSource, write)) + } + this.set[key] = (value) => { + this.#overridden[key] = true + write(value) + return true + } + this.get[key] = read + } + + /** + * @param {string} key The export name to update. + * @param {() => unknown} readSource Reads the current value from the real module. + * @param {(value: unknown) => void} write Assigns the wrapper's local binding. + * @returns {() => boolean} Updater returning whether the value is now settled. + */ + #makeUpdater (key, readSource, write) { + return () => { + if (this.#overridden[key] === true) return true + try { + const value = readSource() + if (value !== undefined) { + write(value) + this.namespace[key] = value + return true + } + return false + } catch (error) { + if (error instanceof ReferenceError) return false + // Only reached if a getter starts throwing a non-ReferenceError after the + // initial bind read already succeeded or deferred; surfaces in flush's + // microtask. Kept as-is from the inline wrapper. + /* c8 ignore next */ + throw error + } + } + } + + #flushOnce () { + const next = [] + for (const updater of this.#pending) { + // If it still throws ReferenceError, keep it for the (single) next attempt. + if (updater() !== true) next.push(updater) + } + this.#pending = next + } + + /** + * Resolves exports deferred by `bind` (undefined or TDZ at wrapper-eval time). + * Retries on a microtask, then at `RETRY_DELAYS`, giving up afterwards to avoid + * unbounded retries. A no-op when nothing was deferred. + * + * @returns {void} + */ + flush () { + if (this.#pending.length === 0) return + queueMicrotask(() => { + this.#flushOnce() + this.#scheduleRetry(0) + }) + } + + /** + * @param {number} attempt Index into `RETRY_DELAYS` for the next retry. + * @returns {void} + */ + #scheduleRetry (attempt) { + if (this.#pending.length === 0) return + if (attempt >= RETRY_DELAYS.length) { + // Give up: leave exports as-is to avoid unbounded retries. + this.#pending = [] + return + } + const timer = setTimeout(() => { + this.#flushOnce() + this.#scheduleRetry(attempt + 1) + }, RETRY_DELAYS[attempt]) + // Don't keep the process alive just for best-effort retries. + if (timer && typeof timer.unref === 'function') timer.unref() + } } exports.register = register +exports.ModuleBinder = ModuleBinder exports.importHooks = importHooks exports.specifiers = specifiers exports.toHook = toHook @@ -97170,20 +69683,43 @@ exports.toHook = toHook "use strict"; -var path = __nccwpck_require__(71017) +var sep = (__nccwpck_require__(71017).sep) module.exports = function (file) { - var segments = file.split(path.sep) + var segments = file.split(sep) var index = segments.lastIndexOf('node_modules') + if (index === -1) return if (!segments[index + 1]) return + var scoped = segments[index + 1][0] === '@' var name = scoped ? segments[index + 1] + '/' + segments[index + 2] : segments[index + 1] var offset = scoped ? 3 : 2 + + var basedir = '' + var lastBaseDirSegmentIndex = index + offset - 1 + for (var i = 0; i <= lastBaseDirSegmentIndex; i++) { + if (i === lastBaseDirSegmentIndex) { + basedir += segments[i] + } else { + basedir += segments[i] + sep + } + } + + var path = '' + var lastSegmentIndex = segments.length - 1 + for (var i2 = index + offset; i2 <= lastSegmentIndex; i2++) { + if (i2 === lastSegmentIndex) { + path += segments[i2] + } else { + path += segments[i2] + sep + } + } + return { name: name, - basedir: segments.slice(0, index + offset).join(path.sep), - path: segments.slice(index + offset).join(path.sep) + basedir: basedir, + path: path } } @@ -97357,89 +69893,6 @@ function plural(ms, msAbs, n, name) { } -/***/ }), - -/***/ 5980: -/***/ ((module) => { - -"use strict"; - - -var isWindows = process.platform === 'win32'; - -// Regex to split a windows path into into [dir, root, basename, name, ext] -var splitWindowsRe = - /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; - -var win32 = {}; - -function win32SplitPath(filename) { - return splitWindowsRe.exec(filename).slice(1); -} - -win32.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 5) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - return { - root: allParts[1], - dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), - base: allParts[2], - ext: allParts[4], - name: allParts[3] - }; -}; - - - -// Split a filename into [dir, root, basename, name, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; -var posix = {}; - - -function posixSplitPath(filename) { - return splitPathRe.exec(filename).slice(1); -} - - -posix.parse = function(pathString) { - if (typeof pathString !== 'string') { - throw new TypeError( - "Parameter 'pathString' must be a string, not " + typeof pathString - ); - } - var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 5) { - throw new TypeError("Invalid path '" + pathString + "'"); - } - - return { - root: allParts[1], - dir: allParts[0].slice(0, -1), - base: allParts[2], - ext: allParts[4], - name: allParts[3], - }; -}; - - -if (isWindows) - module.exports = win32.parse; -else /* posix */ - module.exports = posix.parse; - -module.exports.posix = posix.parse; -module.exports.win32 = win32.parse; - - /***/ }), /***/ 62009: @@ -97450,9 +69903,8 @@ module.exports.win32 = win32.parse; const path = __nccwpck_require__(71017) const Module = __nccwpck_require__(98188) -const resolve = __nccwpck_require__(71597) const debug = __nccwpck_require__(82949)('require-in-the-middle') -const moduleDetailsFromPath = __nccwpck_require__(97751) +const moduleDetailsFromPath = __nccwpck_require__(32752) // Using the default export is discouraged, but kept for backward compatibility. // Use this instead: @@ -97460,6 +69912,8 @@ const moduleDetailsFromPath = __nccwpck_require__(97751) module.exports = Hook module.exports.Hook = Hook +let builtinModules // Set + /** * Is the given module a "core" module? * https://nodejs.org/api/modules.html#core-modules @@ -97469,29 +69923,20 @@ module.exports.Hook = Hook let isCore if (Module.isBuiltin) { // Added in node v18.6.0, v16.17.0 isCore = Module.isBuiltin -} else { - const [major, minor] = process.versions.node.split('.').map(Number) - if (major === 8 && minor < 8) { - // For node versions `[8.0, 8.8)` the "http2" module was built-in but - // behind the `--expose-http2` flag. `resolve` only considers unflagged - // modules to be core: https://github.com/browserify/resolve/issues/139 - // However, for `ExportsCache` to work for "http2" we need it to be - // considered core. - isCore = moduleName => { - if (moduleName === 'http2') { - return true - } - // Prefer `resolve.core` lookup to `resolve.isCore(moduleName)` because - // the latter is doing version range matches for every call. - return !!resolve.core[moduleName] +} else if (Module.builtinModules) { // Added in node v9.3.0, v8.10.0, v6.13.0 + isCore = moduleName => { + if (moduleName.startsWith('node:')) { + return true } - } else { - isCore = moduleName => { - // Prefer `resolve.core` lookup to `resolve.isCore(moduleName)` because - // the latter is doing version range matches for every call. - return !!resolve.core[moduleName] + + if (builtinModules === undefined) { + builtinModules = new Set(Module.builtinModules) } + + return builtinModules.has(moduleName) } +} else { + throw new Error('\'require-in-the-middle\' requires Node.js >=v9.3.0 or >=v8.10.0') } // 'foo/bar.js' or 'foo/bar/index.js' => 'foo/bar' @@ -97562,7 +70007,7 @@ function Hook (modules, options, onrequire) { if (typeof Module._resolveFilename !== 'function') { console.error('Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!', typeof Module._resolveFilename) - console.error('Please report this error as an issue related to Node.js %s at %s', process.version, (__nccwpck_require__(85425)/* .bugs.url */ .eN.H)) + console.error('Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues', process.version) return } @@ -97729,7 +70174,7 @@ function Hook (modules, options, onrequire) { // figure out if this is the main module file, or a file inside the module let res try { - res = resolve.sync(moduleName, { basedir }) + res = require.resolve(moduleName, { paths: [basedir] }) } catch (e) { debug('could not resolve module: %s', moduleName) self._cache.set(filename, exports, core) @@ -98656,934 +71101,29 @@ formatters.O = function (v) { /***/ }), -/***/ 64781: +/***/ 32752: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var call = Function.prototype.call; -var $hasOwn = Object.prototype.hasOwnProperty; -var bind = __nccwpck_require__(88334); - -/** @type {import('.')} */ -module.exports = bind.call(call, $hasOwn); - - -/***/ }), - -/***/ 89899: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var hasOwn = __nccwpck_require__(64781); - -function specifierIncluded(current, specifier) { - var nodeParts = current.split('.'); - var parts = specifier.split(' '); - var op = parts.length > 1 ? parts[0] : '='; - var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.'); - - for (var i = 0; i < 3; ++i) { - var cur = parseInt(nodeParts[i] || 0, 10); - var ver = parseInt(versionParts[i] || 0, 10); - if (cur === ver) { - continue; // eslint-disable-line no-restricted-syntax, no-continue - } - if (op === '<') { - return cur < ver; - } - if (op === '>=') { - return cur >= ver; - } - return false; - } - return op === '>='; -} - -function matchesRange(current, range) { - var specifiers = range.split(/ ?&& ?/); - if (specifiers.length === 0) { - return false; - } - for (var i = 0; i < specifiers.length; ++i) { - if (!specifierIncluded(current, specifiers[i])) { - return false; - } - } - return true; -} - -function versionIncluded(nodeVersion, specifierValue) { - if (typeof specifierValue === 'boolean') { - return specifierValue; - } - - var current = typeof nodeVersion === 'undefined' - ? process.versions && process.versions.node - : nodeVersion; - - if (typeof current !== 'string') { - throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required'); - } - - if (specifierValue && typeof specifierValue === 'object') { - for (var i = 0; i < specifierValue.length; ++i) { - if (matchesRange(current, specifierValue[i])) { - return true; - } - } - return false; - } - return matchesRange(current, specifierValue); -} - -var data = __nccwpck_require__(78154); - -module.exports = function isCore(x, nodeVersion) { - return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]); -}; - - -/***/ }), - -/***/ 71597: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var async = __nccwpck_require__(39663); -async.core = __nccwpck_require__(9529); -async.isCore = __nccwpck_require__(85439); -async.sync = __nccwpck_require__(15609); - -module.exports = async; - - -/***/ }), - -/***/ 39663: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var fs = __nccwpck_require__(57147); -var getHomedir = __nccwpck_require__(84213); -var path = __nccwpck_require__(71017); -var caller = __nccwpck_require__(71099); -var nodeModulesPaths = __nccwpck_require__(91156); -var normalizeOptions = __nccwpck_require__(33669); -var isCore = __nccwpck_require__(89899); - -var realpathFS = process.platform !== 'win32' && fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; - -var homedir = getHomedir(); -var defaultPaths = function () { - return [ - path.join(homedir, '.node_modules'), - path.join(homedir, '.node_libraries') - ]; -}; - -var defaultIsFile = function isFile(file, cb) { - fs.stat(file, function (err, stat) { - if (!err) { - return cb(null, stat.isFile() || stat.isFIFO()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); -}; - -var defaultIsDir = function isDirectory(dir, cb) { - fs.stat(dir, function (err, stat) { - if (!err) { - return cb(null, stat.isDirectory()); - } - if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); - return cb(err); - }); -}; - -var defaultRealpath = function realpath(x, cb) { - realpathFS(x, function (realpathErr, realPath) { - if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr); - else cb(null, realpathErr ? x : realPath); - }); -}; - -var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) { - if (opts && opts.preserveSymlinks === false) { - realpath(x, cb); - } else { - cb(null, x); - } -}; - -var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) { - readFile(pkgfile, function (readFileErr, body) { - if (readFileErr) cb(readFileErr); - else { - try { - var pkg = JSON.parse(body); - cb(null, pkg); - } catch (jsonErr) { - cb(null); - } - } - }); -}; - -var getPackageCandidates = function getPackageCandidates(x, start, opts) { - var dirs = nodeModulesPaths(start, opts, x); - for (var i = 0; i < dirs.length; i++) { - dirs[i] = path.join(dirs[i], x); - } - return dirs; -}; - -module.exports = function resolve(x, options, callback) { - var cb = callback; - var opts = options; - if (typeof options === 'function') { - cb = opts; - opts = {}; - } - if (typeof x !== 'string') { - var err = new TypeError('Path must be a string.'); - return process.nextTick(function () { - cb(err); - }); - } - - opts = normalizeOptions(x, opts); - - var isFile = opts.isFile || defaultIsFile; - var isDirectory = opts.isDirectory || defaultIsDir; - var readFile = opts.readFile || fs.readFile; - var realpath = opts.realpath || defaultRealpath; - var readPackage = opts.readPackage || defaultReadPackage; - if (opts.readFile && opts.readPackage) { - var conflictErr = new TypeError('`readFile` and `readPackage` are mutually exclusive.'); - return process.nextTick(function () { - cb(conflictErr); - }); - } - var packageIterator = opts.packageIterator; - - var extensions = opts.extensions || ['.js']; - var includeCoreModules = opts.includeCoreModules !== false; - var basedir = opts.basedir || path.dirname(caller()); - var parent = opts.filename || basedir; - - opts.paths = opts.paths || defaultPaths(); - - // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory - var absoluteStart = path.resolve(basedir); - - maybeRealpath( - realpath, - absoluteStart, - opts, - function (err, realStart) { - if (err) cb(err); - else init(realStart); - } - ); - - var res; - function init(basedir) { - if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { - res = path.resolve(basedir, x); - if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; - if ((/\/$/).test(x) && res === basedir) { - loadAsDirectory(res, opts.package, onfile); - } else loadAsFile(res, opts.package, onfile); - } else if (includeCoreModules && isCore(x)) { - return cb(null, x); - } else loadNodeModules(x, basedir, function (err, n, pkg) { - if (err) cb(err); - else if (n) { - return maybeRealpath(realpath, n, opts, function (err, realN) { - if (err) { - cb(err); - } else { - cb(null, realN, pkg); - } - }); - } else { - var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - moduleError.code = 'MODULE_NOT_FOUND'; - cb(moduleError); - } - }); - } - - function onfile(err, m, pkg) { - if (err) cb(err); - else if (m) cb(null, m, pkg); - else loadAsDirectory(res, function (err, d, pkg) { - if (err) cb(err); - else if (d) { - maybeRealpath(realpath, d, opts, function (err, realD) { - if (err) { - cb(err); - } else { - cb(null, realD, pkg); - } - }); - } else { - var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - moduleError.code = 'MODULE_NOT_FOUND'; - cb(moduleError); - } - }); - } - - function loadAsFile(x, thePackage, callback) { - var loadAsFilePackage = thePackage; - var cb = callback; - if (typeof loadAsFilePackage === 'function') { - cb = loadAsFilePackage; - loadAsFilePackage = undefined; - } - - var exts = [''].concat(extensions); - load(exts, x, loadAsFilePackage); - - function load(exts, x, loadPackage) { - if (exts.length === 0) return cb(null, undefined, loadPackage); - var file = x + exts[0]; - - var pkg = loadPackage; - if (pkg) onpkg(null, pkg); - else loadpkg(path.dirname(file), onpkg); - - function onpkg(err, pkg_, dir) { - pkg = pkg_; - if (err) return cb(err); - if (dir && pkg && opts.pathFilter) { - var rfile = path.relative(dir, file); - var rel = rfile.slice(0, rfile.length - exts[0].length); - var r = opts.pathFilter(pkg, x, rel); - if (r) return load( - [''].concat(extensions.slice()), - path.resolve(dir, r), - pkg - ); - } - isFile(file, onex); - } - function onex(err, ex) { - if (err) return cb(err); - if (ex) return cb(null, file, pkg); - load(exts.slice(1), x, pkg); - } - } - } - - function loadpkg(dir, cb) { - if (dir === '' || dir === '/') return cb(null); - if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { - return cb(null); - } - if ((/[/\\]node_modules[/\\]*$/).test(dir)) return cb(null); - - maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) { - if (unwrapErr) return loadpkg(path.dirname(dir), cb); - var pkgfile = path.join(pkgdir, 'package.json'); - isFile(pkgfile, function (err, ex) { - // on err, ex is false - if (!ex) return loadpkg(path.dirname(dir), cb); - - readPackage(readFile, pkgfile, function (err, pkgParam) { - if (err) cb(err); - - var pkg = pkgParam; - - if (pkg && opts.packageFilter) { - pkg = opts.packageFilter(pkg, pkgfile); - } - cb(null, pkg, dir); - }); - }); - }); - } - - function loadAsDirectory(x, loadAsDirectoryPackage, callback) { - var cb = callback; - var fpkg = loadAsDirectoryPackage; - if (typeof fpkg === 'function') { - cb = fpkg; - fpkg = opts.package; - } - - maybeRealpath(realpath, x, opts, function (unwrapErr, pkgdir) { - if (unwrapErr) return cb(unwrapErr); - var pkgfile = path.join(pkgdir, 'package.json'); - isFile(pkgfile, function (err, ex) { - if (err) return cb(err); - if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); - - readPackage(readFile, pkgfile, function (err, pkgParam) { - if (err) return cb(err); - - var pkg = pkgParam; - - if (pkg && opts.packageFilter) { - pkg = opts.packageFilter(pkg, pkgfile); - } - - if (pkg && pkg.main) { - if (typeof pkg.main !== 'string') { - var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); - mainError.code = 'INVALID_PACKAGE_MAIN'; - return cb(mainError); - } - if (pkg.main === '.' || pkg.main === './') { - pkg.main = 'index'; - } - loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { - if (err) return cb(err); - if (m) return cb(null, m, pkg); - if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); - - var dir = path.resolve(x, pkg.main); - loadAsDirectory(dir, pkg, function (err, n, pkg) { - if (err) return cb(err); - if (n) return cb(null, n, pkg); - loadAsFile(path.join(x, 'index'), pkg, cb); - }); - }); - return; - } - - loadAsFile(path.join(x, '/index'), pkg, cb); - }); - }); - }); - } - - function processDirs(cb, dirs) { - if (dirs.length === 0) return cb(null, undefined); - var dir = dirs[0]; - - isDirectory(path.dirname(dir), isdir); - - function isdir(err, isdir) { - if (err) return cb(err); - if (!isdir) return processDirs(cb, dirs.slice(1)); - loadAsFile(dir, opts.package, onfile); - } - - function onfile(err, m, pkg) { - if (err) return cb(err); - if (m) return cb(null, m, pkg); - loadAsDirectory(dir, opts.package, ondir); - } - - function ondir(err, n, pkg) { - if (err) return cb(err); - if (n) return cb(null, n, pkg); - processDirs(cb, dirs.slice(1)); - } - } - function loadNodeModules(x, start, cb) { - var thunk = function () { return getPackageCandidates(x, start, opts); }; - processDirs( - cb, - packageIterator ? packageIterator(x, start, thunk, opts) : thunk() - ); - } -}; - - -/***/ }), - -/***/ 71099: -/***/ ((module) => { - -module.exports = function () { - // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi - var origPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = function (_, stack) { return stack; }; - var stack = (new Error()).stack; - Error.prepareStackTrace = origPrepareStackTrace; - return stack[2].getFileName(); -}; - - -/***/ }), - -/***/ 9529: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var isCoreModule = __nccwpck_require__(89899); -var data = __nccwpck_require__(74476); - -var core = {}; -for (var mod in data) { // eslint-disable-line no-restricted-syntax - if (Object.prototype.hasOwnProperty.call(data, mod)) { - core[mod] = isCoreModule(mod); - } -} -module.exports = core; - - -/***/ }), - -/***/ 84213: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var os = __nccwpck_require__(22037); - -// adapted from https://github.com/sindresorhus/os-homedir/blob/11e089f4754db38bb535e5a8416320c4446e8cfd/index.js - -module.exports = os.homedir || function homedir() { - var home = process.env.HOME; - var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME; - - if (process.platform === 'win32') { - return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null; - } - - if (process.platform === 'darwin') { - return home || (user ? '/Users/' + user : null); - } - - if (process.platform === 'linux') { - return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); // eslint-disable-line no-extra-parens - } - - return home || null; -}; - - -/***/ }), - -/***/ 85439: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var isCoreModule = __nccwpck_require__(89899); - -module.exports = function isCore(x) { - return isCoreModule(x); -}; - - -/***/ }), - -/***/ 91156: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var path = __nccwpck_require__(71017); -var parse = path.parse || __nccwpck_require__(5980); // eslint-disable-line global-require - -var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) { - var prefix = '/'; - if ((/^([A-Za-z]:)/).test(absoluteStart)) { - prefix = ''; - } else if ((/^\\\\/).test(absoluteStart)) { - prefix = '\\\\'; - } - - var paths = [absoluteStart]; - var parsed = parse(absoluteStart); - while (parsed.dir !== paths[paths.length - 1]) { - paths.push(parsed.dir); - parsed = parse(parsed.dir); - } - - return paths.reduce(function (dirs, aPath) { - return dirs.concat(modules.map(function (moduleDir) { - return path.resolve(prefix, aPath, moduleDir); - })); - }, []); -}; - -module.exports = function nodeModulesPaths(start, opts, request) { - var modules = opts && opts.moduleDirectory - ? [].concat(opts.moduleDirectory) - : ['node_modules']; - - if (opts && typeof opts.paths === 'function') { - return opts.paths( - request, - start, - function () { return getNodeModulesDirs(start, modules); }, - opts - ); - } - - var dirs = getNodeModulesDirs(start, modules); - return opts && opts.paths ? dirs.concat(opts.paths) : dirs; -}; - - -/***/ }), - -/***/ 33669: -/***/ ((module) => { - -module.exports = function (x, opts) { - /** - * This file is purposefully a passthrough. It's expected that third-party - * environments will override it at runtime in order to inject special logic - * into `resolve` (by manipulating the options). One such example is the PnP - * code path in Yarn. - */ - - return opts || {}; -}; - - -/***/ }), - -/***/ 15609: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var isCore = __nccwpck_require__(89899); -var fs = __nccwpck_require__(57147); -var path = __nccwpck_require__(71017); -var getHomedir = __nccwpck_require__(84213); -var caller = __nccwpck_require__(71099); -var nodeModulesPaths = __nccwpck_require__(91156); -var normalizeOptions = __nccwpck_require__(33669); - -var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; - -var homedir = getHomedir(); -var defaultPaths = function () { - return [ - path.join(homedir, '.node_modules'), - path.join(homedir, '.node_libraries') - ]; -}; - -var defaultIsFile = function isFile(file) { - try { - var stat = fs.statSync(file, { throwIfNoEntry: false }); - } catch (e) { - if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; - throw e; - } - return !!stat && (stat.isFile() || stat.isFIFO()); -}; - -var defaultIsDir = function isDirectory(dir) { - try { - var stat = fs.statSync(dir, { throwIfNoEntry: false }); - } catch (e) { - if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; - throw e; - } - return !!stat && stat.isDirectory(); -}; - -var defaultRealpathSync = function realpathSync(x) { - try { - return realpathFS(x); - } catch (realpathErr) { - if (realpathErr.code !== 'ENOENT') { - throw realpathErr; - } - } - return x; -}; - -var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) { - if (opts && opts.preserveSymlinks === false) { - return realpathSync(x); - } - return x; -}; - -var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) { - var body = readFileSync(pkgfile); - try { - var pkg = JSON.parse(body); - return pkg; - } catch (jsonErr) {} -}; - -var getPackageCandidates = function getPackageCandidates(x, start, opts) { - var dirs = nodeModulesPaths(start, opts, x); - for (var i = 0; i < dirs.length; i++) { - dirs[i] = path.join(dirs[i], x); - } - return dirs; -}; - -module.exports = function resolveSync(x, options) { - if (typeof x !== 'string') { - throw new TypeError('Path must be a string.'); - } - var opts = normalizeOptions(x, options); - - var isFile = opts.isFile || defaultIsFile; - var readFileSync = opts.readFileSync || fs.readFileSync; - var isDirectory = opts.isDirectory || defaultIsDir; - var realpathSync = opts.realpathSync || defaultRealpathSync; - var readPackageSync = opts.readPackageSync || defaultReadPackageSync; - if (opts.readFileSync && opts.readPackageSync) { - throw new TypeError('`readFileSync` and `readPackageSync` are mutually exclusive.'); - } - var packageIterator = opts.packageIterator; - - var extensions = opts.extensions || ['.js']; - var includeCoreModules = opts.includeCoreModules !== false; - var basedir = opts.basedir || path.dirname(caller()); - var parent = opts.filename || basedir; - - opts.paths = opts.paths || defaultPaths(); - - // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory - var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts); - - if ((/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/).test(x)) { - var res = path.resolve(absoluteStart, x); - if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/'; - var m = loadAsFileSync(res) || loadAsDirectorySync(res); - if (m) return maybeRealpathSync(realpathSync, m, opts); - } else if (includeCoreModules && isCore(x)) { - return x; - } else { - var n = loadNodeModulesSync(x, absoluteStart); - if (n) return maybeRealpathSync(realpathSync, n, opts); - } - - var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); - err.code = 'MODULE_NOT_FOUND'; - throw err; - - function loadAsFileSync(x) { - var pkg = loadpkg(path.dirname(x)); - - if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { - var rfile = path.relative(pkg.dir, x); - var r = opts.pathFilter(pkg.pkg, x, rfile); - if (r) { - x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign - } - } - - if (isFile(x)) { - return x; - } - - for (var i = 0; i < extensions.length; i++) { - var file = x + extensions[i]; - if (isFile(file)) { - return file; - } - } - } - - function loadpkg(dir) { - if (dir === '' || dir === '/') return; - if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { - return; - } - if ((/[/\\]node_modules[/\\]*$/).test(dir)) return; - - var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json'); - - if (!isFile(pkgfile)) { - return loadpkg(path.dirname(dir)); - } - - var pkg = readPackageSync(readFileSync, pkgfile); - - if (pkg && opts.packageFilter) { - // v2 will pass pkgfile - pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment - } - - return { pkg: pkg, dir: dir }; - } - - function loadAsDirectorySync(x) { - var pkgfile = path.join(maybeRealpathSync(realpathSync, x, opts), '/package.json'); - if (isFile(pkgfile)) { - try { - var pkg = readPackageSync(readFileSync, pkgfile); - } catch (e) {} - - if (pkg && opts.packageFilter) { - // v2 will pass pkgfile - pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment - } - - if (pkg && pkg.main) { - if (typeof pkg.main !== 'string') { - var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string'); - mainError.code = 'INVALID_PACKAGE_MAIN'; - throw mainError; - } - if (pkg.main === '.' || pkg.main === './') { - pkg.main = 'index'; - } - try { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - var n = loadAsDirectorySync(path.resolve(x, pkg.main)); - if (n) return n; - } catch (e) {} - } - } - - return loadAsFileSync(path.join(x, '/index')); - } - - function loadNodeModulesSync(x, start) { - var thunk = function () { return getPackageCandidates(x, start, opts); }; - var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk(); - - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - if (isDirectory(path.dirname(dir))) { - var m = loadAsFileSync(dir); - if (m) return m; - var n = loadAsDirectorySync(dir); - if (n) return n; - } - } - } -}; - - -/***/ }), - -/***/ 16672: -/***/ ((module) => { - -"use strict"; - - -function isFunction (funktion) { - return typeof funktion === 'function' -} - -// Default to complaining loudly when things don't go according to plan. -var logger = console.error.bind(console) - -// Sets a property on an object, preserving its enumerability. -// This function assumes that the property is already writable. -function defineProperty (obj, name, value) { - var enumerable = !!obj[name] && obj.propertyIsEnumerable(name) - Object.defineProperty(obj, name, { - configurable: true, - enumerable: enumerable, - writable: true, - value: value - }) -} - -// Keep initialization idempotent. -function shimmer (options) { - if (options && options.logger) { - if (!isFunction(options.logger)) logger("new logger isn't a function, not replacing") - else logger = options.logger +var path = __nccwpck_require__(71017) + +module.exports = function (file) { + var segments = file.split(path.sep) + var index = segments.lastIndexOf('node_modules') + if (index === -1) return + if (!segments[index + 1]) return + var scoped = segments[index + 1][0] === '@' + var name = scoped ? segments[index + 1] + '/' + segments[index + 2] : segments[index + 1] + var offset = scoped ? 3 : 2 + return { + name: name, + basedir: segments.slice(0, index + offset).join(path.sep), + path: segments.slice(index + offset).join(path.sep) } } -function wrap (nodule, name, wrapper) { - if (!nodule || !nodule[name]) { - logger('no original function ' + name + ' to wrap') - return - } - - if (!wrapper) { - logger('no wrapper function') - logger((new Error()).stack) - return - } - - if (!isFunction(nodule[name]) || !isFunction(wrapper)) { - logger('original object and wrapper must be functions') - return - } - - var original = nodule[name] - var wrapped = wrapper(original, name) - - defineProperty(wrapped, '__original', original) - defineProperty(wrapped, '__unwrap', function () { - if (nodule[name] === wrapped) defineProperty(nodule, name, original) - }) - defineProperty(wrapped, '__wrapped', true) - - defineProperty(nodule, name, wrapped) - return wrapped -} - -function massWrap (nodules, names, wrapper) { - if (!nodules) { - logger('must provide one or more modules to patch') - logger((new Error()).stack) - return - } else if (!Array.isArray(nodules)) { - nodules = [nodules] - } - - if (!(names && Array.isArray(names))) { - logger('must provide one or more functions to wrap on modules') - return - } - - nodules.forEach(function (nodule) { - names.forEach(function (name) { - wrap(nodule, name, wrapper) - }) - }) -} - -function unwrap (nodule, name) { - if (!nodule || !nodule[name]) { - logger('no function to unwrap.') - logger((new Error()).stack) - return - } - - if (!nodule[name].__unwrap) { - logger('no original to unwrap to -- has ' + name + ' already been unwrapped?') - } else { - return nodule[name].__unwrap() - } -} - -function massUnwrap (nodules, names) { - if (!nodules) { - logger('must provide one or more modules to patch') - logger((new Error()).stack) - return - } else if (!Array.isArray(nodules)) { - nodules = [nodules] - } - - if (!(names && Array.isArray(names))) { - logger('must provide one or more functions to unwrap on modules') - return - } - - nodules.forEach(function (nodule) { - names.forEach(function (name) { - unwrap(nodule, name) - }) - }) -} - -shimmer.wrap = wrap -shimmer.massWrap = massWrap -shimmer.unwrap = unwrap -shimmer.massUnwrap = massUnwrap - -module.exports = shimmer - /***/ }), @@ -128420,14 +99960,6 @@ module.exports = require("assert"); /***/ }), -/***/ 50852: -/***/ ((module) => { - -"use strict"; -module.exports = require("async_hooks"); - -/***/ }), - /***/ 32081: /***/ ((module) => { @@ -128612,6 +100144,14 @@ module.exports = require("node:inspector"); /***/ }), +/***/ 82033: +/***/ ((module) => { + +"use strict"; +module.exports = require("node:module"); + +/***/ }), + /***/ 87503: /***/ ((module) => { @@ -128804,27 +100344,26 @@ module.exports = require("worker_threads"); /***/ }), -/***/ 78154: -/***/ ((module) => { +/***/ 88264: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -module.exports = JSON.parse('{"assert":true,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],"buffer_ieee754":">= 0.5 && < 0.9.7","buffer":true,"node:buffer":[">= 14.18 && < 15",">= 16"],"child_process":true,"node:child_process":[">= 14.18 && < 15",">= 16"],"cluster":">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],"console":true,"node:console":[">= 14.18 && < 15",">= 16"],"constants":true,"node:constants":[">= 14.18 && < 15",">= 16"],"crypto":true,"node:crypto":[">= 14.18 && < 15",">= 16"],"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":[">= 14.18 && < 15",">= 16"],"diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],"dns":true,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],"events":true,"node:events":[">= 14.18 && < 15",">= 16"],"freelist":"< 6","fs":true,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],"_http_agent":">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],"_http_client":">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],"_http_common":">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],"_http_incoming":">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],"_http_outgoing":">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],"_http_server":">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],"http":true,"node:http":[">= 14.18 && < 15",">= 16"],"http2":">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],"https":true,"node:https":[">= 14.18 && < 15",">= 16"],"inspector":">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],"_linklist":"< 8","module":true,"node:module":[">= 14.18 && < 15",">= 16"],"net":true,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":[">= 14.18 && < 15",">= 16"],"path":true,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],"process":">= 1","node:process":[">= 14.18 && < 15",">= 16"],"punycode":">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],"querystring":true,"node:querystring":[">= 14.18 && < 15",">= 16"],"readline":true,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17","repl":true,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],"smalloc":">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],"_stream_duplex":">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],"_stream_transform":">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],"_stream_wrap":">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],"_stream_passthrough":">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],"_stream_readable":">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],"_stream_writable":">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],"stream":true,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":[">= 14.18 && < 15",">= 16"],"sys":[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],"timers":true,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],"_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],"tls":true,"node:tls":[">= 14.18 && < 15",">= 16"],"trace_events":">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],"tty":true,"node:tty":[">= 14.18 && < 15",">= 16"],"url":true,"node:url":[">= 14.18 && < 15",">= 16"],"util":true,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":[">= 14.18 && < 15",">= 16"],"vm":true,"node:vm":[">= 14.18 && < 15",">= 16"],"wasi":[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],"worker_threads":">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],"zlib":">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}'); +const AI_CITATIONS="ai.citations",AI_COMPLETION_TOKENS_USED="ai.completion_tokens.used",AI_DOCUMENTS="ai.documents",AI_FINISH_REASON="ai.finish_reason",AI_FREQUENCY_PENALTY="ai.frequency_penalty",AI_FUNCTION_CALL="ai.function_call",AI_GENERATION_ID="ai.generation_id",AI_INPUT_MESSAGES="ai.input_messages",AI_IS_SEARCH_REQUIRED="ai.is_search_required",AI_METADATA="ai.metadata",AI_MODEL_ID="ai.model_id",AI_MODEL_PROVIDER="ai.model.provider",AI_PIPELINE_NAME="ai.pipeline.name",AI_PREAMBLE="ai.preamble",AI_PRESENCE_PENALTY="ai.presence_penalty",AI_PROMPT_TOKENS_USED="ai.prompt_tokens.used",AI_RAW_PROMPTING="ai.raw_prompting",AI_RESPONSES="ai.responses",AI_RESPONSE_FORMAT="ai.response_format",AI_SEARCH_QUERIES="ai.search_queries",AI_SEARCH_RESULTS="ai.search_results",AI_SEED="ai.seed",AI_STREAMING="ai.streaming",AI_TAGS="ai.tags",AI_TEMPERATURE="ai.temperature",AI_TEXTS="ai.texts",AI_TOOLS="ai.tools",AI_TOOL_CALLS="ai.tool_calls",AI_TOP_K="ai.top_k",AI_TOP_P="ai.top_p",AI_TOTAL_COST="ai.total_cost",AI_TOTAL_TOKENS_USED="ai.total_tokens.used",AI_WARNINGS="ai.warnings",ANGULAR_VERSION="angular.version",APP_APP_BUILD="app.app_build",APP_APP_IDENTIFIER="app.app_identifier",APP_APP_NAME="app.app_name",APP_APP_START_TIME="app.app_start_time",APP_APP_VERSION="app.app_version",APP_BUILD="app.build",APP_IDENTIFIER="app.identifier",APP_IN_FOREGROUND="app.in_foreground",APP_NAME="app.name",APP_START_COLD="app_start_cold",APP_START_TIME="app.start_time",APP_START_TYPE="app_start_type",APP_START_WARM="app_start_warm",APP_VERSION="app.version",APP_VITALS_FRAMES_DELAY_VALUE="app.vitals.frames.delay.value",APP_VITALS_FRAMES_FROZEN_COUNT="app.vitals.frames.frozen.count",APP_VITALS_FRAMES_SLOW_COUNT="app.vitals.frames.slow.count",APP_VITALS_FRAMES_TOTAL_COUNT="app.vitals.frames.total.count",APP_VITALS_START_COLD_VALUE="app.vitals.start.cold.value",APP_VITALS_START_PREWARMED="app.vitals.start.prewarmed",APP_VITALS_START_REASON="app.vitals.start.reason",APP_VITALS_START_SCREEN="app.vitals.start.screen",APP_VITALS_START_TYPE="app.vitals.start.type",APP_VITALS_START_WARM_VALUE="app.vitals.start.warm.value",APP_VITALS_TTFD_VALUE="app.vitals.ttfd.value",APP_VITALS_TTID_VALUE="app.vitals.ttid.value",ART_GC_BLOCKING_COUNT="art.gc.blocking_count",ART_GC_BLOCKING_TIME="art.gc.blocking_time",ART_GC_PRE_OOME_COUNT="art.gc.pre_oome_count",ART_GC_TOTAL_COUNT="art.gc.total_count",ART_GC_TOTAL_TIME="art.gc.total_time",ART_GC_WAITING_TIME="art.gc.waiting_time",ART_MEMORY_FREE="art.memory.free",ART_MEMORY_FREE_UNTIL_GC="art.memory.free_until_gc",ART_MEMORY_FREE_UNTIL_OOME="art.memory.free_until_oome",ART_MEMORY_MAX="art.memory.max",ART_MEMORY_TOTAL="art.memory.total",AWS_CLOUDWATCH_LOGS_LOG_GROUP="aws.cloudwatch.logs.log_group",AWS_CLOUDWATCH_LOGS_LOG_STREAM="aws.cloudwatch.logs.log_stream",AWS_CLOUDWATCH_LOGS_URL="aws.cloudwatch.logs.url",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS="aws.dynamodb.attribute_definitions",AWS_DYNAMODB_CONSISTENT_READ="aws.dynamodb.consistent_read",AWS_DYNAMODB_CONSUMED_CAPACITY="aws.dynamodb.consumed_capacity",AWS_DYNAMODB_COUNT="aws.dynamodb.count",AWS_DYNAMODB_EXCLUSIVE_START_TABLE="aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES="aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES="aws.dynamodb.global_secondary_index_updates",AWS_DYNAMODB_INDEX_NAME="aws.dynamodb.index_name",AWS_DYNAMODB_ITEM_COLLECTION_METRICS="aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_LIMIT="aws.dynamodb.limit",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES="aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_PROJECTION="aws.dynamodb.projection",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY="aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY="aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_SCANNED_COUNT="aws.dynamodb.scanned_count",AWS_DYNAMODB_SCAN_FORWARD="aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT="aws.dynamodb.segment",AWS_DYNAMODB_SELECT="aws.dynamodb.select",AWS_DYNAMODB_TABLE_COUNT="aws.dynamodb.table_count",AWS_DYNAMODB_TABLE_NAMES="aws.dynamodb.table_names",AWS_DYNAMODB_TOTAL_SEGMENTS="aws.dynamodb.total_segments",AWS_EXTENDED_REQUEST_ID="aws.extended_request_id",AWS_KINESIS_STREAM_NAME="aws.kinesis.stream_name",_AWS_KINESIS_STREAM_NAME="aws.kinesis.stream.name",AWS_LAMBDA_AWS_REQUEST_ID="aws.lambda.aws_request_id",AWS_LAMBDA_EXECUTION_DURATION_IN_MILLIS="aws.lambda.execution_duration_in_millis",AWS_LAMBDA_FUNCTION_NAME="aws.lambda.function_name",AWS_LAMBDA_FUNCTION_VERSION="aws.lambda.function_version",AWS_LAMBDA_INVOKED_ARN="aws.lambda.invoked_arn",AWS_LAMBDA_INVOKED_FUNCTION_ARN="aws.lambda.invoked_function_arn",AWS_LAMBDA_REMAINING_TIME_IN_MILLIS="aws.lambda.remaining_time_in_millis",AWS_LOG_GROUP_NAMES="aws.log.group.names",AWS_LOG_STREAM_NAMES="aws.log.stream.names",AWS_REQUEST_EXTENDED_ID="aws.request.extended_id",AWS_REQUEST_ID="aws.request_id",_AWS_REQUEST_ID="aws.request.id",AWS_S3_BUCKET="aws.s3.bucket",AWS_SECRETSMANAGER_SECRET_ARN="aws.secretsmanager.secret.arn",AWS_SNS_TOPIC_ARN="aws.sns.topic.arn",AWS_STEP_FUNCTIONS_ACTIVITY_ARN="aws.step_functions.activity.arn",AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN="aws.step_functions.state_machine.arn",BLOCKED_MAIN_THREAD="blocked_main_thread",BROWSER_NAME="browser.name",BROWSER_PERFORMANCE_NAVIGATION_ACTIVATION_START="browser.performance.navigation.activation_start",BROWSER_PERFORMANCE_TIME_ORIGIN="browser.performance.time_origin",BROWSER_REPORT_TYPE="browser.report.type",BROWSER_SCRIPT_INVOKER="browser.script.invoker",BROWSER_SCRIPT_INVOKER_TYPE="browser.script.invoker_type",BROWSER_SCRIPT_SOURCE_CHAR_POSITION="browser.script.source_char_position",BROWSER_VERSION="browser.version",BROWSER_WEB_VITAL_CLS_REPORT_EVENT="browser.web_vital.cls.report_event",BROWSER_WEB_VITAL_CLS_SOURCE_KEY="browser.web_vital.cls.source.",BROWSER_WEB_VITAL_CLS_SOURCE_KEY_BASE="browser.web_vital.cls.source",BROWSER_WEB_VITAL_CLS_VALUE="browser.web_vital.cls.value",BROWSER_WEB_VITAL_FCP_VALUE="browser.web_vital.fcp.value",BROWSER_WEB_VITAL_FP_VALUE="browser.web_vital.fp.value",BROWSER_WEB_VITAL_INP_VALUE="browser.web_vital.inp.value",BROWSER_WEB_VITAL_LCP_ELEMENT="browser.web_vital.lcp.element",BROWSER_WEB_VITAL_LCP_ID="browser.web_vital.lcp.id",BROWSER_WEB_VITAL_LCP_LOAD_TIME="browser.web_vital.lcp.load_time",BROWSER_WEB_VITAL_LCP_RENDER_TIME="browser.web_vital.lcp.render_time",BROWSER_WEB_VITAL_LCP_REPORT_EVENT="browser.web_vital.lcp.report_event",BROWSER_WEB_VITAL_LCP_SIZE="browser.web_vital.lcp.size",BROWSER_WEB_VITAL_LCP_URL="browser.web_vital.lcp.url",BROWSER_WEB_VITAL_LCP_VALUE="browser.web_vital.lcp.value",BROWSER_WEB_VITAL_TTFB_REQUEST_TIME="browser.web_vital.ttfb.request_time",BROWSER_WEB_VITAL_TTFB_VALUE="browser.web_vital.ttfb.value",CACHE_HIT="cache.hit",CACHE_ITEM_SIZE="cache.item_size",CACHE_KEY="cache.key",CACHE_OPERATION="cache.operation",CACHE_TTL="cache.ttl",CACHE_WRITE="cache.write",CHANNEL="channel",CLIENT_ADDRESS="client.address",CLIENT_PORT="client.port",CLOUDFLARE_D1_DURATION="cloudflare.d1.duration",CLOUDFLARE_D1_QUERY_TYPE="cloudflare.d1.query_type",CLOUDFLARE_D1_ROWS_READ="cloudflare.d1.rows_read",CLOUDFLARE_D1_ROWS_WRITTEN="cloudflare.d1.rows_written",CLOUDFLARE_DURABLE_OBJECT_QUERY_BINDINGS="cloudflare.durable_object.query.bindings",CLOUDFLARE_DURABLE_OBJECT_RESPONSE_ROWS_READ="cloudflare.durable_object.response.rows_read",CLOUDFLARE_DURABLE_OBJECT_RESPONSE_ROWS_WRITTEN="cloudflare.durable_object.response.rows_written",CLOUDFLARE_R2_BUCKET="cloudflare.r2.bucket",CLOUDFLARE_R2_OPERATION="cloudflare.r2.operation",CLOUDFLARE_R2_REQUEST_DELIMITER="cloudflare.r2.request.delimiter",CLOUDFLARE_R2_REQUEST_KEY="cloudflare.r2.request.key",CLOUDFLARE_R2_REQUEST_PART_NUMBER="cloudflare.r2.request.part_number",CLOUDFLARE_R2_REQUEST_PREFIX="cloudflare.r2.request.prefix",CLOUDFLARE_WORKFLOW_ATTEMPT="cloudflare.workflow.attempt",CLOUDFLARE_WORKFLOW_RETRIES_BACKOFF="cloudflare.workflow.retries.backoff",CLOUDFLARE_WORKFLOW_RETRIES_DELAY="cloudflare.workflow.retries.delay",CLOUDFLARE_WORKFLOW_RETRIES_LIMIT="cloudflare.workflow.retries.limit",CLOUDFLARE_WORKFLOW_TIMEOUT="cloudflare.workflow.timeout",CLOUD_ACCOUNT_ID="cloud.account.id",CLOUD_AVAILABILITY_ZONE="cloud.availability_zone",CLOUD_PLATFORM="cloud.platform",CLOUD_PROVIDER="cloud.provider",CLOUD_REGION="cloud.region",CLOUD_RESOURCE_ID="cloud.resource_id",CLS="cls",CLS_SOURCE_KEY="cls.source.",CLS_SOURCE_KEY_BASE="cls.source",CODE_FILEPATH="code.filepath",CODE_FILE_PATH="code.file.path",CODE_FUNCTION="code.function",CODE_FUNCTION_NAME="code.function.name",CODE_LINENO="code.lineno",CODE_LINE_NUMBER="code.line.number",CODE_NAMESPACE="code.namespace",CONNECTIONTYPE="connectionType",CONNECTION_RTT="connection.rtt",CULTURE_CALENDAR="culture.calendar",CULTURE_DISPLAY_NAME="culture.display_name",CULTURE_IS_24_HOUR_FORMAT="culture.is_24_hour_format",CULTURE_LOCALE="culture.locale",CULTURE_TIMEZONE="culture.timezone",DB_COLLECTION_NAME="db.collection.name",DB_DRIVER_NAME="db.driver.name",DB_NAME="db.name",DB_NAMESPACE="db.namespace",DB_OPERATION="db.operation",DB_OPERATION_BATCH_SIZE="db.operation.batch.size",DB_OPERATION_NAME="db.operation.name",DB_QUERY_PARAMETER_KEY="db.query.parameter.",DB_QUERY_PARAMETER_KEY_BASE="db.query.parameter",DB_QUERY_SUMMARY="db.query.summary",DB_QUERY_TEXT="db.query.text",DB_REDIS_CONNECTION="db.redis.connection",DB_REDIS_KEY="db.redis.key",DB_REDIS_PARAMETERS="db.redis.parameters",DB_RESPONSE_STATUS_CODE="db.response.status_code",DB_SQL_BINDINGS="db.sql.bindings",DB_STATEMENT="db.statement",DB_STORED_PROCEDURE_NAME="db.stored_procedure.name",DB_SYSTEM="db.system",DB_SYSTEM_NAME="db.system.name",DB_USER="db.user",DEVICEMEMORY="deviceMemory",DEVICE_ARCHS="device.archs",DEVICE_BATTERY_LEVEL="device.battery_level",DEVICE_BATTERY_TEMPERATURE="device.battery_temperature",DEVICE_BOOT_TIME="device.boot_time",DEVICE_BRAND="device.brand",DEVICE_CHARGING="device.charging",DEVICE_CHIPSET="device.chipset",DEVICE_CLASS="device.class",DEVICE_CONNECTION_TYPE="device.connection_type",DEVICE_CPU_DESCRIPTION="device.cpu_description",DEVICE_EXTERNAL_FREE_STORAGE="device.external_free_storage",DEVICE_EXTERNAL_STORAGE_SIZE="device.external_storage_size",DEVICE_FAMILY="device.family",DEVICE_FREE_MEMORY="device.free_memory",DEVICE_FREE_STORAGE="device.free_storage",DEVICE_ID="device.id",DEVICE_LOCALE="device.locale",DEVICE_LOW_MEMORY="device.low_memory",DEVICE_LOW_POWER_MODE="device.low_power_mode",DEVICE_MANUFACTURER="device.manufacturer",DEVICE_MEMORY_ESTIMATED_CAPACITY="device.memory.estimated_capacity",DEVICE_MEMORY_SIZE="device.memory_size",DEVICE_MODEL="device.model",DEVICE_MODEL_ID="device.model_id",DEVICE_NAME="device.name",DEVICE_ONLINE="device.online",DEVICE_ORIENTATION="device.orientation",DEVICE_PROCESSOR_COUNT="device.processor_count",DEVICE_PROCESSOR_FREQUENCY="device.processor_frequency",DEVICE_SCREEN_DENSITY="device.screen_density",DEVICE_SCREEN_DPI="device.screen_dpi",DEVICE_SCREEN_HEIGHT_PIXELS="device.screen_height_pixels",DEVICE_SCREEN_WIDTH_PIXELS="device.screen_width_pixels",DEVICE_SIMULATOR="device.simulator",DEVICE_STORAGE_SIZE="device.storage_size",DEVICE_THERMAL_STATE="device.thermal_state",DEVICE_TIMEZONE="device.timezone",DEVICE_USABLE_MEMORY="device.usable_memory",DIST="dist",EFFECTIVECONNECTIONTYPE="effectiveConnectionType",ENVIRONMENT="environment",ERROR_TYPE="error.type",EVENT_ID="event.id",EVENT_NAME="event.name",EXCEPTION_ESCAPED="exception.escaped",EXCEPTION_MESSAGE="exception.message",EXCEPTION_STACKTRACE="exception.stacktrace",EXCEPTION_TYPE="exception.type",FAAS_COLDSTART="faas.coldstart",FAAS_CRON="faas.cron",FAAS_DURATION_IN_MS="faas.duration_in_ms",FAAS_ENTRY_POINT="faas.entry_point",FAAS_EXECUTION="faas.execution",FAAS_ID="faas.id",FAAS_IDENTITY="faas.identity",FAAS_INVOCATION_ID="faas.invocation_id",FAAS_INVOKED_NAME="faas.invoked_name",FAAS_INVOKED_PROVIDER="faas.invoked_provider",FAAS_INVOKED_REGION="faas.invoked_region",FAAS_NAME="faas.name",FAAS_TIME="faas.time",FAAS_TRIGGER="faas.trigger",FAAS_VERSION="faas.version",FCP="fcp",FLAG_EVALUATION_KEY="flag.evaluation.",FLAG_EVALUATION_KEY_BASE="flag.evaluation",FP="fp",FRAMES_DELAY="frames.delay",FRAMES_FROZEN="frames.frozen",FRAMES_FROZEN_RATE="frames_frozen_rate",FRAMES_SLOW="frames.slow",FRAMES_SLOW_RATE="frames_slow_rate",FRAMES_TOTAL="frames.total",FS_ERROR="fs_error",GCP_FUNCTION_CONTEXT_EVENT_ID="gcp.function.context.event_id",GCP_FUNCTION_CONTEXT_EVENT_TYPE="gcp.function.context.event_type",GCP_FUNCTION_CONTEXT_ID="gcp.function.context.id",GCP_FUNCTION_CONTEXT_RESOURCE="gcp.function.context.resource",GCP_FUNCTION_CONTEXT_SOURCE="gcp.function.context.source",GCP_FUNCTION_CONTEXT_SPECVERSION="gcp.function.context.specversion",GCP_FUNCTION_CONTEXT_TIME="gcp.function.context.time",GCP_FUNCTION_CONTEXT_TIMESTAMP="gcp.function.context.timestamp",GCP_FUNCTION_CONTEXT_TYPE="gcp.function.context.type",GCP_PROJECT_ID="gcp.project.id",GEN_AI_AGENT_NAME="gen_ai.agent.name",GEN_AI_CONTEXT_UTILIZATION="gen_ai.context.utilization",GEN_AI_CONTEXT_WINDOW_SIZE="gen_ai.context.window_size",GEN_AI_CONVERSATION_ID="gen_ai.conversation.id",GEN_AI_COST_CACHE_CREATION_INPUT_TOKENS="gen_ai.cost.cache_creation.input_tokens",GEN_AI_COST_CACHE_READ_INPUT_TOKENS="gen_ai.cost.cache_read.input_tokens",GEN_AI_COST_INPUT_TOKENS="gen_ai.cost.input_tokens",GEN_AI_COST_OUTPUT_TOKENS="gen_ai.cost.output_tokens",GEN_AI_COST_REASONING_OUTPUT_TOKENS="gen_ai.cost.reasoning.output_tokens",GEN_AI_COST_TOTAL_TOKENS="gen_ai.cost.total_tokens",GEN_AI_EMBEDDINGS_INPUT="gen_ai.embeddings.input",GEN_AI_FUNCTION_ID="gen_ai.function_id",GEN_AI_INPUT_MESSAGES="gen_ai.input.messages",GEN_AI_OPERATION_NAME="gen_ai.operation.name",GEN_AI_OPERATION_TYPE="gen_ai.operation.type",GEN_AI_OUTPUT_MESSAGES="gen_ai.output.messages",GEN_AI_PIPELINE_NAME="gen_ai.pipeline.name",GEN_AI_PROMPT="gen_ai.prompt",GEN_AI_PROMPT_NAME="gen_ai.prompt.name",GEN_AI_PROVIDER_NAME="gen_ai.provider.name",GEN_AI_REQUEST_AVAILABLE_TOOLS="gen_ai.request.available_tools",GEN_AI_REQUEST_FREQUENCY_PENALTY="gen_ai.request.frequency_penalty",GEN_AI_REQUEST_MAX_TOKENS="gen_ai.request.max_tokens",GEN_AI_REQUEST_MESSAGES="gen_ai.request.messages",GEN_AI_REQUEST_MODEL="gen_ai.request.model",GEN_AI_REQUEST_PRESENCE_PENALTY="gen_ai.request.presence_penalty",GEN_AI_REQUEST_REASONING_EFFORT="gen_ai.request.reasoning_effort",GEN_AI_REQUEST_SEED="gen_ai.request.seed",GEN_AI_REQUEST_STOP_SEQUENCES="gen_ai.request.stop_sequences",GEN_AI_REQUEST_TEMPERATURE="gen_ai.request.temperature",GEN_AI_REQUEST_TOP_K="gen_ai.request.top_k",GEN_AI_REQUEST_TOP_P="gen_ai.request.top_p",GEN_AI_RESPONSE_FINISH_REASONS="gen_ai.response.finish_reasons",GEN_AI_RESPONSE_ID="gen_ai.response.id",GEN_AI_RESPONSE_MODEL="gen_ai.response.model",GEN_AI_RESPONSE_STREAMING="gen_ai.response.streaming",GEN_AI_RESPONSE_TEXT="gen_ai.response.text",GEN_AI_RESPONSE_TIME_TO_FIRST_CHUNK="gen_ai.response.time_to_first_chunk",GEN_AI_RESPONSE_TIME_TO_FIRST_TOKEN="gen_ai.response.time_to_first_token",GEN_AI_RESPONSE_TOKENS_PER_SECOND="gen_ai.response.tokens_per_second",GEN_AI_RESPONSE_TOOL_CALLS="gen_ai.response.tool_calls",GEN_AI_SYSTEM="gen_ai.system",GEN_AI_SYSTEM_INSTRUCTIONS="gen_ai.system_instructions",GEN_AI_SYSTEM_MESSAGE="gen_ai.system.message",GEN_AI_TOOL_CALL_ARGUMENTS="gen_ai.tool.call.arguments",GEN_AI_TOOL_CALL_RESULT="gen_ai.tool.call.result",GEN_AI_TOOL_DEFINITIONS="gen_ai.tool.definitions",GEN_AI_TOOL_DESCRIPTION="gen_ai.tool.description",GEN_AI_TOOL_INPUT="gen_ai.tool.input",GEN_AI_TOOL_MESSAGE="gen_ai.tool.message",GEN_AI_TOOL_NAME="gen_ai.tool.name",GEN_AI_TOOL_OUTPUT="gen_ai.tool.output",GEN_AI_TOOL_TYPE="gen_ai.tool.type",GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS="gen_ai.usage.cache_creation.input_tokens",GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS="gen_ai.usage.cache_read.input_tokens",GEN_AI_USAGE_COMPLETION_TOKENS="gen_ai.usage.completion_tokens",GEN_AI_USAGE_INPUT_TOKENS="gen_ai.usage.input_tokens",GEN_AI_USAGE_INPUT_TOKENS_CACHED="gen_ai.usage.input_tokens.cached",GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE="gen_ai.usage.input_tokens.cache_write",GEN_AI_USAGE_OUTPUT_TOKENS="gen_ai.usage.output_tokens",GEN_AI_USAGE_OUTPUT_TOKENS_REASONING="gen_ai.usage.output_tokens.reasoning",GEN_AI_USAGE_PROMPT_TOKENS="gen_ai.usage.prompt_tokens",GEN_AI_USAGE_REASONING_OUTPUT_TOKENS="gen_ai.usage.reasoning.output_tokens",GEN_AI_USAGE_TOTAL_TOKENS="gen_ai.usage.total_tokens",GRAPHQL_DOCUMENT="graphql.document",GRAPHQL_OPERATION_NAME="graphql.operation.name",GRAPHQL_OPERATION_TYPE="graphql.operation.type",HARDWARECONCURRENCY="hardwareConcurrency",HTTP_CLIENT_IP="http.client_ip",HTTP_DECODED_RESPONSE_CONTENT_LENGTH="http.decoded_response_content_length",HTTP_FLAVOR="http.flavor",HTTP_FRAGMENT="http.fragment",HTTP_HOST="http.host",HTTP_METHOD="http.method",HTTP_QUERY="http.query",HTTP_REQUEST_BODY_DATA="http.request.body.data",HTTP_REQUEST_CONNECTION_END="http.request.connection_end",HTTP_REQUEST_CONNECT_START="http.request.connect_start",HTTP_REQUEST_DOMAIN_LOOKUP_END="http.request.domain_lookup_end",HTTP_REQUEST_DOMAIN_LOOKUP_START="http.request.domain_lookup_start",HTTP_REQUEST_FETCH_START="http.request.fetch_start",HTTP_REQUEST_HEADER_KEY="http.request.header.",HTTP_REQUEST_HEADER_KEY_BASE="http.request.header",HTTP_REQUEST_METHOD="http.request.method",_HTTP_REQUEST_METHOD="http.request_method",HTTP_REQUEST_REDIRECT_END="http.request.redirect_end",HTTP_REQUEST_REDIRECT_START="http.request.redirect_start",HTTP_REQUEST_REQUEST_START="http.request.request_start",HTTP_REQUEST_RESEND_COUNT="http.request.resend_count",HTTP_REQUEST_RESPONSE_END="http.request.response_end",HTTP_REQUEST_RESPONSE_START="http.request.response_start",HTTP_REQUEST_SAME_ORIGIN="http.request.same_origin",HTTP_REQUEST_SECURE_CONNECTION_START="http.request.secure_connection_start",HTTP_REQUEST_TIME_TO_FIRST_BYTE="http.request.time_to_first_byte",HTTP_REQUEST_WORKER_START="http.request.worker_start",HTTP_RESPONSE_BODY_SIZE="http.response.body.size",HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length",HTTP_RESPONSE_HEADER_CONTENT_LENGTH="http.response.header.content-length",HTTP_RESPONSE_HEADER_KEY="http.response.header.",HTTP_RESPONSE_HEADER_KEY_BASE="http.response.header",HTTP_RESPONSE_SIZE="http.response.size",HTTP_RESPONSE_STATUS_CODE="http.response.status_code",HTTP_RESPONSE_TRANSFER_SIZE="http.response_transfer_size",HTTP_ROUTE="http.route",HTTP_SCHEME="http.scheme",HTTP_SERVER_NAME="http.server_name",HTTP_SERVER_REQUEST_TIME_IN_QUEUE="http.server.request.time_in_queue",HTTP_STATUS_CODE="http.status_code",HTTP_TARGET="http.target",HTTP_URL="http.url",HTTP_USER_AGENT="http.user_agent",ID="id",INP="inp",JSONRPC_PROTOCOL_VERSION="jsonrpc.protocol.version",JSONRPC_REQUEST_ID="jsonrpc.request.id",JVM_GC_ACTION="jvm.gc.action",JVM_GC_NAME="jvm.gc.name",JVM_MEMORY_POOL_NAME="jvm.memory.pool.name",JVM_MEMORY_TYPE="jvm.memory.type",JVM_THREAD_DAEMON="jvm.thread.daemon",JVM_THREAD_STATE="jvm.thread.state",KOA_NAME="koa.name",KOA_TYPE="koa.type",LCP="lcp",LCP_ELEMENT="lcp.element",LCP_ID="lcp.id",LCP_LOADTIME="lcp.loadTime",LCP_RENDERTIME="lcp.renderTime",LCP_SIZE="lcp.size",LCP_URL="lcp.url",LOGGER_NAME="logger.name",MCP_CANCELLED_REASON="mcp.cancelled.reason",MCP_CANCELLED_REQUEST_ID="mcp.cancelled.request_id",MCP_CLIENT_NAME="mcp.client.name",MCP_CLIENT_TITLE="mcp.client.title",MCP_CLIENT_VERSION="mcp.client.version",MCP_LIFECYCLE_PHASE="mcp.lifecycle.phase",MCP_LOGGING_DATA_TYPE="mcp.logging.data_type",MCP_LOGGING_LEVEL="mcp.logging.level",MCP_LOGGING_LOGGER="mcp.logging.logger",MCP_LOGGING_MESSAGE="mcp.logging.message",MCP_METHOD_NAME="mcp.method.name",MCP_PROGRESS_CURRENT="mcp.progress.current",MCP_PROGRESS_MESSAGE="mcp.progress.message",MCP_PROGRESS_PERCENTAGE="mcp.progress.percentage",MCP_PROGRESS_TOKEN="mcp.progress.token",MCP_PROGRESS_TOTAL="mcp.progress.total",MCP_PROMPT_NAME="mcp.prompt.name",MCP_PROMPT_RESULT_DESCRIPTION="mcp.prompt.result.description",MCP_PROMPT_RESULT_MESSAGE_CONTENT="mcp.prompt.result.message_content",MCP_PROMPT_RESULT_MESSAGE_COUNT="mcp.prompt.result.message_count",MCP_PROMPT_RESULT_MESSAGE_ROLE="mcp.prompt.result.message_role",MCP_PROTOCOL_READY="mcp.protocol.ready",MCP_PROTOCOL_VERSION="mcp.protocol.version",MCP_REQUEST_ARGUMENT_KEY="mcp.request.argument.",MCP_REQUEST_ARGUMENT_KEY_BASE="mcp.request.argument",MCP_REQUEST_ARGUMENT_NAME="mcp.request.argument.name",MCP_REQUEST_ARGUMENT_URI="mcp.request.argument.uri",MCP_REQUEST_ID="mcp.request.id",MCP_RESOURCE_PROTOCOL="mcp.resource.protocol",MCP_RESOURCE_URI="mcp.resource.uri",MCP_SERVER_NAME="mcp.server.name",MCP_SERVER_TITLE="mcp.server.title",MCP_SERVER_VERSION="mcp.server.version",MCP_SESSION_ID="mcp.session.id",MCP_TOOL_NAME="mcp.tool.name",MCP_TOOL_RESULT_CONTENT="mcp.tool.result.content",MCP_TOOL_RESULT_CONTENT_COUNT="mcp.tool.result.content_count",MCP_TOOL_RESULT_IS_ERROR="mcp.tool.result.is_error",MCP_TRANSPORT="mcp.transport",MDC_KEY="mdc.",MDC_KEY_BASE="mdc",MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count",MESSAGING_DESTINATION="messaging.destination",MESSAGING_DESTINATION_CONNECTION="messaging.destination.connection",MESSAGING_DESTINATION_NAME="messaging.destination.name",MESSAGING_MESSAGE_BODY_SIZE="messaging.message.body.size",MESSAGING_MESSAGE_CONVERSATION_ID="messaging.message.conversation_id",MESSAGING_MESSAGE_ENVELOPE_SIZE="messaging.message.envelope.size",MESSAGING_MESSAGE_ID="messaging.message.id",MESSAGING_MESSAGE_RECEIVE_LATENCY="messaging.message.receive.latency",MESSAGING_MESSAGE_RETRY_COUNT="messaging.message.retry.count",MESSAGING_OPERATION_NAME="messaging.operation.name",MESSAGING_OPERATION_TYPE="messaging.operation.type",MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY="messaging.rabbitmq.destination.routing_key",MESSAGING_SYSTEM="messaging.system",METHOD="method",MIDDLEWARE_NAME="middleware.name",NAVIGATION_ORIGIN="navigation.origin",NAVIGATION_ROUTE_ID="navigation.route.id",NAVIGATION_TYPE="navigation.type",NEL_ELAPSED_TIME="nel.elapsed_time",NEL_PHASE="nel.phase",NEL_REFERRER="nel.referrer",NEL_SAMPLING_FUNCTION="nel.sampling_function",NEL_TYPE="nel.type",NETWORK_CONNECTION_EFFECTIVE_TYPE="network.connection.effective_type",NETWORK_CONNECTION_RTT="network.connection.rtt",NETWORK_CONNECTION_TYPE="network.connection.type",NETWORK_LOCAL_ADDRESS="network.local.address",NETWORK_LOCAL_PORT="network.local.port",NETWORK_PEER_ADDRESS="network.peer.address",NETWORK_PEER_PORT="network.peer.port",NETWORK_PROTOCOL_NAME="network.protocol.name",NETWORK_PROTOCOL_VERSION="network.protocol.version",NETWORK_TRANSPORT="network.transport",NETWORK_TYPE="network.type",NET_HOST_IP="net.host.ip",NET_HOST_NAME="net.host.name",NET_HOST_PORT="net.host.port",NET_PEER_IP="net.peer.ip",NET_PEER_NAME="net.peer.name",NET_PEER_PORT="net.peer.port",NET_PROTOCOL_NAME="net.protocol.name",NET_PROTOCOL_VERSION="net.protocol.version",NET_SOCK_FAMILY="net.sock.family",NET_SOCK_HOST_ADDR="net.sock.host.addr",NET_SOCK_HOST_PORT="net.sock.host.port",NET_SOCK_PEER_ADDR="net.sock.peer.addr",NET_SOCK_PEER_NAME="net.sock.peer.name",NET_SOCK_PEER_PORT="net.sock.peer.port",NET_TRANSPORT="net.transport",OS_BUILD="os.build",OS_BUILD_ID="os.build_id",OS_DESCRIPTION="os.description",OS_KERNEL_VERSION="os.kernel_version",OS_NAME="os.name",OS_RAW_DESCRIPTION="os.raw_description",OS_ROOTED="os.rooted",OS_THEME="os.theme",OS_TYPE="os.type",OS_VERSION="os.version",OTEL_KIND="otel.kind",OTEL_SCOPE_NAME="otel.scope.name",OTEL_SCOPE_VERSION="otel.scope.version",OTEL_STATUS_CODE="otel.status_code",OTEL_STATUS_DESCRIPTION="otel.status_description",PARAMS_KEY="params.",PARAMS_KEY_BASE="params",PERFORMANCE_ACTIVATIONSTART="performance.activationStart",PERFORMANCE_TIMEORIGIN="performance.timeOrigin",PREVIOUS_ROUTE="previous_route",PROCESS_COMMAND_ARGS="process.command_args",PROCESS_EXECUTABLE_NAME="process.executable.name",PROCESS_PID="process.pid",PROCESS_RUNTIME_DESCRIPTION="process.runtime.description",PROCESS_RUNTIME_ENGINE_NAME="process.runtime.engine.name",PROCESS_RUNTIME_ENGINE_VERSION="process.runtime.engine.version",PROCESS_RUNTIME_NAME="process.runtime.name",PROCESS_RUNTIME_VERSION="process.runtime.version",QUERY_KEY="query.",QUERY_KEY_BASE="query",REACT_VERSION="react.version",RELEASE="release",REMIX_ACTION_FORM_DATA_KEY="remix.action_form_data.",REMIX_ACTION_FORM_DATA_KEY_BASE="remix.action_form_data",REPLAY_ID="replay_id",RESOURCE_DEPLOYMENT_ENVIRONMENT="resource.deployment.environment",RESOURCE_DEPLOYMENT_ENVIRONMENT_NAME="resource.deployment.environment.name",RESOURCE_RENDER_BLOCKING_STATUS="resource.render_blocking_status",ROUTE="route",RPC_GRPC_STATUS_CODE="rpc.grpc.status_code",RPC_METHOD="rpc.method",RPC_RESPONSE_STATUS_CODE="rpc.response.status_code",RPC_SERVICE="rpc.service",RPC_SYSTEM="rpc.system",RPC_SYSTEM_NAME="rpc.system.name",RUNTIME_BUILD="runtime.build",RUNTIME_NAME="runtime.name",RUNTIME_RAW_DESCRIPTION="runtime.raw_description",RUNTIME_VERSION="runtime.version",SCORE_KEY="score.",SCORE_KEY_BASE="score",SCORE_RATIO_KEY="score.ratio.",SCORE_RATIO_KEY_BASE="score.ratio",SCORE_TOTAL="score.total",SCORE_WEIGHT_KEY="score.weight.",SCORE_WEIGHT_KEY_BASE="score.weight",SENTRY_ACTION="sentry.action",SENTRY_BROWSER_NAME="sentry.browser.name",SENTRY_BROWSER_VERSION="sentry.browser.version",SENTRY_CANCELLATION_REASON="sentry.cancellation_reason",SENTRY_CATEGORY="sentry.category",SENTRY_CLIENT_SAMPLE_RATE="sentry.client_sample_rate",SENTRY_DESCRIPTION="sentry.description",SENTRY_DIST="sentry.dist",SENTRY_DOMAIN="sentry.domain",SENTRY_DSC_ENVIRONMENT="sentry.dsc.environment",SENTRY_DSC_PROJECT_ID="sentry.dsc.project_id",SENTRY_DSC_PUBLIC_KEY="sentry.dsc.public_key",SENTRY_DSC_RELEASE="sentry.dsc.release",SENTRY_DSC_SAMPLED="sentry.dsc.sampled",SENTRY_DSC_SAMPLE_RATE="sentry.dsc.sample_rate",SENTRY_DSC_TRACE_ID="sentry.dsc.trace_id",SENTRY_DSC_TRANSACTION="sentry.dsc.transaction",SENTRY_ENVIRONMENT="sentry.environment",SENTRY_EXCLUSIVE_TIME="sentry.exclusive_time",SENTRY_GRAPHQL_OPERATION="sentry.graphql.operation",SENTRY_GROUP="sentry.group",SENTRY_HTTP_PREFETCH="sentry.http.prefetch",SENTRY_IDLE_SPAN_FINISH_REASON="sentry.idle_span_finish_reason",SENTRY_IS_REMOTE="sentry.is_remote",SENTRY_KIND="sentry.kind",SENTRY_MAIN_THREAD="sentry.main_thread",SENTRY_MESSAGE_PARAMETER_KEY="sentry.message.parameter.",SENTRY_MESSAGE_TEMPLATE="sentry.message.template",SENTRY_METRIC_SOURCE="sentry.metric.source",SENTRY_MOBILE="sentry.mobile",SENTRY_MODULE_KEY="sentry.module.",SENTRY_MODULE_KEY_BASE="sentry.module",SENTRY_NEXTJS_SSR_FUNCTION_ROUTE="sentry.nextjs.ssr.function.route",SENTRY_NEXTJS_SSR_FUNCTION_TYPE="sentry.nextjs.ssr.function.type",SENTRY_NORMALIZED_DB_QUERY="sentry.normalized_db_query",SENTRY_NORMALIZED_DB_QUERY_HASH="sentry.normalized_db_query.hash",SENTRY_NORMALIZED_DESCRIPTION="sentry.normalized_description",SENTRY_OBSERVED_TIMESTAMP_NANOS="sentry.observed_timestamp_nanos",SENTRY_OP="sentry.op",SENTRY_ORIGIN="sentry.origin",SENTRY_PLATFORM="sentry.platform",SENTRY_PROFILER_ID="sentry.profiler_id",SENTRY_PROFILE_ID="sentry.profile_id",SENTRY_RELEASE="sentry.release",SENTRY_REPLAY_ID="sentry.replay_id",SENTRY_REPLAY_IS_BUFFERING="sentry.replay_is_buffering",SENTRY_REPORT_EVENT="sentry.report_event",SENTRY_SDK_INTEGRATIONS="sentry.sdk.integrations",SENTRY_SDK_NAME="sentry.sdk.name",SENTRY_SDK_VERSION="sentry.sdk.version",SENTRY_SEGMENT_ID="sentry.segment.id",_SENTRY_SEGMENT_ID="sentry.segment_id",SENTRY_SEGMENT_NAME="sentry.segment.name",SENTRY_SERVER_SAMPLE_RATE="sentry.server_sample_rate",SENTRY_SOURCE="sentry.source",SENTRY_SPAN_SOURCE="sentry.span.source",SENTRY_STATUS="sentry.status",SENTRY_STATUS_CODE="sentry.status_code",SENTRY_STATUS_MESSAGE="sentry.status.message",SENTRY_SVELTEKIT_NAVIGATION_FROM="sentry.sveltekit.navigation.from",SENTRY_SVELTEKIT_NAVIGATION_TO="sentry.sveltekit.navigation.to",SENTRY_SVELTEKIT_NAVIGATION_TYPE="sentry.sveltekit.navigation.type",SENTRY_THREAD_ID="sentry.thread.id",SENTRY_TIMESTAMP_SEQUENCE="sentry.timestamp.sequence",SENTRY_TRACE_LIFECYCLE="sentry.trace_lifecycle",SENTRY_TRACE_PARENT_SPAN_ID="sentry.trace.parent_span_id",SENTRY_TRACE_STATUS="sentry.trace.status",SENTRY_TRANSACTION="sentry.transaction",SENTRY_USER_EMAIL="sentry.user.email",SENTRY_USER_GEO_CITY="sentry.user.geo.city",SENTRY_USER_GEO_COUNTRY_CODE="sentry.user.geo.country_code",SENTRY_USER_GEO_REGION="sentry.user.geo.region",SENTRY_USER_GEO_SUBDIVISION="sentry.user.geo.subdivision",SENTRY_USER_ID="sentry.user.id",SENTRY_USER_IP="sentry.user.ip",SENTRY_USER_USERNAME="sentry.user.username",SERVER_ADDRESS="server.address",SERVER_NAME="server_name",SERVER_PORT="server.port",SERVICE_NAME="service.name",SERVICE_VERSION="service.version",SESSION_ID="session.id",STALL_PERCENTAGE="stall_percentage",STALL_TOTAL_TIME="stall_total_time",STATE_TYPE="state.type",THREAD_ID="thread.id",THREAD_NAME="thread.name",TIMBER_TAG="timber.tag",TIME_TO_FULL_DISPLAY="time_to_full_display",TIME_TO_INITIAL_DISPLAY="time_to_initial_display",TRANSACTION="transaction",TRPC_PROCEDURE_PATH="trpc.procedure_path",TRPC_PROCEDURE_TYPE="trpc.procedure_type",TTFB="ttfb",TTFB_REQUESTTIME="ttfb.requestTime",TYPE="type",UI_COMPONENT_NAME="ui.component_name",UI_CONTRIBUTES_TO_TTFD="ui.contributes_to_ttfd",UI_CONTRIBUTES_TO_TTID="ui.contributes_to_ttid",UI_ELEMENT_HEIGHT="ui.element.height",UI_ELEMENT_ID="ui.element.id",UI_ELEMENT_IDENTIFIER="ui.element.identifier",UI_ELEMENT_LOAD_TIME="ui.element.load_time",UI_ELEMENT_PAINT_TYPE="ui.element.paint_type",UI_ELEMENT_RENDER_TIME="ui.element.render_time",UI_ELEMENT_TYPE="ui.element.type",UI_ELEMENT_URL="ui.element.url",UI_ELEMENT_WIDTH="ui.element.width",URL="url",URL_DOMAIN="url.domain",URL_FRAGMENT="url.fragment",URL_FULL="url.full",URL_PATH="url.path",URL_PATH_PARAMETER_KEY="url.path.parameter.",URL_PATH_PARAMETER_KEY_BASE="url.path.parameter",URL_PORT="url.port",URL_QUERY="url.query",URL_SAME_ORIGIN="url.same_origin",URL_SCHEME="url.scheme",URL_TEMPLATE="url.template",USER_AGENT_ORIGINAL="user_agent.original",USER_EMAIL="user.email",USER_FULL_NAME="user.full_name",USER_GEO_CITY="user.geo.city",USER_GEO_COUNTRY_CODE="user.geo.country_code",USER_GEO_REGION="user.geo.region",USER_GEO_SUBDIVISION="user.geo.subdivision",USER_HASH="user.hash",USER_ID="user.id",USER_IP_ADDRESS="user.ip_address",USER_NAME="user.name",USER_ROLES="user.roles",VERCEL_BRANCH="vercel.branch",VERCEL_BUILD_ID="vercel.build_id",VERCEL_DEPLOYMENT_ID="vercel.deployment_id",VERCEL_DESTINATION="vercel.destination",VERCEL_EDGE_TYPE="vercel.edge_type",VERCEL_ENTRYPOINT="vercel.entrypoint",VERCEL_EXECUTION_REGION="vercel.execution_region",VERCEL_ID="vercel.id",VERCEL_JA3_DIGEST="vercel.ja3_digest",VERCEL_JA4_DIGEST="vercel.ja4_digest",VERCEL_LOG_TYPE="vercel.log_type",VERCEL_PATH="vercel.path",VERCEL_PROJECT_ID="vercel.project_id",VERCEL_PROJECT_NAME="vercel.project_name",VERCEL_PROXY_CACHE_ID="vercel.proxy.cache_id",VERCEL_PROXY_CLIENT_IP="vercel.proxy.client_ip",VERCEL_PROXY_HOST="vercel.proxy.host",VERCEL_PROXY_LAMBDA_REGION="vercel.proxy.lambda_region",VERCEL_PROXY_METHOD="vercel.proxy.method",VERCEL_PROXY_PATH="vercel.proxy.path",VERCEL_PROXY_PATH_TYPE="vercel.proxy.path_type",VERCEL_PROXY_PATH_TYPE_VARIANT="vercel.proxy.path_type_variant",VERCEL_PROXY_REFERER="vercel.proxy.referer",VERCEL_PROXY_REGION="vercel.proxy.region",VERCEL_PROXY_RESPONSE_BYTE_SIZE="vercel.proxy.response_byte_size",VERCEL_PROXY_SCHEME="vercel.proxy.scheme",VERCEL_PROXY_STATUS_CODE="vercel.proxy.status_code",VERCEL_PROXY_TIMESTAMP="vercel.proxy.timestamp",VERCEL_PROXY_USER_AGENT="vercel.proxy.user_agent",VERCEL_PROXY_VERCEL_CACHE="vercel.proxy.vercel_cache",VERCEL_PROXY_VERCEL_ID="vercel.proxy.vercel_id",VERCEL_PROXY_WAF_ACTION="vercel.proxy.waf_action",VERCEL_PROXY_WAF_RULE_ID="vercel.proxy.waf_rule_id",VERCEL_REQUEST_ID="vercel.request_id",VERCEL_SOURCE="vercel.source",VERCEL_STATUS_CODE="vercel.status_code",ATTRIBUTE_TYPE={"ai.citations":"string[]","ai.completion_tokens.used":"integer","ai.documents":"string[]","ai.finish_reason":"string","ai.frequency_penalty":"double","ai.function_call":"string","ai.generation_id":"string","ai.input_messages":"string","ai.is_search_required":"boolean","ai.metadata":"string","ai.model_id":"string","ai.model.provider":"string","ai.pipeline.name":"string","ai.preamble":"string","ai.presence_penalty":"double","ai.prompt_tokens.used":"integer","ai.raw_prompting":"boolean","ai.responses":"string[]","ai.response_format":"string","ai.search_queries":"string[]","ai.search_results":"string[]","ai.seed":"string","ai.streaming":"boolean","ai.tags":"string","ai.temperature":"double","ai.texts":"string[]","ai.tools":"string[]","ai.tool_calls":"string[]","ai.top_k":"integer","ai.top_p":"double","ai.total_cost":"double","ai.total_tokens.used":"integer","ai.warnings":"string[]","angular.version":"string","app.app_build":"string","app.app_identifier":"string","app.app_name":"string","app.app_start_time":"string","app.app_version":"string","app.build":"string","app.identifier":"string","app.in_foreground":"boolean","app.name":"string",app_start_cold:"double","app.start_time":"string",app_start_type:"string",app_start_warm:"double","app.version":"string","app.vitals.frames.delay.value":"integer","app.vitals.frames.frozen.count":"integer","app.vitals.frames.slow.count":"integer","app.vitals.frames.total.count":"integer","app.vitals.start.cold.value":"double","app.vitals.start.prewarmed":"boolean","app.vitals.start.reason":"string","app.vitals.start.screen":"string","app.vitals.start.type":"string","app.vitals.start.warm.value":"double","app.vitals.ttfd.value":"double","app.vitals.ttid.value":"double","art.gc.blocking_count":"integer","art.gc.blocking_time":"double","art.gc.pre_oome_count":"integer","art.gc.total_count":"integer","art.gc.total_time":"double","art.gc.waiting_time":"double","art.memory.free":"integer","art.memory.free_until_gc":"integer","art.memory.free_until_oome":"integer","art.memory.max":"integer","art.memory.total":"integer","aws.cloudwatch.logs.log_group":"string","aws.cloudwatch.logs.log_stream":"string","aws.cloudwatch.logs.url":"string","aws.dynamodb.attribute_definitions":"string[]","aws.dynamodb.consistent_read":"boolean","aws.dynamodb.consumed_capacity":"string[]","aws.dynamodb.count":"integer","aws.dynamodb.exclusive_start_table":"string","aws.dynamodb.global_secondary_indexes":"string[]","aws.dynamodb.global_secondary_index_updates":"string[]","aws.dynamodb.index_name":"string","aws.dynamodb.item_collection_metrics":"string","aws.dynamodb.limit":"integer","aws.dynamodb.local_secondary_indexes":"string[]","aws.dynamodb.projection":"string","aws.dynamodb.provisioned_read_capacity":"double","aws.dynamodb.provisioned_write_capacity":"double","aws.dynamodb.scanned_count":"integer","aws.dynamodb.scan_forward":"boolean","aws.dynamodb.segment":"integer","aws.dynamodb.select":"string","aws.dynamodb.table_count":"integer","aws.dynamodb.table_names":"string[]","aws.dynamodb.total_segments":"integer","aws.extended_request_id":"string","aws.kinesis.stream_name":"string","aws.kinesis.stream.name":"string","aws.lambda.aws_request_id":"string","aws.lambda.execution_duration_in_millis":"double","aws.lambda.function_name":"string","aws.lambda.function_version":"string","aws.lambda.invoked_arn":"string","aws.lambda.invoked_function_arn":"string","aws.lambda.remaining_time_in_millis":"double","aws.log.group.names":"string[]","aws.log.stream.names":"string[]","aws.request.extended_id":"string","aws.request_id":"string","aws.request.id":"string","aws.s3.bucket":"string","aws.secretsmanager.secret.arn":"string","aws.sns.topic.arn":"string","aws.step_functions.activity.arn":"string","aws.step_functions.state_machine.arn":"string",blocked_main_thread:"boolean","browser.name":"string","browser.performance.navigation.activation_start":"double","browser.performance.time_origin":"double","browser.report.type":"string","browser.script.invoker":"string","browser.script.invoker_type":"string","browser.script.source_char_position":"integer","browser.version":"string","browser.web_vital.cls.report_event":"string","browser.web_vital.cls.source.":"string","browser.web_vital.cls.value":"double","browser.web_vital.fcp.value":"double","browser.web_vital.fp.value":"double","browser.web_vital.inp.value":"double","browser.web_vital.lcp.element":"string","browser.web_vital.lcp.id":"string","browser.web_vital.lcp.load_time":"integer","browser.web_vital.lcp.render_time":"integer","browser.web_vital.lcp.report_event":"string","browser.web_vital.lcp.size":"integer","browser.web_vital.lcp.url":"string","browser.web_vital.lcp.value":"double","browser.web_vital.ttfb.request_time":"double","browser.web_vital.ttfb.value":"double","cache.hit":"boolean","cache.item_size":"integer","cache.key":"string[]","cache.operation":"string","cache.ttl":"integer","cache.write":"boolean",channel:"string","client.address":"string","client.port":"integer","cloudflare.d1.duration":"integer","cloudflare.d1.query_type":"string","cloudflare.d1.rows_read":"integer","cloudflare.d1.rows_written":"integer","cloudflare.durable_object.query.bindings":"integer","cloudflare.durable_object.response.rows_read":"integer","cloudflare.durable_object.response.rows_written":"integer","cloudflare.r2.bucket":"string","cloudflare.r2.operation":"string","cloudflare.r2.request.delimiter":"string","cloudflare.r2.request.key":"string","cloudflare.r2.request.part_number":"integer","cloudflare.r2.request.prefix":"string","cloudflare.workflow.attempt":"integer","cloudflare.workflow.retries.backoff":"string","cloudflare.workflow.retries.delay":"string","cloudflare.workflow.retries.limit":"integer","cloudflare.workflow.timeout":"string","cloud.account.id":"string","cloud.availability_zone":"string","cloud.platform":"string","cloud.provider":"string","cloud.region":"string","cloud.resource_id":"string",cls:"double","cls.source.":"string","code.filepath":"string","code.file.path":"string","code.function":"string","code.function.name":"string","code.lineno":"integer","code.line.number":"integer","code.namespace":"string",connectionType:"string","connection.rtt":"integer","culture.calendar":"string","culture.display_name":"string","culture.is_24_hour_format":"boolean","culture.locale":"string","culture.timezone":"string","db.collection.name":"string","db.driver.name":"string","db.name":"string","db.namespace":"string","db.operation":"string","db.operation.batch.size":"integer","db.operation.name":"string","db.query.parameter.":"string","db.query.summary":"string","db.query.text":"string","db.redis.connection":"string","db.redis.key":"string","db.redis.parameters":"string[]","db.response.status_code":"string","db.sql.bindings":"string[]","db.statement":"string","db.stored_procedure.name":"string","db.system":"string","db.system.name":"string","db.user":"string",deviceMemory:"string","device.archs":"string[]","device.battery_level":"double","device.battery_temperature":"double","device.boot_time":"string","device.brand":"string","device.charging":"boolean","device.chipset":"string","device.class":"string","device.connection_type":"string","device.cpu_description":"string","device.external_free_storage":"integer","device.external_storage_size":"integer","device.family":"string","device.free_memory":"integer","device.free_storage":"integer","device.id":"string","device.locale":"string","device.low_memory":"boolean","device.low_power_mode":"boolean","device.manufacturer":"string","device.memory.estimated_capacity":"integer","device.memory_size":"integer","device.model":"string","device.model_id":"string","device.name":"string","device.online":"boolean","device.orientation":"string","device.processor_count":"integer","device.processor_frequency":"double","device.screen_density":"double","device.screen_dpi":"integer","device.screen_height_pixels":"integer","device.screen_width_pixels":"integer","device.simulator":"boolean","device.storage_size":"integer","device.thermal_state":"string","device.timezone":"string","device.usable_memory":"integer",dist:"string",effectiveConnectionType:"string",environment:"string","error.type":"string","event.id":"integer","event.name":"string","exception.escaped":"boolean","exception.message":"string","exception.stacktrace":"string","exception.type":"string","faas.coldstart":"boolean","faas.cron":"string","faas.duration_in_ms":"integer","faas.entry_point":"string","faas.execution":"string","faas.id":"string","faas.identity":"string","faas.invocation_id":"string","faas.invoked_name":"string","faas.invoked_provider":"string","faas.invoked_region":"string","faas.name":"string","faas.time":"string","faas.trigger":"string","faas.version":"string",fcp:"double","flag.evaluation.":"boolean",fp:"double","frames.delay":"integer","frames.frozen":"integer",frames_frozen_rate:"double","frames.slow":"integer",frames_slow_rate:"double","frames.total":"integer",fs_error:"string","gcp.function.context.event_id":"string","gcp.function.context.event_type":"string","gcp.function.context.id":"string","gcp.function.context.resource":"string","gcp.function.context.source":"string","gcp.function.context.specversion":"string","gcp.function.context.time":"string","gcp.function.context.timestamp":"string","gcp.function.context.type":"string","gcp.project.id":"string","gen_ai.agent.name":"string","gen_ai.context.utilization":"double","gen_ai.context.window_size":"integer","gen_ai.conversation.id":"string","gen_ai.cost.cache_creation.input_tokens":"double","gen_ai.cost.cache_read.input_tokens":"double","gen_ai.cost.input_tokens":"double","gen_ai.cost.output_tokens":"double","gen_ai.cost.reasoning.output_tokens":"double","gen_ai.cost.total_tokens":"double","gen_ai.embeddings.input":"string","gen_ai.function_id":"string","gen_ai.input.messages":"string","gen_ai.operation.name":"string","gen_ai.operation.type":"string","gen_ai.output.messages":"string","gen_ai.pipeline.name":"string","gen_ai.prompt":"string","gen_ai.prompt.name":"string","gen_ai.provider.name":"string","gen_ai.request.available_tools":"string","gen_ai.request.frequency_penalty":"double","gen_ai.request.max_tokens":"integer","gen_ai.request.messages":"string","gen_ai.request.model":"string","gen_ai.request.presence_penalty":"double","gen_ai.request.reasoning_effort":"string","gen_ai.request.seed":"string","gen_ai.request.stop_sequences":"string[]","gen_ai.request.temperature":"double","gen_ai.request.top_k":"integer","gen_ai.request.top_p":"double","gen_ai.response.finish_reasons":"string","gen_ai.response.id":"string","gen_ai.response.model":"string","gen_ai.response.streaming":"boolean","gen_ai.response.text":"string","gen_ai.response.time_to_first_chunk":"double","gen_ai.response.time_to_first_token":"double","gen_ai.response.tokens_per_second":"double","gen_ai.response.tool_calls":"string","gen_ai.system":"string","gen_ai.system_instructions":"string","gen_ai.system.message":"string","gen_ai.tool.call.arguments":"string","gen_ai.tool.call.result":"string","gen_ai.tool.definitions":"string","gen_ai.tool.description":"string","gen_ai.tool.input":"string","gen_ai.tool.message":"string","gen_ai.tool.name":"string","gen_ai.tool.output":"string","gen_ai.tool.type":"string","gen_ai.usage.cache_creation.input_tokens":"integer","gen_ai.usage.cache_read.input_tokens":"integer","gen_ai.usage.completion_tokens":"integer","gen_ai.usage.input_tokens":"integer","gen_ai.usage.input_tokens.cached":"integer","gen_ai.usage.input_tokens.cache_write":"integer","gen_ai.usage.output_tokens":"integer","gen_ai.usage.output_tokens.reasoning":"integer","gen_ai.usage.prompt_tokens":"integer","gen_ai.usage.reasoning.output_tokens":"integer","gen_ai.usage.total_tokens":"integer","graphql.document":"string","graphql.operation.name":"string","graphql.operation.type":"string",hardwareConcurrency:"string","http.client_ip":"string","http.decoded_response_content_length":"integer","http.flavor":"string","http.fragment":"string","http.host":"string","http.method":"string","http.query":"string","http.request.body.data":"string","http.request.connection_end":"double","http.request.connect_start":"double","http.request.domain_lookup_end":"double","http.request.domain_lookup_start":"double","http.request.fetch_start":"double","http.request.header.":"string[]","http.request.method":"string","http.request_method":"string","http.request.redirect_end":"double","http.request.redirect_start":"double","http.request.request_start":"double","http.request.resend_count":"integer","http.request.response_end":"double","http.request.response_start":"double","http.request.same_origin":"boolean","http.request.secure_connection_start":"double","http.request.time_to_first_byte":"double","http.request.worker_start":"double","http.response.body.size":"integer","http.response_content_length":"integer","http.response.header.content-length":"string","http.response.header.":"string[]","http.response.size":"integer","http.response.status_code":"integer","http.response_transfer_size":"integer","http.route":"string","http.scheme":"string","http.server_name":"string","http.server.request.time_in_queue":"double","http.status_code":"integer","http.target":"string","http.url":"string","http.user_agent":"string",id:"string",inp:"double","jsonrpc.protocol.version":"string","jsonrpc.request.id":"string","jvm.gc.action":"string","jvm.gc.name":"string","jvm.memory.pool.name":"string","jvm.memory.type":"string","jvm.thread.daemon":"boolean","jvm.thread.state":"string","koa.name":"string","koa.type":"string",lcp:"double","lcp.element":"string","lcp.id":"string","lcp.loadTime":"integer","lcp.renderTime":"integer","lcp.size":"integer","lcp.url":"string","logger.name":"string","mcp.cancelled.reason":"string","mcp.cancelled.request_id":"string","mcp.client.name":"string","mcp.client.title":"string","mcp.client.version":"string","mcp.lifecycle.phase":"string","mcp.logging.data_type":"string","mcp.logging.level":"string","mcp.logging.logger":"string","mcp.logging.message":"string","mcp.method.name":"string","mcp.progress.current":"integer","mcp.progress.message":"string","mcp.progress.percentage":"double","mcp.progress.token":"string","mcp.progress.total":"integer","mcp.prompt.name":"string","mcp.prompt.result.description":"string","mcp.prompt.result.message_content":"string","mcp.prompt.result.message_count":"integer","mcp.prompt.result.message_role":"string","mcp.protocol.ready":"integer","mcp.protocol.version":"string","mcp.request.argument.":"string","mcp.request.argument.name":"string","mcp.request.argument.uri":"string","mcp.request.id":"string","mcp.resource.protocol":"string","mcp.resource.uri":"string","mcp.server.name":"string","mcp.server.title":"string","mcp.server.version":"string","mcp.session.id":"string","mcp.tool.name":"string","mcp.tool.result.content":"string","mcp.tool.result.content_count":"integer","mcp.tool.result.is_error":"boolean","mcp.transport":"string","mdc.":"string","messaging.batch.message_count":"integer","messaging.destination":"string","messaging.destination.connection":"string","messaging.destination.name":"string","messaging.message.body.size":"integer","messaging.message.conversation_id":"string","messaging.message.envelope.size":"integer","messaging.message.id":"string","messaging.message.receive.latency":"integer","messaging.message.retry.count":"integer","messaging.operation.name":"string","messaging.operation.type":"string","messaging.rabbitmq.destination.routing_key":"string","messaging.system":"string",method:"string","middleware.name":"string","navigation.origin":"string","navigation.route.id":"string","navigation.type":"string","nel.elapsed_time":"integer","nel.phase":"string","nel.referrer":"string","nel.sampling_function":"double","nel.type":"string","network.connection.effective_type":"string","network.connection.rtt":"integer","network.connection.type":"string","network.local.address":"string","network.local.port":"integer","network.peer.address":"string","network.peer.port":"integer","network.protocol.name":"string","network.protocol.version":"string","network.transport":"string","network.type":"string","net.host.ip":"string","net.host.name":"string","net.host.port":"integer","net.peer.ip":"string","net.peer.name":"string","net.peer.port":"integer","net.protocol.name":"string","net.protocol.version":"string","net.sock.family":"string","net.sock.host.addr":"string","net.sock.host.port":"integer","net.sock.peer.addr":"string","net.sock.peer.name":"string","net.sock.peer.port":"integer","net.transport":"string","os.build":"string","os.build_id":"string","os.description":"string","os.kernel_version":"string","os.name":"string","os.raw_description":"string","os.rooted":"boolean","os.theme":"string","os.type":"string","os.version":"string","otel.kind":"string","otel.scope.name":"string","otel.scope.version":"string","otel.status_code":"string","otel.status_description":"string","params.":"string","performance.activationStart":"double","performance.timeOrigin":"double",previous_route:"string","process.command_args":"string[]","process.executable.name":"string","process.pid":"integer","process.runtime.description":"string","process.runtime.engine.name":"string","process.runtime.engine.version":"string","process.runtime.name":"string","process.runtime.version":"string","query.":"string","react.version":"string",release:"string","remix.action_form_data.":"string",replay_id:"string","resource.deployment.environment":"string","resource.deployment.environment.name":"string","resource.render_blocking_status":"string",route:"string","rpc.grpc.status_code":"integer","rpc.method":"string","rpc.response.status_code":"string","rpc.service":"string","rpc.system":"string","rpc.system.name":"string","runtime.build":"string","runtime.name":"string","runtime.raw_description":"string","runtime.version":"string","score.":"double","score.ratio.":"double","score.total":"double","score.weight.":"double","sentry.action":"string","sentry.browser.name":"string","sentry.browser.version":"string","sentry.cancellation_reason":"string","sentry.category":"string","sentry.client_sample_rate":"double","sentry.description":"string","sentry.dist":"string","sentry.domain":"string","sentry.dsc.environment":"string","sentry.dsc.project_id":"string","sentry.dsc.public_key":"string","sentry.dsc.release":"string","sentry.dsc.sampled":"boolean","sentry.dsc.sample_rate":"string","sentry.dsc.trace_id":"string","sentry.dsc.transaction":"string","sentry.environment":"string","sentry.exclusive_time":"double","sentry.graphql.operation":"string","sentry.group":"string","sentry.http.prefetch":"boolean","sentry.idle_span_finish_reason":"string","sentry.is_remote":"boolean","sentry.kind":"string","sentry.main_thread":"boolean","sentry.message.parameter.":"string","sentry.message.template":"string","sentry.metric.source":"string","sentry.mobile":"boolean","sentry.module.":"string","sentry.nextjs.ssr.function.route":"string","sentry.nextjs.ssr.function.type":"string","sentry.normalized_db_query":"string","sentry.normalized_db_query.hash":"string","sentry.normalized_description":"string","sentry.observed_timestamp_nanos":"string","sentry.op":"string","sentry.origin":"string","sentry.platform":"string","sentry.profiler_id":"string","sentry.profile_id":"string","sentry.release":"string","sentry.replay_id":"string","sentry.replay_is_buffering":"boolean","sentry.report_event":"string","sentry.sdk.integrations":"string[]","sentry.sdk.name":"string","sentry.sdk.version":"string","sentry.segment.id":"string","sentry.segment_id":"string","sentry.segment.name":"string","sentry.server_sample_rate":"double","sentry.source":"string","sentry.span.source":"string","sentry.status":"string","sentry.status_code":"integer","sentry.status.message":"string","sentry.sveltekit.navigation.from":"string","sentry.sveltekit.navigation.to":"string","sentry.sveltekit.navigation.type":"string","sentry.thread.id":"integer","sentry.timestamp.sequence":"integer","sentry.trace_lifecycle":"string","sentry.trace.parent_span_id":"string","sentry.trace.status":"string","sentry.transaction":"string","sentry.user.email":"string","sentry.user.geo.city":"string","sentry.user.geo.country_code":"string","sentry.user.geo.region":"string","sentry.user.geo.subdivision":"string","sentry.user.id":"string","sentry.user.ip":"string","sentry.user.username":"string","server.address":"string",server_name:"string","server.port":"integer","service.name":"string","service.version":"string","session.id":"string",stall_percentage:"double",stall_total_time:"double","state.type":"string","thread.id":"integer","thread.name":"string","timber.tag":"string",time_to_full_display:"double",time_to_initial_display:"double",transaction:"string","trpc.procedure_path":"string","trpc.procedure_type":"string",ttfb:"double","ttfb.requestTime":"double",type:"string","ui.component_name":"string","ui.contributes_to_ttfd":"boolean","ui.contributes_to_ttid":"boolean","ui.element.height":"integer","ui.element.id":"string","ui.element.identifier":"string","ui.element.load_time":"double","ui.element.paint_type":"string","ui.element.render_time":"double","ui.element.type":"string","ui.element.url":"string","ui.element.width":"integer",url:"string","url.domain":"string","url.fragment":"string","url.full":"string","url.path":"string","url.path.parameter.":"string","url.port":"integer","url.query":"string","url.same_origin":"boolean","url.scheme":"string","url.template":"string","user_agent.original":"string","user.email":"string","user.full_name":"string","user.geo.city":"string","user.geo.country_code":"string","user.geo.region":"string","user.geo.subdivision":"string","user.hash":"string","user.id":"string","user.ip_address":"string","user.name":"string","user.roles":"string[]","vercel.branch":"string","vercel.build_id":"string","vercel.deployment_id":"string","vercel.destination":"string","vercel.edge_type":"string","vercel.entrypoint":"string","vercel.execution_region":"string","vercel.id":"string","vercel.ja3_digest":"string","vercel.ja4_digest":"string","vercel.log_type":"string","vercel.path":"string","vercel.project_id":"string","vercel.project_name":"string","vercel.proxy.cache_id":"string","vercel.proxy.client_ip":"string","vercel.proxy.host":"string","vercel.proxy.lambda_region":"string","vercel.proxy.method":"string","vercel.proxy.path":"string","vercel.proxy.path_type":"string","vercel.proxy.path_type_variant":"string","vercel.proxy.referer":"string","vercel.proxy.region":"string","vercel.proxy.response_byte_size":"integer","vercel.proxy.scheme":"string","vercel.proxy.status_code":"integer","vercel.proxy.timestamp":"integer","vercel.proxy.user_agent":"string[]","vercel.proxy.vercel_cache":"string","vercel.proxy.vercel_id":"string","vercel.proxy.waf_action":"string","vercel.proxy.waf_rule_id":"string","vercel.request_id":"string","vercel.source":"string","vercel.status_code":"integer"},ATTRIBUTE_METADATA={"ai.citations":{brief:"References or sources cited by the AI model in its response.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["Citation 1","Citation 2"],deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"ai.completion_tokens.used":{brief:"The number of tokens used to respond to the message.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:10,deprecation:{replacement:"gen_ai.usage.output_tokens"},aliases:["gen_ai.usage.output_tokens","gen_ai.usage.completion_tokens"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57,61]},{version:"0.0.0"}]},"ai.documents":{brief:"Documents or content chunks used as context for the AI model.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["document1.txt","document2.pdf"],deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"ai.finish_reason":{brief:"The reason why the model stopped generating.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"COMPLETE",deprecation:{replacement:"gen_ai.response.finish_reasons"},aliases:["gen_ai.response.finish_reasons"],changelog:[{version:"0.1.0",prs:[55,57,61,108,127]}]},"ai.frequency_penalty":{brief:"Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.5,deprecation:{replacement:"gen_ai.request.frequency_penalty"},aliases:["gen_ai.request.frequency_penalty"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[55,57,61,108]}]},"ai.function_call":{brief:"For an AI model call, the function that was called. This is deprecated for OpenAI, and replaced by tool_calls",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"function_name",deprecation:{replacement:"gen_ai.tool.name"},aliases:["gen_ai.tool.name","mcp.tool.name"],changelog:[{version:"0.1.0",prs:[55,57,61,108]}]},"ai.generation_id":{brief:"Unique identifier for the completion.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"gen_123abc",deprecation:{replacement:"gen_ai.response.id"},aliases:["gen_ai.response.id"],changelog:[{version:"0.1.0",prs:[55,57,61,108,127]}]},"ai.input_messages":{brief:"The input messages sent to the model",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:'[{"role": "user", "message": "hello"}]',deprecation:{replacement:"gen_ai.input.messages"},aliases:["gen_ai.request.messages"],changelog:[{version:"0.1.0",prs:[65,119]},{version:"0.0.0"}]},"ai.is_search_required":{brief:"Boolean indicating if the model needs to perform a search.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!1,deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"ai.metadata":{brief:"Extra metadata passed to an AI pipeline step.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:'{"user_id": 123, "session_id": "abc123"}',deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55,127]}]},"ai.model_id":{brief:"The vendor-specific ID of the model used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"gpt-4",deprecation:{replacement:"gen_ai.response.model"},aliases:["gen_ai.response.model"],changelog:[{version:"0.1.0",prs:[57,61,127]},{version:"0.0.0"}]},"ai.model.provider":{brief:"The provider of the model.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"openai",deprecation:{replacement:"gen_ai.provider.name"},aliases:["gen_ai.provider.name","gen_ai.system"],changelog:[{version:"0.4.0",prs:[253]},{version:"0.1.0",prs:[57,61,108,127]}]},"ai.pipeline.name":{brief:"The name of the AI pipeline.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Autofix Pipeline",deprecation:{replacement:"gen_ai.pipeline.name"},aliases:["gen_ai.pipeline.name"],changelog:[{version:"0.1.0",prs:[53,76,108,127]}]},"ai.preamble":{brief:"For an AI model call, the preamble parameter. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"You are now a clown.",deprecation:{replacement:"gen_ai.system_instructions"},aliases:["gen_ai.system_instructions"],changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"ai.presence_penalty":{brief:"Used to reduce repetitiveness of generated tokens. Similar to frequency_penalty, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.5,deprecation:{replacement:"gen_ai.request.presence_penalty"},aliases:["gen_ai.request.presence_penalty"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[55,57,61,108]}]},"ai.prompt_tokens.used":{brief:"The number of tokens used to process just the prompt.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:20,deprecation:{replacement:"gen_ai.usage.input_tokens"},aliases:["gen_ai.usage.prompt_tokens","gen_ai.usage.input_tokens"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57,61]},{version:"0.0.0"}]},"ai.raw_prompting":{brief:"When enabled, the user\u2019s prompt will be sent to the model without any pre-processing.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"ai.responses":{brief:"The response messages sent back by the AI model.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:["hello","world"],deprecation:{replacement:"gen_ai.output.messages"},changelog:[{version:"0.1.0",prs:[65,127]},{version:"0.0.0"}]},"ai.response_format":{brief:"For an AI model call, the format of the response",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"json_object",deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55,127]}]},"ai.search_queries":{brief:"Queries used to search for relevant context or documents.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["climate change effects","renewable energy"],deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"ai.search_results":{brief:"Results returned from search queries for context.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["search_result_1, search_result_2"],deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"ai.seed":{brief:"The seed, ideally models given the same seed and same other parameters will produce the exact same output.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1234567890",deprecation:{replacement:"gen_ai.request.seed"},aliases:["gen_ai.request.seed"],changelog:[{version:"0.1.0",prs:[55,57,61,108,127]}]},"ai.streaming":{brief:"Whether the request was streamed back.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,deprecation:{replacement:"gen_ai.response.streaming"},aliases:["gen_ai.response.streaming"],changelog:[{version:"0.1.0",prs:[76,108]},{version:"0.0.0"}]},"ai.tags":{brief:"Tags that describe an AI pipeline step.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:'{"executed_function": "add_integers"}',deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55,127]}]},"ai.temperature":{brief:"For an AI model call, the temperature parameter. Temperature essentially means how random the output will be.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.1,deprecation:{replacement:"gen_ai.request.temperature"},aliases:["gen_ai.request.temperature"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[55,57,61,108]}]},"ai.texts":{brief:"Raw text inputs provided to the model.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["Hello, how are you?","What is the capital of France?"],deprecation:{replacement:"gen_ai.input.messages"},aliases:["gen_ai.input.messages"],changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"ai.tools":{brief:"For an AI model call, the functions that are available",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:["function_1","function_2"],deprecation:{replacement:"gen_ai.tool.definitions"},changelog:[{version:"0.1.0",prs:[55,65,127]}]},"ai.tool_calls":{brief:"For an AI model call, the tool calls that were made.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["tool_call_1","tool_call_2"],deprecation:{replacement:"gen_ai.output.messages"},changelog:[{version:"0.1.0",prs:[55,65]}]},"ai.top_k":{brief:"Limits the model to only consider the K most likely next tokens, where K is an integer (e.g., top_k=20 means only the 20 highest probability tokens are considered).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:35,deprecation:{replacement:"gen_ai.request.top_k"},aliases:["gen_ai.request.top_k"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[55,57,61,108]}]},"ai.top_p":{brief:"Limits the model to only consider tokens whose cumulative probability mass adds up to p, where p is a float between 0 and 1 (e.g., top_p=0.7 means only tokens that sum up to 70% of the probability mass are considered).",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.7,deprecation:{replacement:"gen_ai.request.top_p"},aliases:["gen_ai.request.top_p"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[55,57,61,108]}]},"ai.total_cost":{brief:"The total cost for the tokens used.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12.34,deprecation:{replacement:"gen_ai.cost.total_tokens"},aliases:["gen_ai.cost.total_tokens"],changelog:[{version:"0.5.0",prs:[264]},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[53]}]},"ai.total_tokens.used":{brief:"The total number of tokens used to process the prompt.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:30,deprecation:{replacement:"gen_ai.usage.total_tokens"},aliases:["gen_ai.usage.total_tokens"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57,61,108]},{version:"0.0.0"}]},"ai.warnings":{brief:"Warning messages generated during model execution.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["Token limit exceeded"],deprecation:{},changelog:[{version:"0.5.0",prs:[264]},{version:"0.1.0",prs:[55]}]},"angular.version":{brief:"The version of the Angular framework",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"17.1.0",changelog:[{version:"0.7.0",prs:[367],description:"Added angular.version attribute"}]},"app.app_build":{brief:"Internal build identifier, as it appears on the platform.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1",deprecation:{replacement:"app.build",reason:"Deprecated in favor of app.build"},aliases:["app.build"],changelog:[{version:"0.5.0",prs:[296],description:"Added and deprecated app.app_build in favor of app.build"}]},"app.app_identifier":{brief:"Version-independent application identifier, often a dotted bundle ID.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"com.example.myapp",deprecation:{replacement:"app.identifier",reason:"Deprecated in favor of app.identifier"},aliases:["app.identifier"],changelog:[{version:"0.5.0",prs:[296],description:"Added and deprecated app.app_identifier in favor of app.identifier"}]},"app.app_name":{brief:"Human readable application name, as it appears on the platform.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"My App",deprecation:{replacement:"app.name",reason:"Deprecated in favor of app.name"},aliases:["app.name"],changelog:[{version:"0.5.0",prs:[296],description:"Added and deprecated app.app_name in favor of app.name"}]},"app.app_start_time":{brief:"Formatted UTC timestamp when the user started the application.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"2025-01-01T00:00:00.000Z",deprecation:{replacement:"app.start_time",reason:"Deprecated in favor of app.start_time"},aliases:["app.start_time"],changelog:[{version:"0.5.0",prs:[296],description:"Added and deprecated app.app_start_time in favor of app.start_time"}]},"app.app_version":{brief:"Human readable application version, as it appears on the platform.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1.0.0",deprecation:{replacement:"app.version",reason:"Deprecated in favor of app.version"},aliases:["app.version"],changelog:[{version:"0.5.0",prs:[296],description:"Added and deprecated app.app_version in favor of app.version"}]},"app.build":{brief:"Internal build identifier, as it appears on the platform.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1",aliases:["app.app_build"],changelog:[{version:"0.5.0",prs:[296],description:"Added app.build attribute"}]},"app.identifier":{brief:"Version-independent application identifier, often a dotted bundle ID.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"com.example.myapp",aliases:["app.app_identifier"],changelog:[{version:"0.5.0",prs:[296],description:"Added app.identifier attribute"}]},"app.in_foreground":{brief:"Whether the application is currently in the foreground.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.5.0",prs:[296],description:"Added app.in_foreground attribute"}]},"app.name":{brief:"Human readable application name, as it appears on the platform.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"My App",aliases:["app.app_name"],changelog:[{version:"0.5.0",prs:[296],description:"Added app.name attribute"}]},app_start_cold:{brief:"The duration of a cold app start in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,deprecation:{replacement:"app.vitals.start.cold.value",reason:"Replaced by app.vitals.start.cold.value to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.start.cold.value"],changelog:[{version:"0.5.0",prs:[323],description:"Added and deprecated in favor of app.vitals.start.cold.value"}]},"app.start_time":{brief:"Formatted UTC timestamp when the user started the application.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"2025-01-01T00:00:00.000Z",aliases:["app.app_start_time"],changelog:[{version:"0.5.0",prs:[296],description:"Added app.start_time attribute"}]},app_start_type:{brief:"Mobile app start variant. Either cold or warm.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"cold",deprecation:{replacement:"app.vitals.start.type",reason:"Replaced by app.vitals.start.type to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.start.type"],changelog:[{version:"0.5.0",prs:[313],description:"Deprecated in favor of app.vitals.start.type"},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},app_start_warm:{brief:"The duration of a warm app start in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,deprecation:{replacement:"app.vitals.start.warm.value",reason:"Replaced by app.vitals.start.warm.value to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.start.warm.value"],changelog:[{version:"0.5.0",prs:[323],description:"Added and deprecated in favor of app.vitals.start.warm.value"}]},"app.version":{brief:"Human readable application version, as it appears on the platform.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1.0.0",aliases:["app.app_version"],changelog:[{version:"0.5.0",prs:[296],description:"Added app.version attribute"}]},"app.vitals.frames.delay.value":{brief:"The sum of all delayed frame durations in seconds during the lifetime of the span. For more information see [frames delay](https://develop.sentry.dev/sdk/performance/frames-delay/).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:5,aliases:["frames.delay"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.frames.delay.value to replace frames.delay"}]},"app.vitals.frames.frozen.count":{brief:"The number of frozen frames rendered during the lifetime of the span.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:3,aliases:["frames.frozen"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.frames.frozen.count to replace frames.frozen"}]},"app.vitals.frames.slow.count":{brief:"The number of slow frames rendered during the lifetime of the span.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,aliases:["frames.slow"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.frames.slow.count to replace frames.slow"}]},"app.vitals.frames.total.count":{brief:"The number of total frames rendered during the lifetime of the span.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:60,aliases:["frames.total"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.frames.total.count to replace frames.total"}]},"app.vitals.start.cold.value":{brief:"The duration of a cold app start in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,aliases:["app_start_cold"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.start.cold.value attribute"}]},"app.vitals.start.prewarmed":{brief:"Whether the app start was prewarmed.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.11.0",prs:[379],description:"Added app.vitals.start.prewarmed attribute"}]},"app.vitals.start.reason":{brief:"The reason that triggered the app start.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"push",changelog:[{version:"0.7.0",prs:[353],description:"Added app.vitals.start.reason attribute"}]},"app.vitals.start.screen":{brief:"The screen that is rendered when the app start is complete. This is the screen the user first sees and can interact with after launch. The absence of this attribute on the app start span indicates a background app start where no UI was rendered.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"MainActivity",changelog:[{version:"0.7.0",prs:[353],description:"Added app.vitals.start.screen attribute"}]},"app.vitals.start.type":{brief:"The type of app start, for example `cold` or `warm`",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"cold",aliases:["app_start_type"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.start.type attribute"}]},"app.vitals.start.warm.value":{brief:"The duration of a warm app start in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,aliases:["app_start_warm"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.start.warm.value attribute"}]},"app.vitals.ttfd.value":{brief:"The duration of time to full display in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,aliases:["time_to_full_display"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.ttfd.value attribute"}]},"app.vitals.ttid.value":{brief:"The duration of time to initial display in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,aliases:["time_to_initial_display"],changelog:[{version:"0.5.0",prs:[313],description:"Added app.vitals.ttid.value attribute"}]},"art.gc.blocking_count":{brief:"Total number of blocking (stop-the-world) garbage collections performed by the Android Runtime",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,changelog:[{version:"0.11.0",prs:[382],description:"Added art.gc.blocking_count attribute"}]},"art.gc.blocking_time":{brief:"Total time spent in blocking (stop-the-world) garbage collections by the Android Runtime, in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:11.873,changelog:[{version:"0.11.0",prs:[382],description:"Added art.gc.blocking_time attribute"}]},"art.gc.pre_oome_count":{brief:"Total number of garbage collections triggered as a last resort before an OutOfMemoryError by the Android Runtime",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:0,changelog:[{version:"0.11.0",prs:[382],description:"Added art.gc.pre_oome_count attribute"}]},"art.gc.total_count":{brief:"Total number of garbage collections performed by the Android Runtime",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,changelog:[{version:"0.11.0",prs:[382],description:"Added art.gc.total_count attribute"}]},"art.gc.total_time":{brief:"Total time spent in garbage collection by the Android Runtime, in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:11.807,changelog:[{version:"0.11.0",prs:[382],description:"Added art.gc.total_time attribute"}]},"art.gc.waiting_time":{brief:"Total time threads spent waiting for garbage collection to complete in the Android Runtime, in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:8.054,changelog:[{version:"0.11.0",prs:[382],description:"Added art.gc.waiting_time attribute"}]},"art.memory.free":{brief:"Free memory available to the process as reported by the Android Runtime, in bytes",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:3181568,changelog:[{version:"0.11.0",prs:[382],description:"Added art.memory.free attribute"}]},"art.memory.free_until_gc":{brief:"Free memory available before a garbage collection would be triggered by the Android Runtime, in bytes",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:3181568,changelog:[{version:"0.11.0",prs:[382],description:"Added art.memory.free_until_gc attribute"}]},"art.memory.free_until_oome":{brief:"Free memory available before an OutOfMemoryError would be thrown by the Android Runtime, in bytes",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:196083712,changelog:[{version:"0.11.0",prs:[382],description:"Added art.memory.free_until_oome attribute"}]},"art.memory.max":{brief:"Maximum memory the process is allowed to use as reported by the Android Runtime, in bytes",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:201326592,changelog:[{version:"0.11.0",prs:[382],description:"Added art.memory.max attribute"}]},"art.memory.total":{brief:"Total memory currently allocated to the process by the Android Runtime, in bytes",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:7774208,changelog:[{version:"0.11.0",prs:[382],description:"Added art.memory.total attribute"}]},"aws.cloudwatch.logs.log_group":{brief:"The name of the CloudWatch Logs log group",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"/aws/lambda/my-function",changelog:[{version:"0.7.0",prs:[369],description:"Added aws.cloudwatch.logs.log_group attribute"}]},"aws.cloudwatch.logs.log_stream":{brief:"The name of the CloudWatch Logs log stream",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"2024/01/01/[$LATEST]abcdef1234567890",changelog:[{version:"0.7.0",prs:[369],description:"Added aws.cloudwatch.logs.log_stream attribute"}]},"aws.cloudwatch.logs.url":{brief:"The URL to the CloudWatch Logs log group",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/my-log-group",changelog:[{version:"0.7.0",prs:[369],description:"Added aws.cloudwatch.logs.url attribute"}]},"aws.dynamodb.attribute_definitions":{brief:"The JSON-serialized value of each item in the `AttributeDefinitions` request field.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:['{ "AttributeName": "string", "AttributeType": "string" }'],changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.attribute_definitions attribute"}]},"aws.dynamodb.consistent_read":{brief:"The value of the `ConsistentRead` request parameter.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:!0,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.consistent_read attribute"}]},"aws.dynamodb.consumed_capacity":{brief:"The JSON-serialized value of each item in the `ConsumedCapacity` response field.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:['{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName": "string", "WriteCapacityUnits": number }'],changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.consumed_capacity attribute"}]},"aws.dynamodb.count":{brief:"The value of the `Count` response parameter.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:10,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.count attribute"}]},"aws.dynamodb.exclusive_start_table":{brief:"The value of the `ExclusiveStartTableName` request parameter.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Users",changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.exclusive_start_table attribute"}]},"aws.dynamodb.global_secondary_indexes":{brief:"The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:['{ "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'],changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.global_secondary_indexes attribute"}]},"aws.dynamodb.global_secondary_index_updates":{brief:"The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:['{ "Create": { "IndexName": "string", "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'],changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.global_secondary_index_updates attribute"}]},"aws.dynamodb.index_name":{brief:"The value of the `IndexName` request parameter.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"name_to_group",changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.index_name attribute"}]},"aws.dynamodb.item_collection_metrics":{brief:"The JSON-serialized value of the `ItemCollectionMetrics` response field.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:'{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }',changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.item_collection_metrics attribute"}]},"aws.dynamodb.limit":{brief:"The value of the `Limit` request parameter.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:10,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.limit attribute"}]},"aws.dynamodb.local_secondary_indexes":{brief:"The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:['{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }'],changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.local_secondary_indexes attribute"}]},"aws.dynamodb.projection":{brief:"The value of the `ProjectionExpression` request parameter.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Title, Price, Color",changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.projection attribute"}]},"aws.dynamodb.provisioned_read_capacity":{brief:"The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:1,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.provisioned_read_capacity attribute"}]},"aws.dynamodb.provisioned_write_capacity":{brief:"The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:2,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.provisioned_write_capacity attribute"}]},"aws.dynamodb.scanned_count":{brief:"The value of the `ScannedCount` response parameter.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:50,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.scanned_count attribute"}]},"aws.dynamodb.scan_forward":{brief:"The value of the `ScanIndexForward` request parameter.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:!0,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.scan_forward attribute"}]},"aws.dynamodb.segment":{brief:"The value of the `Segment` request parameter.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:10,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.segment attribute"}]},"aws.dynamodb.select":{brief:"The value of the `Select` request parameter.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"ALL_ATTRIBUTES",changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.select attribute"}]},"aws.dynamodb.table_count":{brief:"The number of items in the `TableNames` response parameter.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:20,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.table_count attribute"}]},"aws.dynamodb.table_names":{brief:"The keys in the `RequestItems` object field.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:["Users","Cats"],changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.table_names attribute"}]},"aws.dynamodb.total_segments":{brief:"The value of the `TotalSegments` request parameter.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:100,changelog:[{version:"0.16.0",prs:[479],description:"Added aws.dynamodb.total_segments attribute"}]},"aws.extended_request_id":{brief:"The AWS extended request ID as returned in the response headers.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"wzHcyEWfmOGDIE5QOhTAqFDoDWP3y8IUvpNINCwL9N4TEHbUw0/gZJ+VZTmCNCWR7fezEN3eCiQ=",aliases:["aws.request.extended_id"],changelog:[{version:"0.16.0",prs:[480],description:"Added aws.extended_request_id attribute"}]},"aws.kinesis.stream_name":{brief:"The name of the AWS Kinesis stream the request refers to.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"some-stream-name",aliases:["aws.kinesis.stream.name"],changelog:[{version:"0.16.0",prs:[480],description:"Added aws.kinesis.stream_name attribute"}]},"aws.kinesis.stream.name":{brief:"The name of the AWS Kinesis stream the request refers to.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"some-stream-name",deprecation:{replacement:"aws.kinesis.stream_name",reason:"This attribute is being deprecated in favor of aws.kinesis.stream_name, which is the OTel-aligned replacement."},aliases:["aws.kinesis.stream_name"],changelog:[{version:"0.16.0",prs:[480],description:"Added aws.kinesis.stream.name attribute, deprecated in favor of aws.kinesis.stream_name"}]},"aws.lambda.aws_request_id":{brief:"The AWS request ID as received by the Lambda function runtime",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"8476a536-e9f4-11e8-9739-2dfe598c3fcd",deprecation:{replacement:"faas.invocation_id",reason:"This attribute is being deprecated in favor of faas.invocation_id"},aliases:["faas.invocation_id","faas.execution"],changelog:[{version:"0.16.0",prs:[473],description:"Added faas.execution as an alias"},{version:"0.11.1",prs:[414,424],description:"Deprecated aws.lambda.aws_request_id in favor of faas.invocation_id"},{version:"0.7.0",prs:[369],description:"Added aws.lambda.aws_request_id attribute"}]},"aws.lambda.execution_duration_in_millis":{brief:"The execution duration of the Lambda function invocation in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,changelog:[{version:"0.7.0",prs:[369],description:"Added aws.lambda.execution_duration_in_millis attribute"}]},"aws.lambda.function_name":{brief:"The name of the Lambda function",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"my-function",deprecation:{replacement:"faas.name",reason:"Use the OTel-aligned faas.name attribute instead"},aliases:["faas.name"],changelog:[{version:"0.11.1",prs:[414],description:"Deprecated aws.lambda.function_name in favor of faas.name"},{version:"0.7.0",prs:[369],description:"Added aws.lambda.function_name attribute"}]},"aws.lambda.function_version":{brief:"The version of the Lambda function",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"$LATEST",deprecation:{replacement:"faas.version",reason:"Use the OTel-aligned faas.version attribute instead"},aliases:["faas.version"],changelog:[{version:"0.11.1",prs:[414,424],description:"Deprecated aws.lambda.function_version in favor of faas.version"},{version:"0.7.0",prs:[369],description:"Added aws.lambda.function_version attribute"}]},"aws.lambda.invoked_arn":{brief:"The full ARN of the Lambda function that was invoked",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"arn:aws:lambda:us-east-1:123456789012:function:my-function",aliases:["aws.lambda.invoked_function_arn"],changelog:[{version:"0.11.1",prs:[414]}]},"aws.lambda.invoked_function_arn":{brief:"The full ARN of the Lambda function that was invoked",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"arn:aws:lambda:us-east-1:123456789012:function:my-function",deprecation:{replacement:"aws.lambda.invoked_arn",reason:"This attribute is being deprecated in favor of aws.lambda.invoked_arn"},aliases:["aws.lambda.invoked_arn"],changelog:[{version:"0.11.1",prs:[414],description:"Deprecated aws.lambda.invoked_function_arn in favor of aws.lambda.invoked_arn"},{version:"0.7.0",prs:[369],description:"Added aws.lambda.invoked_function_arn attribute"}]},"aws.lambda.remaining_time_in_millis":{brief:"The remaining time in milliseconds before the Lambda function times out",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:5e3,changelog:[{version:"0.7.0",prs:[369],description:"Added aws.lambda.remaining_time_in_millis attribute"}]},"aws.log.group.names":{brief:"The name(s) of the AWS log group(s) an application is writing to.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:["/aws/lambda/my-function","opentelemetry-service"],changelog:[{version:"0.11.1",prs:[414]}]},"aws.log.stream.names":{brief:"The name(s) of the AWS log stream(s) an application is writing to.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:["logs/main/10838bed-421f-43ef-870a-f43feacbbb5b"],changelog:[{version:"0.11.1",prs:[414]}]},"aws.request.extended_id":{brief:"The AWS extended request ID as returned in the response headers.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"wzHcyEWfmOGDIE5QOhTAqFDoDWP3y8IUvpNINCwL9N4TEHbUw0/gZJ+VZTmCNCWR7fezEN3eCiQ=",deprecation:{replacement:"aws.extended_request_id",reason:"This attribute is being deprecated in favor of aws.extended_request_id, which is the OTel-aligned replacement."},aliases:["aws.extended_request_id"],changelog:[{version:"0.16.0",prs:[480],description:"Added aws.request.extended_id attribute, deprecated in favor of aws.extended_request_id"}]},"aws.request_id":{brief:"The AWS request ID as returned in the response headers.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"79b9da39-b7ae-508a-a6bc-864b2829c622",aliases:["aws.request.id"],changelog:[{version:"0.16.0",prs:[480],description:"Added aws.request_id attribute"}]},"aws.request.id":{brief:"The AWS request ID as returned in the response headers.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"79b9da39-b7ae-508a-a6bc-864b2829c622",deprecation:{replacement:"aws.request_id",reason:"This attribute is being deprecated in favor of aws.request_id, which is the OTel-aligned replacement."},aliases:["aws.request_id"],changelog:[{version:"0.16.0",prs:[480],description:"Added aws.request.id attribute, deprecated in favor of aws.request_id"}]},"aws.s3.bucket":{brief:"The S3 bucket name the request refers to.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"ot-demo-test",changelog:[{version:"0.16.0",prs:[480],description:"Added aws.s3.bucket attribute"}]},"aws.secretsmanager.secret.arn":{brief:"The ARN of the Secret stored in Secrets Manager.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"arn:aws:secretsmanager:us-east-1:123456789012:secret:SecretName-6RandomCharacters",changelog:[{version:"0.16.0",prs:[480],description:"Added aws.secretsmanager.secret.arn attribute"}]},"aws.sns.topic.arn":{brief:"The ARN of the AWS SNS Topic. An Amazon SNS topic is a logical access point that acts as a communication channel.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"arn:aws:sns:us-east-1:123456789012:mystack-mytopic-NZJ5JSMVGFIE",changelog:[{version:"0.16.0",prs:[480],description:"Added aws.sns.topic.arn attribute"}]},"aws.step_functions.activity.arn":{brief:"The ARN of the AWS Step Functions Activity.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"arn:aws:states:us-east-1:123456789012:activity:get-greeting",changelog:[{version:"0.16.0",prs:[480],description:"Added aws.step_functions.activity.arn attribute"}]},"aws.step_functions.state_machine.arn":{brief:"The ARN of the AWS Step Functions State Machine.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"arn:aws:states:us-east-1:123456789012:stateMachine:myStateMachine:1",changelog:[{version:"0.16.0",prs:[480],description:"Added aws.step_functions.state_machine.arn attribute"}]},blocked_main_thread:{brief:"Whether the main thread was blocked by the span.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.0.0"}]},"browser.name":{brief:"The name of the browser.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Chrome",aliases:["sentry.browser.name"],changelog:[{version:"0.1.0",prs:[127,139]},{version:"0.0.0"}]},"browser.performance.navigation.activation_start":{brief:"The time between initiating a navigation to a page and the browser activating the page",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1.983,aliases:["performance.activationStart"],changelog:[{version:"0.5.0",prs:[321],description:"Added browser.performance.navigation.activation_start attribute"}]},"browser.performance.time_origin":{brief:"The browser's performance.timeOrigin timestamp representing the time when the pageload was initiated",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1776185678886e-3,aliases:["performance.timeOrigin"],changelog:[{version:"0.5.0",prs:[321],description:"Added browser.performance.time_origin attribute attribute"}]},"browser.report.type":{brief:"A browser report sent via reporting API..",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"network-error",changelog:[{version:"0.1.0",prs:[68,127]}]},"browser.script.invoker":{brief:"How a script was called in the browser.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Window.requestAnimationFrame",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"browser.script.invoker_type":{brief:"Browser script entry point type.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"event-listener",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"browser.script.source_char_position":{brief:"A number representing the script character position of the script.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:678,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"browser.version":{brief:"The version of the browser.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"120.0.6099.130",aliases:["sentry.browser.version"],changelog:[{version:"0.1.0",prs:[59,127,139]}]},"browser.web_vital.cls.report_event":{brief:"The event that caused the SDK to report CLS (pagehide or navigation)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"navigation",changelog:[{version:"0.5.0",prs:[319],description:"Added browser.web_vital.cls.report_event attribute"}]},"browser.web_vital.cls.source.":{brief:"The HTML elements or components responsible for the layout shift. is a numeric index from 1 to N",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"body > div#app",aliases:["cls.source."],changelog:[{version:"0.5.0",prs:[234]}]},"browser.web_vital.cls.value":{brief:"The value of the recorded Cumulative Layout Shift (CLS) web vital",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.2361,aliases:["cls"],changelog:[{version:"0.5.0",prs:[229],description:"Added browser.web_vital.cls.value attribute"}]},"browser.web_vital.fcp.value":{brief:"The time it takes for the browser to render the first piece of meaningful content on the screen",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:547.6951,aliases:["fcp"],changelog:[{version:"0.5.0",prs:[235]}]},"browser.web_vital.fp.value":{brief:"The time in milliseconds it takes for the browser to render the first pixel on the screen",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:477.1926,aliases:["fp"],changelog:[{version:"0.5.0",prs:[235]}]},"browser.web_vital.inp.value":{brief:"The value of the recorded Interaction to Next Paint (INP) web vital",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:200,aliases:["inp"],changelog:[{version:"0.5.0",prs:[229],description:"Added browser.web_vital.inp.value attribute"}]},"browser.web_vital.lcp.element":{brief:"The HTML element selector or component name for which LCP was reported",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"body > div#app > div#container > div",aliases:["lcp.element"],changelog:[{version:"0.5.0",prs:[233]}]},"browser.web_vital.lcp.id":{brief:"The id of the dom element responsible for the largest contentful paint",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"#gero",aliases:["lcp.id"],changelog:[{version:"0.5.0",prs:[233]}]},"browser.web_vital.lcp.load_time":{brief:"The time it took for the LCP element to be loaded",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1402,aliases:["lcp.loadTime"],changelog:[{version:"0.5.0",prs:[233]}]},"browser.web_vital.lcp.render_time":{brief:"The time it took for the LCP element to be rendered",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1685,aliases:["lcp.renderTime"],changelog:[{version:"0.5.0",prs:[233]}]},"browser.web_vital.lcp.report_event":{brief:"The event that caused the SDK to report LCP (pagehide or navigation)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"pagehide",changelog:[{version:"0.5.0",prs:[319],description:"Added browser.web_vital.lcp.report_event attribute"}]},"browser.web_vital.lcp.size":{brief:"The size of the largest contentful paint element",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1024,aliases:["lcp.size"],changelog:[{version:"0.5.0",prs:[233]}]},"browser.web_vital.lcp.url":{brief:"The url of the dom element responsible for the largest contentful paint",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"https://example.com/static/img.png",aliases:["lcp.url"],changelog:[{version:"0.5.0",prs:[233]}]},"browser.web_vital.lcp.value":{brief:"The value of the recorded Largest Contentful Paint (LCP) web vital",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2500,aliases:["lcp"],changelog:[{version:"0.5.0",prs:[229],description:"Added browser.web_vital.lcp.value attribute"}]},"browser.web_vital.ttfb.request_time":{brief:"The time it takes for the server to process the initial request and send the first byte of a response to the user's browser",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1554.5814,aliases:["ttfb.requestTime"],changelog:[{version:"0.5.0",prs:[235]}]},"browser.web_vital.ttfb.value":{brief:"The value of the recorded Time To First Byte (TTFB) web vital in Milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:194.3322,aliases:["ttfb"],changelog:[{version:"0.5.0",prs:[235]}]},"cache.hit":{brief:"If the cache was hit during this span.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.0.0"}]},"cache.item_size":{brief:"The size of the requested item in the cache. In bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:58,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"cache.key":{brief:"The key of the cache accessed.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:["my-cache-key","my-other-cache-key"],changelog:[{version:"0.0.0"}]},"cache.operation":{brief:"The operation being performed on the cache.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"get",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"cache.ttl":{brief:"The ttl of the cache in seconds",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:120,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"cache.write":{brief:"If the cache operation resulted in a write to the cache.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.5.0"}]},channel:{brief:"The channel name that is being used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"mail",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"client.address":{brief:"Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"example.com",aliases:["http.client_ip"],changelog:[{version:"0.1.0",prs:[106,127]},{version:"0.0.0"}]},"client.port":{brief:"Client port number.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:5432,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"cloudflare.d1.duration":{brief:"The duration of a Cloudflare D1 operation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:543,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"cloudflare.d1.query_type":{brief:"The type of query executed in a Cloudflare D1 operation",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"run",deprecation:{replacement:"db.operation.name"},aliases:["db.operation.name","db.operation"],changelog:[{version:"0.11.0",prs:[392],description:"Added cloudflare.d1.query_type attribute"}]},"cloudflare.d1.rows_read":{brief:"The number of rows read in a Cloudflare D1 operation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"cloudflare.d1.rows_written":{brief:"The number of rows written in a Cloudflare D1 operation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"cloudflare.durable_object.query.bindings":{brief:"The number of bound parameters passed to the SQL exec call.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2,changelog:[{version:"0.13.0",prs:[435],description:"Added cloudflare.durable_object.query.bindings attribute"}]},"cloudflare.durable_object.response.rows_read":{brief:"The number of rows read by a Cloudflare Durable Object SQL operation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12,changelog:[{version:"0.13.0",prs:[435],description:"Added cloudflare.durable_object.response.rows_read attribute"}]},"cloudflare.durable_object.response.rows_written":{brief:"The number of rows written by a Cloudflare Durable Object SQL operation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,changelog:[{version:"0.13.0",prs:[435],description:"Added cloudflare.durable_object.response.rows_written attribute"}]},"cloudflare.r2.bucket":{brief:"The name of the Cloudflare R2 bucket binding",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"MY_BUCKET",changelog:[{version:"0.11.1",prs:[413],description:"Added cloudflare.r2.bucket attribute"}]},"cloudflare.r2.operation":{brief:"The R2 API operation being performed",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"GetObject",changelog:[{version:"0.11.1",prs:[413],description:"Added cloudflare.r2.operation attribute"}]},"cloudflare.r2.request.delimiter":{brief:"The delimiter used to group objects in an R2 list operation",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"/",changelog:[{version:"0.11.1",prs:[413],description:"Added cloudflare.r2.request.delimiter attribute"}]},"cloudflare.r2.request.key":{brief:"The object key used in the R2 operation",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"my-file.txt",changelog:[{version:"0.11.1",prs:[413],description:"Added cloudflare.r2.request.key attribute"}]},"cloudflare.r2.request.part_number":{brief:"The part number in a multipart upload operation",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,changelog:[{version:"0.11.1",prs:[413],description:"Added cloudflare.r2.request.part_number attribute"}]},"cloudflare.r2.request.prefix":{brief:"The prefix used to filter objects in an R2 list operation",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"images/",changelog:[{version:"0.11.1",prs:[413],description:"Added cloudflare.r2.request.prefix attribute"}]},"cloudflare.workflow.attempt":{brief:"The current attempt number for a Cloudflare Workflow step",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,changelog:[{version:"0.11.0",prs:[392],description:"Added cloudflare.workflow.attempt attribute"}]},"cloudflare.workflow.retries.backoff":{brief:"The backoff strategy for Cloudflare Workflow step retries",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"exponential",changelog:[{version:"0.11.0",prs:[392],description:"Added cloudflare.workflow.retries.backoff attribute"}]},"cloudflare.workflow.retries.delay":{brief:"The delay between Cloudflare Workflow step retries",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"5 seconds",changelog:[{version:"0.11.0",prs:[392],description:"Added cloudflare.workflow.retries.delay attribute"}]},"cloudflare.workflow.retries.limit":{brief:"The maximum number of retries for a Cloudflare Workflow step",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:3,changelog:[{version:"0.11.0",prs:[392],description:"Added cloudflare.workflow.retries.limit attribute"}]},"cloudflare.workflow.timeout":{brief:"The timeout duration for a Cloudflare Workflow step",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1 minute",changelog:[{version:"0.11.0",prs:[392],description:"Added cloudflare.workflow.timeout attribute"}]},"cloud.account.id":{brief:"The cloud account ID the resource is assigned to",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"123456789012",changelog:[{version:"0.7.0",prs:[364],description:"Added cloud.account.id attribute"}]},"cloud.availability_zone":{brief:"Cloud regions often have multiple, isolated locations known as zones to increase availability",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"us-east-1c",changelog:[{version:"0.7.0",prs:[364],description:"Added cloud.availability_zone attribute"}]},"cloud.platform":{brief:"The cloud platform in use",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"aws_lambda",changelog:[{version:"0.7.0",prs:[364],description:"Added cloud.platform attribute"}]},"cloud.provider":{brief:"Name of the cloud provider",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"aws",changelog:[{version:"0.7.0",prs:[364],description:"Added cloud.provider attribute"}]},"cloud.region":{brief:"The geographical region the resource is running",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"us-east-1",changelog:[{version:"0.7.0",prs:[364],description:"Added cloud.region attribute"}]},"cloud.resource_id":{brief:"Cloud provider-specific native identifier of the monitored cloud resource",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function",aliases:["faas.id"],changelog:[{version:"0.16.0",prs:[475],description:"Added faas.id as an alias"},{version:"0.11.1",prs:[414]}],additionalContext:["This can be an identifier for a resource in AWS, GCP, or Azure. There may be some overlap in values found here with other attributes. For instance, an AWS lambda ARN may be found here as well as in `aws.lambda.invoked_arn`. OTEL recommends setting them alongside each other."]},cls:{brief:"The value of the recorded Cumulative Layout Shift (CLS) web vital",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.2361,deprecation:{replacement:"browser.web_vital.cls.value",reason:"The CLS web vital is now recorded as a browser.web_vital.cls.value attribute."},aliases:["browser.web_vital.cls.value"],changelog:[{version:"0.5.0",prs:[229],description:"Added and deprecated attribute to document JS SDK's current behaviour"}]},"cls.source.":{brief:"The HTML elements or components responsible for the layout shift. is a numeric index from 1 to N",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"body > div#app",deprecation:{replacement:"browser.web_vital.cls.source.",reason:"The CLS source is now recorded as a browser.web_vital.cls.source. attribute."},aliases:["browser.web_vital.cls.source."],changelog:[{version:"0.5.0",prs:[234]}]},"code.filepath":{brief:"The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"/app/myapplication/http/handler/server.py",deprecation:{replacement:"code.file.path"},aliases:["code.file.path"],changelog:[{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"code.file.path":{brief:"The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"/app/myapplication/http/handler/server.py",aliases:["code.filepath"],changelog:[{version:"0.0.0"}]},"code.function":{brief:"The method or function name, or equivalent (usually rightmost part of the code unit's name).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"server_request",aliases:["code.function.name"],changelog:[{version:"0.1.0",prs:[61,74]},{version:"0.0.0"}]},"code.function.name":{brief:"The method or function fully-qualified name without arguments.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"server_request",aliases:["code.function"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"code.lineno":{brief:"The line number in code.filepath best representing the operation. It SHOULD point within the code unit named in code.function",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:42,deprecation:{replacement:"code.line.number"},aliases:["code.line.number"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61,108]},{version:"0.0.0"}]},"code.line.number":{brief:"The line number in code.filepath best representing the operation. It SHOULD point within the code unit named in code.function",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:42,aliases:["code.lineno"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"code.namespace":{brief:"The 'namespace' within which code.function is defined. Usually the qualified class or module name, such that code.namespace + some separator + code.function form a unique identifier for the code unit.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"http.handler",changelog:[{version:"0.1.0",prs:[61,74]},{version:"0.0.0"}]},connectionType:{brief:"Specifies the type of the current connection (e.g. wifi, ethernet, cellular , etc).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"wifi",deprecation:{replacement:"network.connection.type",reason:"Old namespace-less attribute, to be replaced with network.connection.type for span-first future"},aliases:["network.connection.type","device.connection_type"],changelog:[{version:"0.5.0",prs:[279],description:"Added and deprecated attribute to document JS SDK's current behaviour"}]},"connection.rtt":{brief:"Specifies the estimated effective round-trip time of the current connection, in milliseconds.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:100,deprecation:{replacement:"network.connection.rtt",reason:"Old attribute name (no official namespace), to be replaced with network.connection.rtt for span-first future"},aliases:["network.connection.rtt"],changelog:[{version:"0.5.0",prs:[279],description:"Added and deprecated attribute to document JS SDK's current behaviour"}]},"culture.calendar":{brief:"The calendar system used by the culture.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"GregorianCalendar",changelog:[{version:"0.4.0",prs:[243]}]},"culture.display_name":{brief:"Human readable name of the culture.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"English (United States)",changelog:[{version:"0.4.0",prs:[243]}]},"culture.is_24_hour_format":{brief:"Whether the culture uses 24-hour time format.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.4.0",prs:[243]}]},"culture.locale":{brief:"The locale identifier following RFC 4646.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"en-US",changelog:[{version:"0.4.0",prs:[243]}]},"culture.timezone":{brief:"The timezone of the culture, as a geographic timezone identifier.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Europe/Vienna",changelog:[{version:"0.4.0",prs:[243]}]},"db.collection.name":{brief:"The name of a collection (table, container) within the database.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"users",changelog:[{version:"0.1.0",prs:[106,127]},{version:"0.0.0"}]},"db.driver.name":{brief:"The name of the driver used for the database connection.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"psycopg2",changelog:[{version:"0.5.0",prs:[297],description:"Added db.driver.name attribute"}]},"db.name":{brief:"The name of the database being accessed.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"customers",deprecation:{replacement:"db.namespace"},aliases:["db.namespace"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"db.namespace":{brief:"The name of the database being accessed.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"customers",aliases:["db.name"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"db.operation":{brief:"The name of the operation being executed.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"SELECT",deprecation:{replacement:"db.operation.name"},aliases:["db.operation.name","cloudflare.d1.query_type"],changelog:[{version:"0.4.0",prs:[199]},{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"db.operation.batch.size":{brief:"The number of queries included in a batch operation. Operations are only considered batches when they contain two or more operations, and so db.operation.batch.size SHOULD never be 1.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:3,changelog:[{version:"0.11.0",prs:[407],description:"Added db.operation.batch.size attribute"}]},"db.operation.name":{brief:"The name of the operation being executed.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"SELECT",aliases:["db.operation","cloudflare.d1.query_type"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"db.query.parameter.":{brief:"A query parameter used in db.query.text, with being the parameter name, and the attribute value being a string representation of the parameter value.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",hasDynamicSuffix:!0,example:"db.query.parameter.foo='123'",changelog:[{version:"0.1.0",prs:[103,127]}]},"db.query.summary":{brief:"A shortened representation of operation(s) in the full query. This attribute must be low-cardinality and should only contain the operation table names.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"SELECT users",changelog:[{version:"0.4.0",prs:[208]},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"db.query.text":{brief:"The database parameterized query being executed. Any parameter values (filters, insertion values, etc) should be replaced with parameter placeholders. If applicable, use `db.query.parameter.` to add the parameter value.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"SELECT * FROM users WHERE id = $1",aliases:["db.statement"],changelog:[{version:"0.4.0",prs:[208]},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"db.redis.connection":{brief:"The redis connection name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"my-redis-instance",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"db.redis.key":{brief:"The key the Redis command is operating on.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"user:2047:city",changelog:[{version:"0.6.0",prs:[326],description:"Added db.redis.key attribute"}]},"db.redis.parameters":{brief:"The array of command parameters given to a redis command.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["test","*"],changelog:[{version:"0.0.0"}]},"db.response.status_code":{brief:"Database response status code. The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"ORA-17002",changelog:[{version:"0.16.0",prs:[462],description:"Added db.response.status_code attribute"}]},"db.sql.bindings":{brief:"The array of query bindings.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:["1","foo"],deprecation:{replacement:"db.query.parameter.",reason:"Instead of adding every binding in the db.sql.bindings attribute, add them as individual entires with db.query.parameter.."},changelog:[{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"db.statement":{brief:"The database statement being executed.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"SELECT * FROM users",deprecation:{replacement:"db.query.text"},aliases:["db.query.text"],changelog:[{version:"0.4.0",prs:[199]},{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"db.stored_procedure.name":{brief:"The name of a stored procedure being called.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"GetUserById",changelog:[{version:"0.11.0",prs:[398]}]},"db.system":{brief:"An identifier for the database management system (DBMS) product being used. See [OpenTelemetry docs](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md#notes-and-well-known-identifiers-for-dbsystem) for a list of well-known identifiers.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"postgresql",deprecation:{replacement:"db.system.name"},aliases:["db.system.name"],changelog:[{version:"0.4.0",prs:[199,224]},{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"db.system.name":{brief:"An identifier for the database management system (DBMS) product being used. See [OpenTelemetry docs](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/database/database-spans.md#notes-and-well-known-identifiers-for-dbsystem) for a list of well-known identifiers.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"postgresql",aliases:["db.system"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"db.user":{brief:"The database user.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"fancy_user",changelog:[{version:"0.0.0"}]},deviceMemory:{brief:"The estimated total memory capacity of the device, only a rough estimation in gigabytes.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"8 GB",deprecation:{replacement:"device.memory.estimated_capacity",reason:"Old namespace-less attribute, to be replaced with device.memory.estimated_capacity for span-first future"},aliases:["device.memory.estimated_capacity"],changelog:[{version:"0.5.0",prs:[281],description:"Added and deprecated attribute to document JS SDK's current behaviour"}]},"device.archs":{brief:"The CPU architectures of the device.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:["arm64-v8a","armeabi-v7a","armeabi"],changelog:[{version:"0.5.0",prs:[303],description:"Added device.archs attribute"}]},"device.battery_level":{brief:"The battery level of the device as a percentage (0-100).",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:100,changelog:[{version:"0.5.0",prs:[303],description:"Added device.battery_level attribute"}]},"device.battery_temperature":{brief:"The battery temperature of the device in Celsius.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:25,changelog:[{version:"0.5.0",prs:[303],description:"Added device.battery_temperature attribute"}]},"device.boot_time":{brief:"A formatted UTC timestamp when the system was booted.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"2018-02-08T12:52:12Z",changelog:[{version:"0.5.0",prs:[303],description:"Added device.boot_time attribute"}]},"device.brand":{brief:"The brand of the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Apple",changelog:[{version:"0.1.0",prs:[116,127]}]},"device.charging":{brief:"Whether the device was charging or not.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!1,changelog:[{version:"0.5.0",prs:[303],description:"Added device.charging attribute"}]},"device.chipset":{brief:"The chipset of the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Qualcomm SM8550",changelog:[{version:"0.5.0",prs:[303],description:"Added device.chipset attribute"}]},"device.class":{brief:"The classification of the device. For example, `low`, `medium`, or `high`. Typically inferred by Relay - SDKs generally do not need to set this directly.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"medium",changelog:[{version:"0.5.0",prs:[300],description:"Added device.class attribute"}]},"device.connection_type":{brief:"The internet connection type currently being used by the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"wifi",deprecation:{replacement:"network.connection.type",reason:"This attribute is being deprecated in favor of network.connection.type"},aliases:["network.connection.type","connectionType"],changelog:[{version:"0.5.0",prs:[303],description:"Added and deprecated device.connection_type in favor of network.connection.type"}]},"device.cpu_description":{brief:"A description of the CPU of the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz",changelog:[{version:"0.5.0",prs:[303],description:"Added device.cpu_description attribute"}]},"device.external_free_storage":{brief:"External storage free size in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:67108864e3,changelog:[{version:"0.5.0",prs:[303],description:"Added device.external_free_storage attribute"}]},"device.external_storage_size":{brief:"External storage total size in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:134217728e3,changelog:[{version:"0.5.0",prs:[303],description:"Added device.external_storage_size attribute"}]},"device.family":{brief:"The family of the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"iPhone",changelog:[{version:"0.1.0",prs:[116,127]}]},"device.free_memory":{brief:"Free system memory in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2147483648,changelog:[{version:"0.5.0",prs:[300],description:"Added device.free_memory attribute"}]},"device.free_storage":{brief:"Free device storage in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:107374182400,changelog:[{version:"0.5.0",prs:[303],description:"Added device.free_storage attribute"}]},"device.id":{brief:"Unique device identifier.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"a1b2c3d4-e5f6-7890-abcd-ef1234567890",changelog:[{version:"0.5.0",prs:[303],description:"Added device.id attribute"}]},"device.locale":{brief:"The locale of the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"en-US",changelog:[{version:"0.5.0",prs:[303],description:"Added device.locale attribute"}]},"device.low_memory":{brief:"Whether the device was low on memory.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!1,changelog:[{version:"0.5.0",prs:[303],description:"Added device.low_memory attribute"}]},"device.low_power_mode":{brief:"Whether the device is in Low Power Mode.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.6.0",prs:[314],description:"Added device.low_power_mode attribute"}]},"device.manufacturer":{brief:"The manufacturer of the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Google",changelog:[{version:"0.5.0",prs:[303],description:"Added device.manufacturer attribute"}]},"device.memory.estimated_capacity":{brief:"The estimated total memory capacity of the device, only a rough estimation in gigabytes. Browsers report estimations in buckets of powers of 2, mostly capped at 8 GB",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:8,aliases:["deviceMemory"],changelog:[{version:"0.5.0",prs:[281],description:"Added attribute device.memory.estimated_capacity to be used instead of deviceMemory"}]},"device.memory_size":{brief:"Total system memory available in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:17179869184,changelog:[{version:"0.5.0",prs:[300],description:"Added device.memory_size attribute"}]},"device.model":{brief:"The model of the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"iPhone 15 Pro Max",changelog:[{version:"0.1.0",prs:[116,127]}]},"device.model_id":{brief:"An internal hardware revision to identify the device exactly.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"N861AP",changelog:[{version:"0.5.0",prs:[300],description:"Added device.model_id attribute"}]},"device.name":{brief:"The name of the device. On mobile, this is the user-assigned device name. On servers and desktops, this is typically the hostname.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"localhost",changelog:[{version:"0.5.0",prs:[303],description:"Added device.name attribute"}]},"device.online":{brief:"Whether the device was online or not.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.5.0",prs:[303],description:"Added device.online attribute"}]},"device.orientation":{brief:'The orientation of the device, either "portrait" or "landscape".',type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"portrait",changelog:[{version:"0.5.0",prs:[303],description:"Added device.orientation attribute"}]},"device.processor_count":{brief:'Number of "logical processors".',type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:8,aliases:["hardwareConcurrency"],changelog:[{version:"0.5.0",prs:[300],description:"Added and deprecated attribute device.processor_count in favor of device.cpu.logical_core_count"}]},"device.processor_frequency":{brief:"Processor frequency in MHz.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2400,changelog:[{version:"0.5.0",prs:[303],description:"Added device.processor_frequency attribute"}]},"device.screen_density":{brief:"The screen density of the device.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2.625,changelog:[{version:"0.5.0",prs:[303],description:"Added device.screen_density attribute"}]},"device.screen_dpi":{brief:"The screen density in dots-per-inch (DPI) of the device.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:420,changelog:[{version:"0.5.0",prs:[303],description:"Added device.screen_dpi attribute"}]},"device.screen_height_pixels":{brief:"The height of the device screen in pixels.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2400,changelog:[{version:"0.5.0",prs:[303],description:"Added device.screen_height_pixels attribute"}]},"device.screen_width_pixels":{brief:"The width of the device screen in pixels.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1080,changelog:[{version:"0.5.0",prs:[303],description:"Added device.screen_width_pixels attribute"}]},"device.simulator":{brief:"Whether the device is a simulator or an actual device.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!1,changelog:[{version:"0.5.0",prs:[300],description:"Added device.simulator attribute"}]},"device.storage_size":{brief:"Total device storage in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:274877906944,changelog:[{version:"0.5.0",prs:[303],description:"Added device.storage_size attribute"}]},"device.thermal_state":{brief:"The thermal state of the device. Based on Apple's `ProcessInfo.ThermalState` enum: `nominal`, `fair`, `serious`, or `critical`.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"nominal",changelog:[{version:"0.5.0",prs:[303],description:"Added device.thermal_state attribute"}]},"device.timezone":{brief:"The timezone of the device.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Europe/Vienna",changelog:[{version:"0.5.0",prs:[303],description:"Added device.timezone attribute"}]},"device.usable_memory":{brief:"Memory usable for the app in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2147483648,changelog:[{version:"0.5.0",prs:[303],description:"Added device.usable_memory attribute"}]},dist:{brief:"The sentry dist.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"1.0",deprecation:{replacement:"sentry.dist",reason:"This attribute is being deprecated in favor of sentry.dist."},aliases:["sentry.dist"],changelog:[{version:"0.16.0",prs:[489],description:"Added dist attribute"}]},effectiveConnectionType:{brief:"Specifies the estimated effective type of the current connection (e.g. slow-2g, 2g, 3g, 4g).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"4g",deprecation:{replacement:"network.connection.effective_type",reason:"Old namespace-less attribute, to be replaced with network.connection.effective_type for span-first future"},aliases:["network.connection.effective_type"],changelog:[{version:"0.5.0",prs:[279],description:"Added and deprecated attribute to document JS SDK's current behaviour"}]},environment:{brief:"The sentry environment.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"production",deprecation:{replacement:"sentry.environment"},aliases:["sentry.environment"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"error.type":{brief:"Describes a class of error the operation ended with.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"timeout",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"event.id":{brief:"The unique identifier for this event (log record)",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234567890,changelog:[{version:"0.1.0",prs:[101]}]},"event.name":{brief:"The name that uniquely identifies this event (log record)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Process Payload",changelog:[{version:"0.1.0",prs:[101,127]}]},"exception.escaped":{brief:"SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:!0,changelog:[{version:"0.0.0"}]},"exception.message":{brief:"The error message.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"ENOENT: no such file or directory",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"exception.stacktrace":{brief:"A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:`Exception in thread "main" java.lang.RuntimeException: Test exception + at com.example.GenerateTrace.methodB(GenerateTrace.java:13) + at com.example.GenerateTrace.methodA(GenerateTrace.java:9) + at com.example.GenerateTrace.main(GenerateTrace.java:5)`,changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"exception.type":{brief:"The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"OSError",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"faas.coldstart":{brief:"A boolean that is true if the serverless function is executed for the first time (aka cold-start).",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:!0,changelog:[{version:"0.0.0"}]},"faas.cron":{brief:"A string containing the schedule period as Cron Expression.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"0/5 * * * ? *",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"faas.duration_in_ms":{brief:"The duration a function took to run, in milliseconds.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:120,changelog:[{version:"0.11.0",prs:[403]}]},"faas.entry_point":{brief:"The code that's run when the cloud provider invokes your function.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"my_main_function",changelog:[{version:"0.11.0",prs:[403,415]}]},"faas.execution":{brief:"The execution ID of the current function execution.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"af9d5aa4-a685-4c5f-a22b-444f80b3cc28",deprecation:{replacement:"faas.invocation_id",reason:"This attribute is being deprecated in favor of faas.invocation_id, which is the OTel-aligned replacement."},aliases:["faas.invocation_id","aws.lambda.aws_request_id"],changelog:[{version:"0.16.0",prs:[473],description:"Added faas.execution attribute, deprecated in favor of faas.invocation_id"}]},"faas.id":{brief:"The unique ID of the single function that this runtime instance executes.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function",deprecation:{replacement:"cloud.resource_id",reason:"This attribute is being deprecated in favor of cloud.resource_id, which is the OTel-aligned replacement (renamed in OTel semantic conventions v1.19.0)."},aliases:["cloud.resource_id"],changelog:[{version:"0.16.0",prs:[475],description:"Added faas.id attribute, deprecated in favor of cloud.resource_id"}]},"faas.identity":{brief:"The Service Account (GCP), IAM Execution Role (AWS), or Managed Identity (Azure) used by the serverless function when interacting with other cloud services",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"name@project.iam.gserviceaccount.com (GCP), arn:aws:iam::123456789012:role/role-name (AWS), 00000000-0000-0000-0000-000000000000 (Azure)",changelog:[{version:"0.11.0",prs:[403]}]},"faas.invocation_id":{brief:"The invocation ID of the current function invocation.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"af9d5aa4-a685-4c5f-a22b-444f80b3cc28",aliases:["aws.lambda.aws_request_id","faas.execution"],changelog:[{version:"0.16.0",prs:[473],description:"Added faas.execution as an alias"},{version:"0.11.1",prs:[414,424]}]},"faas.invoked_name":{brief:"The name of the invoked function.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"my-function",changelog:[{version:"0.16.0",prs:[481],description:"Added faas.invoked_name attribute"}]},"faas.invoked_provider":{brief:"The cloud provider of the invoked function.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"aws",changelog:[{version:"0.16.0",prs:[481],description:"Added faas.invoked_provider attribute"}]},"faas.invoked_region":{brief:"The cloud region of the invoked function.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"eu-central-1",changelog:[{version:"0.16.0",prs:[481],description:"Added faas.invoked_region attribute"}]},"faas.name":{brief:"The name of the serverless function",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"my_function",aliases:["aws.lambda.function_name"],changelog:[{version:"0.11.0",prs:[403,415]}]},"faas.time":{brief:"A string containing the function invocation time in the ISO 8601 format expressed in UTC.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"2020-01-23T13:47:06Z",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"faas.trigger":{brief:"Type of the trigger which caused this function invocation.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"timer",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"faas.version":{brief:"The version of the function that was invoked",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"$LATEST",aliases:["aws.lambda.function_version"],changelog:[{version:"0.11.1",prs:[414,424]}]},fcp:{brief:"The time it takes for the browser to render the first piece of meaningful content on the screen",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:547.6951,deprecation:{replacement:"browser.web_vital.fcp.value",reason:"This attribute is being deprecated in favor of browser.web_vital.fcp.value"},aliases:["browser.web_vital.fcp.value"],changelog:[{version:"0.5.0",prs:[235]}]},"flag.evaluation.":{brief:"An instance of a feature flag evaluation. The value of this attribute is the boolean representing the evaluation result. The suffix is the name of the feature flag.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"flag.evaluation.is_new_ui=true",changelog:[{version:"0.1.0",prs:[103]}]},fp:{brief:"The time it takes for the browser to render the first pixel on the screen",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:477.1926,deprecation:{replacement:"browser.web_vital.fp.value",reason:"This attribute is being deprecated in favor of browser.web_vital.fp.value"},aliases:["browser.web_vital.fp.value"],changelog:[{version:"0.5.0",prs:[235]}]},"frames.delay":{brief:"The sum of all delayed frame durations in seconds during the lifetime of the span. For more information see [frames delay](https://develop.sentry.dev/sdk/performance/frames-delay/).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:5,deprecation:{replacement:"app.vitals.frames.delay.value",reason:"Replaced by app.vitals.frames.delay.value to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.frames.delay.value"],changelog:[{version:"0.5.0",prs:[313],description:"Deprecated in favor of app.vitals.frames.delay.value"},{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"frames.frozen":{brief:"The number of frozen frames rendered during the lifetime of the span.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:3,deprecation:{replacement:"app.vitals.frames.frozen.count",reason:"Replaced by app.vitals.frames.frozen.count to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.frames.frozen.count"],changelog:[{version:"0.5.0",prs:[313],description:"Deprecated in favor of app.vitals.frames.frozen.count"},{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},frames_frozen_rate:{brief:"The rate of frozen frames, or `app_vitals.frames.frozen.count` divided by `app_vitals.frames.total.count`. This is computed by Relay.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",changelog:[{version:"0.7.0",prs:[362],description:"Added frames_frozen_rate attribute"}]},"frames.slow":{brief:"The number of slow frames rendered during the lifetime of the span.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,deprecation:{replacement:"app.vitals.frames.slow.count",reason:"Replaced by app.vitals.frames.slow.count to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.frames.slow.count"],changelog:[{version:"0.5.0",prs:[313],description:"Deprecated in favor of app.vitals.frames.slow.count"},{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},frames_slow_rate:{brief:"The rate of slow frames, or `app_vitals.frames.slow.count` divided by `app_vitals.frames.total.count`. This is computed by Relay.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",changelog:[{version:"0.7.0",prs:[362],description:"Added frames_slow_rate attribute"}]},"frames.total":{brief:"The number of total frames rendered during the lifetime of the span.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:60,deprecation:{replacement:"app.vitals.frames.total.count",reason:"Replaced by app.vitals.frames.total.count to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.frames.total.count"],changelog:[{version:"0.5.0",prs:[313],description:"Deprecated in favor of app.vitals.frames.total.count"},{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},fs_error:{brief:"The error message of a file system error.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"ENOENT: no such file or directory",deprecation:{replacement:"error.type",reason:"This attribute is not part of the OpenTelemetry specification and error.type fits much better."},changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"gcp.function.context.event_id":{brief:"The event ID from the legacy GCP Cloud Function context (1st gen)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1234567890",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.event_id attribute"}]},"gcp.function.context.event_type":{brief:"The type of the GCP Cloud Function event",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"google.pubsub.topic.publish",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.event_type attribute"}]},"gcp.function.context.id":{brief:"The unique event ID from the GCP CloudEvents context (2nd gen Cloud Functions)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1234567890",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.id attribute"}]},"gcp.function.context.resource":{brief:"The resource that triggered the GCP Cloud Function event",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"projects/my-project/topics/my-topic",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.resource attribute"}]},"gcp.function.context.source":{brief:"The source of the GCP Cloud Function event",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"//pubsub.googleapis.com/projects/my-project/topics/my-topic",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.source attribute"}]},"gcp.function.context.specversion":{brief:"The CloudEvents specification version of the GCP Cloud Function event",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1.0",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.specversion attribute"}]},"gcp.function.context.time":{brief:"The timestamp of the GCP Cloud Function event",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"2024-01-01T00:00:00.000Z",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.time attribute"}]},"gcp.function.context.timestamp":{brief:"The legacy timestamp of the GCP Cloud Function event",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"2024-01-01T00:00:00.000Z",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.timestamp attribute"}]},"gcp.function.context.type":{brief:"The type of the GCP Cloud Function event context",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"cloud_functions.context",changelog:[{version:"0.7.0",prs:[371],description:"Added gcp.function.context.type attribute"}]},"gcp.project.id":{brief:"The ID of the project in GCP that this resource is associated with",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"my-project-123",changelog:[{version:"0.11.0",prs:[403]}]},"gen_ai.agent.name":{brief:"The name of the agent being used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"ResearchAssistant",changelog:[{version:"0.1.0",prs:[62,127]}]},"gen_ai.context.utilization":{brief:"The fraction of the model context window utilized by this generation.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.75,changelog:[{version:"0.5.0",prs:[315],description:"Added gen_ai.context.utilization attribute"}]},"gen_ai.context.window_size":{brief:"The maximum context window size supported by the model for this generation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:128e3,changelog:[{version:"0.5.0",prs:[315],description:"Added gen_ai.context.window_size attribute"}]},"gen_ai.conversation.id":{brief:"The unique identifier for a conversation (session, thread), used to store and correlate messages within this conversation.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"conv_5j66UpCpwteGg4YSxUnt7lPY",changelog:[{version:"0.4.0",prs:[250]}]},"gen_ai.cost.cache_creation.input_tokens":{brief:"The cost of input tokens written to cache in USD.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12.34,changelog:[{version:"0.16.0",description:"Added gen_ai.cost.cache_creation.input_tokens attribute"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to calculate total cost, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","Despite the name 'cost.cache_creation.input_tokens', this value is cost in USD, not a token count. For token counts, use gen_ai.usage.cache_creation.input_tokens.","This is a subset of gen_ai.cost.input_tokens, not an independent cost. Do not sum this with gen_ai.cost.input_tokens \u2014 it is already included."]},"gen_ai.cost.cache_read.input_tokens":{brief:"The cost of cached input tokens in USD.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12.34,changelog:[{version:"0.16.0",description:"Added gen_ai.cost.cache_read.input_tokens attribute"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to calculate total cost, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","Despite the name 'cost.cache_read.input_tokens', this value is cost in USD, not a token count. For token counts, use gen_ai.usage.cache_read.input_tokens.","This is a subset of gen_ai.cost.input_tokens, not an independent cost. Do not sum this with gen_ai.cost.input_tokens \u2014 it is already included."]},"gen_ai.cost.input_tokens":{brief:"The total cost of all input tokens in USD (includes cached and cache creation tokens).",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:123.45,changelog:[{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[112]}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to calculate total cost, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","Despite the name 'cost.input_tokens', this value is cost in USD, not a token count. For token counts, use gen_ai.usage.input_tokens.","This is the total cost of all input tokens, including cached and cache creation tokens at their respective rates. For the cached portion, see gen_ai.cost.cache_read.input_tokens. For the cache creation portion, see gen_ai.cost.cache_creation.input_tokens."]},"gen_ai.cost.output_tokens":{brief:"The total cost of all output tokens in USD (includes reasoning tokens).",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:123.45,changelog:[{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[112]}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to calculate total cost, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","Despite the name 'cost.output_tokens', this value is cost in USD, not a token count. For token counts, use gen_ai.usage.output_tokens.","This is the total cost of all output tokens, including reasoning tokens at their respective rate. For the reasoning portion, see gen_ai.cost.reasoning.output_tokens."]},"gen_ai.cost.reasoning.output_tokens":{brief:"The cost of reasoning output tokens in USD.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12.34,changelog:[{version:"0.16.0",description:"Added gen_ai.cost.reasoning.output_tokens attribute"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to calculate total cost, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","Despite the name 'cost.reasoning.output_tokens', this value is cost in USD, not a token count. For token counts, use gen_ai.usage.reasoning.output_tokens.","This is a subset of gen_ai.cost.output_tokens, not an independent cost. Do not sum this with gen_ai.cost.output_tokens \u2014 it is already included."]},"gen_ai.cost.total_tokens":{brief:"The total cost for the tokens used.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12.34,aliases:["ai.total_cost"],changelog:[{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.5.0",prs:[264]},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[126]}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to calculate total cost, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","Despite the name 'cost.total_tokens', this value is cost in USD, not a token count. For token counts, use gen_ai.usage.total_tokens."]},"gen_ai.embeddings.input":{brief:"The input to the embeddings model.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"What's the weather in Paris?",changelog:[{version:"0.3.1",prs:[195]}]},"gen_ai.function_id":{brief:"Framework-specific tracing label for the execution of a function or other unit of execution in a generative AI system.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"my-awesome-function",changelog:[{version:"0.5.0",prs:[308],description:"Added gen_ai.function_id attribute"}]},"gen_ai.input.messages":{brief:'The messages passed to the model. It has to be a stringified version of an array of objects. The `role` attribute of each object must be `"user"`, `"assistant"`, `"tool"`, or `"system"`. For messages of the role `"tool"`, the `content` can be a string or an arbitrary object with information about the tool call. For other messages the `content` can be either a string or a list of objects in the format `{type: "text", text:"..."}`.',type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:'[{"role": "user", "parts": [{"type": "text", "content": "Weather in Paris?"}]}, {"role": "assistant", "parts": [{"type": "tool_call", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "name": "get_weather", "arguments": {"location": "Paris"}}]}, {"role": "tool", "parts": [{"type": "tool_call_response", "id": "call_VSPygqKTWdrhaFErNvMV18Yl", "result": "rainy, 57\xB0F"}]}]',aliases:["ai.texts"],changelog:[{version:"0.5.0",prs:[264]},{version:"0.4.0",prs:[221]}]},"gen_ai.operation.name":{brief:"The name of the operation being performed. It has the following list of well-known values: 'chat', 'create_agent', 'embeddings', 'execute_tool', 'generate_content', 'invoke_agent', 'text_completion'. If one of them applies, then that value MUST be used. Otherwise a custom value MAY be used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"chat",changelog:[{version:"0.4.0",prs:[225]},{version:"0.1.0",prs:[62,127]}]},"gen_ai.operation.type":{brief:"The type of AI operation. Must be one of 'agent' (invoke_agent and create_agent spans), 'ai_client' (any LLM call), 'tool' (execute_tool spans), 'handoff' (handoff spans), 'other' (input and output processors, skill loading, guardrails etc.) . Added during ingestion based on span.op and gen_ai.operation.type. Used to filter and aggregate data in the UI",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"tool",changelog:[{version:"0.4.0",prs:[257]},{version:"0.1.0",prs:[113,127]}]},"gen_ai.output.messages":{brief:"The model's response messages. It has to be a stringified version of an array of message objects, which can include text responses and tool calls.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:'[{"role": "assistant", "parts": [{"type": "text", "content": "The weather in Paris is currently rainy with a temperature of 57\xB0F."}], "finish_reason": "stop"}]',changelog:[{version:"0.4.0",prs:[221]}]},"gen_ai.pipeline.name":{brief:"Name of the AI pipeline or chain being executed.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Autofix Pipeline",aliases:["ai.pipeline.name"],changelog:[{version:"0.1.0",prs:[76,127]}]},"gen_ai.prompt":{brief:"The input messages sent to the model",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:'[{"role": "user", "message": "hello"}]',deprecation:{reason:"Deprecated from OTEL, use gen_ai.input.messages with the new format instead."},changelog:[{version:"0.1.0",prs:[74,108,119]},{version:"0.0.0"}]},"gen_ai.prompt.name":{brief:"The name of the prompt that uniquely identifies it.",type:"string",applyScrubbing:{key:"manual",reason:"Prompt names may reveal user behavior patterns or sensitive operations"},isInOtel:!0,visibility:"public",example:"summarize_text",aliases:["mcp.prompt.name"],changelog:[{version:"0.12.0",prs:[420],description:"Added gen_ai.prompt.name attribute"}]},"gen_ai.provider.name":{brief:"The Generative AI provider as identified by the client or server instrumentation.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"openai",aliases:["ai.model.provider","gen_ai.system"],changelog:[{version:"0.4.0",prs:[253]}]},"gen_ai.request.available_tools":{brief:"The available tools for the model. It has to be a stringified version of an array of objects.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:'[{"name": "get_weather", "description": "Get the weather for a given location"}, {"name": "get_news", "description": "Get the news for a given topic"}]',deprecation:{replacement:"gen_ai.tool.definitions"},changelog:[{version:"0.4.0",prs:[221]},{version:"0.1.0",prs:[63,127]}]},"gen_ai.request.frequency_penalty":{brief:"Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:.5,aliases:["ai.frequency_penalty"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57]}]},"gen_ai.request.max_tokens":{brief:"The maximum number of tokens to generate in the response.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:2048,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[62]}]},"gen_ai.request.messages":{brief:'The messages passed to the model. It has to be a stringified version of an array of objects. The `role` attribute of each object must be `"user"`, `"assistant"`, `"tool"`, or `"system"`. For messages of the role `"tool"`, the `content` can be a string or an arbitrary object with information about the tool call. For other messages the `content` can be either a string or a list of objects in the format `{type: "text", text:"..."}`.',type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:'[{"role": "system", "content": "Generate a random number."}, {"role": "user", "content": [{"text": "Generate a random number between 0 and 10.", "type": "text"}]}, {"role": "tool", "content": {"toolCallId": "1", "toolName": "Weather", "output": "rainy"}}]',deprecation:{replacement:"gen_ai.input.messages"},aliases:["ai.input_messages"],changelog:[{version:"0.4.0",prs:[221]},{version:"0.1.0",prs:[63,74,108,119,122]}]},"gen_ai.request.model":{brief:"The model identifier being used for the request.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"gpt-4-turbo-preview",changelog:[{version:"0.1.0",prs:[62,127]}]},"gen_ai.request.presence_penalty":{brief:"Used to reduce repetitiveness of generated tokens. Similar to frequency_penalty, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:.5,aliases:["ai.presence_penalty"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57]}]},"gen_ai.request.reasoning_effort":{brief:"Constrains the effort on reasoning for reasoning models. Supported values vary by provider.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"high",changelog:[{version:"0.13.0",prs:[334],description:"Added gen_ai.request.reasoning_effort attribute"}]},"gen_ai.request.seed":{brief:"The seed, ideally models given the same seed and same other parameters will produce the exact same output.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"1234567890",aliases:["ai.seed"],changelog:[{version:"0.1.0",prs:[57,127]}]},"gen_ai.request.stop_sequences":{brief:"List of sequences that the model will use to stop generating further tokens.",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:["forest","lived"],changelog:[{version:"0.16.0",prs:[482],description:"Added gen_ai.request.stop_sequences attribute"}]},"gen_ai.request.temperature":{brief:"For an AI model call, the temperature parameter. Temperature essentially means how random the output will be.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:.1,aliases:["ai.temperature"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57]}]},"gen_ai.request.top_k":{brief:"Limits the model to only consider the K most likely next tokens, where K is an integer (e.g., top_k=20 means only the 20 highest probability tokens are considered).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:35,aliases:["ai.top_k"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57]}]},"gen_ai.request.top_p":{brief:"Limits the model to only consider tokens whose cumulative probability mass adds up to p, where p is a float between 0 and 1 (e.g., top_p=0.7 means only tokens that sum up to 70% of the probability mass are considered).",type:"double",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:.7,aliases:["ai.top_p"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57]}]},"gen_ai.response.finish_reasons":{brief:"The reason why the model stopped generating.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"COMPLETE",aliases:["ai.finish_reason"],changelog:[{version:"0.1.0",prs:[57,127]}]},"gen_ai.response.id":{brief:"Unique identifier for the completion.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"gen_123abc",aliases:["ai.generation_id"],changelog:[{version:"0.1.0",prs:[57,127]}]},"gen_ai.response.model":{brief:"The vendor-specific ID of the model used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"gpt-4",aliases:["ai.model_id"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"gen_ai.response.streaming":{brief:"Whether or not the AI model call's response was streamed back asynchronously",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,aliases:["ai.streaming"],changelog:[{version:"0.1.0",prs:[76]}]},"gen_ai.response.text":{brief:"The model's response text messages. It has to be a stringified version of an array of response text messages.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:'["The weather in Paris is rainy and overcast, with temperatures around 57\xB0F", "The weather in London is sunny and warm, with temperatures around 65\xB0F"]',deprecation:{replacement:"gen_ai.output.messages"},changelog:[{version:"0.4.0",prs:[221]},{version:"0.1.0",prs:[63,74]}]},"gen_ai.response.time_to_first_chunk":{brief:"Time in seconds when the first response content chunk arrived in streaming responses.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:.6853435,aliases:["gen_ai.response.time_to_first_token"],changelog:[{version:"0.11.0",prs:[418],description:"Added gen_ai.response.time_to_first_chunk attribute"}]},"gen_ai.response.time_to_first_token":{brief:"Time in seconds when the first response content chunk arrived in streaming responses.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.6853435,deprecation:{replacement:"gen_ai.response.time_to_first_chunk"},aliases:["gen_ai.response.time_to_first_chunk"],changelog:[{version:"0.11.0",prs:[418],description:"Deprecate in favor of gen_ai.response.time_to_first_chunk"},{version:"0.4.0",prs:[227]}]},"gen_ai.response.tokens_per_second":{brief:"The total output tokens per seconds throughput",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:12345.67,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[66]}]},"gen_ai.response.tool_calls":{brief:"The tool calls in the model's response. It has to be a stringified version of an array of objects.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:'[{"name": "get_weather", "arguments": {"location": "Paris"}}]',deprecation:{replacement:"gen_ai.output.messages"},changelog:[{version:"0.4.0",prs:[221]},{version:"0.1.0",prs:[63,74]}]},"gen_ai.system":{brief:"The provider of the model.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"openai",deprecation:{replacement:"gen_ai.provider.name"},aliases:["ai.model.provider","gen_ai.provider.name"],changelog:[{version:"0.4.0",prs:[253]},{version:"0.1.0",prs:[57,127]}]},"gen_ai.system_instructions":{brief:"The system instructions passed to the model.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"You are a helpful assistant",aliases:["ai.preamble"],changelog:[{version:"0.5.0",prs:[264]},{version:"0.4.0",prs:[221]}]},"gen_ai.system.message":{brief:"The system instructions passed to the model.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"You are a helpful assistant",deprecation:{replacement:"gen_ai.system_instructions"},changelog:[{version:"0.4.0",prs:[221]},{version:"0.1.0",prs:[62]}]},"gen_ai.tool.call.arguments":{brief:"The arguments of the tool call. It has to be a stringified version of the arguments to the tool.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:'{"location": "Paris"}',aliases:["gen_ai.tool.input"],changelog:[{version:"0.5.0",prs:[265]},{version:"0.4.0",prs:[221]}]},"gen_ai.tool.call.result":{brief:"The result of the tool call. It has to be a stringified version of the result of the tool.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"rainy, 57\xB0F",aliases:["gen_ai.tool.output","gen_ai.tool.message","mcp.tool.result.content"],changelog:[{version:"0.5.0",prs:[265]},{version:"0.4.0",prs:[221]}]},"gen_ai.tool.definitions":{brief:"The list of source system tool definitions available to the GenAI agent or model.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:'[{"type": "function", "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": {"type": "object", "properties": {"location": {"type": "string", "description": "The city and state, e.g. San Francisco, CA"}, "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}}, "required": ["location", "unit"]}}]',changelog:[{version:"0.4.0",prs:[221]}]},"gen_ai.tool.description":{brief:"The description of the tool being used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Searches the web for current information about a topic",changelog:[{version:"0.1.0",prs:[62,127]}]},"gen_ai.tool.input":{brief:"The input of the tool being used. It has to be a stringified version of the input to the tool.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:'{"location": "Paris"}',deprecation:{replacement:"gen_ai.tool.call.arguments"},aliases:["gen_ai.tool.call.arguments"],changelog:[{version:"0.5.0",prs:[265]},{version:"0.1.0",prs:[63,74]}]},"gen_ai.tool.message":{brief:"The response from a tool or function call passed to the model.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"rainy, 57\xB0F",deprecation:{replacement:"gen_ai.tool.call.result"},aliases:["gen_ai.tool.call.result","gen_ai.tool.output","mcp.tool.result.content"],changelog:[{version:"0.5.0",prs:[265]},{version:"0.1.0",prs:[62]}]},"gen_ai.tool.name":{brief:"Name of the tool utilized by the agent.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Flights",aliases:["ai.function_call","mcp.tool.name"],changelog:[{version:"0.1.0",prs:[57,127]}]},"gen_ai.tool.output":{brief:"The output of the tool being used. It has to be a stringified version of the output of the tool.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"rainy, 57\xB0F",deprecation:{replacement:"gen_ai.tool.call.result"},aliases:["gen_ai.tool.call.result","gen_ai.tool.message","mcp.tool.result.content"],changelog:[{version:"0.5.0",prs:[265]},{version:"0.1.0",prs:[63,74]}]},"gen_ai.tool.type":{brief:"The type of tool being used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"function",deprecation:{reason:"The gen_ai.tool.type attribute is deprecated and should no longer be set."},changelog:[{version:"0.1.0",prs:[62,127]}]},"gen_ai.usage.cache_creation.input_tokens":{brief:"The number of tokens written to the cache when processing the AI input (prompt).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:100,aliases:["gen_ai.usage.input_tokens.cache_write"],changelog:[{version:"0.11.0",prs:[418],description:"Added gen_ai.usage.cache_creation.input_tokens attribute"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans."]},"gen_ai.usage.cache_read.input_tokens":{brief:"The number of cached tokens used to process the AI input (prompt).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:50,aliases:["gen_ai.usage.input_tokens.cached"],changelog:[{version:"0.11.0",prs:[418],description:"Added gen_ai.usage.cache_read.input_tokens attribute"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","This is a subset of gen_ai.usage.input_tokens, not an independent count. Do not sum this with gen_ai.usage.input_tokens \u2014 it is already included."]},"gen_ai.usage.completion_tokens":{brief:"The number of tokens used in the GenAI response (completion).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:10,deprecation:{replacement:"gen_ai.usage.output_tokens"},aliases:["ai.completion_tokens.used","gen_ai.usage.output_tokens"],changelog:[{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61]},{version:"0.0.0"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans."]},"gen_ai.usage.input_tokens":{brief:"The number of tokens used to process the AI input (prompt) including cached input tokens.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:10,aliases:["ai.prompt_tokens.used","gen_ai.usage.prompt_tokens"],changelog:[{version:"0.11.0",prs:[418],description:"Update additional_context to reference gen_ai.usage.cache_read.input_tokens"},{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.5.0",prs:[261]},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[112]},{version:"0.0.0"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","This count includes cached input tokens. gen_ai.usage.cache_read.input_tokens is a subset of this value, not an independent count \u2014 do not sum them together."]},"gen_ai.usage.input_tokens.cached":{brief:"The number of cached tokens used to process the AI input (prompt).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:50,deprecation:{replacement:"gen_ai.usage.cache_read.input_tokens"},aliases:["gen_ai.usage.cache_read.input_tokens"],changelog:[{version:"0.11.0",prs:[418],description:"Deprecate in favor of gen_ai.usage.cache_read.input_tokens"},{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[62,112]}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","This is a subset of gen_ai.usage.input_tokens, not an independent count. Do not sum this with gen_ai.usage.input_tokens \u2014 it is already included."]},"gen_ai.usage.input_tokens.cache_write":{brief:"The number of tokens written to the cache when processing the AI input (prompt).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:100,deprecation:{replacement:"gen_ai.usage.cache_creation.input_tokens"},aliases:["gen_ai.usage.cache_creation.input_tokens"],changelog:[{version:"0.11.0",prs:[418],description:"Deprecate in favor of gen_ai.usage.cache_creation.input_tokens"},{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.4.0",prs:[217,228]}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans."]},"gen_ai.usage.output_tokens":{brief:"The number of tokens used for creating the AI output (including reasoning tokens).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:10,aliases:["ai.completion_tokens.used","gen_ai.usage.completion_tokens"],changelog:[{version:"0.11.0",prs:[418],description:"Update additional_context to reference gen_ai.usage.reasoning.output_tokens"},{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.5.0",prs:[261]},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[112]},{version:"0.0.0"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","This count includes reasoning tokens. gen_ai.usage.reasoning.output_tokens is a subset of this value, not an independent count \u2014 do not sum them together."]},"gen_ai.usage.output_tokens.reasoning":{brief:"The number of tokens used for reasoning to create the AI output.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:75,deprecation:{replacement:"gen_ai.usage.reasoning.output_tokens"},aliases:["gen_ai.usage.reasoning.output_tokens"],changelog:[{version:"0.11.0",prs:[418],description:"Deprecate in favor of gen_ai.usage.reasoning.output_tokens"},{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[62,112]}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","This is a subset of gen_ai.usage.output_tokens, not an independent count. Do not sum this with gen_ai.usage.output_tokens \u2014 it is already included."]},"gen_ai.usage.prompt_tokens":{brief:"The number of tokens used in the GenAI input (prompt).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:20,deprecation:{replacement:"gen_ai.usage.input_tokens"},aliases:["ai.prompt_tokens.used","gen_ai.usage.input_tokens"],changelog:[{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61]},{version:"0.0.0"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans."]},"gen_ai.usage.reasoning.output_tokens":{brief:"The number of tokens used for reasoning to create the AI output.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:75,aliases:["gen_ai.usage.output_tokens.reasoning"],changelog:[{version:"0.11.0",prs:[418],description:"Added gen_ai.usage.reasoning.output_tokens attribute"}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","This is a subset of gen_ai.usage.output_tokens, not an independent count. Do not sum this with gen_ai.usage.output_tokens \u2014 it is already included."]},"gen_ai.usage.total_tokens":{brief:"The total number of tokens used to process the prompt. (input tokens plus output todkens)",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:20,aliases:["ai.total_tokens.used"],changelog:[{version:"0.9.0",prs:[397],description:"Add additional_context"},{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[57]}],additionalContext:["This attribute appears on both agent parent spans (aggregated totals) and LLM child spans (per-call values). When using sum() to count tokens, filter to gen_ai.operation.type:ai_client to avoid double-counting hierarchical spans.","This is the sum of gen_ai.usage.input_tokens and gen_ai.usage.output_tokens. Do not sum this with either of them \u2014 they are already included."]},"graphql.document":{brief:"The GraphQL document being executed.",type:"string",applyScrubbing:{key:"auto",reason:"The document may contain sensitive information in arguments or variables. Instrumentation should redact sensitive information when possible."},isInOtel:!0,visibility:"public",example:"query findBookById { bookById(id: ?) { name } }",changelog:[{version:"0.7.0",description:"Adds the `graphql.document` attribute to track the GraphQL document being executed."}]},"graphql.operation.name":{brief:"The name of the operation being executed.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"findBookById",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"graphql.operation.type":{brief:"The type of the operation being executed.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"query",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},hardwareConcurrency:{brief:"The number of logical CPU cores available.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"14",deprecation:{replacement:"device.processor_count",reason:"Old namespace-less attribute, to be replaced with device.processor_count for span-first future"},aliases:["device.processor_count"],changelog:[{version:"0.5.0",prs:[281,300],description:"Added and deprecated attribute to document JS SDK's current behaviour"}]},"http.client_ip":{brief:"Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"example.com",deprecation:{replacement:"client.address"},aliases:["client.address"],changelog:[{version:"0.1.0",prs:[61,106,127]},{version:"0.0.0"}]},"http.decoded_response_content_length":{brief:"The decoded body size of the response (in bytes).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:456,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"http.flavor":{brief:"The actual version of the protocol used for network communication.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"1.1",deprecation:{replacement:"network.protocol.version"},aliases:["network.protocol.version","net.protocol.version"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"http.fragment":{brief:"The fragments present in the URI. Note that this contains the leading # character, while the `url.fragment` attribute does not.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"#details",changelog:[{version:"0.0.0"}]},"http.host":{brief:"The domain name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"example.com",deprecation:{replacement:"server.address",reason:"Deprecated, use one of `server.address` or `client.address`, depending on the usage"},aliases:["server.address","client.address","http.server_name","net.host.name","server_name"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"http.method":{brief:"The HTTP method used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"GET",deprecation:{replacement:"http.request.method"},aliases:["http.request.method","http.request_method","method"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"http.query":{brief:"The query string present in the URL. Note that this contains the leading ? character, while the `url.query` attribute does not.",type:"string",applyScrubbing:{key:"auto",reason:"Query string values can contain sensitive information. Clients should attempt to scrub parameters that might contain sensitive information."},isInOtel:!1,visibility:"public",example:"?foo=bar&bar=baz",changelog:[{version:"0.0.0"}]},"http.request.body.data":{brief:"HTTP request body data. Can be given as string or structural data of any format.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:'[{"role": "user", "message": "hello"}]',changelog:[{version:"0.6.0",prs:[336],description:"Added http.request.body.data attribute"}]},"http.request.connection_end":{brief:"The UNIX timestamp representing the time immediately after the browser finishes establishing the connection to the server to retrieve the resource. The timestamp value includes the time interval to establish the transport connection, as well as other time intervals such as TLS handshake and SOCKS authentication.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:173282955515e-2,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.connect_start":{brief:"The UNIX timestamp representing the time immediately before the user agent starts establishing the connection to the server to retrieve the resource.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1732829555111e-3,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.domain_lookup_end":{brief:"The UNIX timestamp representing the time immediately after the browser finishes the domain-name lookup for the resource.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1732829555201e-3,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.domain_lookup_start":{brief:"The UNIX timestamp representing the time immediately before the browser starts the domain name lookup for the resource.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1732829555322e-3,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.fetch_start":{brief:"The UNIX timestamp representing the time immediately before the browser starts to fetch the resource.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1732829555389e-3,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.header.":{brief:"HTTP request headers, being the normalized HTTP Header name (lowercase), the value being the header values.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",hasDynamicSuffix:!0,example:"http.request.header.custom-header=['foo', 'bar']",changelog:[{version:"0.4.0",prs:[201,204]},{version:"0.1.0",prs:[103]}]},"http.request.method":{brief:"The HTTP method used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"GET",aliases:["method","http.method","http.request_method"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"http.request_method":{brief:"The HTTP method used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"GET",deprecation:{replacement:"http.request.method"},aliases:["method","http.method","http.request.method"],changelog:[{version:"0.6.0",prs:[343],description:"Added http.request_method attribute"}]},"http.request.redirect_end":{brief:"The UNIX timestamp representing the timestamp immediately after receiving the last byte of the response of the last redirect",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1732829558502e-3,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[130,134]}]},"http.request.redirect_start":{brief:"The UNIX timestamp representing the start time of the fetch which that initiates the redirect.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1732829555495e-3,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.request_start":{brief:"The UNIX timestamp representing the time immediately before the browser starts requesting the resource from the server, cache, or local resource. If the transport connection fails and the browser retires the request, the value returned will be the start of the retry request.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:173282955551e-2,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.resend_count":{brief:"The ordinal number of request resending attempt (for any reason, including redirects).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"http.request.response_end":{brief:"The UNIX timestamp representing the time immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:173282955589e-2,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.response_start":{brief:"The UNIX timestamp representing the time immediately before the browser starts requesting the resource from the server, cache, or local resource. If the transport connection fails and the browser retires the request, the value returned will be the start of the retry request.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:17328295557e-1,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.same_origin":{brief:"Indicates that a URL has the same origin as the current page's origin in the browser.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,aliases:["url.same_origin"],changelog:[{version:"0.16.0",prs:[456],description:"Added http.request.same_origin attribute"}]},"http.request.secure_connection_start":{brief:"The UNIX timestamp representing the time immediately before the browser starts the handshake process to secure the current connection. If a secure connection is not used, the property returns zero.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:173282955573e-2,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[134]},{version:"0.0.0"}]},"http.request.time_to_first_byte":{brief:"The time in seconds from the browser's timeorigin to when the first byte of the request's response was received. See https://web.dev/articles/ttfb#measure-resource-requests",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1.032,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[131]}]},"http.request.worker_start":{brief:"The UNIX timestamp representing the timestamp immediately before dispatching the FetchEvent if a Service Worker thread is already running, or immediately before starting the Service Worker thread if it is not already running.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:173282955368e-2,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[130,134]}]},"http.response.body.size":{brief:"The encoded body size of the response (in bytes).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:123,aliases:["http.response_content_length","http.response.header.content-length"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[106]},{version:"0.0.0"}]},"http.response_content_length":{brief:"The encoded body size of the response (in bytes).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:123,deprecation:{replacement:"http.response.body.size"},aliases:["http.response.body.size","http.response.header.content-length"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61,106]},{version:"0.0.0"}]},"http.response.header.content-length":{brief:"The size of the message body sent to the recipient (in bytes)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"http.response.header.custom-header=['foo', 'bar']",aliases:["http.response_content_length","http.response.body.size"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"http.response.header.":{brief:"HTTP response headers, being the normalized HTTP Header name (lowercase), the value being the header values.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",hasDynamicSuffix:!0,example:"http.response.header.custom-header=['foo', 'bar']",changelog:[{version:"0.4.0",prs:[201,204]},{version:"0.1.0",prs:[103]}]},"http.response.size":{brief:"The transfer size of the response (in bytes).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:456,aliases:["http.response_transfer_size"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"http.response.status_code":{brief:"The status code of the HTTP response.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:404,aliases:["http.status_code"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"http.response_transfer_size":{brief:"The transfer size of the response (in bytes).",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:456,deprecation:{replacement:"http.response.size"},aliases:["http.response.size"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"http.route":{brief:"The matched route, that is, the path template in the format used by the respective server framework.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"/users/:id",aliases:["url.template"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"http.scheme":{brief:"The URI scheme component identifying the used protocol.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"https",deprecation:{replacement:"url.scheme"},aliases:["url.scheme"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"http.server_name":{brief:"The server domain name",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"example.com",deprecation:{replacement:"server.address"},aliases:["server.address","net.host.name","http.host","server_name"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"http.server.request.time_in_queue":{brief:"The time in milliseconds the request spent in the server queue before processing began. Measured from the X-Request-Start header set by reverse proxies (e.g., Nginx, HAProxy, Heroku) to when the application started handling the request.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:50,changelog:[{version:"0.5.0",prs:[267]}]},"http.status_code":{brief:"The status code of the HTTP response.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:404,deprecation:{replacement:"http.response.status_code"},aliases:["http.response.status_code"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"http.target":{brief:"The pathname and query string of the URL.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"/test?foo=bar#buzz",deprecation:{replacement:"url.path",reason:"This attribute is being deprecated in favor of url.path and url.query"},changelog:[{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"http.url":{brief:"The URL of the resource that was fetched.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"https://example.com/test?foo=bar#buzz",deprecation:{replacement:"url.full"},aliases:["url.full","url"],changelog:[{version:"0.1.0",prs:[61,108]},{version:"0.0.0"}]},"http.user_agent":{brief:"Value of the HTTP User-Agent header sent by the client.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1",deprecation:{replacement:"user_agent.original"},aliases:["user_agent.original"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},id:{brief:"A unique identifier for the span.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"f47ac10b58cc4372a5670e02b2c3d479",changelog:[{version:"0.0.0"}]},inp:{brief:"The value of the recorded Interaction to Next Paint (INP) web vital",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:200,deprecation:{replacement:"browser.web_vital.inp.value",reason:"The INP web vital is now recorded as a browser.web_vital.inp.value attribute."},aliases:["browser.web_vital.inp.value"],changelog:[{version:"0.5.0",prs:[229],description:"Added and deprecated attribute to document JS SDK's current behaviour"}]},"jsonrpc.protocol.version":{brief:"The version of the JSON-RPC protocol used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"2.0",changelog:[{version:"0.12.0",prs:[420],description:"Added jsonrpc.protocol.version attribute"}]},"jsonrpc.request.id":{brief:"The JSON-RPC request identifier. Unique within the session.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"1",aliases:["mcp.request.id"],changelog:[{version:"0.12.0",prs:[420],description:"Added jsonrpc.request.id attribute"}]},"jvm.gc.action":{brief:"Name of the garbage collector action.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"end of minor GC",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"jvm.gc.name":{brief:"Name of the garbage collector.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"G1 Young Generation",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"jvm.memory.pool.name":{brief:"Name of the memory pool.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"G1 Old Gen",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"jvm.memory.type":{brief:"Name of the memory pool.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"G1 Old Gen",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"jvm.thread.daemon":{brief:"Whether the thread is daemon or not.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:!0,changelog:[{version:"0.0.0"}]},"jvm.thread.state":{brief:"State of the thread.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"blocked",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"koa.name":{brief:"The name of the Koa middleware or matched route that handled the request.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"/users/:id",deprecation:{reason:"No single replacement. SDKs should use http.route for router layers and code.function.name for middleware layers instead."},changelog:[{version:"0.16.0",prs:[490],description:"Added koa.name attribute as deprecated"}]},"koa.type":{brief:"The type of the Koa layer that handled the request.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"router",changelog:[{version:"0.16.0",prs:[471],description:"Added koa.type attribute"}]},lcp:{brief:"The value of the recorded Largest Contentful Paint (LCP) web vital",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2500,deprecation:{replacement:"browser.web_vital.lcp.value",reason:"The LCP web vital is now recorded as a browser.web_vital.lcp.value attribute."},aliases:["browser.web_vital.lcp.value"],changelog:[{version:"0.5.0",prs:[229],description:"Added and deprecated attribute to document JS SDK's current behaviour"}]},"lcp.element":{brief:"The dom element responsible for the largest contentful paint.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"img",deprecation:{replacement:"browser.web_vital.lcp.element",reason:"The LCP element is now recorded as a browser.web_vital.lcp.element attribute."},aliases:["browser.web_vital.lcp.element"],changelog:[{version:"0.5.0",prs:[233]},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"lcp.id":{brief:"The id of the dom element responsible for the largest contentful paint.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"#hero",deprecation:{replacement:"browser.web_vital.lcp.id",reason:"The LCP id is now recorded as a browser.web_vital.lcp.id attribute."},aliases:["browser.web_vital.lcp.id"],changelog:[{version:"0.5.0",prs:[233]},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"lcp.loadTime":{brief:"The time it took for the LCP element to be loaded",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1402,deprecation:{replacement:"browser.web_vital.lcp.load_time",reason:"The LCP load time is now recorded as a browser.web_vital.lcp.load_time attribute."},aliases:["browser.web_vital.lcp.load_time"],changelog:[{version:"0.5.0",prs:[233]}]},"lcp.renderTime":{brief:"The time it took for the LCP element to be rendered",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1685,deprecation:{replacement:"browser.web_vital.lcp.render_time",reason:"The LCP render time is now recorded as a browser.web_vital.lcp.render_time attribute."},aliases:["browser.web_vital.lcp.render_time"],changelog:[{version:"0.5.0",prs:[233]}]},"lcp.size":{brief:"The size of the largest contentful paint element.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234,deprecation:{replacement:"browser.web_vital.lcp.size",reason:"The LCP size is now recorded as a browser.web_vital.lcp.size attribute."},aliases:["browser.web_vital.lcp.size"],changelog:[{version:"0.5.0",prs:[233]},{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"lcp.url":{brief:"The url of the dom element responsible for the largest contentful paint.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"https://example.com",deprecation:{replacement:"browser.web_vital.lcp.url",reason:"The LCP url is now recorded as a browser.web_vital.lcp.url attribute."},aliases:["browser.web_vital.lcp.url"],changelog:[{version:"0.5.0",prs:[233]},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"logger.name":{brief:"The name of the logger that generated this event.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"myLogger",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"mcp.cancelled.reason":{brief:"Reason for the cancellation of an MCP operation.",type:"string",applyScrubbing:{key:"manual",reason:"Cancellation reasons may contain user-specific or sensitive information"},isInOtel:!1,visibility:"public",example:"User cancelled the request",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.cancelled.request_id":{brief:"Request ID of the cancelled MCP operation.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"123",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.client.name":{brief:"Name of the MCP client application.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"claude-desktop",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.client.title":{brief:"Display title of the MCP client application.",type:"string",applyScrubbing:{key:"manual",reason:"Client titles may reveal user-specific application configurations or custom setups"},isInOtel:!1,visibility:"public",example:"Claude Desktop",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.client.version":{brief:"Version of the MCP client application.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1.0.0",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.lifecycle.phase":{brief:"Lifecycle phase indicator for MCP operations.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"initialization_complete",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.logging.data_type":{brief:"Data type of the logged message content.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"string",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.logging.level":{brief:"Log level for MCP logging operations.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"info",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.logging.logger":{brief:"Logger name for MCP logging operations.",type:"string",applyScrubbing:{key:"manual",reason:"Logger names may be user-defined and could contain sensitive information"},isInOtel:!1,visibility:"public",example:"mcp_server",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.logging.message":{brief:"Log message content from MCP logging operations.",type:"string",applyScrubbing:{key:"auto",reason:"Log messages can contain user data"},isInOtel:!1,visibility:"public",example:"Tool execution completed successfully",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.method.name":{brief:"The name of the MCP request or notification method being called.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"tools/call",changelog:[{version:"0.12.0",prs:[420],description:"Set is_in_otel=true, attribute exists in OTel MCP registry"},{version:"0.3.0",prs:[171]}]},"mcp.progress.current":{brief:"Current progress value of an MCP operation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:50,changelog:[{version:"0.4.0",prs:[228]},{version:"0.3.0",prs:[171]}]},"mcp.progress.message":{brief:"Progress message describing the current state of an MCP operation.",type:"string",applyScrubbing:{key:"manual",reason:"Progress messages may contain user-specific or sensitive information"},isInOtel:!1,visibility:"public",example:"Processing 50 of 100 items",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.progress.percentage":{brief:"Calculated progress percentage of an MCP operation. Computed from current/total * 100.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:50,changelog:[{version:"0.4.0",prs:[228]},{version:"0.3.0",prs:[171]}]},"mcp.progress.token":{brief:"Token for tracking progress of an MCP operation.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"progress-token-123",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.progress.total":{brief:"Total progress target value of an MCP operation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:100,changelog:[{version:"0.4.0",prs:[228]},{version:"0.3.0",prs:[171]}]},"mcp.prompt.name":{brief:"Name of the MCP prompt template being used.",type:"string",applyScrubbing:{key:"manual",reason:"Prompt names may reveal user behavior patterns or sensitive operations"},isInOtel:!1,visibility:"public",example:"summarize",deprecation:{replacement:"gen_ai.prompt.name",reason:"OTel uses gen_ai.prompt.name for MCP prompt names"},aliases:["gen_ai.prompt.name"],changelog:[{version:"0.12.0",prs:[420],description:"Deprecated in favor of gen_ai.prompt.name"},{version:"0.3.0",prs:[171]}]},"mcp.prompt.result.description":{brief:"Description of the prompt result.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"A summary of the requested information",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.prompt.result.message_content":{brief:"Content of the message in the prompt result. Used for single message results only.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"Please provide a summary of the document",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.prompt.result.message_count":{brief:"Number of messages in the prompt result.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:3,changelog:[{version:"0.4.0",prs:[228]},{version:"0.3.0",prs:[171]}]},"mcp.prompt.result.message_role":{brief:"Role of the message in the prompt result. Used for single message results only.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"user",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.protocol.ready":{brief:"Protocol readiness indicator for MCP session. Non-zero value indicates the protocol is ready.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,changelog:[{version:"0.4.0",prs:[228]},{version:"0.3.0",prs:[171]}]},"mcp.protocol.version":{brief:"MCP protocol version used in the session.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"2024-11-05",changelog:[{version:"0.12.0",prs:[420],description:"Set is_in_otel=true, attribute exists in OTel MCP registry"},{version:"0.3.0",prs:[171]}]},"mcp.request.argument.":{brief:"MCP request argument with dynamic key suffix. The is replaced with the actual argument name. The value is a JSON-stringified representation of the argument value.",type:"string",applyScrubbing:{key:"auto",reason:"Arguments contain user input"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"mcp.request.argument.query='weather in Paris'",changelog:[{version:"0.3.0",prs:[176]}]},"mcp.request.argument.name":{brief:"Name argument from prompts/get MCP request.",type:"string",applyScrubbing:{key:"auto",reason:"Prompt names can contain user input"},isInOtel:!1,visibility:"public",example:"summarize",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.request.argument.uri":{brief:"URI argument from resources/read MCP request.",type:"string",applyScrubbing:{key:"auto",reason:"URIs can contain user file paths"},isInOtel:!1,visibility:"public",example:"file:///path/to/resource",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.request.id":{brief:"JSON-RPC request identifier for the MCP request. Unique within the MCP session.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1",deprecation:{replacement:"jsonrpc.request.id",reason:"OTel models MCP as JSON-RPC, uses jsonrpc.request.id"},aliases:["jsonrpc.request.id"],changelog:[{version:"0.12.0",prs:[420],description:"Deprecated in favor of jsonrpc.request.id"},{version:"0.3.0",prs:[171]}]},"mcp.resource.protocol":{brief:"Protocol of the resource URI being accessed, extracted from the URI.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"file",deprecation:{replacement:"network.protocol.name",reason:"OTel uses the generic network.protocol.name attribute"},aliases:["network.protocol.name","net.protocol.name"],changelog:[{version:"0.12.0",prs:[420],description:"Deprecated in favor of network.protocol.name"},{version:"0.3.0",prs:[171]}]},"mcp.resource.uri":{brief:"The resource URI being accessed in an MCP operation.",type:"string",applyScrubbing:{key:"auto",reason:"URIs can contain sensitive file paths"},isInOtel:!0,visibility:"public",example:"file:///path/to/file.txt",changelog:[{version:"0.12.0",prs:[420],description:"Set is_in_otel=true, attribute exists in OTel MCP registry"},{version:"0.3.0",prs:[171]}]},"mcp.server.name":{brief:"Name of the MCP server application.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"sentry-mcp-server",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.server.title":{brief:"Display title of the MCP server application.",type:"string",applyScrubbing:{key:"manual",reason:"Server titles may reveal user-specific application configurations or custom setups"},isInOtel:!1,visibility:"public",example:"Sentry MCP Server",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.server.version":{brief:"Version of the MCP server application.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"0.1.0",changelog:[{version:"0.3.0",prs:[171]}]},"mcp.session.id":{brief:"Identifier for the MCP session.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"550e8400-e29b-41d4-a716-446655440000",changelog:[{version:"0.12.0",prs:[420],description:"Set is_in_otel=true, attribute exists in OTel MCP registry"},{version:"0.3.0",prs:[171]}]},"mcp.tool.name":{brief:"Name of the MCP tool being called.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"calculator",deprecation:{replacement:"gen_ai.tool.name",reason:"OTel uses gen_ai.tool.name for MCP tool names"},aliases:["gen_ai.tool.name","ai.function_call"],changelog:[{version:"0.12.0",prs:[420],description:"Deprecated in favor of gen_ai.tool.name"},{version:"0.3.0",prs:[171]}]},"mcp.tool.result.content":{brief:"The content of the tool result.",type:"string",applyScrubbing:{key:"auto",reason:"Tool results can contain user data"},isInOtel:!1,visibility:"public",example:'{"output": "rainy", "toolCallId": "1"}',deprecation:{replacement:"gen_ai.tool.call.result",reason:"OTel uses gen_ai.tool.call.result for MCP tool results"},aliases:["gen_ai.tool.call.result","gen_ai.tool.message","gen_ai.tool.output"],changelog:[{version:"0.12.0",prs:[420],description:"Deprecated in favor of gen_ai.tool.call.result"},{version:"0.3.0",prs:[171]},{version:"0.2.0",prs:[164]}]},"mcp.tool.result.content_count":{brief:"Number of content items in the tool result.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1,changelog:[{version:"0.4.0",prs:[228]},{version:"0.3.0",prs:[171]}]},"mcp.tool.result.is_error":{brief:"Whether a tool execution resulted in an error.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!1,deprecation:{replacement:"error.type",reason:"OTel uses error.type set to 'tool_error' when isError is true. Cannot be automatically backfilled due to type mismatch (boolean vs string)."},changelog:[{version:"0.12.0",prs:[420],description:"Deprecated in favor of error.type"},{version:"0.3.0",prs:[171]}]},"mcp.transport":{brief:"Transport method used for MCP communication.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"stdio",deprecation:{replacement:"network.transport",reason:"OTel uses the generic network.transport attribute"},aliases:["network.transport","net.transport"],changelog:[{version:"0.12.0",prs:[420],description:"Deprecated in favor of network.transport"},{version:"0.3.0",prs:[171]}]},"mdc.":{brief:"Attributes from the Mapped Diagnostic Context (MDC) present at the moment the log record was created. The MDC is supported by all the most popular logging solutions in the Java ecosystem, and it's usually implemented as a thread-local map that stores context for e.g. a specific request.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"mdc.some_key='some_value'",changelog:[{version:"0.3.0",prs:[176]}]},"messaging.batch.message_count":{brief:"The number of messages sent, received, or processed in the scope of the batching operation.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:10,changelog:[{version:"0.6.0",prs:[341],description:"Added messaging.batch.message_count attribute"}]},"messaging.destination":{brief:"The message destination name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"BestTopic",deprecation:{replacement:"messaging.destination.name",reason:"This attribute is being deprecated in favor of messaging.destination.name, which is the OTel-aligned replacement."},aliases:["messaging.destination.name"],changelog:[{version:"0.16.0",prs:[482],description:"Added messaging.destination attribute, deprecated in favor of messaging.destination.name"}]},"messaging.destination.connection":{brief:"The message destination connection.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"BestTopic",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"messaging.destination.name":{brief:"The message destination name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"BestTopic",aliases:["messaging.destination"],changelog:[{version:"0.16.0",prs:[482],description:"Added messaging.destination as an alias"},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"messaging.message.body.size":{brief:"The size of the message body in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:839,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"messaging.message.conversation_id":{brief:'The conversation ID identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".',type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"MyConversationId",changelog:[{version:"0.16.0",prs:[468],description:"Added messaging.message.conversation_id attribute"}]},"messaging.message.envelope.size":{brief:"The size of the message body and metadata in bytes.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:1045,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"messaging.message.id":{brief:"A value used by the messaging system as an identifier for the message, represented as a string.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"f47ac10b58cc4372a5670e02b2c3d479",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"messaging.message.receive.latency":{brief:"The latency between when the message was published and received.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1732847252,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"messaging.message.retry.count":{brief:"The amount of attempts to send the message.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:2,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"messaging.operation.name":{brief:"The name of the messaging operation being performed",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"send",changelog:[{version:"0.11.0",prs:[392],description:"Added messaging.operation.name attribute"}]},"messaging.operation.type":{brief:"A string identifying the type of the messaging operation",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"create",changelog:[{version:"0.1.0",prs:[51,127]}]},"messaging.rabbitmq.destination.routing_key":{brief:"RabbitMQ message routing key.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"myKey",changelog:[{version:"0.16.0",prs:[468],description:"Added messaging.rabbitmq.destination.routing_key attribute"}]},"messaging.system":{brief:"The messaging system as identified by the client instrumentation.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"activemq",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},method:{brief:"The HTTP method used.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"GET",deprecation:{replacement:"http.request.method"},aliases:["http.request.method","http.request_method","http.method"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"middleware.name":{brief:"The name of the middleware.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"AuthenticationMiddleware",changelog:[{version:"0.6.0",prs:[336],description:"Added middleware.name attribute"}]},"navigation.origin":{brief:"The origin of the navigation (usually client side router navigations). Should preferrably parameterized template (like url.template) or a URL path otherwise.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"/users/:id",aliases:["sentry.sveltekit.navigation.from"],changelog:[{version:"0.16.0",prs:[467],description:"Added navigation.origin attribute"}]},"navigation.route.id":{brief:"The identifier of the matched client-side route, as assigned by the routing framework (e.g., vue-router name, react-router id).",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"AboutView",changelog:[{version:"0.16.0",prs:[468],description:"Added navigation.route.id attribute"}]},"navigation.type":{brief:"The type of navigation done by a client-side router.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"router.push",aliases:["sentry.sveltekit.navigation.type"],changelog:[{version:"0.16.0",prs:[467],description:"Added new deprecated alias"},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"nel.elapsed_time":{brief:"The elapsed number of milliseconds between the start of the resource fetch and when it was completed or aborted by the user agent.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:100,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[68]}]},"nel.phase":{brief:'If request failed, the phase of its network error. If request succeeded, "application".',type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"application",changelog:[{version:"0.1.0",prs:[68,127]}]},"nel.referrer":{brief:"request's referrer, as determined by the referrer policy associated with its client.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"https://example.com/foo?bar=baz",changelog:[{version:"0.1.0",prs:[68,127]}]},"nel.sampling_function":{brief:"The sampling function used to determine if the request should be sampled.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:.5,changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[68]}]},"nel.type":{brief:'If request failed, the type of its network error. If request succeeded, "ok".',type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"dns.unreachable",changelog:[{version:"0.1.0",prs:[68,127]}]},"network.connection.effective_type":{brief:"Specifies the effective type of the current connection (e.g. slow-2g, 2g, 3g, 4g).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"4g",aliases:["effectiveConnectionType"],changelog:[{version:"0.5.0",prs:[279],description:"Added attribute network.connection.effective_type to be used instead of effectiveConnectionType"}]},"network.connection.rtt":{brief:"Specifies the estimated effective round-trip time of the current connection, in milliseconds.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:100,aliases:["connection.rtt"],changelog:[{version:"0.5.0",prs:[279],description:"Added attribute network.connection.rtt to be used instead of connection.rtt"}]},"network.connection.type":{brief:"Specifies the type of the current connection (e.g. wifi, ethernet, cellular , etc).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"wifi",aliases:["device.connection_type","connectionType"],changelog:[{version:"0.5.0",prs:[279],description:"Added attribute network.connection.type to be used instead of connectionType"}]},"network.local.address":{brief:"Local address of the network connection - IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"10.1.2.80",aliases:["net.host.ip","net.sock.host.addr"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"network.local.port":{brief:"Local port number of the network connection.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:65400,aliases:["net.sock.host.port"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"network.peer.address":{brief:"Peer address of the network connection - IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"10.1.2.80",aliases:["net.peer.ip","net.sock.peer.addr"],changelog:[{version:"0.1.0",prs:[108,127]},{version:"0.0.0"}]},"network.peer.port":{brief:"Peer port number of the network connection.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:65400,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"network.protocol.name":{brief:"OSI application layer or non-OSI equivalent.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"http",aliases:["net.protocol.name","mcp.resource.protocol"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"network.protocol.version":{brief:"The actual version of the protocol used for network communication.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"1.1",aliases:["http.flavor","net.protocol.version"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"network.transport":{brief:"OSI transport layer or inter-process communication method.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"tcp",aliases:["net.transport","mcp.transport"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"network.type":{brief:"OSI network layer or non-OSI equivalent.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"ipv4",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"net.host.ip":{brief:"Local address of the network connection - IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"192.168.0.1",deprecation:{replacement:"network.local.address"},aliases:["network.local.address","net.sock.host.addr"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"net.host.name":{brief:"Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"example.com",deprecation:{replacement:"server.address"},aliases:["server.address","http.server_name","http.host","server_name"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"net.host.port":{brief:"Server port number.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:1337,deprecation:{replacement:"server.port"},aliases:["server.port"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"net.peer.ip":{brief:"Peer address of the network connection - IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"192.168.0.1",deprecation:{replacement:"network.peer.address"},aliases:["network.peer.address","net.sock.peer.addr"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"net.peer.name":{brief:"Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"example.com",deprecation:{replacement:"server.address",reason:"Deprecated, use server.address on client spans and client.address on server spans."},changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"net.peer.port":{brief:"Peer port number.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:1337,deprecation:{replacement:"server.port",reason:"Deprecated, use server.port on client spans and client.port on server spans."},changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"net.protocol.name":{brief:"OSI application layer or non-OSI equivalent.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"http",deprecation:{replacement:"network.protocol.name"},aliases:["network.protocol.name","mcp.resource.protocol"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"net.protocol.version":{brief:"The actual version of the protocol used for network communication.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"1.1",deprecation:{replacement:"network.protocol.version"},aliases:["network.protocol.version","http.flavor"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"net.sock.family":{brief:"OSI transport and network layer",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"inet",deprecation:{replacement:"network.transport",reason:"Deprecated, use network.transport and network.type."},changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"net.sock.host.addr":{brief:"Local address of the network connection mapping to Unix domain socket name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"/var/my.sock",deprecation:{replacement:"network.local.address"},aliases:["network.local.address","net.host.ip"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"net.sock.host.port":{brief:"Local port number of the network connection.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:8080,deprecation:{replacement:"network.local.port"},aliases:["network.local.port"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"net.sock.peer.addr":{brief:"Peer address of the network connection - IP address",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"192.168.0.1",deprecation:{replacement:"network.peer.address"},aliases:["network.peer.address","net.peer.ip"],changelog:[{version:"0.1.0",prs:[61,108,127]},{version:"0.0.0"}]},"net.sock.peer.name":{brief:"Peer address of the network connection - Unix domain socket name",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"/var/my.sock",deprecation:{reason:"Deprecated from OTEL, no replacement at this time"},changelog:[{version:"0.1.0",prs:[61,119,127]},{version:"0.0.0"}]},"net.sock.peer.port":{brief:"Peer port number of the network connection.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:8080,deprecation:{replacement:"network.peer.port"},changelog:[{version:"0.4.0",prs:[228]},{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"net.transport":{brief:"OSI transport layer or inter-process communication method.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"tcp",deprecation:{replacement:"network.transport"},aliases:["network.transport","mcp.transport"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"os.build":{brief:"The build ID of the operating system.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1234567890",deprecation:{replacement:"os.build_id"},aliases:["os.build_id"],changelog:[{version:"0.5.0",prs:[301],description:"Added os.build attribute, deprecated in favor of os.build_id"}]},"os.build_id":{brief:"The build ID of the operating system.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"1234567890",aliases:["os.build"],changelog:[{version:"0.5.0",prs:[301],description:"Added os.build as alias"},{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"os.description":{brief:"Human readable (not intended to be parsed) OS version information, like e.g. reported by ver or lsb_release -a commands.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Ubuntu 18.04.1 LTS",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"os.kernel_version":{brief:"An independent kernel version string. Typically the entire output of the `uname` syscall.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"20.2.0",changelog:[{version:"0.5.0",prs:[301],description:"Added os.kernel_version attribute"}]},"os.name":{brief:"Human readable operating system name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Ubuntu",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"os.raw_description":{brief:"An unprocessed description string obtained by the operating system. For some well-known runtimes, Sentry will attempt to parse `name` and `version` from this string, if they are not explicitly given.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Ubuntu 22.04.4 LTS (Jammy Jellyfish)",changelog:[{version:"0.5.0",prs:[301],description:"Added os.raw_description attribute"}]},"os.rooted":{brief:"Whether the operating system has been jailbroken or rooted.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.5.0",prs:[301],description:"Added os.rooted attribute"}]},"os.theme":{brief:"Whether the OS runs in dark mode or light mode.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"dark",changelog:[{version:"0.5.0",prs:[301],description:"Added os.theme attribute"}]},"os.type":{brief:"The operating system type.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"linux",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"os.version":{brief:"The version of the operating system.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"18.04.2",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"otel.kind":{brief:"The span kind (https://opentelemetry.io/docs/concepts/signals/traces/#span-kind). Deprecated, use `sentry.kind` instead.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"SERVER",deprecation:{replacement:"sentry.kind",reason:"Deprecated in favor of sentry.kind"},aliases:["sentry.kind"],changelog:[{version:"0.13.0",prs:[440],description:"Added otel.kind attribute"}]},"otel.scope.name":{brief:"The name of the instrumentation scope - (InstrumentationScope.Name in OTLP).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"io.opentelemetry.contrib.mongodb",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"otel.scope.version":{brief:"The version of the instrumentation scope - (InstrumentationScope.Version in OTLP).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"2.4.5",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"otel.status_code":{brief:"Name of the code, either \u201COK\u201D or \u201CERROR\u201D. MUST NOT be set if the status code is UNSET.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"OK",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"otel.status_description":{brief:"Description of the Status if it has a value, otherwise not set.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"resource not found",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"params.":{brief:"Decoded parameters extracted from a URL path. Usually added by client-side routing frameworks like vue-router.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"params.id='123'",aliases:["url.path.parameter."],changelog:[{version:"0.1.0",prs:[103]}]},"performance.activationStart":{brief:"The time between initiating a navigation to a page and the browser activating the page",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1.983,deprecation:{replacement:"browser.performance.navigation.activation_start",reason:"The activationStart is now recorded as the browser.performance.navigation.activation_start attribute."},aliases:["browser.performance.navigation.activation_start"],changelog:[{version:"0.5.0",prs:[321],description:"Added performance.activationStart attribute"}]},"performance.timeOrigin":{brief:"The browser's performance.timeOrigin timestamp representing the time when the pageload was initiated",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1776185678886e-3,deprecation:{replacement:"browser.performance.time_origin",reason:"The timeOrigin is now recorded as the browser.performance.time_origin attribute."},aliases:["browser.performance.time_origin"],changelog:[{version:"0.5.0",prs:[321],description:"Added performance.timeOrigin attribute"}]},previous_route:{brief:"Also used by mobile SDKs to indicate the previous route in the application.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"HomeScreen",changelog:[{version:"0.1.0",prs:[74]},{version:"0.0.0"}]},"process.command_args":{brief:"All the command arguments (including the command/executable itself) as received by the process.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:["cmd/otecol","--config=config.yaml"],changelog:[{version:"0.6.0",prs:[327],description:"Added process.command_args attribute"}]},"process.executable.name":{brief:"The name of the executable that started the process.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"getsentry",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"process.pid":{brief:"The process ID of the running process.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:12345,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"process.runtime.description":{brief:"An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. Equivalent to `raw_description` in the Sentry runtime context.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Eclipse OpenJ9 VM openj9-0.21.0",aliases:["runtime.raw_description"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"process.runtime.engine.name":{brief:"The name of the runtime engine.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"v8",changelog:[{version:"0.0.0"}]},"process.runtime.engine.version":{brief:"The version of the runtime engine.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"12.9.202.13-rusty",changelog:[{version:"0.0.0"}]},"process.runtime.name":{brief:"The name of the runtime. Equivalent to `name` in the Sentry runtime context.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"node",aliases:["runtime.name"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"process.runtime.version":{brief:"The version of the runtime of this process, as returned by the runtime without modification. Equivalent to `version` in the Sentry runtime context.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"18.04.2",aliases:["runtime.version"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"query.":{brief:"An item in a query string. Usually added by client-side routing frameworks like vue-router.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"query.id='123'",deprecation:{replacement:"url.query",reason:"Instead of sending items individually in query., they should be sent all together with url.query."},changelog:[{version:"0.1.0",prs:[103]}]},"react.version":{brief:"The version of the React framework",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"18.2.0",changelog:[{version:"0.7.0",prs:[368],description:"Added react.version attribute"}]},release:{brief:"The sentry release.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"production",deprecation:{replacement:"sentry.release"},aliases:["sentry.release"],changelog:[{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"remix.action_form_data.":{brief:"Remix form data, being the form data key, the value being the form data value.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"http.response.header.text='test'",changelog:[{version:"0.1.0",prs:[103]}]},replay_id:{brief:"The id of the sentry replay.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"123e4567e89b12d3a456426614174000",deprecation:{replacement:"sentry.replay_id"},aliases:["sentry.replay_id"],changelog:[{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"resource.deployment.environment":{brief:"The software deployment environment name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"production",deprecation:{replacement:"sentry.environment"},changelog:[{version:"0.5.0",prs:[266]}]},"resource.deployment.environment.name":{brief:"The software deployment environment name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"production",deprecation:{replacement:"sentry.environment"},changelog:[{version:"0.3.1",prs:[196]}]},"resource.render_blocking_status":{brief:"The render blocking status of the resource.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"non-blocking",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},route:{brief:"The matched route, that is, the path template in the format used by the respective server framework. Also used by mobile SDKs to indicate the current route in the application.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"App\\Controller::indexAction",deprecation:{replacement:"http.route"},aliases:["http.route"],changelog:[{version:"0.1.0",prs:[61,74]},{version:"0.0.0"}]},"rpc.grpc.status_code":{brief:"The numeric status code of the gRPC request.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:2,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"rpc.method":{brief:"The fully-qualified logical name of the method from the RPC interface perspective.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"com.example.ExampleService/exampleMethod",changelog:[{version:"0.7.0",prs:[351],description:"Added rpc.method attribute"}]},"rpc.response.status_code":{brief:"Status code of the RPC returned by the RPC server or generated by the client.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"DEADLINE_EXCEEDED",changelog:[{version:"0.7.0",prs:[352],description:"Added rpc.response.status_code attribute"}]},"rpc.service":{brief:"The full (logical) name of the service being called, including its package name, if applicable.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"myService.BestService",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"rpc.system":{brief:"A string identifying the remoting system.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"aws-api",deprecation:{replacement:"rpc.system.name",reason:"This attribute is being deprecated in favor of rpc.system.name, which is the OTel-aligned replacement."},aliases:["rpc.system.name"],changelog:[{version:"0.16.0",prs:[482],description:"Added rpc.system attribute, deprecated in favor of rpc.system.name"}]},"rpc.system.name":{brief:"A string identifying the remoting system.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"aws-api",aliases:["rpc.system"],changelog:[{version:"0.16.0",prs:[482],description:"Added rpc.system.name attribute"}]},"runtime.build":{brief:"The application build string, when it is separate from the version.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"stable",deprecation:{reason:"The runtime.* namespace is deprecated in favor of process.runtime.*. No direct OTel equivalent exists for this attribute."},changelog:[{version:"0.11.0",prs:[383],description:"Added and deprecated runtime.build attribute"}]},"runtime.name":{brief:"The name of the runtime. For example node, CPython, or rustc.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"node",deprecation:{replacement:"process.runtime.name",reason:"Prefer OTel-aligned process.runtime.name"},aliases:["process.runtime.name"],changelog:[{version:"0.11.0",prs:[383],description:"Added and deprecated runtime.name attribute in favor of process.runtime.name"}]},"runtime.raw_description":{brief:"Unprocessed description string as obtained from the runtime. Used to extract name and version for well-known runtimes.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Eclipse OpenJ9 VM openj9-0.21.0",deprecation:{replacement:"process.runtime.description",reason:"Prefer OTel-aligned process.runtime.description"},aliases:["process.runtime.description"],changelog:[{version:"0.11.0",prs:[383],description:"Added and deprecated runtime.raw_description attribute in favor of process.runtime.description"}]},"runtime.version":{brief:"The version of the runtime.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"18.04.2",deprecation:{replacement:"process.runtime.version",reason:"Prefer OTel-aligned process.runtime.version"},aliases:["process.runtime.version"],changelog:[{version:"0.11.0",prs:[383],description:"Added and deprecated runtime.version attribute in favor of process.runtime.version"}]},"score.":{brief:"The weighted performance score for a web vital. This is defined as `score.weight.` * `score.ratio.`.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"score.cls=0.1723",changelog:[{version:"0.7.0",prs:[355],description:"Added score. attribute"}]},"score.ratio.":{brief:"The score for a web vital, normalized to a number between 0 and 1.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"score.ratio.inp=0.7748",changelog:[{version:"0.7.0",prs:[355],description:"Added score.ratio. attribute"}]},"score.total":{brief:"The total performance score of a span. This is the sum of individual weighted web vital scores (see `score.`).",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",changelog:[{version:"0.7.0",prs:[355],description:"Added score.total attribute"}]},"score.weight.":{brief:"The relative weight of a web vital in a span's performance score.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"score.weight.fcp=0.25",changelog:[{version:"0.7.0",prs:[355],description:"Added score.weight. attribute"}]},"sentry.action":{brief:"Used as a generic attribute representing the action depending on the type of span. For instance, this is the database query operation for DB spans, and the request method for HTTP spans.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"SELECT",changelog:[{version:"0.4.0",prs:[212]}]},"sentry.browser.name":{brief:"The name of the browser.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Chrome",deprecation:{replacement:"browser.name"},aliases:["browser.name"],changelog:[{version:"0.1.0",prs:[139]}]},"sentry.browser.version":{brief:"The version of the browser.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"120.0.6099.130",deprecation:{replacement:"browser.version"},aliases:["browser.version"],changelog:[{version:"0.1.0",prs:[139]}]},"sentry.cancellation_reason":{brief:"The reason why a span ended early.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"document.hidden",changelog:[{version:"0.0.0"}]},"sentry.category":{brief:"The high-level category of a span, derived from the span operation or span attributes. This categorizes spans by their general purpose (e.g., database, HTTP, UI). Known values include: 'ai', 'ai.pipeline', 'app', 'browser', 'cache', 'console', 'db', 'event', 'file', 'function.aws', 'function.azure', 'function.gcp', 'function.nextjs', 'function.remix', 'graphql', 'grpc', 'http', 'measure', 'middleware', 'navigation', 'pageload', 'queue', 'resource', 'rpc', 'serialize', 'subprocess', 'template', 'topic', 'ui', 'ui.angular', 'ui.ember', 'ui.react', 'ui.svelte', 'ui.vue', 'view', 'websocket'.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"db",changelog:[{version:"0.4.0",prs:[218]}]},"sentry.client_sample_rate":{brief:"Rate at which a span was sampled in the SDK.",type:"double",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:.5,changelog:[{version:"0.1.0",prs:[102]}]},"sentry.description":{brief:"The human-readable description of a span.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"index view query",changelog:[{version:"0.1.0",prs:[135]}]},"sentry.dist":{brief:"The sentry dist.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"1.0",aliases:["dist"],changelog:[{version:"0.16.0",prs:[489],description:"Added dist as an alias"},{version:"0.0.0"}]},"sentry.domain":{brief:"Used as a generic attribute representing the domain depending on the type of span. For instance, this is the collection/table name for database spans, and the server address for HTTP spans.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"example.com",changelog:[{version:"0.4.0",prs:[212]}]},"sentry.dsc.environment":{brief:"The environment from the dynamic sampling context.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"internal",example:"prod",changelog:[{version:"0.3.0",prs:[185]}]},"sentry.dsc.project_id":{brief:"The ID of the project where the trace originated (i.e. the project of the SDK that started the trace). Propagated through the dynamic sampling context and set by Relay during ingestion.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"internal",example:"12345",changelog:[{version:"0.7.0",prs:[358],description:"Add sentry.dsc.project_id as an attribute"}]},"sentry.dsc.public_key":{brief:"The public key from the dynamic sampling context.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"internal",example:"c51734c603c4430eb57cb0a5728a479d",changelog:[{version:"0.3.0",prs:[185]}]},"sentry.dsc.release":{brief:"The release identifier from the dynamic sampling context.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"internal",example:"frontend@e8211be71b214afab5b85de4b4c54be3714952bb",changelog:[{version:"0.3.0",prs:[185]}]},"sentry.dsc.sampled":{brief:"Whether the event was sampled according to the dynamic sampling context.",type:"boolean",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"internal",example:!0,changelog:[{version:"0.3.0",prs:[185]}]},"sentry.dsc.sample_rate":{brief:"The sample rate from the dynamic sampling context.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"internal",example:"1.0",changelog:[{version:"0.3.0",prs:[185]}]},"sentry.dsc.trace_id":{brief:"The trace ID from the dynamic sampling context.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"internal",example:"047372980460430cbc78d9779df33a46",changelog:[{version:"0.3.0",prs:[185]}]},"sentry.dsc.transaction":{brief:"The transaction name from the dynamic sampling context.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"internal",example:"/issues/errors-outages/",changelog:[{version:"0.3.0",prs:[185]}]},"sentry.environment":{brief:"The sentry environment.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"production",aliases:["environment"],changelog:[{version:"0.0.0"}]},"sentry.exclusive_time":{brief:"The exclusive time duration of the span in milliseconds.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234,changelog:[{version:"0.4.0",prs:[228]},{version:"0.3.0",prs:[160]},{version:"0.0.0"}]},"sentry.graphql.operation":{brief:"Indicates the type of graphql operation, emitted by the Javascript SDK.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"getUserById",changelog:[{version:"0.3.1",prs:[190]}]},"sentry.group":{brief:"Stores the hash of `sentry.normalized_description`. This is primarily used for grouping spans in the product end.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",changelog:[{version:"0.4.0",prs:[212]}]},"sentry.http.prefetch":{brief:"If an http request was a prefetch request.",type:"boolean",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.0.0"}]},"sentry.idle_span_finish_reason":{brief:"The reason why an idle span ended early.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"idleTimeout",changelog:[{version:"0.0.0"}]},"sentry.is_remote":{brief:"Indicates whether a span's parent is remote.",type:"boolean",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.3.1",prs:[190]}]},"sentry.kind":{brief:"Used to clarify the relationship between parents and children, or to distinguish between spans, e.g. a `server` and `client` span with the same name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"server",aliases:["otel.kind"],changelog:[{version:"0.3.1",prs:[190]}]},"sentry.main_thread":{brief:"Whether the span or event occurred on the main thread. Computed by Relay and should not be set by SDKs.",type:"boolean",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.5.0"}]},"sentry.message.parameter.":{brief:"A parameter used in the message template. can either be the number that represent the parameter's position in the template string (sentry.message.parameter.0, sentry.message.parameter.1, etc) or the parameter's name (sentry.message.parameter.item_id, sentry.message.parameter.user_id, etc)",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"sentry.message.parameter.0='123'",changelog:[{version:"0.1.0",prs:[116]}]},"sentry.message.template":{brief:"The parameterized template string.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Hello, {name}!",changelog:[{version:"0.1.0",prs:[116]}]},"sentry.metric.source":{brief:"The provenance of a metric. For example, this can be set to indicate if a metric was generated by Relay from a span.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"span",changelog:[{version:"0.16.0",prs:[476],description:"Added sentry.metric.source attribute"}]},"sentry.mobile":{brief:"Whether the application is using a mobile SDK. Computed by Relay and should not be set by SDKs.",type:"boolean",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.5.0"}]},"sentry.module.":{brief:"A module that was loaded in the process. The key is the name of the module.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"sentry.module.brianium/paratest='v7.7.0'",changelog:[{version:"0.1.0",prs:[103]}]},"sentry.nextjs.ssr.function.route":{brief:"A parameterized route for a function in Next.js that contributes to Server-Side Rendering. Should be present on spans that track such functions when the file location of the function is known.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"/posts/[id]/layout",changelog:[{version:"0.1.0",prs:[54,106]}]},"sentry.nextjs.ssr.function.type":{brief:"A descriptor for a for a function in Next.js that contributes to Server-Side Rendering. Should be present on spans that track such functions.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"generateMetadata",changelog:[{version:"0.1.0",prs:[54,106]}]},"sentry.normalized_db_query":{brief:"The normalized version of `db.query.text`.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"SELECT .. FROM sentry_project WHERE (project_id = %s)",changelog:[{version:"0.3.1",prs:[194]}]},"sentry.normalized_db_query.hash":{brief:"The hash of `sentry.normalized_db_query`.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",changelog:[{version:"0.4.0",prs:[200]}]},"sentry.normalized_description":{brief:"Used as a generic attribute representing the normalized `sentry.description`. This refers to the legacy use case of `sentry.description` where it holds relevant data depending on the type of span (e.g. database query, resource url, http request description, etc).",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"SELECT .. FROM sentry_project WHERE (project_id = %s)",changelog:[{version:"0.4.0",prs:[212]}]},"sentry.observed_timestamp_nanos":{brief:"The timestamp at which an envelope was received by Relay, in nanoseconds.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"1544712660300000000",changelog:[{version:"0.3.0",prs:[174]},{version:"0.2.0",prs:[137]}]},"sentry.op":{brief:"The operation of a span.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"http.client",changelog:[{version:"0.0.0"}]},"sentry.origin":{brief:"The origin of the instrumentation (e.g. span, log, etc.)",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"auto.http.otel.fastify",changelog:[{version:"0.1.0",prs:[68]},{version:"0.0.0"}]},"sentry.platform":{brief:"The sdk platform that generated the event.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"php",changelog:[{version:"0.0.0"}]},"sentry.profiler_id":{brief:"The id of the currently running profiler (continuous profiling)",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"18779b64dd35d1a538e7ce2dd2d3fad3",changelog:[{version:"0.4.0",prs:[242]}]},"sentry.profile_id":{brief:"The ID of the Sentry profile the span is associated with. This is only meaningful for transaction-based profiling.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"123e4567e89b12d3a456426614174000",changelog:[{version:"0.6.0",prs:[344],description:"Added sentry.profile_id attribute"}]},"sentry.release":{brief:"The sentry release.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"7.0.0",aliases:["service.version","release"],changelog:[{version:"0.0.0"}]},"sentry.replay_id":{brief:"The id of the sentry replay.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"123e4567e89b12d3a456426614174000",aliases:["replay_id"],changelog:[{version:"0.0.0"}]},"sentry.replay_is_buffering":{brief:"A sentinel attribute on log events indicating whether the current Session Replay is being buffered (onErrorSampleRate).",type:"boolean",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.3.0",prs:[185]}]},"sentry.report_event":{brief:"(Deprecated) The event that caused the SDK to report CLS or LCP (pagehide or navigation)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"pagehide",deprecation:{reason:"The report event is now recorded as a browser.web_vital.lcp.report_event or browser.web_vital.cls.report_event attribute. No backfill required."},changelog:[{version:"0.5.0",prs:[320],description:"Added sentry.report_event attribute"}]},"sentry.sdk.integrations":{brief:"A list of names identifying enabled integrations. The list shouldhave all enabled integrations, including default integrations. Defaultintegrations are included because different SDK releases may contain differentdefault integrations.",type:"string[]",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:["InboundFilters","FunctionToString","BrowserApiErrors","Breadcrumbs"],changelog:[{version:"0.0.0",prs:[42]}]},"sentry.sdk.name":{brief:"The sentry sdk name.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"@sentry/react",changelog:[{version:"0.0.0"}]},"sentry.sdk.version":{brief:"The sentry sdk version.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"7.0.0",changelog:[{version:"0.0.0"}]},"sentry.segment.id":{brief:"The segment ID of a span",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"051581bf3cb55c13",aliases:["sentry.segment_id"],changelog:[{version:"0.1.0",prs:[107,124]}]},"sentry.segment_id":{brief:"The segment ID of a span",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"051581bf3cb55c13",deprecation:{replacement:"sentry.segment.id"},aliases:["sentry.segment.id"],changelog:[{version:"0.1.0",prs:[124]}]},"sentry.segment.name":{brief:"The segment name of a span",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"GET /user",aliases:["sentry.transaction","transaction"],changelog:[{version:"0.6.0",prs:[345],description:"Added sentry.transaction and transaction aliases"},{version:"0.1.0",prs:[104]}]},"sentry.server_sample_rate":{brief:"Rate at which a span was sampled in Relay.",type:"double",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:.5,changelog:[{version:"0.1.0",prs:[102]}]},"sentry.source":{brief:"The source of a span, also referred to as transaction source. Known values are: `'custom'`, `'url'`, `'route'`, `'component'`, `'view'`, `'task'`. '`source`' describes a parametrized route, while `'url'` describes the full URL, potentially containing identifiers.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"route",deprecation:{replacement:"sentry.span.source",reason:"This attribute is being deprecated in favor of sentry.span.source"},changelog:[{version:"0.5.0"}]},"sentry.span.source":{brief:"The source of a span, also referred to as transaction source. Known values are: `'custom'`, `'url'`, `'route'`, `'component'`, `'view'`, `'task'`. '`source`' describes a parametrized route, while `'url'` describes the full URL, potentially containing identifiers.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"route",changelog:[{version:"0.4.0",prs:[214]},{version:"0.0.0"}]},"sentry.status":{brief:`The span's status (either "ok" or "error"). Older SDKs may set this to a more specific error, but this behaviour is deprecated.`,type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"ok",changelog:[{version:"0.14.0",prs:[453]}]},"sentry.status_code":{brief:"The HTTP status code used in Sentry Insights. Typically set by Sentry during ingestion, rather than by clients.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:200,changelog:[{version:"0.4.0",prs:[223,228]}]},"sentry.status.message":{brief:"The from OTLP extracted status message.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"foobar",changelog:[{version:"0.3.1",prs:[190]}]},"sentry.sveltekit.navigation.from":{brief:"the navigation origin (sveltekit router)",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"/home",deprecation:{replacement:"navigation.origin",reason:"Use the more generic attribute instead"},aliases:["navigation.origin"],changelog:[{version:"0.16.0",prs:[467],description:"Added sentry.sveltekit.navigation.from attribute"}]},"sentry.sveltekit.navigation.to":{brief:"the navigation destination",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"/users/:id",deprecation:{reason:"the navigation destination is already covered by url.* attributes"},changelog:[{version:"0.16.0",prs:[467],description:"Added sentry.sveltekit.navigation.to attribute"}]},"sentry.sveltekit.navigation.type":{brief:"The type of navigation event emitted from the sveltekit client router",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"link",deprecation:{replacement:"navigation.type",reason:"Use the more generic attribute instead"},aliases:["navigation.type"],changelog:[{version:"0.16.0",prs:[467],description:"Added sentry.sveltekit.navigation.type attribute"}]},"sentry.thread.id":{brief:"Current \u201Cmanaged\u201D thread ID.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:56,deprecation:{replacement:"thread.id",reason:"This attribute is being deprecated in favor of the OTel-standard thread.id"},changelog:[{version:"0.13.0",prs:[451]}]},"sentry.timestamp.sequence":{brief:"A sequencing counter for deterministic ordering of logs or metrics when timestamps share the same integer millisecond. Starts at 0 on SDK initialization, increments by 1 for each captured item, and resets to 0 when the integer millisecond of the current item differs from the previous one.",type:"integer",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:0,changelog:[{version:"0.5.0",prs:[262]}]},"sentry.trace_lifecycle":{brief:"Indicates the chosen trace lifecycle mode of the SDK (stream or static)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"stream",changelog:[{version:"0.13.0",prs:[442],description:"Added sentry.trace_lifecycle attribute"}]},"sentry.trace.parent_span_id":{brief:"The span id of the span that was active when the log was collected. This should not be set if there was no active span.",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"b0e6f15b45c36b12",deprecation:{},changelog:[{version:"0.5.0",prs:[287],description:"Deprecate `sentry.trace.parent_span_id`"},{version:"0.1.0",prs:[116]}]},"sentry.trace.status":{brief:`The segment's status (either "ok" or "error"). Older SDKs may set this to a more specific error, but this behaviour is deprecated.`,type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"ok",changelog:[{version:"0.14.0",prs:[453]}]},"sentry.transaction":{brief:"The sentry transaction (segment name).",type:"string",applyScrubbing:{key:"never"},isInOtel:!1,visibility:"public",example:"GET /",deprecation:{replacement:"sentry.segment.name",reason:"This attribute is being deprecated in favor of sentry.segment.name"},aliases:["sentry.segment.name","transaction"],changelog:[{version:"0.6.0",prs:[345],description:"Deprecated sentry.transaction in favor of sentry.segment.name"},{version:"0.0.0"}]},"sentry.user.email":{brief:"User email address.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",deprecation:{replacement:"user.email"},aliases:["user.email"],changelog:[{version:"0.10.0",prs:[406]}]},"sentry.user.geo.city":{brief:"Human readable city name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",deprecation:{replacement:"user.geo.city"},aliases:["user.geo.city"],changelog:[{version:"0.10.0",prs:[406]}]},"sentry.user.geo.country_code":{brief:"Two-letter country code (ISO 3166-1 alpha-2).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",deprecation:{replacement:"user.geo.country_code"},aliases:["user.geo.country_code"],changelog:[{version:"0.10.0",prs:[406]}]},"sentry.user.geo.region":{brief:"Human readable region name or code.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",deprecation:{replacement:"user.geo.region"},aliases:["user.geo.region"],changelog:[{version:"0.10.0",prs:[406]}]},"sentry.user.geo.subdivision":{brief:"Human readable subdivision name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",deprecation:{replacement:"user.geo.subdivision"},aliases:["user.geo.subdivision"],changelog:[{version:"0.10.0",prs:[406]}]},"sentry.user.id":{brief:"Unique identifier of the user.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",deprecation:{replacement:"user.id"},aliases:["user.id"],changelog:[{version:"0.10.0",prs:[406]}]},"sentry.user.ip":{brief:"The IP address of the user.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",deprecation:{replacement:"user.ip_address"},aliases:["user.ip_address"],changelog:[{version:"0.10.0",prs:[406]}]},"sentry.user.username":{brief:"Short name or login/username of the user.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",deprecation:{replacement:"user.name"},aliases:["user.name"],changelog:[{version:"0.10.0",prs:[406]}]},"server.address":{brief:"Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"example.com",aliases:["http.server_name","net.host.name","http.host","server_name"],changelog:[{version:"0.1.0",prs:[108,127]},{version:"0.0.0"}]},server_name:{brief:"Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"example.com",deprecation:{replacement:"server.address",reason:"This attribute is being deprecated in favor of server.address, which is the OTel-aligned replacement."},aliases:["server.address","http.server_name","net.host.name","http.host"],changelog:[{version:"0.16.0",prs:[477],description:"Added server_name attribute, deprecated in favor of server.address"}]},"server.port":{brief:"Server port number.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:1337,aliases:["net.host.port"],changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"service.name":{brief:"Logical name of the service.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"omegastar",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"service.version":{brief:"The version string of the service API or implementation. The format is not defined by these conventions.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"5.0.0",aliases:["sentry.release"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"session.id":{brief:"A unique id identifying the active session at the time of setting this attribute",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"00112233-4455-6677-8899-aabbccddeeff",changelog:[{version:"0.11.0",prs:[412],description:"Added session.id attribute"}]},stall_percentage:{brief:"The fraction of time the app was stalled. Only applies to React Native. This is computed by Relay.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",changelog:[{version:"0.7.0",prs:[362],description:"Added stall_percentage attribute"}]},stall_total_time:{brief:"The combined duration of all stalls in milliseconds. Only applies to React Native. This is computed by Relay.",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",changelog:[{version:"0.7.0",prs:[362],description:"Added stall_total_time attribute"}]},"state.type":{brief:"The type of state management library",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"redux",changelog:[{version:"0.7.0",prs:[365],description:"Added state.type attribute"}]},"thread.id":{brief:"Current \u201Cmanaged\u201D thread ID.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:56,changelog:[{version:"0.0.0"}]},"thread.name":{brief:"Current thread name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"main",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"timber.tag":{brief:"The log tag provided by the timber logging framework.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"MyTag",changelog:[{version:"0.3.0",prs:[183]}]},time_to_full_display:{brief:"The duration of time to full display in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,deprecation:{replacement:"app.vitals.ttfd.value",reason:"Replaced by app.vitals.ttfd.value to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.ttfd.value"],changelog:[{version:"0.5.0",prs:[313],description:"Added and deprecated in favor of app.vitals.ttfd.value"}]},time_to_initial_display:{brief:"The duration of time to initial display in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1234.56,deprecation:{replacement:"app.vitals.ttid.value",reason:"Replaced by app.vitals.ttid.value to align with the app.vitals.* namespace for mobile performance attributes"},aliases:["app.vitals.ttid.value"],changelog:[{version:"0.5.0",prs:[313],description:"Added and deprecated in favor of app.vitals.ttid.value"}]},transaction:{brief:"The sentry transaction (segment name).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"GET /",deprecation:{replacement:"sentry.segment.name"},aliases:["sentry.segment.name","sentry.transaction"],changelog:[{version:"0.6.0",prs:[345],description:"Updated transaction deprecation replacement to sentry.segment.name"},{version:"0.1.0",prs:[61,127]},{version:"0.0.0"}]},"trpc.procedure_path":{brief:"The path of the tRPC procedure being called",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"user.getById",changelog:[{version:"0.7.0",prs:[370],description:"Added trpc.procedure_path attribute"}]},"trpc.procedure_type":{brief:"The type of the tRPC procedure",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"query",changelog:[{version:"0.7.0",prs:[370],description:"Added trpc.procedure_type attribute"}]},ttfb:{brief:"The value of the recorded Time To First Byte (TTFB) web vital in milliseconds",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:194,deprecation:{replacement:"browser.web_vital.ttfb.value",reason:"This attribute is being deprecated in favor of browser.web_vital.ttfb.value"},aliases:["browser.web_vital.ttfb.value"],changelog:[{version:"0.5.0",prs:[235]}]},"ttfb.requestTime":{brief:"The time it takes for the server to process the initial request and send the first byte of a response to the user's browser",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1554.5814,deprecation:{replacement:"browser.web_vital.ttfb.request_time",reason:"This attribute is being deprecated in favor of browser.web_vital.ttfb.request_time"},aliases:["browser.web_vital.ttfb.request_time"],changelog:[{version:"0.5.0",prs:[235]}]},type:{brief:"More granular type of the operation happening.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"fetch",changelog:[{version:"0.0.0"}]},"ui.component_name":{brief:"The name of the associated component.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"HomeButton",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"ui.contributes_to_ttfd":{brief:"Whether the span execution contributed to the TTFD (time to fully drawn) metric.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.0.0"}]},"ui.contributes_to_ttid":{brief:"Whether the span execution contributed to the TTID (time to initial display) metric.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,changelog:[{version:"0.0.0"}]},"ui.element.height":{brief:"The height of the UI element (for Html in pixels)",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:256,changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.height attribute"}]},"ui.element.id":{brief:"The id of the UI element",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"btn-login",changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.id attribute"}]},"ui.element.identifier":{brief:"The identifier used to measure the UI element timing",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"heroImage",changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.identifier attribute"}]},"ui.element.load_time":{brief:"The loading time of a UI element (from time origin to finished loading)",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:998.2234,changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.load_time attribute"}]},"ui.element.paint_type":{brief:"The type of element paint. Can either be 'image-paint' or 'text-paint'",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"image-paint",changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.paint_type attribute"}]},"ui.element.render_time":{brief:"The rendering time of the UI element (from time origin to finished rendering)",type:"double",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1023.1124,changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.render_time attribute"}]},"ui.element.type":{brief:"type of the UI element",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"img",changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.type attribute"}]},"ui.element.url":{brief:"The URL of the UI element (e.g. an img src)",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"https://assets.myapp.com/hero.png",changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.url attribute"}]},"ui.element.width":{brief:"The width of the UI element (for HTML in pixels)",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:512,changelog:[{version:"0.5.0",prs:[284],description:"Added ui.element.width attribute"}]},url:{brief:"The URL of the resource that was fetched.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"https://example.com/test?foo=bar#buzz",deprecation:{replacement:"url.full"},aliases:["url.full","http.url"],changelog:[{version:"0.1.0",prs:[61]},{version:"0.0.0"}]},"url.domain":{brief:"Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"example.com",changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"url.fragment":{brief:"The fragments present in the URI. Note that this does not contain the leading # character, while the `http.fragment` attribute does.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"details",changelog:[{version:"0.0.0"}]},"url.full":{brief:"The URL of the resource that was fetched.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"https://example.com/test?foo=bar#buzz",aliases:["http.url","url"],changelog:[{version:"0.1.0",prs:[108]},{version:"0.0.0"}]},"url.path":{brief:"The URI path component.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"/foo",changelog:[{version:"0.0.0"}]},"url.path.parameter.":{brief:"Decoded parameters extracted from a URL path. Usually added by client-side routing frameworks like vue-router.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",hasDynamicSuffix:!0,example:"url.path.parameter.id='123'",aliases:["params."],changelog:[{version:"0.1.0",prs:[103]}]},"url.port":{brief:"Server port number.",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:1337,changelog:[{version:"0.4.0",prs:[228]},{version:"0.0.0"}]},"url.query":{brief:"The query string present in the URL. Note that this does not contain the leading ? character, while the `http.query` attribute does.",type:"string",applyScrubbing:{key:"auto",reason:"Query string values can contain sensitive information. Clients should attempt to scrub parameters that might contain sensitive information."},isInOtel:!0,visibility:"public",example:"foo=bar&bar=baz",changelog:[{version:"0.0.0"}]},"url.same_origin":{brief:"Indicates that a URL has the same origin as the current page's origin in the browser.",type:"boolean",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:!0,deprecation:{replacement:"http.request.same_origin",reason:"This attribute is being deprecated in favor of http.request.same_origin."},aliases:["http.request.same_origin"],changelog:[{version:"0.16.0",prs:[456],description:"Added url.same_origin attribute, deprecated in favor of http.request.same_origin"}]},"url.scheme":{brief:"The URI scheme component identifying the used protocol.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"https",aliases:["http.scheme"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"url.template":{brief:"The low-cardinality template of an absolute path reference.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"/users/:id",aliases:["http.route"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"user_agent.original":{brief:"Value of the HTTP User-Agent header sent by the client.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!0,visibility:"public",example:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1",aliases:["http.user_agent"],changelog:[{version:"0.1.0",prs:[127]},{version:"0.0.0"}]},"user.email":{brief:"User email address.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"test@example.com",aliases:["sentry.user.email"],changelog:[{version:"0.0.0"}]},"user.full_name":{brief:"User's full name.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"John Smith",changelog:[{version:"0.0.0"}]},"user.geo.city":{brief:"Human readable city name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Toronto",aliases:["sentry.user.geo.city"],changelog:[{version:"0.0.0"}]},"user.geo.country_code":{brief:"Two-letter country code (ISO 3166-1 alpha-2).",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"CA",aliases:["sentry.user.geo.country_code"],changelog:[{version:"0.0.0"}]},"user.geo.region":{brief:"Human readable region name or code.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Canada",aliases:["sentry.user.geo.region"],changelog:[{version:"0.0.0"}]},"user.geo.subdivision":{brief:"Human readable subdivision name.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"Ontario",aliases:["sentry.user.geo.subdivision"],changelog:[{version:"0.0.0"}]},"user.hash":{brief:"Unique user hash to correlate information for a user in anonymized form.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"8ae4c2993e0f4f3b8b2d1b1f3b5e8f4d",changelog:[{version:"0.0.0"}]},"user.id":{brief:"Unique identifier of the user.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"S-1-5-21-202424912787-2692429404-2351956786-1000",aliases:["sentry.user.id"],changelog:[{version:"0.0.0"}]},"user.ip_address":{brief:"The IP address of the user.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"192.168.1.1",aliases:["sentry.user.ip"],changelog:[{version:"0.1.0",prs:[75]}]},"user.name":{brief:"Short name or login/username of the user.",type:"string",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:"j.smith",aliases:["sentry.user.username"],changelog:[{version:"0.0.0"}]},"user.roles":{brief:"Array of user roles at the time of the event.",type:"string[]",applyScrubbing:{key:"auto"},isInOtel:!0,visibility:"public",example:["admin","editor"],changelog:[{version:"0.0.0"}]},"vercel.branch":{brief:"Git branch name for Vercel project",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"main",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.build_id":{brief:"Identifier for the Vercel build (only present on build logs)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"bld_cotnkcr76",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.deployment_id":{brief:"Identifier for the Vercel deployment",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"dpl_233NRGRjVZX1caZrXWtz5g1TAksD",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.destination":{brief:"Origin of the external content in Vercel (only on external logs)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"https://vitals.vercel-insights.com/v1",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.edge_type":{brief:"Type of edge runtime in Vercel",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"edge-function",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.entrypoint":{brief:"Entrypoint for the request in Vercel",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"api/index.js",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.execution_region":{brief:"Region where the request is executed",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"sfo1",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.id":{brief:"Unique identifier for the log entry in Vercel",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"1573817187330377061717300000",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.ja3_digest":{brief:"JA3 fingerprint digest of Vercel request",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"769,47-53-5-10-49161-49162-49171-49172-50-56-19-4,0-10-11,23-24-25,0",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.ja4_digest":{brief:"JA4 fingerprint digest",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"t13d1516h2_8daaf6152771_02713d6af862",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.log_type":{brief:"Vercel log output type",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"stdout",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.path":{brief:"Function or dynamic path of the request in Vercel.",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"/dynamic/[route].json",changelog:[{version:"0.6.0",prs:[349],description:"Added vercel.path attribute"}]},"vercel.project_id":{brief:"Identifier for the Vercel project",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"gdufoJxB6b9b1fEqr1jUtFkyavUU",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.project_name":{brief:"Name of the Vercel project",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"my-app",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.cache_id":{brief:"Original request ID when request is served from cache",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"pdx1::v8g4b-1744143786684-93dafbc0f70d",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.client_ip":{brief:"Client IP address",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"120.75.16.101",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.host":{brief:"Hostname of the request",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"test.vercel.app",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.lambda_region":{brief:"Region where lambda function executed",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"sfo1",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.method":{brief:"HTTP method of the request",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"GET",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.path":{brief:"Request path with query parameters",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"/dynamic/some-value.json?route=some-value",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.path_type":{brief:"How the request was served based on its path and project configuration",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"func",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.path_type_variant":{brief:"Variant of the path type",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"api",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.referer":{brief:"Referer of the request",type:"string",applyScrubbing:{key:"auto"},isInOtel:!1,visibility:"public",example:"*.vercel.app",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.region":{brief:"Region where the request is processed",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"sfo1",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.response_byte_size":{brief:"Size of the response in bytes",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1024,changelog:[{version:"0.4.0",prs:[228]},{version:"0.2.0",prs:[163]}]},"vercel.proxy.scheme":{brief:"Protocol of the request",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"https",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.status_code":{brief:"HTTP status code of the proxy request",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:200,changelog:[{version:"0.4.0",prs:[228]},{version:"0.2.0",prs:[163]}]},"vercel.proxy.timestamp":{brief:"Unix timestamp when the proxy request was made",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:1573817250172,changelog:[{version:"0.4.0",prs:[228]},{version:"0.2.0",prs:[163]}]},"vercel.proxy.user_agent":{brief:"User agent strings of the request",type:"string[]",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:["Mozilla/5.0..."],changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.vercel_cache":{brief:"Cache status sent to the browser",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"REVALIDATED",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.vercel_id":{brief:"Vercel-specific identifier",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"sfo1::abc123",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.waf_action":{brief:"Action taken by firewall rules",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"deny",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.proxy.waf_rule_id":{brief:"ID of the firewall rule that matched",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"rule_gAHz8jtSB1Gy",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.request_id":{brief:"Identifier of the Vercel request",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"643af4e3-975a-4cc7-9e7a-1eda11539d90",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.source":{brief:"Origin of the Vercel log (build, edge, lambda, static, external, or firewall)",type:"string",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:"build",changelog:[{version:"0.2.0",prs:[163]}]},"vercel.status_code":{brief:"HTTP status code of the request (-1 means no response returned and the lambda crashed)",type:"integer",applyScrubbing:{key:"manual"},isInOtel:!1,visibility:"public",example:200,changelog:[{version:"0.4.0",prs:[228]},{version:"0.2.0",prs:[163]}]}};exports.AI_CITATIONS=AI_CITATIONS,exports.AI_COMPLETION_TOKENS_USED=AI_COMPLETION_TOKENS_USED,exports.AI_DOCUMENTS=AI_DOCUMENTS,exports.AI_FINISH_REASON=AI_FINISH_REASON,exports.AI_FREQUENCY_PENALTY=AI_FREQUENCY_PENALTY,exports.AI_FUNCTION_CALL=AI_FUNCTION_CALL,exports.AI_GENERATION_ID=AI_GENERATION_ID,exports.AI_INPUT_MESSAGES=AI_INPUT_MESSAGES,exports.AI_IS_SEARCH_REQUIRED=AI_IS_SEARCH_REQUIRED,exports.AI_METADATA=AI_METADATA,exports.AI_MODEL_ID=AI_MODEL_ID,exports.AI_MODEL_PROVIDER=AI_MODEL_PROVIDER,exports.AI_PIPELINE_NAME=AI_PIPELINE_NAME,exports.AI_PREAMBLE=AI_PREAMBLE,exports.AI_PRESENCE_PENALTY=AI_PRESENCE_PENALTY,exports.AI_PROMPT_TOKENS_USED=AI_PROMPT_TOKENS_USED,exports.AI_RAW_PROMPTING=AI_RAW_PROMPTING,exports.AI_RESPONSES=AI_RESPONSES,exports.AI_RESPONSE_FORMAT=AI_RESPONSE_FORMAT,exports.AI_SEARCH_QUERIES=AI_SEARCH_QUERIES,exports.AI_SEARCH_RESULTS=AI_SEARCH_RESULTS,exports.AI_SEED=AI_SEED,exports.AI_STREAMING=AI_STREAMING,exports.AI_TAGS=AI_TAGS,exports.AI_TEMPERATURE=AI_TEMPERATURE,exports.AI_TEXTS=AI_TEXTS,exports.AI_TOOLS=AI_TOOLS,exports.AI_TOOL_CALLS=AI_TOOL_CALLS,exports.AI_TOP_K=AI_TOP_K,exports.AI_TOP_P=AI_TOP_P,exports.AI_TOTAL_COST=AI_TOTAL_COST,exports.AI_TOTAL_TOKENS_USED=AI_TOTAL_TOKENS_USED,exports.AI_WARNINGS=AI_WARNINGS,exports.ANGULAR_VERSION=ANGULAR_VERSION,exports.APP_APP_BUILD=APP_APP_BUILD,exports.APP_APP_IDENTIFIER=APP_APP_IDENTIFIER,exports.APP_APP_NAME=APP_APP_NAME,exports.APP_APP_START_TIME=APP_APP_START_TIME,exports.APP_APP_VERSION=APP_APP_VERSION,exports.APP_BUILD=APP_BUILD,exports.APP_IDENTIFIER=APP_IDENTIFIER,exports.APP_IN_FOREGROUND=APP_IN_FOREGROUND,exports.APP_NAME=APP_NAME,exports.APP_START_COLD=APP_START_COLD,exports.APP_START_TIME=APP_START_TIME,exports.APP_START_TYPE=APP_START_TYPE,exports.APP_START_WARM=APP_START_WARM,exports.APP_VERSION=APP_VERSION,exports.APP_VITALS_FRAMES_DELAY_VALUE=APP_VITALS_FRAMES_DELAY_VALUE,exports.APP_VITALS_FRAMES_FROZEN_COUNT=APP_VITALS_FRAMES_FROZEN_COUNT,exports.APP_VITALS_FRAMES_SLOW_COUNT=APP_VITALS_FRAMES_SLOW_COUNT,exports.APP_VITALS_FRAMES_TOTAL_COUNT=APP_VITALS_FRAMES_TOTAL_COUNT,exports.APP_VITALS_START_COLD_VALUE=APP_VITALS_START_COLD_VALUE,exports.APP_VITALS_START_PREWARMED=APP_VITALS_START_PREWARMED,exports.APP_VITALS_START_REASON=APP_VITALS_START_REASON,exports.APP_VITALS_START_SCREEN=APP_VITALS_START_SCREEN,exports.APP_VITALS_START_TYPE=APP_VITALS_START_TYPE,exports.APP_VITALS_START_WARM_VALUE=APP_VITALS_START_WARM_VALUE,exports.APP_VITALS_TTFD_VALUE=APP_VITALS_TTFD_VALUE,exports.APP_VITALS_TTID_VALUE=APP_VITALS_TTID_VALUE,exports.ART_GC_BLOCKING_COUNT=ART_GC_BLOCKING_COUNT,exports.ART_GC_BLOCKING_TIME=ART_GC_BLOCKING_TIME,exports.ART_GC_PRE_OOME_COUNT=ART_GC_PRE_OOME_COUNT,exports.ART_GC_TOTAL_COUNT=ART_GC_TOTAL_COUNT,exports.ART_GC_TOTAL_TIME=ART_GC_TOTAL_TIME,exports.ART_GC_WAITING_TIME=ART_GC_WAITING_TIME,exports.ART_MEMORY_FREE=ART_MEMORY_FREE,exports.ART_MEMORY_FREE_UNTIL_GC=ART_MEMORY_FREE_UNTIL_GC,exports.ART_MEMORY_FREE_UNTIL_OOME=ART_MEMORY_FREE_UNTIL_OOME,exports.ART_MEMORY_MAX=ART_MEMORY_MAX,exports.ART_MEMORY_TOTAL=ART_MEMORY_TOTAL,exports.ATTRIBUTE_METADATA=ATTRIBUTE_METADATA,exports.ATTRIBUTE_TYPE=ATTRIBUTE_TYPE,exports.AWS_CLOUDWATCH_LOGS_LOG_GROUP=AWS_CLOUDWATCH_LOGS_LOG_GROUP,exports.AWS_CLOUDWATCH_LOGS_LOG_STREAM=AWS_CLOUDWATCH_LOGS_LOG_STREAM,exports.AWS_CLOUDWATCH_LOGS_URL=AWS_CLOUDWATCH_LOGS_URL,exports.AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS,exports.AWS_DYNAMODB_CONSISTENT_READ=AWS_DYNAMODB_CONSISTENT_READ,exports.AWS_DYNAMODB_CONSUMED_CAPACITY=AWS_DYNAMODB_CONSUMED_CAPACITY,exports.AWS_DYNAMODB_COUNT=AWS_DYNAMODB_COUNT,exports.AWS_DYNAMODB_EXCLUSIVE_START_TABLE=AWS_DYNAMODB_EXCLUSIVE_START_TABLE,exports.AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES,exports.AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES,exports.AWS_DYNAMODB_INDEX_NAME=AWS_DYNAMODB_INDEX_NAME,exports.AWS_DYNAMODB_ITEM_COLLECTION_METRICS=AWS_DYNAMODB_ITEM_COLLECTION_METRICS,exports.AWS_DYNAMODB_LIMIT=AWS_DYNAMODB_LIMIT,exports.AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES,exports.AWS_DYNAMODB_PROJECTION=AWS_DYNAMODB_PROJECTION,exports.AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=AWS_DYNAMODB_PROVISIONED_READ_CAPACITY,exports.AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY,exports.AWS_DYNAMODB_SCANNED_COUNT=AWS_DYNAMODB_SCANNED_COUNT,exports.AWS_DYNAMODB_SCAN_FORWARD=AWS_DYNAMODB_SCAN_FORWARD,exports.AWS_DYNAMODB_SEGMENT=AWS_DYNAMODB_SEGMENT,exports.AWS_DYNAMODB_SELECT=AWS_DYNAMODB_SELECT,exports.AWS_DYNAMODB_TABLE_COUNT=AWS_DYNAMODB_TABLE_COUNT,exports.AWS_DYNAMODB_TABLE_NAMES=AWS_DYNAMODB_TABLE_NAMES,exports.AWS_DYNAMODB_TOTAL_SEGMENTS=AWS_DYNAMODB_TOTAL_SEGMENTS,exports.AWS_EXTENDED_REQUEST_ID=AWS_EXTENDED_REQUEST_ID,exports.AWS_KINESIS_STREAM_NAME=AWS_KINESIS_STREAM_NAME,exports.AWS_LAMBDA_AWS_REQUEST_ID=AWS_LAMBDA_AWS_REQUEST_ID,exports.AWS_LAMBDA_EXECUTION_DURATION_IN_MILLIS=AWS_LAMBDA_EXECUTION_DURATION_IN_MILLIS,exports.AWS_LAMBDA_FUNCTION_NAME=AWS_LAMBDA_FUNCTION_NAME,exports.AWS_LAMBDA_FUNCTION_VERSION=AWS_LAMBDA_FUNCTION_VERSION,exports.AWS_LAMBDA_INVOKED_ARN=AWS_LAMBDA_INVOKED_ARN,exports.AWS_LAMBDA_INVOKED_FUNCTION_ARN=AWS_LAMBDA_INVOKED_FUNCTION_ARN,exports.AWS_LAMBDA_REMAINING_TIME_IN_MILLIS=AWS_LAMBDA_REMAINING_TIME_IN_MILLIS,exports.AWS_LOG_GROUP_NAMES=AWS_LOG_GROUP_NAMES,exports.AWS_LOG_STREAM_NAMES=AWS_LOG_STREAM_NAMES,exports.AWS_REQUEST_EXTENDED_ID=AWS_REQUEST_EXTENDED_ID,exports.AWS_REQUEST_ID=AWS_REQUEST_ID,exports.AWS_S3_BUCKET=AWS_S3_BUCKET,exports.AWS_SECRETSMANAGER_SECRET_ARN=AWS_SECRETSMANAGER_SECRET_ARN,exports.AWS_SNS_TOPIC_ARN=AWS_SNS_TOPIC_ARN,exports.AWS_STEP_FUNCTIONS_ACTIVITY_ARN=AWS_STEP_FUNCTIONS_ACTIVITY_ARN,exports.AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN=AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN,exports.BLOCKED_MAIN_THREAD=BLOCKED_MAIN_THREAD,exports.BROWSER_NAME=BROWSER_NAME,exports.BROWSER_PERFORMANCE_NAVIGATION_ACTIVATION_START=BROWSER_PERFORMANCE_NAVIGATION_ACTIVATION_START,exports.BROWSER_PERFORMANCE_TIME_ORIGIN=BROWSER_PERFORMANCE_TIME_ORIGIN,exports.BROWSER_REPORT_TYPE=BROWSER_REPORT_TYPE,exports.BROWSER_SCRIPT_INVOKER=BROWSER_SCRIPT_INVOKER,exports.BROWSER_SCRIPT_INVOKER_TYPE=BROWSER_SCRIPT_INVOKER_TYPE,exports.BROWSER_SCRIPT_SOURCE_CHAR_POSITION=BROWSER_SCRIPT_SOURCE_CHAR_POSITION,exports.BROWSER_VERSION=BROWSER_VERSION,exports.BROWSER_WEB_VITAL_CLS_REPORT_EVENT=BROWSER_WEB_VITAL_CLS_REPORT_EVENT,exports.BROWSER_WEB_VITAL_CLS_SOURCE_KEY=BROWSER_WEB_VITAL_CLS_SOURCE_KEY,exports.BROWSER_WEB_VITAL_CLS_SOURCE_KEY_BASE=BROWSER_WEB_VITAL_CLS_SOURCE_KEY_BASE,exports.BROWSER_WEB_VITAL_CLS_VALUE=BROWSER_WEB_VITAL_CLS_VALUE,exports.BROWSER_WEB_VITAL_FCP_VALUE=BROWSER_WEB_VITAL_FCP_VALUE,exports.BROWSER_WEB_VITAL_FP_VALUE=BROWSER_WEB_VITAL_FP_VALUE,exports.BROWSER_WEB_VITAL_INP_VALUE=BROWSER_WEB_VITAL_INP_VALUE,exports.BROWSER_WEB_VITAL_LCP_ELEMENT=BROWSER_WEB_VITAL_LCP_ELEMENT,exports.BROWSER_WEB_VITAL_LCP_ID=BROWSER_WEB_VITAL_LCP_ID,exports.BROWSER_WEB_VITAL_LCP_LOAD_TIME=BROWSER_WEB_VITAL_LCP_LOAD_TIME,exports.BROWSER_WEB_VITAL_LCP_RENDER_TIME=BROWSER_WEB_VITAL_LCP_RENDER_TIME,exports.BROWSER_WEB_VITAL_LCP_REPORT_EVENT=BROWSER_WEB_VITAL_LCP_REPORT_EVENT,exports.BROWSER_WEB_VITAL_LCP_SIZE=BROWSER_WEB_VITAL_LCP_SIZE,exports.BROWSER_WEB_VITAL_LCP_URL=BROWSER_WEB_VITAL_LCP_URL,exports.BROWSER_WEB_VITAL_LCP_VALUE=BROWSER_WEB_VITAL_LCP_VALUE,exports.BROWSER_WEB_VITAL_TTFB_REQUEST_TIME=BROWSER_WEB_VITAL_TTFB_REQUEST_TIME,exports.BROWSER_WEB_VITAL_TTFB_VALUE=BROWSER_WEB_VITAL_TTFB_VALUE,exports.CACHE_HIT=CACHE_HIT,exports.CACHE_ITEM_SIZE=CACHE_ITEM_SIZE,exports.CACHE_KEY=CACHE_KEY,exports.CACHE_OPERATION=CACHE_OPERATION,exports.CACHE_TTL=CACHE_TTL,exports.CACHE_WRITE=CACHE_WRITE,exports.CHANNEL=CHANNEL,exports.CLIENT_ADDRESS=CLIENT_ADDRESS,exports.CLIENT_PORT=CLIENT_PORT,exports.CLOUDFLARE_D1_DURATION=CLOUDFLARE_D1_DURATION,exports.CLOUDFLARE_D1_QUERY_TYPE=CLOUDFLARE_D1_QUERY_TYPE,exports.CLOUDFLARE_D1_ROWS_READ=CLOUDFLARE_D1_ROWS_READ,exports.CLOUDFLARE_D1_ROWS_WRITTEN=CLOUDFLARE_D1_ROWS_WRITTEN,exports.CLOUDFLARE_DURABLE_OBJECT_QUERY_BINDINGS=CLOUDFLARE_DURABLE_OBJECT_QUERY_BINDINGS,exports.CLOUDFLARE_DURABLE_OBJECT_RESPONSE_ROWS_READ=CLOUDFLARE_DURABLE_OBJECT_RESPONSE_ROWS_READ,exports.CLOUDFLARE_DURABLE_OBJECT_RESPONSE_ROWS_WRITTEN=CLOUDFLARE_DURABLE_OBJECT_RESPONSE_ROWS_WRITTEN,exports.CLOUDFLARE_R2_BUCKET=CLOUDFLARE_R2_BUCKET,exports.CLOUDFLARE_R2_OPERATION=CLOUDFLARE_R2_OPERATION,exports.CLOUDFLARE_R2_REQUEST_DELIMITER=CLOUDFLARE_R2_REQUEST_DELIMITER,exports.CLOUDFLARE_R2_REQUEST_KEY=CLOUDFLARE_R2_REQUEST_KEY,exports.CLOUDFLARE_R2_REQUEST_PART_NUMBER=CLOUDFLARE_R2_REQUEST_PART_NUMBER,exports.CLOUDFLARE_R2_REQUEST_PREFIX=CLOUDFLARE_R2_REQUEST_PREFIX,exports.CLOUDFLARE_WORKFLOW_ATTEMPT=CLOUDFLARE_WORKFLOW_ATTEMPT,exports.CLOUDFLARE_WORKFLOW_RETRIES_BACKOFF=CLOUDFLARE_WORKFLOW_RETRIES_BACKOFF,exports.CLOUDFLARE_WORKFLOW_RETRIES_DELAY=CLOUDFLARE_WORKFLOW_RETRIES_DELAY,exports.CLOUDFLARE_WORKFLOW_RETRIES_LIMIT=CLOUDFLARE_WORKFLOW_RETRIES_LIMIT,exports.CLOUDFLARE_WORKFLOW_TIMEOUT=CLOUDFLARE_WORKFLOW_TIMEOUT,exports.CLOUD_ACCOUNT_ID=CLOUD_ACCOUNT_ID,exports.CLOUD_AVAILABILITY_ZONE=CLOUD_AVAILABILITY_ZONE,exports.CLOUD_PLATFORM=CLOUD_PLATFORM,exports.CLOUD_PROVIDER=CLOUD_PROVIDER,exports.CLOUD_REGION=CLOUD_REGION,exports.CLOUD_RESOURCE_ID=CLOUD_RESOURCE_ID,exports.CLS="cls",exports.CLS_SOURCE_KEY=CLS_SOURCE_KEY,exports.CLS_SOURCE_KEY_BASE=CLS_SOURCE_KEY_BASE,exports.CODE_FILEPATH=CODE_FILEPATH,exports.CODE_FILE_PATH=CODE_FILE_PATH,exports.CODE_FUNCTION=CODE_FUNCTION,exports.CODE_FUNCTION_NAME=CODE_FUNCTION_NAME,exports.CODE_LINENO=CODE_LINENO,exports.CODE_LINE_NUMBER=CODE_LINE_NUMBER,exports.CODE_NAMESPACE=CODE_NAMESPACE,exports.CONNECTIONTYPE=CONNECTIONTYPE,exports.CONNECTION_RTT=CONNECTION_RTT,exports.CULTURE_CALENDAR=CULTURE_CALENDAR,exports.CULTURE_DISPLAY_NAME=CULTURE_DISPLAY_NAME,exports.CULTURE_IS_24_HOUR_FORMAT=CULTURE_IS_24_HOUR_FORMAT,exports.CULTURE_LOCALE=CULTURE_LOCALE,exports.CULTURE_TIMEZONE=CULTURE_TIMEZONE,exports.DB_COLLECTION_NAME=DB_COLLECTION_NAME,exports.DB_DRIVER_NAME=DB_DRIVER_NAME,exports.DB_NAME=DB_NAME,exports.DB_NAMESPACE=DB_NAMESPACE,exports.DB_OPERATION=DB_OPERATION,exports.DB_OPERATION_BATCH_SIZE=DB_OPERATION_BATCH_SIZE,exports.DB_OPERATION_NAME=DB_OPERATION_NAME,exports.DB_QUERY_PARAMETER_KEY=DB_QUERY_PARAMETER_KEY,exports.DB_QUERY_PARAMETER_KEY_BASE=DB_QUERY_PARAMETER_KEY_BASE,exports.DB_QUERY_SUMMARY=DB_QUERY_SUMMARY,exports.DB_QUERY_TEXT=DB_QUERY_TEXT,exports.DB_REDIS_CONNECTION=DB_REDIS_CONNECTION,exports.DB_REDIS_KEY=DB_REDIS_KEY,exports.DB_REDIS_PARAMETERS=DB_REDIS_PARAMETERS,exports.DB_RESPONSE_STATUS_CODE=DB_RESPONSE_STATUS_CODE,exports.DB_SQL_BINDINGS=DB_SQL_BINDINGS,exports.DB_STATEMENT=DB_STATEMENT,exports.DB_STORED_PROCEDURE_NAME=DB_STORED_PROCEDURE_NAME,exports.DB_SYSTEM=DB_SYSTEM,exports.DB_SYSTEM_NAME=DB_SYSTEM_NAME,exports.DB_USER=DB_USER,exports.DEVICEMEMORY=DEVICEMEMORY,exports.DEVICE_ARCHS=DEVICE_ARCHS,exports.DEVICE_BATTERY_LEVEL=DEVICE_BATTERY_LEVEL,exports.DEVICE_BATTERY_TEMPERATURE=DEVICE_BATTERY_TEMPERATURE,exports.DEVICE_BOOT_TIME=DEVICE_BOOT_TIME,exports.DEVICE_BRAND=DEVICE_BRAND,exports.DEVICE_CHARGING=DEVICE_CHARGING,exports.DEVICE_CHIPSET=DEVICE_CHIPSET,exports.DEVICE_CLASS=DEVICE_CLASS,exports.DEVICE_CONNECTION_TYPE=DEVICE_CONNECTION_TYPE,exports.DEVICE_CPU_DESCRIPTION=DEVICE_CPU_DESCRIPTION,exports.DEVICE_EXTERNAL_FREE_STORAGE=DEVICE_EXTERNAL_FREE_STORAGE,exports.DEVICE_EXTERNAL_STORAGE_SIZE=DEVICE_EXTERNAL_STORAGE_SIZE,exports.DEVICE_FAMILY=DEVICE_FAMILY,exports.DEVICE_FREE_MEMORY=DEVICE_FREE_MEMORY,exports.DEVICE_FREE_STORAGE=DEVICE_FREE_STORAGE,exports.DEVICE_ID=DEVICE_ID,exports.DEVICE_LOCALE=DEVICE_LOCALE,exports.DEVICE_LOW_MEMORY=DEVICE_LOW_MEMORY,exports.DEVICE_LOW_POWER_MODE=DEVICE_LOW_POWER_MODE,exports.DEVICE_MANUFACTURER=DEVICE_MANUFACTURER,exports.DEVICE_MEMORY_ESTIMATED_CAPACITY=DEVICE_MEMORY_ESTIMATED_CAPACITY,exports.DEVICE_MEMORY_SIZE=DEVICE_MEMORY_SIZE,exports.DEVICE_MODEL=DEVICE_MODEL,exports.DEVICE_MODEL_ID=DEVICE_MODEL_ID,exports.DEVICE_NAME=DEVICE_NAME,exports.DEVICE_ONLINE=DEVICE_ONLINE,exports.DEVICE_ORIENTATION=DEVICE_ORIENTATION,exports.DEVICE_PROCESSOR_COUNT=DEVICE_PROCESSOR_COUNT,exports.DEVICE_PROCESSOR_FREQUENCY=DEVICE_PROCESSOR_FREQUENCY,exports.DEVICE_SCREEN_DENSITY=DEVICE_SCREEN_DENSITY,exports.DEVICE_SCREEN_DPI=DEVICE_SCREEN_DPI,exports.DEVICE_SCREEN_HEIGHT_PIXELS=DEVICE_SCREEN_HEIGHT_PIXELS,exports.DEVICE_SCREEN_WIDTH_PIXELS=DEVICE_SCREEN_WIDTH_PIXELS,exports.DEVICE_SIMULATOR=DEVICE_SIMULATOR,exports.DEVICE_STORAGE_SIZE=DEVICE_STORAGE_SIZE,exports.DEVICE_THERMAL_STATE=DEVICE_THERMAL_STATE,exports.DEVICE_TIMEZONE=DEVICE_TIMEZONE,exports.DEVICE_USABLE_MEMORY=DEVICE_USABLE_MEMORY,exports.DIST=DIST,exports.EFFECTIVECONNECTIONTYPE=EFFECTIVECONNECTIONTYPE,exports.ENVIRONMENT=ENVIRONMENT,exports.ERROR_TYPE=ERROR_TYPE,exports.EVENT_ID=EVENT_ID,exports.EVENT_NAME=EVENT_NAME,exports.EXCEPTION_ESCAPED=EXCEPTION_ESCAPED,exports.EXCEPTION_MESSAGE=EXCEPTION_MESSAGE,exports.EXCEPTION_STACKTRACE=EXCEPTION_STACKTRACE,exports.EXCEPTION_TYPE=EXCEPTION_TYPE,exports.FAAS_COLDSTART=FAAS_COLDSTART,exports.FAAS_CRON=FAAS_CRON,exports.FAAS_DURATION_IN_MS=FAAS_DURATION_IN_MS,exports.FAAS_ENTRY_POINT=FAAS_ENTRY_POINT,exports.FAAS_EXECUTION=FAAS_EXECUTION,exports.FAAS_ID=FAAS_ID,exports.FAAS_IDENTITY=FAAS_IDENTITY,exports.FAAS_INVOCATION_ID=FAAS_INVOCATION_ID,exports.FAAS_INVOKED_NAME=FAAS_INVOKED_NAME,exports.FAAS_INVOKED_PROVIDER=FAAS_INVOKED_PROVIDER,exports.FAAS_INVOKED_REGION=FAAS_INVOKED_REGION,exports.FAAS_NAME=FAAS_NAME,exports.FAAS_TIME=FAAS_TIME,exports.FAAS_TRIGGER=FAAS_TRIGGER,exports.FAAS_VERSION=FAAS_VERSION,exports.FCP="fcp",exports.FLAG_EVALUATION_KEY=FLAG_EVALUATION_KEY,exports.FLAG_EVALUATION_KEY_BASE=FLAG_EVALUATION_KEY_BASE,exports.FP="fp",exports.FRAMES_DELAY=FRAMES_DELAY,exports.FRAMES_FROZEN=FRAMES_FROZEN,exports.FRAMES_FROZEN_RATE=FRAMES_FROZEN_RATE,exports.FRAMES_SLOW=FRAMES_SLOW,exports.FRAMES_SLOW_RATE=FRAMES_SLOW_RATE,exports.FRAMES_TOTAL=FRAMES_TOTAL,exports.FS_ERROR=FS_ERROR,exports.GCP_FUNCTION_CONTEXT_EVENT_ID=GCP_FUNCTION_CONTEXT_EVENT_ID,exports.GCP_FUNCTION_CONTEXT_EVENT_TYPE=GCP_FUNCTION_CONTEXT_EVENT_TYPE,exports.GCP_FUNCTION_CONTEXT_ID=GCP_FUNCTION_CONTEXT_ID,exports.GCP_FUNCTION_CONTEXT_RESOURCE=GCP_FUNCTION_CONTEXT_RESOURCE,exports.GCP_FUNCTION_CONTEXT_SOURCE=GCP_FUNCTION_CONTEXT_SOURCE,exports.GCP_FUNCTION_CONTEXT_SPECVERSION=GCP_FUNCTION_CONTEXT_SPECVERSION,exports.GCP_FUNCTION_CONTEXT_TIME=GCP_FUNCTION_CONTEXT_TIME,exports.GCP_FUNCTION_CONTEXT_TIMESTAMP=GCP_FUNCTION_CONTEXT_TIMESTAMP,exports.GCP_FUNCTION_CONTEXT_TYPE=GCP_FUNCTION_CONTEXT_TYPE,exports.GCP_PROJECT_ID=GCP_PROJECT_ID,exports.GEN_AI_AGENT_NAME=GEN_AI_AGENT_NAME,exports.GEN_AI_CONTEXT_UTILIZATION=GEN_AI_CONTEXT_UTILIZATION,exports.GEN_AI_CONTEXT_WINDOW_SIZE=GEN_AI_CONTEXT_WINDOW_SIZE,exports.GEN_AI_CONVERSATION_ID=GEN_AI_CONVERSATION_ID,exports.GEN_AI_COST_CACHE_CREATION_INPUT_TOKENS=GEN_AI_COST_CACHE_CREATION_INPUT_TOKENS,exports.GEN_AI_COST_CACHE_READ_INPUT_TOKENS=GEN_AI_COST_CACHE_READ_INPUT_TOKENS,exports.GEN_AI_COST_INPUT_TOKENS=GEN_AI_COST_INPUT_TOKENS,exports.GEN_AI_COST_OUTPUT_TOKENS=GEN_AI_COST_OUTPUT_TOKENS,exports.GEN_AI_COST_REASONING_OUTPUT_TOKENS=GEN_AI_COST_REASONING_OUTPUT_TOKENS,exports.GEN_AI_COST_TOTAL_TOKENS=GEN_AI_COST_TOTAL_TOKENS,exports.GEN_AI_EMBEDDINGS_INPUT=GEN_AI_EMBEDDINGS_INPUT,exports.GEN_AI_FUNCTION_ID=GEN_AI_FUNCTION_ID,exports.GEN_AI_INPUT_MESSAGES=GEN_AI_INPUT_MESSAGES,exports.GEN_AI_OPERATION_NAME=GEN_AI_OPERATION_NAME,exports.GEN_AI_OPERATION_TYPE=GEN_AI_OPERATION_TYPE,exports.GEN_AI_OUTPUT_MESSAGES=GEN_AI_OUTPUT_MESSAGES,exports.GEN_AI_PIPELINE_NAME=GEN_AI_PIPELINE_NAME,exports.GEN_AI_PROMPT=GEN_AI_PROMPT,exports.GEN_AI_PROMPT_NAME=GEN_AI_PROMPT_NAME,exports.GEN_AI_PROVIDER_NAME=GEN_AI_PROVIDER_NAME,exports.GEN_AI_REQUEST_AVAILABLE_TOOLS=GEN_AI_REQUEST_AVAILABLE_TOOLS,exports.GEN_AI_REQUEST_FREQUENCY_PENALTY=GEN_AI_REQUEST_FREQUENCY_PENALTY,exports.GEN_AI_REQUEST_MAX_TOKENS=GEN_AI_REQUEST_MAX_TOKENS,exports.GEN_AI_REQUEST_MESSAGES=GEN_AI_REQUEST_MESSAGES,exports.GEN_AI_REQUEST_MODEL=GEN_AI_REQUEST_MODEL,exports.GEN_AI_REQUEST_PRESENCE_PENALTY=GEN_AI_REQUEST_PRESENCE_PENALTY,exports.GEN_AI_REQUEST_REASONING_EFFORT=GEN_AI_REQUEST_REASONING_EFFORT,exports.GEN_AI_REQUEST_SEED=GEN_AI_REQUEST_SEED,exports.GEN_AI_REQUEST_STOP_SEQUENCES=GEN_AI_REQUEST_STOP_SEQUENCES,exports.GEN_AI_REQUEST_TEMPERATURE=GEN_AI_REQUEST_TEMPERATURE,exports.GEN_AI_REQUEST_TOP_K=GEN_AI_REQUEST_TOP_K,exports.GEN_AI_REQUEST_TOP_P=GEN_AI_REQUEST_TOP_P,exports.GEN_AI_RESPONSE_FINISH_REASONS=GEN_AI_RESPONSE_FINISH_REASONS,exports.GEN_AI_RESPONSE_ID=GEN_AI_RESPONSE_ID,exports.GEN_AI_RESPONSE_MODEL=GEN_AI_RESPONSE_MODEL,exports.GEN_AI_RESPONSE_STREAMING=GEN_AI_RESPONSE_STREAMING,exports.GEN_AI_RESPONSE_TEXT=GEN_AI_RESPONSE_TEXT,exports.GEN_AI_RESPONSE_TIME_TO_FIRST_CHUNK=GEN_AI_RESPONSE_TIME_TO_FIRST_CHUNK,exports.GEN_AI_RESPONSE_TIME_TO_FIRST_TOKEN=GEN_AI_RESPONSE_TIME_TO_FIRST_TOKEN,exports.GEN_AI_RESPONSE_TOKENS_PER_SECOND=GEN_AI_RESPONSE_TOKENS_PER_SECOND,exports.GEN_AI_RESPONSE_TOOL_CALLS=GEN_AI_RESPONSE_TOOL_CALLS,exports.GEN_AI_SYSTEM=GEN_AI_SYSTEM,exports.GEN_AI_SYSTEM_INSTRUCTIONS=GEN_AI_SYSTEM_INSTRUCTIONS,exports.GEN_AI_SYSTEM_MESSAGE=GEN_AI_SYSTEM_MESSAGE,exports.GEN_AI_TOOL_CALL_ARGUMENTS=GEN_AI_TOOL_CALL_ARGUMENTS,exports.GEN_AI_TOOL_CALL_RESULT=GEN_AI_TOOL_CALL_RESULT,exports.GEN_AI_TOOL_DEFINITIONS=GEN_AI_TOOL_DEFINITIONS,exports.GEN_AI_TOOL_DESCRIPTION=GEN_AI_TOOL_DESCRIPTION,exports.GEN_AI_TOOL_INPUT=GEN_AI_TOOL_INPUT,exports.GEN_AI_TOOL_MESSAGE=GEN_AI_TOOL_MESSAGE,exports.GEN_AI_TOOL_NAME=GEN_AI_TOOL_NAME,exports.GEN_AI_TOOL_OUTPUT=GEN_AI_TOOL_OUTPUT,exports.GEN_AI_TOOL_TYPE=GEN_AI_TOOL_TYPE,exports.GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS=GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS,exports.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS=GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS,exports.GEN_AI_USAGE_COMPLETION_TOKENS=GEN_AI_USAGE_COMPLETION_TOKENS,exports.GEN_AI_USAGE_INPUT_TOKENS=GEN_AI_USAGE_INPUT_TOKENS,exports.GEN_AI_USAGE_INPUT_TOKENS_CACHED=GEN_AI_USAGE_INPUT_TOKENS_CACHED,exports.GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE=GEN_AI_USAGE_INPUT_TOKENS_CACHE_WRITE,exports.GEN_AI_USAGE_OUTPUT_TOKENS=GEN_AI_USAGE_OUTPUT_TOKENS,exports.GEN_AI_USAGE_OUTPUT_TOKENS_REASONING=GEN_AI_USAGE_OUTPUT_TOKENS_REASONING,exports.GEN_AI_USAGE_PROMPT_TOKENS=GEN_AI_USAGE_PROMPT_TOKENS,exports.GEN_AI_USAGE_REASONING_OUTPUT_TOKENS=GEN_AI_USAGE_REASONING_OUTPUT_TOKENS,exports.GEN_AI_USAGE_TOTAL_TOKENS=GEN_AI_USAGE_TOTAL_TOKENS,exports.GRAPHQL_DOCUMENT=GRAPHQL_DOCUMENT,exports.GRAPHQL_OPERATION_NAME=GRAPHQL_OPERATION_NAME,exports.GRAPHQL_OPERATION_TYPE=GRAPHQL_OPERATION_TYPE,exports.HARDWARECONCURRENCY=HARDWARECONCURRENCY,exports.HTTP_CLIENT_IP=HTTP_CLIENT_IP,exports.HTTP_DECODED_RESPONSE_CONTENT_LENGTH=HTTP_DECODED_RESPONSE_CONTENT_LENGTH,exports.HTTP_FLAVOR=HTTP_FLAVOR,exports.HTTP_FRAGMENT=HTTP_FRAGMENT,exports.HTTP_HOST=HTTP_HOST,exports.HTTP_METHOD=HTTP_METHOD,exports.HTTP_QUERY=HTTP_QUERY,exports.HTTP_REQUEST_BODY_DATA=HTTP_REQUEST_BODY_DATA,exports.HTTP_REQUEST_CONNECTION_END=HTTP_REQUEST_CONNECTION_END,exports.HTTP_REQUEST_CONNECT_START=HTTP_REQUEST_CONNECT_START,exports.HTTP_REQUEST_DOMAIN_LOOKUP_END=HTTP_REQUEST_DOMAIN_LOOKUP_END,exports.HTTP_REQUEST_DOMAIN_LOOKUP_START=HTTP_REQUEST_DOMAIN_LOOKUP_START,exports.HTTP_REQUEST_FETCH_START=HTTP_REQUEST_FETCH_START,exports.HTTP_REQUEST_HEADER_KEY=HTTP_REQUEST_HEADER_KEY,exports.HTTP_REQUEST_HEADER_KEY_BASE=HTTP_REQUEST_HEADER_KEY_BASE,exports.HTTP_REQUEST_METHOD=HTTP_REQUEST_METHOD,exports.HTTP_REQUEST_REDIRECT_END=HTTP_REQUEST_REDIRECT_END,exports.HTTP_REQUEST_REDIRECT_START=HTTP_REQUEST_REDIRECT_START,exports.HTTP_REQUEST_REQUEST_START=HTTP_REQUEST_REQUEST_START,exports.HTTP_REQUEST_RESEND_COUNT=HTTP_REQUEST_RESEND_COUNT,exports.HTTP_REQUEST_RESPONSE_END=HTTP_REQUEST_RESPONSE_END,exports.HTTP_REQUEST_RESPONSE_START=HTTP_REQUEST_RESPONSE_START,exports.HTTP_REQUEST_SAME_ORIGIN=HTTP_REQUEST_SAME_ORIGIN,exports.HTTP_REQUEST_SECURE_CONNECTION_START=HTTP_REQUEST_SECURE_CONNECTION_START,exports.HTTP_REQUEST_TIME_TO_FIRST_BYTE=HTTP_REQUEST_TIME_TO_FIRST_BYTE,exports.HTTP_REQUEST_WORKER_START=HTTP_REQUEST_WORKER_START,exports.HTTP_RESPONSE_BODY_SIZE=HTTP_RESPONSE_BODY_SIZE,exports.HTTP_RESPONSE_CONTENT_LENGTH=HTTP_RESPONSE_CONTENT_LENGTH,exports.HTTP_RESPONSE_HEADER_CONTENT_LENGTH=HTTP_RESPONSE_HEADER_CONTENT_LENGTH,exports.HTTP_RESPONSE_HEADER_KEY=HTTP_RESPONSE_HEADER_KEY,exports.HTTP_RESPONSE_HEADER_KEY_BASE=HTTP_RESPONSE_HEADER_KEY_BASE,exports.HTTP_RESPONSE_SIZE=HTTP_RESPONSE_SIZE,exports.HTTP_RESPONSE_STATUS_CODE=HTTP_RESPONSE_STATUS_CODE,exports.HTTP_RESPONSE_TRANSFER_SIZE=HTTP_RESPONSE_TRANSFER_SIZE,exports.HTTP_ROUTE=HTTP_ROUTE,exports.HTTP_SCHEME=HTTP_SCHEME,exports.HTTP_SERVER_NAME=HTTP_SERVER_NAME,exports.HTTP_SERVER_REQUEST_TIME_IN_QUEUE=HTTP_SERVER_REQUEST_TIME_IN_QUEUE,exports.HTTP_STATUS_CODE=HTTP_STATUS_CODE,exports.HTTP_TARGET=HTTP_TARGET,exports.HTTP_URL=HTTP_URL,exports.HTTP_USER_AGENT=HTTP_USER_AGENT,exports.ID="id",exports.INP="inp",exports.JSONRPC_PROTOCOL_VERSION=JSONRPC_PROTOCOL_VERSION,exports.JSONRPC_REQUEST_ID=JSONRPC_REQUEST_ID,exports.JVM_GC_ACTION=JVM_GC_ACTION,exports.JVM_GC_NAME=JVM_GC_NAME,exports.JVM_MEMORY_POOL_NAME=JVM_MEMORY_POOL_NAME,exports.JVM_MEMORY_TYPE=JVM_MEMORY_TYPE,exports.JVM_THREAD_DAEMON=JVM_THREAD_DAEMON,exports.JVM_THREAD_STATE=JVM_THREAD_STATE,exports.KOA_NAME=KOA_NAME,exports.KOA_TYPE=KOA_TYPE,exports.LCP="lcp",exports.LCP_ELEMENT=LCP_ELEMENT,exports.LCP_ID=LCP_ID,exports.LCP_LOADTIME=LCP_LOADTIME,exports.LCP_RENDERTIME=LCP_RENDERTIME,exports.LCP_SIZE=LCP_SIZE,exports.LCP_URL=LCP_URL,exports.LOGGER_NAME=LOGGER_NAME,exports.MCP_CANCELLED_REASON=MCP_CANCELLED_REASON,exports.MCP_CANCELLED_REQUEST_ID=MCP_CANCELLED_REQUEST_ID,exports.MCP_CLIENT_NAME=MCP_CLIENT_NAME,exports.MCP_CLIENT_TITLE=MCP_CLIENT_TITLE,exports.MCP_CLIENT_VERSION=MCP_CLIENT_VERSION,exports.MCP_LIFECYCLE_PHASE=MCP_LIFECYCLE_PHASE,exports.MCP_LOGGING_DATA_TYPE=MCP_LOGGING_DATA_TYPE,exports.MCP_LOGGING_LEVEL=MCP_LOGGING_LEVEL,exports.MCP_LOGGING_LOGGER=MCP_LOGGING_LOGGER,exports.MCP_LOGGING_MESSAGE=MCP_LOGGING_MESSAGE,exports.MCP_METHOD_NAME=MCP_METHOD_NAME,exports.MCP_PROGRESS_CURRENT=MCP_PROGRESS_CURRENT,exports.MCP_PROGRESS_MESSAGE=MCP_PROGRESS_MESSAGE,exports.MCP_PROGRESS_PERCENTAGE=MCP_PROGRESS_PERCENTAGE,exports.MCP_PROGRESS_TOKEN=MCP_PROGRESS_TOKEN,exports.MCP_PROGRESS_TOTAL=MCP_PROGRESS_TOTAL,exports.MCP_PROMPT_NAME=MCP_PROMPT_NAME,exports.MCP_PROMPT_RESULT_DESCRIPTION=MCP_PROMPT_RESULT_DESCRIPTION,exports.MCP_PROMPT_RESULT_MESSAGE_CONTENT=MCP_PROMPT_RESULT_MESSAGE_CONTENT,exports.MCP_PROMPT_RESULT_MESSAGE_COUNT=MCP_PROMPT_RESULT_MESSAGE_COUNT,exports.MCP_PROMPT_RESULT_MESSAGE_ROLE=MCP_PROMPT_RESULT_MESSAGE_ROLE,exports.MCP_PROTOCOL_READY=MCP_PROTOCOL_READY,exports.MCP_PROTOCOL_VERSION=MCP_PROTOCOL_VERSION,exports.MCP_REQUEST_ARGUMENT_KEY=MCP_REQUEST_ARGUMENT_KEY,exports.MCP_REQUEST_ARGUMENT_KEY_BASE=MCP_REQUEST_ARGUMENT_KEY_BASE,exports.MCP_REQUEST_ARGUMENT_NAME=MCP_REQUEST_ARGUMENT_NAME,exports.MCP_REQUEST_ARGUMENT_URI=MCP_REQUEST_ARGUMENT_URI,exports.MCP_REQUEST_ID=MCP_REQUEST_ID,exports.MCP_RESOURCE_PROTOCOL=MCP_RESOURCE_PROTOCOL,exports.MCP_RESOURCE_URI=MCP_RESOURCE_URI,exports.MCP_SERVER_NAME=MCP_SERVER_NAME,exports.MCP_SERVER_TITLE=MCP_SERVER_TITLE,exports.MCP_SERVER_VERSION=MCP_SERVER_VERSION,exports.MCP_SESSION_ID=MCP_SESSION_ID,exports.MCP_TOOL_NAME=MCP_TOOL_NAME,exports.MCP_TOOL_RESULT_CONTENT=MCP_TOOL_RESULT_CONTENT,exports.MCP_TOOL_RESULT_CONTENT_COUNT=MCP_TOOL_RESULT_CONTENT_COUNT,exports.MCP_TOOL_RESULT_IS_ERROR=MCP_TOOL_RESULT_IS_ERROR,exports.MCP_TRANSPORT=MCP_TRANSPORT,exports.MDC_KEY=MDC_KEY,exports.MDC_KEY_BASE="mdc",exports.MESSAGING_BATCH_MESSAGE_COUNT=MESSAGING_BATCH_MESSAGE_COUNT,exports.MESSAGING_DESTINATION=MESSAGING_DESTINATION,exports.MESSAGING_DESTINATION_CONNECTION=MESSAGING_DESTINATION_CONNECTION,exports.MESSAGING_DESTINATION_NAME=MESSAGING_DESTINATION_NAME,exports.MESSAGING_MESSAGE_BODY_SIZE=MESSAGING_MESSAGE_BODY_SIZE,exports.MESSAGING_MESSAGE_CONVERSATION_ID=MESSAGING_MESSAGE_CONVERSATION_ID,exports.MESSAGING_MESSAGE_ENVELOPE_SIZE=MESSAGING_MESSAGE_ENVELOPE_SIZE,exports.MESSAGING_MESSAGE_ID=MESSAGING_MESSAGE_ID,exports.MESSAGING_MESSAGE_RECEIVE_LATENCY=MESSAGING_MESSAGE_RECEIVE_LATENCY,exports.MESSAGING_MESSAGE_RETRY_COUNT=MESSAGING_MESSAGE_RETRY_COUNT,exports.MESSAGING_OPERATION_NAME=MESSAGING_OPERATION_NAME,exports.MESSAGING_OPERATION_TYPE=MESSAGING_OPERATION_TYPE,exports.MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY=MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY,exports.MESSAGING_SYSTEM=MESSAGING_SYSTEM,exports.METHOD=METHOD,exports.MIDDLEWARE_NAME=MIDDLEWARE_NAME,exports.NAVIGATION_ORIGIN=NAVIGATION_ORIGIN,exports.NAVIGATION_ROUTE_ID=NAVIGATION_ROUTE_ID,exports.NAVIGATION_TYPE=NAVIGATION_TYPE,exports.NEL_ELAPSED_TIME=NEL_ELAPSED_TIME,exports.NEL_PHASE=NEL_PHASE,exports.NEL_REFERRER=NEL_REFERRER,exports.NEL_SAMPLING_FUNCTION=NEL_SAMPLING_FUNCTION,exports.NEL_TYPE=NEL_TYPE,exports.NETWORK_CONNECTION_EFFECTIVE_TYPE=NETWORK_CONNECTION_EFFECTIVE_TYPE,exports.NETWORK_CONNECTION_RTT=NETWORK_CONNECTION_RTT,exports.NETWORK_CONNECTION_TYPE=NETWORK_CONNECTION_TYPE,exports.NETWORK_LOCAL_ADDRESS=NETWORK_LOCAL_ADDRESS,exports.NETWORK_LOCAL_PORT=NETWORK_LOCAL_PORT,exports.NETWORK_PEER_ADDRESS=NETWORK_PEER_ADDRESS,exports.NETWORK_PEER_PORT=NETWORK_PEER_PORT,exports.NETWORK_PROTOCOL_NAME=NETWORK_PROTOCOL_NAME,exports.NETWORK_PROTOCOL_VERSION=NETWORK_PROTOCOL_VERSION,exports.NETWORK_TRANSPORT=NETWORK_TRANSPORT,exports.NETWORK_TYPE=NETWORK_TYPE,exports.NET_HOST_IP=NET_HOST_IP,exports.NET_HOST_NAME=NET_HOST_NAME,exports.NET_HOST_PORT=NET_HOST_PORT,exports.NET_PEER_IP=NET_PEER_IP,exports.NET_PEER_NAME=NET_PEER_NAME,exports.NET_PEER_PORT=NET_PEER_PORT,exports.NET_PROTOCOL_NAME=NET_PROTOCOL_NAME,exports.NET_PROTOCOL_VERSION=NET_PROTOCOL_VERSION,exports.NET_SOCK_FAMILY=NET_SOCK_FAMILY,exports.NET_SOCK_HOST_ADDR=NET_SOCK_HOST_ADDR,exports.NET_SOCK_HOST_PORT=NET_SOCK_HOST_PORT,exports.NET_SOCK_PEER_ADDR=NET_SOCK_PEER_ADDR,exports.NET_SOCK_PEER_NAME=NET_SOCK_PEER_NAME,exports.NET_SOCK_PEER_PORT=NET_SOCK_PEER_PORT,exports.NET_TRANSPORT=NET_TRANSPORT,exports.OS_BUILD=OS_BUILD,exports.OS_BUILD_ID=OS_BUILD_ID,exports.OS_DESCRIPTION=OS_DESCRIPTION,exports.OS_KERNEL_VERSION=OS_KERNEL_VERSION,exports.OS_NAME=OS_NAME,exports.OS_RAW_DESCRIPTION=OS_RAW_DESCRIPTION,exports.OS_ROOTED=OS_ROOTED,exports.OS_THEME=OS_THEME,exports.OS_TYPE=OS_TYPE,exports.OS_VERSION=OS_VERSION,exports.OTEL_KIND=OTEL_KIND,exports.OTEL_SCOPE_NAME=OTEL_SCOPE_NAME,exports.OTEL_SCOPE_VERSION=OTEL_SCOPE_VERSION,exports.OTEL_STATUS_CODE=OTEL_STATUS_CODE,exports.OTEL_STATUS_DESCRIPTION=OTEL_STATUS_DESCRIPTION,exports.PARAMS_KEY=PARAMS_KEY,exports.PARAMS_KEY_BASE=PARAMS_KEY_BASE,exports.PERFORMANCE_ACTIVATIONSTART=PERFORMANCE_ACTIVATIONSTART,exports.PERFORMANCE_TIMEORIGIN=PERFORMANCE_TIMEORIGIN,exports.PREVIOUS_ROUTE=PREVIOUS_ROUTE,exports.PROCESS_COMMAND_ARGS=PROCESS_COMMAND_ARGS,exports.PROCESS_EXECUTABLE_NAME=PROCESS_EXECUTABLE_NAME,exports.PROCESS_PID=PROCESS_PID,exports.PROCESS_RUNTIME_DESCRIPTION=PROCESS_RUNTIME_DESCRIPTION,exports.PROCESS_RUNTIME_ENGINE_NAME=PROCESS_RUNTIME_ENGINE_NAME,exports.PROCESS_RUNTIME_ENGINE_VERSION=PROCESS_RUNTIME_ENGINE_VERSION,exports.PROCESS_RUNTIME_NAME=PROCESS_RUNTIME_NAME,exports.PROCESS_RUNTIME_VERSION=PROCESS_RUNTIME_VERSION,exports.QUERY_KEY=QUERY_KEY,exports.QUERY_KEY_BASE=QUERY_KEY_BASE,exports.REACT_VERSION=REACT_VERSION,exports.RELEASE=RELEASE,exports.REMIX_ACTION_FORM_DATA_KEY=REMIX_ACTION_FORM_DATA_KEY,exports.REMIX_ACTION_FORM_DATA_KEY_BASE=REMIX_ACTION_FORM_DATA_KEY_BASE,exports.REPLAY_ID=REPLAY_ID,exports.RESOURCE_DEPLOYMENT_ENVIRONMENT=RESOURCE_DEPLOYMENT_ENVIRONMENT,exports.RESOURCE_DEPLOYMENT_ENVIRONMENT_NAME=RESOURCE_DEPLOYMENT_ENVIRONMENT_NAME,exports.RESOURCE_RENDER_BLOCKING_STATUS=RESOURCE_RENDER_BLOCKING_STATUS,exports.ROUTE=ROUTE,exports.RPC_GRPC_STATUS_CODE=RPC_GRPC_STATUS_CODE,exports.RPC_METHOD=RPC_METHOD,exports.RPC_RESPONSE_STATUS_CODE=RPC_RESPONSE_STATUS_CODE,exports.RPC_SERVICE=RPC_SERVICE,exports.RPC_SYSTEM=RPC_SYSTEM,exports.RPC_SYSTEM_NAME=RPC_SYSTEM_NAME,exports.RUNTIME_BUILD=RUNTIME_BUILD,exports.RUNTIME_NAME=RUNTIME_NAME,exports.RUNTIME_RAW_DESCRIPTION=RUNTIME_RAW_DESCRIPTION,exports.RUNTIME_VERSION=RUNTIME_VERSION,exports.SCORE_KEY=SCORE_KEY,exports.SCORE_KEY_BASE=SCORE_KEY_BASE,exports.SCORE_RATIO_KEY=SCORE_RATIO_KEY,exports.SCORE_RATIO_KEY_BASE=SCORE_RATIO_KEY_BASE,exports.SCORE_TOTAL=SCORE_TOTAL,exports.SCORE_WEIGHT_KEY=SCORE_WEIGHT_KEY,exports.SCORE_WEIGHT_KEY_BASE=SCORE_WEIGHT_KEY_BASE,exports.SENTRY_ACTION=SENTRY_ACTION,exports.SENTRY_BROWSER_NAME=SENTRY_BROWSER_NAME,exports.SENTRY_BROWSER_VERSION=SENTRY_BROWSER_VERSION,exports.SENTRY_CANCELLATION_REASON=SENTRY_CANCELLATION_REASON,exports.SENTRY_CATEGORY=SENTRY_CATEGORY,exports.SENTRY_CLIENT_SAMPLE_RATE=SENTRY_CLIENT_SAMPLE_RATE,exports.SENTRY_DESCRIPTION=SENTRY_DESCRIPTION,exports.SENTRY_DIST=SENTRY_DIST,exports.SENTRY_DOMAIN=SENTRY_DOMAIN,exports.SENTRY_DSC_ENVIRONMENT=SENTRY_DSC_ENVIRONMENT,exports.SENTRY_DSC_PROJECT_ID=SENTRY_DSC_PROJECT_ID,exports.SENTRY_DSC_PUBLIC_KEY=SENTRY_DSC_PUBLIC_KEY,exports.SENTRY_DSC_RELEASE=SENTRY_DSC_RELEASE,exports.SENTRY_DSC_SAMPLED=SENTRY_DSC_SAMPLED,exports.SENTRY_DSC_SAMPLE_RATE=SENTRY_DSC_SAMPLE_RATE,exports.SENTRY_DSC_TRACE_ID=SENTRY_DSC_TRACE_ID,exports.SENTRY_DSC_TRANSACTION=SENTRY_DSC_TRANSACTION,exports.SENTRY_ENVIRONMENT=SENTRY_ENVIRONMENT,exports.SENTRY_EXCLUSIVE_TIME=SENTRY_EXCLUSIVE_TIME,exports.SENTRY_GRAPHQL_OPERATION=SENTRY_GRAPHQL_OPERATION,exports.SENTRY_GROUP=SENTRY_GROUP,exports.SENTRY_HTTP_PREFETCH=SENTRY_HTTP_PREFETCH,exports.SENTRY_IDLE_SPAN_FINISH_REASON=SENTRY_IDLE_SPAN_FINISH_REASON,exports.SENTRY_IS_REMOTE=SENTRY_IS_REMOTE,exports.SENTRY_KIND=SENTRY_KIND,exports.SENTRY_MAIN_THREAD=SENTRY_MAIN_THREAD,exports.SENTRY_MESSAGE_PARAMETER_KEY=SENTRY_MESSAGE_PARAMETER_KEY,exports.SENTRY_MESSAGE_TEMPLATE=SENTRY_MESSAGE_TEMPLATE,exports.SENTRY_METRIC_SOURCE=SENTRY_METRIC_SOURCE,exports.SENTRY_MOBILE=SENTRY_MOBILE,exports.SENTRY_MODULE_KEY=SENTRY_MODULE_KEY,exports.SENTRY_MODULE_KEY_BASE=SENTRY_MODULE_KEY_BASE,exports.SENTRY_NEXTJS_SSR_FUNCTION_ROUTE=SENTRY_NEXTJS_SSR_FUNCTION_ROUTE,exports.SENTRY_NEXTJS_SSR_FUNCTION_TYPE=SENTRY_NEXTJS_SSR_FUNCTION_TYPE,exports.SENTRY_NORMALIZED_DB_QUERY=SENTRY_NORMALIZED_DB_QUERY,exports.SENTRY_NORMALIZED_DB_QUERY_HASH=SENTRY_NORMALIZED_DB_QUERY_HASH,exports.SENTRY_NORMALIZED_DESCRIPTION=SENTRY_NORMALIZED_DESCRIPTION,exports.SENTRY_OBSERVED_TIMESTAMP_NANOS=SENTRY_OBSERVED_TIMESTAMP_NANOS,exports.SENTRY_OP=SENTRY_OP,exports.SENTRY_ORIGIN=SENTRY_ORIGIN,exports.SENTRY_PLATFORM=SENTRY_PLATFORM,exports.SENTRY_PROFILER_ID=SENTRY_PROFILER_ID,exports.SENTRY_PROFILE_ID=SENTRY_PROFILE_ID,exports.SENTRY_RELEASE=SENTRY_RELEASE,exports.SENTRY_REPLAY_ID=SENTRY_REPLAY_ID,exports.SENTRY_REPLAY_IS_BUFFERING=SENTRY_REPLAY_IS_BUFFERING,exports.SENTRY_REPORT_EVENT=SENTRY_REPORT_EVENT,exports.SENTRY_SDK_INTEGRATIONS=SENTRY_SDK_INTEGRATIONS,exports.SENTRY_SDK_NAME=SENTRY_SDK_NAME,exports.SENTRY_SDK_VERSION=SENTRY_SDK_VERSION,exports.SENTRY_SEGMENT_ID=SENTRY_SEGMENT_ID,exports.SENTRY_SEGMENT_NAME=SENTRY_SEGMENT_NAME,exports.SENTRY_SERVER_SAMPLE_RATE=SENTRY_SERVER_SAMPLE_RATE,exports.SENTRY_SOURCE=SENTRY_SOURCE,exports.SENTRY_SPAN_SOURCE=SENTRY_SPAN_SOURCE,exports.SENTRY_STATUS=SENTRY_STATUS,exports.SENTRY_STATUS_CODE=SENTRY_STATUS_CODE,exports.SENTRY_STATUS_MESSAGE=SENTRY_STATUS_MESSAGE,exports.SENTRY_SVELTEKIT_NAVIGATION_FROM=SENTRY_SVELTEKIT_NAVIGATION_FROM,exports.SENTRY_SVELTEKIT_NAVIGATION_TO=SENTRY_SVELTEKIT_NAVIGATION_TO,exports.SENTRY_SVELTEKIT_NAVIGATION_TYPE=SENTRY_SVELTEKIT_NAVIGATION_TYPE,exports.SENTRY_THREAD_ID=SENTRY_THREAD_ID,exports.SENTRY_TIMESTAMP_SEQUENCE=SENTRY_TIMESTAMP_SEQUENCE,exports.SENTRY_TRACE_LIFECYCLE=SENTRY_TRACE_LIFECYCLE,exports.SENTRY_TRACE_PARENT_SPAN_ID=SENTRY_TRACE_PARENT_SPAN_ID,exports.SENTRY_TRACE_STATUS=SENTRY_TRACE_STATUS,exports.SENTRY_TRANSACTION=SENTRY_TRANSACTION,exports.SENTRY_USER_EMAIL=SENTRY_USER_EMAIL,exports.SENTRY_USER_GEO_CITY=SENTRY_USER_GEO_CITY,exports.SENTRY_USER_GEO_COUNTRY_CODE=SENTRY_USER_GEO_COUNTRY_CODE,exports.SENTRY_USER_GEO_REGION=SENTRY_USER_GEO_REGION,exports.SENTRY_USER_GEO_SUBDIVISION=SENTRY_USER_GEO_SUBDIVISION,exports.SENTRY_USER_ID=SENTRY_USER_ID,exports.SENTRY_USER_IP=SENTRY_USER_IP,exports.SENTRY_USER_USERNAME=SENTRY_USER_USERNAME,exports.SERVER_ADDRESS=SERVER_ADDRESS,exports.SERVER_NAME=SERVER_NAME,exports.SERVER_PORT=SERVER_PORT,exports.SERVICE_NAME=SERVICE_NAME,exports.SERVICE_VERSION=SERVICE_VERSION,exports.SESSION_ID=SESSION_ID,exports.STALL_PERCENTAGE=STALL_PERCENTAGE,exports.STALL_TOTAL_TIME=STALL_TOTAL_TIME,exports.STATE_TYPE=STATE_TYPE,exports.THREAD_ID=THREAD_ID,exports.THREAD_NAME=THREAD_NAME,exports.TIMBER_TAG=TIMBER_TAG,exports.TIME_TO_FULL_DISPLAY=TIME_TO_FULL_DISPLAY,exports.TIME_TO_INITIAL_DISPLAY=TIME_TO_INITIAL_DISPLAY,exports.TRANSACTION=TRANSACTION,exports.TRPC_PROCEDURE_PATH=TRPC_PROCEDURE_PATH,exports.TRPC_PROCEDURE_TYPE=TRPC_PROCEDURE_TYPE,exports.TTFB=TTFB,exports.TTFB_REQUESTTIME=TTFB_REQUESTTIME,exports.TYPE=TYPE,exports.UI_COMPONENT_NAME=UI_COMPONENT_NAME,exports.UI_CONTRIBUTES_TO_TTFD=UI_CONTRIBUTES_TO_TTFD,exports.UI_CONTRIBUTES_TO_TTID=UI_CONTRIBUTES_TO_TTID,exports.UI_ELEMENT_HEIGHT=UI_ELEMENT_HEIGHT,exports.UI_ELEMENT_ID=UI_ELEMENT_ID,exports.UI_ELEMENT_IDENTIFIER=UI_ELEMENT_IDENTIFIER,exports.UI_ELEMENT_LOAD_TIME=UI_ELEMENT_LOAD_TIME,exports.UI_ELEMENT_PAINT_TYPE=UI_ELEMENT_PAINT_TYPE,exports.UI_ELEMENT_RENDER_TIME=UI_ELEMENT_RENDER_TIME,exports.UI_ELEMENT_TYPE=UI_ELEMENT_TYPE,exports.UI_ELEMENT_URL=UI_ELEMENT_URL,exports.UI_ELEMENT_WIDTH=UI_ELEMENT_WIDTH,exports.URL="url",exports.URL_DOMAIN=URL_DOMAIN,exports.URL_FRAGMENT=URL_FRAGMENT,exports.URL_FULL=URL_FULL,exports.URL_PATH=URL_PATH,exports.URL_PATH_PARAMETER_KEY=URL_PATH_PARAMETER_KEY,exports.URL_PATH_PARAMETER_KEY_BASE=URL_PATH_PARAMETER_KEY_BASE,exports.URL_PORT=URL_PORT,exports.URL_QUERY=URL_QUERY,exports.URL_SAME_ORIGIN=URL_SAME_ORIGIN,exports.URL_SCHEME=URL_SCHEME,exports.URL_TEMPLATE=URL_TEMPLATE,exports.USER_AGENT_ORIGINAL=USER_AGENT_ORIGINAL,exports.USER_EMAIL=USER_EMAIL,exports.USER_FULL_NAME=USER_FULL_NAME,exports.USER_GEO_CITY=USER_GEO_CITY,exports.USER_GEO_COUNTRY_CODE=USER_GEO_COUNTRY_CODE,exports.USER_GEO_REGION=USER_GEO_REGION,exports.USER_GEO_SUBDIVISION=USER_GEO_SUBDIVISION,exports.USER_HASH=USER_HASH,exports.USER_ID=USER_ID,exports.USER_IP_ADDRESS=USER_IP_ADDRESS,exports.USER_NAME=USER_NAME,exports.USER_ROLES=USER_ROLES,exports.VERCEL_BRANCH=VERCEL_BRANCH,exports.VERCEL_BUILD_ID=VERCEL_BUILD_ID,exports.VERCEL_DEPLOYMENT_ID=VERCEL_DEPLOYMENT_ID,exports.VERCEL_DESTINATION=VERCEL_DESTINATION,exports.VERCEL_EDGE_TYPE=VERCEL_EDGE_TYPE,exports.VERCEL_ENTRYPOINT=VERCEL_ENTRYPOINT,exports.VERCEL_EXECUTION_REGION=VERCEL_EXECUTION_REGION,exports.VERCEL_ID=VERCEL_ID,exports.VERCEL_JA3_DIGEST=VERCEL_JA3_DIGEST,exports.VERCEL_JA4_DIGEST=VERCEL_JA4_DIGEST,exports.VERCEL_LOG_TYPE=VERCEL_LOG_TYPE,exports.VERCEL_PATH=VERCEL_PATH,exports.VERCEL_PROJECT_ID=VERCEL_PROJECT_ID,exports.VERCEL_PROJECT_NAME=VERCEL_PROJECT_NAME,exports.VERCEL_PROXY_CACHE_ID=VERCEL_PROXY_CACHE_ID,exports.VERCEL_PROXY_CLIENT_IP=VERCEL_PROXY_CLIENT_IP,exports.VERCEL_PROXY_HOST=VERCEL_PROXY_HOST,exports.VERCEL_PROXY_LAMBDA_REGION=VERCEL_PROXY_LAMBDA_REGION,exports.VERCEL_PROXY_METHOD=VERCEL_PROXY_METHOD,exports.VERCEL_PROXY_PATH=VERCEL_PROXY_PATH,exports.VERCEL_PROXY_PATH_TYPE=VERCEL_PROXY_PATH_TYPE,exports.VERCEL_PROXY_PATH_TYPE_VARIANT=VERCEL_PROXY_PATH_TYPE_VARIANT,exports.VERCEL_PROXY_REFERER=VERCEL_PROXY_REFERER,exports.VERCEL_PROXY_REGION=VERCEL_PROXY_REGION,exports.VERCEL_PROXY_RESPONSE_BYTE_SIZE=VERCEL_PROXY_RESPONSE_BYTE_SIZE,exports.VERCEL_PROXY_SCHEME=VERCEL_PROXY_SCHEME,exports.VERCEL_PROXY_STATUS_CODE=VERCEL_PROXY_STATUS_CODE,exports.VERCEL_PROXY_TIMESTAMP=VERCEL_PROXY_TIMESTAMP,exports.VERCEL_PROXY_USER_AGENT=VERCEL_PROXY_USER_AGENT,exports.VERCEL_PROXY_VERCEL_CACHE=VERCEL_PROXY_VERCEL_CACHE,exports.VERCEL_PROXY_VERCEL_ID=VERCEL_PROXY_VERCEL_ID,exports.VERCEL_PROXY_WAF_ACTION=VERCEL_PROXY_WAF_ACTION,exports.VERCEL_PROXY_WAF_RULE_ID=VERCEL_PROXY_WAF_RULE_ID,exports.VERCEL_REQUEST_ID=VERCEL_REQUEST_ID,exports.VERCEL_SOURCE=VERCEL_SOURCE,exports.VERCEL_STATUS_CODE=VERCEL_STATUS_CODE,exports._AWS_KINESIS_STREAM_NAME=_AWS_KINESIS_STREAM_NAME,exports._AWS_REQUEST_ID=_AWS_REQUEST_ID,exports._HTTP_REQUEST_METHOD=_HTTP_REQUEST_METHOD,exports._SENTRY_SEGMENT_ID=_SENTRY_SEGMENT_ID; +//# sourceMappingURL=attributes.cjs.map + /***/ }), -/***/ 74476: -/***/ ((module) => { +/***/ 83678: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -module.exports = JSON.parse('{"assert":true,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16","async_hooks":">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],"buffer_ieee754":">= 0.5 && < 0.9.7","buffer":true,"node:buffer":[">= 14.18 && < 15",">= 16"],"child_process":true,"node:child_process":[">= 14.18 && < 15",">= 16"],"cluster":">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],"console":true,"node:console":[">= 14.18 && < 15",">= 16"],"constants":true,"node:constants":[">= 14.18 && < 15",">= 16"],"crypto":true,"node:crypto":[">= 14.18 && < 15",">= 16"],"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"node:dgram":[">= 14.18 && < 15",">= 16"],"diagnostics_channel":[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],"dns":true,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16","domain":">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],"events":true,"node:events":[">= 14.18 && < 15",">= 16"],"freelist":"< 6","fs":true,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],"_http_agent":">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],"_http_client":">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],"_http_common":">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],"_http_incoming":">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],"_http_outgoing":">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],"_http_server":">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],"http":true,"node:http":[">= 14.18 && < 15",">= 16"],"http2":">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],"https":true,"node:https":[">= 14.18 && < 15",">= 16"],"inspector":">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],"_linklist":"< 8","module":true,"node:module":[">= 14.18 && < 15",">= 16"],"net":true,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12","os":true,"node:os":[">= 14.18 && < 15",">= 16"],"path":true,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16","perf_hooks":">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],"process":">= 1","node:process":[">= 14.18 && < 15",">= 16"],"punycode":">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],"querystring":true,"node:querystring":[">= 14.18 && < 15",">= 16"],"readline":true,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17","repl":true,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],"smalloc":">= 0.11.5 && < 3","node:sqlite":">= 23.4","_stream_duplex":">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],"_stream_transform":">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],"_stream_wrap":">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],"_stream_passthrough":">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],"_stream_readable":">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],"_stream_writable":">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],"stream":true,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5","string_decoder":true,"node:string_decoder":[">= 14.18 && < 15",">= 16"],"sys":[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],"timers":true,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16","_tls_common":">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],"_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],"tls":true,"node:tls":[">= 14.18 && < 15",">= 16"],"trace_events":">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],"tty":true,"node:tty":[">= 14.18 && < 15",">= 16"],"url":true,"node:url":[">= 14.18 && < 15",">= 16"],"util":true,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8":">= 1","node:v8":[">= 14.18 && < 15",">= 16"],"vm":true,"node:vm":[">= 14.18 && < 15",">= 16"],"wasi":[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],"worker_threads":">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],"zlib":">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}'); +const BROWSER_PAGELOAD_SPAN_OP="pageload",BROWSER_NAVIGATION_SPAN_OP="navigation",BROWSER_RESOURCE_SPAN_OP="resource",BROWSER_RESOURCE_SCRIPT_SPAN_OP="resource.script",BROWSER_RESOURCE_LINK_SPAN_OP="resource.link",BROWSER_RESOURCE_IMG_SPAN_OP="resource.img",BROWSER_RESOURCE_CSS_SPAN_OP="resource.css",BROWSER_RESOURCE_AUDIO_SPAN_OP="resource.audio",BROWSER_RESOURCE_VIDEO_SPAN_OP="resource.video",BROWSER_RESOURCE_IFRAME_SPAN_OP="resource.iframe",BROWSER_RESOURCE_OTHER_SPAN_OP="resource.other",BROWSER_BROWSER_SPAN_OP="browser",BROWSER_BROWSER_PAINT_SPAN_OP="browser.paint",BROWSER_UI_SPAN_OP="ui",BROWSER_UI_TASK_SPAN_OP="ui.task",BROWSER_UI_RENDER_SPAN_OP="ui.render",BROWSER_UI_ACTION_SPAN_OP="ui.action",BROWSER_UI_ACTION_CLICK_SPAN_OP="ui.action.click",BROWSER_UI_REACT_SPAN_OP="ui.react",BROWSER_UI_REACT_MOUNT_SPAN_OP="ui.react.mount",BROWSER_UI_REACT_RENDER_SPAN_OP="ui.react.render",BROWSER_UI_REACT_UPDATE_SPAN_OP="ui.react.update",BROWSER_UI_VUE_SPAN_OP="ui.vue",BROWSER_UI_SVELTE_SPAN_OP="ui.svelte",BROWSER_UI_ANGULAR_SPAN_OP="ui.angular",BROWSER_UI_EMBER_SPAN_OP="ui.ember",BROWSER_UI_LIVEWIRE_SPAN_OP="ui.livewire",DATABASE_DB_SPAN_OP="db",DATABASE_DB_QUERY_SPAN_OP="db.query",DATABASE_CACHE_SPAN_OP="cache",DATABASE_CACHE_GET_SPAN_OP="cache.get",DATABASE_CACHE_PUT_SPAN_OP="cache.put",DATABASE_CACHE_REMOVE_SPAN_OP="cache.remove",FAAS_HTTP_SPAN_OP="http",FAAS_GRPC_SPAN_OP="grpc",FAAS_FUNCTION_GCP_SPAN_OP="function.gcp",FAAS_FUNCTION_AWS_SPAN_OP="function.aws",FAAS_FUNCTION_AZURE_SPAN_OP="function.azure",GEN_AI_CHAT_SPAN_OP="chat",GEN_AI_EXECUTE_TOOL_SPAN_OP="execute_tool",GEN_AI_HANDOFF_SPAN_OP="handoff",GEN_AI_INVOKE_AGENT_SPAN_OP="invoke_agent",GENERAL_MARK_SPAN_OP="mark",GENERAL_FUNCTION_SPAN_OP="function",MESSAGING_QUEUE_SPAN_OP="queue",MESSAGING_QUEUE_PUBLISH_SPAN_OP="queue.publish",MESSAGING_QUEUE_CREATE_SPAN_OP="queue.create",MESSAGING_QUEUE_RECEIVE_SPAN_OP="queue.receive",MESSAGING_QUEUE_PROCESS_SPAN_OP="queue.process",MESSAGING_QUEUE_SETTLE_SPAN_OP="queue.settle",MESSAGING_QUEUE_SUBMIT_ARQ_SPAN_OP="queue.submit.arq",MESSAGING_QUEUE_TASK_ARQ_SPAN_OP="queue.task.arq",MESSAGING_QUEUE_SUBMIT_CELERY_SPAN_OP="queue.submit.celery",MESSAGING_QUEUE_TASK_CELERY_SPAN_OP="queue.task.celery",MESSAGING_QUEUE_TASK_DRAMATIQ_SPAN_OP="queue.task.dramatiq",MESSAGING_QUEUE_SUBMIT_HUEY_SPAN_OP="queue.submit.huey",MESSAGING_QUEUE_TASK_HUEY_SPAN_OP="queue.task.huey",MESSAGING_QUEUE_TASK_RQ_SPAN_OP="queue.task.rq",MOBILE_APP_SPAN_OP="app",MOBILE_UI_SPAN_OP="ui",MOBILE_NAVIGATION_SPAN_OP="navigation",MOBILE_FILE_SPAN_OP="file",MOBILE_SERIALIZE_SPAN_OP="serialize",MOBILE_HTTP_SPAN_OP="http",WEB_SERVER_HTTP_SPAN_OP="http",WEB_SERVER_HTTP_CLIENT_SPAN_OP="http.client",WEB_SERVER_HTTP_SERVER_SPAN_OP="http.server",WEB_SERVER_WEBSOCKET_SPAN_OP="websocket",WEB_SERVER_RPC_SPAN_OP="rpc",WEB_SERVER_GRPC_SPAN_OP="grpc",WEB_SERVER_GRAPHQL_SPAN_OP="graphql",WEB_SERVER_SUBPROCESS_SPAN_OP="subprocess",WEB_SERVER_MIDDLEWARE_SPAN_OP="middleware",WEB_SERVER_VIEW_SPAN_OP="view",WEB_SERVER_TEMPLATE_SPAN_OP="template",WEB_SERVER_FUNCTION_SPAN_OP="function",WEB_SERVER_FUNCTION_REMIX_SPAN_OP="function.remix",WEB_SERVER_FUNCTION_NEXTJS_SPAN_OP="function.nextjs",WEB_SERVER_SERIALIZE_SPAN_OP="serialize",WEB_SERVER_CONSOLE_SPAN_OP="console",WEB_SERVER_FILE_SPAN_OP="file",WEB_SERVER_APP_SPAN_OP="app";exports.BROWSER_BROWSER_PAINT_SPAN_OP=BROWSER_BROWSER_PAINT_SPAN_OP,exports.BROWSER_BROWSER_SPAN_OP=BROWSER_BROWSER_SPAN_OP,exports.BROWSER_NAVIGATION_SPAN_OP=BROWSER_NAVIGATION_SPAN_OP,exports.BROWSER_PAGELOAD_SPAN_OP=BROWSER_PAGELOAD_SPAN_OP,exports.BROWSER_RESOURCE_AUDIO_SPAN_OP=BROWSER_RESOURCE_AUDIO_SPAN_OP,exports.BROWSER_RESOURCE_CSS_SPAN_OP=BROWSER_RESOURCE_CSS_SPAN_OP,exports.BROWSER_RESOURCE_IFRAME_SPAN_OP=BROWSER_RESOURCE_IFRAME_SPAN_OP,exports.BROWSER_RESOURCE_IMG_SPAN_OP=BROWSER_RESOURCE_IMG_SPAN_OP,exports.BROWSER_RESOURCE_LINK_SPAN_OP=BROWSER_RESOURCE_LINK_SPAN_OP,exports.BROWSER_RESOURCE_OTHER_SPAN_OP=BROWSER_RESOURCE_OTHER_SPAN_OP,exports.BROWSER_RESOURCE_SCRIPT_SPAN_OP=BROWSER_RESOURCE_SCRIPT_SPAN_OP,exports.BROWSER_RESOURCE_SPAN_OP=BROWSER_RESOURCE_SPAN_OP,exports.BROWSER_RESOURCE_VIDEO_SPAN_OP=BROWSER_RESOURCE_VIDEO_SPAN_OP,exports.BROWSER_UI_ACTION_CLICK_SPAN_OP=BROWSER_UI_ACTION_CLICK_SPAN_OP,exports.BROWSER_UI_ACTION_SPAN_OP=BROWSER_UI_ACTION_SPAN_OP,exports.BROWSER_UI_ANGULAR_SPAN_OP=BROWSER_UI_ANGULAR_SPAN_OP,exports.BROWSER_UI_EMBER_SPAN_OP=BROWSER_UI_EMBER_SPAN_OP,exports.BROWSER_UI_LIVEWIRE_SPAN_OP=BROWSER_UI_LIVEWIRE_SPAN_OP,exports.BROWSER_UI_REACT_MOUNT_SPAN_OP=BROWSER_UI_REACT_MOUNT_SPAN_OP,exports.BROWSER_UI_REACT_RENDER_SPAN_OP=BROWSER_UI_REACT_RENDER_SPAN_OP,exports.BROWSER_UI_REACT_SPAN_OP=BROWSER_UI_REACT_SPAN_OP,exports.BROWSER_UI_REACT_UPDATE_SPAN_OP=BROWSER_UI_REACT_UPDATE_SPAN_OP,exports.BROWSER_UI_RENDER_SPAN_OP=BROWSER_UI_RENDER_SPAN_OP,exports.BROWSER_UI_SPAN_OP="ui",exports.BROWSER_UI_SVELTE_SPAN_OP=BROWSER_UI_SVELTE_SPAN_OP,exports.BROWSER_UI_TASK_SPAN_OP=BROWSER_UI_TASK_SPAN_OP,exports.BROWSER_UI_VUE_SPAN_OP=BROWSER_UI_VUE_SPAN_OP,exports.DATABASE_CACHE_GET_SPAN_OP=DATABASE_CACHE_GET_SPAN_OP,exports.DATABASE_CACHE_PUT_SPAN_OP=DATABASE_CACHE_PUT_SPAN_OP,exports.DATABASE_CACHE_REMOVE_SPAN_OP=DATABASE_CACHE_REMOVE_SPAN_OP,exports.DATABASE_CACHE_SPAN_OP=DATABASE_CACHE_SPAN_OP,exports.DATABASE_DB_QUERY_SPAN_OP=DATABASE_DB_QUERY_SPAN_OP,exports.DATABASE_DB_SPAN_OP="db",exports.FAAS_FUNCTION_AWS_SPAN_OP=FAAS_FUNCTION_AWS_SPAN_OP,exports.FAAS_FUNCTION_AZURE_SPAN_OP=FAAS_FUNCTION_AZURE_SPAN_OP,exports.FAAS_FUNCTION_GCP_SPAN_OP=FAAS_FUNCTION_GCP_SPAN_OP,exports.FAAS_GRPC_SPAN_OP=FAAS_GRPC_SPAN_OP,exports.FAAS_HTTP_SPAN_OP=FAAS_HTTP_SPAN_OP,exports.GENERAL_FUNCTION_SPAN_OP=GENERAL_FUNCTION_SPAN_OP,exports.GENERAL_MARK_SPAN_OP=GENERAL_MARK_SPAN_OP,exports.GEN_AI_CHAT_SPAN_OP=GEN_AI_CHAT_SPAN_OP,exports.GEN_AI_EXECUTE_TOOL_SPAN_OP=GEN_AI_EXECUTE_TOOL_SPAN_OP,exports.GEN_AI_HANDOFF_SPAN_OP=GEN_AI_HANDOFF_SPAN_OP,exports.GEN_AI_INVOKE_AGENT_SPAN_OP=GEN_AI_INVOKE_AGENT_SPAN_OP,exports.MESSAGING_QUEUE_CREATE_SPAN_OP=MESSAGING_QUEUE_CREATE_SPAN_OP,exports.MESSAGING_QUEUE_PROCESS_SPAN_OP=MESSAGING_QUEUE_PROCESS_SPAN_OP,exports.MESSAGING_QUEUE_PUBLISH_SPAN_OP=MESSAGING_QUEUE_PUBLISH_SPAN_OP,exports.MESSAGING_QUEUE_RECEIVE_SPAN_OP=MESSAGING_QUEUE_RECEIVE_SPAN_OP,exports.MESSAGING_QUEUE_SETTLE_SPAN_OP=MESSAGING_QUEUE_SETTLE_SPAN_OP,exports.MESSAGING_QUEUE_SPAN_OP=MESSAGING_QUEUE_SPAN_OP,exports.MESSAGING_QUEUE_SUBMIT_ARQ_SPAN_OP=MESSAGING_QUEUE_SUBMIT_ARQ_SPAN_OP,exports.MESSAGING_QUEUE_SUBMIT_CELERY_SPAN_OP=MESSAGING_QUEUE_SUBMIT_CELERY_SPAN_OP,exports.MESSAGING_QUEUE_SUBMIT_HUEY_SPAN_OP=MESSAGING_QUEUE_SUBMIT_HUEY_SPAN_OP,exports.MESSAGING_QUEUE_TASK_ARQ_SPAN_OP=MESSAGING_QUEUE_TASK_ARQ_SPAN_OP,exports.MESSAGING_QUEUE_TASK_CELERY_SPAN_OP=MESSAGING_QUEUE_TASK_CELERY_SPAN_OP,exports.MESSAGING_QUEUE_TASK_DRAMATIQ_SPAN_OP=MESSAGING_QUEUE_TASK_DRAMATIQ_SPAN_OP,exports.MESSAGING_QUEUE_TASK_HUEY_SPAN_OP=MESSAGING_QUEUE_TASK_HUEY_SPAN_OP,exports.MESSAGING_QUEUE_TASK_RQ_SPAN_OP=MESSAGING_QUEUE_TASK_RQ_SPAN_OP,exports.MOBILE_APP_SPAN_OP="app",exports.MOBILE_FILE_SPAN_OP=MOBILE_FILE_SPAN_OP,exports.MOBILE_HTTP_SPAN_OP=MOBILE_HTTP_SPAN_OP,exports.MOBILE_NAVIGATION_SPAN_OP=MOBILE_NAVIGATION_SPAN_OP,exports.MOBILE_SERIALIZE_SPAN_OP=MOBILE_SERIALIZE_SPAN_OP,exports.MOBILE_UI_SPAN_OP="ui",exports.WEB_SERVER_APP_SPAN_OP="app",exports.WEB_SERVER_CONSOLE_SPAN_OP=WEB_SERVER_CONSOLE_SPAN_OP,exports.WEB_SERVER_FILE_SPAN_OP=WEB_SERVER_FILE_SPAN_OP,exports.WEB_SERVER_FUNCTION_NEXTJS_SPAN_OP=WEB_SERVER_FUNCTION_NEXTJS_SPAN_OP,exports.WEB_SERVER_FUNCTION_REMIX_SPAN_OP=WEB_SERVER_FUNCTION_REMIX_SPAN_OP,exports.WEB_SERVER_FUNCTION_SPAN_OP=WEB_SERVER_FUNCTION_SPAN_OP,exports.WEB_SERVER_GRAPHQL_SPAN_OP=WEB_SERVER_GRAPHQL_SPAN_OP,exports.WEB_SERVER_GRPC_SPAN_OP=WEB_SERVER_GRPC_SPAN_OP,exports.WEB_SERVER_HTTP_CLIENT_SPAN_OP=WEB_SERVER_HTTP_CLIENT_SPAN_OP,exports.WEB_SERVER_HTTP_SERVER_SPAN_OP=WEB_SERVER_HTTP_SERVER_SPAN_OP,exports.WEB_SERVER_HTTP_SPAN_OP=WEB_SERVER_HTTP_SPAN_OP,exports.WEB_SERVER_MIDDLEWARE_SPAN_OP=WEB_SERVER_MIDDLEWARE_SPAN_OP,exports.WEB_SERVER_RPC_SPAN_OP="rpc",exports.WEB_SERVER_SERIALIZE_SPAN_OP=WEB_SERVER_SERIALIZE_SPAN_OP,exports.WEB_SERVER_SUBPROCESS_SPAN_OP=WEB_SERVER_SUBPROCESS_SPAN_OP,exports.WEB_SERVER_TEMPLATE_SPAN_OP=WEB_SERVER_TEMPLATE_SPAN_OP,exports.WEB_SERVER_VIEW_SPAN_OP=WEB_SERVER_VIEW_SPAN_OP,exports.WEB_SERVER_WEBSOCKET_SPAN_OP=WEB_SERVER_WEBSOCKET_SPAN_OP; +//# sourceMappingURL=op.cjs.map -/***/ }), - -/***/ 85425: -/***/ ((module) => { - -"use strict"; -module.exports = JSON.parse('{"eN":{"H":"https://github.com/elastic/require-in-the-middle/issues"}}'); /***/ }), @@ -128832,7 +100371,7 @@ module.exports = JSON.parse('{"eN":{"H":"https://github.com/elastic/require-in-t /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"name":"action-release","version":"3.7.0","private":true,"description":"GitHub Action for creating a release on Sentry","main":"dist/index.js","scripts":{"all":"yarn run format && yarn run lint && yarn run build && yarn test","build":"ncc build src/main.ts -e @sentry/cli","format":"prettier --write **/*.ts **/*.md","format-check":"prettier --check **/*.ts **/*.md","lint":"eslint src/**/*.ts","set-docker-tag":"./scripts/set-docker-tag.sh","set-docker-tag-from-branch":"./scripts/set-docker-tag-from-branch.sh","start":"node dist/index.js","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/getsentry/action-release.git"},"keywords":["actions","sentry","release"],"author":"Sentry","license":"MIT","dependencies":{"@actions/core":"^2.0.3","@sentry/cli":"^2.58.6","@sentry/node":"^8.54.0"},"devDependencies":{"@types/jest":"^29.5.6","@types/node":"^24.0.0","@typescript-eslint/parser":"^6.9.0","@vercel/ncc":"^0.38.1","eslint":"^8.52.0","eslint-plugin-github":"^4.10.1","eslint-plugin-jest":"^27.4.3","jest":"^29.7.0","jest-circus":"^29.7.0","js-yaml":"^4.3.1","prettier":"^3.0.3","ts-jest":"^29.1.1","typescript":"^5.2.2"},"resolutions":{"**/@istanbuljs/load-nyc-config/js-yaml":"3.15.2"},"volta":{"node":"24.14.1","yarn":"1.22.4"}}'); +module.exports = JSON.parse('{"name":"action-release","version":"3.7.0","private":true,"description":"GitHub Action for creating a release on Sentry","main":"dist/index.js","scripts":{"all":"yarn run format && yarn run lint && yarn run build && yarn test","build":"ncc build src/main.ts -e @sentry/cli","format":"prettier --write **/*.ts **/*.md","format-check":"prettier --check **/*.ts **/*.md","lint":"eslint src/**/*.ts","set-docker-tag":"./scripts/set-docker-tag.sh","set-docker-tag-from-branch":"./scripts/set-docker-tag-from-branch.sh","start":"node dist/index.js","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/getsentry/action-release.git"},"keywords":["actions","sentry","release"],"author":"Sentry","license":"MIT","dependencies":{"@actions/core":"^2.0.3","@sentry/cli":"^2.58.6","@sentry/node":"^10.71.0"},"devDependencies":{"@types/jest":"^29.5.6","@types/node":"^24.0.0","@typescript-eslint/parser":"^6.9.0","@vercel/ncc":"^0.38.1","eslint":"^8.52.0","eslint-plugin-github":"^4.10.1","eslint-plugin-jest":"^27.4.3","jest":"^29.7.0","jest-circus":"^29.7.0","js-yaml":"^4.3.1","prettier":"^3.0.3","ts-jest":"^29.1.1","typescript":"^5.2.2"},"resolutions":{"**/@istanbuljs/load-nyc-config/js-yaml":"3.15.2"},"volta":{"node":"24.14.1","yarn":"1.22.4"}}'); /***/ }) @@ -128871,6 +100410,9 @@ module.exports = JSON.parse('{"name":"action-release","version":"3.7.0","private /******/ return module.exports; /******/ } /******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nccwpck_require__.m = __webpack_modules__; +/******/ /************************************************************************/ /******/ /* webpack/runtime/create fake namespace object */ /******/ (() => { @@ -128914,6 +100456,28 @@ module.exports = JSON.parse('{"name":"action-release","version":"3.7.0","private /******/ }; /******/ })(); /******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __nccwpck_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __nccwpck_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__nccwpck_require__.f).reduce((promises, key) => { +/******/ __nccwpck_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __nccwpck_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return "" + chunkId + ".index.js"; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) @@ -128943,6 +100507,48 @@ module.exports = JSON.parse('{"name":"action-release","version":"3.7.0","private /******/ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; /******/ +/******/ /* webpack/runtime/require chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded chunks +/******/ // "1" means "loaded", otherwise not loaded yet +/******/ var installedChunks = { +/******/ 179: 1 +/******/ }; +/******/ +/******/ // no on chunks loaded +/******/ +/******/ var installChunk = (chunk) => { +/******/ var moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime; +/******/ for(var moduleId in moreModules) { +/******/ if(__nccwpck_require__.o(moreModules, moduleId)) { +/******/ __nccwpck_require__.m[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) runtime(__nccwpck_require__); +/******/ for(var i = 0; i < chunkIds.length; i++) +/******/ installedChunks[chunkIds[i]] = 1; +/******/ +/******/ }; +/******/ +/******/ // require() chunk loading for javascript +/******/ __nccwpck_require__.f.require = (chunkId, promises) => { +/******/ // "1" is the signal for "already loaded" +/******/ if(!installedChunks[chunkId]) { +/******/ if(true) { // all chunks have JS +/******/ installChunk(require("./" + __nccwpck_require__.u(chunkId))); +/******/ } else installedChunks[chunkId] = 1; +/******/ } +/******/ }; +/******/ +/******/ // no external install chunk +/******/ +/******/ // no HMR +/******/ +/******/ // no HMR manifest +/******/ })(); +/******/ /************************************************************************/ /******/ /******/ // startup diff --git a/package.json b/package.json index 1fda33f..a30d883 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "dependencies": { "@actions/core": "^2.0.3", "@sentry/cli": "^2.58.6", - "@sentry/node": "^8.54.0" + "@sentry/node": "^10.71.0" }, "devDependencies": { "@types/jest": "^29.5.6", diff --git a/yarn.lock b/yarn.lock index 84736e3..e18eb61 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,6 +35,37 @@ resolved "https://registry.yarnpkg.com/@actions/io/-/io-2.0.0.tgz#3ad1271ba3cd515324f2215e8d4c1c0c3864d65b" integrity sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg== +"@apm-js-collab/code-transformer-bundler-plugins@^0.7.3": + version "0.7.4" + resolved "https://registry.yarnpkg.com/@apm-js-collab/code-transformer-bundler-plugins/-/code-transformer-bundler-plugins-0.7.4.tgz#f323d5f723565e34f1409aa96e445ad489020f76" + integrity sha512-nAfOeZPSUAQvJa1iFT/5oCrTm5YQhMMrfCNthNnaXHZiOQhu1KGuLoIx7HtbAi3wfwaBYLaICPIeenIaEwcXIg== + dependencies: + "@apm-js-collab/code-transformer" "^0.18.1" + es-module-lexer "^2.1.0" + magic-string "^0.30.21" + module-details-from-path "^1.0.4" + +"@apm-js-collab/code-transformer@^0.18.0", "@apm-js-collab/code-transformer@^0.18.1": + version "0.18.1" + resolved "https://registry.yarnpkg.com/@apm-js-collab/code-transformer/-/code-transformer-0.18.1.tgz#66ce01cfe9607779b4abebb4f54c49a46e8b48ca" + integrity sha512-u1Hb6bHjWtkSpiprwVP6YaHC1DTN4RAU3zYkUDUe7WMnJwdyU1pwTL9dFKiSJB9IiLue/EQovmyx6xhU7FFtAQ== + dependencies: + "@types/estree" "^1.0.8" + astring "^1.9.0" + esquery "^1.7.0" + meriyah "^6.1.4" + semifies "^1.0.0" + source-map "^0.6.0" + +"@apm-js-collab/tracing-hooks@^0.13.0": + version "0.13.0" + resolved "https://registry.yarnpkg.com/@apm-js-collab/tracing-hooks/-/tracing-hooks-0.13.0.tgz#20b2f77ec7a0e5dfd9fbf2215b56e2c2b7f41e4b" + integrity sha512-mTvWz9rnQwx1U3h0XPTHaX7bgfkpipLLTQyjlC2cdhQpQEuoLT0AGzoydeoq2NxfEVv6fWOOETcSbb2nptleyw== + dependencies: + "@apm-js-collab/code-transformer" "^0.18.0" + debug "^4.4.1" + module-details-from-path "^1.0.4" + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" @@ -658,6 +689,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== +"@jridgewell/sourcemap-codec@^1.5.5": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz#f4c663e862f06dc98ca4d453862c46902789a18d" + integrity sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw== + "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": version "0.3.20" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" @@ -695,331 +731,70 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@opentelemetry/api-logs@0.53.0": - version "0.53.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.53.0.tgz#c478cbd8120ec2547b64edfa03a552cfe42170be" - integrity sha512-8HArjKx+RaAI8uEIgcORbZIPklyh1YLjPSBus8hjRmvLi6DeFzgOcdZ7KwPabKj8mXF8dX0hyfAyGfycz0DbFw== - dependencies: - "@opentelemetry/api" "^1.0.0" - -"@opentelemetry/api-logs@0.57.1": - version "0.57.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.57.1.tgz#97ebd714f0b1fcdf896e85c465ae5c5b22747425" - integrity sha512-I4PHczeujhQAQv6ZBzqHYEUiggZL4IdSMixtVD3EYqbdrjujE7kRfI5QohjlPoJm8BvenoW5YaTMWRrbpot6tg== +"@opentelemetry/api-logs@0.220.0": + version "0.220.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.220.0.tgz#b2ed235de4b5f3c1769adfa5f3bc247d82cdfbc9" + integrity sha512-CmVa4ImJ+ynfrPMNaAXHET6Bhb44SwzmfyVJFq9ni2jgXJR/l7C6gfVFddNmHP+ZOkP9cf4f9DBe68qVLTHc9w== dependencies: "@opentelemetry/api" "^1.3.0" -"@opentelemetry/api@^1.0.0", "@opentelemetry/api@^1.3.0", "@opentelemetry/api@^1.8", "@opentelemetry/api@^1.9.0": +"@opentelemetry/api@^1.3.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== -"@opentelemetry/context-async-hooks@^1.30.1": - version "1.30.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.30.1.tgz#4f76280691a742597fd0bf682982126857622948" - integrity sha512-s5vvxXPVdjqS3kTLKMeBMvop9hbWkwzBpu+mUO2M7sZtlkyDJGwFe33wRKnbaYDo8ExRVBIIdwIGrqpxHuKttA== +"@opentelemetry/api@^1.9.1": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.1.tgz#c1b0346de336ba55af2d5a7970882037baedec05" + integrity sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q== -"@opentelemetry/core@1.30.0", "@opentelemetry/core@^1.1.0", "@opentelemetry/core@^1.26.0", "@opentelemetry/core@^1.8.0": - version "1.30.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.30.0.tgz#ef959e11e137d72466e566e375ecc5a82e922b86" - integrity sha512-Q/3u/K73KUjTCnFUP97ZY+pBjQ1kPEgjOfXj/bJl8zW7GbXdkw6cwuyZk6ZTXkVgCBsYRYUzx4fvYK1jxdb9MA== +"@opentelemetry/core@2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-2.10.0.tgz#aa77f7138e74ba5399d5f3bb0deade0c168f00b2" + integrity sha512-/wNZ8twnEQQA4HoHu22+vcsdru6pWPWxW+7w+FlxT6Id7PE/WIbZmVKkte+PF72e0F2dnImFeHD2syyE1Mw6MQ== dependencies: - "@opentelemetry/semantic-conventions" "1.28.0" + "@opentelemetry/semantic-conventions" "^1.29.0" -"@opentelemetry/core@1.30.1", "@opentelemetry/core@^1.30.1": - version "1.30.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.30.1.tgz#a0b468bb396358df801881709ea38299fc30ab27" - integrity sha512-OOCM2C/QIURhJMuKaekP3TRBxBKxG/TWWA0TL2J6nXUtDnuCtccy49LUJF8xPFXMX+0LMcxFpCo8M9cGY1W6rQ== +"@opentelemetry/instrumentation@^0.220.0": + version "0.220.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.220.0.tgz#542b36bf4871dd83dc84e1373ac4bbcd35a8bfb8" + integrity sha512-xQx3E2WxP1mDvKzxLxX+CTCtNLa560YJZ3087qYHerl2YmiKpv7AH+dAy7vmx+eVrZ5BwhfWUAVoKOoxCNHcpw== dependencies: - "@opentelemetry/semantic-conventions" "1.28.0" + "@opentelemetry/api-logs" "0.220.0" + import-in-the-middle "^3.0.0" + require-in-the-middle "^8.0.0" -"@opentelemetry/instrumentation-amqplib@^0.46.0": - version "0.46.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.46.0.tgz#8b0c61213034780a79c16216c62eee0ce1457ddf" - integrity sha512-04VHHV1KIN/c1wLWwzmLI02d/welgscBJ4BuDqrHaxd+ZIdlVXK9UYQsYf3JwSeF52z/4YoSzr8bfdVBSWoMAg== +"@opentelemetry/resources@2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-2.10.0.tgz#ce76c1c1baafce4c77bc29890965ba1f56671acc" + integrity sha512-q6MMm2zhggzsHVNbabYwut+a6nbuQQe3URUoxaojM/8K1IBfwwPzvxIjNi2/lI1TFe+fMHMW9MWhrtDLEXEnkA== dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" + "@opentelemetry/core" "2.10.0" + "@opentelemetry/semantic-conventions" "^1.29.0" -"@opentelemetry/instrumentation-connect@0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.43.0.tgz#411035f4a8f2e498dbfa7300e545c58586a062e2" - integrity sha512-Q57JGpH6T4dkYHo9tKXONgLtxzsh1ZEW5M9A/OwKrZFyEpLqWgjhcZ3hIuVvDlhb426iDF1f9FPToV/mi5rpeA== +"@opentelemetry/sdk-trace-base@^2.9.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.10.0.tgz#3f9bf8a14c1dba8790619e28326f7c57f8b9e76f" + integrity sha512-GuYQQT7QD2EeO8lcZLRQzcbOyhqAzL+6WWTKTU9mSUBYBazkEDl+VrQcXQhbB08OWM9anD1aHleVadzulpOaUQ== dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - "@types/connect" "3.4.36" + "@opentelemetry/core" "2.10.0" + "@opentelemetry/resources" "2.10.0" + "@opentelemetry/sdk-trace" "2.10.0" + "@opentelemetry/semantic-conventions" "^1.29.0" -"@opentelemetry/instrumentation-dataloader@0.16.0": - version "0.16.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.16.0.tgz#913345c335f67bf8e17a9b38c227dba741fe488b" - integrity sha512-88+qCHZC02up8PwKHk0UQKLLqGGURzS3hFQBZC7PnGwReuoKjHXS1o29H58S+QkXJpkTr2GACbx8j6mUoGjNPA== +"@opentelemetry/sdk-trace@2.10.0": + version "2.10.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace/-/sdk-trace-2.10.0.tgz#76b0331092452b01a8b2f704480e2576641c7011" + integrity sha512-MfQGq3GRmTh5fM/y+OjaO0vj6+luCB1XO2gfXCalKCfgKw0eHL++sm75DNweC6ohlp+aFvACqeE0fYayqdRaoQ== dependencies: - "@opentelemetry/instrumentation" "^0.57.0" + "@opentelemetry/core" "2.10.0" + "@opentelemetry/resources" "2.10.0" + "@opentelemetry/semantic-conventions" "^1.29.0" -"@opentelemetry/instrumentation-express@0.47.0": - version "0.47.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-express/-/instrumentation-express-0.47.0.tgz#f0477db3b1f4b342beb9ecd08edc26c470566724" - integrity sha512-XFWVx6k0XlU8lu6cBlCa29ONtVt6ADEjmxtyAyeF2+rifk8uBJbk1La0yIVfI0DoKURGbaEDTNelaXG9l/lNNQ== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-fastify@0.44.1": - version "0.44.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.44.1.tgz#c8080f24a6fbdd14689c619ad7b14fe189b10f28" - integrity sha512-RoVeMGKcNttNfXMSl6W4fsYoCAYP1vi6ZAWIGhBY+o7R9Y0afA7f9JJL0j8LHbyb0P0QhSYk+6O56OwI2k4iRQ== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-fs@0.19.0": - version "0.19.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fs/-/instrumentation-fs-0.19.0.tgz#a44807aea97edc64c597d6a5b5b8637b7ab45057" - integrity sha512-JGwmHhBkRT2G/BYNV1aGI+bBjJu4fJUD/5/Jat0EWZa2ftrLV3YE8z84Fiij/wK32oMZ88eS8DI4ecLGZhpqsQ== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - -"@opentelemetry/instrumentation-generic-pool@0.43.0": - version "0.43.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.43.0.tgz#b1769eb0e30f2abb764a9cbc811aa3d4560ecc24" - integrity sha512-at8GceTtNxD1NfFKGAuwtqM41ot/TpcLh+YsGe4dhf7gvv1HW/ZWdq6nfRtS6UjIvZJOokViqLPJ3GVtZItAnQ== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - -"@opentelemetry/instrumentation-graphql@0.47.0": - version "0.47.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.47.0.tgz#271807e21a6224bd1986a3e9887650f1858ee733" - integrity sha512-Cc8SMf+nLqp0fi8oAnooNEfwZWFnzMiBHCGmDFYqmgjPylyLmi83b+NiTns/rKGwlErpW0AGPt0sMpkbNlzn8w== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - -"@opentelemetry/instrumentation-hapi@0.45.1": - version "0.45.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.45.1.tgz#5edf982549070d95e20152d568279548ad44d662" - integrity sha512-VH6mU3YqAKTePPfUPwfq4/xr049774qWtfTuJqVHoVspCLiT3bW+fCQ1toZxt6cxRPYASoYaBsMA3CWo8B8rcw== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-http@0.57.1": - version "0.57.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.57.1.tgz#2d8b395df62191475e76fa0eb7bf60079ea886b9" - integrity sha512-ThLmzAQDs7b/tdKI3BV2+yawuF09jF111OFsovqT1Qj3D8vjwKBwhi/rDE5xethwn4tSXtZcJ9hBsVAlWFQZ7g== - dependencies: - "@opentelemetry/core" "1.30.1" - "@opentelemetry/instrumentation" "0.57.1" - "@opentelemetry/semantic-conventions" "1.28.0" - forwarded-parse "2.1.2" - semver "^7.5.2" - -"@opentelemetry/instrumentation-ioredis@0.47.0": - version "0.47.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.47.0.tgz#f83bd133d36d137d2d0b58bfbdfe12ed6fe5ab2f" - integrity sha512-4HqP9IBC8e7pW9p90P3q4ox0XlbLGme65YTrA3UTLvqvo4Z6b0puqZQP203YFu8m9rE/luLfaG7/xrwwqMUpJw== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/redis-common" "^0.36.2" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-kafkajs@0.7.0": - version "0.7.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.7.0.tgz#079b949ec814b42e49d23bb4d4f73735fe460d52" - integrity sha512-LB+3xiNzc034zHfCtgs4ITWhq6Xvdo8bsq7amR058jZlf2aXXDrN9SV4si4z2ya9QX4tz6r4eZJwDkXOp14/AQ== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-knex@0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.44.0.tgz#af251ed38f06a2f248812c5addf0266697b6149a" - integrity sha512-SlT0+bLA0Lg3VthGje+bSZatlGHw/vwgQywx0R/5u9QC59FddTQSPJeWNw29M6f8ScORMeUOOTwihlQAn4GkJQ== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-koa@0.47.0": - version "0.47.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.47.0.tgz#a74b35809ba95d0f9db49e8c3f214bde475b095a" - integrity sha512-HFdvqf2+w8sWOuwtEXayGzdZ2vWpCKEQv5F7+2DSA74Te/Cv4rvb2E5So5/lh+ok4/RAIPuvCbCb/SHQFzMmbw== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-lru-memoizer@0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.44.0.tgz#c22e770d950c165f80c657a9c790c9843baaa65b" - integrity sha512-Tn7emHAlvYDFik3vGU0mdwvWJDwtITtkJ+5eT2cUquct6nIs+H8M47sqMJkCpyPe5QIBJoTOHxmc6mj9lz6zDw== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - -"@opentelemetry/instrumentation-mongodb@0.51.0": - version "0.51.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.51.0.tgz#8a323c2fb4cb2c93bf95f1b1c0fcb30952d12a08" - integrity sha512-cMKASxCX4aFxesoj3WK8uoQ0YUrRvnfxaO72QWI2xLu5ZtgX/QvdGBlU3Ehdond5eb74c2s1cqRQUIptBnKz1g== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-mongoose@0.46.0": - version "0.46.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.46.0.tgz#c3a5f69e1a5b950b542cf84650fbbd3e31bd681e" - integrity sha512-mtVv6UeaaSaWTeZtLo4cx4P5/ING2obSqfWGItIFSunQBrYROfhuVe7wdIrFUs2RH1tn2YYpAJyMaRe/bnTTIQ== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-mysql2@0.45.0": - version "0.45.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.45.0.tgz#95501759d470dbc7038670e91205e8ed601ec402" - integrity sha512-qLslv/EPuLj0IXFvcE3b0EqhWI8LKmrgRPIa4gUd8DllbBpqJAvLNJSv3cC6vWwovpbSI3bagNO/3Q2SuXv2xA== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - "@opentelemetry/sql-common" "^0.40.1" - -"@opentelemetry/instrumentation-mysql@0.45.0": - version "0.45.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.45.0.tgz#e4df8bc709c0c8b0ff90bbef92fb36e92ebe0d19" - integrity sha512-tWWyymgwYcTwZ4t8/rLDfPYbOTF3oYB8SxnYMtIQ1zEf5uDm90Ku3i6U/vhaMyfHNlIHvDhvJh+qx5Nc4Z3Acg== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - "@types/mysql" "2.15.26" - -"@opentelemetry/instrumentation-nestjs-core@0.44.0": - version "0.44.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.44.0.tgz#d2a3631de3bed2b1c0a03afa79c08ae22bef8b6c" - integrity sha512-t16pQ7A4WYu1yyQJZhRKIfUNvl5PAaF2pEteLvgJb/BWdd1oNuU1rOYt4S825kMy+0q4ngiX281Ss9qiwHfxFQ== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-pg@0.50.0": - version "0.50.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.50.0.tgz#525ecf683c349529539a14f2be47164f4e3eb0f5" - integrity sha512-TtLxDdYZmBhFswm8UIsrDjh/HFBeDXd4BLmE8h2MxirNHewLJ0VS9UUddKKEverb5Sm2qFVjqRjcU+8Iw4FJ3w== - dependencies: - "@opentelemetry/core" "^1.26.0" - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "1.27.0" - "@opentelemetry/sql-common" "^0.40.1" - "@types/pg" "8.6.1" - "@types/pg-pool" "2.0.6" - -"@opentelemetry/instrumentation-redis-4@0.46.0": - version "0.46.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.46.0.tgz#828704b8134f023730ac508bcf3a38ca4d5d697c" - integrity sha512-aTUWbzbFMFeRODn3720TZO0tsh/49T8H3h8vVnVKJ+yE36AeW38Uj/8zykQ/9nO8Vrtjr5yKuX3uMiG/W8FKNw== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/redis-common" "^0.36.2" - "@opentelemetry/semantic-conventions" "^1.27.0" - -"@opentelemetry/instrumentation-tedious@0.18.0": - version "0.18.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-tedious/-/instrumentation-tedious-0.18.0.tgz#636745423db28e303b4e0289b8f69685cb36f807" - integrity sha512-9zhjDpUDOtD+coeADnYEJQ0IeLVCj7w/hqzIutdp5NqS1VqTAanaEfsEcSypyvYv5DX3YOsTUoF+nr2wDXPETA== - dependencies: - "@opentelemetry/instrumentation" "^0.57.0" - "@opentelemetry/semantic-conventions" "^1.27.0" - "@types/tedious" "^4.0.14" - -"@opentelemetry/instrumentation-undici@0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.10.0.tgz#99cba213a6e9d47a82896b6c782c3f2d60e0edb5" - integrity sha512-vm+V255NGw9gaSsPD6CP0oGo8L55BffBc8KnxqsMuc6XiAD1L8SFNzsW0RHhxJFqy9CJaJh+YiJ5EHXuZ5rZBw== - dependencies: - "@opentelemetry/core" "^1.8.0" - "@opentelemetry/instrumentation" "^0.57.0" - -"@opentelemetry/instrumentation@0.57.1", "@opentelemetry/instrumentation@^0.57.0", "@opentelemetry/instrumentation@^0.57.1": - version "0.57.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.57.1.tgz#5aea772be8783a35d69d643da46582f381ba1810" - integrity sha512-SgHEKXoVxOjc20ZYusPG3Fh+RLIZTSa4x8QtD3NfgAUDyqdFFS9W1F2ZVbZkqDCdyMcQG02Ok4duUGLHJXHgbA== - dependencies: - "@opentelemetry/api-logs" "0.57.1" - "@types/shimmer" "^1.2.0" - import-in-the-middle "^1.8.1" - require-in-the-middle "^7.1.1" - semver "^7.5.2" - shimmer "^1.2.1" - -"@opentelemetry/instrumentation@^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0": - version "0.53.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.53.0.tgz#e6369e4015eb5112468a4d45d38dcada7dad892d" - integrity sha512-DMwg0hy4wzf7K73JJtl95m/e0boSoWhH07rfvHvYzQtBD3Bmv0Wc1x733vyZBqmFm8OjJD0/pfiUg1W3JjFX0A== - dependencies: - "@opentelemetry/api-logs" "0.53.0" - "@types/shimmer" "^1.2.0" - import-in-the-middle "^1.8.1" - require-in-the-middle "^7.1.1" - semver "^7.5.2" - shimmer "^1.2.1" - -"@opentelemetry/redis-common@^0.36.2": - version "0.36.2" - resolved "https://registry.yarnpkg.com/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz#906ac8e4d804d4109f3ebd5c224ac988276fdc47" - integrity sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g== - -"@opentelemetry/resources@1.30.0": - version "1.30.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.30.0.tgz#87604359e6195c017075b7d294a949ad018e692d" - integrity sha512-5mGMjL0Uld/99t7/pcd7CuVtJbkARckLVuiOX84nO8RtLtIz0/J6EOHM2TGvPZ6F4K+XjUq13gMx14w80SVCQg== - dependencies: - "@opentelemetry/core" "1.30.0" - "@opentelemetry/semantic-conventions" "1.28.0" - -"@opentelemetry/resources@1.30.1", "@opentelemetry/resources@^1.30.1": - version "1.30.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.30.1.tgz#a4eae17ebd96947fdc7a64f931ca4b71e18ce964" - integrity sha512-5UxZqiAgLYGFjS4s9qm5mBVo433u+dSPUFWVWXmLAD4wB65oMCoXaJP1KJa9DIYYMeHu3z4BZcStG3LC593cWA== - dependencies: - "@opentelemetry/core" "1.30.1" - "@opentelemetry/semantic-conventions" "1.28.0" - -"@opentelemetry/sdk-trace-base@^1.22": - version "1.30.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.30.0.tgz#27c68ab01b1cfb4af16356550f8091d6e727f182" - integrity sha512-RKQDaDIkV7PwizmHw+rE/FgfB2a6MBx+AEVVlAHXRG1YYxLiBpPX2KhmoB99R5vA4b72iJrjle68NDWnbrE9Dg== - dependencies: - "@opentelemetry/core" "1.30.0" - "@opentelemetry/resources" "1.30.0" - "@opentelemetry/semantic-conventions" "1.28.0" - -"@opentelemetry/sdk-trace-base@^1.30.1": - version "1.30.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.30.1.tgz#41a42234096dc98e8f454d24551fc80b816feb34" - integrity sha512-jVPgBbH1gCy2Lb7X0AVQ8XAfgg0pJ4nvl8/IiQA6nxOsPvS+0zMJaFSs2ltXe0J6C8dqjcnpyqINDJmU30+uOg== - dependencies: - "@opentelemetry/core" "1.30.1" - "@opentelemetry/resources" "1.30.1" - "@opentelemetry/semantic-conventions" "1.28.0" - -"@opentelemetry/semantic-conventions@1.27.0": - version "1.27.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.27.0.tgz#1a857dcc95a5ab30122e04417148211e6f945e6c" - integrity sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg== - -"@opentelemetry/semantic-conventions@1.28.0", "@opentelemetry/semantic-conventions@^1.27.0", "@opentelemetry/semantic-conventions@^1.28.0": - version "1.28.0" - resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.28.0.tgz#337fb2bca0453d0726696e745f50064411f646d6" - integrity sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA== - -"@opentelemetry/sql-common@^0.40.1": - version "0.40.1" - resolved "https://registry.yarnpkg.com/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz#93fbc48d8017449f5b3c3274f2268a08af2b83b6" - integrity sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg== - dependencies: - "@opentelemetry/core" "^1.1.0" +"@opentelemetry/semantic-conventions@^1.29.0": + version "1.43.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.43.0.tgz#f3f467e36c27332f0e735ec86cdcd78dd6f27865" + integrity sha512-eSYWTm620tTk45EKSedaUL8MFYI8hW164hIXsgIHyxu3VobUB3fFCu5t0hQby6OoWRPsG1KkKUG2M5UadiLiVg== "@pkgr/utils@^2.3.1": version "2.4.2" @@ -1033,15 +808,6 @@ picocolors "^1.0.0" tslib "^2.6.0" -"@prisma/instrumentation@5.22.0": - version "5.22.0" - resolved "https://registry.yarnpkg.com/@prisma/instrumentation/-/instrumentation-5.22.0.tgz#c39941046e9886e17bdb47dbac45946c24d579aa" - integrity sha512-LxccF392NN37ISGxIurUljZSh1YWnphO34V5a0+T7FVQG2u9bhAXRTJpgmQ3483woVhkraQZFF7cbRrpbw/F4Q== - dependencies: - "@opentelemetry/api" "^1.8" - "@opentelemetry/instrumentation" "^0.49 || ^0.50 || ^0.51 || ^0.52.0 || ^0.53.0" - "@opentelemetry/sdk-trace-base" "^1.22" - "@sentry/cli-darwin@2.58.6": version "2.58.6" resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.58.6.tgz#38fd82751014b287e58e99ef948d01ca1e09f41d" @@ -1102,58 +868,61 @@ "@sentry/cli-win32-i686" "2.58.6" "@sentry/cli-win32-x64" "2.58.6" -"@sentry/core@8.54.0": - version "8.54.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.54.0.tgz#a2ebec965cadcb6de89e116689feeef79d5862a6" - integrity sha512-03bWf+D1j28unOocY/5FDB6bUHtYlm6m6ollVejhg45ZmK9iPjdtxNWbrLsjT1WRym0Tjzowu+A3p+eebYEv0Q== +"@sentry/conventions@^0.16.0": + version "0.16.0" + resolved "https://registry.yarnpkg.com/@sentry/conventions/-/conventions-0.16.0.tgz#3b58d15714cf44dca1518496c00749eec5525009" + integrity sha512-fO9PLmHdVURcSPUpWCItWAtgKiMwGdJHbovoSEyLplX5sxs2ugvI4CBPTrkkgqhObnZOD0CnWBKDzSVQYBKEyQ== -"@sentry/node@^8.54.0": - version "8.54.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-8.54.0.tgz#4ba175e320c36263f75a88670f4a5507754cf8f0" - integrity sha512-z9ak481OtCw3V4l55ke/9FOiorF2J/niO1J1gvGefXpgFucpw0M3qqEFjB5cpg9HoZM8Y1WtA1OFusfTAnvcXg== +"@sentry/core@10.71.0": + version "10.71.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-10.71.0.tgz#7b523ccef4700910cc66ef1edc3c19e833dcac6c" + integrity sha512-OIjT7rzcWJjUC6r3eBT3Td1j0afDBMkbbx9jTocSD+ZSfc25eEU7hoIPS0WvfeIOTIN3y8bfQnXavwMReaNVHQ== dependencies: - "@opentelemetry/api" "^1.9.0" - "@opentelemetry/context-async-hooks" "^1.30.1" - "@opentelemetry/core" "^1.30.1" - "@opentelemetry/instrumentation" "^0.57.1" - "@opentelemetry/instrumentation-amqplib" "^0.46.0" - "@opentelemetry/instrumentation-connect" "0.43.0" - "@opentelemetry/instrumentation-dataloader" "0.16.0" - "@opentelemetry/instrumentation-express" "0.47.0" - "@opentelemetry/instrumentation-fastify" "0.44.1" - "@opentelemetry/instrumentation-fs" "0.19.0" - "@opentelemetry/instrumentation-generic-pool" "0.43.0" - "@opentelemetry/instrumentation-graphql" "0.47.0" - "@opentelemetry/instrumentation-hapi" "0.45.1" - "@opentelemetry/instrumentation-http" "0.57.1" - "@opentelemetry/instrumentation-ioredis" "0.47.0" - "@opentelemetry/instrumentation-kafkajs" "0.7.0" - "@opentelemetry/instrumentation-knex" "0.44.0" - "@opentelemetry/instrumentation-koa" "0.47.0" - "@opentelemetry/instrumentation-lru-memoizer" "0.44.0" - "@opentelemetry/instrumentation-mongodb" "0.51.0" - "@opentelemetry/instrumentation-mongoose" "0.46.0" - "@opentelemetry/instrumentation-mysql" "0.45.0" - "@opentelemetry/instrumentation-mysql2" "0.45.0" - "@opentelemetry/instrumentation-nestjs-core" "0.44.0" - "@opentelemetry/instrumentation-pg" "0.50.0" - "@opentelemetry/instrumentation-redis-4" "0.46.0" - "@opentelemetry/instrumentation-tedious" "0.18.0" - "@opentelemetry/instrumentation-undici" "0.10.0" - "@opentelemetry/resources" "^1.30.1" - "@opentelemetry/sdk-trace-base" "^1.30.1" - "@opentelemetry/semantic-conventions" "^1.28.0" - "@prisma/instrumentation" "5.22.0" - "@sentry/core" "8.54.0" - "@sentry/opentelemetry" "8.54.0" - import-in-the-middle "^1.11.2" + "@sentry/conventions" "^0.16.0" -"@sentry/opentelemetry@8.54.0": - version "8.54.0" - resolved "https://registry.yarnpkg.com/@sentry/opentelemetry/-/opentelemetry-8.54.0.tgz#0fd2c732b6f83ec7a6eb27defbb535784657669d" - integrity sha512-Tkmd8bmXMx0PKZF53ywk/FfvDrphX8NdPH5N53HxyMvGxSf2trZkTuOSFJg6zKibyGYO6+PUeGO3g2WJKUxwGA== +"@sentry/node-core@10.71.0": + version "10.71.0" + resolved "https://registry.yarnpkg.com/@sentry/node-core/-/node-core-10.71.0.tgz#a2d662956d98a44b2b15ed3ac551b83686ec7c79" + integrity sha512-sxd0/ZW+Uda/17H0R7lB2Othm37VYcdwKdWdyHRizg872TfCX4UwTTPaoS2tMJAUjV2tVh83ZA0fsoC2q9SpjA== dependencies: - "@sentry/core" "8.54.0" + "@sentry/conventions" "^0.16.0" + "@sentry/core" "10.71.0" + "@sentry/opentelemetry" "10.71.0" + import-in-the-middle "^3.0.0" + +"@sentry/node@^10.71.0": + version "10.71.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-10.71.0.tgz#c742e04e3dcf8f4446adaeb376859f9f1e1439af" + integrity sha512-bw2M/xkMu2+ATo6QWFmtTZTYp5LV1krt9/DTtYqtt4GmhXmXgdFPXCv6783AJI3HUoEMx2BcehhNbKzGrFXo/g== + dependencies: + "@opentelemetry/api" "^1.9.1" + "@opentelemetry/instrumentation" "^0.220.0" + "@opentelemetry/sdk-trace-base" "^2.9.0" + "@sentry/conventions" "^0.16.0" + "@sentry/core" "10.71.0" + "@sentry/node-core" "10.71.0" + "@sentry/opentelemetry" "10.71.0" + "@sentry/server-utils" "10.71.0" + import-in-the-middle "^3.0.0" + +"@sentry/opentelemetry@10.71.0": + version "10.71.0" + resolved "https://registry.yarnpkg.com/@sentry/opentelemetry/-/opentelemetry-10.71.0.tgz#72a0e602cbd79c7aa230199a16529f4285c9a02a" + integrity sha512-YgeL0xTObKma3MuOrt+/6M/f6mo/Z08LHh3OxPomzQpgpCgCLGyJ/739cDSSH1LRjqWdPQtoia5asl5ZRdhWmw== + dependencies: + "@sentry/conventions" "^0.16.0" + "@sentry/core" "10.71.0" + +"@sentry/server-utils@10.71.0": + version "10.71.0" + resolved "https://registry.yarnpkg.com/@sentry/server-utils/-/server-utils-10.71.0.tgz#c583a1b077c39e93dfc61b3ca1721cc253317abd" + integrity sha512-zdyShKNsghzPGVWVRzc7oybYTsRZdKgdPtq+dsksImo1b6n7ILlD7eYx1Q0eAOZoWkDqDmm+Ml6MQb76IT1eTA== + dependencies: + "@apm-js-collab/code-transformer-bundler-plugins" "^0.7.3" + "@apm-js-collab/tracing-hooks" "^0.13.0" + "@sentry/conventions" "^0.16.0" + "@sentry/core" "10.71.0" + meriyah "^6.1.4" "@sinclair/typebox@^0.27.8": version "0.27.8" @@ -1207,12 +976,10 @@ dependencies: "@babel/types" "^7.20.7" -"@types/connect@3.4.36": - version "3.4.36" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.36.tgz#e511558c15a39cb29bd5357eebb57bd1459cd1ab" - integrity sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w== - dependencies: - "@types/node" "*" +"@types/estree@^1.0.8": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.9.tgz#cf3f0e876d7bee15a93ab925b82bf570a3904a24" + integrity sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg== "@types/graceful-fs@^4.1.3": version "4.1.8" @@ -1258,13 +1025,6 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== -"@types/mysql@2.15.26": - version "2.15.26" - resolved "https://registry.yarnpkg.com/@types/mysql/-/mysql-2.15.26.tgz#f0de1484b9e2354d587e7d2bd17a873cc8300836" - integrity sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ== - dependencies: - "@types/node" "*" - "@types/node@*": version "20.8.9" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.9.tgz#646390b4fab269abce59c308fc286dcd818a2b08" @@ -1279,53 +1039,16 @@ dependencies: undici-types "~7.16.0" -"@types/pg-pool@2.0.6": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/pg-pool/-/pg-pool-2.0.6.tgz#1376d9dc5aec4bb2ec67ce28d7e9858227403c77" - integrity sha512-TaAUE5rq2VQYxab5Ts7WZhKNmuN78Q6PiFonTDdpbx8a1H0M1vhy3rhiMjl+e2iHmogyMw7jZF4FrE6eJUy5HQ== - dependencies: - "@types/pg" "*" - -"@types/pg@*": - version "8.11.10" - resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.11.10.tgz#b8fb2b2b759d452fe3ec182beadd382563b63291" - integrity sha512-LczQUW4dbOQzsH2RQ5qoeJ6qJPdrcM/DcMLoqWQkMLMsq83J5lAX3LXjdkWdpscFy67JSOWDnh7Ny/sPFykmkg== - dependencies: - "@types/node" "*" - pg-protocol "*" - pg-types "^4.0.1" - -"@types/pg@8.6.1": - version "8.6.1" - resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.6.1.tgz#099450b8dc977e8197a44f5229cedef95c8747f9" - integrity sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w== - dependencies: - "@types/node" "*" - pg-protocol "*" - pg-types "^2.2.0" - "@types/semver@^7.3.12", "@types/semver@^7.5.0": version "7.5.4" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.4.tgz#0a41252ad431c473158b22f9bfb9a63df7541cff" integrity sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ== -"@types/shimmer@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@types/shimmer/-/shimmer-1.2.0.tgz#9b706af96fa06416828842397a70dfbbf1c14ded" - integrity sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg== - "@types/stack-utils@^2.0.0": version "2.0.2" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.2.tgz#01284dde9ef4e6d8cef6422798d9a3ad18a66f8b" integrity sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw== -"@types/tedious@^4.0.14": - version "4.0.14" - resolved "https://registry.yarnpkg.com/@types/tedious/-/tedious-4.0.14.tgz#868118e7a67808258c05158e9cad89ca58a2aec1" - integrity sha512-KHPsfX/FoVbUGbyYvk1q9MMQHLPeRZhRJZdO45Q4YjvFkv4hMNghCWTvy7rdKessBsmtz4euWCWAB6/tVpI1Iw== - dependencies: - "@types/node" "*" - "@types/yargs-parser@*": version "21.0.2" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.2.tgz#7bd04c5da378496ef1695a1008bf8f71847a8b8b" @@ -1481,21 +1204,11 @@ resolved "https://registry.yarnpkg.com/@vercel/ncc/-/ncc-0.38.1.tgz#13f08738111e1d9e8a22fd6141f3590e54d9a60e" integrity sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw== -acorn-import-attributes@^1.9.5: - version "1.9.5" - resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" - integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.8.2: - version "8.14.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" - integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== - acorn@^8.9.0: version "8.11.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" @@ -1649,6 +1362,11 @@ ast-types-flow@^0.0.7: resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag== +astring@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/astring/-/astring-1.9.0.tgz#cc73e6062a7eb03e7d19c22d8b0b3451fd9bfeef" + integrity sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg== + available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -1876,10 +1594,10 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== -cjs-module-lexer@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz#707413784dbb3a72aa11c2f2b042a0bef4004170" - integrity sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA== +cjs-module-lexer@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-2.2.1.tgz#ab35b03c56ade05fe170c70e67ae89f60666847c" + integrity sha512-Ca8swihM+/4yKecYHY52kgJd300hi2lADU/a1RxNTRe+RJ9jvqQlESpbz9DnG9mowez8qwXHB8qYdIUw9e+F5Q== cliui@^8.0.1: version "8.0.1" @@ -1982,7 +1700,7 @@ debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: dependencies: ms "2.1.2" -debug@^4.3.1: +debug@^4.3.1, debug@^4.4.1: version "4.4.3" resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== @@ -2158,6 +1876,11 @@ es-abstract@^1.22.1: unbox-primitive "^1.0.2" which-typed-array "^1.1.13" +es-module-lexer@^2.1.0, es-module-lexer@^2.2.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-2.3.2.tgz#311fa4f40168c1975c505477c51b23234d41ad55" + integrity sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw== + es-set-tostringtag@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz#11f7cc9f63376930a5f20be4915834f4bc74f9c9" @@ -2438,6 +2161,13 @@ esquery@^1.4.2: dependencies: estraverse "^5.1.0" +esquery@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.7.0.tgz#08d048f261f0ddedb5bae95f46809463d9c9496d" + integrity sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g== + dependencies: + estraverse "^5.1.0" + esrecurse@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" @@ -2602,11 +2332,6 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" -forwarded-parse@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/forwarded-parse/-/forwarded-parse-2.1.2.tgz#08511eddaaa2ddfd56ba11138eee7df117a09325" - integrity sha512-alTFZZQDKMporBH77856pXgzhEzaUVmLCDk+egLgIgHst3Tpndzz8MnKe+GzRJRfvVdn69HhpW7cmXzvtLvJAw== - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2795,13 +2520,6 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" -hasown@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" - integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== - dependencies: - function-bind "^1.1.2" - html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -2838,15 +2556,14 @@ import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-in-the-middle@^1.11.2, import-in-the-middle@^1.8.1: - version "1.12.0" - resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.12.0.tgz#80d6536a01d0708a6f119f30d22447d4eb9e5c63" - integrity sha512-yAgSE7GmtRcu4ZUSFX/4v69UGXwugFFSdIQJ14LHPOPPQrWv8Y7O9PHsw8Ovk7bKCLe4sjXMbZFqGFcLHpZ89w== +import-in-the-middle@^3.0.0: + version "3.3.3" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-3.3.3.tgz#71420ed5eac24a358695bffacd7435b486c76d61" + integrity sha512-AiohS3H80sXO6owEltjGX+glb7qXaDhBoJb9XcQVH4UI207xu/bDLUcadVKp7Qe576reg9yr/PXZjV5qx8gfbA== dependencies: - acorn "^8.8.2" - acorn-import-attributes "^1.9.5" - cjs-module-lexer "^1.2.2" - module-details-from-path "^1.0.3" + cjs-module-lexer "^2.2.0" + es-module-lexer "^2.2.0" + module-details-from-path "^1.0.4" import-local@^3.0.2: version "3.1.0" @@ -2924,13 +2641,6 @@ is-core-module@^2.13.0, is-core-module@^2.13.1: dependencies: hasown "^2.0.0" -is-core-module@^2.16.0: - version "2.16.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" - integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== - dependencies: - hasown "^2.0.2" - is-date-object@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" @@ -3652,6 +3362,13 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +magic-string@^0.30.21: + version "0.30.21" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.21.tgz#56763ec09a0fa8091df27879fd94d19078c00d91" + integrity sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.5" + make-dir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" @@ -3681,6 +3398,11 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== +meriyah@^6.1.4: + version "6.1.4" + resolved "https://registry.yarnpkg.com/meriyah/-/meriyah-6.1.4.tgz#2d49a8934fbcd9205c20564579c3560d9b1e077b" + integrity sha512-Sz8FzjzI0kN13GK/6MVEsVzMZEPvOhnmmI1lU5+/1cGOiK3QUahntrNNtdVeihrO7t9JpoH75iMNXg6R6uWflQ== + micromatch@^4.0.4: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" @@ -3716,6 +3438,11 @@ module-details-from-path@^1.0.3: resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b" integrity sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A== +module-details-from-path@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.4.tgz#b662fdcd93f6c83d3f25289da0ce81c8d9685b94" + integrity sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w== + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -3829,11 +3556,6 @@ object.values@^1.1.6, object.values@^1.1.7: define-properties "^1.2.0" es-abstract "^1.22.1" -obuf@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" - integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== - once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -3957,45 +3679,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pg-int8@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" - integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== - -pg-numeric@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pg-numeric/-/pg-numeric-1.0.2.tgz#816d9a44026086ae8ae74839acd6a09b0636aa3a" - integrity sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw== - -pg-protocol@*: - version "1.7.0" - resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.7.0.tgz#ec037c87c20515372692edac8b63cf4405448a93" - integrity sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ== - -pg-types@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" - integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA== - dependencies: - pg-int8 "1.0.1" - postgres-array "~2.0.0" - postgres-bytea "~1.0.0" - postgres-date "~1.0.4" - postgres-interval "^1.1.0" - -pg-types@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-4.0.2.tgz#399209a57c326f162461faa870145bb0f918b76d" - integrity sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng== - dependencies: - pg-int8 "1.0.1" - pg-numeric "1.0.2" - postgres-array "~3.0.1" - postgres-bytea "~3.0.0" - postgres-date "~2.1.0" - postgres-interval "^3.0.0" - postgres-range "^1.1.1" - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -4023,55 +3706,6 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -postgres-array@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" - integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== - -postgres-array@~3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-3.0.2.tgz#68d6182cb0f7f152a7e60dc6a6889ed74b0a5f98" - integrity sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog== - -postgres-bytea@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" - integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w== - -postgres-bytea@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-3.0.0.tgz#9048dc461ac7ba70a6a42d109221619ecd1cb089" - integrity sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw== - dependencies: - obuf "~1.1.2" - -postgres-date@~1.0.4: - version "1.0.7" - resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8" - integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q== - -postgres-date@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-2.1.0.tgz#b85d3c1fb6fb3c6c8db1e9942a13a3bf625189d0" - integrity sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA== - -postgres-interval@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" - integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ== - dependencies: - xtend "^4.0.0" - -postgres-interval@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-3.0.0.tgz#baf7a8b3ebab19b7f38f07566c7aab0962f0c86a" - integrity sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw== - -postgres-range@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/postgres-range/-/postgres-range-1.1.4.tgz#a59c5f9520909bcec5e63e8cf913a92e4c952863" - integrity sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w== - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -4155,14 +3789,13 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== -require-in-the-middle@^7.1.1: - version "7.4.0" - resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-7.4.0.tgz#606977820d4b5f9be75e5a108ce34cfed25b3bb4" - integrity sha512-X34iHADNbNDfr6OTStIAHWSAvvKQRYgLO6duASaVf7J2VA3lvmNYboAHOuLC2huav1IwgZJtyEcJCKVzFxOSMQ== +require-in-the-middle@^8.0.0: + version "8.0.1" + resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-8.0.1.tgz#dbde2587f669398626d56b20c868ab87bf01cce4" + integrity sha512-QT7FVMXfWOYFbeRBF6nu+I6tr2Tf3u0q8RIEjNob/heKY/nh7drD/k7eeMFmSQgnTtCzLDcCu/XEnpW2wk4xCQ== dependencies: debug "^4.3.5" module-details-from-path "^1.0.3" - resolve "^1.22.8" resolve-cwd@^3.0.0: version "3.0.0" @@ -4195,15 +3828,6 @@ resolve@^1.20.0, resolve@^1.22.4: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -resolve@^1.22.8: - version "1.22.10" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" - integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== - dependencies: - is-core-module "^2.16.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -4249,6 +3873,11 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" +semifies@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semifies/-/semifies-1.0.0.tgz#b69569f32c2ba2ac04f705ea82831364289b2ae2" + integrity sha512-xXR3KGeoxTNWPD4aBvL5NUpMTT7WMANr3EWnaS190QVkY52lqqcVRD7Q05UVbBhiWDGWMlJEUam9m7uFFGVScw== + semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" @@ -4261,11 +3890,6 @@ semver@^7.3.7, semver@^7.5.3, semver@^7.5.4: dependencies: lru-cache "^6.0.0" -semver@^7.5.2: - version "7.6.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" - integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== - set-function-length@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.1.1.tgz#4bc39fafb0307224a33e106a7d35ca1218d659ed" @@ -4297,11 +3921,6 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shimmer@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" - integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== - side-channel@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" @@ -4757,11 +4376,6 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -xtend@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"